clang 19.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::VisitSYCLUniqueStableNameExpr(SYCLUniqueStableNameExpr *E) {
579 VisitExpr(E);
580
581 E->setLocation(readSourceLocation());
582 E->setLParenLocation(readSourceLocation());
583 E->setRParenLocation(readSourceLocation());
584
585 E->setTypeSourceInfo(Record.readTypeSourceInfo());
586}
587
588void ASTStmtReader::VisitPredefinedExpr(PredefinedExpr *E) {
589 VisitExpr(E);
590 bool HasFunctionName = Record.readInt();
591 E->PredefinedExprBits.HasFunctionName = HasFunctionName;
592 E->PredefinedExprBits.Kind = Record.readInt();
593 E->PredefinedExprBits.IsTransparent = Record.readInt();
594 E->setLocation(readSourceLocation());
595 if (HasFunctionName)
596 E->setFunctionName(cast<StringLiteral>(Record.readSubExpr()));
597}
598
599void ASTStmtReader::VisitDeclRefExpr(DeclRefExpr *E) {
600 VisitExpr(E);
601
602 CurrentUnpackingBits.emplace(Record.readInt());
603 E->DeclRefExprBits.HadMultipleCandidates = CurrentUnpackingBits->getNextBit();
604 E->DeclRefExprBits.RefersToEnclosingVariableOrCapture =
605 CurrentUnpackingBits->getNextBit();
606 E->DeclRefExprBits.NonOdrUseReason =
607 CurrentUnpackingBits->getNextBits(/*Width=*/2);
608 E->DeclRefExprBits.IsImmediateEscalating = CurrentUnpackingBits->getNextBit();
609 E->DeclRefExprBits.HasFoundDecl = CurrentUnpackingBits->getNextBit();
610 E->DeclRefExprBits.HasQualifier = CurrentUnpackingBits->getNextBit();
611 E->DeclRefExprBits.HasTemplateKWAndArgsInfo =
612 CurrentUnpackingBits->getNextBit();
613 E->DeclRefExprBits.CapturedByCopyInLambdaWithExplicitObjectParameter = false;
614 unsigned NumTemplateArgs = 0;
616 NumTemplateArgs = Record.readInt();
617
618 if (E->hasQualifier())
619 new (E->getTrailingObjects<NestedNameSpecifierLoc>())
620 NestedNameSpecifierLoc(Record.readNestedNameSpecifierLoc());
621
622 if (E->hasFoundDecl())
623 *E->getTrailingObjects<NamedDecl *>() = readDeclAs<NamedDecl>();
624
627 *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
628 E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs);
629
630 E->D = readDeclAs<ValueDecl>();
631 E->setLocation(readSourceLocation());
632 E->DNLoc = Record.readDeclarationNameLoc(E->getDecl()->getDeclName());
633}
634
635void ASTStmtReader::VisitIntegerLiteral(IntegerLiteral *E) {
636 VisitExpr(E);
637 E->setLocation(readSourceLocation());
638 E->setValue(Record.getContext(), Record.readAPInt());
639}
640
641void ASTStmtReader::VisitFixedPointLiteral(FixedPointLiteral *E) {
642 VisitExpr(E);
643 E->setLocation(readSourceLocation());
644 E->setScale(Record.readInt());
645 E->setValue(Record.getContext(), Record.readAPInt());
646}
647
648void ASTStmtReader::VisitFloatingLiteral(FloatingLiteral *E) {
649 VisitExpr(E);
651 static_cast<llvm::APFloatBase::Semantics>(Record.readInt()));
652 E->setExact(Record.readInt());
653 E->setValue(Record.getContext(), Record.readAPFloat(E->getSemantics()));
654 E->setLocation(readSourceLocation());
655}
656
657void ASTStmtReader::VisitImaginaryLiteral(ImaginaryLiteral *E) {
658 VisitExpr(E);
659 E->setSubExpr(Record.readSubExpr());
660}
661
662void ASTStmtReader::VisitStringLiteral(StringLiteral *E) {
663 VisitExpr(E);
664
665 // NumConcatenated, Length and CharByteWidth are set by the empty
666 // ctor since they are needed to allocate storage for the trailing objects.
667 unsigned NumConcatenated = Record.readInt();
668 unsigned Length = Record.readInt();
669 unsigned CharByteWidth = Record.readInt();
670 assert((NumConcatenated == E->getNumConcatenated()) &&
671 "Wrong number of concatenated tokens!");
672 assert((Length == E->getLength()) && "Wrong Length!");
673 assert((CharByteWidth == E->getCharByteWidth()) && "Wrong character width!");
674 E->StringLiteralBits.Kind = Record.readInt();
675 E->StringLiteralBits.IsPascal = Record.readInt();
676
677 // The character width is originally computed via mapCharByteWidth.
678 // Check that the deserialized character width is consistant with the result
679 // of calling mapCharByteWidth.
680 assert((CharByteWidth ==
681 StringLiteral::mapCharByteWidth(Record.getContext().getTargetInfo(),
682 E->getKind())) &&
683 "Wrong character width!");
684
685 // Deserialize the trailing array of SourceLocation.
686 for (unsigned I = 0; I < NumConcatenated; ++I)
687 E->setStrTokenLoc(I, readSourceLocation());
688
689 // Deserialize the trailing array of char holding the string data.
690 char *StrData = E->getStrDataAsChar();
691 for (unsigned I = 0; I < Length * CharByteWidth; ++I)
692 StrData[I] = Record.readInt();
693}
694
695void ASTStmtReader::VisitCharacterLiteral(CharacterLiteral *E) {
696 VisitExpr(E);
697 E->setValue(Record.readInt());
698 E->setLocation(readSourceLocation());
699 E->setKind(static_cast<CharacterLiteralKind>(Record.readInt()));
700}
701
702void ASTStmtReader::VisitParenExpr(ParenExpr *E) {
703 VisitExpr(E);
704 E->setLParen(readSourceLocation());
705 E->setRParen(readSourceLocation());
706 E->setSubExpr(Record.readSubExpr());
707}
708
709void ASTStmtReader::VisitParenListExpr(ParenListExpr *E) {
710 VisitExpr(E);
711 unsigned NumExprs = Record.readInt();
712 assert((NumExprs == E->getNumExprs()) && "Wrong NumExprs!");
713 for (unsigned I = 0; I != NumExprs; ++I)
714 E->getTrailingObjects<Stmt *>()[I] = Record.readSubStmt();
715 E->LParenLoc = readSourceLocation();
716 E->RParenLoc = readSourceLocation();
717}
718
719void ASTStmtReader::VisitUnaryOperator(UnaryOperator *E) {
720 VisitExpr(E);
721 bool hasFP_Features = CurrentUnpackingBits->getNextBit();
722 assert(hasFP_Features == E->hasStoredFPFeatures());
723 E->setSubExpr(Record.readSubExpr());
724 E->setOpcode(
725 (UnaryOperator::Opcode)CurrentUnpackingBits->getNextBits(/*Width=*/5));
726 E->setOperatorLoc(readSourceLocation());
727 E->setCanOverflow(CurrentUnpackingBits->getNextBit());
728 if (hasFP_Features)
731}
732
733void ASTStmtReader::VisitOffsetOfExpr(OffsetOfExpr *E) {
734 VisitExpr(E);
735 assert(E->getNumComponents() == Record.peekInt());
736 Record.skipInts(1);
737 assert(E->getNumExpressions() == Record.peekInt());
738 Record.skipInts(1);
739 E->setOperatorLoc(readSourceLocation());
740 E->setRParenLoc(readSourceLocation());
741 E->setTypeSourceInfo(readTypeSourceInfo());
742 for (unsigned I = 0, N = E->getNumComponents(); I != N; ++I) {
743 auto Kind = static_cast<OffsetOfNode::Kind>(Record.readInt());
744 SourceLocation Start = readSourceLocation();
745 SourceLocation End = readSourceLocation();
746 switch (Kind) {
748 E->setComponent(I, OffsetOfNode(Start, Record.readInt(), End));
749 break;
750
752 E->setComponent(
753 I, OffsetOfNode(Start, readDeclAs<FieldDecl>(), End));
754 break;
755
757 E->setComponent(
758 I,
759 OffsetOfNode(Start, Record.readIdentifier(), End));
760 break;
761
762 case OffsetOfNode::Base: {
763 auto *Base = new (Record.getContext()) CXXBaseSpecifier();
764 *Base = Record.readCXXBaseSpecifier();
766 break;
767 }
768 }
769 }
770
771 for (unsigned I = 0, N = E->getNumExpressions(); I != N; ++I)
772 E->setIndexExpr(I, Record.readSubExpr());
773}
774
775void ASTStmtReader::VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *E) {
776 VisitExpr(E);
777 E->setKind(static_cast<UnaryExprOrTypeTrait>(Record.readInt()));
778 if (Record.peekInt() == 0) {
779 E->setArgument(Record.readSubExpr());
780 Record.skipInts(1);
781 } else {
782 E->setArgument(readTypeSourceInfo());
783 }
784 E->setOperatorLoc(readSourceLocation());
785 E->setRParenLoc(readSourceLocation());
786}
787
790 ConstraintSatisfaction Satisfaction;
791 Satisfaction.IsSatisfied = Record.readInt();
792 Satisfaction.ContainsErrors = Record.readInt();
793 if (!Satisfaction.IsSatisfied) {
794 unsigned NumDetailRecords = Record.readInt();
795 for (unsigned i = 0; i != NumDetailRecords; ++i) {
796 Expr *ConstraintExpr = Record.readExpr();
797 if (/* IsDiagnostic */Record.readInt()) {
798 SourceLocation DiagLocation = Record.readSourceLocation();
799 std::string DiagMessage = Record.readString();
800 Satisfaction.Details.emplace_back(
801 ConstraintExpr, new (Record.getContext())
803 DiagLocation, DiagMessage});
804 } else
805 Satisfaction.Details.emplace_back(ConstraintExpr, Record.readExpr());
806 }
807 }
808 return Satisfaction;
809}
810
811void ASTStmtReader::VisitConceptSpecializationExpr(
813 VisitExpr(E);
814 E->SpecDecl = Record.readDeclAs<ImplicitConceptSpecializationDecl>();
815 if (Record.readBool())
816 E->ConceptRef = Record.readConceptReference();
817 E->Satisfaction = E->isValueDependent() ? nullptr :
820}
821
824 std::string SubstitutedEntity = Record.readString();
825 SourceLocation DiagLoc = Record.readSourceLocation();
826 std::string DiagMessage = Record.readString();
827 return new (Record.getContext())
828 concepts::Requirement::SubstitutionDiagnostic{SubstitutedEntity, DiagLoc,
829 DiagMessage};
830}
831
832void ASTStmtReader::VisitRequiresExpr(RequiresExpr *E) {
833 VisitExpr(E);
834 unsigned NumLocalParameters = Record.readInt();
835 unsigned NumRequirements = Record.readInt();
836 E->RequiresExprBits.RequiresKWLoc = Record.readSourceLocation();
837 E->RequiresExprBits.IsSatisfied = Record.readInt();
838 E->Body = Record.readDeclAs<RequiresExprBodyDecl>();
840 for (unsigned i = 0; i < NumLocalParameters; ++i)
841 LocalParameters.push_back(cast<ParmVarDecl>(Record.readDecl()));
842 std::copy(LocalParameters.begin(), LocalParameters.end(),
843 E->getTrailingObjects<ParmVarDecl *>());
845 for (unsigned i = 0; i < NumRequirements; ++i) {
846 auto RK =
847 static_cast<concepts::Requirement::RequirementKind>(Record.readInt());
848 concepts::Requirement *R = nullptr;
849 switch (RK) {
851 auto Status =
853 Record.readInt());
855 R = new (Record.getContext())
857 else
858 R = new (Record.getContext())
859 concepts::TypeRequirement(Record.readTypeSourceInfo());
860 } break;
863 auto Status =
865 Record.readInt());
867 Expr *> E;
870 } else
871 E = Record.readExpr();
872
873 std::optional<concepts::ExprRequirement::ReturnTypeRequirement> Req;
874 ConceptSpecializationExpr *SubstitutedConstraintExpr = nullptr;
875 SourceLocation NoexceptLoc;
877 Req.emplace();
878 } else {
879 NoexceptLoc = Record.readSourceLocation();
880 switch (/* returnTypeRequirementKind */Record.readInt()) {
881 case 0:
882 // No return type requirement.
883 Req.emplace();
884 break;
885 case 1: {
886 // type-constraint
887 TemplateParameterList *TPL = Record.readTemplateParameterList();
888 if (Status >=
890 SubstitutedConstraintExpr =
891 cast<ConceptSpecializationExpr>(Record.readExpr());
892 Req.emplace(TPL);
893 } break;
894 case 2:
895 // Substitution failure
897 break;
898 }
899 }
900 if (Expr *Ex = E.dyn_cast<Expr *>())
901 R = new (Record.getContext()) concepts::ExprRequirement(
902 Ex, RK == concepts::Requirement::RK_Simple, NoexceptLoc,
903 std::move(*Req), Status, SubstitutedConstraintExpr);
904 else
905 R = new (Record.getContext()) concepts::ExprRequirement(
907 RK == concepts::Requirement::RK_Simple, NoexceptLoc,
908 std::move(*Req));
909 } break;
911 bool HasInvalidConstraint = Record.readInt();
912 if (HasInvalidConstraint) {
913 std::string InvalidConstraint = Record.readString();
914 char *InvalidConstraintBuf =
915 new (Record.getContext()) char[InvalidConstraint.size()];
916 std::copy(InvalidConstraint.begin(), InvalidConstraint.end(),
917 InvalidConstraintBuf);
918 R = new (Record.getContext()) concepts::NestedRequirement(
919 Record.getContext(),
920 StringRef(InvalidConstraintBuf, InvalidConstraint.size()),
922 break;
923 }
924 Expr *E = Record.readExpr();
926 R = new (Record.getContext()) concepts::NestedRequirement(E);
927 else
928 R = new (Record.getContext())
929 concepts::NestedRequirement(Record.getContext(), E,
931 } break;
932 }
933 if (!R)
934 continue;
935 Requirements.push_back(R);
936 }
937 std::copy(Requirements.begin(), Requirements.end(),
938 E->getTrailingObjects<concepts::Requirement *>());
939 E->LParenLoc = Record.readSourceLocation();
940 E->RParenLoc = Record.readSourceLocation();
941 E->RBraceLoc = Record.readSourceLocation();
942}
943
944void ASTStmtReader::VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
945 VisitExpr(E);
946 E->setLHS(Record.readSubExpr());
947 E->setRHS(Record.readSubExpr());
948 E->setRBracketLoc(readSourceLocation());
949}
950
951void ASTStmtReader::VisitMatrixSubscriptExpr(MatrixSubscriptExpr *E) {
952 VisitExpr(E);
953 E->setBase(Record.readSubExpr());
954 E->setRowIdx(Record.readSubExpr());
955 E->setColumnIdx(Record.readSubExpr());
956 E->setRBracketLoc(readSourceLocation());
957}
958
959void ASTStmtReader::VisitArraySectionExpr(ArraySectionExpr *E) {
960 VisitExpr(E);
961 E->ASType = Record.readEnum<ArraySectionExpr::ArraySectionType>();
962
963 E->setBase(Record.readSubExpr());
964 E->setLowerBound(Record.readSubExpr());
965 E->setLength(Record.readSubExpr());
966
967 if (E->isOMPArraySection())
968 E->setStride(Record.readSubExpr());
969
970 E->setColonLocFirst(readSourceLocation());
971
972 if (E->isOMPArraySection())
973 E->setColonLocSecond(readSourceLocation());
974
975 E->setRBracketLoc(readSourceLocation());
976}
977
978void ASTStmtReader::VisitOMPArrayShapingExpr(OMPArrayShapingExpr *E) {
979 VisitExpr(E);
980 unsigned NumDims = Record.readInt();
981 E->setBase(Record.readSubExpr());
982 SmallVector<Expr *, 4> Dims(NumDims);
983 for (unsigned I = 0; I < NumDims; ++I)
984 Dims[I] = Record.readSubExpr();
985 E->setDimensions(Dims);
986 SmallVector<SourceRange, 4> SRs(NumDims);
987 for (unsigned I = 0; I < NumDims; ++I)
988 SRs[I] = readSourceRange();
989 E->setBracketsRanges(SRs);
990 E->setLParenLoc(readSourceLocation());
991 E->setRParenLoc(readSourceLocation());
992}
993
994void ASTStmtReader::VisitOMPIteratorExpr(OMPIteratorExpr *E) {
995 VisitExpr(E);
996 unsigned NumIters = Record.readInt();
997 E->setIteratorKwLoc(readSourceLocation());
998 E->setLParenLoc(readSourceLocation());
999 E->setRParenLoc(readSourceLocation());
1000 for (unsigned I = 0; I < NumIters; ++I) {
1001 E->setIteratorDeclaration(I, Record.readDeclRef());
1002 E->setAssignmentLoc(I, readSourceLocation());
1003 Expr *Begin = Record.readSubExpr();
1004 Expr *End = Record.readSubExpr();
1005 Expr *Step = Record.readSubExpr();
1006 SourceLocation ColonLoc = readSourceLocation();
1007 SourceLocation SecColonLoc;
1008 if (Step)
1009 SecColonLoc = readSourceLocation();
1010 E->setIteratorRange(I, Begin, ColonLoc, End, SecColonLoc, Step);
1011 // Deserialize helpers
1013 HD.CounterVD = cast_or_null<VarDecl>(Record.readDeclRef());
1014 HD.Upper = Record.readSubExpr();
1015 HD.Update = Record.readSubExpr();
1016 HD.CounterUpdate = Record.readSubExpr();
1017 E->setHelper(I, HD);
1018 }
1019}
1020
1021void ASTStmtReader::VisitCallExpr(CallExpr *E) {
1022 VisitExpr(E);
1023
1024 unsigned NumArgs = Record.readInt();
1025 CurrentUnpackingBits.emplace(Record.readInt());
1026 E->setADLCallKind(
1027 static_cast<CallExpr::ADLCallKind>(CurrentUnpackingBits->getNextBit()));
1028 bool HasFPFeatures = CurrentUnpackingBits->getNextBit();
1029 assert((NumArgs == E->getNumArgs()) && "Wrong NumArgs!");
1030 E->setRParenLoc(readSourceLocation());
1031 E->setCallee(Record.readSubExpr());
1032 for (unsigned I = 0; I != NumArgs; ++I)
1033 E->setArg(I, Record.readSubExpr());
1034
1035 if (HasFPFeatures)
1038}
1039
1040void ASTStmtReader::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) {
1041 VisitCallExpr(E);
1042}
1043
1044void ASTStmtReader::VisitMemberExpr(MemberExpr *E) {
1045 VisitExpr(E);
1046
1047 CurrentUnpackingBits.emplace(Record.readInt());
1048 bool HasQualifier = CurrentUnpackingBits->getNextBit();
1049 bool HasFoundDecl = CurrentUnpackingBits->getNextBit();
1050 bool HasTemplateInfo = CurrentUnpackingBits->getNextBit();
1051 unsigned NumTemplateArgs = Record.readInt();
1052
1053 E->Base = Record.readSubExpr();
1054 E->MemberDecl = Record.readDeclAs<ValueDecl>();
1055 E->MemberDNLoc = Record.readDeclarationNameLoc(E->MemberDecl->getDeclName());
1056 E->MemberLoc = Record.readSourceLocation();
1057 E->MemberExprBits.IsArrow = CurrentUnpackingBits->getNextBit();
1058 E->MemberExprBits.HasQualifier = HasQualifier;
1059 E->MemberExprBits.HasFoundDecl = HasFoundDecl;
1060 E->MemberExprBits.HasTemplateKWAndArgsInfo = HasTemplateInfo;
1061 E->MemberExprBits.HadMultipleCandidates = CurrentUnpackingBits->getNextBit();
1062 E->MemberExprBits.NonOdrUseReason =
1063 CurrentUnpackingBits->getNextBits(/*Width=*/2);
1064 E->MemberExprBits.OperatorLoc = Record.readSourceLocation();
1065
1066 if (HasQualifier)
1067 new (E->getTrailingObjects<NestedNameSpecifierLoc>())
1068 NestedNameSpecifierLoc(Record.readNestedNameSpecifierLoc());
1069
1070 if (HasFoundDecl) {
1071 auto *FoundD = Record.readDeclAs<NamedDecl>();
1072 auto AS = (AccessSpecifier)CurrentUnpackingBits->getNextBits(/*Width=*/2);
1073 *E->getTrailingObjects<DeclAccessPair>() = DeclAccessPair::make(FoundD, AS);
1074 }
1075
1076 if (HasTemplateInfo)
1078 *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
1079 E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs);
1080}
1081
1082void ASTStmtReader::VisitObjCIsaExpr(ObjCIsaExpr *E) {
1083 VisitExpr(E);
1084 E->setBase(Record.readSubExpr());
1085 E->setIsaMemberLoc(readSourceLocation());
1086 E->setOpLoc(readSourceLocation());
1087 E->setArrow(Record.readInt());
1088}
1089
1090void ASTStmtReader::
1091VisitObjCIndirectCopyRestoreExpr(ObjCIndirectCopyRestoreExpr *E) {
1092 VisitExpr(E);
1093 E->Operand = Record.readSubExpr();
1094 E->setShouldCopy(Record.readInt());
1095}
1096
1097void ASTStmtReader::VisitObjCBridgedCastExpr(ObjCBridgedCastExpr *E) {
1098 VisitExplicitCastExpr(E);
1099 E->LParenLoc = readSourceLocation();
1100 E->BridgeKeywordLoc = readSourceLocation();
1101 E->Kind = Record.readInt();
1102}
1103
1104void ASTStmtReader::VisitCastExpr(CastExpr *E) {
1105 VisitExpr(E);
1106 unsigned NumBaseSpecs = Record.readInt();
1107 assert(NumBaseSpecs == E->path_size());
1108
1109 CurrentUnpackingBits.emplace(Record.readInt());
1110 E->setCastKind((CastKind)CurrentUnpackingBits->getNextBits(/*Width=*/7));
1111 unsigned HasFPFeatures = CurrentUnpackingBits->getNextBit();
1112 assert(E->hasStoredFPFeatures() == HasFPFeatures);
1113
1114 E->setSubExpr(Record.readSubExpr());
1115
1117 while (NumBaseSpecs--) {
1118 auto *BaseSpec = new (Record.getContext()) CXXBaseSpecifier;
1119 *BaseSpec = Record.readCXXBaseSpecifier();
1120 *BaseI++ = BaseSpec;
1121 }
1122 if (HasFPFeatures)
1123 *E->getTrailingFPFeatures() =
1125}
1126
1127void ASTStmtReader::VisitBinaryOperator(BinaryOperator *E) {
1128 VisitExpr(E);
1129 CurrentUnpackingBits.emplace(Record.readInt());
1130 E->setOpcode(
1131 (BinaryOperator::Opcode)CurrentUnpackingBits->getNextBits(/*Width=*/6));
1132 bool hasFP_Features = CurrentUnpackingBits->getNextBit();
1133 E->setHasStoredFPFeatures(hasFP_Features);
1134 E->setLHS(Record.readSubExpr());
1135 E->setRHS(Record.readSubExpr());
1136 E->setOperatorLoc(readSourceLocation());
1137 if (hasFP_Features)
1140}
1141
1142void ASTStmtReader::VisitCompoundAssignOperator(CompoundAssignOperator *E) {
1143 VisitBinaryOperator(E);
1144 E->setComputationLHSType(Record.readType());
1145 E->setComputationResultType(Record.readType());
1146}
1147
1148void ASTStmtReader::VisitConditionalOperator(ConditionalOperator *E) {
1149 VisitExpr(E);
1150 E->SubExprs[ConditionalOperator::COND] = Record.readSubExpr();
1151 E->SubExprs[ConditionalOperator::LHS] = Record.readSubExpr();
1152 E->SubExprs[ConditionalOperator::RHS] = Record.readSubExpr();
1153 E->QuestionLoc = readSourceLocation();
1154 E->ColonLoc = readSourceLocation();
1155}
1156
1157void
1158ASTStmtReader::VisitBinaryConditionalOperator(BinaryConditionalOperator *E) {
1159 VisitExpr(E);
1160 E->OpaqueValue = cast<OpaqueValueExpr>(Record.readSubExpr());
1161 E->SubExprs[BinaryConditionalOperator::COMMON] = Record.readSubExpr();
1162 E->SubExprs[BinaryConditionalOperator::COND] = Record.readSubExpr();
1163 E->SubExprs[BinaryConditionalOperator::LHS] = Record.readSubExpr();
1164 E->SubExprs[BinaryConditionalOperator::RHS] = Record.readSubExpr();
1165 E->QuestionLoc = readSourceLocation();
1166 E->ColonLoc = readSourceLocation();
1167}
1168
1169void ASTStmtReader::VisitImplicitCastExpr(ImplicitCastExpr *E) {
1170 VisitCastExpr(E);
1171 E->setIsPartOfExplicitCast(CurrentUnpackingBits->getNextBit());
1172}
1173
1174void ASTStmtReader::VisitExplicitCastExpr(ExplicitCastExpr *E) {
1175 VisitCastExpr(E);
1176 E->setTypeInfoAsWritten(readTypeSourceInfo());
1177}
1178
1179void ASTStmtReader::VisitCStyleCastExpr(CStyleCastExpr *E) {
1180 VisitExplicitCastExpr(E);
1181 E->setLParenLoc(readSourceLocation());
1182 E->setRParenLoc(readSourceLocation());
1183}
1184
1185void ASTStmtReader::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
1186 VisitExpr(E);
1187 E->setLParenLoc(readSourceLocation());
1188 E->setTypeSourceInfo(readTypeSourceInfo());
1189 E->setInitializer(Record.readSubExpr());
1190 E->setFileScope(Record.readInt());
1191}
1192
1193void ASTStmtReader::VisitExtVectorElementExpr(ExtVectorElementExpr *E) {
1194 VisitExpr(E);
1195 E->setBase(Record.readSubExpr());
1196 E->setAccessor(Record.readIdentifier());
1197 E->setAccessorLoc(readSourceLocation());
1198}
1199
1200void ASTStmtReader::VisitInitListExpr(InitListExpr *E) {
1201 VisitExpr(E);
1202 if (auto *SyntForm = cast_or_null<InitListExpr>(Record.readSubStmt()))
1203 E->setSyntacticForm(SyntForm);
1204 E->setLBraceLoc(readSourceLocation());
1205 E->setRBraceLoc(readSourceLocation());
1206 bool isArrayFiller = Record.readInt();
1207 Expr *filler = nullptr;
1208 if (isArrayFiller) {
1209 filler = Record.readSubExpr();
1210 E->ArrayFillerOrUnionFieldInit = filler;
1211 } else
1212 E->ArrayFillerOrUnionFieldInit = readDeclAs<FieldDecl>();
1213 E->sawArrayRangeDesignator(Record.readInt());
1214 unsigned NumInits = Record.readInt();
1215 E->reserveInits(Record.getContext(), NumInits);
1216 if (isArrayFiller) {
1217 for (unsigned I = 0; I != NumInits; ++I) {
1218 Expr *init = Record.readSubExpr();
1219 E->updateInit(Record.getContext(), I, init ? init : filler);
1220 }
1221 } else {
1222 for (unsigned I = 0; I != NumInits; ++I)
1223 E->updateInit(Record.getContext(), I, Record.readSubExpr());
1224 }
1225}
1226
1227void ASTStmtReader::VisitDesignatedInitExpr(DesignatedInitExpr *E) {
1229
1230 VisitExpr(E);
1231 unsigned NumSubExprs = Record.readInt();
1232 assert(NumSubExprs == E->getNumSubExprs() && "Wrong number of subexprs");
1233 for (unsigned I = 0; I != NumSubExprs; ++I)
1234 E->setSubExpr(I, Record.readSubExpr());
1235 E->setEqualOrColonLoc(readSourceLocation());
1236 E->setGNUSyntax(Record.readInt());
1237
1238 SmallVector<Designator, 4> Designators;
1239 while (Record.getIdx() < Record.size()) {
1240 switch ((DesignatorTypes)Record.readInt()) {
1241 case DESIG_FIELD_DECL: {
1242 auto *Field = readDeclAs<FieldDecl>();
1243 SourceLocation DotLoc = readSourceLocation();
1244 SourceLocation FieldLoc = readSourceLocation();
1245 Designators.push_back(Designator::CreateFieldDesignator(
1246 Field->getIdentifier(), DotLoc, FieldLoc));
1247 Designators.back().setFieldDecl(Field);
1248 break;
1249 }
1250
1251 case DESIG_FIELD_NAME: {
1252 const IdentifierInfo *Name = Record.readIdentifier();
1253 SourceLocation DotLoc = readSourceLocation();
1254 SourceLocation FieldLoc = readSourceLocation();
1255 Designators.push_back(Designator::CreateFieldDesignator(Name, DotLoc,
1256 FieldLoc));
1257 break;
1258 }
1259
1260 case DESIG_ARRAY: {
1261 unsigned Index = Record.readInt();
1262 SourceLocation LBracketLoc = readSourceLocation();
1263 SourceLocation RBracketLoc = readSourceLocation();
1264 Designators.push_back(Designator::CreateArrayDesignator(Index,
1265 LBracketLoc,
1266 RBracketLoc));
1267 break;
1268 }
1269
1270 case DESIG_ARRAY_RANGE: {
1271 unsigned Index = Record.readInt();
1272 SourceLocation LBracketLoc = readSourceLocation();
1273 SourceLocation EllipsisLoc = readSourceLocation();
1274 SourceLocation RBracketLoc = readSourceLocation();
1275 Designators.push_back(Designator::CreateArrayRangeDesignator(
1276 Index, LBracketLoc, EllipsisLoc, RBracketLoc));
1277 break;
1278 }
1279 }
1280 }
1281 E->setDesignators(Record.getContext(),
1282 Designators.data(), Designators.size());
1283}
1284
1285void ASTStmtReader::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) {
1286 VisitExpr(E);
1287 E->setBase(Record.readSubExpr());
1288 E->setUpdater(Record.readSubExpr());
1289}
1290
1291void ASTStmtReader::VisitNoInitExpr(NoInitExpr *E) {
1292 VisitExpr(E);
1293}
1294
1295void ASTStmtReader::VisitArrayInitLoopExpr(ArrayInitLoopExpr *E) {
1296 VisitExpr(E);
1297 E->SubExprs[0] = Record.readSubExpr();
1298 E->SubExprs[1] = Record.readSubExpr();
1299}
1300
1301void ASTStmtReader::VisitArrayInitIndexExpr(ArrayInitIndexExpr *E) {
1302 VisitExpr(E);
1303}
1304
1305void ASTStmtReader::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) {
1306 VisitExpr(E);
1307}
1308
1309void ASTStmtReader::VisitVAArgExpr(VAArgExpr *E) {
1310 VisitExpr(E);
1311 E->setSubExpr(Record.readSubExpr());
1312 E->setWrittenTypeInfo(readTypeSourceInfo());
1313 E->setBuiltinLoc(readSourceLocation());
1314 E->setRParenLoc(readSourceLocation());
1315 E->setIsMicrosoftABI(Record.readInt());
1316}
1317
1318void ASTStmtReader::VisitSourceLocExpr(SourceLocExpr *E) {
1319 VisitExpr(E);
1320 E->ParentContext = readDeclAs<DeclContext>();
1321 E->BuiltinLoc = readSourceLocation();
1322 E->RParenLoc = readSourceLocation();
1323 E->SourceLocExprBits.Kind = Record.readInt();
1324}
1325
1326void ASTStmtReader::VisitAddrLabelExpr(AddrLabelExpr *E) {
1327 VisitExpr(E);
1328 E->setAmpAmpLoc(readSourceLocation());
1329 E->setLabelLoc(readSourceLocation());
1330 E->setLabel(readDeclAs<LabelDecl>());
1331}
1332
1333void ASTStmtReader::VisitStmtExpr(StmtExpr *E) {
1334 VisitExpr(E);
1335 E->setLParenLoc(readSourceLocation());
1336 E->setRParenLoc(readSourceLocation());
1337 E->setSubStmt(cast_or_null<CompoundStmt>(Record.readSubStmt()));
1338 E->StmtExprBits.TemplateDepth = Record.readInt();
1339}
1340
1341void ASTStmtReader::VisitChooseExpr(ChooseExpr *E) {
1342 VisitExpr(E);
1343 E->setCond(Record.readSubExpr());
1344 E->setLHS(Record.readSubExpr());
1345 E->setRHS(Record.readSubExpr());
1346 E->setBuiltinLoc(readSourceLocation());
1347 E->setRParenLoc(readSourceLocation());
1348 E->setIsConditionTrue(Record.readInt());
1349}
1350
1351void ASTStmtReader::VisitGNUNullExpr(GNUNullExpr *E) {
1352 VisitExpr(E);
1353 E->setTokenLocation(readSourceLocation());
1354}
1355
1356void ASTStmtReader::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
1357 VisitExpr(E);
1359 unsigned NumExprs = Record.readInt();
1360 while (NumExprs--)
1361 Exprs.push_back(Record.readSubExpr());
1362 E->setExprs(Record.getContext(), Exprs);
1363 E->setBuiltinLoc(readSourceLocation());
1364 E->setRParenLoc(readSourceLocation());
1365}
1366
1367void ASTStmtReader::VisitConvertVectorExpr(ConvertVectorExpr *E) {
1368 VisitExpr(E);
1369 E->BuiltinLoc = readSourceLocation();
1370 E->RParenLoc = readSourceLocation();
1371 E->TInfo = readTypeSourceInfo();
1372 E->SrcExpr = Record.readSubExpr();
1373}
1374
1375void ASTStmtReader::VisitBlockExpr(BlockExpr *E) {
1376 VisitExpr(E);
1377 E->setBlockDecl(readDeclAs<BlockDecl>());
1378}
1379
1380void ASTStmtReader::VisitGenericSelectionExpr(GenericSelectionExpr *E) {
1381 VisitExpr(E);
1382
1383 unsigned NumAssocs = Record.readInt();
1384 assert(NumAssocs == E->getNumAssocs() && "Wrong NumAssocs!");
1385 E->IsExprPredicate = Record.readInt();
1386 E->ResultIndex = Record.readInt();
1387 E->GenericSelectionExprBits.GenericLoc = readSourceLocation();
1388 E->DefaultLoc = readSourceLocation();
1389 E->RParenLoc = readSourceLocation();
1390
1391 Stmt **Stmts = E->getTrailingObjects<Stmt *>();
1392 // Add 1 to account for the controlling expression which is the first
1393 // expression in the trailing array of Stmt *. This is not needed for
1394 // the trailing array of TypeSourceInfo *.
1395 for (unsigned I = 0, N = NumAssocs + 1; I < N; ++I)
1396 Stmts[I] = Record.readSubExpr();
1397
1398 TypeSourceInfo **TSIs = E->getTrailingObjects<TypeSourceInfo *>();
1399 for (unsigned I = 0, N = NumAssocs; I < N; ++I)
1400 TSIs[I] = readTypeSourceInfo();
1401}
1402
1403void ASTStmtReader::VisitPseudoObjectExpr(PseudoObjectExpr *E) {
1404 VisitExpr(E);
1405 unsigned numSemanticExprs = Record.readInt();
1406 assert(numSemanticExprs + 1 == E->PseudoObjectExprBits.NumSubExprs);
1407 E->PseudoObjectExprBits.ResultIndex = Record.readInt();
1408
1409 // Read the syntactic expression.
1410 E->getSubExprsBuffer()[0] = Record.readSubExpr();
1411
1412 // Read all the semantic expressions.
1413 for (unsigned i = 0; i != numSemanticExprs; ++i) {
1414 Expr *subExpr = Record.readSubExpr();
1415 E->getSubExprsBuffer()[i+1] = subExpr;
1416 }
1417}
1418
1419void ASTStmtReader::VisitAtomicExpr(AtomicExpr *E) {
1420 VisitExpr(E);
1421 E->Op = AtomicExpr::AtomicOp(Record.readInt());
1422 E->NumSubExprs = AtomicExpr::getNumSubExprs(E->Op);
1423 for (unsigned I = 0; I != E->NumSubExprs; ++I)
1424 E->SubExprs[I] = Record.readSubExpr();
1425 E->BuiltinLoc = readSourceLocation();
1426 E->RParenLoc = readSourceLocation();
1427}
1428
1429//===----------------------------------------------------------------------===//
1430// Objective-C Expressions and Statements
1431
1432void ASTStmtReader::VisitObjCStringLiteral(ObjCStringLiteral *E) {
1433 VisitExpr(E);
1434 E->setString(cast<StringLiteral>(Record.readSubStmt()));
1435 E->setAtLoc(readSourceLocation());
1436}
1437
1438void ASTStmtReader::VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
1439 VisitExpr(E);
1440 // could be one of several IntegerLiteral, FloatLiteral, etc.
1441 E->SubExpr = Record.readSubStmt();
1442 E->BoxingMethod = readDeclAs<ObjCMethodDecl>();
1443 E->Range = readSourceRange();
1444}
1445
1446void ASTStmtReader::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
1447 VisitExpr(E);
1448 unsigned NumElements = Record.readInt();
1449 assert(NumElements == E->getNumElements() && "Wrong number of elements");
1450 Expr **Elements = E->getElements();
1451 for (unsigned I = 0, N = NumElements; I != N; ++I)
1452 Elements[I] = Record.readSubExpr();
1453 E->ArrayWithObjectsMethod = readDeclAs<ObjCMethodDecl>();
1454 E->Range = readSourceRange();
1455}
1456
1457void ASTStmtReader::VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *E) {
1458 VisitExpr(E);
1459 unsigned NumElements = Record.readInt();
1460 assert(NumElements == E->getNumElements() && "Wrong number of elements");
1461 bool HasPackExpansions = Record.readInt();
1462 assert(HasPackExpansions == E->HasPackExpansions &&"Pack expansion mismatch");
1463 auto *KeyValues =
1464 E->getTrailingObjects<ObjCDictionaryLiteral::KeyValuePair>();
1465 auto *Expansions =
1466 E->getTrailingObjects<ObjCDictionaryLiteral::ExpansionData>();
1467 for (unsigned I = 0; I != NumElements; ++I) {
1468 KeyValues[I].Key = Record.readSubExpr();
1469 KeyValues[I].Value = Record.readSubExpr();
1470 if (HasPackExpansions) {
1471 Expansions[I].EllipsisLoc = readSourceLocation();
1472 Expansions[I].NumExpansionsPlusOne = Record.readInt();
1473 }
1474 }
1475 E->DictWithObjectsMethod = readDeclAs<ObjCMethodDecl>();
1476 E->Range = readSourceRange();
1477}
1478
1479void ASTStmtReader::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
1480 VisitExpr(E);
1481 E->setEncodedTypeSourceInfo(readTypeSourceInfo());
1482 E->setAtLoc(readSourceLocation());
1483 E->setRParenLoc(readSourceLocation());
1484}
1485
1486void ASTStmtReader::VisitObjCSelectorExpr(ObjCSelectorExpr *E) {
1487 VisitExpr(E);
1488 E->setSelector(Record.readSelector());
1489 E->setAtLoc(readSourceLocation());
1490 E->setRParenLoc(readSourceLocation());
1491}
1492
1493void ASTStmtReader::VisitObjCProtocolExpr(ObjCProtocolExpr *E) {
1494 VisitExpr(E);
1495 E->setProtocol(readDeclAs<ObjCProtocolDecl>());
1496 E->setAtLoc(readSourceLocation());
1497 E->ProtoLoc = readSourceLocation();
1498 E->setRParenLoc(readSourceLocation());
1499}
1500
1501void ASTStmtReader::VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) {
1502 VisitExpr(E);
1503 E->setDecl(readDeclAs<ObjCIvarDecl>());
1504 E->setLocation(readSourceLocation());
1505 E->setOpLoc(readSourceLocation());
1506 E->setBase(Record.readSubExpr());
1507 E->setIsArrow(Record.readInt());
1508 E->setIsFreeIvar(Record.readInt());
1509}
1510
1511void ASTStmtReader::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
1512 VisitExpr(E);
1513 unsigned MethodRefFlags = Record.readInt();
1514 bool Implicit = Record.readInt() != 0;
1515 if (Implicit) {
1516 auto *Getter = readDeclAs<ObjCMethodDecl>();
1517 auto *Setter = readDeclAs<ObjCMethodDecl>();
1518 E->setImplicitProperty(Getter, Setter, MethodRefFlags);
1519 } else {
1520 E->setExplicitProperty(readDeclAs<ObjCPropertyDecl>(), MethodRefFlags);
1521 }
1522 E->setLocation(readSourceLocation());
1523 E->setReceiverLocation(readSourceLocation());
1524 switch (Record.readInt()) {
1525 case 0:
1526 E->setBase(Record.readSubExpr());
1527 break;
1528 case 1:
1529 E->setSuperReceiver(Record.readType());
1530 break;
1531 case 2:
1532 E->setClassReceiver(readDeclAs<ObjCInterfaceDecl>());
1533 break;
1534 }
1535}
1536
1537void ASTStmtReader::VisitObjCSubscriptRefExpr(ObjCSubscriptRefExpr *E) {
1538 VisitExpr(E);
1539 E->setRBracket(readSourceLocation());
1540 E->setBaseExpr(Record.readSubExpr());
1541 E->setKeyExpr(Record.readSubExpr());
1542 E->GetAtIndexMethodDecl = readDeclAs<ObjCMethodDecl>();
1543 E->SetAtIndexMethodDecl = readDeclAs<ObjCMethodDecl>();
1544}
1545
1546void ASTStmtReader::VisitObjCMessageExpr(ObjCMessageExpr *E) {
1547 VisitExpr(E);
1548 assert(Record.peekInt() == E->getNumArgs());
1549 Record.skipInts(1);
1550 unsigned NumStoredSelLocs = Record.readInt();
1551 E->SelLocsKind = Record.readInt();
1552 E->setDelegateInitCall(Record.readInt());
1553 E->IsImplicit = Record.readInt();
1554 auto Kind = static_cast<ObjCMessageExpr::ReceiverKind>(Record.readInt());
1555 switch (Kind) {
1557 E->setInstanceReceiver(Record.readSubExpr());
1558 break;
1559
1561 E->setClassReceiver(readTypeSourceInfo());
1562 break;
1563
1566 QualType T = Record.readType();
1567 SourceLocation SuperLoc = readSourceLocation();
1568 E->setSuper(SuperLoc, T, Kind == ObjCMessageExpr::SuperInstance);
1569 break;
1570 }
1571 }
1572
1573 assert(Kind == E->getReceiverKind());
1574
1575 if (Record.readInt())
1576 E->setMethodDecl(readDeclAs<ObjCMethodDecl>());
1577 else
1578 E->setSelector(Record.readSelector());
1579
1580 E->LBracLoc = readSourceLocation();
1581 E->RBracLoc = readSourceLocation();
1582
1583 for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1584 E->setArg(I, Record.readSubExpr());
1585
1586 SourceLocation *Locs = E->getStoredSelLocs();
1587 for (unsigned I = 0; I != NumStoredSelLocs; ++I)
1588 Locs[I] = readSourceLocation();
1589}
1590
1591void ASTStmtReader::VisitObjCForCollectionStmt(ObjCForCollectionStmt *S) {
1592 VisitStmt(S);
1593 S->setElement(Record.readSubStmt());
1594 S->setCollection(Record.readSubExpr());
1595 S->setBody(Record.readSubStmt());
1596 S->setForLoc(readSourceLocation());
1597 S->setRParenLoc(readSourceLocation());
1598}
1599
1600void ASTStmtReader::VisitObjCAtCatchStmt(ObjCAtCatchStmt *S) {
1601 VisitStmt(S);
1602 S->setCatchBody(Record.readSubStmt());
1603 S->setCatchParamDecl(readDeclAs<VarDecl>());
1604 S->setAtCatchLoc(readSourceLocation());
1605 S->setRParenLoc(readSourceLocation());
1606}
1607
1608void ASTStmtReader::VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S) {
1609 VisitStmt(S);
1610 S->setFinallyBody(Record.readSubStmt());
1611 S->setAtFinallyLoc(readSourceLocation());
1612}
1613
1614void ASTStmtReader::VisitObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S) {
1615 VisitStmt(S); // FIXME: no test coverage.
1616 S->setSubStmt(Record.readSubStmt());
1617 S->setAtLoc(readSourceLocation());
1618}
1619
1620void ASTStmtReader::VisitObjCAtTryStmt(ObjCAtTryStmt *S) {
1621 VisitStmt(S);
1622 assert(Record.peekInt() == S->getNumCatchStmts());
1623 Record.skipInts(1);
1624 bool HasFinally = Record.readInt();
1625 S->setTryBody(Record.readSubStmt());
1626 for (unsigned I = 0, N = S->getNumCatchStmts(); I != N; ++I)
1627 S->setCatchStmt(I, cast_or_null<ObjCAtCatchStmt>(Record.readSubStmt()));
1628
1629 if (HasFinally)
1630 S->setFinallyStmt(Record.readSubStmt());
1631 S->setAtTryLoc(readSourceLocation());
1632}
1633
1634void ASTStmtReader::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
1635 VisitStmt(S); // FIXME: no test coverage.
1636 S->setSynchExpr(Record.readSubStmt());
1637 S->setSynchBody(Record.readSubStmt());
1638 S->setAtSynchronizedLoc(readSourceLocation());
1639}
1640
1641void ASTStmtReader::VisitObjCAtThrowStmt(ObjCAtThrowStmt *S) {
1642 VisitStmt(S); // FIXME: no test coverage.
1643 S->setThrowExpr(Record.readSubStmt());
1644 S->setThrowLoc(readSourceLocation());
1645}
1646
1647void ASTStmtReader::VisitObjCBoolLiteralExpr(ObjCBoolLiteralExpr *E) {
1648 VisitExpr(E);
1649 E->setValue(Record.readInt());
1650 E->setLocation(readSourceLocation());
1651}
1652
1653void ASTStmtReader::VisitObjCAvailabilityCheckExpr(ObjCAvailabilityCheckExpr *E) {
1654 VisitExpr(E);
1655 SourceRange R = Record.readSourceRange();
1656 E->AtLoc = R.getBegin();
1657 E->RParen = R.getEnd();
1658 E->VersionToCheck = Record.readVersionTuple();
1659}
1660
1661//===----------------------------------------------------------------------===//
1662// C++ Expressions and Statements
1663//===----------------------------------------------------------------------===//
1664
1665void ASTStmtReader::VisitCXXCatchStmt(CXXCatchStmt *S) {
1666 VisitStmt(S);
1667 S->CatchLoc = readSourceLocation();
1668 S->ExceptionDecl = readDeclAs<VarDecl>();
1669 S->HandlerBlock = Record.readSubStmt();
1670}
1671
1672void ASTStmtReader::VisitCXXTryStmt(CXXTryStmt *S) {
1673 VisitStmt(S);
1674 assert(Record.peekInt() == S->getNumHandlers() && "NumStmtFields is wrong ?");
1675 Record.skipInts(1);
1676 S->TryLoc = readSourceLocation();
1677 S->getStmts()[0] = Record.readSubStmt();
1678 for (unsigned i = 0, e = S->getNumHandlers(); i != e; ++i)
1679 S->getStmts()[i + 1] = Record.readSubStmt();
1680}
1681
1682void ASTStmtReader::VisitCXXForRangeStmt(CXXForRangeStmt *S) {
1683 VisitStmt(S);
1684 S->ForLoc = readSourceLocation();
1685 S->CoawaitLoc = readSourceLocation();
1686 S->ColonLoc = readSourceLocation();
1687 S->RParenLoc = readSourceLocation();
1688 S->setInit(Record.readSubStmt());
1689 S->setRangeStmt(Record.readSubStmt());
1690 S->setBeginStmt(Record.readSubStmt());
1691 S->setEndStmt(Record.readSubStmt());
1692 S->setCond(Record.readSubExpr());
1693 S->setInc(Record.readSubExpr());
1694 S->setLoopVarStmt(Record.readSubStmt());
1695 S->setBody(Record.readSubStmt());
1696}
1697
1698void ASTStmtReader::VisitMSDependentExistsStmt(MSDependentExistsStmt *S) {
1699 VisitStmt(S);
1700 S->KeywordLoc = readSourceLocation();
1701 S->IsIfExists = Record.readInt();
1702 S->QualifierLoc = Record.readNestedNameSpecifierLoc();
1703 S->NameInfo = Record.readDeclarationNameInfo();
1704 S->SubStmt = Record.readSubStmt();
1705}
1706
1707void ASTStmtReader::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
1708 VisitCallExpr(E);
1709 E->CXXOperatorCallExprBits.OperatorKind = Record.readInt();
1710 E->Range = Record.readSourceRange();
1711}
1712
1713void ASTStmtReader::VisitCXXRewrittenBinaryOperator(
1715 VisitExpr(E);
1716 E->CXXRewrittenBinaryOperatorBits.IsReversed = Record.readInt();
1717 E->SemanticForm = Record.readSubExpr();
1718}
1719
1720void ASTStmtReader::VisitCXXConstructExpr(CXXConstructExpr *E) {
1721 VisitExpr(E);
1722
1723 unsigned NumArgs = Record.readInt();
1724 assert((NumArgs == E->getNumArgs()) && "Wrong NumArgs!");
1725
1726 E->CXXConstructExprBits.Elidable = Record.readInt();
1727 E->CXXConstructExprBits.HadMultipleCandidates = Record.readInt();
1728 E->CXXConstructExprBits.ListInitialization = Record.readInt();
1729 E->CXXConstructExprBits.StdInitListInitialization = Record.readInt();
1730 E->CXXConstructExprBits.ZeroInitialization = Record.readInt();
1731 E->CXXConstructExprBits.ConstructionKind = Record.readInt();
1732 E->CXXConstructExprBits.IsImmediateEscalating = Record.readInt();
1733 E->CXXConstructExprBits.Loc = readSourceLocation();
1734 E->Constructor = readDeclAs<CXXConstructorDecl>();
1735 E->ParenOrBraceRange = readSourceRange();
1736
1737 for (unsigned I = 0; I != NumArgs; ++I)
1738 E->setArg(I, Record.readSubExpr());
1739}
1740
1741void ASTStmtReader::VisitCXXInheritedCtorInitExpr(CXXInheritedCtorInitExpr *E) {
1742 VisitExpr(E);
1743 E->Constructor = readDeclAs<CXXConstructorDecl>();
1744 E->Loc = readSourceLocation();
1745 E->ConstructsVirtualBase = Record.readInt();
1746 E->InheritedFromVirtualBase = Record.readInt();
1747}
1748
1749void ASTStmtReader::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
1750 VisitCXXConstructExpr(E);
1751 E->TSI = readTypeSourceInfo();
1752}
1753
1754void ASTStmtReader::VisitLambdaExpr(LambdaExpr *E) {
1755 VisitExpr(E);
1756 unsigned NumCaptures = Record.readInt();
1757 (void)NumCaptures;
1758 assert(NumCaptures == E->LambdaExprBits.NumCaptures);
1759 E->IntroducerRange = readSourceRange();
1760 E->LambdaExprBits.CaptureDefault = Record.readInt();
1761 E->CaptureDefaultLoc = readSourceLocation();
1762 E->LambdaExprBits.ExplicitParams = Record.readInt();
1763 E->LambdaExprBits.ExplicitResultType = Record.readInt();
1764 E->ClosingBrace = readSourceLocation();
1765
1766 // Read capture initializers.
1768 CEnd = E->capture_init_end();
1769 C != CEnd; ++C)
1770 *C = Record.readSubExpr();
1771
1772 // The body will be lazily deserialized when needed from the call operator
1773 // declaration.
1774}
1775
1776void
1777ASTStmtReader::VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E) {
1778 VisitExpr(E);
1779 E->SubExpr = Record.readSubExpr();
1780}
1781
1782void ASTStmtReader::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) {
1783 VisitExplicitCastExpr(E);
1784 SourceRange R = readSourceRange();
1785 E->Loc = R.getBegin();
1786 E->RParenLoc = R.getEnd();
1787 if (CurrentUnpackingBits->getNextBit())
1788 E->AngleBrackets = readSourceRange();
1789}
1790
1791void ASTStmtReader::VisitCXXStaticCastExpr(CXXStaticCastExpr *E) {
1792 return VisitCXXNamedCastExpr(E);
1793}
1794
1795void ASTStmtReader::VisitCXXDynamicCastExpr(CXXDynamicCastExpr *E) {
1796 return VisitCXXNamedCastExpr(E);
1797}
1798
1799void ASTStmtReader::VisitCXXReinterpretCastExpr(CXXReinterpretCastExpr *E) {
1800 return VisitCXXNamedCastExpr(E);
1801}
1802
1803void ASTStmtReader::VisitCXXAddrspaceCastExpr(CXXAddrspaceCastExpr *E) {
1804 return VisitCXXNamedCastExpr(E);
1805}
1806
1807void ASTStmtReader::VisitCXXConstCastExpr(CXXConstCastExpr *E) {
1808 return VisitCXXNamedCastExpr(E);
1809}
1810
1811void ASTStmtReader::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E) {
1812 VisitExplicitCastExpr(E);
1813 E->setLParenLoc(readSourceLocation());
1814 E->setRParenLoc(readSourceLocation());
1815}
1816
1817void ASTStmtReader::VisitBuiltinBitCastExpr(BuiltinBitCastExpr *E) {
1818 VisitExplicitCastExpr(E);
1819 E->KWLoc = readSourceLocation();
1820 E->RParenLoc = readSourceLocation();
1821}
1822
1823void ASTStmtReader::VisitUserDefinedLiteral(UserDefinedLiteral *E) {
1824 VisitCallExpr(E);
1825 E->UDSuffixLoc = readSourceLocation();
1826}
1827
1828void ASTStmtReader::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) {
1829 VisitExpr(E);
1830 E->setValue(Record.readInt());
1831 E->setLocation(readSourceLocation());
1832}
1833
1834void ASTStmtReader::VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E) {
1835 VisitExpr(E);
1836 E->setLocation(readSourceLocation());
1837}
1838
1839void ASTStmtReader::VisitCXXTypeidExpr(CXXTypeidExpr *E) {
1840 VisitExpr(E);
1841 E->setSourceRange(readSourceRange());
1842 if (E->isTypeOperand())
1843 E->Operand = readTypeSourceInfo();
1844 else
1845 E->Operand = Record.readSubExpr();
1846}
1847
1848void ASTStmtReader::VisitCXXThisExpr(CXXThisExpr *E) {
1849 VisitExpr(E);
1850 E->setLocation(readSourceLocation());
1851 E->setImplicit(Record.readInt());
1853}
1854
1855void ASTStmtReader::VisitCXXThrowExpr(CXXThrowExpr *E) {
1856 VisitExpr(E);
1857 E->CXXThrowExprBits.ThrowLoc = readSourceLocation();
1858 E->Operand = Record.readSubExpr();
1859 E->CXXThrowExprBits.IsThrownVariableInScope = Record.readInt();
1860}
1861
1862void ASTStmtReader::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
1863 VisitExpr(E);
1864 E->Param = readDeclAs<ParmVarDecl>();
1865 E->UsedContext = readDeclAs<DeclContext>();
1866 E->CXXDefaultArgExprBits.Loc = readSourceLocation();
1867 E->CXXDefaultArgExprBits.HasRewrittenInit = Record.readInt();
1868 if (E->CXXDefaultArgExprBits.HasRewrittenInit)
1869 *E->getTrailingObjects<Expr *>() = Record.readSubExpr();
1870}
1871
1872void ASTStmtReader::VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E) {
1873 VisitExpr(E);
1874 E->CXXDefaultInitExprBits.HasRewrittenInit = Record.readInt();
1875 E->Field = readDeclAs<FieldDecl>();
1876 E->UsedContext = readDeclAs<DeclContext>();
1877 E->CXXDefaultInitExprBits.Loc = readSourceLocation();
1878 if (E->CXXDefaultInitExprBits.HasRewrittenInit)
1879 *E->getTrailingObjects<Expr *>() = Record.readSubExpr();
1880}
1881
1882void ASTStmtReader::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
1883 VisitExpr(E);
1884 E->setTemporary(Record.readCXXTemporary());
1885 E->setSubExpr(Record.readSubExpr());
1886}
1887
1888void ASTStmtReader::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
1889 VisitExpr(E);
1890 E->TypeInfo = readTypeSourceInfo();
1891 E->CXXScalarValueInitExprBits.RParenLoc = readSourceLocation();
1892}
1893
1894void ASTStmtReader::VisitCXXNewExpr(CXXNewExpr *E) {
1895 VisitExpr(E);
1896
1897 bool IsArray = Record.readInt();
1898 bool HasInit = Record.readInt();
1899 unsigned NumPlacementArgs = Record.readInt();
1900 bool IsParenTypeId = Record.readInt();
1901
1902 E->CXXNewExprBits.IsGlobalNew = Record.readInt();
1903 E->CXXNewExprBits.ShouldPassAlignment = Record.readInt();
1904 E->CXXNewExprBits.UsualArrayDeleteWantsSize = Record.readInt();
1905 E->CXXNewExprBits.HasInitializer = Record.readInt();
1906 E->CXXNewExprBits.StoredInitializationStyle = Record.readInt();
1907
1908 assert((IsArray == E->isArray()) && "Wrong IsArray!");
1909 assert((HasInit == E->hasInitializer()) && "Wrong HasInit!");
1910 assert((NumPlacementArgs == E->getNumPlacementArgs()) &&
1911 "Wrong NumPlacementArgs!");
1912 assert((IsParenTypeId == E->isParenTypeId()) && "Wrong IsParenTypeId!");
1913 (void)IsArray;
1914 (void)HasInit;
1915 (void)NumPlacementArgs;
1916
1917 E->setOperatorNew(readDeclAs<FunctionDecl>());
1918 E->setOperatorDelete(readDeclAs<FunctionDecl>());
1919 E->AllocatedTypeInfo = readTypeSourceInfo();
1920 if (IsParenTypeId)
1921 E->getTrailingObjects<SourceRange>()[0] = readSourceRange();
1922 E->Range = readSourceRange();
1923 E->DirectInitRange = readSourceRange();
1924
1925 // Install all the subexpressions.
1927 N = E->raw_arg_end();
1928 I != N; ++I)
1929 *I = Record.readSubStmt();
1930}
1931
1932void ASTStmtReader::VisitCXXDeleteExpr(CXXDeleteExpr *E) {
1933 VisitExpr(E);
1934 E->CXXDeleteExprBits.GlobalDelete = Record.readInt();
1935 E->CXXDeleteExprBits.ArrayForm = Record.readInt();
1936 E->CXXDeleteExprBits.ArrayFormAsWritten = Record.readInt();
1937 E->CXXDeleteExprBits.UsualArrayDeleteWantsSize = Record.readInt();
1938 E->OperatorDelete = readDeclAs<FunctionDecl>();
1939 E->Argument = Record.readSubExpr();
1940 E->CXXDeleteExprBits.Loc = readSourceLocation();
1941}
1942
1943void ASTStmtReader::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
1944 VisitExpr(E);
1945
1946 E->Base = Record.readSubExpr();
1947 E->IsArrow = Record.readInt();
1948 E->OperatorLoc = readSourceLocation();
1949 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1950 E->ScopeType = readTypeSourceInfo();
1951 E->ColonColonLoc = readSourceLocation();
1952 E->TildeLoc = readSourceLocation();
1953
1954 IdentifierInfo *II = Record.readIdentifier();
1955 if (II)
1956 E->setDestroyedType(II, readSourceLocation());
1957 else
1958 E->setDestroyedType(readTypeSourceInfo());
1959}
1960
1961void ASTStmtReader::VisitExprWithCleanups(ExprWithCleanups *E) {
1962 VisitExpr(E);
1963
1964 unsigned NumObjects = Record.readInt();
1965 assert(NumObjects == E->getNumObjects());
1966 for (unsigned i = 0; i != NumObjects; ++i) {
1967 unsigned CleanupKind = Record.readInt();
1969 if (CleanupKind == COK_Block)
1970 Obj = readDeclAs<BlockDecl>();
1971 else if (CleanupKind == COK_CompoundLiteral)
1972 Obj = cast<CompoundLiteralExpr>(Record.readSubExpr());
1973 else
1974 llvm_unreachable("unexpected cleanup object type");
1975 E->getTrailingObjects<ExprWithCleanups::CleanupObject>()[i] = Obj;
1976 }
1977
1978 E->ExprWithCleanupsBits.CleanupsHaveSideEffects = Record.readInt();
1979 E->SubExpr = Record.readSubExpr();
1980}
1981
1982void ASTStmtReader::VisitCXXDependentScopeMemberExpr(
1984 VisitExpr(E);
1985
1986 unsigned NumTemplateArgs = Record.readInt();
1987 CurrentUnpackingBits.emplace(Record.readInt());
1988 bool HasTemplateKWAndArgsInfo = CurrentUnpackingBits->getNextBit();
1989 bool HasFirstQualifierFoundInScope = CurrentUnpackingBits->getNextBit();
1990
1991 assert((HasTemplateKWAndArgsInfo == E->hasTemplateKWAndArgsInfo()) &&
1992 "Wrong HasTemplateKWAndArgsInfo!");
1993 assert(
1994 (HasFirstQualifierFoundInScope == E->hasFirstQualifierFoundInScope()) &&
1995 "Wrong HasFirstQualifierFoundInScope!");
1996
1997 if (HasTemplateKWAndArgsInfo)
1999 *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
2000 E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs);
2001
2002 assert((NumTemplateArgs == E->getNumTemplateArgs()) &&
2003 "Wrong NumTemplateArgs!");
2004
2006 CurrentUnpackingBits->getNextBit();
2007
2008 E->BaseType = Record.readType();
2009 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
2010 // not ImplicitAccess
2011 if (CurrentUnpackingBits->getNextBit())
2012 E->Base = Record.readSubExpr();
2013 else
2014 E->Base = nullptr;
2015
2016 E->CXXDependentScopeMemberExprBits.OperatorLoc = readSourceLocation();
2017
2018 if (HasFirstQualifierFoundInScope)
2019 *E->getTrailingObjects<NamedDecl *>() = readDeclAs<NamedDecl>();
2020
2021 E->MemberNameInfo = Record.readDeclarationNameInfo();
2022}
2023
2024void
2025ASTStmtReader::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) {
2026 VisitExpr(E);
2027
2028 if (CurrentUnpackingBits->getNextBit()) // HasTemplateKWAndArgsInfo
2030 *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
2031 E->getTrailingObjects<TemplateArgumentLoc>(),
2032 /*NumTemplateArgs=*/CurrentUnpackingBits->getNextBits(/*Width=*/16));
2033
2034 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
2035 E->NameInfo = Record.readDeclarationNameInfo();
2036}
2037
2038void
2039ASTStmtReader::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E) {
2040 VisitExpr(E);
2041 assert(Record.peekInt() == E->getNumArgs() &&
2042 "Read wrong record during creation ?");
2043 Record.skipInts(1);
2044 for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
2045 E->setArg(I, Record.readSubExpr());
2046 E->TypeAndInitForm.setPointer(readTypeSourceInfo());
2047 E->setLParenLoc(readSourceLocation());
2048 E->setRParenLoc(readSourceLocation());
2049 E->TypeAndInitForm.setInt(Record.readInt());
2050}
2051
2052void ASTStmtReader::VisitOverloadExpr(OverloadExpr *E) {
2053 VisitExpr(E);
2054
2055 unsigned NumResults = Record.readInt();
2056 CurrentUnpackingBits.emplace(Record.readInt());
2057 bool HasTemplateKWAndArgsInfo = CurrentUnpackingBits->getNextBit();
2058 assert((E->getNumDecls() == NumResults) && "Wrong NumResults!");
2059 assert((E->hasTemplateKWAndArgsInfo() == HasTemplateKWAndArgsInfo) &&
2060 "Wrong HasTemplateKWAndArgsInfo!");
2061
2062 if (HasTemplateKWAndArgsInfo) {
2063 unsigned NumTemplateArgs = Record.readInt();
2066 NumTemplateArgs);
2067 assert((E->getNumTemplateArgs() == NumTemplateArgs) &&
2068 "Wrong NumTemplateArgs!");
2069 }
2070
2071 UnresolvedSet<8> Decls;
2072 for (unsigned I = 0; I != NumResults; ++I) {
2073 auto *D = readDeclAs<NamedDecl>();
2074 auto AS = (AccessSpecifier)Record.readInt();
2075 Decls.addDecl(D, AS);
2076 }
2077
2078 DeclAccessPair *Results = E->getTrailingResults();
2080 for (unsigned I = 0; I != NumResults; ++I) {
2081 Results[I] = (Iter + I).getPair();
2082 }
2083
2084 E->NameInfo = Record.readDeclarationNameInfo();
2085 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
2086}
2087
2088void ASTStmtReader::VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
2089 VisitOverloadExpr(E);
2090 E->UnresolvedMemberExprBits.IsArrow = CurrentUnpackingBits->getNextBit();
2091 E->UnresolvedMemberExprBits.HasUnresolvedUsing =
2092 CurrentUnpackingBits->getNextBit();
2093
2094 if (/*!isImplicitAccess=*/CurrentUnpackingBits->getNextBit())
2095 E->Base = Record.readSubExpr();
2096 else
2097 E->Base = nullptr;
2098
2099 E->OperatorLoc = readSourceLocation();
2100
2101 E->BaseType = Record.readType();
2102}
2103
2104void ASTStmtReader::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) {
2105 VisitOverloadExpr(E);
2106 E->UnresolvedLookupExprBits.RequiresADL = CurrentUnpackingBits->getNextBit();
2107 E->NamingClass = readDeclAs<CXXRecordDecl>();
2108}
2109
2110void ASTStmtReader::VisitTypeTraitExpr(TypeTraitExpr *E) {
2111 VisitExpr(E);
2112 E->TypeTraitExprBits.NumArgs = Record.readInt();
2113 E->TypeTraitExprBits.Kind = Record.readInt();
2114 E->TypeTraitExprBits.Value = Record.readInt();
2115 SourceRange Range = readSourceRange();
2116 E->Loc = Range.getBegin();
2117 E->RParenLoc = Range.getEnd();
2118
2119 auto **Args = E->getTrailingObjects<TypeSourceInfo *>();
2120 for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
2121 Args[I] = readTypeSourceInfo();
2122}
2123
2124void ASTStmtReader::VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E) {
2125 VisitExpr(E);
2126 E->ATT = (ArrayTypeTrait)Record.readInt();
2127 E->Value = (unsigned int)Record.readInt();
2128 SourceRange Range = readSourceRange();
2129 E->Loc = Range.getBegin();
2130 E->RParen = Range.getEnd();
2131 E->QueriedType = readTypeSourceInfo();
2132 E->Dimension = Record.readSubExpr();
2133}
2134
2135void ASTStmtReader::VisitExpressionTraitExpr(ExpressionTraitExpr *E) {
2136 VisitExpr(E);
2137 E->ET = (ExpressionTrait)Record.readInt();
2138 E->Value = (bool)Record.readInt();
2139 SourceRange Range = readSourceRange();
2140 E->QueriedExpression = Record.readSubExpr();
2141 E->Loc = Range.getBegin();
2142 E->RParen = Range.getEnd();
2143}
2144
2145void ASTStmtReader::VisitCXXNoexceptExpr(CXXNoexceptExpr *E) {
2146 VisitExpr(E);
2147 E->CXXNoexceptExprBits.Value = Record.readInt();
2148 E->Range = readSourceRange();
2149 E->Operand = Record.readSubExpr();
2150}
2151
2152void ASTStmtReader::VisitPackExpansionExpr(PackExpansionExpr *E) {
2153 VisitExpr(E);
2154 E->EllipsisLoc = readSourceLocation();
2155 E->NumExpansions = Record.readInt();
2156 E->Pattern = Record.readSubExpr();
2157}
2158
2159void ASTStmtReader::VisitSizeOfPackExpr(SizeOfPackExpr *E) {
2160 VisitExpr(E);
2161 unsigned NumPartialArgs = Record.readInt();
2162 E->OperatorLoc = readSourceLocation();
2163 E->PackLoc = readSourceLocation();
2164 E->RParenLoc = readSourceLocation();
2165 E->Pack = Record.readDeclAs<NamedDecl>();
2166 if (E->isPartiallySubstituted()) {
2167 assert(E->Length == NumPartialArgs);
2168 for (auto *I = E->getTrailingObjects<TemplateArgument>(),
2169 *E = I + NumPartialArgs;
2170 I != E; ++I)
2171 new (I) TemplateArgument(Record.readTemplateArgument());
2172 } else if (!E->isValueDependent()) {
2173 E->Length = Record.readInt();
2174 }
2175}
2176
2177void ASTStmtReader::VisitPackIndexingExpr(PackIndexingExpr *E) {
2178 VisitExpr(E);
2179 E->TransformedExpressions = Record.readInt();
2180 E->EllipsisLoc = readSourceLocation();
2181 E->RSquareLoc = readSourceLocation();
2182 E->SubExprs[0] = Record.readStmt();
2183 E->SubExprs[1] = Record.readStmt();
2184 auto **Exprs = E->getTrailingObjects<Expr *>();
2185 for (unsigned I = 0; I < E->TransformedExpressions; ++I)
2186 Exprs[I] = Record.readExpr();
2187}
2188
2189void ASTStmtReader::VisitSubstNonTypeTemplateParmExpr(
2191 VisitExpr(E);
2192 E->AssociatedDeclAndRef.setPointer(readDeclAs<Decl>());
2193 E->AssociatedDeclAndRef.setInt(CurrentUnpackingBits->getNextBit());
2194 E->Index = CurrentUnpackingBits->getNextBits(/*Width=*/12);
2195 if (CurrentUnpackingBits->getNextBit())
2196 E->PackIndex = Record.readInt();
2197 else
2198 E->PackIndex = 0;
2199 E->SubstNonTypeTemplateParmExprBits.NameLoc = readSourceLocation();
2200 E->Replacement = Record.readSubExpr();
2201}
2202
2203void ASTStmtReader::VisitSubstNonTypeTemplateParmPackExpr(
2205 VisitExpr(E);
2206 E->AssociatedDecl = readDeclAs<Decl>();
2207 E->Index = Record.readInt();
2208 TemplateArgument ArgPack = Record.readTemplateArgument();
2209 if (ArgPack.getKind() != TemplateArgument::Pack)
2210 return;
2211
2212 E->Arguments = ArgPack.pack_begin();
2213 E->NumArguments = ArgPack.pack_size();
2214 E->NameLoc = readSourceLocation();
2215}
2216
2217void ASTStmtReader::VisitFunctionParmPackExpr(FunctionParmPackExpr *E) {
2218 VisitExpr(E);
2219 E->NumParameters = Record.readInt();
2220 E->ParamPack = readDeclAs<ParmVarDecl>();
2221 E->NameLoc = readSourceLocation();
2222 auto **Parms = E->getTrailingObjects<VarDecl *>();
2223 for (unsigned i = 0, n = E->NumParameters; i != n; ++i)
2224 Parms[i] = readDeclAs<VarDecl>();
2225}
2226
2227void ASTStmtReader::VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E) {
2228 VisitExpr(E);
2229 bool HasMaterialzedDecl = Record.readInt();
2230 if (HasMaterialzedDecl)
2231 E->State = cast<LifetimeExtendedTemporaryDecl>(Record.readDecl());
2232 else
2233 E->State = Record.readSubExpr();
2234}
2235
2236void ASTStmtReader::VisitCXXFoldExpr(CXXFoldExpr *E) {
2237 VisitExpr(E);
2238 E->LParenLoc = readSourceLocation();
2239 E->EllipsisLoc = readSourceLocation();
2240 E->RParenLoc = readSourceLocation();
2241 E->NumExpansions = Record.readInt();
2242 E->SubExprs[0] = Record.readSubExpr();
2243 E->SubExprs[1] = Record.readSubExpr();
2244 E->SubExprs[2] = Record.readSubExpr();
2245 E->Opcode = (BinaryOperatorKind)Record.readInt();
2246}
2247
2248void ASTStmtReader::VisitCXXParenListInitExpr(CXXParenListInitExpr *E) {
2249 VisitExpr(E);
2250 unsigned ExpectedNumExprs = Record.readInt();
2251 assert(E->NumExprs == ExpectedNumExprs &&
2252 "expected number of expressions does not equal the actual number of "
2253 "serialized expressions.");
2254 E->NumUserSpecifiedExprs = Record.readInt();
2255 E->InitLoc = readSourceLocation();
2256 E->LParenLoc = readSourceLocation();
2257 E->RParenLoc = readSourceLocation();
2258 for (unsigned I = 0; I < ExpectedNumExprs; I++)
2259 E->getTrailingObjects<Expr *>()[I] = Record.readSubExpr();
2260
2261 bool HasArrayFillerOrUnionDecl = Record.readBool();
2262 if (HasArrayFillerOrUnionDecl) {
2263 bool HasArrayFiller = Record.readBool();
2264 if (HasArrayFiller) {
2265 E->setArrayFiller(Record.readSubExpr());
2266 } else {
2267 E->setInitializedFieldInUnion(readDeclAs<FieldDecl>());
2268 }
2269 }
2270 E->updateDependence();
2271}
2272
2273void ASTStmtReader::VisitOpaqueValueExpr(OpaqueValueExpr *E) {
2274 VisitExpr(E);
2275 E->SourceExpr = Record.readSubExpr();
2276 E->OpaqueValueExprBits.Loc = readSourceLocation();
2277 E->setIsUnique(Record.readInt());
2278}
2279
2280void ASTStmtReader::VisitTypoExpr(TypoExpr *E) {
2281 llvm_unreachable("Cannot read TypoExpr nodes");
2282}
2283
2284void ASTStmtReader::VisitRecoveryExpr(RecoveryExpr *E) {
2285 VisitExpr(E);
2286 unsigned NumArgs = Record.readInt();
2287 E->BeginLoc = readSourceLocation();
2288 E->EndLoc = readSourceLocation();
2289 assert((NumArgs + 0LL ==
2290 std::distance(E->children().begin(), E->children().end())) &&
2291 "Wrong NumArgs!");
2292 (void)NumArgs;
2293 for (Stmt *&Child : E->children())
2294 Child = Record.readSubStmt();
2295}
2296
2297//===----------------------------------------------------------------------===//
2298// Microsoft Expressions and Statements
2299//===----------------------------------------------------------------------===//
2300void ASTStmtReader::VisitMSPropertyRefExpr(MSPropertyRefExpr *E) {
2301 VisitExpr(E);
2302 E->IsArrow = (Record.readInt() != 0);
2303 E->BaseExpr = Record.readSubExpr();
2304 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
2305 E->MemberLoc = readSourceLocation();
2306 E->TheDecl = readDeclAs<MSPropertyDecl>();
2307}
2308
2309void ASTStmtReader::VisitMSPropertySubscriptExpr(MSPropertySubscriptExpr *E) {
2310 VisitExpr(E);
2311 E->setBase(Record.readSubExpr());
2312 E->setIdx(Record.readSubExpr());
2313 E->setRBracketLoc(readSourceLocation());
2314}
2315
2316void ASTStmtReader::VisitCXXUuidofExpr(CXXUuidofExpr *E) {
2317 VisitExpr(E);
2318 E->setSourceRange(readSourceRange());
2319 E->Guid = readDeclAs<MSGuidDecl>();
2320 if (E->isTypeOperand())
2321 E->Operand = readTypeSourceInfo();
2322 else
2323 E->Operand = Record.readSubExpr();
2324}
2325
2326void ASTStmtReader::VisitSEHLeaveStmt(SEHLeaveStmt *S) {
2327 VisitStmt(S);
2328 S->setLeaveLoc(readSourceLocation());
2329}
2330
2331void ASTStmtReader::VisitSEHExceptStmt(SEHExceptStmt *S) {
2332 VisitStmt(S);
2333 S->Loc = readSourceLocation();
2334 S->Children[SEHExceptStmt::FILTER_EXPR] = Record.readSubStmt();
2335 S->Children[SEHExceptStmt::BLOCK] = Record.readSubStmt();
2336}
2337
2338void ASTStmtReader::VisitSEHFinallyStmt(SEHFinallyStmt *S) {
2339 VisitStmt(S);
2340 S->Loc = readSourceLocation();
2341 S->Block = Record.readSubStmt();
2342}
2343
2344void ASTStmtReader::VisitSEHTryStmt(SEHTryStmt *S) {
2345 VisitStmt(S);
2346 S->IsCXXTry = Record.readInt();
2347 S->TryLoc = readSourceLocation();
2348 S->Children[SEHTryStmt::TRY] = Record.readSubStmt();
2349 S->Children[SEHTryStmt::HANDLER] = Record.readSubStmt();
2350}
2351
2352//===----------------------------------------------------------------------===//
2353// CUDA Expressions and Statements
2354//===----------------------------------------------------------------------===//
2355
2356void ASTStmtReader::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E) {
2357 VisitCallExpr(E);
2358 E->setPreArg(CUDAKernelCallExpr::CONFIG, Record.readSubExpr());
2359}
2360
2361//===----------------------------------------------------------------------===//
2362// OpenCL Expressions and Statements.
2363//===----------------------------------------------------------------------===//
2364void ASTStmtReader::VisitAsTypeExpr(AsTypeExpr *E) {
2365 VisitExpr(E);
2366 E->BuiltinLoc = readSourceLocation();
2367 E->RParenLoc = readSourceLocation();
2368 E->SrcExpr = Record.readSubExpr();
2369}
2370
2371//===----------------------------------------------------------------------===//
2372// OpenMP Directives.
2373//===----------------------------------------------------------------------===//
2374
2375void ASTStmtReader::VisitOMPCanonicalLoop(OMPCanonicalLoop *S) {
2376 VisitStmt(S);
2377 for (Stmt *&SubStmt : S->SubStmts)
2378 SubStmt = Record.readSubStmt();
2379}
2380
2381void ASTStmtReader::VisitOMPExecutableDirective(OMPExecutableDirective *E) {
2382 Record.readOMPChildren(E->Data);
2383 E->setLocStart(readSourceLocation());
2384 E->setLocEnd(readSourceLocation());
2386}
2387
2388void ASTStmtReader::VisitOMPLoopBasedDirective(OMPLoopBasedDirective *D) {
2389 VisitStmt(D);
2390 // Field CollapsedNum was read in ReadStmtFromStream.
2391 Record.skipInts(1);
2392 VisitOMPExecutableDirective(D);
2393}
2394
2395void ASTStmtReader::VisitOMPLoopDirective(OMPLoopDirective *D) {
2396 VisitOMPLoopBasedDirective(D);
2397}
2398
2399void ASTStmtReader::VisitOMPMetaDirective(OMPMetaDirective *D) {
2400 VisitStmt(D);
2401 // The NumClauses field was read in ReadStmtFromStream.
2402 Record.skipInts(1);
2403 VisitOMPExecutableDirective(D);
2404}
2405
2406void ASTStmtReader::VisitOMPParallelDirective(OMPParallelDirective *D) {
2407 VisitStmt(D);
2408 VisitOMPExecutableDirective(D);
2409 D->setHasCancel(Record.readBool());
2410}
2411
2412void ASTStmtReader::VisitOMPSimdDirective(OMPSimdDirective *D) {
2413 VisitOMPLoopDirective(D);
2414}
2415
2416void ASTStmtReader::VisitOMPLoopTransformationDirective(
2418 VisitOMPLoopBasedDirective(D);
2419 D->setNumGeneratedLoops(Record.readUInt32());
2420}
2421
2422void ASTStmtReader::VisitOMPTileDirective(OMPTileDirective *D) {
2423 VisitOMPLoopTransformationDirective(D);
2424}
2425
2426void ASTStmtReader::VisitOMPUnrollDirective(OMPUnrollDirective *D) {
2427 VisitOMPLoopTransformationDirective(D);
2428}
2429
2430void ASTStmtReader::VisitOMPForDirective(OMPForDirective *D) {
2431 VisitOMPLoopDirective(D);
2432 D->setHasCancel(Record.readBool());
2433}
2434
2435void ASTStmtReader::VisitOMPForSimdDirective(OMPForSimdDirective *D) {
2436 VisitOMPLoopDirective(D);
2437}
2438
2439void ASTStmtReader::VisitOMPSectionsDirective(OMPSectionsDirective *D) {
2440 VisitStmt(D);
2441 VisitOMPExecutableDirective(D);
2442 D->setHasCancel(Record.readBool());
2443}
2444
2445void ASTStmtReader::VisitOMPSectionDirective(OMPSectionDirective *D) {
2446 VisitStmt(D);
2447 VisitOMPExecutableDirective(D);
2448 D->setHasCancel(Record.readBool());
2449}
2450
2451void ASTStmtReader::VisitOMPScopeDirective(OMPScopeDirective *D) {
2452 VisitStmt(D);
2453 VisitOMPExecutableDirective(D);
2454}
2455
2456void ASTStmtReader::VisitOMPSingleDirective(OMPSingleDirective *D) {
2457 VisitStmt(D);
2458 VisitOMPExecutableDirective(D);
2459}
2460
2461void ASTStmtReader::VisitOMPMasterDirective(OMPMasterDirective *D) {
2462 VisitStmt(D);
2463 VisitOMPExecutableDirective(D);
2464}
2465
2466void ASTStmtReader::VisitOMPCriticalDirective(OMPCriticalDirective *D) {
2467 VisitStmt(D);
2468 VisitOMPExecutableDirective(D);
2469 D->DirName = Record.readDeclarationNameInfo();
2470}
2471
2472void ASTStmtReader::VisitOMPParallelForDirective(OMPParallelForDirective *D) {
2473 VisitOMPLoopDirective(D);
2474 D->setHasCancel(Record.readBool());
2475}
2476
2477void ASTStmtReader::VisitOMPParallelForSimdDirective(
2479 VisitOMPLoopDirective(D);
2480}
2481
2482void ASTStmtReader::VisitOMPParallelMasterDirective(
2484 VisitStmt(D);
2485 VisitOMPExecutableDirective(D);
2486}
2487
2488void ASTStmtReader::VisitOMPParallelMaskedDirective(
2490 VisitStmt(D);
2491 VisitOMPExecutableDirective(D);
2492}
2493
2494void ASTStmtReader::VisitOMPParallelSectionsDirective(
2496 VisitStmt(D);
2497 VisitOMPExecutableDirective(D);
2498 D->setHasCancel(Record.readBool());
2499}
2500
2501void ASTStmtReader::VisitOMPTaskDirective(OMPTaskDirective *D) {
2502 VisitStmt(D);
2503 VisitOMPExecutableDirective(D);
2504 D->setHasCancel(Record.readBool());
2505}
2506
2507void ASTStmtReader::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) {
2508 VisitStmt(D);
2509 VisitOMPExecutableDirective(D);
2510}
2511
2512void ASTStmtReader::VisitOMPBarrierDirective(OMPBarrierDirective *D) {
2513 VisitStmt(D);
2514 VisitOMPExecutableDirective(D);
2515}
2516
2517void ASTStmtReader::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) {
2518 VisitStmt(D);
2519 // The NumClauses field was read in ReadStmtFromStream.
2520 Record.skipInts(1);
2521 VisitOMPExecutableDirective(D);
2522}
2523
2524void ASTStmtReader::VisitOMPErrorDirective(OMPErrorDirective *D) {
2525 VisitStmt(D);
2526 // The NumClauses field was read in ReadStmtFromStream.
2527 Record.skipInts(1);
2528 VisitOMPExecutableDirective(D);
2529}
2530
2531void ASTStmtReader::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) {
2532 VisitStmt(D);
2533 VisitOMPExecutableDirective(D);
2534}
2535
2536void ASTStmtReader::VisitOMPFlushDirective(OMPFlushDirective *D) {
2537 VisitStmt(D);
2538 VisitOMPExecutableDirective(D);
2539}
2540
2541void ASTStmtReader::VisitOMPDepobjDirective(OMPDepobjDirective *D) {
2542 VisitStmt(D);
2543 VisitOMPExecutableDirective(D);
2544}
2545
2546void ASTStmtReader::VisitOMPScanDirective(OMPScanDirective *D) {
2547 VisitStmt(D);
2548 VisitOMPExecutableDirective(D);
2549}
2550
2551void ASTStmtReader::VisitOMPOrderedDirective(OMPOrderedDirective *D) {
2552 VisitStmt(D);
2553 VisitOMPExecutableDirective(D);
2554}
2555
2556void ASTStmtReader::VisitOMPAtomicDirective(OMPAtomicDirective *D) {
2557 VisitStmt(D);
2558 VisitOMPExecutableDirective(D);
2559 D->Flags.IsXLHSInRHSPart = Record.readBool() ? 1 : 0;
2560 D->Flags.IsPostfixUpdate = Record.readBool() ? 1 : 0;
2561 D->Flags.IsFailOnly = Record.readBool() ? 1 : 0;
2562}
2563
2564void ASTStmtReader::VisitOMPTargetDirective(OMPTargetDirective *D) {
2565 VisitStmt(D);
2566 VisitOMPExecutableDirective(D);
2567}
2568
2569void ASTStmtReader::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) {
2570 VisitStmt(D);
2571 VisitOMPExecutableDirective(D);
2572}
2573
2574void ASTStmtReader::VisitOMPTargetEnterDataDirective(
2576 VisitStmt(D);
2577 VisitOMPExecutableDirective(D);
2578}
2579
2580void ASTStmtReader::VisitOMPTargetExitDataDirective(
2582 VisitStmt(D);
2583 VisitOMPExecutableDirective(D);
2584}
2585
2586void ASTStmtReader::VisitOMPTargetParallelDirective(
2588 VisitStmt(D);
2589 VisitOMPExecutableDirective(D);
2590 D->setHasCancel(Record.readBool());
2591}
2592
2593void ASTStmtReader::VisitOMPTargetParallelForDirective(
2595 VisitOMPLoopDirective(D);
2596 D->setHasCancel(Record.readBool());
2597}
2598
2599void ASTStmtReader::VisitOMPTeamsDirective(OMPTeamsDirective *D) {
2600 VisitStmt(D);
2601 VisitOMPExecutableDirective(D);
2602}
2603
2604void ASTStmtReader::VisitOMPCancellationPointDirective(
2606 VisitStmt(D);
2607 VisitOMPExecutableDirective(D);
2608 D->setCancelRegion(Record.readEnum<OpenMPDirectiveKind>());
2609}
2610
2611void ASTStmtReader::VisitOMPCancelDirective(OMPCancelDirective *D) {
2612 VisitStmt(D);
2613 VisitOMPExecutableDirective(D);
2614 D->setCancelRegion(Record.readEnum<OpenMPDirectiveKind>());
2615}
2616
2617void ASTStmtReader::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) {
2618 VisitOMPLoopDirective(D);
2619 D->setHasCancel(Record.readBool());
2620}
2621
2622void ASTStmtReader::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) {
2623 VisitOMPLoopDirective(D);
2624}
2625
2626void ASTStmtReader::VisitOMPMasterTaskLoopDirective(
2628 VisitOMPLoopDirective(D);
2629 D->setHasCancel(Record.readBool());
2630}
2631
2632void ASTStmtReader::VisitOMPMaskedTaskLoopDirective(
2634 VisitOMPLoopDirective(D);
2635 D->setHasCancel(Record.readBool());
2636}
2637
2638void ASTStmtReader::VisitOMPMasterTaskLoopSimdDirective(
2640 VisitOMPLoopDirective(D);
2641}
2642
2643void ASTStmtReader::VisitOMPMaskedTaskLoopSimdDirective(
2645 VisitOMPLoopDirective(D);
2646}
2647
2648void ASTStmtReader::VisitOMPParallelMasterTaskLoopDirective(
2650 VisitOMPLoopDirective(D);
2651 D->setHasCancel(Record.readBool());
2652}
2653
2654void ASTStmtReader::VisitOMPParallelMaskedTaskLoopDirective(
2656 VisitOMPLoopDirective(D);
2657 D->setHasCancel(Record.readBool());
2658}
2659
2660void ASTStmtReader::VisitOMPParallelMasterTaskLoopSimdDirective(
2662 VisitOMPLoopDirective(D);
2663}
2664
2665void ASTStmtReader::VisitOMPParallelMaskedTaskLoopSimdDirective(
2667 VisitOMPLoopDirective(D);
2668}
2669
2670void ASTStmtReader::VisitOMPDistributeDirective(OMPDistributeDirective *D) {
2671 VisitOMPLoopDirective(D);
2672}
2673
2674void ASTStmtReader::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) {
2675 VisitStmt(D);
2676 VisitOMPExecutableDirective(D);
2677}
2678
2679void ASTStmtReader::VisitOMPDistributeParallelForDirective(
2681 VisitOMPLoopDirective(D);
2682 D->setHasCancel(Record.readBool());
2683}
2684
2685void ASTStmtReader::VisitOMPDistributeParallelForSimdDirective(
2687 VisitOMPLoopDirective(D);
2688}
2689
2690void ASTStmtReader::VisitOMPDistributeSimdDirective(
2692 VisitOMPLoopDirective(D);
2693}
2694
2695void ASTStmtReader::VisitOMPTargetParallelForSimdDirective(
2697 VisitOMPLoopDirective(D);
2698}
2699
2700void ASTStmtReader::VisitOMPTargetSimdDirective(OMPTargetSimdDirective *D) {
2701 VisitOMPLoopDirective(D);
2702}
2703
2704void ASTStmtReader::VisitOMPTeamsDistributeDirective(
2706 VisitOMPLoopDirective(D);
2707}
2708
2709void ASTStmtReader::VisitOMPTeamsDistributeSimdDirective(
2711 VisitOMPLoopDirective(D);
2712}
2713
2714void ASTStmtReader::VisitOMPTeamsDistributeParallelForSimdDirective(
2716 VisitOMPLoopDirective(D);
2717}
2718
2719void ASTStmtReader::VisitOMPTeamsDistributeParallelForDirective(
2721 VisitOMPLoopDirective(D);
2722 D->setHasCancel(Record.readBool());
2723}
2724
2725void ASTStmtReader::VisitOMPTargetTeamsDirective(OMPTargetTeamsDirective *D) {
2726 VisitStmt(D);
2727 VisitOMPExecutableDirective(D);
2728}
2729
2730void ASTStmtReader::VisitOMPTargetTeamsDistributeDirective(
2732 VisitOMPLoopDirective(D);
2733}
2734
2735void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForDirective(
2737 VisitOMPLoopDirective(D);
2738 D->setHasCancel(Record.readBool());
2739}
2740
2741void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
2743 VisitOMPLoopDirective(D);
2744}
2745
2746void ASTStmtReader::VisitOMPTargetTeamsDistributeSimdDirective(
2748 VisitOMPLoopDirective(D);
2749}
2750
2751void ASTStmtReader::VisitOMPInteropDirective(OMPInteropDirective *D) {
2752 VisitStmt(D);
2753 VisitOMPExecutableDirective(D);
2754}
2755
2756void ASTStmtReader::VisitOMPDispatchDirective(OMPDispatchDirective *D) {
2757 VisitStmt(D);
2758 VisitOMPExecutableDirective(D);
2759 D->setTargetCallLoc(Record.readSourceLocation());
2760}
2761
2762void ASTStmtReader::VisitOMPMaskedDirective(OMPMaskedDirective *D) {
2763 VisitStmt(D);
2764 VisitOMPExecutableDirective(D);
2765}
2766
2767void ASTStmtReader::VisitOMPGenericLoopDirective(OMPGenericLoopDirective *D) {
2768 VisitOMPLoopDirective(D);
2769}
2770
2771void ASTStmtReader::VisitOMPTeamsGenericLoopDirective(
2773 VisitOMPLoopDirective(D);
2774}
2775
2776void ASTStmtReader::VisitOMPTargetTeamsGenericLoopDirective(
2778 VisitOMPLoopDirective(D);
2779 D->setCanBeParallelFor(Record.readBool());
2780}
2781
2782void ASTStmtReader::VisitOMPParallelGenericLoopDirective(
2784 VisitOMPLoopDirective(D);
2785}
2786
2787void ASTStmtReader::VisitOMPTargetParallelGenericLoopDirective(
2789 VisitOMPLoopDirective(D);
2790}
2791
2792//===----------------------------------------------------------------------===//
2793// OpenACC Constructs/Directives.
2794//===----------------------------------------------------------------------===//
2795void ASTStmtReader::VisitOpenACCConstructStmt(OpenACCConstructStmt *S) {
2796 (void)Record.readInt();
2797 S->Kind = Record.readEnum<OpenACCDirectiveKind>();
2798 S->Range = Record.readSourceRange();
2799 Record.readOpenACCClauseList(S->Clauses);
2800}
2801
2802void ASTStmtReader::VisitOpenACCAssociatedStmtConstruct(
2804 VisitOpenACCConstructStmt(S);
2805 S->setAssociatedStmt(Record.readSubStmt());
2806}
2807
2808void ASTStmtReader::VisitOpenACCComputeConstruct(OpenACCComputeConstruct *S) {
2809 VisitStmt(S);
2810 VisitOpenACCAssociatedStmtConstruct(S);
2811}
2812
2813//===----------------------------------------------------------------------===//
2814// ASTReader Implementation
2815//===----------------------------------------------------------------------===//
2816
2818 switch (ReadingKind) {
2819 case Read_None:
2820 llvm_unreachable("should not call this when not reading anything");
2821 case Read_Decl:
2822 case Read_Type:
2823 return ReadStmtFromStream(F);
2824 case Read_Stmt:
2825 return ReadSubStmt();
2826 }
2827
2828 llvm_unreachable("ReadingKind not set ?");
2829}
2830
2832 return cast_or_null<Expr>(ReadStmt(F));
2833}
2834
2836 return cast_or_null<Expr>(ReadSubStmt());
2837}
2838
2839// Within the bitstream, expressions are stored in Reverse Polish
2840// Notation, with each of the subexpressions preceding the
2841// expression they are stored in. Subexpressions are stored from last to first.
2842// To evaluate expressions, we continue reading expressions and placing them on
2843// the stack, with expressions having operands removing those operands from the
2844// stack. Evaluation terminates when we see a STMT_STOP record, and
2845// the single remaining expression on the stack is our result.
2846Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) {
2847 ReadingKindTracker ReadingKind(Read_Stmt, *this);
2848 llvm::BitstreamCursor &Cursor = F.DeclsCursor;
2849
2850 // Map of offset to previously deserialized stmt. The offset points
2851 // just after the stmt record.
2852 llvm::DenseMap<uint64_t, Stmt *> StmtEntries;
2853
2854#ifndef NDEBUG
2855 unsigned PrevNumStmts = StmtStack.size();
2856#endif
2857
2858 ASTRecordReader Record(*this, F);
2859 ASTStmtReader Reader(Record, Cursor);
2860 Stmt::EmptyShell Empty;
2861
2862 while (true) {
2864 Cursor.advanceSkippingSubblocks();
2865 if (!MaybeEntry) {
2866 Error(toString(MaybeEntry.takeError()));
2867 return nullptr;
2868 }
2869 llvm::BitstreamEntry Entry = MaybeEntry.get();
2870
2871 switch (Entry.Kind) {
2872 case llvm::BitstreamEntry::SubBlock: // Handled for us already.
2873 case llvm::BitstreamEntry::Error:
2874 Error("malformed block record in AST file");
2875 return nullptr;
2876 case llvm::BitstreamEntry::EndBlock:
2877 goto Done;
2878 case llvm::BitstreamEntry::Record:
2879 // The interesting case.
2880 break;
2881 }
2882
2883 ASTContext &Context = getContext();
2884 Stmt *S = nullptr;
2885 bool Finished = false;
2886 bool IsStmtReference = false;
2887 Expected<unsigned> MaybeStmtCode = Record.readRecord(Cursor, Entry.ID);
2888 if (!MaybeStmtCode) {
2889 Error(toString(MaybeStmtCode.takeError()));
2890 return nullptr;
2891 }
2892 switch ((StmtCode)MaybeStmtCode.get()) {
2893 case STMT_STOP:
2894 Finished = true;
2895 break;
2896
2897 case STMT_REF_PTR:
2898 IsStmtReference = true;
2899 assert(StmtEntries.contains(Record[0]) &&
2900 "No stmt was recorded for this offset reference!");
2901 S = StmtEntries[Record.readInt()];
2902 break;
2903
2904 case STMT_NULL_PTR:
2905 S = nullptr;
2906 break;
2907
2908 case STMT_NULL:
2909 S = new (Context) NullStmt(Empty);
2910 break;
2911
2912 case STMT_COMPOUND: {
2913 unsigned NumStmts = Record[ASTStmtReader::NumStmtFields];
2914 bool HasFPFeatures = Record[ASTStmtReader::NumStmtFields + 1];
2915 S = CompoundStmt::CreateEmpty(Context, NumStmts, HasFPFeatures);
2916 break;
2917 }
2918
2919 case STMT_CASE:
2921 Context,
2922 /*CaseStmtIsGNURange*/ Record[ASTStmtReader::NumStmtFields + 3]);
2923 break;
2924
2925 case STMT_DEFAULT:
2926 S = new (Context) DefaultStmt(Empty);
2927 break;
2928
2929 case STMT_LABEL:
2930 S = new (Context) LabelStmt(Empty);
2931 break;
2932
2933 case STMT_ATTRIBUTED:
2935 Context,
2937 break;
2938
2939 case STMT_IF: {
2941 bool HasElse = IfStmtBits.getNextBit();
2942 bool HasVar = IfStmtBits.getNextBit();
2943 bool HasInit = IfStmtBits.getNextBit();
2944 S = IfStmt::CreateEmpty(Context, HasElse, HasVar, HasInit);
2945 break;
2946 }
2947
2948 case STMT_SWITCH:
2950 Context,
2952 /* HasVar=*/Record[ASTStmtReader::NumStmtFields + 1]);
2953 break;
2954
2955 case STMT_WHILE:
2957 Context,
2959 break;
2960
2961 case STMT_DO:
2962 S = new (Context) DoStmt(Empty);
2963 break;
2964
2965 case STMT_FOR:
2966 S = new (Context) ForStmt(Empty);
2967 break;
2968
2969 case STMT_GOTO:
2970 S = new (Context) GotoStmt(Empty);
2971 break;
2972
2973 case STMT_INDIRECT_GOTO:
2974 S = new (Context) IndirectGotoStmt(Empty);
2975 break;
2976
2977 case STMT_CONTINUE:
2978 S = new (Context) ContinueStmt(Empty);
2979 break;
2980
2981 case STMT_BREAK:
2982 S = new (Context) BreakStmt(Empty);
2983 break;
2984
2985 case STMT_RETURN:
2987 Context, /* HasNRVOCandidate=*/Record[ASTStmtReader::NumStmtFields]);
2988 break;
2989
2990 case STMT_DECL:
2991 S = new (Context) DeclStmt(Empty);
2992 break;
2993
2994 case STMT_GCCASM:
2995 S = new (Context) GCCAsmStmt(Empty);
2996 break;
2997
2998 case STMT_MSASM:
2999 S = new (Context) MSAsmStmt(Empty);
3000 break;
3001
3002 case STMT_CAPTURED:
3005 break;
3006
3007 case EXPR_CONSTANT:
3009 Context, static_cast<ConstantResultStorageKind>(
3010 /*StorageKind=*/Record[ASTStmtReader::NumExprFields]));
3011 break;
3012
3015 break;
3016
3017 case EXPR_PREDEFINED:
3019 Context,
3020 /*HasFunctionName*/ Record[ASTStmtReader::NumExprFields]);
3021 break;
3022
3023 case EXPR_DECL_REF: {
3025 DeclRefExprBits.advance(5);
3026 bool HasFoundDecl = DeclRefExprBits.getNextBit();
3027 bool HasQualifier = DeclRefExprBits.getNextBit();
3028 bool HasTemplateKWAndArgsInfo = DeclRefExprBits.getNextBit();
3029 unsigned NumTemplateArgs = HasTemplateKWAndArgsInfo
3031 : 0;
3032 S = DeclRefExpr::CreateEmpty(Context, HasQualifier, HasFoundDecl,
3033 HasTemplateKWAndArgsInfo, NumTemplateArgs);
3034 break;
3035 }
3036
3038 S = IntegerLiteral::Create(Context, Empty);
3039 break;
3040
3042 S = FixedPointLiteral::Create(Context, Empty);
3043 break;
3044
3046 S = FloatingLiteral::Create(Context, Empty);
3047 break;
3048
3050 S = new (Context) ImaginaryLiteral(Empty);
3051 break;
3052
3055 Context,
3056 /* NumConcatenated=*/Record[ASTStmtReader::NumExprFields],
3057 /* Length=*/Record[ASTStmtReader::NumExprFields + 1],
3058 /* CharByteWidth=*/Record[ASTStmtReader::NumExprFields + 2]);
3059 break;
3060
3062 S = new (Context) CharacterLiteral(Empty);
3063 break;
3064
3065 case EXPR_PAREN:
3066 S = new (Context) ParenExpr(Empty);
3067 break;
3068
3069 case EXPR_PAREN_LIST:
3071 Context,
3072 /* NumExprs=*/Record[ASTStmtReader::NumExprFields]);
3073 break;
3074
3075 case EXPR_UNARY_OPERATOR: {
3077 UnaryOperatorBits.advance(ASTStmtReader::NumExprBits);
3078 bool HasFPFeatures = UnaryOperatorBits.getNextBit();
3079 S = UnaryOperator::CreateEmpty(Context, HasFPFeatures);
3080 break;
3081 }
3082
3083 case EXPR_OFFSETOF:
3084 S = OffsetOfExpr::CreateEmpty(Context,
3087 break;
3088
3090 S = new (Context) UnaryExprOrTypeTraitExpr(Empty);
3091 break;
3092
3094 S = new (Context) ArraySubscriptExpr(Empty);
3095 break;
3096
3098 S = new (Context) MatrixSubscriptExpr(Empty);
3099 break;
3100
3101 case EXPR_ARRAY_SECTION:
3102 S = new (Context) ArraySectionExpr(Empty);
3103 break;
3104
3108 break;
3109
3110 case EXPR_OMP_ITERATOR:
3111 S = OMPIteratorExpr::CreateEmpty(Context,
3113 break;
3114
3115 case EXPR_CALL: {
3116 auto NumArgs = Record[ASTStmtReader::NumExprFields];
3118 CallExprBits.advance(1);
3119 auto HasFPFeatures = CallExprBits.getNextBit();
3120 S = CallExpr::CreateEmpty(Context, NumArgs, HasFPFeatures, Empty);
3121 break;
3122 }
3123
3124 case EXPR_RECOVERY:
3126 Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields]);
3127 break;
3128
3129 case EXPR_MEMBER: {
3131 bool HasQualifier = ExprMemberBits.getNextBit();
3132 bool HasFoundDecl = ExprMemberBits.getNextBit();
3133 bool HasTemplateInfo = ExprMemberBits.getNextBit();
3134 unsigned NumTemplateArgs = Record[ASTStmtReader::NumExprFields + 1];
3135 S = MemberExpr::CreateEmpty(Context, HasQualifier, HasFoundDecl,
3136 HasTemplateInfo, NumTemplateArgs);
3137 break;
3138 }
3139
3140 case EXPR_BINARY_OPERATOR: {
3142 BinaryOperatorBits.advance(/*Size of opcode*/ 6);
3143 bool HasFPFeatures = BinaryOperatorBits.getNextBit();
3144 S = BinaryOperator::CreateEmpty(Context, HasFPFeatures);
3145 break;
3146 }
3147
3150 BinaryOperatorBits.advance(/*Size of opcode*/ 6);
3151 bool HasFPFeatures = BinaryOperatorBits.getNextBit();
3152 S = CompoundAssignOperator::CreateEmpty(Context, HasFPFeatures);
3153 break;
3154 }
3155
3157 S = new (Context) ConditionalOperator(Empty);
3158 break;
3159
3161 S = new (Context) BinaryConditionalOperator(Empty);
3162 break;
3163
3164 case EXPR_IMPLICIT_CAST: {
3165 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
3167 CastExprBits.advance(7);
3168 bool HasFPFeatures = CastExprBits.getNextBit();
3169 S = ImplicitCastExpr::CreateEmpty(Context, PathSize, HasFPFeatures);
3170 break;
3171 }
3172
3173 case EXPR_CSTYLE_CAST: {
3174 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
3176 CastExprBits.advance(7);
3177 bool HasFPFeatures = CastExprBits.getNextBit();
3178 S = CStyleCastExpr::CreateEmpty(Context, PathSize, HasFPFeatures);
3179 break;
3180 }
3181
3183 S = new (Context) CompoundLiteralExpr(Empty);
3184 break;
3185
3187 S = new (Context) ExtVectorElementExpr(Empty);
3188 break;
3189
3190 case EXPR_INIT_LIST:
3191 S = new (Context) InitListExpr(Empty);
3192 break;
3193
3197
3198 break;
3199
3201 S = new (Context) DesignatedInitUpdateExpr(Empty);
3202 break;
3203
3205 S = new (Context) ImplicitValueInitExpr(Empty);
3206 break;
3207
3208 case EXPR_NO_INIT:
3209 S = new (Context) NoInitExpr(Empty);
3210 break;
3211
3213 S = new (Context) ArrayInitLoopExpr(Empty);
3214 break;
3215
3217 S = new (Context) ArrayInitIndexExpr(Empty);
3218 break;
3219
3220 case EXPR_VA_ARG:
3221 S = new (Context) VAArgExpr(Empty);
3222 break;
3223
3224 case EXPR_SOURCE_LOC:
3225 S = new (Context) SourceLocExpr(Empty);
3226 break;
3227
3228 case EXPR_ADDR_LABEL:
3229 S = new (Context) AddrLabelExpr(Empty);
3230 break;
3231
3232 case EXPR_STMT:
3233 S = new (Context) StmtExpr(Empty);
3234 break;
3235
3236 case EXPR_CHOOSE:
3237 S = new (Context) ChooseExpr(Empty);
3238 break;
3239
3240 case EXPR_GNU_NULL:
3241 S = new (Context) GNUNullExpr(Empty);
3242 break;
3243
3245 S = new (Context) ShuffleVectorExpr(Empty);
3246 break;
3247
3249 S = new (Context) ConvertVectorExpr(Empty);
3250 break;
3251
3252 case EXPR_BLOCK:
3253 S = new (Context) BlockExpr(Empty);
3254 break;
3255
3258 Context,
3259 /*NumAssocs=*/Record[ASTStmtReader::NumExprFields]);
3260 break;
3261
3263 S = new (Context) ObjCStringLiteral(Empty);
3264 break;
3265
3267 S = new (Context) ObjCBoxedExpr(Empty);
3268 break;
3269
3273 break;
3274
3279 break;
3280
3281 case EXPR_OBJC_ENCODE:
3282 S = new (Context) ObjCEncodeExpr(Empty);
3283 break;
3284
3286 S = new (Context) ObjCSelectorExpr(Empty);
3287 break;
3288
3290 S = new (Context) ObjCProtocolExpr(Empty);
3291 break;
3292
3294 S = new (Context) ObjCIvarRefExpr(Empty);
3295 break;
3296
3298 S = new (Context) ObjCPropertyRefExpr(Empty);
3299 break;
3300
3302 S = new (Context) ObjCSubscriptRefExpr(Empty);
3303 break;
3304
3306 llvm_unreachable("mismatching AST file");
3307
3309 S = ObjCMessageExpr::CreateEmpty(Context,
3312 break;
3313
3314 case EXPR_OBJC_ISA:
3315 S = new (Context) ObjCIsaExpr(Empty);
3316 break;
3317
3319 S = new (Context) ObjCIndirectCopyRestoreExpr(Empty);
3320 break;
3321
3323 S = new (Context) ObjCBridgedCastExpr(Empty);
3324 break;
3325
3327 S = new (Context) ObjCForCollectionStmt(Empty);
3328 break;
3329
3330 case STMT_OBJC_CATCH:
3331 S = new (Context) ObjCAtCatchStmt(Empty);
3332 break;
3333
3334 case STMT_OBJC_FINALLY:
3335 S = new (Context) ObjCAtFinallyStmt(Empty);
3336 break;
3337
3338 case STMT_OBJC_AT_TRY:
3339 S = ObjCAtTryStmt::CreateEmpty(Context,
3342 break;
3343
3345 S = new (Context) ObjCAtSynchronizedStmt(Empty);
3346 break;
3347
3348 case STMT_OBJC_AT_THROW:
3349 S = new (Context) ObjCAtThrowStmt(Empty);
3350 break;
3351
3353 S = new (Context) ObjCAutoreleasePoolStmt(Empty);
3354 break;
3355
3357 S = new (Context) ObjCBoolLiteralExpr(Empty);
3358 break;
3359
3361 S = new (Context) ObjCAvailabilityCheckExpr(Empty);
3362 break;
3363
3364 case STMT_SEH_LEAVE:
3365 S = new (Context) SEHLeaveStmt(Empty);
3366 break;
3367
3368 case STMT_SEH_EXCEPT:
3369 S = new (Context) SEHExceptStmt(Empty);
3370 break;
3371
3372 case STMT_SEH_FINALLY:
3373 S = new (Context) SEHFinallyStmt(Empty);
3374 break;
3375
3376 case STMT_SEH_TRY:
3377 S = new (Context) SEHTryStmt(Empty);
3378 break;
3379
3380 case STMT_CXX_CATCH:
3381 S = new (Context) CXXCatchStmt(Empty);
3382 break;
3383
3384 case STMT_CXX_TRY:
3385 S = CXXTryStmt::Create(Context, Empty,
3386 /*numHandlers=*/Record[ASTStmtReader::NumStmtFields]);
3387 break;
3388
3389 case STMT_CXX_FOR_RANGE:
3390 S = new (Context) CXXForRangeStmt(Empty);
3391 break;
3392
3394 S = new (Context) MSDependentExistsStmt(SourceLocation(), true,
3397 nullptr);
3398 break;
3399
3401 S = OMPCanonicalLoop::createEmpty(Context);
3402 break;
3403
3406 Context, Record[ASTStmtReader::NumStmtFields], Empty);
3407 break;
3408
3410 S =
3413 Empty);
3414 break;
3415
3417 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3418 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3419 S = OMPSimdDirective::CreateEmpty(Context, NumClauses,
3420 CollapsedNum, Empty);
3421 break;
3422 }
3423
3425 unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
3426 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3427 S = OMPTileDirective::CreateEmpty(Context, NumClauses, NumLoops);
3428 break;
3429 }
3430
3432 assert(Record[ASTStmtReader::NumStmtFields] == 1 && "Unroll directive accepts only a single loop");
3433 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3434 S = OMPUnrollDirective::CreateEmpty(Context, NumClauses);
3435 break;
3436 }
3437
3439 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3440 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3441 S = OMPForDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3442 Empty);
3443 break;
3444 }
3445
3447 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3448 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3449 S = OMPForSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3450 Empty);
3451 break;
3452 }
3453
3456 Context, Record[ASTStmtReader::NumStmtFields], Empty);
3457 break;
3458
3460 S = OMPSectionDirective::CreateEmpty(Context, Empty);
3461 break;
3462
3465 Context, Record[ASTStmtReader::NumStmtFields], Empty);
3466 break;
3467
3470 Context, Record[ASTStmtReader::NumStmtFields], Empty);
3471 break;
3472
3474 S = OMPMasterDirective::CreateEmpty(Context, Empty);
3475 break;
3476
3479 Context, Record[ASTStmtReader::NumStmtFields], Empty);
3480 break;
3481
3483 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3484 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3485 S = OMPParallelForDirective::CreateEmpty(Context, NumClauses,
3486 CollapsedNum, Empty);
3487 break;
3488 }
3489
3491 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3492 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3493 S = OMPParallelForSimdDirective::CreateEmpty(Context, NumClauses,
3494 CollapsedNum, Empty);
3495 break;
3496 }
3497
3500 Context, Record[ASTStmtReader::NumStmtFields], Empty);
3501 break;
3502
3505 Context, Record[ASTStmtReader::NumStmtFields], Empty);
3506 break;
3507
3510 Context, Record[ASTStmtReader::NumStmtFields], Empty);
3511 break;
3512
3515 Context, Record[ASTStmtReader::NumStmtFields], Empty);
3516 break;
3517
3519 S = OMPTaskyieldDirective::CreateEmpty(Context, Empty);
3520 break;
3521
3523 S = OMPBarrierDirective::CreateEmpty(Context, Empty);
3524 break;
3525
3528 Context, Record[ASTStmtReader::NumStmtFields], Empty);
3529 break;
3530
3533 Context, Record[ASTStmtReader::NumStmtFields], Empty);
3534 break;
3535
3538 Context, Record[ASTStmtReader::NumStmtFields], Empty);
3539 break;
3540
3543 Context, Record[ASTStmtReader::NumStmtFields], Empty);
3544 break;
3545
3548 Context, Record[ASTStmtReader::NumStmtFields], Empty);
3549 break;
3550
3553 Context, Record[ASTStmtReader::NumStmtFields], Empty);
3554 break;
3555
3557 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3558 bool HasAssociatedStmt = Record[ASTStmtReader::NumStmtFields + 2];
3559 S = OMPOrderedDirective::CreateEmpty(Context, NumClauses,
3560 !HasAssociatedStmt, Empty);
3561 break;
3562 }
3563
3566 Context, Record[ASTStmtReader::NumStmtFields], Empty);
3567 break;
3568
3571 Context, Record[ASTStmtReader::NumStmtFields], Empty);
3572 break;
3573
3576 Context, Record[ASTStmtReader::NumStmtFields], Empty);
3577 break;
3578
3581 Context, Record[ASTStmtReader::NumStmtFields], Empty);
3582 break;
3583
3586 Context, Record[ASTStmtReader::NumStmtFields], Empty);
3587 break;
3588
3591 Context, Record[ASTStmtReader::NumStmtFields], Empty);
3592 break;
3593
3595 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3596 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3597 S = OMPTargetParallelForDirective::CreateEmpty(Context, NumClauses,
3598 CollapsedNum, Empty);
3599 break;
3600 }
3601
3604 Context, Record[ASTStmtReader::NumStmtFields], Empty);
3605 break;
3606
3609 Context, Record[ASTStmtReader::NumStmtFields], Empty);
3610 break;
3611
3614 break;
3615
3618 Context, Record[ASTStmtReader::NumStmtFields], Empty);
3619 break;
3620
3622 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3623 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3624 S = OMPTaskLoopDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3625 Empty);
3626 break;
3627 }
3628
3630 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3631 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3632 S = OMPTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
3633 CollapsedNum, Empty);
3634 break;
3635 }
3636
3638 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3639 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3640 S = OMPMasterTaskLoopDirective::CreateEmpty(Context, NumClauses,
3641 CollapsedNum, Empty);
3642 break;
3643 }
3644
3646 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3647 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3648 S = OMPMaskedTaskLoopDirective::CreateEmpty(Context, NumClauses,
3649 CollapsedNum, Empty);
3650 break;
3651 }
3652
3654 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3655 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3656 S = OMPMasterTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
3657 CollapsedNum, Empty);
3658 break;
3659 }
3660
3662 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3663 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3664 S = OMPMaskedTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
3665 CollapsedNum, Empty);
3666 break;
3667 }
3668
3670 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3671 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3673 CollapsedNum, Empty);
3674 break;
3675 }
3676
3678 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3679 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3681 CollapsedNum, Empty);
3682 break;
3683 }
3684
3686 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3687 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3689 Context, NumClauses, CollapsedNum, Empty);
3690 break;
3691 }
3692
3694 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3695 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3697 Context, NumClauses, CollapsedNum, Empty);
3698 break;
3699 }
3700
3702 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3703 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3704 S = OMPDistributeDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3705 Empty);
3706 break;
3707 }
3708
3710 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3711 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3712 S = OMPDistributeParallelForDirective::CreateEmpty(Context, NumClauses,
3713 CollapsedNum, Empty);
3714 break;
3715 }
3716
3718 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3719 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3721 CollapsedNum,
3722 Empty);
3723 break;
3724 }
3725
3727 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3728 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3729 S = OMPDistributeSimdDirective::CreateEmpty(Context, NumClauses,
3730 CollapsedNum, Empty);
3731 break;
3732 }
3733
3735 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3736 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3737 S = OMPTargetParallelForSimdDirective::CreateEmpty(Context, NumClauses,
3738 CollapsedNum, Empty);
3739 break;
3740 }
3741
3743 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3744 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3745 S = OMPTargetSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3746 Empty);
3747 break;
3748 }
3749
3751 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3752 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3753 S = OMPTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
3754 CollapsedNum, Empty);
3755 break;
3756 }
3757
3759 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3760 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3761 S = OMPTeamsDistributeSimdDirective::CreateEmpty(Context, NumClauses,
3762 CollapsedNum, Empty);
3763 break;
3764 }
3765
3767 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3768 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3770 Context, NumClauses, CollapsedNum, Empty);
3771 break;
3772 }
3773
3775 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3776 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3778 Context, NumClauses, CollapsedNum, Empty);
3779 break;
3780 }
3781
3784 Context, Record[ASTStmtReader::NumStmtFields], Empty);
3785 break;
3786
3788 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3789 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3790 S = OMPTargetTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
3791 CollapsedNum, Empty);
3792 break;
3793 }
3794
3796 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3797 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3799 Context, NumClauses, CollapsedNum, Empty);
3800 break;
3801 }
3802
3804 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3805 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3807 Context, NumClauses, CollapsedNum, Empty);
3808 break;
3809 }
3810
3812 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3813 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3815 Context, NumClauses, CollapsedNum, Empty);
3816 break;
3817 }
3818
3821 Context, Record[ASTStmtReader::NumStmtFields], Empty);
3822 break;
3823
3826 Context, Record[ASTStmtReader::NumStmtFields], Empty);
3827 break;
3828
3831 Context, Record[ASTStmtReader::NumStmtFields], Empty);
3832 break;
3833
3835 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3836 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3837 S = OMPGenericLoopDirective::CreateEmpty(Context, NumClauses,
3838 CollapsedNum, Empty);
3839 break;
3840 }
3841
3843 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3844 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3845 S = OMPTeamsGenericLoopDirective::CreateEmpty(Context, NumClauses,
3846 CollapsedNum, Empty);
3847 break;
3848 }
3849
3851 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3852 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3854 CollapsedNum, Empty);
3855 break;
3856 }
3857
3859 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3860 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3861 S = OMPParallelGenericLoopDirective::CreateEmpty(Context, NumClauses,
3862 CollapsedNum, Empty);
3863 break;
3864 }
3865
3867 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3868 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3870 Context, NumClauses, CollapsedNum, Empty);
3871 break;
3872 }
3873
3875 auto NumArgs = Record[ASTStmtReader::NumExprFields];
3877 CallExprBits.advance(1);
3878 auto HasFPFeatures = CallExprBits.getNextBit();
3879 S = CXXOperatorCallExpr::CreateEmpty(Context, NumArgs, HasFPFeatures,
3880 Empty);
3881 break;
3882 }
3883
3884 case EXPR_CXX_MEMBER_CALL: {
3885 auto NumArgs = Record[ASTStmtReader::NumExprFields];
3887 CallExprBits.advance(1);
3888 auto HasFPFeatures = CallExprBits.getNextBit();
3889 S = CXXMemberCallExpr::CreateEmpty(Context, NumArgs, HasFPFeatures,
3890 Empty);
3891 break;
3892 }
3893
3895 S = new (Context) CXXRewrittenBinaryOperator(Empty);
3896 break;
3897
3898 case EXPR_CXX_CONSTRUCT:
3900 Context,
3901 /* NumArgs=*/Record[ASTStmtReader::NumExprFields]);
3902 break;
3903
3905 S = new (Context) CXXInheritedCtorInitExpr(Empty);
3906 break;
3907
3910 Context,
3911 /* NumArgs=*/Record[ASTStmtReader::NumExprFields]);
3912 break;
3913
3914 case EXPR_CXX_STATIC_CAST: {
3915 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
3917 CastExprBits.advance(7);
3918 bool HasFPFeatures = CastExprBits.getNextBit();
3919 S = CXXStaticCastExpr::CreateEmpty(Context, PathSize, HasFPFeatures);
3920 break;
3921 }
3922
3923 case EXPR_CXX_DYNAMIC_CAST: {
3924 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
3925 S = CXXDynamicCastExpr::CreateEmpty(Context, PathSize);
3926 break;
3927 }
3928
3930 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
3931 S = CXXReinterpretCastExpr::CreateEmpty(Context, PathSize);
3932 break;
3933 }
3934
3936 S = CXXConstCastExpr::CreateEmpty(Context);
3937 break;
3938
3941 break;
3942
3944 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
3946 CastExprBits.advance(7);
3947 bool HasFPFeatures = CastExprBits.getNextBit();
3948 S = CXXFunctionalCastExpr::CreateEmpty(Context, PathSize, HasFPFeatures);
3949 break;
3950 }
3951
3952 case EXPR_BUILTIN_BIT_CAST: {
3953#ifndef NDEBUG
3954 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
3955 assert(PathSize == 0 && "Wrong PathSize!");
3956#endif
3957 S = new (Context) BuiltinBitCastExpr(Empty);
3958 break;
3959 }
3960
3962 auto NumArgs = Record[ASTStmtReader::NumExprFields];
3964 CallExprBits.advance(1);
3965 auto HasFPFeatures = CallExprBits.getNextBit();
3966 S = UserDefinedLiteral::CreateEmpty(Context, NumArgs, HasFPFeatures,
3967 Empty);
3968 break;
3969 }
3970
3972 S = new (Context) CXXStdInitializerListExpr(Empty);
3973 break;
3974
3976 S = new (Context) CXXBoolLiteralExpr(Empty);
3977 break;
3978
3980 S = new (Context) CXXNullPtrLiteralExpr(Empty);
3981 break;
3982
3984 S = new (Context) CXXTypeidExpr(Empty, true);
3985 break;
3986
3988 S = new (Context) CXXTypeidExpr(Empty, false);
3989 break;
3990
3992 S = new (Context) CXXUuidofExpr(Empty, true);
3993 break;
3994
3996 S = new (Context) MSPropertyRefExpr(Empty);
3997 break;
3998
4000 S = new (Context) MSPropertySubscriptExpr(Empty);
4001 break;
4002
4004 S = new (Context) CXXUuidofExpr(Empty, false);
4005 break;
4006
4007 case EXPR_CXX_THIS:
4008 S = CXXThisExpr::CreateEmpty(Context);
4009 break;
4010
4011 case EXPR_CXX_THROW:
4012 S = new (Context) CXXThrowExpr(Empty);
4013 break;
4014
4017 Context, /*HasRewrittenInit=*/Record[ASTStmtReader::NumExprFields]);
4018 break;
4019
4022 Context, /*HasRewrittenInit=*/Record[ASTStmtReader::NumExprFields]);
4023 break;
4024
4026 S = new (Context) CXXBindTemporaryExpr(Empty);
4027 break;
4028
4030 S = new (Context) CXXScalarValueInitExpr(Empty);
4031 break;
4032
4033 case EXPR_CXX_NEW:
4035 Context,
4037 /*HasInit=*/Record[ASTStmtReader::NumExprFields + 1],
4038 /*NumPlacementArgs=*/Record[ASTStmtReader::NumExprFields + 2],
4039 /*IsParenTypeId=*/Record[ASTStmtReader::NumExprFields + 3]);
4040 break;
4041
4042 case EXPR_CXX_DELETE:
4043 S = new (Context) CXXDeleteExpr(Empty);
4044 break;
4045
4047 S = new (Context) CXXPseudoDestructorExpr(Empty);
4048 break;
4049
4051 S = ExprWithCleanups::Create(Context, Empty,
4053 break;
4054
4056 unsigned NumTemplateArgs = Record[ASTStmtReader::NumExprFields];
4057 BitsUnpacker DependentScopeMemberBits(
4059 bool HasTemplateKWAndArgsInfo = DependentScopeMemberBits.getNextBit();
4060
4061 bool HasFirstQualifierFoundInScope =
4062 DependentScopeMemberBits.getNextBit();
4064 Context, HasTemplateKWAndArgsInfo, NumTemplateArgs,
4065 HasFirstQualifierFoundInScope);
4066 break;
4067 }
4068
4070 BitsUnpacker DependentScopeDeclRefBits(
4072 DependentScopeDeclRefBits.advance(ASTStmtReader::NumExprBits);
4073 bool HasTemplateKWAndArgsInfo = DependentScopeDeclRefBits.getNextBit();
4074 unsigned NumTemplateArgs =
4075 HasTemplateKWAndArgsInfo
4076 ? DependentScopeDeclRefBits.getNextBits(/*Width=*/16)
4077 : 0;
4079 Context, HasTemplateKWAndArgsInfo, NumTemplateArgs);
4080 break;
4081 }
4082
4086 break;
4087
4089 auto NumResults = Record[ASTStmtReader::NumExprFields];
4090 BitsUnpacker OverloadExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4091 auto HasTemplateKWAndArgsInfo = OverloadExprBits.getNextBit();
4092 auto NumTemplateArgs = HasTemplateKWAndArgsInfo
4094 : 0;
4096 Context, NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
4097 break;
4098 }
4099
4101 auto NumResults = Record[ASTStmtReader::NumExprFields];
4102 BitsUnpacker OverloadExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4103 auto HasTemplateKWAndArgsInfo = OverloadExprBits.getNextBit();
4104 auto NumTemplateArgs = HasTemplateKWAndArgsInfo
4106 : 0;
4108 Context, NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
4109 break;
4110 }
4111
4112 case EXPR_TYPE_TRAIT:
4115 break;
4116
4118 S = new (Context) ArrayTypeTraitExpr(Empty);
4119 break;
4120
4122 S = new (Context) ExpressionTraitExpr(Empty);
4123 break;
4124
4125 case EXPR_CXX_NOEXCEPT:
4126 S = new (Context) CXXNoexceptExpr(Empty);
4127 break;
4128
4130 S = new (Context) PackExpansionExpr(Empty);
4131 break;
4132
4133 case EXPR_SIZEOF_PACK:
4135 Context,
4136 /*NumPartialArgs=*/Record[ASTStmtReader::NumExprFields]);
4137 break;
4138
4139 case EXPR_PACK_INDEXING:
4141 Context,
4142 /*TransformedExprs=*/Record[ASTStmtReader::NumExprFields]);
4143 break;
4144
4146 S = new (Context) SubstNonTypeTemplateParmExpr(Empty);
4147 break;
4148
4150 S = new (Context) SubstNonTypeTemplateParmPackExpr(Empty);
4151 break;
4152
4156 break;
4157
4159 S = new (Context) MaterializeTemporaryExpr(Empty);
4160 break;
4161
4162 case EXPR_CXX_FOLD:
4163 S = new (Context) CXXFoldExpr(Empty);
4164 break;
4165
4168 Context, /*numExprs=*/Record[ASTStmtReader::NumExprFields], Empty);
4169 break;
4170
4171 case EXPR_OPAQUE_VALUE:
4172 S = new (Context) OpaqueValueExpr(Empty);
4173 break;
4174
4175 case EXPR_CUDA_KERNEL_CALL: {
4176 auto NumArgs = Record[ASTStmtReader::NumExprFields];
4178 CallExprBits.advance(1);
4179 auto HasFPFeatures = CallExprBits.getNextBit();
4180 S = CUDAKernelCallExpr::CreateEmpty(Context, NumArgs, HasFPFeatures,
4181 Empty);
4182 break;
4183 }
4184
4185 case EXPR_ASTYPE:
4186 S = new (Context) AsTypeExpr(Empty);
4187 break;
4188
4189 case EXPR_PSEUDO_OBJECT: {
4190 unsigned numSemanticExprs = Record[ASTStmtReader::NumExprFields];
4191 S = PseudoObjectExpr::Create(Context, Empty, numSemanticExprs);
4192 break;
4193 }
4194
4195 case EXPR_ATOMIC:
4196 S = new (Context) AtomicExpr(Empty);
4197 break;
4198
4199 case EXPR_LAMBDA: {
4200 unsigned NumCaptures = Record[ASTStmtReader::NumExprFields];
4201 S = LambdaExpr::CreateDeserialized(Context, NumCaptures);
4202 break;
4203 }
4204
4205 case STMT_COROUTINE_BODY: {
4206 unsigned NumParams = Record[ASTStmtReader::NumStmtFields];
4207 S = CoroutineBodyStmt::Create(Context, Empty, NumParams);
4208 break;
4209 }
4210
4211 case STMT_CORETURN:
4212 S = new (Context) CoreturnStmt(Empty);
4213 break;
4214
4215 case EXPR_COAWAIT:
4216 S = new (Context) CoawaitExpr(Empty);
4217 break;
4218
4219 case EXPR_COYIELD:
4220 S = new (Context) CoyieldExpr(Empty);
4221 break;
4222
4224 S = new (Context) DependentCoawaitExpr(Empty);
4225 break;
4226
4228 S = new (Context) ConceptSpecializationExpr(Empty);
4229 break;
4230 }
4232 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4233 S = OpenACCComputeConstruct::CreateEmpty(Context, NumClauses);
4234 break;
4235 }
4236 case EXPR_REQUIRES:
4237 unsigned numLocalParameters = Record[ASTStmtReader::NumExprFields];
4238 unsigned numRequirement = Record[ASTStmtReader::NumExprFields + 1];
4239 S = RequiresExpr::Create(Context, Empty, numLocalParameters,
4240 numRequirement);
4241 break;
4242 }
4243
4244 // We hit a STMT_STOP, so we're done with this expression.
4245 if (Finished)
4246 break;
4247
4248 ++NumStatementsRead;
4249
4250 if (S && !IsStmtReference) {
4251 Reader.Visit(S);
4252 StmtEntries[Cursor.GetCurrentBitNo()] = S;
4253 }
4254
4255 assert(Record.getIdx() == Record.size() &&
4256 "Invalid deserialization of statement");
4257 StmtStack.push_back(S);
4258 }
4259Done:
4260 assert(StmtStack.size() > PrevNumStmts && "Read too many sub-stmts!");
4261 assert(StmtStack.size() == PrevNumStmts + 1 && "Extra expressions on stack!");
4262 return StmtStack.pop_back_val();
4263}
This file provides AST data structures related to concepts.
Defines the clang::ASTContext interface.
static concepts::Requirement::SubstitutionDiagnostic * readSubstitutionDiagnostic(ASTRecordReader &Record)
static ConstraintSatisfaction readConstraintSatisfaction(ASTRecordReader &Record)
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines the C++ template declaration subclasses.
Defines the clang::Expr interface and subclasses for C++ expressions.
Defines enumerations for expression traits intrinsics.
unsigned Iter
Definition: HTMLLogger.cpp:154
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.
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
void setValue(const ASTContext &C, const llvm::APInt &Val)
bool needsCleanup() const
Returns whether the object performed allocations.
Definition: APValue.cpp:431
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:182
ASTContext & getContext()
Retrieve the AST context that this AST reader supplements.
Definition: ASTReader.h:2363
Stmt * ReadSubStmt()
Reads a sub-statement operand during statement reading.
Definition: ASTReader.h:2318
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:4338
void setLabel(LabelDecl *L)
Definition: Expr.h:4362
void setLabelLoc(SourceLocation L)
Definition: Expr.h:4356
void setAmpAmpLoc(SourceLocation L)
Definition: Expr.h:4354
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Definition: Expr.h:5564
Represents a loop initializing the elements of an array.
Definition: Expr.h:5511
This class represents BOTH the OpenMP Array Section and OpenACC 'subarray', with a boolean differenti...
Definition: Expr.h:6734
bool isOMPArraySection() const
Definition: Expr.h:6796
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition: Expr.h:2664
void setRHS(Expr *E)
Definition: Expr.h:2699
void setRBracketLoc(SourceLocation L)
Definition: Expr.h:2715
void setLHS(Expr *E)
Definition: Expr.h:2695
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
Definition: ExprCXX.h:2846
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Definition: Expr.h:6234
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
Definition: Stmt.h:3100
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Definition: Expr.h:6437
unsigned getNumSubExprs() const
Definition: Expr.h:6512
Represents an attribute applied to a statement.
Definition: Stmt.h:2080
static AttributedStmt * CreateEmpty(const ASTContext &C, unsigned NumAttrs)
Definition: Stmt.cpp:434
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Definition: Expr.h:4241
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3840
void setLHS(Expr *E)
Definition: Expr.h:3890
void setHasStoredFPFeatures(bool B)
Set and fetch the bit that shows whether FPFeatures needs to be allocated in Trailing Storage.
Definition: Expr.h:4023
void setOperatorLoc(SourceLocation L)
Definition: Expr.h:3882
void setRHS(Expr *E)
Definition: Expr.h:3892
static BinaryOperator * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
Definition: Expr.cpp:4773
void setStoredFPFeatures(FPOptionsOverride F)
Set FPFeatures in trailing storage, used only by Serialization.
Definition: Expr.h:4032
void setOpcode(Opcode Opc)
Definition: Expr.h:3887
A simple helper class to unpack an integer to bits and consuming the bits in order.
Definition: ASTReader.h:2425
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:6173
void setBlockDecl(BlockDecl *BD)
Definition: Expr.h:6187
BreakStmt - This represents a break.
Definition: Stmt.h:2980
Represents a C++2a __builtin_bit_cast(T, v) expression.
Definition: ExprCXX.h:5258
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr....
Definition: Expr.h:3771
static CStyleCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize, bool HasFPFeatures)
Definition: Expr.cpp:2123
void setRParenLoc(SourceLocation L)
Definition: Expr.h:3807
void setLParenLoc(SourceLocation L)
Definition: Expr.h:3804
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:1872
A C++ addrspace_cast expression (currently only enabled for OpenCL).
Definition: ExprCXX.h:601
static CXXAddrspaceCastExpr * CreateEmpty(const ASTContext &Context)
Definition: ExprCXX.cpp:848
Represents a base class of a C++ class.
Definition: DeclCXX.h:146
Represents binding an expression to a temporary.
Definition: ExprCXX.h:1485
void setTemporary(CXXTemporary *T)
Definition: ExprCXX.h:1505
void setSubExpr(Expr *E)
Definition: ExprCXX.h:1509
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition: ExprCXX.h:720
void setValue(bool V)
Definition: ExprCXX.h:738
void setLocation(SourceLocation L)
Definition: ExprCXX.h:744
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:835
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1540
void setArg(unsigned Arg, Expr *ArgExpr)
Set the specified argument.
Definition: ExprCXX.h:1693
unsigned getNumArgs() const
Return the number of arguments to the constructor call.
Definition: ExprCXX.h:1680
static CXXConstructExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs)
Create an empty C++ construction expression.
Definition: ExprCXX.cpp:1125
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1264
static CXXDefaultArgExpr * CreateEmpty(const ASTContext &C, bool HasRewrittenInit)
Definition: ExprCXX.cpp:962
A use of a default initializer in a constructor or in aggregate initialization.
Definition: ExprCXX.h:1371
static CXXDefaultInitExpr * CreateEmpty(const ASTContext &C, bool HasRewrittenInit)
Definition: ExprCXX.cpp:1016
Represents a delete expression for memory deallocation and destructor calls, e.g.
Definition: ExprCXX.h:2491
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3652
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: ExprCXX.h:3850
static CXXDependentScopeMemberExpr * CreateEmpty(const ASTContext &Ctx, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs, bool HasFirstQualifierFoundInScope)
Definition: ExprCXX.cpp:1505
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Definition: ExprCXX.h:478
static CXXDynamicCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
Definition: ExprCXX.cpp:757
Represents a folding of a pack over an operator.
Definition: ExprCXX.h:4798
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:1811
void setLParenLoc(SourceLocation L)
Definition: ExprCXX.h:1849
static CXXFunctionalCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize, bool HasFPFeatures)
Definition: ExprCXX.cpp:868
void setRParenLoc(SourceLocation L)
Definition: ExprCXX.h:1851
Represents a call to an inherited base class constructor from an inheriting constructor.
Definition: ExprCXX.h:1731
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:642
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:2234
static CXXNewExpr * CreateEmpty(const ASTContext &Ctx, bool IsArray, bool HasInit, unsigned NumPlacementArgs, bool IsParenTypeId)
Create an empty c++ new expression.
Definition: ExprCXX.cpp:268
bool isArray() const
Definition: ExprCXX.h:2342
bool hasInitializer() const
Whether this new-expression has any initializer at all.
Definition: ExprCXX.h:2398
void setOperatorDelete(FunctionDecl *D)
Definition: ExprCXX.h:2340
unsigned getNumPlacementArgs() const
Definition: ExprCXX.h:2372
bool isParenTypeId() const
Definition: ExprCXX.h:2389
raw_arg_iterator raw_arg_end()
Definition: ExprCXX.h:2461
raw_arg_iterator raw_arg_begin()
Definition: ExprCXX.h:2460
void setOperatorNew(FunctionDecl *D)
Definition: ExprCXX.h:2338
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition: ExprCXX.h:4095
The null pointer literal (C++11 [lex.nullptr])
Definition: ExprCXX.h:765
void setLocation(SourceLocation L)
Definition: ExprCXX.h:780
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:577
Represents a list-initialization with parenthesis.
Definition: ExprCXX.h:4920
void setInitializedFieldInUnion(FieldDecl *FD)
Definition: ExprCXX.h:4996
static CXXParenListInitExpr * CreateEmpty(ASTContext &C, unsigned numExprs, EmptyShell Empty)
Definition: ExprCXX.cpp:1894
void setArrayFiller(Expr *E)
Definition: ExprCXX.h:4986
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition: ExprCXX.h:2610
void setDestroyedType(IdentifierInfo *II, SourceLocation Loc)
Set the name of destroyed type for a dependent pseudo-destructor expression.
Definition: ExprCXX.h:2725
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
Definition: ExprCXX.h:523
static CXXReinterpretCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
Definition: ExprCXX.cpp:821
A rewritten comparison expression that was originally written using operator syntax.
Definition: ExprCXX.h:283
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type.
Definition: ExprCXX.h:2175
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:729
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:1879
static CXXTemporaryObjectExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs)
Definition: ExprCXX.cpp:1091
Represents the this expression in C++.
Definition: ExprCXX.h:1148
void setCapturedByCopyInLambdaWithExplicitObjectParameter(bool Set)
Definition: ExprCXX.h:1178
void setLocation(SourceLocation L)
Definition: ExprCXX.h:1166
static CXXThisExpr * CreateEmpty(const ASTContext &Ctx)
Definition: ExprCXX.cpp:1525
void setImplicit(bool I)
Definition: ExprCXX.h:1172
A C++ throw-expression (C++ [except.throw]).
Definition: ExprCXX.h:1202
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
bool isTypeOperand() const
Definition: ExprCXX.h:881
void setSourceRange(SourceRange R)
Definition: ExprCXX.h:900
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:3526
void setRParenLoc(SourceLocation L)
Definition: ExprCXX.h:3576
void setArg(unsigned I, Expr *E)
Definition: ExprCXX.h:3612
void setLParenLoc(SourceLocation L)
Definition: ExprCXX.h:3571
unsigned getNumArgs() const
Retrieve the number of arguments.
Definition: ExprCXX.h:3584
static CXXUnresolvedConstructExpr * CreateEmpty(const ASTContext &Context, unsigned NumArgs)
Definition: ExprCXX.cpp:1432
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
Definition: ExprCXX.h:1062
bool isTypeOperand() const
Definition: ExprCXX.h:1092
void setSourceRange(SourceRange R)
Definition: ExprCXX.h:1113
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2820
void setRParenLoc(SourceLocation L)
Definition: Expr.h:3131
void setArg(unsigned Arg, Expr *ArgExpr)
setArg - Set the specified argument.
Definition: Expr.h:3024
void setADLCallKind(ADLCallKind V=UsesADL)
Definition: Expr.h:2977
static CallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPFeatures, EmptyShell Empty)
Create an empty call expression, for deserialization.
Definition: Expr.cpp:1518
void setPreArg(unsigned I, Stmt *PreArg)
Definition: Expr.h:2908
void setStoredFPFeatures(FPOptionsOverride F)
Set FPOptionsOverride in trailing storage. Used only by Serialization.
Definition: Expr.h:3089
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition: Expr.h:2998
void setCallee(Expr *F)
Definition: Expr.h:2972
This captures a statement into a function.
Definition: Stmt.h:3757
static CapturedStmt * CreateDeserialized(const ASTContext &Context, unsigned NumCaptures)
Definition: Stmt.cpp:1385
VariableCaptureKind
The different capture forms: by 'this', by reference, capture for variable-length array type etc.
Definition: Stmt.h:3761
CaseStmt - Represent a case statement.
Definition: Stmt.h:1801
static CaseStmt * CreateEmpty(const ASTContext &Ctx, bool CaseStmtIsGNURange)
Build an empty case statement.
Definition: Stmt.cpp:1231
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:3483
FPOptionsOverride * getTrailingFPFeatures()
Return a pointer to the trailing FPOptions.
Definition: Expr.cpp:2054
path_iterator path_begin()
Definition: Expr.h:3553
unsigned path_size() const
Definition: Expr.h:3552
void setCastKind(CastKind K)
Definition: Expr.h:3528
bool hasStoredFPFeatures() const
Definition: Expr.h:3582
void setSubExpr(Expr *E)
Definition: Expr.h:3535
void setValue(unsigned Val)
Definition: Expr.h:1616
void setLocation(SourceLocation Location)
Definition: Expr.h:1612
void setKind(CharacterLiteralKind kind)
Definition: Expr.h:1613
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition: Expr.h:4558
void setRParenLoc(SourceLocation L)
Definition: Expr.h:4609
void setIsConditionTrue(bool isTrue)
Definition: Expr.h:4586
void setBuiltinLoc(SourceLocation L)
Definition: Expr.h:4606
void setRHS(Expr *E)
Definition: Expr.h:4603
void setCond(Expr *E)
Definition: Expr.h:4599
void setLHS(Expr *E)
Definition: Expr.h:4601
Represents a 'co_await' expression.
Definition: ExprCXX.h:5151
void setIsImplicit(bool value=true)
Definition: ExprCXX.h:5174
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:4088
void setComputationResultType(QualType T)
Definition: Expr.h:4126
static CompoundAssignOperator * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
Definition: Expr.cpp:4795
void setComputationLHSType(QualType T)
Definition: Expr.h:4123
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:3413
void setFileScope(bool FS)
Definition: Expr.h:3441
void setTypeSourceInfo(TypeSourceInfo *tinfo)
Definition: Expr.h:3449
void setLParenLoc(SourceLocation L)
Definition: Expr.h:3444
void setInitializer(Expr *E)
Definition: Expr.h:3438
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:1606
static CompoundStmt * CreateEmpty(const ASTContext &C, unsigned NumStmts, bool HasFPFeatures)
Definition: Stmt.cpp:393
Represents the specialization of a concept - evaluates to a prvalue of type bool.
Definition: ExprConcepts.h:42
ConditionalOperator - The ?: ternary operator.
Definition: Expr.h:4179
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition: Expr.h:1072
ConstantResultStorageKind getResultStorageKind() const
Definition: Expr.h:1141
static ConstantExpr * CreateEmpty(const ASTContext &Context, ConstantResultStorageKind StorageKind)
Definition: Expr.cpp:367
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
Definition: ASTConcept.h:35
llvm::SmallVector< std::pair< const Expr *, Detail >, 4 > Details
Pairs of unsatisfied atomic constraint expressions along with the substituted constraint expr,...
Definition: ASTConcept.h:60
std::pair< SourceLocation, StringRef > SubstitutionDiagnostic
Definition: ASTConcept.h:50
ContinueStmt - This represents a continue.
Definition: Stmt.h:2950
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition: Expr.h:4499
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:5232
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:1260
bool hasTemplateKWAndArgsInfo() const
Definition: Expr.h:1375
static DeclRefExpr * CreateEmpty(const ASTContext &Context, bool HasQualifier, bool HasFoundDecl, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Construct an empty declaration reference expression.
Definition: Expr.cpp:529
void setLocation(SourceLocation L)
Definition: Expr.h:1337
bool hasQualifier() const
Determine whether this declaration reference was preceded by a C++ nested-name-specifier,...
Definition: Expr.h:1343
ValueDecl * getDecl()
Definition: Expr.h:1328
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
Definition: Stmt.h:1497
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:5183
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:3292
static DependentScopeDeclRefExpr * CreateEmpty(const ASTContext &Context, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition: ExprCXX.cpp:497
Represents a single C99 designator.
Definition: Expr.h:5135
Represents a C99 designated initializer expression.
Definition: Expr.h:5092
static DesignatedInitExpr * CreateEmpty(const ASTContext &C, unsigned NumIndexExprs)
Definition: Expr.cpp:4594
void setSubExpr(unsigned Idx, Expr *E)
Definition: Expr.h:5379
void setGNUSyntax(bool GNU)
Definition: Expr.h:5357
void setEqualOrColonLoc(SourceLocation L)
Definition: Expr.h:5348
void setDesignators(const ASTContext &C, const Designator *Desigs, unsigned NumDesigs)
Definition: Expr.cpp:4601
unsigned getNumSubExprs() const
Retrieve the total number of subexpressions in this designated initializer expression,...
Definition: Expr.h:5372
void setBase(Expr *Base)
Definition: Expr.h:5477
void setUpdater(Expr *Updater)
Definition: Expr.h:5482
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:2725
ExplicitCastExpr - An explicit cast written in the source code.
Definition: Expr.h:3730
void setTypeInfoAsWritten(TypeSourceInfo *writtenTy)
Definition: Expr.h:3753
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition: ExprCXX.h:3443
unsigned getNumObjects() const
Definition: ExprCXX.h:3471
llvm::PointerUnion< BlockDecl *, CompoundLiteralExpr * > CleanupObject
The type of objects that are kept in the cleanup.
Definition: ExprCXX.h:3449
static ExprWithCleanups * Create(const ASTContext &C, EmptyShell empty, unsigned numObjects)
Definition: ExprCXX.cpp:1397
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:2917
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:6113
void setAccessor(IdentifierInfo *II)
Definition: Expr.h:6135
void setBase(Expr *E)
Definition: Expr.h:6132
void setAccessorLoc(SourceLocation L)
Definition: Expr.h:6138
static FPOptionsOverride getFromOpaqueInt(storage_type I)
Definition: LangOptions.h:981
static FixedPointLiteral * Create(const ASTContext &C, EmptyShell Empty)
Returns an empty fixed-point literal.
Definition: Expr.cpp:1007
void setLocation(SourceLocation Location)
Definition: Expr.h:1564
void setScale(unsigned S)
Definition: Expr.h:1567
static FloatingLiteral * Create(const ASTContext &C, const llvm::APFloat &V, bool isexact, QualType Type, SourceLocation L)
Definition: Expr.cpp:1078
const llvm::fltSemantics & getSemantics() const
Return the APFloat semantics this literal uses.
Definition: Expr.h:1669
void setValue(const ASTContext &C, const llvm::APFloat &Val)
Definition: Expr.h:1650
void setRawSemantics(llvm::APFloatBase::Semantics Sem)
Set the raw enumeration value representing the floating-point semantics of this literal (32-bit IEEE,...
Definition: Expr.h:1664
void setExact(bool E)
Definition: Expr.h:1681
void setLocation(SourceLocation L)
Definition: Expr.h:1689
ForStmt - This represents a 'for (init;cond;inc)' stmt.
Definition: Stmt.h:2781
void setSubExpr(Expr *E)
As with any mutator of the AST, be very careful when modifying an existing AST to preserve its invari...
Definition: Expr.h:1057
Stmt * SubExpr
Definition: Expr.h:1041
Represents a reference to a function parameter pack or init-capture pack that has been substituted bu...
Definition: ExprCXX.h:4606
static FunctionParmPackExpr * CreateEmpty(const ASTContext &Context, unsigned NumParams)
Definition: ExprCXX.cpp:1756
This represents a GCC inline-assembly statement extension.
Definition: Stmt.h:3259
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Definition: Expr.h:4633
void setTokenLocation(SourceLocation L)
Definition: Expr.h:4648
Represents a C11 generic selection.
Definition: Expr.h:5725
unsigned getNumAssocs() const
The number of association expressions.
Definition: Expr.h:5965
static GenericSelectionExpr * CreateEmpty(const ASTContext &Context, unsigned NumAssocs)
Create an empty generic selection expression for deserialization.
Definition: Expr.cpp:4528
GotoStmt - This represents a direct goto.
Definition: Stmt.h:2862
One of these records is kept for each identifier that is lexed.
IfStmt - This represents an if/then/else.
Definition: Stmt.h:2138
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:973
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1....
Definition: Expr.h:1712
void setSubExpr(Expr *E)
Definition: Expr.h:1726
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:3655
static ImplicitCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize, bool HasFPFeatures)
Definition: Expr.cpp:2096
void setIsPartOfExplicitCast(bool PartOfExplicitCast)
Definition: Expr.h:3687
Represents an implicitly-generated value initialization of an object of a given type.
Definition: Expr.h:5600
IndirectGotoStmt - This represents an indirect goto.
Definition: Stmt.h:2901
Describes an C or C++ initializer list.
Definition: Expr.h:4847
void setSyntacticForm(InitListExpr *Init)
Definition: Expr.h:5017
Expr * updateInit(const ASTContext &C, unsigned Init, Expr *expr)
Updates the initializer at index Init with the new expression expr, and returns the old expression at...
Definition: Expr.cpp:2396
void setLBraceLoc(SourceLocation Loc)
Definition: Expr.h:5002
void setRBraceLoc(SourceLocation Loc)
Definition: Expr.h:5004
void sawArrayRangeDesignator(bool ARD=true)
Definition: Expr.h:5027
void reserveInits(const ASTContext &C, unsigned NumInits)
Reserve space for some number of initializers.
Definition: Expr.cpp:2387
void setLocation(SourceLocation Location)
Definition: Expr.h:1522
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:977
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:2031
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition: ExprCXX.h:1948
static LambdaExpr * CreateDeserialized(const ASTContext &C, unsigned NumCaptures)
Construct a new lambda expression that will be deserialized from an external source.
Definition: ExprCXX.cpp:1264
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument for this lambda expression.
Definition: ExprCXX.h:2086
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
Definition: ExprCXX.h:2074
This represents a Microsoft inline-assembly statement extension.
Definition: Stmt.h:3482
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:929
MS property subscript expression.
Definition: ExprCXX.h:1000
void setRBracketLoc(SourceLocation L)
Definition: ExprCXX.h:1038
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition: ExprCXX.h:4686
MatrixSubscriptExpr - Matrix subscript expression for the MatrixType extension.
Definition: Expr.h:2742
void setColumnIdx(Expr *E)
Definition: Expr.h:2782
void setBase(Expr *E)
Definition: Expr.h:2770
void setRowIdx(Expr *E)
Definition: Expr.h:2774
void setRBracketLoc(SourceLocation L)
Definition: Expr.h:2797
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition: Expr.h:3172
static MemberExpr * CreateEmpty(const ASTContext &Context, bool HasQualifier, bool HasFoundDecl, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition: Expr.cpp:1776
This represents a decl that may have a name.
Definition: Decl.h:249
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition: Decl.h:315
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:5420
NullStmt - This is the null statement ";": C99 6.8.3p3.
Definition: Stmt.h:1569
An explicit cast in C or a C-style cast in C++, which uses the syntax ([s1][s2]......
Definition: ExprOpenMP.h:24
void setLParenLoc(SourceLocation L)
Definition: ExprOpenMP.h:69
static OMPArrayShapingExpr * CreateEmpty(const ASTContext &Context, unsigned NumDims)
Definition: Expr.cpp:5158
void setRParenLoc(SourceLocation L)
Definition: ExprOpenMP.h:72
This represents '#pragma omp atomic' directive.
Definition: StmtOpenMP.h:2963
static OMPAtomicDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:935
This represents '#pragma omp barrier' directive.
Definition: StmtOpenMP.h:2641
static OMPBarrierDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:787
This represents '#pragma omp cancel' directive.
Definition: StmtOpenMP.h:3671
static OMPCancelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:847
This represents '#pragma omp cancellation point' directive.
Definition: StmtOpenMP.h:3613
static OMPCancellationPointDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:832
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:2092
static OMPCriticalDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:592
This represents '#pragma omp depobj' directive.
Definition: StmtOpenMP.h:2857
static OMPDepobjDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:877
This represents '#pragma omp dispatch' directive.
Definition: StmtOpenMP.h:5827
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:4441
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:4564
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:4660
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:4725
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:6311
static OMPErrorDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:775
This is a basic class for representing single OpenMP executable directive.
Definition: StmtOpenMP.h:266
void setLocStart(SourceLocation Loc)
Set starting location of directive kind.
Definition: StmtOpenMP.h:510
OMPChildren * Data
Data, associated with the directive.
Definition: StmtOpenMP.h:295
void setLocEnd(SourceLocation Loc)
Set ending location of directive.
Definition: StmtOpenMP.h:515
void setMappedDirective(OpenMPDirectiveKind MappedDirective)
Definition: StmtOpenMP.h:357
This represents '#pragma omp flush' directive.
Definition: StmtOpenMP.h:2805
static OMPFlushDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:862
This represents '#pragma omp for' directive.
Definition: StmtOpenMP.h:1649
static OMPForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:400
This represents '#pragma omp for simd' directive.
Definition: StmtOpenMP.h:1740
static OMPForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:487
This represents '#pragma omp loop' directive.
Definition: StmtOpenMP.h:5982
static OMPGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with a place for NumClauses clauses.
This represents '#pragma omp interop' directive.
Definition: StmtOpenMP.h:5774
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
void setLParenLoc(SourceLocation L)
Definition: ExprOpenMP.h:243
static OMPIteratorExpr * CreateEmpty(const ASTContext &Context, unsigned NumIterators)
Definition: Expr.cpp:5289
void setRParenLoc(SourceLocation L)
Definition: ExprOpenMP.h:246
void setIteratorKwLoc(SourceLocation L)
Definition: ExprOpenMP.h:249
The base class for all loop-based directives, including loop transformation directives.
Definition: StmtOpenMP.h:698
This is a common base class for loop directives ('omp simd', 'omp for', 'omp for simd' etc....
Definition: StmtOpenMP.h:1018
The base class for all loop transformation directives.
Definition: StmtOpenMP.h:975
void setNumGeneratedLoops(unsigned Num)
Set the number of loops generated by this loop transformation.
Definition: StmtOpenMP.h:990
This represents '#pragma omp masked' directive.
Definition: StmtOpenMP.h:5892
static OMPMaskedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
This represents '#pragma omp masked taskloop' directive.
Definition: StmtOpenMP.h:3946
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:4087
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:2044
static OMPMasterDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:577
This represents '#pragma omp master taskloop' directive.
Definition: StmtOpenMP.h:3870
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:4022
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:5943
static OMPMetaDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Definition: StmtOpenMP.cpp:273
This represents '#pragma omp ordered' directive.
Definition: StmtOpenMP.h:2909
static OMPOrderedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, bool IsStandalone, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:908
This represents '#pragma omp parallel' directive.
Definition: StmtOpenMP.h:627
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:2163
static OMPParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:637
This represents '#pragma omp parallel for simd' directive.
Definition: StmtOpenMP.h:2260
static OMPParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:680
This represents '#pragma omp parallel loop' directive.
Definition: StmtOpenMP.h:6184
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:2388
static OMPParallelMaskedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:714
This represents '#pragma omp parallel masked taskloop' directive.
Definition: StmtOpenMP.h:4231
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:4376
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:2325
static OMPParallelMasterDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:698
This represents '#pragma omp parallel master taskloop' directive.
Definition: StmtOpenMP.h:4153
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:4309
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:2452
static OMPParallelSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:732
This represents '#pragma omp scan' directive.
Definition: StmtOpenMP.h:5721
static OMPScanDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:892
This represents '#pragma omp scope' directive.
Definition: StmtOpenMP.h:1941
static OMPScopeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:544
This represents '#pragma omp section' directive.
Definition: StmtOpenMP.h:1880
static OMPSectionDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:528
void setHasCancel(bool Has)
Set cancel state.
Definition: StmtOpenMP.h:1924
This represents '#pragma omp sections' directive.
Definition: StmtOpenMP.h:1803
static OMPSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:508
This represents '#pragma omp simd' directive.
Definition: StmtOpenMP.h:1585
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:1993
static OMPSingleDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:561
This represents '#pragma omp target data' directive.
Definition: StmtOpenMP.h:3222
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:3168
static OMPTargetDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:951
This represents '#pragma omp target enter data' directive.
Definition: StmtOpenMP.h:3276
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:3331
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:3385
static OMPTargetParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:970
This represents '#pragma omp target parallel for' directive.
Definition: StmtOpenMP.h:3465
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:4791
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:6249
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:4858
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:5216
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:5272
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:5339
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:5437
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:5507
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:6109
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:4508
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:2533
static OMPTaskDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:748
This represents '#pragma omp taskloop' directive.
Definition: StmtOpenMP.h:3731
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:3804
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:2738
static OMPTaskgroupDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:816
This represents '#pragma omp taskwait' directive.
Definition: StmtOpenMP.h:2687
static OMPTaskwaitDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:801
This represents '#pragma omp taskyield' directive.
Definition: StmtOpenMP.h:2595
static OMPTaskyieldDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:761
This represents '#pragma omp teams' directive.
Definition: StmtOpenMP.h:3560
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:4923
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:5123
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:5057
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:4989
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:6044
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:5565
static OMPTileDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty '#pragma omp tile' AST node for deserialization.
Definition: StmtOpenMP.cpp:422
This represents the '#pragma omp unroll' loop transformation directive.
Definition: StmtOpenMP.h:5647
static OMPUnrollDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses)
Build an empty '#pragma omp unroll' AST node for deserialization.
Definition: StmtOpenMP.cpp:445
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:47
Expr ** getElements()
Retrieve elements of array of literals.
Definition: ExprObjC.h:220
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c array literal.
Definition: ExprObjC.h:228
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:1696
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition: ExprObjC.h:87
void setLocation(SourceLocation L)
Definition: ExprObjC.h:107
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:1636
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:88
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c dictionary literal.
Definition: ExprObjC.h:360
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:410
void setEncodedTypeSourceInfo(TypeSourceInfo *EncType)
Definition: ExprObjC.h:433
void setRParenLoc(SourceLocation L)
Definition: ExprObjC.h:427
void setAtLoc(SourceLocation L)
Definition: ExprObjC.h:425
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:1575
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC 'id' type.
Definition: ExprObjC.h:1491
void setIsaMemberLoc(SourceLocation L)
Definition: ExprObjC.h:1524
void setBase(Expr *E)
Definition: ExprObjC.h:1515
void setArrow(bool A)
Definition: ExprObjC.h:1519
void setOpLoc(SourceLocation L)
Definition: ExprObjC.h:1527
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:549
void setIsArrow(bool A)
Definition: ExprObjC.h:589
void setBase(Expr *base)
Definition: ExprObjC.h:585
void setDecl(ObjCIvarDecl *d)
Definition: ExprObjC.h:581
void setIsFreeIvar(bool A)
Definition: ExprObjC.h:590
void setOpLoc(SourceLocation L)
Definition: ExprObjC.h:601
void setLocation(SourceLocation L)
Definition: ExprObjC.h:593
An expression that sends a message to the given Objective-C object or class.
Definition: ExprObjC.h:945
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:232
void setMethodDecl(ObjCMethodDecl *MD)
Definition: ExprObjC.h:1370
void setClassReceiver(TypeSourceInfo *TSInfo)
Definition: ExprObjC.h:1294
void setInstanceReceiver(Expr *rec)
Turn this message send into an instance message that computes the receiver object with the given expr...
Definition: ExprObjC.h:1272
void setSuper(SourceLocation Loc, QualType T, bool IsInstanceSuper)
Definition: ExprObjC.h:1343
ReceiverKind
The kind of receiver this message is sending to.
Definition: ExprObjC.h:948
@ SuperInstance
The receiver is the instance of the superclass object.
Definition: ExprObjC.h:959
@ Instance
The receiver is an object instance.
Definition: ExprObjC.h:953
@ SuperClass
The receiver is a superclass.
Definition: ExprObjC.h:956
@ Class
The receiver is a class.
Definition: ExprObjC.h:950
void setDelegateInitCall(bool isDelegate)
Definition: ExprObjC.h:1414
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
Definition: ExprObjC.h:1234
unsigned getNumArgs() const
Return the number of actual arguments in this message, not counting the receiver.
Definition: ExprObjC.h:1382
void setSelector(Selector S)
Definition: ExprObjC.h:1351
void setArg(unsigned Arg, Expr *ArgExpr)
setArg - Set the specified argument.
Definition: ExprObjC.h:1405
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
void setProtocol(ObjCProtocolDecl *P)
Definition: ExprObjC.h:523
void setRParenLoc(SourceLocation L)
Definition: ExprObjC.h:529
void setAtLoc(SourceLocation L)
Definition: ExprObjC.h:528
ObjCSelectorExpr used for @selector in Objective-C.
Definition: ExprObjC.h:455
void setSelector(Selector S)
Definition: ExprObjC.h:470
void setAtLoc(SourceLocation L)
Definition: ExprObjC.h:474
void setRParenLoc(SourceLocation L)
Definition: ExprObjC.h:475
ObjCStringLiteral, used for Objective-C string literals i.e.
Definition: ExprObjC.h:51
void setAtLoc(SourceLocation L)
Definition: ExprObjC.h:69
void setString(StringLiteral *S)
Definition: ExprObjC.h:66
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:844
void setRBracket(SourceLocation RB)
Definition: ExprObjC.h:875
void setKeyExpr(Stmt *S)
Definition: ExprObjC.h:887
void setBaseExpr(Stmt *S)
Definition: ExprObjC.h:884
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type,...
Definition: Expr.h:2465
void setOperatorLoc(SourceLocation L)
Definition: Expr.h:2499
static OffsetOfExpr * CreateEmpty(const ASTContext &C, unsigned NumComps, unsigned NumExprs)
Definition: Expr.cpp:1670
void setIndexExpr(unsigned Idx, Expr *E)
Definition: Expr.h:2536
void setTypeSourceInfo(TypeSourceInfo *tsi)
Definition: Expr.h:2508
void setComponent(unsigned Idx, OffsetOfNode ON)
Definition: Expr.h:2517
unsigned getNumExpressions() const
Definition: Expr.h:2541
void setRParenLoc(SourceLocation R)
Definition: Expr.h:2503
unsigned getNumComponents() const
Definition: Expr.h:2522
Helper class for OffsetOfExpr.
Definition: Expr.h:2359
Kind
The kind of offsetof node we have.
Definition: Expr.h:2362
@ Array
An index into an array.
Definition: Expr.h:2364
@ Identifier
A field in a dependent type, known only by its name.
Definition: Expr.h:2368
@ Field
A field.
Definition: Expr.h:2366
@ Base
An implicit indirection through a C++ base class, when the field found is in a base class.
Definition: Expr.h:2371
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
Definition: Expr.h:1168
void setIsUnique(bool V)
Definition: Expr.h:1220
This is a base class for any OpenACC statement-level constructs that have an associated statement.
Definition: StmtOpenACC.h:76
This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...
Definition: StmtOpenACC.h:120
static OpenACCComputeConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
Definition: StmtOpenACC.cpp:18
This is the base class for an OpenACC statement-level construct, other construct types are expected t...
Definition: StmtOpenACC.h:25
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr.
Definition: ExprCXX.h:2976
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
Definition: ExprCXX.h:4068
unsigned getNumDecls() const
Gets the number of declarations in the unresolved set.
Definition: ExprCXX.h:3079
TemplateArgumentLoc * getTrailingTemplateArgumentLoc()
Return the optional template arguments.
Definition: ExprCXX.h:4078
DeclAccessPair * getTrailingResults()
Return the results. Defined after UnresolvedMemberExpr.
Definition: ExprCXX.h:4062
bool hasTemplateKWAndArgsInfo() const
Definition: ExprCXX.h:3020
unsigned getNumTemplateArgs() const
Definition: ExprCXX.h:3135
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition: ExprCXX.h:4149
static PackIndexingExpr * CreateDeserialized(ASTContext &Context, unsigned NumTransformedExprs)
Definition: ExprCXX.cpp:1697
ParenExpr - This represents a parethesized expression, e.g.
Definition: Expr.h:2130
void setLParen(SourceLocation Loc)
Definition: Expr.h:2154
void setRParen(SourceLocation Loc)
Definition: Expr.h:2158
void setSubExpr(Expr *E)
Definition: Expr.h:2147
static ParenListExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumExprs)
Create an empty paren list.
Definition: Expr.cpp:4732
unsigned getNumExprs() const
Return the number of expressions in this paren list.
Definition: Expr.h:5653
Represents a parameter to a function.
Definition: Decl.h:1761
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:1986
void setLocation(SourceLocation L)
Definition: Expr.h:2028
static PredefinedExpr * CreateEmpty(const ASTContext &Ctx, bool HasFunctionName)
Create an empty PredefinedExpr.
Definition: Expr.cpp:647
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition: Expr.h:6305
static PseudoObjectExpr * Create(const ASTContext &Context, Expr *syntactic, ArrayRef< Expr * > semantic, unsigned resultIndex)
Definition: Expr.cpp:4875
A (possibly-)qualified type.
Definition: Type.h:940
Frontend produces RecoveryExprs on semantic errors that prevent creating other well-formed expression...
Definition: Expr.h:6909
child_range children()
Definition: Expr.h:6925
static RecoveryExpr * CreateEmpty(ASTContext &Ctx, unsigned NumSubExprs)
Definition: Expr.cpp:5113
Represents the body of a requires-expression.
Definition: DeclCXX.h:2029
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
Definition: ExprConcepts.h:510
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:3019
static ReturnStmt * CreateEmpty(const ASTContext &Ctx, bool HasNRVOCandidate)
Create an empty return statement, optionally with storage for an NRVO candidate.
Definition: Stmt.cpp:1212
Represents a __leave statement.
Definition: Stmt.h:3718
static SYCLUniqueStableNameExpr * CreateEmpty(const ASTContext &Ctx)
Definition: Expr.cpp:587
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition: Expr.h:4431
void setExprs(const ASTContext &C, ArrayRef< Expr * > Exprs)
Definition: Expr.cpp:4354
void setRParenLoc(SourceLocation L)
Definition: Expr.h:4453
void setBuiltinLoc(SourceLocation L)
Definition: Expr.h:4450
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:4227
static SizeOfPackExpr * CreateDeserialized(ASTContext &Context, unsigned NumPartialArgs)
Definition: ExprCXX.cpp:1656
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof... expression, such as is produced f...
Definition: ExprCXX.h:4313
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(),...
Definition: Expr.h:4727
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:4383
void setRParenLoc(SourceLocation L)
Definition: Expr.h:4410
void setLParenLoc(SourceLocation L)
Definition: Expr.h:4408
void setSubStmt(CompoundStmt *S)
Definition: Expr.h:4402
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:1233
LambdaExprBitfields LambdaExprBits
Definition: Stmt.h:1263
UnresolvedLookupExprBitfields UnresolvedLookupExprBits
Definition: Stmt.h:1259
SubstNonTypeTemplateParmExprBitfields SubstNonTypeTemplateParmExprBits
Definition: Stmt.h:1262
CXXNoexceptExprBitfields CXXNoexceptExprBits
Definition: Stmt.h:1261
CXXRewrittenBinaryOperatorBitfields CXXRewrittenBinaryOperatorBits
Definition: Stmt.h:1242
ExprWithCleanupsBitfields ExprWithCleanupsBits
Definition: Stmt.h:1255
CXXScalarValueInitExprBitfields CXXScalarValueInitExprBits
Definition: Stmt.h:1249
CXXConstructExprBitfields CXXConstructExprBits
Definition: Stmt.h:1254
CXXDependentScopeMemberExprBitfields CXXDependentScopeMemberExprBits
Definition: Stmt.h:1257
TypeTraitExprBitfields TypeTraitExprBits
Definition: Stmt.h:1252
CXXNewExprBitfields CXXNewExprBits
Definition: Stmt.h:1250
SourceLocExprBitfields SourceLocExprBits
Definition: Stmt.h:1235
ConstantExprBitfields ConstantExprBits
Definition: Stmt.h:1218
RequiresExprBitfields RequiresExprBits
Definition: Stmt.h:1264
StmtExprBitfields StmtExprBits
Definition: Stmt.h:1238
StringLiteralBitfields StringLiteralBits
Definition: Stmt.h:1222
OpaqueValueExprBitfields OpaqueValueExprBits
Definition: Stmt.h:1273
CXXThrowExprBitfields CXXThrowExprBits
Definition: Stmt.h:1246
MemberExprBitfields MemberExprBits
Definition: Stmt.h:1228
DeclRefExprBitfields DeclRefExprBits
Definition: Stmt.h:1220
CXXOperatorCallExprBitfields CXXOperatorCallExprBits
Definition: Stmt.h:1241
CXXDefaultInitExprBitfields CXXDefaultInitExprBits
Definition: Stmt.h:1248
PredefinedExprBitfields PredefinedExprBits
Definition: Stmt.h:1219
UnresolvedMemberExprBitfields UnresolvedMemberExprBits
Definition: Stmt.h:1260
PseudoObjectExprBitfields PseudoObjectExprBits
Definition: Stmt.h:1234
CXXDeleteExprBitfields CXXDeleteExprBits
Definition: Stmt.h:1251
CXXDefaultArgExprBitfields CXXDefaultArgExprBits
Definition: Stmt.h:1247
StringLiteral - This represents a string literal expression, e.g.
Definition: Expr.h:1773
unsigned getLength() const
Definition: Expr.h:1890
StringLiteralKind getKind() const
Definition: Expr.h:1893
static StringLiteral * CreateEmpty(const ASTContext &Ctx, unsigned NumConcatenated, unsigned Length, unsigned CharByteWidth)
Construct an empty string literal.
Definition: Expr.cpp:1202
unsigned getNumConcatenated() const
getNumConcatenated - Get the number of string literal tokens that were concatenated in translation ph...
Definition: Expr.h:1921
unsigned getCharByteWidth() const
Definition: Expr.h:1891
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition: ExprCXX.h:4442
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition: ExprCXX.h:4527
void setNextSwitchCase(SwitchCase *SC)
Definition: Stmt.h:1776
SwitchStmt - This represents a 'switch' stmt.
Definition: Stmt.h:2388
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:1092
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:7330
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2761
static TypeTraitExpr * CreateDeserialized(const ASTContext &C, unsigned NumArgs)
Definition: ExprCXX.cpp:1838
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
Definition: ExprCXX.h:2808
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
Definition: Expr.h:6585
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition: Expr.h:2568
void setKind(UnaryExprOrTypeTrait K)
Definition: Expr.h:2603
void setOperatorLoc(SourceLocation L)
Definition: Expr.h:2642
void setRParenLoc(SourceLocation L)
Definition: Expr.h:2645
void setArgument(Expr *E)
Definition: Expr.h:2626
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition: Expr.h:2183
void setSubExpr(Expr *E)
Definition: Expr.h:2229
void setOperatorLoc(SourceLocation L)
Definition: Expr.h:2233
void setCanOverflow(bool C)
Definition: Expr.h:2242
bool hasStoredFPFeatures() const
Is FPFeatures in Trailing Storage?
Definition: Expr.h:2324
void setOpcode(Opcode Opc)
Definition: Expr.h:2226
void setStoredFPFeatures(FPOptionsOverride F)
Set FPFeatures in trailing storage, used by Serialization & ASTImporter.
Definition: Expr.h:2333
static UnaryOperator * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
Definition: Expr.cpp:4817
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:3173
static UnresolvedLookupExpr * CreateEmpty(const ASTContext &Context, unsigned NumResults, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition: ExprCXX.cpp:405
Represents a C++ member access expression for which lookup produced a set of overloaded functions.
Definition: ExprCXX.h:3912
static UnresolvedMemberExpr * CreateEmpty(const ASTContext &Context, unsigned NumResults, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition: ExprCXX.cpp:1605
void addDecl(NamedDecl *D)
Definition: UnresolvedSet.h:91
The iterator over UnresolvedSets.
Definition: UnresolvedSet.h:35
A set of unresolved declarations.
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit....
Definition: ExprCXX.h:637
static UserDefinedLiteral * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPOptions, EmptyShell Empty)
Definition: ExprCXX.cpp:916
Represents a call to the builtin function __builtin_va_arg.
Definition: Expr.h:4667
void setRParenLoc(SourceLocation L)
Definition: Expr.h:4698
void setIsMicrosoftABI(bool IsMS)
Definition: Expr.h:4689
void setSubExpr(Expr *E)
Definition: Expr.h:4685
void setBuiltinLoc(SourceLocation L)
Definition: Expr.h:4695
void setWrittenTypeInfo(TypeSourceInfo *TI)
Definition: Expr.h:4692
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:706
Represents a variable declaration or definition.
Definition: Decl.h:918
WhileStmt - This represents a 'while' stmt.
Definition: Stmt.h:2584
static WhileStmt * CreateEmpty(const ASTContext &Ctx, bool HasVar)
Create an empty while statement optionally with storage for a condition variable.
Definition: Stmt.cpp:1154
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:124
llvm::BitstreamCursor DeclsCursor
DeclsCursor - This is a cursor to the start of the DECLTYPES_BLOCK block.
Definition: ModuleFile.h:449
StmtCode
Record codes for each kind of statement or expression.
Definition: ASTBitCodes.h:1467
DesignatorTypes
The kinds of designators that can occur in a DesignatedInitExpr.
Definition: ASTBitCodes.h:1956
@ EXPR_DESIGNATED_INIT
A DesignatedInitExpr record.
Definition: ASTBitCodes.h:1614
@ EXPR_COMPOUND_LITERAL
A CompoundLiteralExpr record.
Definition: ASTBitCodes.h:1605
@ STMT_OMP_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1907
@ EXPR_OBJC_IVAR_REF_EXPR
An ObjCIvarRefExpr record.
Definition: ASTBitCodes.h:1689
@ EXPR_MEMBER
A MemberExpr record.
Definition: ASTBitCodes.h:1587
@ EXPR_CXX_TEMPORARY_OBJECT
A CXXTemporaryObjectExpr record.
Definition: ASTBitCodes.h:1763
@ STMT_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1918
@ EXPR_COMPOUND_ASSIGN_OPERATOR
A CompoundAssignOperator record.
Definition: ASTBitCodes.h:1593
@ EXPR_CXX_STATIC_CAST
A CXXStaticCastExpr record.
Definition: ASTBitCodes.h:1766
@ EXPR_OBJC_STRING_LITERAL
An ObjCStringLiteral record.
Definition: ASTBitCodes.h:1673
@ EXPR_VA_ARG
A VAArgExpr record.
Definition: ASTBitCodes.h:1632
@ STMT_OMP_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1912
@ EXPR_OBJC_ISA
An ObjCIsa Expr record.
Definition: ASTBitCodes.h:1704
@ EXPR_CXX_OPERATOR_CALL
A CXXOperatorCallExpr record.
Definition: ASTBitCodes.h:1748
@ STMT_OBJC_AT_TRY
An ObjCAtTryStmt record.
Definition: ASTBitCodes.h:1719
@ STMT_DO
A DoStmt record.
Definition: ASTBitCodes.h:1506
@ STMT_OBJC_CATCH
An ObjCAtCatchStmt record.
Definition: ASTBitCodes.h:1713
@ STMT_IF
An IfStmt record.
Definition: ASTBitCodes.h:1497
@ EXPR_STRING_LITERAL
A StringLiteral record.
Definition: ASTBitCodes.h:1557
@ EXPR_OBJC_AVAILABILITY_CHECK
An ObjCAvailabilityCheckExpr record.
Definition: ASTBitCodes.h:1734
@ STMT_OMP_PARALLEL_MASKED_TASKLOOP_DIRECTIVE
Definition: ASTBitCodes.h:1902
@ EXPR_MATRIX_SUBSCRIPT
An MatrixSubscriptExpr record.
Definition: ASTBitCodes.h:1581
@ EXPR_PSEUDO_OBJECT
A PseudoObjectExpr record.
Definition: ASTBitCodes.h:1662
@ STMT_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE
Definition: ASTBitCodes.h:1917
@ EXPR_IMPLICIT_CAST
An ImplicitCastExpr record.
Definition: ASTBitCodes.h:1599
@ STMT_CAPTURED
A CapturedStmt record.
Definition: ASTBitCodes.h:1530
@ STMT_OMP_TARGET_PARALLEL_FOR_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1909
@ STMT_GCCASM
A GCC-style AsmStmt record.
Definition: ASTBitCodes.h:1533
@ EXPR_IMAGINARY_LITERAL
An ImaginaryLiteral record.
Definition: ASTBitCodes.h:1554
@ STMT_WHILE
A WhileStmt record.
Definition: ASTBitCodes.h:1503
@ EXPR_CONVERT_VECTOR
A ConvertVectorExpr record.
Definition: ASTBitCodes.h:1653
@ EXPR_OBJC_SUBSCRIPT_REF_EXPR
An ObjCSubscriptRefExpr record.
Definition: ASTBitCodes.h:1695
@ EXPR_STMT
A StmtExpr record.
Definition: ASTBitCodes.h:1638
@ STMT_OMP_PARALLEL_GENERIC_LOOP_DIRECTIVE
Definition: ASTBitCodes.h:1927
@ EXPR_CXX_REINTERPRET_CAST
A CXXReinterpretCastExpr record.
Definition: ASTBitCodes.h:1772
@ EXPR_DESIGNATED_INIT_UPDATE
A DesignatedInitUpdateExpr record.
Definition: ASTBitCodes.h:1617
@ STMT_OBJC_AT_SYNCHRONIZED
An ObjCAtSynchronizedStmt record.
Definition: ASTBitCodes.h:1722
@ STMT_OMP_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE
Definition: ASTBitCodes.h:1906
@ EXPR_BUILTIN_BIT_CAST
A BuiltinBitCastExpr record.
Definition: ASTBitCodes.h:1784
@ STMT_OMP_TARGET_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1919
@ EXPR_CHARACTER_LITERAL
A CharacterLiteral record.
Definition: ASTBitCodes.h:1560
@ EXPR_OBJC_ENCODE
An ObjCEncodeExpr record.
Definition: ASTBitCodes.h:1680
@ EXPR_CSTYLE_CAST
A CStyleCastExpr record.
Definition: ASTBitCodes.h:1602
@ EXPR_OBJC_BOOL_LITERAL
An ObjCBoolLiteralExpr record.
Definition: ASTBitCodes.h:1731
@ EXPR_EXT_VECTOR_ELEMENT
An ExtVectorElementExpr record.
Definition: ASTBitCodes.h:1608
@ EXPR_ATOMIC
An AtomicExpr record.
Definition: ASTBitCodes.h:1665
@ EXPR_OFFSETOF
An OffsetOfExpr record.
Definition: ASTBitCodes.h:1572
@ STMT_RETURN
A ReturnStmt record.
Definition: ASTBitCodes.h:1524
@ STMT_OBJC_FOR_COLLECTION
An ObjCForCollectionStmt record.
Definition: ASTBitCodes.h:1710
@ STMT_OMP_TARGET_TEAMS_DISTRIBUTE_DIRECTIVE
Definition: ASTBitCodes.h:1916
@ EXPR_ARRAY_INIT_LOOP
An ArrayInitLoopExpr record.
Definition: ASTBitCodes.h:1623
@ STMT_OMP_PARALLEL_MASTER_TASKLOOP_DIRECTIVE
Definition: ASTBitCodes.h:1898
@ STMT_OMP_PARALLEL_MASKED_TASKLOOP_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1903
@ STMT_CONTINUE
A ContinueStmt record.
Definition: ASTBitCodes.h:1518
@ EXPR_PREDEFINED
A PredefinedExpr record.
Definition: ASTBitCodes.h:1542
@ EXPR_CXX_BOOL_LITERAL
A CXXBoolLiteralExpr record.
Definition: ASTBitCodes.h:1793
@ EXPR_PAREN_LIST
A ParenListExpr record.
Definition: ASTBitCodes.h:1566
@ EXPR_CXX_PAREN_LIST_INIT
A CXXParenListInitExpr record.
Definition: ASTBitCodes.h:1796
@ STMT_OMP_MASTER_TASKLOOP_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1897
@ STMT_COMPOUND
A CompoundStmt record.
Definition: ASTBitCodes.h:1482
@ STMT_FOR
A ForStmt record.
Definition: ASTBitCodes.h:1509
@ STMT_ATTRIBUTED
An AttributedStmt record.
Definition: ASTBitCodes.h:1494
@ STMT_OMP_TARGET_TEAMS_GENERIC_LOOP_DIRECTIVE
Definition: ASTBitCodes.h:1926
@ EXPR_CXX_REWRITTEN_BINARY_OPERATOR
A CXXRewrittenBinaryOperator record.
Definition: ASTBitCodes.h:1754
@ STMT_GOTO
A GotoStmt record.
Definition: ASTBitCodes.h:1512
@ EXPR_NO_INIT
An NoInitExpr record.
Definition: ASTBitCodes.h:1620
@ EXPR_OBJC_PROTOCOL_EXPR
An ObjCProtocolExpr record.
Definition: ASTBitCodes.h:1686
@ EXPR_ARRAY_INIT_INDEX
An ArrayInitIndexExpr record.
Definition: ASTBitCodes.h:1626
@ EXPR_CXX_CONSTRUCT
A CXXConstructExpr record.
Definition: ASTBitCodes.h:1757
@ STMT_OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE
Definition: ASTBitCodes.h:1914
@ STMT_OMP_PARALLEL_MASTER_TASKLOOP_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1899
@ STMT_OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1913
@ EXPR_CXX_DYNAMIC_CAST
A CXXDynamicCastExpr record.
Definition: ASTBitCodes.h:1769
@ STMT_CXX_TRY
A CXXTryStmt record.
Definition: ASTBitCodes.h:1742
@ EXPR_GENERIC_SELECTION
A GenericSelectionExpr record.
Definition: ASTBitCodes.h:1659
@ EXPR_OBJC_INDIRECT_COPY_RESTORE
An ObjCIndirectCopyRestoreExpr record.
Definition: ASTBitCodes.h:1707
@ EXPR_CXX_INHERITED_CTOR_INIT
A CXXInheritedCtorInitExpr record.
Definition: ASTBitCodes.h:1760
@ EXPR_CALL
A CallExpr record.
Definition: ASTBitCodes.h:1584
@ EXPR_GNU_NULL
A GNUNullExpr record.
Definition: ASTBitCodes.h:1644
@ EXPR_OBJC_PROPERTY_REF_EXPR
An ObjCPropertyRefExpr record.
Definition: ASTBitCodes.h:1692
@ STMT_OMP_TARGET_PARALLEL_FOR_DIRECTIVE
Definition: ASTBitCodes.h:1889
@ EXPR_CXX_CONST_CAST
A CXXConstCastExpr record.
Definition: ASTBitCodes.h:1775
@ STMT_REF_PTR
A reference to a previously [de]serialized Stmt record.
Definition: ASTBitCodes.h:1476
@ EXPR_OBJC_MESSAGE_EXPR
An ObjCMessageExpr record.
Definition: ASTBitCodes.h:1701
@ STMT_CASE
A CaseStmt record.
Definition: ASTBitCodes.h:1485
@ EXPR_CONSTANT
A constant expression context.
Definition: ASTBitCodes.h:1539
@ STMT_STOP
A marker record that indicates that we are at the end of an expression.
Definition: ASTBitCodes.h:1470
@ STMT_MSASM
A MS-style AsmStmt record.
Definition: ASTBitCodes.h:1536
@ EXPR_CONDITIONAL_OPERATOR
A ConditionOperator record.
Definition: ASTBitCodes.h:1596
@ EXPR_BINARY_OPERATOR
A BinaryOperator record.
Definition: ASTBitCodes.h:1590
@ EXPR_CXX_STD_INITIALIZER_LIST
A CXXStdInitializerListExpr record.
Definition: ASTBitCodes.h:1790
@ EXPR_SHUFFLE_VECTOR
A ShuffleVectorExpr record.
Definition: ASTBitCodes.h:1650
@ STMT_OBJC_FINALLY
An ObjCAtFinallyStmt record.
Definition: ASTBitCodes.h:1716
@ EXPR_OBJC_SELECTOR_EXPR
An ObjCSelectorExpr record.
Definition: ASTBitCodes.h:1683
@ EXPR_FLOATING_LITERAL
A FloatingLiteral record.
Definition: ASTBitCodes.h:1551
@ STMT_NULL_PTR
A NULL expression.
Definition: ASTBitCodes.h:1473
@ STMT_DEFAULT
A DefaultStmt record.
Definition: ASTBitCodes.h:1488
@ EXPR_CHOOSE
A ChooseExpr record.
Definition: ASTBitCodes.h:1641
@ STMT_NULL
A NullStmt record.
Definition: ASTBitCodes.h:1479
@ EXPR_BLOCK
BlockExpr.
Definition: ASTBitCodes.h:1656
@ EXPR_DECL_REF
A DeclRefExpr record.
Definition: ASTBitCodes.h:1545
@ EXPR_INIT_LIST
An InitListExpr record.
Definition: ASTBitCodes.h:1611
@ EXPR_IMPLICIT_VALUE_INIT
An ImplicitValueInitExpr record.
Definition: ASTBitCodes.h:1629
@ STMT_OBJC_AUTORELEASE_POOL
An ObjCAutoreleasePoolStmt record.
Definition: ASTBitCodes.h:1728
@ EXPR_RECOVERY
A RecoveryExpr record.
Definition: ASTBitCodes.h:1668
@ EXPR_PAREN
A ParenExpr record.
Definition: ASTBitCodes.h:1563
@ STMT_OMP_TARGET_PARALLEL_GENERIC_LOOP_DIRECTIVE
Definition: ASTBitCodes.h:1928
@ STMT_LABEL
A LabelStmt record.
Definition: ASTBitCodes.h:1491
@ EXPR_CXX_FUNCTIONAL_CAST
A CXXFunctionalCastExpr record.
Definition: ASTBitCodes.h:1781
@ EXPR_USER_DEFINED_LITERAL
A UserDefinedLiteral record.
Definition: ASTBitCodes.h:1787
@ EXPR_INTEGER_LITERAL
An IntegerLiteral record.
Definition: ASTBitCodes.h:1548
@ EXPR_SOURCE_LOC
A SourceLocExpr record.
Definition: ASTBitCodes.h:1647
@ EXPR_CXX_MEMBER_CALL
A CXXMemberCallExpr record.
Definition: ASTBitCodes.h:1751
@ STMT_SWITCH
A SwitchStmt record.
Definition: ASTBitCodes.h:1500
@ STMT_DECL
A DeclStmt record.
Definition: ASTBitCodes.h:1527
@ EXPR_OBJC_KVC_REF_EXPR
UNUSED.
Definition: ASTBitCodes.h:1698
@ EXPR_SUBST_NON_TYPE_TEMPLATE_PARM_PACK
Definition: ASTBitCodes.h:1832
@ STMT_OMP_MASKED_TASKLOOP_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1901
@ EXPR_SIZEOF_ALIGN_OF
A SizefAlignOfExpr record.
Definition: ASTBitCodes.h:1575
@ STMT_BREAK
A BreakStmt record.
Definition: ASTBitCodes.h:1521
@ STMT_OBJC_AT_THROW
An ObjCAtThrowStmt record.
Definition: ASTBitCodes.h:1725
@ EXPR_ADDR_LABEL
An AddrLabelExpr record.
Definition: ASTBitCodes.h:1635
@ STMT_CXX_FOR_RANGE
A CXXForRangeStmt record.
Definition: ASTBitCodes.h:1745
@ EXPR_CXX_ADDRSPACE_CAST
A CXXAddrspaceCastExpr record.
Definition: ASTBitCodes.h:1778
@ EXPR_ARRAY_SUBSCRIPT
An ArraySubscriptExpr record.
Definition: ASTBitCodes.h:1578
@ EXPR_UNARY_OPERATOR
A UnaryOperator record.
Definition: ASTBitCodes.h:1569
@ STMT_CXX_CATCH
A CXXCatchStmt record.
Definition: ASTBitCodes.h:1739
@ STMT_INDIRECT_GOTO
An IndirectGotoStmt record.
Definition: ASTBitCodes.h:1515
@ DESIG_ARRAY_RANGE
GNU array range designator.
Definition: ASTBitCodes.h:1968
@ DESIG_FIELD_NAME
Field designator where only the field name is known.
Definition: ASTBitCodes.h:1958
@ DESIG_FIELD_DECL
Field designator where the field has been resolved to a declaration.
Definition: ASTBitCodes.h:1962
@ DESIG_ARRAY
Array designator.
Definition: ASTBitCodes.h:1965
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:1066
ArrayTypeTrait
Names for the array type traits.
Definition: TypeTraits.h:42
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
Definition: OpenMPKinds.h:24
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:146
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
OpenACCDirectiveKind
Definition: OpenACCKinds.h:25
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:129
const FunctionProtoType * T
@ Implicit
An implicit conversion.
CharacterLiteralKind
Definition: Expr.h:1584
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
Definition: Specifiers.h:120
unsigned long uint64_t
#define bool
Definition: stdbool.h:20
static ASTConstraintSatisfaction * Create(const ASTContext &C, const ConstraintSatisfaction &Satisfaction)
Definition: ASTConcept.cpp:66
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...
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:1298