summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp')
-rw-r--r--llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp33
1 files changed, 2 insertions, 31 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp b/llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp
index 1fa3bc09f4b..9d1d0708e08 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp
@@ -770,11 +770,6 @@ llvm::Error DWARFDebugNames::extract() {
return Error::success();
}
-iterator_range<DWARFDebugNames::ValueIterator>
-DWARFDebugNames::NameIndex::equal_range(StringRef Key) const {
- return make_range(ValueIterator(*this, Key), ValueIterator());
-}
-
LLVM_DUMP_METHOD void DWARFDebugNames::dump(raw_ostream &OS) const {
ScopedPrinter W(OS);
for (const NameIndex &NI : NameIndices)
@@ -849,44 +844,20 @@ void DWARFDebugNames::ValueIterator::next() {
if (getEntryAtCurrentOffset())
return;
- // If we're a local iterator, we're done.
- if (IsLocal) {
- setEnd();
- return;
- }
-
- // Otherwise, try the next index.
+ // Try the next Name Index.
++CurrentIndex;
searchFromStartOfCurrentIndex();
}
DWARFDebugNames::ValueIterator::ValueIterator(const DWARFDebugNames &AccelTable,
StringRef Key)
- : CurrentIndex(AccelTable.NameIndices.begin()), IsLocal(false), Key(Key) {
+ : CurrentIndex(AccelTable.NameIndices.begin()), Key(Key) {
searchFromStartOfCurrentIndex();
}
-DWARFDebugNames::ValueIterator::ValueIterator(
- const DWARFDebugNames::NameIndex &NI, StringRef Key)
- : CurrentIndex(&NI), IsLocal(true), Key(Key) {
- if (!findInCurrentIndex())
- setEnd();
-}
-
iterator_range<DWARFDebugNames::ValueIterator>
DWARFDebugNames::equal_range(StringRef Key) const {
if (NameIndices.empty())
return make_range(ValueIterator(), ValueIterator());
return make_range(ValueIterator(*this, Key), ValueIterator());
}
-
-const DWARFDebugNames::NameIndex *
-DWARFDebugNames::getCUNameIndex(uint32_t CUOffset) {
- if (CUToNameIndex.size() == 0 && NameIndices.size() > 0) {
- for (const auto &NI : *this) {
- for (uint32_t CU = 0; CU < NI.getCUCount(); ++CU)
- CUToNameIndex.try_emplace(NI.getCUOffset(CU), &NI);
- }
- }
- return CUToNameIndex.lookup(CUOffset);
-}
OpenPOWER on IntegriCloud