[Lldb-commits] [PATCH] D56462: Change SymbolFile::ParseTypes to ParseTypesForCompileUnit

Zachary Turner via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 8 16:27:27 PST 2019


zturner created this revision.
zturner added reviewers: clayborg, labath, davide, jingham.
Herald added a subscriber: JDevlieghere.

The function `SymbolFile::ParseTypes` previously accepted a `SymbolContext`.  This makes it extremely difficult to implement faithfully, because you have to account for all possible combinations of members being set in the `SymbolContext`.  On the other hand, no clients of this function actually care about implementing this function to this strict of a standard.  AFAICT, there is actually only 1 client in the entire codebase, and it is the function `ParseAllDebugSymbols`, which is itself only called for testing purposes when dumping information.  At this call-site, the only field it sets is the `CompileUnit`, meaning that an implementer of a `SymbolFile` need not worry about any examining or handling any other fields which might be set.

By restricting this API to accept exactly a `CompileUnit&` and nothing more, we can simplify the life of new `SymbolFile` plugin implementers by making it clear exactly what the necessary and sufficient set of functionality they need to implement is, while at the same time removing some dead code that tried to handle other types of `SymbolContext` fields that were never going to be set anyway.


https://reviews.llvm.org/D56462

Files:
  lldb/include/lldb/Symbol/SymbolFile.h
  lldb/include/lldb/Symbol/SymbolVendor.h
  lldb/source/Core/Module.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
  lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
  lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
  lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
  lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
  lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
  lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h
  lldb/source/Symbol/SymbolVendor.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56462.180766.patch
Type: text/x-patch
Size: 10506 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190109/4f1df108/attachment.bin>


More information about the lldb-commits mailing list