OSDN Git Service

[PDB] Rename some files to be more intuitive.
authorZachary Turner <zturner@google.com>
Fri, 20 Jan 2017 22:41:15 +0000 (22:41 +0000)
committerZachary Turner <zturner@google.com>
Fri, 20 Jan 2017 22:41:15 +0000 (22:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292663 91177308-0d34-0410-b5e6-96231b3b80d8

19 files changed:
include/llvm/DebugInfo/PDB/Raw/DbiStream.h
include/llvm/DebugInfo/PDB/Raw/InfoStream.h
include/llvm/DebugInfo/PDB/Raw/InfoStreamBuilder.h
include/llvm/DebugInfo/PDB/Raw/NamedStreamMap.h [moved from include/llvm/DebugInfo/PDB/Raw/NameMap.h with 70% similarity]
include/llvm/DebugInfo/PDB/Raw/NamedStreamMapBuilder.h [moved from include/llvm/DebugInfo/PDB/Raw/NameMapBuilder.h with 77% similarity]
include/llvm/DebugInfo/PDB/Raw/PDBFile.h
include/llvm/DebugInfo/PDB/Raw/RawTypes.h
include/llvm/DebugInfo/PDB/Raw/StringTable.h [moved from include/llvm/DebugInfo/PDB/Raw/NameHashTable.h with 82% similarity]
include/llvm/DebugInfo/PDB/Raw/StringTableBuilder.h [moved from include/llvm/DebugInfo/PDB/Raw/NameHashTableBuilder.h with 78% similarity]
lib/DebugInfo/PDB/CMakeLists.txt
lib/DebugInfo/PDB/Raw/DbiStream.cpp
lib/DebugInfo/PDB/Raw/InfoStreamBuilder.cpp
lib/DebugInfo/PDB/Raw/NamedStreamMap.cpp [moved from lib/DebugInfo/PDB/Raw/NameMap.cpp with 85% similarity]
lib/DebugInfo/PDB/Raw/NamedStreamMapBuilder.cpp [moved from lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp with 75% similarity]
lib/DebugInfo/PDB/Raw/PDBFile.cpp
lib/DebugInfo/PDB/Raw/StringTable.cpp [moved from lib/DebugInfo/PDB/Raw/NameHashTable.cpp with 85% similarity]
lib/DebugInfo/PDB/Raw/StringTableBuilder.cpp [moved from lib/DebugInfo/PDB/Raw/NameHashTableBuilder.cpp with 87% similarity]
unittests/DebugInfo/PDB/CMakeLists.txt
unittests/DebugInfo/PDB/StringTableBuilderTest.cpp [moved from unittests/DebugInfo/PDB/NameHashTableBuilderTest.cpp with 81% similarity]

index c97ca32..2228ca9 100644 (file)
@@ -16,9 +16,9 @@
 #include "llvm/DebugInfo/MSF/StreamRef.h"
 #include "llvm/DebugInfo/PDB/PDBTypes.h"
 #include "llvm/DebugInfo/PDB/Raw/ModInfo.h"
-#include "llvm/DebugInfo/PDB/Raw/NameHashTable.h"
 #include "llvm/DebugInfo/PDB/Raw/RawConstants.h"
 #include "llvm/DebugInfo/PDB/Raw/RawTypes.h"
+#include "llvm/DebugInfo/PDB/Raw/StringTable.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 
@@ -89,7 +89,7 @@ private:
   std::unique_ptr<msf::MappedBlockStream> Stream;
 
   std::vector<ModuleInfoEx> ModuleInfos;
-  NameHashTable ECNames;
+  StringTable ECNames;
 
   msf::ReadableStreamRef ModInfoSubstream;
   msf::ReadableStreamRef SecContrSubstream;
index 6b8b94f..11c7715 100644 (file)
@@ -13,7 +13,7 @@
 #include "llvm/ADT/StringMap.h"
 #include "llvm/DebugInfo/MSF/MappedBlockStream.h"
 #include "llvm/DebugInfo/PDB/PDBTypes.h"
-#include "llvm/DebugInfo/PDB/Raw/NameMap.h"
+#include "llvm/DebugInfo/PDB/Raw/NamedStreamMap.h"
 #include "llvm/DebugInfo/PDB/Raw/RawConstants.h"
 
 #include "llvm/Support/Endian.h"
@@ -61,7 +61,7 @@ private:
   // universally unique.
   PDB_UniqueId Guid;
 
-  NameMap NamedStreams;
+  NamedStreamMap NamedStreams;
 };
 }
 }
