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