Skip to content

Commit 222afb1

Browse files
committed
fixup! create literal AsmLabels
1 parent c0654a2 commit 222afb1

File tree

4 files changed

+4
-19
lines changed

4 files changed

+4
-19
lines changed

lldb/include/lldb/Expression/Expression.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,6 @@ struct FunctionCallLabel {
118118
/// from JITted expressions.
119119
inline constexpr llvm::StringRef FunctionCallLabelPrefix = "$__lldb_func";
120120

121-
bool consumeFunctionCallLabelPrefix(llvm::StringRef &name);
122-
bool hasFunctionCallLabelPrefix(llvm::StringRef name);
123-
124121
} // namespace lldb_private
125122

126123
#endif // LLDB_EXPRESSION_EXPRESSION_H

lldb/source/Expression/Expression.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,3 @@ Expression::Expression(ExecutionContextScope &exe_scope)
3030
m_jit_end_addr(LLDB_INVALID_ADDRESS) {
3131
assert(m_target_wp.lock());
3232
}
33-
34-
bool lldb_private::consumeFunctionCallLabelPrefix(llvm::StringRef &name) {
35-
// On Darwin mangled names get a '_' prefix.
36-
name.consume_front("_");
37-
return name.consume_front(FunctionCallLabelPrefix);
38-
}
39-
40-
bool lldb_private::hasFunctionCallLabelPrefix(llvm::StringRef name) {
41-
// On Darwin mangled names get a '_' prefix.
42-
name.consume_front("_");
43-
return name.starts_with(FunctionCallLabelPrefix);
44-
}

lldb/source/Expression/IRExecutionUnit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ lldb::addr_t IRExecutionUnit::FindInUserDefinedSymbols(
966966

967967
lldb::addr_t IRExecutionUnit::FindSymbol(lldb_private::ConstString name,
968968
bool &missing_weak) {
969-
if (hasFunctionCallLabelPrefix(name.GetStringRef())) {
969+
if (name.GetStringRef().starts_with(FunctionCallLabelPrefix)) {
970970
if (auto addr_or_err = ResolveFunctionCallLabel(name.GetStringRef(),
971971
m_sym_ctx, missing_weak)) {
972972
return *addr_or_err;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2173,7 +2173,7 @@ FunctionDecl *TypeSystemClang::CreateFunctionDeclaration(
21732173
// AddMethodToCXXRecordType.
21742174
if (asm_label)
21752175
func_decl->addAttr(clang::AsmLabelAttr::CreateImplicit(ast, *asm_label,
2176-
/*literal=*/false));
2176+
/*literal=*/true));
21772177

21782178
SetOwningModule(func_decl, owning_module);
21792179
decl_ctx->addDecl(func_decl);
@@ -7799,7 +7799,7 @@ clang::CXXMethodDecl *TypeSystemClang::AddMethodToCXXRecordType(
77997799

78007800
if (asm_label)
78017801
cxx_method_decl->addAttr(clang::AsmLabelAttr::CreateImplicit(
7802-
getASTContext(), *asm_label, /*literal=*/false));
7802+
getASTContext(), *asm_label, /*literal=*/true));
78037803

78047804
// Parameters on member function declarations in DWARF generally don't
78057805
// have names, so we omit them when creating the ParmVarDecls.
@@ -9787,7 +9787,7 @@ void TypeSystemClang::LogCreation() const {
97879787
// $__lldb_func:<mangled name>:<module id>:<definition/declaration DIE id>
97889788
llvm::Expected<llvm::SmallVector<llvm::StringRef, 3>>
97899789
TypeSystemClang::splitFunctionCallLabel(llvm::StringRef label) const {
9790-
if (!consumeFunctionCallLabelPrefix(label))
9790+
if (!label.consume_front(FunctionCallLabelPrefix))
97919791
return llvm::createStringError(
97929792
"expected function call label prefix not found in %s", label.data());
97939793
if (!label.consume_front(":"))

0 commit comments

Comments
 (0)