Move pdb code into pdb namespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268544 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Zachary Turner 2016-05-04 20:32:13 +00:00
parent 7fa1a5ff6d
commit c95df94d5d
121 changed files with 275 additions and 87 deletions

View File

@ -15,6 +15,7 @@
#include <memory>
namespace llvm {
namespace pdb {
template <typename ChildType>
class ConcreteSymbolEnumerator : public IPDBEnumChildren<ChildType> {
@ -55,5 +56,6 @@ private:
std::unique_ptr<IPDBEnumSymbols> Enumerator;
};
}
}
#endif

View File

@ -14,6 +14,7 @@
#include "llvm/DebugInfo/PDB/IPDBDataStream.h"
namespace llvm {
namespace pdb {
class DIADataStream : public IPDBDataStream {
public:
explicit DIADataStream(CComPtr<IDiaEnumDebugStreamData> DiaStreamData);
@ -29,5 +30,6 @@ private:
CComPtr<IDiaEnumDebugStreamData> StreamData;
};
}
}
#endif

View File

@ -14,6 +14,7 @@
#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
namespace llvm {
namespace pdb {
class IPDBDataStream;
@ -31,5 +32,6 @@ private:
CComPtr<IDiaEnumDebugStreams> Enumerator;
};
}
}
#endif

View File

@ -14,7 +14,7 @@
#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
namespace llvm {
namespace pdb {
class IPDBLineNumber;
class DIAEnumLineNumbers : public IPDBEnumChildren<IPDBLineNumber> {
@ -31,5 +31,6 @@ private:
CComPtr<IDiaEnumLineNumbers> Enumerator;
};
}
}
#endif

View File

@ -14,7 +14,7 @@
#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
namespace llvm {
namespace pdb {
class DIASession;
class DIAEnumSourceFiles : public IPDBEnumChildren<IPDBSourceFile> {
@ -33,5 +33,6 @@ private:
CComPtr<IDiaEnumSourceFiles> Enumerator;
};
}
}
#endif

View File

@ -14,7 +14,7 @@
#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
namespace llvm {
namespace pdb {
class DIASession;
class DIAEnumSymbols : public IPDBEnumChildren<PDBSymbol> {
@ -33,5 +33,6 @@ private:
CComPtr<IDiaEnumSymbols> Enumerator;
};
}
}
#endif

View File

@ -14,6 +14,7 @@
#include "llvm/DebugInfo/PDB/IPDBLineNumber.h"
namespace llvm {
namespace pdb {
class DIALineNumber : public IPDBLineNumber {
public:
explicit DIALineNumber(CComPtr<IDiaLineNumber> DiaLineNumber);
@ -35,5 +36,5 @@ private:
CComPtr<IDiaLineNumber> LineNumber;
};
}
}
#endif

View File

@ -14,6 +14,7 @@
#include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
namespace llvm {
namespace pdb {
class DIASession;
class DIARawSymbol : public IPDBRawSymbol {
public:
@ -202,5 +203,6 @@ private:
CComPtr<IDiaSymbol> Symbol;
};
}
}
#endif

View File

@ -16,6 +16,7 @@
namespace llvm {
class StringRef;
namespace pdb {
class DIASession : public IPDBSession {
public:
explicit DIASession(CComPtr<IDiaSession> DiaSession);
@ -64,5 +65,5 @@ private:
CComPtr<IDiaSession> Session;
};
}
}
#endif

View File

@ -14,6 +14,7 @@
#include "llvm/DebugInfo/PDB/IPDBSourceFile.h"
namespace llvm {
namespace pdb {
class DIASession;
class DIASourceFile : public IPDBSourceFile {
@ -35,5 +36,6 @@ private:
CComPtr<IDiaSourceFile> SourceFile;
};
}
}
#endif

View File

@ -15,6 +15,7 @@
#include "llvm/ADT/SmallVector.h"
namespace llvm {
namespace pdb {
/// IPDBDataStream defines an interface used to represent a stream consisting
/// of a name and a series of records whose formats depend on the particular
@ -33,5 +34,6 @@ public:
virtual IPDBDataStream *clone() const = 0;
};
}
}
#endif

View File

@ -14,6 +14,7 @@
#include <memory>
namespace llvm {
namespace pdb {
template <typename ChildType> class IPDBEnumChildren {
public:
@ -29,5 +30,6 @@ public:
virtual MyType *clone() const = 0;
};
}
}
#endif

View File

