summaryrefslogtreecommitdiff
path: root/include/llvm/DebugInfo/PDB/Native
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/DebugInfo/PDB/Native')
-rw-r--r--include/llvm/DebugInfo/PDB/Native/DbiModuleList.h22
-rw-r--r--include/llvm/DebugInfo/PDB/Native/Hash.h14
-rw-r--r--include/llvm/DebugInfo/PDB/Native/HashTable.h25
-rw-r--r--include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h23
-rw-r--r--include/llvm/DebugInfo/PDB/Native/ModuleDebugStreamBuilder.h0
-rw-r--r--include/llvm/DebugInfo/PDB/Native/NamedStreamMap.h15
-rw-r--r--include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h12
-rw-r--r--include/llvm/DebugInfo/PDB/Native/NativeSession.h10
8 files changed, 71 insertions, 50 deletions
diff --git a/include/llvm/DebugInfo/PDB/Native/DbiModuleList.h b/include/llvm/DebugInfo/PDB/Native/DbiModuleList.h
index 2885081628f6..5f6e7ab92a96 100644
--- a/include/llvm/DebugInfo/PDB/Native/DbiModuleList.h
+++ b/include/llvm/DebugInfo/PDB/Native/DbiModuleList.h
@@ -7,22 +7,23 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_DEBUGINFO_PDB_RAW_DBIMODULELIST_H
-#define LLVM_DEBUGINFO_PDB_RAW_DBIMODULELIST_H
+#ifndef LLVM_DEBUGINFO_PDB_NATIVE_DBIMODULELIST_H
+#define LLVM_DEBUGINFO_PDB_NATIVE_DBIMODULELIST_H
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/iterator.h"
-#include "llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h"
+#include "llvm/ADT/iterator_range.h"
#include "llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h"
#include "llvm/Support/BinaryStreamArray.h"
#include "llvm/Support/BinaryStreamRef.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Error.h"
+#include <cstddef>
#include <cstdint>
+#include <iterator>
#include <vector>
namespace llvm {
-namespace codeview {}
namespace pdb {
class DbiModuleList;
@@ -31,9 +32,9 @@ struct FileInfoSubstreamHeader;
class DbiModuleSourceFilesIterator
: public iterator_facade_base<DbiModuleSourceFilesIterator,
std::random_access_iterator_tag, StringRef> {
- typedef iterator_facade_base<DbiModuleSourceFilesIterator,
- std::random_access_iterator_tag, StringRef>
- BaseType;
+ using BaseType =
+ iterator_facade_base<DbiModuleSourceFilesIterator,
+ std::random_access_iterator_tag, StringRef>;
public:
DbiModuleSourceFilesIterator(const DbiModuleList &Modules, uint32_t Modi,
@@ -110,7 +111,8 @@ private:
BinaryStreamRef FileInfoSubstream;
BinaryStreamRef NamesBuffer;
};
-}
-}
-#endif // LLVM_DEBUGINFO_PDB_RAW_DBIMODULELIST_H \ No newline at end of file
+} // end namespace pdb
+} // end namespace llvm
+
+#endif // LLVM_DEBUGINFO_PDB_NATIVE_DBIMODULELIST_H
diff --git a/include/llvm/DebugInfo/PDB/Native/Hash.h b/include/llvm/DebugInfo/PDB/Native/Hash.h
index 0340554d7b0b..1f11d43ecdd4 100644
--- a/include/llvm/DebugInfo/PDB/Native/Hash.h
+++ b/include/llvm/DebugInfo/PDB/Native/Hash.h
@@ -7,19 +7,21 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_DEBUGINFO_PDB_RAW_HASH_H
-#define LLVM_DEBUGINFO_PDB_RAW_HASH_H
+#ifndef LLVM_DEBUGINFO_PDB_NATIVE_HASH_H
+#define LLVM_DEBUGINFO_PDB_NATIVE_HASH_H
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
-#include <stdint.h>
+#include <cstdint>
namespace llvm {
namespace pdb {
+
uint32_t hashStringV1(StringRef Str);
uint32_t hashStringV2(StringRef Str);
uint32_t hashBufferV8(ArrayRef<uint8_t> Data);
-}
-}
-#endif
+} // end namespace pdb
+} // end namespace llvm
+
+#endif // LLVM_DEBUGINFO_PDB_NATIVE_HASH_H
diff --git a/include/llvm/DebugInfo/PDB/Native/HashTable.h b/include/llvm/DebugInfo/PDB/Native/HashTable.h
index 46eefa968e52..05c70c4f2175 100644
--- a/include/llvm/DebugInfo/PDB/Native/HashTable.h
+++ b/include/llvm/DebugInfo/PDB/Native/HashTable.h
@@ -7,36 +7,36 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_DEBUGINFO_PDB_RAW_HASHTABLE_H
-#define LLVM_DEBUGINFO_PDB_RAW_HASHTABLE_H
+#ifndef LLVM_DEBUGINFO_PDB_NATIVE_HASHTABLE_H
+#define LLVM_DEBUGINFO_PDB_NATIVE_HASHTABLE_H
-#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SparseBitVector.h"
-#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/iterator.h"
-#include "llvm/Support/BinaryStreamArray.h"
-#include "llvm/Support/BinaryStreamReader.h"
-#include "llvm/Support/BinaryStreamWriter.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Error.h"
-#include "llvm/Support/MathExtras.h"
-
#include <cstdint>
+#include <iterator>
#include <utility>
+#include <vector>
namespace llvm {
+
+class BinaryStreamReader;
+class BinaryStreamWriter;
+
namespace pdb {
class HashTableIterator;
class HashTable {
friend class HashTableIterator;
+
struct Header {
support::ulittle32_t Size;
support::ulittle32_t Capacity;
};
- typedef std::vector<std::pair<uint32_t, uint32_t>> BucketList;
+ using BucketList = std::vector<std::pair<uint32_t, uint32_t>>;
public:
HashTable();
@@ -63,6 +63,7 @@ public:
protected:
bool isPresent(uint32_t K) const { return Present.test(K); }
bool isDeleted(uint32_t K) const { return Deleted.test(K); }
+
BucketList Buckets;
mutable SparseBitVector<> Present;
mutable SparseBitVector<> Deleted;
@@ -81,6 +82,7 @@ class HashTableIterator
: public iterator_facade_base<HashTableIterator, std::forward_iterator_tag,
std::pair<uint32_t, uint32_t>> {
friend class HashTable;
+
HashTableIterator(const HashTable &Map, uint32_t Index, bool IsEnd);
public:
@@ -101,6 +103,7 @@ private:
};
} // end namespace pdb
+
} // end namespace llvm
-#endif // LLVM_DEBUGINFO_PDB_RAW_HASHTABLE_H
+#endif // LLVM_DEBUGINFO_PDB_NATIVE_HASHTABLE_H
diff --git a/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h b/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h
index 5565cd5582bc..f413fd1b336e 100644
--- a/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h
+++ b/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h
@@ -1,4 +1,4 @@
-//===- ModuleDebugStream.h - PDB Module Info Stream Access ----------------===//
+//===- ModuleDebugStream.h - PDB Module Info Stream Access ------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -7,26 +7,26 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_DEBUGINFO_PDB_RAW_MODULEDEBUGSTREAM_H
-#define LLVM_DEBUGINFO_PDB_RAW_MODULEDEBUGSTREAM_H
+#ifndef LLVM_DEBUGINFO_PDB_NATIVE_MODULEDEBUGSTREAM_H
+#define LLVM_DEBUGINFO_PDB_NATIVE_MODULEDEBUGSTREAM_H
#include "llvm/ADT/iterator_range.h"
-#include "llvm/DebugInfo/CodeView/CVRecord.h"
#include "llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h"
#include "llvm/DebugInfo/CodeView/DebugSubsectionRecord.h"
#include "llvm/DebugInfo/CodeView/SymbolRecord.h"
#include "llvm/DebugInfo/MSF/MappedBlockStream.h"
-#include "llvm/Support/BinaryStreamArray.h"
#include "llvm/Support/BinaryStreamRef.h"
#include "llvm/Support/Error.h"
+#include <cstdint>
+#include <memory>
namespace llvm {
namespace pdb {
-class PDBFile;
+
class DbiModuleDescriptor;
class ModuleDebugStreamRef {
- typedef codeview::DebugSubsectionArray::Iterator DebugSubsectionIterator;
+ using DebugSubsectionIterator = codeview::DebugSubsectionArray::Iterator;
public:
ModuleDebugStreamRef(const DbiModuleDescriptor &Module,
@@ -50,7 +50,7 @@ public:
ModuleDebugStreamRef &operator=(ModuleDebugStreamRef &&Other) = default;
- llvm::iterator_range<DebugSubsectionIterator> subsections() const;
+ iterator_range<DebugSubsectionIterator> subsections() const;
bool hasDebugSubsections() const;
@@ -75,7 +75,8 @@ private:
codeview::DebugSubsectionArray Subsections;
};
-}
-}
-#endif
+} // end namespace pdb
+} // end namespace llvm
+
+#endif // LLVM_DEBUGINFO_PDB_NATIVE_MODULEDEBUGSTREAM_H
diff --git a/include/llvm/DebugInfo/PDB/Native/ModuleDebugStreamBuilder.h b/include/llvm/DebugInfo/PDB/Native/ModuleDebugStreamBuilder.h
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/include/llvm/DebugInfo/PDB/Native/ModuleDebugStreamBuilder.h
+++ /dev/null
diff --git a/include/llvm/DebugInfo/PDB/Native/NamedStreamMap.h b/include/llvm/DebugInfo/PDB/Native/NamedStreamMap.h
index d4206503e7dc..25f66240a6a2 100644
--- a/include/llvm/DebugInfo/PDB/Native/NamedStreamMap.h
+++ b/include/llvm/DebugInfo/PDB/Native/NamedStreamMap.h
@@ -7,27 +7,31 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_DEBUGINFO_PDB_RAW_PDBNAMEDSTREAMMAP_H
-#define LLVM_DEBUGINFO_PDB_RAW_PDBNAMEDSTREAMMAP_H
+#ifndef LLVM_DEBUGINFO_PDB_NATIVE_NAMEDSTREAMMAP_H
+#define LLVM_DEBUGINFO_PDB_NATIVE_NAMEDSTREAMMAP_H
+#include "llvm/ADT/Optional.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/iterator_range.h"
#include "llvm/DebugInfo/PDB/Native/HashTable.h"
#include "llvm/Support/Error.h"
#include <cstdint>
namespace llvm {
+
class BinaryStreamReader;
class BinaryStreamWriter;
namespace pdb {
-class NamedStreamMapBuilder;
+
class NamedStreamMap {
+ friend class NamedStreamMapBuilder;
+
struct FinalizationInfo {
uint32_t StringDataBytes = 0;
uint32_t SerializedLength = 0;
};
- friend NamedStreamMapBuilder;
public:
NamedStreamMap();
@@ -50,6 +54,7 @@ private:
};
} // end namespace pdb
+
} // end namespace llvm
-#endif // LLVM_DEBUGINFO_PDB_RAW_PDBNAMEDSTREAMMAP_H
+#endif // LLVM_DEBUGINFO_PDB_NATIVE_NAMEDSTREAMMAP_H
diff --git a/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h b/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h
index 5e4aaafff1a9..a24a972879d2 100644
--- a/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h
+++ b/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h
@@ -1,4 +1,4 @@
-//===- NativeRawSymbol.h - Native implementation of IPDBRawSymbol - C++ -*-===//
+//==- NativeRawSymbol.h - Native implementation of IPDBRawSymbol -*- C++ -*-==//
//
// The LLVM Compiler Infrastructure
//
@@ -11,6 +11,8 @@
#define LLVM_DEBUGINFO_PDB_NATIVE_NATIVERAWSYMBOL_H
#include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
+#include <cstdint>
+#include <memory>
namespace llvm {
namespace pdb {
@@ -36,7 +38,7 @@ public:
std::unique_ptr<IPDBEnumSymbols>
findInlineFramesByRVA(uint32_t RVA) const override;
- void getDataBytes(llvm::SmallVector<uint8_t, 32> &Bytes) const override;
+ void getDataBytes(SmallVector<uint8_t, 32> &Bytes) const override;
void getFrontEndVersion(VersionInfo &Version) const override;
void getBackEndVersion(VersionInfo &Version) const override;
PDB_MemberAccess getAccess() const override;
@@ -206,7 +208,7 @@ protected:
uint32_t SymbolId;
};
-}
-}
+} // end namespace pdb
+} // end namespace llvm
-#endif
+#endif // LLVM_DEBUGINFO_PDB_NATIVE_NATIVERAWSYMBOL_H
diff --git a/include/llvm/DebugInfo/PDB/Native/NativeSession.h b/include/llvm/DebugInfo/PDB/Native/NativeSession.h
index bbe207738e02..dd40874dc5f2 100644
--- a/include/llvm/DebugInfo/PDB/Native/NativeSession.h
+++ b/include/llvm/DebugInfo/PDB/Native/NativeSession.h
@@ -7,11 +7,13 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_DEBUGINFO_PDB_RAW_RAWSESSION_H
-#define LLVM_DEBUGINFO_PDB_RAW_RAWSESSION_H
+#ifndef LLVM_DEBUGINFO_PDB_NATIVE_NATIVESESSION_H
+#define LLVM_DEBUGINFO_PDB_NATIVE_NATIVESESSION_H
#include "llvm/ADT/StringRef.h"
#include "llvm/DebugInfo/PDB/IPDBSession.h"
+#include "llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h"
+#include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/Error.h"
@@ -30,6 +32,9 @@ public:
static Error createFromExe(StringRef Path,
std::unique_ptr<IPDBSession> &Session);
+ std::unique_ptr<PDBSymbolCompiland>
+ createCompilandSymbol(DbiModuleDescriptor MI);
+
uint64_t getLoadAddress() const override;
void setLoadAddress(uint64_t Address) override;
std::unique_ptr<PDBSymbolExe> getGlobalScope() override;
@@ -71,6 +76,7 @@ public:
private:
std::unique_ptr<PDBFile> Pdb;
std::unique_ptr<BumpPtrAllocator> Allocator;
+ std::vector<std::unique_ptr<NativeRawSymbol>> SymbolCache;
};
}
}