index cb60b1e..ab6a0c3 100644 (file)
@@ -14,7 +14,7 @@
 #include "llvm/Support/Error.h"
 
 #include "llvm/DebugInfo/PDB/PDBTypes.h"
-#include "llvm/DebugInfo/PDB/Raw/NameMapBuilder.h"
+#include "llvm/DebugInfo/PDB/Raw/NamedStreamMapBuilder.h"
 #include "llvm/DebugInfo/PDB/Raw/PDBFile.h"
 #include "llvm/DebugInfo/PDB/Raw/RawConstants.h"
 
@@ -37,7 +37,7 @@ public:
   void setAge(uint32_t A);
   void setGuid(PDB_UniqueId G);
 
-  NameMapBuilder &getNamedStreamsBuilder();
+  NamedStreamMapBuilder &getNamedStreamsBuilder();
 
   uint32_t calculateSerializedLength() const;
 
@@ -54,7 +54,7 @@ private:
   uint32_t Age;
   PDB_UniqueId Guid;
 
-  NameMapBuilder NamedStreams;
+  NamedStreamMapBuilder NamedStreams;
 };
 }
 }
similarity index 70%
rename from include/llvm/DebugInfo/PDB/Raw/NameMap.h
rename to include/llvm/DebugInfo/PDB/Raw/NamedStreamMap.h
index de1163b..088c53a 100644 (file)
@@ -1,4 +1,4 @@
-//===- NameMap.h - PDB Name Map ---------------------------------*- C++ -*-===//
+//===- NamedStreamMap.h - PDB Named Stream Map ------------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_DEBUGINFO_PDB_RAW_PDBNAMEMAP_H
-#define LLVM_DEBUGINFO_PDB_RAW_PDBNAMEMAP_H
+#ifndef LLVM_DEBUGINFO_PDB_RAW_PDBNAMEDSTREAMMAP_H
+#define LLVM_DEBUGINFO_PDB_RAW_PDBNAMEDSTREAMMAP_H
 
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
@@ -21,12 +21,12 @@ class StreamReader;
 class StreamWriter;
 }
 namespace pdb {
-class NameMapBuilder;
-class NameMap {
-  friend NameMapBuilder;
+class NamedStreamMapBuilder;
+class NamedStreamMap {
+  friend NamedStreamMapBuilder;
 
 public:
-  NameMap();
+  NamedStreamMap();
 
   Error load(msf::StreamReader &Stream);
 
@@ -41,4 +41,4 @@ private:
 } // end namespace pdb
 } // end namespace llvm
 
-#endif // LLVM_DEBUGINFO_PDB_RAW_PDBNAMEMAP_H
+#endif // LLVM_DEBUGINFO_PDB_RAW_PDBNAMEDSTREAMMAP_H
@@ -1,4 +1,4 @@
-//===- NameMapBuilder.h - PDB Name Map Builder ------------------*- C++ -*-===//
+//===- NamedStreamMapBuilder.h - PDB Named Stream Map Builder ---*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_DEBUGINFO_PDB_RAW_PDBNAMEMAPBUILDER_H
-#define LLVM_DEBUGINFO_PDB_RAW_PDBNAMEMAPBUILDER_H
+#ifndef LLVM_DEBUGINFO_PDB_RAW_PDBNAMEDSTREAMMAPBUILDER_H
+#define LLVM_DEBUGINFO_PDB_RAW_PDBNAMEDSTREAMMAPBUILDER_H
 
 #include "llvm/DebugInfo/PDB/Raw/HashTable.h"
 #include "llvm/Support/Error.h"
@@ -22,11 +22,10 @@ namespace msf {
 class StreamWriter;
 }
 namespace pdb {
-class NameMap;
 
-class NameMapBuilder {
+class NamedStreamMapBuilder {
 public:
-  NameMapBuilder();
+  NamedStreamMapBuilder();
 
   void addMapping(StringRef Name, uint32_t Mapping);
 
index 29f5b21..07c1dcf 100644 (file)
@@ -32,7 +32,7 @@ namespace pdb {
 class DbiStream;
 class GlobalsStream;
 class InfoStream;
-class NameHashTable;
+class StringTable;
 class PDBFileBuilder;
 class PublicsStream;
 class SymbolStream;
@@ -91,7 +91,7 @@ public:
   Expected<TpiStream &> getPDBIpiStream();
   Expected<PublicsStream &> getPDBPublicsStream();
   Expected<SymbolStream &> getPDBSymbolStream();
-  Expected<NameHashTable &> getStringTable();
+  Expected<StringTable &> getStringTable();
 
   BumpPtrAllocator &getAllocator() { return Allocator; }
 
@@ -125,7 +125,7 @@ public:
   std::unique_ptr<SymbolStream> Symbols;
   std::unique_ptr<msf::MappedBlockStream> DirectoryStream;
   std::unique_ptr<msf::MappedBlockStream> StringTableStream;
-  std::unique_ptr<NameHashTable> StringTable;
+  std::unique_ptr<StringTable> Strings;
 };
 }
 }
index 8497ed9..5f0a824 100644 (file)
@@ -303,13 +303,13 @@ struct InfoStreamHeader {
 };
 
 /// The header preceeding the /names stream.
-struct NameHashTableHeader {
+struct StringTableHeader {
   support::ulittle32_t Signature;
   support::ulittle32_t HashVersion;
   support::ulittle32_t ByteSize;
 };
 
-const uint32_t NameHashTableSignature = 0xEFFEEFFE;
+const uint32_t StringTableSignature = 0xEFFEEFFE;
 
 } // namespace pdb
 } // namespace llvm
@@ -1,4 +1,4 @@
-//===- NameHashTable.h - PDB Name Hash Table --------------------*- C++ -*-===//
+//===- StringTable.h - PDB String Table -------------------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_DEBUGINFO_PDB_RAW_NAMEHASHTABLE_H
-#define LLVM_DEBUGINFO_PDB_RAW_NAMEHASHTABLE_H
+#ifndef LLVM_DEBUGINFO_PDB_RAW_STRINGTABLE_H
+#define LLVM_DEBUGINFO_PDB_RAW_STRINGTABLE_H
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringRef.h"
@@ -25,9 +25,9 @@ class StreamReader;
 }
 namespace pdb {
 
-class NameHashTable {
+class StringTable {
 public:
-  NameHashTable();
+  StringTable();
 
   Error load(msf::StreamReader &Stream);
 
@@ -51,4 +51,4 @@ private:
 } // end namespace pdb
 } // end namespace llvm
 
-#endif // LLVM_DEBUGINFO_PDB_RAW_NAMEHASHTABLE_H
+#endif // LLVM_DEBUGINFO_PDB_RAW_STRINGTABLE_H
@@ -1,4 +1,4 @@
-//===- NameHashTableBuilder.h - PDB Name Hash Table Builder -----*- C++ -*-===//
+//===- StringTableBuilder.h - PDB String Table Builder ----------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -11,8 +11,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_DEBUGINFO_PDB_RAW_NAMEHASHTABLEBUILDER_H
-#define LLVM_DEBUGINFO_PDB_RAW_NAMEHASHTABLEBUILDER_H
+#ifndef LLVM_DEBUGINFO_PDB_RAW_STRINGTABLEBUILDER_H
+#define LLVM_DEBUGINFO_PDB_RAW_STRINGTABLEBUILDER_H
 
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/StringRef.h"
@@ -25,7 +25,7 @@ class StreamWriter;
 }
 namespace pdb {
 
-class NameHashTableBuilder {
+class StringTableBuilder {
 public:
   // If string S does not exist in the string table, insert it.
   // Returns the ID for S.
@@ -42,4 +42,4 @@ private:
 } // end namespace pdb
 } // end namespace llvm
 
-#endif // LLVM_DEBUGINFO_PDB_RAW_NAMEHASHTABLEBUILDER_H
+#endif // LLVM_DEBUGINFO_PDB_RAW_STRINGTABLEBUILDER_H
index 43ae30f..469886d 100644 (file)
@@ -39,15 +39,15 @@ add_pdb_impl_folder(Raw
   Raw/InfoStreamBuilder.cpp
   Raw/ModInfo.cpp
   Raw/ModStream.cpp
-  Raw/NameHashTable.cpp
-  Raw/NameHashTableBuilder.cpp
-  Raw/NameMap.cpp
-  Raw/NameMapBuilder.cpp
+  Raw/NamedStreamMap.cpp
+  Raw/NamedStreamMapBuilder.cpp
   Raw/PDBFile.cpp
   Raw/PDBFileBuilder.cpp
   Raw/PublicsStream.cpp
   Raw/RawError.cpp
   Raw/RawSession.cpp
+  Raw/StringTable.cpp
+  Raw/StringTableBuilder.cpp
   Raw/SymbolStream.cpp
   Raw/TpiHashing.cpp
   Raw/TpiStream.cpp
index 4f4a0cf..cb390d2 100644 (file)
@@ -16,7 +16,6 @@
 #include "llvm/DebugInfo/PDB/Raw/ISectionContribVisitor.h"
 #include "llvm/DebugInfo/PDB/Raw/InfoStream.h"
 #include "llvm/DebugInfo/PDB/Raw/ModInfo.h"
-#include "llvm/DebugInfo/PDB/Raw/NameHashTable.h"
 #include "llvm/DebugInfo/PDB/Raw/PDBFile.h"
 #include "llvm/DebugInfo/PDB/Raw/RawConstants.h"
 #include "llvm/DebugInfo/PDB/Raw/RawError.h"
index 73fbf85..5053965 100644 (file)
@@ -32,7 +32,7 @@ void InfoStreamBuilder::setAge(uint32_t A) { Age = A; }
 
 void InfoStreamBuilder::setGuid(PDB_UniqueId G) { Guid = G; }
 
-NameMapBuilder &InfoStreamBuilder::getNamedStreamsBuilder() {
+NamedStreamMapBuilder &InfoStreamBuilder::getNamedStreamsBuilder() {
   return NamedStreams;
 }
 
similarity index 85%
rename from lib/DebugInfo/PDB/Raw/NameMap.cpp
rename to lib/DebugInfo/PDB/Raw/NamedStreamMap.cpp
index b101f90..77077bc 100644 (file)
@@ -1,4 +1,4 @@
-//===- NameMap.cpp - PDB Name Map -------------------------------*- C++ -*-===//
+//===- NamedStreamMap.cpp - PDB Named Stream Map ----------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/DebugInfo/PDB/Raw/NameMap.h"
+#include "llvm/DebugInfo/PDB/Raw/NamedStreamMap.h"
 
 #include "llvm/ADT/SparseBitVector.h"
 #include "llvm/ADT/StringMap.h"
@@ -24,9 +24,9 @@ using namespace llvm;
 using namespace llvm::msf;
 using namespace llvm::pdb;
 
-NameMap::NameMap() = default;
+NamedStreamMap::NamedStreamMap() = default;
 
-Error NameMap::load(StreamReader &Stream) {
+Error NamedStreamMap::load(StreamReader &Stream) {
   uint32_t StringBufferSize;
   if (auto EC = Stream.readInteger(StringBufferSize))
     return joinErrors(std::move(EC),
@@ -63,12 +63,13 @@ Error NameMap::load(StreamReader &Stream) {
   return Error::success();
 }
 
-iterator_range<StringMapConstIterator<uint32_t>> NameMap::entries() const {
+iterator_range<StringMapConstIterator<uint32_t>>
+NamedStreamMap::entries() const {
   return make_range<StringMapConstIterator<uint32_t>>(Mapping.begin(),
                                                       Mapping.end());
 }
 
-bool NameMap::tryGetValue(StringRef Name, uint32_t &Value) const {
+bool NamedStreamMap::tryGetValue(StringRef Name, uint32_t &Value) const {
   auto Iter = Mapping.find(Name);
   if (Iter == Mapping.end())
     return false;
similarity index 75%
rename from lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp
rename to lib/DebugInfo/PDB/Raw/NamedStreamMapBuilder.cpp
index aead331..886d2ff 100644 (file)
@@ -1,4 +1,4 @@
-//===- NameMapBuilder.cpp - PDB Name Map Builder ----------------*- C++ -*-===//
+//===- NamedStreamMapBuilder.cpp - PDB Named Stream Map Builder -*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -7,10 +7,10 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "llvm/DebugInfo/PDB/Raw/NamedStreamMapBuilder.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/DebugInfo/MSF/StreamWriter.h"
-#include "llvm/DebugInfo/PDB/Raw/NameMap.h"
-#include "llvm/DebugInfo/PDB/Raw/NameMapBuilder.h"
+#include "llvm/DebugInfo/PDB/Raw/NamedStreamMap.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 #include <algorithm>
 using namespace llvm;
 using namespace llvm::pdb;
 
-NameMapBuilder::NameMapBuilder() = default;
+NamedStreamMapBuilder::NamedStreamMapBuilder() = default;
 
-void NameMapBuilder::addMapping(StringRef Name, uint32_t Mapping) {
+void NamedStreamMapBuilder::addMapping(StringRef Name, uint32_t Mapping) {
   Strings.push_back(Name);
   Map.set(Offset, Mapping);
   Offset += Name.size() + 1;
 }
 
-uint32_t NameMapBuilder::calculateSerializedLength() const {
+uint32_t NamedStreamMapBuilder::calculateSerializedLength() const {
   uint32_t TotalLength = 0;
 
   // Number of bytes of string data.
@@ -40,7 +40,7 @@ uint32_t NameMapBuilder::calculateSerializedLength() const {
   return TotalLength;
 }
 
-Error NameMapBuilder::commit(msf::StreamWriter &Writer) const {
+Error NamedStreamMapBuilder::commit(msf::StreamWriter &Writer) const {
   // The first field is the number of bytes of string data.  We've already been
   // keeping a running total of this in `Offset`.
   if (auto EC = Writer.writeInteger(Offset)) // Number of bytes of string data
index 5349151..aef86c2 100644 (file)
@@ -7,20 +7,20 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "llvm/DebugInfo/PDB/Raw/PDBFile.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/STLExtras.h"
-#include "llvm/DebugInfo/MSF/MappedBlockStream.h"
 #include "llvm/DebugInfo/MSF/MSFCommon.h"
+#include "llvm/DebugInfo/MSF/MappedBlockStream.h"
 #include "llvm/DebugInfo/MSF/StreamArray.h"
 #include "llvm/DebugInfo/MSF/StreamInterface.h"
 #include "llvm/DebugInfo/MSF/StreamReader.h"
 #include "llvm/DebugInfo/PDB/Raw/DbiStream.h"
 #include "llvm/DebugInfo/PDB/Raw/GlobalsStream.h"
 #include "llvm/DebugInfo/PDB/Raw/InfoStream.h"
-#include "llvm/DebugInfo/PDB/Raw/NameHashTable.h"
-#include "llvm/DebugInfo/PDB/Raw/PDBFile.h"
 #include "llvm/DebugInfo/PDB/Raw/PublicsStream.h"
 #include "llvm/DebugInfo/PDB/Raw/RawError.h"
+#include "llvm/DebugInfo/PDB/Raw/StringTable.h"
 #include "llvm/DebugInfo/PDB/Raw/SymbolStream.h"
 #include "llvm/DebugInfo/PDB/Raw/TpiStream.h"
 #include "llvm/Support/Endian.h"
@@ -323,8 +323,8 @@ Expected<SymbolStream &> PDBFile::getPDBSymbolStream() {
   return *Symbols;
 }
 
-Expected<NameHashTable &> PDBFile::getStringTable() {
-  if (!StringTable || !StringTableStream) {
+Expected<StringTable &> PDBFile::getStringTable() {
+  if (!Strings || !StringTableStream) {
     auto IS = getPDBInfoStream();
     if (!IS)
       return IS.takeError();
@@ -336,13 +336,13 @@ Expected<NameHashTable &> PDBFile::getStringTable() {
     if (!NS) return NS.takeError();
 
     StreamReader Reader(**NS);
-    auto N = llvm::make_unique<NameHashTable>();
+    auto N = llvm::make_unique<StringTable>();
     if (auto EC = N->load(Reader))
       return std::move(EC);
-    StringTable = std::move(N);
+    Strings = std::move(N);
     StringTableStream = std::move(*NS);
   }
-  return *StringTable;
+  return *Strings;
 }
 
 bool PDBFile::hasPDBDbiStream() const { return StreamDBI < getNumStreams(); }
similarity index 85%
rename from lib/DebugInfo/PDB/Raw/NameHashTable.cpp
rename to lib/DebugInfo/PDB/Raw/StringTable.cpp
index 86784a7..ed78cb4 100644 (file)
@@ -1,4 +1,4 @@
-//===- NameHashTable.cpp - PDB Name Hash Table ------------------*- C++ -*-===//
+//===- StringTable.cpp - PDB String Table -----------------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/DebugInfo/PDB/Raw/NameHashTable.h"
+#include "llvm/DebugInfo/PDB/Raw/StringTable.h"
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/DebugInfo/MSF/StreamReader.h"
@@ -21,14 +21,14 @@ using namespace llvm::msf;
 using namespace llvm::support;
 using namespace llvm::pdb;
 
-NameHashTable::NameHashTable() : Signature(0), HashVersion(0), NameCount(0) {}
+StringTable::StringTable() : Signature(0), HashVersion(0), NameCount(0) {}
 
-Error NameHashTable::load(StreamReader &Stream) {
-  const NameHashTableHeader *H;
+Error StringTable::load(StreamReader &Stream) {
+  const StringTableHeader *H;
   if (auto EC = Stream.readObject(H))
     return EC;
 
-  if (H->Signature != NameHashTableSignature)
+  if (H->Signature != StringTableSignature)
     return make_error<RawError>(raw_error_code::corrupt_file,
                                 "Invalid hash table signature");
   if (H->HashVersion != 1 && H->HashVersion != 2)
@@ -60,7 +60,7 @@ Error NameHashTable::load(StreamReader &Stream) {
   return Error::success();
 }
 
-StringRef NameHashTable::getStringForID(uint32_t ID) const {
+StringRef StringTable::getStringForID(uint32_t ID) const {
   if (ID == IDs[0])
     return StringRef();
 
@@ -75,7 +75,7 @@ StringRef NameHashTable::getStringForID(uint32_t ID) const {
   return Result;
 }
 
-uint32_t NameHashTable::getIDForString(StringRef Str) const {
+uint32_t StringTable::getIDForString(StringRef Str) const {
   uint32_t Hash = (HashVersion == 1) ? hashStringV1(Str) : hashStringV2(Str);
   size_t Count = IDs.size();
   uint32_t Start = Hash % Count;
@@ -94,6 +94,6 @@ uint32_t NameHashTable::getIDForString(StringRef Str) const {
   return IDs[0];
 }
 
-FixedStreamArray<support::ulittle32_t> NameHashTable::name_ids() const {
+FixedStreamArray<support::ulittle32_t> StringTable::name_ids() const {
   return IDs;
 }
@@ -1,4 +1,4 @@
-//===- NameHashTable.cpp - PDB Name Hash Table ------------------*- C++ -*-===//
+//===- StringTableBuilder.cpp - PDB String Table ----------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/DebugInfo/PDB/Raw/NameHashTableBuilder.h"
+#include "llvm/DebugInfo/PDB/Raw/StringTableBuilder.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/DebugInfo/MSF/StreamWriter.h"
 #include "llvm/DebugInfo/PDB/Raw/Hash.h"
@@ -19,7 +19,7 @@ using namespace llvm::support;
 using namespace llvm::support::endian;
 using namespace llvm::pdb;
 
-uint32_t NameHashTableBuilder::insert(StringRef S) {
+uint32_t StringTableBuilder::insert(StringRef S) {
   auto P = Strings.insert({S, StringSize});
 
   // If a given string didn't exist in the string table, we want to increment
@@ -38,9 +38,9 @@ static uint32_t computeBucketCount(uint32_t NumStrings) {
   return (NumStrings + 1) * 1.25;
 }
 
-uint32_t NameHashTableBuilder::calculateSerializedLength() const {
+uint32_t StringTableBuilder::calculateSerializedLength() const {
   uint32_t Size = 0;
-  Size += sizeof(NameHashTableHeader);
+  Size += sizeof(StringTableHeader);
   Size += StringSize;
   Size += 4; // Hash table begins with 4-byte size field.
 
@@ -51,10 +51,10 @@ uint32_t NameHashTableBuilder::calculateSerializedLength() const {
   return Size;
 }
 
-Error NameHashTableBuilder::commit(msf::StreamWriter &Writer) const {
+Error StringTableBuilder::commit(msf::StreamWriter &Writer) const {
   // Write a header
-  NameHashTableHeader H;
-  H.Signature = NameHashTableSignature;
+  StringTableHeader H;
+  H.Signature = StringTableSignature;
   H.HashVersion = 1;
   H.ByteSize = StringSize;
   if (auto EC = Writer.writeObject(H))
index 06695e3..3ba3196 100644 (file)
@@ -7,7 +7,7 @@ set(LLVM_LINK_COMPONENTS
 set(DebugInfoPDBSources
   HashTableTest.cpp
   MappedBlockStreamTest.cpp
-  NameHashTableBuilderTest.cpp
+  StringTableBuilderTest.cpp
   MSFBuilderTest.cpp
   PDBApiTest.cpp
   )
@@ -1,4 +1,4 @@
-//===- NameHashTableBuilderTest.cpp ---------------------------------------===//
+//===- StringTableBuilderTest.cpp -----------------------------------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -12,8 +12,8 @@
 #include "llvm/DebugInfo/MSF/ByteStream.h"
 #include "llvm/DebugInfo/MSF/StreamReader.h"
 #include "llvm/DebugInfo/MSF/StreamWriter.h"
-#include "llvm/DebugInfo/PDB/Raw/NameHashTable.h"
-#include "llvm/DebugInfo/PDB/Raw/NameHashTableBuilder.h"
+#include "llvm/DebugInfo/PDB/Raw/StringTable.h"
+#include "llvm/DebugInfo/PDB/Raw/StringTableBuilder.h"
 
 #include "gtest/gtest.h"
 
@@ -21,12 +21,12 @@ using namespace llvm;
 using namespace llvm::pdb;
 
 namespace {
-class NameHashTableBuilderTest : public ::testing::Test {};
+class StringTableBuilderTest : public ::testing::Test {};
 }
 
-TEST_F(NameHashTableBuilderTest, Simple) {
+TEST_F(StringTableBuilderTest, Simple) {
   // Create /names table contents.
-  NameHashTableBuilder Builder;
+  StringTableBuilder Builder;
   EXPECT_EQ(1U, Builder.insert("foo"));
   EXPECT_EQ(5U, Builder.insert("bar"));
   EXPECT_EQ(1U, Builder.insert("foo"));
@@ -40,7 +40,7 @@ TEST_F(NameHashTableBuilderTest, Simple) {
   // Reads the contents back.
   msf::ByteStream InStream(Buffer);
   msf::StreamReader Reader(InStream);
-  NameHashTable Table;
+  StringTable Table;
   EXPECT_NO_ERROR(Table.load(Reader));
 
   EXPECT_EQ(3U, Table.getNameCount());