Backend API Reference
Generated from the /// XML doc comments in src/Ashes.Backend/. See the Compilation Pipeline for how this project fits into the compiler. This page is regenerated by tools/docs-api-gen on every docs build — edit the doc comments in the source, not this file.
Types
| Type | Kind | Summary | Source |
|---|---|---|---|
BackendCompileOptions | record | The knobs passed to Compile controlling the LLVM pipeline, debug-info emission, target CPU tuning, and the parallel worker runtime limits baked into the emitted executable. | source |
BackendFactory | class | Resolves an IBackend for a given target RID and reports the default target for the running operating system and architecture. | source |
BackendOptimizationLevel | enum | The LLVM optimization pipeline the backend runs, mirroring clang's -O levels. | source |
IBackend | interface | A native code generator for one target platform. | source |
LinuxArm64LlvmBackend | class | The IBackend that emits 64-bit ARM Linux ELF executables via LLVM. | source |
LinuxX64LlvmBackend | class | The IBackend that emits 64-bit x86 Linux ELF executables via LLVM. | source |
LlvmAttributeHandle | record struct | source | |
LlvmBasicBlockHandle | record struct | source | |
LlvmBuilderHandle | record struct | source | |
LlvmCodeGenFileType | enum | source | |
LlvmCodeGenOptLevel | enum | source | |
LlvmCodeModel | enum | source | |
LlvmContextHandle | record struct | source | |
LlvmDIBuilderHandle | record struct | source | |
LlvmIntPredicate | enum | source | |
LlvmLinkage | enum | source | |
LlvmMetadataHandle | record struct | source | |
LlvmModuleHandle | record struct | source | |
LlvmPassBuilderOptionsHandle | record struct | source | |
LlvmRealPredicate | enum | source | |
LlvmRelocMode | enum | source | |
LlvmTargetDataHandle | record struct | source | |
LlvmTargetHandle | record struct | source | |
LlvmTargetMachineHandle | record struct | source | |
LlvmTypeHandle | record struct | source | |
LlvmTypeKind | enum | source | |
LlvmValueHandle | record struct | source | |
LlvmVerifierFailureAction | enum | source | |
TargetIds | class | The canonical runtime-identifier strings for the four supported targets, each of which is both a compile target and a host RID on which a released compiler runs. | source |
WindowsArm64LlvmBackend | class | The IBackend that emits 64-bit ARM Windows PE executables via LLVM. | source |
WindowsX64LlvmBackend | class | The IBackend that emits 64-bit x86 Windows PE executables via LLVM. | source |
IBackend
A native code generator for one target platform. Each implementation binds a specific target RID (see TargetIds) to the LLVM pipeline, turning a lowered IrProgram into a standalone executable image. Resolve one through Create.
| Member | Signature | Summary |
|---|---|---|
Compile | byte[] Compile(IrProgram program, BackendCompileOptions? options = null) | Compiles program to a native executable image (ELF on Linux, PE on Windows) for TargetId, returning the linked bytes. When options is null, Default applies. |
TargetId | string TargetId | The target RID this backend emits for, e.g. linux-x64 or win-arm64. |
BackendFactory
Resolves an IBackend for a given target RID and reports the default target for the running operating system and architecture.
| Member | Signature | Summary |
|---|---|---|
Create | IBackend Create(string targetId) | Returns the IBackend that emits for targetId (one of the values in TargetIds). Throws ArgumentOutOfRangeException for an unknown target. |
DefaultForCurrentOS | string DefaultForCurrentOS() | Returns the target RID matching the host's operating system and architecture — the target used when the user does not pass --target. Throws PlatformNotSupportedException on an operating system that is neither Windows nor Linux. |
