OSDN Git Service

[dsymutil] Move string pool into its own implementatino file. NFC.
[android-x86/external-llvm.git] / tools / dsymutil / DwarfLinker.cpp
index e35e17c..6acf305 100644 (file)
@@ -4137,49 +4137,6 @@ bool DwarfLinker::link(const DebugMap &Map) {
   return Options.NoOutput ? true : Streamer->finish(Map);
 }
 
-DwarfStringPoolEntryRef NonRelocatableStringpool::getEntry(StringRef S) {
-  if (S.empty() && !Strings.empty())
-    return EmptyString;
-
-  auto I = Strings.insert(std::make_pair(S, DwarfStringPoolEntry()));
-  auto &Entry = I.first->second;
-  if (I.second || Entry.Index == -1U) {
-    Entry.Index = NumEntries++;
-    Entry.Offset = CurrentEndOffset;
-    Entry.Symbol = nullptr;
-    CurrentEndOffset += S.size() + 1;
-  }
-  return DwarfStringPoolEntryRef(*I.first);
-}
-
-uint32_t NonRelocatableStringpool::getStringOffset(StringRef S) {
-  return getEntry(S).getOffset();
-}
-
-/// Put \p S into the StringMap so that it gets permanent
-/// storage, but do not actually link it in the chain of elements
-/// that go into the output section. A latter call to
-/// getStringOffset() with the same string will chain it though.
-StringRef NonRelocatableStringpool::internString(StringRef S) {
-  DwarfStringPoolEntry Entry{nullptr, 0, -1U};
-  auto InsertResult = Strings.insert(std::make_pair(S, Entry));
-  return InsertResult.first->getKey();
-}
-
-std::vector<DwarfStringPoolEntryRef>
-NonRelocatableStringpool::getEntries() const {
-  std::vector<DwarfStringPoolEntryRef> Result;
-  Result.reserve(Strings.size());
-  for (const auto &E : Strings)
-    Result.emplace_back(E);
-  std::sort(
-      Result.begin(), Result.end(),
-      [](const DwarfStringPoolEntryRef A, const DwarfStringPoolEntryRef B) {
-        return A.getIndex() < B.getIndex();
-      });
-  return Result;
-}
-
 void warn(const Twine &Warning, const Twine &Context) {
   errs() << Twine("while processing ") + Context + ":\n";
   errs() << Twine("warning: ") + Warning + "\n";