clang 23.0.0git
ASTReaderStmt.cpp
Go to the documentation of this file.
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
17#include "clang/AST/Decl.h"
19#include "clang/AST/DeclCXX.h"
20#include "clang/AST/DeclGroup.h"
21#include "clang/AST/DeclObjC.h"
25#include "clang/AST/Expr.h"
26#include "clang/AST/ExprCXX.h"
27#include "clang/AST/ExprObjC.h"
32#include "clang/AST/Stmt.h"
33#include "clang/AST/StmtCXX.h"
34#include "clang/AST/StmtObjC.h"
36#include "clang/AST/StmtSYCL.h"
39#include "clang/AST/Type.h"
43#include "clang/Basic/LLVM.h"
49#include "clang/Lex/Token.h"
52#include "llvm/ADT/DenseMap.h"
53#include "llvm/ADT/SmallVector.h"
54#include "llvm/ADT/StringRef.h"
55#include "llvm/Bitstream/BitstreamReader.h"
56#include "llvm/Support/ErrorHandling.h"
57#include <algorithm>
58#include <cassert>
59#include <cstdint>
60#include <optional>
61#include <string>
62
63using namespace clang;
64using namespace serialization;
65
66namespace clang {
67
68 class ASTStmtReader : public StmtVisitor<ASTStmtReader> {
69 ASTRecordReader &Record;
70 llvm::BitstreamCursor &DeclsCursor;
71
72 std::optional<BitsUnpacker> CurrentUnpackingBits;
73
74 SourceLocation readSourceLocation() {
75 return Record.readSourceLocation();
76 }
77
78 SourceRange readSourceRange() {
79 return Record.readSourceRange();
80 }
81
82 std::string readString() {
83 return Record.readString();
84 }
85
86 TypeSourceInfo *readTypeSourceInfo() {
87 return Record.readTypeSourceInfo();
88 }
89
90 Decl *readDecl() {
91 return Record.readDecl();
92 }
93
94 template<typename T>
95 T *readDeclAs() {
96 return Record.readDeclAs<T>();
97 }
98
99 public:
100 ASTStmtReader(ASTRecordReader &Record, llvm::BitstreamCursor &Cursor)
101 : Record(Record), DeclsCursor(Cursor) {}
102
103 /// The number of record fields required for the Stmt class
104 /// itself.
105 static const unsigned NumStmtFields = 0;
106
107 /// The number of record fields required for the Expr class
108 /// itself.
109 static const unsigned NumExprFields = NumStmtFields + 2;
110
111 /// The number of bits required for the packing bits for the Expr class.
112 static const unsigned NumExprBits = 10;
113
114 /// Read and initialize a ExplicitTemplateArgumentList structure.
116 TemplateArgumentLoc *ArgsLocArray,
117 unsigned NumTemplateArgs);
118
119 void VisitStmt(Stmt *S);
120#define STMT(Type, Base) \
121 void Visit##Type(Type *);
122#include "clang/AST/StmtNodes.inc"
123 };
124
125} // namespace clang
126
128 TemplateArgumentLoc *ArgsLocArray,
129 unsigned NumTemplateArgs) {
130 SourceLocation TemplateKWLoc = readSourceLocation();
132 ArgInfo.setLAngleLoc(readSourceLocation());
133 ArgInfo.setRAngleLoc(readSourceLocation());
134 for (unsigned i = 0; i != NumTemplateArgs; ++i)
135 ArgInfo.addArgument(Record.readTemplateArgumentLoc());
136 Args.initializeFrom(TemplateKWLoc, ArgInfo, ArgsLocArray);
137}
138
140 assert(Record.getIdx() == NumStmtFields && "Incorrect statement field count");
141}
142
143void ASTStmtReader::VisitNullStmt(NullStmt *S) {
144 VisitStmt(S);
145 S->setSemiLoc(readSourceLocation());
146 S->NullStmtBits.HasLeadingEmptyMacro = Record.readInt();
147}
148
149void ASTStmtReader::VisitCompoundStmt(CompoundStmt *S) {
150 VisitStmt(S);
152 unsigned NumStmts = Record.readInt();
153 unsigned HasFPFeatures = Record.readInt();
154 assert(S->hasStoredFPFeatures() == HasFPFeatures);
155 while (NumStmts--)
156 Stmts.push_back(Record.readSubStmt());
157 S->setStmts(Stmts);
158 if (HasFPFeatures)
159 S->setStoredFPFeatures(
161 S->LBraceLoc = readSourceLocation();
162 S->RBraceLoc = readSourceLocation();
163}
164
165void ASTStmtReader::VisitSwitchCase(SwitchCase *S) {
166 VisitStmt(S);
167 Record.recordSwitchCaseID(S, Record.readInt());
168 S->setKeywordLoc(readSourceLocation());
169 S->setColonLoc(readSourceLocation());
170}
171
172void ASTStmtReader::VisitCaseStmt(CaseStmt *S) {
173 VisitSwitchCase(S);
174 bool CaseStmtIsGNURange = Record.readInt();
175 S->setLHS(Record.readSubExpr());
176 S->setSubStmt(Record.readSubStmt());
177 if (CaseStmtIsGNURange) {
178 S->setRHS(Record.readSubExpr());
179 S->setEllipsisLoc(readSourceLocation());
180 }
181}
182
183void ASTStmtReader::VisitDefaultStmt(DefaultStmt *S) {
184 VisitSwitchCase(S);
185 S->setSubStmt(Record.readSubStmt());
186}
187
188void ASTStmtReader::VisitLabelStmt(LabelStmt *S) {
189 VisitStmt(S);
190 bool IsSideEntry = Record.readInt();
191 auto *LD = readDeclAs<LabelDecl>();
192 LD->setStmt(S);
193 S->setDecl(LD);
194 S->setSubStmt(Record.readSubStmt());
195 S->setIdentLoc(readSourceLocation());
196 S->setSideEntry(IsSideEntry);
197}
198
199void ASTStmtReader::VisitAttributedStmt(AttributedStmt *S) {
200 VisitStmt(S);
201 // NumAttrs in AttributedStmt is set when creating an empty
202 // AttributedStmt in AttributedStmt::CreateEmpty, since it is needed
203 // to allocate the right amount of space for the trailing Attr *.
204 uint64_t NumAttrs = Record.readInt();
205 AttrVec Attrs;
206 Record.readAttributes(Attrs);
207 (void)NumAttrs;
208 assert(NumAttrs == S->AttributedStmtBits.NumAttrs);
209 assert(NumAttrs == Attrs.size());
210 std::copy(Attrs.begin(), Attrs.end(), S->getAttrArrayPtr());
211 S->SubStmt = Record.readSubStmt();
212 S->AttributedStmtBits.AttrLoc = readSourceLocation();
213}
214
215void ASTStmtReader::VisitIfStmt(IfStmt *S) {
216 VisitStmt(S);
217
218 CurrentUnpackingBits.emplace(Record.readInt());
219
220 bool HasElse = CurrentUnpackingBits->getNextBit();
221 bool HasVar = CurrentUnpackingBits->getNextBit();
222 bool HasInit = CurrentUnpackingBits->getNextBit();
223
224 S->setStatementKind(static_cast<IfStatementKind>(Record.readInt()));
225 S->setCond(Record.readSubExpr());
226 S->setThen(Record.readSubStmt());
227 if (HasElse)
228 S->setElse(Record.readSubStmt());
229 if (HasVar)
230 S->setConditionVariableDeclStmt(cast<DeclStmt>(Record.readSubStmt()));
231 if (HasInit)
232 S->setInit(Record.readSubStmt());
233
234 S->setIfLoc(readSourceLocation());
235 S->setLParenLoc(readSourceLocation());
236 S->setRParenLoc(readSourceLocation());
237 if (HasElse)
238 S->setElseLoc(readSourceLocation());
239}
240
241void ASTStmtReader::VisitSwitchStmt(SwitchStmt *S) {
242 VisitStmt(S);
243
244 bool HasInit = Record.readInt();
245 bool HasVar = Record.readInt();
246 bool AllEnumCasesCovered = Record.readInt();
247 if (AllEnumCasesCovered)
249
250 S->setCond(Record.readSubExpr());
251 S->setBody(Record.readSubStmt());
252 if (HasInit)
253 S->setInit(Record.readSubStmt());
254 if (HasVar)
255 S->setConditionVariableDeclStmt(cast<DeclStmt>(Record.readSubStmt()));
256
257 S->setSwitchLoc(readSourceLocation());
258 S->setLParenLoc(readSourceLocation());
259 S->setRParenLoc(readSourceLocation());
260
261 SwitchCase *PrevSC = nullptr;
262 for (auto E = Record.size(); Record.getIdx() != E; ) {
263 SwitchCase *SC = Record.getSwitchCaseWithID(Record.readInt());
264 if (PrevSC)
265 PrevSC->setNextSwitchCase(SC);
266 else
267 S->setSwitchCaseList(SC);
268
269 PrevSC = SC;
270 }
271}
272
273void ASTStmtReader::VisitWhileStmt(WhileStmt *S) {
274 VisitStmt(S);
275
276 bool HasVar = Record.readInt();
277
278 S->setCond(Record.readSubExpr());
279 S->setBody(Record.readSubStmt());
280 if (HasVar)
281 S->setConditionVariableDeclStmt(cast<DeclStmt>(Record.readSubStmt()));
282
283 S->setWhileLoc(readSourceLocation());
284 S->setLParenLoc(readSourceLocation());
285 S->setRParenLoc(readSourceLocation());
286}
287
288void ASTStmtReader::VisitDoStmt(DoStmt *S) {
289 VisitStmt(S);
290 S->setCond(Record.readSubExpr());
291 S->setBody(Record.readSubStmt());
292 S->setDoLoc(readSourceLocation());
293 S->setWhileLoc(readSourceLocation());
294 S->setRParenLoc(readSourceLocation());
295}
296
297void ASTStmtReader::VisitForStmt(ForStmt *S) {
298 VisitStmt(S);
299 S->setInit(Record.readSubStmt());
300 S->setCond(Record.readSubExpr());
301 S->setConditionVariableDeclStmt(cast_or_null<DeclStmt>(Record.readSubStmt()));
302 S->setInc(Record.readSubExpr());
303 S->setBody(Record.readSubStmt());
304 S->setForLoc(readSourceLocation());
305 S->setLParenLoc(readSourceLocation());
306 S->setRParenLoc(readSourceLocation());
307}
308
309void ASTStmtReader::VisitGotoStmt(GotoStmt *S) {
310 VisitStmt(S);
311 S->setLabel(readDeclAs<LabelDecl>());
312 S->setGotoLoc(readSourceLocation());
313 S->setLabelLoc(readSourceLocation());
314}
315
316void ASTStmtReader::VisitIndirectGotoStmt(IndirectGotoStmt *S) {
317 VisitStmt(S);
318 S->setGotoLoc(readSourceLocation());
319 S->setStarLoc(readSourceLocation());
320 S->setTarget(Record.readSubExpr());
321}
322
323void ASTStmtReader::VisitLoopControlStmt(LoopControlStmt *S) {
324 VisitStmt(S);
325 S->setKwLoc(readSourceLocation());
326 if (Record.readBool()) {
327 S->setLabelDecl(readDeclAs<LabelDecl>());
328 S->setLabelLoc(readSourceLocation());
329 }
330}
331
332void ASTStmtReader::VisitContinueStmt(ContinueStmt *S) {
333 VisitLoopControlStmt(S);
334}
335
336void ASTStmtReader::VisitBreakStmt(BreakStmt *S) { VisitLoopControlStmt(S); }
337
338void ASTStmtReader::VisitDeferStmt(DeferStmt *S) {
339 VisitStmt(S);
340 S->setDeferLoc(readSourceLocation());
341 S->setBody(Record.readSubStmt());
342}
343
344void ASTStmtReader::VisitReturnStmt(ReturnStmt *S) {
345 VisitStmt(S);
346
347 bool HasNRVOCandidate = Record.readInt();
348
349 S->setRetValue(Record.readSubExpr());
350 if (HasNRVOCandidate)
351 S->setNRVOCandidate(readDeclAs<VarDecl>());
352
353 S->setReturnLoc(readSourceLocation());
354}
355
356void ASTStmtReader::VisitDeclStmt(DeclStmt *S) {
357 VisitStmt(S);
358 S->setStartLoc(readSourceLocation());
359 S->setEndLoc(readSourceLocation());
360
361 if (Record.size() - Record.getIdx() == 1) {
362 // Single declaration
363 S->setDeclGroup(DeclGroupRef(readDecl()));
364 } else {
365 SmallVector<Decl *, 16> Decls;
366 int N = Record.size() - Record.getIdx();
367 Decls.reserve(N);
368 for (int I = 0; I < N; ++I)
369 Decls.push_back(readDecl());
370 S->setDeclGroup(DeclGroupRef(DeclGroup::Create(Record.getContext(),
371 Decls.data(),
372 Decls.size())));
373 }
374}
375
376void ASTStmtReader::VisitAsmStmt(AsmStmt *S) {
377 VisitStmt(S);
378 S->NumOutputs = Record.readInt();
379 S->NumInputs = Record.readInt();
380 S->NumClobbers = Record.readInt();
381 S->setAsmLoc(readSourceLocation());
382 S->setVolatile(Record.readInt());
383 S->setSimple(Record.readInt());
384}
385
386void ASTStmtReader::VisitGCCAsmStmt(GCCAsmStmt *S) {
387 VisitAsmStmt(S);
388 S->NumLabels = Record.readInt();
389 S->setRParenLoc(readSourceLocation());
390 S->setAsmStringExpr(cast_or_null<Expr>(Record.readSubStmt()));
391
392 unsigned NumOutputs = S->getNumOutputs();
393 unsigned NumInputs = S->getNumInputs();
394 unsigned NumClobbers = S->getNumClobbers();
395 unsigned NumLabels = S->getNumLabels();
396
397 // Outputs and inputs
398 SmallVector<IdentifierInfo *, 16> Names;
399 SmallVector<Expr *, 16> Constraints;
400 SmallVector<Stmt*, 16> Exprs;
401 for (unsigned I = 0, N = NumOutputs + NumInputs; I != N; ++I) {
402 Names.push_back(Record.readIdentifier());
403 Constraints.push_back(cast_or_null<Expr>(Record.readSubStmt()));
404 Exprs.push_back(Record.readSubStmt());
405 }
406
407 // Constraints
408 SmallVector<Expr *, 16> Clobbers;
409 for (unsigned I = 0; I != NumClobbers; ++I)
410 Clobbers.push_back(cast_or_null<Expr>(Record.readSubStmt()));
411
412 // Labels
413 for (unsigned I = 0, N = NumLabels; I != N; ++I) {
414 Names.push_back(Record.readIdentifier());
415 Exprs.push_back(Record.readSubStmt());
416 }
417
418 S->setOutputsAndInputsAndClobbers(Record.getContext(),
419 Names.data(), Constraints.data(),
420 Exprs.data(), NumOutputs, NumInputs,
421 NumLabels,
422 Clobbers.data(), NumClobbers);
423}
424
425void ASTStmtReader::VisitMSAsmStmt(MSAsmStmt *S) {
426 VisitAsmStmt(S);
427 S->LBraceLoc = readSourceLocation();
428 S->EndLoc = readSourceLocation();
429 S->NumAsmToks = Record.readInt();
430 std::string AsmStr = readString();
431
432 // Read the tokens.
433 SmallVector<Token, 16> AsmToks;
434 AsmToks.reserve(S->NumAsmToks);
435 for (unsigned i = 0, e = S->NumAsmToks; i != e; ++i) {
436 AsmToks.push_back(Record.readToken());
437 }
438
439 // The calls to reserve() for the FooData vectors are mandatory to
440 // prevent dead StringRefs in the Foo vectors.
441
442 // Read the clobbers.
443 SmallVector<std::string, 16> ClobbersData;
444 SmallVector<StringRef, 16> Clobbers;
445 ClobbersData.reserve(S->NumClobbers);
446 Clobbers.reserve(S->NumClobbers);
447 for (unsigned i = 0, e = S->NumClobbers; i != e; ++i) {
448 ClobbersData.push_back(readString());
449 Clobbers.push_back(ClobbersData.back());
450 }
451
452 // Read the operands.
453 unsigned NumOperands = S->NumOutputs + S->NumInputs;
454 SmallVector<Expr*, 16> Exprs;
455 SmallVector<std::string, 16> ConstraintsData;
456 SmallVector<StringRef, 16> Constraints;
457 Exprs.reserve(NumOperands);
458 ConstraintsData.reserve(NumOperands);
459 Constraints.reserve(NumOperands);
460 for (unsigned i = 0; i != NumOperands; ++i) {
461 Exprs.push_back(cast<Expr>(Record.readSubStmt()));
462 ConstraintsData.push_back(readString());
463 Constraints.push_back(ConstraintsData.back());
464 }
465
466 S->initialize(Record.getContext(), AsmStr, AsmToks,
467 Constraints, Exprs, Clobbers);
468}
469
470void ASTStmtReader::VisitCoroutineBodyStmt(CoroutineBodyStmt *S) {
471 VisitStmt(S);
472 assert(Record.peekInt() == S->NumParams);
473 Record.skipInts(1);
474 auto *StoredStmts = S->getStoredStmts();
475 for (unsigned i = 0;
476 i < CoroutineBodyStmt::SubStmt::FirstParamMove + S->NumParams; ++i)
477 StoredStmts[i] = Record.readSubStmt();
478}
479
480void ASTStmtReader::VisitCoreturnStmt(CoreturnStmt *S) {
481 VisitStmt(S);
482 S->CoreturnLoc = Record.readSourceLocation();
483 for (auto &SubStmt: S->SubStmts)
484 SubStmt = Record.readSubStmt();
485 S->IsImplicit = Record.readInt() != 0;
486}
487
488void ASTStmtReader::VisitCoawaitExpr(CoawaitExpr *E) {
489 VisitExpr(E);
490 E->KeywordLoc = readSourceLocation();
491 for (auto &SubExpr: E->SubExprs)
492 SubExpr = Record.readSubStmt();
493 E->OpaqueValue = cast_or_null<OpaqueValueExpr>(Record.readSubStmt());
494 E->setIsImplicit(Record.readInt() != 0);
495}
496
497void ASTStmtReader::VisitCoyieldExpr(CoyieldExpr *E) {
498 VisitExpr(E);
499 E->KeywordLoc = readSourceLocation();
500 for (auto &SubExpr: E->SubExprs)
501 SubExpr = Record.readSubStmt();
502 E->OpaqueValue = cast_or_null<OpaqueValueExpr>(Record.readSubStmt());
503}
504
505void ASTStmtReader::VisitDependentCoawaitExpr(DependentCoawaitExpr *E) {
506 VisitExpr(E);
507 E->KeywordLoc = readSourceLocation();
508 for (auto &SubExpr: E->SubExprs)
509 SubExpr = Record.readSubStmt();
510}
511
512void ASTStmtReader::VisitCapturedStmt(CapturedStmt *S) {
513 VisitStmt(S);
514 Record.skipInts(1);
515 S->setCapturedDecl(readDeclAs<CapturedDecl>());
516 S->setCapturedRegionKind(static_cast<CapturedRegionKind>(Record.readInt()));
517 S->setCapturedRecordDecl(readDeclAs<RecordDecl>());
518
519 // Capture inits
521 E = S->capture_init_end();
522 I != E; ++I)
523 *I = Record.readSubExpr();
524
525 // Body
526 S->setCapturedStmt(Record.readSubStmt());
528
529 // Captures
530 for (auto &I : S->captures()) {
531 I.VarAndKind.setPointer(readDeclAs<VarDecl>());
532 I.VarAndKind.setInt(
533 static_cast<CapturedStmt::VariableCaptureKind>(Record.readInt()));
534 I.Loc = readSourceLocation();
535 }
536}
537
538void ASTStmtReader::VisitCXXReflectExpr(CXXReflectExpr *E) {
539 // TODO(Reflection): Implement this.
540 assert(false && "not implemented yet");
541}
542
543void ASTStmtReader::VisitSYCLKernelCallStmt(SYCLKernelCallStmt *S) {
544 VisitStmt(S);
545 S->setOriginalStmt(cast<CompoundStmt>(Record.readSubStmt()));
546 S->setKernelLaunchStmt(cast<Stmt>(Record.readSubStmt()));
547 S->setOutlinedFunctionDecl(readDeclAs<OutlinedFunctionDecl>());
548}
549
550void ASTStmtReader::VisitExpr(Expr *E) {
551 VisitStmt(E);
552 CurrentUnpackingBits.emplace(Record.readInt());
553 E->setDependence(static_cast<ExprDependence>(
554 CurrentUnpackingBits->getNextBits(/*Width=*/5)));
555 E->setValueKind(static_cast<ExprValueKind>(
556 CurrentUnpackingBits->getNextBits(/*Width=*/2)));
557 E->setObjectKind(static_cast<ExprObjectKind>(
558 CurrentUnpackingBits->getNextBits(/*Width=*/3)));
559
560 E->setType(Record.readType());
561 assert(Record.getIdx() == NumExprFields &&
562 "Incorrect expression field count");
563}
564
565void ASTStmtReader::VisitConstantExpr(ConstantExpr *E) {
566 VisitExpr(E);
567
568 auto StorageKind = static_cast<ConstantResultStorageKind>(Record.readInt());
569 assert(E->getResultStorageKind() == StorageKind && "Wrong ResultKind!");
570
571 E->ConstantExprBits.APValueKind = Record.readInt();
572 E->ConstantExprBits.IsUnsigned = Record.readInt();
573 E->ConstantExprBits.BitWidth = Record.readInt();
574 E->ConstantExprBits.HasCleanup = false; // Not serialized, see below.
575 E->ConstantExprBits.IsImmediateInvocation = Record.readInt();
576
577 switch (StorageKind) {
579 break;
580
582 E->Int64Result() = Record.readInt();
583 break;
584
586 E->APValueResult() = Record.readAPValue();
587 if (E->APValueResult().needsCleanup()) {
588 E->ConstantExprBits.HasCleanup = true;
589 Record.getContext().addDestruction(&E->APValueResult());
590 }
591 break;
592 }
593
594 E->setSubExpr(Record.readSubExpr());
595}
596
597void ASTStmtReader::VisitOpenACCAsteriskSizeExpr(OpenACCAsteriskSizeExpr *E) {
598 VisitExpr(E);
599 E->setAsteriskLocation(readSourceLocation());
600}
601
602void ASTStmtReader::VisitSYCLUniqueStableNameExpr(SYCLUniqueStableNameExpr *E) {
603 VisitExpr(E);
604
605 E->setLocation(readSourceLocation());
606 E->setLParenLocation(readSourceLocation());
607 E->setRParenLocation(readSourceLocation());
608
609 E->setTypeSourceInfo(Record.readTypeSourceInfo());
610}
611
612void ASTStmtReader::VisitUnresolvedSYCLKernelCallStmt(
614 VisitStmt(S);
615
616 S->setOriginalStmt(cast<CompoundStmt>(Record.readSubStmt()));
617 S->setKernelLaunchIdExpr(Record.readExpr());
618}
619
620void ASTStmtReader::VisitPredefinedExpr(PredefinedExpr *E) {
621 VisitExpr(E);
622 bool HasFunctionName = Record.readInt();
623 E->PredefinedExprBits.HasFunctionName = HasFunctionName;
624 E->PredefinedExprBits.Kind = Record.readInt();
625 E->PredefinedExprBits.IsTransparent = Record.readInt();
626 E->setLocation(readSourceLocation());
627 if (HasFunctionName)
628 E->setFunctionName(cast<StringLiteral>(Record.readSubExpr()));
629}
630
631void ASTStmtReader::VisitDeclRefExpr(DeclRefExpr *E) {
632 VisitExpr(E);
633
634 CurrentUnpackingBits.emplace(Record.readInt());
635 E->DeclRefExprBits.HadMultipleCandidates = CurrentUnpackingBits->getNextBit();
636 E->DeclRefExprBits.RefersToEnclosingVariableOrCapture =
637 CurrentUnpackingBits->getNextBit();
638 E->DeclRefExprBits.NonOdrUseReason =
639 CurrentUnpackingBits->getNextBits(/*Width=*/2);
640 E->DeclRefExprBits.IsImmediateEscalating = CurrentUnpackingBits->getNextBit();
641 E->DeclRefExprBits.HasFoundDecl = CurrentUnpackingBits->getNextBit();
642 E->DeclRefExprBits.HasQualifier = CurrentUnpackingBits->getNextBit();
643 E->DeclRefExprBits.HasTemplateKWAndArgsInfo =
644 CurrentUnpackingBits->getNextBit();
645 E->DeclRefExprBits.CapturedByCopyInLambdaWithExplicitObjectParameter = false;
646 unsigned NumTemplateArgs = 0;
648 NumTemplateArgs = Record.readInt();
649
650 if (E->hasQualifier())
651 new (E->getTrailingObjects<NestedNameSpecifierLoc>())
652 NestedNameSpecifierLoc(Record.readNestedNameSpecifierLoc());
653
654 if (E->hasFoundDecl())
655 *E->getTrailingObjects<NamedDecl *>() = readDeclAs<NamedDecl>();
656
659 *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
660 E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs);
661
662 E->D = readDeclAs<ValueDecl>();
663 E->setLocation(readSourceLocation());
664 E->DNLoc = Record.readDeclarationNameLoc(E->getDecl()->getDeclName());
665}
666
667void ASTStmtReader::VisitIntegerLiteral(IntegerLiteral *E) {
668 VisitExpr(E);
669 E->setLocation(readSourceLocation());
670 E->setValue(Record.getContext(), Record.readAPInt());
671}
672
673void ASTStmtReader::VisitFixedPointLiteral(FixedPointLiteral *E) {
674 VisitExpr(E);
675 E->setLocation(readSourceLocation());
676 E->setScale(Record.readInt());
677 E->setValue(Record.getContext(), Record.readAPInt());
678}
679
680void ASTStmtReader::VisitFloatingLiteral(FloatingLiteral *E) {
681 VisitExpr(E);
683 static_cast<llvm::APFloatBase::Semantics>(Record.readInt()));
684 E->setExact(Record.readInt());
685 E->setValue(Record.getContext(), Record.readAPFloat(E->getSemantics()));
686 E->setLocation(readSourceLocation());
687}
688
689void ASTStmtReader::VisitImaginaryLiteral(ImaginaryLiteral *E) {
690 VisitExpr(E);
691 E->setSubExpr(Record.readSubExpr());
692}
693
694void ASTStmtReader::VisitStringLiteral(StringLiteral *E) {
695 VisitExpr(E);
696
697 // NumConcatenated, Length and CharByteWidth are set by the empty
698 // ctor since they are needed to allocate storage for the trailing objects.
699 unsigned NumConcatenated = Record.readInt();
700 unsigned Length = Record.readInt();
701 unsigned CharByteWidth = Record.readInt();
702 assert((NumConcatenated == E->getNumConcatenated()) &&
703 "Wrong number of concatenated tokens!");
704 assert((Length == E->getLength()) && "Wrong Length!");
705 assert((CharByteWidth == E->getCharByteWidth()) && "Wrong character width!");
706 E->StringLiteralBits.Kind = Record.readInt();
707 E->StringLiteralBits.IsPascal = Record.readInt();
708
709 // The character width is originally computed via mapCharByteWidth.
710 // Check that the deserialized character width is consistant with the result
711 // of calling mapCharByteWidth.
712 assert((CharByteWidth ==
713 StringLiteral::mapCharByteWidth(Record.getContext().getTargetInfo(),
714 E->getKind())) &&
715 "Wrong character width!");
716
717 // Deserialize the trailing array of SourceLocation.
718 for (unsigned I = 0; I < NumConcatenated; ++I)
719 E->setStrTokenLoc(I, readSourceLocation());
720
721 // Deserialize the trailing array of char holding the string data.
722 char *StrData = E->getStrDataAsChar();
723 for (unsigned I = 0; I < Length * CharByteWidth; ++I)
724 StrData[I] = Record.readInt();
725}
726
727void ASTStmtReader::VisitCharacterLiteral(CharacterLiteral *E) {
728 VisitExpr(E);
729 E->setValue(Record.readInt());
730 E->setLocation(readSourceLocation());
731 E->setKind(static_cast<CharacterLiteralKind>(Record.readInt()));
732}
733
734void ASTStmtReader::VisitParenExpr(ParenExpr *E) {
735 VisitExpr(E);
736 E->setIsProducedByFoldExpansion(Record.readInt());
737 E->setLParen(readSourceLocation());
738 E->setRParen(readSourceLocation());
739 E->setSubExpr(Record.readSubExpr());
740}
741
742void ASTStmtReader::VisitParenListExpr(ParenListExpr *E) {
743 VisitExpr(E);
744 unsigned NumExprs = Record.readInt();
745 assert((NumExprs == E->getNumExprs()) && "Wrong NumExprs!");
746 for (unsigned I = 0; I != NumExprs; ++I)
747 E->getTrailingObjects()[I] = Record.readSubStmt();
748 E->LParenLoc = readSourceLocation();
749 E->RParenLoc = readSourceLocation();
750}
751
752void ASTStmtReader::VisitUnaryOperator(UnaryOperator *E) {
753 VisitExpr(E);
754 bool hasFP_Features = CurrentUnpackingBits->getNextBit();
755 assert(hasFP_Features == E->hasStoredFPFeatures());
756 E->setSubExpr(Record.readSubExpr());
757 E->setOpcode(
758 (UnaryOperator::Opcode)CurrentUnpackingBits->getNextBits(/*Width=*/5));
759 E->setOperatorLoc(readSourceLocation());
760 E->setCanOverflow(CurrentUnpackingBits->getNextBit());
761 if (hasFP_Features)
763 FPOptionsOverride::getFromOpaqueInt(Record.readInt()));
764}
765
766void ASTStmtReader::VisitOffsetOfExpr(OffsetOfExpr *E) {
767 VisitExpr(E);
768 assert(E->getNumComponents() == Record.peekInt());
769 Record.skipInts(1);
770 assert(E->getNumExpressions() == Record.peekInt());
771 Record.skipInts(1);
772 E->setOperatorLoc(readSourceLocation());
773 E->setRParenLoc(readSourceLocation());
774 E->setTypeSourceInfo(readTypeSourceInfo());
775 for (unsigned I = 0, N = E->getNumComponents(); I != N; ++I) {
776 auto Kind = static_cast<OffsetOfNode::Kind>(Record.readInt());
777 SourceLocation Start = readSourceLocation();
778 SourceLocation End = readSourceLocation();
779 switch (Kind) {
781 E->setComponent(I, OffsetOfNode(Start, Record.readInt(), End));
782 break;
783
785 E->setComponent(
786 I, OffsetOfNode(Start, readDeclAs<FieldDecl>(), End));
787 break;
788
790 E->setComponent(
791 I,
792 OffsetOfNode(Start, Record.readIdentifier(), End));
793 break;
794
795 case OffsetOfNode::Base: {
796 auto *Base = new (Record.getContext()) CXXBaseSpecifier();
797 *Base = Record.readCXXBaseSpecifier();
798 E->setComponent(I, OffsetOfNode(Base));
799 break;
800 }
801 }
802 }
803
804 for (unsigned I = 0, N = E->getNumExpressions(); I != N; ++I)
805 E->setIndexExpr(I, Record.readSubExpr());
806}
807
808void ASTStmtReader::VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *E) {
809 VisitExpr(E);
810 E->setKind(static_cast<UnaryExprOrTypeTrait>(Record.readInt()));
811 if (Record.peekInt() == 0) {
812 E->setArgument(Record.readSubExpr());
813 Record.skipInts(1);
814 } else {
815 E->setArgument(readTypeSourceInfo());
816 }
817 E->setOperatorLoc(readSourceLocation());
818 E->setRParenLoc(readSourceLocation());
819}
820
823 ConstraintSatisfaction Satisfaction;
824 Satisfaction.IsSatisfied = Record.readInt();
825 Satisfaction.ContainsErrors = Record.readInt();
826 const ASTContext &C = Record.getContext();
827 if (!Satisfaction.IsSatisfied) {
828 unsigned NumDetailRecords = Record.readInt();
829 for (unsigned i = 0; i != NumDetailRecords; ++i) {
830 auto Kind = Record.readInt();
831 if (Kind == 0) {
832 SourceLocation DiagLocation = Record.readSourceLocation();
833 StringRef DiagMessage = C.backupStr(Record.readString());
834
835 Satisfaction.Details.emplace_back(new (
836 C) ConstraintSubstitutionDiagnostic(DiagLocation, DiagMessage));
837 } else if (Kind == 1) {
838 Satisfaction.Details.emplace_back(Record.readExpr());
839 } else {
840 assert(Kind == 2);
841 Satisfaction.Details.emplace_back(Record.readConceptReference());
842 }
843 }
844 }
845 return Satisfaction;
846}
847
848void ASTStmtReader::VisitConceptSpecializationExpr(
850 VisitExpr(E);
851 E->SpecDecl = Record.readDeclAs<ImplicitConceptSpecializationDecl>();
852 if (Record.readBool())
853 E->ConceptRef = Record.readConceptReference();
854 E->Satisfaction = E->isValueDependent() ? nullptr :
855 ASTConstraintSatisfaction::Create(Record.getContext(),
857}
858
861 const ASTContext &C = Record.getContext();
862 StringRef SubstitutedEntity = C.backupStr(Record.readString());
863 SourceLocation DiagLoc = Record.readSourceLocation();
864 StringRef DiagMessage = C.backupStr(Record.readString());
865
866 return new (Record.getContext())
867 concepts::Requirement::SubstitutionDiagnostic{SubstitutedEntity, DiagLoc,
868 DiagMessage};
869}
870
871void ASTStmtReader::VisitRequiresExpr(RequiresExpr *E) {
872 VisitExpr(E);
873 unsigned NumLocalParameters = Record.readInt();
874 unsigned NumRequirements = Record.readInt();
875 E->RequiresExprBits.RequiresKWLoc = Record.readSourceLocation();
876 E->RequiresExprBits.IsSatisfied = Record.readInt();
877 E->Body = Record.readDeclAs<RequiresExprBodyDecl>();
878 llvm::SmallVector<ParmVarDecl *, 4> LocalParameters;
879 for (unsigned i = 0; i < NumLocalParameters; ++i)
880 LocalParameters.push_back(cast<ParmVarDecl>(Record.readDecl()));
881 std::copy(LocalParameters.begin(), LocalParameters.end(),
882 E->getTrailingObjects<ParmVarDecl *>());
883 llvm::SmallVector<concepts::Requirement *, 4> Requirements;
884 for (unsigned i = 0; i < NumRequirements; ++i) {
885 auto RK =
886 static_cast<concepts::Requirement::RequirementKind>(Record.readInt());
887 concepts::Requirement *R = nullptr;
888 switch (RK) {
890 auto Status =
892 Record.readInt());
894 R = new (Record.getContext())
895 concepts::TypeRequirement(readSubstitutionDiagnostic(Record));
896 else
897 R = new (Record.getContext())
898 concepts::TypeRequirement(Record.readTypeSourceInfo());
899 } break;
902 auto Status =
904 Record.readInt());
905 llvm::PointerUnion<concepts::Requirement::SubstitutionDiagnostic *,
906 Expr *> E;
908 E = readSubstitutionDiagnostic(Record);
909 } else
910 E = Record.readExpr();
911
912 std::optional<concepts::ExprRequirement::ReturnTypeRequirement> Req;
913 ConceptSpecializationExpr *SubstitutedConstraintExpr = nullptr;
914 SourceLocation NoexceptLoc;
916 Req.emplace();
917 } else {
918 NoexceptLoc = Record.readSourceLocation();
919 switch (/* returnTypeRequirementKind */Record.readInt()) {
920 case 0:
921 // No return type requirement.
922 Req.emplace();
923 break;
924 case 1: {
925 // type-constraint
926 TemplateParameterList *TPL = Record.readTemplateParameterList();
927 if (Status >=
929 SubstitutedConstraintExpr =
930 cast<ConceptSpecializationExpr>(Record.readExpr());
931 Req.emplace(TPL);
932 } break;
933 case 2:
934 // Substitution failure
935 Req.emplace(readSubstitutionDiagnostic(Record));
936 break;
937 }
938 }
939 if (Expr *Ex = E.dyn_cast<Expr *>())
940 R = new (Record.getContext()) concepts::ExprRequirement(
941 Ex, RK == concepts::Requirement::RK_Simple, NoexceptLoc,
942 std::move(*Req), Status, SubstitutedConstraintExpr);
943 else
944 R = new (Record.getContext()) concepts::ExprRequirement(
946 RK == concepts::Requirement::RK_Simple, NoexceptLoc,
947 std::move(*Req));
948 } break;
950 ASTContext &C = Record.getContext();
951 bool HasInvalidConstraint = Record.readInt();
952 if (HasInvalidConstraint) {
953 StringRef InvalidConstraint = C.backupStr(Record.readString());
954 R = new (C) concepts::NestedRequirement(
955 Record.getContext(), InvalidConstraint,
957 break;
958 }
959 Expr *E = Record.readExpr();
961 R = new (C) concepts::NestedRequirement(E);
962 else
963 R = new (C) concepts::NestedRequirement(
964 C, E, readConstraintSatisfaction(Record));
965 } break;
966 }
967 if (!R)
968 continue;
969 Requirements.push_back(R);
970 }
971 std::copy(Requirements.begin(), Requirements.end(),
972 E->getTrailingObjects<concepts::Requirement *>());
973 E->LParenLoc = Record.readSourceLocation();
974 E->RParenLoc = Record.readSourceLocation();
975 E->RBraceLoc = Record.readSourceLocation();
976}
977
978void ASTStmtReader::VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
979 VisitExpr(E);
980 E->setLHS(Record.readSubExpr());
981 E->setRHS(Record.readSubExpr());
982 E->setRBracketLoc(readSourceLocation());
983}
984
985void ASTStmtReader::VisitMatrixSingleSubscriptExpr(
987 VisitExpr(E);
988 E->setBase(Record.readSubExpr());
989 E->setRowIdx(Record.readSubExpr());
990 E->setRBracketLoc(readSourceLocation());
991}
992
993void ASTStmtReader::VisitMatrixSubscriptExpr(MatrixSubscriptExpr *E) {
994 VisitExpr(E);
995 E->setBase(Record.readSubExpr());
996 E->setRowIdx(Record.readSubExpr());
997 E->setColumnIdx(Record.readSubExpr());
998 E->setRBracketLoc(readSourceLocation());
999}
1000
1001void ASTStmtReader::VisitArraySectionExpr(ArraySectionExpr *E) {
1002 VisitExpr(E);
1003 E->ASType = Record.readEnum<ArraySectionExpr::ArraySectionType>();
1004
1005 E->setBase(Record.readSubExpr());
1006 E->setLowerBound(Record.readSubExpr());
1007 E->setLength(Record.readSubExpr());
1008
1009 if (E->isOMPArraySection())
1010 E->setStride(Record.readSubExpr());
1011
1012 E->setColonLocFirst(readSourceLocation());
1013
1014 if (E->isOMPArraySection())
1015 E->setColonLocSecond(readSourceLocation());
1016
1017 E->setRBracketLoc(readSourceLocation());
1018}
1019
1020void ASTStmtReader::VisitOMPArrayShapingExpr(OMPArrayShapingExpr *E) {
1021 VisitExpr(E);
1022 unsigned NumDims = Record.readInt();
1023 E->setBase(Record.readSubExpr());
1024 SmallVector<Expr *, 4> Dims(NumDims);
1025 for (unsigned I = 0; I < NumDims; ++I)
1026 Dims[I] = Record.readSubExpr();
1027 E->setDimensions(Dims);
1028 SmallVector<SourceRange, 4> SRs(NumDims);
1029 for (unsigned I = 0; I < NumDims; ++I)
1030 SRs[I] = readSourceRange();
1031 E->setBracketsRanges(SRs);
1032 E->setLParenLoc(readSourceLocation());
1033 E->setRParenLoc(readSourceLocation());
1034}
1035
1036void ASTStmtReader::VisitOMPIteratorExpr(OMPIteratorExpr *E) {
1037 VisitExpr(E);
1038 unsigned NumIters = Record.readInt();
1039 E->setIteratorKwLoc(readSourceLocation());
1040 E->setLParenLoc(readSourceLocation());
1041 E->setRParenLoc(readSourceLocation());
1042 for (unsigned I = 0; I < NumIters; ++I) {
1043 E->setIteratorDeclaration(I, Record.readDeclRef());
1044 E->setAssignmentLoc(I, readSourceLocation());
1045 Expr *Begin = Record.readSubExpr();
1046 Expr *End = Record.readSubExpr();
1047 Expr *Step = Record.readSubExpr();
1048 SourceLocation ColonLoc = readSourceLocation();
1049 SourceLocation SecColonLoc;
1050 if (Step)
1051 SecColonLoc = readSourceLocation();
1052 E->setIteratorRange(I, Begin, ColonLoc, End, SecColonLoc, Step);
1053 // Deserialize helpers
1054 OMPIteratorHelperData HD;
1055 HD.CounterVD = cast_or_null<VarDecl>(Record.readDeclRef());
1056 HD.Upper = Record.readSubExpr();
1057 HD.Update = Record.readSubExpr();
1058 HD.CounterUpdate = Record.readSubExpr();
1059 E->setHelper(I, HD);
1060 }
1061}
1062
1063void ASTStmtReader::VisitCallExpr(CallExpr *E) {
1064 VisitExpr(E);
1065
1066 unsigned NumArgs = Record.readInt();
1067 CurrentUnpackingBits.emplace(Record.readInt());
1068 E->setADLCallKind(
1069 static_cast<CallExpr::ADLCallKind>(CurrentUnpackingBits->getNextBit()));
1070 bool HasFPFeatures = CurrentUnpackingBits->getNextBit();
1071 E->setCoroElideSafe(CurrentUnpackingBits->getNextBit());
1072 E->setUsesMemberSyntax(CurrentUnpackingBits->getNextBit());
1073 assert((NumArgs == E->getNumArgs()) && "Wrong NumArgs!");
1074 E->setRParenLoc(readSourceLocation());
1075 E->setCallee(Record.readSubExpr());
1076 for (unsigned I = 0; I != NumArgs; ++I)
1077 E->setArg(I, Record.readSubExpr());
1078
1079 if (HasFPFeatures)
1081 FPOptionsOverride::getFromOpaqueInt(Record.readInt()));
1082
1083 if (E->getStmtClass() == Stmt::CallExprClass)
1084 E->updateTrailingSourceLoc();
1085}
1086
1087void ASTStmtReader::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) {
1088 VisitCallExpr(E);
1089}
1090
1091void ASTStmtReader::VisitMemberExpr(MemberExpr *E) {
1092 VisitExpr(E);
1093
1094 CurrentUnpackingBits.emplace(Record.readInt());
1095 bool HasQualifier = CurrentUnpackingBits->getNextBit();
1096 bool HasFoundDecl = CurrentUnpackingBits->getNextBit();
1097 bool HasTemplateInfo = CurrentUnpackingBits->getNextBit();
1098 unsigned NumTemplateArgs = Record.readInt();
1099
1100 E->Base = Record.readSubExpr();
1101 E->MemberDecl = Record.readDeclAs<ValueDecl>();
1102 E->MemberDNLoc = Record.readDeclarationNameLoc(E->MemberDecl->getDeclName());
1103 E->MemberLoc = Record.readSourceLocation();
1104 E->MemberExprBits.IsArrow = CurrentUnpackingBits->getNextBit();
1105 E->MemberExprBits.HasQualifier = HasQualifier;
1106 E->MemberExprBits.HasFoundDecl = HasFoundDecl;
1107 E->MemberExprBits.HasTemplateKWAndArgsInfo = HasTemplateInfo;
1108 E->MemberExprBits.HadMultipleCandidates = CurrentUnpackingBits->getNextBit();
1109 E->MemberExprBits.NonOdrUseReason =
1110 CurrentUnpackingBits->getNextBits(/*Width=*/2);
1111 E->MemberExprBits.OperatorLoc = Record.readSourceLocation();
1112
1113 if (HasQualifier)
1114 new (E->getTrailingObjects<NestedNameSpecifierLoc>())
1115 NestedNameSpecifierLoc(Record.readNestedNameSpecifierLoc());
1116
1117 if (HasFoundDecl) {
1118 auto *FoundD = Record.readDeclAs<NamedDecl>();
1119 auto AS = (AccessSpecifier)CurrentUnpackingBits->getNextBits(/*Width=*/2);
1120 *E->getTrailingObjects<DeclAccessPair>() = DeclAccessPair::make(FoundD, AS);
1121 }
1122
1123 if (HasTemplateInfo)
1125 *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
1126 E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs);
1127}
1128
1129void ASTStmtReader::VisitObjCIsaExpr(ObjCIsaExpr *E) {
1130 VisitExpr(E);
1131 E->setBase(Record.readSubExpr());
1132 E->setIsaMemberLoc(readSourceLocation());
1133 E->setOpLoc(readSourceLocation());
1134 E->setArrow(Record.readInt());
1135}
1136
1137void ASTStmtReader::
1138VisitObjCIndirectCopyRestoreExpr(ObjCIndirectCopyRestoreExpr *E) {
1139 VisitExpr(E);
1140 E->Operand = Record.readSubExpr();
1141 E->setShouldCopy(Record.readInt());
1142}
1143
1144void ASTStmtReader::VisitObjCBridgedCastExpr(ObjCBridgedCastExpr *E) {
1145 VisitExplicitCastExpr(E);
1146 E->LParenLoc = readSourceLocation();
1147 E->BridgeKeywordLoc = readSourceLocation();
1148 E->Kind = Record.readInt();
1149}
1150
1151void ASTStmtReader::VisitCastExpr(CastExpr *E) {
1152 VisitExpr(E);
1153 unsigned NumBaseSpecs = Record.readInt();
1154 assert(NumBaseSpecs == E->path_size());
1155
1156 CurrentUnpackingBits.emplace(Record.readInt());
1157 E->setCastKind((CastKind)CurrentUnpackingBits->getNextBits(/*Width=*/7));
1158 unsigned HasFPFeatures = CurrentUnpackingBits->getNextBit();
1159 assert(E->hasStoredFPFeatures() == HasFPFeatures);
1160
1161 E->setSubExpr(Record.readSubExpr());
1162
1164 while (NumBaseSpecs--) {
1165 auto *BaseSpec = new (Record.getContext()) CXXBaseSpecifier;
1166 *BaseSpec = Record.readCXXBaseSpecifier();
1167 *BaseI++ = BaseSpec;
1168 }
1169 if (HasFPFeatures)
1170 *E->getTrailingFPFeatures() =
1171 FPOptionsOverride::getFromOpaqueInt(Record.readInt());
1172}
1173
1174void ASTStmtReader::VisitBinaryOperator(BinaryOperator *E) {
1175 VisitExpr(E);
1176 CurrentUnpackingBits.emplace(Record.readInt());
1177 E->setOpcode(
1178 (BinaryOperator::Opcode)CurrentUnpackingBits->getNextBits(/*Width=*/6));
1179 bool hasFP_Features = CurrentUnpackingBits->getNextBit();
1180 E->setHasStoredFPFeatures(hasFP_Features);
1181 E->setExcludedOverflowPattern(CurrentUnpackingBits->getNextBit());
1182 E->setLHS(Record.readSubExpr());
1183 E->setRHS(Record.readSubExpr());
1184 E->setOperatorLoc(readSourceLocation());
1185 if (hasFP_Features)
1187 FPOptionsOverride::getFromOpaqueInt(Record.readInt()));
1188}
1189
1190void ASTStmtReader::VisitCompoundAssignOperator(CompoundAssignOperator *E) {
1191 VisitBinaryOperator(E);
1192 E->setComputationLHSType(Record.readType());
1193 E->setComputationResultType(Record.readType());
1194}
1195
1196void ASTStmtReader::VisitConditionalOperator(ConditionalOperator *E) {
1197 VisitExpr(E);
1198 E->SubExprs[ConditionalOperator::COND] = Record.readSubExpr();
1199 E->SubExprs[ConditionalOperator::LHS] = Record.readSubExpr();
1200 E->SubExprs[ConditionalOperator::RHS] = Record.readSubExpr();
1201 E->QuestionLoc = readSourceLocation();
1202 E->ColonLoc = readSourceLocation();
1203}
1204
1205void
1206ASTStmtReader::VisitBinaryConditionalOperator(BinaryConditionalOperator *E) {
1207 VisitExpr(E);
1208 E->OpaqueValue = cast<OpaqueValueExpr>(Record.readSubExpr());
1209 E->SubExprs[BinaryConditionalOperator::COMMON] = Record.readSubExpr();
1210 E->SubExprs[BinaryConditionalOperator::COND] = Record.readSubExpr();
1211 E->SubExprs[BinaryConditionalOperator::LHS] = Record.readSubExpr();
1212 E->SubExprs[BinaryConditionalOperator::RHS] = Record.readSubExpr();
1213 E->QuestionLoc = readSourceLocation();
1214 E->ColonLoc = readSourceLocation();
1215}
1216
1217void ASTStmtReader::VisitImplicitCastExpr(ImplicitCastExpr *E) {
1218 VisitCastExpr(E);
1219 E->setIsPartOfExplicitCast(CurrentUnpackingBits->getNextBit());
1220}
1221
1222void ASTStmtReader::VisitExplicitCastExpr(ExplicitCastExpr *E) {
1223 VisitCastExpr(E);
1224 E->setTypeInfoAsWritten(readTypeSourceInfo());
1225}
1226
1227void ASTStmtReader::VisitCStyleCastExpr(CStyleCastExpr *E) {
1228 VisitExplicitCastExpr(E);
1229 E->setLParenLoc(readSourceLocation());
1230 E->setRParenLoc(readSourceLocation());
1231}
1232
1233void ASTStmtReader::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
1234 VisitExpr(E);
1235 E->setLParenLoc(readSourceLocation());
1236 E->setTypeSourceInfo(readTypeSourceInfo());
1237 E->setInitializer(Record.readSubExpr());
1238 E->setFileScope(Record.readInt());
1239}
1240
1241void ASTStmtReader::VisitExtVectorElementExpr(ExtVectorElementExpr *E) {
1242 VisitExpr(E);
1243 E->setBase(Record.readSubExpr());
1244 E->setAccessor(Record.readIdentifier());
1245 E->setAccessorLoc(readSourceLocation());
1246}
1247
1248void ASTStmtReader::VisitMatrixElementExpr(MatrixElementExpr *E) {
1249 VisitExpr(E);
1250 E->setBase(Record.readSubExpr());
1251 E->setAccessor(Record.readIdentifier());
1252 E->setAccessorLoc(readSourceLocation());
1253}
1254
1255void ASTStmtReader::VisitInitListExpr(InitListExpr *E) {
1256 VisitExpr(E);
1257 if (auto *SyntForm = cast_or_null<InitListExpr>(Record.readSubStmt()))
1258 E->setSyntacticForm(SyntForm);
1259 E->setLBraceLoc(readSourceLocation());
1260 E->setRBraceLoc(readSourceLocation());
1261 bool isArrayFiller = Record.readInt();
1262 Expr *filler = nullptr;
1263 if (isArrayFiller) {
1264 filler = Record.readSubExpr();
1265 E->ArrayFillerOrUnionFieldInit = filler;
1266 } else
1267 E->ArrayFillerOrUnionFieldInit = readDeclAs<FieldDecl>();
1268 E->sawArrayRangeDesignator(Record.readInt());
1269 unsigned NumInits = Record.readInt();
1270 E->reserveInits(Record.getContext(), NumInits);
1271 if (isArrayFiller) {
1272 for (unsigned I = 0; I != NumInits; ++I) {
1273 Expr *init = Record.readSubExpr();
1274 E->updateInit(Record.getContext(), I, init ? init : filler);
1275 }
1276 } else {
1277 for (unsigned I = 0; I != NumInits; ++I)
1278 E->updateInit(Record.getContext(), I, Record.readSubExpr());
1279 }
1280}
1281
1282void ASTStmtReader::VisitDesignatedInitExpr(DesignatedInitExpr *E) {
1283 using Designator = DesignatedInitExpr::Designator;
1284
1285 VisitExpr(E);
1286 unsigned NumSubExprs = Record.readInt();
1287 assert(NumSubExprs == E->getNumSubExprs() && "Wrong number of subexprs");
1288 for (unsigned I = 0; I != NumSubExprs; ++I)
1289 E->setSubExpr(I, Record.readSubExpr());
1290 E->setEqualOrColonLoc(readSourceLocation());
1291 E->setGNUSyntax(Record.readInt());
1292
1293 SmallVector<Designator, 4> Designators;
1294 while (Record.getIdx() < Record.size()) {
1295 switch ((DesignatorTypes)Record.readInt()) {
1296 case DESIG_FIELD_DECL: {
1297 auto *Field = readDeclAs<FieldDecl>();
1298 SourceLocation DotLoc = readSourceLocation();
1299 SourceLocation FieldLoc = readSourceLocation();
1300 Designators.push_back(Designator::CreateFieldDesignator(
1301 Field->getIdentifier(), DotLoc, FieldLoc));
1302 Designators.back().setFieldDecl(Field);
1303 break;
1304 }
1305
1306 case DESIG_FIELD_NAME: {
1307 const IdentifierInfo *Name = Record.readIdentifier();
1308 SourceLocation DotLoc = readSourceLocation();
1309 SourceLocation FieldLoc = readSourceLocation();
1310 Designators.push_back(Designator::CreateFieldDesignator(Name, DotLoc,
1311 FieldLoc));
1312 break;
1313 }
1314
1315 case DESIG_ARRAY: {
1316 unsigned Index = Record.readInt();
1317 SourceLocation LBracketLoc = readSourceLocation();
1318 SourceLocation RBracketLoc = readSourceLocation();
1319 Designators.push_back(Designator::CreateArrayDesignator(Index,
1320 LBracketLoc,
1321 RBracketLoc));
1322 break;
1323 }
1324
1325 case DESIG_ARRAY_RANGE: {
1326 unsigned Index = Record.readInt();
1327 SourceLocation LBracketLoc = readSourceLocation();
1328 SourceLocation EllipsisLoc = readSourceLocation();
1329 SourceLocation RBracketLoc = readSourceLocation();
1330 Designators.push_back(Designator::CreateArrayRangeDesignator(
1331 Index, LBracketLoc, EllipsisLoc, RBracketLoc));
1332 break;
1333 }
1334 }
1335 }
1336 E->setDesignators(Record.getContext(),
1337 Designators.data(), Designators.size());
1338}
1339
1340void ASTStmtReader::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) {
1341 VisitExpr(E);
1342 E->setBase(Record.readSubExpr());
1343 E->setUpdater(Record.readSubExpr());
1344}
1345
1346void ASTStmtReader::VisitNoInitExpr(NoInitExpr *E) {
1347 VisitExpr(E);
1348}
1349
1350void ASTStmtReader::VisitArrayInitLoopExpr(ArrayInitLoopExpr *E) {
1351 VisitExpr(E);
1352 E->SubExprs[0] = Record.readSubExpr();
1353 E->SubExprs[1] = Record.readSubExpr();
1354}
1355
1356void ASTStmtReader::VisitArrayInitIndexExpr(ArrayInitIndexExpr *E) {
1357 VisitExpr(E);
1358}
1359
1360void ASTStmtReader::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) {
1361 VisitExpr(E);
1362}
1363
1364void ASTStmtReader::VisitVAArgExpr(VAArgExpr *E) {
1365 VisitExpr(E);
1366 E->setSubExpr(Record.readSubExpr());
1367 E->setWrittenTypeInfo(readTypeSourceInfo());
1368 E->setBuiltinLoc(readSourceLocation());
1369 E->setRParenLoc(readSourceLocation());
1370 E->setIsMicrosoftABI(Record.readInt());
1371}
1372
1373void ASTStmtReader::VisitSourceLocExpr(SourceLocExpr *E) {
1374 VisitExpr(E);
1375 E->ParentContext = readDeclAs<DeclContext>();
1376 E->BuiltinLoc = readSourceLocation();
1377 E->RParenLoc = readSourceLocation();
1378 E->SourceLocExprBits.Kind = Record.readInt();
1379}
1380
1381void ASTStmtReader::VisitEmbedExpr(EmbedExpr *E) {
1382 VisitExpr(E);
1383 E->EmbedKeywordLoc = readSourceLocation();
1384 EmbedDataStorage *Data = new (Record.getContext()) EmbedDataStorage;
1385 Data->BinaryData = cast<StringLiteral>(Record.readSubStmt());
1386 E->Data = Data;
1387 E->Begin = Record.readInt();
1388 E->NumOfElements = Record.readInt();
1389}
1390
1391void ASTStmtReader::VisitAddrLabelExpr(AddrLabelExpr *E) {
1392 VisitExpr(E);
1393 E->setAmpAmpLoc(readSourceLocation());
1394 E->setLabelLoc(readSourceLocation());
1395 E->setLabel(readDeclAs<LabelDecl>());
1396}
1397
1398void ASTStmtReader::VisitStmtExpr(StmtExpr *E) {
1399 VisitExpr(E);
1400 E->setLParenLoc(readSourceLocation());
1401 E->setRParenLoc(readSourceLocation());
1402 E->setSubStmt(cast_or_null<CompoundStmt>(Record.readSubStmt()));
1403 E->StmtExprBits.TemplateDepth = Record.readInt();
1404}
1405
1406void ASTStmtReader::VisitChooseExpr(ChooseExpr *E) {
1407 VisitExpr(E);
1408 E->setCond(Record.readSubExpr());
1409 E->setLHS(Record.readSubExpr());
1410 E->setRHS(Record.readSubExpr());
1411 E->setBuiltinLoc(readSourceLocation());
1412 E->setRParenLoc(readSourceLocation());
1413 E->setIsConditionTrue(Record.readInt());
1414}
1415
1416void ASTStmtReader::VisitGNUNullExpr(GNUNullExpr *E) {
1417 VisitExpr(E);
1418 E->setTokenLocation(readSourceLocation());
1419}
1420
1421void ASTStmtReader::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
1422 VisitExpr(E);
1423 SmallVector<Expr *, 16> Exprs;
1424 unsigned NumExprs = Record.readInt();
1425 while (NumExprs--)
1426 Exprs.push_back(Record.readSubExpr());
1427 E->setExprs(Record.getContext(), Exprs);
1428 E->setBuiltinLoc(readSourceLocation());
1429 E->setRParenLoc(readSourceLocation());
1430}
1431
1432void ASTStmtReader::VisitConvertVectorExpr(ConvertVectorExpr *E) {
1433 VisitExpr(E);
1434 bool HasFPFeatures = CurrentUnpackingBits->getNextBit();
1435 assert(HasFPFeatures == E->hasStoredFPFeatures());
1436 E->BuiltinLoc = readSourceLocation();
1437 E->RParenLoc = readSourceLocation();
1438 E->TInfo = readTypeSourceInfo();
1439 E->SrcExpr = Record.readSubExpr();
1440 if (HasFPFeatures)
1442 FPOptionsOverride::getFromOpaqueInt(Record.readInt()));
1443}
1444
1445void ASTStmtReader::VisitBlockExpr(BlockExpr *E) {
1446 VisitExpr(E);
1447 E->setBlockDecl(readDeclAs<BlockDecl>());
1448}
1449
1450void ASTStmtReader::VisitGenericSelectionExpr(GenericSelectionExpr *E) {
1451 VisitExpr(E);
1452
1453 unsigned NumAssocs = Record.readInt();
1454 assert(NumAssocs == E->getNumAssocs() && "Wrong NumAssocs!");
1455 E->IsExprPredicate = Record.readInt();
1456 E->ResultIndex = Record.readInt();
1457 E->GenericSelectionExprBits.GenericLoc = readSourceLocation();
1458 E->DefaultLoc = readSourceLocation();
1459 E->RParenLoc = readSourceLocation();
1460
1461 Stmt **Stmts = E->getTrailingObjects<Stmt *>();
1462 // Add 1 to account for the controlling expression which is the first
1463 // expression in the trailing array of Stmt *. This is not needed for
1464 // the trailing array of TypeSourceInfo *.
1465 for (unsigned I = 0, N = NumAssocs + 1; I < N; ++I)
1466 Stmts[I] = Record.readSubExpr();
1467
1468 TypeSourceInfo **TSIs = E->getTrailingObjects<TypeSourceInfo *>();
1469 for (unsigned I = 0, N = NumAssocs; I < N; ++I)
1470 TSIs[I] = readTypeSourceInfo();
1471}
1472
1473void ASTStmtReader::VisitPseudoObjectExpr(PseudoObjectExpr *E) {
1474 VisitExpr(E);
1475 unsigned numSemanticExprs = Record.readInt();
1476 assert(numSemanticExprs + 1 == E->PseudoObjectExprBits.NumSubExprs);
1477 E->PseudoObjectExprBits.ResultIndex = Record.readInt();
1478
1479 // Read the syntactic expression.
1480 E->getTrailingObjects()[0] = Record.readSubExpr();
1481
1482 // Read all the semantic expressions.
1483 for (unsigned i = 0; i != numSemanticExprs; ++i) {
1484 Expr *subExpr = Record.readSubExpr();
1485 E->getTrailingObjects()[i + 1] = subExpr;
1486 }
1487}
1488
1489void ASTStmtReader::VisitAtomicExpr(AtomicExpr *E) {
1490 VisitExpr(E);
1491 E->Op = AtomicExpr::AtomicOp(Record.readInt());
1492 E->NumSubExprs = AtomicExpr::getNumSubExprs(E->Op);
1493 for (unsigned I = 0; I != E->NumSubExprs; ++I)
1494 E->SubExprs[I] = Record.readSubExpr();
1495 E->BuiltinLoc = readSourceLocation();
1496 E->RParenLoc = readSourceLocation();
1497}
1498
1499//===----------------------------------------------------------------------===//
1500// Objective-C Expressions and Statements
1501
1502void ASTStmtReader::VisitObjCStringLiteral(ObjCStringLiteral *E) {
1503 VisitExpr(E);
1504 E->setString(cast<StringLiteral>(Record.readSubStmt()));
1505 E->setAtLoc(readSourceLocation());
1506}
1507
1508void ASTStmtReader::VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
1509 VisitExpr(E);
1510 // could be one of several IntegerLiteral, FloatLiteral, etc.
1511 E->SubExpr = Record.readSubStmt();
1512 E->BoxingMethod = readDeclAs<ObjCMethodDecl>();
1513 E->Range = readSourceRange();
1514}
1515
1516void ASTStmtReader::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
1517 VisitExpr(E);
1518 unsigned NumElements = Record.readInt();
1519 assert(NumElements == E->getNumElements() && "Wrong number of elements");
1520 Expr **Elements = E->getElements();
1521 for (unsigned I = 0, N = NumElements; I != N; ++I)
1522 Elements[I] = Record.readSubExpr();
1523 E->ArrayWithObjectsMethod = readDeclAs<ObjCMethodDecl>();
1524 E->Range = readSourceRange();
1525}
1526
1527void ASTStmtReader::VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *E) {
1528 VisitExpr(E);
1529 unsigned NumElements = Record.readInt();
1530 assert(NumElements == E->getNumElements() && "Wrong number of elements");
1531 bool HasPackExpansions = Record.readInt();
1532 assert(HasPackExpansions == E->HasPackExpansions &&"Pack expansion mismatch");
1533 auto *KeyValues =
1534 E->getTrailingObjects<ObjCDictionaryLiteral::KeyValuePair>();
1535 auto *Expansions =
1536 E->getTrailingObjects<ObjCDictionaryLiteral::ExpansionData>();
1537 for (unsigned I = 0; I != NumElements; ++I) {
1538 KeyValues[I].Key = Record.readSubExpr();
1539 KeyValues[I].Value = Record.readSubExpr();
1540 if (HasPackExpansions) {
1541 Expansions[I].EllipsisLoc = readSourceLocation();
1542 Expansions[I].NumExpansionsPlusOne = Record.readInt();
1543 }
1544 }
1545 E->DictWithObjectsMethod = readDeclAs<ObjCMethodDecl>();
1546 E->Range = readSourceRange();
1547}
1548
1549void ASTStmtReader::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
1550 VisitExpr(E);
1551 E->setEncodedTypeSourceInfo(readTypeSourceInfo());
1552 E->setAtLoc(readSourceLocation());
1553 E->setRParenLoc(readSourceLocation());
1554}
1555
1556void ASTStmtReader::VisitObjCSelectorExpr(ObjCSelectorExpr *E) {
1557 VisitExpr(E);
1558 E->setSelector(Record.readSelector());
1559 E->setAtLoc(readSourceLocation());
1560 E->setRParenLoc(readSourceLocation());
1561}
1562
1563void ASTStmtReader::VisitObjCProtocolExpr(ObjCProtocolExpr *E) {
1564 VisitExpr(E);
1565 E->setProtocol(readDeclAs<ObjCProtocolDecl>());
1566 E->setAtLoc(readSourceLocation());
1567 E->ProtoLoc = readSourceLocation();
1568 E->setRParenLoc(readSourceLocation());
1569}
1570
1571void ASTStmtReader::VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) {
1572 VisitExpr(E);
1573 E->setDecl(readDeclAs<ObjCIvarDecl>());
1574 E->setLocation(readSourceLocation());
1575 E->setOpLoc(readSourceLocation());
1576 E->setBase(Record.readSubExpr());
1577 E->setIsArrow(Record.readInt());
1578 E->setIsFreeIvar(Record.readInt());
1579}
1580
1581void ASTStmtReader::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
1582 VisitExpr(E);
1583 unsigned MethodRefFlags = Record.readInt();
1584 bool Implicit = Record.readInt() != 0;
1585 if (Implicit) {
1586 auto *Getter = readDeclAs<ObjCMethodDecl>();
1587 auto *Setter = readDeclAs<ObjCMethodDecl>();
1588 E->setImplicitProperty(Getter, Setter, MethodRefFlags);
1589 } else {
1590 E->setExplicitProperty(readDeclAs<ObjCPropertyDecl>(), MethodRefFlags);
1591 }
1592 E->setLocation(readSourceLocation());
1593 E->setReceiverLocation(readSourceLocation());
1594 switch (Record.readInt()) {
1595 case 0:
1596 E->setBase(Record.readSubExpr());
1597 break;
1598 case 1:
1599 E->setSuperReceiver(Record.readType());
1600 break;
1601 case 2:
1602 E->setClassReceiver(readDeclAs<ObjCInterfaceDecl>());
1603 break;
1604 }
1605}
1606
1607void ASTStmtReader::VisitObjCSubscriptRefExpr(ObjCSubscriptRefExpr *E) {
1608 VisitExpr(E);
1609 E->setRBracket(readSourceLocation());
1610 E->setBaseExpr(Record.readSubExpr());
1611 E->setKeyExpr(Record.readSubExpr());
1612 E->GetAtIndexMethodDecl = readDeclAs<ObjCMethodDecl>();
1613 E->SetAtIndexMethodDecl = readDeclAs<ObjCMethodDecl>();
1614}
1615
1616void ASTStmtReader::VisitObjCMessageExpr(ObjCMessageExpr *E) {
1617 VisitExpr(E);
1618 assert(Record.peekInt() == E->getNumArgs());
1619 Record.skipInts(1);
1620 unsigned NumStoredSelLocs = Record.readInt();
1621 E->SelLocsKind = Record.readInt();
1622 E->setDelegateInitCall(Record.readInt());
1623 E->IsImplicit = Record.readInt();
1624 auto Kind = static_cast<ObjCMessageExpr::ReceiverKind>(Record.readInt());
1625 switch (Kind) {
1627 E->setInstanceReceiver(Record.readSubExpr());
1628 break;
1629
1631 E->setClassReceiver(readTypeSourceInfo());
1632 break;
1633
1636 QualType T = Record.readType();
1637 SourceLocation SuperLoc = readSourceLocation();
1638 E->setSuper(SuperLoc, T, Kind == ObjCMessageExpr::SuperInstance);
1639 break;
1640 }
1641 }
1642
1643 assert(Kind == E->getReceiverKind());
1644
1645 if (Record.readInt())
1646 E->setMethodDecl(readDeclAs<ObjCMethodDecl>());
1647 else
1648 E->setSelector(Record.readSelector());
1649
1650 E->LBracLoc = readSourceLocation();
1651 E->RBracLoc = readSourceLocation();
1652
1653 for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1654 E->setArg(I, Record.readSubExpr());
1655
1656 SourceLocation *Locs = E->getStoredSelLocs();
1657 for (unsigned I = 0; I != NumStoredSelLocs; ++I)
1658 Locs[I] = readSourceLocation();
1659}
1660
1661void ASTStmtReader::VisitObjCForCollectionStmt(ObjCForCollectionStmt *S) {
1662 VisitStmt(S);
1663 S->setElement(Record.readSubStmt());
1664 S->setCollection(Record.readSubExpr());
1665 S->setBody(Record.readSubStmt());
1666 S->setForLoc(readSourceLocation());
1667 S->setRParenLoc(readSourceLocation());
1668}
1669
1670void ASTStmtReader::VisitObjCAtCatchStmt(ObjCAtCatchStmt *S) {
1671 VisitStmt(S);
1672 S->setCatchBody(Record.readSubStmt());
1673 S->setCatchParamDecl(readDeclAs<VarDecl>());
1674 S->setAtCatchLoc(readSourceLocation());
1675 S->setRParenLoc(readSourceLocation());
1676}
1677
1678void ASTStmtReader::VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S) {
1679 VisitStmt(S);
1680 S->setFinallyBody(Record.readSubStmt());
1681 S->setAtFinallyLoc(readSourceLocation());
1682}
1683
1684void ASTStmtReader::VisitObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S) {
1685 VisitStmt(S); // FIXME: no test coverage.
1686 S->setSubStmt(Record.readSubStmt());
1687 S->setAtLoc(readSourceLocation());
1688}
1689
1690void ASTStmtReader::VisitObjCAtTryStmt(ObjCAtTryStmt *S) {
1691 VisitStmt(S);
1692 assert(Record.peekInt() == S->getNumCatchStmts());
1693 Record.skipInts(1);
1694 bool HasFinally = Record.readInt();
1695 S->setTryBody(Record.readSubStmt());
1696 for (unsigned I = 0, N = S->getNumCatchStmts(); I != N; ++I)
1697 S->setCatchStmt(I, cast_or_null<ObjCAtCatchStmt>(Record.readSubStmt()));
1698
1699 if (HasFinally)
1700 S->setFinallyStmt(Record.readSubStmt());
1701 S->setAtTryLoc(readSourceLocation());
1702}
1703
1704void ASTStmtReader::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
1705 VisitStmt(S); // FIXME: no test coverage.
1706 S->setSynchExpr(Record.readSubStmt());
1707 S->setSynchBody(Record.readSubStmt());
1708 S->setAtSynchronizedLoc(readSourceLocation());
1709}
1710
1711void ASTStmtReader::VisitObjCAtThrowStmt(ObjCAtThrowStmt *S) {
1712 VisitStmt(S); // FIXME: no test coverage.
1713 S->setThrowExpr(Record.readSubStmt());
1714 S->setThrowLoc(readSourceLocation());
1715}
1716
1717void ASTStmtReader::VisitObjCBoolLiteralExpr(ObjCBoolLiteralExpr *E) {
1718 VisitExpr(E);
1719 E->setValue(Record.readInt());
1720 E->setLocation(readSourceLocation());
1721}
1722
1723void ASTStmtReader::VisitObjCAvailabilityCheckExpr(ObjCAvailabilityCheckExpr *E) {
1724 VisitExpr(E);
1725 SourceRange R = Record.readSourceRange();
1726 E->AtLoc = R.getBegin();
1727 E->RParen = R.getEnd();
1728 E->VersionToCheck = Record.readVersionTuple();
1729}
1730
1731//===----------------------------------------------------------------------===//
1732// C++ Expressions and Statements
1733//===----------------------------------------------------------------------===//
1734
1735void ASTStmtReader::VisitCXXCatchStmt(CXXCatchStmt *S) {
1736 VisitStmt(S);
1737 S->CatchLoc = readSourceLocation();
1738 S->ExceptionDecl = readDeclAs<VarDecl>();
1739 S->HandlerBlock = Record.readSubStmt();
1740}
1741
1742void ASTStmtReader::VisitCXXTryStmt(CXXTryStmt *S) {
1743 VisitStmt(S);
1744 assert(Record.peekInt() == S->getNumHandlers() && "NumStmtFields is wrong ?");
1745 Record.skipInts(1);
1746 S->TryLoc = readSourceLocation();
1747 S->getStmts()[0] = Record.readSubStmt();
1748 for (unsigned i = 0, e = S->getNumHandlers(); i != e; ++i)
1749 S->getStmts()[i + 1] = Record.readSubStmt();
1750}
1751
1752void ASTStmtReader::VisitCXXForRangeStmt(CXXForRangeStmt *S) {
1753 VisitStmt(S);
1754 S->ForLoc = readSourceLocation();
1755 S->CoawaitLoc = readSourceLocation();
1756 S->ColonLoc = readSourceLocation();
1757 S->RParenLoc = readSourceLocation();
1758 S->setInit(Record.readSubStmt());
1759 S->setRangeStmt(Record.readSubStmt());
1760 S->setBeginStmt(Record.readSubStmt());
1761 S->setEndStmt(Record.readSubStmt());
1762 S->setCond(Record.readSubExpr());
1763 S->setInc(Record.readSubExpr());
1764 S->setLoopVarStmt(Record.readSubStmt());
1765 S->setBody(Record.readSubStmt());
1766}
1767
1768void ASTStmtReader::VisitMSDependentExistsStmt(MSDependentExistsStmt *S) {
1769 VisitStmt(S);
1770 S->KeywordLoc = readSourceLocation();
1771 S->IsIfExists = Record.readInt();
1772 S->QualifierLoc = Record.readNestedNameSpecifierLoc();
1773 S->NameInfo = Record.readDeclarationNameInfo();
1774 S->SubStmt = Record.readSubStmt();
1775}
1776
1777void ASTStmtReader::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
1778 VisitCallExpr(E);
1779 E->CXXOperatorCallExprBits.OperatorKind = Record.readInt();
1780 E->BeginLoc = Record.readSourceLocation();
1781}
1782
1783void ASTStmtReader::VisitCXXRewrittenBinaryOperator(
1785 VisitExpr(E);
1786 E->CXXRewrittenBinaryOperatorBits.IsReversed = Record.readInt();
1787 E->SemanticForm = Record.readSubExpr();
1788}
1789
1790void ASTStmtReader::VisitCXXConstructExpr(CXXConstructExpr *E) {
1791 VisitExpr(E);
1792
1793 unsigned NumArgs = Record.readInt();
1794 assert((NumArgs == E->getNumArgs()) && "Wrong NumArgs!");
1795
1796 E->CXXConstructExprBits.Elidable = Record.readInt();
1797 E->CXXConstructExprBits.HadMultipleCandidates = Record.readInt();
1798 E->CXXConstructExprBits.ListInitialization = Record.readInt();
1799 E->CXXConstructExprBits.StdInitListInitialization = Record.readInt();
1800 E->CXXConstructExprBits.ZeroInitialization = Record.readInt();
1801 E->CXXConstructExprBits.ConstructionKind = Record.readInt();
1802 E->CXXConstructExprBits.IsImmediateEscalating = Record.readInt();
1803 E->CXXConstructExprBits.Loc = readSourceLocation();
1804 E->Constructor = readDeclAs<CXXConstructorDecl>();
1805 E->ParenOrBraceRange = readSourceRange();
1806
1807 for (unsigned I = 0; I != NumArgs; ++I)
1808 E->setArg(I, Record.readSubExpr());
1809}
1810
1811void ASTStmtReader::VisitCXXInheritedCtorInitExpr(CXXInheritedCtorInitExpr *E) {
1812 VisitExpr(E);
1813 E->Constructor = readDeclAs<CXXConstructorDecl>();
1814 E->Loc = readSourceLocation();
1815 E->ConstructsVirtualBase = Record.readInt();
1816 E->InheritedFromVirtualBase = Record.readInt();
1817}
1818
1819void ASTStmtReader::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
1820 VisitCXXConstructExpr(E);
1821 E->TSI = readTypeSourceInfo();
1822}
1823
1824void ASTStmtReader::VisitLambdaExpr(LambdaExpr *E) {
1825 VisitExpr(E);
1826 unsigned NumCaptures = Record.readInt();
1827 (void)NumCaptures;
1828 assert(NumCaptures == E->LambdaExprBits.NumCaptures);
1829 E->IntroducerRange = readSourceRange();
1830 E->LambdaExprBits.CaptureDefault = Record.readInt();
1831 E->CaptureDefaultLoc = readSourceLocation();
1832 E->LambdaExprBits.ExplicitParams = Record.readInt();
1833 E->LambdaExprBits.ExplicitResultType = Record.readInt();
1834 E->ClosingBrace = readSourceLocation();
1835
1836 // Read capture initializers.
1838 CEnd = E->capture_init_end();
1839 C != CEnd; ++C)
1840 *C = Record.readSubExpr();
1841
1842 // The body will be lazily deserialized when needed from the call operator
1843 // declaration.
1844}
1845
1846void
1847ASTStmtReader::VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E) {
1848 VisitExpr(E);
1849 E->SubExpr = Record.readSubExpr();
1850}
1851
1852void ASTStmtReader::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) {
1853 VisitExplicitCastExpr(E);
1854 SourceRange R = readSourceRange();
1855 E->Loc = R.getBegin();
1856 E->RParenLoc = R.getEnd();
1857 if (CurrentUnpackingBits->getNextBit())
1858 E->AngleBrackets = readSourceRange();
1859}
1860
1861void ASTStmtReader::VisitCXXStaticCastExpr(CXXStaticCastExpr *E) {
1862 return VisitCXXNamedCastExpr(E);
1863}
1864
1865void ASTStmtReader::VisitCXXDynamicCastExpr(CXXDynamicCastExpr *E) {
1866 return VisitCXXNamedCastExpr(E);
1867}
1868
1869void ASTStmtReader::VisitCXXReinterpretCastExpr(CXXReinterpretCastExpr *E) {
1870 return VisitCXXNamedCastExpr(E);
1871}
1872
1873void ASTStmtReader::VisitCXXAddrspaceCastExpr(CXXAddrspaceCastExpr *E) {
1874 return VisitCXXNamedCastExpr(E);
1875}
1876
1877void ASTStmtReader::VisitCXXConstCastExpr(CXXConstCastExpr *E) {
1878 return VisitCXXNamedCastExpr(E);
1879}
1880
1881void ASTStmtReader::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E) {
1882 VisitExplicitCastExpr(E);
1883 E->setLParenLoc(readSourceLocation());
1884 E->setRParenLoc(readSourceLocation());
1885}
1886
1887void ASTStmtReader::VisitBuiltinBitCastExpr(BuiltinBitCastExpr *E) {
1888 VisitExplicitCastExpr(E);
1889 E->KWLoc = readSourceLocation();
1890 E->RParenLoc = readSourceLocation();
1891}
1892
1893void ASTStmtReader::VisitUserDefinedLiteral(UserDefinedLiteral *E) {
1894 VisitCallExpr(E);
1895 E->UDSuffixLoc = readSourceLocation();
1896}
1897
1898void ASTStmtReader::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) {
1899 VisitExpr(E);
1900 E->setValue(Record.readInt());
1901 E->setLocation(readSourceLocation());
1902}
1903
1904void ASTStmtReader::VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E) {
1905 VisitExpr(E);
1906 E->setLocation(readSourceLocation());
1907}
1908
1909void ASTStmtReader::VisitCXXTypeidExpr(CXXTypeidExpr *E) {
1910 VisitExpr(E);
1911 E->setSourceRange(readSourceRange());
1912 if (E->isTypeOperand())
1913 E->Operand = readTypeSourceInfo();
1914 else
1915 E->Operand = Record.readSubExpr();
1916}
1917
1918void ASTStmtReader::VisitCXXThisExpr(CXXThisExpr *E) {
1919 VisitExpr(E);
1920 E->setLocation(readSourceLocation());
1921 E->setImplicit(Record.readInt());
1923}
1924
1925void ASTStmtReader::VisitCXXThrowExpr(CXXThrowExpr *E) {
1926 VisitExpr(E);
1927 E->CXXThrowExprBits.ThrowLoc = readSourceLocation();
1928 E->Operand = Record.readSubExpr();
1929 E->CXXThrowExprBits.IsThrownVariableInScope = Record.readInt();
1930}
1931
1932void ASTStmtReader::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
1933 VisitExpr(E);
1934 E->Param = readDeclAs<ParmVarDecl>();
1935 E->UsedContext = readDeclAs<DeclContext>();
1936 E->CXXDefaultArgExprBits.Loc = readSourceLocation();
1937 E->CXXDefaultArgExprBits.HasRewrittenInit = Record.readInt();
1938 if (E->CXXDefaultArgExprBits.HasRewrittenInit)
1939 *E->getTrailingObjects() = Record.readSubExpr();
1940}
1941
1942void ASTStmtReader::VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E) {
1943 VisitExpr(E);
1944 E->CXXDefaultInitExprBits.HasRewrittenInit = Record.readInt();
1945 E->Field = readDeclAs<FieldDecl>();
1946 E->UsedContext = readDeclAs<DeclContext>();
1947 E->CXXDefaultInitExprBits.Loc = readSourceLocation();
1948 if (E->CXXDefaultInitExprBits.HasRewrittenInit)
1949 *E->getTrailingObjects() = Record.readSubExpr();
1950}
1951
1952void ASTStmtReader::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
1953 VisitExpr(E);
1954 E->setTemporary(Record.readCXXTemporary());
1955 E->setSubExpr(Record.readSubExpr());
1956}
1957
1958void ASTStmtReader::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
1959 VisitExpr(E);
1960 E->TypeInfo = readTypeSourceInfo();
1961 E->CXXScalarValueInitExprBits.RParenLoc = readSourceLocation();
1962}
1963
1964void ASTStmtReader::VisitCXXNewExpr(CXXNewExpr *E) {
1965 VisitExpr(E);
1966
1967 bool IsArray = Record.readInt();
1968 bool HasInit = Record.readInt();
1969 unsigned NumPlacementArgs = Record.readInt();
1970 bool IsParenTypeId = Record.readInt();
1971
1972 E->CXXNewExprBits.IsGlobalNew = Record.readInt();
1973 E->CXXNewExprBits.ShouldPassAlignment = Record.readInt();
1974 E->CXXNewExprBits.ShouldPassTypeIdentity = Record.readInt();
1975 E->CXXNewExprBits.UsualArrayDeleteWantsSize = Record.readInt();
1976 E->CXXNewExprBits.HasInitializer = Record.readInt();
1977 E->CXXNewExprBits.StoredInitializationStyle = Record.readInt();
1978
1979 assert((IsArray == E->isArray()) && "Wrong IsArray!");
1980 assert((HasInit == E->hasInitializer()) && "Wrong HasInit!");
1981 assert((NumPlacementArgs == E->getNumPlacementArgs()) &&
1982 "Wrong NumPlacementArgs!");
1983 assert((IsParenTypeId == E->isParenTypeId()) && "Wrong IsParenTypeId!");
1984 (void)IsArray;
1985 (void)HasInit;
1986 (void)NumPlacementArgs;
1987
1988 E->setOperatorNew(readDeclAs<FunctionDecl>());
1989 E->setOperatorDelete(readDeclAs<FunctionDecl>());
1990 E->AllocatedTypeInfo = readTypeSourceInfo();
1991 if (IsParenTypeId)
1992 E->getTrailingObjects<SourceRange>()[0] = readSourceRange();
1993 E->Range = readSourceRange();
1994 E->DirectInitRange = readSourceRange();
1995
1996 // Install all the subexpressions.
1998 N = E->raw_arg_end();
1999 I != N; ++I)
2000 *I = Record.readSubStmt();
2001}
2002
2003void ASTStmtReader::VisitCXXDeleteExpr(CXXDeleteExpr *E) {
2004 VisitExpr(E);
2005 E->CXXDeleteExprBits.GlobalDelete = Record.readInt();
2006 E->CXXDeleteExprBits.ArrayForm = Record.readInt();
2007 E->CXXDeleteExprBits.ArrayFormAsWritten = Record.readInt();
2008 E->CXXDeleteExprBits.UsualArrayDeleteWantsSize = Record.readInt();
2009 E->OperatorDelete = readDeclAs<FunctionDecl>();
2010 E->Argument = Record.readSubExpr();
2011 E->CXXDeleteExprBits.Loc = readSourceLocation();
2012}
2013
2014void ASTStmtReader::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
2015 VisitExpr(E);
2016
2017 E->Base = Record.readSubExpr();
2018 E->IsArrow = Record.readInt();
2019 E->OperatorLoc = readSourceLocation();
2020 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
2021 E->ScopeType = readTypeSourceInfo();
2022 E->ColonColonLoc = readSourceLocation();
2023 E->TildeLoc = readSourceLocation();
2024
2025 IdentifierInfo *II = Record.readIdentifier();
2026 if (II)
2027 E->setDestroyedType(II, readSourceLocation());
2028 else
2029 E->setDestroyedType(readTypeSourceInfo());
2030}
2031
2032void ASTStmtReader::VisitExprWithCleanups(ExprWithCleanups *E) {
2033 VisitExpr(E);
2034
2035 unsigned NumObjects = Record.readInt();
2036 assert(NumObjects == E->getNumObjects());
2037 for (unsigned i = 0; i != NumObjects; ++i) {
2038 unsigned CleanupKind = Record.readInt();
2040 if (CleanupKind == COK_Block)
2041 Obj = readDeclAs<BlockDecl>();
2042 else if (CleanupKind == COK_CompoundLiteral)
2043 Obj = cast<CompoundLiteralExpr>(Record.readSubExpr());
2044 else
2045 llvm_unreachable("unexpected cleanup object type");
2046 E->getTrailingObjects()[i] = Obj;
2047 }
2048
2049 E->ExprWithCleanupsBits.CleanupsHaveSideEffects = Record.readInt();
2050 E->SubExpr = Record.readSubExpr();
2051}
2052
2053void ASTStmtReader::VisitCXXDependentScopeMemberExpr(
2055 VisitExpr(E);
2056
2057 unsigned NumTemplateArgs = Record.readInt();
2058 CurrentUnpackingBits.emplace(Record.readInt());
2059 bool HasTemplateKWAndArgsInfo = CurrentUnpackingBits->getNextBit();
2060 bool HasFirstQualifierFoundInScope = CurrentUnpackingBits->getNextBit();
2061
2062 assert((HasTemplateKWAndArgsInfo == E->hasTemplateKWAndArgsInfo()) &&
2063 "Wrong HasTemplateKWAndArgsInfo!");
2064 assert(
2065 (HasFirstQualifierFoundInScope == E->hasFirstQualifierFoundInScope()) &&
2066 "Wrong HasFirstQualifierFoundInScope!");
2067
2068 if (HasTemplateKWAndArgsInfo)
2070 *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
2071 E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs);
2072
2073 assert((NumTemplateArgs == E->getNumTemplateArgs()) &&
2074 "Wrong NumTemplateArgs!");
2075
2077 CurrentUnpackingBits->getNextBit();
2078
2079 E->BaseType = Record.readType();
2080 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
2081 // not ImplicitAccess
2082 if (CurrentUnpackingBits->getNextBit())
2083 E->Base = Record.readSubExpr();
2084 else
2085 E->Base = nullptr;
2086
2087 E->CXXDependentScopeMemberExprBits.OperatorLoc = readSourceLocation();
2088
2089 if (HasFirstQualifierFoundInScope)
2090 *E->getTrailingObjects<NamedDecl *>() = readDeclAs<NamedDecl>();
2091
2092 E->MemberNameInfo = Record.readDeclarationNameInfo();
2093}
2094
2095void
2096ASTStmtReader::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) {
2097 VisitExpr(E);
2098
2099 if (CurrentUnpackingBits->getNextBit()) // HasTemplateKWAndArgsInfo
2101 *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
2102 E->getTrailingObjects<TemplateArgumentLoc>(),
2103 /*NumTemplateArgs=*/CurrentUnpackingBits->getNextBits(/*Width=*/16));
2104
2105 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
2106 E->NameInfo = Record.readDeclarationNameInfo();
2107}
2108
2109void
2110ASTStmtReader::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E) {
2111 VisitExpr(E);
2112 assert(Record.peekInt() == E->getNumArgs() &&
2113 "Read wrong record during creation ?");
2114 Record.skipInts(1);
2115 for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
2116 E->setArg(I, Record.readSubExpr());
2117 E->TypeAndInitForm.setPointer(readTypeSourceInfo());
2118 E->setLParenLoc(readSourceLocation());
2119 E->setRParenLoc(readSourceLocation());
2120 E->TypeAndInitForm.setInt(Record.readInt());
2121}
2122
2123void ASTStmtReader::VisitOverloadExpr(OverloadExpr *E) {
2124 VisitExpr(E);
2125
2126 unsigned NumResults = Record.readInt();
2127 CurrentUnpackingBits.emplace(Record.readInt());
2128 bool HasTemplateKWAndArgsInfo = CurrentUnpackingBits->getNextBit();
2129 assert((E->getNumDecls() == NumResults) && "Wrong NumResults!");
2130 assert((E->hasTemplateKWAndArgsInfo() == HasTemplateKWAndArgsInfo) &&
2131 "Wrong HasTemplateKWAndArgsInfo!");
2132
2133 unsigned NumTemplateArgs = 0;
2134 if (HasTemplateKWAndArgsInfo) {
2135 NumTemplateArgs = Record.readInt();
2138 NumTemplateArgs);
2139 }
2140
2141 UnresolvedSet<8> Decls;
2142 for (unsigned I = 0; I != NumResults; ++I) {
2143 auto *D = readDeclAs<NamedDecl>();
2144 auto AS = (AccessSpecifier)Record.readInt();
2145 Decls.addDecl(D, AS);
2146 }
2147
2148 DeclAccessPair *Results = E->getTrailingResults();
2149 UnresolvedSetIterator Iter = Decls.begin();
2150 for (unsigned I = 0; I != NumResults; ++I) {
2151 Results[I] = (Iter + I).getPair();
2152 }
2153
2154 assert((E->getNumTemplateArgs() == NumTemplateArgs) &&
2155 "Wrong NumTemplateArgs!");
2156
2157 E->NameInfo = Record.readDeclarationNameInfo();
2158 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
2159}
2160
2161void ASTStmtReader::VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
2162 VisitOverloadExpr(E);
2163 E->UnresolvedMemberExprBits.IsArrow = CurrentUnpackingBits->getNextBit();
2164 E->UnresolvedMemberExprBits.HasUnresolvedUsing =
2165 CurrentUnpackingBits->getNextBit();
2166
2167 if (/*!isImplicitAccess=*/CurrentUnpackingBits->getNextBit())
2168 E->Base = Record.readSubExpr();
2169 else
2170 E->Base = nullptr;
2171
2172 E->OperatorLoc = readSourceLocation();
2173
2174 E->BaseType = Record.readType();
2175}
2176
2177void ASTStmtReader::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) {
2178 VisitOverloadExpr(E);
2179 E->UnresolvedLookupExprBits.RequiresADL = CurrentUnpackingBits->getNextBit();
2180 E->NamingClass = readDeclAs<CXXRecordDecl>();
2181}
2182
2183void ASTStmtReader::VisitTypeTraitExpr(TypeTraitExpr *E) {
2184 VisitExpr(E);
2185 E->TypeTraitExprBits.IsBooleanTypeTrait = Record.readInt();
2186 E->TypeTraitExprBits.NumArgs = Record.readInt();
2187 E->TypeTraitExprBits.Kind = Record.readInt();
2188
2189 if (E->TypeTraitExprBits.IsBooleanTypeTrait)
2190 E->TypeTraitExprBits.Value = Record.readInt();
2191 else
2192 *E->getTrailingObjects<APValue>() = Record.readAPValue();
2193
2194 SourceRange Range = readSourceRange();
2195 E->Loc = Range.getBegin();
2196 E->RParenLoc = Range.getEnd();
2197
2198 auto **Args = E->getTrailingObjects<TypeSourceInfo *>();
2199 for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
2200 Args[I] = readTypeSourceInfo();
2201}
2202
2203void ASTStmtReader::VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E) {
2204 VisitExpr(E);
2205 E->ArrayTypeTraitExprBits.ATT = (ArrayTypeTrait)Record.readInt();
2206 E->Value = (unsigned int)Record.readInt();
2207 SourceRange Range = readSourceRange();
2208 E->Loc = Range.getBegin();
2209 E->RParen = Range.getEnd();
2210 E->QueriedType = readTypeSourceInfo();
2211 E->Dimension = Record.readSubExpr();
2212}
2213
2214void ASTStmtReader::VisitExpressionTraitExpr(ExpressionTraitExpr *E) {
2215 VisitExpr(E);
2216 E->ExpressionTraitExprBits.ET = (ExpressionTrait)Record.readInt();
2217 E->ExpressionTraitExprBits.Value = (bool)Record.readInt();
2218 SourceRange Range = readSourceRange();
2219 E->QueriedExpression = Record.readSubExpr();
2220 E->Loc = Range.getBegin();
2221 E->RParen = Range.getEnd();
2222}
2223
2224void ASTStmtReader::VisitCXXNoexceptExpr(CXXNoexceptExpr *E) {
2225 VisitExpr(E);
2226 E->CXXNoexceptExprBits.Value = Record.readInt();
2227 E->Range = readSourceRange();
2228 E->Operand = Record.readSubExpr();
2229}
2230
2231void ASTStmtReader::VisitPackExpansionExpr(PackExpansionExpr *E) {
2232 VisitExpr(E);
2233 E->EllipsisLoc = readSourceLocation();
2234 E->NumExpansions = Record.readInt();
2235 E->Pattern = Record.readSubExpr();
2236}
2237
2238void ASTStmtReader::VisitSizeOfPackExpr(SizeOfPackExpr *E) {
2239 VisitExpr(E);
2240 unsigned NumPartialArgs = Record.readInt();
2241 E->OperatorLoc = readSourceLocation();
2242 E->PackLoc = readSourceLocation();
2243 E->RParenLoc = readSourceLocation();
2244 E->Pack = Record.readDeclAs<NamedDecl>();
2245 if (E->isPartiallySubstituted()) {
2246 assert(E->Length == NumPartialArgs);
2247 for (auto *I = E->getTrailingObjects(), *E = I + NumPartialArgs; I != E;
2248 ++I)
2249 new (I) TemplateArgument(Record.readTemplateArgument());
2250 } else if (!E->isValueDependent()) {
2251 E->Length = Record.readInt();
2252 }
2253}
2254
2255void ASTStmtReader::VisitPackIndexingExpr(PackIndexingExpr *E) {
2256 VisitExpr(E);
2257 E->PackIndexingExprBits.TransformedExpressions = Record.readInt();
2258 E->PackIndexingExprBits.FullySubstituted = Record.readInt();
2259 E->EllipsisLoc = readSourceLocation();
2260 E->RSquareLoc = readSourceLocation();
2261 E->SubExprs[0] = Record.readStmt();
2262 E->SubExprs[1] = Record.readStmt();
2263 auto **Exprs = E->getTrailingObjects();
2264 for (unsigned I = 0; I < E->PackIndexingExprBits.TransformedExpressions; ++I)
2265 Exprs[I] = Record.readExpr();
2266}
2267
2268void ASTStmtReader::VisitSubstNonTypeTemplateParmExpr(
2270 VisitExpr(E);
2271 E->AssociatedDeclAndRef.setPointer(readDeclAs<Decl>());
2272 E->AssociatedDeclAndRef.setInt(CurrentUnpackingBits->getNextBit());
2273 E->Index = CurrentUnpackingBits->getNextBits(/*Width=*/12);
2274 E->PackIndex = Record.readUnsignedOrNone().toInternalRepresentation();
2275 E->Final = CurrentUnpackingBits->getNextBit();
2276 E->SubstNonTypeTemplateParmExprBits.NameLoc = readSourceLocation();
2277 E->Replacement = Record.readSubExpr();
2278}
2279
2280void ASTStmtReader::VisitSubstNonTypeTemplateParmPackExpr(
2282 VisitExpr(E);
2283 E->AssociatedDecl = readDeclAs<Decl>();
2284 E->Final = CurrentUnpackingBits->getNextBit();
2285 E->Index = Record.readInt();
2286 TemplateArgument ArgPack = Record.readTemplateArgument();
2287 if (ArgPack.getKind() != TemplateArgument::Pack)
2288 return;
2289
2290 E->Arguments = ArgPack.pack_begin();
2291 E->NumArguments = ArgPack.pack_size();
2292 E->NameLoc = readSourceLocation();
2293}
2294
2295void ASTStmtReader::VisitFunctionParmPackExpr(FunctionParmPackExpr *E) {
2296 VisitExpr(E);
2297 E->NumParameters = Record.readInt();
2298 E->ParamPack = readDeclAs<ValueDecl>();
2299 E->NameLoc = readSourceLocation();
2300 auto **Parms = E->getTrailingObjects();
2301 for (unsigned i = 0, n = E->NumParameters; i != n; ++i)
2302 Parms[i] = readDeclAs<ValueDecl>();
2303}
2304
2305void ASTStmtReader::VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E) {
2306 VisitExpr(E);
2307 bool HasMaterialzedDecl = Record.readInt();
2308 if (HasMaterialzedDecl)
2309 E->State = cast<LifetimeExtendedTemporaryDecl>(Record.readDecl());
2310 else
2311 E->State = Record.readSubExpr();
2312}
2313
2314void ASTStmtReader::VisitCXXFoldExpr(CXXFoldExpr *E) {
2315 VisitExpr(E);
2316 E->LParenLoc = readSourceLocation();
2317 E->EllipsisLoc = readSourceLocation();
2318 E->RParenLoc = readSourceLocation();
2319 E->NumExpansions = Record.readUnsignedOrNone();
2320 E->SubExprs[0] = Record.readSubExpr();
2321 E->SubExprs[1] = Record.readSubExpr();
2322 E->SubExprs[2] = Record.readSubExpr();
2323 E->CXXFoldExprBits.Opcode = (BinaryOperatorKind)Record.readInt();
2324}
2325
2326void ASTStmtReader::VisitCXXParenListInitExpr(CXXParenListInitExpr *E) {
2327 VisitExpr(E);
2328 unsigned ExpectedNumExprs = Record.readInt();
2329 assert(E->NumExprs == ExpectedNumExprs &&
2330 "expected number of expressions does not equal the actual number of "
2331 "serialized expressions.");
2332 E->NumUserSpecifiedExprs = Record.readInt();
2333 E->InitLoc = readSourceLocation();
2334 E->LParenLoc = readSourceLocation();
2335 E->RParenLoc = readSourceLocation();
2336 for (unsigned I = 0; I < ExpectedNumExprs; I++)
2337 E->getTrailingObjects()[I] = Record.readSubExpr();
2338
2339 bool HasArrayFillerOrUnionDecl = Record.readBool();
2340 if (HasArrayFillerOrUnionDecl) {
2341 bool HasArrayFiller = Record.readBool();
2342 if (HasArrayFiller) {
2343 E->setArrayFiller(Record.readSubExpr());
2344 } else {
2345 E->setInitializedFieldInUnion(readDeclAs<FieldDecl>());
2346 }
2347 }
2348 E->updateDependence();
2349}
2350
2351void ASTStmtReader::VisitOpaqueValueExpr(OpaqueValueExpr *E) {
2352 VisitExpr(E);
2353 E->SourceExpr = Record.readSubExpr();
2354 E->OpaqueValueExprBits.Loc = readSourceLocation();
2355 E->setIsUnique(Record.readInt());
2356}
2357
2358void ASTStmtReader::VisitRecoveryExpr(RecoveryExpr *E) {
2359 VisitExpr(E);
2360 unsigned NumArgs = Record.readInt();
2361 E->BeginLoc = readSourceLocation();
2362 E->EndLoc = readSourceLocation();
2363 assert((NumArgs + 0LL ==
2364 std::distance(E->children().begin(), E->children().end())) &&
2365 "Wrong NumArgs!");
2366 (void)NumArgs;
2367 for (Stmt *&Child : E->children())
2368 Child = Record.readSubStmt();
2369}
2370
2371//===----------------------------------------------------------------------===//
2372// Microsoft Expressions and Statements
2373//===----------------------------------------------------------------------===//
2374void ASTStmtReader::VisitMSPropertyRefExpr(MSPropertyRefExpr *E) {
2375 VisitExpr(E);
2376 E->IsArrow = (Record.readInt() != 0);
2377 E->BaseExpr = Record.readSubExpr();
2378 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
2379 E->MemberLoc = readSourceLocation();
2380 E->TheDecl = readDeclAs<MSPropertyDecl>();
2381}
2382
2383void ASTStmtReader::VisitMSPropertySubscriptExpr(MSPropertySubscriptExpr *E) {
2384 VisitExpr(E);
2385 E->setBase(Record.readSubExpr());
2386 E->setIdx(Record.readSubExpr());
2387 E->setRBracketLoc(readSourceLocation());
2388}
2389
2390void ASTStmtReader::VisitCXXUuidofExpr(CXXUuidofExpr *E) {
2391 VisitExpr(E);
2392 E->setSourceRange(readSourceRange());
2393 E->Guid = readDeclAs<MSGuidDecl>();
2394 if (E->isTypeOperand())
2395 E->Operand = readTypeSourceInfo();
2396 else
2397 E->Operand = Record.readSubExpr();
2398}
2399
2400void ASTStmtReader::VisitSEHLeaveStmt(SEHLeaveStmt *S) {
2401 VisitStmt(S);
2402 S->setLeaveLoc(readSourceLocation());
2403}
2404
2405void ASTStmtReader::VisitSEHExceptStmt(SEHExceptStmt *S) {
2406 VisitStmt(S);
2407 S->Loc = readSourceLocation();
2408 S->Children[SEHExceptStmt::FILTER_EXPR] = Record.readSubStmt();
2409 S->Children[SEHExceptStmt::BLOCK] = Record.readSubStmt();
2410}
2411
2412void ASTStmtReader::VisitSEHFinallyStmt(SEHFinallyStmt *S) {
2413 VisitStmt(S);
2414 S->Loc = readSourceLocation();
2415 S->Block = Record.readSubStmt();
2416}
2417
2418void ASTStmtReader::VisitSEHTryStmt(SEHTryStmt *S) {
2419 VisitStmt(S);
2420 S->IsCXXTry = Record.readInt();
2421 S->TryLoc = readSourceLocation();
2422 S->Children[SEHTryStmt::TRY] = Record.readSubStmt();
2423 S->Children[SEHTryStmt::HANDLER] = Record.readSubStmt();
2424}
2425
2426//===----------------------------------------------------------------------===//
2427// CUDA Expressions and Statements
2428//===----------------------------------------------------------------------===//
2429
2430void ASTStmtReader::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E) {
2431 VisitCallExpr(E);
2432 E->setPreArg(CUDAKernelCallExpr::CONFIG, Record.readSubExpr());
2433}
2434
2435//===----------------------------------------------------------------------===//
2436// OpenCL Expressions and Statements.
2437//===----------------------------------------------------------------------===//
2438void ASTStmtReader::VisitAsTypeExpr(AsTypeExpr *E) {
2439 VisitExpr(E);
2440 E->BuiltinLoc = readSourceLocation();
2441 E->RParenLoc = readSourceLocation();
2442 E->SrcExpr = Record.readSubExpr();
2443}
2444
2445//===----------------------------------------------------------------------===//
2446// OpenMP Directives.
2447//===----------------------------------------------------------------------===//
2448
2449void ASTStmtReader::VisitOMPCanonicalLoop(OMPCanonicalLoop *S) {
2450 VisitStmt(S);
2451 for (Stmt *&SubStmt : S->SubStmts)
2452 SubStmt = Record.readSubStmt();
2453}
2454
2455void ASTStmtReader::VisitOMPExecutableDirective(OMPExecutableDirective *E) {
2456 Record.readOMPChildren(E->Data);
2457 E->setLocStart(readSourceLocation());
2458 E->setLocEnd(readSourceLocation());
2459}
2460
2461void ASTStmtReader::VisitOMPLoopBasedDirective(OMPLoopBasedDirective *D) {
2462 VisitStmt(D);
2463 // Field CollapsedNum was read in ReadStmtFromStream.
2464 Record.skipInts(1);
2465 VisitOMPExecutableDirective(D);
2466}
2467
2468void ASTStmtReader::VisitOMPLoopDirective(OMPLoopDirective *D) {
2469 VisitOMPLoopBasedDirective(D);
2470}
2471
2472void ASTStmtReader::VisitOMPMetaDirective(OMPMetaDirective *D) {
2473 VisitStmt(D);
2474 // The NumClauses field was read in ReadStmtFromStream.
2475 Record.skipInts(1);
2476 VisitOMPExecutableDirective(D);
2477}
2478
2479void ASTStmtReader::VisitOMPParallelDirective(OMPParallelDirective *D) {
2480 VisitStmt(D);
2481 VisitOMPExecutableDirective(D);
2482 D->setHasCancel(Record.readBool());
2483}
2484
2485void ASTStmtReader::VisitOMPSimdDirective(OMPSimdDirective *D) {
2486 VisitOMPLoopDirective(D);
2487}
2488
2489void ASTStmtReader::VisitOMPCanonicalLoopNestTransformationDirective(
2490 OMPCanonicalLoopNestTransformationDirective *D) {
2491 VisitOMPLoopBasedDirective(D);
2492 D->setNumGeneratedTopLevelLoops(Record.readUInt32());
2493}
2494
2495void ASTStmtReader::VisitOMPTileDirective(OMPTileDirective *D) {
2496 VisitOMPCanonicalLoopNestTransformationDirective(D);
2497}
2498
2499void ASTStmtReader::VisitOMPStripeDirective(OMPStripeDirective *D) {
2500 VisitOMPCanonicalLoopNestTransformationDirective(D);
2501}
2502
2503void ASTStmtReader::VisitOMPUnrollDirective(OMPUnrollDirective *D) {
2504 VisitOMPCanonicalLoopNestTransformationDirective(D);
2505}
2506
2507void ASTStmtReader::VisitOMPReverseDirective(OMPReverseDirective *D) {
2508 VisitOMPCanonicalLoopNestTransformationDirective(D);
2509}
2510
2511void ASTStmtReader::VisitOMPCanonicalLoopSequenceTransformationDirective(
2512 OMPCanonicalLoopSequenceTransformationDirective *D) {
2513 VisitStmt(D);
2514 VisitOMPExecutableDirective(D);
2515 D->setNumGeneratedTopLevelLoops(Record.readUInt32());
2516}
2517
2518void ASTStmtReader::VisitOMPInterchangeDirective(OMPInterchangeDirective *D) {
2519 VisitOMPCanonicalLoopNestTransformationDirective(D);
2520}
2521
2522void ASTStmtReader::VisitOMPFuseDirective(OMPFuseDirective *D) {
2523 VisitOMPCanonicalLoopSequenceTransformationDirective(D);
2524}
2525
2526void ASTStmtReader::VisitOMPForDirective(OMPForDirective *D) {
2527 VisitOMPLoopDirective(D);
2528 D->setHasCancel(Record.readBool());
2529}
2530
2531void ASTStmtReader::VisitOMPForSimdDirective(OMPForSimdDirective *D) {
2532 VisitOMPLoopDirective(D);
2533}
2534
2535void ASTStmtReader::VisitOMPSectionsDirective(OMPSectionsDirective *D) {
2536 VisitStmt(D);
2537 VisitOMPExecutableDirective(D);
2538 D->setHasCancel(Record.readBool());
2539}
2540
2541void ASTStmtReader::VisitOMPSectionDirective(OMPSectionDirective *D) {
2542 VisitStmt(D);
2543 VisitOMPExecutableDirective(D);
2544 D->setHasCancel(Record.readBool());
2545}
2546
2547void ASTStmtReader::VisitOMPScopeDirective(OMPScopeDirective *D) {
2548 VisitStmt(D);
2549 VisitOMPExecutableDirective(D);
2550}
2551
2552void ASTStmtReader::VisitOMPSingleDirective(OMPSingleDirective *D) {
2553 VisitStmt(D);
2554 VisitOMPExecutableDirective(D);
2555}
2556
2557void ASTStmtReader::VisitOMPMasterDirective(OMPMasterDirective *D) {
2558 VisitStmt(D);
2559 VisitOMPExecutableDirective(D);
2560}
2561
2562void ASTStmtReader::VisitOMPCriticalDirective(OMPCriticalDirective *D) {
2563 VisitStmt(D);
2564 VisitOMPExecutableDirective(D);
2565 D->DirName = Record.readDeclarationNameInfo();
2566}
2567
2568void ASTStmtReader::VisitOMPParallelForDirective(OMPParallelForDirective *D) {
2569 VisitOMPLoopDirective(D);
2570 D->setHasCancel(Record.readBool());
2571}
2572
2573void ASTStmtReader::VisitOMPParallelForSimdDirective(
2574 OMPParallelForSimdDirective *D) {
2575 VisitOMPLoopDirective(D);
2576}
2577
2578void ASTStmtReader::VisitOMPParallelMasterDirective(
2579 OMPParallelMasterDirective *D) {
2580 VisitStmt(D);
2581 VisitOMPExecutableDirective(D);
2582}
2583
2584void ASTStmtReader::VisitOMPParallelMaskedDirective(
2585 OMPParallelMaskedDirective *D) {
2586 VisitStmt(D);
2587 VisitOMPExecutableDirective(D);
2588}
2589
2590void ASTStmtReader::VisitOMPParallelSectionsDirective(
2591 OMPParallelSectionsDirective *D) {
2592 VisitStmt(D);
2593 VisitOMPExecutableDirective(D);
2594 D->setHasCancel(Record.readBool());
2595}
2596
2597void ASTStmtReader::VisitOMPTaskDirective(OMPTaskDirective *D) {
2598 VisitStmt(D);
2599 VisitOMPExecutableDirective(D);
2600 D->setHasCancel(Record.readBool());
2601}
2602
2603void ASTStmtReader::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) {
2604 VisitStmt(D);
2605 VisitOMPExecutableDirective(D);
2606}
2607
2608void ASTStmtReader::VisitOMPBarrierDirective(OMPBarrierDirective *D) {
2609 VisitStmt(D);
2610 VisitOMPExecutableDirective(D);
2611}
2612
2613void ASTStmtReader::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) {
2614 VisitStmt(D);
2615 // The NumClauses field was read in ReadStmtFromStream.
2616 Record.skipInts(1);
2617 VisitOMPExecutableDirective(D);
2618}
2619
2620void ASTStmtReader::VisitOMPAssumeDirective(OMPAssumeDirective *D) {
2621 VisitStmt(D);
2622 VisitOMPExecutableDirective(D);
2623}
2624
2625void ASTStmtReader::VisitOMPErrorDirective(OMPErrorDirective *D) {
2626 VisitStmt(D);
2627 // The NumClauses field was read in ReadStmtFromStream.
2628 Record.skipInts(1);
2629 VisitOMPExecutableDirective(D);
2630}
2631
2632void ASTStmtReader::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) {
2633 VisitStmt(D);
2634 VisitOMPExecutableDirective(D);
2635}
2636
2637void ASTStmtReader::VisitOMPFlushDirective(OMPFlushDirective *D) {
2638 VisitStmt(D);
2639 VisitOMPExecutableDirective(D);
2640}
2641
2642void ASTStmtReader::VisitOMPDepobjDirective(OMPDepobjDirective *D) {
2643 VisitStmt(D);
2644 VisitOMPExecutableDirective(D);
2645}
2646
2647void ASTStmtReader::VisitOMPScanDirective(OMPScanDirective *D) {
2648 VisitStmt(D);
2649 VisitOMPExecutableDirective(D);
2650}
2651
2652void ASTStmtReader::VisitOMPOrderedDirective(OMPOrderedDirective *D) {
2653 VisitStmt(D);
2654 VisitOMPExecutableDirective(D);
2655}
2656
2657void ASTStmtReader::VisitOMPAtomicDirective(OMPAtomicDirective *D) {
2658 VisitStmt(D);
2659 VisitOMPExecutableDirective(D);
2660 D->Flags.IsXLHSInRHSPart = Record.readBool() ? 1 : 0;
2661 D->Flags.IsPostfixUpdate = Record.readBool() ? 1 : 0;
2662 D->Flags.IsFailOnly = Record.readBool() ? 1 : 0;
2663}
2664
2665void ASTStmtReader::VisitOMPTargetDirective(OMPTargetDirective *D) {
2666 VisitStmt(D);
2667 VisitOMPExecutableDirective(D);
2668}
2669
2670void ASTStmtReader::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) {
2671 VisitStmt(D);
2672 VisitOMPExecutableDirective(D);
2673}
2674
2675void ASTStmtReader::VisitOMPTargetEnterDataDirective(
2676 OMPTargetEnterDataDirective *D) {
2677 VisitStmt(D);
2678 VisitOMPExecutableDirective(D);
2679}
2680
2681void ASTStmtReader::VisitOMPTargetExitDataDirective(
2682 OMPTargetExitDataDirective *D) {
2683 VisitStmt(D);
2684 VisitOMPExecutableDirective(D);
2685}
2686
2687void ASTStmtReader::VisitOMPTargetParallelDirective(
2688 OMPTargetParallelDirective *D) {
2689 VisitStmt(D);
2690 VisitOMPExecutableDirective(D);
2691 D->setHasCancel(Record.readBool());
2692}
2693
2694void ASTStmtReader::VisitOMPTargetParallelForDirective(
2695 OMPTargetParallelForDirective *D) {
2696 VisitOMPLoopDirective(D);
2697 D->setHasCancel(Record.readBool());
2698}
2699
2700void ASTStmtReader::VisitOMPTeamsDirective(OMPTeamsDirective *D) {
2701 VisitStmt(D);
2702 VisitOMPExecutableDirective(D);
2703}
2704
2705void ASTStmtReader::VisitOMPCancellationPointDirective(
2706 OMPCancellationPointDirective *D) {
2707 VisitStmt(D);
2708 VisitOMPExecutableDirective(D);
2709 D->setCancelRegion(Record.readEnum<OpenMPDirectiveKind>());
2710}
2711
2712void ASTStmtReader::VisitOMPCancelDirective(OMPCancelDirective *D) {
2713 VisitStmt(D);
2714 VisitOMPExecutableDirective(D);
2715 D->setCancelRegion(Record.readEnum<OpenMPDirectiveKind>());
2716}
2717
2718void ASTStmtReader::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) {
2719 VisitOMPLoopDirective(D);
2720 D->setHasCancel(Record.readBool());
2721}
2722
2723void ASTStmtReader::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) {
2724 VisitOMPLoopDirective(D);
2725}
2726
2727void ASTStmtReader::VisitOMPMasterTaskLoopDirective(
2728 OMPMasterTaskLoopDirective *D) {
2729 VisitOMPLoopDirective(D);
2730 D->setHasCancel(Record.readBool());
2731}
2732
2733void ASTStmtReader::VisitOMPMaskedTaskLoopDirective(
2734 OMPMaskedTaskLoopDirective *D) {
2735 VisitOMPLoopDirective(D);
2736 D->setHasCancel(Record.readBool());
2737}
2738
2739void ASTStmtReader::VisitOMPMasterTaskLoopSimdDirective(
2740 OMPMasterTaskLoopSimdDirective *D) {
2741 VisitOMPLoopDirective(D);
2742}
2743
2744void ASTStmtReader::VisitOMPMaskedTaskLoopSimdDirective(
2745 OMPMaskedTaskLoopSimdDirective *D) {
2746 VisitOMPLoopDirective(D);
2747}
2748
2749void ASTStmtReader::VisitOMPParallelMasterTaskLoopDirective(
2750 OMPParallelMasterTaskLoopDirective *D) {
2751 VisitOMPLoopDirective(D);
2752 D->setHasCancel(Record.readBool());
2753}
2754
2755void ASTStmtReader::VisitOMPParallelMaskedTaskLoopDirective(
2756 OMPParallelMaskedTaskLoopDirective *D) {
2757 VisitOMPLoopDirective(D);
2758 D->setHasCancel(Record.readBool());
2759}
2760
2761void ASTStmtReader::VisitOMPParallelMasterTaskLoopSimdDirective(
2762 OMPParallelMasterTaskLoopSimdDirective *D) {
2763 VisitOMPLoopDirective(D);
2764}
2765
2766void ASTStmtReader::VisitOMPParallelMaskedTaskLoopSimdDirective(
2767 OMPParallelMaskedTaskLoopSimdDirective *D) {
2768 VisitOMPLoopDirective(D);
2769}
2770
2771void ASTStmtReader::VisitOMPDistributeDirective(OMPDistributeDirective *D) {
2772 VisitOMPLoopDirective(D);
2773}
2774
2775void ASTStmtReader::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) {
2776 VisitStmt(D);
2777 VisitOMPExecutableDirective(D);
2778}
2779
2780void ASTStmtReader::VisitOMPDistributeParallelForDirective(
2781 OMPDistributeParallelForDirective *D) {
2782 VisitOMPLoopDirective(D);
2783 D->setHasCancel(Record.readBool());
2784}
2785
2786void ASTStmtReader::VisitOMPDistributeParallelForSimdDirective(
2787 OMPDistributeParallelForSimdDirective *D) {
2788 VisitOMPLoopDirective(D);
2789}
2790
2791void ASTStmtReader::VisitOMPDistributeSimdDirective(
2792 OMPDistributeSimdDirective *D) {
2793 VisitOMPLoopDirective(D);
2794}
2795
2796void ASTStmtReader::VisitOMPTargetParallelForSimdDirective(
2797 OMPTargetParallelForSimdDirective *D) {
2798 VisitOMPLoopDirective(D);
2799}
2800
2801void ASTStmtReader::VisitOMPTargetSimdDirective(OMPTargetSimdDirective *D) {
2802 VisitOMPLoopDirective(D);
2803}
2804
2805void ASTStmtReader::VisitOMPTeamsDistributeDirective(
2806 OMPTeamsDistributeDirective *D) {
2807 VisitOMPLoopDirective(D);
2808}
2809
2810void ASTStmtReader::VisitOMPTeamsDistributeSimdDirective(
2811 OMPTeamsDistributeSimdDirective *D) {
2812 VisitOMPLoopDirective(D);
2813}
2814
2815void ASTStmtReader::VisitOMPTeamsDistributeParallelForSimdDirective(
2816 OMPTeamsDistributeParallelForSimdDirective *D) {
2817 VisitOMPLoopDirective(D);
2818}
2819
2820void ASTStmtReader::VisitOMPTeamsDistributeParallelForDirective(
2821 OMPTeamsDistributeParallelForDirective *D) {
2822 VisitOMPLoopDirective(D);
2823 D->setHasCancel(Record.readBool());
2824}
2825
2826void ASTStmtReader::VisitOMPTargetTeamsDirective(OMPTargetTeamsDirective *D) {
2827 VisitStmt(D);
2828 VisitOMPExecutableDirective(D);
2829}
2830
2831void ASTStmtReader::VisitOMPTargetTeamsDistributeDirective(
2832 OMPTargetTeamsDistributeDirective *D) {
2833 VisitOMPLoopDirective(D);
2834}
2835
2836void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForDirective(
2837 OMPTargetTeamsDistributeParallelForDirective *D) {
2838 VisitOMPLoopDirective(D);
2839 D->setHasCancel(Record.readBool());
2840}
2841
2842void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
2843 OMPTargetTeamsDistributeParallelForSimdDirective *D) {
2844 VisitOMPLoopDirective(D);
2845}
2846
2847void ASTStmtReader::VisitOMPTargetTeamsDistributeSimdDirective(
2848 OMPTargetTeamsDistributeSimdDirective *D) {
2849 VisitOMPLoopDirective(D);
2850}
2851
2852void ASTStmtReader::VisitOMPInteropDirective(OMPInteropDirective *D) {
2853 VisitStmt(D);
2854 VisitOMPExecutableDirective(D);
2855}
2856
2857void ASTStmtReader::VisitOMPDispatchDirective(OMPDispatchDirective *D) {
2858 VisitStmt(D);
2859 VisitOMPExecutableDirective(D);
2860 D->setTargetCallLoc(Record.readSourceLocation());
2861}
2862
2863void ASTStmtReader::VisitOMPMaskedDirective(OMPMaskedDirective *D) {
2864 VisitStmt(D);
2865 VisitOMPExecutableDirective(D);
2866}
2867
2868void ASTStmtReader::VisitOMPGenericLoopDirective(OMPGenericLoopDirective *D) {
2869 VisitOMPLoopDirective(D);
2870}
2871
2872void ASTStmtReader::VisitOMPTeamsGenericLoopDirective(
2873 OMPTeamsGenericLoopDirective *D) {
2874 VisitOMPLoopDirective(D);
2875}
2876
2877void ASTStmtReader::VisitOMPTargetTeamsGenericLoopDirective(
2878 OMPTargetTeamsGenericLoopDirective *D) {
2879 VisitOMPLoopDirective(D);
2880 D->setCanBeParallelFor(Record.readBool());
2881}
2882
2883void ASTStmtReader::VisitOMPParallelGenericLoopDirective(
2884 OMPParallelGenericLoopDirective *D) {
2885 VisitOMPLoopDirective(D);
2886}
2887
2888void ASTStmtReader::VisitOMPTargetParallelGenericLoopDirective(
2889 OMPTargetParallelGenericLoopDirective *D) {
2890 VisitOMPLoopDirective(D);
2891}
2892
2893//===----------------------------------------------------------------------===//
2894// OpenACC Constructs/Directives.
2895//===----------------------------------------------------------------------===//
2896void ASTStmtReader::VisitOpenACCConstructStmt(OpenACCConstructStmt *S) {
2897 (void)Record.readInt();
2898 S->Kind = Record.readEnum<OpenACCDirectiveKind>();
2899 S->Range = Record.readSourceRange();
2900 S->DirectiveLoc = Record.readSourceLocation();
2901 Record.readOpenACCClauseList(S->Clauses);
2902}
2903
2904void ASTStmtReader::VisitOpenACCAssociatedStmtConstruct(
2906 VisitOpenACCConstructStmt(S);
2907 S->setAssociatedStmt(Record.readSubStmt());
2908}
2909
2910void ASTStmtReader::VisitOpenACCComputeConstruct(OpenACCComputeConstruct *S) {
2911 VisitStmt(S);
2912 VisitOpenACCAssociatedStmtConstruct(S);
2913}
2914
2915void ASTStmtReader::VisitOpenACCLoopConstruct(OpenACCLoopConstruct *S) {
2916 VisitStmt(S);
2917 VisitOpenACCAssociatedStmtConstruct(S);
2918 S->ParentComputeConstructKind = Record.readEnum<OpenACCDirectiveKind>();
2919}
2920
2921void ASTStmtReader::VisitOpenACCCombinedConstruct(OpenACCCombinedConstruct *S) {
2922 VisitStmt(S);
2923 VisitOpenACCAssociatedStmtConstruct(S);
2924}
2925
2926void ASTStmtReader::VisitOpenACCDataConstruct(OpenACCDataConstruct *S) {
2927 VisitStmt(S);
2928 VisitOpenACCAssociatedStmtConstruct(S);
2929}
2930
2931void ASTStmtReader::VisitOpenACCEnterDataConstruct(
2932 OpenACCEnterDataConstruct *S) {
2933 VisitStmt(S);
2934 VisitOpenACCConstructStmt(S);
2935}
2936
2937void ASTStmtReader::VisitOpenACCExitDataConstruct(OpenACCExitDataConstruct *S) {
2938 VisitStmt(S);
2939 VisitOpenACCConstructStmt(S);
2940}
2941
2942void ASTStmtReader::VisitOpenACCInitConstruct(OpenACCInitConstruct *S) {
2943 VisitStmt(S);
2944 VisitOpenACCConstructStmt(S);
2945}
2946
2947void ASTStmtReader::VisitOpenACCShutdownConstruct(OpenACCShutdownConstruct *S) {
2948 VisitStmt(S);
2949 VisitOpenACCConstructStmt(S);
2950}
2951
2952void ASTStmtReader::VisitOpenACCSetConstruct(OpenACCSetConstruct *S) {
2953 VisitStmt(S);
2954 VisitOpenACCConstructStmt(S);
2955}
2956
2957void ASTStmtReader::VisitOpenACCUpdateConstruct(OpenACCUpdateConstruct *S) {
2958 VisitStmt(S);
2959 VisitOpenACCConstructStmt(S);
2960}
2961
2962void ASTStmtReader::VisitOpenACCHostDataConstruct(OpenACCHostDataConstruct *S) {
2963 VisitStmt(S);
2964 VisitOpenACCAssociatedStmtConstruct(S);
2965}
2966
2967void ASTStmtReader::VisitOpenACCWaitConstruct(OpenACCWaitConstruct *S) {
2968 VisitStmt(S);
2969 // Consume the count of Expressions.
2970 (void)Record.readInt();
2971 VisitOpenACCConstructStmt(S);
2972 S->LParenLoc = Record.readSourceLocation();
2973 S->RParenLoc = Record.readSourceLocation();
2974 S->QueuesLoc = Record.readSourceLocation();
2975
2976 for (unsigned I = 0; I < S->NumExprs; ++I) {
2977 S->getExprPtr()[I] = cast_if_present<Expr>(Record.readSubStmt());
2978 assert((I == 0 || S->getExprPtr()[I] != nullptr) &&
2979 "Only first expression should be null");
2980 }
2981}
2982
2983void ASTStmtReader::VisitOpenACCCacheConstruct(OpenACCCacheConstruct *S) {
2984 VisitStmt(S);
2985 (void)Record.readInt();
2986 VisitOpenACCConstructStmt(S);
2987 S->ParensLoc = Record.readSourceRange();
2988 S->ReadOnlyLoc = Record.readSourceLocation();
2989 for (unsigned I = 0; I < S->NumVars; ++I)
2990 S->getVarList()[I] = cast<Expr>(Record.readSubStmt());
2991}
2992
2993void ASTStmtReader::VisitOpenACCAtomicConstruct(OpenACCAtomicConstruct *S) {
2994 VisitStmt(S);
2995 VisitOpenACCConstructStmt(S);
2996 S->AtomicKind = Record.readEnum<OpenACCAtomicKind>();
2997 S->setAssociatedStmt(Record.readSubStmt());
2998}
2999
3000//===----------------------------------------------------------------------===//
3001// HLSL Constructs/Directives.
3002//===----------------------------------------------------------------------===//
3003
3004void ASTStmtReader::VisitHLSLOutArgExpr(HLSLOutArgExpr *S) {
3005 VisitExpr(S);
3006 S->SubExprs[HLSLOutArgExpr::BaseLValue] = Record.readSubExpr();
3007 S->SubExprs[HLSLOutArgExpr::CastedTemporary] = Record.readSubExpr();
3008 S->SubExprs[HLSLOutArgExpr::WritebackCast] = Record.readSubExpr();
3009 S->IsInOut = Record.readBool();
3010}
3011
3012//===----------------------------------------------------------------------===//
3013// ASTReader Implementation
3014//===----------------------------------------------------------------------===//
3015
3017 switch (ReadingKind) {
3018 case Read_None:
3019 llvm_unreachable("should not call this when not reading anything");
3020 case Read_Decl:
3021 case Read_Type:
3022 return ReadStmtFromStream(F);
3023 case Read_Stmt:
3024 return ReadSubStmt();
3025 }
3026
3027 llvm_unreachable("ReadingKind not set ?");
3028}
3029
3031 return cast_or_null<Expr>(ReadStmt(F));
3032}
3033
3035 return cast_or_null<Expr>(ReadSubStmt());
3036}
3037
3038// Within the bitstream, expressions are stored in Reverse Polish
3039// Notation, with each of the subexpressions preceding the
3040// expression they are stored in. Subexpressions are stored from last to first.
3041// To evaluate expressions, we continue reading expressions and placing them on
3042// the stack, with expressions having operands removing those operands from the
3043// stack. Evaluation terminates when we see a STMT_STOP record, and
3044// the single remaining expression on the stack is our result.
3045Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) {
3046 ReadingKindTracker ReadingKind(Read_Stmt, *this);
3047 llvm::BitstreamCursor &Cursor = F.DeclsCursor;
3048
3049 // Map of offset to previously deserialized stmt. The offset points
3050 // just after the stmt record.
3051 llvm::DenseMap<uint64_t, Stmt *> StmtEntries;
3052
3053#ifndef NDEBUG
3054 unsigned PrevNumStmts = StmtStack.size();
3055#endif
3056
3057 ASTRecordReader Record(*this, F);
3058 ASTStmtReader Reader(Record, Cursor);
3060
3061 while (true) {
3063 Cursor.advanceSkippingSubblocks();
3064 if (!MaybeEntry) {
3065 Error(toString(MaybeEntry.takeError()));
3066 return nullptr;
3067 }
3068 llvm::BitstreamEntry Entry = MaybeEntry.get();
3069
3070 switch (Entry.Kind) {
3071 case llvm::BitstreamEntry::SubBlock: // Handled for us already.
3072 case llvm::BitstreamEntry::Error:
3073 Error("malformed block record in AST file");
3074 return nullptr;
3075 case llvm::BitstreamEntry::EndBlock:
3076 goto Done;
3077 case llvm::BitstreamEntry::Record:
3078 // The interesting case.
3079 break;
3080 }
3081
3082 ASTContext &Context = getContext();
3083 Stmt *S = nullptr;
3084 bool Finished = false;
3085 bool IsStmtReference = false;
3086 Expected<unsigned> MaybeStmtCode = Record.readRecord(Cursor, Entry.ID);
3087 if (!MaybeStmtCode) {
3088 Error(toString(MaybeStmtCode.takeError()));
3089 return nullptr;
3090 }
3091 switch ((StmtCode)MaybeStmtCode.get()) {
3092 case STMT_STOP:
3093 Finished = true;
3094 break;
3095
3096 case STMT_REF_PTR:
3097 IsStmtReference = true;
3098 assert(StmtEntries.contains(Record[0]) &&
3099 "No stmt was recorded for this offset reference!");
3100 S = StmtEntries[Record.readInt()];
3101 break;
3102
3103 case STMT_NULL_PTR:
3104 S = nullptr;
3105 break;
3106
3107 case STMT_NULL:
3108 S = new (Context) NullStmt(Empty);
3109 break;
3110
3111 case STMT_COMPOUND: {
3112 unsigned NumStmts = Record[ASTStmtReader::NumStmtFields];
3113 bool HasFPFeatures = Record[ASTStmtReader::NumStmtFields + 1];
3114 S = CompoundStmt::CreateEmpty(Context, NumStmts, HasFPFeatures);
3115 break;
3116 }
3117
3118 case STMT_CASE:
3120 Context,
3121 /*CaseStmtIsGNURange*/ Record[ASTStmtReader::NumStmtFields + 3]);
3122 break;
3123
3124 case STMT_DEFAULT:
3125 S = new (Context) DefaultStmt(Empty);
3126 break;
3127
3128 case STMT_LABEL:
3129 S = new (Context) LabelStmt(Empty);
3130 break;
3131
3132 case STMT_ATTRIBUTED:
3134 Context,
3136 break;
3137
3138 case STMT_IF: {
3139 BitsUnpacker IfStmtBits(Record[ASTStmtReader::NumStmtFields]);
3140 bool HasElse = IfStmtBits.getNextBit();
3141 bool HasVar = IfStmtBits.getNextBit();
3142 bool HasInit = IfStmtBits.getNextBit();
3143 S = IfStmt::CreateEmpty(Context, HasElse, HasVar, HasInit);
3144 break;
3145 }
3146
3147 case STMT_SWITCH:
3149 Context,
3151 /* HasVar=*/Record[ASTStmtReader::NumStmtFields + 1]);
3152 break;
3153
3154 case STMT_WHILE:
3156 Context,
3158 break;
3159
3160 case STMT_DO:
3161 S = new (Context) DoStmt(Empty);
3162 break;
3163
3164 case STMT_FOR:
3165 S = new (Context) ForStmt(Empty);
3166 break;
3167
3168 case STMT_GOTO:
3169 S = new (Context) GotoStmt(Empty);
3170 break;
3171
3172 case STMT_INDIRECT_GOTO:
3173 S = new (Context) IndirectGotoStmt(Empty);
3174 break;
3175
3176 case STMT_CONTINUE:
3177 S = new (Context) ContinueStmt(Empty);
3178 break;
3179
3180 case STMT_BREAK:
3181 S = new (Context) BreakStmt(Empty);
3182 break;
3183
3184 case STMT_DEFER:
3185 S = DeferStmt::CreateEmpty(Context, Empty);
3186 break;
3187
3188 case STMT_RETURN:
3190 Context, /* HasNRVOCandidate=*/Record[ASTStmtReader::NumStmtFields]);
3191 break;
3192
3193 case STMT_DECL:
3194 S = new (Context) DeclStmt(Empty);
3195 break;
3196
3197 case STMT_GCCASM:
3198 S = new (Context) GCCAsmStmt(Empty);
3199 break;
3200
3201 case STMT_MSASM:
3202 S = new (Context) MSAsmStmt(Empty);
3203 break;
3204
3205 case STMT_CAPTURED:
3208 break;
3209
3211 S = new (Context) SYCLKernelCallStmt(Empty);
3212 break;
3213
3214 case EXPR_CONSTANT:
3216 Context, static_cast<ConstantResultStorageKind>(
3217 /*StorageKind=*/Record[ASTStmtReader::NumExprFields]));
3218 break;
3219
3222 break;
3223
3226 break;
3227
3230 break;
3231
3232 case EXPR_PREDEFINED:
3234 Context,
3235 /*HasFunctionName*/ Record[ASTStmtReader::NumExprFields]);
3236 break;
3237
3238 case EXPR_DECL_REF: {
3239 BitsUnpacker DeclRefExprBits(Record[ASTStmtReader::NumExprFields]);
3240 DeclRefExprBits.advance(5);
3241 bool HasFoundDecl = DeclRefExprBits.getNextBit();
3242 bool HasQualifier = DeclRefExprBits.getNextBit();
3243 bool HasTemplateKWAndArgsInfo = DeclRefExprBits.getNextBit();
3244 unsigned NumTemplateArgs = HasTemplateKWAndArgsInfo
3246 : 0;
3247 S = DeclRefExpr::CreateEmpty(Context, HasQualifier, HasFoundDecl,
3248 HasTemplateKWAndArgsInfo, NumTemplateArgs);
3249 break;
3250 }
3251
3253 S = IntegerLiteral::Create(Context, Empty);
3254 break;
3255
3257 S = FixedPointLiteral::Create(Context, Empty);
3258 break;
3259
3261 S = FloatingLiteral::Create(Context, Empty);
3262 break;
3263
3265 S = new (Context) ImaginaryLiteral(Empty);
3266 break;
3267
3270 Context,
3271 /* NumConcatenated=*/Record[ASTStmtReader::NumExprFields],
3272 /* Length=*/Record[ASTStmtReader::NumExprFields + 1],
3273 /* CharByteWidth=*/Record[ASTStmtReader::NumExprFields + 2]);
3274 break;
3275
3277 S = new (Context) CharacterLiteral(Empty);
3278 break;
3279
3280 case EXPR_PAREN:
3281 S = new (Context) ParenExpr(Empty);
3282 break;
3283
3284 case EXPR_PAREN_LIST:
3286 Context,
3287 /* NumExprs=*/Record[ASTStmtReader::NumExprFields]);
3288 break;
3289
3290 case EXPR_UNARY_OPERATOR: {
3291 BitsUnpacker UnaryOperatorBits(Record[ASTStmtReader::NumStmtFields]);
3292 UnaryOperatorBits.advance(ASTStmtReader::NumExprBits);
3293 bool HasFPFeatures = UnaryOperatorBits.getNextBit();
3294 S = UnaryOperator::CreateEmpty(Context, HasFPFeatures);
3295 break;
3296 }
3297
3298 case EXPR_OFFSETOF:
3299 S = OffsetOfExpr::CreateEmpty(Context,
3302 break;
3303
3305 S = new (Context) UnaryExprOrTypeTraitExpr(Empty);
3306 break;
3307
3309 S = new (Context) ArraySubscriptExpr(Empty);
3310 break;
3311
3313 S = new (Context) MatrixSubscriptExpr(Empty);
3314 break;
3315
3316 case EXPR_ARRAY_SECTION:
3317 S = new (Context) ArraySectionExpr(Empty);
3318 break;
3319
3323 break;
3324
3325 case EXPR_OMP_ITERATOR:
3326 S = OMPIteratorExpr::CreateEmpty(Context,
3328 break;
3329
3330 case EXPR_CALL: {
3331 auto NumArgs = Record[ASTStmtReader::NumExprFields];
3332 BitsUnpacker CallExprBits(Record[ASTStmtReader::NumExprFields + 1]);
3333 CallExprBits.advance(1);
3334 auto HasFPFeatures = CallExprBits.getNextBit();
3335 S = CallExpr::CreateEmpty(Context, NumArgs, HasFPFeatures, Empty);
3336 break;
3337 }
3338
3339 case EXPR_RECOVERY:
3341 Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields]);
3342 break;
3343
3344 case EXPR_MEMBER: {
3345 BitsUnpacker ExprMemberBits(Record[ASTStmtReader::NumExprFields]);
3346 bool HasQualifier = ExprMemberBits.getNextBit();
3347 bool HasFoundDecl = ExprMemberBits.getNextBit();
3348 bool HasTemplateInfo = ExprMemberBits.getNextBit();
3349 unsigned NumTemplateArgs = Record[ASTStmtReader::NumExprFields + 1];
3350 S = MemberExpr::CreateEmpty(Context, HasQualifier, HasFoundDecl,
3351 HasTemplateInfo, NumTemplateArgs);
3352 break;
3353 }
3354
3355 case EXPR_BINARY_OPERATOR: {
3356 BitsUnpacker BinaryOperatorBits(Record[ASTStmtReader::NumExprFields]);
3357 BinaryOperatorBits.advance(/*Size of opcode*/ 6);
3358 bool HasFPFeatures = BinaryOperatorBits.getNextBit();
3359 S = BinaryOperator::CreateEmpty(Context, HasFPFeatures);
3360 break;
3361 }
3362
3364 BitsUnpacker BinaryOperatorBits(Record[ASTStmtReader::NumExprFields]);
3365 BinaryOperatorBits.advance(/*Size of opcode*/ 6);
3366 bool HasFPFeatures = BinaryOperatorBits.getNextBit();
3367 S = CompoundAssignOperator::CreateEmpty(Context, HasFPFeatures);
3368 break;
3369 }
3370
3372 S = new (Context) ConditionalOperator(Empty);
3373 break;
3374
3376 S = new (Context) BinaryConditionalOperator(Empty);
3377 break;
3378
3379 case EXPR_IMPLICIT_CAST: {
3380 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
3381 BitsUnpacker CastExprBits(Record[ASTStmtReader::NumExprFields + 1]);
3382 CastExprBits.advance(7);
3383 bool HasFPFeatures = CastExprBits.getNextBit();
3384 S = ImplicitCastExpr::CreateEmpty(Context, PathSize, HasFPFeatures);
3385 break;
3386 }
3387
3388 case EXPR_CSTYLE_CAST: {
3389 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
3390 BitsUnpacker CastExprBits(Record[ASTStmtReader::NumExprFields + 1]);
3391 CastExprBits.advance(7);
3392 bool HasFPFeatures = CastExprBits.getNextBit();
3393 S = CStyleCastExpr::CreateEmpty(Context, PathSize, HasFPFeatures);
3394 break;
3395 }
3396
3398 S = new (Context) CompoundLiteralExpr(Empty);
3399 break;
3400
3402 S = new (Context) ExtVectorElementExpr(Empty);
3403 break;
3404
3406 S = new (Context) MatrixElementExpr(Empty);
3407 break;
3408
3409 case EXPR_INIT_LIST:
3410 S = new (Context) InitListExpr(Empty);
3411 break;
3412
3416
3417 break;
3418
3420 S = new (Context) DesignatedInitUpdateExpr(Empty);
3421 break;
3422
3424 S = new (Context) ImplicitValueInitExpr(Empty);
3425 break;
3426
3427 case EXPR_NO_INIT:
3428 S = new (Context) NoInitExpr(Empty);
3429 break;
3430
3432 S = new (Context) ArrayInitLoopExpr(Empty);
3433 break;
3434
3436 S = new (Context) ArrayInitIndexExpr(Empty);
3437 break;
3438
3439 case EXPR_VA_ARG:
3440 S = new (Context) VAArgExpr(Empty);
3441 break;
3442
3443 case EXPR_SOURCE_LOC:
3444 S = new (Context) SourceLocExpr(Empty);
3445 break;
3446
3448 S = new (Context) EmbedExpr(Empty);
3449 break;
3450
3451 case EXPR_ADDR_LABEL:
3452 S = new (Context) AddrLabelExpr(Empty);
3453 break;
3454
3455 case EXPR_STMT:
3456 S = new (Context) StmtExpr(Empty);
3457 break;
3458
3459 case EXPR_CHOOSE:
3460 S = new (Context) ChooseExpr(Empty);
3461 break;
3462
3463 case EXPR_GNU_NULL:
3464 S = new (Context) GNUNullExpr(Empty);
3465 break;
3466
3468 S = new (Context) ShuffleVectorExpr(Empty);
3469 break;
3470
3471 case EXPR_CONVERT_VECTOR: {
3472 BitsUnpacker ConvertVectorExprBits(Record[ASTStmtReader::NumStmtFields]);
3473 ConvertVectorExprBits.advance(ASTStmtReader::NumExprBits);
3474 bool HasFPFeatures = ConvertVectorExprBits.getNextBit();
3475 S = ConvertVectorExpr::CreateEmpty(Context, HasFPFeatures);
3476 break;
3477 }
3478
3479 case EXPR_BLOCK:
3480 S = new (Context) BlockExpr(Empty);
3481 break;
3482
3485 Context,
3486 /*NumAssocs=*/Record[ASTStmtReader::NumExprFields]);
3487 break;
3488
3490 S = new (Context) ObjCStringLiteral(Empty);
3491 break;
3492
3494 S = new (Context) ObjCBoxedExpr(Empty);
3495 break;
3496
3500 break;
3501
3506 break;
3507
3508 case EXPR_OBJC_ENCODE:
3509 S = new (Context) ObjCEncodeExpr(Empty);
3510 break;
3511
3513 S = new (Context) ObjCSelectorExpr(Empty);
3514 break;
3515
3517 S = new (Context) ObjCProtocolExpr(Empty);
3518 break;
3519
3521 S = new (Context) ObjCIvarRefExpr(Empty);
3522 break;
3523
3525 S = new (Context) ObjCPropertyRefExpr(Empty);
3526 break;
3527
3529 S = new (Context) ObjCSubscriptRefExpr(Empty);
3530 break;
3531
3533 llvm_unreachable("mismatching AST file");
3534
3536 S = ObjCMessageExpr::CreateEmpty(Context,
3539 break;
3540
3541 case EXPR_OBJC_ISA:
3542 S = new (Context) ObjCIsaExpr(Empty);
3543 break;
3544
3546 S = new (Context) ObjCIndirectCopyRestoreExpr(Empty);
3547 break;
3548
3550 S = new (Context) ObjCBridgedCastExpr(Empty);
3551 break;
3552
3554 S = new (Context) ObjCForCollectionStmt(Empty);
3555 break;
3556
3557 case STMT_OBJC_CATCH:
3558 S = new (Context) ObjCAtCatchStmt(Empty);
3559 break;
3560
3561 case STMT_OBJC_FINALLY:
3562 S = new (Context) ObjCAtFinallyStmt(Empty);
3563 break;
3564
3565 case STMT_OBJC_AT_TRY:
3566 S = ObjCAtTryStmt::CreateEmpty(Context,
3569 break;
3570
3572 S = new (Context) ObjCAtSynchronizedStmt(Empty);
3573 break;
3574
3575 case STMT_OBJC_AT_THROW:
3576 S = new (Context) ObjCAtThrowStmt(Empty);
3577 break;
3578
3580 S = new (Context) ObjCAutoreleasePoolStmt(Empty);
3581 break;
3582
3584 S = new (Context) ObjCBoolLiteralExpr(Empty);
3585 break;
3586
3588 S = new (Context) ObjCAvailabilityCheckExpr(Empty);
3589 break;
3590
3591 case STMT_SEH_LEAVE:
3592 S = new (Context) SEHLeaveStmt(Empty);
3593 break;
3594
3595 case STMT_SEH_EXCEPT:
3596 S = new (Context) SEHExceptStmt(Empty);
3597 break;
3598
3599 case STMT_SEH_FINALLY:
3600 S = new (Context) SEHFinallyStmt(Empty);
3601 break;
3602
3603 case STMT_SEH_TRY:
3604 S = new (Context) SEHTryStmt(Empty);
3605 break;
3606
3607 case STMT_CXX_CATCH:
3608 S = new (Context) CXXCatchStmt(Empty);
3609 break;
3610
3611 case STMT_CXX_TRY:
3612 S = CXXTryStmt::Create(Context, Empty,
3613 /*numHandlers=*/Record[ASTStmtReader::NumStmtFields]);
3614 break;
3615
3616 case STMT_CXX_FOR_RANGE:
3617 S = new (Context) CXXForRangeStmt(Empty);
3618 break;
3619
3621 S = new (Context) MSDependentExistsStmt(SourceLocation(), true,
3622 NestedNameSpecifierLoc(),
3623 DeclarationNameInfo(),
3624 nullptr);
3625 break;
3626
3628 S = OMPCanonicalLoop::createEmpty(Context);
3629 break;
3630
3634 break;
3635
3637 S =
3638 OMPParallelDirective::CreateEmpty(Context,
3640 Empty);
3641 break;
3642
3644 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3645 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3646 S = OMPSimdDirective::CreateEmpty(Context, NumClauses,
3647 CollapsedNum, Empty);
3648 break;
3649 }
3650
3652 unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
3653 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3654 S = OMPTileDirective::CreateEmpty(Context, NumClauses, NumLoops);
3655 break;
3656 }
3657
3659 unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
3660 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3661 S = OMPStripeDirective::CreateEmpty(Context, NumClauses, NumLoops);
3662 break;
3663 }
3664
3666 assert(Record[ASTStmtReader::NumStmtFields] == 1 && "Unroll directive accepts only a single loop");
3667 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3668 S = OMPUnrollDirective::CreateEmpty(Context, NumClauses);
3669 break;
3670 }
3671
3673 unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
3674 assert(Record[ASTStmtReader::NumStmtFields + 1] == 0 &&
3675 "Reverse directive has no clauses");
3676 S = OMPReverseDirective::CreateEmpty(Context, NumLoops);
3677 break;
3678 }
3679
3681 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3682 S = OMPFuseDirective::CreateEmpty(Context, NumClauses);
3683 break;
3684 }
3685
3687 unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
3688 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3689 S = OMPInterchangeDirective::CreateEmpty(Context, NumClauses, NumLoops);
3690 break;
3691 }
3692
3694 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3695 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3696 S = OMPForDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3697 Empty);
3698 break;
3699 }
3700
3702 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3703 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3704 S = OMPForSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3705 Empty);
3706 break;
3707 }
3708
3710 S = OMPSectionsDirective::CreateEmpty(
3712 break;
3713
3715 S = OMPSectionDirective::CreateEmpty(Context, Empty);
3716 break;
3717
3719 S = OMPScopeDirective::CreateEmpty(
3721 break;
3722
3724 S = OMPSingleDirective::CreateEmpty(
3726 break;
3727
3729 S = OMPMasterDirective::CreateEmpty(Context, Empty);
3730 break;
3731
3733 S = OMPCriticalDirective::CreateEmpty(
3735 break;
3736
3738 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3739 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3740 S = OMPParallelForDirective::CreateEmpty(Context, NumClauses,
3741 CollapsedNum, Empty);
3742 break;
3743 }
3744
3746 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3747 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3748 S = OMPParallelForSimdDirective::CreateEmpty(Context, NumClauses,
3749 CollapsedNum, Empty);
3750 break;
3751 }
3752
3754 S = OMPParallelMasterDirective::CreateEmpty(
3756 break;
3757
3759 S = OMPParallelMaskedDirective::CreateEmpty(
3761 break;
3762
3764 S = OMPParallelSectionsDirective::CreateEmpty(
3766 break;
3767
3769 S = OMPTaskDirective::CreateEmpty(
3771 break;
3772
3774 S = OMPTaskyieldDirective::CreateEmpty(Context, Empty);
3775 break;
3776
3778 S = OMPBarrierDirective::CreateEmpty(Context, Empty);
3779 break;
3780
3782 S = OMPTaskwaitDirective::CreateEmpty(
3784 break;
3785
3789 break;
3790
3792 S = OMPTaskgroupDirective::CreateEmpty(
3794 break;
3795
3797 S = OMPFlushDirective::CreateEmpty(
3799 break;
3800
3802 S = OMPDepobjDirective::CreateEmpty(
3804 break;
3805
3809 break;
3810
3812 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3813 bool HasAssociatedStmt = Record[ASTStmtReader::NumStmtFields + 2];
3814 S = OMPOrderedDirective::CreateEmpty(Context, NumClauses,
3815 !HasAssociatedStmt, Empty);
3816 break;
3817 }
3818
3820 S = OMPAtomicDirective::CreateEmpty(
3822 break;
3823
3827 break;
3828
3832 break;
3833
3837 break;
3838
3842 break;
3843
3847 break;
3848
3850 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3851 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3852 S = OMPTargetParallelForDirective::CreateEmpty(Context, NumClauses,
3853 CollapsedNum, Empty);
3854 break;
3855 }
3856
3860 break;
3861
3865 break;
3866
3869 break;
3870
3874 break;
3875
3877 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3878 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3879 S = OMPTaskLoopDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3880 Empty);
3881 break;
3882 }
3883
3885 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3886 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3887 S = OMPTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
3888 CollapsedNum, Empty);
3889 break;
3890 }
3891
3893 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3894 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3895 S = OMPMasterTaskLoopDirective::CreateEmpty(Context, NumClauses,
3896 CollapsedNum, Empty);
3897 break;
3898 }
3899
3901 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3902 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3903 S = OMPMaskedTaskLoopDirective::CreateEmpty(Context, NumClauses,
3904 CollapsedNum, Empty);
3905 break;
3906 }
3907
3909 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3910 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3911 S = OMPMasterTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
3912 CollapsedNum, Empty);
3913 break;
3914 }
3915
3917 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3918 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3919 S = OMPMaskedTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
3920 CollapsedNum, Empty);
3921 break;
3922 }
3923
3925 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3926 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3928 CollapsedNum, Empty);
3929 break;
3930 }
3931
3933 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3934 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3936 CollapsedNum, Empty);
3937 break;
3938 }
3939
3941 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3942 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3944 Context, NumClauses, CollapsedNum, Empty);
3945 break;
3946 }
3947
3949 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3950 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3952 Context, NumClauses, CollapsedNum, Empty);
3953 break;
3954 }
3955
3957 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3958 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3959 S = OMPDistributeDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3960 Empty);
3961 break;
3962 }
3963
3965 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3966 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3967 S = OMPDistributeParallelForDirective::CreateEmpty(Context, NumClauses,
3968 CollapsedNum, Empty);
3969 break;
3970 }
3971
3973 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3974 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3976 CollapsedNum,
3977 Empty);
3978 break;
3979 }
3980
3982 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3983 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3984 S = OMPDistributeSimdDirective::CreateEmpty(Context, NumClauses,
3985 CollapsedNum, Empty);
3986 break;
3987 }
3988
3990 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3991 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3992 S = OMPTargetParallelForSimdDirective::CreateEmpty(Context, NumClauses,
3993 CollapsedNum, Empty);
3994 break;
3995 }
3996
3998 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3999 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4000 S = OMPTargetSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
4001 Empty);
4002 break;
4003 }
4004
4006 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4007 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4008 S = OMPTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
4009 CollapsedNum, Empty);
4010 break;
4011 }
4012
4014 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4015 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4016 S = OMPTeamsDistributeSimdDirective::CreateEmpty(Context, NumClauses,
4017 CollapsedNum, Empty);
4018 break;
4019 }
4020
4022 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4023 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4025 Context, NumClauses, CollapsedNum, Empty);
4026 break;
4027 }
4028
4030 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4031 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4033 Context, NumClauses, CollapsedNum, Empty);
4034 break;
4035 }
4036
4040 break;
4041
4043 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4044 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4045 S = OMPTargetTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
4046 CollapsedNum, Empty);
4047 break;
4048 }
4049
4051 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4052 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4054 Context, NumClauses, CollapsedNum, Empty);
4055 break;
4056 }
4057
4059 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4060 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4062 Context, NumClauses, CollapsedNum, Empty);
4063 break;
4064 }
4065
4067 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4068 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4070 Context, NumClauses, CollapsedNum, Empty);
4071 break;
4072 }
4073
4077 break;
4078
4082 break;
4083
4087 break;
4088
4090 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4091 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4092 S = OMPGenericLoopDirective::CreateEmpty(Context, NumClauses,
4093 CollapsedNum, Empty);
4094 break;
4095 }
4096
4098 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4099 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4100 S = OMPTeamsGenericLoopDirective::CreateEmpty(Context, NumClauses,
4101 CollapsedNum, Empty);
4102 break;
4103 }
4104
4106 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4107 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4109 CollapsedNum, Empty);
4110 break;
4111 }
4112
4114 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4115 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4116 S = OMPParallelGenericLoopDirective::CreateEmpty(Context, NumClauses,
4117 CollapsedNum, Empty);
4118 break;
4119 }
4120
4122 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4123 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4125 Context, NumClauses, CollapsedNum, Empty);
4126 break;
4127 }
4128
4130 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4131 S = OMPAssumeDirective::CreateEmpty(Context, NumClauses, Empty);
4132 break;
4133 }
4134
4136 auto NumArgs = Record[ASTStmtReader::NumExprFields];
4137 BitsUnpacker CallExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4138 CallExprBits.advance(1);
4139 auto HasFPFeatures = CallExprBits.getNextBit();
4140 S = CXXOperatorCallExpr::CreateEmpty(Context, NumArgs, HasFPFeatures,
4141 Empty);
4142 break;
4143 }
4144
4145 case EXPR_CXX_MEMBER_CALL: {
4146 auto NumArgs = Record[ASTStmtReader::NumExprFields];
4147 BitsUnpacker CallExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4148 CallExprBits.advance(1);
4149 auto HasFPFeatures = CallExprBits.getNextBit();
4150 S = CXXMemberCallExpr::CreateEmpty(Context, NumArgs, HasFPFeatures,
4151 Empty);
4152 break;
4153 }
4154
4156 S = new (Context) CXXRewrittenBinaryOperator(Empty);
4157 break;
4158
4159 case EXPR_CXX_CONSTRUCT:
4161 Context,
4162 /* NumArgs=*/Record[ASTStmtReader::NumExprFields]);
4163 break;
4164
4166 S = new (Context) CXXInheritedCtorInitExpr(Empty);
4167 break;
4168
4171 Context,
4172 /* NumArgs=*/Record[ASTStmtReader::NumExprFields]);
4173 break;
4174
4175 case EXPR_CXX_STATIC_CAST: {
4176 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
4177 BitsUnpacker CastExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4178 CastExprBits.advance(7);
4179 bool HasFPFeatures = CastExprBits.getNextBit();
4180 S = CXXStaticCastExpr::CreateEmpty(Context, PathSize, HasFPFeatures);
4181 break;
4182 }
4183
4184 case EXPR_CXX_DYNAMIC_CAST: {
4185 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
4186 S = CXXDynamicCastExpr::CreateEmpty(Context, PathSize);
4187 break;
4188 }
4189
4191 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
4192 S = CXXReinterpretCastExpr::CreateEmpty(Context, PathSize);
4193 break;
4194 }
4195
4197 S = CXXConstCastExpr::CreateEmpty(Context);
4198 break;
4199
4202 break;
4203
4205 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
4206 BitsUnpacker CastExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4207 CastExprBits.advance(7);
4208 bool HasFPFeatures = CastExprBits.getNextBit();
4209 S = CXXFunctionalCastExpr::CreateEmpty(Context, PathSize, HasFPFeatures);
4210 break;
4211 }
4212
4213 case EXPR_BUILTIN_BIT_CAST: {
4214#ifndef NDEBUG
4215 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
4216 assert(PathSize == 0 && "Wrong PathSize!");
4217#endif
4218 S = new (Context) BuiltinBitCastExpr(Empty);
4219 break;
4220 }
4221
4223 auto NumArgs = Record[ASTStmtReader::NumExprFields];
4224 BitsUnpacker CallExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4225 CallExprBits.advance(1);
4226 auto HasFPFeatures = CallExprBits.getNextBit();
4227 S = UserDefinedLiteral::CreateEmpty(Context, NumArgs, HasFPFeatures,
4228 Empty);
4229 break;
4230 }
4231
4233 S = new (Context) CXXStdInitializerListExpr(Empty);
4234 break;
4235
4237 S = new (Context) CXXBoolLiteralExpr(Empty);
4238 break;
4239
4241 S = new (Context) CXXNullPtrLiteralExpr(Empty);
4242 break;
4243
4245 S = new (Context) CXXTypeidExpr(Empty, true);
4246 break;
4247
4249 S = new (Context) CXXTypeidExpr(Empty, false);
4250 break;
4251
4253 S = new (Context) CXXUuidofExpr(Empty, true);
4254 break;
4255
4257 S = new (Context) MSPropertyRefExpr(Empty);
4258 break;
4259
4261 S = new (Context) MSPropertySubscriptExpr(Empty);
4262 break;
4263
4265 S = new (Context) CXXUuidofExpr(Empty, false);
4266 break;
4267
4268 case EXPR_CXX_THIS:
4269 S = CXXThisExpr::CreateEmpty(Context);
4270 break;
4271
4272 case EXPR_CXX_THROW:
4273 S = new (Context) CXXThrowExpr(Empty);
4274 break;
4275
4278 Context, /*HasRewrittenInit=*/Record[ASTStmtReader::NumExprFields]);
4279 break;
4280
4283 Context, /*HasRewrittenInit=*/Record[ASTStmtReader::NumExprFields]);
4284 break;
4285
4287 S = new (Context) CXXBindTemporaryExpr(Empty);
4288 break;
4289
4291 S = new (Context) CXXScalarValueInitExpr(Empty);
4292 break;
4293
4294 case EXPR_CXX_NEW:
4296 Context,
4298 /*HasInit=*/Record[ASTStmtReader::NumExprFields + 1],
4299 /*NumPlacementArgs=*/Record[ASTStmtReader::NumExprFields + 2],
4300 /*IsParenTypeId=*/Record[ASTStmtReader::NumExprFields + 3]);
4301 break;
4302
4303 case EXPR_CXX_DELETE:
4304 S = new (Context) CXXDeleteExpr(Empty);
4305 break;
4306
4308 S = new (Context) CXXPseudoDestructorExpr(Empty);
4309 break;
4310
4312 S = ExprWithCleanups::Create(Context, Empty,
4314 break;
4315
4317 unsigned NumTemplateArgs = Record[ASTStmtReader::NumExprFields];
4318 BitsUnpacker DependentScopeMemberBits(
4320 bool HasTemplateKWAndArgsInfo = DependentScopeMemberBits.getNextBit();
4321
4322 bool HasFirstQualifierFoundInScope =
4323 DependentScopeMemberBits.getNextBit();
4325 Context, HasTemplateKWAndArgsInfo, NumTemplateArgs,
4326 HasFirstQualifierFoundInScope);
4327 break;
4328 }
4329
4331 BitsUnpacker DependentScopeDeclRefBits(
4333 DependentScopeDeclRefBits.advance(ASTStmtReader::NumExprBits);
4334 bool HasTemplateKWAndArgsInfo = DependentScopeDeclRefBits.getNextBit();
4335 unsigned NumTemplateArgs =
4336 HasTemplateKWAndArgsInfo
4337 ? DependentScopeDeclRefBits.getNextBits(/*Width=*/16)
4338 : 0;
4340 Context, HasTemplateKWAndArgsInfo, NumTemplateArgs);
4341 break;
4342 }
4343
4347 break;
4348
4350 auto NumResults = Record[ASTStmtReader::NumExprFields];
4351 BitsUnpacker OverloadExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4352 auto HasTemplateKWAndArgsInfo = OverloadExprBits.getNextBit();
4353 auto NumTemplateArgs = HasTemplateKWAndArgsInfo
4355 : 0;
4357 Context, NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
4358 break;
4359 }
4360
4362 auto NumResults = Record[ASTStmtReader::NumExprFields];
4363 BitsUnpacker OverloadExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4364 auto HasTemplateKWAndArgsInfo = OverloadExprBits.getNextBit();
4365 auto NumTemplateArgs = HasTemplateKWAndArgsInfo
4367 : 0;
4369 Context, NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
4370 break;
4371 }
4372
4373 case EXPR_TYPE_TRAIT:
4377 break;
4378
4380 S = new (Context) ArrayTypeTraitExpr(Empty);
4381 break;
4382
4384 S = new (Context) ExpressionTraitExpr(Empty);
4385 break;
4386
4387 case EXPR_CXX_NOEXCEPT:
4388 S = new (Context) CXXNoexceptExpr(Empty);
4389 break;
4390
4392 S = new (Context) PackExpansionExpr(Empty);
4393 break;
4394
4395 case EXPR_SIZEOF_PACK:
4397 Context,
4398 /*NumPartialArgs=*/Record[ASTStmtReader::NumExprFields]);
4399 break;
4400
4401 case EXPR_PACK_INDEXING:
4403 Context,
4404 /*TransformedExprs=*/Record[ASTStmtReader::NumExprFields]);
4405 break;
4406
4408 S = new (Context) SubstNonTypeTemplateParmExpr(Empty);
4409 break;
4410
4412 S = new (Context) SubstNonTypeTemplateParmPackExpr(Empty);
4413 break;
4414
4418 break;
4419
4421 S = new (Context) MaterializeTemporaryExpr(Empty);
4422 break;
4423
4424 case EXPR_CXX_FOLD:
4425 S = new (Context) CXXFoldExpr(Empty);
4426 break;
4427
4430 Context, /*numExprs=*/Record[ASTStmtReader::NumExprFields], Empty);
4431 break;
4432
4433 case EXPR_OPAQUE_VALUE:
4434 S = new (Context) OpaqueValueExpr(Empty);
4435 break;
4436
4437 case EXPR_CUDA_KERNEL_CALL: {
4438 auto NumArgs = Record[ASTStmtReader::NumExprFields];
4439 BitsUnpacker CallExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4440 CallExprBits.advance(1);
4441 auto HasFPFeatures = CallExprBits.getNextBit();
4442 S = CUDAKernelCallExpr::CreateEmpty(Context, NumArgs, HasFPFeatures,
4443 Empty);
4444 break;
4445 }
4446
4447 case EXPR_ASTYPE:
4448 S = new (Context) AsTypeExpr(Empty);
4449 break;
4450
4451 case EXPR_PSEUDO_OBJECT: {
4452 unsigned numSemanticExprs = Record[ASTStmtReader::NumExprFields];
4453 S = PseudoObjectExpr::Create(Context, Empty, numSemanticExprs);
4454 break;
4455 }
4456
4457 case EXPR_ATOMIC:
4458 S = new (Context) AtomicExpr(Empty);
4459 break;
4460
4461 case EXPR_LAMBDA: {
4462 unsigned NumCaptures = Record[ASTStmtReader::NumExprFields];
4463 S = LambdaExpr::CreateDeserialized(Context, NumCaptures);
4464 break;
4465 }
4466
4467 case STMT_COROUTINE_BODY: {
4468 unsigned NumParams = Record[ASTStmtReader::NumStmtFields];
4469 S = CoroutineBodyStmt::Create(Context, Empty, NumParams);
4470 break;
4471 }
4472
4473 case STMT_CORETURN:
4474 S = new (Context) CoreturnStmt(Empty);
4475 break;
4476
4477 case EXPR_COAWAIT:
4478 S = new (Context) CoawaitExpr(Empty);
4479 break;
4480
4481 case EXPR_COYIELD:
4482 S = new (Context) CoyieldExpr(Empty);
4483 break;
4484
4486 S = new (Context) DependentCoawaitExpr(Empty);
4487 break;
4488
4490 S = new (Context) ConceptSpecializationExpr(Empty);
4491 break;
4492 }
4494 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4495 S = OpenACCComputeConstruct::CreateEmpty(Context, NumClauses);
4496 break;
4497 }
4499 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4500 S = OpenACCLoopConstruct::CreateEmpty(Context, NumClauses);
4501 break;
4502 }
4504 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4505 S = OpenACCCombinedConstruct::CreateEmpty(Context, NumClauses);
4506 break;
4507 }
4509 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4510 S = OpenACCDataConstruct::CreateEmpty(Context, NumClauses);
4511 break;
4512 }
4514 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4515 S = OpenACCEnterDataConstruct::CreateEmpty(Context, NumClauses);
4516 break;
4517 }
4519 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4520 S = OpenACCExitDataConstruct::CreateEmpty(Context, NumClauses);
4521 break;
4522 }
4524 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4525 S = OpenACCHostDataConstruct::CreateEmpty(Context, NumClauses);
4526 break;
4527 }
4529 unsigned NumExprs = Record[ASTStmtReader::NumStmtFields];
4530 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4531 S = OpenACCWaitConstruct::CreateEmpty(Context, NumExprs, NumClauses);
4532 break;
4533 }
4535 unsigned NumVars = Record[ASTStmtReader::NumStmtFields];
4536 S = OpenACCCacheConstruct::CreateEmpty(Context, NumVars);
4537 break;
4538 }
4540 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4541 S = OpenACCInitConstruct::CreateEmpty(Context, NumClauses);
4542 break;
4543 }
4545 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4546 S = OpenACCShutdownConstruct::CreateEmpty(Context, NumClauses);
4547 break;
4548 }
4550 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4551 S = OpenACCSetConstruct::CreateEmpty(Context, NumClauses);
4552 break;
4553 }
4555 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4556 S = OpenACCUpdateConstruct::CreateEmpty(Context, NumClauses);
4557 break;
4558 }
4560 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4561 S = OpenACCAtomicConstruct::CreateEmpty(Context, NumClauses);
4562 break;
4563 }
4564 case EXPR_REQUIRES: {
4565 unsigned numLocalParameters = Record[ASTStmtReader::NumExprFields];
4566 unsigned numRequirement = Record[ASTStmtReader::NumExprFields + 1];
4567 S = RequiresExpr::Create(Context, Empty, numLocalParameters,
4568 numRequirement);
4569 break;
4570 }
4571 case EXPR_HLSL_OUT_ARG:
4572 S = HLSLOutArgExpr::CreateEmpty(Context);
4573 break;
4574 case EXPR_REFLECT: {
4575 S = CXXReflectExpr::CreateEmpty(Context);
4576 break;
4577 }
4578 }
4579
4580 // We hit a STMT_STOP, so we're done with this expression.
4581 if (Finished)
4582 break;
4583
4584 ++NumStatementsRead;
4585
4586 if (S && !IsStmtReference) {
4587 Reader.Visit(S);
4588 StmtEntries[Cursor.GetCurrentBitNo()] = S;
4589 }
4590
4591 assert(Record.getIdx() == Record.size() &&
4592 "Invalid deserialization of statement");
4593 StmtStack.push_back(S);
4594 }
4595Done:
4596 assert(StmtStack.size() > PrevNumStmts && "Read too many sub-stmts!");
4597 assert(StmtStack.size() == PrevNumStmts + 1 && "Extra expressions on stack!");
4598 return StmtStack.pop_back_val();
4599}
This file provides AST data structures related to concepts.
Defines the clang::ASTContext interface.
static concepts::Requirement::SubstitutionDiagnostic * readSubstitutionDiagnostic(ASTRecordReader &Record)
static ConstraintSatisfaction readConstraintSatisfaction(ASTRecordReader &Record)
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines the C++ template declaration subclasses.
Defines the clang::Expr interface and subclasses for C++ expressions.
Defines enumerations for expression traits intrinsics.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the clang::LangOptions interface.
llvm::MachO::Record Record
Definition MachO.h:31
This file defines OpenMP AST classes for clauses.
Defines some OpenMP-specific enums and functions.
static std::string toString(const clang::SanitizerSet &Sanitizers)
Produce a string containing comma-separated names of sanitizers in Sanitizers set.
Defines the clang::SourceLocation class and associated facilities.
Defines various enumerations that describe declaration and type specifiers.
Defines the Objective-C statement AST node classes.
This file defines OpenMP AST classes for executable directives and clauses.
This file defines SYCL AST classes used to represent calls to SYCL kernels.
Defines enumerations for the type traits support.
C Language Family Type Representation.
static OMPAssumeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
static OMPCancelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPCancellationPointDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static OMPDispatchDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPErrorDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPFuseDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses)
Build an empty 'pragma omp fuse' AST node for deserialization.
static OMPGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with a place for NumClauses clauses.
static OMPInterchangeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty 'pragma omp interchange' AST node for deserialization.
static OMPInteropDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPMaskedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPMaskedTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPMaskedTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPMasterTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPMasterTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPMetaDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
static OMPParallelGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPParallelMaskedTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPParallelMaskedTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPParallelMasterTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPParallelMasterTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPReverseDirective * CreateEmpty(const ASTContext &C, unsigned NumLoops)
Build an empty 'pragma omp reverse' AST node for deserialization.
static OMPScanDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPStripeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty 'pragma omp stripe' AST node for deserialization.
static OMPTargetDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
static OMPTargetDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetEnterDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
static OMPTargetExitDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
static OMPTargetParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetParallelGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetTeamsGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetUpdateDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTeamsGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTileDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty 'pragma omp tile' AST node for deserialization.
static OMPUnrollDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses)
Build an empty 'pragma omp unroll' AST node for deserialization.
static OpenACCAtomicConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
ArrayRef< Expr * > getVarList() const
static OpenACCCacheConstruct * CreateEmpty(const ASTContext &C, unsigned NumVars)
static OpenACCCombinedConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static OpenACCDataConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static OpenACCEnterDataConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static OpenACCExitDataConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static OpenACCHostDataConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static OpenACCInitConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static OpenACCLoopConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static OpenACCSetConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static OpenACCShutdownConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static OpenACCUpdateConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static OpenACCWaitConstruct * CreateEmpty(const ASTContext &C, unsigned NumExprs, unsigned NumClauses)
void setValue(const ASTContext &C, const llvm::APInt &Val)
bool needsCleanup() const
Returns whether the object performed allocations.
Definition APValue.cpp:444
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition ASTContext.h:226
ASTContext & getContext()
Retrieve the AST context that this AST reader supplements.
Definition ASTReader.h:2624
Stmt * ReadSubStmt()
Reads a sub-statement operand during statement reading.
Definition ASTReader.h:2579
Expr * ReadSubExpr()
Reads a sub-expression operand during statement reading.
Expr * ReadExpr(ModuleFile &F)
Reads an expression.
Stmt * ReadStmt(ModuleFile &F)
Reads a statement.
serialization::ModuleFile ModuleFile
Definition ASTReader.h:473
An object for streaming information from a record.
static const unsigned NumExprFields
The number of record fields required for the Expr class itself.
static const unsigned NumStmtFields
The number of record fields required for the Stmt class itself.
static const unsigned NumExprBits
The number of bits required for the packing bits for the Expr class.
void ReadTemplateKWAndArgsInfo(ASTTemplateKWAndArgsInfo &Args, TemplateArgumentLoc *ArgsLocArray, unsigned NumTemplateArgs)
Read and initialize a ExplicitTemplateArgumentList structure.
ASTStmtReader(ASTRecordReader &Record, llvm::BitstreamCursor &Cursor)
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition Expr.h:4553
void setLabel(LabelDecl *L)
Definition Expr.h:4577
void setLabelLoc(SourceLocation L)
Definition Expr.h:4571
void setAmpAmpLoc(SourceLocation L)
Definition Expr.h:4569
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Definition Expr.h:6024
Represents a loop initializing the elements of an array.
Definition Expr.h:5971
This class represents BOTH the OpenMP Array Section and OpenACC 'subarray', with a boolean differenti...
Definition Expr.h:7218
bool isOMPArraySection() const
Definition Expr.h:7292
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition Expr.h:2724
void setRHS(Expr *E)
Definition Expr.h:2759
void setRBracketLoc(SourceLocation L)
Definition Expr.h:2775
void setLHS(Expr *E)
Definition Expr.h:2755
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
Definition ExprCXX.h:2997
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Definition Expr.h:6732
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
Definition Stmt.h:3269
void setSimple(bool V)
Definition Stmt.h:3303
void setAsmLoc(SourceLocation L)
Definition Stmt.h:3300
void setVolatile(bool V)
Definition Stmt.h:3306
unsigned NumInputs
Definition Stmt.h:3284
unsigned getNumClobbers() const
Definition Stmt.h:3360
unsigned getNumOutputs() const
Definition Stmt.h:3328
unsigned NumOutputs
Definition Stmt.h:3283
unsigned NumClobbers
Definition Stmt.h:3285
unsigned getNumInputs() const
Definition Stmt.h:3350
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Definition Expr.h:6927
unsigned getNumSubExprs() const
Definition Expr.h:7000
Represents an attribute applied to a statement.
Definition Stmt.h:2195
static AttributedStmt * CreateEmpty(const ASTContext &C, unsigned NumAttrs)
Definition Stmt.cpp:450
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Definition Expr.h:4456
A builtin binary operation expression such as "x + y" or "x <= y".
Definition Expr.h:4041
void setLHS(Expr *E)
Definition Expr.h:4092
void setHasStoredFPFeatures(bool B)
Set and fetch the bit that shows whether FPFeatures needs to be allocated in Trailing Storage.
Definition Expr.h:4225
void setOperatorLoc(SourceLocation L)
Definition Expr.h:4084
void setRHS(Expr *E)
Definition Expr.h:4094
void setExcludedOverflowPattern(bool B)
Set and get the bit that informs arithmetic overflow sanitizers whether or not they should exclude ce...
Definition Expr.h:4230
static BinaryOperator * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
Definition Expr.cpp:5068
void setStoredFPFeatures(FPOptionsOverride F)
Set FPFeatures in trailing storage, used only by Serialization.
Definition Expr.h:4243
void setOpcode(Opcode Opc)
Definition Expr.h:4089
BinaryOperatorKind Opcode
Definition Expr.h:4046
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition Expr.h:6671
void setBlockDecl(BlockDecl *BD)
Definition Expr.h:6685
BreakStmt - This represents a break.
Definition Stmt.h:3127
Represents a C++2a __builtin_bit_cast(T, v) expression.
Definition ExprCXX.h:5477
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr....
Definition Expr.h:3972
static CStyleCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize, bool HasFPFeatures)
Definition Expr.cpp:2122
void setRParenLoc(SourceLocation L)
Definition Expr.h:4008
void setLParenLoc(SourceLocation L)
Definition Expr.h:4005
Represents a call to a CUDA kernel function.
Definition ExprCXX.h:235
static CUDAKernelCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPFeatures, EmptyShell Empty)
Definition ExprCXX.cpp:1990
A C++ addrspace_cast expression (currently only enabled for OpenCL).
Definition ExprCXX.h:605
static CXXAddrspaceCastExpr * CreateEmpty(const ASTContext &Context)
Definition ExprCXX.cpp:914
Represents binding an expression to a temporary.
Definition ExprCXX.h:1494
void setTemporary(CXXTemporary *T)
Definition ExprCXX.h:1514
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition ExprCXX.h:724
void setValue(bool V)
Definition ExprCXX.h:742
void setLocation(SourceLocation L)
Definition ExprCXX.h:748
CXXCatchStmt - This represents a C++ catch block.
Definition StmtCXX.h:28
A C++ const_cast expression (C++ [expr.const.cast]).
Definition ExprCXX.h:567
static CXXConstCastExpr * CreateEmpty(const ASTContext &Context)
Definition ExprCXX.cpp:901
Represents a call to a C++ constructor.
Definition ExprCXX.h:1549
void setArg(unsigned Arg, Expr *ArgExpr)
Set the specified argument.
Definition ExprCXX.h:1702
unsigned getNumArgs() const
Return the number of arguments to the constructor call.
Definition ExprCXX.h:1689
static CXXConstructExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs)
Create an empty C++ construction expression.
Definition ExprCXX.cpp:1195
A default argument (C++ [dcl.fct.default]).
Definition ExprCXX.h:1271
static CXXDefaultArgExpr * CreateEmpty(const ASTContext &C, bool HasRewrittenInit)
Definition ExprCXX.cpp:1032
A use of a default initializer in a constructor or in aggregate initialization.
Definition ExprCXX.h:1378
static CXXDefaultInitExpr * CreateEmpty(const ASTContext &C, bool HasRewrittenInit)
Definition ExprCXX.cpp:1086
Represents a delete expression for memory deallocation and destructor calls, e.g.
Definition ExprCXX.h:2627
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition ExprCXX.h:3871
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition ExprCXX.h:4065
static CXXDependentScopeMemberExpr * CreateEmpty(const ASTContext &Ctx, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs, bool HasFirstQualifierFoundInScope)
Definition ExprCXX.cpp:1571
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Definition ExprCXX.h:482
static CXXDynamicCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
Definition ExprCXX.cpp:824
Represents a folding of a pack over an operator.
Definition ExprCXX.h:5033
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
Definition StmtCXX.h:135
void setLoopVarStmt(Stmt *S)
Definition StmtCXX.h:199
void setRangeStmt(Stmt *S)
Definition StmtCXX.h:194
void setEndStmt(Stmt *S)
Definition StmtCXX.h:196
void setInc(Expr *E)
Definition StmtCXX.h:198
void setBeginStmt(Stmt *S)
Definition StmtCXX.h:195
void setInit(Stmt *S)
Definition StmtCXX.h:192
void setBody(Stmt *S)
Definition StmtCXX.h:200
void setCond(Expr *E)
Definition StmtCXX.h:197
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr....
Definition ExprCXX.h:1832
void setLParenLoc(SourceLocation L)
Definition ExprCXX.h:1870
static CXXFunctionalCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize, bool HasFPFeatures)
Definition ExprCXX.cpp:934
void setRParenLoc(SourceLocation L)
Definition ExprCXX.h:1872
Represents a call to an inherited base class constructor from an inheriting constructor.
Definition ExprCXX.h:1752
Represents a call to a member function that may be written either with member call syntax (e....
Definition ExprCXX.h:180
static CXXMemberCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPFeatures, EmptyShell Empty)
Definition ExprCXX.cpp:709
Abstract class common to all of the C++ "named"/"keyword" casts.
Definition ExprCXX.h:376
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Definition ExprCXX.h:2356
static CXXNewExpr * CreateEmpty(const ASTContext &Ctx, bool IsArray, bool HasInit, unsigned NumPlacementArgs, bool IsParenTypeId)
Create an empty c++ new expression.
Definition ExprCXX.cpp:315
bool isArray() const
Definition ExprCXX.h:2465
bool hasInitializer() const
Whether this new-expression has any initializer at all.
Definition ExprCXX.h:2525
Stmt ** raw_arg_iterator
Definition ExprCXX.h:2594
void setOperatorDelete(FunctionDecl *D)
Definition ExprCXX.h:2463
unsigned getNumPlacementArgs() const
Definition ExprCXX.h:2495
bool isParenTypeId() const
Definition ExprCXX.h:2516
raw_arg_iterator raw_arg_end()
Definition ExprCXX.h:2597
raw_arg_iterator raw_arg_begin()
Definition ExprCXX.h:2596
void setOperatorNew(FunctionDecl *D)
Definition ExprCXX.h:2461
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition ExprCXX.h:4310
The null pointer literal (C++11 [lex.nullptr])
Definition ExprCXX.h:769
void setLocation(SourceLocation L)
Definition ExprCXX.h:784
A call to an overloaded operator written using operator syntax.
Definition ExprCXX.h:85
static CXXOperatorCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPFeatures, EmptyShell Empty)
Definition ExprCXX.cpp:641
Represents a list-initialization with parenthesis.
Definition ExprCXX.h:5142
void setInitializedFieldInUnion(FieldDecl *FD)
Definition ExprCXX.h:5216
static CXXParenListInitExpr * CreateEmpty(ASTContext &C, unsigned numExprs, EmptyShell Empty)
Definition ExprCXX.cpp:2014
void setArrayFiller(Expr *E)
Definition ExprCXX.h:5206
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition ExprCXX.h:2746
void setDestroyedType(IdentifierInfo *II, SourceLocation Loc)
Set the name of destroyed type for a dependent pseudo-destructor expression.
Definition ExprCXX.h:2861
Represents a C++26 reflect expression [expr.reflect].
Definition ExprCXX.h:5509
static CXXReflectExpr * CreateEmpty(ASTContext &C)
Definition ExprCXX.cpp:1956
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
Definition ExprCXX.h:527
static CXXReinterpretCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
Definition ExprCXX.cpp:887
A rewritten comparison expression that was originally written using operator syntax.
Definition ExprCXX.h:287
An expression "T()" which creates an rvalue of a non-class type T.
Definition ExprCXX.h:2197
A C++ static_cast expression (C++ [expr.static.cast]).
Definition ExprCXX.h:437
static CXXStaticCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize, bool hasFPFeatures)
Definition ExprCXX.cpp:797
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition ExprCXX.h:801
Represents a C++ functional cast expression that builds a temporary object.
Definition ExprCXX.h:1900
static CXXTemporaryObjectExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs)
Definition ExprCXX.cpp:1161
Represents the this expression in C++.
Definition ExprCXX.h:1155
void setCapturedByCopyInLambdaWithExplicitObjectParameter(bool Set)
Definition ExprCXX.h:1185
void setLocation(SourceLocation L)
Definition ExprCXX.h:1173
static CXXThisExpr * CreateEmpty(const ASTContext &Ctx)
Definition ExprCXX.cpp:1591
void setImplicit(bool I)
Definition ExprCXX.h:1179
A C++ throw-expression (C++ [except.throw]).
Definition ExprCXX.h:1209
CXXTryStmt - A C++ try block, including all handlers.
Definition StmtCXX.h:69
unsigned getNumHandlers() const
Definition StmtCXX.h:107
static CXXTryStmt * Create(const ASTContext &C, SourceLocation tryLoc, CompoundStmt *tryBlock, ArrayRef< Stmt * > handlers)
Definition StmtCXX.cpp:25
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition ExprCXX.h:849
bool isTypeOperand() const
Definition ExprCXX.h:885
void setSourceRange(SourceRange R)
Definition ExprCXX.h:904
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition ExprCXX.h:3745
void setRParenLoc(SourceLocation L)
Definition ExprCXX.h:3795
void setArg(unsigned I, Expr *E)
Definition ExprCXX.h:3831
void setLParenLoc(SourceLocation L)
Definition ExprCXX.h:3790
unsigned getNumArgs() const
Retrieve the number of arguments.
Definition ExprCXX.h:3803
static CXXUnresolvedConstructExpr * CreateEmpty(const ASTContext &Context, unsigned NumArgs)
Definition ExprCXX.cpp:1498
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
Definition ExprCXX.h:1069
bool isTypeOperand() const
Definition ExprCXX.h:1099
void setSourceRange(SourceRange R)
Definition ExprCXX.h:1120
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition Expr.h:2946
void setRParenLoc(SourceLocation L)
Definition Expr.h:3278
void setCoroElideSafe(bool V=true)
Definition Expr.h:3121
void setArg(unsigned Arg, Expr *ArgExpr)
setArg - Set the specified argument.
Definition Expr.h:3163
void setADLCallKind(ADLCallKind V=UsesADL)
Definition Expr.h:3100
static CallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPFeatures, EmptyShell Empty)
Create an empty call expression, for deserialization.
Definition Expr.cpp:1535
void setUsesMemberSyntax(bool V=true)
Definition Expr.h:3110
void setPreArg(unsigned I, Stmt *PreArg)
Definition Expr.h:3043
void setStoredFPFeatures(FPOptionsOverride F)
Set FPOptionsOverride in trailing storage. Used only by Serialization.
Definition Expr.h:3227
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition Expr.h:3137
void setCallee(Expr *F)
Definition Expr.h:3095
void setBody(Stmt *B)
Definition Decl.cpp:5700
This captures a statement into a function.
Definition Stmt.h:3929
static CapturedStmt * CreateDeserialized(const ASTContext &Context, unsigned NumCaptures)
Definition Stmt.cpp:1471
Expr ** capture_init_iterator
Iterator that walks over the capture initialization arguments.
Definition Stmt.h:4088
void setCapturedRegionKind(CapturedRegionKind Kind)
Set the captured region kind.
Definition Stmt.cpp:1513
CapturedDecl * getCapturedDecl()
Retrieve the outlined function declaration.
Definition Stmt.cpp:1493
Stmt * getCapturedStmt()
Retrieve the statement being captured.
Definition Stmt.h:4033
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument.
Definition Stmt.h:4106
void setCapturedDecl(CapturedDecl *D)
Set the outlined function declaration.
Definition Stmt.cpp:1502
void setCapturedRecordDecl(RecordDecl *D)
Set the record declaration for captured variables.
Definition Stmt.h:4053
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument.
Definition Stmt.h:4116
capture_range captures()
Definition Stmt.h:4067
VariableCaptureKind
The different capture forms: by 'this', by reference, capture for variable-length array type etc.
Definition Stmt.h:3933
CaseStmt - Represent a case statement.
Definition Stmt.h:1912
void setEllipsisLoc(SourceLocation L)
Set the location of the ... in a case statement of the form LHS ... RHS.
Definition Stmt.h:1988
static CaseStmt * CreateEmpty(const ASTContext &Ctx, bool CaseStmtIsGNURange)
Build an empty case statement.
Definition Stmt.cpp:1317
void setLHS(Expr *Val)
Definition Stmt.h:2003
void setSubStmt(Stmt *S)
Definition Stmt.h:2030
void setRHS(Expr *Val)
Definition Stmt.h:2019
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition Expr.h:3679
FPOptionsOverride * getTrailingFPFeatures()
Return a pointer to the trailing FPOptions.
Definition Expr.cpp:2053
path_iterator path_begin()
Definition Expr.h:3749
unsigned path_size() const
Definition Expr.h:3748
void setCastKind(CastKind K)
Definition Expr.h:3724
bool hasStoredFPFeatures() const
Definition Expr.h:3778
CXXBaseSpecifier ** path_iterator
Definition Expr.h:3745
void setSubExpr(Expr *E)
Definition Expr.h:3731
void setValue(unsigned Val)
Definition Expr.h:1638
void setLocation(SourceLocation Location)
Definition Expr.h:1634
void setKind(CharacterLiteralKind kind)
Definition Expr.h:1635
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition Expr.h:4851
void setRParenLoc(SourceLocation L)
Definition Expr.h:4902
void setIsConditionTrue(bool isTrue)
Definition Expr.h:4879
void setBuiltinLoc(SourceLocation L)
Definition Expr.h:4899
void setRHS(Expr *E)
Definition Expr.h:4896
void setCond(Expr *E)
Definition Expr.h:4892
void setLHS(Expr *E)
Definition Expr.h:4894
Represents a 'co_await' expression.
Definition ExprCXX.h:5370
void setIsImplicit(bool value=true)
Definition ExprCXX.h:5393
CompoundAssignOperator - For compound assignments (e.g.
Definition Expr.h:4303
void setComputationResultType(QualType T)
Definition Expr.h:4341
static CompoundAssignOperator * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
Definition Expr.cpp:5090
void setComputationLHSType(QualType T)
Definition Expr.h:4338
CompoundLiteralExpr - [C99 6.5.2.5].
Definition Expr.h:3608
void setFileScope(bool FS)
Definition Expr.h:3641
void setTypeSourceInfo(TypeSourceInfo *tinfo)
Definition Expr.h:3649
void setLParenLoc(SourceLocation L)
Definition Expr.h:3644
void setInitializer(Expr *E)
Definition Expr.h:3638
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition Stmt.h:1732
static CompoundStmt * CreateEmpty(const ASTContext &C, unsigned NumStmts, bool HasFPFeatures)
Definition Stmt.cpp:409
bool hasStoredFPFeatures() const
Definition Stmt.h:1779
Represents the specialization of a concept - evaluates to a prvalue of type bool.
ConditionalOperator - The ?
Definition Expr.h:4394
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition Expr.h:1085
ConstantResultStorageKind getResultStorageKind() const
Definition Expr.h:1154
static ConstantExpr * CreateEmpty(const ASTContext &Context, ConstantResultStorageKind StorageKind)
Definition Expr.cpp:367
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
Definition ASTConcept.h:47
llvm::SmallVector< UnsatisfiedConstraintRecord, 4 > Details
The substituted constraint expr, if the template arguments could be substituted into them,...
Definition ASTConcept.h:67
ContinueStmt - This represents a continue.
Definition Stmt.h:3111
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition Expr.h:4722
static ConvertVectorExpr * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
Definition Expr.cpp:5648
void setStoredFPFeatures(FPOptionsOverride F)
Set FPFeatures in trailing storage, used by Serialization & ASTImporter.
Definition Expr.h:4795
bool hasStoredFPFeatures() const
Is FPFeatures in Trailing Storage?
Definition Expr.h:4780
Represents a 'co_return' statement in the C++ Coroutines TS.
Definition StmtCXX.h:473
Represents the body of a coroutine.
Definition StmtCXX.h:320
static CoroutineBodyStmt * Create(const ASTContext &C, CtorArgs const &Args)
Definition StmtCXX.cpp:87
Represents a 'co_yield' expression.
Definition ExprCXX.h:5451
static DeclAccessPair make(NamedDecl *D, AccessSpecifier AS)
static DeclGroup * Create(ASTContext &C, Decl **Decls, unsigned NumDecls)
Definition DeclGroup.cpp:20
A reference to a declared variable, function, enum, etc.
Definition Expr.h:1273
bool hasTemplateKWAndArgsInfo() const
Definition Expr.h:1394
static DeclRefExpr * CreateEmpty(const ASTContext &Context, bool HasQualifier, bool HasFoundDecl, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Construct an empty declaration reference expression.
Definition Expr.cpp:529
void setLocation(SourceLocation L)
Definition Expr.h:1350
bool hasQualifier() const
Determine whether this declaration reference was preceded by a C++ nested-name-specifier,...
Definition Expr.h:1362
ValueDecl * getDecl()
Definition Expr.h:1341
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
Definition Stmt.h:1623
void setStartLoc(SourceLocation L)
Definition Stmt.h:1645
void setEndLoc(SourceLocation L)
Definition Stmt.h:1647
void setDeclGroup(DeclGroupRef DGR)
Definition Stmt.h:1643
Decl - This represents one declaration (or definition), e.g.
Definition DeclBase.h:86
void setSubStmt(Stmt *S)
Definition Stmt.h:2075
DeferStmt - This represents a deferred statement.
Definition Stmt.h:3228
void setBody(Stmt *S)
Definition Stmt.h:3249
void setDeferLoc(SourceLocation DeferLoc)
Definition Stmt.h:3243
static DeferStmt * CreateEmpty(ASTContext &Context, EmptyShell Empty)
Definition Stmt.cpp:1548
Represents a 'co_await' expression while the type of the promise is dependent.
Definition ExprCXX.h:5402
A qualified reference to a name whose declaration cannot yet be resolved.
Definition ExprCXX.h:3511
static DependentScopeDeclRefExpr * CreateEmpty(const ASTContext &Context, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition ExprCXX.cpp:559
Represents a C99 designated initializer expression.
Definition Expr.h:5554
static DesignatedInitExpr * CreateEmpty(const ASTContext &C, unsigned NumIndexExprs)
Definition Expr.cpp:4822
void setSubExpr(unsigned Idx, Expr *E)
Definition Expr.h:5840
void setGNUSyntax(bool GNU)
Definition Expr.h:5819
void setEqualOrColonLoc(SourceLocation L)
Definition Expr.h:5810
void setDesignators(const ASTContext &C, const Designator *Desigs, unsigned NumDesigs)
Definition Expr.cpp:4829
unsigned getNumSubExprs() const
Retrieve the total number of subexpressions in this designated initializer expression,...
Definition Expr.h:5834
void setBase(Expr *Base)
Definition Expr.h:5937
void setUpdater(Expr *Updater)
Definition Expr.h:5942
static Designator CreateArrayRangeDesignator(Expr *Start, Expr *End, SourceLocation LBracketLoc, SourceLocation EllipsisLoc)
Creates a GNU array-range designator.
Definition Designator.h:172
static Designator CreateArrayDesignator(Expr *Index, SourceLocation LBracketLoc)
Creates an array designator.
Definition Designator.h:142
static Designator CreateFieldDesignator(const IdentifierInfo *FieldName, SourceLocation DotLoc, SourceLocation FieldLoc)
Creates a field designator.
Definition Designator.h:115
DoStmt - This represents a 'do/while' stmt.
Definition Stmt.h:2824
void setWhileLoc(SourceLocation L)
Definition Stmt.h:2856
void setDoLoc(SourceLocation L)
Definition Stmt.h:2854
void setRParenLoc(SourceLocation L)
Definition Stmt.h:2858
void setBody(Stmt *Body)
Definition Stmt.h:2851
void setCond(Expr *Cond)
Definition Stmt.h:2847
void setAccessorLoc(SourceLocation L)
Definition Expr.h:6588
void setAccessor(IdentifierInfo *II)
Definition Expr.h:6585
void setBase(Expr *E)
Definition Expr.h:6582
Represents a reference to emded data.
Definition Expr.h:5129
ExplicitCastExpr - An explicit cast written in the source code.
Definition Expr.h:3931
void setTypeInfoAsWritten(TypeSourceInfo *writtenTy)
Definition Expr.h:3954
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition ExprCXX.h:3662
unsigned getNumObjects() const
Definition ExprCXX.h:3690
llvm::PointerUnion< BlockDecl *, CompoundLiteralExpr * > CleanupObject
The type of objects that are kept in the cleanup.
Definition ExprCXX.h:3668
static ExprWithCleanups * Create(const ASTContext &C, EmptyShell empty, unsigned numObjects)
Definition ExprCXX.cpp:1464
This represents one expression.
Definition Expr.h:112
void setType(QualType t)
Definition Expr.h:145
bool isValueDependent() const
Determines whether the value of this expression depends on.
Definition Expr.h:177
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on.
Definition Expr.h:223
void setValueKind(ExprValueKind Cat)
setValueKind - Set the value kind produced by this expression.
Definition Expr.h:464
void setObjectKind(ExprObjectKind Cat)
setObjectKind - Set the object kind produced by this expression.
Definition Expr.h:467
void setDependence(ExprDependence Deps)
Each concrete expr subclass is expected to compute its dependence and call this in the constructor.
Definition Expr.h:137
An expression trait intrinsic.
Definition ExprCXX.h:3070
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition Expr.h:6609
static FPOptionsOverride getFromOpaqueInt(storage_type I)
static FixedPointLiteral * Create(const ASTContext &C, EmptyShell Empty)
Returns an empty fixed-point literal.
Definition Expr.cpp:1005
void setLocation(SourceLocation Location)
Definition Expr.h:1586
void setScale(unsigned S)
Definition Expr.h:1589
static FloatingLiteral * Create(const ASTContext &C, const llvm::APFloat &V, bool isexact, QualType Type, SourceLocation L)
Definition Expr.cpp:1076
const llvm::fltSemantics & getSemantics() const
Return the APFloat semantics this literal uses.
Definition Expr.h:1691
void setValue(const ASTContext &C, const llvm::APFloat &Val)
Definition Expr.h:1672
void setRawSemantics(llvm::APFloatBase::Semantics Sem)
Set the raw enumeration value representing the floating-point semantics of this literal (32-bit IEEE,...
Definition Expr.h:1686
void setExact(bool E)
Definition Expr.h:1703
void setLocation(SourceLocation L)
Definition Expr.h:1711
ForStmt - This represents a 'for (init;cond;inc)' stmt.
Definition Stmt.h:2880
void setBody(Stmt *S)
Definition Stmt.h:2934
void setCond(Expr *E)
Definition Stmt.h:2932
void setForLoc(SourceLocation L)
Definition Stmt.h:2937
void setInc(Expr *E)
Definition Stmt.h:2933
void setLParenLoc(SourceLocation L)
Definition Stmt.h:2939
void setInit(Stmt *S)
Definition Stmt.h:2931
void setConditionVariableDeclStmt(DeclStmt *CondVar)
Definition Stmt.h:2918
void setRParenLoc(SourceLocation L)
Definition Stmt.h:2941
void setSubExpr(Expr *E)
As with any mutator of the AST, be very careful when modifying an existing AST to preserve its invari...
Definition Expr.h:1070
Stmt * SubExpr
Definition Expr.h:1054
Represents a reference to a function parameter pack, init-capture pack, or binding pack that has been...
Definition ExprCXX.h:4842
static FunctionParmPackExpr * CreateEmpty(const ASTContext &Context, unsigned NumParams)
Definition ExprCXX.cpp:1824
This represents a GCC inline-assembly statement extension.
Definition Stmt.h:3438
unsigned getNumLabels() const
Definition Stmt.h:3588
void setAsmStringExpr(Expr *E)
Definition Stmt.h:3467
void setRParenLoc(SourceLocation L)
Definition Stmt.h:3461
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Definition Expr.h:4926
void setTokenLocation(SourceLocation L)
Definition Expr.h:4941
Represents a C11 generic selection.
Definition Expr.h:6181
unsigned getNumAssocs() const
The number of association expressions.
Definition Expr.h:6423
static GenericSelectionExpr * CreateEmpty(const ASTContext &Context, unsigned NumAssocs)
Create an empty generic selection expression for deserialization.
Definition Expr.cpp:4756
GotoStmt - This represents a direct goto.
Definition Stmt.h:2961
void setLabel(LabelDecl *D)
Definition Stmt.h:2975
void setLabelLoc(SourceLocation L)
Definition Stmt.h:2980
void setGotoLoc(SourceLocation L)
Definition Stmt.h:2978
This class represents temporary values used to represent inout and out arguments in HLSL.
Definition Expr.h:7396
static HLSLOutArgExpr * CreateEmpty(const ASTContext &Ctx)
Definition Expr.cpp:5634
IfStmt - This represents an if/then/else.
Definition Stmt.h:2251
void setThen(Stmt *Then)
Definition Stmt.h:2345
void setConditionVariableDeclStmt(DeclStmt *CondVar)
Definition Stmt.h:2396
void setCond(Expr *Cond)
Definition Stmt.h:2336
void setLParenLoc(SourceLocation Loc)
Definition Stmt.h:2470
void setElse(Stmt *Else)
Definition Stmt.h:2359
void setElseLoc(SourceLocation ElseLoc)
Definition Stmt.h:2425
static IfStmt * CreateEmpty(const ASTContext &Ctx, bool HasElse, bool HasVar, bool HasInit)
Create an empty IfStmt optionally with storage for an else statement, condition variable and init exp...
Definition Stmt.cpp:1059
void setStatementKind(IfStatementKind Kind)
Definition Stmt.h:2448
void setRParenLoc(SourceLocation Loc)
Definition Stmt.h:2472
void setIfLoc(SourceLocation IfLoc)
Definition Stmt.h:2418
void setInit(Stmt *Init)
Definition Stmt.h:2411
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1....
Definition Expr.h:1734
void setSubExpr(Expr *E)
Definition Expr.h:1748
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition Expr.h:3856
static ImplicitCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize, bool HasFPFeatures)
Definition Expr.cpp:2095
void setIsPartOfExplicitCast(bool PartOfExplicitCast)
Definition Expr.h:3888
Represents an implicitly-generated value initialization of an object of a given type.
Definition Expr.h:6060
IndirectGotoStmt - This represents an indirect goto.
Definition Stmt.h:3000
void setTarget(Expr *E)
Definition Stmt.h:3024
void setGotoLoc(SourceLocation L)
Definition Stmt.h:3015
void setStarLoc(SourceLocation L)
Definition Stmt.h:3017
Describes an C or C++ initializer list.
Definition Expr.h:5302
void setSyntacticForm(InitListExpr *Init)
Definition Expr.h:5479
Expr * updateInit(const ASTContext &C, unsigned Init, Expr *expr)
Updates the initializer at index Init with the new expression expr, and returns the old expression at...
Definition Expr.cpp:2426
void setLBraceLoc(SourceLocation Loc)
Definition Expr.h:5464
void setRBraceLoc(SourceLocation Loc)
Definition Expr.h:5466
void sawArrayRangeDesignator(bool ARD=true)
Definition Expr.h:5489
void reserveInits(const ASTContext &C, unsigned NumInits)
Reserve space for some number of initializers.
Definition Expr.cpp:2417
void setLocation(SourceLocation Location)
Definition Expr.h:1541
static IntegerLiteral * Create(const ASTContext &C, const llvm::APInt &V, QualType type, SourceLocation l)
Returns a new integer literal with value 'V' and type 'type'.
Definition Expr.cpp:975
LabelStmt - Represents a label, which has a substatement.
Definition Stmt.h:2138
void setSubStmt(Stmt *SS)
Definition Stmt.h:2163
void setDecl(LabelDecl *D)
Definition Stmt.h:2157
void setIdentLoc(SourceLocation L)
Definition Stmt.h:2154
void setSideEntry(bool SE)
Definition Stmt.h:2186
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition ExprCXX.h:1969
Expr ** capture_init_iterator
Iterator that walks over the capture initialization arguments.
Definition ExprCXX.h:2076
static LambdaExpr * CreateDeserialized(const ASTContext &C, unsigned NumCaptures)
Construct a new lambda expression that will be deserialized from an external source.
Definition ExprCXX.cpp:1332
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument for this lambda expression.
Definition ExprCXX.h:2107
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
Definition ExprCXX.h:2095
Base class for BreakStmt and ContinueStmt.
Definition Stmt.h:3049
void setLabelDecl(LabelDecl *S)
Definition Stmt.h:3089
void setLabelLoc(SourceLocation L)
Definition Stmt.h:3085
void setKwLoc(SourceLocation L)
Definition Stmt.h:3075
This represents a Microsoft inline-assembly statement extension.
Definition Stmt.h:3657
Representation of a Microsoft __if_exists or __if_not_exists statement with a dependent name.
Definition StmtCXX.h:253
A member reference to an MSPropertyDecl.
Definition ExprCXX.h:937
MS property subscript expression.
Definition ExprCXX.h:1007
void setRBracketLoc(SourceLocation L)
Definition ExprCXX.h:1045
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition ExprCXX.h:4921
MatrixSingleSubscriptExpr - Matrix single subscript expression for the MatrixType extension when you ...
Definition Expr.h:2798
void setRBracketLoc(SourceLocation L)
Definition Expr.h:2845
MatrixSubscriptExpr - Matrix subscript expression for the MatrixType extension.
Definition Expr.h:2868
void setColumnIdx(Expr *E)
Definition Expr.h:2908
void setBase(Expr *E)
Definition Expr.h:2896
void setRowIdx(Expr *E)
Definition Expr.h:2900
void setRBracketLoc(SourceLocation L)
Definition Expr.h:2923
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition Expr.h:3367
static MemberExpr * CreateEmpty(const ASTContext &Context, bool HasQualifier, bool HasFoundDecl, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition Expr.cpp:1772
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition Decl.h:340
Represents a place-holder for an object not to be initialized by anything.
Definition Expr.h:5880
NullStmt - This is the null statement ";": C99 6.8.3p3.
Definition Stmt.h:1695
void setSemiLoc(SourceLocation L)
Definition Stmt.h:1707
An explicit cast in C or a C-style cast in C++, which uses the syntax ([s1][s2]......
Definition ExprOpenMP.h:24
void setLParenLoc(SourceLocation L)
Definition ExprOpenMP.h:69
static OMPArrayShapingExpr * CreateEmpty(const ASTContext &Context, unsigned NumDims)
Definition Expr.cpp:5488
void setRParenLoc(SourceLocation L)
Definition ExprOpenMP.h:72
OpenMP 5.0 [2.1.6 Iterators] Iterators are identifiers that expand to multiple values in the clause o...
Definition ExprOpenMP.h:151
void setLParenLoc(SourceLocation L)
Definition ExprOpenMP.h:243
static OMPIteratorExpr * CreateEmpty(const ASTContext &Context, unsigned NumIterators)
Definition Expr.cpp:5617
void setRParenLoc(SourceLocation L)
Definition ExprOpenMP.h:246
void setIteratorKwLoc(SourceLocation L)
Definition ExprOpenMP.h:249
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp,...
Definition ExprObjC.h:192
static ObjCArrayLiteral * CreateEmpty(const ASTContext &C, unsigned NumElements)
Definition ExprObjC.cpp:45
Expr ** getElements()
Retrieve elements of array of literals.
Definition ExprObjC.h:221
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c array literal.
Definition ExprObjC.h:227
Represents Objective-C's @catch statement.
Definition StmtObjC.h:77
void setCatchParamDecl(VarDecl *D)
Definition StmtObjC.h:103
void setCatchBody(Stmt *S)
Definition StmtObjC.h:95
void setRParenLoc(SourceLocation Loc)
Definition StmtObjC.h:108
void setAtCatchLoc(SourceLocation Loc)
Definition StmtObjC.h:106
Represents Objective-C's @finally statement.
Definition StmtObjC.h:127
void setFinallyBody(Stmt *S)
Definition StmtObjC.h:141
void setAtFinallyLoc(SourceLocation Loc)
Definition StmtObjC.h:149
Represents Objective-C's @synchronized statement.
Definition StmtObjC.h:303
void setAtSynchronizedLoc(SourceLocation Loc)
Definition StmtObjC.h:321
Represents Objective-C's @throw statement.
Definition StmtObjC.h:358
void setThrowLoc(SourceLocation Loc)
Definition StmtObjC.h:375
void setThrowExpr(Stmt *S)
Definition StmtObjC.h:372
Represents Objective-C's @try ... @catch ... @finally statement.
Definition StmtObjC.h:167
void setAtTryLoc(SourceLocation Loc)
Definition StmtObjC.h:211
void setFinallyStmt(Stmt *S)
Definition StmtObjC.h:253
static ObjCAtTryStmt * CreateEmpty(const ASTContext &Context, unsigned NumCatchStmts, bool HasFinally)
Definition StmtObjC.cpp:56
unsigned getNumCatchStmts() const
Retrieve the number of @catch statements in this try-catch-finally block.
Definition StmtObjC.h:220
void setCatchStmt(unsigned I, ObjCAtCatchStmt *S)
Set a particular catch statement.
Definition StmtObjC.h:235
void setTryBody(Stmt *S)
Definition StmtObjC.h:216
Represents Objective-C's @autoreleasepool Statement.
Definition StmtObjC.h:394
void setAtLoc(SourceLocation Loc)
Definition StmtObjC.h:415
A runtime availability query.
Definition ExprObjC.h:1700
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition ExprObjC.h:88
void setLocation(SourceLocation L)
Definition ExprObjC.h:108
ObjCBoxedExpr - used for generalized expression boxing.
Definition ExprObjC.h:128
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers,...
Definition ExprObjC.h:1640
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
Definition ExprObjC.h:307
static ObjCDictionaryLiteral * CreateEmpty(const ASTContext &C, unsigned NumElements, bool HasPackExpansions)
Definition ExprObjC.cpp:86
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c dictionary literal.
Definition ExprObjC.h:358
ObjCEncodeExpr, used for @encode in Objective-C.
Definition ExprObjC.h:407
void setEncodedTypeSourceInfo(TypeSourceInfo *EncType)
Definition ExprObjC.h:430
void setRParenLoc(SourceLocation L)
Definition ExprObjC.h:424
void setAtLoc(SourceLocation L)
Definition ExprObjC.h:422
Represents Objective-C's collection statement.
Definition StmtObjC.h:23
void setCollection(Expr *E)
Definition StmtObjC.h:47
void setForLoc(SourceLocation Loc)
Definition StmtObjC.h:53
void setRParenLoc(SourceLocation Loc)
Definition StmtObjC.h:55
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
Definition ExprObjC.h:1579
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC 'id' type.
Definition ExprObjC.h:1495
void setIsaMemberLoc(SourceLocation L)
Definition ExprObjC.h:1528
void setBase(Expr *E)
Definition ExprObjC.h:1519
void setArrow(bool A)
Definition ExprObjC.h:1523
void setOpLoc(SourceLocation L)
Definition ExprObjC.h:1531
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition ExprObjC.h:546
void setIsArrow(bool A)
Definition ExprObjC.h:586
void setBase(Expr *base)
Definition ExprObjC.h:582
void setDecl(ObjCIvarDecl *d)
Definition ExprObjC.h:578
void setIsFreeIvar(bool A)
Definition ExprObjC.h:587
void setOpLoc(SourceLocation L)
Definition ExprObjC.h:598
void setLocation(SourceLocation L)
Definition ExprObjC.h:590
An expression that sends a message to the given Objective-C object or class.
Definition ExprObjC.h:937
static ObjCMessageExpr * CreateEmpty(const ASTContext &Context, unsigned NumArgs, unsigned NumStoredSelLocs)
Create an empty Objective-C message expression, to be filled in by subsequent calls.
Definition ExprObjC.cpp:228
void setMethodDecl(ObjCMethodDecl *MD)
Definition ExprObjC.h:1375
void setClassReceiver(TypeSourceInfo *TSInfo)
Definition ExprObjC.h:1299
void setInstanceReceiver(Expr *rec)
Turn this message send into an instance message that computes the receiver object with the given expr...
Definition ExprObjC.h:1277
void setSuper(SourceLocation Loc, QualType T, bool IsInstanceSuper)
Definition ExprObjC.h:1348
ReceiverKind
The kind of receiver this message is sending to.
Definition ExprObjC.h:940
@ SuperInstance
The receiver is the instance of the superclass object.
Definition ExprObjC.h:951
@ Instance
The receiver is an object instance.
Definition ExprObjC.h:945
@ SuperClass
The receiver is a superclass.
Definition ExprObjC.h:948
@ Class
The receiver is a class.
Definition ExprObjC.h:942
void setDelegateInitCall(bool isDelegate)
Definition ExprObjC.h:1419
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
Definition ExprObjC.h:1226
unsigned getNumArgs() const
Return the number of actual arguments in this message, not counting the receiver.
Definition ExprObjC.h:1387
void setSelector(Selector S)
Definition ExprObjC.h:1356
void setArg(unsigned Arg, Expr *ArgExpr)
setArg - Set the specified argument.
Definition ExprObjC.h:1410
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition ExprObjC.h:614
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition ExprObjC.h:502
void setProtocol(ObjCProtocolDecl *P)
Definition ExprObjC.h:520
void setRParenLoc(SourceLocation L)
Definition ExprObjC.h:526
void setAtLoc(SourceLocation L)
Definition ExprObjC.h:525
ObjCSelectorExpr used for @selector in Objective-C.
Definition ExprObjC.h:452
void setSelector(Selector S)
Definition ExprObjC.h:467
void setAtLoc(SourceLocation L)
Definition ExprObjC.h:471
void setRParenLoc(SourceLocation L)
Definition ExprObjC.h:472
ObjCStringLiteral, used for Objective-C string literals i.e.
Definition ExprObjC.h:52
void setAtLoc(SourceLocation L)
Definition ExprObjC.h:70
void setString(StringLiteral *S)
Definition ExprObjC.h:67
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition ExprObjC.h:836
void setRBracket(SourceLocation RB)
Definition ExprObjC.h:867
void setBaseExpr(Stmt *S)
Definition ExprObjC.h:876
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type,...
Definition Expr.h:2530
void setOperatorLoc(SourceLocation L)
Definition Expr.h:2564
static OffsetOfExpr * CreateEmpty(const ASTContext &C, unsigned NumComps, unsigned NumExprs)
Definition Expr.cpp:1666
void setIndexExpr(unsigned Idx, Expr *E)
Definition Expr.h:2597
void setTypeSourceInfo(TypeSourceInfo *tsi)
Definition Expr.h:2573
void setComponent(unsigned Idx, OffsetOfNode ON)
Definition Expr.h:2581
unsigned getNumExpressions() const
Definition Expr.h:2601
void setRParenLoc(SourceLocation R)
Definition Expr.h:2568
unsigned getNumComponents() const
Definition Expr.h:2585
Kind
The kind of offsetof node we have.
Definition Expr.h:2427
@ Array
An index into an array.
Definition Expr.h:2429
@ Identifier
A field in a dependent type, known only by its name.
Definition Expr.h:2433
@ Field
A field.
Definition Expr.h:2431
@ Base
An implicit indirection through a C++ base class, when the field found is in a base class.
Definition Expr.h:2436
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
Definition Expr.h:1181
void setIsUnique(bool V)
Definition Expr.h:1233
This is a base class for any OpenACC statement-level constructs that have an associated statement.
Definition StmtOpenACC.h:81
This expression type represents an asterisk in an OpenACC Size-Expr, used in the 'tile' and 'gang' cl...
Definition Expr.h:2093
static OpenACCAsteriskSizeExpr * CreateEmpty(const ASTContext &C)
Definition Expr.cpp:5644
This is the base class for an OpenACC statement-level construct, other construct types are expected t...
Definition StmtOpenACC.h:26
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr.
Definition ExprCXX.h:3129
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
Definition ExprCXX.h:4283
unsigned getNumDecls() const
Gets the number of declarations in the unresolved set.
Definition ExprCXX.h:3233
TemplateArgumentLoc * getTrailingTemplateArgumentLoc()
Return the optional template arguments.
Definition ExprCXX.h:4293
DeclAccessPair * getTrailingResults()
Return the results. Defined after UnresolvedMemberExpr.
Definition ExprCXX.h:4277
bool hasTemplateKWAndArgsInfo() const
Definition ExprCXX.h:3173
unsigned getNumTemplateArgs() const
Definition ExprCXX.h:3331
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition ExprCXX.h:4364
static PackIndexingExpr * CreateDeserialized(ASTContext &Context, unsigned NumTransformedExprs)
Definition ExprCXX.cpp:1761
ParenExpr - This represents a parenthesized expression, e.g.
Definition Expr.h:2185
void setLParen(SourceLocation Loc)
Definition Expr.h:2211
void setIsProducedByFoldExpansion(bool ProducedByFoldExpansion=true)
Definition Expr.h:2230
void setRParen(SourceLocation Loc)
Definition Expr.h:2215
void setSubExpr(Expr *E)
Definition Expr.h:2204
static ParenListExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumExprs)
Create an empty paren list.
Definition Expr.cpp:4957
unsigned getNumExprs() const
Return the number of expressions in this paren list.
Definition Expr.h:6113
[C99 6.4.2.2] - A predefined identifier such as func.
Definition Expr.h:2008
void setLocation(SourceLocation L)
Definition Expr.h:2050
static PredefinedExpr * CreateEmpty(const ASTContext &Ctx, bool HasFunctionName)
Create an empty PredefinedExpr.
Definition Expr.cpp:642
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition Expr.h:6803
static PseudoObjectExpr * Create(const ASTContext &Context, Expr *syntactic, ArrayRef< Expr * > semantic, unsigned resultIndex)
Definition Expr.cpp:5170
Frontend produces RecoveryExprs on semantic errors that prevent creating other well-formed expression...
Definition Expr.h:7502
child_range children()
Definition Expr.h:7515
static RecoveryExpr * CreateEmpty(ASTContext &Ctx, unsigned NumSubExprs)
Definition Expr.cpp:5443
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
static RequiresExpr * Create(ASTContext &C, SourceLocation RequiresKWLoc, RequiresExprBodyDecl *Body, SourceLocation LParenLoc, ArrayRef< ParmVarDecl * > LocalParameters, SourceLocation RParenLoc, ArrayRef< concepts::Requirement * > Requirements, SourceLocation RBraceLoc)
ReturnStmt - This represents a return, optionally of an expression: return; return 4;.
Definition Stmt.h:3152
void setRetValue(Expr *E)
Definition Stmt.h:3181
void setReturnLoc(SourceLocation L)
Definition Stmt.h:3202
void setNRVOCandidate(const VarDecl *Var)
Set the variable that might be used for the named return value optimization.
Definition Stmt.h:3195
static ReturnStmt * CreateEmpty(const ASTContext &Ctx, bool HasNRVOCandidate)
Create an empty return statement, optionally with storage for an NRVO candidate.
Definition Stmt.cpp:1298
Represents a __leave statement.
Definition Stmt.h:3890
void setLeaveLoc(SourceLocation L)
Definition Stmt.h:3901
SYCLKernelCallStmt represents the transformation that is applied to the body of a function declared w...
Definition StmtSYCL.h:36
void setOriginalStmt(CompoundStmt *CS)
Definition StmtSYCL.h:59
void setKernelLaunchStmt(Stmt *S)
Definition StmtSYCL.h:64
void setOutlinedFunctionDecl(OutlinedFunctionDecl *OFD)
Definition StmtSYCL.h:69
static SYCLUniqueStableNameExpr * CreateEmpty(const ASTContext &Ctx)
Definition Expr.cpp:582
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition Expr.h:4646
void setExprs(const ASTContext &C, ArrayRef< Expr * > Exprs)
Definition Expr.cpp:4586
void setRParenLoc(SourceLocation L)
Definition Expr.h:4667
void setBuiltinLoc(SourceLocation L)
Definition Expr.h:4664
Represents an expression that computes the length of a parameter pack.
Definition ExprCXX.h:4442
static SizeOfPackExpr * CreateDeserialized(ASTContext &Context, unsigned NumPartialArgs)
Definition ExprCXX.cpp:1721
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof... expression, such as is produced f...
Definition ExprCXX.h:4527
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(),...
Definition Expr.h:5020
Encodes a location in the source.
A trivial tuple used to represent a source range.
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition Expr.h:4598
void setRParenLoc(SourceLocation L)
Definition Expr.h:4625
void setLParenLoc(SourceLocation L)
Definition Expr.h:4623
void setSubStmt(CompoundStmt *S)
Definition Expr.h:4617
StmtVisitor - This class implements a simple visitor for Stmt subclasses.
Stmt - This represents one statement.
Definition Stmt.h:86
ExpressionTraitExprBitfields ExpressionTraitExprBits
Definition Stmt.h:1388
GenericSelectionExprBitfields GenericSelectionExprBits
Definition Stmt.h:1352
LambdaExprBitfields LambdaExprBits
Definition Stmt.h:1385
AttributedStmtBitfields AttributedStmtBits
Definition Stmt.h:1323
UnresolvedLookupExprBitfields UnresolvedLookupExprBits
Definition Stmt.h:1381
SubstNonTypeTemplateParmExprBitfields SubstNonTypeTemplateParmExprBits
Definition Stmt.h:1384
CXXNoexceptExprBitfields CXXNoexceptExprBits
Definition Stmt.h:1383
CXXRewrittenBinaryOperatorBitfields CXXRewrittenBinaryOperatorBits
Definition Stmt.h:1364
ExprWithCleanupsBitfields ExprWithCleanupsBits
Definition Stmt.h:1377
StmtClass getStmtClass() const
Definition Stmt.h:1485
CXXScalarValueInitExprBitfields CXXScalarValueInitExprBits
Definition Stmt.h:1371
CXXConstructExprBitfields CXXConstructExprBits
Definition Stmt.h:1376
CXXDependentScopeMemberExprBitfields CXXDependentScopeMemberExprBits
Definition Stmt.h:1379
TypeTraitExprBitfields TypeTraitExprBits
Definition Stmt.h:1374
CXXNewExprBitfields CXXNewExprBits
Definition Stmt.h:1372
SourceLocExprBitfields SourceLocExprBits
Definition Stmt.h:1354
ConstantExprBitfields ConstantExprBits
Definition Stmt.h:1337
RequiresExprBitfields RequiresExprBits
Definition Stmt.h:1386
CXXFoldExprBitfields CXXFoldExprBits
Definition Stmt.h:1389
StmtExprBitfields StmtExprBits
Definition Stmt.h:1359
StringLiteralBitfields StringLiteralBits
Definition Stmt.h:1341
OpaqueValueExprBitfields OpaqueValueExprBits
Definition Stmt.h:1399
CXXThrowExprBitfields CXXThrowExprBits
Definition Stmt.h:1368
MemberExprBitfields MemberExprBits
Definition Stmt.h:1347
PackIndexingExprBitfields PackIndexingExprBits
Definition Stmt.h:1390
DeclRefExprBitfields DeclRefExprBits
Definition Stmt.h:1339
CXXOperatorCallExprBitfields CXXOperatorCallExprBits
Definition Stmt.h:1363
CXXDefaultInitExprBitfields CXXDefaultInitExprBits
Definition Stmt.h:1370
NullStmtBitfields NullStmtBits
Definition Stmt.h:1320
ArrayTypeTraitExprBitfields ArrayTypeTraitExprBits
Definition Stmt.h:1387
PredefinedExprBitfields PredefinedExprBits
Definition Stmt.h:1338
UnresolvedMemberExprBitfields UnresolvedMemberExprBits
Definition Stmt.h:1382
PseudoObjectExprBitfields PseudoObjectExprBits
Definition Stmt.h:1353
CXXDeleteExprBitfields CXXDeleteExprBits
Definition Stmt.h:1373
CXXDefaultArgExprBitfields CXXDefaultArgExprBits
Definition Stmt.h:1369
StringLiteral - This represents a string literal expression, e.g.
Definition Expr.h:1802
unsigned getLength() const
Definition Expr.h:1912
StringLiteralKind getKind() const
Definition Expr.h:1915
static StringLiteral * CreateEmpty(const ASTContext &Ctx, unsigned NumConcatenated, unsigned Length, unsigned CharByteWidth)
Construct an empty string literal.
Definition Expr.cpp:1198
unsigned getNumConcatenated() const
getNumConcatenated - Get the number of string literal tokens that were concatenated in translation ph...
Definition Expr.h:1943
unsigned getCharByteWidth() const
Definition Expr.h:1913
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition ExprCXX.h:4665
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition ExprCXX.h:4755
void setColonLoc(SourceLocation L)
Definition Stmt.h:1892
void setKeywordLoc(SourceLocation L)
Definition Stmt.h:1890
void setNextSwitchCase(SwitchCase *SC)
Definition Stmt.h:1887
SwitchStmt - This represents a 'switch' stmt.
Definition Stmt.h:2501
void setCond(Expr *Cond)
Definition Stmt.h:2572
void setSwitchLoc(SourceLocation L)
Definition Stmt.h:2637
void setConditionVariableDeclStmt(DeclStmt *CondVar)
Definition Stmt.h:2627
void setBody(Stmt *Body)
Definition Stmt.h:2579
void setRParenLoc(SourceLocation Loc)
Definition Stmt.h:2641
void setInit(Stmt *Init)
Definition Stmt.h:2589
void setLParenLoc(SourceLocation Loc)
Definition Stmt.h:2639
static SwitchStmt * CreateEmpty(const ASTContext &Ctx, bool HasInit, bool HasVar)
Create an empty switch statement optionally with storage for an init expression and a condition varia...
Definition Stmt.cpp:1178
void setAllEnumCasesCovered()
Set a flag in the SwitchStmt indicating that if the 'switch (X)' is a switch over an enum value then ...
Definition Stmt.h:2657
void setSwitchCaseList(SwitchCase *SC)
Definition Stmt.h:2634
A convenient class for passing around template argument information.
void setLAngleLoc(SourceLocation Loc)
void setRAngleLoc(SourceLocation Loc)
void addArgument(const TemplateArgumentLoc &Loc)
Location wrapper for a TemplateArgument.
pack_iterator pack_begin() const
Iterator referencing the first argument of a template argument pack.
unsigned pack_size() const
The number of template arguments in the given template argument pack.
@ Pack
The template argument is actually a parameter pack.
ArgKind getKind() const
Return the kind of stored template argument.
A container of type source information.
Definition TypeBase.h:8402
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition ExprCXX.h:2897
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
Definition ExprCXX.h:2959
static TypeTraitExpr * CreateDeserialized(const ASTContext &C, bool IsStoredAsBool, unsigned NumArgs)
Definition ExprCXX.cpp:1934
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition Expr.h:2628
void setKind(UnaryExprOrTypeTrait K)
Definition Expr.h:2663
void setOperatorLoc(SourceLocation L)
Definition Expr.h:2702
void setRParenLoc(SourceLocation L)
Definition Expr.h:2705
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition Expr.h:2247
void setSubExpr(Expr *E)
Definition Expr.h:2289
void setOperatorLoc(SourceLocation L)
Definition Expr.h:2293
void setCanOverflow(bool C)
Definition Expr.h:2302
bool hasStoredFPFeatures() const
Is FPFeatures in Trailing Storage?
Definition Expr.h:2384
void setOpcode(Opcode Opc)
Definition Expr.h:2286
void setStoredFPFeatures(FPOptionsOverride F)
Set FPFeatures in trailing storage, used by Serialization & ASTImporter.
Definition Expr.h:2398
UnaryOperatorKind Opcode
Definition Expr.h:2261
static UnaryOperator * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
Definition Expr.cpp:5112
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition ExprCXX.h:3391
static UnresolvedLookupExpr * CreateEmpty(const ASTContext &Context, unsigned NumResults, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition ExprCXX.cpp:467
Represents a C++ member access expression for which lookup produced a set of overloaded functions.
Definition ExprCXX.h:4127
static UnresolvedMemberExpr * CreateEmpty(const ASTContext &Context, unsigned NumResults, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition ExprCXX.cpp:1671
static UnresolvedSYCLKernelCallStmt * CreateEmpty(const ASTContext &C)
Definition StmtSYCL.h:125
void addDecl(NamedDecl *D)
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit....
Definition ExprCXX.h:641
static UserDefinedLiteral * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPOptions, EmptyShell Empty)
Definition ExprCXX.cpp:984
Represents a call to the builtin function __builtin_va_arg.
Definition Expr.h:4960
void setRParenLoc(SourceLocation L)
Definition Expr.h:4991
void setIsMicrosoftABI(bool IsMS)
Definition Expr.h:4982
void setSubExpr(Expr *E)
Definition Expr.h:4978
void setBuiltinLoc(SourceLocation L)
Definition Expr.h:4988
void setWrittenTypeInfo(TypeSourceInfo *TI)
Definition Expr.h:4985
WhileStmt - This represents a 'while' stmt.
Definition Stmt.h:2689
void setCond(Expr *Cond)
Definition Stmt.h:2749
void setBody(Stmt *Body)
Definition Stmt.h:2756
void setLParenLoc(SourceLocation L)
Definition Stmt.h:2798
void setRParenLoc(SourceLocation L)
Definition Stmt.h:2800
void setWhileLoc(SourceLocation L)
Definition Stmt.h:2795
static WhileStmt * CreateEmpty(const ASTContext &Ctx, bool HasVar)
Create an empty while statement optionally with storage for a condition variable.
Definition Stmt.cpp:1240
void setConditionVariableDeclStmt(DeclStmt *CondVar)
Definition Stmt.h:2789
Information about a module that has been loaded by the ASTReader.
Definition ModuleFile.h:145
llvm::BitstreamCursor DeclsCursor
DeclsCursor - This is a cursor to the start of the DECLTYPES_BLOCK block.
Definition ModuleFile.h:470
#define bool
Definition gpuintrin.h:32
StmtCode
Record codes for each kind of statement or expression.
DesignatorTypes
The kinds of designators that can occur in a DesignatedInitExpr.
@ EXPR_DESIGNATED_INIT
A DesignatedInitExpr record.
@ EXPR_COMPOUND_LITERAL
A CompoundLiteralExpr record.
@ STMT_OMP_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE
@ EXPR_OBJC_IVAR_REF_EXPR
An ObjCIvarRefExpr record.
@ EXPR_MEMBER
A MemberExpr record.
@ EXPR_CXX_TEMPORARY_OBJECT
A CXXTemporaryObjectExpr record.
@ STMT_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE
@ EXPR_COMPOUND_ASSIGN_OPERATOR
A CompoundAssignOperator record.
@ EXPR_CXX_STATIC_CAST
A CXXStaticCastExpr record.
@ EXPR_OBJC_STRING_LITERAL
An ObjCStringLiteral record.
@ EXPR_VA_ARG
A VAArgExpr record.
@ EXPR_OBJC_ISA
An ObjCIsa Expr record.
@ EXPR_CXX_OPERATOR_CALL
A CXXOperatorCallExpr record.
@ STMT_OBJC_AT_TRY
An ObjCAtTryStmt record.
@ STMT_DO
A DoStmt record.
@ STMT_OBJC_CATCH
An ObjCAtCatchStmt record.
@ STMT_IF
An IfStmt record.
@ EXPR_STRING_LITERAL
A StringLiteral record.
@ EXPR_OBJC_AVAILABILITY_CHECK
An ObjCAvailabilityCheckExpr record.
@ STMT_OMP_PARALLEL_MASKED_TASKLOOP_DIRECTIVE
@ EXPR_MATRIX_SUBSCRIPT
An MatrixSubscriptExpr record.
@ EXPR_PSEUDO_OBJECT
A PseudoObjectExpr record.
@ STMT_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE
@ EXPR_IMPLICIT_CAST
An ImplicitCastExpr record.
@ STMT_CAPTURED
A CapturedStmt record.
@ STMT_OMP_TARGET_PARALLEL_FOR_SIMD_DIRECTIVE
@ STMT_GCCASM
A GCC-style AsmStmt record.
@ EXPR_IMAGINARY_LITERAL
An ImaginaryLiteral record.
@ STMT_WHILE
A WhileStmt record.
@ EXPR_CONVERT_VECTOR
A ConvertVectorExpr record.
@ EXPR_OBJC_SUBSCRIPT_REF_EXPR
An ObjCSubscriptRefExpr record.
@ EXPR_STMT
A StmtExpr record.
@ EXPR_CXX_REINTERPRET_CAST
A CXXReinterpretCastExpr record.
@ EXPR_DESIGNATED_INIT_UPDATE
A DesignatedInitUpdateExpr record.
@ STMT_OBJC_AT_SYNCHRONIZED
An ObjCAtSynchronizedStmt record.
@ STMT_OMP_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE
@ EXPR_BUILTIN_BIT_CAST
A BuiltinBitCastExpr record.
@ STMT_OMP_TARGET_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE
@ STMT_SYCLKERNELCALL
A SYCLKernelCallStmt record.
@ EXPR_CHARACTER_LITERAL
A CharacterLiteral record.
@ EXPR_OBJC_ENCODE
An ObjCEncodeExpr record.
@ EXPR_CSTYLE_CAST
A CStyleCastExpr record.
@ EXPR_OBJC_BOOL_LITERAL
An ObjCBoolLiteralExpr record.
@ EXPR_EXT_VECTOR_ELEMENT
An ExtVectorElementExpr record.
@ EXPR_ATOMIC
An AtomicExpr record.
@ EXPR_OFFSETOF
An OffsetOfExpr record.
@ STMT_RETURN
A ReturnStmt record.
@ STMT_OBJC_FOR_COLLECTION
An ObjCForCollectionStmt record.
@ STMT_OMP_TARGET_TEAMS_DISTRIBUTE_DIRECTIVE
@ EXPR_ARRAY_INIT_LOOP
An ArrayInitLoopExpr record.
@ STMT_OMP_PARALLEL_MASTER_TASKLOOP_DIRECTIVE
@ STMT_OMP_PARALLEL_MASKED_TASKLOOP_SIMD_DIRECTIVE
@ STMT_CONTINUE
A ContinueStmt record.
@ EXPR_PREDEFINED
A PredefinedExpr record.
@ EXPR_CXX_BOOL_LITERAL
A CXXBoolLiteralExpr record.
@ EXPR_PAREN_LIST
A ParenListExpr record.
@ EXPR_CXX_PAREN_LIST_INIT
A CXXParenListInitExpr record.
@ STMT_COMPOUND
A CompoundStmt record.
@ STMT_FOR
A ForStmt record.
@ STMT_ATTRIBUTED
An AttributedStmt record.
@ STMT_UNRESOLVED_SYCL_KERNEL_CALL
An UnresolvedSYCLKernelCallStmt record.
@ STMT_OMP_TARGET_TEAMS_GENERIC_LOOP_DIRECTIVE
@ EXPR_CXX_REWRITTEN_BINARY_OPERATOR
A CXXRewrittenBinaryOperator record.
@ STMT_GOTO
A GotoStmt record.
@ EXPR_NO_INIT
An NoInitExpr record.
@ EXPR_OBJC_PROTOCOL_EXPR
An ObjCProtocolExpr record.
@ EXPR_ARRAY_INIT_INDEX
An ArrayInitIndexExpr record.
@ EXPR_CXX_CONSTRUCT
A CXXConstructExpr record.
@ STMT_OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE
@ STMT_OMP_PARALLEL_MASTER_TASKLOOP_SIMD_DIRECTIVE
@ STMT_OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE
@ EXPR_CXX_DYNAMIC_CAST
A CXXDynamicCastExpr record.
@ STMT_CXX_TRY
A CXXTryStmt record.
@ EXPR_GENERIC_SELECTION
A GenericSelectionExpr record.
@ EXPR_OBJC_INDIRECT_COPY_RESTORE
An ObjCIndirectCopyRestoreExpr record.
@ EXPR_CXX_INHERITED_CTOR_INIT
A CXXInheritedCtorInitExpr record.
@ EXPR_CALL
A CallExpr record.
@ EXPR_GNU_NULL
A GNUNullExpr record.
@ EXPR_OBJC_PROPERTY_REF_EXPR
An ObjCPropertyRefExpr record.
@ EXPR_CXX_CONST_CAST
A CXXConstCastExpr record.
@ STMT_REF_PTR
A reference to a previously [de]serialized Stmt record.
@ EXPR_OBJC_MESSAGE_EXPR
An ObjCMessageExpr record.
@ STMT_CASE
A CaseStmt record.
@ EXPR_CONSTANT
A constant expression context.
@ STMT_STOP
A marker record that indicates that we are at the end of an expression.
@ STMT_MSASM
A MS-style AsmStmt record.
@ EXPR_CONDITIONAL_OPERATOR
A ConditionOperator record.
@ EXPR_BINARY_OPERATOR
A BinaryOperator record.
@ EXPR_CXX_STD_INITIALIZER_LIST
A CXXStdInitializerListExpr record.
@ EXPR_SHUFFLE_VECTOR
A ShuffleVectorExpr record.
@ STMT_OBJC_FINALLY
An ObjCAtFinallyStmt record.
@ EXPR_OBJC_SELECTOR_EXPR
An ObjCSelectorExpr record.
@ EXPR_FLOATING_LITERAL
A FloatingLiteral record.
@ STMT_NULL_PTR
A NULL expression.
@ STMT_DEFAULT
A DefaultStmt record.
@ EXPR_CHOOSE
A ChooseExpr record.
@ STMT_NULL
A NullStmt record.
@ EXPR_DECL_REF
A DeclRefExpr record.
@ EXPR_INIT_LIST
An InitListExpr record.
@ EXPR_IMPLICIT_VALUE_INIT
An ImplicitValueInitExpr record.
@ STMT_OBJC_AUTORELEASE_POOL
An ObjCAutoreleasePoolStmt record.
@ EXPR_RECOVERY
A RecoveryExpr record.
@ EXPR_PAREN
A ParenExpr record.
@ STMT_OMP_TARGET_PARALLEL_GENERIC_LOOP_DIRECTIVE
@ STMT_LABEL
A LabelStmt record.
@ EXPR_CXX_FUNCTIONAL_CAST
A CXXFunctionalCastExpr record.
@ EXPR_USER_DEFINED_LITERAL
A UserDefinedLiteral record.
@ EXPR_INTEGER_LITERAL
An IntegerLiteral record.
@ EXPR_SOURCE_LOC
A SourceLocExpr record.
@ EXPR_CXX_MEMBER_CALL
A CXXMemberCallExpr record.
@ STMT_SWITCH
A SwitchStmt record.
@ STMT_DECL
A DeclStmt record.
@ EXPR_OBJC_KVC_REF_EXPR
UNUSED.
@ EXPR_SIZEOF_ALIGN_OF
A SizefAlignOfExpr record.
@ STMT_BREAK
A BreakStmt record.
@ STMT_OBJC_AT_THROW
An ObjCAtThrowStmt record.
@ EXPR_ADDR_LABEL
An AddrLabelExpr record.
@ EXPR_MATRIX_ELEMENT
A MatrixElementExpr record.
@ STMT_CXX_FOR_RANGE
A CXXForRangeStmt record.
@ EXPR_CXX_ADDRSPACE_CAST
A CXXAddrspaceCastExpr record.
@ EXPR_ARRAY_SUBSCRIPT
An ArraySubscriptExpr record.
@ EXPR_UNARY_OPERATOR
A UnaryOperator record.
@ STMT_CXX_CATCH
A CXXCatchStmt record.
@ EXPR_BUILTIN_PP_EMBED
A EmbedExpr record.
@ STMT_INDIRECT_GOTO
An IndirectGotoStmt record.
@ DESIG_ARRAY_RANGE
GNU array range designator.
@ DESIG_FIELD_NAME
Field designator where only the field name is known.
@ DESIG_FIELD_DECL
Field designator where the field has been resolved to a declaration.
@ DESIG_ARRAY
Array designator.
The JSON file list parser is used to communicate input to InstallAPI.
ConstantResultStorageKind
Describes the kind of result that can be tail-allocated.
Definition Expr.h:1079
OpenACCDirectiveKind
ArrayTypeTrait
Names for the array type traits.
Definition TypeTraits.h:42
OpenACCAtomicKind
ExprDependenceScope::ExprDependence ExprDependence
IfStatementKind
In an if statement, this denotes whether the statement is a constexpr or consteval if statement.
Definition Specifiers.h:39
ExprObjectKind
A further classification of the kind of object referenced by an l-value or x-value.
Definition Specifiers.h:149
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
Definition Specifiers.h:123
SmallVector< Attr *, 4 > AttrVec
AttrVec - A vector of Attr, which is how they are stored on the AST.
nullptr
This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...
CapturedRegionKind
The different kinds of captured statement.
OpenACCComputeConstruct(OpenACCDirectiveKind K, SourceLocation Start, SourceLocation DirectiveLoc, SourceLocation End, ArrayRef< const OpenACCClause * > Clauses, Stmt *StructuredBlock)
UnaryExprOrTypeTrait
Names for the "expression or type" traits.
Definition TypeTraits.h:51
std::pair< SourceLocation, StringRef > ConstraintSubstitutionDiagnostic
Unsatisfied constraint expressions if the template arguments could be substituted into them,...
Definition ASTConcept.h:40
CastKind
CastKind - The kind of operation required for a conversion.
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
Definition OpenMPKinds.h:25
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
Definition Specifiers.h:132
U cast(CodeGen::Address addr)
Definition Address.h:327
@ Implicit
An implicit conversion.
Definition Sema.h:440
CharacterLiteralKind
Definition Expr.h:1606
unsigned long uint64_t
static ASTConstraintSatisfaction * Create(const ASTContext &C, const ConstraintSatisfaction &Satisfaction)
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
void initializeFrom(SourceLocation TemplateKWLoc, const TemplateArgumentListInfo &List, TemplateArgumentLoc *OutArgArray)
Expr * CounterUpdate
Updater for the internal counter: ++CounterVD;.
Definition ExprOpenMP.h:121
Expr * Upper
Normalized upper bound.
Definition ExprOpenMP.h:116
Expr * Update
Update expression for the originally specified iteration variable, calculated as VD = Begin + Counter...
Definition ExprOpenMP.h:119
VarDecl * CounterVD
Internal normalized counter.
Definition ExprOpenMP.h:113
A placeholder type used to construct an empty shell of a type, that will be filled in later (e....
Definition Stmt.h:1425