[Lldb-commits] [PATCH] D12809: Better scheme to lookup alternate mangled name when looking up function address.

Sean Callanan via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 14 13:22:54 PDT 2015

spyffe requested changes to this revision.
spyffe added a comment.

I LOVE the idea of getting rid of those horrid "alternate manglings."  We knew what the mangling was during name lookup, we should be able to recognize them later!
As listed in my inline comments, I have some concerns about the scope.  This knowledge is built up during expression parsing and used during expression parsing – we're done.
Thanks for working on this, Siva.

Comment at: source/Expression/ClangExpressionDeclMap.cpp:661
@@ -603,4 +660,3 @@
-                    FindCodeSymbolInContext(
-                        demangled, m_parser_vars->m_sym_ctx, eFunctionNameTypeFull, sc_list);
-                    sc_list_size = sc_list.GetSize();
+                    ConstString best_alternate_mangled_name = FindBestAlternateMangledName(demangled, lang_type, sc);
+                    if (best_alternate_mangled_name)
This should definitely only be done if we can't find the name the original way.  I'm always happy to pay extra runtime to fix an expression that would otherwise not work – but expressions that would work (the >90% case) shouldn't be paying for this.

Comment at: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h:200
@@ -198,1 +199,3 @@
+    void
+    GetMangledNamesForFunction (const std::string &scope_qualified_name,
Why is this attached to the DWARF?  I would want to attach this to the ClangExpressionDeclMap because we identify these alternate names during function name lookup, and we just need to remember them when resolving the references in IR.  After that, they are no longer needed.


More information about the lldb-commits mailing list