diff options
| author | Gui Andrade <gh@archshift.com> | 2019-10-29 21:12:05 -0700 |
|---|---|---|
| committer | Gui Andrade <gh@archshift.com> | 2019-10-29 21:12:05 -0700 |
| commit | 539de439ad6f32e9a9a8a593299072a106786890 (patch) | |
| tree | 712932c2c0e692647a67a001b64cebd066648935 /src/rustllvm/PassWrapper.cpp | |
| parent | aa69777ea2902208b24b3fd77767d577ceaf6386 (diff) | |
| download | rust-539de439ad6f32e9a9a8a593299072a106786890.tar.gz rust-539de439ad6f32e9a9a8a593299072a106786890.zip | |
Allow specifying key "llvm-abiname" in target specification
This addresses #65024, as it allows RISC-V target specification files to set "llvm-abiname": "lp64d". In general, it is useful for the programmer to be able to set this codegen parameter, which other languages usually expose under a compiler argument like "-mabi=<XYZ>".
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
| -rw-r--r-- | src/rustllvm/PassWrapper.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp index 0cda3465dc0..5b3900ab496 100644 --- a/src/rustllvm/PassWrapper.cpp +++ b/src/rustllvm/PassWrapper.cpp @@ -343,7 +343,7 @@ extern "C" const char* LLVMRustGetHostCPUName(size_t *len) { extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine( const char *TripleStr, const char *CPU, const char *Feature, - LLVMRustCodeModel RustCM, LLVMRustRelocMode RustReloc, + const char *ABIStr, LLVMRustCodeModel RustCM, LLVMRustRelocMode RustReloc, LLVMRustCodeGenOptLevel RustOptLevel, bool UseSoftFloat, bool PositionIndependentExecutable, bool FunctionSections, bool DataSections, @@ -374,6 +374,7 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine( Options.FunctionSections = FunctionSections; Options.MCOptions.AsmVerbose = AsmComments; Options.MCOptions.PreserveAsmComments = AsmComments; + Options.MCOptions.ABIName = ABIStr; if (TrapUnreachable) { // Tell LLVM to codegen `unreachable` into an explicit trap instruction. |
