summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2014-04-18 20:30:27 +0000
committerAlexey Samsonov <samsonov@google.com>2014-04-18 20:30:27 +0000
commit4387550026dba56892261986efaa4e26955282d4 (patch)
treed7bb23979791af46b3e2a66b91def1088bfbc779 /lib
parent561edae83424f87ff86f033caf3bef6b0a54d23c (diff)
downloadllvm-4387550026dba56892261986efaa4e26955282d4.tar.gz
llvm-4387550026dba56892261986efaa4e26955282d4.tar.bz2
llvm-4387550026dba56892261986efaa4e26955282d4.tar.xz
[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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206641 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/DebugInfo/DWARFUnit.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/DebugInfo/DWARFUnit.cpp b/lib/DebugInfo/DWARFUnit.cpp
index 6b8d97ca6e..7aba46ca37 100644
--- a/lib/DebugInfo/DWARFUnit.cpp
+++ b/lib/DebugInfo/DWARFUnit.cpp
@@ -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