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): add support for TemplateReference, NamespaceReference and
543 // DeclRefExpr
544 VisitExpr(E);
545 E->CaretCaretLoc = readSourceLocation();
546 E->Kind = static_cast<ReflectionKind>(Record.readInt());
547 switch (E->Kind) {
549 assert(false && "null reflection can't be constructed from parsing a "
550 "reflection operand");
551 E->Operand = nullptr;
552 break;
554 E->Operand = Record.readTypeSourceInfo();
555 break;
556 }
557}
558
559void ASTStmtReader::VisitSYCLKernelCallStmt(SYCLKernelCallStmt *S) {
560 VisitStmt(S);
561 S->setOriginalStmt(cast<CompoundStmt>(Record.readSubStmt()));
562 S->setKernelLaunchStmt(cast<Stmt>(Record.readSubStmt()));
563 S->setOutlinedFunctionDecl(readDeclAs<OutlinedFunctionDecl>());
564}
565
566void ASTStmtReader::VisitExpr(Expr *E) {
567 VisitStmt(E);
568 CurrentUnpackingBits.emplace(Record.readInt());
569 E->setDependence(static_cast<ExprDependence>(
570 CurrentUnpackingBits->getNextBits(/*Width=*/5)));
571 E->setValueKind(static_cast<ExprValueKind>(
572 CurrentUnpackingBits->getNextBits(/*Width=*/2)));
573 E->setObjectKind(static_cast<ExprObjectKind>(
574 CurrentUnpackingBits->getNextBits(/*Width=*/3)));
575
576 E->setType(Record.readType());
577 assert(Record.getIdx() == NumExprFields &&
578 "Incorrect expression field count");
579}
580
581void ASTStmtReader::VisitConstantExpr(ConstantExpr *E) {
582 VisitExpr(E);
583
584 auto StorageKind = static_cast<ConstantResultStorageKind>(Record.readInt());
585 assert(E->getResultStorageKind() == StorageKind && "Wrong ResultKind!");
586
587 E->ConstantExprBits.APValueKind = Record.readInt();
588 E->ConstantExprBits.IsUnsigned = Record.readInt();
589 E->ConstantExprBits.BitWidth = Record.readInt();
590 E->ConstantExprBits.HasCleanup = false; // Not serialized, see below.
591 E->ConstantExprBits.IsImmediateInvocation = Record.readInt();
592
593 switch (StorageKind) {
595 break;
596
598 E->Int64Result() = Record.readInt();
599 break;
600
602 E->APValueResult() = Record.readAPValue();
603 if (E->APValueResult().needsCleanup()) {
604 E->ConstantExprBits.HasCleanup = true;
605 Record.getContext().addDestruction(&E->APValueResult());
606 }
607 break;
608 }
609
610 E->setSubExpr(Record.readSubExpr());
611}
612
613void ASTStmtReader::VisitOpenACCAsteriskSizeExpr(OpenACCAsteriskSizeExpr *E) {
614 VisitExpr(E);
615 E->setAsteriskLocation(readSourceLocation());
616}
617
618void ASTStmtReader::VisitSYCLUniqueStableNameExpr(SYCLUniqueStableNameExpr *E) {
619 VisitExpr(E);
620
621 E->setLocation(readSourceLocation());
622 E->setLParenLocation(readSourceLocation());
623 E->setRParenLocation(readSourceLocation());
624
625 E->setTypeSourceInfo(Record.readTypeSourceInfo());
626}
627
628void ASTStmtReader::VisitUnresolvedSYCLKernelCallStmt(
630 VisitStmt(S);
631
632 S->setOriginalStmt(cast<CompoundStmt>(Record.readSubStmt()));
633 S->setKernelLaunchIdExpr(Record.readExpr());
634}
635
636void ASTStmtReader::VisitPredefinedExpr(PredefinedExpr *E) {
637 VisitExpr(E);
638 bool HasFunctionName = Record.readInt();
639 E->PredefinedExprBits.HasFunctionName = HasFunctionName;
640 E->PredefinedExprBits.Kind = Record.readInt();
641 E->PredefinedExprBits.IsTransparent = Record.readInt();
642 E->setLocation(readSourceLocation());
643 if (HasFunctionName)
644 E->setFunctionName(cast<StringLiteral>(Record.readSubExpr()));
645}
646
647void ASTStmtReader::VisitDeclRefExpr(DeclRefExpr *E) {
648 VisitExpr(E);
649
650 CurrentUnpackingBits.emplace(Record.readInt());
651 E->DeclRefExprBits.HadMultipleCandidates = CurrentUnpackingBits->getNextBit();
652 E->DeclRefExprBits.RefersToEnclosingVariableOrCapture =
653 CurrentUnpackingBits->getNextBit();
654 E->DeclRefExprBits.NonOdrUseReason =
655 CurrentUnpackingBits->getNextBits(/*Width=*/2);
656 E->DeclRefExprBits.IsImmediateEscalating = CurrentUnpackingBits->getNextBit();
657 E->DeclRefExprBits.HasFoundDecl = CurrentUnpackingBits->getNextBit();
658 E->DeclRefExprBits.HasQualifier = CurrentUnpackingBits->getNextBit();
659 E->DeclRefExprBits.HasTemplateKWAndArgsInfo =
660 CurrentUnpackingBits->getNextBit();
661 E->DeclRefExprBits.CapturedByCopyInLambdaWithExplicitObjectParameter = false;
662 unsigned NumTemplateArgs = 0;
664 NumTemplateArgs = Record.readInt();
665
666 if (E->hasQualifier())
667 new (E->getTrailingObjects<NestedNameSpecifierLoc>())
668 NestedNameSpecifierLoc(Record.readNestedNameSpecifierLoc());
669
670 if (E->hasFoundDecl())
671 *E->getTrailingObjects<NamedDecl *>() = readDeclAs<NamedDecl>();
672
675 *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
676 E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs);
677
678 E->D = readDeclAs<ValueDecl>();
679 E->setLocation(readSourceLocation());
680 E->DNLoc = Record.readDeclarationNameLoc(E->getDecl()->getDeclName());
681}
682
683void ASTStmtReader::VisitIntegerLiteral(IntegerLiteral *E) {
684 VisitExpr(E);
685 E->setLocation(readSourceLocation());
686 E->setValue(Record.getContext(), Record.readAPInt());
687}
688
689void ASTStmtReader::VisitFixedPointLiteral(FixedPointLiteral *E) {
690 VisitExpr(E);
691 E->setLocation(readSourceLocation());
692 E->setScale(Record.readInt());
693 E->setValue(Record.getContext(), Record.readAPInt());
694}
695
696void ASTStmtReader::VisitFloatingLiteral(FloatingLiteral *E) {
697 VisitExpr(E);
699 static_cast<llvm::APFloatBase::Semantics>(Record.readInt()));
700 E->setExact(Record.readInt());
701 E->setValue(Record.getContext(), Record.readAPFloat(E->getSemantics()));
702 E->setLocation(readSourceLocation());
703}
704
705void ASTStmtReader::VisitImaginaryLiteral(ImaginaryLiteral *E) {
706 VisitExpr(E);
707 E->setSubExpr(Record.readSubExpr());
708}
709
710void ASTStmtReader::VisitStringLiteral(StringLiteral *E) {
711 VisitExpr(E);
712
713 // NumConcatenated, Length and CharByteWidth are set by the empty
714 // ctor since they are needed to allocate storage for the trailing objects.
715 unsigned NumConcatenated = Record.readInt();
716 unsigned Length = Record.readInt();
717 unsigned CharByteWidth = Record.readInt();
718 assert((NumConcatenated == E->getNumConcatenated()) &&
719 "Wrong number of concatenated tokens!");
720 assert((Length == E->getLength()) && "Wrong Length!");
721 assert((CharByteWidth == E->getCharByteWidth()) && "Wrong character width!");
722 E->StringLiteralBits.Kind = Record.readInt();
723 E->StringLiteralBits.IsPascal = Record.readInt();
724
725 // The character width is originally computed via mapCharByteWidth.
726 // Check that the deserialized character width is consistant with the result
727 // of calling mapCharByteWidth.
728 assert((CharByteWidth ==
729 StringLiteral::mapCharByteWidth(Record.getContext().getTargetInfo(),
730 E->getKind())) &&
731 "Wrong character width!");
732
733 // Deserialize the trailing array of SourceLocation.
734 for (unsigned I = 0; I < NumConcatenated; ++I)
735 E->setStrTokenLoc(I, readSourceLocation());
736
737 // Deserialize the trailing array of char holding the string data.
738 char *StrData = E->getStrDataAsChar();
739 for (unsigned I = 0; I < Length * CharByteWidth; ++I)
740 StrData[I] = Record.readInt();
741}
742
743void ASTStmtReader::VisitCharacterLiteral(CharacterLiteral *E) {
744 VisitExpr(E);
745 E->setValue(Record.readInt());
746 E->setLocation(readSourceLocation());
747 E->setKind(static_cast<CharacterLiteralKind>(Record.readInt()));
748}
749
750void ASTStmtReader::VisitParenExpr(ParenExpr *E) {
751 VisitExpr(E);
752 E->setIsProducedByFoldExpansion(Record.readInt());
753 E->setLParen(readSourceLocation());
754 E->setRParen(readSourceLocation());
755 E->setSubExpr(Record.readSubExpr());
756}
757
758void ASTStmtReader::VisitParenListExpr(ParenListExpr *E) {
759 VisitExpr(E);
760 unsigned NumExprs = Record.readInt();
761 assert((NumExprs == E->getNumExprs()) && "Wrong NumExprs!");
762 for (unsigned I = 0; I != NumExprs; ++I)
763 E->getTrailingObjects()[I] = Record.readSubStmt();
764 E->LParenLoc = readSourceLocation();
765 E->RParenLoc = readSourceLocation();
766}
767
768void ASTStmtReader::VisitUnaryOperator(UnaryOperator *E) {
769 VisitExpr(E);
770 bool hasFP_Features = CurrentUnpackingBits->getNextBit();
771 assert(hasFP_Features == E->hasStoredFPFeatures());
772 E->setSubExpr(Record.readSubExpr());
773 E->setOpcode(
774 (UnaryOperator::Opcode)CurrentUnpackingBits->getNextBits(/*Width=*/5));
775 E->setOperatorLoc(readSourceLocation());
776 E->setCanOverflow(CurrentUnpackingBits->getNextBit());
777 if (hasFP_Features)
779 FPOptionsOverride::getFromOpaqueInt(Record.readInt()));
780}
781
782void ASTStmtReader::VisitOffsetOfExpr(OffsetOfExpr *E) {
783 VisitExpr(E);
784 assert(E->getNumComponents() == Record.peekInt());
785 Record.skipInts(1);
786 assert(E->getNumExpressions() == Record.peekInt());
787 Record.skipInts(1);
788 E->setOperatorLoc(readSourceLocation());
789 E->setRParenLoc(readSourceLocation());
790 E->setTypeSourceInfo(readTypeSourceInfo());
791 for (unsigned I = 0, N = E->getNumComponents(); I != N; ++I) {
792 auto Kind = static_cast<OffsetOfNode::Kind>(Record.readInt());
793 SourceLocation Start = readSourceLocation();
794 SourceLocation End = readSourceLocation();
795 switch (Kind) {
797 E->setComponent(I, OffsetOfNode(Start, Record.readInt(), End));
798 break;
799
801 E->setComponent(
802 I, OffsetOfNode(Start, readDeclAs<FieldDecl>(), End));
803 break;
804
806 E->setComponent(
807 I,
808 OffsetOfNode(Start, Record.readIdentifier(), End));
809 break;
810
811 case OffsetOfNode::Base: {
812 auto *Base = new (Record.getContext()) CXXBaseSpecifier();
813 *Base = Record.readCXXBaseSpecifier();
814 E->setComponent(I, OffsetOfNode(Base));
815 break;
816 }
817 }
818 }
819
820 for (unsigned I = 0, N = E->getNumExpressions(); I != N; ++I)
821 E->setIndexExpr(I, Record.readSubExpr());
822}
823
824void ASTStmtReader::VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *E) {
825 VisitExpr(E);
826 E->setKind(static_cast<UnaryExprOrTypeTrait>(Record.readInt()));
827 if (Record.peekInt() == 0) {
828 E->setArgument(Record.readSubExpr());
829 Record.skipInts(1);
830 } else {
831 E->setArgument(readTypeSourceInfo());
832 }
833 E->setOperatorLoc(readSourceLocation());
834 E->setRParenLoc(readSourceLocation());
835}
836
839 ConstraintSatisfaction Satisfaction;
840 Satisfaction.IsSatisfied = Record.readInt();
841 Satisfaction.ContainsErrors = Record.readInt();
842 const ASTContext &C = Record.getContext();
843 if (!Satisfaction.IsSatisfied) {
844 unsigned NumDetailRecords = Record.readInt();
845 for (unsigned i = 0; i != NumDetailRecords; ++i) {
846 auto Kind = Record.readInt();
847 if (Kind == 0) {
848 SourceLocation DiagLocation = Record.readSourceLocation();
849 StringRef DiagMessage = C.backupStr(Record.readString());
850
851 Satisfaction.Details.emplace_back(new (
852 C) ConstraintSubstitutionDiagnostic(DiagLocation, DiagMessage));
853 } else if (Kind == 1) {
854 Satisfaction.Details.emplace_back(Record.readExpr());
855 } else {
856 assert(Kind == 2);
857 Satisfaction.Details.emplace_back(Record.readConceptReference());
858 }
859 }
860 }
861 return Satisfaction;
862}
863
864void ASTStmtReader::VisitConceptSpecializationExpr(
866 VisitExpr(E);
867 E->SpecDecl = Record.readDeclAs<ImplicitConceptSpecializationDecl>();
868 if (Record.readBool())
869 E->ConceptRef = Record.readConceptReference();
870 E->Satisfaction = E->isValueDependent() ? nullptr :
871 ASTConstraintSatisfaction::Create(Record.getContext(),
873}
874
877 const ASTContext &C = Record.getContext();
878 StringRef SubstitutedEntity = C.backupStr(Record.readString());
879 SourceLocation DiagLoc = Record.readSourceLocation();
880 StringRef DiagMessage = C.backupStr(Record.readString());
881
882 return new (Record.getContext())
883 concepts::Requirement::SubstitutionDiagnostic{SubstitutedEntity, DiagLoc,
884 DiagMessage};
885}
886
887void ASTStmtReader::VisitRequiresExpr(RequiresExpr *E) {
888 VisitExpr(E);
889 unsigned NumLocalParameters = Record.readInt();
890 unsigned NumRequirements = Record.readInt();
891 E->RequiresExprBits.RequiresKWLoc = Record.readSourceLocation();
892 E->RequiresExprBits.IsSatisfied = Record.readInt();
893 E->Body = Record.readDeclAs<RequiresExprBodyDecl>();
894 llvm::SmallVector<ParmVarDecl *, 4> LocalParameters;
895 for (unsigned i = 0; i < NumLocalParameters; ++i)
896 LocalParameters.push_back(cast<ParmVarDecl>(Record.readDecl()));
897 std::copy(LocalParameters.begin(), LocalParameters.end(),
898 E->getTrailingObjects<ParmVarDecl *>());
899 llvm::SmallVector<concepts::Requirement *, 4> Requirements;
900 for (unsigned i = 0; i < NumRequirements; ++i) {
901 auto RK =
902 static_cast<concepts::Requirement::RequirementKind>(Record.readInt());
903 concepts::Requirement *R = nullptr;
904 switch (RK) {
906 auto Status =
908 Record.readInt());
910 R = new (Record.getContext())
911 concepts::TypeRequirement(readSubstitutionDiagnostic(Record));
912 else
913 R = new (Record.getContext())
914 concepts::TypeRequirement(Record.readTypeSourceInfo());
915 } break;
918 auto Status =
920 Record.readInt());
921 llvm::PointerUnion<concepts::Requirement::SubstitutionDiagnostic *,
922 Expr *> E;
924 E = readSubstitutionDiagnostic(Record);
925 } else
926 E = Record.readExpr();
927
928 std::optional<concepts::ExprRequirement::ReturnTypeRequirement> Req;
929 ConceptSpecializationExpr *SubstitutedConstraintExpr = nullptr;
930 SourceLocation NoexceptLoc;
932 Req.emplace();
933 } else {
934 NoexceptLoc = Record.readSourceLocation();
935 switch (/* returnTypeRequirementKind */Record.readInt()) {
936 case 0:
937 // No return type requirement.
938 Req.emplace();
939 break;
940 case 1: {
941 // type-constraint
942 TemplateParameterList *TPL = Record.readTemplateParameterList();
943 if (Status >=
945 SubstitutedConstraintExpr =
946 cast<ConceptSpecializationExpr>(Record.readExpr());
947 Req.emplace(TPL);
948 } break;
949 case 2:
950 // Substitution failure
951 Req.emplace(readSubstitutionDiagnostic(Record));
952 break;
953 }
954 }
955 if (Expr *Ex = dyn_cast<Expr *>(E))
956 R = new (Record.getContext()) concepts::ExprRequirement(
957 Ex, RK == concepts::Requirement::RK_Simple, NoexceptLoc,
958 std::move(*Req), Status, SubstitutedConstraintExpr);
959 else
960 R = new (Record.getContext()) concepts::ExprRequirement(
962 RK == concepts::Requirement::RK_Simple, NoexceptLoc,
963 std::move(*Req));
964 } break;
966 ASTContext &C = Record.getContext();
967 bool HasInvalidConstraint = Record.readInt();
968 if (HasInvalidConstraint) {
969 StringRef InvalidConstraint = C.backupStr(Record.readString());
970 R = new (C) concepts::NestedRequirement(
971 Record.getContext(), InvalidConstraint,
973 break;
974 }
975 Expr *E = Record.readExpr();
977 R = new (C) concepts::NestedRequirement(E);
978 else
979 R = new (C) concepts::NestedRequirement(
980 C, E, readConstraintSatisfaction(Record));
981 } break;
982 }
983 if (!R)
984 continue;
985 Requirements.push_back(R);
986 }
987 std::copy(Requirements.begin(), Requirements.end(),
988 E->getTrailingObjects<concepts::Requirement *>());
989 E->LParenLoc = Record.readSourceLocation();
990 E->RParenLoc = Record.readSourceLocation();
991 E->RBraceLoc = Record.readSourceLocation();
992}
993
994void ASTStmtReader::VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
995 VisitExpr(E);
996 E->setLHS(Record.readSubExpr());
997 E->setRHS(Record.readSubExpr());
998 E->setRBracketLoc(readSourceLocation());
999}
1000
1001void ASTStmtReader::VisitMatrixSingleSubscriptExpr(
1003 VisitExpr(E);
1004 E->setBase(Record.readSubExpr());
1005 E->setRowIdx(Record.readSubExpr());
1006 E->setRBracketLoc(readSourceLocation());
1007}
1008
1009void ASTStmtReader::VisitMatrixSubscriptExpr(MatrixSubscriptExpr *E) {
1010 VisitExpr(E);
1011 E->setBase(Record.readSubExpr());
1012 E->setRowIdx(Record.readSubExpr());
1013 E->setColumnIdx(Record.readSubExpr());
1014 E->setRBracketLoc(readSourceLocation());
1015}
1016
1017void ASTStmtReader::VisitArraySectionExpr(ArraySectionExpr *E) {
1018 VisitExpr(E);
1019 E->ASType = Record.readEnum<ArraySectionExpr::ArraySectionType>();
1020
1021 E->setBase(Record.readSubExpr());
1022 E->setLowerBound(Record.readSubExpr());
1023 E->setLength(Record.readSubExpr());
1024
1025 if (E->isOMPArraySection())
1026 E->setStride(Record.readSubExpr());
1027
1028 E->setColonLocFirst(readSourceLocation());
1029
1030 if (E->isOMPArraySection())
1031 E->setColonLocSecond(readSourceLocation());
1032
1033 E->setRBracketLoc(readSourceLocation());
1034}
1035
1036void ASTStmtReader::VisitOMPArrayShapingExpr(OMPArrayShapingExpr *E) {
1037 VisitExpr(E);
1038 unsigned NumDims = Record.readInt();
1039 E->setBase(Record.readSubExpr());
1040 SmallVector<Expr *, 4> Dims(NumDims);
1041 for (unsigned I = 0; I < NumDims; ++I)
1042 Dims[I] = Record.readSubExpr();
1043 E->setDimensions(Dims);
1044 SmallVector<SourceRange, 4> SRs(NumDims);
1045 for (unsigned I = 0; I < NumDims; ++I)
1046 SRs[I] = readSourceRange();
1047 E->setBracketsRanges(SRs);
1048 E->setLParenLoc(readSourceLocation());
1049 E->setRParenLoc(readSourceLocation());
1050}
1051
1052void ASTStmtReader::VisitOMPIteratorExpr(OMPIteratorExpr *E) {
1053 VisitExpr(E);
1054 unsigned NumIters = Record.readInt();
1055 E->setIteratorKwLoc(readSourceLocation());
1056 E->setLParenLoc(readSourceLocation());
1057 E->setRParenLoc(readSourceLocation());
1058 for (unsigned I = 0; I < NumIters; ++I) {
1059 E->setIteratorDeclaration(I, Record.readDeclRef());
1060 E->setAssignmentLoc(I, readSourceLocation());
1061 Expr *Begin = Record.readSubExpr();
1062 Expr *End = Record.readSubExpr();
1063 Expr *Step = Record.readSubExpr();
1064 SourceLocation ColonLoc = readSourceLocation();
1065 SourceLocation SecColonLoc;
1066 if (Step)
1067 SecColonLoc = readSourceLocation();
1068 E->setIteratorRange(I, Begin, ColonLoc, End, SecColonLoc, Step);
1069 // Deserialize helpers
1070 OMPIteratorHelperData HD;
1071 HD.CounterVD = cast_or_null<VarDecl>(Record.readDeclRef());
1072 HD.Upper = Record.readSubExpr();
1073 HD.Update = Record.readSubExpr();
1074 HD.CounterUpdate = Record.readSubExpr();
1075 E->setHelper(I, HD);
1076 }
1077}
1078
1079void ASTStmtReader::VisitCallExpr(CallExpr *E) {
1080 VisitExpr(E);
1081
1082 unsigned NumArgs = Record.readInt();
1083 CurrentUnpackingBits.emplace(Record.readInt());
1084 E->setADLCallKind(
1085 static_cast<CallExpr::ADLCallKind>(CurrentUnpackingBits->getNextBit()));
1086 bool HasFPFeatures = CurrentUnpackingBits->getNextBit();
1087 E->setCoroElideSafe(CurrentUnpackingBits->getNextBit());
1088 E->setUsesMemberSyntax(CurrentUnpackingBits->getNextBit());
1089 assert((NumArgs == E->getNumArgs()) && "Wrong NumArgs!");
1090 E->setRParenLoc(readSourceLocation());
1091 E->setCallee(Record.readSubExpr());
1092 for (unsigned I = 0; I != NumArgs; ++I)
1093 E->setArg(I, Record.readSubExpr());
1094
1095 if (HasFPFeatures)
1097 FPOptionsOverride::getFromOpaqueInt(Record.readInt()));
1098
1099 if (E->getStmtClass() == Stmt::CallExprClass)
1100 E->updateTrailingSourceLoc();
1101}
1102
1103void ASTStmtReader::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) {
1104 VisitCallExpr(E);
1105}
1106
1107void ASTStmtReader::VisitMemberExpr(MemberExpr *E) {
1108 VisitExpr(E);
1109
1110 CurrentUnpackingBits.emplace(Record.readInt());
1111 bool HasQualifier = CurrentUnpackingBits->getNextBit();
1112 bool HasFoundDecl = CurrentUnpackingBits->getNextBit();
1113 bool HasTemplateInfo = CurrentUnpackingBits->getNextBit();
1114 unsigned NumTemplateArgs = Record.readInt();
1115
1116 E->Base = Record.readSubExpr();
1117 E->MemberDecl = Record.readDeclAs<ValueDecl>();
1118 E->MemberDNLoc = Record.readDeclarationNameLoc(E->MemberDecl->getDeclName());
1119 E->MemberLoc = Record.readSourceLocation();
1120 E->MemberExprBits.IsArrow = CurrentUnpackingBits->getNextBit();
1121 E->MemberExprBits.HasQualifier = HasQualifier;
1122 E->MemberExprBits.HasFoundDecl = HasFoundDecl;
1123 E->MemberExprBits.HasTemplateKWAndArgsInfo = HasTemplateInfo;
1124 E->MemberExprBits.HadMultipleCandidates = CurrentUnpackingBits->getNextBit();
1125 E->MemberExprBits.NonOdrUseReason =
1126 CurrentUnpackingBits->getNextBits(/*Width=*/2);
1127 E->MemberExprBits.OperatorLoc = Record.readSourceLocation();
1128
1129 if (HasQualifier)
1130 new (E->getTrailingObjects<NestedNameSpecifierLoc>())
1131 NestedNameSpecifierLoc(Record.readNestedNameSpecifierLoc());
1132
1133 if (HasFoundDecl) {
1134 auto *FoundD = Record.readDeclAs<NamedDecl>();
1135 auto AS = (AccessSpecifier)CurrentUnpackingBits->getNextBits(/*Width=*/2);
1136 *E->getTrailingObjects<DeclAccessPair>() = DeclAccessPair::make(FoundD, AS);
1137 }
1138
1139 if (HasTemplateInfo)
1141 *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
1142 E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs);
1143}
1144
1145void ASTStmtReader::VisitObjCIsaExpr(ObjCIsaExpr *E) {
1146 VisitExpr(E);
1147 E->setBase(Record.readSubExpr());
1148 E->setIsaMemberLoc(readSourceLocation());
1149 E->setOpLoc(readSourceLocation());
1150 E->setArrow(Record.readInt());
1151}
1152
1153void ASTStmtReader::
1154VisitObjCIndirectCopyRestoreExpr(ObjCIndirectCopyRestoreExpr *E) {
1155 VisitExpr(E);
1156 E->Operand = Record.readSubExpr();
1157 E->setShouldCopy(Record.readInt());
1158}
1159
1160void ASTStmtReader::VisitObjCBridgedCastExpr(ObjCBridgedCastExpr *E) {
1161 VisitExplicitCastExpr(E);
1162 E->LParenLoc = readSourceLocation();
1163 E->BridgeKeywordLoc = readSourceLocation();
1164 E->Kind = Record.readInt();
1165}
1166
1167void ASTStmtReader::VisitCastExpr(CastExpr *E) {
1168 VisitExpr(E);
1169 unsigned NumBaseSpecs = Record.readInt();
1170 assert(NumBaseSpecs == E->path_size());
1171
1172 CurrentUnpackingBits.emplace(Record.readInt());
1173 E->setCastKind((CastKind)CurrentUnpackingBits->getNextBits(/*Width=*/7));
1174 unsigned HasFPFeatures = CurrentUnpackingBits->getNextBit();
1175 assert(E->hasStoredFPFeatures() == HasFPFeatures);
1176
1177 E->setSubExpr(Record.readSubExpr());
1178
1180 while (NumBaseSpecs--) {
1181 auto *BaseSpec = new (Record.getContext()) CXXBaseSpecifier;
1182 *BaseSpec = Record.readCXXBaseSpecifier();
1183 *BaseI++ = BaseSpec;
1184 }
1185 if (HasFPFeatures)
1186 *E->getTrailingFPFeatures() =
1187 FPOptionsOverride::getFromOpaqueInt(Record.readInt());
1188}
1189
1190void ASTStmtReader::VisitBinaryOperator(BinaryOperator *E) {
1191 VisitExpr(E);
1192 CurrentUnpackingBits.emplace(Record.readInt());
1193 E->setOpcode(
1194 (BinaryOperator::Opcode)CurrentUnpackingBits->getNextBits(/*Width=*/6));
1195 bool hasFP_Features = CurrentUnpackingBits->getNextBit();
1196 E->setHasStoredFPFeatures(hasFP_Features);
1197 E->setExcludedOverflowPattern(CurrentUnpackingBits->getNextBit());
1198 E->setLHS(Record.readSubExpr());
1199 E->setRHS(Record.readSubExpr());
1200 E->setOperatorLoc(readSourceLocation());
1201 if (hasFP_Features)
1203 FPOptionsOverride::getFromOpaqueInt(Record.readInt()));
1204}
1205
1206void ASTStmtReader::VisitCompoundAssignOperator(CompoundAssignOperator *E) {
1207 VisitBinaryOperator(E);
1208 E->setComputationLHSType(Record.readType());
1209 E->setComputationResultType(Record.readType());
1210}
1211
1212void ASTStmtReader::VisitConditionalOperator(ConditionalOperator *E) {
1213 VisitExpr(E);
1214 E->SubExprs[ConditionalOperator::COND] = Record.readSubExpr();
1215 E->SubExprs[ConditionalOperator::LHS] = Record.readSubExpr();
1216 E->SubExprs[ConditionalOperator::RHS] = Record.readSubExpr();
1217 E->QuestionLoc = readSourceLocation();
1218 E->ColonLoc = readSourceLocation();
1219}
1220
1221void
1222ASTStmtReader::VisitBinaryConditionalOperator(BinaryConditionalOperator *E) {
1223 VisitExpr(E);
1224 E->OpaqueValue = cast<OpaqueValueExpr>(Record.readSubExpr());
1225 E->SubExprs[BinaryConditionalOperator::COMMON] = Record.readSubExpr();
1226 E->SubExprs[BinaryConditionalOperator::COND] = Record.readSubExpr();
1227 E->SubExprs[BinaryConditionalOperator::LHS] = Record.readSubExpr();
1228 E->SubExprs[BinaryConditionalOperator::RHS] = Record.readSubExpr();
1229 E->QuestionLoc = readSourceLocation();
1230 E->ColonLoc = readSourceLocation();
1231}
1232
1233void ASTStmtReader::VisitImplicitCastExpr(ImplicitCastExpr *E) {
1234 VisitCastExpr(E);
1235 E->setIsPartOfExplicitCast(CurrentUnpackingBits->getNextBit());
1236}
1237
1238void ASTStmtReader::VisitExplicitCastExpr(ExplicitCastExpr *E) {
1239 VisitCastExpr(E);
1240 E->setTypeInfoAsWritten(readTypeSourceInfo());
1241}
1242
1243void ASTStmtReader::VisitCStyleCastExpr(CStyleCastExpr *E) {
1244 VisitExplicitCastExpr(E);
1245 E->setLParenLoc(readSourceLocation());
1246 E->setRParenLoc(readSourceLocation());
1247}
1248
1249void ASTStmtReader::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
1250 VisitExpr(E);
1251 E->setLParenLoc(readSourceLocation());
1252 E->setTypeSourceInfo(readTypeSourceInfo());
1253 E->setInitializer(Record.readSubExpr());
1254 E->setFileScope(Record.readInt());
1255}
1256
1257void ASTStmtReader::VisitExtVectorElementExpr(ExtVectorElementExpr *E) {
1258 VisitExpr(E);
1259 E->setBase(Record.readSubExpr());
1260 E->setAccessor(Record.readIdentifier());
1261 E->setAccessorLoc(readSourceLocation());
1262}
1263
1264void ASTStmtReader::VisitMatrixElementExpr(MatrixElementExpr *E) {
1265 VisitExpr(E);
1266 E->setBase(Record.readSubExpr());
1267 E->setAccessor(Record.readIdentifier());
1268 E->setAccessorLoc(readSourceLocation());
1269}
1270
1271void ASTStmtReader::VisitInitListExpr(InitListExpr *E) {
1272 VisitExpr(E);
1273 if (auto *SyntForm = cast_or_null<InitListExpr>(Record.readSubStmt()))
1274 E->setSyntacticForm(SyntForm);
1275 E->setLBraceLoc(readSourceLocation());
1276 E->setRBraceLoc(readSourceLocation());
1277 bool isArrayFiller = Record.readInt();
1278 Expr *filler = nullptr;
1279 if (isArrayFiller) {
1280 filler = Record.readSubExpr();
1281 E->ArrayFillerOrUnionFieldInit = filler;
1282 } else
1283 E->ArrayFillerOrUnionFieldInit = readDeclAs<FieldDecl>();
1284 E->sawArrayRangeDesignator(Record.readInt());
1285 unsigned NumInits = Record.readInt();
1286 E->reserveInits(Record.getContext(), NumInits);
1287 if (isArrayFiller) {
1288 for (unsigned I = 0; I != NumInits; ++I) {
1289 Expr *init = Record.readSubExpr();
1290 E->updateInit(Record.getContext(), I, init ? init : filler);
1291 }
1292 } else {
1293 for (unsigned I = 0; I != NumInits; ++I)
1294 E->updateInit(Record.getContext(), I, Record.readSubExpr());
1295 }
1296 E->InitListExprBits.IsExplicit = Record.readBool();
1297}
1298
1299void ASTStmtReader::VisitDesignatedInitExpr(DesignatedInitExpr *E) {
1300 using Designator = DesignatedInitExpr::Designator;
1301
1302 VisitExpr(E);
1303 unsigned NumSubExprs = Record.readInt();
1304 assert(NumSubExprs == E->getNumSubExprs() && "Wrong number of subexprs");
1305 for (unsigned I = 0; I != NumSubExprs; ++I)
1306 E->setSubExpr(I, Record.readSubExpr());
1307 E->setEqualOrColonLoc(readSourceLocation());
1308 E->setGNUSyntax(Record.readInt());
1309
1310 SmallVector<Designator, 4> Designators;
1311 while (Record.getIdx() < Record.size()) {
1312 switch ((DesignatorTypes)Record.readInt()) {
1313 case DESIG_FIELD_DECL: {
1314 auto *Field = readDeclAs<FieldDecl>();
1315 SourceLocation DotLoc = readSourceLocation();
1316 SourceLocation FieldLoc = readSourceLocation();
1317 Designators.push_back(Designator::CreateFieldDesignator(
1318 Field->getIdentifier(), DotLoc, FieldLoc));
1319 Designators.back().setFieldDecl(Field);
1320 break;
1321 }
1322
1323 case DESIG_FIELD_NAME: {
1324 const IdentifierInfo *Name = Record.readIdentifier();
1325 SourceLocation DotLoc = readSourceLocation();
1326 SourceLocation FieldLoc = readSourceLocation();
1327 Designators.push_back(Designator::CreateFieldDesignator(Name, DotLoc,
1328 FieldLoc));
1329 break;
1330 }
1331
1332 case DESIG_ARRAY: {
1333 unsigned Index = Record.readInt();
1334 SourceLocation LBracketLoc = readSourceLocation();
1335 SourceLocation RBracketLoc = readSourceLocation();
1336 Designators.push_back(Designator::CreateArrayDesignator(Index,
1337 LBracketLoc,
1338 RBracketLoc));
1339 break;
1340 }
1341
1342 case DESIG_ARRAY_RANGE: {
1343 unsigned Index = Record.readInt();
1344 SourceLocation LBracketLoc = readSourceLocation();
1345 SourceLocation EllipsisLoc = readSourceLocation();
1346 SourceLocation RBracketLoc = readSourceLocation();
1347 Designators.push_back(Designator::CreateArrayRangeDesignator(
1348 Index, LBracketLoc, EllipsisLoc, RBracketLoc));
1349 break;
1350 }
1351 }
1352 }
1353 E->setDesignators(Record.getContext(),
1354 Designators.data(), Designators.size());
1355}
1356
1357void ASTStmtReader::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) {
1358 VisitExpr(E);
1359 E->setBase(Record.readSubExpr());
1360 E->setUpdater(Record.readSubExpr());
1361}
1362
1363void ASTStmtReader::VisitNoInitExpr(NoInitExpr *E) {
1364 VisitExpr(E);
1365}
1366
1367void ASTStmtReader::VisitArrayInitLoopExpr(ArrayInitLoopExpr *E) {
1368 VisitExpr(E);
1369 E->SubExprs[0] = Record.readSubExpr();
1370 E->SubExprs[1] = Record.readSubExpr();
1371}
1372
1373void ASTStmtReader::VisitArrayInitIndexExpr(ArrayInitIndexExpr *E) {
1374 VisitExpr(E);
1375}
1376
1377void ASTStmtReader::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) {
1378 VisitExpr(E);
1379}
1380
1381void ASTStmtReader::VisitVAArgExpr(VAArgExpr *E) {
1382 VisitExpr(E);
1383 E->setSubExpr(Record.readSubExpr());
1384 E->setWrittenTypeInfo(readTypeSourceInfo());
1385 E->setBuiltinLoc(readSourceLocation());
1386 E->setRParenLoc(readSourceLocation());
1387 E->setVarargABI(static_cast<clang::VAArgExpr::VarArgKind>(Record.readInt()));
1388}
1389
1390void ASTStmtReader::VisitSourceLocExpr(SourceLocExpr *E) {
1391 VisitExpr(E);
1392 E->ParentContext = readDeclAs<DeclContext>();
1393 E->BuiltinLoc = readSourceLocation();
1394 E->RParenLoc = readSourceLocation();
1395 E->SourceLocExprBits.Kind = Record.readInt();
1396}
1397
1398void ASTStmtReader::VisitEmbedExpr(EmbedExpr *E) {
1399 VisitExpr(E);
1400 E->EmbedKeywordLoc = readSourceLocation();
1401 EmbedDataStorage *Data = new (Record.getContext()) EmbedDataStorage;
1402 Data->BinaryData = cast<StringLiteral>(Record.readSubStmt());
1403 E->Data = Data;
1404 E->Begin = Record.readUInt32();
1405 E->NumOfElements = Record.readUInt32();
1406 ASTContext &Ctx = Record.getContext();
1407 E->Ctx = &Ctx;
1408 E->setType(Ctx.IntTy);
1409 E->FakeChildNode = IntegerLiteral::Create(
1410 Ctx, llvm::APInt::getZero(Ctx.getTypeSize(E->getType())), E->getType(),
1411 E->EmbedKeywordLoc);
1412}
1413
1414void ASTStmtReader::VisitAddrLabelExpr(AddrLabelExpr *E) {
1415 VisitExpr(E);
1416 E->setAmpAmpLoc(readSourceLocation());
1417 E->setLabelLoc(readSourceLocation());
1418 E->setLabel(readDeclAs<LabelDecl>());
1419}
1420
1421void ASTStmtReader::VisitStmtExpr(StmtExpr *E) {
1422 VisitExpr(E);
1423 E->setLParenLoc(readSourceLocation());
1424 E->setRParenLoc(readSourceLocation());
1425 E->setSubStmt(cast_or_null<CompoundStmt>(Record.readSubStmt()));
1426 E->StmtExprBits.TemplateDepth = Record.readInt();
1427}
1428
1429void ASTStmtReader::VisitChooseExpr(ChooseExpr *E) {
1430 VisitExpr(E);
1431 E->setCond(Record.readSubExpr());
1432 E->setLHS(Record.readSubExpr());
1433 E->setRHS(Record.readSubExpr());
1434 E->setBuiltinLoc(readSourceLocation());
1435 E->setRParenLoc(readSourceLocation());
1436 E->setIsConditionTrue(Record.readInt());
1437}
1438
1439void ASTStmtReader::VisitGNUNullExpr(GNUNullExpr *E) {
1440 VisitExpr(E);
1441 E->setTokenLocation(readSourceLocation());
1442}
1443
1444void ASTStmtReader::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
1445 VisitExpr(E);
1446 SmallVector<Expr *, 16> Exprs;
1447 unsigned NumExprs = Record.readInt();
1448 while (NumExprs--)
1449 Exprs.push_back(Record.readSubExpr());
1450 E->setExprs(Record.getContext(), Exprs);
1451 E->setBuiltinLoc(readSourceLocation());
1452 E->setRParenLoc(readSourceLocation());
1453}
1454
1455void ASTStmtReader::VisitConvertVectorExpr(ConvertVectorExpr *E) {
1456 VisitExpr(E);
1457 bool HasFPFeatures = CurrentUnpackingBits->getNextBit();
1458 assert(HasFPFeatures == E->hasStoredFPFeatures());
1459 E->BuiltinLoc = readSourceLocation();
1460 E->RParenLoc = readSourceLocation();
1461 E->TInfo = readTypeSourceInfo();
1462 E->SrcExpr = Record.readSubExpr();
1463 if (HasFPFeatures)
1465 FPOptionsOverride::getFromOpaqueInt(Record.readInt()));
1466}
1467
1468void ASTStmtReader::VisitBlockExpr(BlockExpr *E) {
1469 VisitExpr(E);
1470 E->setBlockDecl(readDeclAs<BlockDecl>());
1471}
1472
1473void ASTStmtReader::VisitGenericSelectionExpr(GenericSelectionExpr *E) {
1474 VisitExpr(E);
1475
1476 unsigned NumAssocs = Record.readInt();
1477 assert(NumAssocs == E->getNumAssocs() && "Wrong NumAssocs!");
1478 E->IsExprPredicate = Record.readInt();
1479 E->ResultIndex = Record.readInt();
1480 E->GenericSelectionExprBits.GenericLoc = readSourceLocation();
1481 E->DefaultLoc = readSourceLocation();
1482 E->RParenLoc = readSourceLocation();
1483
1484 // During serialization, either one more Stmt or one more
1485 // TypeSourceInfo was encoded to account for the predicate
1486 // (whether it was an expression or a type).
1487 Stmt **Stmts = E->getTrailingObjects<Stmt *>();
1488 for (unsigned I = 0, N = NumAssocs + (E->IsExprPredicate ? 1 : 0); I < N; ++I)
1489 Stmts[I] = Record.readSubExpr();
1490
1491 TypeSourceInfo **TSIs = E->getTrailingObjects<TypeSourceInfo *>();
1492 for (unsigned I = 0, N = NumAssocs + (!E->IsExprPredicate ? 1 : 0); I < N;
1493 ++I)
1494 TSIs[I] = readTypeSourceInfo();
1495}
1496
1497void ASTStmtReader::VisitPseudoObjectExpr(PseudoObjectExpr *E) {
1498 VisitExpr(E);
1499 unsigned numSemanticExprs = Record.readInt();
1500 assert(numSemanticExprs + 1 == E->PseudoObjectExprBits.NumSubExprs);
1501 E->PseudoObjectExprBits.ResultIndex = Record.readInt();
1502
1503 // Read the syntactic expression.
1504 E->getTrailingObjects()[0] = Record.readSubExpr();
1505
1506 // Read all the semantic expressions.
1507 for (unsigned i = 0; i != numSemanticExprs; ++i) {
1508 Expr *subExpr = Record.readSubExpr();
1509 E->getTrailingObjects()[i + 1] = subExpr;
1510 }
1511}
1512
1513void ASTStmtReader::VisitAtomicExpr(AtomicExpr *E) {
1514 VisitExpr(E);
1515 E->Op = AtomicExpr::AtomicOp(Record.readInt());
1516 E->NumSubExprs = AtomicExpr::getNumSubExprs(E->Op);
1517 for (unsigned I = 0; I != E->NumSubExprs; ++I)
1518 E->SubExprs[I] = Record.readSubExpr();
1519 E->BuiltinLoc = readSourceLocation();
1520 E->RParenLoc = readSourceLocation();
1521}
1522
1523//===----------------------------------------------------------------------===//
1524// Objective-C Expressions and Statements
1525
1526void ASTStmtReader::VisitObjCObjectLiteral(ObjCObjectLiteral *E) {
1527 VisitExpr(E);
1528 E->setExpressibleAsConstantInitializer(Record.readInt());
1529}
1530
1531void ASTStmtReader::VisitObjCStringLiteral(ObjCStringLiteral *E) {
1532 VisitObjCObjectLiteral(E);
1533 E->setString(cast<StringLiteral>(Record.readSubStmt()));
1534 E->setAtLoc(readSourceLocation());
1535}
1536
1537void ASTStmtReader::VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
1538 VisitObjCObjectLiteral(E);
1539 // could be one of several IntegerLiteral, FloatLiteral, etc.
1540 E->SubExpr = Record.readSubStmt();
1541 E->BoxingMethod = readDeclAs<ObjCMethodDecl>();
1542 E->Range = readSourceRange();
1543}
1544
1545void ASTStmtReader::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
1546 VisitObjCObjectLiteral(E);
1547 unsigned NumElements = Record.readInt();
1548 assert(NumElements == E->getNumElements() && "Wrong number of elements");
1549 Expr **Elements = E->getElements();
1550 for (unsigned I = 0, N = NumElements; I != N; ++I)
1551 Elements[I] = Record.readSubExpr();
1552 E->ArrayWithObjectsMethod = readDeclAs<ObjCMethodDecl>();
1553 E->Range = readSourceRange();
1554}
1555
1556void ASTStmtReader::VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *E) {
1557 VisitObjCObjectLiteral(E);
1558 unsigned NumElements = Record.readInt();
1559 assert(NumElements == E->getNumElements() && "Wrong number of elements");
1560 bool HasPackExpansions = Record.readInt();
1561 assert(HasPackExpansions == E->HasPackExpansions &&"Pack expansion mismatch");
1562 auto *KeyValues =
1563 E->getTrailingObjects<ObjCDictionaryLiteral::KeyValuePair>();
1564 auto *Expansions =
1565 E->getTrailingObjects<ObjCDictionaryLiteral::ExpansionData>();
1566 for (unsigned I = 0; I != NumElements; ++I) {
1567 KeyValues[I].Key = Record.readSubExpr();
1568 KeyValues[I].Value = Record.readSubExpr();
1569 if (HasPackExpansions) {
1570 Expansions[I].EllipsisLoc = readSourceLocation();
1571 Expansions[I].NumExpansionsPlusOne = Record.readInt();
1572 }
1573 }
1574 E->DictWithObjectsMethod = readDeclAs<ObjCMethodDecl>();
1575 E->Range = readSourceRange();
1576}
1577
1578void ASTStmtReader::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
1579 VisitExpr(E);
1580 E->setEncodedTypeSourceInfo(readTypeSourceInfo());
1581 E->setAtLoc(readSourceLocation());
1582 E->setRParenLoc(readSourceLocation());
1583}
1584
1585void ASTStmtReader::VisitObjCSelectorExpr(ObjCSelectorExpr *E) {
1586 VisitExpr(E);
1587 E->setSelector(Record.readSelector());
1588 E->setAtLoc(readSourceLocation());
1589 E->setSelectorNameLoc(readSourceLocation());
1590 E->setRParenLoc(readSourceLocation());
1591}
1592
1593void ASTStmtReader::VisitObjCProtocolExpr(ObjCProtocolExpr *E) {
1594 VisitExpr(E);
1595 E->setProtocol(readDeclAs<ObjCProtocolDecl>());
1596 E->setAtLoc(readSourceLocation());
1597 E->ProtoLoc = readSourceLocation();
1598 E->setRParenLoc(readSourceLocation());
1599}
1600
1601void ASTStmtReader::VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) {
1602 VisitExpr(E);
1603 E->setDecl(readDeclAs<ObjCIvarDecl>());
1604 E->setLocation(readSourceLocation());
1605 E->setOpLoc(readSourceLocation());
1606 E->setBase(Record.readSubExpr());
1607 E->setIsArrow(Record.readInt());
1608 E->setIsFreeIvar(Record.readInt());
1609}
1610
1611void ASTStmtReader::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
1612 VisitExpr(E);
1613 unsigned MethodRefFlags = Record.readInt();
1614 bool Implicit = Record.readInt() != 0;
1615 if (Implicit) {
1616 auto *Getter = readDeclAs<ObjCMethodDecl>();
1617 auto *Setter = readDeclAs<ObjCMethodDecl>();
1618 E->setImplicitProperty(Getter, Setter, MethodRefFlags);
1619 } else {
1620 E->setExplicitProperty(readDeclAs<ObjCPropertyDecl>(), MethodRefFlags);
1621 }
1622 E->setLocation(readSourceLocation());
1623 E->setReceiverLocation(readSourceLocation());
1624 switch (Record.readInt()) {
1625 case 0:
1626 E->setBase(Record.readSubExpr());
1627 break;
1628 case 1:
1629 E->setSuperReceiver(Record.readType());
1630 break;
1631 case 2:
1632 E->setClassReceiver(readDeclAs<ObjCInterfaceDecl>());
1633 break;
1634 }
1635}
1636
1637void ASTStmtReader::VisitObjCSubscriptRefExpr(ObjCSubscriptRefExpr *E) {
1638 VisitExpr(E);
1639 E->setRBracket(readSourceLocation());
1640 E->setBaseExpr(Record.readSubExpr());
1641 E->setKeyExpr(Record.readSubExpr());
1642 E->GetAtIndexMethodDecl = readDeclAs<ObjCMethodDecl>();
1643 E->SetAtIndexMethodDecl = readDeclAs<ObjCMethodDecl>();
1644}
1645
1646void ASTStmtReader::VisitObjCMessageExpr(ObjCMessageExpr *E) {
1647 VisitExpr(E);
1648 assert(Record.peekInt() == E->getNumArgs());
1649 Record.skipInts(1);
1650 unsigned NumStoredSelLocs = Record.readInt();
1651 E->SelLocsKind = Record.readInt();
1652 E->setDelegateInitCall(Record.readInt());
1653 E->IsImplicit = Record.readInt();
1654 auto Kind = static_cast<ObjCMessageExpr::ReceiverKind>(Record.readInt());
1655 switch (Kind) {
1657 E->setInstanceReceiver(Record.readSubExpr());
1658 break;
1659
1661 E->setClassReceiver(readTypeSourceInfo());
1662 break;
1663
1666 QualType T = Record.readType();
1667 SourceLocation SuperLoc = readSourceLocation();
1668 E->setSuper(SuperLoc, T, Kind == ObjCMessageExpr::SuperInstance);
1669 break;
1670 }
1671 }
1672
1673 assert(Kind == E->getReceiverKind());
1674
1675 if (Record.readInt())
1676 E->setMethodDecl(readDeclAs<ObjCMethodDecl>());
1677 else
1678 E->setSelector(Record.readSelector());
1679
1680 E->LBracLoc = readSourceLocation();
1681 E->RBracLoc = readSourceLocation();
1682
1683 for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1684 E->setArg(I, Record.readSubExpr());
1685
1686 SourceLocation *Locs = E->getStoredSelLocs();
1687 for (unsigned I = 0; I != NumStoredSelLocs; ++I)
1688 Locs[I] = readSourceLocation();
1689}
1690
1691void ASTStmtReader::VisitObjCForCollectionStmt(ObjCForCollectionStmt *S) {
1692 VisitStmt(S);
1693 S->setElement(Record.readSubStmt());
1694 S->setCollection(Record.readSubExpr());
1695 S->setBody(Record.readSubStmt());
1696 S->setForLoc(readSourceLocation());
1697 S->setRParenLoc(readSourceLocation());
1698}
1699
1700void ASTStmtReader::VisitObjCAtCatchStmt(ObjCAtCatchStmt *S) {
1701 VisitStmt(S);
1702 S->setCatchBody(Record.readSubStmt());
1703 S->setCatchParamDecl(readDeclAs<VarDecl>());
1704 S->setAtCatchLoc(readSourceLocation());
1705 S->setRParenLoc(readSourceLocation());
1706}
1707
1708void ASTStmtReader::VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S) {
1709 VisitStmt(S);
1710 S->setFinallyBody(Record.readSubStmt());
1711 S->setAtFinallyLoc(readSourceLocation());
1712}
1713
1714void ASTStmtReader::VisitObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S) {
1715 VisitStmt(S); // FIXME: no test coverage.
1716 S->setSubStmt(Record.readSubStmt());
1717 S->setAtLoc(readSourceLocation());
1718}
1719
1720void ASTStmtReader::VisitObjCAtTryStmt(ObjCAtTryStmt *S) {
1721 VisitStmt(S);
1722 assert(Record.peekInt() == S->getNumCatchStmts());
1723 Record.skipInts(1);
1724 bool HasFinally = Record.readInt();
1725 S->setTryBody(Record.readSubStmt());
1726 for (unsigned I = 0, N = S->getNumCatchStmts(); I != N; ++I)
1727 S->setCatchStmt(I, cast_or_null<ObjCAtCatchStmt>(Record.readSubStmt()));
1728
1729 if (HasFinally)
1730 S->setFinallyStmt(Record.readSubStmt());
1731 S->setAtTryLoc(readSourceLocation());
1732}
1733
1734void ASTStmtReader::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
1735 VisitStmt(S); // FIXME: no test coverage.
1736 S->setSynchExpr(Record.readSubStmt());
1737 S->setSynchBody(Record.readSubStmt());
1738 S->setAtSynchronizedLoc(readSourceLocation());
1739}
1740
1741void ASTStmtReader::VisitObjCAtThrowStmt(ObjCAtThrowStmt *S) {
1742 VisitStmt(S); // FIXME: no test coverage.
1743 S->setThrowExpr(Record.readSubStmt());
1744 S->setThrowLoc(readSourceLocation());
1745}
1746
1747void ASTStmtReader::VisitObjCBoolLiteralExpr(ObjCBoolLiteralExpr *E) {
1748 VisitExpr(E);
1749 E->setValue(Record.readInt());
1750 E->setLocation(readSourceLocation());
1751}
1752
1753void ASTStmtReader::VisitObjCAvailabilityCheckExpr(ObjCAvailabilityCheckExpr *E) {
1754 VisitExpr(E);
1755 SourceRange R = Record.readSourceRange();
1756 E->AtLoc = R.getBegin();
1757 E->RParen = R.getEnd();
1758 E->VersionToCheck = Record.readVersionTuple();
1759}
1760
1761//===----------------------------------------------------------------------===//
1762// C++ Expressions and Statements
1763//===----------------------------------------------------------------------===//
1764
1765void ASTStmtReader::VisitCXXCatchStmt(CXXCatchStmt *S) {
1766 VisitStmt(S);
1767 S->CatchLoc = readSourceLocation();
1768 S->ExceptionDecl = readDeclAs<VarDecl>();
1769 S->HandlerBlock = Record.readSubStmt();
1770}
1771
1772void ASTStmtReader::VisitCXXTryStmt(CXXTryStmt *S) {
1773 VisitStmt(S);
1774 assert(Record.peekInt() == S->getNumHandlers() && "NumStmtFields is wrong ?");
1775 Record.skipInts(1);
1776 S->TryLoc = readSourceLocation();
1777 S->getStmts()[0] = Record.readSubStmt();
1778 for (unsigned i = 0, e = S->getNumHandlers(); i != e; ++i)
1779 S->getStmts()[i + 1] = Record.readSubStmt();
1780}
1781
1782void ASTStmtReader::VisitCXXForRangeStmt(CXXForRangeStmt *S) {
1783 VisitStmt(S);
1784 S->ForLoc = readSourceLocation();
1785 S->CoawaitLoc = readSourceLocation();
1786 S->ColonLoc = readSourceLocation();
1787 S->RParenLoc = readSourceLocation();
1788 S->setInit(Record.readSubStmt());
1789 S->setRangeStmt(Record.readSubStmt());
1790 S->setBeginStmt(Record.readSubStmt());
1791 S->setEndStmt(Record.readSubStmt());
1792 S->setCond(Record.readSubExpr());
1793 S->setInc(Record.readSubExpr());
1794 S->setLoopVarStmt(Record.readSubStmt());
1795 S->setBody(Record.readSubStmt());
1796}
1797
1798void ASTStmtReader::VisitCXXExpansionStmtPattern(CXXExpansionStmtPattern *S) {
1799 VisitStmt(S);
1800 Record.skipInts(1); // Skip kind.
1801 S->LParenLoc = readSourceLocation();
1802 S->ColonLoc = readSourceLocation();
1803 S->RParenLoc = readSourceLocation();
1804 S->ParentDecl = cast<CXXExpansionStmtDecl>(Record.readDeclRef());
1805 for (Stmt *&SubStmt : S->children())
1806 SubStmt = Record.readSubStmt();
1807}
1808
1809void ASTStmtReader::VisitCXXExpansionStmtInstantiation(
1811 VisitStmt(S);
1812 Record.skipInts(2);
1813 S->Parent = cast<CXXExpansionStmtDecl>(Record.readDeclRef());
1814 for (unsigned I = 0; I < S->getNumSubStmts(); ++I)
1815 S->getAllSubStmts()[I] = Record.readSubStmt();
1816 S->setShouldApplyLifetimeExtensionToPreamble(Record.readBool());
1817}
1818
1819void ASTStmtReader::VisitCXXExpansionSelectExpr(CXXExpansionSelectExpr *E) {
1820 VisitExpr(E);
1821 E->setRangeExpr(cast<InitListExpr>(Record.readSubExpr()));
1822 E->setIndexExpr(Record.readSubExpr());
1823}
1824
1825void ASTStmtReader::VisitMSDependentExistsStmt(MSDependentExistsStmt *S) {
1826 VisitStmt(S);
1827 S->KeywordLoc = readSourceLocation();
1828 S->IsIfExists = Record.readInt();
1829 S->QualifierLoc = Record.readNestedNameSpecifierLoc();
1830 S->NameInfo = Record.readDeclarationNameInfo();
1831 S->SubStmt = Record.readSubStmt();
1832}
1833
1834void ASTStmtReader::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
1835 VisitCallExpr(E);
1836 E->CXXOperatorCallExprBits.OperatorKind = Record.readInt();
1837 E->CXXOperatorCallExprBits.IsReversed = Record.readInt();
1838 E->BeginLoc = Record.readSourceLocation();
1839}
1840
1841void ASTStmtReader::VisitCXXRewrittenBinaryOperator(
1843 VisitExpr(E);
1844 E->CXXRewrittenBinaryOperatorBits.IsReversed = Record.readInt();
1845 E->SemanticForm = Record.readSubExpr();
1846}
1847
1848void ASTStmtReader::VisitCXXConstructExpr(CXXConstructExpr *E) {
1849 VisitExpr(E);
1850
1851 unsigned NumArgs = Record.readInt();
1852 assert((NumArgs == E->getNumArgs()) && "Wrong NumArgs!");
1853
1854 E->CXXConstructExprBits.Elidable = Record.readInt();
1855 E->CXXConstructExprBits.HadMultipleCandidates = Record.readInt();
1856 E->CXXConstructExprBits.ListInitialization = Record.readInt();
1857 E->CXXConstructExprBits.StdInitListInitialization = Record.readInt();
1858 E->CXXConstructExprBits.ZeroInitialization = Record.readInt();
1859 E->CXXConstructExprBits.ConstructionKind = Record.readInt();
1860 E->CXXConstructExprBits.IsImmediateEscalating = Record.readInt();
1861 E->CXXConstructExprBits.Loc = readSourceLocation();
1862 E->Constructor = readDeclAs<CXXConstructorDecl>();
1863 E->ParenOrBraceRange = readSourceRange();
1864
1865 for (unsigned I = 0; I != NumArgs; ++I)
1866 E->setArg(I, Record.readSubExpr());
1867}
1868
1869void ASTStmtReader::VisitCXXInheritedCtorInitExpr(CXXInheritedCtorInitExpr *E) {
1870 VisitExpr(E);
1871 E->Constructor = readDeclAs<CXXConstructorDecl>();
1872 E->Loc = readSourceLocation();
1873 E->ConstructsVirtualBase = Record.readInt();
1874 E->InheritedFromVirtualBase = Record.readInt();
1875}
1876
1877void ASTStmtReader::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
1878 VisitCXXConstructExpr(E);
1879 E->TSI = readTypeSourceInfo();
1880}
1881
1882void ASTStmtReader::VisitLambdaExpr(LambdaExpr *E) {
1883 VisitExpr(E);
1884 unsigned NumCaptures = Record.readInt();
1885 (void)NumCaptures;
1886 assert(NumCaptures == E->LambdaExprBits.NumCaptures);
1887 E->IntroducerRange = readSourceRange();
1888 E->LambdaExprBits.CaptureDefault = Record.readInt();
1889 E->CaptureDefaultLoc = readSourceLocation();
1890 E->LambdaExprBits.ExplicitParams = Record.readInt();
1891 E->LambdaExprBits.ExplicitResultType = Record.readInt();
1892 E->ClosingBrace = readSourceLocation();
1893
1894 // Read capture initializers.
1896 CEnd = E->capture_init_end();
1897 C != CEnd; ++C)
1898 *C = Record.readSubExpr();
1899
1900 // The body will be lazily deserialized when needed from the call operator
1901 // declaration.
1902}
1903
1904void
1905ASTStmtReader::VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E) {
1906 VisitExpr(E);
1907 E->SubExpr = Record.readSubExpr();
1908}
1909
1910void ASTStmtReader::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) {
1911 VisitExplicitCastExpr(E);
1912 SourceRange R = readSourceRange();
1913 E->Loc = R.getBegin();
1914 E->RParenLoc = R.getEnd();
1915 if (CurrentUnpackingBits->getNextBit())
1916 E->AngleBrackets = readSourceRange();
1917}
1918
1919void ASTStmtReader::VisitCXXStaticCastExpr(CXXStaticCastExpr *E) {
1920 return VisitCXXNamedCastExpr(E);
1921}
1922
1923void ASTStmtReader::VisitCXXDynamicCastExpr(CXXDynamicCastExpr *E) {
1924 return VisitCXXNamedCastExpr(E);
1925}
1926
1927void ASTStmtReader::VisitCXXReinterpretCastExpr(CXXReinterpretCastExpr *E) {
1928 return VisitCXXNamedCastExpr(E);
1929}
1930
1931void ASTStmtReader::VisitCXXAddrspaceCastExpr(CXXAddrspaceCastExpr *E) {
1932 return VisitCXXNamedCastExpr(E);
1933}
1934
1935void ASTStmtReader::VisitCXXConstCastExpr(CXXConstCastExpr *E) {
1936 return VisitCXXNamedCastExpr(E);
1937}
1938
1939void ASTStmtReader::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E) {
1940 VisitExplicitCastExpr(E);
1941 E->setLParenLoc(readSourceLocation());
1942 E->setRParenLoc(readSourceLocation());
1943}
1944
1945void ASTStmtReader::VisitBuiltinBitCastExpr(BuiltinBitCastExpr *E) {
1946 VisitExplicitCastExpr(E);
1947 E->KWLoc = readSourceLocation();
1948 E->RParenLoc = readSourceLocation();
1949}
1950
1951void ASTStmtReader::VisitUserDefinedLiteral(UserDefinedLiteral *E) {
1952 VisitCallExpr(E);
1953 E->UDSuffixLoc = readSourceLocation();
1954}
1955
1956void ASTStmtReader::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) {
1957 VisitExpr(E);
1958 E->setValue(Record.readInt());
1959 E->setLocation(readSourceLocation());
1960}
1961
1962void ASTStmtReader::VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E) {
1963 VisitExpr(E);
1964 E->setLocation(readSourceLocation());
1965}
1966
1967void ASTStmtReader::VisitCXXTypeidExpr(CXXTypeidExpr *E) {
1968 VisitExpr(E);
1969 E->setSourceRange(readSourceRange());
1970 if (E->isTypeOperand())
1971 E->Operand = readTypeSourceInfo();
1972 else
1973 E->Operand = Record.readSubExpr();
1974}
1975
1976void ASTStmtReader::VisitCXXThisExpr(CXXThisExpr *E) {
1977 VisitExpr(E);
1978 E->setLocation(readSourceLocation());
1979 E->setImplicit(Record.readInt());
1981}
1982
1983void ASTStmtReader::VisitCXXThrowExpr(CXXThrowExpr *E) {
1984 VisitExpr(E);
1985 E->CXXThrowExprBits.ThrowLoc = readSourceLocation();
1986 E->Operand = Record.readSubExpr();
1987 E->CXXThrowExprBits.IsThrownVariableInScope = Record.readInt();
1988}
1989
1990void ASTStmtReader::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
1991 VisitExpr(E);
1992 E->Param = readDeclAs<ParmVarDecl>();
1993 E->UsedContext = readDeclAs<DeclContext>();
1994 E->CXXDefaultArgExprBits.Loc = readSourceLocation();
1995 E->CXXDefaultArgExprBits.HasRewrittenInit = Record.readInt();
1996 if (E->CXXDefaultArgExprBits.HasRewrittenInit)
1997 *E->getTrailingObjects() = Record.readSubExpr();
1998}
1999
2000void ASTStmtReader::VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E) {
2001 VisitExpr(E);
2002 E->CXXDefaultInitExprBits.HasRewrittenInit = Record.readInt();
2003 E->Field = readDeclAs<FieldDecl>();
2004 E->UsedContext = readDeclAs<DeclContext>();
2005 E->CXXDefaultInitExprBits.Loc = readSourceLocation();
2006 if (E->CXXDefaultInitExprBits.HasRewrittenInit)
2007 *E->getTrailingObjects() = Record.readSubExpr();
2008}
2009
2010void ASTStmtReader::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
2011 VisitExpr(E);
2012 E->setTemporary(Record.readCXXTemporary());
2013 E->setSubExpr(Record.readSubExpr());
2014}
2015
2016void ASTStmtReader::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
2017 VisitExpr(E);
2018 E->TypeInfo = readTypeSourceInfo();
2019 E->CXXScalarValueInitExprBits.RParenLoc = readSourceLocation();
2020}
2021
2022void ASTStmtReader::VisitCXXNewExpr(CXXNewExpr *E) {
2023 VisitExpr(E);
2024
2025 bool IsArray = Record.readInt();
2026 bool HasInit = Record.readInt();
2027 unsigned NumPlacementArgs = Record.readInt();
2028 bool IsParenTypeId = Record.readInt();
2029
2030 E->CXXNewExprBits.IsGlobalNew = Record.readInt();
2031 E->CXXNewExprBits.ShouldPassAlignment = Record.readInt();
2032 E->CXXNewExprBits.ShouldPassTypeIdentity = Record.readInt();
2033 E->CXXNewExprBits.UsualArrayDeleteWantsSize = Record.readInt();
2034 E->CXXNewExprBits.HasInitializer = Record.readInt();
2035 E->CXXNewExprBits.StoredInitializationStyle = Record.readInt();
2036
2037 assert((IsArray == E->isArray()) && "Wrong IsArray!");
2038 assert((HasInit == E->hasInitializer()) && "Wrong HasInit!");
2039 assert((NumPlacementArgs == E->getNumPlacementArgs()) &&
2040 "Wrong NumPlacementArgs!");
2041 assert((IsParenTypeId == E->isParenTypeId()) && "Wrong IsParenTypeId!");
2042 (void)IsArray;
2043 (void)HasInit;
2044 (void)NumPlacementArgs;
2045
2046 E->setOperatorNew(readDeclAs<FunctionDecl>());
2047 E->setOperatorDelete(readDeclAs<FunctionDecl>());
2048 E->AllocatedTypeInfo = readTypeSourceInfo();
2049 if (IsParenTypeId)
2050 E->getTrailingObjects<SourceRange>()[0] = readSourceRange();
2051 E->Range = readSourceRange();
2052 E->DirectInitRange = readSourceRange();
2053
2054 // Install all the subexpressions.
2056 N = E->raw_arg_end();
2057 I != N; ++I)
2058 *I = Record.readSubStmt();
2059}
2060
2061void ASTStmtReader::VisitCXXDeleteExpr(CXXDeleteExpr *E) {
2062 VisitExpr(E);
2063 E->CXXDeleteExprBits.GlobalDelete = Record.readInt();
2064 E->CXXDeleteExprBits.ArrayForm = Record.readInt();
2065 E->CXXDeleteExprBits.ArrayFormAsWritten = Record.readInt();
2066 E->CXXDeleteExprBits.UsualArrayDeleteWantsSize = Record.readInt();
2067 E->OperatorDelete = readDeclAs<FunctionDecl>();
2068 E->Argument = Record.readSubExpr();
2069 E->CXXDeleteExprBits.Loc = readSourceLocation();
2070}
2071
2072void ASTStmtReader::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
2073 VisitExpr(E);
2074
2075 E->Base = Record.readSubExpr();
2076 E->IsArrow = Record.readInt();
2077 E->OperatorLoc = readSourceLocation();
2078 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
2079 E->ScopeType = readTypeSourceInfo();
2080 E->ColonColonLoc = readSourceLocation();
2081 E->TildeLoc = readSourceLocation();
2082
2083 IdentifierInfo *II = Record.readIdentifier();
2084 if (II)
2085 E->setDestroyedType(II, readSourceLocation());
2086 else
2087 E->setDestroyedType(readTypeSourceInfo());
2088}
2089
2090void ASTStmtReader::VisitExprWithCleanups(ExprWithCleanups *E) {
2091 VisitExpr(E);
2092
2093 unsigned NumObjects = Record.readInt();
2094 assert(NumObjects == E->getNumObjects());
2095 for (unsigned i = 0; i != NumObjects; ++i) {
2096 unsigned CleanupKind = Record.readInt();
2098 if (CleanupKind == COK_Block)
2099 Obj = readDeclAs<BlockDecl>();
2100 else if (CleanupKind == COK_CompoundLiteral)
2101 Obj = cast<CompoundLiteralExpr>(Record.readSubExpr());
2102 else
2103 llvm_unreachable("unexpected cleanup object type");
2104 E->getTrailingObjects()[i] = Obj;
2105 }
2106
2107 E->ExprWithCleanupsBits.CleanupsHaveSideEffects = Record.readInt();
2108 E->SubExpr = Record.readSubExpr();
2109}
2110
2111void ASTStmtReader::VisitDependentTemplateIdExpr(DependentTemplateIdExpr *E) {
2112 VisitExpr(E);
2113 unsigned NumTemplateArgs = Record.readInt();
2114 assert(NumTemplateArgs == E->getNumTemplateArgs() &&
2115 "Wrong NumTemplateArgs!");
2116 ReadTemplateKWAndArgsInfo(E->KWAndArgs, E->getTrailingObjects(),
2117 NumTemplateArgs);
2118 E->NameInfo = Record.readDeclarationNameInfo();
2119 E->Name = Record.readTemplateName();
2120}
2121
2122void ASTStmtReader::VisitCXXDependentScopeMemberExpr(
2124 VisitExpr(E);
2125
2126 unsigned NumTemplateArgs = Record.readInt();
2127 CurrentUnpackingBits.emplace(Record.readInt());
2128 bool HasTemplateKWAndArgsInfo = CurrentUnpackingBits->getNextBit();
2129 bool HasFirstQualifierFoundInScope = CurrentUnpackingBits->getNextBit();
2130
2131 assert((HasTemplateKWAndArgsInfo == E->hasTemplateKWAndArgsInfo()) &&
2132 "Wrong HasTemplateKWAndArgsInfo!");
2133 assert(
2134 (HasFirstQualifierFoundInScope == E->hasFirstQualifierFoundInScope()) &&
2135 "Wrong HasFirstQualifierFoundInScope!");
2136
2137 if (HasTemplateKWAndArgsInfo)
2139 *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
2140 E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs);
2141
2142 assert((NumTemplateArgs == E->getNumTemplateArgs()) &&
2143 "Wrong NumTemplateArgs!");
2144
2146 CurrentUnpackingBits->getNextBit();
2147
2148 E->BaseType = Record.readType();
2149 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
2150 // not ImplicitAccess
2151 if (CurrentUnpackingBits->getNextBit())
2152 E->Base = Record.readSubExpr();
2153 else
2154 E->Base = nullptr;
2155
2156 E->CXXDependentScopeMemberExprBits.OperatorLoc = readSourceLocation();
2157
2158 if (HasFirstQualifierFoundInScope)
2159 *E->getTrailingObjects<NamedDecl *>() = readDeclAs<NamedDecl>();
2160
2161 E->MemberNameInfo = Record.readDeclarationNameInfo();
2162}
2163
2164void
2165ASTStmtReader::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) {
2166 VisitExpr(E);
2167
2168 if (CurrentUnpackingBits->getNextBit()) // HasTemplateKWAndArgsInfo
2170 *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
2171 E->getTrailingObjects<TemplateArgumentLoc>(),
2172 /*NumTemplateArgs=*/CurrentUnpackingBits->getNextBits(/*Width=*/16));
2173
2174 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
2175 E->NameInfo = Record.readDeclarationNameInfo();
2176}
2177
2178void
2179ASTStmtReader::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E) {
2180 VisitExpr(E);
2181 assert(Record.peekInt() == E->getNumArgs() &&
2182 "Read wrong record during creation ?");
2183 Record.skipInts(1);
2184 for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
2185 E->setArg(I, Record.readSubExpr());
2186 E->TypeAndInitForm.setPointer(readTypeSourceInfo());
2187 E->setLParenLoc(readSourceLocation());
2188 E->setRParenLoc(readSourceLocation());
2189 E->TypeAndInitForm.setInt(Record.readInt());
2190}
2191
2192void ASTStmtReader::VisitOverloadExpr(OverloadExpr *E) {
2193 VisitExpr(E);
2194
2195 unsigned NumResults = Record.readInt();
2196 CurrentUnpackingBits.emplace(Record.readInt());
2197 bool HasTemplateKWAndArgsInfo = CurrentUnpackingBits->getNextBit();
2198 assert((E->getNumDecls() == NumResults) && "Wrong NumResults!");
2199 assert((E->hasTemplateKWAndArgsInfo() == HasTemplateKWAndArgsInfo) &&
2200 "Wrong HasTemplateKWAndArgsInfo!");
2201
2202 unsigned NumTemplateArgs = 0;
2203 if (HasTemplateKWAndArgsInfo) {
2204 NumTemplateArgs = Record.readInt();
2207 NumTemplateArgs);
2208 }
2209
2210 UnresolvedSet<8> Decls;
2211 for (unsigned I = 0; I != NumResults; ++I) {
2212 auto *D = readDeclAs<NamedDecl>();
2213 auto AS = (AccessSpecifier)Record.readInt();
2214 Decls.addDecl(D, AS);
2215 }
2216
2217 DeclAccessPair *Results = E->getTrailingResults();
2218 UnresolvedSetIterator Iter = Decls.begin();
2219 for (unsigned I = 0; I != NumResults; ++I) {
2220 Results[I] = (Iter + I).getPair();
2221 }
2222
2223 assert((E->getNumTemplateArgs() == NumTemplateArgs) &&
2224 "Wrong NumTemplateArgs!");
2225
2226 E->NameInfo = Record.readDeclarationNameInfo();
2227 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
2228}
2229
2230void ASTStmtReader::VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
2231 VisitOverloadExpr(E);
2232 E->UnresolvedMemberExprBits.IsArrow = CurrentUnpackingBits->getNextBit();
2233 E->UnresolvedMemberExprBits.HasUnresolvedUsing =
2234 CurrentUnpackingBits->getNextBit();
2235
2236 if (/*!isImplicitAccess=*/CurrentUnpackingBits->getNextBit())
2237 E->Base = Record.readSubExpr();
2238 else
2239 E->Base = nullptr;
2240
2241 E->OperatorLoc = readSourceLocation();
2242
2243 E->BaseType = Record.readType();
2244}
2245
2246void ASTStmtReader::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) {
2247 VisitOverloadExpr(E);
2248 E->UnresolvedLookupExprBits.RequiresADL = CurrentUnpackingBits->getNextBit();
2249 E->NamingClass = readDeclAs<CXXRecordDecl>();
2250}
2251
2252void ASTStmtReader::VisitTypeTraitExpr(TypeTraitExpr *E) {
2253 VisitExpr(E);
2254 E->TypeTraitExprBits.IsBooleanTypeTrait = Record.readInt();
2255 E->TypeTraitExprBits.IsComparisonResult = Record.readInt();
2256 E->TypeTraitExprBits.NumArgs = Record.readInt();
2257 E->TypeTraitExprBits.Kind = Record.readInt();
2258
2259 if (E->TypeTraitExprBits.IsBooleanTypeTrait)
2260 E->TypeTraitExprBits.Value = Record.readInt();
2261 else
2262 *E->getTrailingObjects<APValue>() = Record.readAPValue();
2263
2264 SourceRange Range = readSourceRange();
2265 E->Loc = Range.getBegin();
2266 E->RParenLoc = Range.getEnd();
2267
2268 auto **Args = E->getTrailingObjects<TypeSourceInfo *>();
2269 for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
2270 Args[I] = readTypeSourceInfo();
2271}
2272
2273void ASTStmtReader::VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E) {
2274 VisitExpr(E);
2275 E->ArrayTypeTraitExprBits.ATT = (ArrayTypeTrait)Record.readInt();
2276 E->Value = (unsigned int)Record.readInt();
2277 SourceRange Range = readSourceRange();
2278 E->Loc = Range.getBegin();
2279 E->RParen = Range.getEnd();
2280 E->QueriedType = readTypeSourceInfo();
2281 E->Dimension = Record.readSubExpr();
2282}
2283
2284void ASTStmtReader::VisitExpressionTraitExpr(ExpressionTraitExpr *E) {
2285 VisitExpr(E);
2286 E->ExpressionTraitExprBits.ET = (ExpressionTrait)Record.readInt();
2287 E->ExpressionTraitExprBits.Value = (bool)Record.readInt();
2288 SourceRange Range = readSourceRange();
2289 E->QueriedExpression = Record.readSubExpr();
2290 E->Loc = Range.getBegin();
2291 E->RParen = Range.getEnd();
2292}
2293
2294void ASTStmtReader::VisitCXXNoexceptExpr(CXXNoexceptExpr *E) {
2295 VisitExpr(E);
2296 E->CXXNoexceptExprBits.Value = Record.readInt();
2297 E->Range = readSourceRange();
2298 E->Operand = Record.readSubExpr();
2299}
2300
2301void ASTStmtReader::VisitPackExpansionExpr(PackExpansionExpr *E) {
2302 VisitExpr(E);
2303 E->EllipsisLoc = readSourceLocation();
2304 E->NumExpansions = Record.readInt();
2305 E->Pattern = Record.readSubExpr();
2306}
2307
2308void ASTStmtReader::VisitSizeOfPackExpr(SizeOfPackExpr *E) {
2309 VisitExpr(E);
2310 unsigned NumPartialArgs = Record.readInt();
2311 E->OperatorLoc = readSourceLocation();
2312 E->PackLoc = readSourceLocation();
2313 E->RParenLoc = readSourceLocation();
2314 E->Pack = Record.readDeclAs<NamedDecl>();
2315 if (E->isPartiallySubstituted()) {
2316 assert(E->Length == NumPartialArgs);
2317 for (auto *I = E->getTrailingObjects(), *E = I + NumPartialArgs; I != E;
2318 ++I)
2319 new (I) TemplateArgument(Record.readTemplateArgument());
2320 } else if (!E->isValueDependent()) {
2321 E->Length = Record.readInt();
2322 }
2323}
2324
2325void ASTStmtReader::VisitPackIndexingExpr(PackIndexingExpr *E) {
2326 VisitExpr(E);
2327 E->PackIndexingExprBits.TransformedExpressions = Record.readInt();
2328 E->PackIndexingExprBits.FullySubstituted = Record.readInt();
2329 E->EllipsisLoc = readSourceLocation();
2330 E->RSquareLoc = readSourceLocation();
2331 E->SubExprs[0] = Record.readStmt();
2332 E->SubExprs[1] = Record.readStmt();
2333 auto **Exprs = E->getTrailingObjects();
2334 for (unsigned I = 0; I < E->PackIndexingExprBits.TransformedExpressions; ++I)
2335 Exprs[I] = Record.readExpr();
2336}
2337
2338void ASTStmtReader::VisitSubstNonTypeTemplateParmExpr(
2340 VisitExpr(E);
2341 E->AssociatedDeclAndFinal.setPointer(readDeclAs<Decl>());
2342 E->AssociatedDeclAndFinal.setInt(CurrentUnpackingBits->getNextBit());
2343 E->Index = CurrentUnpackingBits->getNextBits(/*Width=*/12);
2344 E->PackIndex = Record.readUnsignedOrNone().toInternalRepresentation();
2345 E->ParamType = Record.readType();
2346 E->SubstNonTypeTemplateParmExprBits.NameLoc = readSourceLocation();
2347 E->Replacement = Record.readSubExpr();
2348}
2349
2350void ASTStmtReader::VisitSubstNonTypeTemplateParmPackExpr(
2352 VisitExpr(E);
2353 E->AssociatedDecl = readDeclAs<Decl>();
2354 E->Final = CurrentUnpackingBits->getNextBit();
2355 E->Index = Record.readInt();
2356 TemplateArgument ArgPack = Record.readTemplateArgument();
2357 if (ArgPack.getKind() != TemplateArgument::Pack)
2358 return;
2359
2360 E->Arguments = ArgPack.pack_begin();
2361 E->NumArguments = ArgPack.pack_size();
2362 E->NameLoc = readSourceLocation();
2363}
2364
2365void ASTStmtReader::VisitFunctionParmPackExpr(FunctionParmPackExpr *E) {
2366 VisitExpr(E);
2367 E->NumParameters = Record.readInt();
2368 E->ParamPack = readDeclAs<ValueDecl>();
2369 E->NameLoc = readSourceLocation();
2370 auto **Parms = E->getTrailingObjects();
2371 for (unsigned i = 0, n = E->NumParameters; i != n; ++i)
2372 Parms[i] = readDeclAs<ValueDecl>();
2373}
2374
2375void ASTStmtReader::VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E) {
2376 VisitExpr(E);
2377 bool HasMaterialzedDecl = Record.readInt();
2378 if (HasMaterialzedDecl)
2379 E->State = cast<LifetimeExtendedTemporaryDecl>(Record.readDecl());
2380 else
2381 E->State = Record.readSubExpr();
2382}
2383
2384void ASTStmtReader::VisitCXXFoldExpr(CXXFoldExpr *E) {
2385 VisitExpr(E);
2386 E->LParenLoc = readSourceLocation();
2387 E->EllipsisLoc = readSourceLocation();
2388 E->RParenLoc = readSourceLocation();
2389 E->NumExpansions = Record.readUnsignedOrNone();
2390 E->SubExprs[0] = Record.readSubExpr();
2391 E->SubExprs[1] = Record.readSubExpr();
2392 E->SubExprs[2] = Record.readSubExpr();
2393 E->CXXFoldExprBits.Opcode = (BinaryOperatorKind)Record.readInt();
2394}
2395
2396void ASTStmtReader::VisitCXXParenListInitExpr(CXXParenListInitExpr *E) {
2397 VisitExpr(E);
2398 unsigned ExpectedNumExprs = Record.readInt();
2399 assert(E->NumExprs == ExpectedNumExprs &&
2400 "expected number of expressions does not equal the actual number of "
2401 "serialized expressions.");
2402 E->NumUserSpecifiedExprs = Record.readInt();
2403 E->InitLoc = readSourceLocation();
2404 E->LParenLoc = readSourceLocation();
2405 E->RParenLoc = readSourceLocation();
2406 for (unsigned I = 0; I < ExpectedNumExprs; I++)
2407 E->getTrailingObjects()[I] = Record.readSubExpr();
2408
2409 bool HasArrayFillerOrUnionDecl = Record.readBool();
2410 if (HasArrayFillerOrUnionDecl) {
2411 bool HasArrayFiller = Record.readBool();
2412 if (HasArrayFiller) {
2413 E->setArrayFiller(Record.readSubExpr());
2414 } else {
2415 E->setInitializedFieldInUnion(readDeclAs<FieldDecl>());
2416 }
2417 }
2418 E->updateDependence();
2419}
2420
2421void ASTStmtReader::VisitOpaqueValueExpr(OpaqueValueExpr *E) {
2422 VisitExpr(E);
2423 E->SourceExpr = Record.readSubExpr();
2424 E->OpaqueValueExprBits.Loc = readSourceLocation();
2425 E->setIsUnique(Record.readInt());
2426}
2427
2428void ASTStmtReader::VisitRecoveryExpr(RecoveryExpr *E) {
2429 VisitExpr(E);
2430 unsigned NumArgs = Record.readInt();
2431 E->BeginLoc = readSourceLocation();
2432 E->EndLoc = readSourceLocation();
2433 assert((NumArgs + 0LL ==
2434 std::distance(E->children().begin(), E->children().end())) &&
2435 "Wrong NumArgs!");
2436 (void)NumArgs;
2437 for (Stmt *&Child : E->children())
2438 Child = Record.readSubStmt();
2439}
2440
2441//===----------------------------------------------------------------------===//
2442// Microsoft Expressions and Statements
2443//===----------------------------------------------------------------------===//
2444void ASTStmtReader::VisitMSPropertyRefExpr(MSPropertyRefExpr *E) {
2445 VisitExpr(E);
2446 E->IsArrow = (Record.readInt() != 0);
2447 E->BaseExpr = Record.readSubExpr();
2448 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
2449 E->MemberLoc = readSourceLocation();
2450 E->TheDecl = readDeclAs<MSPropertyDecl>();
2451}
2452
2453void ASTStmtReader::VisitMSPropertySubscriptExpr(MSPropertySubscriptExpr *E) {
2454 VisitExpr(E);
2455 E->setBase(Record.readSubExpr());
2456 E->setIdx(Record.readSubExpr());
2457 E->setRBracketLoc(readSourceLocation());
2458}
2459
2460void ASTStmtReader::VisitCXXUuidofExpr(CXXUuidofExpr *E) {
2461 VisitExpr(E);
2462 E->setSourceRange(readSourceRange());
2463 E->Guid = readDeclAs<MSGuidDecl>();
2464 if (E->isTypeOperand())
2465 E->Operand = readTypeSourceInfo();
2466 else
2467 E->Operand = Record.readSubExpr();
2468}
2469
2470void ASTStmtReader::VisitSEHLeaveStmt(SEHLeaveStmt *S) {
2471 VisitStmt(S);
2472 S->setLeaveLoc(readSourceLocation());
2473}
2474
2475void ASTStmtReader::VisitSEHExceptStmt(SEHExceptStmt *S) {
2476 VisitStmt(S);
2477 S->Loc = readSourceLocation();
2478 S->Children[SEHExceptStmt::FILTER_EXPR] = Record.readSubStmt();
2479 S->Children[SEHExceptStmt::BLOCK] = Record.readSubStmt();
2480}
2481
2482void ASTStmtReader::VisitSEHFinallyStmt(SEHFinallyStmt *S) {
2483 VisitStmt(S);
2484 S->Loc = readSourceLocation();
2485 S->Block = Record.readSubStmt();
2486}
2487
2488void ASTStmtReader::VisitSEHTryStmt(SEHTryStmt *S) {
2489 VisitStmt(S);
2490 S->IsCXXTry = Record.readInt();
2491 S->TryLoc = readSourceLocation();
2492 S->Children[SEHTryStmt::TRY] = Record.readSubStmt();
2493 S->Children[SEHTryStmt::HANDLER] = Record.readSubStmt();
2494}
2495
2496//===----------------------------------------------------------------------===//
2497// CUDA Expressions and Statements
2498//===----------------------------------------------------------------------===//
2499
2500void ASTStmtReader::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E) {
2501 VisitCallExpr(E);
2502 E->setPreArg(CUDAKernelCallExpr::CONFIG, Record.readSubExpr());
2503}
2504
2505//===----------------------------------------------------------------------===//
2506// OpenCL Expressions and Statements.
2507//===----------------------------------------------------------------------===//
2508void ASTStmtReader::VisitAsTypeExpr(AsTypeExpr *E) {
2509 VisitExpr(E);
2510 E->BuiltinLoc = readSourceLocation();
2511 E->RParenLoc = readSourceLocation();
2512 E->SrcExpr = Record.readSubExpr();
2513}
2514
2515//===----------------------------------------------------------------------===//
2516// OpenMP Directives.
2517//===----------------------------------------------------------------------===//
2518
2519void ASTStmtReader::VisitOMPCanonicalLoop(OMPCanonicalLoop *S) {
2520 VisitStmt(S);
2521 for (Stmt *&SubStmt : S->SubStmts)
2522 SubStmt = Record.readSubStmt();
2523}
2524
2525void ASTStmtReader::VisitOMPExecutableDirective(OMPExecutableDirective *E) {
2526 Record.readOMPChildren(E->Data);
2527 E->setLocStart(readSourceLocation());
2528 E->setLocEnd(readSourceLocation());
2529}
2530
2531void ASTStmtReader::VisitOMPLoopBasedDirective(OMPLoopBasedDirective *D) {
2532 VisitStmt(D);
2533 // Field CollapsedNum was read in ReadStmtFromStream.
2534 Record.skipInts(1);
2535 VisitOMPExecutableDirective(D);
2536}
2537
2538void ASTStmtReader::VisitOMPLoopDirective(OMPLoopDirective *D) {
2539 VisitOMPLoopBasedDirective(D);
2540}
2541
2542void ASTStmtReader::VisitOMPMetaDirective(OMPMetaDirective *D) {
2543 VisitStmt(D);
2544 // The NumVariants field was read in ReadStmtFromStream.
2545 Record.skipInts(1);
2546 VisitOMPExecutableDirective(D);
2547 D->setHasImplicitOtherwise(Record.readBool());
2548 for (OMPTraitInfo *&TI : D->getTrailingTraitInfos())
2549 TI = Record.readOMPTraitInfo();
2550}
2551
2552void ASTStmtReader::VisitOMPParallelDirective(OMPParallelDirective *D) {
2553 VisitStmt(D);
2554 VisitOMPExecutableDirective(D);
2555 D->setHasCancel(Record.readBool());
2556}
2557
2558void ASTStmtReader::VisitOMPSimdDirective(OMPSimdDirective *D) {
2559 VisitOMPLoopDirective(D);
2560}
2561
2562void ASTStmtReader::VisitOMPCanonicalLoopNestTransformationDirective(
2563 OMPCanonicalLoopNestTransformationDirective *D) {
2564 VisitOMPLoopBasedDirective(D);
2565 D->setNumGeneratedTopLevelLoops(Record.readUInt32());
2566}
2567
2568void ASTStmtReader::VisitOMPTileDirective(OMPTileDirective *D) {
2569 VisitOMPCanonicalLoopNestTransformationDirective(D);
2570}
2571
2572void ASTStmtReader::VisitOMPStripeDirective(OMPStripeDirective *D) {
2573 VisitOMPCanonicalLoopNestTransformationDirective(D);
2574}
2575
2576void ASTStmtReader::VisitOMPUnrollDirective(OMPUnrollDirective *D) {
2577 VisitOMPCanonicalLoopNestTransformationDirective(D);
2578}
2579
2580void ASTStmtReader::VisitOMPReverseDirective(OMPReverseDirective *D) {
2581 VisitOMPCanonicalLoopNestTransformationDirective(D);
2582}
2583
2584void ASTStmtReader::VisitOMPCanonicalLoopSequenceTransformationDirective(
2585 OMPCanonicalLoopSequenceTransformationDirective *D) {
2586 VisitStmt(D);
2587 VisitOMPExecutableDirective(D);
2588 D->setNumGeneratedTopLevelLoops(Record.readUInt32());
2589}
2590
2591void ASTStmtReader::VisitOMPInterchangeDirective(OMPInterchangeDirective *D) {
2592 VisitOMPCanonicalLoopNestTransformationDirective(D);
2593}
2594
2595void ASTStmtReader::VisitOMPFlattenDirective(OMPFlattenDirective *D) {
2596 VisitOMPCanonicalLoopNestTransformationDirective(D);
2597}
2598
2599void ASTStmtReader::VisitOMPSplitDirective(OMPSplitDirective *D) {
2600 VisitOMPCanonicalLoopNestTransformationDirective(D);
2601}
2602
2603void ASTStmtReader::VisitOMPFuseDirective(OMPFuseDirective *D) {
2604 VisitOMPCanonicalLoopSequenceTransformationDirective(D);
2605}
2606
2607void ASTStmtReader::VisitOMPForDirective(OMPForDirective *D) {
2608 VisitOMPLoopDirective(D);
2609 D->setHasCancel(Record.readBool());
2610}
2611
2612void ASTStmtReader::VisitOMPForSimdDirective(OMPForSimdDirective *D) {
2613 VisitOMPLoopDirective(D);
2614}
2615
2616void ASTStmtReader::VisitOMPSectionsDirective(OMPSectionsDirective *D) {
2617 VisitStmt(D);
2618 VisitOMPExecutableDirective(D);
2619 D->setHasCancel(Record.readBool());
2620}
2621
2622void ASTStmtReader::VisitOMPSectionDirective(OMPSectionDirective *D) {
2623 VisitStmt(D);
2624 VisitOMPExecutableDirective(D);
2625 D->setHasCancel(Record.readBool());
2626}
2627
2628void ASTStmtReader::VisitOMPScopeDirective(OMPScopeDirective *D) {
2629 VisitStmt(D);
2630 VisitOMPExecutableDirective(D);
2631}
2632
2633void ASTStmtReader::VisitOMPSingleDirective(OMPSingleDirective *D) {
2634 VisitStmt(D);
2635 VisitOMPExecutableDirective(D);
2636}
2637
2638void ASTStmtReader::VisitOMPMasterDirective(OMPMasterDirective *D) {
2639 VisitStmt(D);
2640 VisitOMPExecutableDirective(D);
2641}
2642
2643void ASTStmtReader::VisitOMPCriticalDirective(OMPCriticalDirective *D) {
2644 VisitStmt(D);
2645 VisitOMPExecutableDirective(D);
2646 D->DirName = Record.readDeclarationNameInfo();
2647}
2648
2649void ASTStmtReader::VisitOMPParallelForDirective(OMPParallelForDirective *D) {
2650 VisitOMPLoopDirective(D);
2651 D->setHasCancel(Record.readBool());
2652}
2653
2654void ASTStmtReader::VisitOMPParallelForSimdDirective(
2655 OMPParallelForSimdDirective *D) {
2656 VisitOMPLoopDirective(D);
2657}
2658
2659void ASTStmtReader::VisitOMPParallelMasterDirective(
2660 OMPParallelMasterDirective *D) {
2661 VisitStmt(D);
2662 VisitOMPExecutableDirective(D);
2663}
2664
2665void ASTStmtReader::VisitOMPParallelMaskedDirective(
2666 OMPParallelMaskedDirective *D) {
2667 VisitStmt(D);
2668 VisitOMPExecutableDirective(D);
2669}
2670
2671void ASTStmtReader::VisitOMPParallelSectionsDirective(
2672 OMPParallelSectionsDirective *D) {
2673 VisitStmt(D);
2674 VisitOMPExecutableDirective(D);
2675 D->setHasCancel(Record.readBool());
2676}
2677
2678void ASTStmtReader::VisitOMPTaskDirective(OMPTaskDirective *D) {
2679 VisitStmt(D);
2680 VisitOMPExecutableDirective(D);
2681 D->setHasCancel(Record.readBool());
2682}
2683
2684void ASTStmtReader::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) {
2685 VisitStmt(D);
2686 VisitOMPExecutableDirective(D);
2687}
2688
2689void ASTStmtReader::VisitOMPBarrierDirective(OMPBarrierDirective *D) {
2690 VisitStmt(D);
2691 VisitOMPExecutableDirective(D);
2692}
2693
2694void ASTStmtReader::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) {
2695 VisitStmt(D);
2696 // The NumClauses field was read in ReadStmtFromStream.
2697 Record.skipInts(1);
2698 VisitOMPExecutableDirective(D);
2699}
2700
2701void ASTStmtReader::VisitOMPAssumeDirective(OMPAssumeDirective *D) {
2702 VisitStmt(D);
2703 VisitOMPExecutableDirective(D);
2704}
2705
2706void ASTStmtReader::VisitOMPErrorDirective(OMPErrorDirective *D) {
2707 VisitStmt(D);
2708 // The NumClauses field was read in ReadStmtFromStream.
2709 Record.skipInts(1);
2710 VisitOMPExecutableDirective(D);
2711}
2712
2713void ASTStmtReader::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) {
2714 VisitStmt(D);
2715 VisitOMPExecutableDirective(D);
2716}
2717
2718void ASTStmtReader::VisitOMPFlushDirective(OMPFlushDirective *D) {
2719 VisitStmt(D);
2720 VisitOMPExecutableDirective(D);
2721}
2722
2723void ASTStmtReader::VisitOMPDepobjDirective(OMPDepobjDirective *D) {
2724 VisitStmt(D);
2725 VisitOMPExecutableDirective(D);
2726}
2727
2728void ASTStmtReader::VisitOMPScanDirective(OMPScanDirective *D) {
2729 VisitStmt(D);
2730 VisitOMPExecutableDirective(D);
2731}
2732
2733void ASTStmtReader::VisitOMPOrderedStandaloneDirective(
2734 OMPOrderedStandaloneDirective *D) {
2735 VisitStmt(D);
2736 VisitOMPExecutableDirective(D);
2737}
2738
2739void ASTStmtReader::VisitOMPOrderedBlockAssocDirective(
2740 OMPOrderedBlockAssocDirective *D) {
2741 VisitStmt(D);
2742 VisitOMPExecutableDirective(D);
2743}
2744
2745void ASTStmtReader::VisitOMPAtomicDirective(OMPAtomicDirective *D) {
2746 VisitStmt(D);
2747 VisitOMPExecutableDirective(D);
2748 D->Flags.IsXLHSInRHSPart = Record.readBool() ? 1 : 0;
2749 D->Flags.IsPostfixUpdate = Record.readBool() ? 1 : 0;
2750 D->Flags.IsFailOnly = Record.readBool() ? 1 : 0;
2751}
2752
2753void ASTStmtReader::VisitOMPTargetDirective(OMPTargetDirective *D) {
2754 VisitStmt(D);
2755 VisitOMPExecutableDirective(D);
2756}
2757
2758void ASTStmtReader::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) {
2759 VisitStmt(D);
2760 VisitOMPExecutableDirective(D);
2761}
2762
2763void ASTStmtReader::VisitOMPTargetEnterDataDirective(
2764 OMPTargetEnterDataDirective *D) {
2765 VisitStmt(D);
2766 VisitOMPExecutableDirective(D);
2767}
2768
2769void ASTStmtReader::VisitOMPTargetExitDataDirective(
2770 OMPTargetExitDataDirective *D) {
2771 VisitStmt(D);
2772 VisitOMPExecutableDirective(D);
2773}
2774
2775void ASTStmtReader::VisitOMPTargetParallelDirective(
2776 OMPTargetParallelDirective *D) {
2777 VisitStmt(D);
2778 VisitOMPExecutableDirective(D);
2779 D->setHasCancel(Record.readBool());
2780}
2781
2782void ASTStmtReader::VisitOMPTargetParallelForDirective(
2783 OMPTargetParallelForDirective *D) {
2784 VisitOMPLoopDirective(D);
2785 D->setHasCancel(Record.readBool());
2786}
2787
2788void ASTStmtReader::VisitOMPTeamsDirective(OMPTeamsDirective *D) {
2789 VisitStmt(D);
2790 VisitOMPExecutableDirective(D);
2791}
2792
2793void ASTStmtReader::VisitOMPCancellationPointDirective(
2794 OMPCancellationPointDirective *D) {
2795 VisitStmt(D);
2796 VisitOMPExecutableDirective(D);
2797 D->setCancelRegion(Record.readEnum<OpenMPDirectiveKind>());
2798}
2799
2800void ASTStmtReader::VisitOMPCancelDirective(OMPCancelDirective *D) {
2801 VisitStmt(D);
2802 VisitOMPExecutableDirective(D);
2803 D->setCancelRegion(Record.readEnum<OpenMPDirectiveKind>());
2804}
2805
2806void ASTStmtReader::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) {
2807 VisitOMPLoopDirective(D);
2808 D->setHasCancel(Record.readBool());
2809}
2810
2811void ASTStmtReader::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) {
2812 VisitOMPLoopDirective(D);
2813}
2814
2815void ASTStmtReader::VisitOMPMasterTaskLoopDirective(
2816 OMPMasterTaskLoopDirective *D) {
2817 VisitOMPLoopDirective(D);
2818 D->setHasCancel(Record.readBool());
2819}
2820
2821void ASTStmtReader::VisitOMPMaskedTaskLoopDirective(
2822 OMPMaskedTaskLoopDirective *D) {
2823 VisitOMPLoopDirective(D);
2824 D->setHasCancel(Record.readBool());
2825}
2826
2827void ASTStmtReader::VisitOMPMasterTaskLoopSimdDirective(
2828 OMPMasterTaskLoopSimdDirective *D) {
2829 VisitOMPLoopDirective(D);
2830}
2831
2832void ASTStmtReader::VisitOMPMaskedTaskLoopSimdDirective(
2833 OMPMaskedTaskLoopSimdDirective *D) {
2834 VisitOMPLoopDirective(D);
2835}
2836
2837void ASTStmtReader::VisitOMPParallelMasterTaskLoopDirective(
2838 OMPParallelMasterTaskLoopDirective *D) {
2839 VisitOMPLoopDirective(D);
2840 D->setHasCancel(Record.readBool());
2841}
2842
2843void ASTStmtReader::VisitOMPParallelMaskedTaskLoopDirective(
2844 OMPParallelMaskedTaskLoopDirective *D) {
2845 VisitOMPLoopDirective(D);
2846 D->setHasCancel(Record.readBool());
2847}
2848
2849void ASTStmtReader::VisitOMPParallelMasterTaskLoopSimdDirective(
2850 OMPParallelMasterTaskLoopSimdDirective *D) {
2851 VisitOMPLoopDirective(D);
2852}
2853
2854void ASTStmtReader::VisitOMPParallelMaskedTaskLoopSimdDirective(
2855 OMPParallelMaskedTaskLoopSimdDirective *D) {
2856 VisitOMPLoopDirective(D);
2857}
2858
2859void ASTStmtReader::VisitOMPDistributeDirective(OMPDistributeDirective *D) {
2860 VisitOMPLoopDirective(D);
2861}
2862
2863void ASTStmtReader::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) {
2864 VisitStmt(D);
2865 VisitOMPExecutableDirective(D);
2866}
2867
2868void ASTStmtReader::VisitOMPDistributeParallelForDirective(
2869 OMPDistributeParallelForDirective *D) {
2870 VisitOMPLoopDirective(D);
2871 D->setHasCancel(Record.readBool());
2872}
2873
2874void ASTStmtReader::VisitOMPDistributeParallelForSimdDirective(
2875 OMPDistributeParallelForSimdDirective *D) {
2876 VisitOMPLoopDirective(D);
2877}
2878
2879void ASTStmtReader::VisitOMPDistributeSimdDirective(
2880 OMPDistributeSimdDirective *D) {
2881 VisitOMPLoopDirective(D);
2882}
2883
2884void ASTStmtReader::VisitOMPTargetParallelForSimdDirective(
2885 OMPTargetParallelForSimdDirective *D) {
2886 VisitOMPLoopDirective(D);
2887}
2888
2889void ASTStmtReader::VisitOMPTargetSimdDirective(OMPTargetSimdDirective *D) {
2890 VisitOMPLoopDirective(D);
2891}
2892
2893void ASTStmtReader::VisitOMPTeamsDistributeDirective(
2894 OMPTeamsDistributeDirective *D) {
2895 VisitOMPLoopDirective(D);
2896}
2897
2898void ASTStmtReader::VisitOMPTeamsDistributeSimdDirective(
2899 OMPTeamsDistributeSimdDirective *D) {
2900 VisitOMPLoopDirective(D);
2901}
2902
2903void ASTStmtReader::VisitOMPTeamsDistributeParallelForSimdDirective(
2904 OMPTeamsDistributeParallelForSimdDirective *D) {
2905 VisitOMPLoopDirective(D);
2906}
2907
2908void ASTStmtReader::VisitOMPTeamsDistributeParallelForDirective(
2909 OMPTeamsDistributeParallelForDirective *D) {
2910 VisitOMPLoopDirective(D);
2911 D->setHasCancel(Record.readBool());
2912}
2913
2914void ASTStmtReader::VisitOMPTargetTeamsDirective(OMPTargetTeamsDirective *D) {
2915 VisitStmt(D);
2916 VisitOMPExecutableDirective(D);
2917}
2918
2919void ASTStmtReader::VisitOMPTargetTeamsDistributeDirective(
2920 OMPTargetTeamsDistributeDirective *D) {
2921 VisitOMPLoopDirective(D);
2922}
2923
2924void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForDirective(
2925 OMPTargetTeamsDistributeParallelForDirective *D) {
2926 VisitOMPLoopDirective(D);
2927 D->setHasCancel(Record.readBool());
2928}
2929
2930void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
2931 OMPTargetTeamsDistributeParallelForSimdDirective *D) {
2932 VisitOMPLoopDirective(D);
2933}
2934
2935void ASTStmtReader::VisitOMPTargetTeamsDistributeSimdDirective(
2936 OMPTargetTeamsDistributeSimdDirective *D) {
2937 VisitOMPLoopDirective(D);
2938}
2939
2940void ASTStmtReader::VisitOMPInteropDirective(OMPInteropDirective *D) {
2941 VisitStmt(D);
2942 VisitOMPExecutableDirective(D);
2943}
2944
2945void ASTStmtReader::VisitOMPDispatchDirective(OMPDispatchDirective *D) {
2946 VisitStmt(D);
2947 VisitOMPExecutableDirective(D);
2948 D->setTargetCallLoc(Record.readSourceLocation());
2949}
2950
2951void ASTStmtReader::VisitOMPMaskedDirective(OMPMaskedDirective *D) {
2952 VisitStmt(D);
2953 VisitOMPExecutableDirective(D);
2954}
2955
2956void ASTStmtReader::VisitOMPGenericLoopDirective(OMPGenericLoopDirective *D) {
2957 VisitOMPLoopDirective(D);
2958}
2959
2960void ASTStmtReader::VisitOMPTeamsGenericLoopDirective(
2961 OMPTeamsGenericLoopDirective *D) {
2962 VisitOMPLoopDirective(D);
2963}
2964
2965void ASTStmtReader::VisitOMPTargetTeamsGenericLoopDirective(
2966 OMPTargetTeamsGenericLoopDirective *D) {
2967 VisitOMPLoopDirective(D);
2968 D->setCanBeParallelFor(Record.readBool());
2969}
2970
2971void ASTStmtReader::VisitOMPParallelGenericLoopDirective(
2972 OMPParallelGenericLoopDirective *D) {
2973 VisitOMPLoopDirective(D);
2974}
2975
2976void ASTStmtReader::VisitOMPTargetParallelGenericLoopDirective(
2977 OMPTargetParallelGenericLoopDirective *D) {
2978 VisitOMPLoopDirective(D);
2979}
2980
2981void ASTStmtReader::VisitOMPTargetGenericLoopDirective(
2982 OMPTargetGenericLoopDirective *D) {
2983 VisitOMPLoopDirective(D);
2984}
2985
2986//===----------------------------------------------------------------------===//
2987// OpenACC Constructs/Directives.
2988//===----------------------------------------------------------------------===//
2989void ASTStmtReader::VisitOpenACCConstructStmt(OpenACCConstructStmt *S) {
2990 (void)Record.readInt();
2991 S->Kind = Record.readEnum<OpenACCDirectiveKind>();
2992 S->Range = Record.readSourceRange();
2993 S->DirectiveLoc = Record.readSourceLocation();
2994 Record.readOpenACCClauseList(S->Clauses);
2995}
2996
2997void ASTStmtReader::VisitOpenACCAssociatedStmtConstruct(
2999 VisitOpenACCConstructStmt(S);
3000 S->setAssociatedStmt(Record.readSubStmt());
3001}
3002
3003void ASTStmtReader::VisitOpenACCComputeConstruct(OpenACCComputeConstruct *S) {
3004 VisitStmt(S);
3005 VisitOpenACCAssociatedStmtConstruct(S);
3006}
3007
3008void ASTStmtReader::VisitOpenACCLoopConstruct(OpenACCLoopConstruct *S) {
3009 VisitStmt(S);
3010 VisitOpenACCAssociatedStmtConstruct(S);
3011 S->ParentComputeConstructKind = Record.readEnum<OpenACCDirectiveKind>();
3012}
3013
3014void ASTStmtReader::VisitOpenACCCombinedConstruct(OpenACCCombinedConstruct *S) {
3015 VisitStmt(S);
3016 VisitOpenACCAssociatedStmtConstruct(S);
3017}
3018
3019void ASTStmtReader::VisitOpenACCDataConstruct(OpenACCDataConstruct *S) {
3020 VisitStmt(S);
3021 VisitOpenACCAssociatedStmtConstruct(S);
3022}
3023
3024void ASTStmtReader::VisitOpenACCEnterDataConstruct(
3025 OpenACCEnterDataConstruct *S) {
3026 VisitStmt(S);
3027 VisitOpenACCConstructStmt(S);
3028}
3029
3030void ASTStmtReader::VisitOpenACCExitDataConstruct(OpenACCExitDataConstruct *S) {
3031 VisitStmt(S);
3032 VisitOpenACCConstructStmt(S);
3033}
3034
3035void ASTStmtReader::VisitOpenACCInitConstruct(OpenACCInitConstruct *S) {
3036 VisitStmt(S);
3037 VisitOpenACCConstructStmt(S);
3038}
3039
3040void ASTStmtReader::VisitOpenACCShutdownConstruct(OpenACCShutdownConstruct *S) {
3041 VisitStmt(S);
3042 VisitOpenACCConstructStmt(S);
3043}
3044
3045void ASTStmtReader::VisitOpenACCSetConstruct(OpenACCSetConstruct *S) {
3046 VisitStmt(S);
3047 VisitOpenACCConstructStmt(S);
3048}
3049
3050void ASTStmtReader::VisitOpenACCUpdateConstruct(OpenACCUpdateConstruct *S) {
3051 VisitStmt(S);
3052 VisitOpenACCConstructStmt(S);
3053}
3054
3055void ASTStmtReader::VisitOpenACCHostDataConstruct(OpenACCHostDataConstruct *S) {
3056 VisitStmt(S);
3057 VisitOpenACCAssociatedStmtConstruct(S);
3058}
3059
3060void ASTStmtReader::VisitOpenACCWaitConstruct(OpenACCWaitConstruct *S) {
3061 VisitStmt(S);
3062 // Consume the count of Expressions.
3063 (void)Record.readInt();
3064 VisitOpenACCConstructStmt(S);
3065 S->LParenLoc = Record.readSourceLocation();
3066 S->RParenLoc = Record.readSourceLocation();
3067 S->QueuesLoc = Record.readSourceLocation();
3068
3069 for (unsigned I = 0; I < S->NumExprs; ++I) {
3070 S->getExprPtr()[I] = cast_if_present<Expr>(Record.readSubStmt());
3071 assert((I == 0 || S->getExprPtr()[I] != nullptr) &&
3072 "Only first expression should be null");
3073 }
3074}
3075
3076void ASTStmtReader::VisitOpenACCCacheConstruct(OpenACCCacheConstruct *S) {
3077 VisitStmt(S);
3078 (void)Record.readInt();
3079 VisitOpenACCConstructStmt(S);
3080 S->ParensLoc = Record.readSourceRange();
3081 S->ReadOnlyLoc = Record.readSourceLocation();
3082 for (unsigned I = 0; I < S->NumVars; ++I)
3083 S->getVarList()[I] = cast<Expr>(Record.readSubStmt());
3084}
3085
3086void ASTStmtReader::VisitOpenACCAtomicConstruct(OpenACCAtomicConstruct *S) {
3087 VisitStmt(S);
3088 VisitOpenACCConstructStmt(S);
3089 S->AtomicKind = Record.readEnum<OpenACCAtomicKind>();
3090 S->setAssociatedStmt(Record.readSubStmt());
3091}
3092
3093//===----------------------------------------------------------------------===//
3094// HLSL Constructs/Directives.
3095//===----------------------------------------------------------------------===//
3096
3097void ASTStmtReader::VisitHLSLOutArgExpr(HLSLOutArgExpr *S) {
3098 VisitExpr(S);
3099 S->SubExprs[HLSLOutArgExpr::BaseLValue] = Record.readSubExpr();
3100 S->SubExprs[HLSLOutArgExpr::CastedTemporary] = Record.readSubExpr();
3101 S->SubExprs[HLSLOutArgExpr::WritebackCast] = Record.readSubExpr();
3102 S->IsInOut = Record.readBool();
3103}
3104
3105//===----------------------------------------------------------------------===//
3106// ASTReader Implementation
3107//===----------------------------------------------------------------------===//
3108
3110 switch (ReadingKind) {
3111 case Read_None:
3112 llvm_unreachable("should not call this when not reading anything");
3113 case Read_Decl:
3114 case Read_Type:
3115 return ReadStmtFromStream(F);
3116 case Read_Stmt:
3117 return ReadSubStmt();
3118 }
3119
3120 llvm_unreachable("ReadingKind not set ?");
3121}
3122
3124 return cast_or_null<Expr>(ReadStmt(F));
3125}
3126
3128 return cast_or_null<Expr>(ReadSubStmt());
3129}
3130
3131// Within the bitstream, expressions are stored in Reverse Polish
3132// Notation, with each of the subexpressions preceding the
3133// expression they are stored in. Subexpressions are stored from last to first.
3134// To evaluate expressions, we continue reading expressions and placing them on
3135// the stack, with expressions having operands removing those operands from the
3136// stack. Evaluation terminates when we see a STMT_STOP record, and
3137// the single remaining expression on the stack is our result.
3138Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) {
3139 ReadingKindTracker ReadingKind(Read_Stmt, *this);
3140 llvm::BitstreamCursor &Cursor = F.DeclsCursor;
3141
3142 // Map of offset to previously deserialized stmt. The offset points
3143 // just after the stmt record.
3144 llvm::DenseMap<uint64_t, Stmt *> StmtEntries;
3145
3146#ifndef NDEBUG
3147 unsigned PrevNumStmts = StmtStack.size();
3148#endif
3149
3150 ASTRecordReader Record(*this, F);
3151 ASTStmtReader Reader(Record, Cursor);
3153
3154 while (true) {
3156 Cursor.advanceSkippingSubblocks();
3157 if (!MaybeEntry) {
3158 Error(toString(MaybeEntry.takeError()));
3159 return nullptr;
3160 }
3161 llvm::BitstreamEntry Entry = MaybeEntry.get();
3162
3163 switch (Entry.Kind) {
3164 case llvm::BitstreamEntry::SubBlock: // Handled for us already.
3165 case llvm::BitstreamEntry::Error:
3166 Error("malformed block record in AST file");
3167 return nullptr;
3168 case llvm::BitstreamEntry::EndBlock:
3169 goto Done;
3170 case llvm::BitstreamEntry::Record:
3171 // The interesting case.
3172 break;
3173 }
3174
3175 ASTContext &Context = getContext();
3176 Stmt *S = nullptr;
3177 bool Finished = false;
3178 bool IsStmtReference = false;
3179 Expected<unsigned> MaybeStmtCode = Record.readRecord(Cursor, Entry.ID);
3180 if (!MaybeStmtCode) {
3181 Error(toString(MaybeStmtCode.takeError()));
3182 return nullptr;
3183 }
3184 switch ((StmtCode)MaybeStmtCode.get()) {
3185 case STMT_STOP:
3186 Finished = true;
3187 break;
3188
3189 case STMT_REF_PTR:
3190 IsStmtReference = true;
3191 assert(StmtEntries.contains(Record[0]) &&
3192 "No stmt was recorded for this offset reference!");
3193 S = StmtEntries[Record.readInt()];
3194 break;
3195
3196 case STMT_NULL_PTR:
3197 S = nullptr;
3198 break;
3199
3200 case STMT_NULL:
3201 S = new (Context) NullStmt(Empty);
3202 break;
3203
3204 case STMT_COMPOUND: {
3205 unsigned NumStmts = Record[ASTStmtReader::NumStmtFields];
3206 bool HasFPFeatures = Record[ASTStmtReader::NumStmtFields + 1];
3207 S = CompoundStmt::CreateEmpty(Context, NumStmts, HasFPFeatures);
3208 break;
3209 }
3210
3211 case STMT_CASE:
3213 Context,
3214 /*CaseStmtIsGNURange*/ Record[ASTStmtReader::NumStmtFields + 3]);
3215 break;
3216
3217 case STMT_DEFAULT:
3218 S = new (Context) DefaultStmt(Empty);
3219 break;
3220
3221 case STMT_LABEL:
3222 S = new (Context) LabelStmt(Empty);
3223 break;
3224
3225 case STMT_ATTRIBUTED:
3227 Context,
3229 break;
3230
3231 case STMT_IF: {
3232 BitsUnpacker IfStmtBits(Record[ASTStmtReader::NumStmtFields]);
3233 bool HasElse = IfStmtBits.getNextBit();
3234 bool HasVar = IfStmtBits.getNextBit();
3235 bool HasInit = IfStmtBits.getNextBit();
3236 S = IfStmt::CreateEmpty(Context, HasElse, HasVar, HasInit);
3237 break;
3238 }
3239
3240 case STMT_SWITCH:
3242 Context,
3244 /* HasVar=*/Record[ASTStmtReader::NumStmtFields + 1]);
3245 break;
3246
3247 case STMT_WHILE:
3249 Context,
3251 break;
3252
3253 case STMT_DO:
3254 S = new (Context) DoStmt(Empty);
3255 break;
3256
3257 case STMT_FOR:
3258 S = new (Context) ForStmt(Empty);
3259 break;
3260
3261 case STMT_GOTO:
3262 S = new (Context) GotoStmt(Empty);
3263 break;
3264
3265 case STMT_INDIRECT_GOTO:
3266 S = new (Context) IndirectGotoStmt(Empty);
3267 break;
3268
3269 case STMT_CONTINUE:
3270 S = new (Context) ContinueStmt(Empty);
3271 break;
3272
3273 case STMT_BREAK:
3274 S = new (Context) BreakStmt(Empty);
3275 break;
3276
3277 case STMT_DEFER:
3278 S = DeferStmt::CreateEmpty(Context, Empty);
3279 break;
3280
3281 case STMT_RETURN:
3283 Context, /* HasNRVOCandidate=*/Record[ASTStmtReader::NumStmtFields]);
3284 break;
3285
3286 case STMT_DECL:
3287 S = new (Context) DeclStmt(Empty);
3288 break;
3289
3290 case STMT_GCCASM:
3291 S = new (Context) GCCAsmStmt(Empty);
3292 break;
3293
3294 case STMT_MSASM:
3295 S = new (Context) MSAsmStmt(Empty);
3296 break;
3297
3298 case STMT_CAPTURED:
3301 break;
3302
3304 S = new (Context) SYCLKernelCallStmt(Empty);
3305 break;
3306
3307 case EXPR_CONSTANT:
3309 Context, static_cast<ConstantResultStorageKind>(
3310 /*StorageKind=*/Record[ASTStmtReader::NumExprFields]));
3311 break;
3312
3315 break;
3316
3319 break;
3320
3323 break;
3324
3325 case EXPR_PREDEFINED:
3327 Context,
3328 /*HasFunctionName*/ Record[ASTStmtReader::NumExprFields]);
3329 break;
3330
3331 case EXPR_DECL_REF: {
3332 BitsUnpacker DeclRefExprBits(Record[ASTStmtReader::NumExprFields]);
3333 DeclRefExprBits.advance(5);
3334 bool HasFoundDecl = DeclRefExprBits.getNextBit();
3335 bool HasQualifier = DeclRefExprBits.getNextBit();
3336 bool HasTemplateKWAndArgsInfo = DeclRefExprBits.getNextBit();
3337 unsigned NumTemplateArgs = HasTemplateKWAndArgsInfo
3339 : 0;
3340 S = DeclRefExpr::CreateEmpty(Context, HasQualifier, HasFoundDecl,
3341 HasTemplateKWAndArgsInfo, NumTemplateArgs);
3342 break;
3343 }
3344
3346 S = IntegerLiteral::Create(Context, Empty);
3347 break;
3348
3350 S = FixedPointLiteral::Create(Context, Empty);
3351 break;
3352
3354 S = FloatingLiteral::Create(Context, Empty);
3355 break;
3356
3358 S = new (Context) ImaginaryLiteral(Empty);
3359 break;
3360
3363 Context,
3364 /* NumConcatenated=*/Record[ASTStmtReader::NumExprFields],
3365 /* Length=*/Record[ASTStmtReader::NumExprFields + 1],
3366 /* CharByteWidth=*/Record[ASTStmtReader::NumExprFields + 2]);
3367 break;
3368
3370 S = new (Context) CharacterLiteral(Empty);
3371 break;
3372
3373 case EXPR_PAREN:
3374 S = new (Context) ParenExpr(Empty);
3375 break;
3376
3377 case EXPR_PAREN_LIST:
3379 Context,
3380 /* NumExprs=*/Record[ASTStmtReader::NumExprFields]);
3381 break;
3382
3383 case EXPR_UNARY_OPERATOR: {
3384 BitsUnpacker UnaryOperatorBits(Record[ASTStmtReader::NumStmtFields]);
3385 UnaryOperatorBits.advance(ASTStmtReader::NumExprBits);
3386 bool HasFPFeatures = UnaryOperatorBits.getNextBit();
3387 S = UnaryOperator::CreateEmpty(Context, HasFPFeatures);
3388 break;
3389 }
3390
3391 case EXPR_OFFSETOF:
3392 S = OffsetOfExpr::CreateEmpty(Context,
3395 break;
3396
3398 S = new (Context) UnaryExprOrTypeTraitExpr(Empty);
3399 break;
3400
3402 S = new (Context) ArraySubscriptExpr(Empty);
3403 break;
3404
3406 S = new (Context) MatrixSubscriptExpr(Empty);
3407 break;
3408
3409 case EXPR_ARRAY_SECTION:
3410 S = new (Context) ArraySectionExpr(Empty);
3411 break;
3412
3416 break;
3417
3418 case EXPR_OMP_ITERATOR:
3419 S = OMPIteratorExpr::CreateEmpty(Context,
3421 break;
3422
3423 case EXPR_CALL: {
3424 auto NumArgs = Record[ASTStmtReader::NumExprFields];
3425 BitsUnpacker CallExprBits(Record[ASTStmtReader::NumExprFields + 1]);
3426 CallExprBits.advance(1);
3427 auto HasFPFeatures = CallExprBits.getNextBit();
3428 S = CallExpr::CreateEmpty(Context, NumArgs, HasFPFeatures, Empty);
3429 break;
3430 }
3431
3432 case EXPR_RECOVERY:
3434 Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields]);
3435 break;
3436
3437 case EXPR_MEMBER: {
3438 BitsUnpacker ExprMemberBits(Record[ASTStmtReader::NumExprFields]);
3439 bool HasQualifier = ExprMemberBits.getNextBit();
3440 bool HasFoundDecl = ExprMemberBits.getNextBit();
3441 bool HasTemplateInfo = ExprMemberBits.getNextBit();
3442 unsigned NumTemplateArgs = Record[ASTStmtReader::NumExprFields + 1];
3443 S = MemberExpr::CreateEmpty(Context, HasQualifier, HasFoundDecl,
3444 HasTemplateInfo, NumTemplateArgs);
3445 break;
3446 }
3447
3448 case EXPR_BINARY_OPERATOR: {
3449 BitsUnpacker BinaryOperatorBits(Record[ASTStmtReader::NumExprFields]);
3450 BinaryOperatorBits.advance(/*Size of opcode*/ 6);
3451 bool HasFPFeatures = BinaryOperatorBits.getNextBit();
3452 S = BinaryOperator::CreateEmpty(Context, HasFPFeatures);
3453 break;
3454 }
3455
3457 BitsUnpacker BinaryOperatorBits(Record[ASTStmtReader::NumExprFields]);
3458 BinaryOperatorBits.advance(/*Size of opcode*/ 6);
3459 bool HasFPFeatures = BinaryOperatorBits.getNextBit();
3460 S = CompoundAssignOperator::CreateEmpty(Context, HasFPFeatures);
3461 break;
3462 }
3463
3465 S = new (Context) ConditionalOperator(Empty);
3466 break;
3467
3469 S = new (Context) BinaryConditionalOperator(Empty);
3470 break;
3471
3472 case EXPR_IMPLICIT_CAST: {
3473 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
3474 BitsUnpacker CastExprBits(Record[ASTStmtReader::NumExprFields + 1]);
3475 CastExprBits.advance(7);
3476 bool HasFPFeatures = CastExprBits.getNextBit();
3477 S = ImplicitCastExpr::CreateEmpty(Context, PathSize, HasFPFeatures);
3478 break;
3479 }
3480
3481 case EXPR_CSTYLE_CAST: {
3482 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
3483 BitsUnpacker CastExprBits(Record[ASTStmtReader::NumExprFields + 1]);
3484 CastExprBits.advance(7);
3485 bool HasFPFeatures = CastExprBits.getNextBit();
3486 S = CStyleCastExpr::CreateEmpty(Context, PathSize, HasFPFeatures);
3487 break;
3488 }
3489
3491 S = new (Context) CompoundLiteralExpr(Empty);
3492 break;
3493
3495 S = new (Context) ExtVectorElementExpr(Empty);
3496 break;
3497
3499 S = new (Context) MatrixElementExpr(Empty);
3500 break;
3501
3502 case EXPR_INIT_LIST:
3503 S = new (Context) InitListExpr(Empty);
3504 break;
3505
3509
3510 break;
3511
3513 S = new (Context) DesignatedInitUpdateExpr(Empty);
3514 break;
3515
3517 S = new (Context) ImplicitValueInitExpr(Empty);
3518 break;
3519
3520 case EXPR_NO_INIT:
3521 S = new (Context) NoInitExpr(Empty);
3522 break;
3523
3525 S = new (Context) ArrayInitLoopExpr(Empty);
3526 break;
3527
3529 S = new (Context) ArrayInitIndexExpr(Empty);
3530 break;
3531
3532 case EXPR_VA_ARG:
3533 S = new (Context) VAArgExpr(Empty);
3534 break;
3535
3536 case EXPR_SOURCE_LOC:
3537 S = new (Context) SourceLocExpr(Empty);
3538 break;
3539
3541 S = new (Context) EmbedExpr(Empty);
3542 break;
3543
3544 case EXPR_ADDR_LABEL:
3545 S = new (Context) AddrLabelExpr(Empty);
3546 break;
3547
3548 case EXPR_STMT:
3549 S = new (Context) StmtExpr(Empty);
3550 break;
3551
3552 case EXPR_CHOOSE:
3553 S = new (Context) ChooseExpr(Empty);
3554 break;
3555
3556 case EXPR_GNU_NULL:
3557 S = new (Context) GNUNullExpr(Empty);
3558 break;
3559
3561 S = new (Context) ShuffleVectorExpr(Empty);
3562 break;
3563
3564 case EXPR_CONVERT_VECTOR: {
3565 BitsUnpacker ConvertVectorExprBits(Record[ASTStmtReader::NumStmtFields]);
3566 ConvertVectorExprBits.advance(ASTStmtReader::NumExprBits);
3567 bool HasFPFeatures = ConvertVectorExprBits.getNextBit();
3568 S = ConvertVectorExpr::CreateEmpty(Context, HasFPFeatures);
3569 break;
3570 }
3571
3572 case EXPR_BLOCK:
3573 S = new (Context) BlockExpr(Empty);
3574 break;
3575
3578 Context,
3579 /*NumAssocs=*/Record[ASTStmtReader::NumExprFields]);
3580 break;
3581
3583 S = new (Context) ObjCStringLiteral(Empty);
3584 break;
3585
3587 S = new (Context) ObjCBoxedExpr(Empty);
3588 break;
3589
3593 break;
3594
3599 break;
3600
3601 case EXPR_OBJC_ENCODE:
3602 S = new (Context) ObjCEncodeExpr(Empty);
3603 break;
3604
3606 S = new (Context) ObjCSelectorExpr(Empty);
3607 break;
3608
3610 S = new (Context) ObjCProtocolExpr(Empty);
3611 break;
3612
3614 S = new (Context) ObjCIvarRefExpr(Empty);
3615 break;
3616
3618 S = new (Context) ObjCPropertyRefExpr(Empty);
3619 break;
3620
3622 S = new (Context) ObjCSubscriptRefExpr(Empty);
3623 break;
3624
3626 llvm_unreachable("mismatching AST file");
3627
3629 S = ObjCMessageExpr::CreateEmpty(Context,
3632 break;
3633
3634 case EXPR_OBJC_ISA:
3635 S = new (Context) ObjCIsaExpr(Empty);
3636 break;
3637
3639 S = new (Context) ObjCIndirectCopyRestoreExpr(Empty);
3640 break;
3641
3643 S = new (Context) ObjCBridgedCastExpr(Empty);
3644 break;
3645
3647 S = new (Context) ObjCForCollectionStmt(Empty);
3648 break;
3649
3650 case STMT_OBJC_CATCH:
3651 S = new (Context) ObjCAtCatchStmt(Empty);
3652 break;
3653
3654 case STMT_OBJC_FINALLY:
3655 S = new (Context) ObjCAtFinallyStmt(Empty);
3656 break;
3657
3658 case STMT_OBJC_AT_TRY:
3659 S = ObjCAtTryStmt::CreateEmpty(Context,
3662 break;
3663
3665 S = new (Context) ObjCAtSynchronizedStmt(Empty);
3666 break;
3667
3668 case STMT_OBJC_AT_THROW:
3669 S = new (Context) ObjCAtThrowStmt(Empty);
3670 break;
3671
3673 S = new (Context) ObjCAutoreleasePoolStmt(Empty);
3674 break;
3675
3677 S = new (Context) ObjCBoolLiteralExpr(Empty);
3678 break;
3679
3681 S = new (Context) ObjCAvailabilityCheckExpr(Empty);
3682 break;
3683
3684 case STMT_SEH_LEAVE:
3685 S = new (Context) SEHLeaveStmt(Empty);
3686 break;
3687
3688 case STMT_SEH_EXCEPT:
3689 S = new (Context) SEHExceptStmt(Empty);
3690 break;
3691
3692 case STMT_SEH_FINALLY:
3693 S = new (Context) SEHFinallyStmt(Empty);
3694 break;
3695
3696 case STMT_SEH_TRY:
3697 S = new (Context) SEHTryStmt(Empty);
3698 break;
3699
3700 case STMT_CXX_CATCH:
3701 S = new (Context) CXXCatchStmt(Empty);
3702 break;
3703
3704 case STMT_CXX_TRY:
3705 S = CXXTryStmt::Create(Context, Empty,
3706 /*numHandlers=*/Record[ASTStmtReader::NumStmtFields]);
3707 break;
3708
3711 Context, Empty,
3714 break;
3715
3720 break;
3721
3722 case STMT_CXX_FOR_RANGE:
3723 S = new (Context) CXXForRangeStmt(Empty);
3724 break;
3725
3727 S = new (Context) MSDependentExistsStmt(SourceLocation(), true,
3728 NestedNameSpecifierLoc(),
3729 DeclarationNameInfo(),
3730 nullptr);
3731 break;
3732
3734 S = OMPCanonicalLoop::createEmpty(Context);
3735 break;
3736
3740 break;
3741
3743 S =
3744 OMPParallelDirective::CreateEmpty(Context,
3746 Empty);
3747 break;
3748
3750 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3751 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3752 S = OMPSimdDirective::CreateEmpty(Context, NumClauses,
3753 CollapsedNum, Empty);
3754 break;
3755 }
3756
3758 unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
3759 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3760 S = OMPTileDirective::CreateEmpty(Context, NumClauses, NumLoops);
3761 break;
3762 }
3763
3765 unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
3766 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3767 S = OMPStripeDirective::CreateEmpty(Context, NumClauses, NumLoops);
3768 break;
3769 }
3770
3772 assert(Record[ASTStmtReader::NumStmtFields] == 1 && "Unroll directive accepts only a single loop");
3773 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3774 S = OMPUnrollDirective::CreateEmpty(Context, NumClauses);
3775 break;
3776 }
3777
3779 unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
3780 assert(Record[ASTStmtReader::NumStmtFields + 1] == 0 &&
3781 "Reverse directive has no clauses");
3782 S = OMPReverseDirective::CreateEmpty(Context, NumLoops);
3783 break;
3784 }
3785
3787 unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
3788 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3789 S = OMPSplitDirective::CreateEmpty(Context, NumClauses, NumLoops);
3790 break;
3791 }
3792
3794 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3795 S = OMPFuseDirective::CreateEmpty(Context, NumClauses);
3796 break;
3797 }
3798
3800 unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
3801 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3802 S = OMPInterchangeDirective::CreateEmpty(Context, NumClauses, NumLoops);
3803 break;
3804 }
3805
3807 unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
3808 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3809 S = OMPFlattenDirective::CreateEmpty(Context, NumClauses, NumLoops);
3810 break;
3811 }
3812
3814 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3815 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3816 S = OMPForDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3817 Empty);
3818 break;
3819 }
3820
3822 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3823 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3824 S = OMPForSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3825 Empty);
3826 break;
3827 }
3828
3832 break;
3833
3836 break;
3837
3841 break;
3842
3846 break;
3847
3850 break;
3851
3855 break;
3856
3858 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3859 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3860 S = OMPParallelForDirective::CreateEmpty(Context, NumClauses,
3861 CollapsedNum, Empty);
3862 break;
3863 }
3864
3866 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3867 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3868 S = OMPParallelForSimdDirective::CreateEmpty(Context, NumClauses,
3869 CollapsedNum, Empty);
3870 break;
3871 }
3872
3876 break;
3877
3881 break;
3882
3886 break;
3887
3891 break;
3892
3895 break;
3896
3899 break;
3900
3904 break;
3905
3909 break;
3910
3914 break;
3915
3919 break;
3920
3924 break;
3925
3929 break;
3930
3932 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3933 S = OMPOrderedStandaloneDirective::CreateEmpty(Context, NumClauses,
3934 Empty);
3935 break;
3936 }
3937
3939 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3940 S = OMPOrderedBlockAssocDirective::CreateEmpty(Context, NumClauses,
3941 Empty);
3942 break;
3943 }
3944
3948 break;
3949
3953 break;
3954
3958 break;
3959
3963 break;
3964
3968 break;
3969
3973 break;
3974
3976 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3977 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3978 S = OMPTargetParallelForDirective::CreateEmpty(Context, NumClauses,
3979 CollapsedNum, Empty);
3980 break;
3981 }
3982
3986 break;
3987
3991 break;
3992
3995 break;
3996
4000 break;
4001
4003 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4004 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4005 S = OMPTaskLoopDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
4006 Empty);
4007 break;
4008 }
4009
4011 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4012 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4013 S = OMPTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
4014 CollapsedNum, Empty);
4015 break;
4016 }
4017
4019 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4020 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4021 S = OMPMasterTaskLoopDirective::CreateEmpty(Context, NumClauses,
4022 CollapsedNum, Empty);
4023 break;
4024 }
4025
4027 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4028 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4029 S = OMPMaskedTaskLoopDirective::CreateEmpty(Context, NumClauses,
4030 CollapsedNum, Empty);
4031 break;
4032 }
4033
4035 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4036 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4037 S = OMPMasterTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
4038 CollapsedNum, Empty);
4039 break;
4040 }
4041
4043 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4044 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4045 S = OMPMaskedTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
4046 CollapsedNum, Empty);
4047 break;
4048 }
4049
4051 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4052 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4054 CollapsedNum, Empty);
4055 break;
4056 }
4057
4059 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4060 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4062 CollapsedNum, Empty);
4063 break;
4064 }
4065
4067 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4068 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4070 Context, NumClauses, CollapsedNum, Empty);
4071 break;
4072 }
4073
4075 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4076 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4078 Context, NumClauses, CollapsedNum, Empty);
4079 break;
4080 }
4081
4083 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4084 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4085 S = OMPDistributeDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
4086 Empty);
4087 break;
4088 }
4089
4091 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4092 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4093 S = OMPDistributeParallelForDirective::CreateEmpty(Context, NumClauses,
4094 CollapsedNum, Empty);
4095 break;
4096 }
4097
4099 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4100 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4102 CollapsedNum,
4103 Empty);
4104 break;
4105 }
4106
4108 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4109 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4110 S = OMPDistributeSimdDirective::CreateEmpty(Context, NumClauses,
4111 CollapsedNum, Empty);
4112 break;
4113 }
4114
4116 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4117 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4118 S = OMPTargetParallelForSimdDirective::CreateEmpty(Context, NumClauses,
4119 CollapsedNum, Empty);
4120 break;
4121 }
4122
4124 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4125 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4126 S = OMPTargetSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
4127 Empty);
4128 break;
4129 }
4130
4132 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4133 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4134 S = OMPTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
4135 CollapsedNum, Empty);
4136 break;
4137 }
4138
4140 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4141 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4142 S = OMPTeamsDistributeSimdDirective::CreateEmpty(Context, NumClauses,
4143 CollapsedNum, Empty);
4144 break;
4145 }
4146
4148 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4149 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4151 Context, NumClauses, 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
4166 break;
4167
4169 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4170 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4171 S = OMPTargetTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
4172 CollapsedNum, Empty);
4173 break;
4174 }
4175
4177 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4178 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4180 Context, NumClauses, CollapsedNum, Empty);
4181 break;
4182 }
4183
4185 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4186 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4188 Context, NumClauses, CollapsedNum, Empty);
4189 break;
4190 }
4191
4193 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4194 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4196 Context, NumClauses, CollapsedNum, Empty);
4197 break;
4198 }
4199
4203 break;
4204
4208 break;
4209
4213 break;
4214
4216 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4217 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4218 S = OMPGenericLoopDirective::CreateEmpty(Context, NumClauses,
4219 CollapsedNum, Empty);
4220 break;
4221 }
4222
4224 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4225 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4226 S = OMPTeamsGenericLoopDirective::CreateEmpty(Context, NumClauses,
4227 CollapsedNum, Empty);
4228 break;
4229 }
4230
4232 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4233 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4235 CollapsedNum, Empty);
4236 break;
4237 }
4238
4240 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4241 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4242 S = OMPParallelGenericLoopDirective::CreateEmpty(Context, NumClauses,
4243 CollapsedNum, Empty);
4244 break;
4245 }
4246
4248 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4249 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4251 Context, NumClauses, CollapsedNum, Empty);
4252 break;
4253 }
4254
4256 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4257 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4258 S = OMPTargetGenericLoopDirective::CreateEmpty(Context, NumClauses,
4259 CollapsedNum, Empty);
4260 break;
4261 }
4262
4264 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4265 S = OMPAssumeDirective::CreateEmpty(Context, NumClauses, Empty);
4266 break;
4267 }
4268
4270 auto NumArgs = Record[ASTStmtReader::NumExprFields];
4271 BitsUnpacker CallExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4272 CallExprBits.advance(1);
4273 auto HasFPFeatures = CallExprBits.getNextBit();
4274 S = CXXOperatorCallExpr::CreateEmpty(Context, NumArgs, HasFPFeatures,
4275 Empty);
4276 break;
4277 }
4278
4279 case EXPR_CXX_MEMBER_CALL: {
4280 auto NumArgs = Record[ASTStmtReader::NumExprFields];
4281 BitsUnpacker CallExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4282 CallExprBits.advance(1);
4283 auto HasFPFeatures = CallExprBits.getNextBit();
4284 S = CXXMemberCallExpr::CreateEmpty(Context, NumArgs, HasFPFeatures,
4285 Empty);
4286 break;
4287 }
4288
4290 S = new (Context) CXXRewrittenBinaryOperator(Empty);
4291 break;
4292
4293 case EXPR_CXX_CONSTRUCT:
4295 Context,
4296 /* NumArgs=*/Record[ASTStmtReader::NumExprFields]);
4297 break;
4298
4300 S = new (Context) CXXInheritedCtorInitExpr(Empty);
4301 break;
4302
4305 Context,
4306 /* NumArgs=*/Record[ASTStmtReader::NumExprFields]);
4307 break;
4308
4309 case EXPR_CXX_STATIC_CAST: {
4310 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
4311 BitsUnpacker CastExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4312 CastExprBits.advance(7);
4313 bool HasFPFeatures = CastExprBits.getNextBit();
4314 S = CXXStaticCastExpr::CreateEmpty(Context, PathSize, HasFPFeatures);
4315 break;
4316 }
4317
4318 case EXPR_CXX_DYNAMIC_CAST: {
4319 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
4320 S = CXXDynamicCastExpr::CreateEmpty(Context, PathSize);
4321 break;
4322 }
4323
4325 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
4326 S = CXXReinterpretCastExpr::CreateEmpty(Context, PathSize);
4327 break;
4328 }
4329
4331 S = CXXConstCastExpr::CreateEmpty(Context);
4332 break;
4333
4336 break;
4337
4339 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
4340 BitsUnpacker CastExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4341 CastExprBits.advance(7);
4342 bool HasFPFeatures = CastExprBits.getNextBit();
4343 S = CXXFunctionalCastExpr::CreateEmpty(Context, PathSize, HasFPFeatures);
4344 break;
4345 }
4346
4347 case EXPR_BUILTIN_BIT_CAST: {
4348#ifndef NDEBUG
4349 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
4350 assert(PathSize == 0 && "Wrong PathSize!");
4351#endif
4352 S = new (Context) BuiltinBitCastExpr(Empty);
4353 break;
4354 }
4355
4357 auto NumArgs = Record[ASTStmtReader::NumExprFields];
4358 BitsUnpacker CallExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4359 CallExprBits.advance(1);
4360 auto HasFPFeatures = CallExprBits.getNextBit();
4361 S = UserDefinedLiteral::CreateEmpty(Context, NumArgs, HasFPFeatures,
4362 Empty);
4363 break;
4364 }
4365
4367 S = new (Context) CXXStdInitializerListExpr(Empty);
4368 break;
4369
4371 S = new (Context) CXXBoolLiteralExpr(Empty);
4372 break;
4373
4375 S = new (Context) CXXNullPtrLiteralExpr(Empty);
4376 break;
4377
4379 S = new (Context) CXXTypeidExpr(Empty, true);
4380 break;
4381
4383 S = new (Context) CXXTypeidExpr(Empty, false);
4384 break;
4385
4387 S = new (Context) CXXUuidofExpr(Empty, true);
4388 break;
4389
4391 S = new (Context) MSPropertyRefExpr(Empty);
4392 break;
4393
4395 S = new (Context) MSPropertySubscriptExpr(Empty);
4396 break;
4397
4399 S = new (Context) CXXUuidofExpr(Empty, false);
4400 break;
4401
4402 case EXPR_CXX_THIS:
4403 S = CXXThisExpr::CreateEmpty(Context);
4404 break;
4405
4406 case EXPR_CXX_THROW:
4407 S = new (Context) CXXThrowExpr(Empty);
4408 break;
4409
4412 Context, /*HasRewrittenInit=*/Record[ASTStmtReader::NumExprFields]);
4413 break;
4414
4417 Context, /*HasRewrittenInit=*/Record[ASTStmtReader::NumExprFields]);
4418 break;
4419
4421 S = new (Context) CXXBindTemporaryExpr(Empty);
4422 break;
4423
4425 S = new (Context) CXXScalarValueInitExpr(Empty);
4426 break;
4427
4428 case EXPR_CXX_NEW:
4430 Context,
4432 /*HasInit=*/Record[ASTStmtReader::NumExprFields + 1],
4433 /*NumPlacementArgs=*/Record[ASTStmtReader::NumExprFields + 2],
4434 /*IsParenTypeId=*/Record[ASTStmtReader::NumExprFields + 3]);
4435 break;
4436
4437 case EXPR_CXX_DELETE:
4438 S = new (Context) CXXDeleteExpr(Empty);
4439 break;
4440
4442 S = new (Context) CXXPseudoDestructorExpr(Empty);
4443 break;
4444
4446 S = ExprWithCleanups::Create(Context, Empty,
4448 break;
4449
4451 unsigned NumTemplateArgs = Record[ASTStmtReader::NumExprFields];
4452 BitsUnpacker DependentScopeMemberBits(
4454 bool HasTemplateKWAndArgsInfo = DependentScopeMemberBits.getNextBit();
4455
4456 bool HasFirstQualifierFoundInScope =
4457 DependentScopeMemberBits.getNextBit();
4459 Context, HasTemplateKWAndArgsInfo, NumTemplateArgs,
4460 HasFirstQualifierFoundInScope);
4461 break;
4462 }
4463
4466 Context, /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]);
4467 break;
4468
4470 BitsUnpacker DependentScopeDeclRefBits(
4472 DependentScopeDeclRefBits.advance(ASTStmtReader::NumExprBits);
4473 bool HasTemplateKWAndArgsInfo = DependentScopeDeclRefBits.getNextBit();
4474 unsigned NumTemplateArgs =
4475 HasTemplateKWAndArgsInfo
4476 ? DependentScopeDeclRefBits.getNextBits(/*Width=*/16)
4477 : 0;
4479 Context, HasTemplateKWAndArgsInfo, NumTemplateArgs);
4480 break;
4481 }
4482
4486 break;
4487
4489 auto NumResults = Record[ASTStmtReader::NumExprFields];
4490 BitsUnpacker OverloadExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4491 auto HasTemplateKWAndArgsInfo = OverloadExprBits.getNextBit();
4492 auto NumTemplateArgs = HasTemplateKWAndArgsInfo
4494 : 0;
4496 Context, NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
4497 break;
4498 }
4499
4501 auto NumResults = Record[ASTStmtReader::NumExprFields];
4502 BitsUnpacker OverloadExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4503 auto HasTemplateKWAndArgsInfo = OverloadExprBits.getNextBit();
4504 auto NumTemplateArgs = HasTemplateKWAndArgsInfo
4506 : 0;
4508 Context, NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
4509 break;
4510 }
4511
4512 case EXPR_TYPE_TRAIT:
4516 break;
4517
4519 S = new (Context) ArrayTypeTraitExpr(Empty);
4520 break;
4521
4523 S = new (Context) ExpressionTraitExpr(Empty);
4524 break;
4525
4526 case EXPR_CXX_NOEXCEPT:
4527 S = new (Context) CXXNoexceptExpr(Empty);
4528 break;
4529
4531 S = new (Context) PackExpansionExpr(Empty);
4532 break;
4533
4534 case EXPR_SIZEOF_PACK:
4536 Context,
4537 /*NumPartialArgs=*/Record[ASTStmtReader::NumExprFields]);
4538 break;
4539
4540 case EXPR_PACK_INDEXING:
4542 Context,
4543 /*TransformedExprs=*/Record[ASTStmtReader::NumExprFields]);
4544 break;
4545
4547 S = new (Context) SubstNonTypeTemplateParmExpr(Empty);
4548 break;
4549
4551 S = new (Context) SubstNonTypeTemplateParmPackExpr(Empty);
4552 break;
4553
4557 break;
4558
4560 S = new (Context) MaterializeTemporaryExpr(Empty);
4561 break;
4562
4563 case EXPR_CXX_FOLD:
4564 S = new (Context) CXXFoldExpr(Empty);
4565 break;
4566
4569 Context, /*numExprs=*/Record[ASTStmtReader::NumExprFields], Empty);
4570 break;
4571
4572 case EXPR_OPAQUE_VALUE:
4573 S = new (Context) OpaqueValueExpr(Empty);
4574 break;
4575
4576 case EXPR_CUDA_KERNEL_CALL: {
4577 auto NumArgs = Record[ASTStmtReader::NumExprFields];
4578 BitsUnpacker CallExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4579 CallExprBits.advance(1);
4580 auto HasFPFeatures = CallExprBits.getNextBit();
4581 S = CUDAKernelCallExpr::CreateEmpty(Context, NumArgs, HasFPFeatures,
4582 Empty);
4583 break;
4584 }
4585
4586 case EXPR_ASTYPE:
4587 S = new (Context) AsTypeExpr(Empty);
4588 break;
4589
4590 case EXPR_PSEUDO_OBJECT: {
4591 unsigned numSemanticExprs = Record[ASTStmtReader::NumExprFields];
4592 S = PseudoObjectExpr::Create(Context, Empty, numSemanticExprs);
4593 break;
4594 }
4595
4596 case EXPR_ATOMIC:
4597 S = new (Context) AtomicExpr(Empty);
4598 break;
4599
4600 case EXPR_LAMBDA: {
4601 unsigned NumCaptures = Record[ASTStmtReader::NumExprFields];
4602 S = LambdaExpr::CreateDeserialized(Context, NumCaptures);
4603 break;
4604 }
4605
4606 case STMT_COROUTINE_BODY: {
4607 unsigned NumParams = Record[ASTStmtReader::NumStmtFields];
4608 S = CoroutineBodyStmt::Create(Context, Empty, NumParams);
4609 break;
4610 }
4611
4612 case STMT_CORETURN:
4613 S = new (Context) CoreturnStmt(Empty);
4614 break;
4615
4616 case EXPR_COAWAIT:
4617 S = new (Context) CoawaitExpr(Empty);
4618 break;
4619
4620 case EXPR_COYIELD:
4621 S = new (Context) CoyieldExpr(Empty);
4622 break;
4623
4625 S = new (Context) DependentCoawaitExpr(Empty);
4626 break;
4627
4629 S = new (Context) ConceptSpecializationExpr(Empty);
4630 break;
4631 }
4632
4634 S = new (Context) CXXExpansionSelectExpr(Empty);
4635 break;
4636
4638 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4639 S = OpenACCComputeConstruct::CreateEmpty(Context, NumClauses);
4640 break;
4641 }
4643 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4644 S = OpenACCLoopConstruct::CreateEmpty(Context, NumClauses);
4645 break;
4646 }
4648 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4649 S = OpenACCCombinedConstruct::CreateEmpty(Context, NumClauses);
4650 break;
4651 }
4653 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4654 S = OpenACCDataConstruct::CreateEmpty(Context, NumClauses);
4655 break;
4656 }
4658 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4659 S = OpenACCEnterDataConstruct::CreateEmpty(Context, NumClauses);
4660 break;
4661 }
4663 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4664 S = OpenACCExitDataConstruct::CreateEmpty(Context, NumClauses);
4665 break;
4666 }
4668 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4669 S = OpenACCHostDataConstruct::CreateEmpty(Context, NumClauses);
4670 break;
4671 }
4673 unsigned NumExprs = Record[ASTStmtReader::NumStmtFields];
4674 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4675 S = OpenACCWaitConstruct::CreateEmpty(Context, NumExprs, NumClauses);
4676 break;
4677 }
4679 unsigned NumVars = Record[ASTStmtReader::NumStmtFields];
4680 S = OpenACCCacheConstruct::CreateEmpty(Context, NumVars);
4681 break;
4682 }
4684 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4685 S = OpenACCInitConstruct::CreateEmpty(Context, NumClauses);
4686 break;
4687 }
4689 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4690 S = OpenACCShutdownConstruct::CreateEmpty(Context, NumClauses);
4691 break;
4692 }
4694 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4695 S = OpenACCSetConstruct::CreateEmpty(Context, NumClauses);
4696 break;
4697 }
4699 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4700 S = OpenACCUpdateConstruct::CreateEmpty(Context, NumClauses);
4701 break;
4702 }
4704 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4705 S = OpenACCAtomicConstruct::CreateEmpty(Context, NumClauses);
4706 break;
4707 }
4708 case EXPR_REQUIRES: {
4709 unsigned numLocalParameters = Record[ASTStmtReader::NumExprFields];
4710 unsigned numRequirement = Record[ASTStmtReader::NumExprFields + 1];
4711 S = RequiresExpr::Create(Context, Empty, numLocalParameters,
4712 numRequirement);
4713 break;
4714 }
4715 case EXPR_HLSL_OUT_ARG:
4716 S = HLSLOutArgExpr::CreateEmpty(Context);
4717 break;
4718 case EXPR_REFLECT: {
4719 S = CXXReflectExpr::CreateEmpty(Context);
4720 break;
4721 }
4722 }
4723
4724 // We hit a STMT_STOP, so we're done with this expression.
4725 if (Finished)
4726 break;
4727
4728 ++NumStatementsRead;
4729
4730 if (S && !IsStmtReference) {
4731 Reader.Visit(S);
4732 StmtEntries[Cursor.GetCurrentBitNo()] = S;
4733 }
4734
4735 assert(Record.getIdx() == Record.size() &&
4736 "Invalid deserialization of statement");
4737 StmtStack.push_back(S);
4738 }
4739Done:
4740 assert(StmtStack.size() > PrevNumStmts && "Read too many sub-stmts!");
4741 assert(StmtStack.size() == PrevNumStmts + 1 && "Extra expressions on stack!");
4742 return StmtStack.pop_back_val();
4743}
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 NumVariants, 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 OMPTargetGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses 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:500
static ASTConstraintSatisfaction * Create(const ASTContext &C, const ConstraintSatisfaction &Satisfaction)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition ASTContext.h:245
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:2618
Stmt * ReadSubStmt()
Reads a sub-statement operand during statement reading.
Definition ASTReader.h:2573
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:4619
void setLabel(LabelDecl *L)
Definition Expr.h:4643
void setLabelLoc(SourceLocation L)
Definition Expr.h:4637
void setAmpAmpLoc(SourceLocation L)
Definition Expr.h:4635
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Definition Expr.h:6107
Represents a loop initializing the elements of an array.
Definition Expr.h:6054
This class represents BOTH the OpenMP Array Section and OpenACC 'subarray', with a boolean differenti...
Definition Expr.h:7305
bool isOMPArraySection() const
Definition Expr.h:7379
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition Expr.h:2790
void setRHS(Expr *E)
Definition Expr.h:2825
void setRBracketLoc(SourceLocation L)
Definition Expr.h:2841
void setLHS(Expr *E)
Definition Expr.h:2821
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
Definition ExprCXX.h:3011
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Definition Expr.h:6819
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
Definition Stmt.h:3290
void setSimple(bool V)
Definition Stmt.h:3324
void setAsmLoc(SourceLocation L)
Definition Stmt.h:3321
void setVolatile(bool V)
Definition Stmt.h:3327
unsigned NumInputs
Definition Stmt.h:3305
unsigned getNumClobbers() const
Definition Stmt.h:3381
unsigned getNumOutputs() const
Definition Stmt.h:3349
unsigned NumOutputs
Definition Stmt.h:3304
unsigned NumClobbers
Definition Stmt.h:3306
unsigned getNumInputs() const
Definition Stmt.h:3371
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Definition Expr.h:7014
unsigned getNumSubExprs() const
Definition Expr.h:7087
Represents an attribute applied to a statement.
Definition Stmt.h:2214
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:4522
A builtin binary operation expression such as "x + y" or "x <= y".
Definition Expr.h:4107
void setLHS(Expr *E)
Definition Expr.h:4158
void setHasStoredFPFeatures(bool B)
Set and fetch the bit that shows whether FPFeatures needs to be allocated in Trailing Storage.
Definition Expr.h:4291
void setOperatorLoc(SourceLocation L)
Definition Expr.h:4150
void setRHS(Expr *E)
Definition Expr.h:4160
void setExcludedOverflowPattern(bool B)
Set and get the bit that informs arithmetic overflow sanitizers whether or not they should exclude ce...
Definition Expr.h:4296
static BinaryOperator * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
Definition Expr.cpp:5136
void setStoredFPFeatures(FPOptionsOverride F)
Set FPFeatures in trailing storage, used only by Serialization.
Definition Expr.h:4309
void setOpcode(Opcode Opc)
Definition Expr.h:4155
BinaryOperatorKind Opcode
Definition Expr.h:4112
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition Expr.h:6758
void setBlockDecl(BlockDecl *BD)
Definition Expr.h:6772
BreakStmt - This represents a break.
Definition Stmt.h:3148
Represents a C++2a __builtin_bit_cast(T, v) expression.
Definition ExprCXX.h:5530
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr....
Definition Expr.h:4038
static CStyleCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize, bool HasFPFeatures)
Definition Expr.cpp:2159
void setRParenLoc(SourceLocation L)
Definition Expr.h:4074
void setLParenLoc(SourceLocation L)
Definition Expr.h:4071
Represents a call to a CUDA kernel function.
Definition ExprCXX.h:239
static CUDAKernelCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPFeatures, EmptyShell Empty)
Definition ExprCXX.cpp:2023
A C++ addrspace_cast expression (currently only enabled for OpenCL).
Definition ExprCXX.h:609
static CXXAddrspaceCastExpr * CreateEmpty(const ASTContext &Context)
Definition ExprCXX.cpp:946
Represents binding an expression to a temporary.
Definition ExprCXX.h:1498
void setTemporary(CXXTemporary *T)
Definition ExprCXX.h:1518
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition ExprCXX.h:728
void setValue(bool V)
Definition ExprCXX.h:746
void setLocation(SourceLocation L)
Definition ExprCXX.h:752
CXXCatchStmt - This represents a C++ catch block.
Definition StmtCXX.h:29
A C++ const_cast expression (C++ [expr.const.cast]).
Definition ExprCXX.h:571
static CXXConstCastExpr * CreateEmpty(const ASTContext &Context)
Definition ExprCXX.cpp:933
Represents a call to a C++ constructor.
Definition ExprCXX.h:1553
void setArg(unsigned Arg, Expr *ArgExpr)
Set the specified argument.
Definition ExprCXX.h:1706
unsigned getNumArgs() const
Return the number of arguments to the constructor call.
Definition ExprCXX.h:1693
static CXXConstructExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs)
Create an empty C++ construction expression.
Definition ExprCXX.cpp:1227
A default argument (C++ [dcl.fct.default]).
Definition ExprCXX.h:1275
static CXXDefaultArgExpr * CreateEmpty(const ASTContext &C, bool HasRewrittenInit)
Definition ExprCXX.cpp:1064
A use of a default initializer in a constructor or in aggregate initialization.
Definition ExprCXX.h:1382
static CXXDefaultInitExpr * CreateEmpty(const ASTContext &C, bool HasRewrittenInit)
Definition ExprCXX.cpp:1118
Represents a delete expression for memory deallocation and destructor calls, e.g.
Definition ExprCXX.h:2631
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition ExprCXX.h:3924
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition ExprCXX.h:4118
static CXXDependentScopeMemberExpr * CreateEmpty(const ASTContext &Ctx, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs, bool HasFirstQualifierFoundInScope)
Definition ExprCXX.cpp:1602
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Definition ExprCXX.h:486
static CXXDynamicCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
Definition ExprCXX.cpp:856
Helper that selects an expression from an InitListExpr depending on the current expansion index.
Definition ExprCXX.h:5622
void setRangeExpr(InitListExpr *E)
Definition ExprCXX.h:5638
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:5086
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:1836
void setLParenLoc(SourceLocation L)
Definition ExprCXX.h:1874
static CXXFunctionalCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize, bool HasFPFeatures)
Definition ExprCXX.cpp:966
void setRParenLoc(SourceLocation L)
Definition ExprCXX.h:1876
Represents a call to an inherited base class constructor from an inheriting constructor.
Definition ExprCXX.h:1756
Represents a call to a member function that may be written either with member call syntax (e....
Definition ExprCXX.h:184
static CXXMemberCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPFeatures, EmptyShell Empty)
Definition ExprCXX.cpp:741
Abstract class common to all of the C++ "named"/"keyword" casts.
Definition ExprCXX.h:380
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Definition ExprCXX.h:2360
static CXXNewExpr * CreateEmpty(const ASTContext &Ctx, bool IsArray, bool HasInit, unsigned NumPlacementArgs, bool IsParenTypeId)
Create an empty c++ new expression.
Definition ExprCXX.cpp:322
bool isArray() const
Definition ExprCXX.h:2469
bool hasInitializer() const
Whether this new-expression has any initializer at all.
Definition ExprCXX.h:2529
Stmt ** raw_arg_iterator
Definition ExprCXX.h:2598
void setOperatorDelete(FunctionDecl *D)
Definition ExprCXX.h:2467
unsigned getNumPlacementArgs() const
Definition ExprCXX.h:2499
bool isParenTypeId() const
Definition ExprCXX.h:2520
raw_arg_iterator raw_arg_end()
Definition ExprCXX.h:2601
raw_arg_iterator raw_arg_begin()
Definition ExprCXX.h:2600
void setOperatorNew(FunctionDecl *D)
Definition ExprCXX.h:2465
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition ExprCXX.h:4363
The null pointer literal (C++11 [lex.nullptr])
Definition ExprCXX.h:773
void setLocation(SourceLocation L)
Definition ExprCXX.h:788
A call to an overloaded operator written using operator syntax.
Definition ExprCXX.h:86
static CXXOperatorCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPFeatures, EmptyShell Empty)
Definition ExprCXX.cpp:671
Represents a list-initialization with parenthesis.
Definition ExprCXX.h:5195
void setInitializedFieldInUnion(FieldDecl *FD)
Definition ExprCXX.h:5269
static CXXParenListInitExpr * CreateEmpty(ASTContext &C, unsigned numExprs, EmptyShell Empty)
Definition ExprCXX.cpp:2047
void setArrayFiller(Expr *E)
Definition ExprCXX.h:5259
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition ExprCXX.h:2750
void setDestroyedType(IdentifierInfo *II, SourceLocation Loc)
Set the name of destroyed type for a dependent pseudo-destructor expression.
Definition ExprCXX.h:2865
Represents a C++26 reflect expression [expr.reflect].
Definition ExprCXX.h:5562
static CXXReflectExpr * CreateEmpty(ASTContext &C)
Definition ExprCXX.cpp:1989
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
Definition ExprCXX.h:531
static CXXReinterpretCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
Definition ExprCXX.cpp:919
A rewritten comparison expression that was originally written using operator syntax.
Definition ExprCXX.h:291
An expression "T()" which creates an rvalue of a non-class type T.
Definition ExprCXX.h:2201
A C++ static_cast expression (C++ [expr.static.cast]).
Definition ExprCXX.h:441
static CXXStaticCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize, bool hasFPFeatures)
Definition ExprCXX.cpp:829
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition ExprCXX.h:805
Represents a C++ functional cast expression that builds a temporary object.
Definition ExprCXX.h:1904
static CXXTemporaryObjectExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs)
Definition ExprCXX.cpp:1193
Represents the this expression in C++.
Definition ExprCXX.h:1159
void setCapturedByCopyInLambdaWithExplicitObjectParameter(bool Set)
Definition ExprCXX.h:1189
void setLocation(SourceLocation L)
Definition ExprCXX.h:1177
static CXXThisExpr * CreateEmpty(const ASTContext &Ctx)
Definition ExprCXX.cpp:1622
void setImplicit(bool I)
Definition ExprCXX.h:1183
A C++ throw-expression (C++ [except.throw]).
Definition ExprCXX.h:1213
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:853
bool isTypeOperand() const
Definition ExprCXX.h:889
void setSourceRange(SourceRange R)
Definition ExprCXX.h:908
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition ExprCXX.h:3798
void setRParenLoc(SourceLocation L)
Definition ExprCXX.h:3848
void setArg(unsigned I, Expr *E)
Definition ExprCXX.h:3884
void setLParenLoc(SourceLocation L)
Definition ExprCXX.h:3843
unsigned getNumArgs() const
Retrieve the number of arguments.
Definition ExprCXX.h:3856
static CXXUnresolvedConstructExpr * CreateEmpty(const ASTContext &Context, unsigned NumArgs)
Definition ExprCXX.cpp:1530
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
Definition ExprCXX.h:1073
bool isTypeOperand() const
Definition ExprCXX.h:1103
void setSourceRange(SourceRange R)
Definition ExprCXX.h:1124
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition Expr.h:3012
void setRParenLoc(SourceLocation L)
Definition Expr.h:3344
void setCoroElideSafe(bool V=true)
Definition Expr.h:3187
void setArg(unsigned Arg, Expr *ArgExpr)
setArg - Set the specified argument.
Definition Expr.h:3229
void setADLCallKind(ADLCallKind V=UsesADL)
Definition Expr.h:3166
static CallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPFeatures, EmptyShell Empty)
Create an empty call expression, for deserialization.
Definition Expr.cpp:1567
void setUsesMemberSyntax(bool V=true)
Definition Expr.h:3176
void setPreArg(unsigned I, Stmt *PreArg)
Definition Expr.h:3109
void setStoredFPFeatures(FPOptionsOverride F)
Set FPOptionsOverride in trailing storage. Used only by Serialization.
Definition Expr.h:3293
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition Expr.h:3203
void setCallee(Expr *F)
Definition Expr.h:3161
void setBody(Stmt *B)
Definition Decl.cpp:5841
This captures a statement into a function.
Definition Stmt.h:3950
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:4109
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:4054
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument.
Definition Stmt.h:4127
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:4074
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument.
Definition Stmt.h:4137
capture_range captures()
Definition Stmt.h:4088
VariableCaptureKind
The different capture forms: by 'this', by reference, capture for variable-length array type etc.
Definition Stmt.h:3954
CaseStmt - Represent a case statement.
Definition Stmt.h:1931
void setEllipsisLoc(SourceLocation L)
Set the location of the ... in a case statement of the form LHS ... RHS.
Definition Stmt.h:2007
static CaseStmt * CreateEmpty(const ASTContext &Ctx, bool CaseStmtIsGNURange)
Build an empty case statement.
Definition Stmt.cpp:1317
void setLHS(Expr *Val)
Definition Stmt.h:2022
void setSubStmt(Stmt *S)
Definition Stmt.h:2049
void setRHS(Expr *Val)
Definition Stmt.h:2038
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition Expr.h:3745
FPOptionsOverride * getTrailingFPFeatures()
Return a pointer to the trailing FPOptions.
Definition Expr.cpp:2089
path_iterator path_begin()
Definition Expr.h:3815
unsigned path_size() const
Definition Expr.h:3814
void setCastKind(CastKind K)
Definition Expr.h:3790
bool hasStoredFPFeatures() const
Definition Expr.h:3844
CXXBaseSpecifier ** path_iterator
Definition Expr.h:3811
void setSubExpr(Expr *E)
Definition Expr.h:3797
void setValue(unsigned Val)
Definition Expr.h:1680
void setLocation(SourceLocation Location)
Definition Expr.h:1676
void setKind(CharacterLiteralKind kind)
Definition Expr.h:1677
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition Expr.h:4917
void setRParenLoc(SourceLocation L)
Definition Expr.h:4968
void setIsConditionTrue(bool isTrue)
Definition Expr.h:4945
void setBuiltinLoc(SourceLocation L)
Definition Expr.h:4965
void setRHS(Expr *E)
Definition Expr.h:4962
void setCond(Expr *E)
Definition Expr.h:4958
void setLHS(Expr *E)
Definition Expr.h:4960
Represents a 'co_await' expression.
Definition ExprCXX.h:5423
void setIsImplicit(bool value=true)
Definition ExprCXX.h:5446
CompoundAssignOperator - For compound assignments (e.g.
Definition Expr.h:4369
void setComputationResultType(QualType T)
Definition Expr.h:4407
static CompoundAssignOperator * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
Definition Expr.cpp:5158
void setComputationLHSType(QualType T)
Definition Expr.h:4404
CompoundLiteralExpr - [C99 6.5.2.5].
Definition Expr.h:3674
void setFileScope(bool FS)
Definition Expr.h:3707
void setTypeSourceInfo(TypeSourceInfo *tinfo)
Definition Expr.h:3715
void setLParenLoc(SourceLocation L)
Definition Expr.h:3710
void setInitializer(Expr *E)
Definition Expr.h:3704
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition Stmt.h:1751
static CompoundStmt * CreateEmpty(const ASTContext &C, unsigned NumStmts, bool HasFPFeatures)
Definition Stmt.cpp:409
bool hasStoredFPFeatures() const
Definition Stmt.h:1798
Represents the specialization of a concept - evaluates to a prvalue of type bool.
ConditionalOperator - The ?
Definition Expr.h:4460
An expression that occurs in a constant context and the result of evaluating the expression.
Definition Expr.h:1127
ConstantResultStorageKind getResultStorageKind() const
Definition Expr.h:1196
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, 1 > Details
The substituted constraint expr, if the template arguments could be substituted into them,...
Definition ASTConcept.h:55
ContinueStmt - This represents a continue.
Definition Stmt.h:3132
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition Expr.h:4788
static ConvertVectorExpr * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
Definition Expr.cpp:5724
void setStoredFPFeatures(FPOptionsOverride F)
Set FPFeatures in trailing storage, used by Serialization & ASTImporter.
Definition Expr.h:4861
bool hasStoredFPFeatures() const
Is FPFeatures in Trailing Storage?
Definition Expr.h:4846
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:5504
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:1315
bool hasTemplateKWAndArgsInfo() const
Definition Expr.h:1436
static DeclRefExpr * CreateEmpty(const ASTContext &Context, bool HasQualifier, bool HasFoundDecl, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Construct an empty declaration reference expression.
Definition Expr.cpp:539
void setLocation(SourceLocation L)
Definition Expr.h:1392
bool hasQualifier() const
Determine whether this declaration reference was preceded by a C++ nested-name-specifier,...
Definition Expr.h:1404
ValueDecl * getDecl()
Definition Expr.h:1383
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
Definition Stmt.h:1642
void setStartLoc(SourceLocation L)
Definition Stmt.h:1664
void setEndLoc(SourceLocation L)
Definition Stmt.h:1666
void setDeclGroup(DeclGroupRef DGR)
Definition Stmt.h:1662
Decl - This represents one declaration (or definition), e.g.
Definition DeclBase.h:86
void setSubStmt(Stmt *S)
Definition Stmt.h:2094
DeferStmt - This represents a deferred statement.
Definition Stmt.h:3249
void setBody(Stmt *S)
Definition Stmt.h:3270
void setDeferLoc(SourceLocation DeferLoc)
Definition Stmt.h:3264
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:5455
A qualified reference to a name whose declaration cannot yet be resolved.
Definition ExprCXX.h:3564
static DependentScopeDeclRefExpr * CreateEmpty(const ASTContext &Context, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition ExprCXX.cpp:589
A template-id naming a variable template or a concept through a template template parameter.
Definition ExprCXX.h:3480
static DependentTemplateIdExpr * CreateEmpty(const ASTContext &Context, unsigned NumTemplateArgs)
Definition ExprCXX.cpp:434
unsigned getNumTemplateArgs() const
Definition ExprCXX.h:3523
Represents a C99 designated initializer expression.
Definition Expr.h:5637
static DesignatedInitExpr * CreateEmpty(const ASTContext &C, unsigned NumIndexExprs)
Definition Expr.cpp:4889
void setSubExpr(unsigned Idx, Expr *E)
Definition Expr.h:5923
void setGNUSyntax(bool GNU)
Definition Expr.h:5902
void setEqualOrColonLoc(SourceLocation L)
Definition Expr.h:5893
void setDesignators(const ASTContext &C, const Designator *Desigs, unsigned NumDesigs)
Definition Expr.cpp:4896
unsigned getNumSubExprs() const
Retrieve the total number of subexpressions in this designated initializer expression,...
Definition Expr.h:5917
void setBase(Expr *Base)
Definition Expr.h:6020
void setUpdater(Expr *Updater)
Definition Expr.h:6025
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:2843
void setWhileLoc(SourceLocation L)
Definition Stmt.h:2875
void setDoLoc(SourceLocation L)
Definition Stmt.h:2873
void setRParenLoc(SourceLocation L)
Definition Stmt.h:2877
void setBody(Stmt *Body)
Definition Stmt.h:2870
void setCond(Expr *Cond)
Definition Stmt.h:2866
void setAccessorLoc(SourceLocation L)
Definition Expr.h:6675
void setAccessor(IdentifierInfo *II)
Definition Expr.h:6672
void setBase(Expr *E)
Definition Expr.h:6669
Represents a reference to emded data.
Definition Expr.h:5204
ExplicitCastExpr - An explicit cast written in the source code.
Definition Expr.h:3997
void setTypeInfoAsWritten(TypeSourceInfo *writtenTy)
Definition Expr.h:4020
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition ExprCXX.h:3715
unsigned getNumObjects() const
Definition ExprCXX.h:3743
llvm::PointerUnion< BlockDecl *, CompoundLiteralExpr * > CleanupObject
The type of objects that are kept in the cleanup.
Definition ExprCXX.h:3721
static ExprWithCleanups * Create(const ASTContext &C, EmptyShell empty, unsigned numObjects)
Definition ExprCXX.cpp:1496
This represents one expression.
Definition Expr.h:114
void setType(QualType t)
Definition Expr.h:147
bool isValueDependent() const
Determines whether the value of this expression depends on.
Definition Expr.h:179
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on.
Definition Expr.h:225
void setValueKind(ExprValueKind Cat)
setValueKind - Set the value kind produced by this expression.
Definition Expr.h:466
void setObjectKind(ExprObjectKind Cat)
setObjectKind - Set the object kind produced by this expression.
Definition Expr.h:469
QualType getType() const
Definition Expr.h:146
void setDependence(ExprDependence Deps)
Each concrete expr subclass is expected to compute its dependence and call this in the constructor.
Definition Expr.h:139
An expression trait intrinsic.
Definition ExprCXX.h:3084
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition Expr.h:6696
static FPOptionsOverride getFromOpaqueInt(storage_type I)
static FixedPointLiteral * Create(const ASTContext &C, EmptyShell Empty)
Returns an empty fixed-point literal.
Definition Expr.cpp:1015
void setLocation(SourceLocation Location)
Definition Expr.h:1628
void setScale(unsigned S)
Definition Expr.h:1631
static FloatingLiteral * Create(const ASTContext &C, const llvm::APFloat &V, bool isexact, QualType Type, SourceLocation L)
Definition Expr.cpp:1086
const llvm::fltSemantics & getSemantics() const
Return the APFloat semantics this literal uses.
Definition Expr.h:1733
void setValue(const ASTContext &C, const llvm::APFloat &Val)
Definition Expr.h:1714
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:1728
void setExact(bool E)
Definition Expr.h:1745
void setLocation(SourceLocation L)
Definition Expr.h:1753
ForStmt - This represents a 'for (init;cond;inc)' stmt.
Definition Stmt.h:2899
void setBody(Stmt *S)
Definition Stmt.h:2953
void setCond(Expr *E)
Definition Stmt.h:2951
void setForLoc(SourceLocation L)
Definition Stmt.h:2956
void setInc(Expr *E)
Definition Stmt.h:2952
void setLParenLoc(SourceLocation L)
Definition Stmt.h:2958
void setInit(Stmt *S)
Definition Stmt.h:2950
void setConditionVariableDeclStmt(DeclStmt *CondVar)
Definition Stmt.h:2937
void setRParenLoc(SourceLocation L)
Definition Stmt.h:2960
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:1112
Stmt * SubExpr
Definition Expr.h:1096
Represents a reference to a function parameter pack, init-capture pack, or binding pack that has been...
Definition ExprCXX.h:4895
static FunctionParmPackExpr * CreateEmpty(const ASTContext &Context, unsigned NumParams)
Definition ExprCXX.cpp:1840
This represents a GCC inline-assembly statement extension.
Definition Stmt.h:3459
unsigned getNumLabels() const
Definition Stmt.h:3609
void setAsmStringExpr(Expr *E)
Definition Stmt.h:3488
void setRParenLoc(SourceLocation L)
Definition Stmt.h:3482
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Definition Expr.h:4992
void setTokenLocation(SourceLocation L)
Definition Expr.h:5007
Represents a C11 generic selection.
Definition Expr.h:6268
unsigned getNumAssocs() const
The number of association expressions.
Definition Expr.h:6510
static GenericSelectionExpr * CreateEmpty(const ASTContext &Context, unsigned NumAssocs)
Create an empty generic selection expression for deserialization.
Definition Expr.cpp:4823
GotoStmt - This represents a direct goto.
Definition Stmt.h:2980
void setLabel(LabelDecl *D)
Definition Stmt.h:2994
void setLabelLoc(SourceLocation L)
Definition Stmt.h:2999
void setGotoLoc(SourceLocation L)
Definition Stmt.h:2997
This class represents temporary values used to represent inout and out arguments in HLSL.
Definition Expr.h:7483
static HLSLOutArgExpr * CreateEmpty(const ASTContext &Ctx)
Definition Expr.cpp:5710
IfStmt - This represents an if/then/else.
Definition Stmt.h:2270
void setThen(Stmt *Then)
Definition Stmt.h:2364
void setConditionVariableDeclStmt(DeclStmt *CondVar)
Definition Stmt.h:2415
void setCond(Expr *Cond)
Definition Stmt.h:2355
void setLParenLoc(SourceLocation Loc)
Definition Stmt.h:2489
void setElse(Stmt *Else)
Definition Stmt.h:2378
void setElseLoc(SourceLocation ElseLoc)
Definition Stmt.h:2444
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:2467
void setRParenLoc(SourceLocation Loc)
Definition Stmt.h:2491
void setIfLoc(SourceLocation IfLoc)
Definition Stmt.h:2437
void setInit(Stmt *Init)
Definition Stmt.h:2430
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1....
Definition Expr.h:1776
void setSubExpr(Expr *E)
Definition Expr.h:1790
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition Expr.h:3922
static ImplicitCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize, bool HasFPFeatures)
Definition Expr.cpp:2132
void setIsPartOfExplicitCast(bool PartOfExplicitCast)
Definition Expr.h:3954
Represents an implicitly-generated value initialization of an object of a given type.
Definition Expr.h:6143
IndirectGotoStmt - This represents an indirect goto.
Definition Stmt.h:3019
void setTarget(Expr *E)
Definition Stmt.h:3043
void setGotoLoc(SourceLocation L)
Definition Stmt.h:3034
void setStarLoc(SourceLocation L)
Definition Stmt.h:3036
Describes an C or C++ initializer list.
Definition Expr.h:5377
void setSyntacticForm(InitListExpr *Init)
Definition Expr.h:5562
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:2465
void setLBraceLoc(SourceLocation Loc)
Definition Expr.h:5547
void setRBraceLoc(SourceLocation Loc)
Definition Expr.h:5549
void sawArrayRangeDesignator(bool ARD=true)
Definition Expr.h:5572
void reserveInits(const ASTContext &C, unsigned NumInits)
Reserve space for some number of initializers.
Definition Expr.cpp:2456
void setLocation(SourceLocation Location)
Definition Expr.h:1583
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:985
LabelStmt - Represents a label, which has a substatement.
Definition Stmt.h:2157
void setSubStmt(Stmt *SS)
Definition Stmt.h:2182
void setDecl(LabelDecl *D)
Definition Stmt.h:2176
void setIdentLoc(SourceLocation L)
Definition Stmt.h:2173
void setSideEntry(bool SE)
Definition Stmt.h:2205
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition ExprCXX.h:1973
Expr ** capture_init_iterator
Iterator that walks over the capture initialization arguments.
Definition ExprCXX.h:2080
static LambdaExpr * CreateDeserialized(const ASTContext &C, unsigned NumCaptures)
Construct a new lambda expression that will be deserialized from an external source.
Definition ExprCXX.cpp:1364
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument for this lambda expression.
Definition ExprCXX.h:2111
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
Definition ExprCXX.h:2099
Base class for BreakStmt and ContinueStmt.
Definition Stmt.h:3068
void setLabelDecl(LabelDecl *S)
Definition Stmt.h:3108
void setLabelLoc(SourceLocation L)
Definition Stmt.h:3104
void setKwLoc(SourceLocation L)
Definition Stmt.h:3094
This represents a Microsoft inline-assembly statement extension.
Definition Stmt.h:3678
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:941
MS property subscript expression.
Definition ExprCXX.h:1011
void setRBracketLoc(SourceLocation L)
Definition ExprCXX.h:1049
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition ExprCXX.h:4974
MatrixSingleSubscriptExpr - Matrix single subscript expression for the MatrixType extension when you ...
Definition Expr.h:2864
void setRBracketLoc(SourceLocation L)
Definition Expr.h:2911
MatrixSubscriptExpr - Matrix subscript expression for the MatrixType extension.
Definition Expr.h:2934
void setColumnIdx(Expr *E)
Definition Expr.h:2974
void setBase(Expr *E)
Definition Expr.h:2962
void setRowIdx(Expr *E)
Definition Expr.h:2966
void setRBracketLoc(SourceLocation L)
Definition Expr.h:2989
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition Expr.h:3433
static MemberExpr * CreateEmpty(const ASTContext &Context, bool HasQualifier, bool HasFoundDecl, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition Expr.cpp:1808
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition Decl.h:342
Represents a place-holder for an object not to be initialized by anything.
Definition Expr.h:5963
NullStmt - This is the null statement ";": C99 6.8.3p3.
Definition Stmt.h:1714
void setSemiLoc(SourceLocation L)
Definition Stmt.h:1726
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:5564
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:5693
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:2596
void setOperatorLoc(SourceLocation L)
Definition Expr.h:2630
static OffsetOfExpr * CreateEmpty(const ASTContext &C, unsigned NumComps, unsigned NumExprs)
Definition Expr.cpp:1703
void setIndexExpr(unsigned Idx, Expr *E)
Definition Expr.h:2663
void setTypeSourceInfo(TypeSourceInfo *tsi)
Definition Expr.h:2639
void setComponent(unsigned Idx, OffsetOfNode ON)
Definition Expr.h:2647
unsigned getNumExpressions() const
Definition Expr.h:2667
void setRParenLoc(SourceLocation R)
Definition Expr.h:2634
unsigned getNumComponents() const
Definition Expr.h:2651
Kind
The kind of offsetof node we have.
Definition Expr.h:2493
@ Array
An index into an array.
Definition Expr.h:2495
@ Identifier
A field in a dependent type, known only by its name.
Definition Expr.h:2499
@ Field
A field.
Definition Expr.h:2497
@ Base
An implicit indirection through a C++ base class, when the field found is in a base class.
Definition Expr.h:2502
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
Definition Expr.h:1223
void setIsUnique(bool V)
Definition Expr.h:1275
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:2159
static OpenACCAsteriskSizeExpr * CreateEmpty(const ASTContext &C)
Definition Expr.cpp:5720
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:3143
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
Definition ExprCXX.h:4336
unsigned getNumDecls() const
Gets the number of declarations in the unresolved set.
Definition ExprCXX.h:3247
TemplateArgumentLoc * getTrailingTemplateArgumentLoc()
Return the optional template arguments.
Definition ExprCXX.h:4346
DeclAccessPair * getTrailingResults()
Return the results. Defined after UnresolvedMemberExpr.
Definition ExprCXX.h:4330
bool hasTemplateKWAndArgsInfo() const
Definition ExprCXX.h:3187
unsigned getNumTemplateArgs() const
Definition ExprCXX.h:3313
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition ExprCXX.h:4417
static PackIndexingExpr * CreateDeserialized(ASTContext &Context, unsigned NumTransformedExprs)
Definition ExprCXX.cpp:1789
ParenExpr - This represents a parenthesized expression, e.g.
Definition Expr.h:2251
void setLParen(SourceLocation Loc)
Definition Expr.h:2277
void setIsProducedByFoldExpansion(bool ProducedByFoldExpansion=true)
Definition Expr.h:2296
void setRParen(SourceLocation Loc)
Definition Expr.h:2281
void setSubExpr(Expr *E)
Definition Expr.h:2270
static ParenListExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumExprs)
Create an empty paren list.
Definition Expr.cpp:5025
unsigned getNumExprs() const
Return the number of expressions in this paren list.
Definition Expr.h:6196
[C99 6.4.2.2] - A predefined identifier such as func.
Definition Expr.h:2074
void setLocation(SourceLocation L)
Definition Expr.h:2116
static PredefinedExpr * CreateEmpty(const ASTContext &Ctx, bool HasFunctionName)
Create an empty PredefinedExpr.
Definition Expr.cpp:652
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition Expr.h:6890
static PseudoObjectExpr * Create(const ASTContext &Context, Expr *syntactic, ArrayRef< Expr * > semantic, unsigned resultIndex)
Definition Expr.cpp:5238
Frontend produces RecoveryExprs on semantic errors that prevent creating other well-formed expression...
Definition Expr.h:7589
child_range children()
Definition Expr.h:7602
static RecoveryExpr * CreateEmpty(ASTContext &Ctx, unsigned NumSubExprs)
Definition Expr.cpp:5519
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:3173
void setRetValue(Expr *E)
Definition Stmt.h:3202
void setReturnLoc(SourceLocation L)
Definition Stmt.h:3223
void setNRVOCandidate(const VarDecl *Var)
Set the variable that might be used for the named return value optimization.
Definition Stmt.h:3216
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:3911
void setLeaveLoc(SourceLocation L)
Definition Stmt.h:3922
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:592
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition Expr.h:4712
void setExprs(const ASTContext &C, ArrayRef< Expr * > Exprs)
Definition Expr.cpp:4653
void setRParenLoc(SourceLocation L)
Definition Expr.h:4733
void setBuiltinLoc(SourceLocation L)
Definition Expr.h:4730
Represents an expression that computes the length of a parameter pack.
Definition ExprCXX.h:4495
static SizeOfPackExpr * CreateDeserialized(ASTContext &Context, unsigned NumPartialArgs)
Definition ExprCXX.cpp:1751
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof... expression, such as is produced f...
Definition ExprCXX.h:4580
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(),...
Definition Expr.h:5095
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:4664
void setRParenLoc(SourceLocation L)
Definition Expr.h:4691
void setLParenLoc(SourceLocation L)
Definition Expr.h:4689
void setSubStmt(CompoundStmt *S)
Definition Expr.h:4683
StmtVisitor - This class implements a simple visitor for Stmt subclasses.
Stmt - This represents one statement.
Definition Stmt.h:85
ExpressionTraitExprBitfields ExpressionTraitExprBits
Definition Stmt.h:1406
GenericSelectionExprBitfields GenericSelectionExprBits
Definition Stmt.h:1370
InitListExprBitfields InitListExprBits
Definition Stmt.h:1368
LambdaExprBitfields LambdaExprBits
Definition Stmt.h:1403
AttributedStmtBitfields AttributedStmtBits
Definition Stmt.h:1341
UnresolvedLookupExprBitfields UnresolvedLookupExprBits
Definition Stmt.h:1399
SubstNonTypeTemplateParmExprBitfields SubstNonTypeTemplateParmExprBits
Definition Stmt.h:1402
CXXNoexceptExprBitfields CXXNoexceptExprBits
Definition Stmt.h:1401
CXXRewrittenBinaryOperatorBitfields CXXRewrittenBinaryOperatorBits
Definition Stmt.h:1382
ExprWithCleanupsBitfields ExprWithCleanupsBits
Definition Stmt.h:1395
StmtClass getStmtClass() const
Definition Stmt.h:1504
CXXScalarValueInitExprBitfields CXXScalarValueInitExprBits
Definition Stmt.h:1389
CXXConstructExprBitfields CXXConstructExprBits
Definition Stmt.h:1394
CXXDependentScopeMemberExprBitfields CXXDependentScopeMemberExprBits
Definition Stmt.h:1397
TypeTraitExprBitfields TypeTraitExprBits
Definition Stmt.h:1392
CXXNewExprBitfields CXXNewExprBits
Definition Stmt.h:1390
SourceLocExprBitfields SourceLocExprBits
Definition Stmt.h:1372
ConstantExprBitfields ConstantExprBits
Definition Stmt.h:1355
RequiresExprBitfields RequiresExprBits
Definition Stmt.h:1404
CXXFoldExprBitfields CXXFoldExprBits
Definition Stmt.h:1407
StmtExprBitfields StmtExprBits
Definition Stmt.h:1377
StringLiteralBitfields StringLiteralBits
Definition Stmt.h:1359
OpaqueValueExprBitfields OpaqueValueExprBits
Definition Stmt.h:1418
CXXThrowExprBitfields CXXThrowExprBits
Definition Stmt.h:1386
MemberExprBitfields MemberExprBits
Definition Stmt.h:1365
PackIndexingExprBitfields PackIndexingExprBits
Definition Stmt.h:1408
DeclRefExprBitfields DeclRefExprBits
Definition Stmt.h:1357
CXXOperatorCallExprBitfields CXXOperatorCallExprBits
Definition Stmt.h:1381
CXXDefaultInitExprBitfields CXXDefaultInitExprBits
Definition Stmt.h:1388
NullStmtBitfields NullStmtBits
Definition Stmt.h:1338
ArrayTypeTraitExprBitfields ArrayTypeTraitExprBits
Definition Stmt.h:1405
PredefinedExprBitfields PredefinedExprBits
Definition Stmt.h:1356
UnresolvedMemberExprBitfields UnresolvedMemberExprBits
Definition Stmt.h:1400
PseudoObjectExprBitfields PseudoObjectExprBits
Definition Stmt.h:1371
CXXDeleteExprBitfields CXXDeleteExprBits
Definition Stmt.h:1391
CXXDefaultArgExprBitfields CXXDefaultArgExprBits
Definition Stmt.h:1387
StringLiteral - This represents a string literal expression, e.g.
Definition Expr.h:1844
unsigned getLength() const
Definition Expr.h:1969
StringLiteralKind getKind() const
Definition Expr.h:1973
static StringLiteral * CreateEmpty(const ASTContext &Ctx, unsigned NumConcatenated, unsigned Length, unsigned CharByteWidth)
Construct an empty string literal.
Definition Expr.cpp:1208
unsigned getNumConcatenated() const
Get the number of string literal tokens that were concatenated in translation phase #6 to form this s...
Definition Expr.h:2010
unsigned getCharByteWidth() const
Definition Expr.h:1971
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition ExprCXX.h:4718
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition ExprCXX.h:4808
void setColonLoc(SourceLocation L)
Definition Stmt.h:1911
void setKeywordLoc(SourceLocation L)
Definition Stmt.h:1909
void setNextSwitchCase(SwitchCase *SC)
Definition Stmt.h:1906
SwitchStmt - This represents a 'switch' stmt.
Definition Stmt.h:2520
void setCond(Expr *Cond)
Definition Stmt.h:2591
void setSwitchLoc(SourceLocation L)
Definition Stmt.h:2656
void setConditionVariableDeclStmt(DeclStmt *CondVar)
Definition Stmt.h:2646
void setBody(Stmt *Body)
Definition Stmt.h:2598
void setRParenLoc(SourceLocation Loc)
Definition Stmt.h:2660
void setInit(Stmt *Init)
Definition Stmt.h:2608
void setLParenLoc(SourceLocation Loc)
Definition Stmt.h:2658
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:2676
void setSwitchCaseList(SwitchCase *SC)
Definition Stmt.h:2653
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:8549
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition ExprCXX.h:2901
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
Definition ExprCXX.h:2973
static TypeTraitExpr * CreateDeserialized(const ASTContext &C, bool IsStoredAsBool, unsigned NumArgs)
Definition ExprCXX.cpp:1967
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition Expr.h:2694
void setKind(UnaryExprOrTypeTrait K)
Definition Expr.h:2729
void setOperatorLoc(SourceLocation L)
Definition Expr.h:2768
void setRParenLoc(SourceLocation L)
Definition Expr.h:2771
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition Expr.h:2313
void setSubExpr(Expr *E)
Definition Expr.h:2355
void setOperatorLoc(SourceLocation L)
Definition Expr.h:2359
void setCanOverflow(bool C)
Definition Expr.h:2368
bool hasStoredFPFeatures() const
Is FPFeatures in Trailing Storage?
Definition Expr.h:2450
void setOpcode(Opcode Opc)
Definition Expr.h:2352
void setStoredFPFeatures(FPOptionsOverride F)
Set FPFeatures in trailing storage, used by Serialization & ASTImporter.
Definition Expr.h:2464
UnaryOperatorKind Opcode
Definition Expr.h:2327
static UnaryOperator * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
Definition Expr.cpp:5180
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition ExprCXX.h:3373
static UnresolvedLookupExpr * CreateEmpty(const ASTContext &Context, unsigned NumResults, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition ExprCXX.cpp:499
Represents a C++ member access expression for which lookup produced a set of overloaded functions.
Definition ExprCXX.h:4180
static UnresolvedMemberExpr * CreateEmpty(const ASTContext &Context, unsigned NumResults, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition ExprCXX.cpp:1701
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:645
static UserDefinedLiteral * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPOptions, EmptyShell Empty)
Definition ExprCXX.cpp:1016
Represents a call to the builtin function __builtin_va_arg.
Definition Expr.h:5026
void setVarargABI(VarArgKind Kind)
Definition Expr.h:5051
void setRParenLoc(SourceLocation L)
Definition Expr.h:5066
void setSubExpr(Expr *E)
Definition Expr.h:5048
void setBuiltinLoc(SourceLocation L)
Definition Expr.h:5063
void setWrittenTypeInfo(TypeSourceInfo *TI)
Definition Expr.h:5060
WhileStmt - This represents a 'while' stmt.
Definition Stmt.h:2708
void setCond(Expr *Cond)
Definition Stmt.h:2768
void setBody(Stmt *Body)
Definition Stmt.h:2775
void setLParenLoc(SourceLocation L)
Definition Stmt.h:2817
void setRParenLoc(SourceLocation L)
Definition Stmt.h:2819
void setWhileLoc(SourceLocation L)
Definition Stmt.h:2814
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:2808
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:506
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:1121
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:153
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
Definition Specifiers.h:127
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)
ReflectionKind
Definition Reflection.h:22
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:136
U cast(CodeGen::Address addr)
Definition Address.h:327
@ Implicit
An implicit conversion.
Definition Sema.h:433
CharacterLiteralKind
Definition Expr.h:1648
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:1444