10 #ifndef LLVM_DEBUGINFO_PDB_PDBSYMBOL_H 11 #define LLVM_DEBUGINFO_PDB_PDBSYMBOL_H 20 #define FORWARD_SYMBOL_METHOD(MethodName) \ 21 auto MethodName() const->decltype(RawSymbol->MethodName()) { \ 22 return RawSymbol->MethodName(); \ 25 #define FORWARD_CONCRETE_SYMBOL_ID_METHOD_WITH_NAME(ConcreteType, PrivateName, \ 27 auto PublicName##Id() const->decltype(RawSymbol->PrivateName##Id()) { \ 28 return RawSymbol->PrivateName##Id(); \ 30 std::unique_ptr<ConcreteType> PublicName() const { \ 31 uint32_t Id = PublicName##Id(); \ 32 return getConcreteSymbolByIdHelper<ConcreteType>(Id); \ 35 #define FORWARD_SYMBOL_ID_METHOD_WITH_NAME(PrivateName, PublicName) \ 36 FORWARD_CONCRETE_SYMBOL_ID_METHOD_WITH_NAME(PDBSymbol, PrivateName, \ 39 #define FORWARD_SYMBOL_ID_METHOD(MethodName) \ 40 FORWARD_SYMBOL_ID_METHOD_WITH_NAME(MethodName, MethodName) 51 #define DECLARE_PDB_SYMBOL_CONCRETE_TYPE(TagValue) \ 53 using PDBSymbol::PDBSymbol; \ 54 friend class PDBSymbol; \ 57 static const PDB_SymType Tag = TagValue; \ 58 static bool classof(const PDBSymbol *S) { return S->getSymTag() == Tag; } 60 #define DECLARE_PDB_SYMBOL_CUSTOM_TYPE(Condition) \ 62 using PDBSymbol::PDBSymbol; \ 63 friend class PDBSymbol; \ 66 static bool classof(const PDBSymbol *S) { return Condition; } 75 static std::unique_ptr<PDBSymbol> createSymbol(
const IPDBSession &PDBSession,
83 static std::unique_ptr<PDBSymbol>
85 std::unique_ptr<IPDBRawSymbol>
RawSymbol);
89 template <
typename ConcreteT>
90 static std::unique_ptr<ConcreteT>
92 std::unique_ptr<IPDBRawSymbol> RawSymbol) {
93 std::unique_ptr<PDBSymbol> S =
create(PDBSession, std::move(RawSymbol));
94 return unique_dyn_cast_or_null<ConcreteT>(std::move(S));
96 template <
typename ConcreteT>
99 std::unique_ptr<PDBSymbol> S =
create(PDBSession, RawSymbol);
100 return unique_dyn_cast_or_null<ConcreteT>(std::move(S));
130 template <
typename T>
135 return llvm::make_unique<ConcreteSymbolEnumerator<T>>(std::move(BaseIter));
140 std::unique_ptr<IPDBEnumSymbols>
159 template <
typename ConcreteType>
IPDBSession defines an interface used to provide a context for querying debug information from a debu...
IPDBRawSymbol * RawSymbol
This class represents lattice values for constants.
const IPDBSession & getSession() const
virtual std::unique_ptr< IPDBEnumSymbols > findChildren(PDB_SymType Type) const =0
static std::unique_ptr< ConcreteT > createAs(const IPDBSession &PDBSession, std::unique_ptr< IPDBRawSymbol > RawSymbol)
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
PDB_NameSearchFlags
Defines flags used for enumerating child symbols.
IPDBRawSymbol & getRawSymbol()
std::unique_ptr< T > findOneChild() const
std::unique_ptr< ConcreteSymbolEnumerator< T > > findAllChildren() const
amdgpu Simplify well known AMD library false Value Value const Twine & Name
std::unordered_map< PDB_SymType, int > TagStats
block placement Basic Block Placement Stats
std::unique_ptr< IPDBEnumSymbols > getChildStats(TagStats &Stats) const
PDB_SymType
These values correspond to the SymTagEnum enumeration, and are documented here: https://msdn.microsoft.com/en-us/library/bkedss5f.aspx.
void defaultDump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowFlags, PdbSymbolIdField RecurseFlags) const
std::unique_ptr< ConcreteType > getConcreteSymbolByIdHelper(uint32_t Id) const
The instances of the Type class are immutable: once they are created, they are never changed...
IPDBRawSymbol defines an interface used to represent an arbitrary symbol.
std::unique_ptr< IPDBEnumSymbols > findChildren(PDB_SymType Type, StringRef Name, PDB_NameSearchFlags Flags) const
PDBSymbol(const IPDBSession &PDBSession)
std::unique_ptr< PDBSymbol > getSymbolByIdHelper(uint32_t Id) const
PDB_SymType getSymTag() const
PDBSymbol defines the base of the inheritance hierarchy for concrete symbol types (e...
const IPDBRawSymbol & getRawSymbol() const
virtual void dump(PDBSymDumper &Dumper) const =0
Dumps the contents of a symbol a raw_ostream.
static std::unique_ptr< ConcreteT > createAs(const IPDBSession &PDBSession, IPDBRawSymbol &RawSymbol)
const IPDBSession & Session
std::unique_ptr< IPDBEnumSymbols > findChildrenByRVA(PDB_SymType Type, StringRef Name, PDB_NameSearchFlags Flags, uint32_t RVA) const
void dumpProperties() const
std::unique_ptr< IPDBEnumSymbols > findInlineFramesByRVA(uint32_t RVA) const
uint32_t getSymIndexId() const
This class implements an extremely fast bulk output stream that can only output to a stream...
static std::unique_ptr< PDBSymbol > create(const IPDBSession &PDBSession, std::unique_ptr< IPDBRawSymbol > RawSymbol)
StringRef - Represent a constant reference to a string, i.e.
void dumpChildStats() const