sun::codegen::functions::FunctionRegistry
class · Source (opens in a new tab)
class sun::codegen::functions::FunctionRegistryMap resolved declarations to LLVM functions and track their origins.
Public Functions
- FunctionRegistry
- isPrecompiled
- lookupFunctionById
- noteUserDefined
- operator=
- registerFunction
- snapshotPrecompiled
- userDefined
FunctionRegistry
FunctionRegistry(const FunctionRegistry &)=delete
public · function · Source (opens in a new tab)
sun::codegen::functions::FunctionRegistry::FunctionRegistry(const FunctionRegistry &)=deleteDisallows copying so the owned state cannot be duplicated.
FunctionRegistry(sun::codegen::CodegenState &state)
public · function · Source (opens in a new tab)
sun::codegen::functions::FunctionRegistry::FunctionRegistry(sun::codegen::CodegenState &state)Share the module and declaration table used by this codegen run.
Related: sun::codegen::CodegenState
isPrecompiled
public · function · Source (opens in a new tab)
bool sun::codegen::functions::FunctionRegistry::isPrecompiled(const std::string &name) constTrue if the function was declared from precompiled bitcode rather than by codegen itself.
lookupFunctionById
public · function · Source (opens in a new tab)
Function * sun::codegen::functions::FunctionRegistry::lookupFunctionById(DeclarationId declaration)Find the emitted function selected by semantic declaration resolution.
Related: DeclarationId
noteUserDefined
public · function · Source (opens in a new tab)
void sun::codegen::functions::FunctionRegistry::noteUserDefined(const std::string &name)Note a function as user-written, so an IR dump includes it.
operator=
public · function · Source (opens in a new tab)
FunctionRegistry & sun::codegen::functions::FunctionRegistry::operator=(const FunctionRegistry &)=deleteDisallows assignment so ownership and object identity cannot be duplicated.
Related: FunctionRegistry
registerFunction
public · function · Source (opens in a new tab)
void sun::codegen::functions::FunctionRegistry::registerFunction(DeclarationId declaration, llvm::Function *function)Bind a source declaration to its created or imported LLVM function.
Related: DeclarationId
snapshotPrecompiled
public · function · Source (opens in a new tab)
void sun::codegen::functions::FunctionRegistry::snapshotPrecompiled(llvm::Module &module)Snapshot the module's current declarations.
Call after the precompiled bitcode has been declared but before codegen starts.
userDefined
public · function · Source (opens in a new tab)
const std::set< std::string > & sun::codegen::functions::FunctionRegistry::userDefined() constThe user-written function names, for filtering an IR dump.
Private Fields
functionsById_
private · variable · Source (opens in a new tab)
std::unordered_map<DeclarationId, llvm::WeakTrackingVH> sun::codegen::functions::FunctionRegistry::functionsById_No documentation comment.
Related: DeclarationId
precompiled_
private · variable · Source (opens in a new tab)
std::set<std::string> sun::codegen::functions::FunctionRegistry::precompiled_No documentation comment.
state_
private · variable · Source (opens in a new tab)
sun::codegen::CodegenState& sun::codegen::functions::FunctionRegistry::state_No documentation comment.
Related: sun::codegen::CodegenState
userDefined_
private · variable · Source (opens in a new tab)
std::set<std::string> sun::codegen::functions::FunctionRegistry::userDefined_No documentation comment.