From 75696ffa2533abb4e4db406d4e2de42e86197413 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Mon, 10 Apr 2017 23:27:53 +0000 Subject: [PATCH] Update for alloca construction changes llvm-svn: 299898 --- .../RenderScriptRuntime/RenderScriptx86ABIFixups.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp index 0e475e0b3d78..3ceda5ff67e9 100644 --- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp +++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp @@ -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(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");