]> granicus.if.org Git - llvm/commitdiff
[RISCV] Fix RV32 datalayout string and ensure initAsmInfo is called
authorAlex Bradbury <asb@lowrisc.org>
Tue, 14 Feb 2017 05:20:20 +0000 (05:20 +0000)
committerAlex Bradbury <asb@lowrisc.org>
Tue, 14 Feb 2017 05:20:20 +0000 (05:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295028 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/RISCV/RISCVTargetMachine.cpp

index afbbe004186e70117aa8c02b87fede2ddac36e38..a20331cd0a3edadfb4553bdee8b186ae2950dc57 100644 (file)
@@ -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<TargetLoweringObjectFileELF>()) {}
+      TLOF(make_unique<TargetLoweringObjectFileELF>()) {
+  initAsmInfo();
+}
 
 TargetPassConfig *RISCVTargetMachine::createPassConfig(PassManagerBase &PM) {
   return new TargetPassConfig(this, PM);