[llvm] r230184 - [llvm-pdbdump] Rewrite dumper using visitor pattern.
Zachary Turner
zturner at google.com
Sun Feb 22 14:03:39 PST 2015
Author: zturner
Date: Sun Feb 22 16:03:38 2015
New Revision: 230184
URL: http://llvm.org/viewvc/llvm-project?rev=230184&view=rev
Log:
[llvm-pdbdump] Rewrite dumper using visitor pattern.
This increases the flexibility of how to dump different
symbol types -- necessary for context-sensitive formatting of
symbol types -- and also improves the modularity by allowing
the dumping to be implemented in the actual dumper, as opposed
to in the PDB library.
Added:
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymDumper.h
llvm/trunk/lib/DebugInfo/PDB/PDBSymDumper.cpp
llvm/trunk/tools/llvm-pdbdump/CompilandDumper.cpp
llvm/trunk/tools/llvm-pdbdump/CompilandDumper.h
llvm/trunk/tools/llvm-pdbdump/FunctionDumper.cpp
llvm/trunk/tools/llvm-pdbdump/FunctionDumper.h
llvm/trunk/tools/llvm-pdbdump/TypeDumper.cpp
llvm/trunk/tools/llvm-pdbdump/TypeDumper.h
llvm/trunk/tools/llvm-pdbdump/TypedefDumper.cpp
llvm/trunk/tools/llvm-pdbdump/TypedefDumper.h
llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.h
Modified:
llvm/trunk/include/llvm/DebugInfo/PDB/PDBExtras.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbol.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolAnnotation.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolBlock.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCompiland.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCustom.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolData.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolExe.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolFunc.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolLabel.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolThunk.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeArray.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypePointer.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolUnknown.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBTypes.h
llvm/trunk/lib/DebugInfo/PDB/CMakeLists.txt
llvm/trunk/lib/DebugInfo/PDB/PDBExtras.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbol.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolAnnotation.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolBlock.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompilandDetails.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompilandEnv.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCustom.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolData.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolExe.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFunc.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFuncDebugEnd.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFuncDebugStart.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolLabel.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolPublicSymbol.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolThunk.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeArray.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeBaseClass.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeBuiltin.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeCustom.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeDimension.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeEnum.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeFriend.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeFunctionArg.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeFunctionSig.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeManaged.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypePointer.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeTypedef.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeUDT.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeVTable.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeVTableShape.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolUnknown.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolUsingNamespace.cpp
llvm/trunk/test/DebugInfo/PDB/pdbdump-symbol-format.test
llvm/trunk/tools/llvm-pdbdump/CMakeLists.txt
llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBExtras.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBExtras.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBExtras.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBExtras.h Sun Feb 22 16:03:38 2015
@@ -17,12 +17,6 @@
namespace llvm {
typedef std::unordered_map<PDB_SymType, int> TagStats;
-struct stream_indent {
- stream_indent(int IndentWidth) : Width(IndentWidth) {}
- int Width;
-};
-raw_ostream &operator<<(raw_ostream &OS, const stream_indent &Indent);
-
raw_ostream &operator<<(raw_ostream &OS, const PDB_VariantType &Value);
raw_ostream &operator<<(raw_ostream &OS, const PDB_CallingConv &Conv);
raw_ostream &operator<<(raw_ostream &OS, const PDB_DataKind &Data);
Added: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymDumper.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymDumper.h?rev=230184&view=auto
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymDumper.h (added)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymDumper.h Sun Feb 22 16:03:38 2015
@@ -0,0 +1,85 @@
+//===- PDBSymDumper.h - base interface for PDB symbol dumper *- C++ -----*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_DEBUGINFO_PDB_PDBSYMDUMPER_H
+#define LLVM_DEBUGINFO_PDB_PDBSYMDUMPER_H
+
+#include "PDBTypes.h"
+
+namespace llvm {
+
+class raw_ostream;
+
+class PDBSymDumper {
+public:
+ PDBSymDumper(bool ShouldRequireImpl);
+ virtual ~PDBSymDumper();
+
+ virtual void dump(const PDBSymbolAnnotation &Symbol, raw_ostream &OS,
+ int Indent);
+ virtual void dump(const PDBSymbolBlock &Symbol, raw_ostream &OS, int Indent);
+ virtual void dump(const PDBSymbolCompiland &Symbol, raw_ostream &OS,
+ int Indent);
+ virtual void dump(const PDBSymbolCompilandDetails &Symbol, raw_ostream &OS,
+ int Indent);
+ virtual void dump(const PDBSymbolCompilandEnv &Symbol, raw_ostream &OS,
+ int Indent);
+ virtual void dump(const PDBSymbolCustom &Symbol, raw_ostream &OS, int Indent);
+ virtual void dump(const PDBSymbolData &Symbol, raw_ostream &OS, int Indent);
+ virtual void dump(const PDBSymbolExe &Symbol, raw_ostream &OS, int Indent);
+ virtual void dump(const PDBSymbolFunc &Symbol, raw_ostream &OS, int Indent);
+ virtual void dump(const PDBSymbolFuncDebugEnd &Symbol, raw_ostream &OS,
+ int Indent);
+ virtual void dump(const PDBSymbolFuncDebugStart &Symbol, raw_ostream &OS,
+ int Indent);
+ virtual void dump(const PDBSymbolLabel &Symbol, raw_ostream &OS, int Indent);
+ virtual void dump(const PDBSymbolPublicSymbol &Symbol, raw_ostream &OS,
+ int Indent);
+ virtual void dump(const PDBSymbolThunk &Symbol, raw_ostream &OS, int Indent);
+ virtual void dump(const PDBSymbolTypeArray &Symbol, raw_ostream &OS,
+ int Indent);
+ virtual void dump(const PDBSymbolTypeBaseClass &Symbol, raw_ostream &OS,
+ int Indent);
+ virtual void dump(const PDBSymbolTypeBuiltin &Symbol, raw_ostream &OS,
+ int Indent);
+ virtual void dump(const PDBSymbolTypeCustom &Symbol, raw_ostream &OS,
+ int Indent);
+ virtual void dump(const PDBSymbolTypeDimension &Symbol, raw_ostream &OS,
+ int Indent);
+ virtual void dump(const PDBSymbolTypeEnum &Symbol, raw_ostream &OS,
+ int Indent);
+ virtual void dump(const PDBSymbolTypeFriend &Symbol, raw_ostream &OS,
+ int Indent);
+ virtual void dump(const PDBSymbolTypeFunctionArg &Symbol, raw_ostream &OS,
+ int Indent);
+ virtual void dump(const PDBSymbolTypeFunctionSig &Symbol, raw_ostream &OS,
+ int Indent);
+ virtual void dump(const PDBSymbolTypeManaged &Symbol, raw_ostream &OS,
+ int Indent);
+ virtual void dump(const PDBSymbolTypePointer &Symbol, raw_ostream &OS,
+ int Indent);
+ virtual void dump(const PDBSymbolTypeTypedef &Symbol, raw_ostream &OS,
+ int Indent);
+ virtual void dump(const PDBSymbolTypeUDT &Symbol, raw_ostream &OS,
+ int Indent);
+ virtual void dump(const PDBSymbolTypeVTable &Symbol, raw_ostream &OS,
+ int Indent);
+ virtual void dump(const PDBSymbolTypeVTableShape &Symbol, raw_ostream &OS,
+ int Indent);
+ virtual void dump(const PDBSymbolUnknown &Symbol, raw_ostream &OS,
+ int Indent);
+ virtual void dump(const PDBSymbolUsingNamespace &Symbol, raw_ostream &OS,
+ int Indent);
+
+private:
+ bool RequireImpl;
+};
+}
+
+#endif
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbol.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbol.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbol.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbol.h Sun Feb 22 16:03:38 2015
@@ -53,7 +53,8 @@ public:
/// call dump() on the underlying RawSymbol, which allows us to discover
/// unknown properties, but individual implementations of PDBSymbol may
/// override the behavior to only dump known fields.
- virtual void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const = 0;
+ virtual void dump(raw_ostream &OS, int Indent,
+ PDBSymDumper &Dumper) const = 0;
void defaultDump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const;
PDB_SymType getSymTag() const;
@@ -83,6 +84,8 @@ public:
const IPDBRawSymbol &getRawSymbol() const { return *RawSymbol; }
IPDBRawSymbol &getRawSymbol() { return *RawSymbol; }
+ const IPDBSession &getSession() const { return Session; }
+
protected:
std::unique_ptr<IPDBEnumSymbols> getChildStats(TagStats &Stats) const;
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolAnnotation.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolAnnotation.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolAnnotation.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolAnnotation.h Sun Feb 22 16:03:38 2015
@@ -24,7 +24,7 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Annotation)
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(getAddressOffset)
FORWARD_SYMBOL_METHOD(getAddressSection)
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolBlock.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolBlock.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolBlock.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolBlock.h Sun Feb 22 16:03:38 2015
@@ -24,7 +24,7 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Block)
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(getAddressOffset)
FORWARD_SYMBOL_METHOD(getAddressSection)
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCompiland.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCompiland.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCompiland.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCompiland.h Sun Feb 22 16:03:38 2015
@@ -24,7 +24,7 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Compiland)
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(isEditAndContinueEnabled)
FORWARD_SYMBOL_METHOD(getLexicalParentId)
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h Sun Feb 22 16:03:38 2015
@@ -24,7 +24,7 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::CompilandDetails)
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
void getFrontEndVersion(VersionInfo &Version) const {
RawSymbol->getFrontEndVersion(Version);
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h Sun Feb 22 16:03:38 2015
@@ -24,7 +24,7 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::CompilandEnv)
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(getLexicalParentId)
FORWARD_SYMBOL_METHOD(getName)
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCustom.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCustom.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCustom.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCustom.h Sun Feb 22 16:03:38 2015
@@ -28,7 +28,7 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Custom)
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
void getDataBytes(llvm::SmallVector<uint8_t, 32> &bytes);
FORWARD_SYMBOL_METHOD(getSymIndexId)
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolData.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolData.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolData.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolData.h Sun Feb 22 16:03:38 2015
@@ -24,7 +24,7 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Data)
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(getAccess)
FORWARD_SYMBOL_METHOD(getAddressOffset)
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolExe.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolExe.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolExe.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolExe.h Sun Feb 22 16:03:38 2015
@@ -25,7 +25,7 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Exe)
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(getAge)
FORWARD_SYMBOL_METHOD(getGuid)
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolFunc.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolFunc.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolFunc.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolFunc.h Sun Feb 22 16:03:38 2015
@@ -22,7 +22,7 @@ public:
PDBSymbolFunc(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> FuncSymbol);
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
std::unique_ptr<PDBSymbolTypeFunctionSig> getSignature() const;
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h Sun Feb 22 16:03:38 2015
@@ -24,7 +24,7 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::FuncDebugEnd)
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(getAddressOffset)
FORWARD_SYMBOL_METHOD(getAddressSection)
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h Sun Feb 22 16:03:38 2015
@@ -24,7 +24,7 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::FuncDebugStart)
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(getAddressOffset)
FORWARD_SYMBOL_METHOD(getAddressSection)
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolLabel.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolLabel.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolLabel.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolLabel.h Sun Feb 22 16:03:38 2015
@@ -24,7 +24,7 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Label)
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(getAddressOffset)
FORWARD_SYMBOL_METHOD(getAddressSection)
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h Sun Feb 22 16:03:38 2015
@@ -24,7 +24,7 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::PublicSymbol)
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(getAddressOffset)
FORWARD_SYMBOL_METHOD(getAddressSection)
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolThunk.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolThunk.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolThunk.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolThunk.h Sun Feb 22 16:03:38 2015
@@ -25,7 +25,7 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Thunk)
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(getAccess)
FORWARD_SYMBOL_METHOD(getAddressOffset)
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeArray.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeArray.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeArray.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeArray.h Sun Feb 22 16:03:38 2015
@@ -24,7 +24,7 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::ArrayType)
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(getArrayIndexTypeId)
FORWARD_SYMBOL_METHOD(isConstType)
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h Sun Feb 22 16:03:38 2015
@@ -24,7 +24,7 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::BaseClass)
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(getAccess)
FORWARD_SYMBOL_METHOD(getClassParentId)
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h Sun Feb 22 16:03:38 2015
@@ -24,7 +24,7 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::BuiltinType)
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(getBuiltinType)
FORWARD_SYMBOL_METHOD(isConstType)
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h Sun Feb 22 16:03:38 2015
@@ -24,7 +24,7 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::CustomType)
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(getOemId)
FORWARD_SYMBOL_METHOD(getOemSymbolId)
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h Sun Feb 22 16:03:38 2015
@@ -24,7 +24,7 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Dimension)
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(getLowerBoundId)
FORWARD_SYMBOL_METHOD(getUpperBoundId)
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h Sun Feb 22 16:03:38 2015
@@ -24,7 +24,7 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Enum)
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(getBuiltinType)
FORWARD_SYMBOL_METHOD(getClassParentId)
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h Sun Feb 22 16:03:38 2015
@@ -24,7 +24,7 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Friend)
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(getClassParentId)
FORWARD_SYMBOL_METHOD(getName)
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h Sun Feb 22 16:03:38 2015
@@ -24,7 +24,7 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::FunctionArg)
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(getClassParentId)
FORWARD_SYMBOL_METHOD(getLexicalParentId)
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h Sun Feb 22 16:03:38 2015
@@ -28,7 +28,7 @@ public:
std::unique_ptr<IPDBEnumSymbols> getArguments() const;
std::unique_ptr<PDBSymbol> getClassParent() const;
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
void dumpArgList(raw_ostream &OS) const;
FORWARD_SYMBOL_METHOD(getCallingConvention)
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h Sun Feb 22 16:03:38 2015
@@ -24,7 +24,7 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::ManagedType)
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(getName)
FORWARD_SYMBOL_METHOD(getSymIndexId)
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypePointer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypePointer.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypePointer.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypePointer.h Sun Feb 22 16:03:38 2015
@@ -24,7 +24,7 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::PointerType)
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(isConstType)
FORWARD_SYMBOL_METHOD(getLength)
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h Sun Feb 22 16:03:38 2015
@@ -24,7 +24,7 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Typedef)
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(getBuiltinType)
FORWARD_SYMBOL_METHOD(getClassParentId)
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h Sun Feb 22 16:03:38 2015
@@ -24,7 +24,7 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::UDT)
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(getClassParentId)
FORWARD_SYMBOL_METHOD(hasConstructor)
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h Sun Feb 22 16:03:38 2015
@@ -24,7 +24,7 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::VTable)
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(getClassParentId)
FORWARD_SYMBOL_METHOD(isConstType)
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h Sun Feb 22 16:03:38 2015
@@ -24,7 +24,7 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::VTableShape)
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(isConstType)
FORWARD_SYMBOL_METHOD(getCount)
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolUnknown.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolUnknown.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolUnknown.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolUnknown.h Sun Feb 22 16:03:38 2015
@@ -21,7 +21,7 @@ public:
PDBSymbolUnknown(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> UnknownSymbol);
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
static bool classof(const PDBSymbol *S) {
return (S->getSymTag() == PDB_SymType::None ||
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h Sun Feb 22 16:03:38 2015
@@ -24,7 +24,7 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::UsingNamespace)
- void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const override;
+ void dump(raw_ostream &OS, int Indent, PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(getLexicalParentId)
FORWARD_SYMBOL_METHOD(getName)
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBTypes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBTypes.h?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBTypes.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBTypes.h Sun Feb 22 16:03:38 2015
@@ -16,10 +16,8 @@
namespace llvm {
+class PDBSymDumper;
class PDBSymbol;
-class PDBSymbolCompiland;
-class PDBSymbolFunc;
-class PDBSymbolExe;
class IPDBDataStream;
template <class T> class IPDBEnumChildren;
Modified: llvm/trunk/lib/DebugInfo/PDB/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/CMakeLists.txt?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/CMakeLists.txt (original)
+++ llvm/trunk/lib/DebugInfo/PDB/CMakeLists.txt Sun Feb 22 16:03:38 2015
@@ -66,6 +66,7 @@ add_llvm_library(LLVMDebugInfoPDB
PDBSymbolTypeVTableShape.cpp
PDBSymbolUnknown.cpp
PDBSymbolUsingNamespace.cpp
+ PDBSymDumper.cpp
${PDB_IMPL_SOURCES}
ADDITIONAL_HEADER_DIRS
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBExtras.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBExtras.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBExtras.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBExtras.cpp Sun Feb 22 16:03:38 2015
@@ -21,11 +21,6 @@ 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 stream_indent &Indent) {
- OS.indent(Indent.Width);
- return OS;
-}
-
raw_ostream &llvm::operator<<(raw_ostream &OS, const PDB_VariantType &Type) {
switch (Type) {
CASE_OUTPUT_ENUM_CLASS_NAME(PDB_VariantType, Bool, OS)
Added: llvm/trunk/lib/DebugInfo/PDB/PDBSymDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymDumper.cpp?rev=230184&view=auto
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymDumper.cpp (added)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymDumper.cpp Sun Feb 22 16:03:38 2015
@@ -0,0 +1,177 @@
+//===- PDBSymDumper.cpp - ---------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
+#include "llvm/Support/ErrorHandling.h"
+
+using namespace llvm;
+
+#define PDB_SYMDUMP_UNREACHABLE(Type) \
+ if (RequireImpl) \
+ llvm_unreachable("Attempt to dump " #Type " with no dump implementation");
+
+PDBSymDumper::PDBSymDumper(bool ShouldRequireImpl)
+ : RequireImpl(ShouldRequireImpl) {}
+
+PDBSymDumper::~PDBSymDumper() {}
+
+void PDBSymDumper::dump(const PDBSymbolAnnotation &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolAnnotation)
+}
+
+void PDBSymDumper::dump(const PDBSymbolBlock &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolBlock)
+}
+
+void PDBSymDumper::dump(const PDBSymbolCompiland &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolCompiland)
+}
+
+void PDBSymDumper::dump(const PDBSymbolCompilandDetails &Symbol,
+ raw_ostream &OS, int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolCompilandDetails)
+}
+
+void PDBSymDumper::dump(const PDBSymbolCompilandEnv &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolCompilandEnv)
+}
+
+void PDBSymDumper::dump(const PDBSymbolCustom &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolCustom)
+}
+
+void PDBSymDumper::dump(const PDBSymbolData &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolData)
+}
+
+void PDBSymDumper::dump(const PDBSymbolExe &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolExe)
+}
+
+void PDBSymDumper::dump(const PDBSymbolFunc &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolFunc)
+}
+
+void PDBSymDumper::dump(const PDBSymbolFuncDebugEnd &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolFuncDebugEnd)
+}
+
+void PDBSymDumper::dump(const PDBSymbolFuncDebugStart &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolFuncDebugStart)
+}
+
+void PDBSymDumper::dump(const PDBSymbolLabel &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolLabel)
+}
+
+void PDBSymDumper::dump(const PDBSymbolPublicSymbol &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolPublicSymbol)
+}
+
+void PDBSymDumper::dump(const PDBSymbolThunk &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolThunk)
+}
+
+void PDBSymDumper::dump(const PDBSymbolTypeArray &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolTypeArray)
+}
+
+void PDBSymDumper::dump(const PDBSymbolTypeBaseClass &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolTypeBaseClass)
+}
+
+void PDBSymDumper::dump(const PDBSymbolTypeBuiltin &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolTypeBuiltin)
+}
+
+void PDBSymDumper::dump(const PDBSymbolTypeCustom &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolTypeCustom)
+}
+
+void PDBSymDumper::dump(const PDBSymbolTypeDimension &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolTypeDimension)
+}
+
+void PDBSymDumper::dump(const PDBSymbolTypeEnum &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolTypeEnum)
+}
+
+void PDBSymDumper::dump(const PDBSymbolTypeFriend &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolTypeFriend)
+}
+
+void PDBSymDumper::dump(const PDBSymbolTypeFunctionArg &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolTypeFunctionArg)
+}
+
+void PDBSymDumper::dump(const PDBSymbolTypeFunctionSig &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolTypeFunctionSig)
+}
+
+void PDBSymDumper::dump(const PDBSymbolTypeManaged &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolTypeManaged)
+}
+
+void PDBSymDumper::dump(const PDBSymbolTypePointer &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolTypePointer)
+}
+
+void PDBSymDumper::dump(const PDBSymbolTypeTypedef &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolTypeTypedef)
+}
+
+void PDBSymDumper::dump(const PDBSymbolTypeUDT &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolTypeUDT)
+}
+
+void PDBSymDumper::dump(const PDBSymbolTypeVTable &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolTypeVTable)
+}
+
+void PDBSymDumper::dump(const PDBSymbolTypeVTableShape &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolTypeVTableShape)
+}
+
+void PDBSymDumper::dump(const PDBSymbolUnknown &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolUnknown)
+}
+
+void PDBSymDumper::dump(const PDBSymbolUsingNamespace &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_SYMDUMP_UNREACHABLE(PDBSymbolUsingNamespace)
+}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbol.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbol.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbol.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbol.cpp Sun Feb 22 16:03:38 2015
@@ -42,6 +42,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h"
#include "llvm/DebugInfo/PDB/PDBSymbolUnknown.h"
#include "llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <memory>
#include <utility>
@@ -100,6 +101,12 @@ PDBSymbol::create(const IPDBSession &PDB
}
}
+#define TRY_DUMP_TYPE(Type) \
+ if (const Type *DerivedThis = dyn_cast<Type>(this)) \
+ Dumper.dump(OS, Indent, *DerivedThis);
+
+#define ELSE_TRY_DUMP_TYPE(Type, Dumper) else TRY_DUMP_TYPE(Type, Dumper)
+
void PDBSymbol::defaultDump(raw_ostream &OS, int Indent,
PDB_DumpLevel Level) const {
RawSymbol->dump(OS, Indent, Level);
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolAnnotation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolAnnotation.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolAnnotation.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolAnnotation.cpp Sun Feb 22 16:03:38 2015
@@ -9,7 +9,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolAnnotation.h"
-#include "llvm/DebugInfo/PDB/PDBSymbol.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
@@ -20,4 +20,6 @@ PDBSymbolAnnotation::PDBSymbolAnnotation
: PDBSymbol(PDBSession, std::move(Symbol)) {}
void PDBSymbolAnnotation::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {}
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
+}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolBlock.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolBlock.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolBlock.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolBlock.cpp Sun Feb 22 16:03:38 2015
@@ -10,6 +10,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolBlock.h"
#include "llvm/DebugInfo/PDB/PDBSymbol.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
@@ -20,4 +21,6 @@ PDBSymbolBlock::PDBSymbolBlock(const IPD
: PDBSymbol(PDBSession, std::move(Symbol)) {}
void PDBSymbolBlock::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {}
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
+}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp Sun Feb 22 16:03:38 2015
@@ -9,18 +9,9 @@
#include "llvm/DebugInfo/PDB/PDBSymbolCompiland.h"
-#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
-#include "llvm/DebugInfo/PDB/IPDBSession.h"
-#include "llvm/DebugInfo/PDB/IPDBSourceFile.h"
-#include "llvm/DebugInfo/PDB/PDBExtras.h"
-#include "llvm/DebugInfo/PDB/PDBSymbol.h"
-#include "llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h"
-#include "llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h"
-#include "llvm/Support/Path.h"
-#include "llvm/Support/raw_ostream.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
-#include <vector>
using namespace llvm;
@@ -28,45 +19,7 @@ PDBSymbolCompiland::PDBSymbolCompiland(c
std::unique_ptr<IPDBRawSymbol> Symbol)
: PDBSymbol(PDBSession, std::move(Symbol)) {}
-#define SKIP_SYMBOL_IF_FLAG_UNSET(Tag, Flag) \
- case PDB_SymType::Tag: \
- if ((Flags & Flag) == 0) \
- continue; \
- break;
-
void PDBSymbolCompiland::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {
- if (Level == PDB_DumpLevel::Detailed) {
- std::string FullName = getName();
- OS << stream_indent(Indent) << FullName;
- if (Flags & PDB_DF_Children) {
- if (Level >= PDB_DumpLevel::Detailed) {
- auto ChildrenEnum = findAllChildren();
- while (auto Child = ChildrenEnum->getNext()) {
- switch (Child->getSymTag()) {
- SKIP_SYMBOL_IF_FLAG_UNSET(Function, PDB_DF_Functions)
- SKIP_SYMBOL_IF_FLAG_UNSET(Data, PDB_DF_Data)
- SKIP_SYMBOL_IF_FLAG_UNSET(Label, PDB_DF_Labels)
- SKIP_SYMBOL_IF_FLAG_UNSET(PublicSymbol, PDB_DF_PublicSyms)
- SKIP_SYMBOL_IF_FLAG_UNSET(UDT, PDB_DF_Classes)
- SKIP_SYMBOL_IF_FLAG_UNSET(Enum, PDB_DF_Enums)
- SKIP_SYMBOL_IF_FLAG_UNSET(FunctionSig, PDB_DF_Funcsigs)
- SKIP_SYMBOL_IF_FLAG_UNSET(VTable, PDB_DF_VTables)
- SKIP_SYMBOL_IF_FLAG_UNSET(Thunk, PDB_DF_Thunks)
- SKIP_SYMBOL_IF_FLAG_UNSET(Compiland, PDB_DF_ObjFiles)
- default:
- continue;
- }
- PDB_DumpLevel ChildLevel = (Level == PDB_DumpLevel::Detailed)
- ? PDB_DumpLevel::Normal
- : PDB_DumpLevel::Compact;
- OS << "\n";
- Child->dump(OS, Indent + 2, ChildLevel, PDB_DF_Children);
- }
- }
- }
- } else {
- std::string FullName = getName();
- OS << stream_indent(Indent) << "Compiland: " << FullName;
- }
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompilandDetails.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompilandDetails.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompilandDetails.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompilandDetails.cpp Sun Feb 22 16:03:38 2015
@@ -10,6 +10,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h"
#include "llvm/DebugInfo/PDB/PDBSymbol.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
@@ -20,4 +21,6 @@ PDBSymbolCompilandDetails::PDBSymbolComp
: PDBSymbol(PDBSession, std::move(Symbol)) {}
void PDBSymbolCompilandDetails::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {}
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
+}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompilandEnv.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompilandEnv.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompilandEnv.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompilandEnv.cpp Sun Feb 22 16:03:38 2015
@@ -11,6 +11,7 @@
#include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
#include "llvm/DebugInfo/PDB/PDBSymbol.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
@@ -26,4 +27,6 @@ std::string PDBSymbolCompilandEnv::getVa
}
void PDBSymbolCompilandEnv::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {}
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
+}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCustom.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCustom.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCustom.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCustom.cpp Sun Feb 22 16:03:38 2015
@@ -11,6 +11,7 @@
#include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
#include "llvm/DebugInfo/PDB/PDBSymbol.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
@@ -25,4 +26,6 @@ void PDBSymbolCustom::getDataBytes(llvm:
}
void PDBSymbolCustom::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {}
\ No newline at end of file
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
+}
\ No newline at end of file
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolData.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolData.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolData.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolData.cpp Sun Feb 22 16:03:38 2015
@@ -9,11 +9,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolData.h"
-#include "llvm/DebugInfo/PDB/IPDBSession.h"
-#include "llvm/DebugInfo/PDB/PDBExtras.h"
-#include "llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h"
-#include "llvm/Support/Format.h"
-#include <utility>
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
@@ -24,68 +20,6 @@ PDBSymbolData::PDBSymbolData(const IPDBS
: PDBSymbol(PDBSession, std::move(DataSymbol)) {}
void PDBSymbolData::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {
- OS << stream_indent(Indent);
- PDB_LocType Loc = getLocationType();
- PDB_DataKind Kind = getDataKind();
- switch (Loc) {
- case PDB_LocType::Static: {
- uint32_t RVA = getRelativeVirtualAddress();
- OS << Kind << " data[";
- if (RVA != 0)
- OS << format_hex(RVA, 10);
- else
- OS << "???";
- break;
- }
- case PDB_LocType::TLS:
- OS << "threadlocal " << Kind << " data[";
- OS << getAddressSection() << ":" << format_hex(getAddressOffset(), 10);
- break;
- case PDB_LocType::RegRel:
- OS << "regrel " << Kind << " data[";
- OS << getRegisterId() << " + " << getOffset();
- break;
- case PDB_LocType::ThisRel: {
- uint32_t Offset = getOffset();
- OS << Kind << " data[this + " << format_hex(Offset, 4);
- break;
- }
- case PDB_LocType::Enregistered:
- OS << "register " << Kind << " data[" << getRegisterId();
- break;
- case PDB_LocType::BitField: {
- OS << "bitfield data[this + ";
- uint32_t Offset = getOffset();
- uint32_t BitPos = getBitPosition();
- uint32_t Length = getLength();
- OS << format_hex(Offset, 4) << ":" << BitPos << "," << Length;
- break;
- }
- case PDB_LocType::Slot:
- OS << getSlot();
- break;
- case PDB_LocType::Constant: {
- OS << "constant data[";
- OS << getValue();
- break;
- }
- case PDB_LocType::IlRel:
- case PDB_LocType::MetaData:
- default:
- OS << "???";
- }
-
- OS << "] ";
- if (Kind == PDB_DataKind::Member || Kind == PDB_DataKind::StaticMember) {
- uint32_t ClassId = getClassParentId();
- if (auto Class = Session.getSymbolById(ClassId)) {
- if (auto UDT = dyn_cast<PDBSymbolTypeUDT>(Class.get()))
- OS << UDT->getName();
- else
- OS << "{class " << Class->getSymTag() << "}";
- OS << "::";
- }
- }
- OS << getName();
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
}
\ No newline at end of file
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolExe.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolExe.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolExe.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolExe.cpp Sun Feb 22 16:03:38 2015
@@ -9,129 +9,17 @@
#include "llvm/DebugInfo/PDB/PDBSymbolExe.h"
-#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
-#include "llvm/DebugInfo/PDB/PDBExtras.h"
-#include "llvm/DebugInfo/PDB/PDBSymbol.h"
-#include "llvm/Support/ConvertUTF.h"
-#include "llvm/Support/FileSystem.h"
-#include "llvm/Support/raw_ostream.h"
-#include <utility>
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
using namespace llvm;
-#define SKIP_SYMBOL_IF_FLAG_UNSET(Tag, Flag) \
- case PDB_SymType::Tag: \
- if ((Flags & Flag) == 0) \
- continue; \
- break;
-
PDBSymbolExe::PDBSymbolExe(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)
: PDBSymbol(PDBSession, std::move(Symbol)) {}
void PDBSymbolExe::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {
- std::string FileName(getSymbolsFileName());
-
- OS << stream_indent(Indent) << "Summary for " << FileName << "\n";
-
- uint64_t FileSize = 0;
- if (!llvm::sys::fs::file_size(FileName, FileSize))
- OS << stream_indent(Indent + 2) << "Size: " << FileSize << " bytes\n";
- else
- OS << stream_indent(Indent + 2) << "Size: (Unable to obtain file size)\n";
- PDB_UniqueId Guid = getGuid();
- OS << stream_indent(Indent + 2) << "Guid: " << Guid << "\n";
- OS << stream_indent(Indent + 2) << "Age: " << getAge() << "\n";
- OS << stream_indent(Indent + 2) << "Attributes: ";
- if (hasCTypes())
- OS << "HasCTypes ";
- if (hasPrivateSymbols())
- OS << "HasPrivateSymbols ";
- OS << "\n";
-
- if (Flags & PDB_DF_Children) {
- OS << stream_indent(Indent + 2) << "Dumping types\n";
- if (Flags & PDB_DF_Hidden) {
- // For some reason, for each SymTag T, this dumps more items of type T
- // than are dumped by calling dumpChildren(T). In other words, there are
- // "hidden" symbols. For example, it causes functions to be dumped which
- // have no address information, whereas specifically dumping only
- // functions will not find those symbols.
- //
- // My suspicion is that in the underlying DIA call, when you call
- // findChildren, passing a value of SymTagNone means all children
- // recursively, whereas passing a concrete tag value means only immediate
- // children of the global scope. So perhaps we need to find these
- // mysterious missing values by recursing through the hierarchy.
- //
- // On the other hand, there may just be some symbols that DIA tries to
- // hide from you because it thinks you don't care about them. However
- // experimentation shows that even vtables, for example, can't be found
- // without an exhaustive search.
- auto ChildrenEnum = findAllChildren();
- OS << stream_indent(Indent + 2) << ChildrenEnum->getChildCount()
- << " symbols";
-
- while (auto Child = ChildrenEnum->getNext()) {
- switch (Child->getSymTag()) {
- SKIP_SYMBOL_IF_FLAG_UNSET(Function, PDB_DF_Functions)
- SKIP_SYMBOL_IF_FLAG_UNSET(Data, PDB_DF_Data)
- SKIP_SYMBOL_IF_FLAG_UNSET(Label, PDB_DF_Labels)
- SKIP_SYMBOL_IF_FLAG_UNSET(PublicSymbol, PDB_DF_PublicSyms)
- SKIP_SYMBOL_IF_FLAG_UNSET(UDT, PDB_DF_Classes)
- SKIP_SYMBOL_IF_FLAG_UNSET(Enum, PDB_DF_Enums)
- SKIP_SYMBOL_IF_FLAG_UNSET(FunctionSig, PDB_DF_Funcsigs)
- SKIP_SYMBOL_IF_FLAG_UNSET(VTable, PDB_DF_VTables)
- SKIP_SYMBOL_IF_FLAG_UNSET(Thunk, PDB_DF_Thunks)
- SKIP_SYMBOL_IF_FLAG_UNSET(Compiland, PDB_DF_ObjFiles)
- default:
- continue;
- }
- PDB_DumpLevel ChildLevel = (Level == PDB_DumpLevel::Detailed)
- ? PDB_DumpLevel::Normal
- : PDB_DumpLevel::Compact;
- OS << "\n";
- Child->dump(OS, Indent + 4, ChildLevel, PDB_DF_Children);
- }
- } else {
- if (Flags & PDB_DF_ObjFiles)
- dumpChildren(OS, "Compilands", PDB_SymType::Compiland, Indent + 4);
- if (Flags & PDB_DF_Functions)
- dumpChildren(OS, "Functions", PDB_SymType::Function, Indent + 4);
- if (Flags & PDB_DF_Data)
- dumpChildren(OS, "Data", PDB_SymType::Data, Indent + 4);
- if (Flags & PDB_DF_Labels)
- dumpChildren(OS, "Labels", PDB_SymType::Label, Indent + 4);
- if (Flags & PDB_DF_PublicSyms)
- dumpChildren(OS, "Public Symbols", PDB_SymType::PublicSymbol,
- Indent + 4);
- if (Flags & PDB_DF_Classes)
- dumpChildren(OS, "UDTs", PDB_SymType::UDT, Indent + 4);
- if (Flags & PDB_DF_Enums)
- dumpChildren(OS, "Enums", PDB_SymType::Enum, Indent + 4);
- if (Flags & PDB_DF_Funcsigs)
- dumpChildren(OS, "Function Signatures", PDB_SymType::FunctionSig,
- Indent + 4);
- if (Flags & PDB_DF_Typedefs)
- dumpChildren(OS, "Typedefs", PDB_SymType::Typedef, Indent + 4);
- if (Flags & PDB_DF_VTables)
- dumpChildren(OS, "VTables", PDB_SymType::VTable, Indent + 4);
- if (Flags & PDB_DF_Thunks)
- dumpChildren(OS, "Thunks", PDB_SymType::Thunk, Indent + 4);
- }
- }
-}
-
-void PDBSymbolExe::dumpChildren(raw_ostream &OS, StringRef Label,
- PDB_SymType ChildType, int Indent) const {
- auto ChildrenEnum = findAllChildren(ChildType);
- OS << stream_indent(Indent) << Label << ": (" << ChildrenEnum->getChildCount()
- << " items)\n";
- while (auto Child = ChildrenEnum->getNext()) {
- Child->dump(OS, Indent + 2, PDB_DumpLevel::Normal, PDB_DF_None);
- OS << "\n";
- }
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFunc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFunc.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFunc.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFunc.cpp Sun Feb 22 16:03:38 2015
@@ -9,14 +9,10 @@
#include "llvm/DebugInfo/PDB/PDBSymbolFunc.h"
-#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
#include "llvm/DebugInfo/PDB/IPDBSession.h"
-#include "llvm/DebugInfo/PDB/PDBSymbol.h"
-#include "llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h"
-#include "llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h"
-#include "llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h"
-#include "llvm/Support/Format.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
+
#include <utility>
using namespace llvm;
@@ -29,58 +25,6 @@ std::unique_ptr<PDBSymbolTypeFunctionSig
}
void PDBSymbolFunc::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {
- uint32_t FuncStart = getRelativeVirtualAddress();
- uint32_t FuncEnd = FuncStart + getLength();
- OS << stream_indent(Indent);
- if (FuncStart == 0 && FuncEnd == 0) {
- OS << "func [???] ";
- } else {
- OS << "func ";
- OS << "[" << format_hex(FuncStart, 8);
- if (auto DebugStart = findOneChild<PDBSymbolFuncDebugStart>())
- OS << "+" << DebugStart->getRelativeVirtualAddress() - FuncStart;
- OS << " - " << format_hex(FuncEnd, 8);
- if (auto DebugEnd = findOneChild<PDBSymbolFuncDebugEnd>())
- OS << "-" << FuncEnd - DebugEnd->getRelativeVirtualAddress();
- OS << "] ";
- }
-
- PDB_RegisterId Reg = getLocalBasePointerRegisterId();
- if (Reg == PDB_RegisterId::VFrame)
- OS << "(VFrame)";
- else if (hasFramePointer())
- OS << "(" << Reg << ")";
- else
- OS << "(FPO)";
-
- OS << " ";
- if (isVirtual() || isPureVirtual())
- OS << "virtual ";
-
- if (auto FuncSig = getSignature()) {
- // If we have a signature, dump the name with the signature.
- if (auto ReturnType = FuncSig->getReturnType()) {
- ReturnType->dump(OS, 0, PDB_DumpLevel::Compact, PDB_DF_Children);
- OS << " ";
- }
-
- OS << FuncSig->getCallingConvention() << " ";
-
- OS << getName();
- FuncSig->dumpArgList(OS);
- if (isPureVirtual())
- OS << " = 0";
- } else {
- uint32_t ClassId = getClassParentId();
- if (ClassId != 0) {
- if (auto Class = Session.getSymbolById(ClassId)) {
- if (auto UDT = dyn_cast<PDBSymbolTypeUDT>(Class.get()))
- OS << UDT->getName() << "::";
- else
- OS << "{class " << Class->getSymTag() << "}::";
- }
- }
- OS << getName();
- }
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFuncDebugEnd.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFuncDebugEnd.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFuncDebugEnd.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFuncDebugEnd.cpp Sun Feb 22 16:03:38 2015
@@ -10,6 +10,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h"
#include "llvm/DebugInfo/PDB/PDBSymbol.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
@@ -20,4 +21,6 @@ PDBSymbolFuncDebugEnd::PDBSymbolFuncDebu
: PDBSymbol(PDBSession, std::move(Symbol)) {}
void PDBSymbolFuncDebugEnd::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {}
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
+}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFuncDebugStart.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFuncDebugStart.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFuncDebugStart.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFuncDebugStart.cpp Sun Feb 22 16:03:38 2015
@@ -10,6 +10,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h"
#include "llvm/DebugInfo/PDB/PDBSymbol.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
@@ -20,4 +21,6 @@ PDBSymbolFuncDebugStart::PDBSymbolFuncDe
: PDBSymbol(PDBSession, std::move(Symbol)) {}
void PDBSymbolFuncDebugStart::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {}
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
+}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolLabel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolLabel.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolLabel.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolLabel.cpp Sun Feb 22 16:03:38 2015
@@ -9,8 +9,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolLabel.h"
-#include "llvm/DebugInfo/PDB/PDBSymbol.h"
-#include "llvm/Support/Format.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
@@ -21,8 +20,6 @@ PDBSymbolLabel::PDBSymbolLabel(const IPD
: PDBSymbol(PDBSession, std::move(Symbol)) {}
void PDBSymbolLabel::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {
- OS << stream_indent(Indent);
- OS << "label [" << format_hex(getRelativeVirtualAddress(), 10) << "] "
- << getName();
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolPublicSymbol.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolPublicSymbol.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolPublicSymbol.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolPublicSymbol.cpp Sun Feb 22 16:03:38 2015
@@ -10,6 +10,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h"
#include "llvm/DebugInfo/PDB/PDBSymbol.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
@@ -20,7 +21,6 @@ PDBSymbolPublicSymbol::PDBSymbolPublicSy
: PDBSymbol(PDBSession, std::move(Symbol)) {}
void PDBSymbolPublicSymbol::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {
- OS << stream_indent(Indent);
- OS << "public symbol: " << getName();
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolThunk.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolThunk.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolThunk.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolThunk.cpp Sun Feb 22 16:03:38 2015
@@ -9,8 +9,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolThunk.h"
-#include "llvm/DebugInfo/PDB/PDBSymbol.h"
-#include "llvm/Support/Format.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
@@ -21,22 +20,6 @@ PDBSymbolThunk::PDBSymbolThunk(const IPD
: PDBSymbol(PDBSession, std::move(Symbol)) {}
void PDBSymbolThunk::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {
- OS.indent(Indent);
- OS << "thunk ";
- PDB_ThunkOrdinal Ordinal = getThunkOrdinal();
- uint32_t RVA = getRelativeVirtualAddress();
- if (Ordinal == PDB_ThunkOrdinal::TrampIncremental) {
- OS << format_hex(RVA, 10);
- } else {
- OS << "[" << format_hex(RVA, 10);
- OS << " - " << format_hex(RVA + getLength(), 10) << "]";
- }
- OS << " (" << Ordinal << ")";
- if (Ordinal == PDB_ThunkOrdinal::TrampIncremental)
- OS << " -> " << format_hex(getTargetRelativeVirtualAddress(), 10);
- OS << " ";
- std::string Name = getName();
- if (!Name.empty())
- OS << Name;
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeArray.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeArray.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeArray.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeArray.cpp Sun Feb 22 16:03:38 2015
@@ -9,8 +9,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolTypeArray.h"
-#include "llvm/DebugInfo/PDB/IPDBSession.h"
-#include "llvm/DebugInfo/PDB/PDBSymbol.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
@@ -21,11 +20,6 @@ PDBSymbolTypeArray::PDBSymbolTypeArray(c
: PDBSymbol(PDBSession, std::move(Symbol)) {}
void PDBSymbolTypeArray::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {
- OS << stream_indent(Indent);
- if (auto ElementType = Session.getSymbolById(getTypeId()))
- ElementType->dump(OS, 0, PDB_DumpLevel::Compact, PDB_DF_Children);
- else
- OS << "<unknown-element-type>";
- OS << "[" << getLength() << "]";
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeBaseClass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeBaseClass.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeBaseClass.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeBaseClass.cpp Sun Feb 22 16:03:38 2015
@@ -10,6 +10,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h"
#include "llvm/DebugInfo/PDB/PDBSymbol.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
@@ -20,7 +21,6 @@ PDBSymbolTypeBaseClass::PDBSymbolTypeBas
: PDBSymbol(PDBSession, std::move(Symbol)) {}
void PDBSymbolTypeBaseClass::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {
- OS << stream_indent(Indent);
- OS << "<base class> " << getName();
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeBuiltin.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeBuiltin.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeBuiltin.cpp Sun Feb 22 16:03:38 2015
@@ -9,7 +9,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h"
-#include "llvm/DebugInfo/PDB/PDBSymbol.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
@@ -20,10 +20,6 @@ PDBSymbolTypeBuiltin::PDBSymbolTypeBuilt
: PDBSymbol(PDBSession, std::move(Symbol)) {}
void PDBSymbolTypeBuiltin::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {
- OS << stream_indent(Indent);
- PDB_BuiltinType Type = getBuiltinType();
- OS << Type;
- if (Type == PDB_BuiltinType::UInt || Type == PDB_BuiltinType::Int)
- OS << (8 * getLength()) << "_t";
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeCustom.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeCustom.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeCustom.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeCustom.cpp Sun Feb 22 16:03:38 2015
@@ -10,6 +10,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h"
#include "llvm/DebugInfo/PDB/PDBSymbol.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
@@ -20,4 +21,6 @@ PDBSymbolTypeCustom::PDBSymbolTypeCustom
: PDBSymbol(PDBSession, std::move(Symbol)) {}
void PDBSymbolTypeCustom::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {}
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
+}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeDimension.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeDimension.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeDimension.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeDimension.cpp Sun Feb 22 16:03:38 2015
@@ -11,6 +11,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h"
#include "llvm/DebugInfo/PDB/PDBSymbol.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
@@ -21,4 +22,6 @@ PDBSymbolTypeDimension::PDBSymbolTypeDim
: PDBSymbol(PDBSession, std::move(Symbol)) {}
void PDBSymbolTypeDimension::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {}
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
+}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeEnum.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeEnum.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeEnum.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeEnum.cpp Sun Feb 22 16:03:38 2015
@@ -9,8 +9,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h"
-#include "llvm/DebugInfo/PDB/IPDBSession.h"
-#include "llvm/DebugInfo/PDB/PDBSymbol.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
@@ -21,17 +20,6 @@ PDBSymbolTypeEnum::PDBSymbolTypeEnum(con
: PDBSymbol(PDBSession, std::move(Symbol)) {}
void PDBSymbolTypeEnum::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {
- OS << stream_indent(Indent);
- if (Level >= PDB_DumpLevel::Normal)
- OS << "enum ";
-
- uint32_t ClassId = getClassParentId();
- if (ClassId != 0) {
- if (auto ClassParent = Session.getSymbolById(ClassId)) {
- ClassParent->dump(OS, 0, Level, PDB_DF_Children);
- OS << "::";
- }
- }
- OS << getName();
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeFriend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeFriend.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeFriend.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeFriend.cpp Sun Feb 22 16:03:38 2015
@@ -10,6 +10,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h"
#include "llvm/DebugInfo/PDB/PDBSymbol.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
@@ -20,4 +21,6 @@ PDBSymbolTypeFriend::PDBSymbolTypeFriend
: PDBSymbol(PDBSession, std::move(Symbol)) {}
void PDBSymbolTypeFriend::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {}
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
+}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeFunctionArg.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeFunctionArg.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeFunctionArg.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeFunctionArg.cpp Sun Feb 22 16:03:38 2015
@@ -9,8 +9,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h"
-#include "llvm/DebugInfo/PDB/IPDBSession.h"
-#include "llvm/DebugInfo/PDB/PDBSymbol.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
@@ -21,10 +20,6 @@ PDBSymbolTypeFunctionArg::PDBSymbolTypeF
: PDBSymbol(PDBSession, std::move(Symbol)) {}
void PDBSymbolTypeFunctionArg::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {
- OS << stream_indent(Indent);
- uint32_t TypeId = getTypeId();
- if (auto Type = Session.getSymbolById(TypeId)) {
- Type->dump(OS, 0, Level, PDB_DF_Children);
- }
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeFunctionSig.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeFunctionSig.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeFunctionSig.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeFunctionSig.cpp Sun Feb 22 16:03:38 2015
@@ -14,6 +14,7 @@
#include "llvm/DebugInfo/PDB/IPDBSession.h"
#include "llvm/DebugInfo/PDB/PDBSymbol.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
@@ -82,38 +83,7 @@ std::unique_ptr<PDBSymbol> PDBSymbolType
return Session.getSymbolById(ClassId);
}
-void PDBSymbolTypeFunctionSig::dumpArgList(raw_ostream &OS) const {
- OS << "(";
- if (auto ChildEnum = getArguments()) {
- uint32_t Index = 0;
- while (auto Arg = ChildEnum->getNext()) {
- Arg->dump(OS, 0, PDB_DumpLevel::Compact, PDB_DF_Children);
- if (++Index < ChildEnum->getChildCount())
- OS << ", ";
- }
- }
- OS << ")";
- if (isConstType())
- OS << " const";
- if (isVolatileType())
- OS << " volatile";
-}
-
void PDBSymbolTypeFunctionSig::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {
- OS << stream_indent(Indent);
-
- if (auto ReturnType = getReturnType()) {
- ReturnType->dump(OS, 0, PDB_DumpLevel::Compact, PDB_DF_Children);
- OS << " ";
- }
-
- OS << getCallingConvention() << " ";
- if (auto ClassParent = getClassParent()) {
- OS << "(";
- ClassParent->dump(OS, 0, PDB_DumpLevel::Compact, PDB_DF_Children);
- OS << "::*)";
- }
-
- dumpArgList(OS);
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeManaged.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeManaged.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeManaged.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeManaged.cpp Sun Feb 22 16:03:38 2015
@@ -10,6 +10,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h"
#include "llvm/DebugInfo/PDB/PDBSymbol.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
@@ -20,4 +21,6 @@ PDBSymbolTypeManaged::PDBSymbolTypeManag
: PDBSymbol(PDBSession, std::move(Symbol)) {}
void PDBSymbolTypeManaged::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {}
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
+}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypePointer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypePointer.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypePointer.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypePointer.cpp Sun Feb 22 16:03:38 2015
@@ -9,9 +9,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolTypePointer.h"
-#include "llvm/DebugInfo/PDB/IPDBSession.h"
-#include "llvm/DebugInfo/PDB/PDBSymbol.h"
-#include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
@@ -22,25 +20,6 @@ PDBSymbolTypePointer::PDBSymbolTypePoint
: PDBSymbol(PDBSession, std::move(Symbol)) {}
void PDBSymbolTypePointer::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {
- OS << stream_indent(Indent);
- if (isConstType())
- OS << "const ";
- if (isVolatileType())
- OS << "volatile ";
- uint32_t PointeeId = getTypeId();
- if (auto PointeeType = Session.getSymbolById(PointeeId)) {
- // Function pointers get special treatment, since we need to print the * in
- // the middle of the signature.
- if (auto FuncSig = dyn_cast<PDBSymbolTypeFunctionSig>(PointeeType.get())) {
- if (auto ReturnType = FuncSig->getReturnType())
- ReturnType->dump(OS, 0, PDB_DumpLevel::Compact, PDB_DF_Children);
- OS << " (" << FuncSig->getCallingConvention() << " ";
- OS << ((isReference()) ? "&" : "*") << ")";
- FuncSig->dumpArgList(OS);
- } else {
- PointeeType->dump(OS, 0, PDB_DumpLevel::Compact, PDB_DF_Children);
- OS << ((isReference()) ? "&" : "*");
- }
- }
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeTypedef.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeTypedef.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeTypedef.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeTypedef.cpp Sun Feb 22 16:03:38 2015
@@ -9,9 +9,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h"
-#include "llvm/DebugInfo/PDB/IPDBSession.h"
-#include "llvm/DebugInfo/PDB/PDBSymbol.h"
-#include "llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
@@ -22,18 +20,6 @@ PDBSymbolTypeTypedef::PDBSymbolTypeTyped
: PDBSymbol(PDBSession, std::move(Symbol)) {}
void PDBSymbolTypeTypedef::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {
- OS.indent(Indent);
- if (Level >= PDB_DumpLevel::Normal) {
- std::string Name = getName();
- OS << "typedef:" << Name << " -> ";
- std::string TargetTypeName;
- uint32_t TargetId = getTypeId();
- if (auto TypeSymbol = Session.getSymbolById(TargetId)) {
- TypeSymbol->dump(OS, 0, PDB_DumpLevel::Compact, PDB_DF_Children);
- }
- OS << TargetTypeName;
- } else {
- OS << getName();
- }
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeUDT.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeUDT.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeUDT.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeUDT.cpp Sun Feb 22 16:03:38 2015
@@ -9,8 +9,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h"
-#include "llvm/DebugInfo/PDB/IPDBSession.h"
-#include "llvm/DebugInfo/PDB/PDBSymbol.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
@@ -21,22 +20,6 @@ PDBSymbolTypeUDT::PDBSymbolTypeUDT(const
: PDBSymbol(PDBSession, std::move(Symbol)) {}
void PDBSymbolTypeUDT::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {
- OS << stream_indent(Indent);
- if (Level >= PDB_DumpLevel::Normal)
- OS << "class ";
-
- if (isNested()) {
- uint32_t ClassId = getClassParentId();
- if (ClassId != 0) {
- if (auto ClassParent = Session.getSymbolById(ClassId)) {
- ClassParent->dump(OS, 0, Level, PDB_DF_Children);
- OS << "::";
- }
- }
- }
- OS << getName();
-
- if (Level >= PDB_DumpLevel::Normal)
- OS << " (" << getLength() << " bytes)";
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeVTable.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeVTable.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeVTable.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeVTable.cpp Sun Feb 22 16:03:38 2015
@@ -9,10 +9,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h"
-#include "llvm/DebugInfo/PDB/IPDBSession.h"
-#include "llvm/DebugInfo/PDB/PDBSymbol.h"
-#include "llvm/DebugInfo/PDB/PDBSymbolTypePointer.h"
-#include "llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
@@ -23,19 +20,6 @@ PDBSymbolTypeVTable::PDBSymbolTypeVTable
: PDBSymbol(PDBSession, std::move(Symbol)) {}
void PDBSymbolTypeVTable::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {
- OS << stream_indent(Indent);
- uint32_t ClassId = getClassParentId();
- if (auto ClassParent = Session.getSymbolById(ClassId)) {
- ClassParent->dump(OS, 0, PDB_DumpLevel::Compact, PDB_DF_Children);
- OS << "::";
- }
- OS << "<vtbl> ";
- if (auto VtblPointer =
- Session.getConcreteSymbolById<PDBSymbolTypePointer>(getTypeId())) {
- if (auto VtblShape =
- Session.getConcreteSymbolById<PDBSymbolTypeVTableShape>(
- VtblPointer->getTypeId()))
- OS << "(" << VtblShape->getCount() << " entries)";
- }
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeVTableShape.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeVTableShape.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeVTableShape.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeVTableShape.cpp Sun Feb 22 16:03:38 2015
@@ -10,6 +10,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h"
#include "llvm/DebugInfo/PDB/PDBSymbol.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
@@ -20,4 +21,6 @@ PDBSymbolTypeVTableShape::PDBSymbolTypeV
: PDBSymbol(PDBSession, std::move(Symbol)) {}
void PDBSymbolTypeVTableShape::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {}
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
+}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolUnknown.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolUnknown.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolUnknown.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolUnknown.cpp Sun Feb 22 16:03:38 2015
@@ -10,6 +10,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolUnknown.h"
#include "llvm/DebugInfo/PDB/PDBSymbol.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
@@ -20,4 +21,6 @@ PDBSymbolUnknown::PDBSymbolUnknown(const
: PDBSymbol(PDBSession, std::move(Symbol)) {}
void PDBSymbolUnknown::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {}
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
+}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolUsingNamespace.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolUsingNamespace.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolUsingNamespace.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolUsingNamespace.cpp Sun Feb 22 16:03:38 2015
@@ -10,6 +10,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h"
#include "llvm/DebugInfo/PDB/PDBSymbol.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
@@ -20,4 +21,6 @@ PDBSymbolUsingNamespace::PDBSymbolUsingN
: PDBSymbol(PDBSession, std::move(Symbol)) {}
void PDBSymbolUsingNamespace::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {}
+ PDBSymDumper &Dumper) const {
+ Dumper.dump(*this, OS, Indent);
+}
Modified: llvm/trunk/test/DebugInfo/PDB/pdbdump-symbol-format.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/PDB/pdbdump-symbol-format.test?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/PDB/pdbdump-symbol-format.test (original)
+++ llvm/trunk/test/DebugInfo/PDB/pdbdump-symbol-format.test Sun Feb 22 16:03:38 2015
@@ -3,7 +3,7 @@
; The format is func [0x<rva_start>+<prologue_length> - 0x<rva_end>-<epilogue_length>]
; SYM_FORMAT: symbolformat-fpo.obj
-; SYM_FORMAT-DAG: func [0x001130+0 - 0x001137-1] (VFrame) uint32_t __cdecl fpo_func(uint32_t)
+; SYM_FORMAT-DAG: func [0x001130+0 - 0x001137-1] (FPO) uint32_t __cdecl fpo_func(uint32_t)
; SYM_FORMAT: symbolformat.obj
; SYM_FORMAT-DAG: func [0x001060+3 - 0x001067-2] (EBP) int32_t __cdecl _purecall()
; SYM_FORMAT-DAG: func [0x001070+6 - 0x001099-4] (EBP) int32_t __cdecl main(int32_t, char**)
@@ -17,11 +17,11 @@
; TYPES_FORMAT: Function Signatures
; TYPES_FORMAT-DAG: int32_t __cdecl ()
; TYPES_FORMAT-DAG: int32_t __cdecl (int32_t, char**)
-; TYPES_FORMAT-DAG: void __thiscall (A::*)()
-; TYPES_FORMAT-DAG: void __thiscall (B::*)()
-; TYPES_FORMAT-DAG: void __thiscall (B::*)(B&)
-; TYPES_FORMAT-DAG: void __thiscall (B::*)()
-; TYPES_FORMAT-DAG: B& __thiscall (B::*)(B&)
-; TYPES_FORMAT-DAG: void __thiscall (A::*)(A&)
-; TYPES_FORMAT-DAG: void __thiscall (A::*)()
-; TYPES_FORMAT-DAG: A& __thiscall (A::*)(A&)
+; TYPES_FORMAT-DAG: void __thiscall (A::)()
+; TYPES_FORMAT-DAG: void __thiscall (B::)()
+; TYPES_FORMAT-DAG: void __thiscall (B::)(B&)
+; TYPES_FORMAT-DAG: void __thiscall (B::)()
+; TYPES_FORMAT-DAG: B& __thiscall (B::)(B&)
+; TYPES_FORMAT-DAG: void __thiscall (A::)(A&)
+; TYPES_FORMAT-DAG: void __thiscall (A::)()
+; TYPES_FORMAT-DAG: A& __thiscall (A::)(A&)
Modified: llvm/trunk/tools/llvm-pdbdump/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/CMakeLists.txt?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-pdbdump/CMakeLists.txt (original)
+++ llvm/trunk/tools/llvm-pdbdump/CMakeLists.txt Sun Feb 22 16:03:38 2015
@@ -5,4 +5,8 @@ set(LLVM_LINK_COMPONENTS
add_llvm_tool(llvm-pdbdump
llvm-pdbdump.cpp
+ CompilandDumper.cpp
+ FunctionDumper.cpp
+ TypeDumper.cpp
+ TypedefDumper.cpp
)
Added: llvm/trunk/tools/llvm-pdbdump/CompilandDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/CompilandDumper.cpp?rev=230184&view=auto
==============================================================================
--- llvm/trunk/tools/llvm-pdbdump/CompilandDumper.cpp (added)
+++ llvm/trunk/tools/llvm-pdbdump/CompilandDumper.cpp Sun Feb 22 16:03:38 2015
@@ -0,0 +1,132 @@
+//===- CompilandDumper.cpp - llvm-pdbdump compiland symbol dumper *- C++ *-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "CompilandDumper.h"
+#include "llvm-pdbdump.h"
+
+#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
+#include "llvm/DebugInfo/PDB/IPDBSession.h"
+#include "llvm/DebugInfo/PDB/PDBExtras.h"
+#include "llvm/DebugInfo/PDB/PDBSymbol.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolCompiland.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolData.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolFunc.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolLabel.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolThunk.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolUnknown.h"
+#include "llvm/Support/Format.h"
+#include "llvm/Support/Path.h"
+#include "llvm/Support/raw_ostream.h"
+
+#include "FunctionDumper.h"
+
+#include <utility>
+#include <vector>
+
+using namespace llvm;
+
+CompilandDumper::CompilandDumper() : PDBSymDumper(true) {}
+
+void CompilandDumper::dump(const PDBSymbolCompilandDetails &Symbol,
+ raw_ostream &OS, int Indent) {}
+
+void CompilandDumper::dump(const PDBSymbolCompilandEnv &Symbol, raw_ostream &OS,
+ int Indent) {}
+
+void CompilandDumper::start(const PDBSymbolCompiland &Symbol, raw_ostream &OS,
+ int Indent, bool Children) {
+ std::string FullName = Symbol.getName();
+ OS << newline(Indent) << FullName;
+ if (!Children)
+ return;
+
+ auto ChildrenEnum = Symbol.findAllChildren();
+ while (auto Child = ChildrenEnum->getNext())
+ Child->dump(OS, Indent + 2, *this);
+}
+
+void CompilandDumper::dump(const PDBSymbolData &Symbol, raw_ostream &OS,
+ int Indent) {
+ OS << newline(Indent);
+ switch (auto LocType = Symbol.getLocationType()) {
+ case PDB_LocType::Static:
+ OS << "data: [";
+ OS << format_hex(Symbol.getRelativeVirtualAddress(), 10);
+ OS << "]";
+ break;
+ case PDB_LocType::Constant:
+ OS << "constant: [" << Symbol.getValue() << "]";
+ break;
+ default:
+ OS << "data(unexpected type=" << LocType << ")";
+ }
+
+ OS << " " << Symbol.getName();
+}
+
+void CompilandDumper::dump(const PDBSymbolFunc &Symbol, raw_ostream &OS,
+ int Indent) {
+ uint32_t FuncStart = Symbol.getRelativeVirtualAddress();
+ uint32_t FuncEnd = FuncStart + Symbol.getLength();
+ OS << newline(Indent) << "func [" << format_hex(FuncStart, 8);
+ if (auto DebugStart = Symbol.findOneChild<PDBSymbolFuncDebugStart>())
+ OS << "+" << DebugStart->getRelativeVirtualAddress() - FuncStart;
+ OS << " - " << format_hex(FuncEnd, 8);
+ if (auto DebugEnd = Symbol.findOneChild<PDBSymbolFuncDebugEnd>())
+ OS << "-" << FuncEnd - DebugEnd->getRelativeVirtualAddress();
+ OS << "] ";
+
+ if (Symbol.hasFramePointer())
+ OS << "(" << Symbol.getLocalBasePointerRegisterId() << ")";
+ else
+ OS << "(FPO)";
+
+ OS << " ";
+
+ FunctionDumper Dumper;
+ Dumper.start(Symbol, OS);
+ OS.flush();
+}
+
+void CompilandDumper::dump(const PDBSymbolLabel &Symbol, raw_ostream &OS,
+ int Indent) {
+ OS << newline(Indent);
+ OS << "label [" << format_hex(Symbol.getRelativeVirtualAddress(), 10) << "] "
+ << Symbol.getName();
+}
+
+void CompilandDumper::dump(const PDBSymbolThunk &Symbol, raw_ostream &OS,
+ int Indent) {
+ OS << newline(Indent) << "thunk ";
+ PDB_ThunkOrdinal Ordinal = Symbol.getThunkOrdinal();
+ uint32_t RVA = Symbol.getRelativeVirtualAddress();
+ if (Ordinal == PDB_ThunkOrdinal::TrampIncremental) {
+ OS << format_hex(RVA, 10);
+ OS << " -> " << format_hex(Symbol.getTargetRelativeVirtualAddress(), 10);
+ } else {
+ OS << "[" << format_hex(RVA, 10);
+ OS << " - " << format_hex(RVA + Symbol.getLength(), 10) << "]";
+ }
+ OS << " (" << Ordinal << ") ";
+ std::string Name = Symbol.getName();
+ if (!Name.empty())
+ OS << Name;
+}
+
+void CompilandDumper::dump(const PDBSymbolTypeTypedef &Symbol, raw_ostream &OS,
+ int Indent) {}
+
+void CompilandDumper::dump(const PDBSymbolUnknown &Symbol, raw_ostream &OS,
+ int Indent) {
+ OS << newline(Indent);
+ OS << "unknown (" << Symbol.getSymTag() << ")";
+}
Added: llvm/trunk/tools/llvm-pdbdump/CompilandDumper.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/CompilandDumper.h?rev=230184&view=auto
==============================================================================
--- llvm/trunk/tools/llvm-pdbdump/CompilandDumper.h (added)
+++ llvm/trunk/tools/llvm-pdbdump/CompilandDumper.h Sun Feb 22 16:03:38 2015
@@ -0,0 +1,39 @@
+//===- CompilandDumper.h - llvm-pdbdump compiland symbol dumper *- C++ --*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_TOOLS_LLVMPDBDUMP_COMPILANDDUMPER_H
+#define LLVM_TOOLS_LLVMPDBDUMP_COMPILANDDUMPER_H
+
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
+
+namespace llvm {
+
+class CompilandDumper : public PDBSymDumper {
+public:
+ CompilandDumper();
+
+ void start(const PDBSymbolCompiland &Symbol, raw_ostream &OS, int Indent,
+ bool Children);
+
+ void dump(const PDBSymbolCompilandDetails &Symbol, raw_ostream &OS,
+ int Indent) override;
+ void dump(const PDBSymbolCompilandEnv &Symbol, raw_ostream &OS,
+ int Indent) override;
+ void dump(const PDBSymbolData &Symbol, raw_ostream &OS, int Indent) override;
+ void dump(const PDBSymbolFunc &Symbol, raw_ostream &OS, int Indent) override;
+ void dump(const PDBSymbolLabel &Symbol, raw_ostream &OS, int Indent) override;
+ void dump(const PDBSymbolThunk &Symbol, raw_ostream &OS, int Indent) override;
+ void dump(const PDBSymbolTypeTypedef &Symbol, raw_ostream &OS,
+ int Indent) override;
+ void dump(const PDBSymbolUnknown &Symbol, raw_ostream &OS,
+ int Indent) override;
+};
+}
+
+#endif
Added: llvm/trunk/tools/llvm-pdbdump/FunctionDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/FunctionDumper.cpp?rev=230184&view=auto
==============================================================================
--- llvm/trunk/tools/llvm-pdbdump/FunctionDumper.cpp (added)
+++ llvm/trunk/tools/llvm-pdbdump/FunctionDumper.cpp Sun Feb 22 16:03:38 2015
@@ -0,0 +1,187 @@
+//===- FunctionDumper.cpp ------------------------------------ *- C++ *-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "FunctionDumper.h"
+
+#include "llvm/DebugInfo/PDB/IPDBSession.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolFunc.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolTypeArray.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolTypePointer.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h"
+
+namespace {
+template <class T>
+void dumpClassParentWithScopeOperator(const T &Symbol, llvm::raw_ostream &OS,
+ llvm::FunctionDumper &Dumper) {
+ uint32_t ClassParentId = Symbol.getClassParentId();
+ auto ClassParent =
+ Symbol.getSession().getConcreteSymbolById<PDBSymbolTypeUDT>(
+ ClassParentId);
+ if (!ClassParent)
+ return;
+
+ OS << ClassParent->getName() << "::";
+}
+}
+
+using namespace llvm;
+
+FunctionDumper::FunctionDumper() : PDBSymDumper(true) {}
+
+void FunctionDumper::start(const PDBSymbolTypeFunctionSig &Symbol,
+ PointerType Pointer, raw_ostream &OS) {
+ auto ReturnType = Symbol.getReturnType();
+ ReturnType->dump(OS, 0, *this);
+ OS << " ";
+ uint32_t ClassParentId = Symbol.getClassParentId();
+ auto ClassParent =
+ Symbol.getSession().getConcreteSymbolById<PDBSymbolTypeUDT>(
+ ClassParentId);
+
+ if (Pointer == PointerType::None) {
+ OS << Symbol.getCallingConvention() << " ";
+ if (ClassParent)
+ OS << "(" << ClassParent->getName() << "::)";
+ } else {
+ OS << "(" << Symbol.getCallingConvention() << " ";
+ if (ClassParent)
+ OS << ClassParent->getName() << "::";
+ if (Pointer == PointerType::Reference)
+ OS << "&";
+ else
+ OS << "*";
+ OS << ")";
+ }
+
+ OS << "(";
+ if (auto ChildEnum = Symbol.getArguments()) {
+ uint32_t Index = 0;
+ while (auto Arg = ChildEnum->getNext()) {
+ Arg->dump(OS, 0, *this);
+ if (++Index < ChildEnum->getChildCount())
+ OS << ", ";
+ }
+ }
+ OS << ")";
+
+ if (Symbol.isConstType())
+ OS << " const";
+ if (Symbol.isVolatileType())
+ OS << " volatile";
+}
+
+void FunctionDumper::start(const PDBSymbolFunc &Symbol, raw_ostream &OS) {
+ if (Symbol.isVirtual() || Symbol.isPureVirtual())
+ OS << "virtual ";
+
+ auto Signature = Symbol.getSignature();
+ if (!Signature) {
+ OS << Symbol.getName();
+ return;
+ }
+
+ auto ReturnType = Signature->getReturnType();
+ ReturnType->dump(OS, 0, *this);
+
+ OS << " " << Signature->getCallingConvention() << " ";
+ OS << Symbol.getName();
+
+ OS << "(";
+ if (auto ChildEnum = Signature->getArguments()) {
+ uint32_t Index = 0;
+ while (auto Arg = ChildEnum->getNext()) {
+ Arg->dump(OS, 0, *this);
+ if (++Index < ChildEnum->getChildCount())
+ OS << ", ";
+ }
+ }
+ OS << ")";
+
+ if (Symbol.isConstType())
+ OS << " const";
+ if (Symbol.isVolatileType())
+ OS << " volatile";
+ if (Symbol.isPureVirtual())
+ OS << " = 0";
+}
+
+void FunctionDumper::dump(const PDBSymbolTypeArray &Symbol, raw_ostream &OS,
+ int Indent) {
+ uint32_t ElementTypeId = Symbol.getTypeId();
+ auto ElementType = Symbol.getSession().getSymbolById(ElementTypeId);
+ if (!ElementType)
+ return;
+
+ ElementType->dump(OS, 0, *this);
+ OS << "[" << Symbol.getLength() << "]";
+}
+
+void FunctionDumper::dump(const PDBSymbolTypeBuiltin &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_BuiltinType Type = Symbol.getBuiltinType();
+ OS << Type;
+ if (Type == PDB_BuiltinType::UInt || Type == PDB_BuiltinType::Int)
+ OS << (8 * Symbol.getLength()) << "_t";
+}
+
+void FunctionDumper::dump(const PDBSymbolTypeEnum &Symbol, raw_ostream &OS,
+ int Indent) {
+ dumpClassParentWithScopeOperator(Symbol, OS, *this);
+ OS << Symbol.getName();
+}
+
+void FunctionDumper::dump(const PDBSymbolTypeFunctionArg &Symbol,
+ raw_ostream &OS, int Indent) {
+ // PDBSymbolTypeFunctionArg is just a shim over the real argument. Just drill
+ // through to the
+ // real thing and dump it.
+ uint32_t TypeId = Symbol.getTypeId();
+ auto Type = Symbol.getSession().getSymbolById(TypeId);
+ if (!Type)
+ return;
+ Type->dump(OS, 0, *this);
+}
+
+void FunctionDumper::dump(const PDBSymbolTypeTypedef &Symbol, raw_ostream &OS,
+ int Indent) {
+ dumpClassParentWithScopeOperator(Symbol, OS, *this);
+ OS << Symbol.getName();
+}
+
+void FunctionDumper::dump(const PDBSymbolTypePointer &Symbol, raw_ostream &OS,
+ int Indent) {
+ uint32_t PointeeId = Symbol.getTypeId();
+ auto PointeeType = Symbol.getSession().getSymbolById(PointeeId);
+ if (!PointeeType)
+ return;
+
+ if (auto FuncSig = dyn_cast<PDBSymbolTypeFunctionSig>(PointeeType.get())) {
+ FunctionDumper NestedDumper;
+ PointerType Pointer =
+ Symbol.isReference() ? PointerType::Reference : PointerType::Pointer;
+ NestedDumper.start(*FuncSig, Pointer, OS);
+ } else {
+ if (Symbol.isConstType())
+ OS << "const ";
+ if (Symbol.isVolatileType())
+ OS << "volatile ";
+ PointeeType->dump(OS, Indent, *this);
+ OS << (Symbol.isReference() ? "&" : "*");
+ }
+}
+
+void FunctionDumper::dump(const PDBSymbolTypeUDT &Symbol, raw_ostream &OS,
+ int Indent) {
+ OS << Symbol.getName();
+}
Added: llvm/trunk/tools/llvm-pdbdump/FunctionDumper.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/FunctionDumper.h?rev=230184&view=auto
==============================================================================
--- llvm/trunk/tools/llvm-pdbdump/FunctionDumper.h (added)
+++ llvm/trunk/tools/llvm-pdbdump/FunctionDumper.h Sun Feb 22 16:03:38 2015
@@ -0,0 +1,44 @@
+//===- FunctionDumper.h --------------------------------------- *- C++ --*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_TOOLS_LLVMPDBDUMP_FUNCTIONDUMPER_H
+#define LLVM_TOOLS_LLVMPDBDUMP_FUNCTIONDUMPER_H
+
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
+
+namespace llvm {
+
+class FunctionDumper : public PDBSymDumper {
+public:
+ FunctionDumper();
+
+ enum class PointerType { None, Pointer, Reference };
+
+ void start(const PDBSymbolTypeFunctionSig &Symbol, PointerType Pointer,
+ raw_ostream &OS);
+ void start(const PDBSymbolFunc &Symbol, raw_ostream &OS);
+
+ void dump(const PDBSymbolTypeArray &Symbol, raw_ostream &OS,
+ int Indent) override;
+ void dump(const PDBSymbolTypeBuiltin &Symbol, raw_ostream &OS,
+ int Indent) override;
+ void dump(const PDBSymbolTypeEnum &Symbol, raw_ostream &OS,
+ int Indent) override;
+ void dump(const PDBSymbolTypeFunctionArg &Symbol, raw_ostream &OS,
+ int Indent) override;
+ void dump(const PDBSymbolTypePointer &Symbol, raw_ostream &OS,
+ int Indent) override;
+ void dump(const PDBSymbolTypeTypedef &Symbol, raw_ostream &OS,
+ int Indent) override;
+ void dump(const PDBSymbolTypeUDT &Symbol, raw_ostream &OS,
+ int Indent) override;
+};
+}
+
+#endif
Added: llvm/trunk/tools/llvm-pdbdump/TypeDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/TypeDumper.cpp?rev=230184&view=auto
==============================================================================
--- llvm/trunk/tools/llvm-pdbdump/TypeDumper.cpp (added)
+++ llvm/trunk/tools/llvm-pdbdump/TypeDumper.cpp Sun Feb 22 16:03:38 2015
@@ -0,0 +1,63 @@
+//===- TypeDumper.cpp - PDBSymDumper implementation for types *----- C++ *-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "TypeDumper.h"
+
+#include "FunctionDumper.h"
+#include "llvm-pdbdump.h"
+#include "TypedefDumper.h"
+
+#include "llvm/DebugInfo/PDB/IPDBSession.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolExe.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h"
+
+using namespace llvm;
+
+TypeDumper::TypeDumper() : PDBSymDumper(true) {}
+
+void TypeDumper::start(const PDBSymbolExe &Exe, raw_ostream &OS, int Indent) {
+ auto Enums = Exe.findAllChildren<PDBSymbolTypeEnum>();
+ OS << newline(Indent) << "Enums: (" << Enums->getChildCount() << " items)";
+ while (auto Enum = Enums->getNext())
+ Enum->dump(OS, Indent + 2, *this);
+
+ auto FuncSigs = Exe.findAllChildren<PDBSymbolTypeFunctionSig>();
+ OS << newline(Indent);
+ OS << "Function Signatures: (" << FuncSigs->getChildCount() << " items)";
+ while (auto Sig = FuncSigs->getNext())
+ Sig->dump(OS, Indent + 2, *this);
+
+ auto Typedefs = Exe.findAllChildren<PDBSymbolTypeTypedef>();
+ OS << newline(Indent) << "Typedefs: (" << Typedefs->getChildCount()
+ << " items)";
+ while (auto Typedef = Typedefs->getNext())
+ Typedef->dump(OS, Indent + 2, *this);
+}
+
+void TypeDumper::dump(const PDBSymbolTypeEnum &Symbol, raw_ostream &OS,
+ int Indent) {
+ OS << newline(Indent) << "enum " << Symbol.getName();
+}
+
+void TypeDumper::dump(const PDBSymbolTypeFunctionSig &Symbol, raw_ostream &OS,
+ int Indent) {
+ OS << newline(Indent);
+ FunctionDumper Dumper;
+ Dumper.start(Symbol, FunctionDumper::PointerType::None, OS);
+}
+
+void TypeDumper::dump(const PDBSymbolTypeTypedef &Symbol, raw_ostream &OS,
+ int Indent) {
+ OS << newline(Indent);
+ TypedefDumper Dumper;
+ Dumper.start(Symbol, OS, Indent);
+ OS.flush();
+}
Added: llvm/trunk/tools/llvm-pdbdump/TypeDumper.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/TypeDumper.h?rev=230184&view=auto
==============================================================================
--- llvm/trunk/tools/llvm-pdbdump/TypeDumper.h (added)
+++ llvm/trunk/tools/llvm-pdbdump/TypeDumper.h Sun Feb 22 16:03:38 2015
@@ -0,0 +1,32 @@
+//===- TypeDumper.h - PDBSymDumper implementation for types *- C++ ------*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_TOOLS_LLVMPDBDUMP_TYPEDUMPER_H
+#define LLVM_TOOLS_LLVMPDBDUMP_TYPEDUMPER_H
+
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
+
+namespace llvm {
+
+class TypeDumper : public PDBSymDumper {
+public:
+ TypeDumper();
+
+ void start(const PDBSymbolExe &Exe, raw_ostream &OS, int Indent);
+
+ void dump(const PDBSymbolTypeEnum &Symbol, raw_ostream &OS,
+ int Indent) override;
+ void dump(const PDBSymbolTypeFunctionSig &Symbol, raw_ostream &OS,
+ int Indent) override;
+ void dump(const PDBSymbolTypeTypedef &Symbol, raw_ostream &OS,
+ int Indent) override;
+};
+}
+
+#endif
Added: llvm/trunk/tools/llvm-pdbdump/TypedefDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/TypedefDumper.cpp?rev=230184&view=auto
==============================================================================
--- llvm/trunk/tools/llvm-pdbdump/TypedefDumper.cpp (added)
+++ llvm/trunk/tools/llvm-pdbdump/TypedefDumper.cpp Sun Feb 22 16:03:38 2015
@@ -0,0 +1,84 @@
+//===- TypedefDumper.cpp - PDBSymDumper impl for typedefs -------- * C++ *-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "TypedefDumper.h"
+
+#include "FunctionDumper.h"
+#include "llvm-pdbdump.h"
+
+#include "llvm/DebugInfo/PDB/IPDBSession.h"
+#include "llvm/DebugInfo/PDB/PDBExtras.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolTypePointer.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h"
+
+using namespace llvm;
+
+TypedefDumper::TypedefDumper() : PDBSymDumper(true) {}
+
+void TypedefDumper::start(const PDBSymbolTypeTypedef &Symbol, raw_ostream &OS,
+ int Indent) {
+ OS << "typedef:" << Symbol.getName() << " -> ";
+ uint32_t TargetId = Symbol.getTypeId();
+ if (auto TypeSymbol = Symbol.getSession().getSymbolById(TargetId))
+ TypeSymbol->dump(OS, 0, *this);
+}
+
+void TypedefDumper::dump(const PDBSymbolTypeArray &Symbol, raw_ostream &OS,
+ int Indent) {}
+
+void TypedefDumper::dump(const PDBSymbolTypeBuiltin &Symbol, raw_ostream &OS,
+ int Indent) {
+ PDB_BuiltinType Type = Symbol.getBuiltinType();
+ OS << Type;
+ if (Type == PDB_BuiltinType::UInt || Type == PDB_BuiltinType::Int)
+ OS << (8 * Symbol.getLength()) << "_t";
+}
+
+void TypedefDumper::dump(const PDBSymbolTypeEnum &Symbol, raw_ostream &OS,
+ int Indent) {
+ OS << "enum " << Symbol.getName();
+}
+
+void TypedefDumper::dump(const PDBSymbolTypePointer &Symbol, raw_ostream &OS,
+ int Indent) {
+ if (Symbol.isConstType())
+ OS << "const ";
+ if (Symbol.isVolatileType())
+ OS << "volatile ";
+ uint32_t PointeeId = Symbol.getTypeId();
+ auto PointeeType = Symbol.getSession().getSymbolById(PointeeId);
+ if (!PointeeType)
+ return;
+ if (auto FuncSig = dyn_cast<PDBSymbolTypeFunctionSig>(PointeeType.get())) {
+ FunctionDumper::PointerType Pointer = FunctionDumper::PointerType::Pointer;
+ if (Symbol.isReference())
+ Pointer = FunctionDumper::PointerType::Reference;
+ FunctionDumper NestedDumper;
+ NestedDumper.start(*FuncSig, Pointer, OS);
+ OS.flush();
+ } else {
+ PointeeType->dump(OS, Indent, *this);
+ OS << ((Symbol.isReference()) ? "&" : "*");
+ }
+}
+
+void TypedefDumper::dump(const PDBSymbolTypeFunctionSig &Symbol,
+ raw_ostream &OS, int Indent) {
+ FunctionDumper Dumper;
+ Dumper.start(Symbol, FunctionDumper::PointerType::None, OS);
+}
+
+void TypedefDumper::dump(const PDBSymbolTypeUDT &Symbol, raw_ostream &OS,
+ int Indent) {
+ OS << "class " << Symbol.getName();
+}
Added: llvm/trunk/tools/llvm-pdbdump/TypedefDumper.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/TypedefDumper.h?rev=230184&view=auto
==============================================================================
--- llvm/trunk/tools/llvm-pdbdump/TypedefDumper.h (added)
+++ llvm/trunk/tools/llvm-pdbdump/TypedefDumper.h Sun Feb 22 16:03:38 2015
@@ -0,0 +1,38 @@
+//===- TypedefDumper.h - llvm-pdbdump typedef dumper ---------*- C++ ----*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_TOOLS_LLVMPDBDUMP_TYPEDEFDUMPER_H
+#define LLVM_TOOLS_LLVMPDBDUMP_TYPEDEFDUMPER_H
+
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
+
+namespace llvm {
+
+class TypedefDumper : public PDBSymDumper {
+public:
+ TypedefDumper();
+
+ void start(const PDBSymbolTypeTypedef &Symbol, raw_ostream &OS, int Indent);
+
+ void dump(const PDBSymbolTypeArray &Symbol, raw_ostream &OS,
+ int Indent) override;
+ void dump(const PDBSymbolTypeBuiltin &Symbol, raw_ostream &OS,
+ int Indent) override;
+ void dump(const PDBSymbolTypeEnum &Symbol, raw_ostream &OS,
+ int Indent) override;
+ void dump(const PDBSymbolTypeFunctionSig &Symbol, raw_ostream &OS,
+ int Indent) override;
+ void dump(const PDBSymbolTypePointer &Symbol, raw_ostream &OS,
+ int Indent) override;
+ void dump(const PDBSymbolTypeUDT &Symbol, raw_ostream &OS,
+ int Indent) override;
+};
+}
+
+#endif
Modified: llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp?rev=230184&r1=230183&r2=230184&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp (original)
+++ llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp Sun Feb 22 16:03:38 2015
@@ -13,6 +13,10 @@
//
//===----------------------------------------------------------------------===//
+#include "llvm-pdbdump.h"
+#include "CompilandDumper.h"
+#include "TypeDumper.h"
+
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Config/config.h"
@@ -24,12 +28,13 @@
#include "llvm/DebugInfo/PDB/PDBSymbolExe.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ConvertUTF.h"
+#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/Process.h"
-#include "llvm/Support/Signals.h"
#include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/Signals.h"
#if defined(HAVE_DIA_SDK)
#include <Windows.h>
@@ -61,24 +66,36 @@ static void dumpInput(StringRef Path) {
}
auto GlobalScope(Session->getGlobalScope());
+ std::string FileName(GlobalScope->getSymbolsFileName());
+
+ outs() << "Summary for " << FileName;
+ uint64_t FileSize = 0;
+ if (!llvm::sys::fs::file_size(FileName, FileSize))
+ outs() << newline(2) << "Size: " << FileSize << " bytes";
+ else
+ outs() << newline(2) << "Size: (Unable to obtain file size)";
+
+ outs() << newline(2) << "Guid: " << GlobalScope->getGuid();
+ outs() << newline(2) << "Age: " << GlobalScope->getAge();
+ outs() << newline(2) << "Attributes: ";
+ if (GlobalScope->hasCTypes())
+ outs() << "HasCTypes ";
+ if (GlobalScope->hasPrivateSymbols())
+ outs() << "HasPrivateSymbols ";
+
PDB_DumpFlags Flags = PDB_DF_None;
- if (opts::DumpTypes)
- Flags |= PDB_DF_Children | PDB_DF_Enums | PDB_DF_Funcsigs |
- PDB_DF_Typedefs | PDB_DF_VTables;
- GlobalScope->dump(outs(), 0, PDB_DumpLevel::Normal, Flags);
- outs() << "\n";
+ if (opts::DumpTypes) {
+ outs() << "\nDumping types";
+ TypeDumper Dumper;
+ Dumper.start(*GlobalScope, outs(), 2);
+ }
if (opts::DumpSymbols || opts::DumpCompilands) {
- outs() << "Dumping compilands\n";
+ outs() << "\nDumping compilands";
auto Compilands = GlobalScope->findAllChildren<PDBSymbolCompiland>();
- Flags = PDB_DF_None;
- if (opts::DumpSymbols)
- Flags |= PDB_DF_Children | PDB_DF_Data | PDB_DF_Functions |
- PDB_DF_Thunks | PDB_DF_Labels;
- while (auto Compiland = Compilands->getNext()) {
- Compiland->dump(outs(), 2, PDB_DumpLevel::Detailed, Flags);
- outs() << "\n";
- }
+ CompilandDumper Dumper;
+ while (auto Compiland = Compilands->getNext())
+ Dumper.start(*Compiland, outs(), 2, opts::DumpSymbols);
}
outs().flush();
}
Added: llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.h?rev=230184&view=auto
==============================================================================
--- llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.h (added)
+++ llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.h Sun Feb 22 16:03:38 2015
@@ -0,0 +1,28 @@
+//===- llvm-pdbdump.h ----------------------------------------- *- C++ --*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_TOOLS_LLVMPDBDUMP_LLVMPDBDUMP_H
+#define LLVM_TOOLS_LLVMPDBDUMP_LLVMPDBDUMP_H
+
+#include "llvm/Support/raw_ostream.h"
+
+namespace llvm {
+struct newline {
+ newline(int IndentWidth) : Width(IndentWidth) {}
+ int Width;
+};
+
+inline raw_ostream &operator<<(raw_ostream &OS, const newline &Indent) {
+ OS << "\n";
+ OS.indent(Indent.Width);
+ return OS;
+}
+}
+
+#endif
\ No newline at end of file
More information about the llvm-commits
mailing list