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)
llvm-svn: 349985

llvm/lib/DebugInfo/DWARF/DWARFDie.cpp

index e6018d9..c3c5cd2 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);