@ -13,7 +13,7 @@
#include "PDBTypes.h"
namespace llvm {
namespace pdb {
class IPDBLineNumber {
public:
virtual ~IPDBLineNumber();
@ -32,5 +32,6 @@ public:
virtual bool isStatement() const = 0;
};
}
}
#endif

View File

@ -16,9 +16,10 @@
#include <memory>
namespace llvm {
class raw_ostream;
namespace pdb {
/// IPDBRawSymbol defines an interface used to represent an arbitrary symbol.
/// It exposes a monolithic interface consisting of accessors for the union of
/// all properties that are valid for any symbol type. This interface is then
@ -206,6 +207,7 @@ public:
virtual std::string getUnused() const = 0;
};
} // namespace pdb
} // namespace llvm
#endif

View File

@ -16,7 +16,7 @@
#include <memory>
namespace llvm {
namespace pdb {
class PDBSymbolCompiland;
class PDBSymbolExe;
@ -76,5 +76,6 @@ public:
virtual std::unique_ptr<IPDBEnumDataStreams> getDebugStreams() const = 0;
};
}
}
#endif

View File

@ -15,9 +15,10 @@
#include <string>
namespace llvm {
class raw_ostream;
namespace pdb {
/// IPDBSourceFile defines an interface used to represent source files whose
/// information are stored in the PDB.
class IPDBSourceFile {
@ -34,5 +35,6 @@ public:
getCompilands() const = 0;
};
}
}
#endif

View File

@ -16,11 +16,13 @@
namespace llvm {
class StringRef;
namespace pdb {
PDB_ErrorCode loadDataForPDB(PDB_ReaderType Type, StringRef Path,
std::unique_ptr<IPDBSession> &Session);
PDB_ErrorCode loadDataForEXE(PDB_ReaderType Type, StringRef Path,
std::unique_ptr<IPDBSession> &Session);
}
}
#endif

View File

