[llvm] r299831 - General usability improvements to generic PDB library.
Zachary Turner via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 9 23:14:11 PDT 2017
Author: zturner
Date: Mon Apr 10 01:14:09 2017
New Revision: 299831
URL: http://llvm.org/viewvc/llvm-project?rev=299831&view=rev
Log:
General usability improvements to generic PDB library.
1. Added some asserts to make sure concrete symbol types don't
get constructed with RawSymbols that have an incompatible
SymTag enum value.
2. Added new forwarding macros that auto-define an Id/Sym method
pair whenever there is a method that returns a SymIndexId.
Previously we would just provide one method that returned only
the SymIndexId and it was up to the caller to use the Session
object to get a pointer to the symbol. Now we automatically
get both the method that returns the Id, as well as a method
that returns the pointer directly with just one macro.
3. Added some methods for dumping straight to stdout that can
be used from inside the debugger for diagnostics during a
debug session.
4. Added a clone() method and a cast<T>() method to PDBSymbol
that can shorten some usage patterns.
Modified:
llvm/trunk/include/llvm/DebugInfo/PDB/IPDBSession.h
llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbol.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/PDBSymbolData.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/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/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/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/PDBSymbolUsingNamespace.cpp
llvm/trunk/tools/llvm-pdbdump/PrettyClassDefinitionDumper.cpp
llvm/trunk/tools/llvm-pdbdump/PrettyFunctionDumper.cpp
llvm/trunk/tools/llvm-pdbdump/PrettyTypeDumper.cpp
llvm/trunk/tools/llvm-pdbdump/PrettyTypedefDumper.cpp
llvm/trunk/tools/llvm-pdbdump/PrettyVariableDumper.cpp
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/IPDBSession.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/IPDBSession.h?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/IPDBSession.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/IPDBSession.h Mon Apr 10 01:14:09 2017
@@ -10,6 +10,7 @@
#ifndef LLVM_DEBUGINFO_PDB_IPDBSESSION_H
#define LLVM_DEBUGINFO_PDB_IPDBSESSION_H
+#include "PDBSymbol.h"
#include "PDBTypes.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Casting.h"
@@ -44,6 +45,12 @@ public:
return std::unique_ptr<T>(ConcreteSymbol);
}
+ template <>
+ std::unique_ptr<PDBSymbol>
+ getConcreteSymbolById<PDBSymbol>(uint32_t SymbolId) const {
+ return getSymbolById(SymbolId);
+ }
+
virtual std::unique_ptr<PDBSymbol>
findSymbolByAddress(uint64_t Address, PDB_SymType Type) const = 0;
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=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbol.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbol.h Mon Apr 10 01:14:09 2017
@@ -22,6 +22,23 @@
return RawSymbol->MethodName(); \
}
+#define FORWARD_CONCRETE_SYMBOL_ID_METHOD_WITH_NAME(ConcreteType, PrivateName, \
+ PublicName) \
+ auto PublicName##Id() const->decltype(RawSymbol->PrivateName##Id()) { \
+ return RawSymbol->PrivateName##Id(); \
+ } \
+ std::unique_ptr<ConcreteType> PublicName() const { \
+ uint32_t Id = PublicName##Id(); \
+ return getConcreteSymbolByIdHelper<ConcreteType>(Id); \
+ }
+
+#define FORWARD_SYMBOL_ID_METHOD_WITH_NAME(PrivateName, PublicName) \
+ FORWARD_CONCRETE_SYMBOL_ID_METHOD_WITH_NAME(PDBSymbol, PrivateName, \
+ PublicName)
+
+#define FORWARD_SYMBOL_ID_METHOD(MethodName) \
+ FORWARD_SYMBOL_ID_METHOD_WITH_NAME(MethodName, MethodName)
+
namespace llvm {
class StringRef;
@@ -29,6 +46,7 @@ class raw_ostream;
namespace pdb {
class IPDBRawSymbol;
+class IPDBSession;
#define DECLARE_PDB_SYMBOL_CONCRETE_TYPE(TagValue) \
static const PDB_SymType Tag = TagValue; \
@@ -57,6 +75,8 @@ public:
/// override the behavior to only dump known fields.
virtual void dump(PDBSymDumper &Dumper) const = 0;
void defaultDump(raw_ostream &OS, int Indent) const;
+ void dumpProperties() const;
+ void dumpChildStats() const;
PDB_SymType getSymTag() const;
uint32_t getSymIndexId() const;
@@ -66,6 +86,14 @@ public:
return Enumerator->getNext();
}
+ template <typename T> T *cast() { return llvm::dyn_cast<T>(this); }
+
+ template <typename T> const T *cast() const {
+ return llvm::dyn_cast<T>(this);
+ }
+
+ std::unique_ptr<PDBSymbol> clone() const;
+
template <typename T>
std::unique_ptr<ConcreteSymbolEnumerator<T>> findAllChildren() const {
auto BaseIter = RawSymbol->findChildren(T::Tag);
@@ -91,6 +119,20 @@ public:
std::unique_ptr<IPDBEnumSymbols> getChildStats(TagStats &Stats) const;
protected:
+ std::unique_ptr<PDBSymbol> getSymbolByIdHelper(uint32_t Id) const;
+
+ template <typename ConcreteType>
+ std::unique_ptr<ConcreteType> getConcreteSymbolByIdHelper(uint32_t Id) const {
+ auto Sym = getSymbolByIdHelper(Id);
+ if (!Sym)
+ return nullptr;
+ ConcreteType *Result = Sym->cast<ConcreteType>();
+ if (!Result)
+ return nullptr;
+ Sym.release();
+ return std::unique_ptr<ConcreteType>(Result);
+ }
+
const IPDBSession &Session;
const std::unique_ptr<IPDBRawSymbol> RawSymbol;
};
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=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolBlock.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolBlock.h Mon Apr 10 01:14:09 2017
@@ -30,7 +30,7 @@ public:
FORWARD_SYMBOL_METHOD(getAddressOffset)
FORWARD_SYMBOL_METHOD(getAddressSection)
FORWARD_SYMBOL_METHOD(getLength)
- FORWARD_SYMBOL_METHOD(getLexicalParentId)
+ FORWARD_SYMBOL_ID_METHOD(getLexicalParent)
FORWARD_SYMBOL_METHOD(getLocationType)
FORWARD_SYMBOL_METHOD(getName)
FORWARD_SYMBOL_METHOD(getRelativeVirtualAddress)
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=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCompiland.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCompiland.h Mon Apr 10 01:14:09 2017
@@ -29,7 +29,7 @@ public:
void dump(PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(isEditAndContinueEnabled)
- FORWARD_SYMBOL_METHOD(getLexicalParentId)
+ FORWARD_SYMBOL_ID_METHOD(getLexicalParent)
FORWARD_SYMBOL_METHOD(getLibraryName)
FORWARD_SYMBOL_METHOD(getName)
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=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h Mon Apr 10 01:14:09 2017
@@ -46,7 +46,7 @@ public:
FORWARD_SYMBOL_METHOD(isLTCG)
FORWARD_SYMBOL_METHOD(isMSILNetmodule)
FORWARD_SYMBOL_METHOD(getLanguage)
- FORWARD_SYMBOL_METHOD(getLexicalParentId)
+ FORWARD_SYMBOL_ID_METHOD(getLexicalParent)
FORWARD_SYMBOL_METHOD(getPlatform)
FORWARD_SYMBOL_METHOD(getSourceFileName)
};
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=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h Mon Apr 10 01:14:09 2017
@@ -26,7 +26,7 @@ public:
void dump(PDBSymDumper &Dumper) const override;
- FORWARD_SYMBOL_METHOD(getLexicalParentId)
+ FORWARD_SYMBOL_ID_METHOD(getLexicalParent)
FORWARD_SYMBOL_METHOD(getName)
std::string getValue() const;
};
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=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolData.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolData.h Mon Apr 10 01:14:09 2017
@@ -26,8 +26,6 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Data)
- std::unique_ptr<PDBSymbol> getType() const;
-
void dump(PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(getAccess)
@@ -35,14 +33,14 @@ public:
FORWARD_SYMBOL_METHOD(getAddressSection)
FORWARD_SYMBOL_METHOD(getAddressTaken)
FORWARD_SYMBOL_METHOD(getBitPosition)
- FORWARD_SYMBOL_METHOD(getClassParentId)
+ FORWARD_SYMBOL_ID_METHOD(getClassParent)
FORWARD_SYMBOL_METHOD(isCompilerGenerated)
FORWARD_SYMBOL_METHOD(isConstType)
FORWARD_SYMBOL_METHOD(getDataKind)
FORWARD_SYMBOL_METHOD(isAggregated)
FORWARD_SYMBOL_METHOD(isSplitted)
FORWARD_SYMBOL_METHOD(getLength)
- FORWARD_SYMBOL_METHOD(getLexicalParentId)
+ FORWARD_SYMBOL_ID_METHOD(getLexicalParent)
FORWARD_SYMBOL_METHOD(getLocationType)
FORWARD_SYMBOL_METHOD(getName)
FORWARD_SYMBOL_METHOD(getOffset)
@@ -50,7 +48,7 @@ public:
FORWARD_SYMBOL_METHOD(getRelativeVirtualAddress)
FORWARD_SYMBOL_METHOD(getSlot)
FORWARD_SYMBOL_METHOD(getToken)
- FORWARD_SYMBOL_METHOD(getTypeId)
+ FORWARD_SYMBOL_ID_METHOD(getType)
FORWARD_SYMBOL_METHOD(isUnalignedType)
FORWARD_SYMBOL_METHOD(getValue)
FORWARD_SYMBOL_METHOD(getVirtualAddress)
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=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolFunc.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolFunc.h Mon Apr 10 01:14:09 2017
@@ -11,6 +11,7 @@
#define LLVM_DEBUGINFO_PDB_PDBSYMBOLFUNC_H
#include "PDBSymbol.h"
+#include "PDBSymbolTypeFunctionSig.h"
#include "PDBTypes.h"
namespace llvm {
@@ -26,8 +27,6 @@ public:
void dump(PDBSymDumper &Dumper) const override;
- std::unique_ptr<PDBSymbolTypeFunctionSig> getSignature() const;
- std::unique_ptr<PDBSymbolTypeUDT> getClassParent() const;
std::unique_ptr<IPDBEnumChildren<PDBSymbolData>> getArguments() const;
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Function)
@@ -35,7 +34,7 @@ public:
FORWARD_SYMBOL_METHOD(getAccess)
FORWARD_SYMBOL_METHOD(getAddressOffset)
FORWARD_SYMBOL_METHOD(getAddressSection)
- FORWARD_SYMBOL_METHOD(getClassParentId)
+ FORWARD_SYMBOL_ID_METHOD(getClassParent)
FORWARD_SYMBOL_METHOD(isCompilerGenerated)
FORWARD_SYMBOL_METHOD(isConstType)
FORWARD_SYMBOL_METHOD(hasCustomCallingConvention)
@@ -54,7 +53,7 @@ public:
FORWARD_SYMBOL_METHOD(isNaked)
FORWARD_SYMBOL_METHOD(isStatic)
FORWARD_SYMBOL_METHOD(getLength)
- FORWARD_SYMBOL_METHOD(getLexicalParentId)
+ FORWARD_SYMBOL_ID_METHOD(getLexicalParent)
FORWARD_SYMBOL_METHOD(getLocalBasePointerRegisterId)
FORWARD_SYMBOL_METHOD(getLocationType)
FORWARD_SYMBOL_METHOD(getName)
@@ -67,7 +66,8 @@ public:
FORWARD_SYMBOL_METHOD(isPureVirtual)
FORWARD_SYMBOL_METHOD(getRelativeVirtualAddress)
FORWARD_SYMBOL_METHOD(getToken)
- FORWARD_SYMBOL_METHOD(getTypeId)
+ FORWARD_CONCRETE_SYMBOL_ID_METHOD_WITH_NAME(PDBSymbolTypeFunctionSig, getType,
+ getSignature)
FORWARD_SYMBOL_METHOD(isUnalignedType)
FORWARD_SYMBOL_METHOD(getUndecoratedName)
FORWARD_SYMBOL_METHOD(isVirtual)
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=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h Mon Apr 10 01:14:09 2017
@@ -34,7 +34,7 @@ public:
FORWARD_SYMBOL_METHOD(hasFarReturn)
FORWARD_SYMBOL_METHOD(hasInterruptReturn)
FORWARD_SYMBOL_METHOD(isStatic)
- FORWARD_SYMBOL_METHOD(getLexicalParentId)
+ FORWARD_SYMBOL_ID_METHOD(getLexicalParent)
FORWARD_SYMBOL_METHOD(getLocationType)
FORWARD_SYMBOL_METHOD(hasNoInlineAttribute)
FORWARD_SYMBOL_METHOD(hasNoReturnAttribute)
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=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h Mon Apr 10 01:14:09 2017
@@ -33,7 +33,7 @@ public:
FORWARD_SYMBOL_METHOD(hasFarReturn)
FORWARD_SYMBOL_METHOD(hasInterruptReturn)
FORWARD_SYMBOL_METHOD(isStatic)
- FORWARD_SYMBOL_METHOD(getLexicalParentId)
+ FORWARD_SYMBOL_ID_METHOD(getLexicalParent)
FORWARD_SYMBOL_METHOD(getLocationType)
FORWARD_SYMBOL_METHOD(hasNoInlineAttribute)
FORWARD_SYMBOL_METHOD(hasNoReturnAttribute)
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=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolLabel.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolLabel.h Mon Apr 10 01:14:09 2017
@@ -32,7 +32,7 @@ public:
FORWARD_SYMBOL_METHOD(hasCustomCallingConvention)
FORWARD_SYMBOL_METHOD(hasFarReturn)
FORWARD_SYMBOL_METHOD(hasInterruptReturn)
- FORWARD_SYMBOL_METHOD(getLexicalParentId)
+ FORWARD_SYMBOL_ID_METHOD(getLexicalParent)
FORWARD_SYMBOL_METHOD(getLocationType)
FORWARD_SYMBOL_METHOD(getName)
FORWARD_SYMBOL_METHOD(hasNoInlineAttribute)
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=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h Mon Apr 10 01:14:09 2017
@@ -32,7 +32,7 @@ public:
FORWARD_SYMBOL_METHOD(isCode)
FORWARD_SYMBOL_METHOD(isFunction)
FORWARD_SYMBOL_METHOD(getLength)
- FORWARD_SYMBOL_METHOD(getLexicalParentId)
+ FORWARD_SYMBOL_ID_METHOD(getLexicalParent)
FORWARD_SYMBOL_METHOD(getLocationType)
FORWARD_SYMBOL_METHOD(isManagedCode)
FORWARD_SYMBOL_METHOD(isMSILCode)
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=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolThunk.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolThunk.h Mon Apr 10 01:14:09 2017
@@ -30,12 +30,12 @@ public:
FORWARD_SYMBOL_METHOD(getAccess)
FORWARD_SYMBOL_METHOD(getAddressOffset)
FORWARD_SYMBOL_METHOD(getAddressSection)
- FORWARD_SYMBOL_METHOD(getClassParentId)
+ FORWARD_SYMBOL_ID_METHOD(getClassParent)
FORWARD_SYMBOL_METHOD(isConstType)
FORWARD_SYMBOL_METHOD(isIntroVirtualFunction)
FORWARD_SYMBOL_METHOD(isStatic)
FORWARD_SYMBOL_METHOD(getLength)
- FORWARD_SYMBOL_METHOD(getLexicalParentId)
+ FORWARD_SYMBOL_ID_METHOD(getLexicalParent)
FORWARD_SYMBOL_METHOD(getName)
FORWARD_SYMBOL_METHOD(isPureVirtual)
FORWARD_SYMBOL_METHOD(getRelativeVirtualAddress)
@@ -44,7 +44,7 @@ public:
FORWARD_SYMBOL_METHOD(getTargetVirtualAddress)
FORWARD_SYMBOL_METHOD(getTargetSection)
FORWARD_SYMBOL_METHOD(getThunkOrdinal)
- FORWARD_SYMBOL_METHOD(getTypeId)
+ FORWARD_SYMBOL_ID_METHOD(getType)
FORWARD_SYMBOL_METHOD(isUnalignedType)
FORWARD_SYMBOL_METHOD(isVirtual)
FORWARD_SYMBOL_METHOD(getVirtualAddress)
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=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeArray.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeArray.h Mon Apr 10 01:14:09 2017
@@ -25,17 +25,15 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::ArrayType)
- std::unique_ptr<PDBSymbol> getElementType() const;
-
void dump(PDBSymDumper &Dumper) const override;
- FORWARD_SYMBOL_METHOD(getArrayIndexTypeId)
+ FORWARD_SYMBOL_ID_METHOD(getArrayIndexType)
FORWARD_SYMBOL_METHOD(isConstType)
FORWARD_SYMBOL_METHOD(getCount)
FORWARD_SYMBOL_METHOD(getLength)
- FORWARD_SYMBOL_METHOD(getLexicalParentId)
+ FORWARD_SYMBOL_ID_METHOD(getLexicalParent)
FORWARD_SYMBOL_METHOD(getRank)
- FORWARD_SYMBOL_METHOD(getTypeId)
+ FORWARD_SYMBOL_ID_METHOD_WITH_NAME(getType, getElementType)
FORWARD_SYMBOL_METHOD(isUnalignedType)
FORWARD_SYMBOL_METHOD(isVolatileType)
};
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=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h Mon Apr 10 01:14:09 2017
@@ -28,7 +28,7 @@ public:
void dump(PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(getAccess)
- FORWARD_SYMBOL_METHOD(getClassParentId)
+ FORWARD_SYMBOL_ID_METHOD(getClassParent)
FORWARD_SYMBOL_METHOD(hasConstructor)
FORWARD_SYMBOL_METHOD(isConstType)
FORWARD_SYMBOL_METHOD(hasAssignmentOperator)
@@ -36,14 +36,14 @@ public:
FORWARD_SYMBOL_METHOD(hasNestedTypes)
FORWARD_SYMBOL_METHOD(isIndirectVirtualBaseClass)
FORWARD_SYMBOL_METHOD(getLength)
- FORWARD_SYMBOL_METHOD(getLexicalParentId)
+ FORWARD_SYMBOL_ID_METHOD(getLexicalParent)
FORWARD_SYMBOL_METHOD(getName)
FORWARD_SYMBOL_METHOD(isNested)
FORWARD_SYMBOL_METHOD(getOffset)
FORWARD_SYMBOL_METHOD(hasOverloadedOperator)
FORWARD_SYMBOL_METHOD(isPacked)
FORWARD_SYMBOL_METHOD(isScoped)
- FORWARD_SYMBOL_METHOD(getTypeId)
+ FORWARD_SYMBOL_ID_METHOD(getType)
FORWARD_SYMBOL_METHOD(getUdtKind)
FORWARD_SYMBOL_METHOD(isUnalignedType)
@@ -51,7 +51,7 @@ public:
FORWARD_SYMBOL_METHOD(getVirtualBaseDispIndex)
FORWARD_SYMBOL_METHOD(getVirtualBasePointerOffset)
// FORWARD_SYMBOL_METHOD(getVirtualBaseTableType)
- FORWARD_SYMBOL_METHOD(getVirtualTableShapeId)
+ FORWARD_SYMBOL_ID_METHOD(getVirtualTableShape)
FORWARD_SYMBOL_METHOD(isVolatileType)
};
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=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h Mon Apr 10 01:14:09 2017
@@ -30,7 +30,7 @@ public:
FORWARD_SYMBOL_METHOD(getBuiltinType)
FORWARD_SYMBOL_METHOD(isConstType)
FORWARD_SYMBOL_METHOD(getLength)
- FORWARD_SYMBOL_METHOD(getLexicalParentId)
+ FORWARD_SYMBOL_ID_METHOD(getLexicalParent)
FORWARD_SYMBOL_METHOD(isUnalignedType)
FORWARD_SYMBOL_METHOD(isVolatileType)
};
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=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h Mon Apr 10 01:14:09 2017
@@ -11,6 +11,7 @@
#define LLVM_DEBUGINFO_PDB_PDBSYMBOLTYPEENUM_H
#include "PDBSymbol.h"
+#include "PDBSymbolTypeBuiltin.h"
#include "PDBTypes.h"
namespace llvm {
@@ -27,25 +28,22 @@ public:
void dump(PDBSymDumper &Dumper) const override;
- std::unique_ptr<PDBSymbolTypeUDT> getClassParent() const;
- std::unique_ptr<PDBSymbolTypeBuiltin> getUnderlyingType() const;
-
FORWARD_SYMBOL_METHOD(getBuiltinType)
- FORWARD_SYMBOL_METHOD(getClassParentId)
- FORWARD_SYMBOL_METHOD(getUnmodifiedTypeId)
+ FORWARD_SYMBOL_ID_METHOD(getClassParent)
FORWARD_SYMBOL_METHOD(hasConstructor)
FORWARD_SYMBOL_METHOD(isConstType)
FORWARD_SYMBOL_METHOD(hasAssignmentOperator)
FORWARD_SYMBOL_METHOD(hasCastOperator)
FORWARD_SYMBOL_METHOD(hasNestedTypes)
FORWARD_SYMBOL_METHOD(getLength)
- FORWARD_SYMBOL_METHOD(getLexicalParentId)
+ FORWARD_SYMBOL_ID_METHOD(getLexicalParent)
FORWARD_SYMBOL_METHOD(getName)
FORWARD_SYMBOL_METHOD(isNested)
FORWARD_SYMBOL_METHOD(hasOverloadedOperator)
FORWARD_SYMBOL_METHOD(isPacked)
FORWARD_SYMBOL_METHOD(isScoped)
- FORWARD_SYMBOL_METHOD(getTypeId)
+ FORWARD_CONCRETE_SYMBOL_ID_METHOD_WITH_NAME(PDBSymbolTypeBuiltin, getType,
+ getUnderlyingType)
FORWARD_SYMBOL_METHOD(isUnalignedType)
FORWARD_SYMBOL_METHOD(isVolatileType)
};
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=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h Mon Apr 10 01:14:09 2017
@@ -27,9 +27,9 @@ public:
void dump(PDBSymDumper &Dumper) const override;
- FORWARD_SYMBOL_METHOD(getClassParentId)
+ FORWARD_SYMBOL_ID_METHOD(getClassParent)
FORWARD_SYMBOL_METHOD(getName)
- FORWARD_SYMBOL_METHOD(getTypeId)
+ FORWARD_SYMBOL_ID_METHOD(getType)
};
} // 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=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h Mon Apr 10 01:14:09 2017
@@ -27,9 +27,9 @@ public:
void dump(PDBSymDumper &Dumper) const override;
- FORWARD_SYMBOL_METHOD(getClassParentId)
- FORWARD_SYMBOL_METHOD(getLexicalParentId)
- FORWARD_SYMBOL_METHOD(getTypeId)
+ FORWARD_SYMBOL_ID_METHOD(getClassParent)
+ FORWARD_SYMBOL_ID_METHOD(getLexicalParent)
+ FORWARD_SYMBOL_ID_METHOD(getType)
};
} // 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=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h Mon Apr 10 01:14:09 2017
@@ -25,22 +25,20 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::FunctionSig)
- std::unique_ptr<PDBSymbol> getReturnType() const;
std::unique_ptr<IPDBEnumSymbols> getArguments() const;
- std::unique_ptr<PDBSymbol> getClassParent() const;
void dump(PDBSymDumper &Dumper) const override;
void dumpArgList(raw_ostream &OS) const;
FORWARD_SYMBOL_METHOD(getCallingConvention)
- FORWARD_SYMBOL_METHOD(getClassParentId)
- FORWARD_SYMBOL_METHOD(getUnmodifiedTypeId)
+ FORWARD_SYMBOL_ID_METHOD(getClassParent)
+ FORWARD_SYMBOL_ID_METHOD(getUnmodifiedType)
FORWARD_SYMBOL_METHOD(isConstType)
FORWARD_SYMBOL_METHOD(getCount)
- FORWARD_SYMBOL_METHOD(getLexicalParentId)
+ FORWARD_SYMBOL_ID_METHOD(getLexicalParent)
// FORWARD_SYMBOL_METHOD(getObjectPointerType)
FORWARD_SYMBOL_METHOD(getThisAdjust)
- FORWARD_SYMBOL_METHOD(getTypeId)
+ FORWARD_SYMBOL_ID_METHOD_WITH_NAME(getType, getReturnType)
FORWARD_SYMBOL_METHOD(isUnalignedType)
FORWARD_SYMBOL_METHOD(isVolatileType)
};
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=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypePointer.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypePointer.h Mon Apr 10 01:14:09 2017
@@ -25,15 +25,13 @@ public:
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::PointerType)
- std::unique_ptr<PDBSymbol> getPointeeType() const;
-
void dump(PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(isConstType)
FORWARD_SYMBOL_METHOD(getLength)
- FORWARD_SYMBOL_METHOD(getLexicalParentId)
+ FORWARD_SYMBOL_ID_METHOD(getLexicalParent)
FORWARD_SYMBOL_METHOD(isReference)
- FORWARD_SYMBOL_METHOD(getTypeId)
+ FORWARD_SYMBOL_ID_METHOD_WITH_NAME(getType, getPointeeType)
FORWARD_SYMBOL_METHOD(isUnalignedType)
FORWARD_SYMBOL_METHOD(isVolatileType)
};
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=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h Mon Apr 10 01:14:09 2017
@@ -28,24 +28,24 @@ public:
void dump(PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(getBuiltinType)
- FORWARD_SYMBOL_METHOD(getClassParentId)
+ FORWARD_SYMBOL_ID_METHOD(getClassParent)
FORWARD_SYMBOL_METHOD(hasConstructor)
FORWARD_SYMBOL_METHOD(isConstType)
FORWARD_SYMBOL_METHOD(hasAssignmentOperator)
FORWARD_SYMBOL_METHOD(hasCastOperator)
FORWARD_SYMBOL_METHOD(hasNestedTypes)
FORWARD_SYMBOL_METHOD(getLength)
- FORWARD_SYMBOL_METHOD(getLexicalParentId)
+ FORWARD_SYMBOL_ID_METHOD(getLexicalParent)
FORWARD_SYMBOL_METHOD(getName)
FORWARD_SYMBOL_METHOD(isNested)
FORWARD_SYMBOL_METHOD(hasOverloadedOperator)
FORWARD_SYMBOL_METHOD(isPacked)
FORWARD_SYMBOL_METHOD(isReference)
FORWARD_SYMBOL_METHOD(isScoped)
- FORWARD_SYMBOL_METHOD(getTypeId)
+ FORWARD_SYMBOL_ID_METHOD(getType)
FORWARD_SYMBOL_METHOD(getUdtKind)
FORWARD_SYMBOL_METHOD(isUnalignedType)
- FORWARD_SYMBOL_METHOD(getVirtualTableShapeId)
+ FORWARD_SYMBOL_ID_METHOD(getVirtualTableShape)
FORWARD_SYMBOL_METHOD(isVolatileType)
};
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=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h Mon Apr 10 01:14:09 2017
@@ -27,15 +27,15 @@ public:
void dump(PDBSymDumper &Dumper) const override;
- FORWARD_SYMBOL_METHOD(getClassParentId)
- FORWARD_SYMBOL_METHOD(getUnmodifiedTypeId)
+ FORWARD_SYMBOL_ID_METHOD(getClassParent)
+ FORWARD_SYMBOL_ID_METHOD(getUnmodifiedType)
FORWARD_SYMBOL_METHOD(hasConstructor)
FORWARD_SYMBOL_METHOD(isConstType)
FORWARD_SYMBOL_METHOD(hasAssignmentOperator)
FORWARD_SYMBOL_METHOD(hasCastOperator)
FORWARD_SYMBOL_METHOD(hasNestedTypes)
FORWARD_SYMBOL_METHOD(getLength)
- FORWARD_SYMBOL_METHOD(getLexicalParentId)
+ FORWARD_SYMBOL_ID_METHOD(getLexicalParent)
FORWARD_SYMBOL_METHOD(getName)
FORWARD_SYMBOL_METHOD(isNested)
FORWARD_SYMBOL_METHOD(hasOverloadedOperator)
@@ -43,7 +43,7 @@ public:
FORWARD_SYMBOL_METHOD(isScoped)
FORWARD_SYMBOL_METHOD(getUdtKind)
FORWARD_SYMBOL_METHOD(isUnalignedType)
- FORWARD_SYMBOL_METHOD(getVirtualTableShapeId)
+ FORWARD_SYMBOL_ID_METHOD(getVirtualTableShape)
FORWARD_SYMBOL_METHOD(isVolatileType)
};
}
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=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h Mon Apr 10 01:14:09 2017
@@ -27,10 +27,10 @@ public:
void dump(PDBSymDumper &Dumper) const override;
- FORWARD_SYMBOL_METHOD(getClassParentId)
+ FORWARD_SYMBOL_ID_METHOD(getClassParent)
FORWARD_SYMBOL_METHOD(isConstType)
- FORWARD_SYMBOL_METHOD(getLexicalParentId)
- FORWARD_SYMBOL_METHOD(getTypeId)
+ FORWARD_SYMBOL_ID_METHOD(getLexicalParent)
+ FORWARD_SYMBOL_ID_METHOD(getType)
FORWARD_SYMBOL_METHOD(isUnalignedType)
FORWARD_SYMBOL_METHOD(isVolatileType)
};
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=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h Mon Apr 10 01:14:09 2017
@@ -29,7 +29,7 @@ public:
FORWARD_SYMBOL_METHOD(isConstType)
FORWARD_SYMBOL_METHOD(getCount)
- FORWARD_SYMBOL_METHOD(getLexicalParentId)
+ FORWARD_SYMBOL_ID_METHOD(getLexicalParent)
FORWARD_SYMBOL_METHOD(isUnalignedType)
FORWARD_SYMBOL_METHOD(isVolatileType)
};
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=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h Mon Apr 10 01:14:09 2017
@@ -27,7 +27,7 @@ public:
void dump(PDBSymDumper &Dumper) const override;
- FORWARD_SYMBOL_METHOD(getLexicalParentId)
+ FORWARD_SYMBOL_ID_METHOD(getLexicalParent)
FORWARD_SYMBOL_METHOD(getName)
};
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbol.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbol.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbol.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbol.cpp Mon Apr 10 01:14:09 2017
@@ -10,6 +10,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbol.h"
#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
#include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
+#include "llvm/DebugInfo/PDB/IPDBSession.h"
#include "llvm/DebugInfo/PDB/PDBExtras.h"
#include "llvm/DebugInfo/PDB/PDBSymbolAnnotation.h"
#include "llvm/DebugInfo/PDB/PDBSymbolBlock.h"
@@ -100,7 +101,7 @@ PDBSymbol::create(const IPDBSession &PDB
}
#define TRY_DUMP_TYPE(Type) \
- if (const Type *DerivedThis = dyn_cast<Type>(this)) \
+ if (const Type *DerivedThis = this->cast<Type>()) \
Dumper.dump(OS, Indent, *DerivedThis);
#define ELSE_TRY_DUMP_TYPE(Type, Dumper) else TRY_DUMP_TYPE(Type, Dumper)
@@ -109,6 +110,26 @@ void PDBSymbol::defaultDump(raw_ostream
RawSymbol->dump(OS, Indent);
}
+void PDBSymbol::dumpProperties() const {
+ outs() << "\n";
+ defaultDump(outs(), 0);
+ outs().flush();
+}
+
+void PDBSymbol::dumpChildStats() const {
+ TagStats Stats;
+ getChildStats(Stats);
+ outs() << "\n";
+ for (auto &Stat : Stats) {
+ outs() << Stat.first << ": " << Stat.second << "\n";
+ }
+ outs().flush();
+}
+
+std::unique_ptr<PDBSymbol> PDBSymbol::clone() const {
+ return Session.getSymbolById(getSymIndexId());
+}
+
PDB_SymType PDBSymbol::getSymTag() const { return RawSymbol->getSymTag(); }
uint32_t PDBSymbol::getSymIndexId() const { return RawSymbol->getSymIndexId(); }
@@ -148,3 +169,7 @@ PDBSymbol::getChildStats(TagStats &Stats
Result->reset();
return Result;
}
+
+std::unique_ptr<PDBSymbol> PDBSymbol::getSymbolByIdHelper(uint32_t Id) const {
+ return Session.getSymbolById(Id);
+}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolAnnotation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolAnnotation.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolAnnotation.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolAnnotation.cpp Mon Apr 10 01:14:09 2017
@@ -18,7 +18,9 @@ using namespace llvm::pdb;
PDBSymbolAnnotation::PDBSymbolAnnotation(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)
- : PDBSymbol(PDBSession, std::move(Symbol)) {}
+ : PDBSymbol(PDBSession, std::move(Symbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::Annotation);
+}
void PDBSymbolAnnotation::dump(PDBSymDumper &Dumper) const {
Dumper.dump(*this);
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolBlock.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolBlock.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolBlock.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolBlock.cpp Mon Apr 10 01:14:09 2017
@@ -19,6 +19,8 @@ using namespace llvm::pdb;
PDBSymbolBlock::PDBSymbolBlock(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)
- : PDBSymbol(PDBSession, std::move(Symbol)) {}
+ : PDBSymbol(PDBSession, std::move(Symbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::Block);
+}
void PDBSymbolBlock::dump(PDBSymDumper &Dumper) const { Dumper.dump(*this); }
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp Mon Apr 10 01:14:09 2017
@@ -19,7 +19,9 @@ using namespace llvm::pdb;
PDBSymbolCompiland::PDBSymbolCompiland(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)
- : PDBSymbol(PDBSession, std::move(Symbol)) {}
+ : PDBSymbol(PDBSession, std::move(Symbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::Compiland);
+}
void PDBSymbolCompiland::dump(PDBSymDumper &Dumper) const {
Dumper.dump(*this);
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompilandDetails.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompilandDetails.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompilandDetails.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompilandDetails.cpp Mon Apr 10 01:14:09 2017
@@ -19,7 +19,9 @@ using namespace llvm::pdb;
PDBSymbolCompilandDetails::PDBSymbolCompilandDetails(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)
- : PDBSymbol(PDBSession, std::move(Symbol)) {}
+ : PDBSymbol(PDBSession, std::move(Symbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::CompilandDetails);
+}
void PDBSymbolCompilandDetails::dump(PDBSymDumper &Dumper) const {
Dumper.dump(*this);
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompilandEnv.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompilandEnv.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompilandEnv.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompilandEnv.cpp Mon Apr 10 01:14:09 2017
@@ -20,7 +20,9 @@ using namespace llvm::pdb;
PDBSymbolCompilandEnv::PDBSymbolCompilandEnv(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)
- : PDBSymbol(PDBSession, std::move(Symbol)) {}
+ : PDBSymbol(PDBSession, std::move(Symbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::CompilandEnv);
+}
std::string PDBSymbolCompilandEnv::getValue() const {
Variant Value = RawSymbol->getValue();
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCustom.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCustom.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCustom.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCustom.cpp Mon Apr 10 01:14:09 2017
@@ -20,7 +20,9 @@ using namespace llvm::pdb;
PDBSymbolCustom::PDBSymbolCustom(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> CustomSymbol)
- : PDBSymbol(PDBSession, std::move(CustomSymbol)) {}
+ : PDBSymbol(PDBSession, std::move(CustomSymbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::Custom);
+}
void PDBSymbolCustom::getDataBytes(llvm::SmallVector<uint8_t, 32> &bytes) {
RawSymbol->getDataBytes(bytes);
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolData.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolData.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolData.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolData.cpp Mon Apr 10 01:14:09 2017
@@ -19,10 +19,8 @@ using namespace llvm::pdb;
PDBSymbolData::PDBSymbolData(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> DataSymbol)
- : PDBSymbol(PDBSession, std::move(DataSymbol)) {}
-
-std::unique_ptr<PDBSymbol> PDBSymbolData::getType() const {
- return Session.getSymbolById(getTypeId());
+ : PDBSymbol(PDBSession, std::move(DataSymbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::Data);
}
void PDBSymbolData::dump(PDBSymDumper &Dumper) const { Dumper.dump(*this); }
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolExe.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolExe.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolExe.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolExe.cpp Mon Apr 10 01:14:09 2017
@@ -18,6 +18,8 @@ using namespace llvm::pdb;
PDBSymbolExe::PDBSymbolExe(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)
- : PDBSymbol(PDBSession, std::move(Symbol)) {}
+ : PDBSymbol(PDBSession, std::move(Symbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::Exe);
+}
void PDBSymbolExe::dump(PDBSymDumper &Dumper) const { Dumper.dump(*this); }
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFunc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFunc.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFunc.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFunc.cpp Mon Apr 10 01:14:09 2017
@@ -85,10 +85,8 @@ private:
PDBSymbolFunc::PDBSymbolFunc(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)
- : PDBSymbol(PDBSession, std::move(Symbol)) {}
-
-std::unique_ptr<PDBSymbolTypeFunctionSig> PDBSymbolFunc::getSignature() const {
- return Session.getConcreteSymbolById<PDBSymbolTypeFunctionSig>(getTypeId());
+ : PDBSymbol(PDBSession, std::move(Symbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::Function);
}
std::unique_ptr<IPDBEnumChildren<PDBSymbolData>>
@@ -96,8 +94,4 @@ PDBSymbolFunc::getArguments() const {
return llvm::make_unique<FunctionArgEnumerator>(Session, *this);
}
-std::unique_ptr<PDBSymbolTypeUDT> PDBSymbolFunc::getClassParent() const {
- return Session.getConcreteSymbolById<PDBSymbolTypeUDT>(getClassParentId());
-}
-
void PDBSymbolFunc::dump(PDBSymDumper &Dumper) const { Dumper.dump(*this); }
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFuncDebugEnd.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFuncDebugEnd.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFuncDebugEnd.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFuncDebugEnd.cpp Mon Apr 10 01:14:09 2017
@@ -19,7 +19,9 @@ using namespace llvm::pdb;
PDBSymbolFuncDebugEnd::PDBSymbolFuncDebugEnd(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)
- : PDBSymbol(PDBSession, std::move(Symbol)) {}
+ : PDBSymbol(PDBSession, std::move(Symbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::FuncDebugEnd);
+}
void PDBSymbolFuncDebugEnd::dump(PDBSymDumper &Dumper) const {
Dumper.dump(*this);
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFuncDebugStart.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFuncDebugStart.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFuncDebugStart.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolFuncDebugStart.cpp Mon Apr 10 01:14:09 2017
@@ -19,7 +19,9 @@ using namespace llvm::pdb;
PDBSymbolFuncDebugStart::PDBSymbolFuncDebugStart(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)
- : PDBSymbol(PDBSession, std::move(Symbol)) {}
+ : PDBSymbol(PDBSession, std::move(Symbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::FuncDebugStart);
+}
void PDBSymbolFuncDebugStart::dump(PDBSymDumper &Dumper) const {
Dumper.dump(*this);
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolLabel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolLabel.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolLabel.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolLabel.cpp Mon Apr 10 01:14:09 2017
@@ -18,6 +18,8 @@ using namespace llvm::pdb;
PDBSymbolLabel::PDBSymbolLabel(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)
- : PDBSymbol(PDBSession, std::move(Symbol)) {}
+ : PDBSymbol(PDBSession, std::move(Symbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::Label);
+}
void PDBSymbolLabel::dump(PDBSymDumper &Dumper) const { Dumper.dump(*this); }
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolPublicSymbol.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolPublicSymbol.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolPublicSymbol.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolPublicSymbol.cpp Mon Apr 10 01:14:09 2017
@@ -19,7 +19,9 @@ using namespace llvm::pdb;
PDBSymbolPublicSymbol::PDBSymbolPublicSymbol(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)
- : PDBSymbol(PDBSession, std::move(Symbol)) {}
+ : PDBSymbol(PDBSession, std::move(Symbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::PublicSymbol);
+}
void PDBSymbolPublicSymbol::dump(PDBSymDumper &Dumper) const {
Dumper.dump(*this);
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolThunk.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolThunk.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolThunk.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolThunk.cpp Mon Apr 10 01:14:09 2017
@@ -18,6 +18,8 @@ using namespace llvm::pdb;
PDBSymbolThunk::PDBSymbolThunk(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)
- : PDBSymbol(PDBSession, std::move(Symbol)) {}
+ : PDBSymbol(PDBSession, std::move(Symbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::Thunk);
+}
void PDBSymbolThunk::dump(PDBSymDumper &Dumper) const { Dumper.dump(*this); }
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeArray.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeArray.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeArray.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeArray.cpp Mon Apr 10 01:14:09 2017
@@ -19,10 +19,8 @@ using namespace llvm::pdb;
PDBSymbolTypeArray::PDBSymbolTypeArray(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)
- : PDBSymbol(PDBSession, std::move(Symbol)) {}
-
-std::unique_ptr<PDBSymbol> PDBSymbolTypeArray::getElementType() const {
- return Session.getSymbolById(getTypeId());
+ : PDBSymbol(PDBSession, std::move(Symbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::ArrayType);
}
void PDBSymbolTypeArray::dump(PDBSymDumper &Dumper) const {
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeBaseClass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeBaseClass.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeBaseClass.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeBaseClass.cpp Mon Apr 10 01:14:09 2017
@@ -19,7 +19,9 @@ using namespace llvm::pdb;
PDBSymbolTypeBaseClass::PDBSymbolTypeBaseClass(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)
- : PDBSymbol(PDBSession, std::move(Symbol)) {}
+ : PDBSymbol(PDBSession, std::move(Symbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::BaseClass);
+}
void PDBSymbolTypeBaseClass::dump(PDBSymDumper &Dumper) const {
Dumper.dump(*this);
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeBuiltin.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeBuiltin.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeBuiltin.cpp Mon Apr 10 01:14:09 2017
@@ -18,7 +18,9 @@ using namespace llvm::pdb;
PDBSymbolTypeBuiltin::PDBSymbolTypeBuiltin(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)
- : PDBSymbol(PDBSession, std::move(Symbol)) {}
+ : PDBSymbol(PDBSession, std::move(Symbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::BuiltinType);
+}
void PDBSymbolTypeBuiltin::dump(PDBSymDumper &Dumper) const {
Dumper.dump(*this);
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeCustom.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeCustom.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeCustom.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeCustom.cpp Mon Apr 10 01:14:09 2017
@@ -19,7 +19,9 @@ using namespace llvm::pdb;
PDBSymbolTypeCustom::PDBSymbolTypeCustom(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)
- : PDBSymbol(PDBSession, std::move(Symbol)) {}
+ : PDBSymbol(PDBSession, std::move(Symbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::CustomType);
+}
void PDBSymbolTypeCustom::dump(PDBSymDumper &Dumper) const {
Dumper.dump(*this);
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeDimension.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeDimension.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeDimension.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeDimension.cpp Mon Apr 10 01:14:09 2017
@@ -20,7 +20,9 @@ using namespace llvm::pdb;
PDBSymbolTypeDimension::PDBSymbolTypeDimension(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)
- : PDBSymbol(PDBSession, std::move(Symbol)) {}
+ : PDBSymbol(PDBSession, std::move(Symbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::Dimension);
+}
void PDBSymbolTypeDimension::dump(PDBSymDumper &Dumper) const {
Dumper.dump(*this);
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeEnum.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeEnum.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeEnum.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeEnum.cpp Mon Apr 10 01:14:09 2017
@@ -21,15 +21,8 @@ using namespace llvm::pdb;
PDBSymbolTypeEnum::PDBSymbolTypeEnum(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)
- : PDBSymbol(PDBSession, std::move(Symbol)) {}
-
-std::unique_ptr<PDBSymbolTypeUDT> PDBSymbolTypeEnum::getClassParent() const {
- return Session.getConcreteSymbolById<PDBSymbolTypeUDT>(getClassParentId());
-}
-
-std::unique_ptr<PDBSymbolTypeBuiltin>
-PDBSymbolTypeEnum::getUnderlyingType() const {
- return Session.getConcreteSymbolById<PDBSymbolTypeBuiltin>(getTypeId());
+ : PDBSymbol(PDBSession, std::move(Symbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::Enum);
}
void PDBSymbolTypeEnum::dump(PDBSymDumper &Dumper) const { Dumper.dump(*this); }
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeFriend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeFriend.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeFriend.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeFriend.cpp Mon Apr 10 01:14:09 2017
@@ -19,7 +19,9 @@ using namespace llvm::pdb;
PDBSymbolTypeFriend::PDBSymbolTypeFriend(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)
- : PDBSymbol(PDBSession, std::move(Symbol)) {}
+ : PDBSymbol(PDBSession, std::move(Symbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::Friend);
+}
void PDBSymbolTypeFriend::dump(PDBSymDumper &Dumper) const {
Dumper.dump(*this);
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeFunctionArg.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeFunctionArg.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeFunctionArg.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeFunctionArg.cpp Mon Apr 10 01:14:09 2017
@@ -18,7 +18,9 @@ using namespace llvm::pdb;
PDBSymbolTypeFunctionArg::PDBSymbolTypeFunctionArg(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)
- : PDBSymbol(PDBSession, std::move(Symbol)) {}
+ : PDBSymbol(PDBSession, std::move(Symbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::FunctionArg);
+}
void PDBSymbolTypeFunctionArg::dump(PDBSymDumper &Dumper) const {
Dumper.dump(*this);
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeFunctionSig.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeFunctionSig.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeFunctionSig.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeFunctionSig.cpp Mon Apr 10 01:14:09 2017
@@ -68,10 +68,8 @@ private:
PDBSymbolTypeFunctionSig::PDBSymbolTypeFunctionSig(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)
- : PDBSymbol(PDBSession, std::move(Symbol)) {}
-
-std::unique_ptr<PDBSymbol> PDBSymbolTypeFunctionSig::getReturnType() const {
- return Session.getSymbolById(getTypeId());
+ : PDBSymbol(PDBSession, std::move(Symbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::FunctionSig);
}
std::unique_ptr<IPDBEnumSymbols>
@@ -79,13 +77,6 @@ PDBSymbolTypeFunctionSig::getArguments()
return llvm::make_unique<FunctionArgEnumerator>(Session, *this);
}
-std::unique_ptr<PDBSymbol> PDBSymbolTypeFunctionSig::getClassParent() const {
- uint32_t ClassId = getClassParentId();
- if (ClassId == 0)
- return nullptr;
- return Session.getSymbolById(ClassId);
-}
-
void PDBSymbolTypeFunctionSig::dump(PDBSymDumper &Dumper) const {
Dumper.dump(*this);
}
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeManaged.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeManaged.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeManaged.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeManaged.cpp Mon Apr 10 01:14:09 2017
@@ -19,7 +19,9 @@ using namespace llvm::pdb;
PDBSymbolTypeManaged::PDBSymbolTypeManaged(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)
- : PDBSymbol(PDBSession, std::move(Symbol)) {}
+ : PDBSymbol(PDBSession, std::move(Symbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::ManagedType);
+}
void PDBSymbolTypeManaged::dump(PDBSymDumper &Dumper) const {
Dumper.dump(*this);
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypePointer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypePointer.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypePointer.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypePointer.cpp Mon Apr 10 01:14:09 2017
@@ -19,10 +19,8 @@ using namespace llvm::pdb;
PDBSymbolTypePointer::PDBSymbolTypePointer(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)
- : PDBSymbol(PDBSession, std::move(Symbol)) {}
-
-std::unique_ptr<PDBSymbol> PDBSymbolTypePointer::getPointeeType() const {
- return Session.getSymbolById(getTypeId());
+ : PDBSymbol(PDBSession, std::move(Symbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::PointerType);
}
void PDBSymbolTypePointer::dump(PDBSymDumper &Dumper) const {
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeTypedef.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeTypedef.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeTypedef.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeTypedef.cpp Mon Apr 10 01:14:09 2017
@@ -18,7 +18,9 @@ using namespace llvm::pdb;
PDBSymbolTypeTypedef::PDBSymbolTypeTypedef(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)
- : PDBSymbol(PDBSession, std::move(Symbol)) {}
+ : PDBSymbol(PDBSession, std::move(Symbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::Typedef);
+}
void PDBSymbolTypeTypedef::dump(PDBSymDumper &Dumper) const {
Dumper.dump(*this);
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeUDT.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeUDT.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeUDT.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeUDT.cpp Mon Apr 10 01:14:09 2017
@@ -18,6 +18,8 @@ using namespace llvm::pdb;
PDBSymbolTypeUDT::PDBSymbolTypeUDT(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)
- : PDBSymbol(PDBSession, std::move(Symbol)) {}
+ : PDBSymbol(PDBSession, std::move(Symbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::UDT);
+}
void PDBSymbolTypeUDT::dump(PDBSymDumper &Dumper) const { Dumper.dump(*this); }
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeVTable.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeVTable.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeVTable.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeVTable.cpp Mon Apr 10 01:14:09 2017
@@ -18,7 +18,9 @@ using namespace llvm::pdb;
PDBSymbolTypeVTable::PDBSymbolTypeVTable(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)
- : PDBSymbol(PDBSession, std::move(Symbol)) {}
+ : PDBSymbol(PDBSession, std::move(Symbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::VTable);
+}
void PDBSymbolTypeVTable::dump(PDBSymDumper &Dumper) const {
Dumper.dump(*this);
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeVTableShape.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeVTableShape.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeVTableShape.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolTypeVTableShape.cpp Mon Apr 10 01:14:09 2017
@@ -19,7 +19,9 @@ using namespace llvm::pdb;
PDBSymbolTypeVTableShape::PDBSymbolTypeVTableShape(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)
- : PDBSymbol(PDBSession, std::move(Symbol)) {}
+ : PDBSymbol(PDBSession, std::move(Symbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::VTableShape);
+}
void PDBSymbolTypeVTableShape::dump(PDBSymDumper &Dumper) const {
Dumper.dump(*this);
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolUsingNamespace.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolUsingNamespace.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolUsingNamespace.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolUsingNamespace.cpp Mon Apr 10 01:14:09 2017
@@ -19,7 +19,9 @@ using namespace llvm::pdb;
PDBSymbolUsingNamespace::PDBSymbolUsingNamespace(
const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)
- : PDBSymbol(PDBSession, std::move(Symbol)) {}
+ : PDBSymbol(PDBSession, std::move(Symbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::UsingNamespace);
+}
void PDBSymbolUsingNamespace::dump(PDBSymDumper &Dumper) const {
Dumper.dump(*this);
Modified: llvm/trunk/tools/llvm-pdbdump/PrettyClassDefinitionDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/PrettyClassDefinitionDumper.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-pdbdump/PrettyClassDefinitionDumper.cpp (original)
+++ llvm/trunk/tools/llvm-pdbdump/PrettyClassDefinitionDumper.cpp Mon Apr 10 01:14:09 2017
@@ -70,26 +70,24 @@ void ClassDefinitionDumper::start(const
if (opts::pretty::ClassFormat ==
opts::pretty::ClassDefinitionFormat::LayoutOnly) {
- if (auto Data = dyn_cast<PDBSymbolData>(Child.get())) {
+ if (auto Data = Child->cast<PDBSymbolData>()) {
switch (Data->getLocationType()) {
case PDB_LocType::ThisRel:
case PDB_LocType::BitField:
break;
default:
// All other types of data field do not occupy any storage (e.g. are
- // const),
- // so in layout mode we skip them.
+ // const), so in layout mode we skip them.
continue;
}
} else {
// Only data symbols affect record layout, so skip any non-data symbols
- // if
- // we're in record layout mode.
+ // if we're in record layout mode.
continue;
}
}
- if (auto Func = dyn_cast<PDBSymbolFunc>(Child.get())) {
+ if (auto Func = Child->cast<PDBSymbolFunc>()) {
if (Func->isCompilerGenerated() && opts::pretty::ExcludeCompilerGenerated)
continue;
Modified: llvm/trunk/tools/llvm-pdbdump/PrettyFunctionDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/PrettyFunctionDumper.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-pdbdump/PrettyFunctionDumper.cpp (original)
+++ llvm/trunk/tools/llvm-pdbdump/PrettyFunctionDumper.cpp Mon Apr 10 01:14:09 2017
@@ -195,10 +195,7 @@ void FunctionDumper::start(const PDBSymb
}
void FunctionDumper::dump(const PDBSymbolTypeArray &Symbol) {
- uint32_t ElementTypeId = Symbol.getTypeId();
- auto ElementType = Symbol.getSession().getSymbolById(ElementTypeId);
- if (!ElementType)
- return;
+ auto ElementType = Symbol.getElementType();
ElementType->dump(*this);
Printer << "[";
@@ -232,12 +229,11 @@ void FunctionDumper::dump(const PDBSymbo
}
void FunctionDumper::dump(const PDBSymbolTypePointer &Symbol) {
- uint32_t PointeeId = Symbol.getTypeId();
- auto PointeeType = Symbol.getSession().getSymbolById(PointeeId);
+ auto PointeeType = Symbol.getPointeeType();
if (!PointeeType)
return;
- if (auto FuncSig = dyn_cast<PDBSymbolTypeFunctionSig>(PointeeType.get())) {
+ if (auto FuncSig = PointeeType->cast<PDBSymbolTypeFunctionSig>()) {
FunctionDumper NestedDumper(Printer);
PointerType Pointer =
Symbol.isReference() ? PointerType::Reference : PointerType::Pointer;
Modified: llvm/trunk/tools/llvm-pdbdump/PrettyTypeDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/PrettyTypeDumper.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-pdbdump/PrettyTypeDumper.cpp (original)
+++ llvm/trunk/tools/llvm-pdbdump/PrettyTypeDumper.cpp Mon Apr 10 01:14:09 2017
@@ -66,8 +66,6 @@ void TypeDumper::start(const PDBSymbolEx
void TypeDumper::dump(const PDBSymbolTypeEnum &Symbol) {
assert(opts::pretty::Enums);
- if (Symbol.getUnmodifiedTypeId() != 0)
- return;
if (Printer.IsTypeExcluded(Symbol.getName()))
return;
// Dump member enums when dumping their class definition.
Modified: llvm/trunk/tools/llvm-pdbdump/PrettyTypedefDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/PrettyTypedefDumper.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-pdbdump/PrettyTypedefDumper.cpp (original)
+++ llvm/trunk/tools/llvm-pdbdump/PrettyTypedefDumper.cpp Mon Apr 10 01:14:09 2017
@@ -53,11 +53,8 @@ void TypedefDumper::dump(const PDBSymbol
WithColor(Printer, PDB_ColorItem::Keyword).get() << "const ";
if (Symbol.isVolatileType())
WithColor(Printer, PDB_ColorItem::Keyword).get() << "volatile ";
- uint32_t PointeeId = Symbol.getTypeId();
- auto PointeeType = Symbol.getSession().getSymbolById(PointeeId);
- if (!PointeeType)
- return;
- if (auto FuncSig = dyn_cast<PDBSymbolTypeFunctionSig>(PointeeType.get())) {
+ auto PointeeType = Symbol.getPointeeType();
+ if (auto FuncSig = PointeeType->cast<PDBSymbolTypeFunctionSig>()) {
FunctionDumper::PointerType Pointer = FunctionDumper::PointerType::Pointer;
if (Symbol.isReference())
Pointer = FunctionDumper::PointerType::Reference;
Modified: llvm/trunk/tools/llvm-pdbdump/PrettyVariableDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/PrettyVariableDumper.cpp?rev=299831&r1=299830&r2=299831&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-pdbdump/PrettyVariableDumper.cpp (original)
+++ llvm/trunk/tools/llvm-pdbdump/PrettyVariableDumper.cpp Mon Apr 10 01:14:09 2017
@@ -101,7 +101,7 @@ void VariableDumper::dump(const PDBSymbo
if (!PointeeType)
return;
- if (auto Func = dyn_cast<PDBSymbolFunc>(PointeeType.get())) {
+ if (auto Func = PointeeType->cast<PDBSymbolFunc>()) {
FunctionDumper NestedDumper(Printer);
FunctionDumper::PointerType Pointer =
Symbol.isReference() ? FunctionDumper::PointerType::Reference
@@ -128,11 +128,11 @@ void VariableDumper::dump(const PDBSymbo
void VariableDumper::dumpSymbolTypeAndName(const PDBSymbol &Type,
StringRef Name) {
- if (auto *ArrayType = dyn_cast<PDBSymbolTypeArray>(&Type)) {
+ if (auto *ArrayType = Type.cast<PDBSymbolTypeArray>()) {
std::string IndexSpec;
raw_string_ostream IndexStream(IndexSpec);
std::unique_ptr<PDBSymbol> ElementType = ArrayType->getElementType();
- while (auto NestedArray = dyn_cast<PDBSymbolTypeArray>(ElementType.get())) {
+ while (auto NestedArray = ElementType->cast<PDBSymbolTypeArray>()) {
IndexStream << "[";
IndexStream << NestedArray->getCount();
IndexStream << "]";
@@ -154,10 +154,9 @@ bool VariableDumper::tryDumpFunctionPoin
StringRef Name) {
// Function pointers come across as pointers to function signatures. But the
// signature carries no name, so we have to handle this case separately.
- if (auto *PointerType = dyn_cast<PDBSymbolTypePointer>(&Type)) {
+ if (auto *PointerType = Type.cast<PDBSymbolTypePointer>()) {
auto PointeeType = PointerType->getPointeeType();
- if (auto *FunctionSig =
- dyn_cast<PDBSymbolTypeFunctionSig>(PointeeType.get())) {
+ if (auto *FunctionSig = PointeeType->cast<PDBSymbolTypeFunctionSig>()) {
FunctionDumper Dumper(Printer);
FunctionDumper::PointerType PT = FunctionDumper::PointerType::Pointer;
if (PointerType->isReference())
More information about the llvm-commits
mailing list