9#ifndef LLVM_DEBUGINFO_PDB_PDBSYMBOL_H
10#define LLVM_DEBUGINFO_PDB_PDBSYMBOL_H
18#define FORWARD_SYMBOL_METHOD(MethodName) \
19 decltype(auto) MethodName() const { return RawSymbol->MethodName(); }
21#define FORWARD_CONCRETE_SYMBOL_ID_METHOD_WITH_NAME(ConcreteType, PrivateName, \
23 decltype(auto) PublicName##Id() const { \
24 return RawSymbol->PrivateName##Id(); \
26 std::unique_ptr<ConcreteType> PublicName() const { \
27 uint32_t Id = PublicName##Id(); \
28 return getConcreteSymbolByIdHelper<ConcreteType>(Id); \
31#define FORWARD_SYMBOL_ID_METHOD_WITH_NAME(PrivateName, PublicName) \
32 FORWARD_CONCRETE_SYMBOL_ID_METHOD_WITH_NAME(PDBSymbol, PrivateName, \
35#define FORWARD_SYMBOL_ID_METHOD(MethodName) \
36 FORWARD_SYMBOL_ID_METHOD_WITH_NAME(MethodName, MethodName)
47template <
typename ChildType>
class ConcreteSymbolEnumerator;
49#define DECLARE_PDB_SYMBOL_CONCRETE_TYPE(TagValue) \
51 using PDBSymbol::PDBSymbol; \
52 friend class PDBSymbol; \
55 static const PDB_SymType Tag = TagValue; \
56 static bool classof(const PDBSymbol *S) { return S->getSymTag() == Tag; }
58#define DECLARE_PDB_SYMBOL_CUSTOM_TYPE(Condition) \
60 using PDBSymbol::PDBSymbol; \
61 friend class PDBSymbol; \
64 static bool classof(const PDBSymbol *S) { return Condition; }
73 static std::unique_ptr<PDBSymbol> createSymbol(
const IPDBSession &PDBSession,
81 static std::unique_ptr<PDBSymbol>
83 std::unique_ptr<IPDBRawSymbol>
RawSymbol);
87 template <
typename ConcreteT>
88 static std::unique_ptr<ConcreteT>
90 std::unique_ptr<IPDBRawSymbol>
RawSymbol) {
91 std::unique_ptr<PDBSymbol> S =
create(PDBSession, std::move(
RawSymbol));
94 template <
typename ConcreteT>
115 void dumpProperties()
const;
116 void dumpChildStats()
const;
128 template <
typename T>
130 auto BaseIter =
RawSymbol->findChildren(T::Tag);
133 return std::make_unique<ConcreteSymbolEnumerator<T>>(std::move(BaseIter));
135 std::unique_ptr<IPDBEnumSymbols> findAllChildren(
PDB_SymType Type)
const;
136 std::unique_ptr<IPDBEnumSymbols> findAllChildren()
const;
138 std::unique_ptr<IPDBEnumSymbols>
145 std::unique_ptr<IPDBEnumSymbols> findInlineFramesByVA(
uint64_t VA)
const;
146 std::unique_ptr<IPDBEnumSymbols> findInlineFramesByRVA(
uint32_t RVA)
const;
147 std::unique_ptr<IPDBEnumLineNumbers>
149 std::unique_ptr<IPDBEnumLineNumbers>
159 std::unique_ptr<IPDBEnumSymbols> getChildStats(
TagStats &
Stats)
const;
162 std::unique_ptr<PDBSymbol> getSymbolByIdHelper(
uint32_t Id)
const;
164 template <
typename ConcreteType>
block placement Basic Block Placement Stats
static StringRef getName(Value *V)
StringRef - Represent a constant reference to a string, i.e.
IPDBRawSymbol defines an interface used to represent an arbitrary symbol.
IPDBSession defines an interface used to provide a context for querying debug information from a debu...
static std::unique_ptr< ConcreteT > createAs(const IPDBSession &PDBSession, std::unique_ptr< IPDBRawSymbol > RawSymbol)
IPDBRawSymbol & getRawSymbol()
const IPDBSession & Session
std::unique_ptr< T > findOneChild() const
std::unique_ptr< PDBSymbol > getSymbolByIdHelper(uint32_t Id) const
static std::unique_ptr< ConcreteT > createAs(const IPDBSession &PDBSession, IPDBRawSymbol &RawSymbol)
std::unique_ptr< ConcreteSymbolEnumerator< T > > findAllChildren() const
virtual void dump(PDBSymDumper &Dumper) const =0
Dumps the contents of a symbol a raw_ostream.
PDBSymbol(const IPDBSession &PDBSession)
virtual void dumpRight(PDBSymDumper &Dumper) const
For certain PDBSymbolTypes, dumps additional information for the type that normally goes on the right...
std::unique_ptr< IPDBRawSymbol > OwnedRawSymbol
std::unique_ptr< ConcreteType > getConcreteSymbolByIdHelper(uint32_t Id) const
const IPDBRawSymbol & getRawSymbol() const
IPDBRawSymbol * RawSymbol
const IPDBSession & getSession() const
static std::unique_ptr< PDBSymbol > create(const IPDBSession &PDBSession, std::unique_ptr< IPDBRawSymbol > RawSymbol)
This class implements an extremely fast bulk output stream that can only output to a stream.
PDB_NameSearchFlags
Defines flags used for enumerating child symbols.
PDB_SymType
These values correspond to the SymTagEnum enumeration, and are documented here: https://msdn....
std::unordered_map< PDB_SymType, int > TagStats
This is an optimization pass for GlobalISel generic memory operations.
CastInfo< X, std::unique_ptr< Y > >::CastResultType unique_dyn_cast_or_null(std::unique_ptr< Y > &Val)