LLVM: lib/DebugInfo/PDB/Native/NativeTypeFunctionSig.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
10
17
18using namespace llvm;
21
22namespace {
23
24
25
26
28public:
29 NativeTypeFunctionArg(NativeSession &Session,
30 std::unique_ptr RealType)
32 RealType(std::move(RealType)) {}
33
37
39 PdbSymbolIdField::Type, ShowIdFields, RecurseIdFields);
40 }
41
42 SymIndexId getTypeId() const override { return RealType->getSymIndexId(); }
43
44 std::unique_ptr RealType;
45};
46
47class NativeEnumFunctionArgs : public IPDBEnumChildren {
48public:
49 NativeEnumFunctionArgs(NativeSession &Session,
50 std::unique_ptr TypeEnumerator)
51 : Session(Session), TypeEnumerator(std::move(TypeEnumerator)) {}
52
53 uint32_t getChildCount() const override {
54 return TypeEnumerator->getChildCount();
55 }
56 std::unique_ptr getChildAtIndex(uint32_t Index) const override {
57 return wrap(TypeEnumerator->getChildAtIndex(Index));
58 }
59 std::unique_ptr getNext() override {
60 return wrap(TypeEnumerator->getNext());
61 }
62
63 void reset() override { TypeEnumerator->reset(); }
64
65private:
66 std::unique_ptr wrap(std::unique_ptr S) const {
67 if (!S)
68 return nullptr;
69 auto NTFA = std::make_unique(Session, std::move(S));
71 }
72 NativeSession &Session;
73 std::unique_ptr TypeEnumerator;
74};
75}
76
83
89
91 if (IsMemberFunction) {
92 ClassParentId =
93 Session.getSymbolCache().findSymbolByTypeIndex(MemberFunc.ClassType);
94 initializeArgList(MemberFunc.ArgumentList);
95 } else {
96 initializeArgList(Proc.ArgumentList);
97 }
98}
99
101
102void NativeTypeFunctionSig::initializeArgList(codeview::TypeIndex ArgListTI) {
105
107}
108
112
114
117 RecurseIdFields);
118
123 if (IsMemberFunction)
128 Indent);
132}
133
134std::unique_ptr
137 return std::make_unique<NullEnumerator>();
138
139 auto NET = std::make_unique(Session,
140 ArgList.ArgIndices);
141 return std::unique_ptr(
142 new NativeEnumFunctionArgs(Session, std::move(NET)));
143}
144
146 if (!IsMemberFunction)
147 return 0;
148
149 return ClassParentId;
150}
151
153 return IsMemberFunction ? MemberFunc.CallConv : Proc.CallConv;
154}
155
157 return IsMemberFunction ? (1 + MemberFunc.getParameterCount())
158 : Proc.getParameterCount();
159}
160
163 IsMemberFunction ? MemberFunc.getReturnType() : Proc.getReturnType();
164
165 SymIndexId Result = Session.getSymbolCache().findSymbolByTypeIndex(ReturnTI);
166 return Result;
167}
168
170 return IsMemberFunction ? MemberFunc.getThisPointerAdjustment() : 0;
171}
172
174 if (!IsMemberFunction)
175 return false;
176
179}
180
182
184 if (!IsMemberFunction)
185 return false;
186
190}
191
194 IsMemberFunction ? MemberFunc.getOptions() : Proc.getOptions();
196}
197
199
CVType getType(TypeIndex Index) override
static Error deserializeAs(CVType &CVT, T &Record)
NativeRawSymbol(NativeSession &PDBSession, PDB_SymType Tag, SymIndexId SymbolId)
void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields, PdbSymbolIdField RecurseIdFields) const override
bool isConstructorVirtualBase() const override
Definition NativeTypeFunctionSig.cpp:183
SymIndexId getClassParentId() const override
Definition NativeTypeFunctionSig.cpp:145
NativeTypeFunctionSig(NativeSession &Session, SymIndexId Id, codeview::TypeIndex TI, codeview::ProcedureRecord Proc)
Definition NativeTypeFunctionSig.cpp:77
void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields, PdbSymbolIdField RecurseIdFields) const override
Definition NativeTypeFunctionSig.cpp:109
bool isVolatileType() const override
Definition NativeTypeFunctionSig.cpp:200
SymIndexId getTypeId() const override
Definition NativeTypeFunctionSig.cpp:161
bool isConstType() const override
Definition NativeTypeFunctionSig.cpp:181
~NativeTypeFunctionSig() override
PDB_CallingConv getCallingConvention() const override
Definition NativeTypeFunctionSig.cpp:152
std::unique_ptr< IPDBEnumSymbols > findChildren(PDB_SymType Type) const override
Definition NativeTypeFunctionSig.cpp:135
int32_t getThisAdjust() const override
Definition NativeTypeFunctionSig.cpp:169
bool isCxxReturnUdt() const override
Definition NativeTypeFunctionSig.cpp:192
bool isUnalignedType() const override
Definition NativeTypeFunctionSig.cpp:198
bool hasConstructor() const override
Definition NativeTypeFunctionSig.cpp:173
uint32_t getCount() const override
Definition NativeTypeFunctionSig.cpp:156
codeview::ProcedureRecord Proc
codeview::MemberFunctionRecord MemberFunc
void initialize() override
Definition NativeTypeFunctionSig.cpp:90
Expected< TpiStream & > getPDBTpiStream()
static std::unique_ptr< PDBSymbol > create(const IPDBSession &PDBSession, std::unique_ptr< IPDBRawSymbol > RawSymbol)
codeview::LazyRandomTypeCollection & typeCollection()
This class implements an extremely fast bulk output stream that can only output to a stream.
CVRecord< TypeLeafKind > CVType
@ ConstructorWithVirtualBases
void dumpSymbolField(raw_ostream &OS, StringRef Name, T Value, int Indent)
PDB_SymType
These values correspond to the SymTagEnum enumeration, and are documented here: https://msdn....
LLVM_ABI void dumpSymbolIdField(raw_ostream &OS, StringRef Name, SymIndexId Value, int Indent, const IPDBSession &Session, PdbSymbolIdField FieldId, PdbSymbolIdField ShowFlags, PdbSymbolIdField RecurseFlags)
codeview::CallingConvention PDB_CallingConv
These values correspond to the CV_call_e enumeration, and are documented at the following locations: ...
This is an optimization pass for GlobalISel generic memory operations.
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
void cantFail(Error Err, const char *Msg=nullptr)
Report a fatal error if Err is a failure value.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
LLVMAttributeRef wrap(Attribute Attr)
Implement std::hash so that hash_code can be used in STL containers.