summaryrefslogtreecommitdiff
path: root/lldb/source/Symbol
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2022-07-14 18:50:02 +0000
committerDimitry Andric <dim@FreeBSD.org>2022-07-14 18:50:02 +0000
commit1f917f69ff07f09b6dbb670971f57f8efe718b84 (patch)
tree99293cbc1411737cd995dac10a99b2c40ef0944c /lldb/source/Symbol
parent145449b1e420787bb99721a429341fa6be3adfb6 (diff)
Vendor import of llvm-project main llvmorg-15-init-16436-g18a6ab5b8d1f.vendor/llvm-project/llvmorg-15-init-16436-g18a6ab5b8d1f
Diffstat (limited to 'lldb/source/Symbol')
-rw-r--r--lldb/source/Symbol/Function.cpp14
-rw-r--r--lldb/source/Symbol/Symbol.cpp5
-rw-r--r--lldb/source/Symbol/TypeList.cpp9
-rw-r--r--lldb/source/Symbol/TypeMap.cpp41
-rw-r--r--lldb/source/Symbol/Variable.cpp30
5 files changed, 28 insertions, 71 deletions
diff --git a/lldb/source/Symbol/Function.cpp b/lldb/source/Symbol/Function.cpp
index 648a12524aed..8ec4bc90cd13 100644
--- a/lldb/source/Symbol/Function.cpp
+++ b/lldb/source/Symbol/Function.cpp
@@ -196,11 +196,10 @@ Function *IndirectCallEdge::GetCallee(ModuleList &images,
Log *log = GetLog(LLDBLog::Step);
Status error;
Value callee_addr_val;
- if (!call_target.Evaluate(&exe_ctx, exe_ctx.GetRegisterContext(),
- /*loclist_base_load_addr=*/LLDB_INVALID_ADDRESS,
- /*initial_value_ptr=*/nullptr,
- /*object_address_ptr=*/nullptr, callee_addr_val,
- &error)) {
+ if (!call_target.Evaluate(
+ &exe_ctx, exe_ctx.GetRegisterContext(), LLDB_INVALID_ADDRESS,
+ /*initial_value_ptr=*/nullptr,
+ /*object_address_ptr=*/nullptr, callee_addr_val, &error)) {
LLDB_LOGF(log, "IndirectCallEdge: Could not evaluate expression: %s",
error.AsCString());
return nullptr;
@@ -440,8 +439,9 @@ bool Function::GetDisassembly(const ExecutionContext &exe_ctx,
if (disassembler_sp) {
const bool show_address = true;
const bool show_bytes = false;
- disassembler_sp->GetInstructionList().Dump(&strm, show_address, show_bytes,
- &exe_ctx);
+ const bool show_control_flow_kind = false;
+ disassembler_sp->GetInstructionList().Dump(
+ &strm, show_address, show_bytes, show_control_flow_kind, &exe_ctx);
return true;
}
return false;
diff --git a/lldb/source/Symbol/Symbol.cpp b/lldb/source/Symbol/Symbol.cpp
index 9ec7f2638f71..668276aa2500 100644
--- a/lldb/source/Symbol/Symbol.cpp
+++ b/lldb/source/Symbol/Symbol.cpp
@@ -558,8 +558,9 @@ bool Symbol::GetDisassembly(const ExecutionContext &exe_ctx, const char *flavor,
if (disassembler_sp) {
const bool show_address = true;
const bool show_bytes = false;
- disassembler_sp->GetInstructionList().Dump(&strm, show_address, show_bytes,
- &exe_ctx);
+ const bool show_control_flow_kind = false;
+ disassembler_sp->GetInstructionList().Dump(
+ &strm, show_address, show_bytes, show_control_flow_kind, &exe_ctx);
return true;
}
return false;
diff --git a/lldb/source/Symbol/TypeList.cpp b/lldb/source/Symbol/TypeList.cpp
index ace715d933ea..494e59e3a0fc 100644
--- a/lldb/source/Symbol/TypeList.cpp
+++ b/lldb/source/Symbol/TypeList.cpp
@@ -97,7 +97,7 @@ void TypeList::Dump(Stream *s, bool show_context) {
}
}
-void TypeList::RemoveMismatchedTypes(const char *qualified_typename,
+void TypeList::RemoveMismatchedTypes(llvm::StringRef qualified_typename,
bool exact_match) {
llvm::StringRef type_scope;
llvm::StringRef type_basename;
@@ -107,13 +107,12 @@ void TypeList::RemoveMismatchedTypes(const char *qualified_typename,
type_basename = qualified_typename;
type_scope = "";
}
- return RemoveMismatchedTypes(std::string(type_scope),
- std::string(type_basename), type_class,
+ return RemoveMismatchedTypes(type_scope, type_basename, type_class,
exact_match);
}
-void TypeList::RemoveMismatchedTypes(const std::string &type_scope,
- const std::string &type_basename,
+void TypeList::RemoveMismatchedTypes(llvm::StringRef type_scope,
+ llvm::StringRef type_basename,
TypeClass type_class, bool exact_match) {
// Our "collection" type currently is a std::map which doesn't have any good
// way to iterate and remove items from the map so we currently just make a
diff --git a/lldb/source/Symbol/TypeMap.cpp b/lldb/source/Symbol/TypeMap.cpp
index 2cda9b6c27d1..0d5f6d53e5a0 100644
--- a/lldb/source/Symbol/TypeMap.cpp
+++ b/lldb/source/Symbol/TypeMap.cpp
@@ -127,23 +127,8 @@ void TypeMap::Dump(Stream *s, bool show_context, lldb::DescriptionLevel level) {
}
}
-void TypeMap::RemoveMismatchedTypes(const char *qualified_typename,
- bool exact_match) {
- llvm::StringRef type_scope;
- llvm::StringRef type_basename;
- TypeClass type_class = eTypeClassAny;
- if (!Type::GetTypeScopeAndBasename(qualified_typename, type_scope,
- type_basename, type_class)) {
- type_basename = qualified_typename;
- type_scope = "";
- }
- return RemoveMismatchedTypes(std::string(type_scope),
- std::string(type_basename), type_class,
- exact_match);
-}
-
-void TypeMap::RemoveMismatchedTypes(const std::string &type_scope,
- const std::string &type_basename,
+void TypeMap::RemoveMismatchedTypes(llvm::StringRef type_scope,
+ llvm::StringRef type_basename,
TypeClass type_class, bool exact_match) {
// Our "collection" type currently is a std::map which doesn't have any good
// way to iterate and remove items from the map so we currently just make a
@@ -214,25 +199,3 @@ void TypeMap::RemoveMismatchedTypes(const std::string &type_scope,
}
m_types.swap(matching_types);
}
-
-void TypeMap::RemoveMismatchedTypes(TypeClass type_class) {
- if (type_class == eTypeClassAny)
- return;
-
- // Our "collection" type currently is a std::map which doesn't have any good
- // way to iterate and remove items from the map so we currently just make a
- // new list and add all of the matching types to it, and then swap it into
- // m_types at the end
- collection matching_types;
-
- iterator pos, end = m_types.end();
-
- for (pos = m_types.begin(); pos != end; ++pos) {
- Type *the_type = pos->second.get();
- TypeClass match_type_class =
- the_type->GetForwardCompilerType().GetTypeClass();
- if (match_type_class & type_class)
- matching_types.insert(*pos);
- }
- m_types.swap(matching_types);
-}
diff --git a/lldb/source/Symbol/Variable.cpp b/lldb/source/Symbol/Variable.cpp
index b92c86654496..f65e73e5d049 100644
--- a/lldb/source/Symbol/Variable.cpp
+++ b/lldb/source/Symbol/Variable.cpp
@@ -39,13 +39,13 @@ Variable::Variable(lldb::user_id_t uid, const char *name, const char *mangled,
const lldb::SymbolFileTypeSP &symfile_type_sp,
ValueType scope, SymbolContextScope *context,
const RangeList &scope_range, Declaration *decl_ptr,
- const DWARFExpression &location, bool external,
+ const DWARFExpressionList &location_list, bool external,
bool artificial, bool location_is_constant_data,
bool static_member)
: UserID(uid), m_name(name), m_mangled(ConstString(mangled)),
m_symfile_type_sp(symfile_type_sp), m_scope(scope),
m_owner_scope(context), m_scope_range(scope_range),
- m_declaration(decl_ptr), m_location(location), m_external(external),
+ m_declaration(decl_ptr), m_location_list(location_list), m_external(external),
m_artificial(artificial), m_loc_is_const_data(location_is_constant_data),
m_static_member(static_member) {}
@@ -145,7 +145,7 @@ void Variable::Dump(Stream *s, bool show_context) const {
bool show_fullpaths = false;
m_declaration.Dump(s, show_fullpaths);
- if (m_location.IsValid()) {
+ if (m_location_list.IsValid()) {
s->PutCString(", location = ");
ABISP abi;
if (m_owner_scope) {
@@ -153,7 +153,7 @@ void Variable::Dump(Stream *s, bool show_context) const {
if (module_sp)
abi = ABI::FindPlugin(ProcessSP(), module_sp->GetArchitecture());
}
- m_location.GetDescription(s, lldb::eDescriptionLevelBrief, abi.get());
+ m_location_list.GetDescription(s, lldb::eDescriptionLevelBrief, abi.get());
}
if (m_external)
@@ -212,12 +212,6 @@ void Variable::CalculateSymbolContext(SymbolContext *sc) {
}
bool Variable::LocationIsValidForFrame(StackFrame *frame) {
- // Is the variable is described by a single location?
- if (!m_location.IsLocationList()) {
- // Yes it is, the location is valid.
- return true;
- }
-
if (frame) {
Function *function =
frame->GetSymbolContext(eSymbolContextFunction).function;
@@ -231,7 +225,7 @@ bool Variable::LocationIsValidForFrame(StackFrame *frame) {
return false;
// It is a location list. We just need to tell if the location list
// contains the current address when converted to a load address
- return m_location.LocationListContainsAddress(
+ return m_location_list.ContainsAddress(
loclist_base_load_addr,
frame->GetFrameCodeAddress().GetLoadAddress(target_sp.get()));
}
@@ -244,7 +238,7 @@ bool Variable::LocationIsValidForAddress(const Address &address) {
// function.
if (address.IsSectionOffset()) {
// We need to check if the address is valid for both scope range and value
- // range.
+ // range.
// Empty scope range means block range.
bool valid_in_scope_range =
GetScopeRange().IsEmpty() || GetScopeRange().FindEntryThatContains(
@@ -255,7 +249,7 @@ bool Variable::LocationIsValidForAddress(const Address &address) {
CalculateSymbolContext(&sc);
if (sc.module_sp == address.GetModule()) {
// Is the variable is described by a single location?
- if (!m_location.IsLocationList()) {
+ if (m_location_list.IsAlwaysValidSingleExpr()) {
// Yes it is, the location is valid.
return true;
}
@@ -267,8 +261,8 @@ bool Variable::LocationIsValidForAddress(const Address &address) {
return false;
// It is a location list. We just need to tell if the location list
// contains the current address when converted to a load address
- return m_location.LocationListContainsAddress(loclist_base_file_addr,
- address.GetFileAddress());
+ return m_location_list.ContainsAddress(loclist_base_file_addr,
+ address.GetFileAddress());
}
}
}
@@ -459,9 +453,9 @@ bool Variable::DumpLocations(Stream *s, const Address &address) {
sc.function->GetAddressRange().GetBaseAddress().GetFileAddress();
if (loclist_base_file_addr == LLDB_INVALID_ADDRESS)
return false;
- return m_location.DumpLocations(s, eDescriptionLevelBrief,
- loclist_base_file_addr, file_addr,
- abi.get());
+ return m_location_list.DumpLocations(s, eDescriptionLevelBrief,
+ loclist_base_file_addr, file_addr,
+ abi.get());
}
return false;
}