Thorin 1.9.0
The Higher ORder INtermediate representation
Loading...
Searching...
No Matches
thorin::ll::Emitter Class Reference
Inheritance diagram for thorin::ll::Emitter:
[legend]

Public Types

using Super = thorin::Emitter< std::string, std::string, BB, Emitter >
 

Public Member Functions

 Emitter (World &world, std::ostream &ostream)
 
bool is_valid (std::string_view s)
 
void start () override
 Actual entry.
 
void emit_imported (Lam *)
 
void emit_epilogue (Lam *)
 
std::string emit_bb (BB &, const Def *)
 
std::string prepare (const Scope &)
 
void prepare (Lam *, std::string_view)
 
void finalize (const Scope &)
 
template<class... Args>
void declare (const char *s, Args &&... args)
 
- 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.
 

Additional Inherited Members

- Static Public Member Functions inherited from thorin::Phase
template<class P , class... Args>
static void run (Args &&... args)
 Runs a single Phase.
 
- Public Attributes inherited from thorin::Emitter< std::string, std::string, BB, Emitter >
Tab tab
 
- Protected Member Functions inherited from thorin::Emitter< std::string, std::string, BB, Emitter >
 Emitter (World &world, std::string_view name, std::ostream &ostream)
 
std::ostream & ostream () const
 
std::string emit (const Def *def)
 Recursively emits code.
 
std::string 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 inherited from thorin::Emitter< std::string, std::string, BB, Emitter >
std::ostream & ostream_
 
Scheduler scheduler_
 
DefMap< std::string > locals_
 
DefMap< std::string > globals_
 
DefMap< std::string > types_
 
LamMap< BB > lam2bb_
 
Lamentry_
 
- Protected Attributes inherited from thorin::Phase
Worldworld_
 
std::string name_
 
bool dirty_
 

Detailed Description

Definition at line 115 of file ll.cpp.

Member Typedef Documentation

◆ Super

using thorin::ll::Emitter::Super = thorin::Emitter<std::string, std::string, BB, Emitter>

Definition at line 117 of file ll.cpp.

Constructor & Destructor Documentation

◆ Emitter()

thorin::ll::Emitter::Emitter ( World world,
std::ostream &  ostream 
)
inline

Definition at line 119 of file ll.cpp.

Member Function Documentation

◆ declare()

template<class... Args>
void thorin::ll::Emitter::declare ( const char *  s,
Args &&...  args 
)
inline

Definition at line 131 of file ll.cpp.

References thorin::print().

Referenced by emit_bb(), and emit_epilogue().

◆ emit_bb()

◆ emit_epilogue()

◆ emit_imported()

void thorin::ll::Emitter::emit_imported ( Lam lam)

Definition at line 256 of file ll.cpp.

References thorin::print(), thorin::Pi::ret_pi(), and thorin::Lam::type().

◆ finalize()

◆ is_valid()

bool thorin::ll::Emitter::is_valid ( std::string_view  s)
inline

Definition at line 122 of file ll.cpp.

◆ prepare() [1/2]

◆ prepare() [2/2]

void thorin::ll::Emitter::prepare ( Lam ,
std::string_view   
)

◆ start()

void thorin::ll::Emitter::start ( )
overridevirtual

Actual entry.

Implements thorin::Phase.

Definition at line 246 of file ll.cpp.

References thorin::Emitter< std::string, std::string, BB, Emitter >::ostream(), and thorin::Phase::start().


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