diff options
author | Alexey Samsonov <samsonov@google.com> | 2014-04-18 17:25:46 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2014-04-18 17:25:46 +0000 |
commit | fe030f3dcdb5134c9b691c5a65977752d0b7addc (patch) | |
tree | a0ec55dd011461db4b62215312f3eee1db04103b /lib/DebugInfo/DWARFDebugRangeList.h | |
parent | 54850bedf20b85da4a2a7f3a77e6622f76417d03 (diff) | |
download | llvm-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/DWARFDebugRangeList.h')
-rw-r--r-- | lib/DebugInfo/DWARFDebugRangeList.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/DebugInfo/DWARFDebugRangeList.h b/lib/DebugInfo/DWARFDebugRangeList.h index 4e34a916f4..587b550a66 100644 --- a/lib/DebugInfo/DWARFDebugRangeList.h +++ b/lib/DebugInfo/DWARFDebugRangeList.h @@ -17,6 +17,9 @@ namespace llvm { class raw_ostream; +/// DWARFAddressRangesVector - represents a set of absolute address ranges. +typedef std::vector<std::pair<uint64_t, uint64_t>> DWARFAddressRangesVector; + class DWARFDebugRangeList { public: struct RangeListEntry { @@ -50,10 +53,6 @@ public: else return StartAddress == -1ULL; } - bool containsAddress(uint64_t BaseAddress, uint64_t Address) const { - return (BaseAddress + StartAddress <= Address) && - (Address < BaseAddress + EndAddress); - } }; private: @@ -67,10 +66,10 @@ public: void clear(); void dump(raw_ostream &OS) const; bool extract(DataExtractor data, uint32_t *offset_ptr); - /// containsAddress - Returns true if range list contains the given - /// address. Has to be passed base address of the compile unit that - /// references this range list. - bool containsAddress(uint64_t BaseAddress, uint64_t Address) const; + /// getAbsoluteRanges - Returns absolute address ranges defined by this range + /// list. Has to be passed base address of the compile unit referencing this + /// range list. + DWARFAddressRangesVector getAbsoluteRanges(uint64_t BaseAddress) const; }; } // namespace llvm |