summaryrefslogtreecommitdiff
path: root/lib/DebugInfo/DWARFDebugAranges.cpp
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2014-04-18 17:25:46 +0000
committerAlexey Samsonov <samsonov@google.com>2014-04-18 17:25:46 +0000
commitfe030f3dcdb5134c9b691c5a65977752d0b7addc (patch)
treea0ec55dd011461db4b62215312f3eee1db04103b /lib/DebugInfo/DWARFDebugAranges.cpp
parent54850bedf20b85da4a2a7f3a77e6622f76417d03 (diff)
downloadllvm-fe030f3dcdb5134c9b691c5a65977752d0b7addc.tar.gz
llvm-fe030f3dcdb5134c9b691c5a65977752d0b7addc.tar.bz2
llvm-fe030f3dcdb5134c9b691c5a65977752d0b7addc.tar.xz
[DWARF parser] Refactor fetching DIE address ranges.
Add a helper method to get address ranges specified in a DIE (either by DW_AT_low_pc/DW_AT_high_pc, or by DW_AT_ranges). Use it to untangle and simplify the code. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206624 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/DebugInfo/DWARFDebugAranges.cpp')
-rw-r--r--lib/DebugInfo/DWARFDebugAranges.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/DebugInfo/DWARFDebugAranges.cpp b/lib/DebugInfo/DWARFDebugAranges.cpp
index dfab7886b5..08864a0602 100644
--- a/lib/DebugInfo/DWARFDebugAranges.cpp
+++ b/lib/DebugInfo/DWARFDebugAranges.cpp
@@ -58,8 +58,13 @@ void DWARFDebugAranges::generate(DWARFContext *CTX) {
// manually build aranges for the rest of them.
for (const auto &CU : CTX->compile_units()) {
uint32_t CUOffset = CU->getOffset();
- if (ParsedCUOffsets.insert(CUOffset).second)
- CU->buildAddressRangeTable(this, true, CUOffset);
+ if (ParsedCUOffsets.insert(CUOffset).second) {
+ DWARFAddressRangesVector CURanges;
+ CU->collectAddressRanges(CURanges);
+ for (const auto &R : CURanges) {
+ appendRange(CUOffset, R.first, R.second);
+ }
+ }
}
sortAndMinimize();