forked from OSchip/llvm-project
parent
8f2001164a
commit
75696ffa25
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue