[Lldb-commits] [PATCH] D18381: Decouple ClangASTContext from DWARF

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 22 15:23:00 PDT 2016


zturner created this revision.
zturner added a reviewer: clayborg.
zturner added a subscriber: lldb-commits.

This patch attempts to remove the coupling between `ClangASTContext` and DWARF debug information.  Previously, `TypeSystem` exposed a method called `GetDWARFParser`, which means that any TypeSystem had to have some concept of DWARF.  If we want to implement a PDB TypeSystem though, it doesn't make sense to support DWARF, and we don't want to go adding something like `GetPDBParser` to the generic `TypeSystem` either.  

This patch removes all of this code from `TypeSystem` and implements it specifically on `ClangASTContext`.  `SymbolFileDWARF` and related classes (which are all DWARF specific anyway) can now use llvm casting mechanics to check if the TypeSystem is a `ClangASTContext`, and if so it can use `GetDWARFParser`.  

In a followup patch, this will allow PDB and DWARF debug information to in theory live side by side for the same module.

This patch doesn't introduce a `PDBASTParser` yet, it just lays the framework to make this possible in a followup patch.

http://reviews.llvm.org/D18381

Files:
  include/lldb/Symbol/ClangASTContext.h
  include/lldb/Symbol/ClangTypeImportHelper.h
  include/lldb/Symbol/GoASTContext.h
  include/lldb/Symbol/JavaASTContext.h
  include/lldb/Symbol/SymbolFile.h
  include/lldb/Symbol/TypeSystem.h
  source/Plugins/SymbolFile/DWARF/DWARFASTParser.h
  source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
  source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  source/Symbol/CMakeLists.txt
  source/Symbol/ClangASTContext.cpp
  source/Symbol/ClangTypeImportHelper.cpp
  source/Symbol/GoASTContext.cpp
  source/Symbol/JavaASTContext.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18381.51356.patch
Type: text/x-patch
Size: 34545 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160322/b43a401b/attachment-0001.bin>


More information about the lldb-commits mailing list