]> granicus.if.org Git - llvm/commit
Modify DWARFFormValue to remember the DWARFUnit that it was decoded with.
authorGreg Clayton <gclayton@apple.com>
Mon, 31 Oct 2016 16:46:02 +0000 (16:46 +0000)
committerGreg Clayton <gclayton@apple.com>
Mon, 31 Oct 2016 16:46:02 +0000 (16:46 +0000)
commit1a30f4b78e70baf06fcd49759b07e59dcb1bc3f9
treea8c52aa65befbb6381fae93d9c089b836f4ea78d
parentd3f04d331409b10609493a9b1dbed684f8164ac2
Modify DWARFFormValue to remember the DWARFUnit that it was decoded with.

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.

https://reviews.llvm.org/D26052

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285594 91177308-0d34-0410-b5e6-96231b3b80d8
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