@ -17,44 +17,46 @@ namespace llvm {
namespace object {
class COFFObjectFile;
}
/// PDBContext
/// This data structure is the top level entity that deals with PDB debug
/// information parsing. This data structure exists only when there is a
/// need for a transparent interface to different debug information formats
/// (e.g. PDB and DWARF). More control and power over the debug information
/// access can be had by using the PDB interfaces directly.
class PDBContext : public DIContext {
PDBContext(PDBContext &) = delete;
PDBContext &operator=(PDBContext &) = delete;
public:
PDBContext(const object::COFFObjectFile &Object,
std::unique_ptr<IPDBSession> PDBSession);
static bool classof(const DIContext *DICtx) {
return DICtx->getKind() == CK_PDB;
}
void dump(raw_ostream &OS, DIDumpType DumpType = DIDT_All,
bool DumpEH = false) override;
namespace pdb {
/// PDBContext
/// This data structure is the top level entity that deals with PDB debug
/// information parsing. This data structure exists only when there is a
/// need for a transparent interface to different debug information formats
/// (e.g. PDB and DWARF). More control and power over the debug information
/// access can be had by using the PDB interfaces directly.
class PDBContext : public DIContext {
DILineInfo getLineInfoForAddress(
uint64_t Address,
DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
DILineInfoTable getLineInfoForAddressRange(
uint64_t Address, uint64_t Size,
DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
DIInliningInfo getInliningInfoForAddress(
uint64_t Address,
DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
PDBContext(PDBContext &) = delete;
PDBContext &operator=(PDBContext &) = delete;
private:
std::string getFunctionName(uint64_t Address, DINameKind NameKind) const;
std::unique_ptr<IPDBSession> Session;
};
public:
PDBContext(const object::COFFObjectFile &Object,
std::unique_ptr<IPDBSession> PDBSession);
static bool classof(const DIContext *DICtx) {
return DICtx->getKind() == CK_PDB;
}
void dump(raw_ostream &OS, DIDumpType DumpType = DIDT_All,
bool DumpEH = false) override;
DILineInfo getLineInfoForAddress(
uint64_t Address,
DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
DILineInfoTable getLineInfoForAddressRange(
uint64_t Address, uint64_t Size,
DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
DIInliningInfo getInliningInfoForAddress(
uint64_t Address,
DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
private:
std::string getFunctionName(uint64_t Address, DINameKind NameKind) const;
std::unique_ptr<IPDBSession> Session;
};
}
}
#endif

View File

@ -15,6 +15,8 @@
#include <unordered_map>
namespace llvm {
namespace pdb {
typedef std::unordered_map<PDB_SymType, int> TagStats;
raw_ostream &operator<<(raw_ostream &OS, const PDB_VariantType &Value);
@ -35,5 +37,6 @@ 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

View File

@ -15,6 +15,7 @@
namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymDumper {
public:
@ -57,5 +58,6 @@ private:
bool RequireImpl;
};
}
}
#endif

View File

@ -25,9 +25,11 @@
namespace llvm {
class StringRef;
class IPDBRawSymbol;
class raw_ostream;
namespace pdb {
class IPDBRawSymbol;
#define DECLARE_PDB_SYMBOL_CONCRETE_TYPE(TagValue) \
static const PDB_SymType Tag = TagValue; \
static bool classof(const PDBSymbol *S) { return S->getSymTag() == Tag; }
@ -40,7 +42,8 @@ class raw_ostream;
/// https://msdn.microsoft.com/en-us/library/370hs6k4.aspx
class PDBSymbol {
protected:
PDBSymbol(const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol);
PDBSymbol(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
public:
static std::unique_ptr<PDBSymbol>
@ -93,5 +96,6 @@ protected:
};
} // namespace llvm
}
#endif

View File

@ -15,6 +15,7 @@
namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolAnnotation : public PDBSymbol {
public:
@ -33,5 +34,6 @@ public:
FORWARD_SYMBOL_METHOD(getVirtualAddress)
};
}
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLANNOTATION_H

View File

@ -16,6 +16,8 @@ namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolBlock : public PDBSymbol {
public:
PDBSymbolBlock(const IPDBSession &PDBSession,
@ -35,5 +37,6 @@ public:
FORWARD_SYMBOL_METHOD(getVirtualAddress)
};
}
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLBLOCK_H

View File

@ -17,6 +17,8 @@ namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolCompiland : public PDBSymbol {
public:
PDBSymbolCompiland(const IPDBSession &PDBSession,
@ -34,5 +36,6 @@ public:
std::string getSourceFileName() const;
};
}
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLCOMPILAND_H

View File

@ -16,6 +16,7 @@
namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolCompilandDetails : public PDBSymbol {
public:
@ -51,5 +52,6 @@ public:
};
} // namespace llvm
}
#endif // LLVM_DEBUGINFO_PDB_PDBFUNCTION_H

View File

@ -16,7 +16,7 @@
namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolCompilandEnv : public PDBSymbol {
public:
PDBSymbolCompilandEnv(const IPDBSession &PDBSession,
@ -32,5 +32,6 @@ public:
};
} // namespace llvm
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLCOMPILANDENV_H

View File

@ -18,6 +18,7 @@ namespace llvm {
class raw_ostream;
namespace pdb {
/// PDBSymbolCustom represents symbols that are compiler-specific and do not
/// fit anywhere else in the lexical hierarchy.
/// https://msdn.microsoft.com/en-us/library/d88sf09h.aspx
@ -34,5 +35,6 @@ public:
};
} // namespace llvm
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLCUSTOM_H

View File

@ -17,6 +17,8 @@ namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolData : public PDBSymbol {
public:
PDBSymbolData(const IPDBSession &PDBSession,
@ -56,5 +58,6 @@ public:
};
} // namespace llvm
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLDATA_H

View File

@ -17,6 +17,8 @@ namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolExe : public PDBSymbol {
public:
PDBSymbolExe(const IPDBSession &PDBSession,
@ -40,5 +42,6 @@ private:
int Indent) const;
};
} // namespace llvm
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLEXE_H

View File

@ -17,6 +17,8 @@ namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolFunc : public PDBSymbol {
public:
PDBSymbolFunc(const IPDBSession &PDBSession,
@ -75,5 +77,6 @@ public:
};
} // namespace llvm
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLFUNC_H

View File

@ -17,6 +17,8 @@ namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolFuncDebugEnd : public PDBSymbol {
public:
PDBSymbolFuncDebugEnd(const IPDBSession &PDBSession,
@ -44,5 +46,6 @@ public:
};
} // namespace llvm
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLFUNCDEBUGEND_H

View File

@ -16,6 +16,7 @@
namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolFuncDebugStart : public PDBSymbol {
public:
@ -44,5 +45,6 @@ public:
};
} // namespace llvm
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLFUNCDEBUGSTART_H

View File

@ -16,6 +16,7 @@
namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolLabel : public PDBSymbol {
public:
@ -44,5 +45,6 @@ public:
};
} // namespace llvm
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLLABEL_H

View File

@ -16,6 +16,7 @@
namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolPublicSymbol : public PDBSymbol {
public:
@ -42,5 +43,6 @@ public:
};
} // namespace llvm
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLPUBLICSYMBOL_H

