Update for alloca construction changes

llvm-svn: 299898
This commit is contained in:
Matt Arsenault 2017-04-10 23:27:53 +00:00
parent 8f2001164a
commit 75696ffa25
1 changed files with 5 additions and 2 deletions

View File

@ -182,8 +182,10 @@ bool fixupX86StructRetCalls(llvm::Module &module) {
// we pass a pointer to this allocation as the StructRet param, and then
// copy its
// value into the lldb return value
const llvm::DataLayout &DL = module.getDataLayout();
llvm::AllocaInst *return_value_alloc = new llvm::AllocaInst(
func->getReturnType(), "var_vector_return_alloc", call_inst);
func->getReturnType(), DL.getAllocaAddrSpace(), "var_vector_return_alloc",
call_inst);
// use the new allocation as the new first argument
new_call_args.emplace(new_call_args.begin(),
llvm::cast<llvm::Value>(return_value_alloc));
@ -194,7 +196,8 @@ bool fixupX86StructRetCalls(llvm::Module &module) {
llvm::Instruction::BitCast, func, new_func_ptr_type);
// create an allocation for a new function pointer
llvm::AllocaInst *new_func_ptr =
new llvm::AllocaInst(new_func_ptr_type, "new_func_ptr", call_inst);
new llvm::AllocaInst(new_func_ptr_type, DL.getAllocaAddrSpace(),
"new_func_ptr", call_inst);
// store the new_func_cast to the newly allocated space
(new llvm::StoreInst(new_func_cast, new_func_ptr, call_inst))
->setName("new_func_ptr_load_cast");