pub struct BuiltinLibrary { /* private fields */ }Expand description
Resolves runtime helper names to the symbols the emitted code must reference.
Overrides name the C symbol. Platform decoration (the Mach-O leading underscore) is applied on top, the same way it is for every other C symbol.
Implementations§
Source§impl BuiltinLibrary
impl BuiltinLibrary
pub fn new( target_os: TargetOperatingSystem, overrides: HashMap<RuntimeSymbol, String>, ) -> Self
Sourcepub fn from_env(
target_os: TargetOperatingSystem,
) -> Result<Self, BuiltinOverrideError>
pub fn from_env( target_os: TargetOperatingSystem, ) -> Result<Self, BuiltinOverrideError>
The library LAMINA_BUILTINS describes, or why that value could not be read.
Sourcepub fn from_env_or_unset(target_os: TargetOperatingSystem) -> Self
pub fn from_env_or_unset(target_os: TargetOperatingSystem) -> Self
Self::from_env for callers with nowhere to put the error.
A LAMINA_BUILTINS the compiler cannot read is refused by the codegen entry
point before any backend runs, so reaching this with an unreadable value means
the caller skipped that entry point; it then behaves as if nothing was set.
pub fn has_overrides(&self) -> bool
Sourcepub fn c_name(&self, symbol: RuntimeSymbol) -> &str
pub fn c_name(&self, symbol: RuntimeSymbol) -> &str
The undecorated C name for a symbol. MIR call sites carry this name and the backend’s function mangling adds any platform prefix.
Sourcepub fn symbol(&self, symbol: RuntimeSymbol) -> String
pub fn symbol(&self, symbol: RuntimeSymbol) -> String
The final symbol to reference from directly emitted code.