[lldb-dev] Compiler types and renamings

Greg Clayton via lldb-dev lldb-dev at lists.llvm.org
Thu Sep 17 10:20:31 PDT 2015


> On Sep 17, 2015, at 10:14 AM, Ryan Brown <ribrdb at google.com> wrote:
> 
> 
> 
> On Thu, Sep 17, 2015 at 10:06 AM Greg Clayton via lldb-dev <lldb-dev at lists.llvm.org> wrote:
> 
> > On Sep 17, 2015, at 3:08 AM, Bruce Mitchener <bruce.mitchener at gmail.com> wrote:
> >
> > Howdy!
> >
> > I was looking at some of the CompilerType changes and had some questions related to the recent cleanups and renamings.
> >
> >       • clang_type_t is a typedef for void* and is used for the opaque qual type code among other things. However, the m_type on CompilerType is just a void*.  Should we rename clang_type_t to compiler_type_t or just do away with it and use void* instead?
> 
> It might be a good idea to use something like "compiler_opaque_type_t" or just "opaque_t", which is a typedef to "void *". Then we can use this to CompilerDecl, CompilerDeclContext and CompilerType.
> 
> >       • SymbolFileDWARF has 2 typedefs, DIEToClangType and ClangTypeToDIE which are used for 2 maps, m_forward_decl_die_to_clang_type and m_forward_decl_clang_type_to_die. Should these be renamed to use Compiler instead of Clang?
> 
> They could be, but I really need to move these DIEToClangType and ClangTypeToDIE over into DWARFASTParserClang. The problem it is isn't saving the entire CompilerType it is just saving the clang_type_t and some other type system, like Go's TypeSystem, could actually make a CompilerType and use its type system and this "void *"... So this map is really just for Clang types. The reason it wasn't moved was we only have one DWARFASTParserClang when we have DWARF in .o files on MacOSX (we have a "a.out" executable and it points to N SymbolFileDWARF instances (one for each .o file where the .o files contain DWARF, but there is no DWARF in the main executable) so I didn't want to move this map over into DWARFASTParserClang since this would change things. So I vote to not rename it for now and let users know this is for clang types only...
> 
> Actually the DWARFASTParserGo is using this too.
> Is that a problem? It seems like each die should only be associated with one compile unit and hence one type system.
>  

Yes that is a problem if there is ever mixed Go and C/C++/ObjC in one binary. I would switch DWARFASTParserGo() to have its own cache and use it.

Greg


More information about the lldb-dev mailing list