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