mirror of
https://github.com/intel/llvm.git
synced 2026-01-21 20:53:29 +08:00
[lldb] Fix breakeage introduced by llvm::LoadInst api change
This commit is contained in:
@@ -1120,7 +1120,7 @@ bool IRForTarget::RewritePersistentAlloc(llvm::Instruction *persistent_alloc) {
|
||||
// Now, since the variable is a pointer variable, we will drop in a load of
|
||||
// that pointer variable.
|
||||
|
||||
LoadInst *persistent_load = new LoadInst(persistent_global, "", alloc);
|
||||
LoadInst *persistent_load = new LoadInst(persistent_global->getType()->getPointerElementType(), persistent_global, "", alloc);
|
||||
|
||||
LLDB_LOG(log, "Replacing \"{0}\" with \"{1}\"", PrintValue(alloc),
|
||||
PrintValue(persistent_load));
|
||||
@@ -1792,7 +1792,7 @@ bool IRForTarget::ReplaceVariables(Function &llvm_function) {
|
||||
get_element_ptr, value->getType()->getPointerTo(), "",
|
||||
entry_instruction);
|
||||
|
||||
LoadInst *load = new LoadInst(bit_cast, "", entry_instruction);
|
||||
LoadInst *load = new LoadInst(bit_cast->getType()->getPointerElementType(), bit_cast, "", entry_instruction);
|
||||
|
||||
return load;
|
||||
} else {
|
||||
|
||||
@@ -189,7 +189,7 @@ bool fixupX86StructRetCalls(llvm::Module &module) {
|
||||
->setName("new_func_ptr_load_cast");
|
||||
// load the new function address ready for a jump
|
||||
llvm::LoadInst *new_func_addr_load =
|
||||
new llvm::LoadInst(new_func_ptr, "load_func_pointer", call_inst);
|
||||
new llvm::LoadInst(new_func_ptr->getType()->getPointerElementType(), new_func_ptr, "load_func_pointer", call_inst);
|
||||
// and create a callinstruction from it
|
||||
llvm::CallInst *new_call_inst =
|
||||
llvm::CallInst::Create(new_func_type, new_func_addr_load, new_call_args,
|
||||
@@ -197,7 +197,7 @@ bool fixupX86StructRetCalls(llvm::Module &module) {
|
||||
new_call_inst->setCallingConv(call_inst->getCallingConv());
|
||||
new_call_inst->setTailCall(call_inst->isTailCall());
|
||||
llvm::LoadInst *lldb_save_result_address =
|
||||
new llvm::LoadInst(return_value_alloc, "save_return_val", call_inst);
|
||||
new llvm::LoadInst(return_value_alloc->getType()->getPointerElementType(), return_value_alloc, "save_return_val", call_inst);
|
||||
|
||||
// Now remove the old broken call
|
||||
call_inst->replaceAllUsesWith(lldb_save_result_address);
|
||||
|
||||
Reference in New Issue
Block a user