]> granicus.if.org Git - clang/commitdiff
Update for AllocaInst construction changes
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 10 Apr 2017 22:28:02 +0000 (22:28 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 10 Apr 2017 22:28:02 +0000 (22:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299889 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGCall.cpp
lib/CodeGen/CGExpr.cpp

index e11bc94dd8346bfd6ed4710808d4f547378291a5..8af32055fc4c2a968138744f3cf4e947cde6ed77 100644 (file)
@@ -3710,12 +3710,14 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
   Address ArgMemory = Address::invalid();
   const llvm::StructLayout *ArgMemoryLayout = nullptr;
   if (llvm::StructType *ArgStruct = CallInfo.getArgStruct()) {
-    ArgMemoryLayout = CGM.getDataLayout().getStructLayout(ArgStruct);
+    const llvm::DataLayout &DL = CGM.getDataLayout();
+    ArgMemoryLayout = DL.getStructLayout(ArgStruct);
     llvm::Instruction *IP = CallArgs.getStackBase();
     llvm::AllocaInst *AI;
     if (IP) {
       IP = IP->getNextNode();
-      AI = new llvm::AllocaInst(ArgStruct, "argmem", IP);
+      AI = new llvm::AllocaInst(ArgStruct, DL.getAllocaAddrSpace(),
+                                "argmem", IP);
     } else {
       AI = CreateTempAlloca(ArgStruct, "argmem");
     }
index c412456bf7d537481ccf8236fd7da2f859b290fd..a0dd20b5f6a2a3fd9a186dceaf3dedf046d2ec9f 100644 (file)
@@ -71,7 +71,8 @@ Address CodeGenFunction::CreateTempAlloca(llvm::Type *Ty, CharUnits Align,
 /// block.
 llvm::AllocaInst *CodeGenFunction::CreateTempAlloca(llvm::Type *Ty,
                                                     const Twine &Name) {
-  return new llvm::AllocaInst(Ty, nullptr, Name, AllocaInsertPt);
+  return new llvm::AllocaInst(Ty, CGM.getDataLayout().getAllocaAddrSpace(),
+                              nullptr, Name, AllocaInsertPt);
 }
 
 /// CreateDefaultAlignTempAlloca - This creates an alloca with the