summaryrefslogtreecommitdiff
path: root/lib/DebugInfo/DWARF/DWARFFormValue.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/DebugInfo/DWARF/DWARFFormValue.cpp')
-rw-r--r--lib/DebugInfo/DWARF/DWARFFormValue.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/DebugInfo/DWARF/DWARFFormValue.cpp b/lib/DebugInfo/DWARF/DWARFFormValue.cpp
index d63e84ef4e7d..c4abd49797b1 100644
--- a/lib/DebugInfo/DWARF/DWARFFormValue.cpp
+++ b/lib/DebugInfo/DWARF/DWARFFormValue.cpp
@@ -276,7 +276,8 @@ bool DWARFFormValue::isFormClass(DWARFFormValue::FormClass FC) const {
}
bool DWARFFormValue::extractValue(const DWARFDataExtractor &Data,
- uint32_t *OffsetPtr, const DWARFUnit *CU) {
+ uint32_t *OffsetPtr, DWARFFormParams FP,
+ const DWARFUnit *CU) {
U = CU;
bool Indirect = false;
bool IsBlock = false;
@@ -288,10 +289,8 @@ bool DWARFFormValue::extractValue(const DWARFDataExtractor &Data,
switch (Form) {
case DW_FORM_addr:
case DW_FORM_ref_addr: {
- if (!U)
- return false;
- uint16_t Size = (Form == DW_FORM_addr) ? U->getAddressByteSize()
- : U->getRefAddrByteSize();
+ uint16_t Size =
+ (Form == DW_FORM_addr) ? FP.AddrSize : FP.getRefAddrByteSize();
Value.uval = Data.getRelocatedValue(Size, OffsetPtr, &Value.SectionIndex);
break;
}
@@ -360,10 +359,8 @@ bool DWARFFormValue::extractValue(const DWARFDataExtractor &Data,
case DW_FORM_GNU_strp_alt:
case DW_FORM_line_strp:
case DW_FORM_strp_sup: {
- if (!U)
- return false;
Value.uval =
- Data.getRelocatedValue(U->getDwarfOffsetByteSize(), OffsetPtr);
+ Data.getRelocatedValue(FP.getDwarfOffsetByteSize(), OffsetPtr);
break;
}
case DW_FORM_flag_present: