sun::codegen::functions::FunctionRegistry

sun::codegen::functions::FunctionRegistry

class · Source (opens in a new tab)

class sun::codegen::functions::FunctionRegistry

Map resolved declarations to LLVM functions and track their origins.

Public Functions

FunctionRegistry

FunctionRegistry(const FunctionRegistry &)=delete

public · function · Source (opens in a new tab)

sun::codegen::functions::FunctionRegistry::FunctionRegistry(const FunctionRegistry &)=delete

Disallows 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) const

True 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 &)=delete

Disallows 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() const

The 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.