[Lldb-commits] [PATCH] D63399: DWARF: Make DIERefs always valid

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jun 17 01:44:23 PDT 2019


labath created this revision.
labath added reviewers: JDevlieghere, clayborg, aprantl.
Herald added a subscriber: arphaman.
labath marked an inline comment as done.
labath added inline comments.


================
Comment at: source/Plugins/SymbolFile/DWARF/DIERef.cpp:1
 //===-- DIERef.cpp ----------------------------------------------*- C++ -*-===//
 //
----------------
I'm not deleting this file, because I'm going to add some stuff to it in the next patch in this series.


This patch makes the DIERef class always valid by default constructor
and operator bool. This allows one to express the validity of a DIERef
in the type system. Places which are working with potentially-invalid
DIERefs have been updated to use Optional<DIERef> instead.

The constructor taking a DWARFFormValue was not needed, as all places
which were constructing a DIERef this way were immediately converting it
into a DWARFDIE or a user_id. This can be done without constructing an
intermediate DIERef.


https://reviews.llvm.org/D63399

Files:
  source/Plugins/SymbolFile/DWARF/DIERef.cpp
  source/Plugins/SymbolFile/DWARF/DIERef.h
  source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp
  source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h
  source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
  source/Plugins/SymbolFile/DWARF/DWARFDIE.h
  source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
  source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
  source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h
  source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
  source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63399.205002.patch
Type: text/x-patch
Size: 24777 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190617/1222da77/attachment-0001.bin>


More information about the lldb-commits mailing list