![]() |
Spicy
|
#include <codegen.h>
Public Member Functions | |
CodeGen (std::shared_ptr< Context > context) | |
Result< cxx::Unit > | compileModule (Node &root, hilti::Unit *hilti_unit, bool include_implementation) |
Result< cxx::Unit > | linkUnits (const std::vector< cxx::linker::MetaData > &mds) |
std::shared_ptr< Context > | context () const |
const Options & | options () const |
std::optional< cxx::declaration::Type > | typeDeclaration (const hilti::Type &t) |
std::list< cxx::declaration::Type > | typeDependencies (const hilti::Type &t) |
cxx::Type | compile (const hilti::Type &t, codegen::TypeUsage usage) |
cxx::Expression | compile (const hilti::Expression &e, bool lhs=false) |
cxx::Expression | compile (const hilti::Ctor &c) |
cxx::Expression | compile (const hilti::expression::ResolvedOperator &o, bool lhs=false) |
cxx::Block | compile (const hilti::Statement &s, cxx::Block *b=nullptr) |
cxx::declaration::Function | compile (const ID &id, type::Function ft, declaration::Linkage linkage, function::CallingConvention cc=function::CallingConvention::Standard, const std::optional< AttributeSet > &fattrs={}, std::optional< cxx::ID > namespace_={}) |
std::vector< cxx::Expression > | compileCallArguments (const hilti::node::Range< Expression > &args, const hilti::node::Set< declaration::Parameter > ¶ms) |
std::vector< cxx::Expression > | compileCallArguments (const hilti::node::Range< Expression > &args, const hilti::node::Range< declaration::Parameter > ¶ms) |
std::optional< cxx::Expression > | typeDefaultValue (const hilti::Type &t) |
codegen::TypeUsage | parameterKindToTypeUsage (declaration::parameter::Kind) |
cxx::Expression | typeInfo (const hilti::Type &t) |
void | addTypeInfoDefinition (const hilti::Type &t) |
cxx::Expression | coerce (const cxx::Expression &e, const Type &src, const Type &dst) |
cxx::Expression | unpack (const hilti::Type &t, const Expression &data, const std::vector< Expression > &args) |
cxx::Expression | unpack (const hilti::Type &t, const cxx::Expression &data, const std::vector< cxx::Expression > &args) |
void | addDeclarationFor (const hilti::Type &t) |
cxx::Expression | addTmp (const std::string &prefix, const cxx::Type &t) |
cxx::Expression | addTmp (const std::string &prefix, const cxx::Expression &init) |
cxx::ID | uniqueID (const std::string &prefix, const Node &n) |
cxx::Expression | self () const |
cxx::Expression | dollardollar () const |
void | pushSelf (detail::cxx::Expression e) |
void | popSelf () |
auto | cxxBlock () const |
void | pushCxxBlock (cxx::Block *b) |
void | popCxxBlock () |
void | enablePrioritizeTypes () |
void | disablePrioritizeTypes () |
bool | prioritizeTypes () const |
cxx::Unit * | unit () const |
hilti::Unit * | hiltiUnit () const |
HILTI's code generator. This is the main internal entry point for generating C++ code from HILTI source code.
Result< cxx::Unit > CodeGen::compileModule | ( | Node & | root, |
hilti::Unit * | hilti_unit, | ||
bool | include_implementation | ||
) |
Entry point for code generation.
Result< cxx::Unit > CodeGen::linkUnits | ( | const std::vector< cxx::linker::MetaData > & | mds | ) |
Entry point for generating additional cross-unit C++ code through HILTI's linker.