Skip to content

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

TypeKindSummarySource
BackendCompileOptionsrecordThe 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
BackendFactoryclassResolves an IBackend for a given target RID and reports the default target for the running operating system and architecture.source
BackendOptimizationLevelenumThe LLVM optimization pipeline the backend runs, mirroring clang's -O levels.source
IBackendinterfaceA native code generator for one target platform.source
LinuxArm64LlvmBackendclassThe IBackend that emits 64-bit ARM Linux ELF executables via LLVM.source
LinuxX64LlvmBackendclassThe IBackend that emits 64-bit x86 Linux ELF executables via LLVM.source
LlvmAttributeHandlerecord structsource
LlvmBasicBlockHandlerecord structsource
LlvmBuilderHandlerecord structsource
LlvmCodeGenFileTypeenumsource
LlvmCodeGenOptLevelenumsource
LlvmCodeModelenumsource
LlvmContextHandlerecord structsource
LlvmDIBuilderHandlerecord structsource
LlvmIntPredicateenumsource
LlvmLinkageenumsource
LlvmMetadataHandlerecord structsource
LlvmModuleHandlerecord structsource
LlvmPassBuilderOptionsHandlerecord structsource
LlvmRealPredicateenumsource
LlvmRelocModeenumsource
LlvmTargetDataHandlerecord structsource
LlvmTargetHandlerecord structsource
LlvmTargetMachineHandlerecord structsource
LlvmTypeHandlerecord structsource
LlvmTypeKindenumsource
LlvmValueHandlerecord structsource
LlvmVerifierFailureActionenumsource
TargetIdsclassThe 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
WindowsArm64LlvmBackendclassThe IBackend that emits 64-bit ARM Windows PE executables via LLVM.source
WindowsX64LlvmBackendclassThe 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.

MemberSignatureSummary
Compilebyte[] 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.
TargetIdstring TargetIdThe 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.

MemberSignatureSummary
CreateIBackend Create(string targetId)Returns the IBackend that emits for targetId (one of the values in TargetIds). Throws ArgumentOutOfRangeException for an unknown target.
DefaultForCurrentOSstring 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.