View File

@ -16,6 +16,7 @@
namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolThunk : public PDBSymbol {
public:
@ -51,5 +52,6 @@ public:
FORWARD_SYMBOL_METHOD(isVolatileType)
};
} // namespace llvm
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLTHUNK_H

View File

@ -16,6 +16,7 @@
namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolTypeArray : public PDBSymbol {
public:
@ -40,5 +41,6 @@ public:
};
} // namespace llvm
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLTYPEARRAY_H

View File

@ -16,6 +16,7 @@
namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolTypeBaseClass : public PDBSymbol {
public:
@ -55,5 +56,6 @@ public:
};
} // namespace llvm
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLTYPEBASECLASS_H

View File

@ -16,6 +16,7 @@
namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolTypeBuiltin : public PDBSymbol {
public:
@ -35,5 +36,6 @@ public:
};
} // namespace llvm
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLTYPEBUILTIN_H

View File

@ -16,6 +16,7 @@
namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolTypeCustom : public PDBSymbol {
public:
@ -31,5 +32,6 @@ public:
};
} // namespace llvm
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLTYPECUSTOM_H

View File

@ -16,6 +16,7 @@
namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolTypeDimension : public PDBSymbol {
public:
@ -31,5 +32,6 @@ public:
};
} // namespace llvm
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLTYPEDIMENSION_H

View File

@ -16,6 +16,7 @@
namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolTypeEnum : public PDBSymbol {
public:
@ -50,5 +51,6 @@ public:
};
} // namespace llvm
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLTYPEENUM_H

View File

@ -16,6 +16,7 @@
namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolTypeFriend : public PDBSymbol {
public:
@ -32,5 +33,6 @@ public:
};
} // namespace llvm
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLTYPEFRIEND_H

View File

@ -16,6 +16,7 @@
namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolTypeFunctionArg : public PDBSymbol {
public:
@ -32,5 +33,6 @@ public:
};
} // namespace llvm
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLTYPEFUNCTIONARG_H

View File

@ -16,6 +16,7 @@
namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolTypeFunctionSig : public PDBSymbol {
public:
@ -45,5 +46,6 @@ public:
};
} // namespace llvm
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLTYPEFUNCTIONSIG_H

View File

@ -16,6 +16,7 @@
namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolTypeManaged : public PDBSymbol {
public:
@ -30,5 +31,6 @@ public:
};
} // namespace llvm
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLTYPEMANAGED_H

View File

@ -16,6 +16,7 @@
namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolTypePointer : public PDBSymbol {
public:
@ -38,5 +39,6 @@ public:
};
} // namespace llvm
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLTYPEPOINTER_H

View File

@ -16,6 +16,7 @@
namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolTypeTypedef : public PDBSymbol {
public:
@ -49,5 +50,6 @@ public:
};
} // namespace llvm
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLTYPETYPEDEF_H

View File

@ -17,6 +17,7 @@ namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolTypeUDT : public PDBSymbol {
public:
PDBSymbolTypeUDT(const IPDBSession &PDBSession,
@ -45,7 +46,7 @@ public:
FORWARD_SYMBOL_METHOD(getVirtualTableShapeId)
FORWARD_SYMBOL_METHOD(isVolatileType)
};
}
} // namespace llvm
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLTYPEUDT_H

View File

@ -16,6 +16,7 @@
namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolTypeVTable : public PDBSymbol {
public:
@ -35,5 +36,6 @@ public:
};
} // namespace llvm
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLTYPEVTABLE_H

View File

@ -16,6 +16,7 @@
namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolTypeVTableShape : public PDBSymbol {
public:
@ -34,5 +35,6 @@ public:
};
} // namespace llvm
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLTYPEVTABLESHAPE_H

View File

@ -15,6 +15,7 @@
namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolUnknown : public PDBSymbol {
public:
@ -30,5 +31,6 @@ public:
};
} // namespace llvm
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLUNKNOWN_H

View File

@ -16,6 +16,7 @@
namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolUsingNamespace : public PDBSymbol {
public:
@ -31,5 +32,6 @@ public:
};
} // namespace llvm
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLUSINGNAMESPACE_H

View File

