LLVM: include/llvm/DebugInfo/PDB/PDBSymbol.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9#ifndef LLVM_DEBUGINFO_PDB_PDBSYMBOL_H
10#define LLVM_DEBUGINFO_PDB_PDBSYMBOL_H
11
17
18#define FORWARD_SYMBOL_METHOD(MethodName) \
19 decltype(auto) MethodName() const { return RawSymbol->MethodName(); }
20
21#define FORWARD_CONCRETE_SYMBOL_ID_METHOD_WITH_NAME(ConcreteType, PrivateName, \
22 PublicName) \
23 decltype(auto) PublicName##Id() const { \
24 return RawSymbol->PrivateName##Id(); \
25 } \
26 std::unique_ptr PublicName() const { \
27 uint32_t Id = PublicName##Id(); \
28 return getConcreteSymbolByIdHelper(Id); \
29 }
30
31#define FORWARD_SYMBOL_ID_METHOD_WITH_NAME(PrivateName, PublicName) \
32 FORWARD_CONCRETE_SYMBOL_ID_METHOD_WITH_NAME(PDBSymbol, PrivateName, \
33 PublicName)
34
35#define FORWARD_SYMBOL_ID_METHOD(MethodName) \
36 FORWARD_SYMBOL_ID_METHOD_WITH_NAME(MethodName, MethodName)
37
38namespace llvm {
39
40class StringRef;
41class raw_ostream;
42
43namespace pdb {
44class IPDBSession;
45class PDBSymDumper;
46class PDBSymbol;
47template class ConcreteSymbolEnumerator;
48
49#define DECLARE_PDB_SYMBOL_CONCRETE_TYPE(TagValue) \
50private: \
51 using PDBSymbol::PDBSymbol; \
52 friend class PDBSymbol; \
53 \
54public: \
55 static const PDB_SymType Tag = TagValue; \
56 static bool classof(const PDBSymbol *S) { return S->getSymTag() == Tag; }
57
58#define DECLARE_PDB_SYMBOL_CUSTOM_TYPE(Condition) \
59private: \
60 using PDBSymbol::PDBSymbol; \
61 friend class PDBSymbol; \
62 \
63public: \
64 static bool classof(const PDBSymbol *S) { return Condition; }
65
66
67
68
69
70
71
73 static std::unique_ptr createSymbol(const IPDBSession &PDBSession,
75
76protected:
79
80public:
81 static std::unique_ptr
83 std::unique_ptr RawSymbol);
84 static std::unique_ptr create(const IPDBSession &PDBSession,
86
87 template
88 static std::unique_ptr
90 std::unique_ptr RawSymbol) {
91 std::unique_ptr S = create(PDBSession, std::move(RawSymbol));
93 }
94 template
100
102
103
104
105
106
108
109
110
112
115 void dumpProperties() const;
116 void dumpChildStats() const;
117
119 uint32_t getSymIndexId() const;
120
121 template std::unique_ptr findOneChild() const {
124 return nullptr;
126 }
127
128 template
129 std::unique_ptr<ConcreteSymbolEnumerator> findAllChildren() const {
130 auto BaseIter = RawSymbol->findChildren(T::Tag);
131 if (!BaseIter)
132 return nullptr;
133 return std::make_unique<ConcreteSymbolEnumerator>(std::move(BaseIter));
134 }
135 std::unique_ptr findAllChildren(PDB_SymType Type) const;
136 std::unique_ptr findAllChildren() const;
137
138 std::unique_ptr
141 std::unique_ptr findChildrenByRVA(PDB_SymType Type,
145 std::unique_ptr findInlineFramesByVA(uint64_t VA) const;
146 std::unique_ptr findInlineFramesByRVA(uint32_t RVA) const;
147 std::unique_ptr
149 std::unique_ptr
151
152 std::string getName() const;
153
156
158
159 std::unique_ptr getChildStats(TagStats &Stats) const;
160
161protected:
162 std::unique_ptr getSymbolByIdHelper(uint32_t Id) const;
163
164 template
168
172};
173
174}
175}
176
177#endif
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)
Definition PDBSymbol.h:89
IPDBRawSymbol & getRawSymbol()
Definition PDBSymbol.h:155
const IPDBSession & Session
Definition PDBSymbol.h:169
std::unique_ptr< T > findOneChild() const
Definition PDBSymbol.h:121
std::unique_ptr< PDBSymbol > getSymbolByIdHelper(uint32_t Id) const
static std::unique_ptr< ConcreteT > createAs(const IPDBSession &PDBSession, IPDBRawSymbol &RawSymbol)
Definition PDBSymbol.h:95
std::unique_ptr< ConcreteSymbolEnumerator< T > > findAllChildren() const
Definition PDBSymbol.h:129
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...
Definition PDBSymbol.h:111
std::unique_ptr< IPDBRawSymbol > OwnedRawSymbol
Definition PDBSymbol.h:170
std::unique_ptr< ConcreteType > getConcreteSymbolByIdHelper(uint32_t Id) const
Definition PDBSymbol.h:165
const IPDBRawSymbol & getRawSymbol() const
Definition PDBSymbol.h:154
IPDBRawSymbol * RawSymbol
Definition PDBSymbol.h:171
const IPDBSession & getSession() const
Definition PDBSymbol.h:157
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)