Allow DWARFFormValue::extractValue to be called with a null CU.
authorFrederic Riss <friss@apple.com>
Wed, 12 Nov 2014 23:48:04 +0000 (23:48 +0000)
committerFrederic Riss <friss@apple.com>
Wed, 12 Nov 2014 23:48:04 +0000 (23:48 +0000)
commit0275be3a972ecc9dd976232b024cdb366b1619e5
tree5778f6d2532b08608a0fea262ecd5cc47f05c9c7
parentf1faaf2e09e8342383795577224f8a3b7eb397a9
Allow DWARFFormValue::extractValue to be called with a null CU.

Currently FormValues are only used for attributes of DIEs and thus
uers always have a CU lying around when calling into the FormValue
API.
Accelerator tables encode their information using the same Forms
as the attributes, thus it is natural to use DWARFFormValue to
extract/dump them. There is no CU in that case though. Allow the
API to be called with a null CU arguemnt by making the RelocMap
lookup conditional on the CU pointer validity. And document this
new behvior in the header. (Test coverage for this use of the API
comes in the DwarfAccelTable support patch)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221835 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/DebugInfo/DWARFFormValue.h
lib/DebugInfo/DWARFFormValue.cpp