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_view 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 Scope &scope) override
 
- Protected Member Functions inherited from mim::ScopePhase
const Scopescope () const
 
- Protected Member Functions inherited from mim::Phase

Protected Attributes

std::ostream & ostream_
 
Scheduler scheduler_
 
DefMap< Value > locals_
 
DefMap< Value > globals_
 
DefMap< Typetypes_
 
LamMap< BB > lam2bb_
 
Lamentry_ = nullptr
 
- Protected Attributes inherited from mim::Phase
Worldworld_
 
std::string name_
 
bool dirty_
 

Additional Inherited Members

- Public Member Functions inherited from mim::ScopePhase
 ScopePhase (World &world, std::string_view name, bool elide_empty)
 
void start () override
 Actual entry.
 
- Public Member Functions inherited from mim::Phase
 Phase (World &world, std::string_view name, bool dirty)
 
virtual ~Phase ()=default
 
Worldworld ()
 
std::string_view name () const
 
bool is_dirty () const
 
virtual void run ()
 Entry point and generates some debug output; invokes Phase::start.
 
- Static Public Member Functions inherited from mim::Phase
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 9 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_view name,
std::ostream & ostream )
inlineprotected

Definition at line 25 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 34 of file emitter.h.

References mim::Emitter< Value, Type, BB, Child >::emit_unsafe().

◆ 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 41 of file emitter.h.

References mim::Emitter< Value, Type, BB, Child >::globals_, and mim::Emitter< Value, Type, BB, Child >::locals_.

Referenced by mim::Emitter< Value, Type, BB, Child >::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 29 of file emitter.h.

References mim::Emitter< Value, Type, BB, Child >::ostream_.

◆ visit()

Member Data Documentation

◆ entry_

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

Definition at line 90 of file emitter.h.

Referenced by mim::Emitter< Value, Type, BB, Child >::visit().

◆ globals_

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

Definition at line 87 of file emitter.h.

Referenced by mim::Emitter< Value, Type, BB, Child >::emit_unsafe().

◆ lam2bb_

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

Definition at line 89 of file emitter.h.

Referenced by mim::Emitter< Value, Type, BB, Child >::visit().

◆ locals_

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

◆ ostream_

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

Definition at line 84 of file emitter.h.

Referenced by mim::Emitter< Value, Type, BB, Child >::ostream().

◆ scheduler_

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

Definition at line 85 of file emitter.h.

Referenced by mim::Emitter< Value, Type, BB, Child >::visit().

◆ tab

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

Definition at line 22 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 88 of file emitter.h.


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