Skip to content

Commit 0d684b1

Browse files
committed
Update for AllocaInst construction changes
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299889 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent f63663a commit 0d684b1

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/CodeGen/CGCall.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3710,12 +3710,14 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
37103710
Address ArgMemory = Address::invalid();
37113711
const llvm::StructLayout *ArgMemoryLayout = nullptr;
37123712
if (llvm::StructType *ArgStruct = CallInfo.getArgStruct()) {
3713-
ArgMemoryLayout = CGM.getDataLayout().getStructLayout(ArgStruct);
3713+
const llvm::DataLayout &DL = CGM.getDataLayout();
3714+
ArgMemoryLayout = DL.getStructLayout(ArgStruct);
37143715
llvm::Instruction *IP = CallArgs.getStackBase();
37153716
llvm::AllocaInst *AI;
37163717
if (IP) {
37173718
IP = IP->getNextNode();
3718-
AI = new llvm::AllocaInst(ArgStruct, "argmem", IP);
3719+
AI = new llvm::AllocaInst(ArgStruct, DL.getAllocaAddrSpace(),
3720+
"argmem", IP);
37193721
} else {
37203722
AI = CreateTempAlloca(ArgStruct, "argmem");
37213723
}

lib/CodeGen/CGExpr.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ Address CodeGenFunction::CreateTempAlloca(llvm::Type *Ty, CharUnits Align,
7171
/// block.
7272
llvm::AllocaInst *CodeGenFunction::CreateTempAlloca(llvm::Type *Ty,
7373
const Twine &Name) {
74-
return new llvm::AllocaInst(Ty, nullptr, Name, AllocaInsertPt);
74+
return new llvm::AllocaInst(Ty, CGM.getDataLayout().getAllocaAddrSpace(),
75+
nullptr, Name, AllocaInsertPt);
7576
}
7677

7778
/// CreateDefaultAlignTempAlloca - This creates an alloca with the

0 commit comments

Comments
 (0)