summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/DebugInfo/PDB')
-rw-r--r--llvm/lib/DebugInfo/PDB/CMakeLists.txt6
-rw-r--r--llvm/lib/DebugInfo/PDB/PDB.cpp4
-rw-r--r--llvm/lib/DebugInfo/PDB/Raw/ByteStream.cpp1
-rw-r--r--llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp (renamed from llvm/lib/DebugInfo/PDB/Raw/PDBDbiStream.cpp)60
-rw-r--r--llvm/lib/DebugInfo/PDB/Raw/InfoStream.cpp (renamed from llvm/lib/DebugInfo/PDB/Raw/PDBInfoStream.cpp)19
-rw-r--r--llvm/lib/DebugInfo/PDB/Raw/MappedBlockStream.cpp1
-rw-r--r--llvm/lib/DebugInfo/PDB/Raw/ModInfo.cpp1
-rw-r--r--llvm/lib/DebugInfo/PDB/Raw/NameMap.cpp (renamed from llvm/lib/DebugInfo/PDB/Raw/PDBNameMap.cpp)11
-rw-r--r--llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp27
-rw-r--r--llvm/lib/DebugInfo/PDB/Raw/RawSession.cpp1
-rw-r--r--llvm/lib/DebugInfo/PDB/Raw/StreamReader.cpp1
11 files changed, 70 insertions, 62 deletions
diff --git a/llvm/lib/DebugInfo/PDB/CMakeLists.txt b/llvm/lib/DebugInfo/PDB/CMakeLists.txt
index 93960c8ec31..d6a3d2bf71c 100644
--- a/llvm/lib/DebugInfo/PDB/CMakeLists.txt
+++ b/llvm/lib/DebugInfo/PDB/CMakeLists.txt
@@ -31,9 +31,9 @@ add_pdb_impl_folder(Raw
Raw/MappedBlockStream.cpp
Raw/ModInfo.cpp
Raw/PDBFile.cpp
- Raw/PDBDbiStream.cpp
- Raw/PDBInfoStream.cpp
- Raw/PDBNameMap.cpp
+ Raw/DbiStream.cpp
+ Raw/InfoStream.cpp
+ Raw/NameMap.cpp
Raw/RawSession.cpp
Raw/StreamReader.cpp)
diff --git a/llvm/lib/DebugInfo/PDB/PDB.cpp b/llvm/lib/DebugInfo/PDB/PDB.cpp
index c4dd9820ed0..39b4b9480a8 100644
--- a/llvm/lib/DebugInfo/PDB/PDB.cpp
+++ b/llvm/lib/DebugInfo/PDB/PDB.cpp
@@ -25,7 +25,7 @@ PDB_ErrorCode llvm::loadDataForPDB(PDB_ReaderType Type, StringRef Path,
std::unique_ptr<IPDBSession> &Session) {
// Create the correct concrete instance type based on the value of Type.
if (Type == PDB_ReaderType::Raw)
- return RawSession::createFromPdb(Path, Session);
+ return pdb::RawSession::createFromPdb(Path, Session);
#if HAVE_DIA_SDK
return DIASession::createFromPdb(Path, Session);
@@ -38,7 +38,7 @@ PDB_ErrorCode llvm::loadDataForEXE(PDB_ReaderType Type, StringRef Path,
std::unique_ptr<IPDBSession> &Session) {
// Create the correct concrete instance type based on the value of Type.
if (Type == PDB_ReaderType::Raw)
- return RawSession::createFromExe(Path, Session);
+ return pdb::RawSession::createFromExe(Path, Session);
#if HAVE_DIA_SDK
return DIASession::createFromExe(Path, Session);
diff --git a/llvm/lib/DebugInfo/PDB/Raw/ByteStream.cpp b/llvm/lib/DebugInfo/PDB/Raw/ByteStream.cpp
index 20abe4c0d97..d8b78ec2248 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/ByteStream.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/ByteStream.cpp
@@ -11,6 +11,7 @@
#include "llvm/DebugInfo/PDB/Raw/StreamReader.h"
using namespace llvm;
+using namespace llvm::pdb;
ByteStream::ByteStream() : Owned(false) {}
diff --git a/llvm/lib/DebugInfo/PDB/Raw/PDBDbiStream.cpp b/llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp
index 6c15385a16c..7762fa34ceb 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/PDBDbiStream.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp
@@ -1,4 +1,4 @@
-//===- PDBDbiStream.cpp - PDB Dbi Stream (Stream 3) Access ----------------===//
+//===- DbiStream.cpp - PDB Dbi Stream (Stream 3) Access -------------------===//
//
// The LLVM Compiler Infrastructure
//
@@ -7,14 +7,15 @@
//
//===----------------------------------------------------------------------===//
-#include "llvm/DebugInfo/PDB/Raw/PDBDbiStream.h"
+#include "llvm/DebugInfo/PDB/Raw/DbiStream.h"
+#include "llvm/DebugInfo/PDB/Raw/InfoStream.h"
#include "llvm/DebugInfo/PDB/Raw/ModInfo.h"
#include "llvm/DebugInfo/PDB/Raw/PDBFile.h"
-#include "llvm/DebugInfo/PDB/Raw/PDBInfoStream.h"
-#include "llvm/DebugInfo/PDB/Raw/PDBRawConstants.h"
+#include "llvm/DebugInfo/PDB/Raw/RawConstants.h"
#include "llvm/DebugInfo/PDB/Raw/StreamReader.h"
using namespace llvm;
+using namespace llvm::pdb;
using namespace llvm::support;
namespace {
@@ -45,10 +46,10 @@ const uint16_t BuildMajorMask = 0x7F00;
const uint16_t BuildMajorShift = 8;
}
-struct PDBDbiStream::HeaderInfo {
+struct DbiStream::HeaderInfo {
little32_t VersionSignature;
ulittle32_t VersionHeader;
- ulittle32_t Age; // Should match PDBInfoStream.
+ ulittle32_t Age; // Should match InfoStream.
ulittle16_t GSSyms; // Number of global symbols
ulittle16_t BuildNumber; // See DbiBuildNo structure.
ulittle16_t PSSyms; // Number of public symbols
@@ -59,23 +60,23 @@ struct PDBDbiStream::HeaderInfo {
little32_t SecContrSubstreamSize; // Size of sec. contribution stream
little32_t SectionMapSize; // Size of sec. map substream
little32_t FileInfoSize; // Size of file info substream
- little32_t TypeServerSize; // Size of type server map
- ulittle32_t MFCTypeServerIndex; // Index of MFC Type Server
- little32_t OptionalDbgHdrSize; // Size of DbgHeader info
- little32_t ECSubstreamSize; // Size of EC stream (what is EC?)
- ulittle16_t Flags; // See DbiFlags enum.
- ulittle16_t MachineType; // See PDB_MachineType enum.
+ little32_t TypeServerSize; // Size of type server map
+ ulittle32_t MFCTypeServerIndex; // Index of MFC Type Server
+ little32_t OptionalDbgHdrSize; // Size of DbgHeader info
+ little32_t ECSubstreamSize; // Size of EC stream (what is EC?)
+ ulittle16_t Flags; // See DbiFlags enum.
+ ulittle16_t MachineType; // See PDB_MachineType enum.
ulittle32_t Reserved; // Pad to 64 bytes
};
-PDBDbiStream::PDBDbiStream(PDBFile &File) : Pdb(File), Stream(3, File) {
+DbiStream::DbiStream(PDBFile &File) : Pdb(File), Stream(3, File) {
static_assert(sizeof(HeaderInfo) == 64, "Invalid HeaderInfo size!");
}
-PDBDbiStream::~PDBDbiStream() {}
+DbiStream::~DbiStream() {}
-std::error_code PDBDbiStream::reload() {
+std::error_code DbiStream::reload() {
StreamReader Reader(Stream);
Header.reset(new HeaderInfo());
@@ -127,7 +128,8 @@ std::error_code PDBDbiStream::reload() {
for (auto Info : Range)
ModuleInfos.push_back(ModuleInfoEx(Info));
- if ((EC = SecContrSubstream.initialize(Reader, Header->SecContrSubstreamSize)))
+ if ((EC =
+ SecContrSubstream.initialize(Reader, Header->SecContrSubstreamSize)))
return EC;
if ((EC = SecMapSubstream.initialize(Reader, Header->SectionMapSize)))
return EC;
@@ -149,47 +151,45 @@ std::error_code PDBDbiStream::reload() {
return std::error_code();
}
-PdbRaw_DbiVer PDBDbiStream::getDbiVersion() const {
+PdbRaw_DbiVer DbiStream::getDbiVersion() const {
uint32_t Value = Header->VersionHeader;
return static_cast<PdbRaw_DbiVer>(Value);
}
-uint32_t PDBDbiStream::getAge() const { return Header->Age; }
+uint32_t DbiStream::getAge() const { return Header->Age; }
-bool PDBDbiStream::isIncrementallyLinked() const {
+bool DbiStream::isIncrementallyLinked() const {
return (Header->Flags & FlagIncrementalMask) != 0;
}
-bool PDBDbiStream::hasCTypes() const {
+bool DbiStream::hasCTypes() const {
return (Header->Flags & FlagHasCTypesMask) != 0;
}
-bool PDBDbiStream::isStripped() const {
+bool DbiStream::isStripped() const {
return (Header->Flags & FlagStrippedMask) != 0;
}
-uint16_t PDBDbiStream::getBuildMajorVersion() const {
+uint16_t DbiStream::getBuildMajorVersion() const {
return (Header->BuildNumber & BuildMajorMask) >> BuildMajorShift;
}
-uint16_t PDBDbiStream::getBuildMinorVersion() const {
+uint16_t DbiStream::getBuildMinorVersion() const {
return (Header->BuildNumber & BuildMinorMask) >> BuildMinorShift;
}
-uint32_t PDBDbiStream::getPdbDllVersion() const {
- return Header->PdbDllVersion;
-}
+uint32_t DbiStream::getPdbDllVersion() const { return Header->PdbDllVersion; }
-uint32_t PDBDbiStream::getNumberOfSymbols() const { return Header->SymRecords; }
+uint32_t DbiStream::getNumberOfSymbols() const { return Header->SymRecords; }
-PDB_Machine PDBDbiStream::getMachineType() const {
+PDB_Machine DbiStream::getMachineType() const {
uint16_t Machine = Header->MachineType;
return static_cast<PDB_Machine>(Machine);
}
-ArrayRef<ModuleInfoEx> PDBDbiStream::modules() const { return ModuleInfos; }
+ArrayRef<ModuleInfoEx> DbiStream::modules() const { return ModuleInfos; }
-std::error_code PDBDbiStream::initializeFileInfo() {
+std::error_code DbiStream::initializeFileInfo() {
struct FileInfoSubstreamHeader {
ulittle16_t NumModules; // Total # of modules, should match number of
// records in the ModuleInfo substream.
diff --git a/llvm/lib/DebugInfo/PDB/Raw/PDBInfoStream.cpp b/llvm/lib/DebugInfo/PDB/Raw/InfoStream.cpp
index 90397db45bc..c1b4737f21f 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/PDBInfoStream.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/InfoStream.cpp
@@ -1,4 +1,4 @@
-//===- PDBInfoStream.cpp - PDB Info Stream (Stream 1) Access ----*- C++ -*-===//
+//===- InfoStream.cpp - PDB Info Stream (Stream 1) Access -------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -7,16 +7,17 @@
//
//===----------------------------------------------------------------------===//
-#include "llvm/DebugInfo/PDB/Raw/PDBInfoStream.h"
+#include "llvm/DebugInfo/PDB/Raw/InfoStream.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/DebugInfo/PDB/Raw/StreamReader.h"
using namespace llvm;
+using namespace llvm::pdb;
-PDBInfoStream::PDBInfoStream(PDBFile &File) : Pdb(File), Stream(1, File) {}
+InfoStream::InfoStream(PDBFile &File) : Pdb(File), Stream(1, File) {}
-std::error_code PDBInfoStream::reload() {
+std::error_code InfoStream::reload() {
StreamReader Reader(Stream);
support::ulittle32_t Value;
@@ -38,19 +39,19 @@ std::error_code PDBInfoStream::reload() {
return std::error_code();
}
-uint32_t PDBInfoStream::getNamedStreamIndex(llvm::StringRef Name) const {
+uint32_t InfoStream::getNamedStreamIndex(llvm::StringRef Name) const {
uint32_t Result;
if (!NamedStreams.tryGetValue(Name, Result))
return 0;
return Result;
}
-PdbRaw_ImplVer PDBInfoStream::getVersion() const {
+PdbRaw_ImplVer InfoStream::getVersion() const {
return static_cast<PdbRaw_ImplVer>(Version);
}
-uint32_t PDBInfoStream::getSignature() const { return Signature; }
+uint32_t InfoStream::getSignature() const { return Signature; }
-uint32_t PDBInfoStream::getAge() const { return Age; }
+uint32_t InfoStream::getAge() const { return Age; }
-PDB_UniqueId PDBInfoStream::getGuid() const { return Guid; }
+PDB_UniqueId InfoStream::getGuid() const { return Guid; }
diff --git a/llvm/lib/DebugInfo/PDB/Raw/MappedBlockStream.cpp b/llvm/lib/DebugInfo/PDB/Raw/MappedBlockStream.cpp
index ed954bbed28..860f7639a06 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/MappedBlockStream.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/MappedBlockStream.cpp
@@ -11,6 +11,7 @@
#include "llvm/DebugInfo/PDB/Raw/PDBFile.h"
using namespace llvm;
+using namespace llvm::pdb;
MappedBlockStream::MappedBlockStream(uint32_t StreamIdx, const PDBFile &File) : Pdb(File) {
StreamLength = Pdb.getStreamByteSize(StreamIdx);
diff --git a/llvm/lib/DebugInfo/PDB/Raw/ModInfo.cpp b/llvm/lib/DebugInfo/PDB/Raw/ModInfo.cpp
index 4634cb08245..362c402c09b 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/ModInfo.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/ModInfo.cpp
@@ -12,6 +12,7 @@
#include "llvm/Support/Endian.h"
using namespace llvm;
+using namespace llvm::pdb;
using namespace llvm::support;
namespace {
diff --git a/llvm/lib/DebugInfo/PDB/Raw/PDBNameMap.cpp b/llvm/lib/DebugInfo/PDB/Raw/NameMap.cpp
index 4dd8cf0c7aa..28dc67a9d2a 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/PDBNameMap.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/NameMap.cpp
@@ -1,4 +1,4 @@
-//===- PDBNameMap.cpp - PDB Name Map ----------------------------*- C++ -*-===//
+//===- NameMap.cpp - PDB Name Map -------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -7,15 +7,16 @@
//
//===----------------------------------------------------------------------===//
-#include "llvm/DebugInfo/PDB/Raw/PDBNameMap.h"
+#include "llvm/DebugInfo/PDB/Raw/NameMap.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/DebugInfo/PDB/Raw/StreamReader.h"
using namespace llvm;
+using namespace llvm::pdb;
-PDBNameMap::PDBNameMap() {}
+NameMap::NameMap() {}
-std::error_code PDBNameMap::load(StreamReader &Stream) {
+std::error_code NameMap::load(StreamReader &Stream) {
// This is some sort of weird string-set/hash table encoded in the stream.
// It starts with the number of bytes in the table.
@@ -100,7 +101,7 @@ std::error_code PDBNameMap::load(StreamReader &Stream) {
return std::error_code();
}
-bool PDBNameMap::tryGetValue(StringRef Name, uint32_t &Value) const {
+bool NameMap::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/PDBFile.cpp b/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp
index 0adabfe625c..6e5f536cc70 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp
@@ -9,12 +9,13 @@
#include "llvm/DebugInfo/PDB/Raw/PDBFile.h"
#include "llvm/ADT/ArrayRef.h"
-#include "llvm/DebugInfo/PDB/Raw/PDBDbiStream.h"
-#include "llvm/DebugInfo/PDB/Raw/PDBInfoStream.h"
+#include "llvm/DebugInfo/PDB/Raw/DbiStream.h"
+#include "llvm/DebugInfo/PDB/Raw/InfoStream.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/MemoryBuffer.h"
using namespace llvm;
+using namespace llvm::pdb;
namespace {
static const char Magic[] = {'M', 'i', 'c', 'r', 'o', 's', 'o', 'f',
@@ -45,7 +46,7 @@ struct SuperBlock {
};
}
-struct llvm::PDBFileContext {
+struct llvm::pdb::PDBFileContext {
std::unique_ptr<MemoryBuffer> Buffer;
const SuperBlock *SB;
std::vector<uint32_t> StreamSizes;
@@ -244,18 +245,18 @@ llvm::ArrayRef<support::ulittle32_t> PDBFile::getDirectoryBlockArray() {
getNumDirectoryBlocks());
}
-PDBInfoStream &PDBFile::getPDBInfoStream() {
- if (!InfoStream) {
- InfoStream.reset(new PDBInfoStream(*this));
- InfoStream->reload();
+InfoStream &PDBFile::getPDBInfoStream() {
+ if (!Info) {
+ Info.reset(new InfoStream(*this));
+ Info->reload();
}
- return *InfoStream;
+ return *Info;
}
-PDBDbiStream &PDBFile::getPDBDbiStream() {
- if (!DbiStream) {
- DbiStream.reset(new PDBDbiStream(*this));
- DbiStream->reload();
+DbiStream &PDBFile::getPDBDbiStream() {
+ if (!Dbi) {
+ Dbi.reset(new DbiStream(*this));
+ Dbi->reload();
}
- return *DbiStream;
+ return *Dbi;
}
diff --git a/llvm/lib/DebugInfo/PDB/Raw/RawSession.cpp b/llvm/lib/DebugInfo/PDB/Raw/RawSession.cpp
index dcdbcb48933..330e439ed3a 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/RawSession.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/RawSession.cpp
@@ -18,6 +18,7 @@
#include "llvm/Support/MemoryBuffer.h"
using namespace llvm;
+using namespace llvm::pdb;
RawSession::RawSession(std::unique_ptr<PDBFile> PdbFile)
: Pdb(std::move(PdbFile)) {}
diff --git a/llvm/lib/DebugInfo/PDB/Raw/StreamReader.cpp b/llvm/lib/DebugInfo/PDB/Raw/StreamReader.cpp
index 707f77f5d73..42fe4521acf 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/StreamReader.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/StreamReader.cpp
@@ -10,6 +10,7 @@
#include "llvm/DebugInfo/PDB/Raw/StreamReader.h"
using namespace llvm;
+using namespace llvm::pdb;
StreamReader::StreamReader(const StreamInterface &S) : Stream(S), Offset(0) {}
OpenPOWER on IntegriCloud