[Lldb-commits] [PATCH] D12658: Search variables based on clang::DeclContext and clang::Decl tree

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 14 11:48:49 PDT 2015

clayborg added a comment.

In http://reviews.llvm.org/D12658#244710, @paulherman wrote:

> [WIP] Search variables based on clang::DeclContext and clang::Decl tree
> This revision fixes some of the comments. There are some things I'm not sure about. The problem is that at some point there will be the need to link decls with the object they represent (Function, Variable, CompileUnit, etc). Is the approach of getting the VariableSP from the TypeSystem the right one?

It is fine because each TypeSystem does have a link to its SymbolFile, so yes this will work.

> Also, should ParseVariableDIE be moved to DWARFASTParser in order to create the decl there or should there only be a method CreateVariableDecl(VariableSP var)?

No. ParseVariableDIE shouldn't be making the CompilerDecl at all. We should do this only when we call the "Variable::GetDecl()". It should then route this through the TypeSystem from the variable type and ask the type system for the CompilerDecl. This will get routed to the SymbolFile and then to that will get routed to the DWARFASTParser (DWARFASTParserClang for this case).


More information about the lldb-commits mailing list