MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
mim::PhaseMan Class Reference

Organizes several Phases in a a pipeline. More...

#include <mim/phase.h>

Inheritance diagram for mim::PhaseMan:
[legend]

Public Member Functions

Construction
 PhaseMan (World &world, flags_t annex)
 
void apply (bool, Phases &&)
 
void apply (const App *) final
 Invoked if your Stage has additional args.
 
void apply (Stage &) final
 Dito, but invoked by Stage::recreate.
 
Getters
bool fixed_point () const
 
auto & phases ()
 
const auto & phases () const
 
- Public Member Functions inherited from mim::Phase
 Phase (World &world, std::string name)
 
 Phase (World &world, flags_t annex)
 
bool todo () const
 
virtual void run ()
 Entry point and generates some debug output; invokes Phase::start.
 
- Public Member Functions inherited from mim::Stage
Worldworld ()
 
Driverdriver ()
 
Loglog () const
 
std::string_view name () const
 
flags_t annex () const
 
 Stage (World &world, std::string name)
 
 Stage (World &world, flags_t annex)
 
virtual ~Stage ()=default
 
virtual std::unique_ptr< Stagerecreate ()
 Creates a new instance; needed by a fixed-point PhaseMan.
 

Private Member Functions

void start () final
 Actual entry.
 

Additional Inherited Members

template<class P, class... Args>
static void run (Args &&... args)
 Runs a single Phase.
 
static auto create (const Flags2Stages &stages, const Def *def)
 
template<class A, class P>
static void hook (Flags2Stages &stages)
 
- Protected Attributes inherited from mim::Phase
bool todo_ = false
 Set to true to indicate that you want to rerun all Phasees in current your fixed-point PhaseMan.
 
- Protected Attributes inherited from mim::Stage
std::string name_
 

Detailed Description

Organizes several Phases in a a pipeline.

If fixed_point is true, run PhaseMan until all Phases' Phase::todo_ flags yield false.

Definition at line 211 of file phase.h.

Constructor & Destructor Documentation

◆ PhaseMan()

mim::PhaseMan::PhaseMan ( World & world,
flags_t annex )
inline

Definition at line 215 of file phase.h.

References mim::Stage::annex(), mim::Phase::Phase(), and mim::Stage::world().

Referenced by apply().

Member Function Documentation

◆ apply() [1/3]

void mim::PhaseMan::apply ( bool fp,
Phases && phases )

Definition at line 108 of file phase.cpp.

References mim::Stage::name_, and phases().

Referenced by apply(), and apply().

◆ apply() [2/3]

void mim::PhaseMan::apply ( const App * )
finalvirtual

Invoked if your Stage has additional args.

Reimplemented from mim::Stage.

Definition at line 114 of file phase.cpp.

References apply(), mim::Lit::as(), mim::Stage::create(), mim::Stage::driver(), mim::Phase::Phase(), phases(), mim::ReplMan::repls(), and mim::App::uncurry_args().

◆ apply() [3/3]

void mim::PhaseMan::apply ( Stage & )
finalvirtual

Dito, but invoked by Stage::recreate.

Reimplemented from mim::Stage.

Definition at line 130 of file phase.cpp.

References apply(), and PhaseMan().

◆ fixed_point()

bool mim::PhaseMan::fixed_point ( ) const
inline

Definition at line 225 of file phase.h.

Referenced by start().

◆ phases() [1/2]

auto & mim::PhaseMan::phases ( )
inline

Definition at line 226 of file phase.h.

Referenced by apply(), apply(), and start().

◆ phases() [2/2]

const auto & mim::PhaseMan::phases ( ) const
inline

Definition at line 227 of file phase.h.

◆ start()

void mim::PhaseMan::start ( )
finalprivatevirtual

Actual entry.

Implements mim::Phase.

Definition at line 135 of file phase.cpp.

References fixed_point(), mim::Phase::Phase(), phases(), mim::Phase::todo(), mim::Phase::todo_, and VLOG.


The documentation for this class was generated from the following files: