MimIR 0.1
MimIR is my Intermediate Representation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages Concepts
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 ()
 
void finalize ()
 
template<class... Args>
void declare (const char *s, Args &&... args)
 
- Public Member Functions inherited from mim::NestPhase< Lam >
 NestPhase (World &world, std::string_view name, bool dirty, bool elide_empty)
 
const Nestnest () const
 
- Public Member Functions inherited from mim::ClosedMutPhase< Lam >
 ClosedMutPhase (World &world, std::string_view name, bool dirty, bool elide_empty)
 
- 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 Nest &nest) override
 
- Protected Member Functions inherited from mim::ClosedMutPhase< Lam >
Lamroot () const
 
- Protected Member Functions inherited from mim::Phase
void set_name (std::string name)
 
- Protected Attributes inherited from mim::Emitter< std::string, std::string, BB, Emitter >
Lamcurr_lam_
 
std::ostream & ostream_
 
Scheduler scheduler_
 
DefMap< std::string > locals_
 
DefMap< std::string > globals_
 
DefMap< std::string > types_
 
LamMap< BB > lam2bb_
 

Detailed Description

Definition at line 111 of file ll.cpp.

Member Typedef Documentation

◆ Super

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

Definition at line 113 of file ll.cpp.

Constructor & Destructor Documentation

◆ Emitter()

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

Definition at line 115 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 126 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 251 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 118 of file ll.cpp.

◆ prepare()

◆ start()

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

Actual entry.

Reimplemented from mim::ClosedMutPhase< Lam >.

Definition at line 241 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: