/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/lib/Serialization/ASTReaderStmt.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | //===- ASTReaderStmt.cpp - Stmt/Expr Deserialization ----------------------===// |
2 | | // |
3 | | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | | // See https://llvm.org/LICENSE.txt for license information. |
5 | | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | | // |
7 | | //===----------------------------------------------------------------------===// |
8 | | // |
9 | | // Statement/expression deserialization. This implements the |
10 | | // ASTReader::ReadStmt method. |
11 | | // |
12 | | //===----------------------------------------------------------------------===// |
13 | | |
14 | | #include "clang/AST/ASTConcept.h" |
15 | | #include "clang/AST/ASTContext.h" |
16 | | #include "clang/AST/AttrIterator.h" |
17 | | #include "clang/AST/Decl.h" |
18 | | #include "clang/AST/DeclAccessPair.h" |
19 | | #include "clang/AST/DeclCXX.h" |
20 | | #include "clang/AST/DeclGroup.h" |
21 | | #include "clang/AST/DeclObjC.h" |
22 | | #include "clang/AST/DeclTemplate.h" |
23 | | #include "clang/AST/DeclarationName.h" |
24 | | #include "clang/AST/DependenceFlags.h" |
25 | | #include "clang/AST/Expr.h" |
26 | | #include "clang/AST/ExprCXX.h" |
27 | | #include "clang/AST/ExprObjC.h" |
28 | | #include "clang/AST/ExprOpenMP.h" |
29 | | #include "clang/AST/NestedNameSpecifier.h" |
30 | | #include "clang/AST/OpenMPClause.h" |
31 | | #include "clang/AST/OperationKinds.h" |
32 | | #include "clang/AST/Stmt.h" |
33 | | #include "clang/AST/StmtCXX.h" |
34 | | #include "clang/AST/StmtObjC.h" |
35 | | #include "clang/AST/StmtOpenMP.h" |
36 | | #include "clang/AST/StmtVisitor.h" |
37 | | #include "clang/AST/TemplateBase.h" |
38 | | #include "clang/AST/Type.h" |
39 | | #include "clang/AST/UnresolvedSet.h" |
40 | | #include "clang/Basic/CapturedStmt.h" |
41 | | #include "clang/Basic/ExpressionTraits.h" |
42 | | #include "clang/Basic/LLVM.h" |
43 | | #include "clang/Basic/Lambda.h" |
44 | | #include "clang/Basic/LangOptions.h" |
45 | | #include "clang/Basic/OpenMPKinds.h" |
46 | | #include "clang/Basic/OperatorKinds.h" |
47 | | #include "clang/Basic/SourceLocation.h" |
48 | | #include "clang/Basic/Specifiers.h" |
49 | | #include "clang/Basic/TypeTraits.h" |
50 | | #include "clang/Lex/Token.h" |
51 | | #include "clang/Serialization/ASTBitCodes.h" |
52 | | #include "clang/Serialization/ASTRecordReader.h" |
53 | | #include "llvm/ADT/BitmaskEnum.h" |
54 | | #include "llvm/ADT/DenseMap.h" |
55 | | #include "llvm/ADT/SmallString.h" |
56 | | #include "llvm/ADT/SmallVector.h" |
57 | | #include "llvm/ADT/StringRef.h" |
58 | | #include "llvm/Bitstream/BitstreamReader.h" |
59 | | #include "llvm/Support/Casting.h" |
60 | | #include "llvm/Support/ErrorHandling.h" |
61 | | #include <algorithm> |
62 | | #include <cassert> |
63 | | #include <cstdint> |
64 | | #include <optional> |
65 | | #include <string> |
66 | | |
67 | | using namespace clang; |
68 | | using namespace serialization; |
69 | | |
70 | | namespace clang { |
71 | | |
72 | | class ASTStmtReader : public StmtVisitor<ASTStmtReader> { |
73 | | ASTRecordReader &Record; |
74 | | llvm::BitstreamCursor &DeclsCursor; |
75 | | |
76 | 2.14M | SourceLocation readSourceLocation() { |
77 | 2.14M | return Record.readSourceLocation(); |
78 | 2.14M | } |
79 | | |
80 | 33.0k | SourceRange readSourceRange() { |
81 | 33.0k | return Record.readSourceRange(); |
82 | 33.0k | } |
83 | | |
84 | 0 | std::string readString() { |
85 | 0 | return Record.readString(); |
86 | 0 | } |
87 | | |
88 | 40.6k | TypeSourceInfo *readTypeSourceInfo() { |
89 | 40.6k | return Record.readTypeSourceInfo(); |
90 | 40.6k | } |
91 | | |
92 | 53.2k | Decl *readDecl() { |
93 | 53.2k | return Record.readDecl(); |
94 | 53.2k | } |
95 | | |
96 | | template<typename T> |
97 | 1.03M | T *readDeclAs() { |
98 | 1.03M | return Record.readDeclAs<T>(); |
99 | 1.03M | } clang::LabelDecl* clang::ASTStmtReader::readDeclAs<clang::LabelDecl>() Line | Count | Source | 97 | 30 | T *readDeclAs() { | 98 | 30 | return Record.readDeclAs<T>(); | 99 | 30 | } |
clang::VarDecl* clang::ASTStmtReader::readDeclAs<clang::VarDecl>() Line | Count | Source | 97 | 45.5k | T *readDeclAs() { | 98 | 45.5k | return Record.readDeclAs<T>(); | 99 | 45.5k | } |
clang::CapturedDecl* clang::ASTStmtReader::readDeclAs<clang::CapturedDecl>() Line | Count | Source | 97 | 36.6k | T *readDeclAs() { | 98 | 36.6k | return Record.readDeclAs<T>(); | 99 | 36.6k | } |
clang::RecordDecl* clang::ASTStmtReader::readDeclAs<clang::RecordDecl>() Line | Count | Source | 97 | 36.6k | T *readDeclAs() { | 98 | 36.6k | return Record.readDeclAs<T>(); | 99 | 36.6k | } |
clang::NamedDecl* clang::ASTStmtReader::readDeclAs<clang::NamedDecl>() Line | Count | Source | 97 | 286k | T *readDeclAs() { | 98 | 286k | return Record.readDeclAs<T>(); | 99 | 286k | } |
clang::ValueDecl* clang::ASTStmtReader::readDeclAs<clang::ValueDecl>() Line | Count | Source | 97 | 515k | T *readDeclAs() { | 98 | 515k | return Record.readDeclAs<T>(); | 99 | 515k | } |
clang::FieldDecl* clang::ASTStmtReader::readDeclAs<clang::FieldDecl>() Line | Count | Source | 97 | 173 | T *readDeclAs() { | 98 | 173 | return Record.readDeclAs<T>(); | 99 | 173 | } |
clang::DeclContext* clang::ASTStmtReader::readDeclAs<clang::DeclContext>() Line | Count | Source | 97 | 628 | T *readDeclAs() { | 98 | 628 | return Record.readDeclAs<T>(); | 99 | 628 | } |
clang::BlockDecl* clang::ASTStmtReader::readDeclAs<clang::BlockDecl>() Line | Count | Source | 97 | 71 | T *readDeclAs() { | 98 | 71 | return Record.readDeclAs<T>(); | 99 | 71 | } |
clang::ObjCMethodDecl* clang::ASTStmtReader::readDeclAs<clang::ObjCMethodDecl>() Line | Count | Source | 97 | 85 | T *readDeclAs() { | 98 | 85 | return Record.readDeclAs<T>(); | 99 | 85 | } |
clang::ObjCProtocolDecl* clang::ASTStmtReader::readDeclAs<clang::ObjCProtocolDecl>() Line | Count | Source | 97 | 1 | T *readDeclAs() { | 98 | 1 | return Record.readDeclAs<T>(); | 99 | 1 | } |
clang::ObjCIvarDecl* clang::ASTStmtReader::readDeclAs<clang::ObjCIvarDecl>() Line | Count | Source | 97 | 12 | T *readDeclAs() { | 98 | 12 | return Record.readDeclAs<T>(); | 99 | 12 | } |
Unexecuted instantiation: clang::ObjCPropertyDecl* clang::ASTStmtReader::readDeclAs<clang::ObjCPropertyDecl>() clang::ObjCInterfaceDecl* clang::ASTStmtReader::readDeclAs<clang::ObjCInterfaceDecl>() Line | Count | Source | 97 | 1 | T *readDeclAs() { | 98 | 1 | return Record.readDeclAs<T>(); | 99 | 1 | } |
clang::CXXConstructorDecl* clang::ASTStmtReader::readDeclAs<clang::CXXConstructorDecl>() Line | Count | Source | 97 | 8.91k | T *readDeclAs() { | 98 | 8.91k | return Record.readDeclAs<T>(); | 99 | 8.91k | } |
clang::ParmVarDecl* clang::ASTStmtReader::readDeclAs<clang::ParmVarDecl>() Line | Count | Source | 97 | 568 | T *readDeclAs() { | 98 | 568 | return Record.readDeclAs<T>(); | 99 | 568 | } |
clang::FunctionDecl* clang::ASTStmtReader::readDeclAs<clang::FunctionDecl>() Line | Count | Source | 97 | 547 | T *readDeclAs() { | 98 | 547 | return Record.readDeclAs<T>(); | 99 | 547 | } |
clang::CXXRecordDecl* clang::ASTStmtReader::readDeclAs<clang::CXXRecordDecl>() Line | Count | Source | 97 | 55.4k | T *readDeclAs() { | 98 | 55.4k | return Record.readDeclAs<T>(); | 99 | 55.4k | } |
clang::Decl* clang::ASTStmtReader::readDeclAs<clang::Decl>() Line | Count | Source | 97 | 50.3k | T *readDeclAs() { | 98 | 50.3k | return Record.readDeclAs<T>(); | 99 | 50.3k | } |
clang::MSPropertyDecl* clang::ASTStmtReader::readDeclAs<clang::MSPropertyDecl>() Line | Count | Source | 97 | 36 | T *readDeclAs() { | 98 | 36 | return Record.readDeclAs<T>(); | 99 | 36 | } |
clang::MSGuidDecl* clang::ASTStmtReader::readDeclAs<clang::MSGuidDecl>() Line | Count | Source | 97 | 1 | T *readDeclAs() { | 98 | 1 | return Record.readDeclAs<T>(); | 99 | 1 | } |
|
100 | | |
101 | | public: |
102 | | ASTStmtReader(ASTRecordReader &Record, llvm::BitstreamCursor &Cursor) |
103 | 471k | : Record(Record), DeclsCursor(Cursor) {} |
104 | | |
105 | | /// The number of record fields required for the Stmt class |
106 | | /// itself. |
107 | | static const unsigned NumStmtFields = 0; |
108 | | |
109 | | /// The number of record fields required for the Expr class |
110 | | /// itself. |
111 | | static const unsigned NumExprFields = NumStmtFields + 4; |
112 | | |
113 | | /// Read and initialize a ExplicitTemplateArgumentList structure. |
114 | | void ReadTemplateKWAndArgsInfo(ASTTemplateKWAndArgsInfo &Args, |
115 | | TemplateArgumentLoc *ArgsLocArray, |
116 | | unsigned NumTemplateArgs); |
117 | | |
118 | | void VisitStmt(Stmt *S); |
119 | | #define STMT(Type, Base) \ |
120 | | void Visit##Type(Type *); |
121 | | #include "clang/AST/StmtNodes.inc" |
122 | | }; |
123 | | |
124 | | } // namespace clang |
125 | | |
126 | | void ASTStmtReader::ReadTemplateKWAndArgsInfo(ASTTemplateKWAndArgsInfo &Args, |
127 | | TemplateArgumentLoc *ArgsLocArray, |
128 | 16.9k | unsigned NumTemplateArgs) { |
129 | 16.9k | SourceLocation TemplateKWLoc = readSourceLocation(); |
130 | 16.9k | TemplateArgumentListInfo ArgInfo; |
131 | 16.9k | ArgInfo.setLAngleLoc(readSourceLocation()); |
132 | 16.9k | ArgInfo.setRAngleLoc(readSourceLocation()); |
133 | 38.0k | for (unsigned i = 0; i != NumTemplateArgs; ++i21.1k ) |
134 | 21.1k | ArgInfo.addArgument(Record.readTemplateArgumentLoc()); |
135 | 16.9k | Args.initializeFrom(TemplateKWLoc, ArgInfo, ArgsLocArray); |
136 | 16.9k | } |
137 | | |
138 | 2.40M | void ASTStmtReader::VisitStmt(Stmt *S) { |
139 | 2.40M | assert(Record.getIdx() == NumStmtFields && "Incorrect statement field count"); |
140 | 2.40M | } |
141 | | |
142 | 687 | void ASTStmtReader::VisitNullStmt(NullStmt *S) { |
143 | 687 | VisitStmt(S); |
144 | 687 | S->setSemiLoc(readSourceLocation()); |
145 | 687 | S->NullStmtBits.HasLeadingEmptyMacro = Record.readInt(); |
146 | 687 | } |
147 | | |
148 | 77.2k | void ASTStmtReader::VisitCompoundStmt(CompoundStmt *S) { |
149 | 77.2k | VisitStmt(S); |
150 | 77.2k | SmallVector<Stmt *, 16> Stmts; |
151 | 77.2k | unsigned NumStmts = Record.readInt(); |
152 | 77.2k | unsigned HasFPFeatures = Record.readInt(); |
153 | 77.2k | assert(S->hasStoredFPFeatures() == HasFPFeatures); |
154 | 238k | while (77.2k NumStmts--) |
155 | 161k | Stmts.push_back(Record.readSubStmt()); |
156 | 77.2k | S->setStmts(Stmts); |
157 | 77.2k | if (HasFPFeatures) |
158 | 4.52k | S->setStoredFPFeatures( |
159 | 4.52k | FPOptionsOverride::getFromOpaqueInt(Record.readInt())); |
160 | 77.2k | S->LBraceLoc = readSourceLocation(); |
161 | 77.2k | S->RBraceLoc = readSourceLocation(); |
162 | 77.2k | } |
163 | | |
164 | 331 | void ASTStmtReader::VisitSwitchCase(SwitchCase *S) { |
165 | 331 | VisitStmt(S); |
166 | 331 | Record.recordSwitchCaseID(S, Record.readInt()); |
167 | 331 | S->setKeywordLoc(readSourceLocation()); |
168 | 331 | S->setColonLoc(readSourceLocation()); |
169 | 331 | } |
170 | | |
171 | 312 | void ASTStmtReader::VisitCaseStmt(CaseStmt *S) { |
172 | 312 | VisitSwitchCase(S); |
173 | 312 | bool CaseStmtIsGNURange = Record.readInt(); |
174 | 312 | S->setLHS(Record.readSubExpr()); |
175 | 312 | S->setSubStmt(Record.readSubStmt()); |
176 | 312 | if (CaseStmtIsGNURange) { |
177 | 1 | S->setRHS(Record.readSubExpr()); |
178 | 1 | S->setEllipsisLoc(readSourceLocation()); |
179 | 1 | } |
180 | 312 | } |
181 | | |
182 | 19 | void ASTStmtReader::VisitDefaultStmt(DefaultStmt *S) { |
183 | 19 | VisitSwitchCase(S); |
184 | 19 | S->setSubStmt(Record.readSubStmt()); |
185 | 19 | } |
186 | | |
187 | 17 | void ASTStmtReader::VisitLabelStmt(LabelStmt *S) { |
188 | 17 | VisitStmt(S); |
189 | 17 | bool IsSideEntry = Record.readInt(); |
190 | 17 | auto *LD = readDeclAs<LabelDecl>(); |
191 | 17 | LD->setStmt(S); |
192 | 17 | S->setDecl(LD); |
193 | 17 | S->setSubStmt(Record.readSubStmt()); |
194 | 17 | S->setIdentLoc(readSourceLocation()); |
195 | 17 | S->setSideEntry(IsSideEntry); |
196 | 17 | } |
197 | | |
198 | 31 | void ASTStmtReader::VisitAttributedStmt(AttributedStmt *S) { |
199 | 31 | VisitStmt(S); |
200 | | // NumAttrs in AttributedStmt is set when creating an empty |
201 | | // AttributedStmt in AttributedStmt::CreateEmpty, since it is needed |
202 | | // to allocate the right amount of space for the trailing Attr *. |
203 | 31 | uint64_t NumAttrs = Record.readInt(); |
204 | 31 | AttrVec Attrs; |
205 | 31 | Record.readAttributes(Attrs); |
206 | 31 | (void)NumAttrs; |
207 | 31 | assert(NumAttrs == S->AttributedStmtBits.NumAttrs); |
208 | 31 | assert(NumAttrs == Attrs.size()); |
209 | 31 | std::copy(Attrs.begin(), Attrs.end(), S->getAttrArrayPtr()); |
210 | 31 | S->SubStmt = Record.readSubStmt(); |
211 | 31 | S->AttributedStmtBits.AttrLoc = readSourceLocation(); |
212 | 31 | } |
213 | | |
214 | 13.6k | void ASTStmtReader::VisitIfStmt(IfStmt *S) { |
215 | 13.6k | VisitStmt(S); |
216 | | |
217 | 13.6k | bool HasElse = Record.readInt(); |
218 | 13.6k | bool HasVar = Record.readInt(); |
219 | 13.6k | bool HasInit = Record.readInt(); |
220 | | |
221 | 13.6k | S->setStatementKind(static_cast<IfStatementKind>(Record.readInt())); |
222 | 13.6k | S->setCond(Record.readSubExpr()); |
223 | 13.6k | S->setThen(Record.readSubStmt()); |
224 | 13.6k | if (HasElse) |
225 | 3.60k | S->setElse(Record.readSubStmt()); |
226 | 13.6k | if (HasVar) |
227 | 0 | S->setConditionVariableDeclStmt(cast<DeclStmt>(Record.readSubStmt())); |
228 | 13.6k | if (HasInit) |
229 | 4 | S->setInit(Record.readSubStmt()); |
230 | | |
231 | 13.6k | S->setIfLoc(readSourceLocation()); |
232 | 13.6k | S->setLParenLoc(readSourceLocation()); |
233 | 13.6k | S->setRParenLoc(readSourceLocation()); |
234 | 13.6k | if (HasElse) |
235 | 3.60k | S->setElseLoc(readSourceLocation()); |
236 | 13.6k | } |
237 | | |
238 | 105 | void ASTStmtReader::VisitSwitchStmt(SwitchStmt *S) { |
239 | 105 | VisitStmt(S); |
240 | | |
241 | 105 | bool HasInit = Record.readInt(); |
242 | 105 | bool HasVar = Record.readInt(); |
243 | 105 | bool AllEnumCasesCovered = Record.readInt(); |
244 | 105 | if (AllEnumCasesCovered) |
245 | 2 | S->setAllEnumCasesCovered(); |
246 | | |
247 | 105 | S->setCond(Record.readSubExpr()); |
248 | 105 | S->setBody(Record.readSubStmt()); |
249 | 105 | if (HasInit) |
250 | 2 | S->setInit(Record.readSubStmt()); |
251 | 105 | if (HasVar) |
252 | 0 | S->setConditionVariableDeclStmt(cast<DeclStmt>(Record.readSubStmt())); |
253 | | |
254 | 105 | S->setSwitchLoc(readSourceLocation()); |
255 | 105 | S->setLParenLoc(readSourceLocation()); |
256 | 105 | S->setRParenLoc(readSourceLocation()); |
257 | | |
258 | 105 | SwitchCase *PrevSC = nullptr; |
259 | 436 | for (auto E = Record.size(); Record.getIdx() != E; ) { |
260 | 331 | SwitchCase *SC = Record.getSwitchCaseWithID(Record.readInt()); |
261 | 331 | if (PrevSC) |
262 | 229 | PrevSC->setNextSwitchCase(SC); |
263 | 102 | else |
264 | 102 | S->setSwitchCaseList(SC); |
265 | | |
266 | 331 | PrevSC = SC; |
267 | 331 | } |
268 | 105 | } |
269 | | |
270 | 953 | void ASTStmtReader::VisitWhileStmt(WhileStmt *S) { |
271 | 953 | VisitStmt(S); |
272 | | |
273 | 953 | bool HasVar = Record.readInt(); |
274 | | |
275 | 953 | S->setCond(Record.readSubExpr()); |
276 | 953 | S->setBody(Record.readSubStmt()); |
277 | 953 | if (HasVar) |
278 | 12 | S->setConditionVariableDeclStmt(cast<DeclStmt>(Record.readSubStmt())); |
279 | | |
280 | 953 | S->setWhileLoc(readSourceLocation()); |
281 | 953 | S->setLParenLoc(readSourceLocation()); |
282 | 953 | S->setRParenLoc(readSourceLocation()); |
283 | 953 | } |
284 | | |
285 | 51 | void ASTStmtReader::VisitDoStmt(DoStmt *S) { |
286 | 51 | VisitStmt(S); |
287 | 51 | S->setCond(Record.readSubExpr()); |
288 | 51 | S->setBody(Record.readSubStmt()); |
289 | 51 | S->setDoLoc(readSourceLocation()); |
290 | 51 | S->setWhileLoc(readSourceLocation()); |
291 | 51 | S->setRParenLoc(readSourceLocation()); |
292 | 51 | } |
293 | | |
294 | 12.0k | void ASTStmtReader::VisitForStmt(ForStmt *S) { |
295 | 12.0k | VisitStmt(S); |
296 | 12.0k | S->setInit(Record.readSubStmt()); |
297 | 12.0k | S->setCond(Record.readSubExpr()); |
298 | 12.0k | S->setConditionVariableDeclStmt(cast_or_null<DeclStmt>(Record.readSubStmt())); |
299 | 12.0k | S->setInc(Record.readSubExpr()); |
300 | 12.0k | S->setBody(Record.readSubStmt()); |
301 | 12.0k | S->setForLoc(readSourceLocation()); |
302 | 12.0k | S->setLParenLoc(readSourceLocation()); |
303 | 12.0k | S->setRParenLoc(readSourceLocation()); |
304 | 12.0k | } |
305 | | |
306 | 6 | void ASTStmtReader::VisitGotoStmt(GotoStmt *S) { |
307 | 6 | VisitStmt(S); |
308 | 6 | S->setLabel(readDeclAs<LabelDecl>()); |
309 | 6 | S->setGotoLoc(readSourceLocation()); |
310 | 6 | S->setLabelLoc(readSourceLocation()); |
311 | 6 | } |
312 | | |
313 | 2 | void ASTStmtReader::VisitIndirectGotoStmt(IndirectGotoStmt *S) { |
314 | 2 | VisitStmt(S); |
315 | 2 | S->setGotoLoc(readSourceLocation()); |
316 | 2 | S->setStarLoc(readSourceLocation()); |
317 | 2 | S->setTarget(Record.readSubExpr()); |
318 | 2 | } |
319 | | |
320 | 11 | void ASTStmtReader::VisitContinueStmt(ContinueStmt *S) { |
321 | 11 | VisitStmt(S); |
322 | 11 | S->setContinueLoc(readSourceLocation()); |
323 | 11 | } |
324 | | |
325 | 451 | void ASTStmtReader::VisitBreakStmt(BreakStmt *S) { |
326 | 451 | VisitStmt(S); |
327 | 451 | S->setBreakLoc(readSourceLocation()); |
328 | 451 | } |
329 | | |
330 | 28.1k | void ASTStmtReader::VisitReturnStmt(ReturnStmt *S) { |
331 | 28.1k | VisitStmt(S); |
332 | | |
333 | 28.1k | bool HasNRVOCandidate = Record.readInt(); |
334 | | |
335 | 28.1k | S->setRetValue(Record.readSubExpr()); |
336 | 28.1k | if (HasNRVOCandidate) |
337 | 958 | S->setNRVOCandidate(readDeclAs<VarDecl>()); |
338 | | |
339 | 28.1k | S->setReturnLoc(readSourceLocation()); |
340 | 28.1k | } |
341 | | |
342 | 48.3k | void ASTStmtReader::VisitDeclStmt(DeclStmt *S) { |
343 | 48.3k | VisitStmt(S); |
344 | 48.3k | S->setStartLoc(readSourceLocation()); |
345 | 48.3k | S->setEndLoc(readSourceLocation()); |
346 | | |
347 | 48.3k | if (Record.size() - Record.getIdx() == 1) { |
348 | | // Single declaration |
349 | 45.9k | S->setDeclGroup(DeclGroupRef(readDecl())); |
350 | 45.9k | } else { |
351 | 2.38k | SmallVector<Decl *, 16> Decls; |
352 | 2.38k | int N = Record.size() - Record.getIdx(); |
353 | 2.38k | Decls.reserve(N); |
354 | 9.59k | for (int I = 0; I < N; ++I7.21k ) |
355 | 7.21k | Decls.push_back(readDecl()); |
356 | 2.38k | S->setDeclGroup(DeclGroupRef(DeclGroup::Create(Record.getContext(), |
357 | 2.38k | Decls.data(), |
358 | 2.38k | Decls.size()))); |
359 | 2.38k | } |
360 | 48.3k | } |
361 | | |
362 | 12 | void ASTStmtReader::VisitAsmStmt(AsmStmt *S) { |
363 | 12 | VisitStmt(S); |
364 | 12 | S->NumOutputs = Record.readInt(); |
365 | 12 | S->NumInputs = Record.readInt(); |
366 | 12 | S->NumClobbers = Record.readInt(); |
367 | 12 | S->setAsmLoc(readSourceLocation()); |
368 | 12 | S->setVolatile(Record.readInt()); |
369 | 12 | S->setSimple(Record.readInt()); |
370 | 12 | } |
371 | | |
372 | 12 | void ASTStmtReader::VisitGCCAsmStmt(GCCAsmStmt *S) { |
373 | 12 | VisitAsmStmt(S); |
374 | 12 | S->NumLabels = Record.readInt(); |
375 | 12 | S->setRParenLoc(readSourceLocation()); |
376 | 12 | S->setAsmString(cast_or_null<StringLiteral>(Record.readSubStmt())); |
377 | | |
378 | 12 | unsigned NumOutputs = S->getNumOutputs(); |
379 | 12 | unsigned NumInputs = S->getNumInputs(); |
380 | 12 | unsigned NumClobbers = S->getNumClobbers(); |
381 | 12 | unsigned NumLabels = S->getNumLabels(); |
382 | | |
383 | | // Outputs and inputs |
384 | 12 | SmallVector<IdentifierInfo *, 16> Names; |
385 | 12 | SmallVector<StringLiteral*, 16> Constraints; |
386 | 12 | SmallVector<Stmt*, 16> Exprs; |
387 | 28 | for (unsigned I = 0, N = NumOutputs + NumInputs; I != N; ++I16 ) { |
388 | 16 | Names.push_back(Record.readIdentifier()); |
389 | 16 | Constraints.push_back(cast_or_null<StringLiteral>(Record.readSubStmt())); |
390 | 16 | Exprs.push_back(Record.readSubStmt()); |
391 | 16 | } |
392 | | |
393 | | // Constraints |
394 | 12 | SmallVector<StringLiteral*, 16> Clobbers; |
395 | 25 | for (unsigned I = 0; I != NumClobbers; ++I13 ) |
396 | 13 | Clobbers.push_back(cast_or_null<StringLiteral>(Record.readSubStmt())); |
397 | | |
398 | | // Labels |
399 | 16 | for (unsigned I = 0, N = NumLabels; I != N; ++I4 ) { |
400 | 4 | Names.push_back(Record.readIdentifier()); |
401 | 4 | Exprs.push_back(Record.readSubStmt()); |
402 | 4 | } |
403 | | |
404 | 12 | S->setOutputsAndInputsAndClobbers(Record.getContext(), |
405 | 12 | Names.data(), Constraints.data(), |
406 | 12 | Exprs.data(), NumOutputs, NumInputs, |
407 | 12 | NumLabels, |
408 | 12 | Clobbers.data(), NumClobbers); |
409 | 12 | } |
410 | | |
411 | 0 | void ASTStmtReader::VisitMSAsmStmt(MSAsmStmt *S) { |
412 | 0 | VisitAsmStmt(S); |
413 | 0 | S->LBraceLoc = readSourceLocation(); |
414 | 0 | S->EndLoc = readSourceLocation(); |
415 | 0 | S->NumAsmToks = Record.readInt(); |
416 | 0 | std::string AsmStr = readString(); |
417 | | |
418 | | // Read the tokens. |
419 | 0 | SmallVector<Token, 16> AsmToks; |
420 | 0 | AsmToks.reserve(S->NumAsmToks); |
421 | 0 | for (unsigned i = 0, e = S->NumAsmToks; i != e; ++i) { |
422 | 0 | AsmToks.push_back(Record.readToken()); |
423 | 0 | } |
424 | | |
425 | | // The calls to reserve() for the FooData vectors are mandatory to |
426 | | // prevent dead StringRefs in the Foo vectors. |
427 | | |
428 | | // Read the clobbers. |
429 | 0 | SmallVector<std::string, 16> ClobbersData; |
430 | 0 | SmallVector<StringRef, 16> Clobbers; |
431 | 0 | ClobbersData.reserve(S->NumClobbers); |
432 | 0 | Clobbers.reserve(S->NumClobbers); |
433 | 0 | for (unsigned i = 0, e = S->NumClobbers; i != e; ++i) { |
434 | 0 | ClobbersData.push_back(readString()); |
435 | 0 | Clobbers.push_back(ClobbersData.back()); |
436 | 0 | } |
437 | | |
438 | | // Read the operands. |
439 | 0 | unsigned NumOperands = S->NumOutputs + S->NumInputs; |
440 | 0 | SmallVector<Expr*, 16> Exprs; |
441 | 0 | SmallVector<std::string, 16> ConstraintsData; |
442 | 0 | SmallVector<StringRef, 16> Constraints; |
443 | 0 | Exprs.reserve(NumOperands); |
444 | 0 | ConstraintsData.reserve(NumOperands); |
445 | 0 | Constraints.reserve(NumOperands); |
446 | 0 | for (unsigned i = 0; i != NumOperands; ++i) { |
447 | 0 | Exprs.push_back(cast<Expr>(Record.readSubStmt())); |
448 | 0 | ConstraintsData.push_back(readString()); |
449 | 0 | Constraints.push_back(ConstraintsData.back()); |
450 | 0 | } |
451 | |
|
452 | 0 | S->initialize(Record.getContext(), AsmStr, AsmToks, |
453 | 0 | Constraints, Exprs, Clobbers); |
454 | 0 | } |
455 | | |
456 | 3 | void ASTStmtReader::VisitCoroutineBodyStmt(CoroutineBodyStmt *S) { |
457 | 3 | VisitStmt(S); |
458 | 3 | assert(Record.peekInt() == S->NumParams); |
459 | 3 | Record.skipInts(1); |
460 | 3 | auto *StoredStmts = S->getStoredStmts(); |
461 | 3 | for (unsigned i = 0; |
462 | 40 | i < CoroutineBodyStmt::SubStmt::FirstParamMove + S->NumParams; ++i37 ) |
463 | 37 | StoredStmts[i] = Record.readSubStmt(); |
464 | 3 | } |
465 | | |
466 | 3 | void ASTStmtReader::VisitCoreturnStmt(CoreturnStmt *S) { |
467 | 3 | VisitStmt(S); |
468 | 3 | S->CoreturnLoc = Record.readSourceLocation(); |
469 | 3 | for (auto &SubStmt: S->SubStmts) |
470 | 6 | SubStmt = Record.readSubStmt(); |
471 | 3 | S->IsImplicit = Record.readInt() != 0; |
472 | 3 | } |
473 | | |
474 | 7 | void ASTStmtReader::VisitCoawaitExpr(CoawaitExpr *E) { |
475 | 7 | VisitExpr(E); |
476 | 7 | E->KeywordLoc = readSourceLocation(); |
477 | 7 | for (auto &SubExpr: E->SubExprs) |
478 | 35 | SubExpr = Record.readSubStmt(); |
479 | 7 | E->OpaqueValue = cast_or_null<OpaqueValueExpr>(Record.readSubStmt()); |
480 | 7 | E->setIsImplicit(Record.readInt() != 0); |
481 | 7 | } |
482 | | |
483 | 1 | void ASTStmtReader::VisitCoyieldExpr(CoyieldExpr *E) { |
484 | 1 | VisitExpr(E); |
485 | 1 | E->KeywordLoc = readSourceLocation(); |
486 | 1 | for (auto &SubExpr: E->SubExprs) |
487 | 5 | SubExpr = Record.readSubStmt(); |
488 | 1 | E->OpaqueValue = cast_or_null<OpaqueValueExpr>(Record.readSubStmt()); |
489 | 1 | } |
490 | | |
491 | 1 | void ASTStmtReader::VisitDependentCoawaitExpr(DependentCoawaitExpr *E) { |
492 | 1 | VisitExpr(E); |
493 | 1 | E->KeywordLoc = readSourceLocation(); |
494 | 1 | for (auto &SubExpr: E->SubExprs) |
495 | 2 | SubExpr = Record.readSubStmt(); |
496 | 1 | } |
497 | | |
498 | 36.6k | void ASTStmtReader::VisitCapturedStmt(CapturedStmt *S) { |
499 | 36.6k | VisitStmt(S); |
500 | 36.6k | Record.skipInts(1); |
501 | 36.6k | S->setCapturedDecl(readDeclAs<CapturedDecl>()); |
502 | 36.6k | S->setCapturedRegionKind(static_cast<CapturedRegionKind>(Record.readInt())); |
503 | 36.6k | S->setCapturedRecordDecl(readDeclAs<RecordDecl>()); |
504 | | |
505 | | // Capture inits |
506 | 36.6k | for (CapturedStmt::capture_init_iterator I = S->capture_init_begin(), |
507 | 36.6k | E = S->capture_init_end(); |
508 | 81.2k | I != E; ++I44.5k ) |
509 | 44.5k | *I = Record.readSubExpr(); |
510 | | |
511 | | // Body |
512 | 36.6k | S->setCapturedStmt(Record.readSubStmt()); |
513 | 36.6k | S->getCapturedDecl()->setBody(S->getCapturedStmt()); |
514 | | |
515 | | // Captures |
516 | 44.5k | for (auto &I : S->captures()) { |
517 | 44.5k | I.VarAndKind.setPointer(readDeclAs<VarDecl>()); |
518 | 44.5k | I.VarAndKind.setInt( |
519 | 44.5k | static_cast<CapturedStmt::VariableCaptureKind>(Record.readInt())); |
520 | 44.5k | I.Loc = readSourceLocation(); |
521 | 44.5k | } |
522 | 36.6k | } |
523 | | |
524 | 2.16M | void ASTStmtReader::VisitExpr(Expr *E) { |
525 | 2.16M | VisitStmt(E); |
526 | 2.16M | E->setType(Record.readType()); |
527 | 2.16M | E->setDependence(static_cast<ExprDependence>(Record.readInt())); |
528 | 2.16M | E->setValueKind(static_cast<ExprValueKind>(Record.readInt())); |
529 | 2.16M | E->setObjectKind(static_cast<ExprObjectKind>(Record.readInt())); |
530 | 2.16M | assert(Record.getIdx() == NumExprFields && |
531 | 2.16M | "Incorrect expression field count"); |
532 | 2.16M | } |
533 | | |
534 | 49.4k | void ASTStmtReader::VisitConstantExpr(ConstantExpr *E) { |
535 | 49.4k | VisitExpr(E); |
536 | | |
537 | 49.4k | auto StorageKind = Record.readInt(); |
538 | 49.4k | assert(E->ConstantExprBits.ResultKind == StorageKind && "Wrong ResultKind!"); |
539 | | |
540 | 49.4k | E->ConstantExprBits.APValueKind = Record.readInt(); |
541 | 49.4k | E->ConstantExprBits.IsUnsigned = Record.readInt(); |
542 | 49.4k | E->ConstantExprBits.BitWidth = Record.readInt(); |
543 | 49.4k | E->ConstantExprBits.HasCleanup = false; // Not serialized, see below. |
544 | 49.4k | E->ConstantExprBits.IsImmediateInvocation = Record.readInt(); |
545 | | |
546 | 49.4k | switch (StorageKind) { |
547 | 21 | case ConstantExpr::RSK_None: |
548 | 21 | break; |
549 | | |
550 | 49.3k | case ConstantExpr::RSK_Int64: |
551 | 49.3k | E->Int64Result() = Record.readInt(); |
552 | 49.3k | break; |
553 | | |
554 | 34 | case ConstantExpr::RSK_APValue: |
555 | 34 | E->APValueResult() = Record.readAPValue(); |
556 | 34 | if (E->APValueResult().needsCleanup()) { |
557 | 15 | E->ConstantExprBits.HasCleanup = true; |
558 | 15 | Record.getContext().addDestruction(&E->APValueResult()); |
559 | 15 | } |
560 | 34 | break; |
561 | 0 | default: |
562 | 0 | llvm_unreachable("unexpected ResultKind!"); |
563 | 49.4k | } |
564 | | |
565 | 49.4k | E->setSubExpr(Record.readSubExpr()); |
566 | 49.4k | } |
567 | | |
568 | 0 | void ASTStmtReader::VisitSYCLUniqueStableNameExpr(SYCLUniqueStableNameExpr *E) { |
569 | 0 | VisitExpr(E); |
570 | |
|
571 | 0 | E->setLocation(readSourceLocation()); |
572 | 0 | E->setLParenLocation(readSourceLocation()); |
573 | 0 | E->setRParenLocation(readSourceLocation()); |
574 | |
|
575 | 0 | E->setTypeSourceInfo(Record.readTypeSourceInfo()); |
576 | 0 | } |
577 | | |
578 | 18 | void ASTStmtReader::VisitPredefinedExpr(PredefinedExpr *E) { |
579 | 18 | VisitExpr(E); |
580 | 18 | bool HasFunctionName = Record.readInt(); |
581 | 18 | E->PredefinedExprBits.HasFunctionName = HasFunctionName; |
582 | 18 | E->PredefinedExprBits.Kind = Record.readInt(); |
583 | 18 | E->PredefinedExprBits.IsTransparent = Record.readInt(); |
584 | 18 | E->setLocation(readSourceLocation()); |
585 | 18 | if (HasFunctionName) |
586 | 16 | E->setFunctionName(cast<StringLiteral>(Record.readSubExpr())); |
587 | 18 | } |
588 | | |
589 | 515k | void ASTStmtReader::VisitDeclRefExpr(DeclRefExpr *E) { |
590 | 515k | VisitExpr(E); |
591 | | |
592 | 515k | E->DeclRefExprBits.HasQualifier = Record.readInt(); |
593 | 515k | E->DeclRefExprBits.HasFoundDecl = Record.readInt(); |
594 | 515k | E->DeclRefExprBits.HasTemplateKWAndArgsInfo = Record.readInt(); |
595 | 515k | E->DeclRefExprBits.HadMultipleCandidates = Record.readInt(); |
596 | 515k | E->DeclRefExprBits.RefersToEnclosingVariableOrCapture = Record.readInt(); |
597 | 515k | E->DeclRefExprBits.NonOdrUseReason = Record.readInt(); |
598 | 515k | E->DeclRefExprBits.IsImmediateEscalating = Record.readInt(); |
599 | 515k | unsigned NumTemplateArgs = 0; |
600 | 515k | if (E->hasTemplateKWAndArgsInfo()) |
601 | 5.77k | NumTemplateArgs = Record.readInt(); |
602 | | |
603 | 515k | if (E->hasQualifier()) |
604 | 10.8k | new (E->getTrailingObjects<NestedNameSpecifierLoc>()) |
605 | 10.8k | NestedNameSpecifierLoc(Record.readNestedNameSpecifierLoc()); |
606 | | |
607 | 515k | if (E->hasFoundDecl()) |
608 | 6.76k | *E->getTrailingObjects<NamedDecl *>() = readDeclAs<NamedDecl>(); |
609 | | |
610 | 515k | if (E->hasTemplateKWAndArgsInfo()) |
611 | 5.77k | ReadTemplateKWAndArgsInfo( |
612 | 5.77k | *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(), |
613 | 5.77k | E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs); |
614 | | |
615 | 515k | E->D = readDeclAs<ValueDecl>(); |
616 | 515k | E->setLocation(readSourceLocation()); |
617 | 515k | E->DNLoc = Record.readDeclarationNameLoc(E->getDecl()->getDeclName()); |
618 | 515k | } |
619 | | |
620 | 165k | void ASTStmtReader::VisitIntegerLiteral(IntegerLiteral *E) { |
621 | 165k | VisitExpr(E); |
622 | 165k | E->setLocation(readSourceLocation()); |
623 | 165k | E->setValue(Record.getContext(), Record.readAPInt()); |
624 | 165k | } |
625 | | |
626 | 56 | void ASTStmtReader::VisitFixedPointLiteral(FixedPointLiteral *E) { |
627 | 56 | VisitExpr(E); |
628 | 56 | E->setLocation(readSourceLocation()); |
629 | 56 | E->setScale(Record.readInt()); |
630 | 56 | E->setValue(Record.getContext(), Record.readAPInt()); |
631 | 56 | } |
632 | | |
633 | 1.61k | void ASTStmtReader::VisitFloatingLiteral(FloatingLiteral *E) { |
634 | 1.61k | VisitExpr(E); |
635 | 1.61k | E->setRawSemantics( |
636 | 1.61k | static_cast<llvm::APFloatBase::Semantics>(Record.readInt())); |
637 | 1.61k | E->setExact(Record.readInt()); |
638 | 1.61k | E->setValue(Record.getContext(), Record.readAPFloat(E->getSemantics())); |
639 | 1.61k | E->setLocation(readSourceLocation()); |
640 | 1.61k | } |
641 | | |
642 | 5 | void ASTStmtReader::VisitImaginaryLiteral(ImaginaryLiteral *E) { |
643 | 5 | VisitExpr(E); |
644 | 5 | E->setSubExpr(Record.readSubExpr()); |
645 | 5 | } |
646 | | |
647 | 3.03k | void ASTStmtReader::VisitStringLiteral(StringLiteral *E) { |
648 | 3.03k | VisitExpr(E); |
649 | | |
650 | | // NumConcatenated, Length and CharByteWidth are set by the empty |
651 | | // ctor since they are needed to allocate storage for the trailing objects. |
652 | 3.03k | unsigned NumConcatenated = Record.readInt(); |
653 | 3.03k | unsigned Length = Record.readInt(); |
654 | 3.03k | unsigned CharByteWidth = Record.readInt(); |
655 | 3.03k | assert((NumConcatenated == E->getNumConcatenated()) && |
656 | 3.03k | "Wrong number of concatenated tokens!"); |
657 | 3.03k | assert((Length == E->getLength()) && "Wrong Length!"); |
658 | 3.03k | assert((CharByteWidth == E->getCharByteWidth()) && "Wrong character width!"); |
659 | 3.03k | E->StringLiteralBits.Kind = Record.readInt(); |
660 | 3.03k | E->StringLiteralBits.IsPascal = Record.readInt(); |
661 | | |
662 | | // The character width is originally computed via mapCharByteWidth. |
663 | | // Check that the deserialized character width is consistant with the result |
664 | | // of calling mapCharByteWidth. |
665 | 3.03k | assert((CharByteWidth == |
666 | 3.03k | StringLiteral::mapCharByteWidth(Record.getContext().getTargetInfo(), |
667 | 3.03k | E->getKind())) && |
668 | 3.03k | "Wrong character width!"); |
669 | | |
670 | | // Deserialize the trailing array of SourceLocation. |
671 | 6.63k | for (unsigned I = 0; 3.03k I < NumConcatenated; ++I3.60k ) |
672 | 3.60k | E->setStrTokenLoc(I, readSourceLocation()); |
673 | | |
674 | | // Deserialize the trailing array of char holding the string data. |
675 | 3.03k | char *StrData = E->getStrDataAsChar(); |
676 | 176k | for (unsigned I = 0; I < Length * CharByteWidth; ++I173k ) |
677 | 173k | StrData[I] = Record.readInt(); |
678 | 3.03k | } |
679 | | |
680 | 741 | void ASTStmtReader::VisitCharacterLiteral(CharacterLiteral *E) { |
681 | 741 | VisitExpr(E); |
682 | 741 | E->setValue(Record.readInt()); |
683 | 741 | E->setLocation(readSourceLocation()); |
684 | 741 | E->setKind(static_cast<CharacterLiteral::CharacterKind>(Record.readInt())); |
685 | 741 | } |
686 | | |
687 | 49.4k | void ASTStmtReader::VisitParenExpr(ParenExpr *E) { |
688 | 49.4k | VisitExpr(E); |
689 | 49.4k | E->setLParen(readSourceLocation()); |
690 | 49.4k | E->setRParen(readSourceLocation()); |
691 | 49.4k | E->setSubExpr(Record.readSubExpr()); |
692 | 49.4k | } |
693 | | |
694 | 10.8k | void ASTStmtReader::VisitParenListExpr(ParenListExpr *E) { |
695 | 10.8k | VisitExpr(E); |
696 | 10.8k | unsigned NumExprs = Record.readInt(); |
697 | 10.8k | assert((NumExprs == E->getNumExprs()) && "Wrong NumExprs!"); |
698 | 26.8k | for (unsigned I = 0; 10.8k I != NumExprs; ++I16.0k ) |
699 | 16.0k | E->getTrailingObjects<Stmt *>()[I] = Record.readSubStmt(); |
700 | 10.8k | E->LParenLoc = readSourceLocation(); |
701 | 10.8k | E->RParenLoc = readSourceLocation(); |
702 | 10.8k | } |
703 | | |
704 | 66.2k | void ASTStmtReader::VisitUnaryOperator(UnaryOperator *E) { |
705 | 66.2k | VisitExpr(E); |
706 | 66.2k | bool hasFP_Features = Record.readInt(); |
707 | 66.2k | assert(hasFP_Features == E->hasStoredFPFeatures()); |
708 | 66.2k | E->setSubExpr(Record.readSubExpr()); |
709 | 66.2k | E->setOpcode((UnaryOperator::Opcode)Record.readInt()); |
710 | 66.2k | E->setOperatorLoc(readSourceLocation()); |
711 | 66.2k | E->setCanOverflow(Record.readInt()); |
712 | 66.2k | if (hasFP_Features) |
713 | 0 | E->setStoredFPFeatures( |
714 | 0 | FPOptionsOverride::getFromOpaqueInt(Record.readInt())); |
715 | 66.2k | } |
716 | | |
717 | 15 | void ASTStmtReader::VisitOffsetOfExpr(OffsetOfExpr *E) { |
718 | 15 | VisitExpr(E); |
719 | 15 | assert(E->getNumComponents() == Record.peekInt()); |
720 | 15 | Record.skipInts(1); |
721 | 15 | assert(E->getNumExpressions() == Record.peekInt()); |
722 | 15 | Record.skipInts(1); |
723 | 15 | E->setOperatorLoc(readSourceLocation()); |
724 | 15 | E->setRParenLoc(readSourceLocation()); |
725 | 15 | E->setTypeSourceInfo(readTypeSourceInfo()); |
726 | 35 | for (unsigned I = 0, N = E->getNumComponents(); I != N; ++I20 ) { |
727 | 20 | auto Kind = static_cast<OffsetOfNode::Kind>(Record.readInt()); |
728 | 20 | SourceLocation Start = readSourceLocation(); |
729 | 20 | SourceLocation End = readSourceLocation(); |
730 | 20 | switch (Kind) { |
731 | 2 | case OffsetOfNode::Array: |
732 | 2 | E->setComponent(I, OffsetOfNode(Start, Record.readInt(), End)); |
733 | 2 | break; |
734 | | |
735 | 5 | case OffsetOfNode::Field: |
736 | 5 | E->setComponent( |
737 | 5 | I, OffsetOfNode(Start, readDeclAs<FieldDecl>(), End)); |
738 | 5 | break; |
739 | | |
740 | 13 | case OffsetOfNode::Identifier: |
741 | 13 | E->setComponent( |
742 | 13 | I, |
743 | 13 | OffsetOfNode(Start, Record.readIdentifier(), End)); |
744 | 13 | break; |
745 | | |
746 | 0 | case OffsetOfNode::Base: { |
747 | 0 | auto *Base = new (Record.getContext()) CXXBaseSpecifier(); |
748 | 0 | *Base = Record.readCXXBaseSpecifier(); |
749 | 0 | E->setComponent(I, OffsetOfNode(Base)); |
750 | 0 | break; |
751 | 0 | } |
752 | 20 | } |
753 | 20 | } |
754 | | |
755 | 17 | for (unsigned I = 0, N = E->getNumExpressions(); 15 I != N; ++I2 ) |
756 | 2 | E->setIndexExpr(I, Record.readSubExpr()); |
757 | 15 | } |
758 | | |
759 | 1.67k | void ASTStmtReader::VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *E) { |
760 | 1.67k | VisitExpr(E); |
761 | 1.67k | E->setKind(static_cast<UnaryExprOrTypeTrait>(Record.readInt())); |
762 | 1.67k | if (Record.peekInt() == 0) { |
763 | 181 | E->setArgument(Record.readSubExpr()); |
764 | 181 | Record.skipInts(1); |
765 | 1.49k | } else { |
766 | 1.49k | E->setArgument(readTypeSourceInfo()); |
767 | 1.49k | } |
768 | 1.67k | E->setOperatorLoc(readSourceLocation()); |
769 | 1.67k | E->setRParenLoc(readSourceLocation()); |
770 | 1.67k | } |
771 | | |
772 | | static ConstraintSatisfaction |
773 | 6 | readConstraintSatisfaction(ASTRecordReader &Record) { |
774 | 6 | ConstraintSatisfaction Satisfaction; |
775 | 6 | Satisfaction.IsSatisfied = Record.readInt(); |
776 | 6 | Satisfaction.ContainsErrors = Record.readInt(); |
777 | 6 | if (!Satisfaction.IsSatisfied) { |
778 | 0 | unsigned NumDetailRecords = Record.readInt(); |
779 | 0 | for (unsigned i = 0; i != NumDetailRecords; ++i) { |
780 | 0 | Expr *ConstraintExpr = Record.readExpr(); |
781 | 0 | if (/* IsDiagnostic */Record.readInt()) { |
782 | 0 | SourceLocation DiagLocation = Record.readSourceLocation(); |
783 | 0 | std::string DiagMessage = Record.readString(); |
784 | 0 | Satisfaction.Details.emplace_back( |
785 | 0 | ConstraintExpr, new (Record.getContext()) |
786 | 0 | ConstraintSatisfaction::SubstitutionDiagnostic{ |
787 | 0 | DiagLocation, DiagMessage}); |
788 | 0 | } else |
789 | 0 | Satisfaction.Details.emplace_back(ConstraintExpr, Record.readExpr()); |
790 | 0 | } |
791 | 0 | } |
792 | 6 | return Satisfaction; |
793 | 6 | } |
794 | | |
795 | | void ASTStmtReader::VisitConceptSpecializationExpr( |
796 | 78 | ConceptSpecializationExpr *E) { |
797 | 78 | VisitExpr(E); |
798 | 78 | E->SpecDecl = Record.readDeclAs<ImplicitConceptSpecializationDecl>(); |
799 | 78 | if (Record.readBool()) |
800 | 78 | E->ConceptRef = Record.readConceptReference(); |
801 | 78 | E->Satisfaction = E->isValueDependent() ? nullptr72 : |
802 | 78 | ASTConstraintSatisfaction::Create(Record.getContext(), |
803 | 6 | readConstraintSatisfaction(Record)); |
804 | 78 | } |
805 | | |
806 | | static concepts::Requirement::SubstitutionDiagnostic * |
807 | 0 | readSubstitutionDiagnostic(ASTRecordReader &Record) { |
808 | 0 | std::string SubstitutedEntity = Record.readString(); |
809 | 0 | SourceLocation DiagLoc = Record.readSourceLocation(); |
810 | 0 | std::string DiagMessage = Record.readString(); |
811 | 0 | return new (Record.getContext()) |
812 | 0 | concepts::Requirement::SubstitutionDiagnostic{SubstitutedEntity, DiagLoc, |
813 | 0 | DiagMessage}; |
814 | 0 | } |
815 | | |
816 | 29 | void ASTStmtReader::VisitRequiresExpr(RequiresExpr *E) { |
817 | 29 | VisitExpr(E); |
818 | 29 | unsigned NumLocalParameters = Record.readInt(); |
819 | 29 | unsigned NumRequirements = Record.readInt(); |
820 | 29 | E->RequiresExprBits.RequiresKWLoc = Record.readSourceLocation(); |
821 | 29 | E->RequiresExprBits.IsSatisfied = Record.readInt(); |
822 | 29 | E->Body = Record.readDeclAs<RequiresExprBodyDecl>(); |
823 | 29 | llvm::SmallVector<ParmVarDecl *, 4> LocalParameters; |
824 | 51 | for (unsigned i = 0; i < NumLocalParameters; ++i22 ) |
825 | 22 | LocalParameters.push_back(cast<ParmVarDecl>(Record.readDecl())); |
826 | 29 | std::copy(LocalParameters.begin(), LocalParameters.end(), |
827 | 29 | E->getTrailingObjects<ParmVarDecl *>()); |
828 | 29 | llvm::SmallVector<concepts::Requirement *, 4> Requirements; |
829 | 68 | for (unsigned i = 0; i < NumRequirements; ++i39 ) { |
830 | 39 | auto RK = |
831 | 39 | static_cast<concepts::Requirement::RequirementKind>(Record.readInt()); |
832 | 39 | concepts::Requirement *R = nullptr; |
833 | 39 | switch (RK) { |
834 | 6 | case concepts::Requirement::RK_Type: { |
835 | 6 | auto Status = |
836 | 6 | static_cast<concepts::TypeRequirement::SatisfactionStatus>( |
837 | 6 | Record.readInt()); |
838 | 6 | if (Status == concepts::TypeRequirement::SS_SubstitutionFailure) |
839 | 0 | R = new (Record.getContext()) |
840 | 0 | concepts::TypeRequirement(readSubstitutionDiagnostic(Record)); |
841 | 6 | else |
842 | 6 | R = new (Record.getContext()) |
843 | 6 | concepts::TypeRequirement(Record.readTypeSourceInfo()); |
844 | 6 | } break; |
845 | 24 | case concepts::Requirement::RK_Simple: |
846 | 29 | case concepts::Requirement::RK_Compound: { |
847 | 29 | auto Status = |
848 | 29 | static_cast<concepts::ExprRequirement::SatisfactionStatus>( |
849 | 29 | Record.readInt()); |
850 | 29 | llvm::PointerUnion<concepts::Requirement::SubstitutionDiagnostic *, |
851 | 29 | Expr *> E; |
852 | 29 | if (Status == concepts::ExprRequirement::SS_ExprSubstitutionFailure) { |
853 | 0 | E = readSubstitutionDiagnostic(Record); |
854 | 0 | } else |
855 | 29 | E = Record.readExpr(); |
856 | | |
857 | 29 | std::optional<concepts::ExprRequirement::ReturnTypeRequirement> Req; |
858 | 29 | ConceptSpecializationExpr *SubstitutedConstraintExpr = nullptr; |
859 | 29 | SourceLocation NoexceptLoc; |
860 | 29 | if (RK == concepts::Requirement::RK_Simple) { |
861 | 24 | Req.emplace(); |
862 | 24 | } else { |
863 | 5 | NoexceptLoc = Record.readSourceLocation(); |
864 | 5 | switch (/* returnTypeRequirementKind */Record.readInt()) { |
865 | 0 | case 0: |
866 | | // No return type requirement. |
867 | 0 | Req.emplace(); |
868 | 0 | break; |
869 | 5 | case 1: { |
870 | | // type-constraint |
871 | 5 | TemplateParameterList *TPL = Record.readTemplateParameterList(); |
872 | 5 | if (Status >= |
873 | 5 | concepts::ExprRequirement::SS_ConstraintsNotSatisfied) |
874 | 0 | SubstitutedConstraintExpr = |
875 | 0 | cast<ConceptSpecializationExpr>(Record.readExpr()); |
876 | 5 | Req.emplace(TPL); |
877 | 5 | } break; |
878 | 0 | case 2: |
879 | | // Substitution failure |
880 | 0 | Req.emplace(readSubstitutionDiagnostic(Record)); |
881 | 0 | break; |
882 | 5 | } |
883 | 5 | } |
884 | 29 | if (Expr *Ex = E.dyn_cast<Expr *>()) |
885 | 29 | R = new (Record.getContext()) concepts::ExprRequirement( |
886 | 29 | Ex, RK == concepts::Requirement::RK_Simple, NoexceptLoc, |
887 | 29 | std::move(*Req), Status, SubstitutedConstraintExpr); |
888 | 0 | else |
889 | 0 | R = new (Record.getContext()) concepts::ExprRequirement( |
890 | 0 | E.get<concepts::Requirement::SubstitutionDiagnostic *>(), |
891 | 0 | RK == concepts::Requirement::RK_Simple, NoexceptLoc, |
892 | 0 | std::move(*Req)); |
893 | 29 | } break; |
894 | 4 | case concepts::Requirement::RK_Nested: { |
895 | 4 | bool HasInvalidConstraint = Record.readInt(); |
896 | 4 | if (HasInvalidConstraint) { |
897 | 0 | std::string InvalidConstraint = Record.readString(); |
898 | 0 | char *InvalidConstraintBuf = |
899 | 0 | new (Record.getContext()) char[InvalidConstraint.size()]; |
900 | 0 | std::copy(InvalidConstraint.begin(), InvalidConstraint.end(), |
901 | 0 | InvalidConstraintBuf); |
902 | 0 | R = new (Record.getContext()) concepts::NestedRequirement( |
903 | 0 | Record.getContext(), |
904 | 0 | StringRef(InvalidConstraintBuf, InvalidConstraint.size()), |
905 | 0 | readConstraintSatisfaction(Record)); |
906 | 0 | break; |
907 | 0 | } |
908 | 4 | Expr *E = Record.readExpr(); |
909 | 4 | if (E->isInstantiationDependent()) |
910 | 4 | R = new (Record.getContext()) concepts::NestedRequirement(E); |
911 | 0 | else |
912 | 0 | R = new (Record.getContext()) |
913 | 0 | concepts::NestedRequirement(Record.getContext(), E, |
914 | 0 | readConstraintSatisfaction(Record)); |
915 | 4 | } break; |
916 | 39 | } |
917 | 39 | if (!R) |
918 | 0 | continue; |
919 | 39 | Requirements.push_back(R); |
920 | 39 | } |
921 | 29 | std::copy(Requirements.begin(), Requirements.end(), |
922 | 29 | E->getTrailingObjects<concepts::Requirement *>()); |
923 | 29 | E->LParenLoc = Record.readSourceLocation(); |
924 | 29 | E->RParenLoc = Record.readSourceLocation(); |
925 | 29 | E->RBraceLoc = Record.readSourceLocation(); |
926 | 29 | } |
927 | | |
928 | 10.4k | void ASTStmtReader::VisitArraySubscriptExpr(ArraySubscriptExpr *E) { |
929 | 10.4k | VisitExpr(E); |
930 | 10.4k | E->setLHS(Record.readSubExpr()); |
931 | 10.4k | E->setRHS(Record.readSubExpr()); |
932 | 10.4k | E->setRBracketLoc(readSourceLocation()); |
933 | 10.4k | } |
934 | | |
935 | 0 | void ASTStmtReader::VisitMatrixSubscriptExpr(MatrixSubscriptExpr *E) { |
936 | 0 | VisitExpr(E); |
937 | 0 | E->setBase(Record.readSubExpr()); |
938 | 0 | E->setRowIdx(Record.readSubExpr()); |
939 | 0 | E->setColumnIdx(Record.readSubExpr()); |
940 | 0 | E->setRBracketLoc(readSourceLocation()); |
941 | 0 | } |
942 | | |
943 | 2.65k | void ASTStmtReader::VisitOMPArraySectionExpr(OMPArraySectionExpr *E) { |
944 | 2.65k | VisitExpr(E); |
945 | 2.65k | E->setBase(Record.readSubExpr()); |
946 | 2.65k | E->setLowerBound(Record.readSubExpr()); |
947 | 2.65k | E->setLength(Record.readSubExpr()); |
948 | 2.65k | E->setStride(Record.readSubExpr()); |
949 | 2.65k | E->setColonLocFirst(readSourceLocation()); |
950 | 2.65k | E->setColonLocSecond(readSourceLocation()); |
951 | 2.65k | E->setRBracketLoc(readSourceLocation()); |
952 | 2.65k | } |
953 | | |
954 | 44 | void ASTStmtReader::VisitOMPArrayShapingExpr(OMPArrayShapingExpr *E) { |
955 | 44 | VisitExpr(E); |
956 | 44 | unsigned NumDims = Record.readInt(); |
957 | 44 | E->setBase(Record.readSubExpr()); |
958 | 44 | SmallVector<Expr *, 4> Dims(NumDims); |
959 | 152 | for (unsigned I = 0; I < NumDims; ++I108 ) |
960 | 108 | Dims[I] = Record.readSubExpr(); |
961 | 44 | E->setDimensions(Dims); |
962 | 44 | SmallVector<SourceRange, 4> SRs(NumDims); |
963 | 152 | for (unsigned I = 0; I < NumDims; ++I108 ) |
964 | 108 | SRs[I] = readSourceRange(); |
965 | 44 | E->setBracketsRanges(SRs); |
966 | 44 | E->setLParenLoc(readSourceLocation()); |
967 | 44 | E->setRParenLoc(readSourceLocation()); |
968 | 44 | } |
969 | | |
970 | 26 | void ASTStmtReader::VisitOMPIteratorExpr(OMPIteratorExpr *E) { |
971 | 26 | VisitExpr(E); |
972 | 26 | unsigned NumIters = Record.readInt(); |
973 | 26 | E->setIteratorKwLoc(readSourceLocation()); |
974 | 26 | E->setLParenLoc(readSourceLocation()); |
975 | 26 | E->setRParenLoc(readSourceLocation()); |
976 | 58 | for (unsigned I = 0; I < NumIters; ++I32 ) { |
977 | 32 | E->setIteratorDeclaration(I, Record.readDeclRef()); |
978 | 32 | E->setAssignmentLoc(I, readSourceLocation()); |
979 | 32 | Expr *Begin = Record.readSubExpr(); |
980 | 32 | Expr *End = Record.readSubExpr(); |
981 | 32 | Expr *Step = Record.readSubExpr(); |
982 | 32 | SourceLocation ColonLoc = readSourceLocation(); |
983 | 32 | SourceLocation SecColonLoc; |
984 | 32 | if (Step) |
985 | 20 | SecColonLoc = readSourceLocation(); |
986 | 32 | E->setIteratorRange(I, Begin, ColonLoc, End, SecColonLoc, Step); |
987 | | // Deserialize helpers |
988 | 32 | OMPIteratorHelperData HD; |
989 | 32 | HD.CounterVD = cast_or_null<VarDecl>(Record.readDeclRef()); |
990 | 32 | HD.Upper = Record.readSubExpr(); |
991 | 32 | HD.Update = Record.readSubExpr(); |
992 | 32 | HD.CounterUpdate = Record.readSubExpr(); |
993 | 32 | E->setHelper(I, HD); |
994 | 32 | } |
995 | 26 | } |
996 | | |
997 | 132k | void ASTStmtReader::VisitCallExpr(CallExpr *E) { |
998 | 132k | VisitExpr(E); |
999 | 132k | unsigned NumArgs = Record.readInt(); |
1000 | 132k | bool HasFPFeatures = Record.readInt(); |
1001 | 132k | assert((NumArgs == E->getNumArgs()) && "Wrong NumArgs!"); |
1002 | 132k | E->setRParenLoc(readSourceLocation()); |
1003 | 132k | E->setCallee(Record.readSubExpr()); |
1004 | 275k | for (unsigned I = 0; I != NumArgs; ++I142k ) |
1005 | 142k | E->setArg(I, Record.readSubExpr()); |
1006 | 132k | E->setADLCallKind(static_cast<CallExpr::ADLCallKind>(Record.readInt())); |
1007 | 132k | if (HasFPFeatures) |
1008 | 3 | E->setStoredFPFeatures( |
1009 | 3 | FPOptionsOverride::getFromOpaqueInt(Record.readInt())); |
1010 | 132k | } |
1011 | | |
1012 | 4.24k | void ASTStmtReader::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) { |
1013 | 4.24k | VisitCallExpr(E); |
1014 | 4.24k | } |
1015 | | |
1016 | 44.3k | void ASTStmtReader::VisitMemberExpr(MemberExpr *E) { |
1017 | 44.3k | VisitExpr(E); |
1018 | | |
1019 | 44.3k | bool HasQualifier = Record.readInt(); |
1020 | 44.3k | bool HasFoundDecl = Record.readInt(); |
1021 | 44.3k | bool HasTemplateInfo = Record.readInt(); |
1022 | 44.3k | unsigned NumTemplateArgs = Record.readInt(); |
1023 | | |
1024 | 44.3k | E->Base = Record.readSubExpr(); |
1025 | 44.3k | E->MemberDecl = Record.readDeclAs<ValueDecl>(); |
1026 | 44.3k | E->MemberDNLoc = Record.readDeclarationNameLoc(E->MemberDecl->getDeclName()); |
1027 | 44.3k | E->MemberLoc = Record.readSourceLocation(); |
1028 | 44.3k | E->MemberExprBits.IsArrow = Record.readInt(); |
1029 | 44.3k | E->MemberExprBits.HasQualifierOrFoundDecl = HasQualifier || HasFoundDecl44.1k ; |
1030 | 44.3k | E->MemberExprBits.HasTemplateKWAndArgsInfo = HasTemplateInfo; |
1031 | 44.3k | E->MemberExprBits.HadMultipleCandidates = Record.readInt(); |
1032 | 44.3k | E->MemberExprBits.NonOdrUseReason = Record.readInt(); |
1033 | 44.3k | E->MemberExprBits.OperatorLoc = Record.readSourceLocation(); |
1034 | | |
1035 | 44.3k | if (HasQualifier || HasFoundDecl44.1k ) { |
1036 | 809 | DeclAccessPair FoundDecl; |
1037 | 809 | if (HasFoundDecl) { |
1038 | 533 | auto *FoundD = Record.readDeclAs<NamedDecl>(); |
1039 | 533 | auto AS = (AccessSpecifier)Record.readInt(); |
1040 | 533 | FoundDecl = DeclAccessPair::make(FoundD, AS); |
1041 | 533 | } else { |
1042 | 276 | FoundDecl = DeclAccessPair::make(E->MemberDecl, |
1043 | 276 | E->MemberDecl->getAccess()); |
1044 | 276 | } |
1045 | 809 | E->getTrailingObjects<MemberExprNameQualifier>()->FoundDecl = FoundDecl; |
1046 | | |
1047 | 809 | NestedNameSpecifierLoc QualifierLoc; |
1048 | 809 | if (HasQualifier) |
1049 | 276 | QualifierLoc = Record.readNestedNameSpecifierLoc(); |
1050 | 809 | E->getTrailingObjects<MemberExprNameQualifier>()->QualifierLoc = |
1051 | 809 | QualifierLoc; |
1052 | 809 | } |
1053 | | |
1054 | 44.3k | if (HasTemplateInfo) |
1055 | 40 | ReadTemplateKWAndArgsInfo( |
1056 | 40 | *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(), |
1057 | 40 | E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs); |
1058 | 44.3k | } |
1059 | | |
1060 | 0 | void ASTStmtReader::VisitObjCIsaExpr(ObjCIsaExpr *E) { |
1061 | 0 | VisitExpr(E); |
1062 | 0 | E->setBase(Record.readSubExpr()); |
1063 | 0 | E->setIsaMemberLoc(readSourceLocation()); |
1064 | 0 | E->setOpLoc(readSourceLocation()); |
1065 | 0 | E->setArrow(Record.readInt()); |
1066 | 0 | } |
1067 | | |
1068 | | void ASTStmtReader:: |
1069 | 0 | VisitObjCIndirectCopyRestoreExpr(ObjCIndirectCopyRestoreExpr *E) { |
1070 | 0 | VisitExpr(E); |
1071 | 0 | E->Operand = Record.readSubExpr(); |
1072 | 0 | E->setShouldCopy(Record.readInt()); |
1073 | 0 | } |
1074 | | |
1075 | 2 | void ASTStmtReader::VisitObjCBridgedCastExpr(ObjCBridgedCastExpr *E) { |
1076 | 2 | VisitExplicitCastExpr(E); |
1077 | 2 | E->LParenLoc = readSourceLocation(); |
1078 | 2 | E->BridgeKeywordLoc = readSourceLocation(); |
1079 | 2 | E->Kind = Record.readInt(); |
1080 | 2 | } |
1081 | | |
1082 | 341k | void ASTStmtReader::VisitCastExpr(CastExpr *E) { |
1083 | 341k | VisitExpr(E); |
1084 | 341k | unsigned NumBaseSpecs = Record.readInt(); |
1085 | 341k | assert(NumBaseSpecs == E->path_size()); |
1086 | 341k | unsigned HasFPFeatures = Record.readInt(); |
1087 | 341k | assert(E->hasStoredFPFeatures() == HasFPFeatures); |
1088 | 341k | E->setSubExpr(Record.readSubExpr()); |
1089 | 341k | E->setCastKind((CastKind)Record.readInt()); |
1090 | 341k | CastExpr::path_iterator BaseI = E->path_begin(); |
1091 | 343k | while (NumBaseSpecs--) { |
1092 | 1.45k | auto *BaseSpec = new (Record.getContext()) CXXBaseSpecifier; |
1093 | 1.45k | *BaseSpec = Record.readCXXBaseSpecifier(); |
1094 | 1.45k | *BaseI++ = BaseSpec; |
1095 | 1.45k | } |
1096 | 341k | if (HasFPFeatures) |
1097 | 42 | *E->getTrailingFPFeatures() = |
1098 | 42 | FPOptionsOverride::getFromOpaqueInt(Record.readInt()); |
1099 | 341k | } |
1100 | | |
1101 | 292k | void ASTStmtReader::VisitBinaryOperator(BinaryOperator *E) { |
1102 | 292k | bool hasFP_Features; |
1103 | 292k | VisitExpr(E); |
1104 | 292k | E->setHasStoredFPFeatures(hasFP_Features = Record.readInt()); |
1105 | 292k | E->setOpcode((BinaryOperator::Opcode)Record.readInt()); |
1106 | 292k | E->setLHS(Record.readSubExpr()); |
1107 | 292k | E->setRHS(Record.readSubExpr()); |
1108 | 292k | E->setOperatorLoc(readSourceLocation()); |
1109 | 292k | if (hasFP_Features) |
1110 | 14 | E->setStoredFPFeatures( |
1111 | 14 | FPOptionsOverride::getFromOpaqueInt(Record.readInt())); |
1112 | 292k | } |
1113 | | |
1114 | 11.7k | void ASTStmtReader::VisitCompoundAssignOperator(CompoundAssignOperator *E) { |
1115 | 11.7k | VisitBinaryOperator(E); |
1116 | 11.7k | E->setComputationLHSType(Record.readType()); |
1117 | 11.7k | E->setComputationResultType(Record.readType()); |
1118 | 11.7k | } |
1119 | | |
1120 | 11.6k | void ASTStmtReader::VisitConditionalOperator(ConditionalOperator *E) { |
1121 | 11.6k | VisitExpr(E); |
1122 | 11.6k | E->SubExprs[ConditionalOperator::COND] = Record.readSubExpr(); |
1123 | 11.6k | E->SubExprs[ConditionalOperator::LHS] = Record.readSubExpr(); |
1124 | 11.6k | E->SubExprs[ConditionalOperator::RHS] = Record.readSubExpr(); |
1125 | 11.6k | E->QuestionLoc = readSourceLocation(); |
1126 | 11.6k | E->ColonLoc = readSourceLocation(); |
1127 | 11.6k | } |
1128 | | |
1129 | | void |
1130 | 3 | ASTStmtReader::VisitBinaryConditionalOperator(BinaryConditionalOperator *E) { |
1131 | 3 | VisitExpr(E); |
1132 | 3 | E->OpaqueValue = cast<OpaqueValueExpr>(Record.readSubExpr()); |
1133 | 3 | E->SubExprs[BinaryConditionalOperator::COMMON] = Record.readSubExpr(); |
1134 | 3 | E->SubExprs[BinaryConditionalOperator::COND] = Record.readSubExpr(); |
1135 | 3 | E->SubExprs[BinaryConditionalOperator::LHS] = Record.readSubExpr(); |
1136 | 3 | E->SubExprs[BinaryConditionalOperator::RHS] = Record.readSubExpr(); |
1137 | 3 | E->QuestionLoc = readSourceLocation(); |
1138 | 3 | E->ColonLoc = readSourceLocation(); |
1139 | 3 | } |
1140 | | |
1141 | 331k | void ASTStmtReader::VisitImplicitCastExpr(ImplicitCastExpr *E) { |
1142 | 331k | VisitCastExpr(E); |
1143 | 331k | E->setIsPartOfExplicitCast(Record.readInt()); |
1144 | 331k | } |
1145 | | |
1146 | 10.4k | void ASTStmtReader::VisitExplicitCastExpr(ExplicitCastExpr *E) { |
1147 | 10.4k | VisitCastExpr(E); |
1148 | 10.4k | E->setTypeInfoAsWritten(readTypeSourceInfo()); |
1149 | 10.4k | } |
1150 | | |
1151 | 5.70k | void ASTStmtReader::VisitCStyleCastExpr(CStyleCastExpr *E) { |
1152 | 5.70k | VisitExplicitCastExpr(E); |
1153 | 5.70k | E->setLParenLoc(readSourceLocation()); |
1154 | 5.70k | E->setRParenLoc(readSourceLocation()); |
1155 | 5.70k | } |
1156 | | |
1157 | 9 | void ASTStmtReader::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) { |
1158 | 9 | VisitExpr(E); |
1159 | 9 | E->setLParenLoc(readSourceLocation()); |
1160 | 9 | E->setTypeSourceInfo(readTypeSourceInfo()); |
1161 | 9 | E->setInitializer(Record.readSubExpr()); |
1162 | 9 | E->setFileScope(Record.readInt()); |
1163 | 9 | } |
1164 | | |
1165 | 21 | void ASTStmtReader::VisitExtVectorElementExpr(ExtVectorElementExpr *E) { |
1166 | 21 | VisitExpr(E); |
1167 | 21 | E->setBase(Record.readSubExpr()); |
1168 | 21 | E->setAccessor(Record.readIdentifier()); |
1169 | 21 | E->setAccessorLoc(readSourceLocation()); |
1170 | 21 | } |
1171 | | |
1172 | 2.84k | void ASTStmtReader::VisitInitListExpr(InitListExpr *E) { |
1173 | 2.84k | VisitExpr(E); |
1174 | 2.84k | if (auto *SyntForm = cast_or_null<InitListExpr>(Record.readSubStmt())) |
1175 | 1.08k | E->setSyntacticForm(SyntForm); |
1176 | 2.84k | E->setLBraceLoc(readSourceLocation()); |
1177 | 2.84k | E->setRBraceLoc(readSourceLocation()); |
1178 | 2.84k | bool isArrayFiller = Record.readInt(); |
1179 | 2.84k | Expr *filler = nullptr; |
1180 | 2.84k | if (isArrayFiller) { |
1181 | 2.80k | filler = Record.readSubExpr(); |
1182 | 2.80k | E->ArrayFillerOrUnionFieldInit = filler; |
1183 | 2.80k | } else |
1184 | 43 | E->ArrayFillerOrUnionFieldInit = readDeclAs<FieldDecl>(); |
1185 | 2.84k | E->sawArrayRangeDesignator(Record.readInt()); |
1186 | 2.84k | unsigned NumInits = Record.readInt(); |
1187 | 2.84k | E->reserveInits(Record.getContext(), NumInits); |
1188 | 2.84k | if (isArrayFiller) { |
1189 | 8.03k | for (unsigned I = 0; I != NumInits; ++I5.22k ) { |
1190 | 5.22k | Expr *init = Record.readSubExpr(); |
1191 | 5.22k | E->updateInit(Record.getContext(), I, init ? init5.22k : filler2 ); |
1192 | 5.22k | } |
1193 | 2.80k | } else { |
1194 | 81 | for (unsigned I = 0; I != NumInits; ++I38 ) |
1195 | 38 | E->updateInit(Record.getContext(), I, Record.readSubExpr()); |
1196 | 43 | } |
1197 | 2.84k | } |
1198 | | |
1199 | 52 | void ASTStmtReader::VisitDesignatedInitExpr(DesignatedInitExpr *E) { |
1200 | 52 | using Designator = DesignatedInitExpr::Designator; |
1201 | | |
1202 | 52 | VisitExpr(E); |
1203 | 52 | unsigned NumSubExprs = Record.readInt(); |
1204 | 52 | assert(NumSubExprs == E->getNumSubExprs() && "Wrong number of subexprs"); |
1205 | 109 | for (unsigned I = 0; 52 I != NumSubExprs; ++I57 ) |
1206 | 57 | E->setSubExpr(I, Record.readSubExpr()); |
1207 | 52 | E->setEqualOrColonLoc(readSourceLocation()); |
1208 | 52 | E->setGNUSyntax(Record.readInt()); |
1209 | | |
1210 | 52 | SmallVector<Designator, 4> Designators; |
1211 | 113 | while (Record.getIdx() < Record.size()) { |
1212 | 61 | switch ((DesignatorTypes)Record.readInt()) { |
1213 | 56 | case DESIG_FIELD_DECL: { |
1214 | 56 | auto *Field = readDeclAs<FieldDecl>(); |
1215 | 56 | SourceLocation DotLoc = readSourceLocation(); |
1216 | 56 | SourceLocation FieldLoc = readSourceLocation(); |
1217 | 56 | Designators.push_back(Designator::CreateFieldDesignator( |
1218 | 56 | Field->getIdentifier(), DotLoc, FieldLoc)); |
1219 | 56 | Designators.back().setFieldDecl(Field); |
1220 | 56 | break; |
1221 | 0 | } |
1222 | | |
1223 | 0 | case DESIG_FIELD_NAME: { |
1224 | 0 | const IdentifierInfo *Name = Record.readIdentifier(); |
1225 | 0 | SourceLocation DotLoc = readSourceLocation(); |
1226 | 0 | SourceLocation FieldLoc = readSourceLocation(); |
1227 | 0 | Designators.push_back(Designator::CreateFieldDesignator(Name, DotLoc, |
1228 | 0 | FieldLoc)); |
1229 | 0 | break; |
1230 | 0 | } |
1231 | | |
1232 | 5 | case DESIG_ARRAY: { |
1233 | 5 | unsigned Index = Record.readInt(); |
1234 | 5 | SourceLocation LBracketLoc = readSourceLocation(); |
1235 | 5 | SourceLocation RBracketLoc = readSourceLocation(); |
1236 | 5 | Designators.push_back(Designator::CreateArrayDesignator(Index, |
1237 | 5 | LBracketLoc, |
1238 | 5 | RBracketLoc)); |
1239 | 5 | break; |
1240 | 0 | } |
1241 | | |
1242 | 0 | case DESIG_ARRAY_RANGE: { |
1243 | 0 | unsigned Index = Record.readInt(); |
1244 | 0 | SourceLocation LBracketLoc = readSourceLocation(); |
1245 | 0 | SourceLocation EllipsisLoc = readSourceLocation(); |
1246 | 0 | SourceLocation RBracketLoc = readSourceLocation(); |
1247 | 0 | Designators.push_back(Designator::CreateArrayRangeDesignator( |
1248 | 0 | Index, LBracketLoc, EllipsisLoc, RBracketLoc)); |
1249 | 0 | break; |
1250 | 0 | } |
1251 | 61 | } |
1252 | 61 | } |
1253 | 52 | E->setDesignators(Record.getContext(), |
1254 | 52 | Designators.data(), Designators.size()); |
1255 | 52 | } |
1256 | | |
1257 | 1 | void ASTStmtReader::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) { |
1258 | 1 | VisitExpr(E); |
1259 | 1 | E->setBase(Record.readSubExpr()); |
1260 | 1 | E->setUpdater(Record.readSubExpr()); |
1261 | 1 | } |
1262 | | |
1263 | 1 | void ASTStmtReader::VisitNoInitExpr(NoInitExpr *E) { |
1264 | 1 | VisitExpr(E); |
1265 | 1 | } |
1266 | | |
1267 | 6 | void ASTStmtReader::VisitArrayInitLoopExpr(ArrayInitLoopExpr *E) { |
1268 | 6 | VisitExpr(E); |
1269 | 6 | E->SubExprs[0] = Record.readSubExpr(); |
1270 | 6 | E->SubExprs[1] = Record.readSubExpr(); |
1271 | 6 | } |
1272 | | |
1273 | 6 | void ASTStmtReader::VisitArrayInitIndexExpr(ArrayInitIndexExpr *E) { |
1274 | 6 | VisitExpr(E); |
1275 | 6 | } |
1276 | | |
1277 | 145 | void ASTStmtReader::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) { |
1278 | 145 | VisitExpr(E); |
1279 | 145 | } |
1280 | | |
1281 | 2 | void ASTStmtReader::VisitVAArgExpr(VAArgExpr *E) { |
1282 | 2 | VisitExpr(E); |
1283 | 2 | E->setSubExpr(Record.readSubExpr()); |
1284 | 2 | E->setWrittenTypeInfo(readTypeSourceInfo()); |
1285 | 2 | E->setBuiltinLoc(readSourceLocation()); |
1286 | 2 | E->setRParenLoc(readSourceLocation()); |
1287 | 2 | E->setIsMicrosoftABI(Record.readInt()); |
1288 | 2 | } |
1289 | | |
1290 | 0 | void ASTStmtReader::VisitSourceLocExpr(SourceLocExpr *E) { |
1291 | 0 | VisitExpr(E); |
1292 | 0 | E->ParentContext = readDeclAs<DeclContext>(); |
1293 | 0 | E->BuiltinLoc = readSourceLocation(); |
1294 | 0 | E->RParenLoc = readSourceLocation(); |
1295 | 0 | E->SourceLocExprBits.Kind = |
1296 | 0 | static_cast<SourceLocExpr::IdentKind>(Record.readInt()); |
1297 | 0 | } |
1298 | | |
1299 | 7 | void ASTStmtReader::VisitAddrLabelExpr(AddrLabelExpr *E) { |
1300 | 7 | VisitExpr(E); |
1301 | 7 | E->setAmpAmpLoc(readSourceLocation()); |
1302 | 7 | E->setLabelLoc(readSourceLocation()); |
1303 | 7 | E->setLabel(readDeclAs<LabelDecl>()); |
1304 | 7 | } |
1305 | | |
1306 | 24 | void ASTStmtReader::VisitStmtExpr(StmtExpr *E) { |
1307 | 24 | VisitExpr(E); |
1308 | 24 | E->setLParenLoc(readSourceLocation()); |
1309 | 24 | E->setRParenLoc(readSourceLocation()); |
1310 | 24 | E->setSubStmt(cast_or_null<CompoundStmt>(Record.readSubStmt())); |
1311 | 24 | E->StmtExprBits.TemplateDepth = Record.readInt(); |
1312 | 24 | } |
1313 | | |
1314 | 3 | void ASTStmtReader::VisitChooseExpr(ChooseExpr *E) { |
1315 | 3 | VisitExpr(E); |
1316 | 3 | E->setCond(Record.readSubExpr()); |
1317 | 3 | E->setLHS(Record.readSubExpr()); |
1318 | 3 | E->setRHS(Record.readSubExpr()); |
1319 | 3 | E->setBuiltinLoc(readSourceLocation()); |
1320 | 3 | E->setRParenLoc(readSourceLocation()); |
1321 | 3 | E->setIsConditionTrue(Record.readInt()); |
1322 | 3 | } |
1323 | | |
1324 | 0 | void ASTStmtReader::VisitGNUNullExpr(GNUNullExpr *E) { |
1325 | 0 | VisitExpr(E); |
1326 | 0 | E->setTokenLocation(readSourceLocation()); |
1327 | 0 | } |
1328 | | |
1329 | 2 | void ASTStmtReader::VisitShuffleVectorExpr(ShuffleVectorExpr *E) { |
1330 | 2 | VisitExpr(E); |
1331 | 2 | SmallVector<Expr *, 16> Exprs; |
1332 | 2 | unsigned NumExprs = Record.readInt(); |
1333 | 12 | while (NumExprs--) |
1334 | 10 | Exprs.push_back(Record.readSubExpr()); |
1335 | 2 | E->setExprs(Record.getContext(), Exprs); |
1336 | 2 | E->setBuiltinLoc(readSourceLocation()); |
1337 | 2 | E->setRParenLoc(readSourceLocation()); |
1338 | 2 | } |
1339 | | |
1340 | 0 | void ASTStmtReader::VisitConvertVectorExpr(ConvertVectorExpr *E) { |
1341 | 0 | VisitExpr(E); |
1342 | 0 | E->BuiltinLoc = readSourceLocation(); |
1343 | 0 | E->RParenLoc = readSourceLocation(); |
1344 | 0 | E->TInfo = readTypeSourceInfo(); |
1345 | 0 | E->SrcExpr = Record.readSubExpr(); |
1346 | 0 | } |
1347 | | |
1348 | 62 | void ASTStmtReader::VisitBlockExpr(BlockExpr *E) { |
1349 | 62 | VisitExpr(E); |
1350 | 62 | E->setBlockDecl(readDeclAs<BlockDecl>()); |
1351 | 62 | } |
1352 | | |
1353 | 9 | void ASTStmtReader::VisitGenericSelectionExpr(GenericSelectionExpr *E) { |
1354 | 9 | VisitExpr(E); |
1355 | | |
1356 | 9 | unsigned NumAssocs = Record.readInt(); |
1357 | 9 | assert(NumAssocs == E->getNumAssocs() && "Wrong NumAssocs!"); |
1358 | 9 | E->IsExprPredicate = Record.readInt(); |
1359 | 9 | E->ResultIndex = Record.readInt(); |
1360 | 9 | E->GenericSelectionExprBits.GenericLoc = readSourceLocation(); |
1361 | 9 | E->DefaultLoc = readSourceLocation(); |
1362 | 9 | E->RParenLoc = readSourceLocation(); |
1363 | | |
1364 | 9 | Stmt **Stmts = E->getTrailingObjects<Stmt *>(); |
1365 | | // Add 1 to account for the controlling expression which is the first |
1366 | | // expression in the trailing array of Stmt *. This is not needed for |
1367 | | // the trailing array of TypeSourceInfo *. |
1368 | 36 | for (unsigned I = 0, N = NumAssocs + 1; I < N; ++I27 ) |
1369 | 27 | Stmts[I] = Record.readSubExpr(); |
1370 | | |
1371 | 9 | TypeSourceInfo **TSIs = E->getTrailingObjects<TypeSourceInfo *>(); |
1372 | 27 | for (unsigned I = 0, N = NumAssocs; I < N; ++I18 ) |
1373 | 18 | TSIs[I] = readTypeSourceInfo(); |
1374 | 9 | } |
1375 | | |
1376 | 298 | void ASTStmtReader::VisitPseudoObjectExpr(PseudoObjectExpr *E) { |
1377 | 298 | VisitExpr(E); |
1378 | 298 | unsigned numSemanticExprs = Record.readInt(); |
1379 | 298 | assert(numSemanticExprs + 1 == E->PseudoObjectExprBits.NumSubExprs); |
1380 | 298 | E->PseudoObjectExprBits.ResultIndex = Record.readInt(); |
1381 | | |
1382 | | // Read the syntactic expression. |
1383 | 298 | E->getSubExprsBuffer()[0] = Record.readSubExpr(); |
1384 | | |
1385 | | // Read all the semantic expressions. |
1386 | 753 | for (unsigned i = 0; i != numSemanticExprs; ++i455 ) { |
1387 | 455 | Expr *subExpr = Record.readSubExpr(); |
1388 | 455 | E->getSubExprsBuffer()[i+1] = subExpr; |
1389 | 455 | } |
1390 | 298 | } |
1391 | | |
1392 | 204 | void ASTStmtReader::VisitAtomicExpr(AtomicExpr *E) { |
1393 | 204 | VisitExpr(E); |
1394 | 204 | E->Op = AtomicExpr::AtomicOp(Record.readInt()); |
1395 | 204 | E->NumSubExprs = AtomicExpr::getNumSubExprs(E->Op); |
1396 | 877 | for (unsigned I = 0; I != E->NumSubExprs; ++I673 ) |
1397 | 673 | E->SubExprs[I] = Record.readSubExpr(); |
1398 | 204 | E->BuiltinLoc = readSourceLocation(); |
1399 | 204 | E->RParenLoc = readSourceLocation(); |
1400 | 204 | } |
1401 | | |
1402 | | //===----------------------------------------------------------------------===// |
1403 | | // Objective-C Expressions and Statements |
1404 | | |
1405 | 8 | void ASTStmtReader::VisitObjCStringLiteral(ObjCStringLiteral *E) { |
1406 | 8 | VisitExpr(E); |
1407 | 8 | E->setString(cast<StringLiteral>(Record.readSubStmt())); |
1408 | 8 | E->setAtLoc(readSourceLocation()); |
1409 | 8 | } |
1410 | | |
1411 | 20 | void ASTStmtReader::VisitObjCBoxedExpr(ObjCBoxedExpr *E) { |
1412 | 20 | VisitExpr(E); |
1413 | | // could be one of several IntegerLiteral, FloatLiteral, etc. |
1414 | 20 | E->SubExpr = Record.readSubStmt(); |
1415 | 20 | E->BoxingMethod = readDeclAs<ObjCMethodDecl>(); |
1416 | 20 | E->Range = readSourceRange(); |
1417 | 20 | } |
1418 | | |
1419 | 3 | void ASTStmtReader::VisitObjCArrayLiteral(ObjCArrayLiteral *E) { |
1420 | 3 | VisitExpr(E); |
1421 | 3 | unsigned NumElements = Record.readInt(); |
1422 | 3 | assert(NumElements == E->getNumElements() && "Wrong number of elements"); |
1423 | 3 | Expr **Elements = E->getElements(); |
1424 | 9 | for (unsigned I = 0, N = NumElements; I != N; ++I6 ) |
1425 | 6 | Elements[I] = Record.readSubExpr(); |
1426 | 3 | E->ArrayWithObjectsMethod = readDeclAs<ObjCMethodDecl>(); |
1427 | 3 | E->Range = readSourceRange(); |
1428 | 3 | } |
1429 | | |
1430 | 6 | void ASTStmtReader::VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *E) { |
1431 | 6 | VisitExpr(E); |
1432 | 6 | unsigned NumElements = Record.readInt(); |
1433 | 6 | assert(NumElements == E->getNumElements() && "Wrong number of elements"); |
1434 | 6 | bool HasPackExpansions = Record.readInt(); |
1435 | 6 | assert(HasPackExpansions == E->HasPackExpansions &&"Pack expansion mismatch"); |
1436 | 6 | auto *KeyValues = |
1437 | 6 | E->getTrailingObjects<ObjCDictionaryLiteral::KeyValuePair>(); |
1438 | 6 | auto *Expansions = |
1439 | 6 | E->getTrailingObjects<ObjCDictionaryLiteral::ExpansionData>(); |
1440 | 15 | for (unsigned I = 0; I != NumElements; ++I9 ) { |
1441 | 9 | KeyValues[I].Key = Record.readSubExpr(); |
1442 | 9 | KeyValues[I].Value = Record.readSubExpr(); |
1443 | 9 | if (HasPackExpansions) { |
1444 | 3 | Expansions[I].EllipsisLoc = readSourceLocation(); |
1445 | 3 | Expansions[I].NumExpansionsPlusOne = Record.readInt(); |
1446 | 3 | } |
1447 | 9 | } |
1448 | 6 | E->DictWithObjectsMethod = readDeclAs<ObjCMethodDecl>(); |
1449 | 6 | E->Range = readSourceRange(); |
1450 | 6 | } |
1451 | | |
1452 | 1 | void ASTStmtReader::VisitObjCEncodeExpr(ObjCEncodeExpr *E) { |
1453 | 1 | VisitExpr(E); |
1454 | 1 | E->setEncodedTypeSourceInfo(readTypeSourceInfo()); |
1455 | 1 | E->setAtLoc(readSourceLocation()); |
1456 | 1 | E->setRParenLoc(readSourceLocation()); |
1457 | 1 | } |
1458 | | |
1459 | 3 | void ASTStmtReader::VisitObjCSelectorExpr(ObjCSelectorExpr *E) { |
1460 | 3 | VisitExpr(E); |
1461 | 3 | E->setSelector(Record.readSelector()); |
1462 | 3 | E->setAtLoc(readSourceLocation()); |
1463 | 3 | E->setRParenLoc(readSourceLocation()); |
1464 | 3 | } |
1465 | | |
1466 | 1 | void ASTStmtReader::VisitObjCProtocolExpr(ObjCProtocolExpr *E) { |
1467 | 1 | VisitExpr(E); |
1468 | 1 | E->setProtocol(readDeclAs<ObjCProtocolDecl>()); |
1469 | 1 | E->setAtLoc(readSourceLocation()); |
1470 | 1 | E->ProtoLoc = readSourceLocation(); |
1471 | 1 | E->setRParenLoc(readSourceLocation()); |
1472 | 1 | } |
1473 | | |
1474 | 12 | void ASTStmtReader::VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) { |
1475 | 12 | VisitExpr(E); |
1476 | 12 | E->setDecl(readDeclAs<ObjCIvarDecl>()); |
1477 | 12 | E->setLocation(readSourceLocation()); |
1478 | 12 | E->setOpLoc(readSourceLocation()); |
1479 | 12 | E->setBase(Record.readSubExpr()); |
1480 | 12 | E->setIsArrow(Record.readInt()); |
1481 | 12 | E->setIsFreeIvar(Record.readInt()); |
1482 | 12 | } |
1483 | | |
1484 | 1 | void ASTStmtReader::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) { |
1485 | 1 | VisitExpr(E); |
1486 | 1 | unsigned MethodRefFlags = Record.readInt(); |
1487 | 1 | bool Implicit = Record.readInt() != 0; |
1488 | 1 | if (Implicit) { |
1489 | 1 | auto *Getter = readDeclAs<ObjCMethodDecl>(); |
1490 | 1 | auto *Setter = readDeclAs<ObjCMethodDecl>(); |
1491 | 1 | E->setImplicitProperty(Getter, Setter, MethodRefFlags); |
1492 | 1 | } else { |
1493 | 0 | E->setExplicitProperty(readDeclAs<ObjCPropertyDecl>(), MethodRefFlags); |
1494 | 0 | } |
1495 | 1 | E->setLocation(readSourceLocation()); |
1496 | 1 | E->setReceiverLocation(readSourceLocation()); |
1497 | 1 | switch (Record.readInt()) { |
1498 | 0 | case 0: |
1499 | 0 | E->setBase(Record.readSubExpr()); |
1500 | 0 | break; |
1501 | 0 | case 1: |
1502 | 0 | E->setSuperReceiver(Record.readType()); |
1503 | 0 | break; |
1504 | 1 | case 2: |
1505 | 1 | E->setClassReceiver(readDeclAs<ObjCInterfaceDecl>()); |
1506 | 1 | break; |
1507 | 1 | } |
1508 | 1 | } |
1509 | | |
1510 | 12 | void ASTStmtReader::VisitObjCSubscriptRefExpr(ObjCSubscriptRefExpr *E) { |
1511 | 12 | VisitExpr(E); |
1512 | 12 | E->setRBracket(readSourceLocation()); |
1513 | 12 | E->setBaseExpr(Record.readSubExpr()); |
1514 | 12 | E->setKeyExpr(Record.readSubExpr()); |
1515 | 12 | E->GetAtIndexMethodDecl = readDeclAs<ObjCMethodDecl>(); |
1516 | 12 | E->SetAtIndexMethodDecl = readDeclAs<ObjCMethodDecl>(); |
1517 | 12 | } |
1518 | | |
1519 | 30 | void ASTStmtReader::VisitObjCMessageExpr(ObjCMessageExpr *E) { |
1520 | 30 | VisitExpr(E); |
1521 | 30 | assert(Record.peekInt() == E->getNumArgs()); |
1522 | 30 | Record.skipInts(1); |
1523 | 30 | unsigned NumStoredSelLocs = Record.readInt(); |
1524 | 30 | E->SelLocsKind = Record.readInt(); |
1525 | 30 | E->setDelegateInitCall(Record.readInt()); |
1526 | 30 | E->IsImplicit = Record.readInt(); |
1527 | 30 | auto Kind = static_cast<ObjCMessageExpr::ReceiverKind>(Record.readInt()); |
1528 | 30 | switch (Kind) { |
1529 | 23 | case ObjCMessageExpr::Instance: |
1530 | 23 | E->setInstanceReceiver(Record.readSubExpr()); |
1531 | 23 | break; |
1532 | | |
1533 | 7 | case ObjCMessageExpr::Class: |
1534 | 7 | E->setClassReceiver(readTypeSourceInfo()); |
1535 | 7 | break; |
1536 | | |
1537 | 0 | case ObjCMessageExpr::SuperClass: |
1538 | 0 | case ObjCMessageExpr::SuperInstance: { |
1539 | 0 | QualType T = Record.readType(); |
1540 | 0 | SourceLocation SuperLoc = readSourceLocation(); |
1541 | 0 | E->setSuper(SuperLoc, T, Kind == ObjCMessageExpr::SuperInstance); |
1542 | 0 | break; |
1543 | 0 | } |
1544 | 30 | } |
1545 | | |
1546 | 30 | assert(Kind == E->getReceiverKind()); |
1547 | | |
1548 | 30 | if (Record.readInt()) |
1549 | 30 | E->setMethodDecl(readDeclAs<ObjCMethodDecl>()); |
1550 | 0 | else |
1551 | 0 | E->setSelector(Record.readSelector()); |
1552 | | |
1553 | 30 | E->LBracLoc = readSourceLocation(); |
1554 | 30 | E->RBracLoc = readSourceLocation(); |
1555 | | |
1556 | 54 | for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I24 ) |
1557 | 24 | E->setArg(I, Record.readSubExpr()); |
1558 | | |
1559 | 30 | SourceLocation *Locs = E->getStoredSelLocs(); |
1560 | 32 | for (unsigned I = 0; I != NumStoredSelLocs; ++I2 ) |
1561 | 2 | Locs[I] = readSourceLocation(); |
1562 | 30 | } |
1563 | | |
1564 | 0 | void ASTStmtReader::VisitObjCForCollectionStmt(ObjCForCollectionStmt *S) { |
1565 | 0 | VisitStmt(S); |
1566 | 0 | S->setElement(Record.readSubStmt()); |
1567 | 0 | S->setCollection(Record.readSubExpr()); |
1568 | 0 | S->setBody(Record.readSubStmt()); |
1569 | 0 | S->setForLoc(readSourceLocation()); |
1570 | 0 | S->setRParenLoc(readSourceLocation()); |
1571 | 0 | } |
1572 | | |
1573 | 8 | void ASTStmtReader::VisitObjCAtCatchStmt(ObjCAtCatchStmt *S) { |
1574 | 8 | VisitStmt(S); |
1575 | 8 | S->setCatchBody(Record.readSubStmt()); |
1576 | 8 | S->setCatchParamDecl(readDeclAs<VarDecl>()); |
1577 | 8 | S->setAtCatchLoc(readSourceLocation()); |
1578 | 8 | S->setRParenLoc(readSourceLocation()); |
1579 | 8 | } |
1580 | | |
1581 | 3 | void ASTStmtReader::VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S) { |
1582 | 3 | VisitStmt(S); |
1583 | 3 | S->setFinallyBody(Record.readSubStmt()); |
1584 | 3 | S->setAtFinallyLoc(readSourceLocation()); |
1585 | 3 | } |
1586 | | |
1587 | 0 | void ASTStmtReader::VisitObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S) { |
1588 | 0 | VisitStmt(S); // FIXME: no test coverage. |
1589 | 0 | S->setSubStmt(Record.readSubStmt()); |
1590 | 0 | S->setAtLoc(readSourceLocation()); |
1591 | 0 | } |
1592 | | |
1593 | 3 | void ASTStmtReader::VisitObjCAtTryStmt(ObjCAtTryStmt *S) { |
1594 | 3 | VisitStmt(S); |
1595 | 3 | assert(Record.peekInt() == S->getNumCatchStmts()); |
1596 | 3 | Record.skipInts(1); |
1597 | 3 | bool HasFinally = Record.readInt(); |
1598 | 3 | S->setTryBody(Record.readSubStmt()); |
1599 | 11 | for (unsigned I = 0, N = S->getNumCatchStmts(); I != N; ++I8 ) |
1600 | 8 | S->setCatchStmt(I, cast_or_null<ObjCAtCatchStmt>(Record.readSubStmt())); |
1601 | | |
1602 | 3 | if (HasFinally) |
1603 | 3 | S->setFinallyStmt(Record.readSubStmt()); |
1604 | 3 | S->setAtTryLoc(readSourceLocation()); |
1605 | 3 | } |
1606 | | |
1607 | 0 | void ASTStmtReader::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S) { |
1608 | 0 | VisitStmt(S); // FIXME: no test coverage. |
1609 | 0 | S->setSynchExpr(Record.readSubStmt()); |
1610 | 0 | S->setSynchBody(Record.readSubStmt()); |
1611 | 0 | S->setAtSynchronizedLoc(readSourceLocation()); |
1612 | 0 | } |
1613 | | |
1614 | 0 | void ASTStmtReader::VisitObjCAtThrowStmt(ObjCAtThrowStmt *S) { |
1615 | 0 | VisitStmt(S); // FIXME: no test coverage. |
1616 | 0 | S->setThrowExpr(Record.readSubStmt()); |
1617 | 0 | S->setThrowLoc(readSourceLocation()); |
1618 | 0 | } |
1619 | | |
1620 | 0 | void ASTStmtReader::VisitObjCBoolLiteralExpr(ObjCBoolLiteralExpr *E) { |
1621 | 0 | VisitExpr(E); |
1622 | 0 | E->setValue(Record.readInt()); |
1623 | 0 | E->setLocation(readSourceLocation()); |
1624 | 0 | } |
1625 | | |
1626 | 0 | void ASTStmtReader::VisitObjCAvailabilityCheckExpr(ObjCAvailabilityCheckExpr *E) { |
1627 | 0 | VisitExpr(E); |
1628 | 0 | SourceRange R = Record.readSourceRange(); |
1629 | 0 | E->AtLoc = R.getBegin(); |
1630 | 0 | E->RParen = R.getEnd(); |
1631 | 0 | E->VersionToCheck = Record.readVersionTuple(); |
1632 | 0 | } |
1633 | | |
1634 | | //===----------------------------------------------------------------------===// |
1635 | | // C++ Expressions and Statements |
1636 | | //===----------------------------------------------------------------------===// |
1637 | | |
1638 | 7 | void ASTStmtReader::VisitCXXCatchStmt(CXXCatchStmt *S) { |
1639 | 7 | VisitStmt(S); |
1640 | 7 | S->CatchLoc = readSourceLocation(); |
1641 | 7 | S->ExceptionDecl = readDeclAs<VarDecl>(); |
1642 | 7 | S->HandlerBlock = Record.readSubStmt(); |
1643 | 7 | } |
1644 | | |
1645 | 7 | void ASTStmtReader::VisitCXXTryStmt(CXXTryStmt *S) { |
1646 | 7 | VisitStmt(S); |
1647 | 7 | assert(Record.peekInt() == S->getNumHandlers() && "NumStmtFields is wrong ?"); |
1648 | 7 | Record.skipInts(1); |
1649 | 7 | S->TryLoc = readSourceLocation(); |
1650 | 7 | S->getStmts()[0] = Record.readSubStmt(); |
1651 | 14 | for (unsigned i = 0, e = S->getNumHandlers(); i != e; ++i7 ) |
1652 | 7 | S->getStmts()[i + 1] = Record.readSubStmt(); |
1653 | 7 | } |
1654 | | |
1655 | 141 | void ASTStmtReader::VisitCXXForRangeStmt(CXXForRangeStmt *S) { |
1656 | 141 | VisitStmt(S); |
1657 | 141 | S->ForLoc = readSourceLocation(); |
1658 | 141 | S->CoawaitLoc = readSourceLocation(); |
1659 | 141 | S->ColonLoc = readSourceLocation(); |
1660 | 141 | S->RParenLoc = readSourceLocation(); |
1661 | 141 | S->setInit(Record.readSubStmt()); |
1662 | 141 | S->setRangeStmt(Record.readSubStmt()); |
1663 | 141 | S->setBeginStmt(Record.readSubStmt()); |
1664 | 141 | S->setEndStmt(Record.readSubStmt()); |
1665 | 141 | S->setCond(Record.readSubExpr()); |
1666 | 141 | S->setInc(Record.readSubExpr()); |
1667 | 141 | S->setLoopVarStmt(Record.readSubStmt()); |
1668 | 141 | S->setBody(Record.readSubStmt()); |
1669 | 141 | } |
1670 | | |
1671 | 4 | void ASTStmtReader::VisitMSDependentExistsStmt(MSDependentExistsStmt *S) { |
1672 | 4 | VisitStmt(S); |
1673 | 4 | S->KeywordLoc = readSourceLocation(); |
1674 | 4 | S->IsIfExists = Record.readInt(); |
1675 | 4 | S->QualifierLoc = Record.readNestedNameSpecifierLoc(); |
1676 | 4 | S->NameInfo = Record.readDeclarationNameInfo(); |
1677 | 4 | S->SubStmt = Record.readSubStmt(); |
1678 | 4 | } |
1679 | | |
1680 | 30.8k | void ASTStmtReader::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) { |
1681 | 30.8k | VisitCallExpr(E); |
1682 | 30.8k | E->CXXOperatorCallExprBits.OperatorKind = Record.readInt(); |
1683 | 30.8k | E->Range = Record.readSourceRange(); |
1684 | 30.8k | } |
1685 | | |
1686 | | void ASTStmtReader::VisitCXXRewrittenBinaryOperator( |
1687 | 5 | CXXRewrittenBinaryOperator *E) { |
1688 | 5 | VisitExpr(E); |
1689 | 5 | E->CXXRewrittenBinaryOperatorBits.IsReversed = Record.readInt(); |
1690 | 5 | E->SemanticForm = Record.readSubExpr(); |
1691 | 5 | } |
1692 | | |
1693 | 8.91k | void ASTStmtReader::VisitCXXConstructExpr(CXXConstructExpr *E) { |
1694 | 8.91k | VisitExpr(E); |
1695 | | |
1696 | 8.91k | unsigned NumArgs = Record.readInt(); |
1697 | 8.91k | assert((NumArgs == E->getNumArgs()) && "Wrong NumArgs!"); |
1698 | | |
1699 | 8.91k | E->CXXConstructExprBits.Elidable = Record.readInt(); |
1700 | 8.91k | E->CXXConstructExprBits.HadMultipleCandidates = Record.readInt(); |
1701 | 8.91k | E->CXXConstructExprBits.ListInitialization = Record.readInt(); |
1702 | 8.91k | E->CXXConstructExprBits.StdInitListInitialization = Record.readInt(); |
1703 | 8.91k | E->CXXConstructExprBits.ZeroInitialization = Record.readInt(); |
1704 | 8.91k | E->CXXConstructExprBits.ConstructionKind = Record.readInt(); |
1705 | 8.91k | E->CXXConstructExprBits.IsImmediateEscalating = Record.readInt(); |
1706 | 8.91k | E->CXXConstructExprBits.Loc = readSourceLocation(); |
1707 | 8.91k | E->Constructor = readDeclAs<CXXConstructorDecl>(); |
1708 | 8.91k | E->ParenOrBraceRange = readSourceRange(); |
1709 | | |
1710 | 13.0k | for (unsigned I = 0; I != NumArgs; ++I4.11k ) |
1711 | 4.11k | E->setArg(I, Record.readSubExpr()); |
1712 | 8.91k | } |
1713 | | |
1714 | 0 | void ASTStmtReader::VisitCXXInheritedCtorInitExpr(CXXInheritedCtorInitExpr *E) { |
1715 | 0 | VisitExpr(E); |
1716 | 0 | E->Constructor = readDeclAs<CXXConstructorDecl>(); |
1717 | 0 | E->Loc = readSourceLocation(); |
1718 | 0 | E->ConstructsVirtualBase = Record.readInt(); |
1719 | 0 | E->InheritedFromVirtualBase = Record.readInt(); |
1720 | 0 | } |
1721 | | |
1722 | 2.10k | void ASTStmtReader::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) { |
1723 | 2.10k | VisitCXXConstructExpr(E); |
1724 | 2.10k | E->TSI = readTypeSourceInfo(); |
1725 | 2.10k | } |
1726 | | |
1727 | 728 | void ASTStmtReader::VisitLambdaExpr(LambdaExpr *E) { |
1728 | 728 | VisitExpr(E); |
1729 | 728 | unsigned NumCaptures = Record.readInt(); |
1730 | 728 | (void)NumCaptures; |
1731 | 728 | assert(NumCaptures == E->LambdaExprBits.NumCaptures); |
1732 | 728 | E->IntroducerRange = readSourceRange(); |
1733 | 728 | E->LambdaExprBits.CaptureDefault = Record.readInt(); |
1734 | 728 | E->CaptureDefaultLoc = readSourceLocation(); |
1735 | 728 | E->LambdaExprBits.ExplicitParams = Record.readInt(); |
1736 | 728 | E->LambdaExprBits.ExplicitResultType = Record.readInt(); |
1737 | 728 | E->ClosingBrace = readSourceLocation(); |
1738 | | |
1739 | | // Read capture initializers. |
1740 | 728 | for (LambdaExpr::capture_init_iterator C = E->capture_init_begin(), |
1741 | 728 | CEnd = E->capture_init_end(); |
1742 | 1.94k | C != CEnd; ++C1.21k ) |
1743 | 1.21k | *C = Record.readSubExpr(); |
1744 | | |
1745 | | // The body will be lazily deserialized when needed from the call operator |
1746 | | // declaration. |
1747 | 728 | } |
1748 | | |
1749 | | void |
1750 | 5 | ASTStmtReader::VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E) { |
1751 | 5 | VisitExpr(E); |
1752 | 5 | E->SubExpr = Record.readSubExpr(); |
1753 | 5 | } |
1754 | | |
1755 | 4.17k | void ASTStmtReader::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) { |
1756 | 4.17k | VisitExplicitCastExpr(E); |
1757 | 4.17k | SourceRange R = readSourceRange(); |
1758 | 4.17k | E->Loc = R.getBegin(); |
1759 | 4.17k | E->RParenLoc = R.getEnd(); |
1760 | 4.17k | R = readSourceRange(); |
1761 | 4.17k | E->AngleBrackets = R; |
1762 | 4.17k | } |
1763 | | |
1764 | 3.95k | void ASTStmtReader::VisitCXXStaticCastExpr(CXXStaticCastExpr *E) { |
1765 | 3.95k | return VisitCXXNamedCastExpr(E); |
1766 | 3.95k | } |
1767 | | |
1768 | 3 | void ASTStmtReader::VisitCXXDynamicCastExpr(CXXDynamicCastExpr *E) { |
1769 | 3 | return VisitCXXNamedCastExpr(E); |
1770 | 3 | } |
1771 | | |
1772 | 99 | void ASTStmtReader::VisitCXXReinterpretCastExpr(CXXReinterpretCastExpr *E) { |
1773 | 99 | return VisitCXXNamedCastExpr(E); |
1774 | 99 | } |
1775 | | |
1776 | 0 | void ASTStmtReader::VisitCXXAddrspaceCastExpr(CXXAddrspaceCastExpr *E) { |
1777 | 0 | return VisitCXXNamedCastExpr(E); |
1778 | 0 | } |
1779 | | |
1780 | 117 | void ASTStmtReader::VisitCXXConstCastExpr(CXXConstCastExpr *E) { |
1781 | 117 | return VisitCXXNamedCastExpr(E); |
1782 | 117 | } |
1783 | | |
1784 | 593 | void ASTStmtReader::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E) { |
1785 | 593 | VisitExplicitCastExpr(E); |
1786 | 593 | E->setLParenLoc(readSourceLocation()); |
1787 | 593 | E->setRParenLoc(readSourceLocation()); |
1788 | 593 | } |
1789 | | |
1790 | 1 | void ASTStmtReader::VisitBuiltinBitCastExpr(BuiltinBitCastExpr *E) { |
1791 | 1 | VisitExplicitCastExpr(E); |
1792 | 1 | E->KWLoc = readSourceLocation(); |
1793 | 1 | E->RParenLoc = readSourceLocation(); |
1794 | 1 | } |
1795 | | |
1796 | 2 | void ASTStmtReader::VisitUserDefinedLiteral(UserDefinedLiteral *E) { |
1797 | 2 | VisitCallExpr(E); |
1798 | 2 | E->UDSuffixLoc = readSourceLocation(); |
1799 | 2 | } |
1800 | | |
1801 | 35.4k | void ASTStmtReader::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) { |
1802 | 35.4k | VisitExpr(E); |
1803 | 35.4k | E->setValue(Record.readInt()); |
1804 | 35.4k | E->setLocation(readSourceLocation()); |
1805 | 35.4k | } |
1806 | | |
1807 | 4.48k | void ASTStmtReader::VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E) { |
1808 | 4.48k | VisitExpr(E); |
1809 | 4.48k | E->setLocation(readSourceLocation()); |
1810 | 4.48k | } |
1811 | | |
1812 | 30 | void ASTStmtReader::VisitCXXTypeidExpr(CXXTypeidExpr *E) { |
1813 | 30 | VisitExpr(E); |
1814 | 30 | E->setSourceRange(readSourceRange()); |
1815 | 30 | if (E->isTypeOperand()) |
1816 | 26 | E->Operand = readTypeSourceInfo(); |
1817 | 4 | else |
1818 | 4 | E->Operand = Record.readSubExpr(); |
1819 | 30 | } |
1820 | | |
1821 | 49.1k | void ASTStmtReader::VisitCXXThisExpr(CXXThisExpr *E) { |
1822 | 49.1k | VisitExpr(E); |
1823 | 49.1k | E->setLocation(readSourceLocation()); |
1824 | 49.1k | E->setImplicit(Record.readInt()); |
1825 | 49.1k | } |
1826 | | |
1827 | 6 | void ASTStmtReader::VisitCXXThrowExpr(CXXThrowExpr *E) { |
1828 | 6 | VisitExpr(E); |
1829 | 6 | E->CXXThrowExprBits.ThrowLoc = readSourceLocation(); |
1830 | 6 | E->Operand = Record.readSubExpr(); |
1831 | 6 | E->CXXThrowExprBits.IsThrownVariableInScope = Record.readInt(); |
1832 | 6 | } |
1833 | | |
1834 | 560 | void ASTStmtReader::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) { |
1835 | 560 | VisitExpr(E); |
1836 | 560 | E->Param = readDeclAs<ParmVarDecl>(); |
1837 | 560 | E->UsedContext = readDeclAs<DeclContext>(); |
1838 | 560 | E->CXXDefaultArgExprBits.Loc = readSourceLocation(); |
1839 | 560 | E->CXXDefaultArgExprBits.HasRewrittenInit = Record.readInt(); |
1840 | 560 | if (E->CXXDefaultArgExprBits.HasRewrittenInit) |
1841 | 0 | *E->getTrailingObjects<Expr *>() = Record.readSubExpr(); |
1842 | 560 | } |
1843 | | |
1844 | 68 | void ASTStmtReader::VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E) { |
1845 | 68 | VisitExpr(E); |
1846 | 68 | E->CXXDefaultInitExprBits.HasRewrittenInit = Record.readInt(); |
1847 | 68 | E->Field = readDeclAs<FieldDecl>(); |
1848 | 68 | E->UsedContext = readDeclAs<DeclContext>(); |
1849 | 68 | E->CXXDefaultInitExprBits.Loc = readSourceLocation(); |
1850 | 68 | if (E->CXXDefaultInitExprBits.HasRewrittenInit) |
1851 | 68 | *E->getTrailingObjects<Expr *>() = Record.readSubExpr(); |
1852 | 68 | } |
1853 | | |
1854 | 1.41k | void ASTStmtReader::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) { |
1855 | 1.41k | VisitExpr(E); |
1856 | 1.41k | E->setTemporary(Record.readCXXTemporary()); |
1857 | 1.41k | E->setSubExpr(Record.readSubExpr()); |
1858 | 1.41k | } |
1859 | | |
1860 | 147 | void ASTStmtReader::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) { |
1861 | 147 | VisitExpr(E); |
1862 | 147 | E->TypeInfo = readTypeSourceInfo(); |
1863 | 147 | E->CXXScalarValueInitExprBits.RParenLoc = readSourceLocation(); |
1864 | 147 | } |
1865 | | |
1866 | 242 | void ASTStmtReader::VisitCXXNewExpr(CXXNewExpr *E) { |
1867 | 242 | VisitExpr(E); |
1868 | | |
1869 | 242 | bool IsArray = Record.readInt(); |
1870 | 242 | bool HasInit = Record.readInt(); |
1871 | 242 | unsigned NumPlacementArgs = Record.readInt(); |
1872 | 242 | bool IsParenTypeId = Record.readInt(); |
1873 | | |
1874 | 242 | E->CXXNewExprBits.IsGlobalNew = Record.readInt(); |
1875 | 242 | E->CXXNewExprBits.ShouldPassAlignment = Record.readInt(); |
1876 | 242 | E->CXXNewExprBits.UsualArrayDeleteWantsSize = Record.readInt(); |
1877 | 242 | E->CXXNewExprBits.StoredInitializationStyle = Record.readInt(); |
1878 | | |
1879 | 242 | assert((IsArray == E->isArray()) && "Wrong IsArray!"); |
1880 | 242 | assert((HasInit == E->hasInitializer()) && "Wrong HasInit!"); |
1881 | 242 | assert((NumPlacementArgs == E->getNumPlacementArgs()) && |
1882 | 242 | "Wrong NumPlacementArgs!"); |
1883 | 242 | assert((IsParenTypeId == E->isParenTypeId()) && "Wrong IsParenTypeId!"); |
1884 | 242 | (void)IsArray; |
1885 | 242 | (void)HasInit; |
1886 | 242 | (void)NumPlacementArgs; |
1887 | | |
1888 | 242 | E->setOperatorNew(readDeclAs<FunctionDecl>()); |
1889 | 242 | E->setOperatorDelete(readDeclAs<FunctionDecl>()); |
1890 | 242 | E->AllocatedTypeInfo = readTypeSourceInfo(); |
1891 | 242 | if (IsParenTypeId) |
1892 | 1 | E->getTrailingObjects<SourceRange>()[0] = readSourceRange(); |
1893 | 242 | E->Range = readSourceRange(); |
1894 | 242 | E->DirectInitRange = readSourceRange(); |
1895 | | |
1896 | | // Install all the subexpressions. |
1897 | 242 | for (CXXNewExpr::raw_arg_iterator I = E->raw_arg_begin(), |
1898 | 242 | N = E->raw_arg_end(); |
1899 | 615 | I != N; ++I373 ) |
1900 | 373 | *I = Record.readSubStmt(); |
1901 | 242 | } |
1902 | | |
1903 | 63 | void ASTStmtReader::VisitCXXDeleteExpr(CXXDeleteExpr *E) { |
1904 | 63 | VisitExpr(E); |
1905 | 63 | E->CXXDeleteExprBits.GlobalDelete = Record.readInt(); |
1906 | 63 | E->CXXDeleteExprBits.ArrayForm = Record.readInt(); |
1907 | 63 | E->CXXDeleteExprBits.ArrayFormAsWritten = Record.readInt(); |
1908 | 63 | E->CXXDeleteExprBits.UsualArrayDeleteWantsSize = Record.readInt(); |
1909 | 63 | E->OperatorDelete = readDeclAs<FunctionDecl>(); |
1910 | 63 | E->Argument = Record.readSubExpr(); |
1911 | 63 | E->CXXDeleteExprBits.Loc = readSourceLocation(); |
1912 | 63 | } |
1913 | | |
1914 | 113 | void ASTStmtReader::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) { |
1915 | 113 | VisitExpr(E); |
1916 | | |
1917 | 113 | E->Base = Record.readSubExpr(); |
1918 | 113 | E->IsArrow = Record.readInt(); |
1919 | 113 | E->OperatorLoc = readSourceLocation(); |
1920 | 113 | E->QualifierLoc = Record.readNestedNameSpecifierLoc(); |
1921 | 113 | E->ScopeType = readTypeSourceInfo(); |
1922 | 113 | E->ColonColonLoc = readSourceLocation(); |
1923 | 113 | E->TildeLoc = readSourceLocation(); |
1924 | | |
1925 | 113 | IdentifierInfo *II = Record.readIdentifier(); |
1926 | 113 | if (II) |
1927 | 0 | E->setDestroyedType(II, readSourceLocation()); |
1928 | 113 | else |
1929 | 113 | E->setDestroyedType(readTypeSourceInfo()); |
1930 | 113 | } |
1931 | | |
1932 | 1.71k | void ASTStmtReader::VisitExprWithCleanups(ExprWithCleanups *E) { |
1933 | 1.71k | VisitExpr(E); |
1934 | | |
1935 | 1.71k | unsigned NumObjects = Record.readInt(); |
1936 | 1.71k | assert(NumObjects == E->getNumObjects()); |
1937 | 1.73k | for (unsigned i = 0; 1.71k i != NumObjects; ++i11 ) { |
1938 | 11 | unsigned CleanupKind = Record.readInt(); |
1939 | 11 | ExprWithCleanups::CleanupObject Obj; |
1940 | 11 | if (CleanupKind == COK_Block) |
1941 | 9 | Obj = readDeclAs<BlockDecl>(); |
1942 | 2 | else if (CleanupKind == COK_CompoundLiteral) |
1943 | 2 | Obj = cast<CompoundLiteralExpr>(Record.readSubExpr()); |
1944 | 0 | else |
1945 | 0 | llvm_unreachable("unexpected cleanup object type"); |
1946 | 11 | E->getTrailingObjects<ExprWithCleanups::CleanupObject>()[i] = Obj; |
1947 | 11 | } |
1948 | | |
1949 | 1.71k | E->ExprWithCleanupsBits.CleanupsHaveSideEffects = Record.readInt(); |
1950 | 1.71k | E->SubExpr = Record.readSubExpr(); |
1951 | 1.71k | } |
1952 | | |
1953 | | void ASTStmtReader::VisitCXXDependentScopeMemberExpr( |
1954 | 52.8k | CXXDependentScopeMemberExpr *E) { |
1955 | 52.8k | VisitExpr(E); |
1956 | | |
1957 | 52.8k | bool HasTemplateKWAndArgsInfo = Record.readInt(); |
1958 | 52.8k | unsigned NumTemplateArgs = Record.readInt(); |
1959 | 52.8k | bool HasFirstQualifierFoundInScope = Record.readInt(); |
1960 | | |
1961 | 52.8k | assert((HasTemplateKWAndArgsInfo == E->hasTemplateKWAndArgsInfo()) && |
1962 | 52.8k | "Wrong HasTemplateKWAndArgsInfo!"); |
1963 | 52.8k | assert( |
1964 | 52.8k | (HasFirstQualifierFoundInScope == E->hasFirstQualifierFoundInScope()) && |
1965 | 52.8k | "Wrong HasFirstQualifierFoundInScope!"); |
1966 | | |
1967 | 52.8k | if (HasTemplateKWAndArgsInfo) |
1968 | 14 | ReadTemplateKWAndArgsInfo( |
1969 | 14 | *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(), |
1970 | 14 | E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs); |
1971 | | |
1972 | 52.8k | assert((NumTemplateArgs == E->getNumTemplateArgs()) && |
1973 | 52.8k | "Wrong NumTemplateArgs!"); |
1974 | | |
1975 | 52.8k | E->CXXDependentScopeMemberExprBits.IsArrow = Record.readInt(); |
1976 | 52.8k | E->CXXDependentScopeMemberExprBits.OperatorLoc = readSourceLocation(); |
1977 | 52.8k | E->BaseType = Record.readType(); |
1978 | 52.8k | E->QualifierLoc = Record.readNestedNameSpecifierLoc(); |
1979 | 52.8k | E->Base = Record.readSubExpr(); |
1980 | | |
1981 | 52.8k | if (HasFirstQualifierFoundInScope) |
1982 | 8 | *E->getTrailingObjects<NamedDecl *>() = readDeclAs<NamedDecl>(); |
1983 | | |
1984 | 52.8k | E->MemberNameInfo = Record.readDeclarationNameInfo(); |
1985 | 52.8k | } |
1986 | | |
1987 | | void |
1988 | 140k | ASTStmtReader::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) { |
1989 | 140k | VisitExpr(E); |
1990 | | |
1991 | 140k | if (Record.readInt()) // HasTemplateKWAndArgsInfo |
1992 | 1.83k | ReadTemplateKWAndArgsInfo( |
1993 | 1.83k | *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(), |
1994 | 1.83k | E->getTrailingObjects<TemplateArgumentLoc>(), |
1995 | 1.83k | /*NumTemplateArgs=*/Record.readInt()); |
1996 | | |
1997 | 140k | E->QualifierLoc = Record.readNestedNameSpecifierLoc(); |
1998 | 140k | E->NameInfo = Record.readDeclarationNameInfo(); |
1999 | 140k | } |
2000 | | |
2001 | | void |
2002 | 8.82k | ASTStmtReader::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E) { |
2003 | 8.82k | VisitExpr(E); |
2004 | 8.82k | assert(Record.peekInt() == E->getNumArgs() && |
2005 | 8.82k | "Read wrong record during creation ?"); |
2006 | 8.82k | Record.skipInts(1); |
2007 | 14.9k | for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I6.15k ) |
2008 | 6.15k | E->setArg(I, Record.readSubExpr()); |
2009 | 8.82k | E->TypeAndInitForm.setPointer(readTypeSourceInfo()); |
2010 | 8.82k | E->setLParenLoc(readSourceLocation()); |
2011 | 8.82k | E->setRParenLoc(readSourceLocation()); |
2012 | 8.82k | E->TypeAndInitForm.setInt(Record.readInt()); |
2013 | 8.82k | } |
2014 | | |
2015 | 69.2k | void ASTStmtReader::VisitOverloadExpr(OverloadExpr *E) { |
2016 | 69.2k | VisitExpr(E); |
2017 | | |
2018 | 69.2k | unsigned NumResults = Record.readInt(); |
2019 | 69.2k | bool HasTemplateKWAndArgsInfo = Record.readInt(); |
2020 | 69.2k | assert((E->getNumDecls() == NumResults) && "Wrong NumResults!"); |
2021 | 69.2k | assert((E->hasTemplateKWAndArgsInfo() == HasTemplateKWAndArgsInfo) && |
2022 | 69.2k | "Wrong HasTemplateKWAndArgsInfo!"); |
2023 | | |
2024 | 69.2k | if (HasTemplateKWAndArgsInfo) { |
2025 | 9.28k | unsigned NumTemplateArgs = Record.readInt(); |
2026 | 9.28k | ReadTemplateKWAndArgsInfo(*E->getTrailingASTTemplateKWAndArgsInfo(), |
2027 | 9.28k | E->getTrailingTemplateArgumentLoc(), |
2028 | 9.28k | NumTemplateArgs); |
2029 | 9.28k | assert((E->getNumTemplateArgs() == NumTemplateArgs) && |
2030 | 9.28k | "Wrong NumTemplateArgs!"); |
2031 | 9.28k | } |
2032 | | |
2033 | 69.2k | UnresolvedSet<8> Decls; |
2034 | 348k | for (unsigned I = 0; I != NumResults; ++I279k ) { |
2035 | 279k | auto *D = readDeclAs<NamedDecl>(); |
2036 | 279k | auto AS = (AccessSpecifier)Record.readInt(); |
2037 | 279k | Decls.addDecl(D, AS); |
2038 | 279k | } |
2039 | | |
2040 | 69.2k | DeclAccessPair *Results = E->getTrailingResults(); |
2041 | 69.2k | UnresolvedSetIterator Iter = Decls.begin(); |
2042 | 348k | for (unsigned I = 0; I != NumResults; ++I279k ) { |
2043 | 279k | Results[I] = (Iter + I).getPair(); |
2044 | 279k | } |
2045 | | |
2046 | 69.2k | E->NameInfo = Record.readDeclarationNameInfo(); |
2047 | 69.2k | E->QualifierLoc = Record.readNestedNameSpecifierLoc(); |
2048 | 69.2k | } |
2049 | | |
2050 | 13.8k | void ASTStmtReader::VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E) { |
2051 | 13.8k | VisitOverloadExpr(E); |
2052 | 13.8k | E->UnresolvedMemberExprBits.IsArrow = Record.readInt(); |
2053 | 13.8k | E->UnresolvedMemberExprBits.HasUnresolvedUsing = Record.readInt(); |
2054 | 13.8k | E->Base = Record.readSubExpr(); |
2055 | 13.8k | E->BaseType = Record.readType(); |
2056 | 13.8k | E->OperatorLoc = readSourceLocation(); |
2057 | 13.8k | } |
2058 | | |
2059 | 55.4k | void ASTStmtReader::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) { |
2060 | 55.4k | VisitOverloadExpr(E); |
2061 | 55.4k | E->UnresolvedLookupExprBits.RequiresADL = Record.readInt(); |
2062 | 55.4k | E->UnresolvedLookupExprBits.Overloaded = Record.readInt(); |
2063 | 55.4k | E->NamingClass = readDeclAs<CXXRecordDecl>(); |
2064 | 55.4k | } |
2065 | | |
2066 | 11.1k | void ASTStmtReader::VisitTypeTraitExpr(TypeTraitExpr *E) { |
2067 | 11.1k | VisitExpr(E); |
2068 | 11.1k | E->TypeTraitExprBits.NumArgs = Record.readInt(); |
2069 | 11.1k | E->TypeTraitExprBits.Kind = Record.readInt(); |
2070 | 11.1k | E->TypeTraitExprBits.Value = Record.readInt(); |
2071 | 11.1k | SourceRange Range = readSourceRange(); |
2072 | 11.1k | E->Loc = Range.getBegin(); |
2073 | 11.1k | E->RParenLoc = Range.getEnd(); |
2074 | | |
2075 | 11.1k | auto **Args = E->getTrailingObjects<TypeSourceInfo *>(); |
2076 | 28.1k | for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I16.9k ) |
2077 | 16.9k | Args[I] = readTypeSourceInfo(); |
2078 | 11.1k | } |
2079 | | |
2080 | 3 | void ASTStmtReader::VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E) { |
2081 | 3 | VisitExpr(E); |
2082 | 3 | E->ATT = (ArrayTypeTrait)Record.readInt(); |
2083 | 3 | E->Value = (unsigned int)Record.readInt(); |
2084 | 3 | SourceRange Range = readSourceRange(); |
2085 | 3 | E->Loc = Range.getBegin(); |
2086 | 3 | E->RParen = Range.getEnd(); |
2087 | 3 | E->QueriedType = readTypeSourceInfo(); |
2088 | 3 | E->Dimension = Record.readSubExpr(); |
2089 | 3 | } |
2090 | | |
2091 | 2 | void ASTStmtReader::VisitExpressionTraitExpr(ExpressionTraitExpr *E) { |
2092 | 2 | VisitExpr(E); |
2093 | 2 | E->ET = (ExpressionTrait)Record.readInt(); |
2094 | 2 | E->Value = (bool)Record.readInt(); |
2095 | 2 | SourceRange Range = readSourceRange(); |
2096 | 2 | E->QueriedExpression = Record.readSubExpr(); |
2097 | 2 | E->Loc = Range.getBegin(); |
2098 | 2 | E->RParen = Range.getEnd(); |
2099 | 2 | } |
2100 | | |
2101 | 3.18k | void ASTStmtReader::VisitCXXNoexceptExpr(CXXNoexceptExpr *E) { |
2102 | 3.18k | VisitExpr(E); |
2103 | 3.18k | E->CXXNoexceptExprBits.Value = Record.readInt(); |
2104 | 3.18k | E->Range = readSourceRange(); |
2105 | 3.18k | E->Operand = Record.readSubExpr(); |
2106 | 3.18k | } |
2107 | | |
2108 | 6.66k | void ASTStmtReader::VisitPackExpansionExpr(PackExpansionExpr *E) { |
2109 | 6.66k | VisitExpr(E); |
2110 | 6.66k | E->EllipsisLoc = readSourceLocation(); |
2111 | 6.66k | E->NumExpansions = Record.readInt(); |
2112 | 6.66k | E->Pattern = Record.readSubExpr(); |
2113 | 6.66k | } |
2114 | | |
2115 | 10.0k | void ASTStmtReader::VisitSizeOfPackExpr(SizeOfPackExpr *E) { |
2116 | 10.0k | VisitExpr(E); |
2117 | 10.0k | unsigned NumPartialArgs = Record.readInt(); |
2118 | 10.0k | E->OperatorLoc = readSourceLocation(); |
2119 | 10.0k | E->PackLoc = readSourceLocation(); |
2120 | 10.0k | E->RParenLoc = readSourceLocation(); |
2121 | 10.0k | E->Pack = Record.readDeclAs<NamedDecl>(); |
2122 | 10.0k | if (E->isPartiallySubstituted()) { |
2123 | 4 | assert(E->Length == NumPartialArgs); |
2124 | 4 | for (auto *I = E->getTrailingObjects<TemplateArgument>(), |
2125 | 4 | *E = I + NumPartialArgs; |
2126 | 8 | I != E; ++I4 ) |
2127 | 4 | new (I) TemplateArgument(Record.readTemplateArgument()); |
2128 | 9.99k | } else if (!E->isValueDependent()) { |
2129 | 862 | E->Length = Record.readInt(); |
2130 | 862 | } |
2131 | 10.0k | } |
2132 | | |
2133 | | void ASTStmtReader::VisitSubstNonTypeTemplateParmExpr( |
2134 | 50.3k | SubstNonTypeTemplateParmExpr *E) { |
2135 | 50.3k | VisitExpr(E); |
2136 | 50.3k | E->AssociatedDeclAndRef.setPointer(readDeclAs<Decl>()); |
2137 | 50.3k | E->AssociatedDeclAndRef.setInt(Record.readInt()); |
2138 | 50.3k | E->Index = Record.readInt(); |
2139 | 50.3k | E->PackIndex = Record.readInt(); |
2140 | 50.3k | E->SubstNonTypeTemplateParmExprBits.NameLoc = readSourceLocation(); |
2141 | 50.3k | E->Replacement = Record.readSubExpr(); |
2142 | 50.3k | } |
2143 | | |
2144 | | void ASTStmtReader::VisitSubstNonTypeTemplateParmPackExpr( |
2145 | 0 | SubstNonTypeTemplateParmPackExpr *E) { |
2146 | 0 | VisitExpr(E); |
2147 | 0 | E->AssociatedDecl = readDeclAs<Decl>(); |
2148 | 0 | E->Index = Record.readInt(); |
2149 | 0 | TemplateArgument ArgPack = Record.readTemplateArgument(); |
2150 | 0 | if (ArgPack.getKind() != TemplateArgument::Pack) |
2151 | 0 | return; |
2152 | | |
2153 | 0 | E->Arguments = ArgPack.pack_begin(); |
2154 | 0 | E->NumArguments = ArgPack.pack_size(); |
2155 | 0 | E->NameLoc = readSourceLocation(); |
2156 | 0 | } |
2157 | | |
2158 | 8 | void ASTStmtReader::VisitFunctionParmPackExpr(FunctionParmPackExpr *E) { |
2159 | 8 | VisitExpr(E); |
2160 | 8 | E->NumParameters = Record.readInt(); |
2161 | 8 | E->ParamPack = readDeclAs<ParmVarDecl>(); |
2162 | 8 | E->NameLoc = readSourceLocation(); |
2163 | 8 | auto **Parms = E->getTrailingObjects<VarDecl *>(); |
2164 | 32 | for (unsigned i = 0, n = E->NumParameters; i != n; ++i24 ) |
2165 | 24 | Parms[i] = readDeclAs<VarDecl>(); |
2166 | 8 | } |
2167 | | |
2168 | 2.16k | void ASTStmtReader::VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E) { |
2169 | 2.16k | VisitExpr(E); |
2170 | 2.16k | bool HasMaterialzedDecl = Record.readInt(); |
2171 | 2.16k | if (HasMaterialzedDecl) |
2172 | 21 | E->State = cast<LifetimeExtendedTemporaryDecl>(Record.readDecl()); |
2173 | 2.14k | else |
2174 | 2.14k | E->State = Record.readSubExpr(); |
2175 | 2.16k | } |
2176 | | |
2177 | 11 | void ASTStmtReader::VisitCXXFoldExpr(CXXFoldExpr *E) { |
2178 | 11 | VisitExpr(E); |
2179 | 11 | E->LParenLoc = readSourceLocation(); |
2180 | 11 | E->EllipsisLoc = readSourceLocation(); |
2181 | 11 | E->RParenLoc = readSourceLocation(); |
2182 | 11 | E->NumExpansions = Record.readInt(); |
2183 | 11 | E->SubExprs[0] = Record.readSubExpr(); |
2184 | 11 | E->SubExprs[1] = Record.readSubExpr(); |
2185 | 11 | E->SubExprs[2] = Record.readSubExpr(); |
2186 | 11 | E->Opcode = (BinaryOperatorKind)Record.readInt(); |
2187 | 11 | } |
2188 | | |
2189 | 3 | void ASTStmtReader::VisitCXXParenListInitExpr(CXXParenListInitExpr *E) { |
2190 | 3 | VisitExpr(E); |
2191 | 3 | unsigned ExpectedNumExprs = Record.readInt(); |
2192 | 3 | assert(E->NumExprs == ExpectedNumExprs && |
2193 | 3 | "expected number of expressions does not equal the actual number of " |
2194 | 3 | "serialized expressions."); |
2195 | 3 | E->NumUserSpecifiedExprs = Record.readInt(); |
2196 | 3 | E->InitLoc = readSourceLocation(); |
2197 | 3 | E->LParenLoc = readSourceLocation(); |
2198 | 3 | E->RParenLoc = readSourceLocation(); |
2199 | 8 | for (unsigned I = 0; I < ExpectedNumExprs; I++5 ) |
2200 | 5 | E->getTrailingObjects<Expr *>()[I] = Record.readSubExpr(); |
2201 | | |
2202 | 3 | bool HasArrayFillerOrUnionDecl = Record.readBool(); |
2203 | 3 | if (HasArrayFillerOrUnionDecl) { |
2204 | 2 | bool HasArrayFiller = Record.readBool(); |
2205 | 2 | if (HasArrayFiller) { |
2206 | 1 | E->setArrayFiller(Record.readSubExpr()); |
2207 | 1 | } else { |
2208 | 1 | E->setInitializedFieldInUnion(readDeclAs<FieldDecl>()); |
2209 | 1 | } |
2210 | 2 | } |
2211 | 3 | E->updateDependence(); |
2212 | 3 | } |
2213 | | |
2214 | 1.32k | void ASTStmtReader::VisitOpaqueValueExpr(OpaqueValueExpr *E) { |
2215 | 1.32k | VisitExpr(E); |
2216 | 1.32k | E->SourceExpr = Record.readSubExpr(); |
2217 | 1.32k | E->OpaqueValueExprBits.Loc = readSourceLocation(); |
2218 | 1.32k | E->setIsUnique(Record.readInt()); |
2219 | 1.32k | } |
2220 | | |
2221 | 0 | void ASTStmtReader::VisitTypoExpr(TypoExpr *E) { |
2222 | 0 | llvm_unreachable("Cannot read TypoExpr nodes"); |
2223 | 0 | } |
2224 | | |
2225 | 0 | void ASTStmtReader::VisitRecoveryExpr(RecoveryExpr *E) { |
2226 | 0 | VisitExpr(E); |
2227 | 0 | unsigned NumArgs = Record.readInt(); |
2228 | 0 | E->BeginLoc = readSourceLocation(); |
2229 | 0 | E->EndLoc = readSourceLocation(); |
2230 | 0 | assert((NumArgs + 0LL == |
2231 | 0 | std::distance(E->children().begin(), E->children().end())) && |
2232 | 0 | "Wrong NumArgs!"); |
2233 | 0 | (void)NumArgs; |
2234 | 0 | for (Stmt *&Child : E->children()) |
2235 | 0 | Child = Record.readSubStmt(); |
2236 | 0 | } |
2237 | | |
2238 | | //===----------------------------------------------------------------------===// |
2239 | | // Microsoft Expressions and Statements |
2240 | | //===----------------------------------------------------------------------===// |
2241 | 36 | void ASTStmtReader::VisitMSPropertyRefExpr(MSPropertyRefExpr *E) { |
2242 | 36 | VisitExpr(E); |
2243 | 36 | E->IsArrow = (Record.readInt() != 0); |
2244 | 36 | E->BaseExpr = Record.readSubExpr(); |
2245 | 36 | E->QualifierLoc = Record.readNestedNameSpecifierLoc(); |
2246 | 36 | E->MemberLoc = readSourceLocation(); |
2247 | 36 | E->TheDecl = readDeclAs<MSPropertyDecl>(); |
2248 | 36 | } |
2249 | | |
2250 | 70 | void ASTStmtReader::VisitMSPropertySubscriptExpr(MSPropertySubscriptExpr *E) { |
2251 | 70 | VisitExpr(E); |
2252 | 70 | E->setBase(Record.readSubExpr()); |
2253 | 70 | E->setIdx(Record.readSubExpr()); |
2254 | 70 | E->setRBracketLoc(readSourceLocation()); |
2255 | 70 | } |
2256 | | |
2257 | 1 | void ASTStmtReader::VisitCXXUuidofExpr(CXXUuidofExpr *E) { |
2258 | 1 | VisitExpr(E); |
2259 | 1 | E->setSourceRange(readSourceRange()); |
2260 | 1 | E->Guid = readDeclAs<MSGuidDecl>(); |
2261 | 1 | if (E->isTypeOperand()) |
2262 | 0 | E->Operand = readTypeSourceInfo(); |
2263 | 1 | else |
2264 | 1 | E->Operand = Record.readSubExpr(); |
2265 | 1 | } |
2266 | | |
2267 | 0 | void ASTStmtReader::VisitSEHLeaveStmt(SEHLeaveStmt *S) { |
2268 | 0 | VisitStmt(S); |
2269 | 0 | S->setLeaveLoc(readSourceLocation()); |
2270 | 0 | } |
2271 | | |
2272 | 1 | void ASTStmtReader::VisitSEHExceptStmt(SEHExceptStmt *S) { |
2273 | 1 | VisitStmt(S); |
2274 | 1 | S->Loc = readSourceLocation(); |
2275 | 1 | S->Children[SEHExceptStmt::FILTER_EXPR] = Record.readSubStmt(); |
2276 | 1 | S->Children[SEHExceptStmt::BLOCK] = Record.readSubStmt(); |
2277 | 1 | } |
2278 | | |
2279 | 0 | void ASTStmtReader::VisitSEHFinallyStmt(SEHFinallyStmt *S) { |
2280 | 0 | VisitStmt(S); |
2281 | 0 | S->Loc = readSourceLocation(); |
2282 | 0 | S->Block = Record.readSubStmt(); |
2283 | 0 | } |
2284 | | |
2285 | 1 | void ASTStmtReader::VisitSEHTryStmt(SEHTryStmt *S) { |
2286 | 1 | VisitStmt(S); |
2287 | 1 | S->IsCXXTry = Record.readInt(); |
2288 | 1 | S->TryLoc = readSourceLocation(); |
2289 | 1 | S->Children[SEHTryStmt::TRY] = Record.readSubStmt(); |
2290 | 1 | S->Children[SEHTryStmt::HANDLER] = Record.readSubStmt(); |
2291 | 1 | } |
2292 | | |
2293 | | //===----------------------------------------------------------------------===// |
2294 | | // CUDA Expressions and Statements |
2295 | | //===----------------------------------------------------------------------===// |
2296 | | |
2297 | 1 | void ASTStmtReader::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E) { |
2298 | 1 | VisitCallExpr(E); |
2299 | 1 | E->setPreArg(CUDAKernelCallExpr::CONFIG, Record.readSubExpr()); |
2300 | 1 | } |
2301 | | |
2302 | | //===----------------------------------------------------------------------===// |
2303 | | // OpenCL Expressions and Statements. |
2304 | | //===----------------------------------------------------------------------===// |
2305 | 0 | void ASTStmtReader::VisitAsTypeExpr(AsTypeExpr *E) { |
2306 | 0 | VisitExpr(E); |
2307 | 0 | E->BuiltinLoc = readSourceLocation(); |
2308 | 0 | E->RParenLoc = readSourceLocation(); |
2309 | 0 | E->SrcExpr = Record.readSubExpr(); |
2310 | 0 | } |
2311 | | |
2312 | | //===----------------------------------------------------------------------===// |
2313 | | // OpenMP Directives. |
2314 | | //===----------------------------------------------------------------------===// |
2315 | | |
2316 | 25 | void ASTStmtReader::VisitOMPCanonicalLoop(OMPCanonicalLoop *S) { |
2317 | 25 | VisitStmt(S); |
2318 | 25 | for (Stmt *&SubStmt : S->SubStmts) |
2319 | 100 | SubStmt = Record.readSubStmt(); |
2320 | 25 | } |
2321 | | |
2322 | 25.4k | void ASTStmtReader::VisitOMPExecutableDirective(OMPExecutableDirective *E) { |
2323 | 25.4k | Record.readOMPChildren(E->Data); |
2324 | 25.4k | E->setLocStart(readSourceLocation()); |
2325 | 25.4k | E->setLocEnd(readSourceLocation()); |
2326 | 25.4k | E->setMappedDirective(Record.readEnum<OpenMPDirectiveKind>()); |
2327 | 25.4k | } |
2328 | | |
2329 | 7.87k | void ASTStmtReader::VisitOMPLoopBasedDirective(OMPLoopBasedDirective *D) { |
2330 | 7.87k | VisitStmt(D); |
2331 | | // Field CollapsedNum was read in ReadStmtFromStream. |
2332 | 7.87k | Record.skipInts(1); |
2333 | 7.87k | VisitOMPExecutableDirective(D); |
2334 | 7.87k | } |
2335 | | |
2336 | 7.82k | void ASTStmtReader::VisitOMPLoopDirective(OMPLoopDirective *D) { |
2337 | 7.82k | VisitOMPLoopBasedDirective(D); |
2338 | 7.82k | } |
2339 | | |
2340 | 0 | void ASTStmtReader::VisitOMPMetaDirective(OMPMetaDirective *D) { |
2341 | 0 | VisitStmt(D); |
2342 | | // The NumClauses field was read in ReadStmtFromStream. |
2343 | 0 | Record.skipInts(1); |
2344 | 0 | VisitOMPExecutableDirective(D); |
2345 | 0 | } |
2346 | | |
2347 | 835 | void ASTStmtReader::VisitOMPParallelDirective(OMPParallelDirective *D) { |
2348 | 835 | VisitStmt(D); |
2349 | 835 | VisitOMPExecutableDirective(D); |
2350 | 835 | D->setHasCancel(Record.readBool()); |
2351 | 835 | } |
2352 | | |
2353 | 200 | void ASTStmtReader::VisitOMPSimdDirective(OMPSimdDirective *D) { |
2354 | 200 | VisitOMPLoopDirective(D); |
2355 | 200 | } |
2356 | | |
2357 | | void ASTStmtReader::VisitOMPLoopTransformationDirective( |
2358 | 52 | OMPLoopTransformationDirective *D) { |
2359 | 52 | VisitOMPLoopBasedDirective(D); |
2360 | 52 | D->setNumGeneratedLoops(Record.readUInt32()); |
2361 | 52 | } |
2362 | | |
2363 | 26 | void ASTStmtReader::VisitOMPTileDirective(OMPTileDirective *D) { |
2364 | 26 | VisitOMPLoopTransformationDirective(D); |
2365 | 26 | } |
2366 | | |
2367 | 26 | void ASTStmtReader::VisitOMPUnrollDirective(OMPUnrollDirective *D) { |
2368 | 26 | VisitOMPLoopTransformationDirective(D); |
2369 | 26 | } |
2370 | | |
2371 | 451 | void ASTStmtReader::VisitOMPForDirective(OMPForDirective *D) { |
2372 | 451 | VisitOMPLoopDirective(D); |
2373 | 451 | D->setHasCancel(Record.readBool()); |
2374 | 451 | } |
2375 | | |
2376 | 135 | void ASTStmtReader::VisitOMPForSimdDirective(OMPForSimdDirective *D) { |
2377 | 135 | VisitOMPLoopDirective(D); |
2378 | 135 | } |
2379 | | |
2380 | 58 | void ASTStmtReader::VisitOMPSectionsDirective(OMPSectionsDirective *D) { |
2381 | 58 | VisitStmt(D); |
2382 | 58 | VisitOMPExecutableDirective(D); |
2383 | 58 | D->setHasCancel(Record.readBool()); |
2384 | 58 | } |
2385 | | |
2386 | 50 | void ASTStmtReader::VisitOMPSectionDirective(OMPSectionDirective *D) { |
2387 | 50 | VisitStmt(D); |
2388 | 50 | VisitOMPExecutableDirective(D); |
2389 | 50 | D->setHasCancel(Record.readBool()); |
2390 | 50 | } |
2391 | | |
2392 | 4 | void ASTStmtReader::VisitOMPScopeDirective(OMPScopeDirective *D) { |
2393 | 4 | VisitStmt(D); |
2394 | 4 | VisitOMPExecutableDirective(D); |
2395 | 4 | } |
2396 | | |
2397 | 46 | void ASTStmtReader::VisitOMPSingleDirective(OMPSingleDirective *D) { |
2398 | 46 | VisitStmt(D); |
2399 | 46 | VisitOMPExecutableDirective(D); |
2400 | 46 | } |
2401 | | |
2402 | 17 | void ASTStmtReader::VisitOMPMasterDirective(OMPMasterDirective *D) { |
2403 | 17 | VisitStmt(D); |
2404 | 17 | VisitOMPExecutableDirective(D); |
2405 | 17 | } |
2406 | | |
2407 | 78 | void ASTStmtReader::VisitOMPCriticalDirective(OMPCriticalDirective *D) { |
2408 | 78 | VisitStmt(D); |
2409 | 78 | VisitOMPExecutableDirective(D); |
2410 | 78 | D->DirName = Record.readDeclarationNameInfo(); |
2411 | 78 | } |
2412 | | |
2413 | 123 | void ASTStmtReader::VisitOMPParallelForDirective(OMPParallelForDirective *D) { |
2414 | 123 | VisitOMPLoopDirective(D); |
2415 | 123 | D->setHasCancel(Record.readBool()); |
2416 | 123 | } |
2417 | | |
2418 | | void ASTStmtReader::VisitOMPParallelForSimdDirective( |
2419 | 144 | OMPParallelForSimdDirective *D) { |
2420 | 144 | VisitOMPLoopDirective(D); |
2421 | 144 | } |
2422 | | |
2423 | | void ASTStmtReader::VisitOMPParallelMasterDirective( |
2424 | 63 | OMPParallelMasterDirective *D) { |
2425 | 63 | VisitStmt(D); |
2426 | 63 | VisitOMPExecutableDirective(D); |
2427 | 63 | } |
2428 | | |
2429 | | void ASTStmtReader::VisitOMPParallelMaskedDirective( |
2430 | 44 | OMPParallelMaskedDirective *D) { |
2431 | 44 | VisitStmt(D); |
2432 | 44 | VisitOMPExecutableDirective(D); |
2433 | 44 | } |
2434 | | |
2435 | | void ASTStmtReader::VisitOMPParallelSectionsDirective( |
2436 | 32 | OMPParallelSectionsDirective *D) { |
2437 | 32 | VisitStmt(D); |
2438 | 32 | VisitOMPExecutableDirective(D); |
2439 | 32 | D->setHasCancel(Record.readBool()); |
2440 | 32 | } |
2441 | | |
2442 | 257 | void ASTStmtReader::VisitOMPTaskDirective(OMPTaskDirective *D) { |
2443 | 257 | VisitStmt(D); |
2444 | 257 | VisitOMPExecutableDirective(D); |
2445 | 257 | D->setHasCancel(Record.readBool()); |
2446 | 257 | } |
2447 | | |
2448 | 16 | void ASTStmtReader::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) { |
2449 | 16 | VisitStmt(D); |
2450 | 16 | VisitOMPExecutableDirective(D); |
2451 | 16 | } |
2452 | | |
2453 | 30 | void ASTStmtReader::VisitOMPBarrierDirective(OMPBarrierDirective *D) { |
2454 | 30 | VisitStmt(D); |
2455 | 30 | VisitOMPExecutableDirective(D); |
2456 | 30 | } |
2457 | | |
2458 | 38 | void ASTStmtReader::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) { |
2459 | 38 | VisitStmt(D); |
2460 | | // The NumClauses field was read in ReadStmtFromStream. |
2461 | 38 | Record.skipInts(1); |
2462 | 38 | VisitOMPExecutableDirective(D); |
2463 | 38 | } |
2464 | | |
2465 | 10 | void ASTStmtReader::VisitOMPErrorDirective(OMPErrorDirective *D) { |
2466 | 10 | VisitStmt(D); |
2467 | | // The NumClauses field was read in ReadStmtFromStream. |
2468 | 10 | Record.skipInts(1); |
2469 | 10 | VisitOMPExecutableDirective(D); |
2470 | 10 | } |
2471 | | |
2472 | 114 | void ASTStmtReader::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) { |
2473 | 114 | VisitStmt(D); |
2474 | 114 | VisitOMPExecutableDirective(D); |
2475 | 114 | } |
2476 | | |
2477 | 50 | void ASTStmtReader::VisitOMPFlushDirective(OMPFlushDirective *D) { |
2478 | 50 | VisitStmt(D); |
2479 | 50 | VisitOMPExecutableDirective(D); |
2480 | 50 | } |
2481 | | |
2482 | 28 | void ASTStmtReader::VisitOMPDepobjDirective(OMPDepobjDirective *D) { |
2483 | 28 | VisitStmt(D); |
2484 | 28 | VisitOMPExecutableDirective(D); |
2485 | 28 | } |
2486 | | |
2487 | 24 | void ASTStmtReader::VisitOMPScanDirective(OMPScanDirective *D) { |
2488 | 24 | VisitStmt(D); |
2489 | 24 | VisitOMPExecutableDirective(D); |
2490 | 24 | } |
2491 | | |
2492 | 114 | void ASTStmtReader::VisitOMPOrderedDirective(OMPOrderedDirective *D) { |
2493 | 114 | VisitStmt(D); |
2494 | 114 | VisitOMPExecutableDirective(D); |
2495 | 114 | } |
2496 | | |
2497 | 6.29k | void ASTStmtReader::VisitOMPAtomicDirective(OMPAtomicDirective *D) { |
2498 | 6.29k | VisitStmt(D); |
2499 | 6.29k | VisitOMPExecutableDirective(D); |
2500 | 6.29k | D->Flags.IsXLHSInRHSPart = Record.readBool() ? 14.66k : 01.63k ; |
2501 | 6.29k | D->Flags.IsPostfixUpdate = Record.readBool() ? 11.57k : 04.71k ; |
2502 | 6.29k | D->Flags.IsFailOnly = Record.readBool() ? 1600 : 05.69k ; |
2503 | 6.29k | } |
2504 | | |
2505 | 5.16k | void ASTStmtReader::VisitOMPTargetDirective(OMPTargetDirective *D) { |
2506 | 5.16k | VisitStmt(D); |
2507 | 5.16k | VisitOMPExecutableDirective(D); |
2508 | 5.16k | } |
2509 | | |
2510 | 276 | void ASTStmtReader::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) { |
2511 | 276 | VisitStmt(D); |
2512 | 276 | VisitOMPExecutableDirective(D); |
2513 | 276 | } |
2514 | | |
2515 | | void ASTStmtReader::VisitOMPTargetEnterDataDirective( |
2516 | 343 | OMPTargetEnterDataDirective *D) { |
2517 | 343 | VisitStmt(D); |
2518 | 343 | VisitOMPExecutableDirective(D); |
2519 | 343 | } |
2520 | | |
2521 | | void ASTStmtReader::VisitOMPTargetExitDataDirective( |
2522 | 335 | OMPTargetExitDataDirective *D) { |
2523 | 335 | VisitStmt(D); |
2524 | 335 | VisitOMPExecutableDirective(D); |
2525 | 335 | } |
2526 | | |
2527 | | void ASTStmtReader::VisitOMPTargetParallelDirective( |
2528 | 618 | OMPTargetParallelDirective *D) { |
2529 | 618 | VisitStmt(D); |
2530 | 618 | VisitOMPExecutableDirective(D); |
2531 | 618 | D->setHasCancel(Record.readBool()); |
2532 | 618 | } |
2533 | | |
2534 | | void ASTStmtReader::VisitOMPTargetParallelForDirective( |
2535 | 502 | OMPTargetParallelForDirective *D) { |
2536 | 502 | VisitOMPLoopDirective(D); |
2537 | 502 | D->setHasCancel(Record.readBool()); |
2538 | 502 | } |
2539 | | |
2540 | 1.01k | void ASTStmtReader::VisitOMPTeamsDirective(OMPTeamsDirective *D) { |
2541 | 1.01k | VisitStmt(D); |
2542 | 1.01k | VisitOMPExecutableDirective(D); |
2543 | 1.01k | } |
2544 | | |
2545 | | void ASTStmtReader::VisitOMPCancellationPointDirective( |
2546 | 78 | OMPCancellationPointDirective *D) { |
2547 | 78 | VisitStmt(D); |
2548 | 78 | VisitOMPExecutableDirective(D); |
2549 | 78 | D->setCancelRegion(Record.readEnum<OpenMPDirectiveKind>()); |
2550 | 78 | } |
2551 | | |
2552 | 176 | void ASTStmtReader::VisitOMPCancelDirective(OMPCancelDirective *D) { |
2553 | 176 | VisitStmt(D); |
2554 | 176 | VisitOMPExecutableDirective(D); |
2555 | 176 | D->setCancelRegion(Record.readEnum<OpenMPDirectiveKind>()); |
2556 | 176 | } |
2557 | | |
2558 | 48 | void ASTStmtReader::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) { |
2559 | 48 | VisitOMPLoopDirective(D); |
2560 | 48 | D->setHasCancel(Record.readBool()); |
2561 | 48 | } |
2562 | | |
2563 | 46 | void ASTStmtReader::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) { |
2564 | 46 | VisitOMPLoopDirective(D); |
2565 | 46 | } |
2566 | | |
2567 | | void ASTStmtReader::VisitOMPMasterTaskLoopDirective( |
2568 | 36 | OMPMasterTaskLoopDirective *D) { |
2569 | 36 | VisitOMPLoopDirective(D); |
2570 | 36 | D->setHasCancel(Record.readBool()); |
2571 | 36 | } |
2572 | | |
2573 | | void ASTStmtReader::VisitOMPMaskedTaskLoopDirective( |
2574 | 12 | OMPMaskedTaskLoopDirective *D) { |
2575 | 12 | VisitOMPLoopDirective(D); |
2576 | 12 | D->setHasCancel(Record.readBool()); |
2577 | 12 | } |
2578 | | |
2579 | | void ASTStmtReader::VisitOMPMasterTaskLoopSimdDirective( |
2580 | 50 | OMPMasterTaskLoopSimdDirective *D) { |
2581 | 50 | VisitOMPLoopDirective(D); |
2582 | 50 | } |
2583 | | |
2584 | | void ASTStmtReader::VisitOMPMaskedTaskLoopSimdDirective( |
2585 | 20 | OMPMaskedTaskLoopSimdDirective *D) { |
2586 | 20 | VisitOMPLoopDirective(D); |
2587 | 20 | } |
2588 | | |
2589 | | void ASTStmtReader::VisitOMPParallelMasterTaskLoopDirective( |
2590 | 34 | OMPParallelMasterTaskLoopDirective *D) { |
2591 | 34 | VisitOMPLoopDirective(D); |
2592 | 34 | D->setHasCancel(Record.readBool()); |
2593 | 34 | } |
2594 | | |
2595 | | void ASTStmtReader::VisitOMPParallelMaskedTaskLoopDirective( |
2596 | 12 | OMPParallelMaskedTaskLoopDirective *D) { |
2597 | 12 | VisitOMPLoopDirective(D); |
2598 | 12 | D->setHasCancel(Record.readBool()); |
2599 | 12 | } |
2600 | | |
2601 | | void ASTStmtReader::VisitOMPParallelMasterTaskLoopSimdDirective( |
2602 | 48 | OMPParallelMasterTaskLoopSimdDirective *D) { |
2603 | 48 | VisitOMPLoopDirective(D); |
2604 | 48 | } |
2605 | | |
2606 | | void ASTStmtReader::VisitOMPParallelMaskedTaskLoopSimdDirective( |
2607 | 12 | OMPParallelMaskedTaskLoopSimdDirective *D) { |
2608 | 12 | VisitOMPLoopDirective(D); |
2609 | 12 | } |
2610 | | |
2611 | 147 | void ASTStmtReader::VisitOMPDistributeDirective(OMPDistributeDirective *D) { |
2612 | 147 | VisitOMPLoopDirective(D); |
2613 | 147 | } |
2614 | | |
2615 | 406 | void ASTStmtReader::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) { |
2616 | 406 | VisitStmt(D); |
2617 | 406 | VisitOMPExecutableDirective(D); |
2618 | 406 | } |
2619 | | |
2620 | | void ASTStmtReader::VisitOMPDistributeParallelForDirective( |
2621 | 300 | OMPDistributeParallelForDirective *D) { |
2622 | 300 | VisitOMPLoopDirective(D); |
2623 | 300 | D->setHasCancel(Record.readBool()); |
2624 | 300 | } |
2625 | | |
2626 | | void ASTStmtReader::VisitOMPDistributeParallelForSimdDirective( |
2627 | 280 | OMPDistributeParallelForSimdDirective *D) { |
2628 | 280 | VisitOMPLoopDirective(D); |
2629 | 280 | } |
2630 | | |
2631 | | void ASTStmtReader::VisitOMPDistributeSimdDirective( |
2632 | 184 | OMPDistributeSimdDirective *D) { |
2633 | 184 | VisitOMPLoopDirective(D); |
2634 | 184 | } |
2635 | | |
2636 | | void ASTStmtReader::VisitOMPTargetParallelForSimdDirective( |
2637 | 600 | OMPTargetParallelForSimdDirective *D) { |
2638 | 600 | VisitOMPLoopDirective(D); |
2639 | 600 | } |
2640 | | |
2641 | 572 | void ASTStmtReader::VisitOMPTargetSimdDirective(OMPTargetSimdDirective *D) { |
2642 | 572 | VisitOMPLoopDirective(D); |
2643 | 572 | } |
2644 | | |
2645 | | void ASTStmtReader::VisitOMPTeamsDistributeDirective( |
2646 | 142 | OMPTeamsDistributeDirective *D) { |
2647 | 142 | VisitOMPLoopDirective(D); |
2648 | 142 | } |
2649 | | |
2650 | | void ASTStmtReader::VisitOMPTeamsDistributeSimdDirective( |
2651 | 246 | OMPTeamsDistributeSimdDirective *D) { |
2652 | 246 | VisitOMPLoopDirective(D); |
2653 | 246 | } |
2654 | | |
2655 | | void ASTStmtReader::VisitOMPTeamsDistributeParallelForSimdDirective( |
2656 | 410 | OMPTeamsDistributeParallelForSimdDirective *D) { |
2657 | 410 | VisitOMPLoopDirective(D); |
2658 | 410 | } |
2659 | | |
2660 | | void ASTStmtReader::VisitOMPTeamsDistributeParallelForDirective( |
2661 | 366 | OMPTeamsDistributeParallelForDirective *D) { |
2662 | 366 | VisitOMPLoopDirective(D); |
2663 | 366 | D->setHasCancel(Record.readBool()); |
2664 | 366 | } |
2665 | | |
2666 | 801 | void ASTStmtReader::VisitOMPTargetTeamsDirective(OMPTargetTeamsDirective *D) { |
2667 | 801 | VisitStmt(D); |
2668 | 801 | VisitOMPExecutableDirective(D); |
2669 | 801 | } |
2670 | | |
2671 | | void ASTStmtReader::VisitOMPTargetTeamsDistributeDirective( |
2672 | 565 | OMPTargetTeamsDistributeDirective *D) { |
2673 | 565 | VisitOMPLoopDirective(D); |
2674 | 565 | } |
2675 | | |
2676 | | void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForDirective( |
2677 | 490 | OMPTargetTeamsDistributeParallelForDirective *D) { |
2678 | 490 | VisitOMPLoopDirective(D); |
2679 | 490 | D->setHasCancel(Record.readBool()); |
2680 | 490 | } |
2681 | | |
2682 | | void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForSimdDirective( |
2683 | 633 | OMPTargetTeamsDistributeParallelForSimdDirective *D) { |
2684 | 633 | VisitOMPLoopDirective(D); |
2685 | 633 | } |
2686 | | |
2687 | | void ASTStmtReader::VisitOMPTargetTeamsDistributeSimdDirective( |
2688 | 587 | OMPTargetTeamsDistributeSimdDirective *D) { |
2689 | 587 | VisitOMPLoopDirective(D); |
2690 | 587 | } |
2691 | | |
2692 | 68 | void ASTStmtReader::VisitOMPInteropDirective(OMPInteropDirective *D) { |
2693 | 68 | VisitStmt(D); |
2694 | 68 | VisitOMPExecutableDirective(D); |
2695 | 68 | } |
2696 | | |
2697 | 40 | void ASTStmtReader::VisitOMPDispatchDirective(OMPDispatchDirective *D) { |
2698 | 40 | VisitStmt(D); |
2699 | 40 | VisitOMPExecutableDirective(D); |
2700 | 40 | D->setTargetCallLoc(Record.readSourceLocation()); |
2701 | 40 | } |
2702 | | |
2703 | 30 | void ASTStmtReader::VisitOMPMaskedDirective(OMPMaskedDirective *D) { |
2704 | 30 | VisitStmt(D); |
2705 | 30 | VisitOMPExecutableDirective(D); |
2706 | 30 | } |
2707 | | |
2708 | 0 | void ASTStmtReader::VisitOMPGenericLoopDirective(OMPGenericLoopDirective *D) { |
2709 | 0 | VisitOMPLoopDirective(D); |
2710 | 0 | } |
2711 | | |
2712 | | void ASTStmtReader::VisitOMPTeamsGenericLoopDirective( |
2713 | 63 | OMPTeamsGenericLoopDirective *D) { |
2714 | 63 | VisitOMPLoopDirective(D); |
2715 | 63 | } |
2716 | | |
2717 | | void ASTStmtReader::VisitOMPTargetTeamsGenericLoopDirective( |
2718 | 144 | OMPTargetTeamsGenericLoopDirective *D) { |
2719 | 144 | VisitOMPLoopDirective(D); |
2720 | 144 | } |
2721 | | |
2722 | | void ASTStmtReader::VisitOMPParallelGenericLoopDirective( |
2723 | 8 | OMPParallelGenericLoopDirective *D) { |
2724 | 8 | VisitOMPLoopDirective(D); |
2725 | 8 | } |
2726 | | |
2727 | | void ASTStmtReader::VisitOMPTargetParallelGenericLoopDirective( |
2728 | 211 | OMPTargetParallelGenericLoopDirective *D) { |
2729 | 211 | VisitOMPLoopDirective(D); |
2730 | 211 | } |
2731 | | |
2732 | | //===----------------------------------------------------------------------===// |
2733 | | // ASTReader Implementation |
2734 | | //===----------------------------------------------------------------------===// |
2735 | | |
2736 | 680k | Stmt *ASTReader::ReadStmt(ModuleFile &F) { |
2737 | 680k | switch (ReadingKind) { |
2738 | 0 | case Read_None: |
2739 | 0 | llvm_unreachable("should not call this when not reading anything"); |
2740 | 172k | case Read_Decl: |
2741 | 356k | case Read_Type: |
2742 | 356k | return ReadStmtFromStream(F); |
2743 | 323k | case Read_Stmt: |
2744 | 323k | return ReadSubStmt(); |
2745 | 680k | } |
2746 | | |
2747 | 0 | llvm_unreachable("ReadingKind not set ?"); |
2748 | 0 | } |
2749 | | |
2750 | 195k | Expr *ASTReader::ReadExpr(ModuleFile &F) { |
2751 | 195k | return cast_or_null<Expr>(ReadStmt(F)); |
2752 | 195k | } |
2753 | | |
2754 | 1.81M | Expr *ASTReader::ReadSubExpr() { |
2755 | 1.81M | return cast_or_null<Expr>(ReadSubStmt()); |
2756 | 1.81M | } |
2757 | | |
2758 | | // Within the bitstream, expressions are stored in Reverse Polish |
2759 | | // Notation, with each of the subexpressions preceding the |
2760 | | // expression they are stored in. Subexpressions are stored from last to first. |
2761 | | // To evaluate expressions, we continue reading expressions and placing them on |
2762 | | // the stack, with expressions having operands removing those operands from the |
2763 | | // stack. Evaluation terminates when we see a STMT_STOP record, and |
2764 | | // the single remaining expression on the stack is our result. |
2765 | 471k | Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) { |
2766 | 471k | ReadingKindTracker ReadingKind(Read_Stmt, *this); |
2767 | 471k | llvm::BitstreamCursor &Cursor = F.DeclsCursor; |
2768 | | |
2769 | | // Map of offset to previously deserialized stmt. The offset points |
2770 | | // just after the stmt record. |
2771 | 471k | llvm::DenseMap<uint64_t, Stmt *> StmtEntries; |
2772 | | |
2773 | 471k | #ifndef NDEBUG |
2774 | 471k | unsigned PrevNumStmts = StmtStack.size(); |
2775 | 471k | #endif |
2776 | | |
2777 | 471k | ASTRecordReader Record(*this, F); |
2778 | 471k | ASTStmtReader Reader(Record, Cursor); |
2779 | 471k | Stmt::EmptyShell Empty; |
2780 | | |
2781 | 3.37M | while (true) { |
2782 | 3.37M | llvm::Expected<llvm::BitstreamEntry> MaybeEntry = |
2783 | 3.37M | Cursor.advanceSkippingSubblocks(); |
2784 | 3.37M | if (!MaybeEntry) { |
2785 | 0 | Error(toString(MaybeEntry.takeError())); |
2786 | 0 | return nullptr; |
2787 | 0 | } |
2788 | 3.37M | llvm::BitstreamEntry Entry = MaybeEntry.get(); |
2789 | | |
2790 | 3.37M | switch (Entry.Kind) { |
2791 | 0 | case llvm::BitstreamEntry::SubBlock: // Handled for us already. |
2792 | 0 | case llvm::BitstreamEntry::Error: |
2793 | 0 | Error("malformed block record in AST file"); |
2794 | 0 | return nullptr; |
2795 | 0 | case llvm::BitstreamEntry::EndBlock: |
2796 | 0 | goto Done; |
2797 | 3.37M | case llvm::BitstreamEntry::Record: |
2798 | | // The interesting case. |
2799 | 3.37M | break; |
2800 | 3.37M | } |
2801 | | |
2802 | 3.37M | ASTContext &Context = getContext(); |
2803 | 3.37M | Stmt *S = nullptr; |
2804 | 3.37M | bool Finished = false; |
2805 | 3.37M | bool IsStmtReference = false; |
2806 | 3.37M | Expected<unsigned> MaybeStmtCode = Record.readRecord(Cursor, Entry.ID); |
2807 | 3.37M | if (!MaybeStmtCode) { |
2808 | 0 | Error(toString(MaybeStmtCode.takeError())); |
2809 | 0 | return nullptr; |
2810 | 0 | } |
2811 | 3.37M | switch ((StmtCode)MaybeStmtCode.get()) { |
2812 | 471k | case STMT_STOP: |
2813 | 471k | Finished = true; |
2814 | 471k | break; |
2815 | | |
2816 | 251k | case STMT_REF_PTR: |
2817 | 251k | IsStmtReference = true; |
2818 | 251k | assert(StmtEntries.contains(Record[0]) && |
2819 | 251k | "No stmt was recorded for this offset reference!"); |
2820 | 251k | S = StmtEntries[Record.readInt()]; |
2821 | 251k | break; |
2822 | | |
2823 | 243k | case STMT_NULL_PTR: |
2824 | 243k | S = nullptr; |
2825 | 243k | break; |
2826 | | |
2827 | 687 | case STMT_NULL: |
2828 | 687 | S = new (Context) NullStmt(Empty); |
2829 | 687 | break; |
2830 | | |
2831 | 77.2k | case STMT_COMPOUND: |
2832 | 77.2k | S = CompoundStmt::CreateEmpty( |
2833 | 77.2k | Context, /*NumStmts=*/Record[ASTStmtReader::NumStmtFields], |
2834 | 77.2k | /*HasFPFeatures=*/Record[ASTStmtReader::NumStmtFields + 1]); |
2835 | 77.2k | break; |
2836 | | |
2837 | 312 | case STMT_CASE: |
2838 | 312 | S = CaseStmt::CreateEmpty( |
2839 | 312 | Context, |
2840 | 312 | /*CaseStmtIsGNURange*/ Record[ASTStmtReader::NumStmtFields + 3]); |
2841 | 312 | break; |
2842 | | |
2843 | 19 | case STMT_DEFAULT: |
2844 | 19 | S = new (Context) DefaultStmt(Empty); |
2845 | 19 | break; |
2846 | | |
2847 | 17 | case STMT_LABEL: |
2848 | 17 | S = new (Context) LabelStmt(Empty); |
2849 | 17 | break; |
2850 | | |
2851 | 31 | case STMT_ATTRIBUTED: |
2852 | 31 | S = AttributedStmt::CreateEmpty( |
2853 | 31 | Context, |
2854 | 31 | /*NumAttrs*/Record[ASTStmtReader::NumStmtFields]); |
2855 | 31 | break; |
2856 | | |
2857 | 13.6k | case STMT_IF: |
2858 | 13.6k | S = IfStmt::CreateEmpty( |
2859 | 13.6k | Context, |
2860 | 13.6k | /* HasElse=*/Record[ASTStmtReader::NumStmtFields], |
2861 | 13.6k | /* HasVar=*/Record[ASTStmtReader::NumStmtFields + 1], |
2862 | 13.6k | /* HasInit=*/Record[ASTStmtReader::NumStmtFields + 2]); |
2863 | 13.6k | break; |
2864 | | |
2865 | 105 | case STMT_SWITCH: |
2866 | 105 | S = SwitchStmt::CreateEmpty( |
2867 | 105 | Context, |
2868 | 105 | /* HasInit=*/Record[ASTStmtReader::NumStmtFields], |
2869 | 105 | /* HasVar=*/Record[ASTStmtReader::NumStmtFields + 1]); |
2870 | 105 | break; |
2871 | | |
2872 | 953 | case STMT_WHILE: |
2873 | 953 | S = WhileStmt::CreateEmpty( |
2874 | 953 | Context, |
2875 | 953 | /* HasVar=*/Record[ASTStmtReader::NumStmtFields]); |
2876 | 953 | break; |
2877 | | |
2878 | 51 | case STMT_DO: |
2879 | 51 | S = new (Context) DoStmt(Empty); |
2880 | 51 | break; |
2881 | | |
2882 | 12.0k | case STMT_FOR: |
2883 | 12.0k | S = new (Context) ForStmt(Empty); |
2884 | 12.0k | break; |
2885 | | |
2886 | 6 | case STMT_GOTO: |
2887 | 6 | S = new (Context) GotoStmt(Empty); |
2888 | 6 | break; |
2889 | | |
2890 | 2 | case STMT_INDIRECT_GOTO: |
2891 | 2 | S = new (Context) IndirectGotoStmt(Empty); |
2892 | 2 | break; |
2893 | | |
2894 | 11 | case STMT_CONTINUE: |
2895 | 11 | S = new (Context) ContinueStmt(Empty); |
2896 | 11 | break; |
2897 | | |
2898 | 451 | case STMT_BREAK: |
2899 | 451 | S = new (Context) BreakStmt(Empty); |
2900 | 451 | break; |
2901 | | |
2902 | 28.1k | case STMT_RETURN: |
2903 | 28.1k | S = ReturnStmt::CreateEmpty( |
2904 | 28.1k | Context, /* HasNRVOCandidate=*/Record[ASTStmtReader::NumStmtFields]); |
2905 | 28.1k | break; |
2906 | | |
2907 | 48.3k | case STMT_DECL: |
2908 | 48.3k | S = new (Context) DeclStmt(Empty); |
2909 | 48.3k | break; |
2910 | | |
2911 | 12 | case STMT_GCCASM: |
2912 | 12 | S = new (Context) GCCAsmStmt(Empty); |
2913 | 12 | break; |
2914 | | |
2915 | 0 | case STMT_MSASM: |
2916 | 0 | S = new (Context) MSAsmStmt(Empty); |
2917 | 0 | break; |
2918 | | |
2919 | 36.6k | case STMT_CAPTURED: |
2920 | 36.6k | S = CapturedStmt::CreateDeserialized( |
2921 | 36.6k | Context, Record[ASTStmtReader::NumStmtFields]); |
2922 | 36.6k | break; |
2923 | | |
2924 | 49.4k | case EXPR_CONSTANT: |
2925 | 49.4k | S = ConstantExpr::CreateEmpty( |
2926 | 49.4k | Context, static_cast<ConstantExpr::ResultStorageKind>( |
2927 | 49.4k | /*StorageKind=*/Record[ASTStmtReader::NumExprFields])); |
2928 | 49.4k | break; |
2929 | | |
2930 | 0 | case EXPR_SYCL_UNIQUE_STABLE_NAME: |
2931 | 0 | S = SYCLUniqueStableNameExpr::CreateEmpty(Context); |
2932 | 0 | break; |
2933 | | |
2934 | 18 | case EXPR_PREDEFINED: |
2935 | 18 | S = PredefinedExpr::CreateEmpty( |
2936 | 18 | Context, |
2937 | 18 | /*HasFunctionName*/ Record[ASTStmtReader::NumExprFields]); |
2938 | 18 | break; |
2939 | | |
2940 | 515k | case EXPR_DECL_REF: |
2941 | 515k | S = DeclRefExpr::CreateEmpty( |
2942 | 515k | Context, |
2943 | 515k | /*HasQualifier=*/Record[ASTStmtReader::NumExprFields], |
2944 | 515k | /*HasFoundDecl=*/Record[ASTStmtReader::NumExprFields + 1], |
2945 | 515k | /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields + 2], |
2946 | | /*NumTemplateArgs=*/ |
2947 | 515k | Record[ASTStmtReader::NumExprFields + 2] |
2948 | 515k | ? Record[ASTStmtReader::NumExprFields + 7]5.77k |
2949 | 515k | : 0509k ); |
2950 | 515k | break; |
2951 | | |
2952 | 165k | case EXPR_INTEGER_LITERAL: |
2953 | 165k | S = IntegerLiteral::Create(Context, Empty); |
2954 | 165k | break; |
2955 | | |
2956 | 56 | case EXPR_FIXEDPOINT_LITERAL: |
2957 | 56 | S = FixedPointLiteral::Create(Context, Empty); |
2958 | 56 | break; |
2959 | | |
2960 | 1.61k | case EXPR_FLOATING_LITERAL: |
2961 | 1.61k | S = FloatingLiteral::Create(Context, Empty); |
2962 | 1.61k | break; |
2963 | | |
2964 | 5 | case EXPR_IMAGINARY_LITERAL: |
2965 | 5 | S = new (Context) ImaginaryLiteral(Empty); |
2966 | 5 | break; |
2967 | | |
2968 | 3.03k | case EXPR_STRING_LITERAL: |
2969 | 3.03k | S = StringLiteral::CreateEmpty( |
2970 | 3.03k | Context, |
2971 | 3.03k | /* NumConcatenated=*/Record[ASTStmtReader::NumExprFields], |
2972 | 3.03k | /* Length=*/Record[ASTStmtReader::NumExprFields + 1], |
2973 | 3.03k | /* CharByteWidth=*/Record[ASTStmtReader::NumExprFields + 2]); |
2974 | 3.03k | break; |
2975 | | |
2976 | 741 | case EXPR_CHARACTER_LITERAL: |
2977 | 741 | S = new (Context) CharacterLiteral(Empty); |
2978 | 741 | break; |
2979 | | |
2980 | 49.4k | case EXPR_PAREN: |
2981 | 49.4k | S = new (Context) ParenExpr(Empty); |
2982 | 49.4k | break; |
2983 | | |
2984 | 10.8k | case EXPR_PAREN_LIST: |
2985 | 10.8k | S = ParenListExpr::CreateEmpty( |
2986 | 10.8k | Context, |
2987 | 10.8k | /* NumExprs=*/Record[ASTStmtReader::NumExprFields]); |
2988 | 10.8k | break; |
2989 | | |
2990 | 66.2k | case EXPR_UNARY_OPERATOR: |
2991 | 66.2k | S = UnaryOperator::CreateEmpty(Context, |
2992 | 66.2k | Record[ASTStmtReader::NumExprFields]); |
2993 | 66.2k | break; |
2994 | | |
2995 | 15 | case EXPR_OFFSETOF: |
2996 | 15 | S = OffsetOfExpr::CreateEmpty(Context, |
2997 | 15 | Record[ASTStmtReader::NumExprFields], |
2998 | 15 | Record[ASTStmtReader::NumExprFields + 1]); |
2999 | 15 | break; |
3000 | | |
3001 | 1.67k | case EXPR_SIZEOF_ALIGN_OF: |
3002 | 1.67k | S = new (Context) UnaryExprOrTypeTraitExpr(Empty); |
3003 | 1.67k | break; |
3004 | | |
3005 | 10.4k | case EXPR_ARRAY_SUBSCRIPT: |
3006 | 10.4k | S = new (Context) ArraySubscriptExpr(Empty); |
3007 | 10.4k | break; |
3008 | | |
3009 | 0 | case EXPR_MATRIX_SUBSCRIPT: |
3010 | 0 | S = new (Context) MatrixSubscriptExpr(Empty); |
3011 | 0 | break; |
3012 | | |
3013 | 2.65k | case EXPR_OMP_ARRAY_SECTION: |
3014 | 2.65k | S = new (Context) OMPArraySectionExpr(Empty); |
3015 | 2.65k | break; |
3016 | | |
3017 | 44 | case EXPR_OMP_ARRAY_SHAPING: |
3018 | 44 | S = OMPArrayShapingExpr::CreateEmpty( |
3019 | 44 | Context, Record[ASTStmtReader::NumExprFields]); |
3020 | 44 | break; |
3021 | | |
3022 | 26 | case EXPR_OMP_ITERATOR: |
3023 | 26 | S = OMPIteratorExpr::CreateEmpty(Context, |
3024 | 26 | Record[ASTStmtReader::NumExprFields]); |
3025 | 26 | break; |
3026 | | |
3027 | 97.0k | case EXPR_CALL: |
3028 | 97.0k | S = CallExpr::CreateEmpty( |
3029 | 97.0k | Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], |
3030 | 97.0k | /*HasFPFeatures=*/Record[ASTStmtReader::NumExprFields + 1], Empty); |
3031 | 97.0k | break; |
3032 | | |
3033 | 0 | case EXPR_RECOVERY: |
3034 | 0 | S = RecoveryExpr::CreateEmpty( |
3035 | 0 | Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields]); |
3036 | 0 | break; |
3037 | | |
3038 | 44.3k | case EXPR_MEMBER: |
3039 | 44.3k | S = MemberExpr::CreateEmpty(Context, Record[ASTStmtReader::NumExprFields], |
3040 | 44.3k | Record[ASTStmtReader::NumExprFields + 1], |
3041 | 44.3k | Record[ASTStmtReader::NumExprFields + 2], |
3042 | 44.3k | Record[ASTStmtReader::NumExprFields + 3]); |
3043 | 44.3k | break; |
3044 | | |
3045 | 281k | case EXPR_BINARY_OPERATOR: |
3046 | 281k | S = BinaryOperator::CreateEmpty(Context, |
3047 | 281k | Record[ASTStmtReader::NumExprFields]); |
3048 | 281k | break; |
3049 | | |
3050 | 11.7k | case EXPR_COMPOUND_ASSIGN_OPERATOR: |
3051 | 11.7k | S = CompoundAssignOperator::CreateEmpty( |
3052 | 11.7k | Context, Record[ASTStmtReader::NumExprFields]); |
3053 | 11.7k | break; |
3054 | | |
3055 | 11.6k | case EXPR_CONDITIONAL_OPERATOR: |
3056 | 11.6k | S = new (Context) ConditionalOperator(Empty); |
3057 | 11.6k | break; |
3058 | | |
3059 | 3 | case EXPR_BINARY_CONDITIONAL_OPERATOR: |
3060 | 3 | S = new (Context) BinaryConditionalOperator(Empty); |
3061 | 3 | break; |
3062 | | |
3063 | 331k | case EXPR_IMPLICIT_CAST: |
3064 | 331k | S = ImplicitCastExpr::CreateEmpty( |
3065 | 331k | Context, |
3066 | 331k | /*PathSize*/ Record[ASTStmtReader::NumExprFields], |
3067 | 331k | /*HasFPFeatures*/ Record[ASTStmtReader::NumExprFields + 1]); |
3068 | 331k | break; |
3069 | | |
3070 | 5.70k | case EXPR_CSTYLE_CAST: |
3071 | 5.70k | S = CStyleCastExpr::CreateEmpty( |
3072 | 5.70k | Context, |
3073 | 5.70k | /*PathSize*/ Record[ASTStmtReader::NumExprFields], |
3074 | 5.70k | /*HasFPFeatures*/ Record[ASTStmtReader::NumExprFields + 1]); |
3075 | 5.70k | break; |
3076 | | |
3077 | 9 | case EXPR_COMPOUND_LITERAL: |
3078 | 9 | S = new (Context) CompoundLiteralExpr(Empty); |
3079 | 9 | break; |
3080 | | |
3081 | 21 | case EXPR_EXT_VECTOR_ELEMENT: |
3082 | 21 | S = new (Context) ExtVectorElementExpr(Empty); |
3083 | 21 | break; |
3084 | | |
3085 | 2.84k | case EXPR_INIT_LIST: |
3086 | 2.84k | S = new (Context) InitListExpr(Empty); |
3087 | 2.84k | break; |
3088 | | |
3089 | 52 | case EXPR_DESIGNATED_INIT: |
3090 | 52 | S = DesignatedInitExpr::CreateEmpty(Context, |
3091 | 52 | Record[ASTStmtReader::NumExprFields] - 1); |
3092 | | |
3093 | 52 | break; |
3094 | | |
3095 | 1 | case EXPR_DESIGNATED_INIT_UPDATE: |
3096 | 1 | S = new (Context) DesignatedInitUpdateExpr(Empty); |
3097 | 1 | break; |
3098 | | |
3099 | 145 | case EXPR_IMPLICIT_VALUE_INIT: |
3100 | 145 | S = new (Context) ImplicitValueInitExpr(Empty); |
3101 | 145 | break; |
3102 | | |
3103 | 1 | case EXPR_NO_INIT: |
3104 | 1 | S = new (Context) NoInitExpr(Empty); |
3105 | 1 | break; |
3106 | | |
3107 | 6 | case EXPR_ARRAY_INIT_LOOP: |
3108 | 6 | S = new (Context) ArrayInitLoopExpr(Empty); |
3109 | 6 | break; |
3110 | | |
3111 | 6 | case EXPR_ARRAY_INIT_INDEX: |
3112 | 6 | S = new (Context) ArrayInitIndexExpr(Empty); |
3113 | 6 | break; |
3114 | | |
3115 | 2 | case EXPR_VA_ARG: |
3116 | 2 | S = new (Context) VAArgExpr(Empty); |
3117 | 2 | break; |
3118 | | |
3119 | 0 | case EXPR_SOURCE_LOC: |
3120 | 0 | S = new (Context) SourceLocExpr(Empty); |
3121 | 0 | break; |
3122 | | |
3123 | 7 | case EXPR_ADDR_LABEL: |
3124 | 7 | S = new (Context) AddrLabelExpr(Empty); |
3125 | 7 | break; |
3126 | | |
3127 | 24 | case EXPR_STMT: |
3128 | 24 | S = new (Context) StmtExpr(Empty); |
3129 | 24 | break; |
3130 | | |
3131 | 3 | case EXPR_CHOOSE: |
3132 | 3 | S = new (Context) ChooseExpr(Empty); |
3133 | 3 | break; |
3134 | | |
3135 | 0 | case EXPR_GNU_NULL: |
3136 | 0 | S = new (Context) GNUNullExpr(Empty); |
3137 | 0 | break; |
3138 | | |
3139 | 2 | case EXPR_SHUFFLE_VECTOR: |
3140 | 2 | S = new (Context) ShuffleVectorExpr(Empty); |
3141 | 2 | break; |
3142 | | |
3143 | 0 | case EXPR_CONVERT_VECTOR: |
3144 | 0 | S = new (Context) ConvertVectorExpr(Empty); |
3145 | 0 | break; |
3146 | | |
3147 | 62 | case EXPR_BLOCK: |
3148 | 62 | S = new (Context) BlockExpr(Empty); |
3149 | 62 | break; |
3150 | | |
3151 | 9 | case EXPR_GENERIC_SELECTION: |
3152 | 9 | S = GenericSelectionExpr::CreateEmpty( |
3153 | 9 | Context, |
3154 | 9 | /*NumAssocs=*/Record[ASTStmtReader::NumExprFields]); |
3155 | 9 | break; |
3156 | | |
3157 | 8 | case EXPR_OBJC_STRING_LITERAL: |
3158 | 8 | S = new (Context) ObjCStringLiteral(Empty); |
3159 | 8 | break; |
3160 | | |
3161 | 20 | case EXPR_OBJC_BOXED_EXPRESSION: |
3162 | 20 | S = new (Context) ObjCBoxedExpr(Empty); |
3163 | 20 | break; |
3164 | | |
3165 | 3 | case EXPR_OBJC_ARRAY_LITERAL: |
3166 | 3 | S = ObjCArrayLiteral::CreateEmpty(Context, |
3167 | 3 | Record[ASTStmtReader::NumExprFields]); |
3168 | 3 | break; |
3169 | | |
3170 | 6 | case EXPR_OBJC_DICTIONARY_LITERAL: |
3171 | 6 | S = ObjCDictionaryLiteral::CreateEmpty(Context, |
3172 | 6 | Record[ASTStmtReader::NumExprFields], |
3173 | 6 | Record[ASTStmtReader::NumExprFields + 1]); |
3174 | 6 | break; |
3175 | | |
3176 | 1 | case EXPR_OBJC_ENCODE: |
3177 | 1 | S = new (Context) ObjCEncodeExpr(Empty); |
3178 | 1 | break; |
3179 | | |
3180 | 3 | case EXPR_OBJC_SELECTOR_EXPR: |
3181 | 3 | S = new (Context) ObjCSelectorExpr(Empty); |
3182 | 3 | break; |
3183 | | |
3184 | 1 | case EXPR_OBJC_PROTOCOL_EXPR: |
3185 | 1 | S = new (Context) ObjCProtocolExpr(Empty); |
3186 | 1 | break; |
3187 | | |
3188 | 12 | case EXPR_OBJC_IVAR_REF_EXPR: |
3189 | 12 | S = new (Context) ObjCIvarRefExpr(Empty); |
3190 | 12 | break; |
3191 | | |
3192 | 1 | case EXPR_OBJC_PROPERTY_REF_EXPR: |
3193 | 1 | S = new (Context) ObjCPropertyRefExpr(Empty); |
3194 | 1 | break; |
3195 | | |
3196 | 12 | case EXPR_OBJC_SUBSCRIPT_REF_EXPR: |
3197 | 12 | S = new (Context) ObjCSubscriptRefExpr(Empty); |
3198 | 12 | break; |
3199 | | |
3200 | 0 | case EXPR_OBJC_KVC_REF_EXPR: |
3201 | 0 | llvm_unreachable("mismatching AST file"); |
3202 | |
|
3203 | 30 | case EXPR_OBJC_MESSAGE_EXPR: |
3204 | 30 | S = ObjCMessageExpr::CreateEmpty(Context, |
3205 | 30 | Record[ASTStmtReader::NumExprFields], |
3206 | 30 | Record[ASTStmtReader::NumExprFields + 1]); |
3207 | 30 | break; |
3208 | | |
3209 | 0 | case EXPR_OBJC_ISA: |
3210 | 0 | S = new (Context) ObjCIsaExpr(Empty); |
3211 | 0 | break; |
3212 | | |
3213 | 0 | case EXPR_OBJC_INDIRECT_COPY_RESTORE: |
3214 | 0 | S = new (Context) ObjCIndirectCopyRestoreExpr(Empty); |
3215 | 0 | break; |
3216 | | |
3217 | 2 | case EXPR_OBJC_BRIDGED_CAST: |
3218 | 2 | S = new (Context) ObjCBridgedCastExpr(Empty); |
3219 | 2 | break; |
3220 | | |
3221 | 0 | case STMT_OBJC_FOR_COLLECTION: |
3222 | 0 | S = new (Context) ObjCForCollectionStmt(Empty); |
3223 | 0 | break; |
3224 | | |
3225 | 8 | case STMT_OBJC_CATCH: |
3226 | 8 | S = new (Context) ObjCAtCatchStmt(Empty); |
3227 | 8 | break; |
3228 | | |
3229 | 3 | case STMT_OBJC_FINALLY: |
3230 | 3 | S = new (Context) ObjCAtFinallyStmt(Empty); |
3231 | 3 | break; |
3232 | | |
3233 | 3 | case STMT_OBJC_AT_TRY: |
3234 | 3 | S = ObjCAtTryStmt::CreateEmpty(Context, |
3235 | 3 | Record[ASTStmtReader::NumStmtFields], |
3236 | 3 | Record[ASTStmtReader::NumStmtFields + 1]); |
3237 | 3 | break; |
3238 | | |
3239 | 0 | case STMT_OBJC_AT_SYNCHRONIZED: |
3240 | 0 | S = new (Context) ObjCAtSynchronizedStmt(Empty); |
3241 | 0 | break; |
3242 | | |
3243 | 0 | case STMT_OBJC_AT_THROW: |
3244 | 0 | S = new (Context) ObjCAtThrowStmt(Empty); |
3245 | 0 | break; |
3246 | | |
3247 | 0 | case STMT_OBJC_AUTORELEASE_POOL: |
3248 | 0 | S = new (Context) ObjCAutoreleasePoolStmt(Empty); |
3249 | 0 | break; |
3250 | | |
3251 | 0 | case EXPR_OBJC_BOOL_LITERAL: |
3252 | 0 | S = new (Context) ObjCBoolLiteralExpr(Empty); |
3253 | 0 | break; |
3254 | | |
3255 | 0 | case EXPR_OBJC_AVAILABILITY_CHECK: |
3256 | 0 | S = new (Context) ObjCAvailabilityCheckExpr(Empty); |
3257 | 0 | break; |
3258 | | |
3259 | 0 | case STMT_SEH_LEAVE: |
3260 | 0 | S = new (Context) SEHLeaveStmt(Empty); |
3261 | 0 | break; |
3262 | | |
3263 | 1 | case STMT_SEH_EXCEPT: |
3264 | 1 | S = new (Context) SEHExceptStmt(Empty); |
3265 | 1 | break; |
3266 | | |
3267 | 0 | case STMT_SEH_FINALLY: |
3268 | 0 | S = new (Context) SEHFinallyStmt(Empty); |
3269 | 0 | break; |
3270 | | |
3271 | 1 | case STMT_SEH_TRY: |
3272 | 1 | S = new (Context) SEHTryStmt(Empty); |
3273 | 1 | break; |
3274 | | |
3275 | 7 | case STMT_CXX_CATCH: |
3276 | 7 | S = new (Context) CXXCatchStmt(Empty); |
3277 | 7 | break; |
3278 | | |
3279 | 7 | case STMT_CXX_TRY: |
3280 | 7 | S = CXXTryStmt::Create(Context, Empty, |
3281 | 7 | /*numHandlers=*/Record[ASTStmtReader::NumStmtFields]); |
3282 | 7 | break; |
3283 | | |
3284 | 141 | case STMT_CXX_FOR_RANGE: |
3285 | 141 | S = new (Context) CXXForRangeStmt(Empty); |
3286 | 141 | break; |
3287 | | |
3288 | 4 | case STMT_MS_DEPENDENT_EXISTS: |
3289 | 4 | S = new (Context) MSDependentExistsStmt(SourceLocation(), true, |
3290 | 4 | NestedNameSpecifierLoc(), |
3291 | 4 | DeclarationNameInfo(), |
3292 | 4 | nullptr); |
3293 | 4 | break; |
3294 | | |
3295 | 25 | case STMT_OMP_CANONICAL_LOOP: |
3296 | 25 | S = OMPCanonicalLoop::createEmpty(Context); |
3297 | 25 | break; |
3298 | | |
3299 | 0 | case STMT_OMP_META_DIRECTIVE: |
3300 | 0 | S = OMPMetaDirective::CreateEmpty( |
3301 | 0 | Context, Record[ASTStmtReader::NumStmtFields], Empty); |
3302 | 0 | break; |
3303 | | |
3304 | 835 | case STMT_OMP_PARALLEL_DIRECTIVE: |
3305 | 835 | S = |
3306 | 835 | OMPParallelDirective::CreateEmpty(Context, |
3307 | 835 | Record[ASTStmtReader::NumStmtFields], |
3308 | 835 | Empty); |
3309 | 835 | break; |
3310 | | |
3311 | 200 | case STMT_OMP_SIMD_DIRECTIVE: { |
3312 | 200 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3313 | 200 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3314 | 200 | S = OMPSimdDirective::CreateEmpty(Context, NumClauses, |
3315 | 200 | CollapsedNum, Empty); |
3316 | 200 | break; |
3317 | 0 | } |
3318 | | |
3319 | 26 | case STMT_OMP_TILE_DIRECTIVE: { |
3320 | 26 | unsigned NumLoops = Record[ASTStmtReader::NumStmtFields]; |
3321 | 26 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3322 | 26 | S = OMPTileDirective::CreateEmpty(Context, NumClauses, NumLoops); |
3323 | 26 | break; |
3324 | 0 | } |
3325 | | |
3326 | 26 | case STMT_OMP_UNROLL_DIRECTIVE: { |
3327 | 26 | assert(Record[ASTStmtReader::NumStmtFields] == 1 && "Unroll directive accepts only a single loop"); |
3328 | 26 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3329 | 26 | S = OMPUnrollDirective::CreateEmpty(Context, NumClauses); |
3330 | 26 | break; |
3331 | 26 | } |
3332 | | |
3333 | 451 | case STMT_OMP_FOR_DIRECTIVE: { |
3334 | 451 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3335 | 451 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3336 | 451 | S = OMPForDirective::CreateEmpty(Context, NumClauses, CollapsedNum, |
3337 | 451 | Empty); |
3338 | 451 | break; |
3339 | 26 | } |
3340 | | |
3341 | 135 | case STMT_OMP_FOR_SIMD_DIRECTIVE: { |
3342 | 135 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3343 | 135 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3344 | 135 | S = OMPForSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum, |
3345 | 135 | Empty); |
3346 | 135 | break; |
3347 | 26 | } |
3348 | | |
3349 | 58 | case STMT_OMP_SECTIONS_DIRECTIVE: |
3350 | 58 | S = OMPSectionsDirective::CreateEmpty( |
3351 | 58 | Context, Record[ASTStmtReader::NumStmtFields], Empty); |
3352 | 58 | break; |
3353 | | |
3354 | 50 | case STMT_OMP_SECTION_DIRECTIVE: |
3355 | 50 | S = OMPSectionDirective::CreateEmpty(Context, Empty); |
3356 | 50 | break; |
3357 | | |
3358 | 4 | case STMT_OMP_SCOPE_DIRECTIVE: |
3359 | 4 | S = OMPScopeDirective::CreateEmpty( |
3360 | 4 | Context, Record[ASTStmtReader::NumStmtFields], Empty); |
3361 | 4 | break; |
3362 | | |
3363 | 46 | case STMT_OMP_SINGLE_DIRECTIVE: |
3364 | 46 | S = OMPSingleDirective::CreateEmpty( |
3365 | 46 | Context, Record[ASTStmtReader::NumStmtFields], Empty); |
3366 | 46 | break; |
3367 | | |
3368 | 17 | case STMT_OMP_MASTER_DIRECTIVE: |
3369 | 17 | S = OMPMasterDirective::CreateEmpty(Context, Empty); |
3370 | 17 | break; |
3371 | | |
3372 | 78 | case STMT_OMP_CRITICAL_DIRECTIVE: |
3373 | 78 | S = OMPCriticalDirective::CreateEmpty( |
3374 | 78 | Context, Record[ASTStmtReader::NumStmtFields], Empty); |
3375 | 78 | break; |
3376 | | |
3377 | 123 | case STMT_OMP_PARALLEL_FOR_DIRECTIVE: { |
3378 | 123 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3379 | 123 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3380 | 123 | S = OMPParallelForDirective::CreateEmpty(Context, NumClauses, |
3381 | 123 | CollapsedNum, Empty); |
3382 | 123 | break; |
3383 | 26 | } |
3384 | | |
3385 | 144 | case STMT_OMP_PARALLEL_FOR_SIMD_DIRECTIVE: { |
3386 | 144 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3387 | 144 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3388 | 144 | S = OMPParallelForSimdDirective::CreateEmpty(Context, NumClauses, |
3389 | 144 | CollapsedNum, Empty); |
3390 | 144 | break; |
3391 | 26 | } |
3392 | | |
3393 | 63 | case STMT_OMP_PARALLEL_MASTER_DIRECTIVE: |
3394 | 63 | S = OMPParallelMasterDirective::CreateEmpty( |
3395 | 63 | Context, Record[ASTStmtReader::NumStmtFields], Empty); |
3396 | 63 | break; |
3397 | | |
3398 | 44 | case STMT_OMP_PARALLEL_MASKED_DIRECTIVE: |
3399 | 44 | S = OMPParallelMaskedDirective::CreateEmpty( |
3400 | 44 | Context, Record[ASTStmtReader::NumStmtFields], Empty); |
3401 | 44 | break; |
3402 | | |
3403 | 32 | case STMT_OMP_PARALLEL_SECTIONS_DIRECTIVE: |
3404 | 32 | S = OMPParallelSectionsDirective::CreateEmpty( |
3405 | 32 | Context, Record[ASTStmtReader::NumStmtFields], Empty); |
3406 | 32 | break; |
3407 | | |
3408 | 257 | case STMT_OMP_TASK_DIRECTIVE: |
3409 | 257 | S = OMPTaskDirective::CreateEmpty( |
3410 | 257 | Context, Record[ASTStmtReader::NumStmtFields], Empty); |
3411 | 257 | break; |
3412 | | |
3413 | 16 | case STMT_OMP_TASKYIELD_DIRECTIVE: |
3414 | 16 | S = OMPTaskyieldDirective::CreateEmpty(Context, Empty); |
3415 | 16 | break; |
3416 | | |
3417 | 30 | case STMT_OMP_BARRIER_DIRECTIVE: |
3418 | 30 | S = OMPBarrierDirective::CreateEmpty(Context, Empty); |
3419 | 30 | break; |
3420 | | |
3421 | 38 | case STMT_OMP_TASKWAIT_DIRECTIVE: |
3422 | 38 | S = OMPTaskwaitDirective::CreateEmpty( |
3423 | 38 | Context, Record[ASTStmtReader::NumStmtFields], Empty); |
3424 | 38 | break; |
3425 | | |
3426 | 10 | case STMT_OMP_ERROR_DIRECTIVE: |
3427 | 10 | S = OMPErrorDirective::CreateEmpty( |
3428 | 10 | Context, Record[ASTStmtReader::NumStmtFields], Empty); |
3429 | 10 | break; |
3430 | | |
3431 | 114 | case STMT_OMP_TASKGROUP_DIRECTIVE: |
3432 | 114 | S = OMPTaskgroupDirective::CreateEmpty( |
3433 | 114 | Context, Record[ASTStmtReader::NumStmtFields], Empty); |
3434 | 114 | break; |
3435 | | |
3436 | 50 | case STMT_OMP_FLUSH_DIRECTIVE: |
3437 | 50 | S = OMPFlushDirective::CreateEmpty( |
3438 | 50 | Context, Record[ASTStmtReader::NumStmtFields], Empty); |
3439 | 50 | break; |
3440 | | |
3441 | 28 | case STMT_OMP_DEPOBJ_DIRECTIVE: |
3442 | 28 | S = OMPDepobjDirective::CreateEmpty( |
3443 | 28 | Context, Record[ASTStmtReader::NumStmtFields], Empty); |
3444 | 28 | break; |
3445 | | |
3446 | 24 | case STMT_OMP_SCAN_DIRECTIVE: |
3447 | 24 | S = OMPScanDirective::CreateEmpty( |
3448 | 24 | Context, Record[ASTStmtReader::NumStmtFields], Empty); |
3449 | 24 | break; |
3450 | | |
3451 | 114 | case STMT_OMP_ORDERED_DIRECTIVE: { |
3452 | 114 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields]; |
3453 | 114 | bool HasAssociatedStmt = Record[ASTStmtReader::NumStmtFields + 2]; |
3454 | 114 | S = OMPOrderedDirective::CreateEmpty(Context, NumClauses, |
3455 | 114 | !HasAssociatedStmt, Empty); |
3456 | 114 | break; |
3457 | 26 | } |
3458 | | |
3459 | 6.29k | case STMT_OMP_ATOMIC_DIRECTIVE: |
3460 | 6.29k | S = OMPAtomicDirective::CreateEmpty( |
3461 | 6.29k | Context, Record[ASTStmtReader::NumStmtFields], Empty); |
3462 | 6.29k | break; |
3463 | | |
3464 | 5.16k | case STMT_OMP_TARGET_DIRECTIVE: |
3465 | 5.16k | S = OMPTargetDirective::CreateEmpty( |
3466 | 5.16k | Context, Record[ASTStmtReader::NumStmtFields], Empty); |
3467 | 5.16k | break; |
3468 | | |
3469 | 276 | case STMT_OMP_TARGET_DATA_DIRECTIVE: |
3470 | 276 | S = OMPTargetDataDirective::CreateEmpty( |
3471 | 276 | Context, Record[ASTStmtReader::NumStmtFields], Empty); |
3472 | 276 | break; |
3473 | | |
3474 | 343 | case STMT_OMP_TARGET_ENTER_DATA_DIRECTIVE: |
3475 | 343 | S = OMPTargetEnterDataDirective::CreateEmpty( |
3476 | 343 | Context, Record[ASTStmtReader::NumStmtFields], Empty); |
3477 | 343 | break; |
3478 | | |
3479 | 335 | case STMT_OMP_TARGET_EXIT_DATA_DIRECTIVE: |
3480 | 335 | S = OMPTargetExitDataDirective::CreateEmpty( |
3481 | 335 | Context, Record[ASTStmtReader::NumStmtFields], Empty); |
3482 | 335 | break; |
3483 | | |
3484 | 618 | case STMT_OMP_TARGET_PARALLEL_DIRECTIVE: |
3485 | 618 | S = OMPTargetParallelDirective::CreateEmpty( |
3486 | 618 | Context, Record[ASTStmtReader::NumStmtFields], Empty); |
3487 | 618 | break; |
3488 | | |
3489 | 502 | case STMT_OMP_TARGET_PARALLEL_FOR_DIRECTIVE: { |
3490 | 502 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3491 | 502 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3492 | 502 | S = OMPTargetParallelForDirective::CreateEmpty(Context, NumClauses, |
3493 | 502 | CollapsedNum, Empty); |
3494 | 502 | break; |
3495 | 26 | } |
3496 | | |
3497 | 406 | case STMT_OMP_TARGET_UPDATE_DIRECTIVE: |
3498 | 406 | S = OMPTargetUpdateDirective::CreateEmpty( |
3499 | 406 | Context, Record[ASTStmtReader::NumStmtFields], Empty); |
3500 | 406 | break; |
3501 | | |
3502 | 1.01k | case STMT_OMP_TEAMS_DIRECTIVE: |
3503 | 1.01k | S = OMPTeamsDirective::CreateEmpty( |
3504 | 1.01k | Context, Record[ASTStmtReader::NumStmtFields], Empty); |
3505 | 1.01k | break; |
3506 | | |
3507 | 78 | case STMT_OMP_CANCELLATION_POINT_DIRECTIVE: |
3508 | 78 | S = OMPCancellationPointDirective::CreateEmpty(Context, Empty); |
3509 | 78 | break; |
3510 | | |
3511 | 176 | case STMT_OMP_CANCEL_DIRECTIVE: |
3512 | 176 | S = OMPCancelDirective::CreateEmpty( |
3513 | 176 | Context, Record[ASTStmtReader::NumStmtFields], Empty); |
3514 | 176 | break; |
3515 | | |
3516 | 48 | case STMT_OMP_TASKLOOP_DIRECTIVE: { |
3517 | 48 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3518 | 48 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3519 | 48 | S = OMPTaskLoopDirective::CreateEmpty(Context, NumClauses, CollapsedNum, |
3520 | 48 | Empty); |
3521 | 48 | break; |
3522 | 26 | } |
3523 | | |
3524 | 46 | case STMT_OMP_TASKLOOP_SIMD_DIRECTIVE: { |
3525 | 46 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3526 | 46 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3527 | 46 | S = OMPTaskLoopSimdDirective::CreateEmpty(Context, NumClauses, |
3528 | 46 | CollapsedNum, Empty); |
3529 | 46 | break; |
3530 | 26 | } |
3531 | | |
3532 | 36 | case STMT_OMP_MASTER_TASKLOOP_DIRECTIVE: { |
3533 | 36 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3534 | 36 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3535 | 36 | S = OMPMasterTaskLoopDirective::CreateEmpty(Context, NumClauses, |
3536 | 36 | CollapsedNum, Empty); |
3537 | 36 | break; |
3538 | 26 | } |
3539 | | |
3540 | 12 | case STMT_OMP_MASKED_TASKLOOP_DIRECTIVE: { |
3541 | 12 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3542 | 12 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3543 | 12 | S = OMPMaskedTaskLoopDirective::CreateEmpty(Context, NumClauses, |
3544 | 12 | CollapsedNum, Empty); |
3545 | 12 | break; |
3546 | 26 | } |
3547 | | |
3548 | 50 | case STMT_OMP_MASTER_TASKLOOP_SIMD_DIRECTIVE: { |
3549 | 50 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3550 | 50 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3551 | 50 | S = OMPMasterTaskLoopSimdDirective::CreateEmpty(Context, NumClauses, |
3552 | 50 | CollapsedNum, Empty); |
3553 | 50 | break; |
3554 | 26 | } |
3555 | | |
3556 | 20 | case STMT_OMP_MASKED_TASKLOOP_SIMD_DIRECTIVE: { |
3557 | 20 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3558 | 20 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3559 | 20 | S = OMPMaskedTaskLoopSimdDirective::CreateEmpty(Context, NumClauses, |
3560 | 20 | CollapsedNum, Empty); |
3561 | 20 | break; |
3562 | 26 | } |
3563 | | |
3564 | 34 | case STMT_OMP_PARALLEL_MASTER_TASKLOOP_DIRECTIVE: { |
3565 | 34 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3566 | 34 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3567 | 34 | S = OMPParallelMasterTaskLoopDirective::CreateEmpty(Context, NumClauses, |
3568 | 34 | CollapsedNum, Empty); |
3569 | 34 | break; |
3570 | 26 | } |
3571 | | |
3572 | 12 | case STMT_OMP_PARALLEL_MASKED_TASKLOOP_DIRECTIVE: { |
3573 | 12 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3574 | 12 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3575 | 12 | S = OMPParallelMaskedTaskLoopDirective::CreateEmpty(Context, NumClauses, |
3576 | 12 | CollapsedNum, Empty); |
3577 | 12 | break; |
3578 | 26 | } |
3579 | | |
3580 | 48 | case STMT_OMP_PARALLEL_MASTER_TASKLOOP_SIMD_DIRECTIVE: { |
3581 | 48 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3582 | 48 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3583 | 48 | S = OMPParallelMasterTaskLoopSimdDirective::CreateEmpty( |
3584 | 48 | Context, NumClauses, CollapsedNum, Empty); |
3585 | 48 | break; |
3586 | 26 | } |
3587 | | |
3588 | 12 | case STMT_OMP_PARALLEL_MASKED_TASKLOOP_SIMD_DIRECTIVE: { |
3589 | 12 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3590 | 12 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3591 | 12 | S = OMPParallelMaskedTaskLoopSimdDirective::CreateEmpty( |
3592 | 12 | Context, NumClauses, CollapsedNum, Empty); |
3593 | 12 | break; |
3594 | 26 | } |
3595 | | |
3596 | 147 | case STMT_OMP_DISTRIBUTE_DIRECTIVE: { |
3597 | 147 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3598 | 147 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3599 | 147 | S = OMPDistributeDirective::CreateEmpty(Context, NumClauses, CollapsedNum, |
3600 | 147 | Empty); |
3601 | 147 | break; |
3602 | 26 | } |
3603 | | |
3604 | 300 | case STMT_OMP_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE: { |
3605 | 300 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3606 | 300 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3607 | 300 | S = OMPDistributeParallelForDirective::CreateEmpty(Context, NumClauses, |
3608 | 300 | CollapsedNum, Empty); |
3609 | 300 | break; |
3610 | 26 | } |
3611 | | |
3612 | 280 | case STMT_OMP_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE: { |
3613 | 280 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3614 | 280 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3615 | 280 | S = OMPDistributeParallelForSimdDirective::CreateEmpty(Context, NumClauses, |
3616 | 280 | CollapsedNum, |
3617 | 280 | Empty); |
3618 | 280 | break; |
3619 | 26 | } |
3620 | | |
3621 | 184 | case STMT_OMP_DISTRIBUTE_SIMD_DIRECTIVE: { |
3622 | 184 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3623 | 184 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3624 | 184 | S = OMPDistributeSimdDirective::CreateEmpty(Context, NumClauses, |
3625 | 184 | CollapsedNum, Empty); |
3626 | 184 | break; |
3627 | 26 | } |
3628 | | |
3629 | 600 | case STMT_OMP_TARGET_PARALLEL_FOR_SIMD_DIRECTIVE: { |
3630 | 600 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3631 | 600 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3632 | 600 | S = OMPTargetParallelForSimdDirective::CreateEmpty(Context, NumClauses, |
3633 | 600 | CollapsedNum, Empty); |
3634 | 600 | break; |
3635 | 26 | } |
3636 | | |
3637 | 572 | case STMT_OMP_TARGET_SIMD_DIRECTIVE: { |
3638 | 572 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3639 | 572 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3640 | 572 | S = OMPTargetSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum, |
3641 | 572 | Empty); |
3642 | 572 | break; |
3643 | 26 | } |
3644 | | |
3645 | 142 | case STMT_OMP_TEAMS_DISTRIBUTE_DIRECTIVE: { |
3646 | 142 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3647 | 142 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3648 | 142 | S = OMPTeamsDistributeDirective::CreateEmpty(Context, NumClauses, |
3649 | 142 | CollapsedNum, Empty); |
3650 | 142 | break; |
3651 | 26 | } |
3652 | | |
3653 | 246 | case STMT_OMP_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE: { |
3654 | 246 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3655 | 246 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3656 | 246 | S = OMPTeamsDistributeSimdDirective::CreateEmpty(Context, NumClauses, |
3657 | 246 | CollapsedNum, Empty); |
3658 | 246 | break; |
3659 | 26 | } |
3660 | | |
3661 | 410 | case STMT_OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE: { |
3662 | 410 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3663 | 410 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3664 | 410 | S = OMPTeamsDistributeParallelForSimdDirective::CreateEmpty( |
3665 | 410 | Context, NumClauses, CollapsedNum, Empty); |
3666 | 410 | break; |
3667 | 26 | } |
3668 | | |
3669 | 366 | case STMT_OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE: { |
3670 | 366 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3671 | 366 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3672 | 366 | S = OMPTeamsDistributeParallelForDirective::CreateEmpty( |
3673 | 366 | Context, NumClauses, CollapsedNum, Empty); |
3674 | 366 | break; |
3675 | 26 | } |
3676 | | |
3677 | 801 | case STMT_OMP_TARGET_TEAMS_DIRECTIVE: |
3678 | 801 | S = OMPTargetTeamsDirective::CreateEmpty( |
3679 | 801 | Context, Record[ASTStmtReader::NumStmtFields], Empty); |
3680 | 801 | break; |
3681 | | |
3682 | 565 | case STMT_OMP_TARGET_TEAMS_DISTRIBUTE_DIRECTIVE: { |
3683 | 565 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3684 | 565 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3685 | 565 | S = OMPTargetTeamsDistributeDirective::CreateEmpty(Context, NumClauses, |
3686 | 565 | CollapsedNum, Empty); |
3687 | 565 | break; |
3688 | 26 | } |
3689 | | |
3690 | 490 | case STMT_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE: { |
3691 | 490 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3692 | 490 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3693 | 490 | S = OMPTargetTeamsDistributeParallelForDirective::CreateEmpty( |
3694 | 490 | Context, NumClauses, CollapsedNum, Empty); |
3695 | 490 | break; |
3696 | 26 | } |
3697 | | |
3698 | 633 | case STMT_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE: { |
3699 | 633 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3700 | 633 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3701 | 633 | S = OMPTargetTeamsDistributeParallelForSimdDirective::CreateEmpty( |
3702 | 633 | Context, NumClauses, CollapsedNum, Empty); |
3703 | 633 | break; |
3704 | 26 | } |
3705 | | |
3706 | 587 | case STMT_OMP_TARGET_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE: { |
3707 | 587 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3708 | 587 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3709 | 587 | S = OMPTargetTeamsDistributeSimdDirective::CreateEmpty( |
3710 | 587 | Context, NumClauses, CollapsedNum, Empty); |
3711 | 587 | break; |
3712 | 26 | } |
3713 | | |
3714 | 68 | case STMT_OMP_INTEROP_DIRECTIVE: |
3715 | 68 | S = OMPInteropDirective::CreateEmpty( |
3716 | 68 | Context, Record[ASTStmtReader::NumStmtFields], Empty); |
3717 | 68 | break; |
3718 | | |
3719 | 40 | case STMT_OMP_DISPATCH_DIRECTIVE: |
3720 | 40 | S = OMPDispatchDirective::CreateEmpty( |
3721 | 40 | Context, Record[ASTStmtReader::NumStmtFields], Empty); |
3722 | 40 | break; |
3723 | | |
3724 | 30 | case STMT_OMP_MASKED_DIRECTIVE: |
3725 | 30 | S = OMPMaskedDirective::CreateEmpty( |
3726 | 30 | Context, Record[ASTStmtReader::NumStmtFields], Empty); |
3727 | 30 | break; |
3728 | | |
3729 | 0 | case STMT_OMP_GENERIC_LOOP_DIRECTIVE: { |
3730 | 0 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3731 | 0 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3732 | 0 | S = OMPGenericLoopDirective::CreateEmpty(Context, NumClauses, |
3733 | 0 | CollapsedNum, Empty); |
3734 | 0 | break; |
3735 | 26 | } |
3736 | | |
3737 | 63 | case STMT_OMP_TEAMS_GENERIC_LOOP_DIRECTIVE: { |
3738 | 63 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3739 | 63 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3740 | 63 | S = OMPTeamsGenericLoopDirective::CreateEmpty(Context, NumClauses, |
3741 | 63 | CollapsedNum, Empty); |
3742 | 63 | break; |
3743 | 26 | } |
3744 | | |
3745 | 144 | case STMT_OMP_TARGET_TEAMS_GENERIC_LOOP_DIRECTIVE: { |
3746 | 144 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3747 | 144 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3748 | 144 | S = OMPTargetTeamsGenericLoopDirective::CreateEmpty(Context, NumClauses, |
3749 | 144 | CollapsedNum, Empty); |
3750 | 144 | break; |
3751 | 26 | } |
3752 | | |
3753 | 8 | case STMT_OMP_PARALLEL_GENERIC_LOOP_DIRECTIVE: { |
3754 | 8 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3755 | 8 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3756 | 8 | S = OMPParallelGenericLoopDirective::CreateEmpty(Context, NumClauses, |
3757 | 8 | CollapsedNum, Empty); |
3758 | 8 | break; |
3759 | 26 | } |
3760 | | |
3761 | 211 | case STMT_OMP_TARGET_PARALLEL_GENERIC_LOOP_DIRECTIVE: { |
3762 | 211 | unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; |
3763 | 211 | unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; |
3764 | 211 | S = OMPTargetParallelGenericLoopDirective::CreateEmpty( |
3765 | 211 | Context, NumClauses, CollapsedNum, Empty); |
3766 | 211 | break; |
3767 | 26 | } |
3768 | | |
3769 | 30.8k | case EXPR_CXX_OPERATOR_CALL: |
3770 | 30.8k | S = CXXOperatorCallExpr::CreateEmpty( |
3771 | 30.8k | Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], |
3772 | 30.8k | /*HasFPFeatures=*/Record[ASTStmtReader::NumExprFields + 1], Empty); |
3773 | 30.8k | break; |
3774 | | |
3775 | 4.24k | case EXPR_CXX_MEMBER_CALL: |
3776 | 4.24k | S = CXXMemberCallExpr::CreateEmpty( |
3777 | 4.24k | Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], |
3778 | 4.24k | /*HasFPFeatures=*/Record[ASTStmtReader::NumExprFields + 1], Empty); |
3779 | 4.24k | break; |
3780 | | |
3781 | 5 | case EXPR_CXX_REWRITTEN_BINARY_OPERATOR: |
3782 | 5 | S = new (Context) CXXRewrittenBinaryOperator(Empty); |
3783 | 5 | break; |
3784 | | |
3785 | 6.80k | case EXPR_CXX_CONSTRUCT: |
3786 | 6.80k | S = CXXConstructExpr::CreateEmpty( |
3787 | 6.80k | Context, |
3788 | 6.80k | /* NumArgs=*/Record[ASTStmtReader::NumExprFields]); |
3789 | 6.80k | break; |
3790 | | |
3791 | 0 | case EXPR_CXX_INHERITED_CTOR_INIT: |
3792 | 0 | S = new (Context) CXXInheritedCtorInitExpr(Empty); |
3793 | 0 | break; |
3794 | | |
3795 | 2.10k | case EXPR_CXX_TEMPORARY_OBJECT: |
3796 | 2.10k | S = CXXTemporaryObjectExpr::CreateEmpty( |
3797 | 2.10k | Context, |
3798 | 2.10k | /* NumArgs=*/Record[ASTStmtReader::NumExprFields]); |
3799 | 2.10k | break; |
3800 | | |
3801 | 3.95k | case EXPR_CXX_STATIC_CAST: |
3802 | 3.95k | S = CXXStaticCastExpr::CreateEmpty( |
3803 | 3.95k | Context, |
3804 | 3.95k | /*PathSize*/ Record[ASTStmtReader::NumExprFields], |
3805 | 3.95k | /*HasFPFeatures*/ Record[ASTStmtReader::NumExprFields + 1]); |
3806 | 3.95k | break; |
3807 | | |
3808 | 3 | case EXPR_CXX_DYNAMIC_CAST: |
3809 | 3 | S = CXXDynamicCastExpr::CreateEmpty(Context, |
3810 | 3 | /*PathSize*/ Record[ASTStmtReader::NumExprFields]); |
3811 | 3 | break; |
3812 | | |
3813 | 99 | case EXPR_CXX_REINTERPRET_CAST: |
3814 | 99 | S = CXXReinterpretCastExpr::CreateEmpty(Context, |
3815 | 99 | /*PathSize*/ Record[ASTStmtReader::NumExprFields]); |
3816 | 99 | break; |
3817 | | |
3818 | 117 | case EXPR_CXX_CONST_CAST: |
3819 | 117 | S = CXXConstCastExpr::CreateEmpty(Context); |
3820 | 117 | break; |
3821 | | |
3822 | 0 | case EXPR_CXX_ADDRSPACE_CAST: |
3823 | 0 | S = CXXAddrspaceCastExpr::CreateEmpty(Context); |
3824 | 0 | break; |
3825 | | |
3826 | 593 | case EXPR_CXX_FUNCTIONAL_CAST: |
3827 | 593 | S = CXXFunctionalCastExpr::CreateEmpty( |
3828 | 593 | Context, |
3829 | 593 | /*PathSize*/ Record[ASTStmtReader::NumExprFields], |
3830 | 593 | /*HasFPFeatures*/ Record[ASTStmtReader::NumExprFields + 1]); |
3831 | 593 | break; |
3832 | | |
3833 | 1 | case EXPR_BUILTIN_BIT_CAST: |
3834 | 1 | assert(Record[ASTStmtReader::NumExprFields] == 0 && "Wrong PathSize!"); |
3835 | 1 | S = new (Context) BuiltinBitCastExpr(Empty); |
3836 | 1 | break; |
3837 | | |
3838 | 2 | case EXPR_USER_DEFINED_LITERAL: |
3839 | 2 | S = UserDefinedLiteral::CreateEmpty( |
3840 | 2 | Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], |
3841 | 2 | /*HasFPFeatures=*/Record[ASTStmtReader::NumExprFields + 1], Empty); |
3842 | 2 | break; |
3843 | | |
3844 | 5 | case EXPR_CXX_STD_INITIALIZER_LIST: |
3845 | 5 | S = new (Context) CXXStdInitializerListExpr(Empty); |
3846 | 5 | break; |
3847 | | |
3848 | 35.4k | case EXPR_CXX_BOOL_LITERAL: |
3849 | 35.4k | S = new (Context) CXXBoolLiteralExpr(Empty); |
3850 | 35.4k | break; |
3851 | | |
3852 | 4.48k | case EXPR_CXX_NULL_PTR_LITERAL: |
3853 | 4.48k | S = new (Context) CXXNullPtrLiteralExpr(Empty); |
3854 | 4.48k | break; |
3855 | | |
3856 | 4 | case EXPR_CXX_TYPEID_EXPR: |
3857 | 4 | S = new (Context) CXXTypeidExpr(Empty, true); |
3858 | 4 | break; |
3859 | | |
3860 | 26 | case EXPR_CXX_TYPEID_TYPE: |
3861 | 26 | S = new (Context) CXXTypeidExpr(Empty, false); |
3862 | 26 | break; |
3863 | | |
3864 | 1 | case EXPR_CXX_UUIDOF_EXPR: |
3865 | 1 | S = new (Context) CXXUuidofExpr(Empty, true); |
3866 | 1 | break; |
3867 | | |
3868 | 36 | case EXPR_CXX_PROPERTY_REF_EXPR: |
3869 | 36 | S = new (Context) MSPropertyRefExpr(Empty); |
3870 | 36 | break; |
3871 | | |
3872 | 70 | case EXPR_CXX_PROPERTY_SUBSCRIPT_EXPR: |
3873 | 70 | S = new (Context) MSPropertySubscriptExpr(Empty); |
3874 | 70 | break; |
3875 | | |
3876 | 0 | case EXPR_CXX_UUIDOF_TYPE: |
3877 | 0 | S = new (Context) CXXUuidofExpr(Empty, false); |
3878 | 0 | break; |
3879 | | |
3880 | 49.1k | case EXPR_CXX_THIS: |
3881 | 49.1k | S = CXXThisExpr::CreateEmpty(Context); |
3882 | 49.1k | break; |
3883 | | |
3884 | 6 | case EXPR_CXX_THROW: |
3885 | 6 | S = new (Context) CXXThrowExpr(Empty); |
3886 | 6 | break; |
3887 | | |
3888 | 560 | case EXPR_CXX_DEFAULT_ARG: |
3889 | 560 | S = CXXDefaultArgExpr::CreateEmpty( |
3890 | 560 | Context, /*HasRewrittenInit=*/Record[ASTStmtReader::NumExprFields]); |
3891 | 560 | break; |
3892 | | |
3893 | 68 | case EXPR_CXX_DEFAULT_INIT: |
3894 | 68 | S = CXXDefaultInitExpr::CreateEmpty( |
3895 | 68 | Context, /*HasRewrittenInit=*/Record[ASTStmtReader::NumExprFields]); |
3896 | 68 | break; |
3897 | | |
3898 | 1.41k | case EXPR_CXX_BIND_TEMPORARY: |
3899 | 1.41k | S = new (Context) CXXBindTemporaryExpr(Empty); |
3900 | 1.41k | break; |
3901 | | |
3902 | 147 | case EXPR_CXX_SCALAR_VALUE_INIT: |
3903 | 147 | S = new (Context) CXXScalarValueInitExpr(Empty); |
3904 | 147 | break; |
3905 | | |
3906 | 242 | case EXPR_CXX_NEW: |
3907 | 242 | S = CXXNewExpr::CreateEmpty( |
3908 | 242 | Context, |
3909 | 242 | /*IsArray=*/Record[ASTStmtReader::NumExprFields], |
3910 | 242 | /*HasInit=*/Record[ASTStmtReader::NumExprFields + 1], |
3911 | 242 | /*NumPlacementArgs=*/Record[ASTStmtReader::NumExprFields + 2], |
3912 | 242 | /*IsParenTypeId=*/Record[ASTStmtReader::NumExprFields + 3]); |
3913 | 242 | break; |
3914 | | |
3915 | 63 | case EXPR_CXX_DELETE: |
3916 | 63 | S = new (Context) CXXDeleteExpr(Empty); |
3917 | 63 | break; |
3918 | | |
3919 | 113 | case EXPR_CXX_PSEUDO_DESTRUCTOR: |
3920 | 113 | S = new (Context) CXXPseudoDestructorExpr(Empty); |
3921 | 113 | break; |
3922 | | |
3923 | 1.71k | case EXPR_EXPR_WITH_CLEANUPS: |
3924 | 1.71k | S = ExprWithCleanups::Create(Context, Empty, |
3925 | 1.71k | Record[ASTStmtReader::NumExprFields]); |
3926 | 1.71k | break; |
3927 | | |
3928 | 52.8k | case EXPR_CXX_DEPENDENT_SCOPE_MEMBER: |
3929 | 52.8k | S = CXXDependentScopeMemberExpr::CreateEmpty( |
3930 | 52.8k | Context, |
3931 | 52.8k | /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields], |
3932 | 52.8k | /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields + 1], |
3933 | | /*HasFirstQualifierFoundInScope=*/ |
3934 | 52.8k | Record[ASTStmtReader::NumExprFields + 2]); |
3935 | 52.8k | break; |
3936 | | |
3937 | 140k | case EXPR_CXX_DEPENDENT_SCOPE_DECL_REF: |
3938 | 140k | S = DependentScopeDeclRefExpr::CreateEmpty(Context, |
3939 | 140k | /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields], |
3940 | 140k | /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields] |
3941 | 140k | ? Record[ASTStmtReader::NumExprFields + 1]1.83k |
3942 | 140k | : 0139k ); |
3943 | 140k | break; |
3944 | | |
3945 | 8.82k | case EXPR_CXX_UNRESOLVED_CONSTRUCT: |
3946 | 8.82k | S = CXXUnresolvedConstructExpr::CreateEmpty(Context, |
3947 | 8.82k | /*NumArgs=*/Record[ASTStmtReader::NumExprFields]); |
3948 | 8.82k | break; |
3949 | | |
3950 | 13.8k | case EXPR_CXX_UNRESOLVED_MEMBER: |
3951 | 13.8k | S = UnresolvedMemberExpr::CreateEmpty( |
3952 | 13.8k | Context, |
3953 | 13.8k | /*NumResults=*/Record[ASTStmtReader::NumExprFields], |
3954 | 13.8k | /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields + 1], |
3955 | | /*NumTemplateArgs=*/ |
3956 | 13.8k | Record[ASTStmtReader::NumExprFields + 1] |
3957 | 13.8k | ? Record[ASTStmtReader::NumExprFields + 2]14 |
3958 | 13.8k | : 013.8k ); |
3959 | 13.8k | break; |
3960 | | |
3961 | 55.4k | case EXPR_CXX_UNRESOLVED_LOOKUP: |
3962 | 55.4k | S = UnresolvedLookupExpr::CreateEmpty( |
3963 | 55.4k | Context, |
3964 | 55.4k | /*NumResults=*/Record[ASTStmtReader::NumExprFields], |
3965 | 55.4k | /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields + 1], |
3966 | | /*NumTemplateArgs=*/ |
3967 | 55.4k | Record[ASTStmtReader::NumExprFields + 1] |
3968 | 55.4k | ? Record[ASTStmtReader::NumExprFields + 2]9.26k |
3969 | 55.4k | : 046.1k ); |
3970 | 55.4k | break; |
3971 | | |
3972 | 11.1k | case EXPR_TYPE_TRAIT: |
3973 | 11.1k | S = TypeTraitExpr::CreateDeserialized(Context, |
3974 | 11.1k | Record[ASTStmtReader::NumExprFields]); |
3975 | 11.1k | break; |
3976 | | |
3977 | 3 | case EXPR_ARRAY_TYPE_TRAIT: |
3978 | 3 | S = new (Context) ArrayTypeTraitExpr(Empty); |
3979 | 3 | break; |
3980 | | |
3981 | 2 | case EXPR_CXX_EXPRESSION_TRAIT: |
3982 | 2 | S = new (Context) ExpressionTraitExpr(Empty); |
3983 | 2 | break; |
3984 | | |
3985 | 3.18k | case EXPR_CXX_NOEXCEPT: |
3986 | 3.18k | S = new (Context) CXXNoexceptExpr(Empty); |
3987 | 3.18k | break; |
3988 | | |
3989 | 6.66k | case EXPR_PACK_EXPANSION: |
3990 | 6.66k | S = new (Context) PackExpansionExpr(Empty); |
3991 | 6.66k | break; |
3992 | | |
3993 | 10.0k | case EXPR_SIZEOF_PACK: |
3994 | 10.0k | S = SizeOfPackExpr::CreateDeserialized( |
3995 | 10.0k | Context, |
3996 | 10.0k | /*NumPartialArgs=*/Record[ASTStmtReader::NumExprFields]); |
3997 | 10.0k | break; |
3998 | | |
3999 | 50.3k | case EXPR_SUBST_NON_TYPE_TEMPLATE_PARM: |
4000 | 50.3k | S = new (Context) SubstNonTypeTemplateParmExpr(Empty); |
4001 | 50.3k | break; |
4002 | | |
4003 | 0 | case EXPR_SUBST_NON_TYPE_TEMPLATE_PARM_PACK: |
4004 | 0 | S = new (Context) SubstNonTypeTemplateParmPackExpr(Empty); |
4005 | 0 | break; |
4006 | | |
4007 | 8 | case EXPR_FUNCTION_PARM_PACK: |
4008 | 8 | S = FunctionParmPackExpr::CreateEmpty(Context, |
4009 | 8 | Record[ASTStmtReader::NumExprFields]); |
4010 | 8 | break; |
4011 | | |
4012 | 2.16k | case EXPR_MATERIALIZE_TEMPORARY: |
4013 | 2.16k | S = new (Context) MaterializeTemporaryExpr(Empty); |
4014 | 2.16k | break; |
4015 | | |
4016 | 11 | case EXPR_CXX_FOLD: |
4017 | 11 | S = new (Context) CXXFoldExpr(Empty); |
4018 | 11 | break; |
4019 | | |
4020 | 3 | case EXPR_CXX_PAREN_LIST_INIT: |
4021 | 3 | S = CXXParenListInitExpr::CreateEmpty( |
4022 | 3 | Context, /*numExprs=*/Record[ASTStmtReader::NumExprFields], Empty); |
4023 | 3 | break; |
4024 | | |
4025 | 1.32k | case EXPR_OPAQUE_VALUE: |
4026 | 1.32k | S = new (Context) OpaqueValueExpr(Empty); |
4027 | 1.32k | break; |
4028 | | |
4029 | 1 | case EXPR_CUDA_KERNEL_CALL: |
4030 | 1 | S = CUDAKernelCallExpr::CreateEmpty( |
4031 | 1 | Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], |
4032 | 1 | /*HasFPFeatures=*/Record[ASTStmtReader::NumExprFields + 1], Empty); |
4033 | 1 | break; |
4034 | | |
4035 | 0 | case EXPR_ASTYPE: |
4036 | 0 | S = new (Context) AsTypeExpr(Empty); |
4037 | 0 | break; |
4038 | | |
4039 | 298 | case EXPR_PSEUDO_OBJECT: { |
4040 | 298 | unsigned numSemanticExprs = Record[ASTStmtReader::NumExprFields]; |
4041 | 298 | S = PseudoObjectExpr::Create(Context, Empty, numSemanticExprs); |
4042 | 298 | break; |
4043 | 1 | } |
4044 | | |
4045 | 204 | case EXPR_ATOMIC: |
4046 | 204 | S = new (Context) AtomicExpr(Empty); |
4047 | 204 | break; |
4048 | | |
4049 | 728 | case EXPR_LAMBDA: { |
4050 | 728 | unsigned NumCaptures = Record[ASTStmtReader::NumExprFields]; |
4051 | 728 | S = LambdaExpr::CreateDeserialized(Context, NumCaptures); |
4052 | 728 | break; |
4053 | 1 | } |
4054 | | |
4055 | 3 | case STMT_COROUTINE_BODY: { |
4056 | 3 | unsigned NumParams = Record[ASTStmtReader::NumStmtFields]; |
4057 | 3 | S = CoroutineBodyStmt::Create(Context, Empty, NumParams); |
4058 | 3 | break; |
4059 | 1 | } |
4060 | | |
4061 | 3 | case STMT_CORETURN: |
4062 | 3 | S = new (Context) CoreturnStmt(Empty); |
4063 | 3 | break; |
4064 | | |
4065 | 7 | case EXPR_COAWAIT: |
4066 | 7 | S = new (Context) CoawaitExpr(Empty); |
4067 | 7 | break; |
4068 | | |
4069 | 1 | case EXPR_COYIELD: |
4070 | 1 | S = new (Context) CoyieldExpr(Empty); |
4071 | 1 | break; |
4072 | | |
4073 | 1 | case EXPR_DEPENDENT_COAWAIT: |
4074 | 1 | S = new (Context) DependentCoawaitExpr(Empty); |
4075 | 1 | break; |
4076 | | |
4077 | 78 | case EXPR_CONCEPT_SPECIALIZATION: { |
4078 | 78 | S = new (Context) ConceptSpecializationExpr(Empty); |
4079 | 78 | break; |
4080 | 1 | } |
4081 | | |
4082 | 29 | case EXPR_REQUIRES: |
4083 | 29 | unsigned numLocalParameters = Record[ASTStmtReader::NumExprFields]; |
4084 | 29 | unsigned numRequirement = Record[ASTStmtReader::NumExprFields + 1]; |
4085 | 29 | S = RequiresExpr::Create(Context, Empty, numLocalParameters, |
4086 | 29 | numRequirement); |
4087 | 29 | break; |
4088 | 3.37M | } |
4089 | | |
4090 | | // We hit a STMT_STOP, so we're done with this expression. |
4091 | 3.37M | if (Finished) |
4092 | 471k | break; |
4093 | | |
4094 | 2.90M | ++NumStatementsRead; |
4095 | | |
4096 | 2.90M | if (S && !IsStmtReference2.65M ) { |
4097 | 2.40M | Reader.Visit(S); |
4098 | 2.40M | StmtEntries[Cursor.GetCurrentBitNo()] = S; |
4099 | 2.40M | } |
4100 | | |
4101 | 2.90M | assert(Record.getIdx() == Record.size() && |
4102 | 2.90M | "Invalid deserialization of statement"); |
4103 | 2.90M | StmtStack.push_back(S); |
4104 | 2.90M | } |
4105 | 471k | Done: |
4106 | 471k | assert(StmtStack.size() > PrevNumStmts && "Read too many sub-stmts!"); |
4107 | 471k | assert(StmtStack.size() == PrevNumStmts + 1 && "Extra expressions on stack!"); |
4108 | 471k | return StmtStack.pop_back_val(); |
4109 | 471k | } |