summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARFDebugArangeSet.cpp
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2013-10-31 18:54:20 +0000
committerAlexey Samsonov <samsonov@google.com>2013-10-31 18:54:20 +0000
commitd3cba699c1a9eb7c98b3a96036ecdea0a16cadd2 (patch)
tree76b8029821fa186a2b994b918f3d8c460d4f91ec /llvm/lib/DebugInfo/DWARFDebugArangeSet.cpp
parenta1e0318c42e115d11aa7da2f5b28ce8b97e15b19 (diff)
downloadbcm5719-llvm-d3cba699c1a9eb7c98b3a96036ecdea0a16cadd2.tar.gz
bcm5719-llvm-d3cba699c1a9eb7c98b3a96036ecdea0a16cadd2.zip
DWARFDebugArangeSet: remove dead code
llvm-svn: 193785
Diffstat (limited to 'llvm/lib/DebugInfo/DWARFDebugArangeSet.cpp')
-rw-r--r--llvm/lib/DebugInfo/DWARFDebugArangeSet.cpp49
1 files changed, 0 insertions, 49 deletions
diff --git a/llvm/lib/DebugInfo/DWARFDebugArangeSet.cpp b/llvm/lib/DebugInfo/DWARFDebugArangeSet.cpp
index 7dff9ff49a6..229376e4a1c 100644
--- a/llvm/lib/DebugInfo/DWARFDebugArangeSet.cpp
+++ b/llvm/lib/DebugInfo/DWARFDebugArangeSet.cpp
@@ -20,32 +20,6 @@ void DWARFDebugArangeSet::clear() {
ArangeDescriptors.clear();
}
-void DWARFDebugArangeSet::compact() {
- if (ArangeDescriptors.empty())
- return;
-
- // Iterate through all arange descriptors and combine any ranges that
- // overlap or have matching boundaries. The ArangeDescriptors are assumed
- // to be in ascending order.
- uint32_t i = 0;
- while (i + 1 < ArangeDescriptors.size()) {
- if (ArangeDescriptors[i].getEndAddress() >= ArangeDescriptors[i+1].Address){
- // The current range ends at or exceeds the start of the next address
- // range. Compute the max end address between the two and use that to
- // make the new length.
- const uint64_t max_end_addr =
- std::max(ArangeDescriptors[i].getEndAddress(),
- ArangeDescriptors[i+1].getEndAddress());
- ArangeDescriptors[i].Length = max_end_addr - ArangeDescriptors[i].Address;
- // Now remove the next entry as it was just combined with the previous one
- ArangeDescriptors.erase(ArangeDescriptors.begin()+i+1);
- } else {
- // Discontiguous address range, just proceed to the next one.
- ++i;
- }
- }
-}
-
bool
DWARFDebugArangeSet::extract(DataExtractor data, uint32_t *offset_ptr) {
if (data.isValidOffset(*offset_ptr)) {
@@ -126,26 +100,3 @@ void DWARFDebugArangeSet::dump(raw_ostream &OS) const {
<< format(" 0x%*.*" PRIx64 ")\n",
hex_width, hex_width, pos->getEndAddress());
}
-
-
-namespace {
- class DescriptorContainsAddress {
- const uint64_t Address;
- public:
- DescriptorContainsAddress(uint64_t address) : Address(address) {}
- bool operator()(const DWARFDebugArangeSet::Descriptor &desc) const {
- return Address >= desc.Address && Address < (desc.Address + desc.Length);
- }
- };
-}
-
-uint32_t DWARFDebugArangeSet::findAddress(uint64_t address) const {
- DescriptorConstIter end = ArangeDescriptors.end();
- DescriptorConstIter pos =
- std::find_if(ArangeDescriptors.begin(), end, // Range
- DescriptorContainsAddress(address)); // Predicate
- if (pos != end)
- return HeaderData.CuOffset;
-
- return -1U;
-}
OpenPOWER on IntegriCloud