Thorin 1.9.0
The Higher ORder INtermediate representation
Loading...
Searching...
No Matches
thorin::Emitter< Value, Type, BB, Child > Class Template Reference

#include <thorin/be/emitter.h>

Inheritance diagram for thorin::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 thorin::ScopePhase
const Scopescope () const
 

Protected Attributes

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

Additional Inherited Members

- Public Member Functions inherited from thorin::ScopePhase
 ScopePhase (World &world, std::string_view name, bool elide_empty)
 
void start () override
 Actual entry.
 
- Public Member Functions inherited from thorin::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 thorin::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 thorin::Emitter< Value, Type, BB, Child >

Definition at line 10 of file emitter.h.

Constructor & Destructor Documentation

◆ Emitter()

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

Definition at line 26 of file emitter.h.

Member Function Documentation

◆ emit()

template<class Value , class Type , class BB , class Child >
Value thorin::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 35 of file emitter.h.

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

◆ emit_unsafe()

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

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

Definition at line 42 of file emitter.h.

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

Referenced by thorin::Emitter< Value, Type, BB, Child >::emit().

◆ ostream()

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

Definition at line 30 of file emitter.h.

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

◆ visit()

Member Data Documentation

◆ entry_

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

Definition at line 91 of file emitter.h.

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

◆ globals_

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

Definition at line 88 of file emitter.h.

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

◆ lam2bb_

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

Definition at line 90 of file emitter.h.

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

◆ locals_

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

◆ ostream_

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

Definition at line 85 of file emitter.h.

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

◆ scheduler_

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

Definition at line 86 of file emitter.h.

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

◆ tab

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

Definition at line 23 of file emitter.h.

◆ types_

template<class Value , class Type , class BB , class Child >
DefMap<Type> thorin::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: