Main module for the LLVM Backend.
Code Map
//! Main module for the LLVM Backend.
module volt.llvm.backend;
//! Layout strings grabbed from clang.
enum layoutWinLinux32;
//! Layout strings grabbed from clang.
enum layoutWinLinux64;
//! Layout strings grabbed from clang.
enum layoutOSX32;
//! Layout strings grabbed from clang.
enum layoutOSX64;
//! Layout strings grabbed from clang.
enum layoutAArch64Linux64;
//! Layout strings grabbed from clang.
enum layoutARMHFLinux32;
//! Bare metal layout, grabbed from clang with target "X-pc-none-elf".
enum layoutMetal32;
//! Bare metal layout, grabbed from clang with target "X-pc-none-elf".
enum layoutMetal64;
//! Main interface for the Driver to the llvm backend.
class LlvmBackend : Backend
{
public:
this(lp: LanguagePass, internalDebug: bool) { }
fn close() { }
fn supported() TargetType[] { }
fn compileFile(m: ir.Module, type: TargetType, ehPersonality: ir.Function, llvmTypeidFor: ir.Function, execDir: string, currentWorkingDir: string, identStr: string) BackendFileResult { }
fn compileHost(m: ir.Module, ehPersonality: ir.Function, llvmTypeidFor: ir.Function, execDir: string, currentWorkingDir: string, identStr: string) BackendHostResult { }
fn compileState(m: ir.Module, ehPersonality: ir.Function, llvmTypeidFor: ir.Function, execDir: string, currentWorkingDir: string, identStr: string) VoltState { }
protected:
lp: LanguagePass;
target: TargetInfo;
llvmTarget: LLVMTargetRef;
llvmMachineTarget: LLVMTargetMachineRef;
mDump: bool;
}
//! A llvm result that saves to bitcode files.
class BitcodeResult : BackendFileResult
{
public:
this(backend: LlvmBackend, state: VoltState) { }
fn close() { }
fn saveToFile(filename: string) { }
protected:
mBackend: LlvmBackend;
mContext: LLVMContextRef;
mMod: LLVMModuleRef;
}
//! Backend results that procudes a object file.
class ObjectResult : BitcodeResult
{
public:
this(b: LlvmBackend, s: VoltState) { }
fn saveToFile(filename: string) { }
}
//! Load a LLVMModuleRef into memory from file.
fn loadModule(ctx: LLVMContextRef, filename: string) LLVMModuleRef { }
//! Helper function to link several LLVM modules together.
fn linkModules(output: string, inputs: string[]) { }
//! Write the given module into a bitcode file.
fn writeBitcodeFile(target: TargetInfo, output: string, mod: LLVMModuleRef) { }
//! Read a bitcode file from disk, assemble and write the given it to the
//! given filename using the given target. The assemble type and file
//! format is decided by the given target.
fn writeObjectFile(target: TargetInfo, output: string, input: string) { }
//! Assemble and write the given module to the given filename using the
//! given target. The assemble type and file format is decided by the given
//! machine.
fn writeObjectFile(machine: LLVMTargetMachineRef, output: string, mod: LLVMModuleRef) { }
//! Create a target machine.
fn createTargetMachine(target: TargetInfo) LLVMTargetMachineRef { }
//! Used to select LLVMTarget.
fn getArchTarget(target: TargetInfo) string { }
//! Returns the llvm triple string for the given target.
fn getTriple(target: TargetInfo) string { }
//! Returns the llvm layout string for the given target.
fn getLayout(target: TargetInfo) string { }
Main interface for the Driver to the llvm backend.
A llvm result that saves to bitcode files.
Backend results that procudes a object file.
Load a LLVMModuleRef into memory from file.
Parameters
ctx |
The context that the module will be created in. |
filename |
The bitcode file to load the module from. |
Helper function to link several LLVM modules together.
Parameters
output |
The filename to write the result into. |
inputs |
Write the given module into a bitcode file.
Parameters
target |
Layout and triple decided by the target. |
output |
The filename that the function writes the bitcode to. |
mod |
The module to assemble and write out to the output file. |
Side-Effects
-
Will overwrite the modules triple and layout information.
Read a bitcode file from disk, assemble and write the given it to the given filename using the given target. The assemble type and file format is decided by the given target.
Parameters
target |
Decides assemble type and file format. |
output |
The filename to write the object file to. |
input |
The file to read the module from. |
Assemble and write the given module to the given filename using the given target. The assemble type and file format is decided by the given machine.
Parameters
machine |
Used to create the object file, createMachineTarget. |
output |
The filename to write the object file to. |
mod |
The module to assemble and write out to the output file. |
Create a target machine.
Parameters
target |
The target for which to create a LLVMTargetMachineRef. |
Used to select LLVMTarget.
Parameters
target |
The target to get the arch string for. |
Returns the llvm triple string for the given target.
Parameters
target |
The target to get the triple string for. |
Returns the llvm layout string for the given target.
Parameters
target |
The target to get the layout string for. |
Layout strings grabbed from clang.
Layout strings grabbed from clang.
Layout strings grabbed from clang.
Layout strings grabbed from clang.
Layout strings grabbed from clang.
Layout strings grabbed from clang.
Bare metal layout, grabbed from clang with target "X-pc-none-elf".
Bare metal layout, grabbed from clang with target "X-pc-none-elf".