diff options
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/DebugInfo/PDB/CMakeLists.txt | 8 | ||||
| -rw-r--r-- | llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp | 1 | ||||
| -rw-r--r-- | llvm/lib/DebugInfo/PDB/Raw/InfoStreamBuilder.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/DebugInfo/PDB/Raw/NamedStreamMap.cpp (renamed from llvm/lib/DebugInfo/PDB/Raw/NameMap.cpp) | 13 | ||||
| -rw-r--r-- | llvm/lib/DebugInfo/PDB/Raw/NamedStreamMapBuilder.cpp (renamed from llvm/lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp) | 14 | ||||
| -rw-r--r-- | llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp | 16 | ||||
| -rw-r--r-- | llvm/lib/DebugInfo/PDB/Raw/StringTable.cpp (renamed from llvm/lib/DebugInfo/PDB/Raw/NameHashTable.cpp) | 18 | ||||
| -rw-r--r-- | llvm/lib/DebugInfo/PDB/Raw/StringTableBuilder.cpp (renamed from llvm/lib/DebugInfo/PDB/Raw/NameHashTableBuilder.cpp) | 16 |
8 files changed, 44 insertions, 44 deletions
diff --git a/llvm/lib/DebugInfo/PDB/CMakeLists.txt b/llvm/lib/DebugInfo/PDB/CMakeLists.txt index 43ae30fabb2..469886d23e8 100644 --- a/llvm/lib/DebugInfo/PDB/CMakeLists.txt +++ b/llvm/lib/DebugInfo/PDB/CMakeLists.txt @@ -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 diff --git a/llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp b/llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp index 4f4a0cf6578..cb390d2fa06 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp +++ b/llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp @@ -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" diff --git a/llvm/lib/DebugInfo/PDB/Raw/InfoStreamBuilder.cpp b/llvm/lib/DebugInfo/PDB/Raw/InfoStreamBuilder.cpp index 73fbf853b4f..50539658819 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/InfoStreamBuilder.cpp +++ b/llvm/lib/DebugInfo/PDB/Raw/InfoStreamBuilder.cpp @@ -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; } diff --git a/llvm/lib/DebugInfo/PDB/Raw/NameMap.cpp b/llvm/lib/DebugInfo/PDB/Raw/NamedStreamMap.cpp index b101f90f756..77077bc3738 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/NameMap.cpp +++ b/llvm/lib/DebugInfo/PDB/Raw/NamedStreamMap.cpp @@ -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; diff --git a/llvm/lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp b/llvm/lib/DebugInfo/PDB/Raw/NamedStreamMapBuilder.cpp index aead331d99d..886d2ffb331 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp +++ b/llvm/lib/DebugInfo/PDB/Raw/NamedStreamMapBuilder.cpp @@ -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> @@ -19,15 +19,15 @@ 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 diff --git a/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp b/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp index 53491518b8c..aef86c2ea99 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp +++ b/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp @@ -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(); } diff --git a/llvm/lib/DebugInfo/PDB/Raw/NameHashTable.cpp b/llvm/lib/DebugInfo/PDB/Raw/StringTable.cpp index 86784a7aa75..ed78cb42da6 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/NameHashTable.cpp +++ b/llvm/lib/DebugInfo/PDB/Raw/StringTable.cpp @@ -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; } diff --git a/llvm/lib/DebugInfo/PDB/Raw/NameHashTableBuilder.cpp b/llvm/lib/DebugInfo/PDB/Raw/StringTableBuilder.cpp index 2ef242515df..7284582d01a 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/NameHashTableBuilder.cpp +++ b/llvm/lib/DebugInfo/PDB/Raw/StringTableBuilder.cpp @@ -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)) |