@ -17,6 +17,7 @@
#include <cstring>
namespace llvm {
namespace pdb {
class PDBSymDumper;
class PDBSymbol;
@ -355,9 +356,7 @@ enum PDB_VariantType {
};
struct Variant {
Variant()
: Type(PDB_VariantType::Empty) {
}
Variant() : Type(PDB_VariantType::Empty) {}
Variant(const Variant &Other) : Type(PDB_VariantType::Empty) {
*this = Other;
@ -429,10 +428,11 @@ struct Variant {
};
} // end namespace llvm
}
namespace std {
template <> struct hash<llvm::PDB_SymType> {
typedef llvm::PDB_SymType argument_type;
template <> struct hash<llvm::pdb::PDB_SymType> {
typedef llvm::pdb::PDB_SymType argument_type;
typedef std::size_t result_type;
result_type operator()(const argument_type &Arg) const {

View File

@ -12,6 +12,7 @@
#include "llvm/Support/ConvertUTF.h"
using namespace llvm;
using namespace llvm::pdb;
DIADataStream::DIADataStream(CComPtr<IDiaEnumDebugStreamData> DiaStreamData)
: StreamData(DiaStreamData) {}

View File

@ -12,6 +12,7 @@
#include "llvm/DebugInfo/PDB/DIA/DIAEnumDebugStreams.h"
using namespace llvm;
using namespace llvm::pdb;
DIAEnumDebugStreams::DIAEnumDebugStreams(
CComPtr<IDiaEnumDebugStreams> DiaEnumerator)

View File

@ -12,6 +12,7 @@
#include "llvm/DebugInfo/PDB/DIA/DIALineNumber.h"
using namespace llvm;
using namespace llvm::pdb;
DIAEnumLineNumbers::DIAEnumLineNumbers(
CComPtr<IDiaEnumLineNumbers> DiaEnumerator)

View File

@ -12,6 +12,7 @@
#include "llvm/DebugInfo/PDB/DIA/DIASourceFile.h"
using namespace llvm;
using namespace llvm::pdb;
DIAEnumSourceFiles::DIAEnumSourceFiles(
const DIASession &PDBSession, CComPtr<IDiaEnumSourceFiles> DiaEnumerator)

View File

@ -13,6 +13,7 @@
#include "llvm/DebugInfo/PDB/DIA/DIASession.h"
using namespace llvm;
using namespace llvm::pdb;
DIAEnumSymbols::DIAEnumSymbols(const DIASession &PDBSession,
CComPtr<IDiaEnumSymbols> DiaEnumerator)

View File

@ -10,6 +10,7 @@
#include "llvm/DebugInfo/PDB/DIA/DIALineNumber.h"
using namespace llvm;
using namespace llvm::pdb;
DIALineNumber::DIALineNumber(CComPtr<IDiaLineNumber> DiaLineNumber)
: LineNumber(DiaLineNumber) {}

View File

@ -17,6 +17,7 @@
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
using namespace llvm::pdb;
namespace {
Variant VariantFromVARIANT(const VARIANT &V) {

View File

@ -21,6 +21,7 @@
#include <diacreate.h>
using namespace llvm;
using namespace llvm::pdb;
namespace {

View File

@ -16,6 +16,7 @@
#include "llvm/Support/ConvertUTF.h"
using namespace llvm;
using namespace llvm::pdb;
DIASourceFile::DIASourceFile(const DIASession &PDBSession,
CComPtr<IDiaSourceFile> DiaSourceFile)

View File

@ -14,6 +14,7 @@
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
using namespace llvm::pdb;
IPDBSourceFile::~IPDBSourceFile() {}

View File

@ -20,12 +20,13 @@
#include "llvm/DebugInfo/PDB/Raw/RawSession.h"
using namespace llvm;
using namespace llvm::pdb;
PDB_ErrorCode llvm::loadDataForPDB(PDB_ReaderType Type, StringRef Path,
std::unique_ptr<IPDBSession> &Session) {
PDB_ErrorCode llvm::pdb::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 pdb::RawSession::createFromPdb(Path, Session);
return RawSession::createFromPdb(Path, Session);
#if HAVE_DIA_SDK
return DIASession::createFromPdb(Path, Session);
@ -34,11 +35,11 @@ PDB_ErrorCode llvm::loadDataForPDB(PDB_ReaderType Type, StringRef Path,
#endif
}
PDB_ErrorCode llvm::loadDataForEXE(PDB_ReaderType Type, StringRef Path,
std::unique_ptr<IPDBSession> &Session) {
PDB_ErrorCode llvm::pdb::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 pdb::RawSession::createFromExe(Path, Session);
return RawSession::createFromExe(Path, Session);
#if HAVE_DIA_SDK
return DIASession::createFromExe(Path, Session);

View File

@ -19,6 +19,7 @@
using namespace llvm;
using namespace llvm::object;
using namespace llvm::pdb;
PDBContext::PDBContext(const COFFObjectFile &Object,
std::unique_ptr<IPDBSession> PDBSession)

View File

@ -12,6 +12,7 @@
#include "llvm/ADT/ArrayRef.h"
using namespace llvm;
using namespace llvm::pdb;
#define CASE_OUTPUT_ENUM_CLASS_STR(Class, Value, Str, Stream) \
case Class::Value: \
@ -21,7 +22,8 @@ using namespace llvm;
#define CASE_OUTPUT_ENUM_CLASS_NAME(Class, Value, Stream) \
CASE_OUTPUT_ENUM_CLASS_STR(Class, Value, #Value, Stream)
raw_ostream &llvm::operator<<(raw_ostream &OS, const PDB_VariantType &Type) {
raw_ostream &llvm::pdb::operator<<(raw_ostream &OS,
const PDB_VariantType &Type) {
switch (Type) {
CASE_OUTPUT_ENUM_CLASS_NAME(PDB_VariantType, Bool, OS)
CASE_OUTPUT_ENUM_CLASS_NAME(PDB_VariantType, Single, OS)
@ -40,7 +42,8 @@ raw_ostream &llvm::operator<<(raw_ostream &OS, const PDB_VariantType &Type) {
return OS;
}
raw_ostream &llvm::operator<<(raw_ostream &OS, const PDB_CallingConv &Conv) {
raw_ostream &llvm::pdb::operator<<(raw_ostream &OS,
const PDB_CallingConv &Conv) {
OS << "__";
switch (Conv) {
CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, NearC , "cdecl", OS)
@ -71,7 +74,7 @@ raw_ostream &llvm::operator<<(raw_ostream &OS, const PDB_CallingConv &Conv) {
return OS;
}
raw_ostream &llvm::operator<<(raw_ostream &OS, const PDB_DataKind &Data) {
raw_ostream &llvm::pdb::operator<<(raw_ostream &OS, const PDB_DataKind &Data) {
switch (Data) {
CASE_OUTPUT_ENUM_CLASS_STR(PDB_DataKind, Unknown, "unknown", OS)
CASE_OUTPUT_ENUM_CLASS_STR(PDB_DataKind, Local, "local", OS)
@ -87,7 +90,7 @@ raw_ostream &llvm::operator<<(raw_ostream &OS, const PDB_DataKind &Data) {
return OS;
}
raw_ostream &llvm::operator<<(raw_ostream &OS, const PDB_RegisterId &Reg) {
raw_ostream &llvm::pdb::operator<<(raw_ostream &OS, const PDB_RegisterId &Reg) {
switch (Reg) {
CASE_OUTPUT_ENUM_CLASS_NAME(PDB_RegisterId, AL, OS)
CASE_OUTPUT_ENUM_CLASS_NAME(PDB_RegisterId, CL, OS)
@ -142,7 +145,7 @@ raw_ostream &llvm::operator<<(raw_ostream &OS, const PDB_RegisterId &Reg) {
return OS;
}
raw_ostream &llvm::operator<<(raw_ostream &OS, const PDB_LocType &Loc) {
raw_ostream &llvm::pdb::operator<<(raw_ostream &OS, const PDB_LocType &Loc) {
switch (Loc) {
CASE_OUTPUT_ENUM_CLASS_STR(PDB_LocType, Static, "static", OS)
CASE_OUTPUT_ENUM_CLASS_STR(PDB_LocType, TLS, "tls", OS)
@ -160,7 +163,8 @@ raw_ostream &llvm::operator<<(raw_ostream &OS, const PDB_LocType &Loc) {
return OS;
}
raw_ostream &llvm::operator<<(raw_ostream &OS, const PDB_ThunkOrdinal &Thunk) {
raw_ostream &llvm::pdb::operator<<(raw_ostream &OS,
const PDB_ThunkOrdinal &Thunk) {
switch (Thunk) {
CASE_OUTPUT_ENUM_CLASS_NAME(PDB_ThunkOrdinal, BranchIsland, OS)
CASE_OUTPUT_ENUM_CLASS_NAME(PDB_ThunkOrdinal, Pcode, OS)
@ -173,7 +177,8 @@ raw_ostream &llvm::operator<<(raw_ostream &OS, const PDB_ThunkOrdinal &Thunk) {
return OS;
}
raw_ostream &llvm::operator<<(raw_ostream &OS, const PDB_Checksum &Checksum) {
raw_ostream &llvm::pdb::operator<<(raw_ostream &OS,
const PDB_Checksum &Checksum) {
switch (Checksum) {
CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Checksum, None, OS)
CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Checksum, MD5, OS)
@ -182,7 +187,7 @@ raw_ostream &llvm::operator<<(raw_ostream &OS, const PDB_Checksum &Checksum) {
return OS;
}
raw_ostream &llvm::operator<<(raw_ostream &OS, const PDB_Lang &Lang) {
raw_ostream &llvm::pdb::operator<<(raw_ostream &OS, const PDB_Lang &Lang) {
switch (Lang) {
CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Lang, C, OS)
CASE_OUTPUT_ENUM_CLASS_STR(PDB_Lang, Cpp, "C++", OS)
@ -205,7 +210,7 @@ raw_ostream &llvm::operator<<(raw_ostream &OS, const PDB_Lang &Lang) {
return OS;
}
raw_ostream &llvm::operator<<(raw_ostream &OS, const PDB_SymType &Tag) {
raw_ostream &llvm::pdb::operator<<(raw_ostream &OS, const PDB_SymType &Tag) {
switch (Tag) {
CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType, Exe, OS)
CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType, Compiland, OS)
@ -243,7 +248,8 @@ raw_ostream &llvm::operator<<(raw_ostream &OS, const PDB_SymType &Tag) {
return OS;
}
raw_ostream &llvm::operator<<(raw_ostream &OS, const PDB_MemberAccess &Access) {
raw_ostream &llvm::pdb::operator<<(raw_ostream &OS,
const PDB_MemberAccess &Access) {
switch (Access) {
CASE_OUTPUT_ENUM_CLASS_STR(PDB_MemberAccess, Public, "public", OS)
CASE_OUTPUT_ENUM_CLASS_STR(PDB_MemberAccess, Protected, "protected", OS)
@ -252,7 +258,7 @@ raw_ostream &llvm::operator<<(raw_ostream &OS, const PDB_MemberAccess &Access) {
return OS;
}
raw_ostream &llvm::operator<<(raw_ostream &OS, const PDB_UdtType &Type) {
raw_ostream &llvm::pdb::operator<<(raw_ostream &OS, const PDB_UdtType &Type) {
switch (Type) {
CASE_OUTPUT_ENUM_CLASS_STR(PDB_UdtType, Class, "class", OS)
CASE_OUTPUT_ENUM_CLASS_STR(PDB_UdtType, Struct, "struct", OS)
@ -262,7 +268,7 @@ raw_ostream &llvm::operator<<(raw_ostream &OS, const PDB_UdtType &Type) {
return OS;
}
raw_ostream &llvm::operator<<(raw_ostream &OS, const PDB_UniqueId &Id) {
raw_ostream &llvm::pdb::operator<<(raw_ostream &OS, const PDB_UniqueId &Id) {
static const char *Lookup = "0123456789ABCDEF";
static_assert(sizeof(PDB_UniqueId) == 16, "Expected 16-byte GUID");
@ -281,7 +287,8 @@ raw_ostream &llvm::operator<<(raw_ostream &OS, const PDB_UniqueId &Id) {
return OS;
}
raw_ostream &llvm::operator<<(raw_ostream &OS, const PDB_Machine &Machine) {
raw_ostream &llvm::pdb::operator<<(raw_ostream &OS,
const PDB_Machine &Machine) {
switch (Machine) {
CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Machine, Am33, OS)
CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Machine, Amd64, OS)
@ -309,7 +316,7 @@ raw_ostream &llvm::operator<<(raw_ostream &OS, const PDB_Machine &Machine) {
return OS;
}
raw_ostream &llvm::operator<<(raw_ostream &OS, const Variant &Value) {
raw_ostream &llvm::pdb::operator<<(raw_ostream &OS, const Variant &Value) {
switch (Value.Type) {
case PDB_VariantType::Bool:
OS << (Value.Value.Bool ? "true" : "false");
@ -353,12 +360,13 @@ raw_ostream &llvm::operator<<(raw_ostream &OS, const Variant &Value) {
return OS;
}
raw_ostream &llvm::operator<<(raw_ostream &OS, const VersionInfo &Version) {
raw_ostream &llvm::pdb::operator<<(raw_ostream &OS,
const VersionInfo &Version) {
OS << Version.Major << "." << Version.Minor << "." << Version.Build;
return OS;
}
raw_ostream &llvm::operator<<(raw_ostream &OS, const TagStats &Stats) {
raw_ostream &llvm::pdb::operator<<(raw_ostream &OS, const TagStats &Stats) {
for (auto Tag : Stats) {
OS << Tag.first << ":" << Tag.second << " ";
}

View File

@ -18,6 +18,7 @@
#include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
using namespace llvm;
using namespace llvm::pdb;
IPDBSession::~IPDBSession() {}

View File

@ -11,6 +11,7 @@
#include "llvm/Support/ErrorHandling.h"
using namespace llvm;
using namespace llvm::pdb;
#define PDB_SYMDUMP_UNREACHABLE(Type) \
if (RequireImpl) \

View File

@ -50,6 +50,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbol::PDBSymbol(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)

View File

@ -14,6 +14,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbolAnnotation::PDBSymbolAnnotation(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)

View File

@ -15,6 +15,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbolBlock::PDBSymbolBlock(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)

View File

@ -15,6 +15,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbolCompiland::PDBSymbolCompiland(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)

View File

@ -15,6 +15,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbolCompilandDetails::PDBSymbolCompilandDetails(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)

View File

@ -16,16 +16,17 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbolCompilandEnv::PDBSymbolCompilandEnv(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)
: PDBSymbol(PDBSession, std::move(Symbol)) {}
std::string PDBSymbolCompilandEnv::getValue() const {
llvm::Variant Value = RawSymbol->getValue();
if (Value.Type != PDB_VariantType::String)
return std::string();
return std::string(Value.Value.String);
Variant Value = RawSymbol->getValue();
if (Value.Type != PDB_VariantType::String)
return std::string();
return std::string(Value.Value.String);
}
void PDBSymbolCompilandEnv::dump(PDBSymDumper &Dumper) const {

View File

@ -16,6 +16,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbolCustom::PDBSymbolCustom(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> CustomSymbol)

View File

@ -15,6 +15,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbolData::PDBSymbolData(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> DataSymbol)

View File

@ -14,6 +14,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbolExe::PDBSymbolExe(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)

View File

@ -23,6 +23,7 @@
#include <vector>
using namespace llvm;
using namespace llvm::pdb;
namespace {
class FunctionArgEnumerator : public IPDBEnumChildren<PDBSymbolData> {

View File

@ -15,6 +15,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbolFuncDebugEnd::PDBSymbolFuncDebugEnd(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)

View File

@ -15,6 +15,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbolFuncDebugStart::PDBSymbolFuncDebugStart(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)

View File

@ -14,6 +14,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbolLabel::PDBSymbolLabel(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)

View File

@ -15,6 +15,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbolPublicSymbol::PDBSymbolPublicSymbol(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)

View File

@ -14,6 +14,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbolThunk::PDBSymbolThunk(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)

View File

@ -15,6 +15,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbolTypeArray::PDBSymbolTypeArray(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)

View File

@ -15,6 +15,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbolTypeBaseClass::PDBSymbolTypeBaseClass(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)

View File

@ -14,6 +14,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbolTypeBuiltin::PDBSymbolTypeBuiltin(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)

View File

@ -15,6 +15,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbolTypeCustom::PDBSymbolTypeCustom(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)

View File

@ -16,6 +16,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbolTypeDimension::PDBSymbolTypeDimension(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)

View File

@ -17,6 +17,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbolTypeEnum::PDBSymbolTypeEnum(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)

View File

@ -15,6 +15,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbolTypeFriend::PDBSymbolTypeFriend(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)

View File

@ -14,6 +14,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbolTypeFunctionArg::PDBSymbolTypeFunctionArg(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)

View File

@ -19,6 +19,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
namespace {
class FunctionArgEnumerator : public IPDBEnumSymbols {

View File

@ -15,6 +15,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbolTypeManaged::PDBSymbolTypeManaged(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)

View File

@ -15,6 +15,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbolTypePointer::PDBSymbolTypePointer(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)

View File

@ -14,6 +14,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbolTypeTypedef::PDBSymbolTypeTypedef(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)

View File

@ -14,6 +14,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbolTypeUDT::PDBSymbolTypeUDT(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)

View File

@ -14,6 +14,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbolTypeVTable::PDBSymbolTypeVTable(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)

View File

@ -15,6 +15,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbolTypeVTableShape::PDBSymbolTypeVTableShape(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)

View File

@ -15,6 +15,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbolUnknown::PDBSymbolUnknown(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)

View File

@ -15,6 +15,7 @@
#include <utility>
using namespace llvm;
using namespace llvm::pdb;
PDBSymbolUsingNamespace::PDBSymbolUsingNamespace(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)

Some files were not shown because too many files have changed in this diff Show More