[llvm] r206641 - [DWARF parser] Respect address ranges specified in compile unit DIE.

Alexey Samsonov samsonov at google.com
Fri Apr 18 13:30:27 PDT 2014


Author: samsonov
Date: Fri Apr 18 15:30:27 2014
New Revision: 206641

URL: http://llvm.org/viewvc/llvm-project?rev=206641&view=rev
Log:
[DWARF parser] Respect address ranges specified in compile unit DIE.

When address ranges for compile unit are specified in compile unit DIE
itself, there is no need to collect ranges from children subprogram DIEs.

This change speeds up llvm-symbolizer on Clang-produced binaries with
full debug info. For instance, symbolizing a first address in a 1Gb binary
is now 2x faster (1s vs. 2s).

Modified:
    llvm/trunk/lib/DebugInfo/DWARFUnit.cpp

Modified: llvm/trunk/lib/DebugInfo/DWARFUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFUnit.cpp?rev=206641&r1=206640&r2=206641&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/DWARFUnit.cpp (original)
+++ llvm/trunk/lib/DebugInfo/DWARFUnit.cpp Fri Apr 18 15:30:27 2014
@@ -299,6 +299,13 @@ void DWARFUnit::clearDIEs(bool KeepCUDie
 }
 
 void DWARFUnit::collectAddressRanges(DWARFAddressRangesVector &CURanges) {
+  // First, check if CU DIE describes address ranges for the unit.
+  const auto &CUDIERanges = getCompileUnitDIE()->getAddressRanges(this);
+  if (!CUDIERanges.empty()) {
+    CURanges.insert(CURanges.end(), CUDIERanges.begin(), CUDIERanges.end());
+    return;
+  }
+
   // This function is usually called if there in no .debug_aranges section
   // in order to produce a compile unit level set of address ranges that
   // is accurate. If the DIEs weren't parsed, then we don't want all dies for





More information about the llvm-commits mailing list