Skip to content

Commit 3eec6e5

Browse files
committed
fixup! rename FunctionCallLabel members
1 parent f50fff2 commit 3eec6e5

File tree

3 files changed

+20
-13
lines changed

3 files changed

+20
-13
lines changed

lldb/include/lldb/Expression/Expression.h

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,25 @@ class Expression {
102102
///
103103
/// The format being:
104104
///
105-
/// <prefix>:<mangled name>:<module id>:<DIE id>
105+
/// <prefix>:<mangled name>:<module uid>:<symbol uid>
106106
///
107107
/// The label string needs to stay valid for the entire lifetime
108108
/// of this object.
109109
struct FunctionCallLabel {
110-
llvm::StringRef m_lookup_name;
111-
lldb::user_id_t m_module_id;
112-
113-
/// Mostly for debuggability.
114-
lldb::user_id_t m_die_id;
110+
/// Name to use when searching for the function symbol in
111+
/// \c module_id. For most function calls this will be a
112+
/// mangled name. In cases where a mangled name can't be used,
113+
/// this will be the function name.
114+
llvm::StringRef lookup_name;
115+
116+
/// Unique identifier of the lldb_private::Module
117+
/// which contains the symbol identified by \c symbol_id.
118+
lldb::user_id_t module_id;
119+
120+
/// Unique identifier of the function symbol on which to
121+
/// perform the function call. For example, for DWARF this would
122+
/// be the DIE UID.
123+
lldb::user_id_t symbol_id;
115124
};
116125

117126
/// LLDB attaches this prefix to mangled names of functions that it get called

lldb/source/Expression/IRExecutionUnit.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -809,11 +809,11 @@ ResolveFunctionCallLabel(llvm::StringRef name,
809809

810810
const auto &label = *label_or_err;
811811

812-
auto module_sp = sc.target_sp->GetImages().FindModule(label.m_module_id);
812+
auto module_sp = sc.target_sp->GetImages().FindModule(label.module_id);
813813

814814
if (!module_sp)
815815
return llvm::createStringError(
816-
llvm::formatv("failed to find module by UID {0}", label.m_module_id));
816+
llvm::formatv("failed to find module by UID {0}", label.module_id));
817817

818818
auto *symbol_file = module_sp->GetSymbolFile();
819819
if (!symbol_file)
@@ -822,7 +822,7 @@ ResolveFunctionCallLabel(llvm::StringRef name,
822822

823823
SymbolContextList sc_list;
824824
if (auto err =
825-
symbol_file->FindAndResolveFunction(sc_list, label.m_lookup_name))
825+
symbol_file->FindAndResolveFunction(sc_list, label.lookup_name))
826826
return llvm::joinErrors(
827827
llvm::createStringError("failed to resolve function by UID"),
828828
std::move(err));

lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9783,8 +9783,6 @@ void TypeSystemClang::LogCreation() const {
97839783
&getASTContext(), getDisplayName());
97849784
}
97859785

9786-
// Expected format is:
9787-
// $__lldb_func:<mangled name>:<module id>:<definition/declaration DIE id>
97889786
llvm::Expected<llvm::SmallVector<llvm::StringRef, 3>>
97899787
TypeSystemClang::splitFunctionCallLabel(llvm::StringRef label) const {
97909788
if (!label.consume_front(FunctionCallLabelPrefix))
@@ -9827,6 +9825,6 @@ TypeSystemClang::makeFunctionCallLabel(llvm::StringRef label) const {
98279825
return llvm::createStringError(
98289826
llvm::formatv("failed to parse DIE ID from '{0}'.", components[2]));
98299827

9830-
return FunctionCallLabel{/*.m_lookup_name =*/components[0],
9831-
/*.m_module_id =*/module_id, /*.m_die_id =*/die_id};
9828+
return FunctionCallLabel{/*.lookup_name=*/components[0],
9829+
/*.module_id=*/module_id, /*.symbol_id=*/die_id};
98329830
}

0 commit comments

Comments
 (0)