Forward ABIName to MCTargetOptions

This is required on RISC-V where Linux uses the lp64d ABI that allows
the usage of floating point registers to pass arguments. It seems to
work out-of-the-box upstream in clang-repl which passes through the
function initTargetOptions in clang/lib/CodeGen/BackendUtil.cpp with
the same effect.
This commit is contained in:
Jonas Hahnfeld 2023-02-16 21:39:05 +01:00 committed by jenkins
parent eb82dc505a
commit 8c3b18f683

View File

@ -435,6 +435,7 @@ CreateTargetMachine(const clang::CompilerInstance& CI, bool JITLink) {
using namespace llvm::orc; using namespace llvm::orc;
auto JTMB = JITTargetMachineBuilder(TT); auto JTMB = JITTargetMachineBuilder(TT);
JTMB.addFeatures(CI.getTargetOpts().Features); JTMB.addFeatures(CI.getTargetOpts().Features);
JTMB.getOptions().MCOptions.ABIName = CI.getTarget().getABI().str();
JTMB.setCodeGenOptLevel(OptLevel); JTMB.setCodeGenOptLevel(OptLevel);
#ifdef _WIN32 #ifdef _WIN32