MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
mim::ll::Emitter Class Reference
Inheritance diagram for mim::ll::Emitter:
[legend]

Public Types

using Super = mim::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 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.
 

Additional Inherited Members

- Static Public Member Functions inherited from mim::Phase
template<class P , class... Args>
static void run (Args &&... args)
 Runs a single Phase.
 
- Public Attributes inherited from mim::Emitter< std::string, std::string, BB, Emitter >
Tab tab
 
- Protected Member Functions inherited from mim::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 mim::ScopePhase
const Scopescope () const
 
- Protected Member Functions inherited from mim::Phase
- Protected Attributes inherited from mim::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 mim::Phase
Worldworld_
 
std::string name_
 
bool dirty_
 

Detailed Description

Definition at line 115 of file ll.cpp.

Member Typedef Documentation

◆ Super

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

Definition at line 117 of file ll.cpp.

Constructor & Destructor Documentation

◆ Emitter()

mim::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 mim::ll::Emitter::declare ( const char * s,
Args &&... args )
inline

Definition at line 131 of file ll.cpp.

References mim::print().

Referenced by emit_bb(), and emit_epilogue().

◆ emit_bb()

◆ emit_epilogue()

◆ emit_imported()

void mim::ll::Emitter::emit_imported ( Lam * lam)

Definition at line 256 of file ll.cpp.

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

◆ finalize()

◆ is_valid()

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

Definition at line 122 of file ll.cpp.

◆ prepare() [1/2]

◆ prepare() [2/2]

void mim::ll::Emitter::prepare ( Lam * ,
std::string_view  )

◆ start()

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

Actual entry.

Implements mim::Phase.

Definition at line 246 of file ll.cpp.

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


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