summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTamas Berghammer <tberghammer@google.com>2017-08-16 11:45:10 +0000
committerTamas Berghammer <tberghammer@google.com>2017-08-16 11:45:10 +0000
commitbba2c83493c8c6293fc9518cbf9f672ae28cedc5 (patch)
tree1b103705a229b45488b90da4af3f9ccd95a41cdb
parent91e55322b9930b6f2a1b439a1fa99f4f9ba90d4e (diff)
downloadbcm5719-llvm-bba2c83493c8c6293fc9518cbf9f672ae28cedc5.tar.gz
bcm5719-llvm-bba2c83493c8c6293fc9518cbf9f672ae28cedc5.zip
Remove the DWARFExpression -> Clang ExpressionParser dependency
It was completly unused and broke the part of the encapsulation that common code shouldn't depend on specific plugins or language specific features. llvm-svn: 311000
-rw-r--r--lldb/include/lldb/Expression/DWARFExpression.h44
-rw-r--r--lldb/source/Core/ValueObjectVariable.cpp5
-rw-r--r--lldb/source/Expression/DWARFExpression.cpp35
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp8
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp12
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp2
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp5
-rw-r--r--lldb/source/Symbol/JavaASTContext.cpp11
-rw-r--r--lldb/source/Target/RegisterContext.cpp7
-rw-r--r--lldb/source/Target/StackFrame.cpp4
10 files changed, 46 insertions, 87 deletions
diff --git a/lldb/include/lldb/Expression/DWARFExpression.h b/lldb/include/lldb/Expression/DWARFExpression.h
index 1816c3b7a00..c85aaa5c1f9 100644
--- a/lldb/include/lldb/Expression/DWARFExpression.h
+++ b/lldb/include/lldb/Expression/DWARFExpression.h
@@ -22,10 +22,6 @@ class DWARFCompileUnit;
namespace lldb_private {
-class ClangExpressionDeclMap;
-class ClangExpressionVariable;
-class ClangExpressionVariableList;
-
//----------------------------------------------------------------------
/// @class DWARFExpression DWARFExpression.h "lldb/Expression/DWARFExpression.h"
/// @brief Encapsulates a DWARF location expression and interprets it.
@@ -262,8 +258,6 @@ public:
/// member variables to populate many operands
//------------------------------------------------------------------
bool Evaluate(ExecutionContextScope *exe_scope,
- ClangExpressionVariableList *expr_locals,
- ClangExpressionDeclMap *decl_map,
lldb::addr_t loclist_base_load_addr,
const Value *initial_value_ptr, const Value *object_address_ptr,
Value &result, Status *error_ptr) const;
@@ -272,9 +266,7 @@ public:
/// Wrapper for the static evaluate function that uses member
/// variables to populate many operands
//------------------------------------------------------------------
- bool Evaluate(ExecutionContext *exe_ctx,
- ClangExpressionVariableList *expr_locals,
- ClangExpressionDeclMap *decl_map, RegisterContext *reg_ctx,
+ bool Evaluate(ExecutionContext *exe_ctx, RegisterContext *reg_ctx,
lldb::addr_t loclist_base_load_addr,
const Value *initial_value_ptr, const Value *object_address_ptr,
Value &result, Status *error_ptr) const;
@@ -338,32 +330,14 @@ public:
/// True on success; false otherwise. If error_ptr is non-NULL,
/// details of the failure are provided through it.
//------------------------------------------------------------------
- static bool
- Evaluate(ExecutionContext *exe_ctx, ClangExpressionVariableList *expr_locals,
- ClangExpressionDeclMap *decl_map, RegisterContext *reg_ctx,
- lldb::ModuleSP opcode_ctx, const DataExtractor &opcodes,
- DWARFCompileUnit *dwarf_cu, const lldb::offset_t offset,
- const lldb::offset_t length, const lldb::RegisterKind reg_set,
- const Value *initial_value_ptr, const Value *object_address_ptr,
- Value &result, Status *error_ptr);
-
- //------------------------------------------------------------------
- /// Loads a ClangExpressionVariableList into the object
- ///
- /// @param[in] locals
- /// If non-NULL, the list of locals used by this expression.
- /// See Evaluate().
- //------------------------------------------------------------------
- void SetExpressionLocalVariableList(ClangExpressionVariableList *locals);
-
- //------------------------------------------------------------------
- /// Loads a ClangExpressionDeclMap into the object
- ///
- /// @param[in] locals
- /// If non-NULL, the list of external variables used by this
- /// expression. See Evaluate().
- //------------------------------------------------------------------
- void SetExpressionDeclMap(ClangExpressionDeclMap *decl_map);
+ static bool Evaluate(ExecutionContext *exe_ctx, RegisterContext *reg_ctx,
+ lldb::ModuleSP opcode_ctx, const DataExtractor &opcodes,
+ DWARFCompileUnit *dwarf_cu, const lldb::offset_t offset,
+ const lldb::offset_t length,
+ const lldb::RegisterKind reg_set,
+ const Value *initial_value_ptr,
+ const Value *object_address_ptr, Value &result,
+ Status *error_ptr);
bool GetExpressionData(DataExtractor &data) const {
data = m_data;
diff --git a/lldb/source/Core/ValueObjectVariable.cpp b/lldb/source/Core/ValueObjectVariable.cpp
index 9b9e51a0abb..167ba8ed64c 100644
--- a/lldb/source/Core/ValueObjectVariable.cpp
+++ b/lldb/source/Core/ValueObjectVariable.cpp
@@ -156,9 +156,8 @@ bool ValueObjectVariable::UpdateValue() {
target);
}
Value old_value(m_value);
- if (expr.Evaluate(&exe_ctx, nullptr, nullptr, nullptr,
- loclist_base_load_addr, nullptr, nullptr, m_value,
- &m_error)) {
+ if (expr.Evaluate(&exe_ctx, nullptr, loclist_base_load_addr, nullptr,
+ nullptr, m_value, &m_error)) {
m_resolved_value = m_value;
m_value.SetContext(Value::eContextTypeVariable, variable);
diff --git a/lldb/source/Expression/DWARFExpression.cpp b/lldb/source/Expression/DWARFExpression.cpp
index 592a30cdd78..14011aece7c 100644
--- a/lldb/source/Expression/DWARFExpression.cpp
+++ b/lldb/source/Expression/DWARFExpression.cpp
@@ -24,9 +24,6 @@
#include "lldb/Utility/StreamString.h"
#include "lldb/Utility/VMRange.h"
-#include "Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h"
-#include "Plugins/ExpressionParser/Clang/ClangExpressionVariable.h"
-
#include "lldb/Host/Host.h"
#include "lldb/Utility/Endian.h"
@@ -1245,23 +1242,21 @@ bool DWARFExpression::DumpLocationForAddress(Stream *s,
}
bool DWARFExpression::Evaluate(ExecutionContextScope *exe_scope,
- ClangExpressionVariableList *expr_locals,
- ClangExpressionDeclMap *decl_map,
lldb::addr_t loclist_base_load_addr,
const Value *initial_value_ptr,
const Value *object_address_ptr, Value &result,
Status *error_ptr) const {
ExecutionContext exe_ctx(exe_scope);
- return Evaluate(&exe_ctx, expr_locals, decl_map, nullptr,
- loclist_base_load_addr, initial_value_ptr, object_address_ptr,
- result, error_ptr);
+ return Evaluate(&exe_ctx, nullptr, loclist_base_load_addr, initial_value_ptr,
+ object_address_ptr, result, error_ptr);
}
-bool DWARFExpression::Evaluate(
- ExecutionContext *exe_ctx, ClangExpressionVariableList *expr_locals,
- ClangExpressionDeclMap *decl_map, RegisterContext *reg_ctx,
- lldb::addr_t loclist_base_load_addr, const Value *initial_value_ptr,
- const Value *object_address_ptr, Value &result, Status *error_ptr) const {
+bool DWARFExpression::Evaluate(ExecutionContext *exe_ctx,
+ RegisterContext *reg_ctx,
+ lldb::addr_t loclist_base_load_addr,
+ const Value *initial_value_ptr,
+ const Value *object_address_ptr, Value &result,
+ Status *error_ptr) const {
ModuleSP module_sp = m_module_wp.lock();
if (IsLocationList()) {
@@ -1307,9 +1302,9 @@ bool DWARFExpression::Evaluate(
if (length > 0 && lo_pc <= pc && pc < hi_pc) {
return DWARFExpression::Evaluate(
- exe_ctx, expr_locals, decl_map, reg_ctx, module_sp, m_data,
- m_dwarf_cu, offset, length, m_reg_kind, initial_value_ptr,
- object_address_ptr, result, error_ptr);
+ exe_ctx, reg_ctx, module_sp, m_data, m_dwarf_cu, offset, length,
+ m_reg_kind, initial_value_ptr, object_address_ptr, result,
+ error_ptr);
}
offset += length;
}
@@ -1321,14 +1316,12 @@ bool DWARFExpression::Evaluate(
// Not a location list, just a single expression.
return DWARFExpression::Evaluate(
- exe_ctx, expr_locals, decl_map, reg_ctx, module_sp, m_data, m_dwarf_cu, 0,
- m_data.GetByteSize(), m_reg_kind, initial_value_ptr, object_address_ptr,
- result, error_ptr);
+ exe_ctx, reg_ctx, module_sp, m_data, m_dwarf_cu, 0, m_data.GetByteSize(),
+ m_reg_kind, initial_value_ptr, object_address_ptr, result, error_ptr);
}
bool DWARFExpression::Evaluate(
- ExecutionContext *exe_ctx, ClangExpressionVariableList *expr_locals,
- ClangExpressionDeclMap *decl_map, RegisterContext *reg_ctx,
+ ExecutionContext *exe_ctx, RegisterContext *reg_ctx,
lldb::ModuleSP module_sp, const DataExtractor &opcodes,
DWARFCompileUnit *dwarf_cu, const lldb::offset_t opcodes_offset,
const lldb::offset_t opcodes_length, const lldb::RegisterKind reg_kind,
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
index bd73a29e087..5435a02433a 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
@@ -1517,8 +1517,8 @@ RegisterContextLLDB::SavedLocationForRegister(
dwarfexpr.SetRegisterKind(unwindplan_registerkind);
Value result;
Status error;
- if (dwarfexpr.Evaluate(&exe_ctx, nullptr, nullptr, this, 0, nullptr,
- nullptr, result, &error)) {
+ if (dwarfexpr.Evaluate(&exe_ctx, this, 0, nullptr, nullptr, result,
+ &error)) {
addr_t val;
val = result.GetScalar().ULongLong();
if (unwindplan_regloc.IsDWARFExpression()) {
@@ -1827,8 +1827,8 @@ bool RegisterContextLLDB::ReadCFAValueForRow(
dwarfexpr.SetRegisterKind(row_register_kind);
Value result;
Status error;
- if (dwarfexpr.Evaluate(&exe_ctx, nullptr, nullptr, this, 0, nullptr,
- nullptr, result, &error)) {
+ if (dwarfexpr.Evaluate(&exe_ctx, this, 0, nullptr, nullptr, result,
+ &error)) {
cfa_value = result.GetScalar().ULongLong();
UnwindLogMsg("CFA value set by DWARF expression is 0x%" PRIx64,
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index f5418763d67..482f0e58c39 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -2741,8 +2741,6 @@ bool DWARFASTParserClang::ParseChildMembers(
form_value.BlockData() - debug_info_data.GetDataStart();
if (DWARFExpression::Evaluate(
nullptr, // ExecutionContext *
- nullptr, // ClangExpressionVariableList *
- nullptr, // ClangExpressionDeclMap *
nullptr, // RegisterContext *
module_sp, debug_info_data, die.GetCU(), block_offset,
block_length, eRegisterKindDWARF, &initialValue,
@@ -3214,11 +3212,11 @@ bool DWARFASTParserClang::ParseChildMembers(
uint32_t block_length = form_value.Unsigned();
uint32_t block_offset =
form_value.BlockData() - debug_info_data.GetDataStart();
- if (DWARFExpression::Evaluate(
- nullptr, nullptr, nullptr, nullptr, module_sp,
- debug_info_data, die.GetCU(), block_offset,
- block_length, eRegisterKindDWARF, &initialValue,
- nullptr, memberOffset, nullptr)) {
+ if (DWARFExpression::Evaluate(nullptr, nullptr, module_sp,
+ debug_info_data, die.GetCU(),
+ block_offset, block_length,
+ eRegisterKindDWARF, &initialValue,
+ nullptr, memberOffset, nullptr)) {
member_byte_offset = memberOffset.ResolveValue(NULL).UInt();
}
} else {
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp
index 2507465750c..e04dc76d1db 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp
@@ -662,8 +662,6 @@ size_t DWARFASTParserGo::ParseChildMembers(const SymbolContext &sc,
form_value.BlockData() - debug_info_data.GetDataStart();
if (DWARFExpression::Evaluate(
NULL, // ExecutionContext *
- NULL, // ClangExpressionVariableList *
- NULL, // ClangExpressionDeclMap *
NULL, // RegisterContext *
module_sp, debug_info_data, die.GetCU(), block_offset,
block_length, eRegisterKindDWARF, &initialValue, NULL,
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 82d68574c49..5e7940d5577 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -1669,9 +1669,8 @@ SymbolFileDWARF::GlobalVariableMap &SymbolFileDWARF::GetGlobalAranges() {
const DWARFExpression &location = var_sp->LocationExpression();
Value location_result;
Status error;
- if (location.Evaluate(nullptr, nullptr, nullptr,
- LLDB_INVALID_ADDRESS, nullptr, nullptr,
- location_result, &error)) {
+ if (location.Evaluate(nullptr, LLDB_INVALID_ADDRESS, nullptr,
+ nullptr, location_result, &error)) {
if (location_result.GetValueType() ==
Value::eValueTypeFileAddress) {
lldb::addr_t file_addr =
diff --git a/lldb/source/Symbol/JavaASTContext.cpp b/lldb/source/Symbol/JavaASTContext.cpp
index ae4e9d5134b..4260f497d90 100644
--- a/lldb/source/Symbol/JavaASTContext.cpp
+++ b/lldb/source/Symbol/JavaASTContext.cpp
@@ -134,9 +134,9 @@ public:
obj_load_address.SetValueType(Value::eValueTypeLoadAddress);
Value result;
- if (m_dynamic_type_id.Evaluate(exe_ctx->GetBestExecutionContextScope(),
- nullptr, nullptr, 0, &obj_load_address,
- nullptr, result, nullptr)) {
+ if (m_dynamic_type_id.Evaluate(exe_ctx->GetBestExecutionContextScope(), 0,
+ &obj_load_address, nullptr, result,
+ nullptr)) {
Status error;
lldb::addr_t type_id_addr = result.GetScalar().UInt();
@@ -315,9 +315,8 @@ public:
ExecutionContextScope *exec_ctx_scope = value_obj->GetExecutionContextRef()
.Lock(true)
.GetBestExecutionContextScope();
- if (m_length_expression.Evaluate(exec_ctx_scope, nullptr, nullptr, 0,
- nullptr, &obj_load_address, result,
- nullptr))
+ if (m_length_expression.Evaluate(exec_ctx_scope, 0, nullptr,
+ &obj_load_address, result, nullptr))
return result.GetScalar().UInt();
return UINT32_MAX;
diff --git a/lldb/source/Target/RegisterContext.cpp b/lldb/source/Target/RegisterContext.cpp
index 66164c175e4..5d3d945b84a 100644
--- a/lldb/source/Target/RegisterContext.cpp
+++ b/lldb/source/Target/RegisterContext.cpp
@@ -93,10 +93,9 @@ RegisterContext::UpdateDynamicRegisterSize(const lldb_private::ArchSpec &arch,
Value result;
Status error;
const lldb::offset_t offset = 0;
- if (dwarf_expr.Evaluate(&exe_ctx, nullptr, nullptr, this, opcode_ctx,
- dwarf_data, nullptr, offset, dwarf_opcode_len,
- eRegisterKindDWARF, nullptr, nullptr, result,
- &error)) {
+ if (dwarf_expr.Evaluate(&exe_ctx, this, opcode_ctx, dwarf_data, nullptr,
+ offset, dwarf_opcode_len, eRegisterKindDWARF, nullptr,
+ nullptr, result, &error)) {
expr_result = result.GetScalar().SInt(-1);
switch (expr_result) {
case 0:
diff --git a/lldb/source/Target/StackFrame.cpp b/lldb/source/Target/StackFrame.cpp
index 30fceb11c11..dd44eac8e50 100644
--- a/lldb/source/Target/StackFrame.cpp
+++ b/lldb/source/Target/StackFrame.cpp
@@ -1089,8 +1089,8 @@ bool StackFrame::GetFrameBaseValue(Scalar &frame_base, Status *error_ptr) {
exe_ctx.GetTargetPtr());
if (m_sc.function->GetFrameBaseExpression().Evaluate(
- &exe_ctx, nullptr, nullptr, nullptr, loclist_base_addr, nullptr,
- nullptr, expr_value, &m_frame_base_error) == false) {
+ &exe_ctx, nullptr, loclist_base_addr, nullptr, nullptr,
+ expr_value, &m_frame_base_error) == false) {
// We should really have an error if evaluate returns, but in case
// we don't, lets set the error to something at least.
if (m_frame_base_error.Success())
OpenPOWER on IntegriCloud