clang 24.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"
48#include "clang/Lex/Token.h"
51#include "llvm/ADT/DenseMap.h"
52#include "llvm/ADT/SmallVector.h"
53#include "llvm/ADT/StringRef.h"
54#include "llvm/Bitstream/BitstreamReader.h"
55#include "llvm/Support/ErrorHandling.h"
56#include <algorithm>
57#include <cassert>
58#include <cstdint>
59#include <optional>
60#include <string>
61
62using namespace clang;
63using namespace serialization;
64
65namespace clang {
66
67 class ASTStmtReader : public StmtVisitor<ASTStmtReader> {
68 ASTRecordReader &Record;
69 llvm::BitstreamCursor &DeclsCursor;
70
71 std::optional<BitsUnpacker> CurrentUnpackingBits;
72
73 SourceLocation readSourceLocation() {
74 return Record.readSourceLocation();
75 }
76
77 SourceRange readSourceRange() {
78 return Record.readSourceRange();
79 }
80
81 std::string readString() {
82 return Record.readString();
83 }
84
85 TypeSourceInfo *readTypeSourceInfo() {
86 return Record.readTypeSourceInfo();
87 }
88
89 Decl *readDecl() {
90 return Record.readDecl();
91 }
92
93 template<typename T>
94 T *readDeclAs() {
95 return Record.readDeclAs<T>();
96 }
97
98 public:
99 ASTStmtReader(ASTRecordReader &Record, llvm::BitstreamCursor &Cursor)
100 : Record(Record), DeclsCursor(Cursor) {}
101
102 /// The number of record fields required for the Stmt class
103 /// itself.
104 static const unsigned NumStmtFields = 0;
105
106 /// The number of record fields required for the Expr class
107 /// itself.
108 static const unsigned NumExprFields = NumStmtFields + 2;
109
110 /// The number of record fields required for the ObjCObjectLiteral class
111 /// itself (Expr fields + isExpressibleAsConstantInitializer).
112 static const unsigned NumObjCObjectLiteralFields = NumExprFields + 1;
113
114 /// The number of bits required for the packing bits for the Expr class.
115 static const unsigned NumExprBits = 10;
116
117 /// Read and initialize a ExplicitTemplateArgumentList structure.
119 TemplateArgumentLoc *ArgsLocArray,
120 unsigned NumTemplateArgs);
121
122 void VisitStmt(Stmt *S);
123#define STMT(Type, Base) \
124 void Visit##Type(Type *);
125#include "clang/AST/StmtNodes.inc"
126 };
127
128} // namespace clang
129
131 TemplateArgumentLoc *ArgsLocArray,
132 unsigned NumTemplateArgs) {
133 SourceLocation TemplateKWLoc = readSourceLocation();
135 ArgInfo.setLAngleLoc(readSourceLocation());
136 ArgInfo.setRAngleLoc(readSourceLocation());
137 for (unsigned i = 0; i != NumTemplateArgs; ++i)
138 ArgInfo.addArgument(Record.readTemplateArgumentLoc());
139 Args.initializeFrom(TemplateKWLoc, ArgInfo, ArgsLocArray);
140}
141
143 assert(Record.getIdx() == NumStmtFields && "Incorrect statement field count");
144}
145
146void ASTStmtReader::VisitNullStmt(NullStmt *S) {
147 VisitStmt(S);
148 S->setSemiLoc(readSourceLocation());
149 S->NullStmtBits.HasLeadingEmptyMacro = Record.readInt();
150}
151
152void ASTStmtReader::VisitCompoundStmt(CompoundStmt *S) {
153 VisitStmt(S);
155 unsigned NumStmts = Record.readInt();
156 unsigned HasFPFeatures = Record.readInt();
157 assert(S->hasStoredFPFeatures() == HasFPFeatures);
158 while (NumStmts--)
159 Stmts.push_back(Record.readSubStmt());
160 S->setStmts(Stmts);
161 if (HasFPFeatures)
162 S->setStoredFPFeatures(
164 S->LBraceLoc = readSourceLocation();
165 S->RBraceLoc = readSourceLocation();
166}
167
168void ASTStmtReader::VisitSwitchCase(SwitchCase *S) {
169 VisitStmt(S);
170 Record.recordSwitchCaseID(S, Record.readInt());
171 S->setKeywordLoc(readSourceLocation());
172 S->setColonLoc(readSourceLocation());
173}
174
175void ASTStmtReader::VisitCaseStmt(CaseStmt *S) {
176 VisitSwitchCase(S);
177 bool CaseStmtIsGNURange = Record.readInt();
178 S->setLHS(Record.readSubExpr());
179 S->setSubStmt(Record.readSubStmt());
180 if (CaseStmtIsGNURange) {
181 S->setRHS(Record.readSubExpr());
182 S->setEllipsisLoc(readSourceLocation());
183 }
184}
185
186void ASTStmtReader::VisitDefaultStmt(DefaultStmt *S) {
187 VisitSwitchCase(S);
188 S->setSubStmt(Record.readSubStmt());
189}
190
191void ASTStmtReader::VisitLabelStmt(LabelStmt *S) {
192 VisitStmt(S);
193 bool IsSideEntry = Record.readInt();
194 auto *LD = readDeclAs<LabelDecl>();
195 LD->setStmt(S);
196 S->setDecl(LD);
197 S->setSubStmt(Record.readSubStmt());
198 S->setIdentLoc(readSourceLocation());
199 S->setSideEntry(IsSideEntry);
200}
201
202void ASTStmtReader::VisitAttributedStmt(AttributedStmt *S) {
203 VisitStmt(S);
204 // NumAttrs in AttributedStmt is set when creating an empty
205 // AttributedStmt in AttributedStmt::CreateEmpty, since it is needed
206 // to allocate the right amount of space for the trailing Attr *.
207 uint64_t NumAttrs = Record.readInt();
208 AttrVec Attrs;
209 Record.readAttributes(Attrs);
210 (void)NumAttrs;
211 assert(NumAttrs == S->AttributedStmtBits.NumAttrs);
212 assert(NumAttrs == Attrs.size());
213 std::copy(Attrs.begin(), Attrs.end(), S->getAttrArrayPtr());
214 S->SubStmt = Record.readSubStmt();
215 S->AttributedStmtBits.AttrLoc = readSourceLocation();
216}
217
218void ASTStmtReader::VisitIfStmt(IfStmt *S) {
219 VisitStmt(S);
220
221 CurrentUnpackingBits.emplace(Record.readInt());
222
223 bool HasElse = CurrentUnpackingBits->getNextBit();
224 bool HasVar = CurrentUnpackingBits->getNextBit();
225 bool HasInit = CurrentUnpackingBits->getNextBit();
226
227 S->setStatementKind(static_cast<IfStatementKind>(Record.readInt()));
228 S->setCond(Record.readSubExpr());
229 S->setThen(Record.readSubStmt());
230 if (HasElse)
231 S->setElse(Record.readSubStmt());
232 if (HasVar)
233 S->setConditionVariableDeclStmt(cast<DeclStmt>(Record.readSubStmt()));
234 if (HasInit)
235 S->setInit(Record.readSubStmt());
236
237 S->setIfLoc(readSourceLocation());
238 S->setLParenLoc(readSourceLocation());
239 S->setRParenLoc(readSourceLocation());
240 if (HasElse)
241 S->setElseLoc(readSourceLocation());
242}
243
244void ASTStmtReader::VisitSwitchStmt(SwitchStmt *S) {
245 VisitStmt(S);
246
247 bool HasInit = Record.readInt();
248 bool HasVar = Record.readInt();
249 bool AllEnumCasesCovered = Record.readInt();
250 if (AllEnumCasesCovered)
252
253 S->setCond(Record.readSubExpr());
254 S->setBody(Record.readSubStmt());
255 if (HasInit)
256 S->setInit(Record.readSubStmt());
257 if (HasVar)
258 S->setConditionVariableDeclStmt(cast<DeclStmt>(Record.readSubStmt()));
259
260 S->setSwitchLoc(readSourceLocation());
261 S->setLParenLoc(readSourceLocation());
262 S->setRParenLoc(readSourceLocation());
263
264 SwitchCase *PrevSC = nullptr;
265 for (auto E = Record.size(); Record.getIdx() != E; ) {
266 SwitchCase *SC = Record.getSwitchCaseWithID(Record.readInt());
267 if (PrevSC)
268 PrevSC->setNextSwitchCase(SC);
269 else
270 S->setSwitchCaseList(SC);
271
272 PrevSC = SC;
273 }
274}
275
276void ASTStmtReader::VisitWhileStmt(WhileStmt *S) {
277 VisitStmt(S);
278
279 bool HasVar = Record.readInt();
280
281 S->setCond(Record.readSubExpr());
282 S->setBody(Record.readSubStmt());
283 if (HasVar)
284 S->setConditionVariableDeclStmt(cast<DeclStmt>(Record.readSubStmt()));
285
286 S->setWhileLoc(readSourceLocation());
287 S->setLParenLoc(readSourceLocation());
288 S->setRParenLoc(readSourceLocation());
289}
290
291void ASTStmtReader::VisitDoStmt(DoStmt *S) {
292 VisitStmt(S);
293 S->setCond(Record.readSubExpr());
294 S->setBody(Record.readSubStmt());
295 S->setDoLoc(readSourceLocation());
296 S->setWhileLoc(readSourceLocation());
297 S->setRParenLoc(readSourceLocation());
298}
299
300void ASTStmtReader::VisitForStmt(ForStmt *S) {
301 VisitStmt(S);
302 S->setInit(Record.readSubStmt());
303 S->setCond(Record.readSubExpr());
304 S->setConditionVariableDeclStmt(cast_or_null<DeclStmt>(Record.readSubStmt()));
305 S->setInc(Record.readSubExpr());
306 S->setBody(Record.readSubStmt());
307 S->setForLoc(readSourceLocation());
308 S->setLParenLoc(readSourceLocation());
309 S->setRParenLoc(readSourceLocation());
310}
311
312void ASTStmtReader::VisitGotoStmt(GotoStmt *S) {
313 VisitStmt(S);
314 S->setLabel(readDeclAs<LabelDecl>());
315 S->setGotoLoc(readSourceLocation());
316 S->setLabelLoc(readSourceLocation());
317}
318
319void ASTStmtReader::VisitIndirectGotoStmt(IndirectGotoStmt *S) {
320 VisitStmt(S);
321 S->setGotoLoc(readSourceLocation());
322 S->setStarLoc(readSourceLocation());
323 S->setTarget(Record.readSubExpr());
324}
325
326void ASTStmtReader::VisitLoopControlStmt(LoopControlStmt *S) {
327 VisitStmt(S);
328 S->setKwLoc(readSourceLocation());
329 if (Record.readBool()) {
330 S->setLabelDecl(readDeclAs<LabelDecl>());
331 S->setLabelLoc(readSourceLocation());
332 }
333}
334
335void ASTStmtReader::VisitContinueStmt(ContinueStmt *S) {
336 VisitLoopControlStmt(S);
337}
338
339void ASTStmtReader::VisitBreakStmt(BreakStmt *S) { VisitLoopControlStmt(S); }
340
341void ASTStmtReader::VisitDeferStmt(DeferStmt *S) {
342 VisitStmt(S);
343 S->setDeferLoc(readSourceLocation());
344 S->setBody(Record.readSubStmt());
345}
346
347void ASTStmtReader::VisitReturnStmt(ReturnStmt *S) {
348 VisitStmt(S);
349
350 bool HasNRVOCandidate = Record.readInt();
351
352 S->setRetValue(Record.readSubExpr());
353 if (HasNRVOCandidate)
354 S->setNRVOCandidate(readDeclAs<VarDecl>());
355
356 S->setReturnLoc(readSourceLocation());
357}
358
359void ASTStmtReader::VisitDeclStmt(DeclStmt *S) {
360 VisitStmt(S);
361 S->setStartLoc(readSourceLocation());
362 S->setEndLoc(readSourceLocation());
363
364 if (Record.size() - Record.getIdx() == 1) {
365 // Single declaration
366 S->setDeclGroup(DeclGroupRef(readDecl()));
367 } else {
368 SmallVector<Decl *, 16> Decls;
369 int N = Record.size() - Record.getIdx();
370 Decls.reserve(N);
371 for (int I = 0; I < N; ++I)
372 Decls.push_back(readDecl());
373 S->setDeclGroup(DeclGroupRef(DeclGroup::Create(Record.getContext(),
374 Decls.data(),
375 Decls.size())));
376 }
377}
378
379void ASTStmtReader::VisitAsmStmt(AsmStmt *S) {
380 VisitStmt(S);
381 S->NumOutputs = Record.readInt();
382 S->NumInputs = Record.readInt();
383 S->NumClobbers = Record.readInt();
384 S->setAsmLoc(readSourceLocation());
385 S->setVolatile(Record.readInt());
386 S->setSimple(Record.readInt());
387}
388
389void ASTStmtReader::VisitGCCAsmStmt(GCCAsmStmt *S) {
390 VisitAsmStmt(S);
391 S->NumLabels = Record.readInt();
392 S->setRParenLoc(readSourceLocation());
393 S->setAsmStringExpr(cast_or_null<Expr>(Record.readSubStmt()));
394
395 unsigned NumOutputs = S->getNumOutputs();
396 unsigned NumInputs = S->getNumInputs();
397 unsigned NumClobbers = S->getNumClobbers();
398 unsigned NumLabels = S->getNumLabels();
399
400 // Outputs and inputs
401 SmallVector<IdentifierInfo *, 16> Names;
402 SmallVector<Expr *, 16> Constraints;
403 SmallVector<Stmt*, 16> Exprs;
404 for (unsigned I = 0, N = NumOutputs + NumInputs; I != N; ++I) {
405 Names.push_back(Record.readIdentifier());
406 Constraints.push_back(cast_or_null<Expr>(Record.readSubStmt()));
407 Exprs.push_back(Record.readSubStmt());
408 }
409
410 // Constraints
411 SmallVector<Expr *, 16> Clobbers;
412 for (unsigned I = 0; I != NumClobbers; ++I)
413 Clobbers.push_back(cast_or_null<Expr>(Record.readSubStmt()));
414
415 // Labels
416 for (unsigned I = 0, N = NumLabels; I != N; ++I) {
417 Names.push_back(Record.readIdentifier());
418 Exprs.push_back(Record.readSubStmt());
419 }
420
421 S->setOutputsAndInputsAndClobbers(Record.getContext(),
422 Names.data(), Constraints.data(),
423 Exprs.data(), NumOutputs, NumInputs,
424 NumLabels,
425 Clobbers.data(), NumClobbers);
426}
427
428void ASTStmtReader::VisitMSAsmStmt(MSAsmStmt *S) {
429 VisitAsmStmt(S);
430 S->LBraceLoc = readSourceLocation();
431 S->EndLoc = readSourceLocation();
432 S->NumAsmToks = Record.readInt();
433 std::string AsmStr = readString();
434
435 // Read the tokens.
436 SmallVector<Token, 16> AsmToks;
437 AsmToks.reserve(S->NumAsmToks);
438 for (unsigned i = 0, e = S->NumAsmToks; i != e; ++i) {
439 AsmToks.push_back(Record.readToken());
440 }
441
442 // The calls to reserve() for the FooData vectors are mandatory to
443 // prevent dead StringRefs in the Foo vectors.
444
445 // Read the clobbers.
446 SmallVector<std::string, 16> ClobbersData;
447 SmallVector<StringRef, 16> Clobbers;
448 ClobbersData.reserve(S->NumClobbers);
449 Clobbers.reserve(S->NumClobbers);
450 for (unsigned i = 0, e = S->NumClobbers; i != e; ++i) {
451 ClobbersData.push_back(readString());
452 Clobbers.push_back(ClobbersData.back());
453 }
454
455 // Read the operands.
456 unsigned NumOperands = S->NumOutputs + S->NumInputs;
457 SmallVector<Expr*, 16> Exprs;
458 SmallVector<std::string, 16> ConstraintsData;
459 SmallVector<StringRef, 16> Constraints;
460 Exprs.reserve(NumOperands);
461 ConstraintsData.reserve(NumOperands);
462 Constraints.reserve(NumOperands);
463 for (unsigned i = 0; i != NumOperands; ++i) {
464 Exprs.push_back(cast<Expr>(Record.readSubStmt()));
465 ConstraintsData.push_back(readString());
466 Constraints.push_back(ConstraintsData.back());
467 }
468
469 S->initialize(Record.getContext(), AsmStr, AsmToks,
470 Constraints, Exprs, Clobbers);
471}
472
473void ASTStmtReader::VisitCoroutineBodyStmt(CoroutineBodyStmt *S) {
474 VisitStmt(S);
475 assert(Record.peekInt() == S->NumParams);
476 Record.skipInts(1);
477 auto *StoredStmts = S->getStoredStmts();
478 for (unsigned i = 0;
479 i < CoroutineBodyStmt::SubStmt::FirstParamMove + S->NumParams; ++i)
480 StoredStmts[i] = Record.readSubStmt();
481}
482
483void ASTStmtReader::VisitCoreturnStmt(CoreturnStmt *S) {
484 VisitStmt(S);
485 S->CoreturnLoc = Record.readSourceLocation();
486 for (auto &SubStmt: S->SubStmts)
487 SubStmt = Record.readSubStmt();
488 S->IsImplicit = Record.readInt() != 0;
489}
490
491void ASTStmtReader::VisitCoawaitExpr(CoawaitExpr *E) {
492 VisitExpr(E);
493 E->KeywordLoc = readSourceLocation();
494 for (auto &SubExpr: E->SubExprs)
495 SubExpr = Record.readSubStmt();
496 E->OpaqueValue = cast_or_null<OpaqueValueExpr>(Record.readSubStmt());
497 E->setIsImplicit(Record.readInt() != 0);
498}
499
500void ASTStmtReader::VisitCoyieldExpr(CoyieldExpr *E) {
501 VisitExpr(E);
502 E->KeywordLoc = readSourceLocation();
503 for (auto &SubExpr: E->SubExprs)
504 SubExpr = Record.readSubStmt();
505 E->OpaqueValue = cast_or_null<OpaqueValueExpr>(Record.readSubStmt());
506}
507
508void ASTStmtReader::VisitDependentCoawaitExpr(DependentCoawaitExpr *E) {
509 VisitExpr(E);
510 E->KeywordLoc = readSourceLocation();
511 for (auto &SubExpr: E->SubExprs)
512 SubExpr = Record.readSubStmt();
513}
514
515void ASTStmtReader::VisitCapturedStmt(CapturedStmt *S) {
516 VisitStmt(S);
517 Record.skipInts(1);
518 S->setCapturedDecl(readDeclAs<CapturedDecl>());
519 S->setCapturedRegionKind(static_cast<CapturedRegionKind>(Record.readInt()));
520 S->setCapturedRecordDecl(readDeclAs<RecordDecl>());
521
522 // Capture inits
524 E = S->capture_init_end();
525 I != E; ++I)
526 *I = Record.readSubExpr();
527
528 // Body
529 S->setCapturedStmt(Record.readSubStmt());
531
532 // Captures
533 for (auto &I : S->captures()) {
534 I.VarAndKind.setPointer(readDeclAs<VarDecl>());
535 I.VarAndKind.setInt(
536 static_cast<CapturedStmt::VariableCaptureKind>(Record.readInt()));
537 I.Loc = readSourceLocation();
538 }
539}
540
541void ASTStmtReader::VisitCXXReflectExpr(CXXReflectExpr *E) {
542 // TODO(Reflection): Implement this.
543 assert(false && "not implemented yet");
544}
545
546void ASTStmtReader::VisitSYCLKernelCallStmt(SYCLKernelCallStmt *S) {
547 VisitStmt(S);
548 S->setOriginalStmt(cast<CompoundStmt>(Record.readSubStmt()));
549 S->setKernelLaunchStmt(cast<Stmt>(Record.readSubStmt()));
550 S->setOutlinedFunctionDecl(readDeclAs<OutlinedFunctionDecl>());
551}
552
553void ASTStmtReader::VisitExpr(Expr *E) {
554 VisitStmt(E);
555 CurrentUnpackingBits.emplace(Record.readInt());
556 E->setDependence(static_cast<ExprDependence>(
557 CurrentUnpackingBits->getNextBits(/*Width=*/5)));
558 E->setValueKind(static_cast<ExprValueKind>(
559 CurrentUnpackingBits->getNextBits(/*Width=*/2)));
560 E->setObjectKind(static_cast<ExprObjectKind>(
561 CurrentUnpackingBits->getNextBits(/*Width=*/3)));
562
563 E->setType(Record.readType());
564 assert(Record.getIdx() == NumExprFields &&
565 "Incorrect expression field count");
566}
567
568void ASTStmtReader::VisitConstantExpr(ConstantExpr *E) {
569 VisitExpr(E);
570
571 auto StorageKind = static_cast<ConstantResultStorageKind>(Record.readInt());
572 assert(E->getResultStorageKind() == StorageKind && "Wrong ResultKind!");
573
574 E->ConstantExprBits.APValueKind = Record.readInt();
575 E->ConstantExprBits.IsUnsigned = Record.readInt();
576 E->ConstantExprBits.BitWidth = Record.readInt();
577 E->ConstantExprBits.HasCleanup = false; // Not serialized, see below.
578 E->ConstantExprBits.IsImmediateInvocation = Record.readInt();
579
580 switch (StorageKind) {
582 break;
583
585 E->Int64Result() = Record.readInt();
586 break;
587
589 E->APValueResult() = Record.readAPValue();
590 if (E->APValueResult().needsCleanup()) {
591 E->ConstantExprBits.HasCleanup = true;
592 Record.getContext().addDestruction(&E->APValueResult());
593 }
594 break;
595 }
596
597 E->setSubExpr(Record.readSubExpr());
598}
599
600void ASTStmtReader::VisitOpenACCAsteriskSizeExpr(OpenACCAsteriskSizeExpr *E) {
601 VisitExpr(E);
602 E->setAsteriskLocation(readSourceLocation());
603}
604
605void ASTStmtReader::VisitSYCLUniqueStableNameExpr(SYCLUniqueStableNameExpr *E) {
606 VisitExpr(E);
607
608 E->setLocation(readSourceLocation());
609 E->setLParenLocation(readSourceLocation());
610 E->setRParenLocation(readSourceLocation());
611
612 E->setTypeSourceInfo(Record.readTypeSourceInfo());
613}
614
615void ASTStmtReader::VisitUnresolvedSYCLKernelCallStmt(
617 VisitStmt(S);
618
619 S->setOriginalStmt(cast<CompoundStmt>(Record.readSubStmt()));
620 S->setKernelLaunchIdExpr(Record.readExpr());
621}
622
623void ASTStmtReader::VisitPredefinedExpr(PredefinedExpr *E) {
624 VisitExpr(E);
625 bool HasFunctionName = Record.readInt();
626 E->PredefinedExprBits.HasFunctionName = HasFunctionName;
627 E->PredefinedExprBits.Kind = Record.readInt();
628 E->PredefinedExprBits.IsTransparent = Record.readInt();
629 E->setLocation(readSourceLocation());
630 if (HasFunctionName)
631 E->setFunctionName(cast<StringLiteral>(Record.readSubExpr()));
632}
633
634void ASTStmtReader::VisitDeclRefExpr(DeclRefExpr *E) {
635 VisitExpr(E);
636
637 CurrentUnpackingBits.emplace(Record.readInt());
638 E->DeclRefExprBits.HadMultipleCandidates = CurrentUnpackingBits->getNextBit();
639 E->DeclRefExprBits.RefersToEnclosingVariableOrCapture =
640 CurrentUnpackingBits->getNextBit();
641 E->DeclRefExprBits.NonOdrUseReason =
642 CurrentUnpackingBits->getNextBits(/*Width=*/2);
643 E->DeclRefExprBits.IsImmediateEscalating = CurrentUnpackingBits->getNextBit();
644 E->DeclRefExprBits.HasFoundDecl = CurrentUnpackingBits->getNextBit();
645 E->DeclRefExprBits.HasQualifier = CurrentUnpackingBits->getNextBit();
646 E->DeclRefExprBits.HasTemplateKWAndArgsInfo =
647 CurrentUnpackingBits->getNextBit();
648 E->DeclRefExprBits.CapturedByCopyInLambdaWithExplicitObjectParameter = false;
649 unsigned NumTemplateArgs = 0;
651 NumTemplateArgs = Record.readInt();
652
653 if (E->hasQualifier())
654 new (E->getTrailingObjects<NestedNameSpecifierLoc>())
655 NestedNameSpecifierLoc(Record.readNestedNameSpecifierLoc());
656
657 if (E->hasFoundDecl())
658 *E->getTrailingObjects<NamedDecl *>() = readDeclAs<NamedDecl>();
659
662 *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
663 E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs);
664
665 E->D = readDeclAs<ValueDecl>();
666 E->setLocation(readSourceLocation());
667 E->DNLoc = Record.readDeclarationNameLoc(E->getDecl()->getDeclName());
668}
669
670void ASTStmtReader::VisitIntegerLiteral(IntegerLiteral *E) {
671 VisitExpr(E);
672 E->setLocation(readSourceLocation());
673 E->setValue(Record.getContext(), Record.readAPInt());
674}
675
676void ASTStmtReader::VisitFixedPointLiteral(FixedPointLiteral *E) {
677 VisitExpr(E);
678 E->setLocation(readSourceLocation());
679 E->setScale(Record.readInt());
680 E->setValue(Record.getContext(), Record.readAPInt());
681}
682
683void ASTStmtReader::VisitFloatingLiteral(FloatingLiteral *E) {
684 VisitExpr(E);
686 static_cast<llvm::APFloatBase::Semantics>(Record.readInt()));
687 E->setExact(Record.readInt());
688 E->setValue(Record.getContext(), Record.readAPFloat(E->getSemantics()));
689 E->setLocation(readSourceLocation());
690}
691
692void ASTStmtReader::VisitImaginaryLiteral(ImaginaryLiteral *E) {
693 VisitExpr(E);
694 E->setSubExpr(Record.readSubExpr());
695}
696
697void ASTStmtReader::VisitStringLiteral(StringLiteral *E) {
698 VisitExpr(E);
699
700 // NumConcatenated, Length and CharByteWidth are set by the empty
701 // ctor since they are needed to allocate storage for the trailing objects.
702 unsigned NumConcatenated = Record.readInt();
703 unsigned Length = Record.readInt();
704 unsigned CharByteWidth = Record.readInt();
705 assert((NumConcatenated == E->getNumConcatenated()) &&
706 "Wrong number of concatenated tokens!");
707 assert((Length == E->getLength()) && "Wrong Length!");
708 assert((CharByteWidth == E->getCharByteWidth()) && "Wrong character width!");
709 E->StringLiteralBits.Kind = Record.readInt();
710 E->StringLiteralBits.IsPascal = Record.readInt();
711
712 // The character width is originally computed via mapCharByteWidth.
713 // Check that the deserialized character width is consistant with the result
714 // of calling mapCharByteWidth.
715 assert((CharByteWidth ==
716 StringLiteral::mapCharByteWidth(Record.getContext().getTargetInfo(),
717 E->getKind())) &&
718 "Wrong character width!");
719
720 // Deserialize the trailing array of SourceLocation.
721 for (unsigned I = 0; I < NumConcatenated; ++I)
722 E->setStrTokenLoc(I, readSourceLocation());
723
724 // Deserialize the trailing array of char holding the string data.
725 char *StrData = E->getStrDataAsChar();
726 for (unsigned I = 0; I < Length * CharByteWidth; ++I)
727 StrData[I] = Record.readInt();
728}
729
730void ASTStmtReader::VisitCharacterLiteral(CharacterLiteral *E) {
731 VisitExpr(E);
732 E->setValue(Record.readInt());
733 E->setLocation(readSourceLocation());
734 E->setKind(static_cast<CharacterLiteralKind>(Record.readInt()));
735}
736
737void ASTStmtReader::VisitParenExpr(ParenExpr *E) {
738 VisitExpr(E);
739 E->setIsProducedByFoldExpansion(Record.readInt());
740 E->setLParen(readSourceLocation());
741 E->setRParen(readSourceLocation());
742 E->setSubExpr(Record.readSubExpr());
743}
744
745void ASTStmtReader::VisitParenListExpr(ParenListExpr *E) {
746 VisitExpr(E);
747 unsigned NumExprs = Record.readInt();
748 assert((NumExprs == E->getNumExprs()) && "Wrong NumExprs!");
749 for (unsigned I = 0; I != NumExprs; ++I)
750 E->getTrailingObjects()[I] = Record.readSubStmt();
751 E->LParenLoc = readSourceLocation();
752 E->RParenLoc = readSourceLocation();
753}
754
755void ASTStmtReader::VisitUnaryOperator(UnaryOperator *E) {
756 VisitExpr(E);
757 bool hasFP_Features = CurrentUnpackingBits->getNextBit();
758 assert(hasFP_Features == E->hasStoredFPFeatures());
759 E->setSubExpr(Record.readSubExpr());
760 E->setOpcode(
761 (UnaryOperator::Opcode)CurrentUnpackingBits->getNextBits(/*Width=*/5));
762 E->setOperatorLoc(readSourceLocation());
763 E->setCanOverflow(CurrentUnpackingBits->getNextBit());
764 if (hasFP_Features)
766 FPOptionsOverride::getFromOpaqueInt(Record.readInt()));
767}
768
769void ASTStmtReader::VisitOffsetOfExpr(OffsetOfExpr *E) {
770 VisitExpr(E);
771 assert(E->getNumComponents() == Record.peekInt());
772 Record.skipInts(1);
773 assert(E->getNumExpressions() == Record.peekInt());
774 Record.skipInts(1);
775 E->setOperatorLoc(readSourceLocation());
776 E->setRParenLoc(readSourceLocation());
777 E->setTypeSourceInfo(readTypeSourceInfo());
778 for (unsigned I = 0, N = E->getNumComponents(); I != N; ++I) {
779 auto Kind = static_cast<OffsetOfNode::Kind>(Record.readInt());
780 SourceLocation Start = readSourceLocation();
781 SourceLocation End = readSourceLocation();
782 switch (Kind) {
784 E->setComponent(I, OffsetOfNode(Start, Record.readInt(), End));
785 break;
786
788 E->setComponent(
789 I, OffsetOfNode(Start, readDeclAs<FieldDecl>(), End));
790 break;
791
793 E->setComponent(
794 I,
795 OffsetOfNode(Start, Record.readIdentifier(), End));
796 break;
797
798 case OffsetOfNode::Base: {
799 auto *Base = new (Record.getContext()) CXXBaseSpecifier();
800 *Base = Record.readCXXBaseSpecifier();
801 E->setComponent(I, OffsetOfNode(Base));
802 break;
803 }
804 }
805 }
806
807 for (unsigned I = 0, N = E->getNumExpressions(); I != N; ++I)
808 E->setIndexExpr(I, Record.readSubExpr());
809}
810
811void ASTStmtReader::VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *E) {
812 VisitExpr(E);
813 E->setKind(static_cast<UnaryExprOrTypeTrait>(Record.readInt()));
814 if (Record.peekInt() == 0) {
815 E->setArgument(Record.readSubExpr());
816 Record.skipInts(1);
817 } else {
818 E->setArgument(readTypeSourceInfo());
819 }
820 E->setOperatorLoc(readSourceLocation());
821 E->setRParenLoc(readSourceLocation());
822}
823
826 ConstraintSatisfaction Satisfaction;
827 Satisfaction.IsSatisfied = Record.readInt();
828 Satisfaction.ContainsErrors = Record.readInt();
829 const ASTContext &C = Record.getContext();
830 if (!Satisfaction.IsSatisfied) {
831 unsigned NumDetailRecords = Record.readInt();
832 for (unsigned i = 0; i != NumDetailRecords; ++i) {
833 auto Kind = Record.readInt();
834 if (Kind == 0) {
835 SourceLocation DiagLocation = Record.readSourceLocation();
836 StringRef DiagMessage = C.backupStr(Record.readString());
837
838 Satisfaction.Details.emplace_back(new (
839 C) ConstraintSubstitutionDiagnostic(DiagLocation, DiagMessage));
840 } else if (Kind == 1) {
841 Satisfaction.Details.emplace_back(Record.readExpr());
842 } else {
843 assert(Kind == 2);
844 Satisfaction.Details.emplace_back(Record.readConceptReference());
845 }
846 }
847 }
848 return Satisfaction;
849}
850
851void ASTStmtReader::VisitConceptSpecializationExpr(
853 VisitExpr(E);
854 E->SpecDecl = Record.readDeclAs<ImplicitConceptSpecializationDecl>();
855 if (Record.readBool())
856 E->ConceptRef = Record.readConceptReference();
857 E->Satisfaction = E->isValueDependent() ? nullptr :
858 ASTConstraintSatisfaction::Create(Record.getContext(),
860}
861
864 const ASTContext &C = Record.getContext();
865 StringRef SubstitutedEntity = C.backupStr(Record.readString());
866 SourceLocation DiagLoc = Record.readSourceLocation();
867 StringRef DiagMessage = C.backupStr(Record.readString());
868
869 return new (Record.getContext())
870 concepts::Requirement::SubstitutionDiagnostic{SubstitutedEntity, DiagLoc,
871 DiagMessage};
872}
873
874void ASTStmtReader::VisitRequiresExpr(RequiresExpr *E) {
875 VisitExpr(E);
876 unsigned NumLocalParameters = Record.readInt();
877 unsigned NumRequirements = Record.readInt();
878 E->RequiresExprBits.RequiresKWLoc = Record.readSourceLocation();
879 E->RequiresExprBits.IsSatisfied = Record.readInt();
880 E->Body = Record.readDeclAs<RequiresExprBodyDecl>();
881 llvm::SmallVector<ParmVarDecl *, 4> LocalParameters;
882 for (unsigned i = 0; i < NumLocalParameters; ++i)
883 LocalParameters.push_back(cast<ParmVarDecl>(Record.readDecl()));
884 std::copy(LocalParameters.begin(), LocalParameters.end(),
885 E->getTrailingObjects<ParmVarDecl *>());
886 llvm::SmallVector<concepts::Requirement *, 4> Requirements;
887 for (unsigned i = 0; i < NumRequirements; ++i) {
888 auto RK =
889 static_cast<concepts::Requirement::RequirementKind>(Record.readInt());
890 concepts::Requirement *R = nullptr;
891 switch (RK) {
893 auto Status =
895 Record.readInt());
897 R = new (Record.getContext())
898 concepts::TypeRequirement(readSubstitutionDiagnostic(Record));
899 else
900 R = new (Record.getContext())
901 concepts::TypeRequirement(Record.readTypeSourceInfo());
902 } break;
905 auto Status =
907 Record.readInt());
908 llvm::PointerUnion<concepts::Requirement::SubstitutionDiagnostic *,
909 Expr *> E;
911 E = readSubstitutionDiagnostic(Record);
912 } else
913 E = Record.readExpr();
914
915 std::optional<concepts::ExprRequirement::ReturnTypeRequirement> Req;
916 ConceptSpecializationExpr *SubstitutedConstraintExpr = nullptr;
917 SourceLocation NoexceptLoc;
919 Req.emplace();
920 } else {
921 NoexceptLoc = Record.readSourceLocation();
922 switch (/* returnTypeRequirementKind */Record.readInt()) {
923 case 0:
924 // No return type requirement.
925 Req.emplace();
926 break;
927 case 1: {
928 // type-constraint
929 TemplateParameterList *TPL = Record.readTemplateParameterList();
930 if (Status >=
932 SubstitutedConstraintExpr =
933 cast<ConceptSpecializationExpr>(Record.readExpr());
934 Req.emplace(TPL);
935 } break;
936 case 2:
937 // Substitution failure
938 Req.emplace(readSubstitutionDiagnostic(Record));
939 break;
940 }
941 }
942 if (Expr *Ex = dyn_cast<Expr *>(E))
943 R = new (Record.getContext()) concepts::ExprRequirement(
944 Ex, RK == concepts::Requirement::RK_Simple, NoexceptLoc,
945 std::move(*Req), Status, SubstitutedConstraintExpr);
946 else
947 R = new (Record.getContext()) concepts::ExprRequirement(
949 RK == concepts::Requirement::RK_Simple, NoexceptLoc,
950 std::move(*Req));
951 } break;
953 ASTContext &C = Record.getContext();
954 bool HasInvalidConstraint = Record.readInt();
955 if (HasInvalidConstraint) {
956 StringRef InvalidConstraint = C.backupStr(Record.readString());
957 R = new (C) concepts::NestedRequirement(
958 Record.getContext(), InvalidConstraint,
960 break;
961 }
962 Expr *E = Record.readExpr();
964 R = new (C) concepts::NestedRequirement(E);
965 else
966 R = new (C) concepts::NestedRequirement(
967 C, E, readConstraintSatisfaction(Record));
968 } break;
969 }
970 if (!R)
971 continue;
972 Requirements.push_back(R);
973 }
974 std::copy(Requirements.begin(), Requirements.end(),
975 E->getTrailingObjects<concepts::Requirement *>());
976 E->LParenLoc = Record.readSourceLocation();
977 E->RParenLoc = Record.readSourceLocation();
978 E->RBraceLoc = Record.readSourceLocation();
979}
980
981void ASTStmtReader::VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
982 VisitExpr(E);
983 E->setLHS(Record.readSubExpr());
984 E->setRHS(Record.readSubExpr());
985 E->setRBracketLoc(readSourceLocation());
986}
987
988void ASTStmtReader::VisitMatrixSingleSubscriptExpr(
990 VisitExpr(E);
991 E->setBase(Record.readSubExpr());
992 E->setRowIdx(Record.readSubExpr());
993 E->setRBracketLoc(readSourceLocation());
994}
995
996void ASTStmtReader::VisitMatrixSubscriptExpr(MatrixSubscriptExpr *E) {
997 VisitExpr(E);
998 E->setBase(Record.readSubExpr());
999 E->setRowIdx(Record.readSubExpr());
1000 E->setColumnIdx(Record.readSubExpr());
1001 E->setRBracketLoc(readSourceLocation());
1002}
1003
1004void ASTStmtReader::VisitArraySectionExpr(ArraySectionExpr *E) {
1005 VisitExpr(E);
1006 E->ASType = Record.readEnum<ArraySectionExpr::ArraySectionType>();
1007
1008 E->setBase(Record.readSubExpr());
1009 E->setLowerBound(Record.readSubExpr());
1010 E->setLength(Record.readSubExpr());
1011
1012 if (E->isOMPArraySection())
1013 E->setStride(Record.readSubExpr());
1014
1015 E->setColonLocFirst(readSourceLocation());
1016
1017 if (E->isOMPArraySection())
1018 E->setColonLocSecond(readSourceLocation());
1019
1020 E->setRBracketLoc(readSourceLocation());
1021}
1022
1023void ASTStmtReader::VisitOMPArrayShapingExpr(OMPArrayShapingExpr *E) {
1024 VisitExpr(E);
1025 unsigned NumDims = Record.readInt();
1026 E->setBase(Record.readSubExpr());
1027 SmallVector<Expr *, 4> Dims(NumDims);
1028 for (unsigned I = 0; I < NumDims; ++I)
1029 Dims[I] = Record.readSubExpr();
1030 E->setDimensions(Dims);
1031 SmallVector<SourceRange, 4> SRs(NumDims);
1032 for (unsigned I = 0; I < NumDims; ++I)
1033 SRs[I] = readSourceRange();
1034 E->setBracketsRanges(SRs);
1035 E->setLParenLoc(readSourceLocation());
1036 E->setRParenLoc(readSourceLocation());
1037}
1038
1039void ASTStmtReader::VisitOMPIteratorExpr(OMPIteratorExpr *E) {
1040 VisitExpr(E);
1041 unsigned NumIters = Record.readInt();
1042 E->setIteratorKwLoc(readSourceLocation());
1043 E->setLParenLoc(readSourceLocation());
1044 E->setRParenLoc(readSourceLocation());
1045 for (unsigned I = 0; I < NumIters; ++I) {
1046 E->setIteratorDeclaration(I, Record.readDeclRef());
1047 E->setAssignmentLoc(I, readSourceLocation());
1048 Expr *Begin = Record.readSubExpr();
1049 Expr *End = Record.readSubExpr();
1050 Expr *Step = Record.readSubExpr();
1051 SourceLocation ColonLoc = readSourceLocation();
1052 SourceLocation SecColonLoc;
1053 if (Step)
1054 SecColonLoc = readSourceLocation();
1055 E->setIteratorRange(I, Begin, ColonLoc, End, SecColonLoc, Step);
1056 // Deserialize helpers
1057 OMPIteratorHelperData HD;
1058 HD.CounterVD = cast_or_null<VarDecl>(Record.readDeclRef());
1059 HD.Upper = Record.readSubExpr();
1060 HD.Update = Record.readSubExpr();
1061 HD.CounterUpdate = Record.readSubExpr();
1062 E->setHelper(I, HD);
1063 }
1064}
1065
1066void ASTStmtReader::VisitCallExpr(CallExpr *E) {
1067 VisitExpr(E);
1068
1069 unsigned NumArgs = Record.readInt();
1070 CurrentUnpackingBits.emplace(Record.readInt());
1071 E->setADLCallKind(
1072 static_cast<CallExpr::ADLCallKind>(CurrentUnpackingBits->getNextBit()));
1073 bool HasFPFeatures = CurrentUnpackingBits->getNextBit();
1074 E->setCoroElideSafe(CurrentUnpackingBits->getNextBit());
1075 E->setUsesMemberSyntax(CurrentUnpackingBits->getNextBit());
1076 assert((NumArgs == E->getNumArgs()) && "Wrong NumArgs!");
1077 E->setRParenLoc(readSourceLocation());
1078 E->setCallee(Record.readSubExpr());
1079 for (unsigned I = 0; I != NumArgs; ++I)
1080 E->setArg(I, Record.readSubExpr());
1081
1082 if (HasFPFeatures)
1084 FPOptionsOverride::getFromOpaqueInt(Record.readInt()));
1085
1086 if (E->getStmtClass() == Stmt::CallExprClass)
1087 E->updateTrailingSourceLoc();
1088}
1089
1090void ASTStmtReader::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) {
1091 VisitCallExpr(E);
1092}
1093
1094void ASTStmtReader::VisitMemberExpr(MemberExpr *E) {
1095 VisitExpr(E);
1096
1097 CurrentUnpackingBits.emplace(Record.readInt());
1098 bool HasQualifier = CurrentUnpackingBits->getNextBit();
1099 bool HasFoundDecl = CurrentUnpackingBits->getNextBit();
1100 bool HasTemplateInfo = CurrentUnpackingBits->getNextBit();
1101 unsigned NumTemplateArgs = Record.readInt();
1102
1103 E->Base = Record.readSubExpr();
1104 E->MemberDecl = Record.readDeclAs<ValueDecl>();
1105 E->MemberDNLoc = Record.readDeclarationNameLoc(E->MemberDecl->getDeclName());
1106 E->MemberLoc = Record.readSourceLocation();
1107 E->MemberExprBits.IsArrow = CurrentUnpackingBits->getNextBit();
1108 E->MemberExprBits.HasQualifier = HasQualifier;
1109 E->MemberExprBits.HasFoundDecl = HasFoundDecl;
1110 E->MemberExprBits.HasTemplateKWAndArgsInfo = HasTemplateInfo;
1111 E->MemberExprBits.HadMultipleCandidates = CurrentUnpackingBits->getNextBit();
1112 E->MemberExprBits.NonOdrUseReason =
1113 CurrentUnpackingBits->getNextBits(/*Width=*/2);
1114 E->MemberExprBits.OperatorLoc = Record.readSourceLocation();
1115
1116 if (HasQualifier)
1117 new (E->getTrailingObjects<NestedNameSpecifierLoc>())
1118 NestedNameSpecifierLoc(Record.readNestedNameSpecifierLoc());
1119
1120 if (HasFoundDecl) {
1121 auto *FoundD = Record.readDeclAs<NamedDecl>();
1122 auto AS = (AccessSpecifier)CurrentUnpackingBits->getNextBits(/*Width=*/2);
1123 *E->getTrailingObjects<DeclAccessPair>() = DeclAccessPair::make(FoundD, AS);
1124 }
1125
1126 if (HasTemplateInfo)
1128 *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
1129 E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs);
1130}
1131
1132void ASTStmtReader::VisitObjCIsaExpr(ObjCIsaExpr *E) {
1133 VisitExpr(E);
1134 E->setBase(Record.readSubExpr());
1135 E->setIsaMemberLoc(readSourceLocation());
1136 E->setOpLoc(readSourceLocation());
1137 E->setArrow(Record.readInt());
1138}
1139
1140void ASTStmtReader::
1141VisitObjCIndirectCopyRestoreExpr(ObjCIndirectCopyRestoreExpr *E) {
1142 VisitExpr(E);
1143 E->Operand = Record.readSubExpr();
1144 E->setShouldCopy(Record.readInt());
1145}
1146
1147void ASTStmtReader::VisitObjCBridgedCastExpr(ObjCBridgedCastExpr *E) {
1148 VisitExplicitCastExpr(E);
1149 E->LParenLoc = readSourceLocation();
1150 E->BridgeKeywordLoc = readSourceLocation();
1151 E->Kind = Record.readInt();
1152}
1153
1154void ASTStmtReader::VisitCastExpr(CastExpr *E) {
1155 VisitExpr(E);
1156 unsigned NumBaseSpecs = Record.readInt();
1157 assert(NumBaseSpecs == E->path_size());
1158
1159 CurrentUnpackingBits.emplace(Record.readInt());
1160 E->setCastKind((CastKind)CurrentUnpackingBits->getNextBits(/*Width=*/7));
1161 unsigned HasFPFeatures = CurrentUnpackingBits->getNextBit();
1162 assert(E->hasStoredFPFeatures() == HasFPFeatures);
1163
1164 E->setSubExpr(Record.readSubExpr());
1165
1167 while (NumBaseSpecs--) {
1168 auto *BaseSpec = new (Record.getContext()) CXXBaseSpecifier;
1169 *BaseSpec = Record.readCXXBaseSpecifier();
1170 *BaseI++ = BaseSpec;
1171 }
1172 if (HasFPFeatures)
1173 *E->getTrailingFPFeatures() =
1174 FPOptionsOverride::getFromOpaqueInt(Record.readInt());
1175}
1176
1177void ASTStmtReader::VisitBinaryOperator(BinaryOperator *E) {
1178 VisitExpr(E);
1179 CurrentUnpackingBits.emplace(Record.readInt());
1180 E->setOpcode(
1181 (BinaryOperator::Opcode)CurrentUnpackingBits->getNextBits(/*Width=*/6));
1182 bool hasFP_Features = CurrentUnpackingBits->getNextBit();
1183 E->setHasStoredFPFeatures(hasFP_Features);
1184 E->setExcludedOverflowPattern(CurrentUnpackingBits->getNextBit());
1185 E->setLHS(Record.readSubExpr());
1186 E->setRHS(Record.readSubExpr());
1187 E->setOperatorLoc(readSourceLocation());
1188 if (hasFP_Features)
1190 FPOptionsOverride::getFromOpaqueInt(Record.readInt()));
1191}
1192
1193void ASTStmtReader::VisitCompoundAssignOperator(CompoundAssignOperator *E) {
1194 VisitBinaryOperator(E);
1195 E->setComputationLHSType(Record.readType());
1196 E->setComputationResultType(Record.readType());
1197}
1198
1199void ASTStmtReader::VisitConditionalOperator(ConditionalOperator *E) {
1200 VisitExpr(E);
1201 E->SubExprs[ConditionalOperator::COND] = Record.readSubExpr();
1202 E->SubExprs[ConditionalOperator::LHS] = Record.readSubExpr();
1203 E->SubExprs[ConditionalOperator::RHS] = Record.readSubExpr();
1204 E->QuestionLoc = readSourceLocation();
1205 E->ColonLoc = readSourceLocation();
1206}
1207
1208void
1209ASTStmtReader::VisitBinaryConditionalOperator(BinaryConditionalOperator *E) {
1210 VisitExpr(E);
1211 E->OpaqueValue = cast<OpaqueValueExpr>(Record.readSubExpr());
1212 E->SubExprs[BinaryConditionalOperator::COMMON] = Record.readSubExpr();
1213 E->SubExprs[BinaryConditionalOperator::COND] = Record.readSubExpr();
1214 E->SubExprs[BinaryConditionalOperator::LHS] = Record.readSubExpr();
1215 E->SubExprs[BinaryConditionalOperator::RHS] = Record.readSubExpr();
1216 E->QuestionLoc = readSourceLocation();
1217 E->ColonLoc = readSourceLocation();
1218}
1219
1220void ASTStmtReader::VisitImplicitCastExpr(ImplicitCastExpr *E) {
1221 VisitCastExpr(E);
1222 E->setIsPartOfExplicitCast(CurrentUnpackingBits->getNextBit());
1223}
1224
1225void ASTStmtReader::VisitExplicitCastExpr(ExplicitCastExpr *E) {
1226 VisitCastExpr(E);
1227 E->setTypeInfoAsWritten(readTypeSourceInfo());
1228}
1229
1230void ASTStmtReader::VisitCStyleCastExpr(CStyleCastExpr *E) {
1231 VisitExplicitCastExpr(E);
1232 E->setLParenLoc(readSourceLocation());
1233 E->setRParenLoc(readSourceLocation());
1234}
1235
1236void ASTStmtReader::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
1237 VisitExpr(E);
1238 E->setLParenLoc(readSourceLocation());
1239 E->setTypeSourceInfo(readTypeSourceInfo());
1240 E->setInitializer(Record.readSubExpr());
1241 E->setFileScope(Record.readInt());
1242}
1243
1244void ASTStmtReader::VisitExtVectorElementExpr(ExtVectorElementExpr *E) {
1245 VisitExpr(E);
1246 E->setBase(Record.readSubExpr());
1247 E->setAccessor(Record.readIdentifier());
1248 E->setAccessorLoc(readSourceLocation());
1249}
1250
1251void ASTStmtReader::VisitMatrixElementExpr(MatrixElementExpr *E) {
1252 VisitExpr(E);
1253 E->setBase(Record.readSubExpr());
1254 E->setAccessor(Record.readIdentifier());
1255 E->setAccessorLoc(readSourceLocation());
1256}
1257
1258void ASTStmtReader::VisitInitListExpr(InitListExpr *E) {
1259 VisitExpr(E);
1260 if (auto *SyntForm = cast_or_null<InitListExpr>(Record.readSubStmt()))
1261 E->setSyntacticForm(SyntForm);
1262 E->setLBraceLoc(readSourceLocation());
1263 E->setRBraceLoc(readSourceLocation());
1264 bool isArrayFiller = Record.readInt();
1265 Expr *filler = nullptr;
1266 if (isArrayFiller) {
1267 filler = Record.readSubExpr();
1268 E->ArrayFillerOrUnionFieldInit = filler;
1269 } else
1270 E->ArrayFillerOrUnionFieldInit = readDeclAs<FieldDecl>();
1271 E->sawArrayRangeDesignator(Record.readInt());
1272 unsigned NumInits = Record.readInt();
1273 E->reserveInits(Record.getContext(), NumInits);
1274 if (isArrayFiller) {
1275 for (unsigned I = 0; I != NumInits; ++I) {
1276 Expr *init = Record.readSubExpr();
1277 E->updateInit(Record.getContext(), I, init ? init : filler);
1278 }
1279 } else {
1280 for (unsigned I = 0; I != NumInits; ++I)
1281 E->updateInit(Record.getContext(), I, Record.readSubExpr());
1282 }
1283 E->InitListExprBits.IsExplicit = Record.readBool();
1284}
1285
1286void ASTStmtReader::VisitDesignatedInitExpr(DesignatedInitExpr *E) {
1287 using Designator = DesignatedInitExpr::Designator;
1288
1289 VisitExpr(E);
1290 unsigned NumSubExprs = Record.readInt();
1291 assert(NumSubExprs == E->getNumSubExprs() && "Wrong number of subexprs");
1292 for (unsigned I = 0; I != NumSubExprs; ++I)
1293 E->setSubExpr(I, Record.readSubExpr());
1294 E->setEqualOrColonLoc(readSourceLocation());
1295 E->setGNUSyntax(Record.readInt());
1296
1297 SmallVector<Designator, 4> Designators;
1298 while (Record.getIdx() < Record.size()) {
1299 switch ((DesignatorTypes)Record.readInt()) {
1300 case DESIG_FIELD_DECL: {
1301 auto *Field = readDeclAs<FieldDecl>();
1302 SourceLocation DotLoc = readSourceLocation();
1303 SourceLocation FieldLoc = readSourceLocation();
1304 Designators.push_back(Designator::CreateFieldDesignator(
1305 Field->getIdentifier(), DotLoc, FieldLoc));
1306 Designators.back().setFieldDecl(Field);
1307 break;
1308 }
1309
1310 case DESIG_FIELD_NAME: {
1311 const IdentifierInfo *Name = Record.readIdentifier();
1312 SourceLocation DotLoc = readSourceLocation();
1313 SourceLocation FieldLoc = readSourceLocation();
1314 Designators.push_back(Designator::CreateFieldDesignator(Name, DotLoc,
1315 FieldLoc));
1316 break;
1317 }
1318
1319 case DESIG_ARRAY: {
1320 unsigned Index = Record.readInt();
1321 SourceLocation LBracketLoc = readSourceLocation();
1322 SourceLocation RBracketLoc = readSourceLocation();
1323 Designators.push_back(Designator::CreateArrayDesignator(Index,
1324 LBracketLoc,
1325 RBracketLoc));
1326 break;
1327 }
1328
1329 case DESIG_ARRAY_RANGE: {
1330 unsigned Index = Record.readInt();
1331 SourceLocation LBracketLoc = readSourceLocation();
1332 SourceLocation EllipsisLoc = readSourceLocation();
1333 SourceLocation RBracketLoc = readSourceLocation();
1334 Designators.push_back(Designator::CreateArrayRangeDesignator(
1335 Index, LBracketLoc, EllipsisLoc, RBracketLoc));
1336 break;
1337 }
1338 }
1339 }
1340 E->setDesignators(Record.getContext(),
1341 Designators.data(), Designators.size());
1342}
1343
1344void ASTStmtReader::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) {
1345 VisitExpr(E);
1346 E->setBase(Record.readSubExpr());
1347 E->setUpdater(Record.readSubExpr());
1348}
1349
1350void ASTStmtReader::VisitNoInitExpr(NoInitExpr *E) {
1351 VisitExpr(E);
1352}
1353
1354void ASTStmtReader::VisitArrayInitLoopExpr(ArrayInitLoopExpr *E) {
1355 VisitExpr(E);
1356 E->SubExprs[0] = Record.readSubExpr();
1357 E->SubExprs[1] = Record.readSubExpr();
1358}
1359
1360void ASTStmtReader::VisitArrayInitIndexExpr(ArrayInitIndexExpr *E) {
1361 VisitExpr(E);
1362}
1363
1364void ASTStmtReader::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) {
1365 VisitExpr(E);
1366}
1367
1368void ASTStmtReader::VisitVAArgExpr(VAArgExpr *E) {
1369 VisitExpr(E);
1370 E->setSubExpr(Record.readSubExpr());
1371 E->setWrittenTypeInfo(readTypeSourceInfo());
1372 E->setBuiltinLoc(readSourceLocation());
1373 E->setRParenLoc(readSourceLocation());
1374 E->setVarargABI(static_cast<clang::VAArgExpr::VarArgKind>(Record.readInt()));
1375}
1376
1377void ASTStmtReader::VisitSourceLocExpr(SourceLocExpr *E) {
1378 VisitExpr(E);
1379 E->ParentContext = readDeclAs<DeclContext>();
1380 E->BuiltinLoc = readSourceLocation();
1381 E->RParenLoc = readSourceLocation();
1382 E->SourceLocExprBits.Kind = Record.readInt();
1383}
1384
1385void ASTStmtReader::VisitEmbedExpr(EmbedExpr *E) {
1386 VisitExpr(E);
1387 E->EmbedKeywordLoc = readSourceLocation();
1388 EmbedDataStorage *Data = new (Record.getContext()) EmbedDataStorage;
1389 Data->BinaryData = cast<StringLiteral>(Record.readSubStmt());
1390 E->Data = Data;
1391 E->Begin = Record.readUInt32();
1392 E->NumOfElements = Record.readUInt32();
1393 ASTContext &Ctx = Record.getContext();
1394 E->Ctx = &Ctx;
1395 E->setType(Ctx.IntTy);
1396 E->FakeChildNode = IntegerLiteral::Create(
1397 Ctx, llvm::APInt::getZero(Ctx.getTypeSize(E->getType())), E->getType(),
1398 E->EmbedKeywordLoc);
1399}
1400
1401void ASTStmtReader::VisitAddrLabelExpr(AddrLabelExpr *E) {
1402 VisitExpr(E);
1403 E->setAmpAmpLoc(readSourceLocation());
1404 E->setLabelLoc(readSourceLocation());
1405 E->setLabel(readDeclAs<LabelDecl>());
1406}
1407
1408void ASTStmtReader::VisitStmtExpr(StmtExpr *E) {
1409 VisitExpr(E);
1410 E->setLParenLoc(readSourceLocation());
1411 E->setRParenLoc(readSourceLocation());
1412 E->setSubStmt(cast_or_null<CompoundStmt>(Record.readSubStmt()));
1413 E->StmtExprBits.TemplateDepth = Record.readInt();
1414}
1415
1416void ASTStmtReader::VisitChooseExpr(ChooseExpr *E) {
1417 VisitExpr(E);
1418 E->setCond(Record.readSubExpr());
1419 E->setLHS(Record.readSubExpr());
1420 E->setRHS(Record.readSubExpr());
1421 E->setBuiltinLoc(readSourceLocation());
1422 E->setRParenLoc(readSourceLocation());
1423 E->setIsConditionTrue(Record.readInt());
1424}
1425
1426void ASTStmtReader::VisitGNUNullExpr(GNUNullExpr *E) {
1427 VisitExpr(E);
1428 E->setTokenLocation(readSourceLocation());
1429}
1430
1431void ASTStmtReader::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
1432 VisitExpr(E);
1433 SmallVector<Expr *, 16> Exprs;
1434 unsigned NumExprs = Record.readInt();
1435 while (NumExprs--)
1436 Exprs.push_back(Record.readSubExpr());
1437 E->setExprs(Record.getContext(), Exprs);
1438 E->setBuiltinLoc(readSourceLocation());
1439 E->setRParenLoc(readSourceLocation());
1440}
1441
1442void ASTStmtReader::VisitConvertVectorExpr(ConvertVectorExpr *E) {
1443 VisitExpr(E);
1444 bool HasFPFeatures = CurrentUnpackingBits->getNextBit();
1445 assert(HasFPFeatures == E->hasStoredFPFeatures());
1446 E->BuiltinLoc = readSourceLocation();
1447 E->RParenLoc = readSourceLocation();
1448 E->TInfo = readTypeSourceInfo();
1449 E->SrcExpr = Record.readSubExpr();
1450 if (HasFPFeatures)
1452 FPOptionsOverride::getFromOpaqueInt(Record.readInt()));
1453}
1454
1455void ASTStmtReader::VisitBlockExpr(BlockExpr *E) {
1456 VisitExpr(E);
1457 E->setBlockDecl(readDeclAs<BlockDecl>());
1458}
1459
1460void ASTStmtReader::VisitGenericSelectionExpr(GenericSelectionExpr *E) {
1461 VisitExpr(E);
1462
1463 unsigned NumAssocs = Record.readInt();
1464 assert(NumAssocs == E->getNumAssocs() && "Wrong NumAssocs!");
1465 E->IsExprPredicate = Record.readInt();
1466 E->ResultIndex = Record.readInt();
1467 E->GenericSelectionExprBits.GenericLoc = readSourceLocation();
1468 E->DefaultLoc = readSourceLocation();
1469 E->RParenLoc = readSourceLocation();
1470
1471 // During serialization, either one more Stmt or one more
1472 // TypeSourceInfo was encoded to account for the predicate
1473 // (whether it was an expression or a type).
1474 Stmt **Stmts = E->getTrailingObjects<Stmt *>();
1475 for (unsigned I = 0, N = NumAssocs + (E->IsExprPredicate ? 1 : 0); I < N; ++I)
1476 Stmts[I] = Record.readSubExpr();
1477
1478 TypeSourceInfo **TSIs = E->getTrailingObjects<TypeSourceInfo *>();
1479 for (unsigned I = 0, N = NumAssocs + (!E->IsExprPredicate ? 1 : 0); I < N;
1480 ++I)
1481 TSIs[I] = readTypeSourceInfo();
1482}
1483
1484void ASTStmtReader::VisitPseudoObjectExpr(PseudoObjectExpr *E) {
1485 VisitExpr(E);
1486 unsigned numSemanticExprs = Record.readInt();
1487 assert(numSemanticExprs + 1 == E->PseudoObjectExprBits.NumSubExprs);
1488 E->PseudoObjectExprBits.ResultIndex = Record.readInt();
1489
1490 // Read the syntactic expression.
1491 E->getTrailingObjects()[0] = Record.readSubExpr();
1492
1493 // Read all the semantic expressions.
1494 for (unsigned i = 0; i != numSemanticExprs; ++i) {
1495 Expr *subExpr = Record.readSubExpr();
1496 E->getTrailingObjects()[i + 1] = subExpr;
1497 }
1498}
1499
1500void ASTStmtReader::VisitAtomicExpr(AtomicExpr *E) {
1501 VisitExpr(E);
1502 E->Op = AtomicExpr::AtomicOp(Record.readInt());
1503 E->NumSubExprs = AtomicExpr::getNumSubExprs(E->Op);
1504 for (unsigned I = 0; I != E->NumSubExprs; ++I)
1505 E->SubExprs[I] = Record.readSubExpr();
1506 E->BuiltinLoc = readSourceLocation();
1507 E->RParenLoc = readSourceLocation();
1508}
1509
1510//===----------------------------------------------------------------------===//
1511// Objective-C Expressions and Statements
1512
1513void ASTStmtReader::VisitObjCObjectLiteral(ObjCObjectLiteral *E) {
1514 VisitExpr(E);
1515 E->setExpressibleAsConstantInitializer(Record.readInt());
1516}
1517
1518void ASTStmtReader::VisitObjCStringLiteral(ObjCStringLiteral *E) {
1519 VisitObjCObjectLiteral(E);
1520 E->setString(cast<StringLiteral>(Record.readSubStmt()));
1521 E->setAtLoc(readSourceLocation());
1522}
1523
1524void ASTStmtReader::VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
1525 VisitObjCObjectLiteral(E);
1526 // could be one of several IntegerLiteral, FloatLiteral, etc.
1527 E->SubExpr = Record.readSubStmt();
1528 E->BoxingMethod = readDeclAs<ObjCMethodDecl>();
1529 E->Range = readSourceRange();
1530}
1531
1532void ASTStmtReader::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
1533 VisitObjCObjectLiteral(E);
1534 unsigned NumElements = Record.readInt();
1535 assert(NumElements == E->getNumElements() && "Wrong number of elements");
1536 Expr **Elements = E->getElements();
1537 for (unsigned I = 0, N = NumElements; I != N; ++I)
1538 Elements[I] = Record.readSubExpr();
1539 E->ArrayWithObjectsMethod = readDeclAs<ObjCMethodDecl>();
1540 E->Range = readSourceRange();
1541}
1542
1543void ASTStmtReader::VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *E) {
1544 VisitObjCObjectLiteral(E);
1545 unsigned NumElements = Record.readInt();
1546 assert(NumElements == E->getNumElements() && "Wrong number of elements");
1547 bool HasPackExpansions = Record.readInt();
1548 assert(HasPackExpansions == E->HasPackExpansions &&"Pack expansion mismatch");
1549 auto *KeyValues =
1550 E->getTrailingObjects<ObjCDictionaryLiteral::KeyValuePair>();
1551 auto *Expansions =
1552 E->getTrailingObjects<ObjCDictionaryLiteral::ExpansionData>();
1553 for (unsigned I = 0; I != NumElements; ++I) {
1554 KeyValues[I].Key = Record.readSubExpr();
1555 KeyValues[I].Value = Record.readSubExpr();
1556 if (HasPackExpansions) {
1557 Expansions[I].EllipsisLoc = readSourceLocation();
1558 Expansions[I].NumExpansionsPlusOne = Record.readInt();
1559 }
1560 }
1561 E->DictWithObjectsMethod = readDeclAs<ObjCMethodDecl>();
1562 E->Range = readSourceRange();
1563}
1564
1565void ASTStmtReader::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
1566 VisitExpr(E);
1567 E->setEncodedTypeSourceInfo(readTypeSourceInfo());
1568 E->setAtLoc(readSourceLocation());
1569 E->setRParenLoc(readSourceLocation());
1570}
1571
1572void ASTStmtReader::VisitObjCSelectorExpr(ObjCSelectorExpr *E) {
1573 VisitExpr(E);
1574 E->setSelector(Record.readSelector());
1575 E->setAtLoc(readSourceLocation());
1576 E->setSelectorNameLoc(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::VisitCXXExpansionStmtPattern(CXXExpansionStmtPattern *S) {
1786 VisitStmt(S);
1787 Record.skipInts(1); // Skip kind.
1788 S->LParenLoc = readSourceLocation();
1789 S->ColonLoc = readSourceLocation();
1790 S->RParenLoc = readSourceLocation();
1791 S->ParentDecl = cast<CXXExpansionStmtDecl>(Record.readDeclRef());
1792 for (Stmt *&SubStmt : S->children())
1793 SubStmt = Record.readSubStmt();
1794}
1795
1796void ASTStmtReader::VisitCXXExpansionStmtInstantiation(
1798 VisitStmt(S);
1799 Record.skipInts(2);
1800 S->Parent = cast<CXXExpansionStmtDecl>(Record.readDeclRef());
1801 for (unsigned I = 0; I < S->getNumSubStmts(); ++I)
1802 S->getAllSubStmts()[I] = Record.readSubStmt();
1803 S->setShouldApplyLifetimeExtensionToPreamble(Record.readBool());
1804}
1805
1806void ASTStmtReader::VisitCXXExpansionSelectExpr(CXXExpansionSelectExpr *E) {
1807 VisitExpr(E);
1808 E->setRangeExpr(cast<InitListExpr>(Record.readSubExpr()));
1809 E->setIndexExpr(Record.readSubExpr());
1810}
1811
1812void ASTStmtReader::VisitMSDependentExistsStmt(MSDependentExistsStmt *S) {
1813 VisitStmt(S);
1814 S->KeywordLoc = readSourceLocation();
1815 S->IsIfExists = Record.readInt();
1816 S->QualifierLoc = Record.readNestedNameSpecifierLoc();
1817 S->NameInfo = Record.readDeclarationNameInfo();
1818 S->SubStmt = Record.readSubStmt();
1819}
1820
1821void ASTStmtReader::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
1822 VisitCallExpr(E);
1823 E->CXXOperatorCallExprBits.OperatorKind = Record.readInt();
1824 E->CXXOperatorCallExprBits.IsReversed = Record.readInt();
1825 E->BeginLoc = Record.readSourceLocation();
1826}
1827
1828void ASTStmtReader::VisitCXXRewrittenBinaryOperator(
1830 VisitExpr(E);
1831 E->CXXRewrittenBinaryOperatorBits.IsReversed = Record.readInt();
1832 E->SemanticForm = Record.readSubExpr();
1833}
1834
1835void ASTStmtReader::VisitCXXConstructExpr(CXXConstructExpr *E) {
1836 VisitExpr(E);
1837
1838 unsigned NumArgs = Record.readInt();
1839 assert((NumArgs == E->getNumArgs()) && "Wrong NumArgs!");
1840
1841 E->CXXConstructExprBits.Elidable = Record.readInt();
1842 E->CXXConstructExprBits.HadMultipleCandidates = Record.readInt();
1843 E->CXXConstructExprBits.ListInitialization = Record.readInt();
1844 E->CXXConstructExprBits.StdInitListInitialization = Record.readInt();
1845 E->CXXConstructExprBits.ZeroInitialization = Record.readInt();
1846 E->CXXConstructExprBits.ConstructionKind = Record.readInt();
1847 E->CXXConstructExprBits.IsImmediateEscalating = Record.readInt();
1848 E->CXXConstructExprBits.Loc = readSourceLocation();
1849 E->Constructor = readDeclAs<CXXConstructorDecl>();
1850 E->ParenOrBraceRange = readSourceRange();
1851
1852 for (unsigned I = 0; I != NumArgs; ++I)
1853 E->setArg(I, Record.readSubExpr());
1854}
1855
1856void ASTStmtReader::VisitCXXInheritedCtorInitExpr(CXXInheritedCtorInitExpr *E) {
1857 VisitExpr(E);
1858 E->Constructor = readDeclAs<CXXConstructorDecl>();
1859 E->Loc = readSourceLocation();
1860 E->ConstructsVirtualBase = Record.readInt();
1861 E->InheritedFromVirtualBase = Record.readInt();
1862}
1863
1864void ASTStmtReader::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
1865 VisitCXXConstructExpr(E);
1866 E->TSI = readTypeSourceInfo();
1867}
1868
1869void ASTStmtReader::VisitLambdaExpr(LambdaExpr *E) {
1870 VisitExpr(E);
1871 unsigned NumCaptures = Record.readInt();
1872 (void)NumCaptures;
1873 assert(NumCaptures == E->LambdaExprBits.NumCaptures);
1874 E->IntroducerRange = readSourceRange();
1875 E->LambdaExprBits.CaptureDefault = Record.readInt();
1876 E->CaptureDefaultLoc = readSourceLocation();
1877 E->LambdaExprBits.ExplicitParams = Record.readInt();
1878 E->LambdaExprBits.ExplicitResultType = Record.readInt();
1879 E->ClosingBrace = readSourceLocation();
1880
1881 // Read capture initializers.
1883 CEnd = E->capture_init_end();
1884 C != CEnd; ++C)
1885 *C = Record.readSubExpr();
1886
1887 // The body will be lazily deserialized when needed from the call operator
1888 // declaration.
1889}
1890
1891void
1892ASTStmtReader::VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E) {
1893 VisitExpr(E);
1894 E->SubExpr = Record.readSubExpr();
1895}
1896
1897void ASTStmtReader::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) {
1898 VisitExplicitCastExpr(E);
1899 SourceRange R = readSourceRange();
1900 E->Loc = R.getBegin();
1901 E->RParenLoc = R.getEnd();
1902 if (CurrentUnpackingBits->getNextBit())
1903 E->AngleBrackets = readSourceRange();
1904}
1905
1906void ASTStmtReader::VisitCXXStaticCastExpr(CXXStaticCastExpr *E) {
1907 return VisitCXXNamedCastExpr(E);
1908}
1909
1910void ASTStmtReader::VisitCXXDynamicCastExpr(CXXDynamicCastExpr *E) {
1911 return VisitCXXNamedCastExpr(E);
1912}
1913
1914void ASTStmtReader::VisitCXXReinterpretCastExpr(CXXReinterpretCastExpr *E) {
1915 return VisitCXXNamedCastExpr(E);
1916}
1917
1918void ASTStmtReader::VisitCXXAddrspaceCastExpr(CXXAddrspaceCastExpr *E) {
1919 return VisitCXXNamedCastExpr(E);
1920}
1921
1922void ASTStmtReader::VisitCXXConstCastExpr(CXXConstCastExpr *E) {
1923 return VisitCXXNamedCastExpr(E);
1924}
1925
1926void ASTStmtReader::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E) {
1927 VisitExplicitCastExpr(E);
1928 E->setLParenLoc(readSourceLocation());
1929 E->setRParenLoc(readSourceLocation());
1930}
1931
1932void ASTStmtReader::VisitBuiltinBitCastExpr(BuiltinBitCastExpr *E) {
1933 VisitExplicitCastExpr(E);
1934 E->KWLoc = readSourceLocation();
1935 E->RParenLoc = readSourceLocation();
1936}
1937
1938void ASTStmtReader::VisitUserDefinedLiteral(UserDefinedLiteral *E) {
1939 VisitCallExpr(E);
1940 E->UDSuffixLoc = readSourceLocation();
1941}
1942
1943void ASTStmtReader::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) {
1944 VisitExpr(E);
1945 E->setValue(Record.readInt());
1946 E->setLocation(readSourceLocation());
1947}
1948
1949void ASTStmtReader::VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E) {
1950 VisitExpr(E);
1951 E->setLocation(readSourceLocation());
1952}
1953
1954void ASTStmtReader::VisitCXXTypeidExpr(CXXTypeidExpr *E) {
1955 VisitExpr(E);
1956 E->setSourceRange(readSourceRange());
1957 if (E->isTypeOperand())
1958 E->Operand = readTypeSourceInfo();
1959 else
1960 E->Operand = Record.readSubExpr();
1961}
1962
1963void ASTStmtReader::VisitCXXThisExpr(CXXThisExpr *E) {
1964 VisitExpr(E);
1965 E->setLocation(readSourceLocation());
1966 E->setImplicit(Record.readInt());
1968}
1969
1970void ASTStmtReader::VisitCXXThrowExpr(CXXThrowExpr *E) {
1971 VisitExpr(E);
1972 E->CXXThrowExprBits.ThrowLoc = readSourceLocation();
1973 E->Operand = Record.readSubExpr();
1974 E->CXXThrowExprBits.IsThrownVariableInScope = Record.readInt();
1975}
1976
1977void ASTStmtReader::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
1978 VisitExpr(E);
1979 E->Param = readDeclAs<ParmVarDecl>();
1980 E->UsedContext = readDeclAs<DeclContext>();
1981 E->CXXDefaultArgExprBits.Loc = readSourceLocation();
1982 E->CXXDefaultArgExprBits.HasRewrittenInit = Record.readInt();
1983 if (E->CXXDefaultArgExprBits.HasRewrittenInit)
1984 *E->getTrailingObjects() = Record.readSubExpr();
1985}
1986
1987void ASTStmtReader::VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E) {
1988 VisitExpr(E);
1989 E->CXXDefaultInitExprBits.HasRewrittenInit = Record.readInt();
1990 E->Field = readDeclAs<FieldDecl>();
1991 E->UsedContext = readDeclAs<DeclContext>();
1992 E->CXXDefaultInitExprBits.Loc = readSourceLocation();
1993 if (E->CXXDefaultInitExprBits.HasRewrittenInit)
1994 *E->getTrailingObjects() = Record.readSubExpr();
1995}
1996
1997void ASTStmtReader::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
1998 VisitExpr(E);
1999 E->setTemporary(Record.readCXXTemporary());
2000 E->setSubExpr(Record.readSubExpr());
2001}
2002
2003void ASTStmtReader::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
2004 VisitExpr(E);
2005 E->TypeInfo = readTypeSourceInfo();
2006 E->CXXScalarValueInitExprBits.RParenLoc = readSourceLocation();
2007}
2008
2009void ASTStmtReader::VisitCXXNewExpr(CXXNewExpr *E) {
2010 VisitExpr(E);
2011
2012 bool IsArray = Record.readInt();
2013 bool HasInit = Record.readInt();
2014 unsigned NumPlacementArgs = Record.readInt();
2015 bool IsParenTypeId = Record.readInt();
2016
2017 E->CXXNewExprBits.IsGlobalNew = Record.readInt();
2018 E->CXXNewExprBits.ShouldPassAlignment = Record.readInt();
2019 E->CXXNewExprBits.ShouldPassTypeIdentity = Record.readInt();
2020 E->CXXNewExprBits.UsualArrayDeleteWantsSize = Record.readInt();
2021 E->CXXNewExprBits.HasInitializer = Record.readInt();
2022 E->CXXNewExprBits.StoredInitializationStyle = Record.readInt();
2023
2024 assert((IsArray == E->isArray()) && "Wrong IsArray!");
2025 assert((HasInit == E->hasInitializer()) && "Wrong HasInit!");
2026 assert((NumPlacementArgs == E->getNumPlacementArgs()) &&
2027 "Wrong NumPlacementArgs!");
2028 assert((IsParenTypeId == E->isParenTypeId()) && "Wrong IsParenTypeId!");
2029 (void)IsArray;
2030 (void)HasInit;
2031 (void)NumPlacementArgs;
2032
2033 E->setOperatorNew(readDeclAs<FunctionDecl>());
2034 E->setOperatorDelete(readDeclAs<FunctionDecl>());
2035 E->AllocatedTypeInfo = readTypeSourceInfo();
2036 if (IsParenTypeId)
2037 E->getTrailingObjects<SourceRange>()[0] = readSourceRange();
2038 E->Range = readSourceRange();
2039 E->DirectInitRange = readSourceRange();
2040
2041 // Install all the subexpressions.
2043 N = E->raw_arg_end();
2044 I != N; ++I)
2045 *I = Record.readSubStmt();
2046}
2047
2048void ASTStmtReader::VisitCXXDeleteExpr(CXXDeleteExpr *E) {
2049 VisitExpr(E);
2050 E->CXXDeleteExprBits.GlobalDelete = Record.readInt();
2051 E->CXXDeleteExprBits.ArrayForm = Record.readInt();
2052 E->CXXDeleteExprBits.ArrayFormAsWritten = Record.readInt();
2053 E->CXXDeleteExprBits.UsualArrayDeleteWantsSize = Record.readInt();
2054 E->OperatorDelete = readDeclAs<FunctionDecl>();
2055 E->Argument = Record.readSubExpr();
2056 E->CXXDeleteExprBits.Loc = readSourceLocation();
2057}
2058
2059void ASTStmtReader::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
2060 VisitExpr(E);
2061
2062 E->Base = Record.readSubExpr();
2063 E->IsArrow = Record.readInt();
2064 E->OperatorLoc = readSourceLocation();
2065 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
2066 E->ScopeType = readTypeSourceInfo();
2067 E->ColonColonLoc = readSourceLocation();
2068 E->TildeLoc = readSourceLocation();
2069
2070 IdentifierInfo *II = Record.readIdentifier();
2071 if (II)
2072 E->setDestroyedType(II, readSourceLocation());
2073 else
2074 E->setDestroyedType(readTypeSourceInfo());
2075}
2076
2077void ASTStmtReader::VisitExprWithCleanups(ExprWithCleanups *E) {
2078 VisitExpr(E);
2079
2080 unsigned NumObjects = Record.readInt();
2081 assert(NumObjects == E->getNumObjects());
2082 for (unsigned i = 0; i != NumObjects; ++i) {
2083 unsigned CleanupKind = Record.readInt();
2085 if (CleanupKind == COK_Block)
2086 Obj = readDeclAs<BlockDecl>();
2087 else if (CleanupKind == COK_CompoundLiteral)
2088 Obj = cast<CompoundLiteralExpr>(Record.readSubExpr());
2089 else
2090 llvm_unreachable("unexpected cleanup object type");
2091 E->getTrailingObjects()[i] = Obj;
2092 }
2093
2094 E->ExprWithCleanupsBits.CleanupsHaveSideEffects = Record.readInt();
2095 E->SubExpr = Record.readSubExpr();
2096}
2097
2098void ASTStmtReader::VisitDependentTemplateIdExpr(DependentTemplateIdExpr *E) {
2099 VisitExpr(E);
2100 unsigned NumTemplateArgs = Record.readInt();
2101 assert(NumTemplateArgs == E->getNumTemplateArgs() &&
2102 "Wrong NumTemplateArgs!");
2103 ReadTemplateKWAndArgsInfo(E->KWAndArgs, E->getTrailingObjects(),
2104 NumTemplateArgs);
2105 E->NameInfo = Record.readDeclarationNameInfo();
2106 E->Name = Record.readTemplateName();
2107}
2108
2109void ASTStmtReader::VisitCXXDependentScopeMemberExpr(
2111 VisitExpr(E);
2112
2113 unsigned NumTemplateArgs = Record.readInt();
2114 CurrentUnpackingBits.emplace(Record.readInt());
2115 bool HasTemplateKWAndArgsInfo = CurrentUnpackingBits->getNextBit();
2116 bool HasFirstQualifierFoundInScope = CurrentUnpackingBits->getNextBit();
2117
2118 assert((HasTemplateKWAndArgsInfo == E->hasTemplateKWAndArgsInfo()) &&
2119 "Wrong HasTemplateKWAndArgsInfo!");
2120 assert(
2121 (HasFirstQualifierFoundInScope == E->hasFirstQualifierFoundInScope()) &&
2122 "Wrong HasFirstQualifierFoundInScope!");
2123
2124 if (HasTemplateKWAndArgsInfo)
2126 *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
2127 E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs);
2128
2129 assert((NumTemplateArgs == E->getNumTemplateArgs()) &&
2130 "Wrong NumTemplateArgs!");
2131
2133 CurrentUnpackingBits->getNextBit();
2134
2135 E->BaseType = Record.readType();
2136 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
2137 // not ImplicitAccess
2138 if (CurrentUnpackingBits->getNextBit())
2139 E->Base = Record.readSubExpr();
2140 else
2141 E->Base = nullptr;
2142
2143 E->CXXDependentScopeMemberExprBits.OperatorLoc = readSourceLocation();
2144
2145 if (HasFirstQualifierFoundInScope)
2146 *E->getTrailingObjects<NamedDecl *>() = readDeclAs<NamedDecl>();
2147
2148 E->MemberNameInfo = Record.readDeclarationNameInfo();
2149}
2150
2151void
2152ASTStmtReader::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) {
2153 VisitExpr(E);
2154
2155 if (CurrentUnpackingBits->getNextBit()) // HasTemplateKWAndArgsInfo
2157 *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
2158 E->getTrailingObjects<TemplateArgumentLoc>(),
2159 /*NumTemplateArgs=*/CurrentUnpackingBits->getNextBits(/*Width=*/16));
2160
2161 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
2162 E->NameInfo = Record.readDeclarationNameInfo();
2163}
2164
2165void
2166ASTStmtReader::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E) {
2167 VisitExpr(E);
2168 assert(Record.peekInt() == E->getNumArgs() &&
2169 "Read wrong record during creation ?");
2170 Record.skipInts(1);
2171 for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
2172 E->setArg(I, Record.readSubExpr());
2173 E->TypeAndInitForm.setPointer(readTypeSourceInfo());
2174 E->setLParenLoc(readSourceLocation());
2175 E->setRParenLoc(readSourceLocation());
2176 E->TypeAndInitForm.setInt(Record.readInt());
2177}
2178
2179void ASTStmtReader::VisitOverloadExpr(OverloadExpr *E) {
2180 VisitExpr(E);
2181
2182 unsigned NumResults = Record.readInt();
2183 CurrentUnpackingBits.emplace(Record.readInt());
2184 bool HasTemplateKWAndArgsInfo = CurrentUnpackingBits->getNextBit();
2185 assert((E->getNumDecls() == NumResults) && "Wrong NumResults!");
2186 assert((E->hasTemplateKWAndArgsInfo() == HasTemplateKWAndArgsInfo) &&
2187 "Wrong HasTemplateKWAndArgsInfo!");
2188
2189 unsigned NumTemplateArgs = 0;
2190 if (HasTemplateKWAndArgsInfo) {
2191 NumTemplateArgs = Record.readInt();
2194 NumTemplateArgs);
2195 }
2196
2197 UnresolvedSet<8> Decls;
2198 for (unsigned I = 0; I != NumResults; ++I) {
2199 auto *D = readDeclAs<NamedDecl>();
2200 auto AS = (AccessSpecifier)Record.readInt();
2201 Decls.addDecl(D, AS);
2202 }
2203
2204 DeclAccessPair *Results = E->getTrailingResults();
2205 UnresolvedSetIterator Iter = Decls.begin();
2206 for (unsigned I = 0; I != NumResults; ++I) {
2207 Results[I] = (Iter + I).getPair();
2208 }
2209
2210 assert((E->getNumTemplateArgs() == NumTemplateArgs) &&
2211 "Wrong NumTemplateArgs!");
2212
2213 E->NameInfo = Record.readDeclarationNameInfo();
2214 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
2215}
2216
2217void ASTStmtReader::VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
2218 VisitOverloadExpr(E);
2219 E->UnresolvedMemberExprBits.IsArrow = CurrentUnpackingBits->getNextBit();
2220 E->UnresolvedMemberExprBits.HasUnresolvedUsing =
2221 CurrentUnpackingBits->getNextBit();
2222
2223 if (/*!isImplicitAccess=*/CurrentUnpackingBits->getNextBit())
2224 E->Base = Record.readSubExpr();
2225 else
2226 E->Base = nullptr;
2227
2228 E->OperatorLoc = readSourceLocation();
2229
2230 E->BaseType = Record.readType();
2231}
2232
2233void ASTStmtReader::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) {
2234 VisitOverloadExpr(E);
2235 E->UnresolvedLookupExprBits.RequiresADL = CurrentUnpackingBits->getNextBit();
2236 E->NamingClass = readDeclAs<CXXRecordDecl>();
2237}
2238
2239void ASTStmtReader::VisitTypeTraitExpr(TypeTraitExpr *E) {
2240 VisitExpr(E);
2241 E->TypeTraitExprBits.IsBooleanTypeTrait = Record.readInt();
2242 E->TypeTraitExprBits.IsComparisonResult = Record.readInt();
2243 E->TypeTraitExprBits.NumArgs = Record.readInt();
2244 E->TypeTraitExprBits.Kind = Record.readInt();
2245
2246 if (E->TypeTraitExprBits.IsBooleanTypeTrait)
2247 E->TypeTraitExprBits.Value = Record.readInt();
2248 else
2249 *E->getTrailingObjects<APValue>() = Record.readAPValue();
2250
2251 SourceRange Range = readSourceRange();
2252 E->Loc = Range.getBegin();
2253 E->RParenLoc = Range.getEnd();
2254
2255 auto **Args = E->getTrailingObjects<TypeSourceInfo *>();
2256 for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
2257 Args[I] = readTypeSourceInfo();
2258}
2259
2260void ASTStmtReader::VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E) {
2261 VisitExpr(E);
2262 E->ArrayTypeTraitExprBits.ATT = (ArrayTypeTrait)Record.readInt();
2263 E->Value = (unsigned int)Record.readInt();
2264 SourceRange Range = readSourceRange();
2265 E->Loc = Range.getBegin();
2266 E->RParen = Range.getEnd();
2267 E->QueriedType = readTypeSourceInfo();
2268 E->Dimension = Record.readSubExpr();
2269}
2270
2271void ASTStmtReader::VisitExpressionTraitExpr(ExpressionTraitExpr *E) {
2272 VisitExpr(E);
2273 E->ExpressionTraitExprBits.ET = (ExpressionTrait)Record.readInt();
2274 E->ExpressionTraitExprBits.Value = (bool)Record.readInt();
2275 SourceRange Range = readSourceRange();
2276 E->QueriedExpression = Record.readSubExpr();
2277 E->Loc = Range.getBegin();
2278 E->RParen = Range.getEnd();
2279}
2280
2281void ASTStmtReader::VisitCXXNoexceptExpr(CXXNoexceptExpr *E) {
2282 VisitExpr(E);
2283 E->CXXNoexceptExprBits.Value = Record.readInt();
2284 E->Range = readSourceRange();
2285 E->Operand = Record.readSubExpr();
2286}
2287
2288void ASTStmtReader::VisitPackExpansionExpr(PackExpansionExpr *E) {
2289 VisitExpr(E);
2290 E->EllipsisLoc = readSourceLocation();
2291 E->NumExpansions = Record.readInt();
2292 E->Pattern = Record.readSubExpr();
2293}
2294
2295void ASTStmtReader::VisitSizeOfPackExpr(SizeOfPackExpr *E) {
2296 VisitExpr(E);
2297 unsigned NumPartialArgs = Record.readInt();
2298 E->OperatorLoc = readSourceLocation();
2299 E->PackLoc = readSourceLocation();
2300 E->RParenLoc = readSourceLocation();
2301 E->Pack = Record.readDeclAs<NamedDecl>();
2302 if (E->isPartiallySubstituted()) {
2303 assert(E->Length == NumPartialArgs);
2304 for (auto *I = E->getTrailingObjects(), *E = I + NumPartialArgs; I != E;
2305 ++I)
2306 new (I) TemplateArgument(Record.readTemplateArgument());
2307 } else if (!E->isValueDependent()) {
2308 E->Length = Record.readInt();
2309 }
2310}
2311
2312void ASTStmtReader::VisitPackIndexingExpr(PackIndexingExpr *E) {
2313 VisitExpr(E);
2314 E->PackIndexingExprBits.TransformedExpressions = Record.readInt();
2315 E->PackIndexingExprBits.FullySubstituted = Record.readInt();
2316 E->EllipsisLoc = readSourceLocation();
2317 E->RSquareLoc = readSourceLocation();
2318 E->SubExprs[0] = Record.readStmt();
2319 E->SubExprs[1] = Record.readStmt();
2320 auto **Exprs = E->getTrailingObjects();
2321 for (unsigned I = 0; I < E->PackIndexingExprBits.TransformedExpressions; ++I)
2322 Exprs[I] = Record.readExpr();
2323}
2324
2325void ASTStmtReader::VisitSubstNonTypeTemplateParmExpr(
2327 VisitExpr(E);
2328 E->AssociatedDeclAndFinal.setPointer(readDeclAs<Decl>());
2329 E->AssociatedDeclAndFinal.setInt(CurrentUnpackingBits->getNextBit());
2330 E->Index = CurrentUnpackingBits->getNextBits(/*Width=*/12);
2331 E->PackIndex = Record.readUnsignedOrNone().toInternalRepresentation();
2332 E->ParamType = Record.readType();
2333 E->SubstNonTypeTemplateParmExprBits.NameLoc = readSourceLocation();
2334 E->Replacement = Record.readSubExpr();
2335}
2336
2337void ASTStmtReader::VisitSubstNonTypeTemplateParmPackExpr(
2339 VisitExpr(E);
2340 E->AssociatedDecl = readDeclAs<Decl>();
2341 E->Final = CurrentUnpackingBits->getNextBit();
2342 E->Index = Record.readInt();
2343 TemplateArgument ArgPack = Record.readTemplateArgument();
2344 if (ArgPack.getKind() != TemplateArgument::Pack)
2345 return;
2346
2347 E->Arguments = ArgPack.pack_begin();
2348 E->NumArguments = ArgPack.pack_size();
2349 E->NameLoc = readSourceLocation();
2350}
2351
2352void ASTStmtReader::VisitFunctionParmPackExpr(FunctionParmPackExpr *E) {
2353 VisitExpr(E);
2354 E->NumParameters = Record.readInt();
2355 E->ParamPack = readDeclAs<ValueDecl>();
2356 E->NameLoc = readSourceLocation();
2357 auto **Parms = E->getTrailingObjects();
2358 for (unsigned i = 0, n = E->NumParameters; i != n; ++i)
2359 Parms[i] = readDeclAs<ValueDecl>();
2360}
2361
2362void ASTStmtReader::VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E) {
2363 VisitExpr(E);
2364 bool HasMaterialzedDecl = Record.readInt();
2365 if (HasMaterialzedDecl)
2366 E->State = cast<LifetimeExtendedTemporaryDecl>(Record.readDecl());
2367 else
2368 E->State = Record.readSubExpr();
2369}
2370
2371void ASTStmtReader::VisitCXXFoldExpr(CXXFoldExpr *E) {
2372 VisitExpr(E);
2373 E->LParenLoc = readSourceLocation();
2374 E->EllipsisLoc = readSourceLocation();
2375 E->RParenLoc = readSourceLocation();
2376 E->NumExpansions = Record.readUnsignedOrNone();
2377 E->SubExprs[0] = Record.readSubExpr();
2378 E->SubExprs[1] = Record.readSubExpr();
2379 E->SubExprs[2] = Record.readSubExpr();
2380 E->CXXFoldExprBits.Opcode = (BinaryOperatorKind)Record.readInt();
2381}
2382
2383void ASTStmtReader::VisitCXXParenListInitExpr(CXXParenListInitExpr *E) {
2384 VisitExpr(E);
2385 unsigned ExpectedNumExprs = Record.readInt();
2386 assert(E->NumExprs == ExpectedNumExprs &&
2387 "expected number of expressions does not equal the actual number of "
2388 "serialized expressions.");
2389 E->NumUserSpecifiedExprs = Record.readInt();
2390 E->InitLoc = readSourceLocation();
2391 E->LParenLoc = readSourceLocation();
2392 E->RParenLoc = readSourceLocation();
2393 for (unsigned I = 0; I < ExpectedNumExprs; I++)
2394 E->getTrailingObjects()[I] = Record.readSubExpr();
2395
2396 bool HasArrayFillerOrUnionDecl = Record.readBool();
2397 if (HasArrayFillerOrUnionDecl) {
2398 bool HasArrayFiller = Record.readBool();
2399 if (HasArrayFiller) {
2400 E->setArrayFiller(Record.readSubExpr());
2401 } else {
2402 E->setInitializedFieldInUnion(readDeclAs<FieldDecl>());
2403 }
2404 }
2405 E->updateDependence();
2406}
2407
2408void ASTStmtReader::VisitOpaqueValueExpr(OpaqueValueExpr *E) {
2409 VisitExpr(E);
2410 E->SourceExpr = Record.readSubExpr();
2411 E->OpaqueValueExprBits.Loc = readSourceLocation();
2412 E->setIsUnique(Record.readInt());
2413}
2414
2415void ASTStmtReader::VisitRecoveryExpr(RecoveryExpr *E) {
2416 VisitExpr(E);
2417 unsigned NumArgs = Record.readInt();
2418 E->BeginLoc = readSourceLocation();
2419 E->EndLoc = readSourceLocation();
2420 assert((NumArgs + 0LL ==
2421 std::distance(E->children().begin(), E->children().end())) &&
2422 "Wrong NumArgs!");
2423 (void)NumArgs;
2424 for (Stmt *&Child : E->children())
2425 Child = Record.readSubStmt();
2426}
2427
2428//===----------------------------------------------------------------------===//
2429// Microsoft Expressions and Statements
2430//===----------------------------------------------------------------------===//
2431void ASTStmtReader::VisitMSPropertyRefExpr(MSPropertyRefExpr *E) {
2432 VisitExpr(E);
2433 E->IsArrow = (Record.readInt() != 0);
2434 E->BaseExpr = Record.readSubExpr();
2435 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
2436 E->MemberLoc = readSourceLocation();
2437 E->TheDecl = readDeclAs<MSPropertyDecl>();
2438}
2439
2440void ASTStmtReader::VisitMSPropertySubscriptExpr(MSPropertySubscriptExpr *E) {
2441 VisitExpr(E);
2442 E->setBase(Record.readSubExpr());
2443 E->setIdx(Record.readSubExpr());
2444 E->setRBracketLoc(readSourceLocation());
2445}
2446
2447void ASTStmtReader::VisitCXXUuidofExpr(CXXUuidofExpr *E) {
2448 VisitExpr(E);
2449 E->setSourceRange(readSourceRange());
2450 E->Guid = readDeclAs<MSGuidDecl>();
2451 if (E->isTypeOperand())
2452 E->Operand = readTypeSourceInfo();
2453 else
2454 E->Operand = Record.readSubExpr();
2455}
2456
2457void ASTStmtReader::VisitSEHLeaveStmt(SEHLeaveStmt *S) {
2458 VisitStmt(S);
2459 S->setLeaveLoc(readSourceLocation());
2460}
2461
2462void ASTStmtReader::VisitSEHExceptStmt(SEHExceptStmt *S) {
2463 VisitStmt(S);
2464 S->Loc = readSourceLocation();
2465 S->Children[SEHExceptStmt::FILTER_EXPR] = Record.readSubStmt();
2466 S->Children[SEHExceptStmt::BLOCK] = Record.readSubStmt();
2467}
2468
2469void ASTStmtReader::VisitSEHFinallyStmt(SEHFinallyStmt *S) {
2470 VisitStmt(S);
2471 S->Loc = readSourceLocation();
2472 S->Block = Record.readSubStmt();
2473}
2474
2475void ASTStmtReader::VisitSEHTryStmt(SEHTryStmt *S) {
2476 VisitStmt(S);
2477 S->IsCXXTry = Record.readInt();
2478 S->TryLoc = readSourceLocation();
2479 S->Children[SEHTryStmt::TRY] = Record.readSubStmt();
2480 S->Children[SEHTryStmt::HANDLER] = Record.readSubStmt();
2481}
2482
2483//===----------------------------------------------------------------------===//
2484// CUDA Expressions and Statements
2485//===----------------------------------------------------------------------===//
2486
2487void ASTStmtReader::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E) {
2488 VisitCallExpr(E);
2489 E->setPreArg(CUDAKernelCallExpr::CONFIG, Record.readSubExpr());
2490}
2491
2492//===----------------------------------------------------------------------===//
2493// OpenCL Expressions and Statements.
2494//===----------------------------------------------------------------------===//
2495void ASTStmtReader::VisitAsTypeExpr(AsTypeExpr *E) {
2496 VisitExpr(E);
2497 E->BuiltinLoc = readSourceLocation();
2498 E->RParenLoc = readSourceLocation();
2499 E->SrcExpr = Record.readSubExpr();
2500}
2501
2502//===----------------------------------------------------------------------===//
2503// OpenMP Directives.
2504//===----------------------------------------------------------------------===//
2505
2506void ASTStmtReader::VisitOMPCanonicalLoop(OMPCanonicalLoop *S) {
2507 VisitStmt(S);
2508 for (Stmt *&SubStmt : S->SubStmts)
2509 SubStmt = Record.readSubStmt();
2510}
2511
2512void ASTStmtReader::VisitOMPExecutableDirective(OMPExecutableDirective *E) {
2513 Record.readOMPChildren(E->Data);
2514 E->setLocStart(readSourceLocation());
2515 E->setLocEnd(readSourceLocation());
2516}
2517
2518void ASTStmtReader::VisitOMPLoopBasedDirective(OMPLoopBasedDirective *D) {
2519 VisitStmt(D);
2520 // Field CollapsedNum was read in ReadStmtFromStream.
2521 Record.skipInts(1);
2522 VisitOMPExecutableDirective(D);
2523}
2524
2525void ASTStmtReader::VisitOMPLoopDirective(OMPLoopDirective *D) {
2526 VisitOMPLoopBasedDirective(D);
2527}
2528
2529void ASTStmtReader::VisitOMPMetaDirective(OMPMetaDirective *D) {
2530 VisitStmt(D);
2531 // The NumClauses field was read in ReadStmtFromStream.
2532 Record.skipInts(1);
2533 VisitOMPExecutableDirective(D);
2534}
2535
2536void ASTStmtReader::VisitOMPParallelDirective(OMPParallelDirective *D) {
2537 VisitStmt(D);
2538 VisitOMPExecutableDirective(D);
2539 D->setHasCancel(Record.readBool());
2540}
2541
2542void ASTStmtReader::VisitOMPSimdDirective(OMPSimdDirective *D) {
2543 VisitOMPLoopDirective(D);
2544}
2545
2546void ASTStmtReader::VisitOMPCanonicalLoopNestTransformationDirective(
2547 OMPCanonicalLoopNestTransformationDirective *D) {
2548 VisitOMPLoopBasedDirective(D);
2549 D->setNumGeneratedTopLevelLoops(Record.readUInt32());
2550}
2551
2552void ASTStmtReader::VisitOMPTileDirective(OMPTileDirective *D) {
2553 VisitOMPCanonicalLoopNestTransformationDirective(D);
2554}
2555
2556void ASTStmtReader::VisitOMPStripeDirective(OMPStripeDirective *D) {
2557 VisitOMPCanonicalLoopNestTransformationDirective(D);
2558}
2559
2560void ASTStmtReader::VisitOMPUnrollDirective(OMPUnrollDirective *D) {
2561 VisitOMPCanonicalLoopNestTransformationDirective(D);
2562}
2563
2564void ASTStmtReader::VisitOMPReverseDirective(OMPReverseDirective *D) {
2565 VisitOMPCanonicalLoopNestTransformationDirective(D);
2566}
2567
2568void ASTStmtReader::VisitOMPCanonicalLoopSequenceTransformationDirective(
2569 OMPCanonicalLoopSequenceTransformationDirective *D) {
2570 VisitStmt(D);
2571 VisitOMPExecutableDirective(D);
2572 D->setNumGeneratedTopLevelLoops(Record.readUInt32());
2573}
2574
2575void ASTStmtReader::VisitOMPInterchangeDirective(OMPInterchangeDirective *D) {
2576 VisitOMPCanonicalLoopNestTransformationDirective(D);
2577}
2578
2579void ASTStmtReader::VisitOMPFlattenDirective(OMPFlattenDirective *D) {
2580 VisitOMPCanonicalLoopNestTransformationDirective(D);
2581}
2582
2583void ASTStmtReader::VisitOMPSplitDirective(OMPSplitDirective *D) {
2584 VisitOMPCanonicalLoopNestTransformationDirective(D);
2585}
2586
2587void ASTStmtReader::VisitOMPFuseDirective(OMPFuseDirective *D) {
2588 VisitOMPCanonicalLoopSequenceTransformationDirective(D);
2589}
2590
2591void ASTStmtReader::VisitOMPForDirective(OMPForDirective *D) {
2592 VisitOMPLoopDirective(D);
2593 D->setHasCancel(Record.readBool());
2594}
2595
2596void ASTStmtReader::VisitOMPForSimdDirective(OMPForSimdDirective *D) {
2597 VisitOMPLoopDirective(D);
2598}
2599
2600void ASTStmtReader::VisitOMPSectionsDirective(OMPSectionsDirective *D) {
2601 VisitStmt(D);
2602 VisitOMPExecutableDirective(D);
2603 D->setHasCancel(Record.readBool());
2604}
2605
2606void ASTStmtReader::VisitOMPSectionDirective(OMPSectionDirective *D) {
2607 VisitStmt(D);
2608 VisitOMPExecutableDirective(D);
2609 D->setHasCancel(Record.readBool());
2610}
2611
2612void ASTStmtReader::VisitOMPScopeDirective(OMPScopeDirective *D) {
2613 VisitStmt(D);
2614 VisitOMPExecutableDirective(D);
2615}
2616
2617void ASTStmtReader::VisitOMPSingleDirective(OMPSingleDirective *D) {
2618 VisitStmt(D);
2619 VisitOMPExecutableDirective(D);
2620}
2621
2622void ASTStmtReader::VisitOMPMasterDirective(OMPMasterDirective *D) {
2623 VisitStmt(D);
2624 VisitOMPExecutableDirective(D);
2625}
2626
2627void ASTStmtReader::VisitOMPCriticalDirective(OMPCriticalDirective *D) {
2628 VisitStmt(D);
2629 VisitOMPExecutableDirective(D);
2630 D->DirName = Record.readDeclarationNameInfo();
2631}
2632
2633void ASTStmtReader::VisitOMPParallelForDirective(OMPParallelForDirective *D) {
2634 VisitOMPLoopDirective(D);
2635 D->setHasCancel(Record.readBool());
2636}
2637
2638void ASTStmtReader::VisitOMPParallelForSimdDirective(
2639 OMPParallelForSimdDirective *D) {
2640 VisitOMPLoopDirective(D);
2641}
2642
2643void ASTStmtReader::VisitOMPParallelMasterDirective(
2644 OMPParallelMasterDirective *D) {
2645 VisitStmt(D);
2646 VisitOMPExecutableDirective(D);
2647}
2648
2649void ASTStmtReader::VisitOMPParallelMaskedDirective(
2650 OMPParallelMaskedDirective *D) {
2651 VisitStmt(D);
2652 VisitOMPExecutableDirective(D);
2653}
2654
2655void ASTStmtReader::VisitOMPParallelSectionsDirective(
2656 OMPParallelSectionsDirective *D) {
2657 VisitStmt(D);
2658 VisitOMPExecutableDirective(D);
2659 D->setHasCancel(Record.readBool());
2660}
2661
2662void ASTStmtReader::VisitOMPTaskDirective(OMPTaskDirective *D) {
2663 VisitStmt(D);
2664 VisitOMPExecutableDirective(D);
2665 D->setHasCancel(Record.readBool());
2666}
2667
2668void ASTStmtReader::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) {
2669 VisitStmt(D);
2670 VisitOMPExecutableDirective(D);
2671}
2672
2673void ASTStmtReader::VisitOMPBarrierDirective(OMPBarrierDirective *D) {
2674 VisitStmt(D);
2675 VisitOMPExecutableDirective(D);
2676}
2677
2678void ASTStmtReader::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) {
2679 VisitStmt(D);
2680 // The NumClauses field was read in ReadStmtFromStream.
2681 Record.skipInts(1);
2682 VisitOMPExecutableDirective(D);
2683}
2684
2685void ASTStmtReader::VisitOMPAssumeDirective(OMPAssumeDirective *D) {
2686 VisitStmt(D);
2687 VisitOMPExecutableDirective(D);
2688}
2689
2690void ASTStmtReader::VisitOMPErrorDirective(OMPErrorDirective *D) {
2691 VisitStmt(D);
2692 // The NumClauses field was read in ReadStmtFromStream.
2693 Record.skipInts(1);
2694 VisitOMPExecutableDirective(D);
2695}
2696
2697void ASTStmtReader::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) {
2698 VisitStmt(D);
2699 VisitOMPExecutableDirective(D);
2700}
2701
2702void ASTStmtReader::VisitOMPFlushDirective(OMPFlushDirective *D) {
2703 VisitStmt(D);
2704 VisitOMPExecutableDirective(D);
2705}
2706
2707void ASTStmtReader::VisitOMPDepobjDirective(OMPDepobjDirective *D) {
2708 VisitStmt(D);
2709 VisitOMPExecutableDirective(D);
2710}
2711
2712void ASTStmtReader::VisitOMPScanDirective(OMPScanDirective *D) {
2713 VisitStmt(D);
2714 VisitOMPExecutableDirective(D);
2715}
2716
2717void ASTStmtReader::VisitOMPOrderedStandaloneDirective(
2718 OMPOrderedStandaloneDirective *D) {
2719 VisitStmt(D);
2720 VisitOMPExecutableDirective(D);
2721}
2722
2723void ASTStmtReader::VisitOMPOrderedBlockAssocDirective(
2724 OMPOrderedBlockAssocDirective *D) {
2725 VisitStmt(D);
2726 VisitOMPExecutableDirective(D);
2727}
2728
2729void ASTStmtReader::VisitOMPAtomicDirective(OMPAtomicDirective *D) {
2730 VisitStmt(D);
2731 VisitOMPExecutableDirective(D);
2732 D->Flags.IsXLHSInRHSPart = Record.readBool() ? 1 : 0;
2733 D->Flags.IsPostfixUpdate = Record.readBool() ? 1 : 0;
2734 D->Flags.IsFailOnly = Record.readBool() ? 1 : 0;
2735}
2736
2737void ASTStmtReader::VisitOMPTargetDirective(OMPTargetDirective *D) {
2738 VisitStmt(D);
2739 VisitOMPExecutableDirective(D);
2740}
2741
2742void ASTStmtReader::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) {
2743 VisitStmt(D);
2744 VisitOMPExecutableDirective(D);
2745}
2746
2747void ASTStmtReader::VisitOMPTargetEnterDataDirective(
2748 OMPTargetEnterDataDirective *D) {
2749 VisitStmt(D);
2750 VisitOMPExecutableDirective(D);
2751}
2752
2753void ASTStmtReader::VisitOMPTargetExitDataDirective(
2754 OMPTargetExitDataDirective *D) {
2755 VisitStmt(D);
2756 VisitOMPExecutableDirective(D);
2757}
2758
2759void ASTStmtReader::VisitOMPTargetParallelDirective(
2760 OMPTargetParallelDirective *D) {
2761 VisitStmt(D);
2762 VisitOMPExecutableDirective(D);
2763 D->setHasCancel(Record.readBool());
2764}
2765
2766void ASTStmtReader::VisitOMPTargetParallelForDirective(
2767 OMPTargetParallelForDirective *D) {
2768 VisitOMPLoopDirective(D);
2769 D->setHasCancel(Record.readBool());
2770}
2771
2772void ASTStmtReader::VisitOMPTeamsDirective(OMPTeamsDirective *D) {
2773 VisitStmt(D);
2774 VisitOMPExecutableDirective(D);
2775}
2776
2777void ASTStmtReader::VisitOMPCancellationPointDirective(
2778 OMPCancellationPointDirective *D) {
2779 VisitStmt(D);
2780 VisitOMPExecutableDirective(D);
2781 D->setCancelRegion(Record.readEnum<OpenMPDirectiveKind>());
2782}
2783
2784void ASTStmtReader::VisitOMPCancelDirective(OMPCancelDirective *D) {
2785 VisitStmt(D);
2786 VisitOMPExecutableDirective(D);
2787 D->setCancelRegion(Record.readEnum<OpenMPDirectiveKind>());
2788}
2789
2790void ASTStmtReader::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) {
2791 VisitOMPLoopDirective(D);
2792 D->setHasCancel(Record.readBool());
2793}
2794
2795void ASTStmtReader::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) {
2796 VisitOMPLoopDirective(D);
2797}
2798
2799void ASTStmtReader::VisitOMPMasterTaskLoopDirective(
2800 OMPMasterTaskLoopDirective *D) {
2801 VisitOMPLoopDirective(D);
2802 D->setHasCancel(Record.readBool());
2803}
2804
2805void ASTStmtReader::VisitOMPMaskedTaskLoopDirective(
2806 OMPMaskedTaskLoopDirective *D) {
2807 VisitOMPLoopDirective(D);
2808 D->setHasCancel(Record.readBool());
2809}
2810
2811void ASTStmtReader::VisitOMPMasterTaskLoopSimdDirective(
2812 OMPMasterTaskLoopSimdDirective *D) {
2813 VisitOMPLoopDirective(D);
2814}
2815
2816void ASTStmtReader::VisitOMPMaskedTaskLoopSimdDirective(
2817 OMPMaskedTaskLoopSimdDirective *D) {
2818 VisitOMPLoopDirective(D);
2819}
2820
2821void ASTStmtReader::VisitOMPParallelMasterTaskLoopDirective(
2822 OMPParallelMasterTaskLoopDirective *D) {
2823 VisitOMPLoopDirective(D);
2824 D->setHasCancel(Record.readBool());
2825}
2826
2827void ASTStmtReader::VisitOMPParallelMaskedTaskLoopDirective(
2828 OMPParallelMaskedTaskLoopDirective *D) {
2829 VisitOMPLoopDirective(D);
2830 D->setHasCancel(Record.readBool());
2831}
2832
2833void ASTStmtReader::VisitOMPParallelMasterTaskLoopSimdDirective(
2834 OMPParallelMasterTaskLoopSimdDirective *D) {
2835 VisitOMPLoopDirective(D);
2836}
2837
2838void ASTStmtReader::VisitOMPParallelMaskedTaskLoopSimdDirective(
2839 OMPParallelMaskedTaskLoopSimdDirective *D) {
2840 VisitOMPLoopDirective(D);
2841}
2842
2843void ASTStmtReader::VisitOMPDistributeDirective(OMPDistributeDirective *D) {
2844 VisitOMPLoopDirective(D);
2845}
2846
2847void ASTStmtReader::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) {
2848 VisitStmt(D);
2849 VisitOMPExecutableDirective(D);
2850}
2851
2852void ASTStmtReader::VisitOMPDistributeParallelForDirective(
2853 OMPDistributeParallelForDirective *D) {
2854 VisitOMPLoopDirective(D);
2855 D->setHasCancel(Record.readBool());
2856}
2857
2858void ASTStmtReader::VisitOMPDistributeParallelForSimdDirective(
2859 OMPDistributeParallelForSimdDirective *D) {
2860 VisitOMPLoopDirective(D);
2861}
2862
2863void ASTStmtReader::VisitOMPDistributeSimdDirective(
2864 OMPDistributeSimdDirective *D) {
2865 VisitOMPLoopDirective(D);
2866}
2867
2868void ASTStmtReader::VisitOMPTargetParallelForSimdDirective(
2869 OMPTargetParallelForSimdDirective *D) {
2870 VisitOMPLoopDirective(D);
2871}
2872
2873void ASTStmtReader::VisitOMPTargetSimdDirective(OMPTargetSimdDirective *D) {
2874 VisitOMPLoopDirective(D);
2875}
2876
2877void ASTStmtReader::VisitOMPTeamsDistributeDirective(
2878 OMPTeamsDistributeDirective *D) {
2879 VisitOMPLoopDirective(D);
2880}
2881
2882void ASTStmtReader::VisitOMPTeamsDistributeSimdDirective(
2883 OMPTeamsDistributeSimdDirective *D) {
2884 VisitOMPLoopDirective(D);
2885}
2886
2887void ASTStmtReader::VisitOMPTeamsDistributeParallelForSimdDirective(
2888 OMPTeamsDistributeParallelForSimdDirective *D) {
2889 VisitOMPLoopDirective(D);
2890}
2891
2892void ASTStmtReader::VisitOMPTeamsDistributeParallelForDirective(
2893 OMPTeamsDistributeParallelForDirective *D) {
2894 VisitOMPLoopDirective(D);
2895 D->setHasCancel(Record.readBool());
2896}
2897
2898void ASTStmtReader::VisitOMPTargetTeamsDirective(OMPTargetTeamsDirective *D) {
2899 VisitStmt(D);
2900 VisitOMPExecutableDirective(D);
2901}
2902
2903void ASTStmtReader::VisitOMPTargetTeamsDistributeDirective(
2904 OMPTargetTeamsDistributeDirective *D) {
2905 VisitOMPLoopDirective(D);
2906}
2907
2908void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForDirective(
2909 OMPTargetTeamsDistributeParallelForDirective *D) {
2910 VisitOMPLoopDirective(D);
2911 D->setHasCancel(Record.readBool());
2912}
2913
2914void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
2915 OMPTargetTeamsDistributeParallelForSimdDirective *D) {
2916 VisitOMPLoopDirective(D);
2917}
2918
2919void ASTStmtReader::VisitOMPTargetTeamsDistributeSimdDirective(
2920 OMPTargetTeamsDistributeSimdDirective *D) {
2921 VisitOMPLoopDirective(D);
2922}
2923
2924void ASTStmtReader::VisitOMPInteropDirective(OMPInteropDirective *D) {
2925 VisitStmt(D);
2926 VisitOMPExecutableDirective(D);
2927}
2928
2929void ASTStmtReader::VisitOMPDispatchDirective(OMPDispatchDirective *D) {
2930 VisitStmt(D);
2931 VisitOMPExecutableDirective(D);
2932 D->setTargetCallLoc(Record.readSourceLocation());
2933}
2934
2935void ASTStmtReader::VisitOMPMaskedDirective(OMPMaskedDirective *D) {
2936 VisitStmt(D);
2937 VisitOMPExecutableDirective(D);
2938}
2939
2940void ASTStmtReader::VisitOMPGenericLoopDirective(OMPGenericLoopDirective *D) {
2941 VisitOMPLoopDirective(D);
2942}
2943
2944void ASTStmtReader::VisitOMPTeamsGenericLoopDirective(
2945 OMPTeamsGenericLoopDirective *D) {
2946 VisitOMPLoopDirective(D);
2947}
2948
2949void ASTStmtReader::VisitOMPTargetTeamsGenericLoopDirective(
2950 OMPTargetTeamsGenericLoopDirective *D) {
2951 VisitOMPLoopDirective(D);
2952 D->setCanBeParallelFor(Record.readBool());
2953}
2954
2955void ASTStmtReader::VisitOMPParallelGenericLoopDirective(
2956 OMPParallelGenericLoopDirective *D) {
2957 VisitOMPLoopDirective(D);
2958}
2959
2960void ASTStmtReader::VisitOMPTargetParallelGenericLoopDirective(
2961 OMPTargetParallelGenericLoopDirective *D) {
2962 VisitOMPLoopDirective(D);
2963}
2964
2965//===----------------------------------------------------------------------===//
2966// OpenACC Constructs/Directives.
2967//===----------------------------------------------------------------------===//
2968void ASTStmtReader::VisitOpenACCConstructStmt(OpenACCConstructStmt *S) {
2969 (void)Record.readInt();
2970 S->Kind = Record.readEnum<OpenACCDirectiveKind>();
2971 S->Range = Record.readSourceRange();
2972 S->DirectiveLoc = Record.readSourceLocation();
2973 Record.readOpenACCClauseList(S->Clauses);
2974}
2975
2976void ASTStmtReader::VisitOpenACCAssociatedStmtConstruct(
2978 VisitOpenACCConstructStmt(S);
2979 S->setAssociatedStmt(Record.readSubStmt());
2980}
2981
2982void ASTStmtReader::VisitOpenACCComputeConstruct(OpenACCComputeConstruct *S) {
2983 VisitStmt(S);
2984 VisitOpenACCAssociatedStmtConstruct(S);
2985}
2986
2987void ASTStmtReader::VisitOpenACCLoopConstruct(OpenACCLoopConstruct *S) {
2988 VisitStmt(S);
2989 VisitOpenACCAssociatedStmtConstruct(S);
2990 S->ParentComputeConstructKind = Record.readEnum<OpenACCDirectiveKind>();
2991}
2992
2993void ASTStmtReader::VisitOpenACCCombinedConstruct(OpenACCCombinedConstruct *S) {
2994 VisitStmt(S);
2995 VisitOpenACCAssociatedStmtConstruct(S);
2996}
2997
2998void ASTStmtReader::VisitOpenACCDataConstruct(OpenACCDataConstruct *S) {
2999 VisitStmt(S);
3000 VisitOpenACCAssociatedStmtConstruct(S);
3001}
3002
3003void ASTStmtReader::VisitOpenACCEnterDataConstruct(
3004 OpenACCEnterDataConstruct *S) {
3005 VisitStmt(S);
3006 VisitOpenACCConstructStmt(S);
3007}
3008
3009void ASTStmtReader::VisitOpenACCExitDataConstruct(OpenACCExitDataConstruct *S) {
3010 VisitStmt(S);
3011 VisitOpenACCConstructStmt(S);
3012}
3013
3014void ASTStmtReader::VisitOpenACCInitConstruct(OpenACCInitConstruct *S) {
3015 VisitStmt(S);
3016 VisitOpenACCConstructStmt(S);
3017}
3018
3019void ASTStmtReader::VisitOpenACCShutdownConstruct(OpenACCShutdownConstruct *S) {
3020 VisitStmt(S);
3021 VisitOpenACCConstructStmt(S);
3022}
3023
3024void ASTStmtReader::VisitOpenACCSetConstruct(OpenACCSetConstruct *S) {
3025 VisitStmt(S);
3026 VisitOpenACCConstructStmt(S);
3027}
3028
3029void ASTStmtReader::VisitOpenACCUpdateConstruct(OpenACCUpdateConstruct *S) {
3030 VisitStmt(S);
3031 VisitOpenACCConstructStmt(S);
3032}
3033
3034void ASTStmtReader::VisitOpenACCHostDataConstruct(OpenACCHostDataConstruct *S) {
3035 VisitStmt(S);
3036 VisitOpenACCAssociatedStmtConstruct(S);
3037}
3038
3039void ASTStmtReader::VisitOpenACCWaitConstruct(OpenACCWaitConstruct *S) {
3040 VisitStmt(S);
3041 // Consume the count of Expressions.
3042 (void)Record.readInt();
3043 VisitOpenACCConstructStmt(S);
3044 S->LParenLoc = Record.readSourceLocation();
3045 S->RParenLoc = Record.readSourceLocation();
3046 S->QueuesLoc = Record.readSourceLocation();
3047
3048 for (unsigned I = 0; I < S->NumExprs; ++I) {
3049 S->getExprPtr()[I] = cast_if_present<Expr>(Record.readSubStmt());
3050 assert((I == 0 || S->getExprPtr()[I] != nullptr) &&
3051 "Only first expression should be null");
3052 }
3053}
3054
3055void ASTStmtReader::VisitOpenACCCacheConstruct(OpenACCCacheConstruct *S) {
3056 VisitStmt(S);
3057 (void)Record.readInt();
3058 VisitOpenACCConstructStmt(S);
3059 S->ParensLoc = Record.readSourceRange();
3060 S->ReadOnlyLoc = Record.readSourceLocation();
3061 for (unsigned I = 0; I < S->NumVars; ++I)
3062 S->getVarList()[I] = cast<Expr>(Record.readSubStmt());
3063}
3064
3065void ASTStmtReader::VisitOpenACCAtomicConstruct(OpenACCAtomicConstruct *S) {
3066 VisitStmt(S);
3067 VisitOpenACCConstructStmt(S);
3068 S->AtomicKind = Record.readEnum<OpenACCAtomicKind>();
3069 S->setAssociatedStmt(Record.readSubStmt());
3070}
3071
3072//===----------------------------------------------------------------------===//
3073// HLSL Constructs/Directives.
3074//===----------------------------------------------------------------------===//
3075
3076void ASTStmtReader::VisitHLSLOutArgExpr(HLSLOutArgExpr *S) {
3077 VisitExpr(S);
3078 S->SubExprs[HLSLOutArgExpr::BaseLValue] = Record.readSubExpr();
3079 S->SubExprs[HLSLOutArgExpr::CastedTemporary] = Record.readSubExpr();
3080 S->SubExprs[HLSLOutArgExpr::WritebackCast] = Record.readSubExpr();
3081 S->IsInOut = Record.readBool();
3082}
3083
3084//===----------------------------------------------------------------------===//
3085// ASTReader Implementation
3086//===----------------------------------------------------------------------===//
3087
3089 switch (ReadingKind) {
3090 case Read_None:
3091 llvm_unreachable("should not call this when not reading anything");
3092 case Read_Decl:
3093 case Read_Type:
3094 return ReadStmtFromStream(F);
3095 case Read_Stmt:
3096 return ReadSubStmt();
3097 }
3098
3099 llvm_unreachable("ReadingKind not set ?");
3100}
3101
3103 return cast_or_null<Expr>(ReadStmt(F));
3104}
3105
3107 return cast_or_null<Expr>(ReadSubStmt());
3108}
3109
3110// Within the bitstream, expressions are stored in Reverse Polish
3111// Notation, with each of the subexpressions preceding the
3112// expression they are stored in. Subexpressions are stored from last to first.
3113// To evaluate expressions, we continue reading expressions and placing them on
3114// the stack, with expressions having operands removing those operands from the
3115// stack. Evaluation terminates when we see a STMT_STOP record, and
3116// the single remaining expression on the stack is our result.
3117Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) {
3118 ReadingKindTracker ReadingKind(Read_Stmt, *this);
3119 llvm::BitstreamCursor &Cursor = F.DeclsCursor;
3120
3121 // Map of offset to previously deserialized stmt. The offset points
3122 // just after the stmt record.
3123 llvm::DenseMap<uint64_t, Stmt *> StmtEntries;
3124
3125#ifndef NDEBUG
3126 unsigned PrevNumStmts = StmtStack.size();
3127#endif
3128
3129 ASTRecordReader Record(*this, F);
3130 ASTStmtReader Reader(Record, Cursor);
3132
3133 while (true) {
3135 Cursor.advanceSkippingSubblocks();
3136 if (!MaybeEntry) {
3137 Error(toString(MaybeEntry.takeError()));
3138 return nullptr;
3139 }
3140 llvm::BitstreamEntry Entry = MaybeEntry.get();
3141
3142 switch (Entry.Kind) {
3143 case llvm::BitstreamEntry::SubBlock: // Handled for us already.
3144 case llvm::BitstreamEntry::Error:
3145 Error("malformed block record in AST file");
3146 return nullptr;
3147 case llvm::BitstreamEntry::EndBlock:
3148 goto Done;
3149 case llvm::BitstreamEntry::Record:
3150 // The interesting case.
3151 break;
3152 }
3153
3154 ASTContext &Context = getContext();
3155 Stmt *S = nullptr;
3156 bool Finished = false;
3157 bool IsStmtReference = false;
3158 Expected<unsigned> MaybeStmtCode = Record.readRecord(Cursor, Entry.ID);
3159 if (!MaybeStmtCode) {
3160 Error(toString(MaybeStmtCode.takeError()));
3161 return nullptr;
3162 }
3163 switch ((StmtCode)MaybeStmtCode.get()) {
3164 case STMT_STOP:
3165 Finished = true;
3166 break;
3167
3168 case STMT_REF_PTR:
3169 IsStmtReference = true;
3170 assert(StmtEntries.contains(Record[0]) &&
3171 "No stmt was recorded for this offset reference!");
3172 S = StmtEntries[Record.readInt()];
3173 break;
3174
3175 case STMT_NULL_PTR:
3176 S = nullptr;
3177 break;
3178
3179 case STMT_NULL:
3180 S = new (Context) NullStmt(Empty);
3181 break;
3182
3183 case STMT_COMPOUND: {
3184 unsigned NumStmts = Record[ASTStmtReader::NumStmtFields];
3185 bool HasFPFeatures = Record[ASTStmtReader::NumStmtFields + 1];
3186 S = CompoundStmt::CreateEmpty(Context, NumStmts, HasFPFeatures);
3187 break;
3188 }
3189
3190 case STMT_CASE:
3192 Context,
3193 /*CaseStmtIsGNURange*/ Record[ASTStmtReader::NumStmtFields + 3]);
3194 break;
3195
3196 case STMT_DEFAULT:
3197 S = new (Context) DefaultStmt(Empty);
3198 break;
3199
3200 case STMT_LABEL:
3201 S = new (Context) LabelStmt(Empty);
3202 break;
3203
3204 case STMT_ATTRIBUTED:
3206 Context,
3208 break;
3209
3210 case STMT_IF: {
3211 BitsUnpacker IfStmtBits(Record[ASTStmtReader::NumStmtFields]);
3212 bool HasElse = IfStmtBits.getNextBit();
3213 bool HasVar = IfStmtBits.getNextBit();
3214 bool HasInit = IfStmtBits.getNextBit();
3215 S = IfStmt::CreateEmpty(Context, HasElse, HasVar, HasInit);
3216 break;
3217 }
3218
3219 case STMT_SWITCH:
3221 Context,
3223 /* HasVar=*/Record[ASTStmtReader::NumStmtFields + 1]);
3224 break;
3225
3226 case STMT_WHILE:
3228 Context,
3230 break;
3231
3232 case STMT_DO:
3233 S = new (Context) DoStmt(Empty);
3234 break;
3235
3236 case STMT_FOR:
3237 S = new (Context) ForStmt(Empty);
3238 break;
3239
3240 case STMT_GOTO:
3241 S = new (Context) GotoStmt(Empty);
3242 break;
3243
3244 case STMT_INDIRECT_GOTO:
3245 S = new (Context) IndirectGotoStmt(Empty);
3246 break;
3247
3248 case STMT_CONTINUE:
3249 S = new (Context) ContinueStmt(Empty);
3250 break;
3251
3252 case STMT_BREAK:
3253 S = new (Context) BreakStmt(Empty);
3254 break;
3255
3256 case STMT_DEFER:
3257 S = DeferStmt::CreateEmpty(Context, Empty);
3258 break;
3259
3260 case STMT_RETURN:
3262 Context, /* HasNRVOCandidate=*/Record[ASTStmtReader::NumStmtFields]);
3263 break;
3264
3265 case STMT_DECL:
3266 S = new (Context) DeclStmt(Empty);
3267 break;
3268
3269 case STMT_GCCASM:
3270 S = new (Context) GCCAsmStmt(Empty);
3271 break;
3272
3273 case STMT_MSASM:
3274 S = new (Context) MSAsmStmt(Empty);
3275 break;
3276
3277 case STMT_CAPTURED:
3280 break;
3281
3283 S = new (Context) SYCLKernelCallStmt(Empty);
3284 break;
3285
3286 case EXPR_CONSTANT:
3288 Context, static_cast<ConstantResultStorageKind>(
3289 /*StorageKind=*/Record[ASTStmtReader::NumExprFields]));
3290 break;
3291
3294 break;
3295
3298 break;
3299
3302 break;
3303
3304 case EXPR_PREDEFINED:
3306 Context,
3307 /*HasFunctionName*/ Record[ASTStmtReader::NumExprFields]);
3308 break;
3309
3310 case EXPR_DECL_REF: {
3311 BitsUnpacker DeclRefExprBits(Record[ASTStmtReader::NumExprFields]);
3312 DeclRefExprBits.advance(5);
3313 bool HasFoundDecl = DeclRefExprBits.getNextBit();
3314 bool HasQualifier = DeclRefExprBits.getNextBit();
3315 bool HasTemplateKWAndArgsInfo = DeclRefExprBits.getNextBit();
3316 unsigned NumTemplateArgs = HasTemplateKWAndArgsInfo
3318 : 0;
3319 S = DeclRefExpr::CreateEmpty(Context, HasQualifier, HasFoundDecl,
3320 HasTemplateKWAndArgsInfo, NumTemplateArgs);
3321 break;
3322 }
3323
3325 S = IntegerLiteral::Create(Context, Empty);
3326 break;
3327
3329 S = FixedPointLiteral::Create(Context, Empty);
3330 break;
3331
3333 S = FloatingLiteral::Create(Context, Empty);
3334 break;
3335
3337 S = new (Context) ImaginaryLiteral(Empty);
3338 break;
3339
3342 Context,
3343 /* NumConcatenated=*/Record[ASTStmtReader::NumExprFields],
3344 /* Length=*/Record[ASTStmtReader::NumExprFields + 1],
3345 /* CharByteWidth=*/Record[ASTStmtReader::NumExprFields + 2]);
3346 break;
3347
3349 S = new (Context) CharacterLiteral(Empty);
3350 break;
3351
3352 case EXPR_PAREN:
3353 S = new (Context) ParenExpr(Empty);
3354 break;
3355
3356 case EXPR_PAREN_LIST:
3358 Context,
3359 /* NumExprs=*/Record[ASTStmtReader::NumExprFields]);
3360 break;
3361
3362 case EXPR_UNARY_OPERATOR: {
3363 BitsUnpacker UnaryOperatorBits(Record[ASTStmtReader::NumStmtFields]);
3364 UnaryOperatorBits.advance(ASTStmtReader::NumExprBits);
3365 bool HasFPFeatures = UnaryOperatorBits.getNextBit();
3366 S = UnaryOperator::CreateEmpty(Context, HasFPFeatures);
3367 break;
3368 }
3369
3370 case EXPR_OFFSETOF:
3371 S = OffsetOfExpr::CreateEmpty(Context,
3374 break;
3375
3377 S = new (Context) UnaryExprOrTypeTraitExpr(Empty);
3378 break;
3379
3381 S = new (Context) ArraySubscriptExpr(Empty);
3382 break;
3383
3385 S = new (Context) MatrixSubscriptExpr(Empty);
3386 break;
3387
3388 case EXPR_ARRAY_SECTION:
3389 S = new (Context) ArraySectionExpr(Empty);
3390 break;
3391
3395 break;
3396
3397 case EXPR_OMP_ITERATOR:
3398 S = OMPIteratorExpr::CreateEmpty(Context,
3400 break;
3401
3402 case EXPR_CALL: {
3403 auto NumArgs = Record[ASTStmtReader::NumExprFields];
3404 BitsUnpacker CallExprBits(Record[ASTStmtReader::NumExprFields + 1]);
3405 CallExprBits.advance(1);
3406 auto HasFPFeatures = CallExprBits.getNextBit();
3407 S = CallExpr::CreateEmpty(Context, NumArgs, HasFPFeatures, Empty);
3408 break;
3409 }
3410
3411 case EXPR_RECOVERY:
3413 Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields]);
3414 break;
3415
3416 case EXPR_MEMBER: {
3417 BitsUnpacker ExprMemberBits(Record[ASTStmtReader::NumExprFields]);
3418 bool HasQualifier = ExprMemberBits.getNextBit();
3419 bool HasFoundDecl = ExprMemberBits.getNextBit();
3420 bool HasTemplateInfo = ExprMemberBits.getNextBit();
3421 unsigned NumTemplateArgs = Record[ASTStmtReader::NumExprFields + 1];
3422 S = MemberExpr::CreateEmpty(Context, HasQualifier, HasFoundDecl,
3423 HasTemplateInfo, NumTemplateArgs);
3424 break;
3425 }
3426
3427 case EXPR_BINARY_OPERATOR: {
3428 BitsUnpacker BinaryOperatorBits(Record[ASTStmtReader::NumExprFields]);
3429 BinaryOperatorBits.advance(/*Size of opcode*/ 6);
3430 bool HasFPFeatures = BinaryOperatorBits.getNextBit();
3431 S = BinaryOperator::CreateEmpty(Context, HasFPFeatures);
3432 break;
3433 }
3434
3436 BitsUnpacker BinaryOperatorBits(Record[ASTStmtReader::NumExprFields]);
3437 BinaryOperatorBits.advance(/*Size of opcode*/ 6);
3438 bool HasFPFeatures = BinaryOperatorBits.getNextBit();
3439 S = CompoundAssignOperator::CreateEmpty(Context, HasFPFeatures);
3440 break;
3441 }
3442
3444 S = new (Context) ConditionalOperator(Empty);
3445 break;
3446
3448 S = new (Context) BinaryConditionalOperator(Empty);
3449 break;
3450
3451 case EXPR_IMPLICIT_CAST: {
3452 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
3453 BitsUnpacker CastExprBits(Record[ASTStmtReader::NumExprFields + 1]);
3454 CastExprBits.advance(7);
3455 bool HasFPFeatures = CastExprBits.getNextBit();
3456 S = ImplicitCastExpr::CreateEmpty(Context, PathSize, HasFPFeatures);
3457 break;
3458 }
3459
3460 case EXPR_CSTYLE_CAST: {
3461 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
3462 BitsUnpacker CastExprBits(Record[ASTStmtReader::NumExprFields + 1]);
3463 CastExprBits.advance(7);
3464 bool HasFPFeatures = CastExprBits.getNextBit();
3465 S = CStyleCastExpr::CreateEmpty(Context, PathSize, HasFPFeatures);
3466 break;
3467 }
3468
3470 S = new (Context) CompoundLiteralExpr(Empty);
3471 break;
3472
3474 S = new (Context) ExtVectorElementExpr(Empty);
3475 break;
3476
3478 S = new (Context) MatrixElementExpr(Empty);
3479 break;
3480
3481 case EXPR_INIT_LIST:
3482 S = new (Context) InitListExpr(Empty);
3483 break;
3484
3488
3489 break;
3490
3492 S = new (Context) DesignatedInitUpdateExpr(Empty);
3493 break;
3494
3496 S = new (Context) ImplicitValueInitExpr(Empty);
3497 break;
3498
3499 case EXPR_NO_INIT:
3500 S = new (Context) NoInitExpr(Empty);
3501 break;
3502
3504 S = new (Context) ArrayInitLoopExpr(Empty);
3505 break;
3506
3508 S = new (Context) ArrayInitIndexExpr(Empty);
3509 break;
3510
3511 case EXPR_VA_ARG:
3512 S = new (Context) VAArgExpr(Empty);
3513 break;
3514
3515 case EXPR_SOURCE_LOC:
3516 S = new (Context) SourceLocExpr(Empty);
3517 break;
3518
3520 S = new (Context) EmbedExpr(Empty);
3521 break;
3522
3523 case EXPR_ADDR_LABEL:
3524 S = new (Context) AddrLabelExpr(Empty);
3525 break;
3526
3527 case EXPR_STMT:
3528 S = new (Context) StmtExpr(Empty);
3529 break;
3530
3531 case EXPR_CHOOSE:
3532 S = new (Context) ChooseExpr(Empty);
3533 break;
3534
3535 case EXPR_GNU_NULL:
3536 S = new (Context) GNUNullExpr(Empty);
3537 break;
3538
3540 S = new (Context) ShuffleVectorExpr(Empty);
3541 break;
3542
3543 case EXPR_CONVERT_VECTOR: {
3544 BitsUnpacker ConvertVectorExprBits(Record[ASTStmtReader::NumStmtFields]);
3545 ConvertVectorExprBits.advance(ASTStmtReader::NumExprBits);
3546 bool HasFPFeatures = ConvertVectorExprBits.getNextBit();
3547 S = ConvertVectorExpr::CreateEmpty(Context, HasFPFeatures);
3548 break;
3549 }
3550
3551 case EXPR_BLOCK:
3552 S = new (Context) BlockExpr(Empty);
3553 break;
3554
3557 Context,
3558 /*NumAssocs=*/Record[ASTStmtReader::NumExprFields]);
3559 break;
3560
3562 S = new (Context) ObjCStringLiteral(Empty);
3563 break;
3564
3566 S = new (Context) ObjCBoxedExpr(Empty);
3567 break;
3568
3572 break;
3573
3578 break;
3579
3580 case EXPR_OBJC_ENCODE:
3581 S = new (Context) ObjCEncodeExpr(Empty);
3582 break;
3583
3585 S = new (Context) ObjCSelectorExpr(Empty);
3586 break;
3587
3589 S = new (Context) ObjCProtocolExpr(Empty);
3590 break;
3591
3593 S = new (Context) ObjCIvarRefExpr(Empty);
3594 break;
3595
3597 S = new (Context) ObjCPropertyRefExpr(Empty);
3598 break;
3599
3601 S = new (Context) ObjCSubscriptRefExpr(Empty);
3602 break;
3603
3605 llvm_unreachable("mismatching AST file");
3606
3608 S = ObjCMessageExpr::CreateEmpty(Context,
3611 break;
3612
3613 case EXPR_OBJC_ISA:
3614 S = new (Context) ObjCIsaExpr(Empty);
3615 break;
3616
3618 S = new (Context) ObjCIndirectCopyRestoreExpr(Empty);
3619 break;
3620
3622 S = new (Context) ObjCBridgedCastExpr(Empty);
3623 break;
3624
3626 S = new (Context) ObjCForCollectionStmt(Empty);
3627 break;
3628
3629 case STMT_OBJC_CATCH:
3630 S = new (Context) ObjCAtCatchStmt(Empty);
3631 break;
3632
3633 case STMT_OBJC_FINALLY:
3634 S = new (Context) ObjCAtFinallyStmt(Empty);
3635 break;
3636
3637 case STMT_OBJC_AT_TRY:
3638 S = ObjCAtTryStmt::CreateEmpty(Context,
3641 break;
3642
3644 S = new (Context) ObjCAtSynchronizedStmt(Empty);
3645 break;
3646
3647 case STMT_OBJC_AT_THROW:
3648 S = new (Context) ObjCAtThrowStmt(Empty);
3649 break;
3650
3652 S = new (Context) ObjCAutoreleasePoolStmt(Empty);
3653 break;
3654
3656 S = new (Context) ObjCBoolLiteralExpr(Empty);
3657 break;
3658
3660 S = new (Context) ObjCAvailabilityCheckExpr(Empty);
3661 break;
3662
3663 case STMT_SEH_LEAVE:
3664 S = new (Context) SEHLeaveStmt(Empty);
3665 break;
3666
3667 case STMT_SEH_EXCEPT:
3668 S = new (Context) SEHExceptStmt(Empty);
3669 break;
3670
3671 case STMT_SEH_FINALLY:
3672 S = new (Context) SEHFinallyStmt(Empty);
3673 break;
3674
3675 case STMT_SEH_TRY:
3676 S = new (Context) SEHTryStmt(Empty);
3677 break;
3678
3679 case STMT_CXX_CATCH:
3680 S = new (Context) CXXCatchStmt(Empty);
3681 break;
3682
3683 case STMT_CXX_TRY:
3684 S = CXXTryStmt::Create(Context, Empty,
3685 /*numHandlers=*/Record[ASTStmtReader::NumStmtFields]);
3686 break;
3687
3690 Context, Empty,
3693 break;
3694
3699 break;
3700
3701 case STMT_CXX_FOR_RANGE:
3702 S = new (Context) CXXForRangeStmt(Empty);
3703 break;
3704
3706 S = new (Context) MSDependentExistsStmt(SourceLocation(), true,
3707 NestedNameSpecifierLoc(),
3708 DeclarationNameInfo(),
3709 nullptr);
3710 break;
3711
3713 S = OMPCanonicalLoop::createEmpty(Context);
3714 break;
3715
3719 break;
3720
3722 S =
3723 OMPParallelDirective::CreateEmpty(Context,
3725 Empty);
3726 break;
3727
3729 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3730 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3731 S = OMPSimdDirective::CreateEmpty(Context, NumClauses,
3732 CollapsedNum, Empty);
3733 break;
3734 }
3735
3737 unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
3738 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3739 S = OMPTileDirective::CreateEmpty(Context, NumClauses, NumLoops);
3740 break;
3741 }
3742
3744 unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
3745 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3746 S = OMPStripeDirective::CreateEmpty(Context, NumClauses, NumLoops);
3747 break;
3748 }
3749
3751 assert(Record[ASTStmtReader::NumStmtFields] == 1 && "Unroll directive accepts only a single loop");
3752 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3753 S = OMPUnrollDirective::CreateEmpty(Context, NumClauses);
3754 break;
3755 }
3756
3758 unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
3759 assert(Record[ASTStmtReader::NumStmtFields + 1] == 0 &&
3760 "Reverse directive has no clauses");
3761 S = OMPReverseDirective::CreateEmpty(Context, NumLoops);
3762 break;
3763 }
3764
3766 unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
3767 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3768 S = OMPSplitDirective::CreateEmpty(Context, NumClauses, NumLoops);
3769 break;
3770 }
3771
3773 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3774 S = OMPFuseDirective::CreateEmpty(Context, NumClauses);
3775 break;
3776 }
3777
3779 unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
3780 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3781 S = OMPInterchangeDirective::CreateEmpty(Context, NumClauses, NumLoops);
3782 break;
3783 }
3784
3786 unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
3787 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3788 S = OMPFlattenDirective::CreateEmpty(Context, NumClauses, NumLoops);
3789 break;
3790 }
3791
3793 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3794 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3795 S = OMPForDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3796 Empty);
3797 break;
3798 }
3799
3801 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3802 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3803 S = OMPForSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3804 Empty);
3805 break;
3806 }
3807
3811 break;
3812
3815 break;
3816
3820 break;
3821
3825 break;
3826
3829 break;
3830
3834 break;
3835
3837 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3838 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3839 S = OMPParallelForDirective::CreateEmpty(Context, NumClauses,
3840 CollapsedNum, Empty);
3841 break;
3842 }
3843
3845 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3846 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3847 S = OMPParallelForSimdDirective::CreateEmpty(Context, NumClauses,
3848 CollapsedNum, Empty);
3849 break;
3850 }
3851
3855 break;
3856
3860 break;
3861
3865 break;
3866
3870 break;
3871
3874 break;
3875
3878 break;
3879
3883 break;
3884
3888 break;
3889
3893 break;
3894
3898 break;
3899
3903 break;
3904
3908 break;
3909
3911 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3912 S = OMPOrderedStandaloneDirective::CreateEmpty(Context, NumClauses,
3913 Empty);
3914 break;
3915 }
3916
3918 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3919 S = OMPOrderedBlockAssocDirective::CreateEmpty(Context, NumClauses,
3920 Empty);
3921 break;
3922 }
3923
3927 break;
3928
3932 break;
3933
3937 break;
3938
3942 break;
3943
3947 break;
3948
3952 break;
3953
3955 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3956 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3957 S = OMPTargetParallelForDirective::CreateEmpty(Context, NumClauses,
3958 CollapsedNum, Empty);
3959 break;
3960 }
3961
3965 break;
3966
3970 break;
3971
3974 break;
3975
3979 break;
3980
3982 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3983 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3984 S = OMPTaskLoopDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3985 Empty);
3986 break;
3987 }
3988
3990 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3991 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3992 S = OMPTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
3993 CollapsedNum, Empty);
3994 break;
3995 }
3996
3998 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3999 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4000 S = OMPMasterTaskLoopDirective::CreateEmpty(Context, NumClauses,
4001 CollapsedNum, Empty);
4002 break;
4003 }
4004
4006 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4007 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4008 S = OMPMaskedTaskLoopDirective::CreateEmpty(Context, NumClauses,
4009 CollapsedNum, Empty);
4010 break;
4011 }
4012
4014 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4015 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4016 S = OMPMasterTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
4017 CollapsedNum, Empty);
4018 break;
4019 }
4020
4022 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4023 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4024 S = OMPMaskedTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
4025 CollapsedNum, Empty);
4026 break;
4027 }
4028
4030 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4031 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4033 CollapsedNum, Empty);
4034 break;
4035 }
4036
4038 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4039 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4041 CollapsedNum, Empty);
4042 break;
4043 }
4044
4046 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4047 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4049 Context, NumClauses, CollapsedNum, Empty);
4050 break;
4051 }
4052
4054 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4055 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4057 Context, NumClauses, CollapsedNum, Empty);
4058 break;
4059 }
4060
4062 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4063 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4064 S = OMPDistributeDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
4065 Empty);
4066 break;
4067 }
4068
4070 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4071 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4072 S = OMPDistributeParallelForDirective::CreateEmpty(Context, NumClauses,
4073 CollapsedNum, Empty);
4074 break;
4075 }
4076
4078 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4079 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4081 CollapsedNum,
4082 Empty);
4083 break;
4084 }
4085
4087 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4088 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4089 S = OMPDistributeSimdDirective::CreateEmpty(Context, NumClauses,
4090 CollapsedNum, Empty);
4091 break;
4092 }
4093
4095 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4096 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4097 S = OMPTargetParallelForSimdDirective::CreateEmpty(Context, NumClauses,
4098 CollapsedNum, Empty);
4099 break;
4100 }
4101
4103 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4104 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4105 S = OMPTargetSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
4106 Empty);
4107 break;
4108 }
4109
4111 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4112 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4113 S = OMPTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
4114 CollapsedNum, Empty);
4115 break;
4116 }
4117
4119 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4120 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4121 S = OMPTeamsDistributeSimdDirective::CreateEmpty(Context, NumClauses,
4122 CollapsedNum, Empty);
4123 break;
4124 }
4125
4127 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4128 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4130 Context, NumClauses, CollapsedNum, Empty);
4131 break;
4132 }
4133
4135 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4136 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4138 Context, NumClauses, CollapsedNum, Empty);
4139 break;
4140 }
4141
4145 break;
4146
4148 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4149 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4150 S = OMPTargetTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
4151 CollapsedNum, Empty);
4152 break;
4153 }
4154
4156 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4157 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4159 Context, NumClauses, CollapsedNum, Empty);
4160 break;
4161 }
4162
4164 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4165 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4167 Context, NumClauses, CollapsedNum, Empty);
4168 break;
4169 }
4170
4172 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4173 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4175 Context, NumClauses, CollapsedNum, Empty);
4176 break;
4177 }
4178
4182 break;
4183
4187 break;
4188
4192 break;
4193
4195 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4196 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4197 S = OMPGenericLoopDirective::CreateEmpty(Context, NumClauses,
4198 CollapsedNum, Empty);
4199 break;
4200 }
4201
4203 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4204 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4205 S = OMPTeamsGenericLoopDirective::CreateEmpty(Context, NumClauses,
4206 CollapsedNum, Empty);
4207 break;
4208 }
4209
4211 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4212 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4214 CollapsedNum, Empty);
4215 break;
4216 }
4217
4219 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4220 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4221 S = OMPParallelGenericLoopDirective::CreateEmpty(Context, NumClauses,
4222 CollapsedNum, Empty);
4223 break;
4224 }
4225
4227 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4228 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4230 Context, NumClauses, CollapsedNum, Empty);
4231 break;
4232 }
4233
4235 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4236 S = OMPAssumeDirective::CreateEmpty(Context, NumClauses, Empty);
4237 break;
4238 }
4239
4241 auto NumArgs = Record[ASTStmtReader::NumExprFields];
4242 BitsUnpacker CallExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4243 CallExprBits.advance(1);
4244 auto HasFPFeatures = CallExprBits.getNextBit();
4245 S = CXXOperatorCallExpr::CreateEmpty(Context, NumArgs, HasFPFeatures,
4246 Empty);
4247 break;
4248 }
4249
4250 case EXPR_CXX_MEMBER_CALL: {
4251 auto NumArgs = Record[ASTStmtReader::NumExprFields];
4252 BitsUnpacker CallExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4253 CallExprBits.advance(1);
4254 auto HasFPFeatures = CallExprBits.getNextBit();
4255 S = CXXMemberCallExpr::CreateEmpty(Context, NumArgs, HasFPFeatures,
4256 Empty);
4257 break;
4258 }
4259
4261 S = new (Context) CXXRewrittenBinaryOperator(Empty);
4262 break;
4263
4264 case EXPR_CXX_CONSTRUCT:
4266 Context,
4267 /* NumArgs=*/Record[ASTStmtReader::NumExprFields]);
4268 break;
4269
4271 S = new (Context) CXXInheritedCtorInitExpr(Empty);
4272 break;
4273
4276 Context,
4277 /* NumArgs=*/Record[ASTStmtReader::NumExprFields]);
4278 break;
4279
4280 case EXPR_CXX_STATIC_CAST: {
4281 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
4282 BitsUnpacker CastExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4283 CastExprBits.advance(7);
4284 bool HasFPFeatures = CastExprBits.getNextBit();
4285 S = CXXStaticCastExpr::CreateEmpty(Context, PathSize, HasFPFeatures);
4286 break;
4287 }
4288
4289 case EXPR_CXX_DYNAMIC_CAST: {
4290 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
4291 S = CXXDynamicCastExpr::CreateEmpty(Context, PathSize);
4292 break;
4293 }
4294
4296 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
4297 S = CXXReinterpretCastExpr::CreateEmpty(Context, PathSize);
4298 break;
4299 }
4300
4302 S = CXXConstCastExpr::CreateEmpty(Context);
4303 break;
4304
4307 break;
4308
4310 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
4311 BitsUnpacker CastExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4312 CastExprBits.advance(7);
4313 bool HasFPFeatures = CastExprBits.getNextBit();
4314 S = CXXFunctionalCastExpr::CreateEmpty(Context, PathSize, HasFPFeatures);
4315 break;
4316 }
4317
4318 case EXPR_BUILTIN_BIT_CAST: {
4319#ifndef NDEBUG
4320 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
4321 assert(PathSize == 0 && "Wrong PathSize!");
4322#endif
4323 S = new (Context) BuiltinBitCastExpr(Empty);
4324 break;
4325 }
4326
4328 auto NumArgs = Record[ASTStmtReader::NumExprFields];
4329 BitsUnpacker CallExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4330 CallExprBits.advance(1);
4331 auto HasFPFeatures = CallExprBits.getNextBit();
4332 S = UserDefinedLiteral::CreateEmpty(Context, NumArgs, HasFPFeatures,
4333 Empty);
4334 break;
4335 }
4336
4338 S = new (Context) CXXStdInitializerListExpr(Empty);
4339 break;
4340
4342 S = new (Context) CXXBoolLiteralExpr(Empty);
4343 break;
4344
4346 S = new (Context) CXXNullPtrLiteralExpr(Empty);
4347 break;
4348
4350 S = new (Context) CXXTypeidExpr(Empty, true);
4351 break;
4352
4354 S = new (Context) CXXTypeidExpr(Empty, false);
4355 break;
4356
4358 S = new (Context) CXXUuidofExpr(Empty, true);
4359 break;
4360
4362 S = new (Context) MSPropertyRefExpr(Empty);
4363 break;
4364
4366 S = new (Context) MSPropertySubscriptExpr(Empty);
4367 break;
4368
4370 S = new (Context) CXXUuidofExpr(Empty, false);
4371 break;
4372
4373 case EXPR_CXX_THIS:
4374 S = CXXThisExpr::CreateEmpty(Context);
4375 break;
4376
4377 case EXPR_CXX_THROW:
4378 S = new (Context) CXXThrowExpr(Empty);
4379 break;
4380
4383 Context, /*HasRewrittenInit=*/Record[ASTStmtReader::NumExprFields]);
4384 break;
4385
4388 Context, /*HasRewrittenInit=*/Record[ASTStmtReader::NumExprFields]);
4389 break;
4390
4392 S = new (Context) CXXBindTemporaryExpr(Empty);
4393 break;
4394
4396 S = new (Context) CXXScalarValueInitExpr(Empty);
4397 break;
4398
4399 case EXPR_CXX_NEW:
4401 Context,
4403 /*HasInit=*/Record[ASTStmtReader::NumExprFields + 1],
4404 /*NumPlacementArgs=*/Record[ASTStmtReader::NumExprFields + 2],
4405 /*IsParenTypeId=*/Record[ASTStmtReader::NumExprFields + 3]);
4406 break;
4407
4408 case EXPR_CXX_DELETE:
4409 S = new (Context) CXXDeleteExpr(Empty);
4410 break;
4411
4413 S = new (Context) CXXPseudoDestructorExpr(Empty);
4414 break;
4415
4417 S = ExprWithCleanups::Create(Context, Empty,
4419 break;
4420
4422 unsigned NumTemplateArgs = Record[ASTStmtReader::NumExprFields];
4423 BitsUnpacker DependentScopeMemberBits(
4425 bool HasTemplateKWAndArgsInfo = DependentScopeMemberBits.getNextBit();
4426
4427 bool HasFirstQualifierFoundInScope =
4428 DependentScopeMemberBits.getNextBit();
4430 Context, HasTemplateKWAndArgsInfo, NumTemplateArgs,
4431 HasFirstQualifierFoundInScope);
4432 break;
4433 }
4434
4437 Context, /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]);
4438 break;
4439
4441 BitsUnpacker DependentScopeDeclRefBits(
4443 DependentScopeDeclRefBits.advance(ASTStmtReader::NumExprBits);
4444 bool HasTemplateKWAndArgsInfo = DependentScopeDeclRefBits.getNextBit();
4445 unsigned NumTemplateArgs =
4446 HasTemplateKWAndArgsInfo
4447 ? DependentScopeDeclRefBits.getNextBits(/*Width=*/16)
4448 : 0;
4450 Context, HasTemplateKWAndArgsInfo, NumTemplateArgs);
4451 break;
4452 }
4453
4457 break;
4458
4460 auto NumResults = Record[ASTStmtReader::NumExprFields];
4461 BitsUnpacker OverloadExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4462 auto HasTemplateKWAndArgsInfo = OverloadExprBits.getNextBit();
4463 auto NumTemplateArgs = HasTemplateKWAndArgsInfo
4465 : 0;
4467 Context, NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
4468 break;
4469 }
4470
4472 auto NumResults = Record[ASTStmtReader::NumExprFields];
4473 BitsUnpacker OverloadExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4474 auto HasTemplateKWAndArgsInfo = OverloadExprBits.getNextBit();
4475 auto NumTemplateArgs = HasTemplateKWAndArgsInfo
4477 : 0;
4479 Context, NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
4480 break;
4481 }
4482
4483 case EXPR_TYPE_TRAIT:
4487 break;
4488
4490 S = new (Context) ArrayTypeTraitExpr(Empty);
4491 break;
4492
4494 S = new (Context) ExpressionTraitExpr(Empty);
4495 break;
4496
4497 case EXPR_CXX_NOEXCEPT:
4498 S = new (Context) CXXNoexceptExpr(Empty);
4499 break;
4500
4502 S = new (Context) PackExpansionExpr(Empty);
4503 break;
4504
4505 case EXPR_SIZEOF_PACK:
4507 Context,
4508 /*NumPartialArgs=*/Record[ASTStmtReader::NumExprFields]);
4509 break;
4510
4511 case EXPR_PACK_INDEXING:
4513 Context,
4514 /*TransformedExprs=*/Record[ASTStmtReader::NumExprFields]);
4515 break;
4516
4518 S = new (Context) SubstNonTypeTemplateParmExpr(Empty);
4519 break;
4520
4522 S = new (Context) SubstNonTypeTemplateParmPackExpr(Empty);
4523 break;
4524
4528 break;
4529
4531 S = new (Context) MaterializeTemporaryExpr(Empty);
4532 break;
4533
4534 case EXPR_CXX_FOLD:
4535 S = new (Context) CXXFoldExpr(Empty);
4536 break;
4537
4540 Context, /*numExprs=*/Record[ASTStmtReader::NumExprFields], Empty);
4541 break;
4542
4543 case EXPR_OPAQUE_VALUE:
4544 S = new (Context) OpaqueValueExpr(Empty);
4545 break;
4546
4547 case EXPR_CUDA_KERNEL_CALL: {
4548 auto NumArgs = Record[ASTStmtReader::NumExprFields];
4549 BitsUnpacker CallExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4550 CallExprBits.advance(1);
4551 auto HasFPFeatures = CallExprBits.getNextBit();
4552 S = CUDAKernelCallExpr::CreateEmpty(Context, NumArgs, HasFPFeatures,
4553 Empty);
4554 break;
4555 }
4556
4557 case EXPR_ASTYPE:
4558 S = new (Context) AsTypeExpr(Empty);
4559 break;
4560
4561 case EXPR_PSEUDO_OBJECT: {
4562 unsigned numSemanticExprs = Record[ASTStmtReader::NumExprFields];
4563 S = PseudoObjectExpr::Create(Context, Empty, numSemanticExprs);
4564 break;
4565 }
4566
4567 case EXPR_ATOMIC:
4568 S = new (Context) AtomicExpr(Empty);
4569 break;
4570
4571 case EXPR_LAMBDA: {
4572 unsigned NumCaptures = Record[ASTStmtReader::NumExprFields];
4573 S = LambdaExpr::CreateDeserialized(Context, NumCaptures);
4574 break;
4575 }
4576
4577 case STMT_COROUTINE_BODY: {
4578 unsigned NumParams = Record[ASTStmtReader::NumStmtFields];
4579 S = CoroutineBodyStmt::Create(Context, Empty, NumParams);
4580 break;
4581 }
4582
4583 case STMT_CORETURN:
4584 S = new (Context) CoreturnStmt(Empty);
4585 break;
4586
4587 case EXPR_COAWAIT:
4588 S = new (Context) CoawaitExpr(Empty);
4589 break;
4590
4591 case EXPR_COYIELD:
4592 S = new (Context) CoyieldExpr(Empty);
4593 break;
4594
4596 S = new (Context) DependentCoawaitExpr(Empty);
4597 break;
4598
4600 S = new (Context) ConceptSpecializationExpr(Empty);
4601 break;
4602 }
4603
4605 S = new (Context) CXXExpansionSelectExpr(Empty);
4606 break;
4607
4609 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4610 S = OpenACCComputeConstruct::CreateEmpty(Context, NumClauses);
4611 break;
4612 }
4614 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4615 S = OpenACCLoopConstruct::CreateEmpty(Context, NumClauses);
4616 break;
4617 }
4619 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4620 S = OpenACCCombinedConstruct::CreateEmpty(Context, NumClauses);
4621 break;
4622 }
4624 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4625 S = OpenACCDataConstruct::CreateEmpty(Context, NumClauses);
4626 break;
4627 }
4629 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4630 S = OpenACCEnterDataConstruct::CreateEmpty(Context, NumClauses);
4631 break;
4632 }
4634 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4635 S = OpenACCExitDataConstruct::CreateEmpty(Context, NumClauses);
4636 break;
4637 }
4639 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4640 S = OpenACCHostDataConstruct::CreateEmpty(Context, NumClauses);
4641 break;
4642 }
4644 unsigned NumExprs = Record[ASTStmtReader::NumStmtFields];
4645 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4646 S = OpenACCWaitConstruct::CreateEmpty(Context, NumExprs, NumClauses);
4647 break;
4648 }
4650 unsigned NumVars = Record[ASTStmtReader::NumStmtFields];
4651 S = OpenACCCacheConstruct::CreateEmpty(Context, NumVars);
4652 break;
4653 }
4655 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4656 S = OpenACCInitConstruct::CreateEmpty(Context, NumClauses);
4657 break;
4658 }
4660 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4661 S = OpenACCShutdownConstruct::CreateEmpty(Context, NumClauses);
4662 break;
4663 }
4665 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4666 S = OpenACCSetConstruct::CreateEmpty(Context, NumClauses);
4667 break;
4668 }
4670 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4671 S = OpenACCUpdateConstruct::CreateEmpty(Context, NumClauses);
4672 break;
4673 }
4675 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4676 S = OpenACCAtomicConstruct::CreateEmpty(Context, NumClauses);
4677 break;
4678 }
4679 case EXPR_REQUIRES: {
4680 unsigned numLocalParameters = Record[ASTStmtReader::NumExprFields];
4681 unsigned numRequirement = Record[ASTStmtReader::NumExprFields + 1];
4682 S = RequiresExpr::Create(Context, Empty, numLocalParameters,
4683 numRequirement);
4684 break;
4685 }
4686 case EXPR_HLSL_OUT_ARG:
4687 S = HLSLOutArgExpr::CreateEmpty(Context);
4688 break;
4689 case EXPR_REFLECT: {
4690 S = CXXReflectExpr::CreateEmpty(Context);
4691 break;
4692 }
4693 }
4694
4695 // We hit a STMT_STOP, so we're done with this expression.
4696 if (Finished)
4697 break;
4698
4699 ++NumStatementsRead;
4700
4701 if (S && !IsStmtReference) {
4702 Reader.Visit(S);
4703 StmtEntries[Cursor.GetCurrentBitNo()] = S;
4704 }
4705
4706 assert(Record.getIdx() == Record.size() &&
4707 "Invalid deserialization of statement");
4708 StmtStack.push_back(S);
4709 }
4710Done:
4711 assert(StmtStack.size() > PrevNumStmts && "Read too many sub-stmts!");
4712 assert(StmtStack.size() == PrevNumStmts + 1 && "Extra expressions on stack!");
4713 return StmtStack.pop_back_val();
4714}
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 enumerations for traits support.
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.
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.
C Language Family Type Representation.
static OMPAssumeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
static OMPAtomicDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPBarrierDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
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 OMPCriticalDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPDepobjDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
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 OMPFlattenDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty 'pragma omp flatten' AST node for deserialization.
static OMPFlushDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
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.
void setNumGeneratedTopLevelLoops(unsigned N)
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 OMPMasterDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
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 OMPOrderedBlockAssocDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPOrderedStandaloneDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPParallelGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPParallelMaskedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, 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 OMPParallelMasterDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, 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 OMPParallelSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, 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 OMPScopeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
void setHasCancel(bool Has)
Set cancel state.
static OMPSectionDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static OMPSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPSingleDirective * 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 OMPTaskDirective * 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 OMPTaskgroupDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPTaskwaitDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPTaskyieldDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
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:433
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition ASTContext.h:239
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:2593
Stmt * ReadSubStmt()
Reads a sub-statement operand during statement reading.
Definition ASTReader.h:2548
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:4594
void setLabel(LabelDecl *L)
Definition Expr.h:4618
void setLabelLoc(SourceLocation L)
Definition Expr.h:4612
void setAmpAmpLoc(SourceLocation L)
Definition Expr.h:4610
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Definition Expr.h:6071
Represents a loop initializing the elements of an array.
Definition Expr.h:6018
This class represents BOTH the OpenMP Array Section and OpenACC 'subarray', with a boolean differenti...
Definition Expr.h:7269
bool isOMPArraySection() const
Definition Expr.h:7343
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition Expr.h:2765
void setRHS(Expr *E)
Definition Expr.h:2800
void setRBracketLoc(SourceLocation L)
Definition Expr.h:2816
void setLHS(Expr *E)
Definition Expr.h:2796
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
Definition ExprCXX.h:3010
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Definition Expr.h:6783
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
Definition Stmt.h:3289
void setSimple(bool V)
Definition Stmt.h:3323
void setAsmLoc(SourceLocation L)
Definition Stmt.h:3320
void setVolatile(bool V)
Definition Stmt.h:3326
unsigned NumInputs
Definition Stmt.h:3304
unsigned getNumClobbers() const
Definition Stmt.h:3380
unsigned getNumOutputs() const
Definition Stmt.h:3348
unsigned NumOutputs
Definition Stmt.h:3303
unsigned NumClobbers
Definition Stmt.h:3305
unsigned getNumInputs() const
Definition Stmt.h:3370
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Definition Expr.h:6978
unsigned getNumSubExprs() const
Definition Expr.h:7051
Represents an attribute applied to a statement.
Definition Stmt.h:2215
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:4497
A builtin binary operation expression such as "x + y" or "x <= y".
Definition Expr.h:4082
void setLHS(Expr *E)
Definition Expr.h:4133
void setHasStoredFPFeatures(bool B)
Set and fetch the bit that shows whether FPFeatures needs to be allocated in Trailing Storage.
Definition Expr.h:4266
void setOperatorLoc(SourceLocation L)
Definition Expr.h:4125
void setRHS(Expr *E)
Definition Expr.h:4135
void setExcludedOverflowPattern(bool B)
Set and get the bit that informs arithmetic overflow sanitizers whether or not they should exclude ce...
Definition Expr.h:4271
static BinaryOperator * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
Definition Expr.cpp:5130
void setStoredFPFeatures(FPOptionsOverride F)
Set FPFeatures in trailing storage, used only by Serialization.
Definition Expr.h:4284
void setOpcode(Opcode Opc)
Definition Expr.h:4130
BinaryOperatorKind Opcode
Definition Expr.h:4087
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition Expr.h:6722
void setBlockDecl(BlockDecl *BD)
Definition Expr.h:6736
BreakStmt - This represents a break.
Definition Stmt.h:3147
Represents a C++2a __builtin_bit_cast(T, v) expression.
Definition ExprCXX.h:5529
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr....
Definition Expr.h:4013
static CStyleCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize, bool HasFPFeatures)
Definition Expr.cpp:2153
void setRParenLoc(SourceLocation L)
Definition Expr.h:4049
void setLParenLoc(SourceLocation L)
Definition Expr.h:4046
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:2025
A C++ addrspace_cast expression (currently only enabled for OpenCL).
Definition ExprCXX.h:608
static CXXAddrspaceCastExpr * CreateEmpty(const ASTContext &Context)
Definition ExprCXX.cpp:947
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:29
A C++ const_cast expression (C++ [expr.const.cast]).
Definition ExprCXX.h:570
static CXXConstCastExpr * CreateEmpty(const ASTContext &Context)
Definition ExprCXX.cpp:934
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:1228
A default argument (C++ [dcl.fct.default]).
Definition ExprCXX.h:1274
static CXXDefaultArgExpr * CreateEmpty(const ASTContext &C, bool HasRewrittenInit)
Definition ExprCXX.cpp:1065
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:1119
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:3923
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition ExprCXX.h:4117
static CXXDependentScopeMemberExpr * CreateEmpty(const ASTContext &Ctx, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs, bool HasFirstQualifierFoundInScope)
Definition ExprCXX.cpp:1604
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Definition ExprCXX.h:485
static CXXDynamicCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
Definition ExprCXX.cpp:857
Helper that selects an expression from an InitListExpr depending on the current expansion index.
Definition ExprCXX.h:5611
void setRangeExpr(InitListExpr *E)
Definition ExprCXX.h:5627
Represents the code generated for an expanded expansion statement.
Definition StmtCXX.h:1028
ArrayRef< Stmt * > getAllSubStmts() const
Definition StmtCXX.h:1057
static CXXExpansionStmtInstantiation * CreateEmpty(ASTContext &C, EmptyShell Empty, unsigned NumInstantiations, unsigned NumPreambleStmts)
Definition StmtCXX.cpp:274
void setShouldApplyLifetimeExtensionToPreamble(bool Apply)
Definition StmtCXX.h:1081
CXXExpansionStmtPattern - Represents an unexpanded C++ expansion statement.
Definition StmtCXX.h:675
static CXXExpansionStmtPattern * CreateEmpty(ASTContext &Context, EmptyShell Empty, ExpansionStmtKind Kind)
Definition StmtCXX.cpp:180
Represents a folding of a pack over an operator.
Definition ExprCXX.h:5085
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
Definition StmtCXX.h:136
void setLoopVarStmt(Stmt *S)
Definition StmtCXX.h:200
void setRangeStmt(Stmt *S)
Definition StmtCXX.h:195
void setEndStmt(Stmt *S)
Definition StmtCXX.h:197
void setInc(Expr *E)
Definition StmtCXX.h:199
void setBeginStmt(Stmt *S)
Definition StmtCXX.h:196
void setInit(Stmt *S)
Definition StmtCXX.h:193
void setBody(Stmt *S)
Definition StmtCXX.h:201
void setCond(Expr *E)
Definition StmtCXX.h:198
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:967
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:742
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:321
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:4362
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:672
Represents a list-initialization with parenthesis.
Definition ExprCXX.h:5194
void setInitializedFieldInUnion(FieldDecl *FD)
Definition ExprCXX.h:5268
static CXXParenListInitExpr * CreateEmpty(ASTContext &C, unsigned numExprs, EmptyShell Empty)
Definition ExprCXX.cpp:2049
void setArrayFiller(Expr *E)
Definition ExprCXX.h:5258
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:5561
static CXXReflectExpr * CreateEmpty(ASTContext &C)
Definition ExprCXX.cpp:1991
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
Definition ExprCXX.h:530
static CXXReinterpretCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
Definition ExprCXX.cpp:920
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:830
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:1194
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:1624
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:70
unsigned getNumHandlers() const
Definition StmtCXX.h:108
static CXXTryStmt * Create(const ASTContext &C, SourceLocation tryLoc, CompoundStmt *tryBlock, ArrayRef< Stmt * > handlers)
Definition StmtCXX.cpp:26
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:3797
void setRParenLoc(SourceLocation L)
Definition ExprCXX.h:3847
void setArg(unsigned I, Expr *E)
Definition ExprCXX.h:3883
void setLParenLoc(SourceLocation L)
Definition ExprCXX.h:3842
unsigned getNumArgs() const
Retrieve the number of arguments.
Definition ExprCXX.h:3855
static CXXUnresolvedConstructExpr * CreateEmpty(const ASTContext &Context, unsigned NumArgs)
Definition ExprCXX.cpp:1531
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:2987
void setRParenLoc(SourceLocation L)
Definition Expr.h:3319
void setCoroElideSafe(bool V=true)
Definition Expr.h:3162
void setArg(unsigned Arg, Expr *ArgExpr)
setArg - Set the specified argument.
Definition Expr.h:3204
void setADLCallKind(ADLCallKind V=UsesADL)
Definition Expr.h:3141
static CallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPFeatures, EmptyShell Empty)
Create an empty call expression, for deserialization.
Definition Expr.cpp:1563
void setUsesMemberSyntax(bool V=true)
Definition Expr.h:3151
void setPreArg(unsigned I, Stmt *PreArg)
Definition Expr.h:3084
void setStoredFPFeatures(FPOptionsOverride F)
Set FPOptionsOverride in trailing storage. Used only by Serialization.
Definition Expr.h:3268
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition Expr.h:3178
void setCallee(Expr *F)
Definition Expr.h:3136
void setBody(Stmt *B)
Definition Decl.cpp:5769
This captures a statement into a function.
Definition Stmt.h:3949
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:4108
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:4053
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument.
Definition Stmt.h:4126
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:4073
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument.
Definition Stmt.h:4136
capture_range captures()
Definition Stmt.h:4087
VariableCaptureKind
The different capture forms: by 'this', by reference, capture for variable-length array type etc.
Definition Stmt.h:3953
CaseStmt - Represent a case statement.
Definition Stmt.h:1932
void setEllipsisLoc(SourceLocation L)
Set the location of the ... in a case statement of the form LHS ... RHS.
Definition Stmt.h:2008
static CaseStmt * CreateEmpty(const ASTContext &Ctx, bool CaseStmtIsGNURange)
Build an empty case statement.
Definition Stmt.cpp:1317
void setLHS(Expr *Val)
Definition Stmt.h:2023
void setSubStmt(Stmt *S)
Definition Stmt.h:2050
void setRHS(Expr *Val)
Definition Stmt.h:2039
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition Expr.h:3720
FPOptionsOverride * getTrailingFPFeatures()
Return a pointer to the trailing FPOptions.
Definition Expr.cpp:2083
path_iterator path_begin()
Definition Expr.h:3790
unsigned path_size() const
Definition Expr.h:3789
void setCastKind(CastKind K)
Definition Expr.h:3765
bool hasStoredFPFeatures() const
Definition Expr.h:3819
CXXBaseSpecifier ** path_iterator
Definition Expr.h:3786
void setSubExpr(Expr *E)
Definition Expr.h:3772
void setValue(unsigned Val)
Definition Expr.h:1655
void setLocation(SourceLocation Location)
Definition Expr.h:1651
void setKind(CharacterLiteralKind kind)
Definition Expr.h:1652
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition Expr.h:4892
void setRParenLoc(SourceLocation L)
Definition Expr.h:4943
void setIsConditionTrue(bool isTrue)
Definition Expr.h:4920
void setBuiltinLoc(SourceLocation L)
Definition Expr.h:4940
void setRHS(Expr *E)
Definition Expr.h:4937
void setCond(Expr *E)
Definition Expr.h:4933
void setLHS(Expr *E)
Definition Expr.h:4935
Represents a 'co_await' expression.
Definition ExprCXX.h:5422
void setIsImplicit(bool value=true)
Definition ExprCXX.h:5445
CompoundAssignOperator - For compound assignments (e.g.
Definition Expr.h:4344
void setComputationResultType(QualType T)
Definition Expr.h:4382
static CompoundAssignOperator * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
Definition Expr.cpp:5152
void setComputationLHSType(QualType T)
Definition Expr.h:4379
CompoundLiteralExpr - [C99 6.5.2.5].
Definition Expr.h:3649
void setFileScope(bool FS)
Definition Expr.h:3682
void setTypeSourceInfo(TypeSourceInfo *tinfo)
Definition Expr.h:3690
void setLParenLoc(SourceLocation L)
Definition Expr.h:3685
void setInitializer(Expr *E)
Definition Expr.h:3679
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition Stmt.h:1752
static CompoundStmt * CreateEmpty(const ASTContext &C, unsigned NumStmts, bool HasFPFeatures)
Definition Stmt.cpp:409
bool hasStoredFPFeatures() const
Definition Stmt.h:1799
Represents the specialization of a concept - evaluates to a prvalue of type bool.
ConditionalOperator - The ?
Definition Expr.h:4435
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition Expr.h:1102
ConstantResultStorageKind getResultStorageKind() const
Definition Expr.h:1171
static ConstantExpr * CreateEmpty(const ASTContext &Context, ConstantResultStorageKind StorageKind)
Definition Expr.cpp:373
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:3131
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition Expr.h:4763
static ConvertVectorExpr * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
Definition Expr.cpp:5718
void setStoredFPFeatures(FPOptionsOverride F)
Set FPFeatures in trailing storage, used by Serialization & ASTImporter.
Definition Expr.h:4836
bool hasStoredFPFeatures() const
Is FPFeatures in Trailing Storage?
Definition Expr.h:4821
Represents a 'co_return' statement in the C++ Coroutines TS.
Definition StmtCXX.h:474
Represents the body of a coroutine.
Definition StmtCXX.h:321
static CoroutineBodyStmt * Create(const ASTContext &C, CtorArgs const &Args)
Definition StmtCXX.cpp:88
Represents a 'co_yield' expression.
Definition ExprCXX.h:5503
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:1290
bool hasTemplateKWAndArgsInfo() const
Definition Expr.h:1411
static DeclRefExpr * CreateEmpty(const ASTContext &Context, bool HasQualifier, bool HasFoundDecl, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Construct an empty declaration reference expression.
Definition Expr.cpp:535
void setLocation(SourceLocation L)
Definition Expr.h:1367
bool hasQualifier() const
Determine whether this declaration reference was preceded by a C++ nested-name-specifier,...
Definition Expr.h:1379
ValueDecl * getDecl()
Definition Expr.h:1358
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
Definition Stmt.h:1643
void setStartLoc(SourceLocation L)
Definition Stmt.h:1665
void setEndLoc(SourceLocation L)
Definition Stmt.h:1667
void setDeclGroup(DeclGroupRef DGR)
Definition Stmt.h:1663
Decl - This represents one declaration (or definition), e.g.
Definition DeclBase.h:86
void setSubStmt(Stmt *S)
Definition Stmt.h:2095
DeferStmt - This represents a deferred statement.
Definition Stmt.h:3248
void setBody(Stmt *S)
Definition Stmt.h:3269
void setDeferLoc(SourceLocation DeferLoc)
Definition Stmt.h:3263
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:5454
A qualified reference to a name whose declaration cannot yet be resolved.
Definition ExprCXX.h:3563
static DependentScopeDeclRefExpr * CreateEmpty(const ASTContext &Context, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition ExprCXX.cpp:590
A template-id naming a variable template or a concept through a template template parameter.
Definition ExprCXX.h:3479
static DependentTemplateIdExpr * CreateEmpty(const ASTContext &Context, unsigned NumTemplateArgs)
Definition ExprCXX.cpp:433
unsigned getNumTemplateArgs() const
Definition ExprCXX.h:3522
Represents a C99 designated initializer expression.
Definition Expr.h:5601
static DesignatedInitExpr * CreateEmpty(const ASTContext &C, unsigned NumIndexExprs)
Definition Expr.cpp:4883
void setSubExpr(unsigned Idx, Expr *E)
Definition Expr.h:5887
void setGNUSyntax(bool GNU)
Definition Expr.h:5866
void setEqualOrColonLoc(SourceLocation L)
Definition Expr.h:5857
void setDesignators(const ASTContext &C, const Designator *Desigs, unsigned NumDesigs)
Definition Expr.cpp:4890
unsigned getNumSubExprs() const
Retrieve the total number of subexpressions in this designated initializer expression,...
Definition Expr.h:5881
void setBase(Expr *Base)
Definition Expr.h:5984
void setUpdater(Expr *Updater)
Definition Expr.h:5989
static Designator CreateArrayRangeDesignator(Expr *Start, Expr *End, SourceLocation LBracketLoc, SourceLocation EllipsisLoc)
Creates a GNU array-range designator.
Definition Designator.h:185
static Designator CreateArrayDesignator(Expr *Index, SourceLocation LBracketLoc)
Creates an array designator.
Definition Designator.h:155
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:2844
void setWhileLoc(SourceLocation L)
Definition Stmt.h:2876
void setDoLoc(SourceLocation L)
Definition Stmt.h:2874
void setRParenLoc(SourceLocation L)
Definition Stmt.h:2878
void setBody(Stmt *Body)
Definition Stmt.h:2871
void setCond(Expr *Cond)
Definition Stmt.h:2867
void setAccessorLoc(SourceLocation L)
Definition Expr.h:6639
void setAccessor(IdentifierInfo *II)
Definition Expr.h:6636
void setBase(Expr *E)
Definition Expr.h:6633
Represents a reference to emded data.
Definition Expr.h:5179
ExplicitCastExpr - An explicit cast written in the source code.
Definition Expr.h:3972
void setTypeInfoAsWritten(TypeSourceInfo *writtenTy)
Definition Expr.h:3995
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition ExprCXX.h:3714
unsigned getNumObjects() const
Definition ExprCXX.h:3742
llvm::PointerUnion< BlockDecl *, CompoundLiteralExpr * > CleanupObject
The type of objects that are kept in the cleanup.
Definition ExprCXX.h:3720
static ExprWithCleanups * Create(const ASTContext &C, EmptyShell empty, unsigned numObjects)
Definition ExprCXX.cpp:1497
This represents one expression.
Definition Expr.h:113
void setType(QualType t)
Definition Expr.h:146
bool isValueDependent() const
Determines whether the value of this expression depends on.
Definition Expr.h:178
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on.
Definition Expr.h:224
void setValueKind(ExprValueKind Cat)
setValueKind - Set the value kind produced by this expression.
Definition Expr.h:465
void setObjectKind(ExprObjectKind Cat)
setObjectKind - Set the object kind produced by this expression.
Definition Expr.h:468
QualType getType() const
Definition Expr.h:145
void setDependence(ExprDependence Deps)
Each concrete expr subclass is expected to compute its dependence and call this in the constructor.
Definition Expr.h:138
An expression trait intrinsic.
Definition ExprCXX.h:3083
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition Expr.h:6660
static FPOptionsOverride getFromOpaqueInt(storage_type I)
static FixedPointLiteral * Create(const ASTContext &C, EmptyShell Empty)
Returns an empty fixed-point literal.
Definition Expr.cpp:1011
void setLocation(SourceLocation Location)
Definition Expr.h:1603
void setScale(unsigned S)
Definition Expr.h:1606
static FloatingLiteral * Create(const ASTContext &C, const llvm::APFloat &V, bool isexact, QualType Type, SourceLocation L)
Definition Expr.cpp:1082
const llvm::fltSemantics & getSemantics() const
Return the APFloat semantics this literal uses.
Definition Expr.h:1708
void setValue(const ASTContext &C, const llvm::APFloat &Val)
Definition Expr.h:1689
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:1703
void setExact(bool E)
Definition Expr.h:1720
void setLocation(SourceLocation L)
Definition Expr.h:1728
ForStmt - This represents a 'for (init;cond;inc)' stmt.
Definition Stmt.h:2900
void setBody(Stmt *S)
Definition Stmt.h:2954
void setCond(Expr *E)
Definition Stmt.h:2952
void setForLoc(SourceLocation L)
Definition Stmt.h:2957
void setInc(Expr *E)
Definition Stmt.h:2953
void setLParenLoc(SourceLocation L)
Definition Stmt.h:2959
void setInit(Stmt *S)
Definition Stmt.h:2951
void setConditionVariableDeclStmt(DeclStmt *CondVar)
Definition Stmt.h:2938
void setRParenLoc(SourceLocation L)
Definition Stmt.h:2961
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:1087
Stmt * SubExpr
Definition Expr.h:1071
Represents a reference to a function parameter pack, init-capture pack, or binding pack that has been...
Definition ExprCXX.h:4894
static FunctionParmPackExpr * CreateEmpty(const ASTContext &Context, unsigned NumParams)
Definition ExprCXX.cpp:1842
This represents a GCC inline-assembly statement extension.
Definition Stmt.h:3458
unsigned getNumLabels() const
Definition Stmt.h:3608
void setAsmStringExpr(Expr *E)
Definition Stmt.h:3487
void setRParenLoc(SourceLocation L)
Definition Stmt.h:3481
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Definition Expr.h:4967
void setTokenLocation(SourceLocation L)
Definition Expr.h:4982
Represents a C11 generic selection.
Definition Expr.h:6232
unsigned getNumAssocs() const
The number of association expressions.
Definition Expr.h:6474
static GenericSelectionExpr * CreateEmpty(const ASTContext &Context, unsigned NumAssocs)
Create an empty generic selection expression for deserialization.
Definition Expr.cpp:4817
GotoStmt - This represents a direct goto.
Definition Stmt.h:2981
void setLabel(LabelDecl *D)
Definition Stmt.h:2995
void setLabelLoc(SourceLocation L)
Definition Stmt.h:3000
void setGotoLoc(SourceLocation L)
Definition Stmt.h:2998
This class represents temporary values used to represent inout and out arguments in HLSL.
Definition Expr.h:7447
static HLSLOutArgExpr * CreateEmpty(const ASTContext &Ctx)
Definition Expr.cpp:5704
IfStmt - This represents an if/then/else.
Definition Stmt.h:2271
void setThen(Stmt *Then)
Definition Stmt.h:2365
void setConditionVariableDeclStmt(DeclStmt *CondVar)
Definition Stmt.h:2416
void setCond(Expr *Cond)
Definition Stmt.h:2356
void setLParenLoc(SourceLocation Loc)
Definition Stmt.h:2490
void setElse(Stmt *Else)
Definition Stmt.h:2379
void setElseLoc(SourceLocation ElseLoc)
Definition Stmt.h:2445
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:2468
void setRParenLoc(SourceLocation Loc)
Definition Stmt.h:2492
void setIfLoc(SourceLocation IfLoc)
Definition Stmt.h:2438
void setInit(Stmt *Init)
Definition Stmt.h:2431
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1....
Definition Expr.h:1751
void setSubExpr(Expr *E)
Definition Expr.h:1765
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition Expr.h:3897
static ImplicitCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize, bool HasFPFeatures)
Definition Expr.cpp:2126
void setIsPartOfExplicitCast(bool PartOfExplicitCast)
Definition Expr.h:3929
Represents an implicitly-generated value initialization of an object of a given type.
Definition Expr.h:6107
IndirectGotoStmt - This represents an indirect goto.
Definition Stmt.h:3020
void setTarget(Expr *E)
Definition Stmt.h:3044
void setGotoLoc(SourceLocation L)
Definition Stmt.h:3035
void setStarLoc(SourceLocation L)
Definition Stmt.h:3037
Describes an C or C++ initializer list.
Definition Expr.h:5352
void setSyntacticForm(InitListExpr *Init)
Definition Expr.h:5526
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:2459
void setLBraceLoc(SourceLocation Loc)
Definition Expr.h:5511
void setRBraceLoc(SourceLocation Loc)
Definition Expr.h:5513
void sawArrayRangeDesignator(bool ARD=true)
Definition Expr.h:5536
void reserveInits(const ASTContext &C, unsigned NumInits)
Reserve space for some number of initializers.
Definition Expr.cpp:2450
void setLocation(SourceLocation Location)
Definition Expr.h:1558
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:981
LabelStmt - Represents a label, which has a substatement.
Definition Stmt.h:2158
void setSubStmt(Stmt *SS)
Definition Stmt.h:2183
void setDecl(LabelDecl *D)
Definition Stmt.h:2177
void setIdentLoc(SourceLocation L)
Definition Stmt.h:2174
void setSideEntry(bool SE)
Definition Stmt.h:2206
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:1365
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:3069
void setLabelDecl(LabelDecl *S)
Definition Stmt.h:3109
void setLabelLoc(SourceLocation L)
Definition Stmt.h:3105
void setKwLoc(SourceLocation L)
Definition Stmt.h:3095
This represents a Microsoft inline-assembly statement extension.
Definition Stmt.h:3677
Representation of a Microsoft __if_exists or __if_not_exists statement with a dependent name.
Definition StmtCXX.h:254
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:4973
MatrixSingleSubscriptExpr - Matrix single subscript expression for the MatrixType extension when you ...
Definition Expr.h:2839
void setRBracketLoc(SourceLocation L)
Definition Expr.h:2886
MatrixSubscriptExpr - Matrix subscript expression for the MatrixType extension.
Definition Expr.h:2909
void setColumnIdx(Expr *E)
Definition Expr.h:2949
void setBase(Expr *E)
Definition Expr.h:2937
void setRowIdx(Expr *E)
Definition Expr.h:2941
void setRBracketLoc(SourceLocation L)
Definition Expr.h:2964
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition Expr.h:3408
static MemberExpr * CreateEmpty(const ASTContext &Context, bool HasQualifier, bool HasFoundDecl, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition Expr.cpp:1802
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition Decl.h:341
Represents a place-holder for an object not to be initialized by anything.
Definition Expr.h:5927
NullStmt - This is the null statement ";": C99 6.8.3p3.
Definition Stmt.h:1715
void setSemiLoc(SourceLocation L)
Definition Stmt.h:1727
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:5558
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:5687
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:219
static ObjCArrayLiteral * CreateEmpty(const ASTContext &C, unsigned NumElements)
Definition ExprObjC.cpp:51
Expr ** getElements()
Retrieve elements of array of literals.
Definition ExprObjC.h:250
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c array literal.
Definition ExprObjC.h:256
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:1735
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition ExprObjC.h:118
void setLocation(SourceLocation L)
Definition ExprObjC.h:138
ObjCBoxedExpr - used for generalized expression boxing.
Definition ExprObjC.h:158
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers,...
Definition ExprObjC.h:1675
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
Definition ExprObjC.h:341
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:391
ObjCEncodeExpr, used for @encode in Objective-C.
Definition ExprObjC.h:440
void setEncodedTypeSourceInfo(TypeSourceInfo *EncType)
Definition ExprObjC.h:463
void setRParenLoc(SourceLocation L)
Definition ExprObjC.h:457
void setAtLoc(SourceLocation L)
Definition ExprObjC.h:455
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:1614
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC 'id' type.
Definition ExprObjC.h:1530
void setIsaMemberLoc(SourceLocation L)
Definition ExprObjC.h:1563
void setBase(Expr *E)
Definition ExprObjC.h:1554
void setArrow(bool A)
Definition ExprObjC.h:1558
void setOpLoc(SourceLocation L)
Definition ExprObjC.h:1566
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition ExprObjC.h:581
void setIsArrow(bool A)
Definition ExprObjC.h:621
void setBase(Expr *base)
Definition ExprObjC.h:617
void setDecl(ObjCIvarDecl *d)
Definition ExprObjC.h:613
void setIsFreeIvar(bool A)
Definition ExprObjC.h:622
void setOpLoc(SourceLocation L)
Definition ExprObjC.h:633
void setLocation(SourceLocation L)
Definition ExprObjC.h:625
An expression that sends a message to the given Objective-C object or class.
Definition ExprObjC.h:972
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:1410
void setClassReceiver(TypeSourceInfo *TSInfo)
Definition ExprObjC.h:1334
void setInstanceReceiver(Expr *rec)
Turn this message send into an instance message that computes the receiver object with the given expr...
Definition ExprObjC.h:1312
void setSuper(SourceLocation Loc, QualType T, bool IsInstanceSuper)
Definition ExprObjC.h:1383
ReceiverKind
The kind of receiver this message is sending to.
Definition ExprObjC.h:975
@ SuperInstance
The receiver is the instance of the superclass object.
Definition ExprObjC.h:986
@ Instance
The receiver is an object instance.
Definition ExprObjC.h:980
@ SuperClass
The receiver is a superclass.
Definition ExprObjC.h:983
@ Class
The receiver is a class.
Definition ExprObjC.h:977
void setDelegateInitCall(bool isDelegate)
Definition ExprObjC.h:1454
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
Definition ExprObjC.h:1261
unsigned getNumArgs() const
Return the number of actual arguments in this message, not counting the receiver.
Definition ExprObjC.h:1422
void setSelector(Selector S)
Definition ExprObjC.h:1391
void setArg(unsigned Arg, Expr *ArgExpr)
setArg - Set the specified argument.
Definition ExprObjC.h:1445
Base class for Objective-C object literals ("...", @42, @[],}).
Definition ExprObjC.h:50
void setExpressibleAsConstantInitializer(bool ExpressibleAsConstantInitializer)
Definition ExprObjC.h:71
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition ExprObjC.h:649
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition ExprObjC.h:537
void setProtocol(ObjCProtocolDecl *P)
Definition ExprObjC.h:555
void setRParenLoc(SourceLocation L)
Definition ExprObjC.h:561
void setAtLoc(SourceLocation L)
Definition ExprObjC.h:560
ObjCSelectorExpr used for @selector in Objective-C.
Definition ExprObjC.h:485
void setSelector(Selector S)
Definition ExprObjC.h:500
void setAtLoc(SourceLocation L)
Definition ExprObjC.h:505
void setSelectorNameLoc(SourceLocation L)
Definition ExprObjC.h:506
void setRParenLoc(SourceLocation L)
Definition ExprObjC.h:507
ObjCStringLiteral, used for Objective-C string literals i.e.
Definition ExprObjC.h:83
void setAtLoc(SourceLocation L)
Definition ExprObjC.h:100
void setString(StringLiteral *S)
Definition ExprObjC.h:97
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition ExprObjC.h:871
void setRBracket(SourceLocation RB)
Definition ExprObjC.h:902
void setBaseExpr(Stmt *S)
Definition ExprObjC.h:911
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type,...
Definition Expr.h:2571
void setOperatorLoc(SourceLocation L)
Definition Expr.h:2605
static OffsetOfExpr * CreateEmpty(const ASTContext &C, unsigned NumComps, unsigned NumExprs)
Definition Expr.cpp:1696
void setIndexExpr(unsigned Idx, Expr *E)
Definition Expr.h:2638
void setTypeSourceInfo(TypeSourceInfo *tsi)
Definition Expr.h:2614
void setComponent(unsigned Idx, OffsetOfNode ON)
Definition Expr.h:2622
unsigned getNumExpressions() const
Definition Expr.h:2642
void setRParenLoc(SourceLocation R)
Definition Expr.h:2609
unsigned getNumComponents() const
Definition Expr.h:2626
Kind
The kind of offsetof node we have.
Definition Expr.h:2468
@ Array
An index into an array.
Definition Expr.h:2470
@ Identifier
A field in a dependent type, known only by its name.
Definition Expr.h:2474
@ Field
A field.
Definition Expr.h:2472
@ Base
An implicit indirection through a C++ base class, when the field found is in a base class.
Definition Expr.h:2477
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
Definition Expr.h:1198
void setIsUnique(bool V)
Definition Expr.h:1250
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:2134
static OpenACCAsteriskSizeExpr * CreateEmpty(const ASTContext &C)
Definition Expr.cpp:5714
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:3142
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
Definition ExprCXX.h:4335
unsigned getNumDecls() const
Gets the number of declarations in the unresolved set.
Definition ExprCXX.h:3246
TemplateArgumentLoc * getTrailingTemplateArgumentLoc()
Return the optional template arguments.
Definition ExprCXX.h:4345
DeclAccessPair * getTrailingResults()
Return the results. Defined after UnresolvedMemberExpr.
Definition ExprCXX.h:4329
bool hasTemplateKWAndArgsInfo() const
Definition ExprCXX.h:3186
unsigned getNumTemplateArgs() const
Definition ExprCXX.h:3312
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition ExprCXX.h:4416
static PackIndexingExpr * CreateDeserialized(ASTContext &Context, unsigned NumTransformedExprs)
Definition ExprCXX.cpp:1791
ParenExpr - This represents a parenthesized expression, e.g.
Definition Expr.h:2226
void setLParen(SourceLocation Loc)
Definition Expr.h:2252
void setIsProducedByFoldExpansion(bool ProducedByFoldExpansion=true)
Definition Expr.h:2271
void setRParen(SourceLocation Loc)
Definition Expr.h:2256
void setSubExpr(Expr *E)
Definition Expr.h:2245
static ParenListExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumExprs)
Create an empty paren list.
Definition Expr.cpp:5019
unsigned getNumExprs() const
Return the number of expressions in this paren list.
Definition Expr.h:6160
[C99 6.4.2.2] - A predefined identifier such as func.
Definition Expr.h:2049
void setLocation(SourceLocation L)
Definition Expr.h:2091
static PredefinedExpr * CreateEmpty(const ASTContext &Ctx, bool HasFunctionName)
Create an empty PredefinedExpr.
Definition Expr.cpp:648
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition Expr.h:6854
static PseudoObjectExpr * Create(const ASTContext &Context, Expr *syntactic, ArrayRef< Expr * > semantic, unsigned resultIndex)
Definition Expr.cpp:5232
Frontend produces RecoveryExprs on semantic errors that prevent creating other well-formed expression...
Definition Expr.h:7553
child_range children()
Definition Expr.h:7566
static RecoveryExpr * CreateEmpty(ASTContext &Ctx, unsigned NumSubExprs)
Definition Expr.cpp:5513
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:3172
void setRetValue(Expr *E)
Definition Stmt.h:3201
void setReturnLoc(SourceLocation L)
Definition Stmt.h:3222
void setNRVOCandidate(const VarDecl *Var)
Set the variable that might be used for the named return value optimization.
Definition Stmt.h:3215
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:3910
void setLeaveLoc(SourceLocation L)
Definition Stmt.h:3921
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:588
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition Expr.h:4687
void setExprs(const ASTContext &C, ArrayRef< Expr * > Exprs)
Definition Expr.cpp:4647
void setRParenLoc(SourceLocation L)
Definition Expr.h:4708
void setBuiltinLoc(SourceLocation L)
Definition Expr.h:4705
Represents an expression that computes the length of a parameter pack.
Definition ExprCXX.h:4494
static SizeOfPackExpr * CreateDeserialized(ASTContext &Context, unsigned NumPartialArgs)
Definition ExprCXX.cpp:1753
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof... expression, such as is produced f...
Definition ExprCXX.h:4579
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(),...
Definition Expr.h:5070
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:4639
void setRParenLoc(SourceLocation L)
Definition Expr.h:4666
void setLParenLoc(SourceLocation L)
Definition Expr.h:4664
void setSubStmt(CompoundStmt *S)
Definition Expr.h:4658
StmtVisitor - This class implements a simple visitor for Stmt subclasses.
Stmt - This represents one statement.
Definition Stmt.h:85
ExpressionTraitExprBitfields ExpressionTraitExprBits
Definition Stmt.h:1407
GenericSelectionExprBitfields GenericSelectionExprBits
Definition Stmt.h:1371
InitListExprBitfields InitListExprBits
Definition Stmt.h:1369
LambdaExprBitfields LambdaExprBits
Definition Stmt.h:1404
AttributedStmtBitfields AttributedStmtBits
Definition Stmt.h:1342
UnresolvedLookupExprBitfields UnresolvedLookupExprBits
Definition Stmt.h:1400
SubstNonTypeTemplateParmExprBitfields SubstNonTypeTemplateParmExprBits
Definition Stmt.h:1403
CXXNoexceptExprBitfields CXXNoexceptExprBits
Definition Stmt.h:1402
CXXRewrittenBinaryOperatorBitfields CXXRewrittenBinaryOperatorBits
Definition Stmt.h:1383
ExprWithCleanupsBitfields ExprWithCleanupsBits
Definition Stmt.h:1396
StmtClass getStmtClass() const
Definition Stmt.h:1505
CXXScalarValueInitExprBitfields CXXScalarValueInitExprBits
Definition Stmt.h:1390
CXXConstructExprBitfields CXXConstructExprBits
Definition Stmt.h:1395
CXXDependentScopeMemberExprBitfields CXXDependentScopeMemberExprBits
Definition Stmt.h:1398
TypeTraitExprBitfields TypeTraitExprBits
Definition Stmt.h:1393
CXXNewExprBitfields CXXNewExprBits
Definition Stmt.h:1391
SourceLocExprBitfields SourceLocExprBits
Definition Stmt.h:1373
ConstantExprBitfields ConstantExprBits
Definition Stmt.h:1356
RequiresExprBitfields RequiresExprBits
Definition Stmt.h:1405
CXXFoldExprBitfields CXXFoldExprBits
Definition Stmt.h:1408
StmtExprBitfields StmtExprBits
Definition Stmt.h:1378
StringLiteralBitfields StringLiteralBits
Definition Stmt.h:1360
OpaqueValueExprBitfields OpaqueValueExprBits
Definition Stmt.h:1419
CXXThrowExprBitfields CXXThrowExprBits
Definition Stmt.h:1387
MemberExprBitfields MemberExprBits
Definition Stmt.h:1366
PackIndexingExprBitfields PackIndexingExprBits
Definition Stmt.h:1409
DeclRefExprBitfields DeclRefExprBits
Definition Stmt.h:1358
CXXOperatorCallExprBitfields CXXOperatorCallExprBits
Definition Stmt.h:1382
CXXDefaultInitExprBitfields CXXDefaultInitExprBits
Definition Stmt.h:1389
NullStmtBitfields NullStmtBits
Definition Stmt.h:1339
ArrayTypeTraitExprBitfields ArrayTypeTraitExprBits
Definition Stmt.h:1406
PredefinedExprBitfields PredefinedExprBits
Definition Stmt.h:1357
UnresolvedMemberExprBitfields UnresolvedMemberExprBits
Definition Stmt.h:1401
PseudoObjectExprBitfields PseudoObjectExprBits
Definition Stmt.h:1372
CXXDeleteExprBitfields CXXDeleteExprBits
Definition Stmt.h:1392
CXXDefaultArgExprBitfields CXXDefaultArgExprBits
Definition Stmt.h:1388
StringLiteral - This represents a string literal expression, e.g.
Definition Expr.h:1819
unsigned getLength() const
Definition Expr.h:1944
StringLiteralKind getKind() const
Definition Expr.h:1948
static StringLiteral * CreateEmpty(const ASTContext &Ctx, unsigned NumConcatenated, unsigned Length, unsigned CharByteWidth)
Construct an empty string literal.
Definition Expr.cpp:1204
unsigned getNumConcatenated() const
Get the number of string literal tokens that were concatenated in translation phase #6 to form this s...
Definition Expr.h:1985
unsigned getCharByteWidth() const
Definition Expr.h:1946
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition ExprCXX.h:4717
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition ExprCXX.h:4807
void setColonLoc(SourceLocation L)
Definition Stmt.h:1912
void setKeywordLoc(SourceLocation L)
Definition Stmt.h:1910
void setNextSwitchCase(SwitchCase *SC)
Definition Stmt.h:1907
SwitchStmt - This represents a 'switch' stmt.
Definition Stmt.h:2521
void setCond(Expr *Cond)
Definition Stmt.h:2592
void setSwitchLoc(SourceLocation L)
Definition Stmt.h:2657
void setConditionVariableDeclStmt(DeclStmt *CondVar)
Definition Stmt.h:2647
void setBody(Stmt *Body)
Definition Stmt.h:2599
void setRParenLoc(SourceLocation Loc)
Definition Stmt.h:2661
void setInit(Stmt *Init)
Definition Stmt.h:2609
void setLParenLoc(SourceLocation Loc)
Definition Stmt.h:2659
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:2677
void setSwitchCaseList(SwitchCase *SC)
Definition Stmt.h:2654
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:8410
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:2972
static TypeTraitExpr * CreateDeserialized(const ASTContext &C, bool IsStoredAsBool, unsigned NumArgs)
Definition ExprCXX.cpp:1969
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition Expr.h:2669
void setKind(UnaryExprOrTypeTrait K)
Definition Expr.h:2704
void setOperatorLoc(SourceLocation L)
Definition Expr.h:2743
void setRParenLoc(SourceLocation L)
Definition Expr.h:2746
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition Expr.h:2288
void setSubExpr(Expr *E)
Definition Expr.h:2330
void setOperatorLoc(SourceLocation L)
Definition Expr.h:2334
void setCanOverflow(bool C)
Definition Expr.h:2343
bool hasStoredFPFeatures() const
Is FPFeatures in Trailing Storage?
Definition Expr.h:2425
void setOpcode(Opcode Opc)
Definition Expr.h:2327
void setStoredFPFeatures(FPOptionsOverride F)
Set FPFeatures in trailing storage, used by Serialization & ASTImporter.
Definition Expr.h:2439
UnaryOperatorKind Opcode
Definition Expr.h:2302
static UnaryOperator * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
Definition Expr.cpp:5174
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition ExprCXX.h:3372
static UnresolvedLookupExpr * CreateEmpty(const ASTContext &Context, unsigned NumResults, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition ExprCXX.cpp:498
Represents a C++ member access expression for which lookup produced a set of overloaded functions.
Definition ExprCXX.h:4179
static UnresolvedMemberExpr * CreateEmpty(const ASTContext &Context, unsigned NumResults, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition ExprCXX.cpp:1703
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:1017
Represents a call to the builtin function __builtin_va_arg.
Definition Expr.h:5001
void setVarargABI(VarArgKind Kind)
Definition Expr.h:5026
void setRParenLoc(SourceLocation L)
Definition Expr.h:5041
void setSubExpr(Expr *E)
Definition Expr.h:5023
void setBuiltinLoc(SourceLocation L)
Definition Expr.h:5038
void setWrittenTypeInfo(TypeSourceInfo *TI)
Definition Expr.h:5035
WhileStmt - This represents a 'while' stmt.
Definition Stmt.h:2709
void setCond(Expr *Cond)
Definition Stmt.h:2769
void setBody(Stmt *Body)
Definition Stmt.h:2776
void setLParenLoc(SourceLocation L)
Definition Stmt.h:2818
void setRParenLoc(SourceLocation L)
Definition Stmt.h:2820
void setWhileLoc(SourceLocation L)
Definition Stmt.h:2815
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:2809
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_CXX_EXPANSION_INSTANTIATION
A CXXExpansionInstantiationStmt.
@ 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_CXX_EXPANSION_PATTERN
A CXXExpansionPatternStmt.
@ 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.
Top level wrappers for InstallAPI frontend operations.
ConstantResultStorageKind
Describes the kind of result that can be tail-allocated.
Definition Expr.h:1096
OpenACCDirectiveKind
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)
const FunctionProtoType * T
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:434
CharacterLiteralKind
Definition Expr.h:1623
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:1445