From: Fangrui Song Date: Wed, 17 Apr 2019 06:33:52 +0000 (+0000) Subject: [DWARF] Pass ReferenceToDIEOffsets elements by reference X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5611a9e3ab1002826ce58a4741b5931c8d30cdbf;p=llvm [DWARF] Pass ReferenceToDIEOffsets elements by reference git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358558 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/DebugInfo/DWARF/DWARFVerifier.cpp b/lib/DebugInfo/DWARF/DWARFVerifier.cpp index a95c4f982c0..5ff25b5209e 100644 --- a/lib/DebugInfo/DWARF/DWARFVerifier.cpp +++ b/lib/DebugInfo/DWARF/DWARFVerifier.cpp @@ -638,9 +638,9 @@ unsigned DWARFVerifier::verifyDebugInfoReferences() { // getting the DIE by offset and emitting an error OS << "Verifying .debug_info references...\n"; unsigned NumErrors = 0; - for (auto Pair : ReferenceToDIEOffsets) { - auto Die = DCtx.getDIEForOffset(Pair.first); - if (Die) + for (const std::pair> &Pair : + ReferenceToDIEOffsets) { + if (DCtx.getDIEForOffset(Pair.first)) continue; ++NumErrors; error() << "invalid DIE reference " << format("0x%08" PRIx64, Pair.first)