summaryrefslogtreecommitdiffstats
path: root/llvm/tools/dsymutil/DwarfLinker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/dsymutil/DwarfLinker.cpp')
-rw-r--r--llvm/tools/dsymutil/DwarfLinker.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/tools/dsymutil/DwarfLinker.cpp b/llvm/tools/dsymutil/DwarfLinker.cpp
index 6818ed220d0..068bf22cc89 100644
--- a/llvm/tools/dsymutil/DwarfLinker.cpp
+++ b/llvm/tools/dsymutil/DwarfLinker.cpp
@@ -2136,19 +2136,19 @@ unsigned DwarfLinker::shouldKeepSubprogramDIE(
Flags |= TF_Keep;
- DWARFFormValue HighPcValue;
- if (!DIE.getAttributeValue(dwarf::DW_AT_high_pc, HighPcValue)) {
+ Optional<DWARFFormValue> HighPcValue;
+ if (!(HighPcValue = DIE.getAttributeValue(dwarf::DW_AT_high_pc))) {
reportWarning("Function without high_pc. Range will be discarded.\n",
&DIE);
return Flags;
}
uint64_t HighPc;
- if (HighPcValue.isFormClass(DWARFFormValue::FC_Address)) {
- HighPc = *HighPcValue.getAsAddress();
+ if (HighPcValue->isFormClass(DWARFFormValue::FC_Address)) {
+ HighPc = *HighPcValue->getAsAddress();
} else {
- assert(HighPcValue.isFormClass(DWARFFormValue::FC_Constant));
- HighPc = LowPc + *HighPcValue.getAsUnsignedConstant();
+ assert(HighPcValue->isFormClass(DWARFFormValue::FC_Constant));
+ HighPc = LowPc + *HighPcValue->getAsUnsignedConstant();
}
// Replace the debug map range with a more accurate one.
OpenPOWER on IntegriCloud