about summary refs log tree commit diff
path: root/src/rustllvm/PassWrapper.cpp
diff options
context:
space:
mode:
authorPietro Albini <pietro@pietroalbini.org>2019-11-05 14:36:57 +0100
committerGitHub <noreply@github.com>2019-11-05 14:36:57 +0100
commit26449f8db46eada190e5b2a48039bb7e10a715d2 (patch)
tree1bcf4dfcbcd32f86314461df81f483316c509bc5 /src/rustllvm/PassWrapper.cpp
parent54c57a2f21193b8a3a6ec1ffd641931bd6da246c (diff)
parent539de439ad6f32e9a9a8a593299072a106786890 (diff)
downloadrust-26449f8db46eada190e5b2a48039bb7e10a715d2.tar.gz
rust-26449f8db46eada190e5b2a48039bb7e10a715d2.zip
Rollup merge of #65953 - keystone-enclave:llvm_abiname, r=alexcrichton
Allow specifying LLVM's MCTargetOptions::ABIName in target specification files

This addresses #65024, as it allows RISC-V target specification files to set `"llvm-abiname": "lp64d"`.

Other languages (read: C) usually expose this codegen parameter under a compiler argument like `-mabi=<XYZ>`.
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
-rw-r--r--src/rustllvm/PassWrapper.cpp3
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.