MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
mim::Emitter< Value, Type, BB, Child > Class Template Reference

#include <mim/be/emitter.h>

Inheritance diagram for mim::Emitter< Value, Type, BB, Child >:
[legend]

Public Attributes

Tab tab
 

Protected Member Functions

 Emitter (World &world, std::string name, std::ostream &ostream)
 
std::ostream & ostream () const
 
Value emit (const Def *def)
 Recursively emits code.
 
Value emit_unsafe (const Def *def)
 As above but returning !child().is_valid(value) is permitted.
 
void visit (const Nest &nest) override
 
- Protected Member Functions inherited from mim::ClosedMutPhase< Lam >
Lamroot () const
 

Protected Attributes

Lamcurr_lam_ = nullptr
 
std::ostream & ostream_
 
Scheduler scheduler_
 
DefMap< Value > locals_
 
DefMap< Value > globals_
 
DefMap< Typetypes_
 
LamMap< BB > lam2bb_
 
- 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.
 

Additional Inherited Members

- Public Member Functions inherited from mim::NestPhase< Lam >
 NestPhase (World &world, std::string name, bool elide_empty)
 
const Nestnest () const
 
- Public Member Functions inherited from mim::ClosedMutPhase< Lam >
 ClosedMutPhase (World &world, std::string name, bool elide_empty)
 
bool elide_empty () const
 
void start () override
 Actual entry.
 
- 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.
 
template<class P, class... Args>
static void run (Args &&... args)
 Runs a single Phase.
 

Detailed Description

template<class Value, class Type, class BB, class Child>
class mim::Emitter< Value, Type, BB, Child >

Definition at line 11 of file emitter.h.

Constructor & Destructor Documentation

◆ Emitter()

template<class Value, class Type, class BB, class Child>
mim::Emitter< Value, Type, BB, Child >::Emitter ( World & world,
std::string name,
std::ostream & ostream )
inlineprotected

Definition at line 27 of file emitter.h.

Member Function Documentation

◆ emit()

template<class Value, class Type, class BB, class Child>
Value mim::Emitter< Value, Type, BB, Child >::emit ( const Def * def)
inlineprotected

Recursively emits code.

mem-typed defs return sth that is !child().is_valid(value). This variant asserts in this case.

Definition at line 36 of file emitter.h.

◆ emit_unsafe()

template<class Value, class Type, class BB, class Child>
Value mim::Emitter< Value, Type, BB, Child >::emit_unsafe ( const Def * def)
inlineprotected

As above but returning !child().is_valid(value) is permitted.

Definition at line 43 of file emitter.h.

Referenced by mim::Emitter< std::string, std::string, BB, Emitter >::emit().

◆ ostream()

template<class Value, class Type, class BB, class Child>
std::ostream & mim::Emitter< Value, Type, BB, Child >::ostream ( ) const
inlineprotected

Definition at line 31 of file emitter.h.

◆ visit()

template<class Value, class Type, class BB, class Child>
void mim::Emitter< Value, Type, BB, Child >::visit ( const Nest & nest)
inlineoverrideprotectedvirtual

Implements mim::NestPhase< Lam >.

Definition at line 51 of file emitter.h.

Member Data Documentation

◆ curr_lam_

template<class Value, class Type, class BB, class Child>
Lam* mim::Emitter< Value, Type, BB, Child >::curr_lam_ = nullptr
protected

Definition at line 84 of file emitter.h.

◆ globals_

template<class Value, class Type, class BB, class Child>
DefMap<Value> mim::Emitter< Value, Type, BB, Child >::globals_
protected

Definition at line 88 of file emitter.h.

◆ lam2bb_

template<class Value, class Type, class BB, class Child>
LamMap<BB> mim::Emitter< Value, Type, BB, Child >::lam2bb_
protected

Definition at line 90 of file emitter.h.

◆ locals_

template<class Value, class Type, class BB, class Child>
DefMap<Value> mim::Emitter< Value, Type, BB, Child >::locals_
protected

Definition at line 87 of file emitter.h.

◆ ostream_

template<class Value, class Type, class BB, class Child>
std::ostream& mim::Emitter< Value, Type, BB, Child >::ostream_
protected

Definition at line 85 of file emitter.h.

◆ scheduler_

template<class Value, class Type, class BB, class Child>
Scheduler mim::Emitter< Value, Type, BB, Child >::scheduler_
protected

Definition at line 86 of file emitter.h.

◆ tab

template<class Value, class Type, class BB, class Child>
Tab mim::Emitter< Value, Type, BB, Child >::tab

Definition at line 24 of file emitter.h.

◆ types_

template<class Value, class Type, class BB, class Child>
DefMap<Type> mim::Emitter< Value, Type, BB, Child >::types_
protected

Definition at line 89 of file emitter.h.


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