[PATCH] D26052: Modify DWARFFormValue to remember the DWARFUnit that it was decoded with.

Greg Clayton via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 27 17:17:07 PDT 2016


clayborg created this revision.
clayborg added reviewers: dblaikie, aprantl, echristo, llvm-commits, friss.
clayborg set the repository for this revision to rL LLVM.
Herald added a subscriber: mehdi_amini.

Modifying DWARFFormValue to remember the DWARFUnit that it was encoded with can simplify the usage of instances of this class. Previously users would have to try and pass in the same DWARFUnit that was used to decode the form value and there was a possibility that a different DWARFUnit might be supplied to the functions that extract values (strings, CU relative references, addresses) and cause problems. This fixes this potential issue by storing the DWARFUnit inside the DWARFFormValue so that this mistake can't be made. Instances of DWARFFormValue are not stored permanently and are used as temporary values, so the increase in size of an instance of DWARFFormValue isn't a big deal. This makes decoding form values more bullet proof and is a change that will be used by future modifications.


Repository:
  rL LLVM

https://reviews.llvm.org/D26052

Files:
  include/llvm/DebugInfo/DWARF/DWARFFormValue.h
  include/llvm/DebugInfo/DWARF/DWARFUnit.h
  lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp
  lib/DebugInfo/DWARF/DWARFDebugInfoEntry.cpp
  lib/DebugInfo/DWARF/DWARFFormValue.cpp
  lib/DebugInfo/DWARF/DWARFTypeUnit.cpp
  tools/dsymutil/DwarfLinker.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26052.76137.patch
Type: text/x-patch
Size: 14000 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161028/729f5aff/attachment.bin>


More information about the llvm-commits mailing list