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

Organizes several Phases into 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 Phase has additional args.
void apply (Phase &) final
 Dito, but invoked by Phase::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)
virtual ~Phase ()=default
virtual std::unique_ptr< Phaserecreate ()
 Creates a new instance; needed by a fixed-point PhaseMan.
virtual bool redirects () const
 If true, Phase::create uses take_resolved().
virtual std::unique_ptr< Phasetake_resolved ()
 The Phase to use instead; nullptr means elide.
Worldworld ()
Driverdriver ()
Loglog () const
std::string_view name () const
flags_t annex () const
const Vector< std::string > & args ()
 Command-line arguments passed to this Phase's plugin via -X <plugin>:<arg>.
bool todo () const
void invalidate (bool todo=true)
 Signals that another round of fixed-point iteration is required, either as part of.
virtual void run ()
 Entry point and generates some debug output; invokes Phase::start.
void profile_count (std::string_view key, uint64_t n=1)
 Adds n to the custom Profiler counter key of the current run; no-op unless profiling is enabled.

Private Member Functions

void start () final
 Actual entry.

Additional Inherited Members

Static Public Member Functions inherited from mim::Phase
static std::unique_ptr< Phasecreate (const Flags2Phases &phases, const Def *def)
template<class A, class P>
static void hook (Flags2Phases &phases)
template<class P, class... Args>
static void run (Args &&... args)
 Runs a single Phase.
Protected Attributes inherited from mim::Phase
std::string name_

Detailed Description

Organizes several Phases into a pipeline.

If fixed_point() is true, rerun the whole pipeline until all Phase::todo()s flags remain false.

See also
PhaseMan

Definition at line 432 of file phase.h.

Constructor & Destructor Documentation

◆ PhaseMan()

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

Definition at line 436 of file phase.h.

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

Referenced by apply().

Member Function Documentation

◆ apply() [1/3]

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

Definition at line 169 of file phase.cpp.

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

Referenced by apply(), and apply().

◆ apply() [2/3]

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

Invoked if your Phase has additional args.

Reimplemented from mim::Phase.

Definition at line 175 of file phase.cpp.

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

◆ apply() [3/3]

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

Dito, but invoked by Phase::recreate.

Reimplemented from mim::Phase.

Definition at line 185 of file phase.cpp.

References apply(), mim::Phase::Phase(), and PhaseMan().

◆ fixed_point()

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

Definition at line 446 of file phase.h.

Referenced by start().

◆ phases() [1/2]

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

Definition at line 447 of file phase.h.

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

◆ phases() [2/2]

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

Definition at line 448 of file phase.h.

◆ start()

void mim::PhaseMan::start ( )
finalprivatevirtual

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