]> granicus.if.org Git - llvm/commitdiff
DebugInfo: Remove extra attribute lookup
authorDavid Blaikie <dblaikie@gmail.com>
Sat, 22 Dec 2018 02:24:13 +0000 (02:24 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Sat, 22 Dec 2018 02:24:13 +0000 (02:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349985 91177308-0d34-0410-b5e6-96231b3b80d8

lib/DebugInfo/DWARF/DWARFDie.cpp

index e6018d9cf22e0c2cf2900c2e6309bcf684eb17f5..c3c5cd2b0e5c21a111c6ec9d23d7a1c995b9d90c 100644 (file)
@@ -353,10 +353,9 @@ static void dumpAttribute(raw_ostream &OS, const DWARFDie &Die,
     const DWARFObject &Obj = Die.getDwarfUnit()->getContext().getDWARFObj();
     // For DW_FORM_rnglistx we need to dump the offset separately, since
     // we have only dumped the index so far.
-    Optional<DWARFFormValue> Value = Die.find(DW_AT_ranges);
-    if (Value && Value->getForm() == DW_FORM_rnglistx)
+    if (formValue.getForm() == DW_FORM_rnglistx)
       if (auto RangeListOffset =
-              U->getRnglistOffset(*Value->getAsSectionOffset())) {
+              U->getRnglistOffset(*formValue.getAsSectionOffset())) {
         DWARFFormValue FV(dwarf::DW_FORM_sec_offset);
         FV.setUValue(*RangeListOffset);
         FV.dump(OS, DumpOpts);