[Lldb-commits] [PATCH] D62649: CompileUnit: Use shared_ptr for storing support file lists

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu May 30 02:19:07 PDT 2019


labath created this revision.
labath added reviewers: JDevlieghere, clayborg, aprantl.
Herald added a subscriber: jdoerfert.

This patch refactors the CompileUnit class to store the support files in
a shared_ptr, and changes the SymbolFiles to hand them out as such.

This allows the file lists to be shared between compile units, or
between other objects. The motivation for this is to enable
SymbolFileDWARF to keep a handle on the file lists it parses, so that it
can use it when processing type units (which will not be handed out as
lldb_private::CompileUnits). This will be implemented in follow-up
patch(es).

Since I was already changing the signature of this function, I made it
return an Expected<shared_ptr> and changed all the places that were
silently doing nothing to return an error. The CompileUnit class still
returns an empty file list in case the parsing failed, but it first
makes sure any errors get reported.


https://reviews.llvm.org/D62649

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62649.202140.patch
Type: text/x-patch
Size: 17900 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190530/51debbe1/attachment-0001.bin>


More information about the lldb-commits mailing list