[llvm] r228960 - Add concrete type overloads to PDBSymbol::findChildren().
Zachary Turner
zturner at google.com
Thu Feb 12 13:09:25 PST 2015
Author: zturner
Date: Thu Feb 12 15:09:24 2015
New Revision: 228960
URL: http://llvm.org/viewvc/llvm-project?rev=228960&view=rev
Log:
Add concrete type overloads to PDBSymbol::findChildren().
Frequently you only want to iterate over children of a specific
type (e.g. functions). Previously you would get back a generic
interface that allowed iteration over the base symbol type,
which you would have to dyn_cast<> each one of. With this patch,
we allow the user to specify the concrete type as a template
parameter, and it will return an iterator which returns instances
of the concrete type directly.
Added:
llvm/trunk/include/llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h
Modified:
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/PDBSymbolUsingNamespace.h
llvm/trunk/lib/DebugInfo/PDB/PDBExtras.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbol.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolData.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFunc.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolThunk.cpp
llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp
Added: llvm/trunk/include/llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h?rev=228960&view=auto
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h (added)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h Thu Feb 12 15:09:24 2015
@@ -0,0 +1,58 @@
+//===- ConcreteSymbolEnumerator.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_DEBUGINFO_PDB_CONCRETESYMBOLENUMERATOR_H
+#define LLVM_DEBUGINFO_PDB_CONCRETESYMBOLENUMERATOR_H
+
+#include <memory>
+#include "IPDBEnumChildren.h"
+
+namespace llvm {
+
+template <typename ChildType>
+class ConcreteSymbolEnumerator : public IPDBEnumChildren<ChildType> {
+public:
+ ConcreteSymbolEnumerator(std::unique_ptr<IPDBEnumSymbols> SymbolEnumerator)
+ : Enumerator(std::move(SymbolEnumerator)) {}
+
+ virtual ~ConcreteSymbolEnumerator() {}
+
+ uint32_t getChildCount() const override {
+ return Enumerator->getChildCount();
+ }
+
+ std::unique_ptr<ChildType> getChildAtIndex(uint32_t Index) const {
+ std::unique_ptr<PDBSymbol> Child = Enumerator->getChildAtIndex(Index);
+ return make_concrete_child(std::move(Child));
+ }
+
+ std::unique_ptr<ChildType> getNext() {
+ std::unique_ptr<PDBSymbol> Child = Enumerator->getNext();
+ return make_concrete_child(std::move(Child));
+ }
+
+ void reset() { Enumerator->reset(); }
+
+ MyType *clone() const {
+ std::unique_ptr<IPDBEnumSymbols> WrappedClone(Enumerator->clone());
+ return new ConcreteSymbolEnumerator<ChildType>(std::move(WrappedClone));
+ }
+
+private:
+ std::unique_ptr<ChildType>
+ make_concrete_child(std::unique_ptr<PDBSymbol> Child) const {
+ ChildType *ConcreteChild = dyn_cast_or_null<ChildType>(Child.release());
+ return std::unique_ptr<ChildType>(ConcreteChild);
+ }
+
+ std::unique_ptr<IPDBEnumSymbols> Enumerator;
+};
+}
+
+#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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbol.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbol.h Thu Feb 12 15:09:24 2015
@@ -16,6 +16,7 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Casting.h"
+#include "ConcreteSymbolEnumerator.h"
#include "IPDBRawSymbol.h"
#include "PDBExtras.h"
#include "PDBTypes.h"
@@ -30,6 +31,10 @@ namespace llvm {
class IPDBRawSymbol;
class raw_ostream;
+#define DECLARE_PDB_SYMBOL_CONCRETE_TYPE(TagValue) \
+ static const PDB_SymType Tag = TagValue; \
+ static bool classof(const PDBSymbol *S) { return S->getSymTag() == Tag; }
+
/// PDBSymbol defines the base of the inheritance hierarchy for concrete symbol
/// types (e.g. functions, executables, vtables, etc). All concrete symbol
/// types inherit from PDBSymbol and expose the exact set of methods that are
@@ -55,7 +60,18 @@ public:
PDB_SymType getSymTag() const;
- std::unique_ptr<IPDBEnumSymbols> findChildren(PDB_SymType Type) const;
+ template <typename T> std::unique_ptr<T> findOneChild() const {
+ auto Enumerator(findAllChildren<T>());
+ return Enumerator->getNext();
+ }
+
+ template <typename T>
+ std::unique_ptr<ConcreteSymbolEnumerator<T>> findAllChildren() const {
+ auto BaseIter = RawSymbol->findChildren(T::Tag);
+ return std::make_unique<ConcreteSymbolEnumerator<T>>(std::move(BaseIter));
+ }
+
+ std::unique_ptr<IPDBEnumSymbols> findAllChildren() const;
std::unique_ptr<IPDBEnumSymbols>
findChildren(PDB_SymType Type, StringRef Name,
PDB_NameSearchFlags Flags) 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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolAnnotation.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolAnnotation.h Thu Feb 12 15:09:24 2015
@@ -23,6 +23,8 @@ public:
PDBSymbolAnnotation(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Annotation)
+
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getAddressOffset)
@@ -32,10 +34,6 @@ public:
FORWARD_SYMBOL_METHOD(getSymIndexId)
// FORWARD_SYMBOL_METHOD(getValue)
FORWARD_SYMBOL_METHOD(getVirtualAddress)
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::Annotation;
- }
};
}
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolBlock.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolBlock.h Thu Feb 12 15:09:24 2015
@@ -23,6 +23,8 @@ public:
PDBSymbolBlock(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Block)
+
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getAddressOffset)
@@ -34,10 +36,6 @@ public:
FORWARD_SYMBOL_METHOD(getRelativeVirtualAddress)
FORWARD_SYMBOL_METHOD(getSymIndexId)
FORWARD_SYMBOL_METHOD(getVirtualAddress)
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::Block;
- }
};
}
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCompiland.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCompiland.h Thu Feb 12 15:09:24 2015
@@ -23,6 +23,8 @@ public:
PDBSymbolCompiland(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> CompilandSymbol);
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Compiland)
+
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(isEditAndContinueEnabled)
@@ -31,10 +33,6 @@ public:
FORWARD_SYMBOL_METHOD(getName)
FORWARD_SYMBOL_METHOD(getSourceFileName)
FORWARD_SYMBOL_METHOD(getSymIndexId)
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::Compiland;
- }
};
}
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h Thu Feb 12 15:09:24 2015
@@ -22,6 +22,8 @@ public:
PDBSymbolCompilandDetails(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::CompilandDetails)
+
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
void getFrontEndVersion(VersionInfo &Version) const {
@@ -46,10 +48,6 @@ public:
FORWARD_SYMBOL_METHOD(getLexicalParentId)
FORWARD_SYMBOL_METHOD(getPlatform)
FORWARD_SYMBOL_METHOD(getSymIndexId)
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::CompilandDetails;
- }
};
} // namespace llvm
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h Thu Feb 12 15:09:24 2015
@@ -22,16 +22,14 @@ public:
PDBSymbolCompilandEnv(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::CompilandEnv)
+
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getLexicalParentId)
FORWARD_SYMBOL_METHOD(getName)
FORWARD_SYMBOL_METHOD(getSymIndexId)
std::string getValue() const;
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::CompilandEnv;
- }
};
} // namespace llvm
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCustom.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCustom.h Thu Feb 12 15:09:24 2015
@@ -27,14 +27,12 @@ public:
PDBSymbolCustom(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> CustomSymbol);
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Custom)
+
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
void getDataBytes(llvm::SmallVector<uint8_t, 32> &bytes);
FORWARD_SYMBOL_METHOD(getSymIndexId)
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::Custom;
- }
};
} // namespace llvm
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolData.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolData.h Thu Feb 12 15:09:24 2015
@@ -22,6 +22,8 @@ public:
PDBSymbolData(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> DataSymbol);
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Data)
+
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getAccess)
@@ -50,10 +52,6 @@ public:
// FORWARD_SYMBOL_METHOD(getValue)
FORWARD_SYMBOL_METHOD(getVirtualAddress)
FORWARD_SYMBOL_METHOD(isVolatileType)
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::Data;
- }
};
} // namespace llvm
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolExe.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolExe.h Thu Feb 12 15:09:24 2015
@@ -24,6 +24,8 @@ public:
PDBSymbolExe(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> ExeSymbol);
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Exe)
+
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getAge)
@@ -35,10 +37,6 @@ public:
FORWARD_SYMBOL_METHOD(getSignature)
FORWARD_SYMBOL_METHOD(getSymbolsFileName)
FORWARD_SYMBOL_METHOD(getSymIndexId)
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::Exe;
- }
};
} // namespace llvm
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolFunc.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolFunc.h Thu Feb 12 15:09:24 2015
@@ -24,6 +24,8 @@ public:
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Function)
+
FORWARD_SYMBOL_METHOD(getAccess)
FORWARD_SYMBOL_METHOD(getAddressOffset)
FORWARD_SYMBOL_METHOD(getAddressSection)
@@ -66,10 +68,6 @@ public:
FORWARD_SYMBOL_METHOD(getVirtualAddress)
FORWARD_SYMBOL_METHOD(getVirtualBaseOffset)
FORWARD_SYMBOL_METHOD(isVolatileType)
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::Function;
- }
};
} // namespace llvm
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h Thu Feb 12 15:09:24 2015
@@ -22,6 +22,8 @@ public:
PDBSymbolFuncDebugEnd(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> FuncDebugEndSymbol);
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::FuncDebugEnd)
+
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getAddressOffset)
@@ -40,10 +42,6 @@ public:
FORWARD_SYMBOL_METHOD(getRelativeVirtualAddress)
FORWARD_SYMBOL_METHOD(getSymIndexId)
FORWARD_SYMBOL_METHOD(getVirtualAddress)
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::FuncDebugEnd;
- }
};
} // namespace llvm
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h Thu Feb 12 15:09:24 2015
@@ -22,6 +22,8 @@ public:
PDBSymbolFuncDebugStart(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> FuncDebugStartSymbol);
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::FuncDebugStart)
+
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getAddressOffset)
@@ -40,10 +42,6 @@ public:
FORWARD_SYMBOL_METHOD(getRelativeVirtualAddress)
FORWARD_SYMBOL_METHOD(getSymIndexId)
FORWARD_SYMBOL_METHOD(getVirtualAddress)
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::FuncDebugStart;
- }
};
} // namespace llvm
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolLabel.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolLabel.h Thu Feb 12 15:09:24 2015
@@ -22,6 +22,8 @@ public:
PDBSymbolLabel(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> LabelSymbol);
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Label)
+
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getAddressOffset)
@@ -40,10 +42,6 @@ public:
FORWARD_SYMBOL_METHOD(getRelativeVirtualAddress)
FORWARD_SYMBOL_METHOD(getSymIndexId)
FORWARD_SYMBOL_METHOD(getVirtualAddress)
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::Label;
- }
};
} // namespace llvm
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h Thu Feb 12 15:09:24 2015
@@ -22,6 +22,8 @@ public:
PDBSymbolPublicSymbol(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> PublicSymbol);
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::PublicSymbol)
+
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getAddressOffset)
@@ -38,10 +40,6 @@ public:
FORWARD_SYMBOL_METHOD(getRelativeVirtualAddress)
FORWARD_SYMBOL_METHOD(getVirtualAddress)
FORWARD_SYMBOL_METHOD(getUndecoratedName)
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::PublicSymbol;
- }
};
} // namespace llvm
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolThunk.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolThunk.h Thu Feb 12 15:09:24 2015
@@ -24,6 +24,8 @@ public:
PDBSymbolThunk(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> ThunkSymbol);
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Thunk)
+
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getAccess)
@@ -50,10 +52,6 @@ public:
FORWARD_SYMBOL_METHOD(getVirtualAddress)
FORWARD_SYMBOL_METHOD(getVirtualBaseOffset)
FORWARD_SYMBOL_METHOD(isVolatileType)
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::Thunk;
- }
};
} // namespace llvm
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeArray.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeArray.h Thu Feb 12 15:09:24 2015
@@ -22,6 +22,8 @@ public:
PDBSymbolTypeArray(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> ArrayTypeSymbol);
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::ArrayType)
+
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getArrayIndexTypeId)
@@ -34,10 +36,6 @@ public:
FORWARD_SYMBOL_METHOD(getTypeId)
FORWARD_SYMBOL_METHOD(isUnalignedType)
FORWARD_SYMBOL_METHOD(isVolatileType)
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::ArrayType;
- }
};
} // namespace llvm
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h Thu Feb 12 15:09:24 2015
@@ -22,6 +22,8 @@ public:
PDBSymbolTypeBaseClass(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::BaseClass)
+
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getAccess)
@@ -51,10 +53,6 @@ public:
// FORWARD_SYMBOL_METHOD(getVirtualBaseTableType)
FORWARD_SYMBOL_METHOD(getVirtualTableShapeId)
FORWARD_SYMBOL_METHOD(isVolatileType)
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::BaseClass;
- }
};
} // namespace llvm
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h Thu Feb 12 15:09:24 2015
@@ -22,6 +22,8 @@ public:
PDBSymbolTypeBuiltin(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::BuiltinType)
+
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getBuiltinType)
@@ -31,10 +33,6 @@ public:
FORWARD_SYMBOL_METHOD(getSymIndexId)
FORWARD_SYMBOL_METHOD(isUnalignedType)
FORWARD_SYMBOL_METHOD(isVolatileType)
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::BuiltinType;
- }
};
} // namespace llvm
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h Thu Feb 12 15:09:24 2015
@@ -22,15 +22,13 @@ public:
PDBSymbolTypeCustom(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::CustomType)
+
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getOemId)
FORWARD_SYMBOL_METHOD(getOemSymbolId)
FORWARD_SYMBOL_METHOD(getSymIndexId)
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::CustomType;
- }
};
} // namespace llvm
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h Thu Feb 12 15:09:24 2015
@@ -22,15 +22,13 @@ public:
PDBSymbolTypeDimension(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Dimension)
+
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getLowerBoundId)
FORWARD_SYMBOL_METHOD(getUpperBoundId)
FORWARD_SYMBOL_METHOD(getSymIndexId)
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::Dimension;
- }
};
} // namespace llvm
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h Thu Feb 12 15:09:24 2015
@@ -22,6 +22,8 @@ public:
PDBSymbolTypeEnum(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> EnumTypeSymbol);
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Enum)
+
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getBuiltinType)
@@ -42,10 +44,6 @@ public:
FORWARD_SYMBOL_METHOD(getTypeId)
FORWARD_SYMBOL_METHOD(isUnalignedType)
FORWARD_SYMBOL_METHOD(isVolatileType)
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::Enum;
- }
};
} // namespace llvm
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h Thu Feb 12 15:09:24 2015
@@ -22,16 +22,14 @@ public:
PDBSymbolTypeFriend(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Friend)
+
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getClassParentId)
FORWARD_SYMBOL_METHOD(getName)
FORWARD_SYMBOL_METHOD(getSymIndexId)
FORWARD_SYMBOL_METHOD(getTypeId)
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::Friend;
- }
};
} // namespace llvm
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h Thu Feb 12 15:09:24 2015
@@ -22,16 +22,14 @@ public:
PDBSymbolTypeFunctionArg(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::FunctionArg)
+
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getClassParentId)
FORWARD_SYMBOL_METHOD(getLexicalParentId)
FORWARD_SYMBOL_METHOD(getSymIndexId)
FORWARD_SYMBOL_METHOD(getTypeId)
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::FunctionArg;
- }
};
} // namespace llvm
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h Thu Feb 12 15:09:24 2015
@@ -22,6 +22,8 @@ public:
PDBSymbolTypeFunctionSig(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::FunctionSig)
+
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getCallingConvention)
@@ -35,10 +37,6 @@ public:
FORWARD_SYMBOL_METHOD(getTypeId)
FORWARD_SYMBOL_METHOD(isUnalignedType)
FORWARD_SYMBOL_METHOD(isVolatileType)
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::FunctionSig;
- }
};
} // namespace llvm
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h Thu Feb 12 15:09:24 2015
@@ -22,14 +22,12 @@ public:
PDBSymbolTypeManaged(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::ManagedType)
+
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getName)
FORWARD_SYMBOL_METHOD(getSymIndexId)
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::ManagedType;
- }
};
} // namespace llvm
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypePointer.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypePointer.h Thu Feb 12 15:09:24 2015
@@ -22,6 +22,8 @@ public:
PDBSymbolTypePointer(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::PointerType)
+
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(isConstType)
@@ -32,10 +34,6 @@ public:
FORWARD_SYMBOL_METHOD(getTypeId)
FORWARD_SYMBOL_METHOD(isUnalignedType)
FORWARD_SYMBOL_METHOD(isVolatileType)
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::PointerType;
- }
};
} // namespace llvm
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h Thu Feb 12 15:09:24 2015
@@ -22,6 +22,8 @@ public:
PDBSymbolTypeTypedef(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Typedef)
+
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getBuiltinType)
@@ -45,10 +47,6 @@ public:
FORWARD_SYMBOL_METHOD(isUnalignedType)
FORWARD_SYMBOL_METHOD(getVirtualTableShapeId)
FORWARD_SYMBOL_METHOD(isVolatileType)
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::Typedef;
- }
};
} // namespace llvm
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h Thu Feb 12 15:09:24 2015
@@ -22,6 +22,8 @@ public:
PDBSymbolTypeUDT(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> UDTSymbol);
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::UDT)
+
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getClassParentId)
@@ -42,10 +44,6 @@ public:
FORWARD_SYMBOL_METHOD(isUnalignedType)
FORWARD_SYMBOL_METHOD(getVirtualTableShapeId)
FORWARD_SYMBOL_METHOD(isVolatileType)
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::UDT;
- }
};
} // namespace llvm
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h Thu Feb 12 15:09:24 2015
@@ -22,6 +22,8 @@ public:
PDBSymbolTypeVTable(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> VtblSymbol);
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::VTable)
+
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getClassParentId)
@@ -31,10 +33,6 @@ public:
FORWARD_SYMBOL_METHOD(getTypeId)
FORWARD_SYMBOL_METHOD(isUnalignedType)
FORWARD_SYMBOL_METHOD(isVolatileType)
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::VTable;
- }
};
} // namespace llvm
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h Thu Feb 12 15:09:24 2015
@@ -22,6 +22,8 @@ public:
PDBSymbolTypeVTableShape(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> VtblShapeSymbol);
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::VTableShape)
+
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(isConstType)
@@ -30,10 +32,6 @@ public:
FORWARD_SYMBOL_METHOD(getSymIndexId)
FORWARD_SYMBOL_METHOD(isUnalignedType)
FORWARD_SYMBOL_METHOD(isVolatileType)
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::VTableShape;
- }
};
} // namespace llvm
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h Thu Feb 12 15:09:24 2015
@@ -22,15 +22,13 @@ public:
PDBSymbolUsingNamespace(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
+ DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::UsingNamespace)
+
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getLexicalParentId)
FORWARD_SYMBOL_METHOD(getName)
FORWARD_SYMBOL_METHOD(getSymIndexId)
-
- static bool classof(const PDBSymbol *S) {
- return S->getSymTag() == PDB_SymType::UsingNamespace;
- }
};
} // namespace llvm
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBExtras.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBExtras.cpp?rev=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBExtras.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBExtras.cpp Thu Feb 12 15:09:24 2015
@@ -75,7 +75,7 @@ raw_ostream &llvm::operator<<(raw_ostrea
CASE_OUTPUT_ENUM_CLASS_NAME(PDB_RegisterId, R14, OS)
CASE_OUTPUT_ENUM_CLASS_NAME(PDB_RegisterId, R15, OS)
default:
- OS << "Unknown";
+ OS << static_cast<int>(Reg);
}
return OS;
}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbol.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbol.cpp?rev=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbol.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbol.cpp Thu Feb 12 15:09:24 2015
@@ -105,8 +105,8 @@ void PDBSymbol::defaultDump(raw_ostream
PDB_SymType PDBSymbol::getSymTag() const { return RawSymbol->getSymTag(); }
-std::unique_ptr<IPDBEnumSymbols> PDBSymbol::findChildren(PDB_SymType Type) const {
- return RawSymbol->findChildren(Type);
+std::unique_ptr<IPDBEnumSymbols> PDBSymbol::findAllChildren() const {
+ return RawSymbol->findChildren(PDB_SymType::None);
}
std::unique_ptr<IPDBEnumSymbols>
@@ -128,7 +128,7 @@ PDBSymbol::findInlineFramesByRVA(uint32_
std::unique_ptr<IPDBEnumSymbols>
PDBSymbol::getChildStats(TagStats &Stats) const {
- std::unique_ptr<IPDBEnumSymbols> Result(findChildren(PDB_SymType::None));
+ std::unique_ptr<IPDBEnumSymbols> Result(findAllChildren());
Stats.clear();
while (auto Child = Result->getNext()) {
++Stats[Child->getSymTag()];
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp?rev=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp Thu Feb 12 15:09:24 2015
@@ -19,6 +19,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h"
#include "llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h"
#include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/Path.h"
using namespace llvm;
@@ -28,9 +29,11 @@ PDBSymbolCompiland::PDBSymbolCompiland(c
void PDBSymbolCompiland::dump(raw_ostream &OS, int Indent,
PDB_DumpLevel Level) const {
- std::string Name = getName();
- OS << "---- [IDX: " << getSymIndexId() << "] Compiland: " << Name
- << " ----\n";
+ std::string FullName = getName();
+ StringRef Name = llvm::sys::path::filename(StringRef(FullName.c_str()));
+
+ OS.indent(Indent);
+ OS << "Compiland: " << Name << "\n";
std::string Source = getSourceFileName();
std::string Library = getLibraryName();
@@ -54,11 +57,8 @@ void PDBSymbolCompiland::dump(raw_ostrea
}
}
- std::unique_ptr<IPDBEnumSymbols> DetailsEnum(
- findChildren(PDB_SymType::CompilandDetails));
- if (auto DetailsPtr = DetailsEnum->getNext()) {
- const auto *CD = dyn_cast<PDBSymbolCompilandDetails>(DetailsPtr.get());
- assert(CD && "We only asked for compilands, but got something else!");
+ auto DetailsEnum(findAllChildren<PDBSymbolCompilandDetails>());
+ if (auto CD = DetailsEnum->getNext()) {
VersionInfo FE;
VersionInfo BE;
CD->getFrontEndVersion(FE);
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolData.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolData.cpp?rev=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolData.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolData.cpp Thu Feb 12 15:09:24 2015
@@ -25,9 +25,11 @@ void PDBSymbolData::dump(raw_ostream &OS
if (Level == PDB_DumpLevel::Compact) {
PDB_LocType Loc = getLocationType();
OS << Loc << " data [";
+ int Length;
switch (Loc) {
case PDB_LocType::Static:
OS << format_hex(getRelativeVirtualAddress(), 10);
+ Length = getLength();
break;
case PDB_LocType::TLS:
OS << getAddressSection() << ":" << format_hex(getAddressOffset(), 10);
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFunc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFunc.cpp?rev=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFunc.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFunc.cpp Thu Feb 12 15:09:24 2015
@@ -27,35 +27,21 @@ void PDBSymbolFunc::dump(raw_ostream &OS
if (Level == PDB_DumpLevel::Compact) {
uint32_t FuncStart = getRelativeVirtualAddress();
uint32_t FuncEnd = FuncStart + getLength();
- auto DebugEndSymbol = findChildren(PDB_SymType::FuncDebugEnd);
OS << stream_indent(Indent);
OS << "[" << format_hex(FuncStart, 8);
- if (auto DebugStartEnum = findChildren(PDB_SymType::FuncDebugStart)) {
- if (auto StartSym = DebugStartEnum->getNext()) {
- auto DebugStart = dyn_cast<PDBSymbolFuncDebugStart>(StartSym.get());
- OS << "+" << DebugStart->getRelativeVirtualAddress() - FuncStart;
- }
- }
+ if (auto DebugStart = findOneChild<PDBSymbolFuncDebugStart>())
+ OS << "+" << DebugStart->getRelativeVirtualAddress() - FuncStart;
OS << " - " << format_hex(FuncEnd, 8);
- if (auto DebugEndEnum = findChildren(PDB_SymType::FuncDebugEnd)) {
- if (auto DebugEndSym = DebugEndEnum->getNext()) {
- auto DebugEnd = dyn_cast<PDBSymbolFuncDebugEnd>(DebugEndSym.get());
+ if (auto DebugEnd = findOneChild<PDBSymbolFuncDebugEnd>())
OS << "-" << FuncEnd - DebugEnd->getRelativeVirtualAddress();
- }
- }
OS << "] ";
PDB_RegisterId Reg = getLocalBasePointerRegisterId();
if (Reg == PDB_RegisterId::VFrame)
OS << "(VFrame)";
- else if (hasFramePointer()) {
- if (Reg == PDB_RegisterId::EBP)
- OS << "(EBP)";
- else
- OS << "(" << (int)Reg << ")";
- } else {
+ else if (hasFramePointer())
+ OS << "(" << Reg << ")";
+ else
OS << "(FPO)";
- }
OS << " " << getName() << "\n";
}
- OS.flush();
}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolThunk.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolThunk.cpp?rev=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolThunk.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolThunk.cpp Thu Feb 12 15:09:24 2015
@@ -25,11 +25,17 @@ void PDBSymbolThunk::dump(raw_ostream &O
if (Level == PDB_DumpLevel::Compact) {
OS.indent(Indent);
PDB_ThunkOrdinal Ordinal = getThunkOrdinal();
- OS << "THUNK[" << Ordinal << "] ";
- OS << "[" << format_hex(getRelativeVirtualAddress(), 10);
+ 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 << " thunk(" << Ordinal << ")";
if (Ordinal == PDB_ThunkOrdinal::TrampIncremental)
OS << " -> " << format_hex(getTargetRelativeVirtualAddress(), 10);
- OS << "] ";
+ OS << " ";
std::string Name = getName();
if (!Name.empty())
OS << Name;
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=228960&r1=228959&r2=228960&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp (original)
+++ llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp Thu Feb 12 15:09:24 2015
@@ -63,11 +63,9 @@ static void dumpInput(StringRef Path) {
outs().flush();
if (opts::Compilands) {
- auto Compilands = GlobalScope->findChildren(PDB_SymType::Compiland);
- if (Compilands) {
- while (auto Compiland = Compilands->getNext()) {
- Compiland->dump(outs(), 0, PDB_DumpLevel::Normal);
- }
+ auto Compilands = GlobalScope->findAllChildren<PDBSymbolCompiland>();
+ while (auto Compiland = Compilands->getNext()) {
+ Compiland->dump(outs(), 0, PDB_DumpLevel::Normal);
}
}
outs().flush();
More information about the llvm-commits
mailing list