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