[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)
Michael Buch via lldb-commits
lldb-commits at lists.llvm.org
Wed Jul 30 08:42:37 PDT 2025
================
@@ -2158,6 +2160,21 @@ FunctionDecl *TypeSystemClang::CreateFunctionDeclaration(
func_decl->setConstexprKind(isConstexprSpecified
? ConstexprSpecKind::Constexpr
: ConstexprSpecKind::Unspecified);
+
+ // Attach an asm(<mangled_name>) label to the FunctionDecl.
+ // This ensures that clang::CodeGen emits function calls
+ // using symbols that are mangled according to the DW_AT_linkage_name.
+ // If we didn't do this, the external symbols wouldn't exactly
+ // match the mangled name LLDB knows about and the IRExecutionUnit
+ // would have to fall back to searching object files for
+ // approximately matching function names. The motivating
+ // example is generating calls to ABI-tagged template functions.
+ // This is done separately for member functions in
+ // AddMethodToCXXRecordType.
+ if (asm_label)
+ func_decl->addAttr(clang::AsmLabelAttr::CreateImplicit(ast, *asm_label,
+ /*literal=*/true));
+
----------------
Michael137 wrote:
https://github.com/llvm/llvm-project/pull/151355
https://github.com/llvm/llvm-project/pull/148877
More information about the lldb-commits
mailing list