summaryrefslogtreecommitdiff
path: root/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-04-16 16:04:10 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-04-16 16:04:10 +0000
commit74a628f776edb588bff8f8f5cc16eac947c9d631 (patch)
treedc32e010ac4902621e5a279bfeb48628f7f0e166 /source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime
parentafed7be32164a598f8172282c249af7266c48b46 (diff)
Notes
Diffstat (limited to 'source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime')
-rw-r--r--source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/CMakeLists.txt18
-rw-r--r--source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp2
-rw-r--r--source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp26
-rw-r--r--source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptScriptGroup.cpp7
-rw-r--r--source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp19
5 files changed, 45 insertions, 27 deletions
diff --git a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/CMakeLists.txt b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/CMakeLists.txt
index cd08f14137dc2..1a6c499461340 100644
--- a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/CMakeLists.txt
+++ b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/CMakeLists.txt
@@ -3,7 +3,7 @@ if(NOT LLDB_BUILT_STANDALONE)
endif()
-add_lldb_library(lldbPluginRenderScriptRuntime
+add_lldb_library(lldbPluginRenderScriptRuntime PLUGIN
RenderScriptRuntime.cpp
RenderScriptExpressionOpts.cpp
RenderScriptx86ABIFixups.cpp
@@ -11,4 +11,20 @@ add_lldb_library(lldbPluginRenderScriptRuntime
DEPENDS
${tablegen_deps}
+
+ LINK_LIBS
+ clangBasic
+ lldbBreakpoint
+ lldbCore
+ lldbDataFormatters
+ lldbExpression
+ lldbHost
+ lldbInterpreter
+ lldbSymbol
+ lldbTarget
+ LINK_COMPONENTS
+ Core
+ IRReader
+ Support
+ Target
)
diff --git a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
index b05618634868f..654ac9abfcab4 100644
--- a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
+++ b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
@@ -25,9 +25,9 @@
#include "clang/Basic/TargetOptions.h"
// Project includes
-#include "lldb/Core/Log.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
+#include "lldb/Utility/Log.h"
#include "RenderScriptExpressionOpts.h"
#include "RenderScriptRuntime.h"
diff --git a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
index ae907ac8dfbb4..638112b9ebde8 100644
--- a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
+++ b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
@@ -17,15 +17,14 @@
#include "RenderScriptScriptGroup.h"
#include "lldb/Breakpoint/StoppointCallbackContext.h"
-#include "lldb/Core/ConstString.h"
#include "lldb/Core/Debugger.h"
-#include "lldb/Core/Error.h"
-#include "lldb/Core/Log.h"
+#include "lldb/Core/DumpDataExtractor.h"
#include "lldb/Core/PluginManager.h"
-#include "lldb/Core/RegularExpression.h"
+#include "lldb/Core/RegisterValue.h"
#include "lldb/Core/ValueObjectVariable.h"
#include "lldb/DataFormatters/DumpValueObjectOptions.h"
#include "lldb/Expression/UserExpression.h"
+#include "lldb/Host/OptionParser.h"
#include "lldb/Host/StringConvert.h"
#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandInterpreter.h"
@@ -41,6 +40,11 @@
#include "lldb/Target/SectionLoadList.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
+#include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/DataBufferLLVM.h"
+#include "lldb/Utility/Error.h"
+#include "lldb/Utility/Log.h"
+#include "lldb/Utility/RegularExpression.h"
using namespace lldb;
using namespace lldb_private;
@@ -2535,7 +2539,7 @@ bool RenderScriptRuntime::LoadAllocation(Stream &strm, const uint32_t alloc_id,
}
// Read file into data buffer
- DataBufferSP data_sp(file.ReadFileContents());
+ auto data_sp = DataBufferLLVM::CreateFromPath(file.GetPath());
// Cast start of buffer to FileHeader and use pointer to read metadata
void *file_buf = data_sp->GetBytes();
@@ -3073,7 +3077,7 @@ bool RSModuleDescriptor::ParseRSInfo() {
const addr_t size = info_sym->GetByteSize();
const FileSpec fs = m_module->GetFileSpec();
- const DataBufferSP buffer = fs.ReadFileContents(addr, size);
+ auto buffer = DataBufferLLVM::CreateSliceFromPath(fs.GetPath(), size, addr);
if (!buffer)
return false;
@@ -3128,9 +3132,8 @@ bool RSModuleDescriptor::ParseRSInfo() {
// in numeric fields at the moment
uint64_t n_lines;
if (val.getAsInteger(10, n_lines)) {
- if (log)
- log->Debug("Failed to parse non-numeric '.rs.info' section %s",
- line->str().c_str());
+ LLDB_LOGV(log, "Failed to parse non-numeric '.rs.info' section {0}",
+ line->str());
continue;
}
if (info_lines.end() - (line + 1) < (ptrdiff_t)n_lines)
@@ -3410,8 +3413,9 @@ bool RenderScriptRuntime::DumpAllocation(Stream &strm, StackFrame *frame_ptr,
// Print the results to our stream.
expr_result->Dump(strm, expr_options);
} else {
- alloc_data.Dump(&strm, offset, format, data_size - padding, 1, 1,
- LLDB_INVALID_ADDRESS, 0, 0);
+ DumpDataExtractor(alloc_data, &strm, offset, format,
+ data_size - padding, 1, 1, LLDB_INVALID_ADDRESS, 0,
+ 0);
}
offset += data_size;
}
diff --git a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptScriptGroup.cpp b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptScriptGroup.cpp
index a8202dd08814a..9ca8fb4444c04 100644
--- a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptScriptGroup.cpp
+++ b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptScriptGroup.cpp
@@ -8,12 +8,8 @@
//===----------------------------------------------------------------------===//
#include "lldb/Breakpoint/StoppointCallbackContext.h"
-#include "lldb/Core/ConstString.h"
#include "lldb/Core/Debugger.h"
-#include "lldb/Core/Error.h"
-#include "lldb/Core/Log.h"
#include "lldb/Core/PluginManager.h"
-#include "lldb/Host/StringConvert.h"
#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandObjectMultiword.h"
@@ -24,6 +20,9 @@
#include "lldb/Symbol/VariableList.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
+#include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/Error.h"
+#include "lldb/Utility/Log.h"
#include "RenderScriptRuntime.h"
#include "RenderScriptScriptGroup.h"
diff --git a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
index aaca045826760..3ceda5ff67e98 100644
--- a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
+++ b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
@@ -24,8 +24,8 @@
#include "llvm/Pass.h"
// Project includes
-#include "lldb/Core/Log.h"
#include "lldb/Target/Process.h"
+#include "lldb/Utility/Log.h"
using namespace lldb_private;
namespace {
@@ -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");
@@ -248,7 +251,7 @@ bool fixupRSAllocationStructByValCalls(llvm::Module &module) {
rs_functions.insert(call_inst->getCalledFunction());
// get the function attributes
- llvm::AttributeSet call_attribs = call_inst->getAttributes();
+ llvm::AttributeList call_attribs = call_inst->getAttributes();
// iterate over the argument attributes
for (size_t i = 1; i <= call_attribs.getNumSlots(); ++i) {
@@ -261,16 +264,12 @@ bool fixupRSAllocationStructByValCalls(llvm::Module &module) {
}
}
- llvm::AttributeSet attr_byval =
- llvm::AttributeSet::get(module.getContext(), 1u, llvm::Attribute::ByVal);
-
// for all called function decls
for (auto func : rs_functions) {
// inspect all of the arguments in the call
- llvm::SymbolTableList<llvm::Argument> &arg_list = func->getArgumentList();
- for (auto &arg : arg_list) {
+ for (auto &arg : func->args()) {
if (arg.hasByValAttr()) {
- arg.removeAttr(attr_byval);
+ arg.removeAttr(llvm::Attribute::ByVal);
changed = true;
}
}