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/phase.h>

Inheritance diagram for mim::PhaseMan:
[legend]

Public Member Functions

 PhaseMan (World &, bool fixed_point=false)
 
bool fixed_point () const
 
void start () override
 Actual entry.
 
phases
const auto & phases () const
 
template<class P, class... Args>
auto add (Args &&... args)
 Add a Phase.
 
void add (std::unique_ptr< Phase > &&phase)
 
- Public Member Functions inherited from mim::Phase
 Phase (World &world, std::string name)
 
virtual ~Phase ()=default
 
virtual void reset ()
 
Worldworld ()
 
std::string_view name () const
 
bool todo () const
 
virtual void run ()
 Entry point and generates some debug output; invokes Phase::start.
 

Static Public Member Functions

template<class A, class P, class... Args>
static void hook (Flags2Phases &phases, Args &&... args)
 
template<class P, class... Args>
static void run (Args &&... args)
 Runs a single Phase.
 

Additional Inherited Members

- 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.
 

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 160 of file phase.h.

Constructor & Destructor Documentation

◆ PhaseMan()

mim::PhaseMan::PhaseMan ( World & world,
bool fixed_point = false )

Definition at line 36 of file phase.cpp.

References fixed_point(), mim::Phase::Phase(), and mim::Phase::world().

Referenced by hook().

Member Function Documentation

◆ add() [1/2]

template<class P, class... Args>
auto mim::PhaseMan::add ( Args &&... args)
inline

Add a Phase.

You don't need to pass the World to args - it will be passed automatically. If P is a Pass, this method will wrap this in a PassPhase.

Definition at line 175 of file phase.h.

References add(), and mim::Phase::world().

Referenced by add(), hook(), and reg_stages().

◆ add() [2/2]

void mim::PhaseMan::add ( std::unique_ptr< Phase > && phase)
inline

Definition at line 186 of file phase.h.

◆ fixed_point()

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

Definition at line 164 of file phase.h.

Referenced by PhaseMan(), and start().

◆ hook()

template<class A, class P, class... Args>
static void mim::PhaseMan::hook ( Flags2Phases & phases,
Args &&... args )
inlinestatic

Definition at line 190 of file phase.h.

References add(), mim::assert_emplace(), mim::Annex::Base, PhaseMan(), and phases().

Referenced by reg_stages().

◆ phases()

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

Definition at line 169 of file phase.h.

Referenced by hook(), and start().

◆ start()

void mim::PhaseMan::start ( )
overridevirtual

Actual entry.

Implements mim::Phase.

Definition at line 40 of file phase.cpp.

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


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