diff options
Diffstat (limited to 'include/llvm/DebugInfo/PDB')
-rw-r--r-- | include/llvm/DebugInfo/PDB/IPDBDataStream.h | 16 | ||||
-rw-r--r-- | include/llvm/DebugInfo/PDB/IPDBEnumChildren.h | 4 | ||||
-rw-r--r-- | include/llvm/DebugInfo/PDB/Native/DbiModuleList.h | 22 | ||||
-rw-r--r-- | include/llvm/DebugInfo/PDB/Native/Hash.h | 14 | ||||
-rw-r--r-- | include/llvm/DebugInfo/PDB/Native/HashTable.h | 25 | ||||
-rw-r--r-- | include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h | 23 | ||||
-rw-r--r-- | include/llvm/DebugInfo/PDB/Native/ModuleDebugStreamBuilder.h | 0 | ||||
-rw-r--r-- | include/llvm/DebugInfo/PDB/Native/NamedStreamMap.h | 15 | ||||
-rw-r--r-- | include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h | 12 | ||||
-rw-r--r-- | include/llvm/DebugInfo/PDB/Native/NativeSession.h | 10 | ||||
-rw-r--r-- | include/llvm/DebugInfo/PDB/PDB.h | 16 | ||||
-rw-r--r-- | include/llvm/DebugInfo/PDB/PDBExtras.h | 18 | ||||
-rw-r--r-- | include/llvm/DebugInfo/PDB/PDBTypes.h | 45 | ||||
-rw-r--r-- | include/llvm/DebugInfo/PDB/UDTLayout.h | 43 |
14 files changed, 141 insertions, 122 deletions
diff --git a/include/llvm/DebugInfo/PDB/IPDBDataStream.h b/include/llvm/DebugInfo/PDB/IPDBDataStream.h index 9594dc1591a7..67b5a06d7c59 100644 --- a/include/llvm/DebugInfo/PDB/IPDBDataStream.h +++ b/include/llvm/DebugInfo/PDB/IPDBDataStream.h @@ -1,4 +1,4 @@ -//===- IPDBDataStream.h - base interface for child enumerator -*- C++ ---*-===// +//===- IPDBDataStream.h - base interface for child enumerator ---*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -10,9 +10,10 @@ #ifndef LLVM_DEBUGINFO_PDB_IPDBDATASTREAM_H #define LLVM_DEBUGINFO_PDB_IPDBDATASTREAM_H -#include "PDBTypes.h" #include "llvm/ADT/Optional.h" #include "llvm/ADT/SmallVector.h" +#include <cstdint> +#include <string> namespace llvm { namespace pdb { @@ -22,18 +23,19 @@ namespace pdb { /// stream type. class IPDBDataStream { public: - typedef llvm::SmallVector<uint8_t, 32> RecordType; + using RecordType = SmallVector<uint8_t, 32>; virtual ~IPDBDataStream(); virtual uint32_t getRecordCount() const = 0; virtual std::string getName() const = 0; - virtual llvm::Optional<RecordType> getItemAtIndex(uint32_t Index) const = 0; + virtual Optional<RecordType> getItemAtIndex(uint32_t Index) const = 0; virtual bool getNext(RecordType &Record) = 0; virtual void reset() = 0; virtual IPDBDataStream *clone() const = 0; }; -} -} -#endif +} // end namespace pdb +} // end namespace llvm + +#endif // LLVM_DEBUGINFO_PDB_IPDBDATASTREAM_H diff --git a/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h b/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h index e48dc250822e..b6b7d95f6282 100644 --- a/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h +++ b/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h @@ -18,8 +18,8 @@ namespace pdb { template <typename ChildType> class IPDBEnumChildren { public: - typedef std::unique_ptr<ChildType> ChildTypePtr; - typedef IPDBEnumChildren<ChildType> MyType; + using ChildTypePtr = std::unique_ptr<ChildType>; + using MyType = IPDBEnumChildren<ChildType>; virtual ~IPDBEnumChildren() = default; 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; }; } } diff --git a/include/llvm/DebugInfo/PDB/PDB.h b/include/llvm/DebugInfo/PDB/PDB.h index 1f5a066b9a1b..9f9da39ca6cc 100644 --- a/include/llvm/DebugInfo/PDB/PDB.h +++ b/include/llvm/DebugInfo/PDB/PDB.h @@ -10,21 +10,23 @@ #ifndef LLVM_DEBUGINFO_PDB_PDB_H #define LLVM_DEBUGINFO_PDB_PDB_H -#include "PDBTypes.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/DebugInfo/PDB/PDBTypes.h" #include "llvm/Support/Error.h" #include <memory> -#include <system_error> namespace llvm { -class StringRef; - namespace pdb { +class IPDBSession; + Error loadDataForPDB(PDB_ReaderType Type, StringRef Path, std::unique_ptr<IPDBSession> &Session); Error loadDataForEXE(PDB_ReaderType Type, StringRef Path, std::unique_ptr<IPDBSession> &Session); -} -} -#endif + +} // end namespace pdb +} // end namespace llvm + +#endif // LLVM_DEBUGINFO_PDB_PDB_H diff --git a/include/llvm/DebugInfo/PDB/PDBExtras.h b/include/llvm/DebugInfo/PDB/PDBExtras.h index fc5787556a6d..3a38f21b94c8 100644 --- a/include/llvm/DebugInfo/PDB/PDBExtras.h +++ b/include/llvm/DebugInfo/PDB/PDBExtras.h @@ -1,4 +1,4 @@ -//===- PDBExtras.h - helper functions and classes for PDBs -------*- C++-*-===// +//===- PDBExtras.h - helper functions and classes for PDBs ------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -10,15 +10,17 @@ #ifndef LLVM_DEBUGINFO_PDB_PDBEXTRAS_H #define LLVM_DEBUGINFO_PDB_PDBEXTRAS_H -#include "PDBTypes.h" #include "llvm/DebugInfo/CodeView/CodeView.h" -#include "llvm/Support/raw_ostream.h" +#include "llvm/DebugInfo/PDB/PDBTypes.h" #include <unordered_map> namespace llvm { +class raw_ostream; + namespace pdb { -typedef std::unordered_map<PDB_SymType, int> TagStats; + +using TagStats = std::unordered_map<PDB_SymType, int>; raw_ostream &operator<<(raw_ostream &OS, const PDB_VariantType &Value); raw_ostream &operator<<(raw_ostream &OS, const PDB_CallingConv &Conv); @@ -37,7 +39,9 @@ raw_ostream &operator<<(raw_ostream &OS, const PDB_Machine &Machine); raw_ostream &operator<<(raw_ostream &OS, const Variant &Value); raw_ostream &operator<<(raw_ostream &OS, const VersionInfo &Version); raw_ostream &operator<<(raw_ostream &OS, const TagStats &Stats); -} -} -#endif +} // end namespace pdb + +} // end namespace llvm + +#endif // LLVM_DEBUGINFO_PDB_PDBEXTRAS_H diff --git a/include/llvm/DebugInfo/PDB/PDBTypes.h b/include/llvm/DebugInfo/PDB/PDBTypes.h index dd2fc4f2c55f..79ec7ce906d5 100644 --- a/include/llvm/DebugInfo/PDB/PDBTypes.h +++ b/include/llvm/DebugInfo/PDB/PDBTypes.h @@ -1,4 +1,4 @@ -//===- PDBTypes.h - Defines enums for various fields contained in PDB ---*-===// +//===- PDBTypes.h - Defines enums for various fields contained in PDB ----====// // // The LLVM Compiler Infrastructure // @@ -10,9 +10,10 @@ #ifndef LLVM_DEBUGINFO_PDB_PDBTYPES_H #define LLVM_DEBUGINFO_PDB_PDBTYPES_H -#include "llvm/Config/llvm-config.h" #include "llvm/DebugInfo/CodeView/CodeView.h" +#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h" #include "llvm/DebugInfo/PDB/Native/RawTypes.h" +#include <cstddef> #include <cstdint> #include <cstring> #include <functional> @@ -20,21 +21,11 @@ namespace llvm { namespace pdb { -class PDBSymDumper; -class PDBSymbol; - class IPDBDataStream; -template <class T> class IPDBEnumChildren; class IPDBLineNumber; -class IPDBRawSymbol; -class IPDBSession; class IPDBSourceFile; - -typedef IPDBEnumChildren<PDBSymbol> IPDBEnumSymbols; -typedef IPDBEnumChildren<IPDBSourceFile> IPDBEnumSourceFiles; -typedef IPDBEnumChildren<IPDBDataStream> IPDBEnumDataStreams; -typedef IPDBEnumChildren<IPDBLineNumber> IPDBEnumLineNumbers; - +class PDBSymDumper; +class PDBSymbol; class PDBSymbolExe; class PDBSymbolCompiland; class PDBSymbolCompilandDetails; @@ -67,6 +58,11 @@ class PDBSymbolTypeManaged; class PDBSymbolTypeDimension; class PDBSymbolUnknown; +using IPDBEnumSymbols = IPDBEnumChildren<PDBSymbol>; +using IPDBEnumSourceFiles = IPDBEnumChildren<IPDBSourceFile>; +using IPDBEnumDataStreams = IPDBEnumChildren<IPDBDataStream>; +using IPDBEnumLineNumbers = IPDBEnumChildren<IPDBLineNumber>; + /// Specifies which PDB reader implementation is to be used. Only a value /// of PDB_ReaderType::DIA is currently supported, but Native is in the works. enum class PDB_ReaderType { @@ -104,7 +100,7 @@ enum class PDB_Checksum { None = 0, MD5 = 1, SHA1 = 2 }; /// These values correspond to the CV_CPU_TYPE_e enumeration, and are documented /// here: https://msdn.microsoft.com/en-us/library/b2fc64ek.aspx -typedef codeview::CPUType PDB_Cpu; +using PDB_Cpu = codeview::CPUType; enum class PDB_Machine { Invalid = 0xffff, @@ -135,12 +131,11 @@ enum class PDB_Machine { /// at the following locations: /// https://msdn.microsoft.com/en-us/library/b2fc64ek.aspx /// https://msdn.microsoft.com/en-us/library/windows/desktop/ms680207(v=vs.85).aspx -/// -typedef codeview::CallingConvention PDB_CallingConv; +using PDB_CallingConv = codeview::CallingConvention; /// These values correspond to the CV_CFL_LANG enumeration, and are documented /// here: https://msdn.microsoft.com/en-us/library/bw3aekw6.aspx -typedef codeview::SourceLanguage PDB_Lang; +using PDB_Lang = codeview::SourceLanguage; /// These values correspond to the DataKind enumeration, and are documented /// here: https://msdn.microsoft.com/en-us/library/b2x2t313.aspx @@ -273,9 +268,9 @@ enum PDB_VariantType { }; struct Variant { - Variant() : Type(PDB_VariantType::Empty) {} + Variant() = default; - Variant(const Variant &Other) : Type(PDB_VariantType::Empty) { + Variant(const Variant &Other) { *this = Other; } @@ -284,7 +279,7 @@ struct Variant { delete[] Value.String; } - PDB_VariantType Type; + PDB_VariantType Type = PDB_VariantType::Empty; union { bool Bool; int8_t Int8; @@ -344,18 +339,20 @@ struct Variant { } }; +} // end namespace pdb } // end namespace llvm -} namespace std { + template <> struct hash<llvm::pdb::PDB_SymType> { - typedef llvm::pdb::PDB_SymType argument_type; - typedef std::size_t result_type; + using argument_type = llvm::pdb::PDB_SymType; + using result_type = std::size_t; result_type operator()(const argument_type &Arg) const { return std::hash<int>()(static_cast<int>(Arg)); } }; + } // end namespace std #endif // LLVM_DEBUGINFO_PDB_PDBTYPES_H diff --git a/include/llvm/DebugInfo/PDB/UDTLayout.h b/include/llvm/DebugInfo/PDB/UDTLayout.h index 6bc3660fbe51..c4234c191e21 100644 --- a/include/llvm/DebugInfo/PDB/UDTLayout.h +++ b/include/llvm/DebugInfo/PDB/UDTLayout.h @@ -10,30 +10,26 @@ #ifndef LLVM_DEBUGINFO_PDB_UDTLAYOUT_H #define LLVM_DEBUGINFO_PDB_UDTLAYOUT_H -#include "PDBSymbol.h" -#include "PDBTypes.h" - #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/BitVector.h" -#include "llvm/ADT/DenseMap.h" - -#include <list> +#include "llvm/ADT/StringRef.h" +#include "llvm/DebugInfo/PDB/PDBSymbol.h" +#include "llvm/DebugInfo/PDB/PDBSymbolData.h" +#include "llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h" +#include "llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h" +#include "llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h" +#include "llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h" +#include "llvm/DebugInfo/PDB/PDBTypes.h" +#include <cstdint> #include <memory> +#include <string> +#include <vector> namespace llvm { - -class raw_ostream; - namespace pdb { -class PDBSymTypeBaseClass; -class PDBSymbolData; -class PDBSymbolTypeUDT; -class PDBSymbolTypeVTable; - -class ClassLayout; class BaseClassLayout; -class LayoutItemBase; +class ClassLayout; class UDTLayoutBase; class LayoutItemBase { @@ -41,7 +37,7 @@ public: LayoutItemBase(const UDTLayoutBase *Parent, const PDBSymbol *Symbol, const std::string &Name, uint32_t OffsetInParent, uint32_t Size, bool IsElided); - virtual ~LayoutItemBase() {} + virtual ~LayoutItemBase() = default; uint32_t deepPaddingSize() const; virtual uint32_t immediatePadding() const { return 0; } @@ -79,7 +75,8 @@ public: VBPtrLayoutItem(const UDTLayoutBase &Parent, std::unique_ptr<PDBSymbolTypeBuiltin> Sym, uint32_t Offset, uint32_t Size); - virtual bool isVBPtr() const { return true; } + + bool isVBPtr() const override { return true; } private: std::unique_ptr<PDBSymbolTypeBuiltin> Type; @@ -120,17 +117,12 @@ public: bool IsElided); uint32_t tailPadding() const override; - ArrayRef<LayoutItemBase *> layout_items() const { return LayoutItems; } - ArrayRef<BaseClassLayout *> bases() const { return AllBases; } ArrayRef<BaseClassLayout *> regular_bases() const { return NonVirtualBases; } ArrayRef<BaseClassLayout *> virtual_bases() const { return VirtualBases; } - uint32_t directVirtualBaseCount() const { return DirectVBaseCount; } - ArrayRef<std::unique_ptr<PDBSymbolFunc>> funcs() const { return Funcs; } - ArrayRef<std::unique_ptr<PDBSymbol>> other_items() const { return Other; } protected: @@ -183,7 +175,8 @@ private: std::unique_ptr<PDBSymbolTypeUDT> OwnedStorage; const PDBSymbolTypeUDT &UDT; }; -} -} // namespace llvm + +} // end namespace pdb +} // end namespace llvm #endif // LLVM_DEBUGINFO_PDB_UDTLAYOUT_H |