From: Alex Bradbury Date: Tue, 14 Feb 2017 05:20:20 +0000 (+0000) Subject: [RISCV] Fix RV32 datalayout string and ensure initAsmInfo is called X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6eaf72c16b344b6ae9ebbea0bcd166a21c973a0b;p=llvm [RISCV] Fix RV32 datalayout string and ensure initAsmInfo is called git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295028 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/RISCV/RISCVTargetMachine.cpp b/lib/Target/RISCV/RISCVTargetMachine.cpp index afbbe004186..a20331cd0a3 100644 --- a/lib/Target/RISCV/RISCVTargetMachine.cpp +++ b/lib/Target/RISCV/RISCVTargetMachine.cpp @@ -32,7 +32,7 @@ static std::string computeDataLayout(const Triple &TT) { return "e-m:e-i64:64-n32:64-S128"; } else { assert(TT.isArch32Bit() && "only RV32 and RV64 are currently supported"); - return "e-m:e-i64:64-n32-S128"; + return "e-m:e-p:32:32-i64:64-n32-S128"; } } @@ -51,7 +51,9 @@ RISCVTargetMachine::RISCVTargetMachine(const Target &T, const Triple &TT, CodeGenOpt::Level OL) : LLVMTargetMachine(T, computeDataLayout(TT), TT, CPU, FS, Options, getEffectiveRelocModel(TT, RM), CM, OL), - TLOF(make_unique()) {} + TLOF(make_unique()) { + initAsmInfo(); +} TargetPassConfig *RISCVTargetMachine::createPassConfig(PassManagerBase &PM) { return new TargetPassConfig(this, PM);