Thorin 1.9.0
The Higher ORder INtermediate representation
|
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 |
World & | world () |
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 Scope & | scope () 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_ |
Lam * | entry_ |
Protected Attributes inherited from thorin::Phase | |
World & | world_ |
std::string | name_ |
bool | dirty_ |
using thorin::ll::Emitter::Super = thorin::Emitter<std::string, std::string, BB, Emitter> |
|
inline |
|
inline |
Definition at line 131 of file ll.cpp.
References thorin::print().
Referenced by emit_bb(), and emit_epilogue().
Definition at line 458 of file ll.cpp.
References thorin::Lit::as(), thorin::ll::BB::assign(), thorin::Annex::Base, thorin::bitcast(), thorin::ll::BB::body(), declare(), thorin::Emitter< std::string, std::string, BB, Emitter >::emit(), thorin::Emitter< std::string, std::string, BB, Emitter >::emit_unsafe(), thorin::Emitter< std::string, std::string, BB, Emitter >::entry_, thorin::error(), thorin::Emitter< std::string, std::string, BB, Emitter >::globals_, thorin::Lit::isa(), thorin::plug::math::isa_f(), thorin::Emitter< std::string, std::string, BB, Emitter >::lam2bb_, thorin::Phase::name(), thorin::print(), thorin::Def::proj(), thorin::Def::projs(), thorin::Idx::size(), thorin::Idx::size2bitwidth(), thorin::ll::BB::tail(), and thorin::Def::type().
void thorin::ll::Emitter::emit_epilogue | ( | Lam * | lam | ) |
Definition at line 317 of file ll.cpp.
References thorin::Def::as_mut(), thorin::Lam::body(), declare(), thorin::Emitter< std::string, std::string, BB, Emitter >::emit(), thorin::Emitter< std::string, std::string, BB, Emitter >::emit_unsafe(), thorin::Emitter< std::string, std::string, BB, Emitter >::entry_, thorin::Pi::isa_basicblock(), thorin::Lam::isa_mut_basicblock(), thorin::Pi::isa_returning(), thorin::Emitter< std::string, std::string, BB, Emitter >::lam2bb_, thorin::Emitter< std::string, std::string, BB, Emitter >::locals_, thorin::Phase::name(), thorin::Def::num_tvars(), thorin::Def::num_vars(), thorin::print(), thorin::Lam::ret_var(), thorin::Def::unique_name(), thorin::Def::var(), and thorin::Phase::world().
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().
void thorin::ll::Emitter::finalize | ( | const Scope & | scope | ) |
Definition at line 288 of file ll.cpp.
References thorin::Scope::exit(), thorin::Emitter< std::string, std::string, BB, Emitter >::lam2bb_, thorin::print(), thorin::Tab::print(), thorin::Scheduler::schedule(), thorin::ScopePhase::scope(), and thorin::Emitter< std::string, std::string, BB, Emitter >::tab.
|
inline |
std::string thorin::ll::Emitter::prepare | ( | const Scope & | scope | ) |
Definition at line 270 of file ll.cpp.
References thorin::Def::as_mut(), thorin::Scope::entry(), thorin::Emitter< std::string, std::string, BB, Emitter >::locals_, thorin::Phase::name(), thorin::print(), and thorin::ScopePhase::scope().
void thorin::ll::Emitter::prepare | ( | Lam * | , |
std::string_view | |||
) |
|
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().