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

Siva Chandra via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 15 12:43:14 PDT 2015


sivachandra added inline comments.

================
Comment at: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h:200
@@ -198,1 +199,3 @@
 
+    void
+    GetMangledNamesForFunction (const std::string &scope_qualified_name,
----------------
sivachandra wrote:
> spyffe wrote:
> > 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.
> My thinking was, DWARF is the only thing which knows about the correct mangled name, so keep it close to the code dealing with DWARF. Your suggestion also makes sense, but might (I have not yet thought enough about it) require us to expose DIE info into ClangExpressionDeclMap. I will think more about this approach and get back to you.
I spent some time thinking about this. ClandExpressionDeclMap doesn't really explicitly lookup method names. If we have an expression like "v.size()", we lookup what "v" is, and that conveys to Clang about the existence of a method "size" in its class. The requirement for alternate names kicks in (so to say) when we are looking for the address of the method. I am not very clear on how we can cleanly keep track of all the methods parsed, while looking up variables, in ClangExpressionDeclMap and use that knowledge while looking up addresses. Do you have any suggestions?

I agree that it is indeed odd to have a method GetMangledNamesForFunction in SymbolFile which is useful only for expression evaluation. How about having a temp object that ClangExpressionDeclMap registers with SymbolFile, and cleans it up after expression evaluation is done? SymbolFile stuffs in to the object all info that ClangExpressionDeclMap could potentially use while parsing the DIEs. ExpressionEvaluationIndex?


http://reviews.llvm.org/D12809





More information about the lldb-commits mailing list