[llvm] ab9d506 - [DWARF][Verifier][NFC] Use reference to DWARFAddressRangesVector to avoid copying.

Alexey Lapshin via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 19 06:25:08 PDT 2021


Author: Alexey Lapshin
Date: 2021-08-19T16:23:05+03:00
New Revision: ab9d506be36eb48f60d982ecbf8636f4b43a3399

URL: https://github.com/llvm/llvm-project/commit/ab9d506be36eb48f60d982ecbf8636f4b43a3399
DIFF: https://github.com/llvm/llvm-project/commit/ab9d506be36eb48f60d982ecbf8636f4b43a3399.diff

LOG: [DWARF][Verifier][NFC] Use reference to DWARFAddressRangesVector to avoid copying.

Avoid copying while access to RangesOrError.get().

Added: 
    

Modified: 
    llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
index c6e414a8eefe..bbf5e697a77c 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
@@ -401,7 +401,7 @@ unsigned DWARFVerifier::verifyDieRanges(const DWARFDie &Die,
     return NumErrors;
   }
 
-  DWARFAddressRangesVector Ranges = RangesOrError.get();
+  const DWARFAddressRangesVector &Ranges = RangesOrError.get();
   // Build RI for this DIE and check that ranges within this DIE do not
   // overlap.
   DieRangeInfo RI(Die);


        


More information about the llvm-commits mailing list