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 NumClauses field was read in ReadStmtFromStream.
2545 Record.skipInts(1);
2546 VisitOMPExecutableDirective(D);
2547}
2548
2549void ASTStmtReader::VisitOMPParallelDirective(OMPParallelDirective *D) {
2550 VisitStmt(D);
2551 VisitOMPExecutableDirective(D);
2552 D->setHasCancel(Record.readBool());
2553}
2554
2555void ASTStmtReader::VisitOMPSimdDirective(OMPSimdDirective *D) {
2556 VisitOMPLoopDirective(D);
2557}
2558
2559void ASTStmtReader::VisitOMPCanonicalLoopNestTransformationDirective(
2560 OMPCanonicalLoopNestTransformationDirective *D) {
2561 VisitOMPLoopBasedDirective(D);
2562 D->setNumGeneratedTopLevelLoops(Record.readUInt32());
2563}
2564
2565void ASTStmtReader::VisitOMPTileDirective(OMPTileDirective *D) {
2566 VisitOMPCanonicalLoopNestTransformationDirective(D);
2567}
2568
2569void ASTStmtReader::VisitOMPStripeDirective(OMPStripeDirective *D) {
2570 VisitOMPCanonicalLoopNestTransformationDirective(D);
2571}
2572
2573void ASTStmtReader::VisitOMPUnrollDirective(OMPUnrollDirective *D) {
2574 VisitOMPCanonicalLoopNestTransformationDirective(D);
2575}
2576
2577void ASTStmtReader::VisitOMPReverseDirective(OMPReverseDirective *D) {
2578 VisitOMPCanonicalLoopNestTransformationDirective(D);
2579}
2580
2581void ASTStmtReader::VisitOMPCanonicalLoopSequenceTransformationDirective(
2582 OMPCanonicalLoopSequenceTransformationDirective *D) {
2583 VisitStmt(D);
2584 VisitOMPExecutableDirective(D);
2585 D->setNumGeneratedTopLevelLoops(Record.readUInt32());
2586}
2587
2588void ASTStmtReader::VisitOMPInterchangeDirective(OMPInterchangeDirective *D) {
2589 VisitOMPCanonicalLoopNestTransformationDirective(D);
2590}
2591
2592void ASTStmtReader::VisitOMPFlattenDirective(OMPFlattenDirective *D) {
2593 VisitOMPCanonicalLoopNestTransformationDirective(D);
2594}
2595
2596void ASTStmtReader::VisitOMPSplitDirective(OMPSplitDirective *D) {
2597 VisitOMPCanonicalLoopNestTransformationDirective(D);
2598}
2599
2600void ASTStmtReader::VisitOMPFuseDirective(OMPFuseDirective *D) {
2601 VisitOMPCanonicalLoopSequenceTransformationDirective(D);
2602}
2603
2604void ASTStmtReader::VisitOMPForDirective(OMPForDirective *D) {
2605 VisitOMPLoopDirective(D);
2606 D->setHasCancel(Record.readBool());
2607}
2608
2609void ASTStmtReader::VisitOMPForSimdDirective(OMPForSimdDirective *D) {
2610 VisitOMPLoopDirective(D);
2611}
2612
2613void ASTStmtReader::VisitOMPSectionsDirective(OMPSectionsDirective *D) {
2614 VisitStmt(D);
2615 VisitOMPExecutableDirective(D);
2616 D->setHasCancel(Record.readBool());
2617}
2618
2619void ASTStmtReader::VisitOMPSectionDirective(OMPSectionDirective *D) {
2620 VisitStmt(D);
2621 VisitOMPExecutableDirective(D);
2622 D->setHasCancel(Record.readBool());
2623}
2624
2625void ASTStmtReader::VisitOMPScopeDirective(OMPScopeDirective *D) {
2626 VisitStmt(D);
2627 VisitOMPExecutableDirective(D);
2628}
2629
2630void ASTStmtReader::VisitOMPSingleDirective(OMPSingleDirective *D) {
2631 VisitStmt(D);
2632 VisitOMPExecutableDirective(D);
2633}
2634
2635void ASTStmtReader::VisitOMPMasterDirective(OMPMasterDirective *D) {
2636 VisitStmt(D);
2637 VisitOMPExecutableDirective(D);
2638}
2639
2640void ASTStmtReader::VisitOMPCriticalDirective(OMPCriticalDirective *D) {
2641 VisitStmt(D);
2642 VisitOMPExecutableDirective(D);
2643 D->DirName = Record.readDeclarationNameInfo();
2644}
2645
2646void ASTStmtReader::VisitOMPParallelForDirective(OMPParallelForDirective *D) {
2647 VisitOMPLoopDirective(D);
2648 D->setHasCancel(Record.readBool());
2649}
2650
2651void ASTStmtReader::VisitOMPParallelForSimdDirective(
2652 OMPParallelForSimdDirective *D) {
2653 VisitOMPLoopDirective(D);
2654}
2655
2656void ASTStmtReader::VisitOMPParallelMasterDirective(
2657 OMPParallelMasterDirective *D) {
2658 VisitStmt(D);
2659 VisitOMPExecutableDirective(D);
2660}
2661
2662void ASTStmtReader::VisitOMPParallelMaskedDirective(
2663 OMPParallelMaskedDirective *D) {
2664 VisitStmt(D);
2665 VisitOMPExecutableDirective(D);
2666}
2667
2668void ASTStmtReader::VisitOMPParallelSectionsDirective(
2669 OMPParallelSectionsDirective *D) {
2670 VisitStmt(D);
2671 VisitOMPExecutableDirective(D);
2672 D->setHasCancel(Record.readBool());
2673}
2674
2675void ASTStmtReader::VisitOMPTaskDirective(OMPTaskDirective *D) {
2676 VisitStmt(D);
2677 VisitOMPExecutableDirective(D);
2678 D->setHasCancel(Record.readBool());
2679}
2680
2681void ASTStmtReader::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) {
2682 VisitStmt(D);
2683 VisitOMPExecutableDirective(D);
2684}
2685
2686void ASTStmtReader::VisitOMPBarrierDirective(OMPBarrierDirective *D) {
2687 VisitStmt(D);
2688 VisitOMPExecutableDirective(D);
2689}
2690
2691void ASTStmtReader::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) {
2692 VisitStmt(D);
2693 // The NumClauses field was read in ReadStmtFromStream.
2694 Record.skipInts(1);
2695 VisitOMPExecutableDirective(D);
2696}
2697
2698void ASTStmtReader::VisitOMPAssumeDirective(OMPAssumeDirective *D) {
2699 VisitStmt(D);
2700 VisitOMPExecutableDirective(D);
2701}
2702
2703void ASTStmtReader::VisitOMPErrorDirective(OMPErrorDirective *D) {
2704 VisitStmt(D);
2705 // The NumClauses field was read in ReadStmtFromStream.
2706 Record.skipInts(1);
2707 VisitOMPExecutableDirective(D);
2708}
2709
2710void ASTStmtReader::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) {
2711 VisitStmt(D);
2712 VisitOMPExecutableDirective(D);
2713}
2714
2715void ASTStmtReader::VisitOMPFlushDirective(OMPFlushDirective *D) {
2716 VisitStmt(D);
2717 VisitOMPExecutableDirective(D);
2718}
2719
2720void ASTStmtReader::VisitOMPDepobjDirective(OMPDepobjDirective *D) {
2721 VisitStmt(D);
2722 VisitOMPExecutableDirective(D);
2723}
2724
2725void ASTStmtReader::VisitOMPScanDirective(OMPScanDirective *D) {
2726 VisitStmt(D);
2727 VisitOMPExecutableDirective(D);
2728}
2729
2730void ASTStmtReader::VisitOMPOrderedStandaloneDirective(
2731 OMPOrderedStandaloneDirective *D) {
2732 VisitStmt(D);
2733 VisitOMPExecutableDirective(D);
2734}
2735
2736void ASTStmtReader::VisitOMPOrderedBlockAssocDirective(
2737 OMPOrderedBlockAssocDirective *D) {
2738 VisitStmt(D);
2739 VisitOMPExecutableDirective(D);
2740}
2741
2742void ASTStmtReader::VisitOMPAtomicDirective(OMPAtomicDirective *D) {
2743 VisitStmt(D);
2744 VisitOMPExecutableDirective(D);
2745 D->Flags.IsXLHSInRHSPart = Record.readBool() ? 1 : 0;
2746 D->Flags.IsPostfixUpdate = Record.readBool() ? 1 : 0;
2747 D->Flags.IsFailOnly = Record.readBool() ? 1 : 0;
2748}
2749
2750void ASTStmtReader::VisitOMPTargetDirective(OMPTargetDirective *D) {
2751 VisitStmt(D);
2752 VisitOMPExecutableDirective(D);
2753}
2754
2755void ASTStmtReader::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) {
2756 VisitStmt(D);
2757 VisitOMPExecutableDirective(D);
2758}
2759
2760void ASTStmtReader::VisitOMPTargetEnterDataDirective(
2761 OMPTargetEnterDataDirective *D) {
2762 VisitStmt(D);
2763 VisitOMPExecutableDirective(D);
2764}
2765
2766void ASTStmtReader::VisitOMPTargetExitDataDirective(
2767 OMPTargetExitDataDirective *D) {
2768 VisitStmt(D);
2769 VisitOMPExecutableDirective(D);
2770}
2771
2772void ASTStmtReader::VisitOMPTargetParallelDirective(
2773 OMPTargetParallelDirective *D) {
2774 VisitStmt(D);
2775 VisitOMPExecutableDirective(D);
2776 D->setHasCancel(Record.readBool());
2777}
2778
2779void ASTStmtReader::VisitOMPTargetParallelForDirective(
2780 OMPTargetParallelForDirective *D) {
2781 VisitOMPLoopDirective(D);
2782 D->setHasCancel(Record.readBool());
2783}
2784
2785void ASTStmtReader::VisitOMPTeamsDirective(OMPTeamsDirective *D) {
2786 VisitStmt(D);
2787 VisitOMPExecutableDirective(D);
2788}
2789
2790void ASTStmtReader::VisitOMPCancellationPointDirective(
2791 OMPCancellationPointDirective *D) {
2792 VisitStmt(D);
2793 VisitOMPExecutableDirective(D);
2794 D->setCancelRegion(Record.readEnum<OpenMPDirectiveKind>());
2795}
2796
2797void ASTStmtReader::VisitOMPCancelDirective(OMPCancelDirective *D) {
2798 VisitStmt(D);
2799 VisitOMPExecutableDirective(D);
2800 D->setCancelRegion(Record.readEnum<OpenMPDirectiveKind>());
2801}
2802
2803void ASTStmtReader::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) {
2804 VisitOMPLoopDirective(D);
2805 D->setHasCancel(Record.readBool());
2806}
2807
2808void ASTStmtReader::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) {
2809 VisitOMPLoopDirective(D);
2810}
2811
2812void ASTStmtReader::VisitOMPMasterTaskLoopDirective(
2813 OMPMasterTaskLoopDirective *D) {
2814 VisitOMPLoopDirective(D);
2815 D->setHasCancel(Record.readBool());
2816}
2817
2818void ASTStmtReader::VisitOMPMaskedTaskLoopDirective(
2819 OMPMaskedTaskLoopDirective *D) {
2820 VisitOMPLoopDirective(D);
2821 D->setHasCancel(Record.readBool());
2822}
2823
2824void ASTStmtReader::VisitOMPMasterTaskLoopSimdDirective(
2825 OMPMasterTaskLoopSimdDirective *D) {
2826 VisitOMPLoopDirective(D);
2827}
2828
2829void ASTStmtReader::VisitOMPMaskedTaskLoopSimdDirective(
2830 OMPMaskedTaskLoopSimdDirective *D) {
2831 VisitOMPLoopDirective(D);
2832}
2833
2834void ASTStmtReader::VisitOMPParallelMasterTaskLoopDirective(
2835 OMPParallelMasterTaskLoopDirective *D) {
2836 VisitOMPLoopDirective(D);
2837 D->setHasCancel(Record.readBool());
2838}
2839
2840void ASTStmtReader::VisitOMPParallelMaskedTaskLoopDirective(
2841 OMPParallelMaskedTaskLoopDirective *D) {
2842 VisitOMPLoopDirective(D);
2843 D->setHasCancel(Record.readBool());
2844}
2845
2846void ASTStmtReader::VisitOMPParallelMasterTaskLoopSimdDirective(
2847 OMPParallelMasterTaskLoopSimdDirective *D) {
2848 VisitOMPLoopDirective(D);
2849}
2850
2851void ASTStmtReader::VisitOMPParallelMaskedTaskLoopSimdDirective(
2852 OMPParallelMaskedTaskLoopSimdDirective *D) {
2853 VisitOMPLoopDirective(D);
2854}
2855
2856void ASTStmtReader::VisitOMPDistributeDirective(OMPDistributeDirective *D) {
2857 VisitOMPLoopDirective(D);
2858}
2859
2860void ASTStmtReader::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) {
2861 VisitStmt(D);
2862 VisitOMPExecutableDirective(D);
2863}
2864
2865void ASTStmtReader::VisitOMPDistributeParallelForDirective(
2866 OMPDistributeParallelForDirective *D) {
2867 VisitOMPLoopDirective(D);
2868 D->setHasCancel(Record.readBool());
2869}
2870
2871void ASTStmtReader::VisitOMPDistributeParallelForSimdDirective(
2872 OMPDistributeParallelForSimdDirective *D) {
2873 VisitOMPLoopDirective(D);
2874}
2875
2876void ASTStmtReader::VisitOMPDistributeSimdDirective(
2877 OMPDistributeSimdDirective *D) {
2878 VisitOMPLoopDirective(D);
2879}
2880
2881void ASTStmtReader::VisitOMPTargetParallelForSimdDirective(
2882 OMPTargetParallelForSimdDirective *D) {
2883 VisitOMPLoopDirective(D);
2884}
2885
2886void ASTStmtReader::VisitOMPTargetSimdDirective(OMPTargetSimdDirective *D) {
2887 VisitOMPLoopDirective(D);
2888}
2889
2890void ASTStmtReader::VisitOMPTeamsDistributeDirective(
2891 OMPTeamsDistributeDirective *D) {
2892 VisitOMPLoopDirective(D);
2893}
2894
2895void ASTStmtReader::VisitOMPTeamsDistributeSimdDirective(
2896 OMPTeamsDistributeSimdDirective *D) {
2897 VisitOMPLoopDirective(D);
2898}
2899
2900void ASTStmtReader::VisitOMPTeamsDistributeParallelForSimdDirective(
2901 OMPTeamsDistributeParallelForSimdDirective *D) {
2902 VisitOMPLoopDirective(D);
2903}
2904
2905void ASTStmtReader::VisitOMPTeamsDistributeParallelForDirective(
2906 OMPTeamsDistributeParallelForDirective *D) {
2907 VisitOMPLoopDirective(D);
2908 D->setHasCancel(Record.readBool());
2909}
2910
2911void ASTStmtReader::VisitOMPTargetTeamsDirective(OMPTargetTeamsDirective *D) {
2912 VisitStmt(D);
2913 VisitOMPExecutableDirective(D);
2914}
2915
2916void ASTStmtReader::VisitOMPTargetTeamsDistributeDirective(
2917 OMPTargetTeamsDistributeDirective *D) {
2918 VisitOMPLoopDirective(D);
2919}
2920
2921void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForDirective(
2922 OMPTargetTeamsDistributeParallelForDirective *D) {
2923 VisitOMPLoopDirective(D);
2924 D->setHasCancel(Record.readBool());
2925}
2926
2927void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
2928 OMPTargetTeamsDistributeParallelForSimdDirective *D) {
2929 VisitOMPLoopDirective(D);
2930}
2931
2932void ASTStmtReader::VisitOMPTargetTeamsDistributeSimdDirective(
2933 OMPTargetTeamsDistributeSimdDirective *D) {
2934 VisitOMPLoopDirective(D);
2935}
2936
2937void ASTStmtReader::VisitOMPInteropDirective(OMPInteropDirective *D) {
2938 VisitStmt(D);
2939 VisitOMPExecutableDirective(D);
2940}
2941
2942void ASTStmtReader::VisitOMPDispatchDirective(OMPDispatchDirective *D) {
2943 VisitStmt(D);
2944 VisitOMPExecutableDirective(D);
2945 D->setTargetCallLoc(Record.readSourceLocation());
2946}
2947
2948void ASTStmtReader::VisitOMPMaskedDirective(OMPMaskedDirective *D) {
2949 VisitStmt(D);
2950 VisitOMPExecutableDirective(D);
2951}
2952
2953void ASTStmtReader::VisitOMPGenericLoopDirective(OMPGenericLoopDirective *D) {
2954 VisitOMPLoopDirective(D);
2955}
2956
2957void ASTStmtReader::VisitOMPTeamsGenericLoopDirective(
2958 OMPTeamsGenericLoopDirective *D) {
2959 VisitOMPLoopDirective(D);
2960}
2961
2962void ASTStmtReader::VisitOMPTargetTeamsGenericLoopDirective(
2963 OMPTargetTeamsGenericLoopDirective *D) {
2964 VisitOMPLoopDirective(D);
2965 D->setCanBeParallelFor(Record.readBool());
2966}
2967
2968void ASTStmtReader::VisitOMPParallelGenericLoopDirective(
2969 OMPParallelGenericLoopDirective *D) {
2970 VisitOMPLoopDirective(D);
2971}
2972
2973void ASTStmtReader::VisitOMPTargetParallelGenericLoopDirective(
2974 OMPTargetParallelGenericLoopDirective *D) {
2975 VisitOMPLoopDirective(D);
2976}
2977
2978//===----------------------------------------------------------------------===//
2979// OpenACC Constructs/Directives.
2980//===----------------------------------------------------------------------===//
2981void ASTStmtReader::VisitOpenACCConstructStmt(OpenACCConstructStmt *S) {
2982 (void)Record.readInt();
2983 S->Kind = Record.readEnum<OpenACCDirectiveKind>();
2984 S->Range = Record.readSourceRange();
2985 S->DirectiveLoc = Record.readSourceLocation();
2986 Record.readOpenACCClauseList(S->Clauses);
2987}
2988
2989void ASTStmtReader::VisitOpenACCAssociatedStmtConstruct(
2991 VisitOpenACCConstructStmt(S);
2992 S->setAssociatedStmt(Record.readSubStmt());
2993}
2994
2995void ASTStmtReader::VisitOpenACCComputeConstruct(OpenACCComputeConstruct *S) {
2996 VisitStmt(S);
2997 VisitOpenACCAssociatedStmtConstruct(S);
2998}
2999
3000void ASTStmtReader::VisitOpenACCLoopConstruct(OpenACCLoopConstruct *S) {
3001 VisitStmt(S);
3002 VisitOpenACCAssociatedStmtConstruct(S);
3003 S->ParentComputeConstructKind = Record.readEnum<OpenACCDirectiveKind>();
3004}
3005
3006void ASTStmtReader::VisitOpenACCCombinedConstruct(OpenACCCombinedConstruct *S) {
3007 VisitStmt(S);
3008 VisitOpenACCAssociatedStmtConstruct(S);
3009}
3010
3011void ASTStmtReader::VisitOpenACCDataConstruct(OpenACCDataConstruct *S) {
3012 VisitStmt(S);
3013 VisitOpenACCAssociatedStmtConstruct(S);
3014}
3015
3016void ASTStmtReader::VisitOpenACCEnterDataConstruct(
3017 OpenACCEnterDataConstruct *S) {
3018 VisitStmt(S);
3019 VisitOpenACCConstructStmt(S);
3020}
3021
3022void ASTStmtReader::VisitOpenACCExitDataConstruct(OpenACCExitDataConstruct *S) {
3023 VisitStmt(S);
3024 VisitOpenACCConstructStmt(S);
3025}
3026
3027void ASTStmtReader::VisitOpenACCInitConstruct(OpenACCInitConstruct *S) {
3028 VisitStmt(S);
3029 VisitOpenACCConstructStmt(S);
3030}
3031
3032void ASTStmtReader::VisitOpenACCShutdownConstruct(OpenACCShutdownConstruct *S) {
3033 VisitStmt(S);
3034 VisitOpenACCConstructStmt(S);
3035}
3036
3037void ASTStmtReader::VisitOpenACCSetConstruct(OpenACCSetConstruct *S) {
3038 VisitStmt(S);
3039 VisitOpenACCConstructStmt(S);
3040}
3041
3042void ASTStmtReader::VisitOpenACCUpdateConstruct(OpenACCUpdateConstruct *S) {
3043 VisitStmt(S);
3044 VisitOpenACCConstructStmt(S);
3045}
3046
3047void ASTStmtReader::VisitOpenACCHostDataConstruct(OpenACCHostDataConstruct *S) {
3048 VisitStmt(S);
3049 VisitOpenACCAssociatedStmtConstruct(S);
3050}
3051
3052void ASTStmtReader::VisitOpenACCWaitConstruct(OpenACCWaitConstruct *S) {
3053 VisitStmt(S);
3054 // Consume the count of Expressions.
3055 (void)Record.readInt();
3056 VisitOpenACCConstructStmt(S);
3057 S->LParenLoc = Record.readSourceLocation();
3058 S->RParenLoc = Record.readSourceLocation();
3059 S->QueuesLoc = Record.readSourceLocation();
3060
3061 for (unsigned I = 0; I < S->NumExprs; ++I) {
3062 S->getExprPtr()[I] = cast_if_present<Expr>(Record.readSubStmt());
3063 assert((I == 0 || S->getExprPtr()[I] != nullptr) &&
3064 "Only first expression should be null");
3065 }
3066}
3067
3068void ASTStmtReader::VisitOpenACCCacheConstruct(OpenACCCacheConstruct *S) {
3069 VisitStmt(S);
3070 (void)Record.readInt();
3071 VisitOpenACCConstructStmt(S);
3072 S->ParensLoc = Record.readSourceRange();
3073 S->ReadOnlyLoc = Record.readSourceLocation();
3074 for (unsigned I = 0; I < S->NumVars; ++I)
3075 S->getVarList()[I] = cast<Expr>(Record.readSubStmt());
3076}
3077
3078void ASTStmtReader::VisitOpenACCAtomicConstruct(OpenACCAtomicConstruct *S) {
3079 VisitStmt(S);
3080 VisitOpenACCConstructStmt(S);
3081 S->AtomicKind = Record.readEnum<OpenACCAtomicKind>();
3082 S->setAssociatedStmt(Record.readSubStmt());
3083}
3084
3085//===----------------------------------------------------------------------===//
3086// HLSL Constructs/Directives.
3087//===----------------------------------------------------------------------===//
3088
3089void ASTStmtReader::VisitHLSLOutArgExpr(HLSLOutArgExpr *S) {
3090 VisitExpr(S);
3091 S->SubExprs[HLSLOutArgExpr::BaseLValue] = Record.readSubExpr();
3092 S->SubExprs[HLSLOutArgExpr::CastedTemporary] = Record.readSubExpr();
3093 S->SubExprs[HLSLOutArgExpr::WritebackCast] = Record.readSubExpr();
3094 S->IsInOut = Record.readBool();
3095}
3096
3097//===----------------------------------------------------------------------===//
3098// ASTReader Implementation
3099//===----------------------------------------------------------------------===//
3100
3102 switch (ReadingKind) {
3103 case Read_None:
3104 llvm_unreachable("should not call this when not reading anything");
3105 case Read_Decl:
3106 case Read_Type:
3107 return ReadStmtFromStream(F);
3108 case Read_Stmt:
3109 return ReadSubStmt();
3110 }
3111
3112 llvm_unreachable("ReadingKind not set ?");
3113}
3114
3116 return cast_or_null<Expr>(ReadStmt(F));
3117}
3118
3120 return cast_or_null<Expr>(ReadSubStmt());
3121}
3122
3123// Within the bitstream, expressions are stored in Reverse Polish
3124// Notation, with each of the subexpressions preceding the
3125// expression they are stored in. Subexpressions are stored from last to first.
3126// To evaluate expressions, we continue reading expressions and placing them on
3127// the stack, with expressions having operands removing those operands from the
3128// stack. Evaluation terminates when we see a STMT_STOP record, and
3129// the single remaining expression on the stack is our result.
3130Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) {
3131 ReadingKindTracker ReadingKind(Read_Stmt, *this);
3132 llvm::BitstreamCursor &Cursor = F.DeclsCursor;
3133
3134 // Map of offset to previously deserialized stmt. The offset points
3135 // just after the stmt record.
3136 llvm::DenseMap<uint64_t, Stmt *> StmtEntries;
3137
3138#ifndef NDEBUG
3139 unsigned PrevNumStmts = StmtStack.size();
3140#endif
3141
3142 ASTRecordReader Record(*this, F);
3143 ASTStmtReader Reader(Record, Cursor);
3145
3146 while (true) {
3148 Cursor.advanceSkippingSubblocks();
3149 if (!MaybeEntry) {
3150 Error(toString(MaybeEntry.takeError()));
3151 return nullptr;
3152 }
3153 llvm::BitstreamEntry Entry = MaybeEntry.get();
3154
3155 switch (Entry.Kind) {
3156 case llvm::BitstreamEntry::SubBlock: // Handled for us already.
3157 case llvm::BitstreamEntry::Error:
3158 Error("malformed block record in AST file");
3159 return nullptr;
3160 case llvm::BitstreamEntry::EndBlock:
3161 goto Done;
3162 case llvm::BitstreamEntry::Record:
3163 // The interesting case.
3164 break;
3165 }
3166
3167 ASTContext &Context = getContext();
3168 Stmt *S = nullptr;
3169 bool Finished = false;
3170 bool IsStmtReference = false;
3171 Expected<unsigned> MaybeStmtCode = Record.readRecord(Cursor, Entry.ID);
3172 if (!MaybeStmtCode) {
3173 Error(toString(MaybeStmtCode.takeError()));
3174 return nullptr;
3175 }
3176 switch ((StmtCode)MaybeStmtCode.get()) {
3177 case STMT_STOP:
3178 Finished = true;
3179 break;
3180
3181 case STMT_REF_PTR:
3182 IsStmtReference = true;
3183 assert(StmtEntries.contains(Record[0]) &&
3184 "No stmt was recorded for this offset reference!");
3185 S = StmtEntries[Record.readInt()];
3186 break;
3187
3188 case STMT_NULL_PTR:
3189 S = nullptr;
3190 break;
3191
3192 case STMT_NULL:
3193 S = new (Context) NullStmt(Empty);
3194 break;
3195
3196 case STMT_COMPOUND: {
3197 unsigned NumStmts = Record[ASTStmtReader::NumStmtFields];
3198 bool HasFPFeatures = Record[ASTStmtReader::NumStmtFields + 1];
3199 S = CompoundStmt::CreateEmpty(Context, NumStmts, HasFPFeatures);
3200 break;
3201 }
3202
3203 case STMT_CASE:
3205 Context,
3206 /*CaseStmtIsGNURange*/ Record[ASTStmtReader::NumStmtFields + 3]);
3207 break;
3208
3209 case STMT_DEFAULT:
3210 S = new (Context) DefaultStmt(Empty);
3211 break;
3212
3213 case STMT_LABEL:
3214 S = new (Context) LabelStmt(Empty);
3215 break;
3216
3217 case STMT_ATTRIBUTED:
3219 Context,
3221 break;
3222
3223 case STMT_IF: {
3224 BitsUnpacker IfStmtBits(Record[ASTStmtReader::NumStmtFields]);
3225 bool HasElse = IfStmtBits.getNextBit();
3226 bool HasVar = IfStmtBits.getNextBit();
3227 bool HasInit = IfStmtBits.getNextBit();
3228 S = IfStmt::CreateEmpty(Context, HasElse, HasVar, HasInit);
3229 break;
3230 }
3231
3232 case STMT_SWITCH:
3234 Context,
3236 /* HasVar=*/Record[ASTStmtReader::NumStmtFields + 1]);
3237 break;
3238
3239 case STMT_WHILE:
3241 Context,
3243 break;
3244
3245 case STMT_DO:
3246 S = new (Context) DoStmt(Empty);
3247 break;
3248
3249 case STMT_FOR:
3250 S = new (Context) ForStmt(Empty);
3251 break;
3252
3253 case STMT_GOTO:
3254 S = new (Context) GotoStmt(Empty);
3255 break;
3256
3257 case STMT_INDIRECT_GOTO:
3258 S = new (Context) IndirectGotoStmt(Empty);
3259 break;
3260
3261 case STMT_CONTINUE:
3262 S = new (Context) ContinueStmt(Empty);
3263 break;
3264
3265 case STMT_BREAK:
3266 S = new (Context) BreakStmt(Empty);
3267 break;
3268
3269 case STMT_DEFER:
3270 S = DeferStmt::CreateEmpty(Context, Empty);
3271 break;
3272
3273 case STMT_RETURN:
3275 Context, /* HasNRVOCandidate=*/Record[ASTStmtReader::NumStmtFields]);
3276 break;
3277
3278 case STMT_DECL:
3279 S = new (Context) DeclStmt(Empty);
3280 break;
3281
3282 case STMT_GCCASM:
3283 S = new (Context) GCCAsmStmt(Empty);
3284 break;
3285
3286 case STMT_MSASM:
3287 S = new (Context) MSAsmStmt(Empty);
3288 break;
3289
3290 case STMT_CAPTURED:
3293 break;
3294
3296 S = new (Context) SYCLKernelCallStmt(Empty);
3297 break;
3298
3299 case EXPR_CONSTANT:
3301 Context, static_cast<ConstantResultStorageKind>(
3302 /*StorageKind=*/Record[ASTStmtReader::NumExprFields]));
3303 break;
3304
3307 break;
3308
3311 break;
3312
3315 break;
3316
3317 case EXPR_PREDEFINED:
3319 Context,
3320 /*HasFunctionName*/ Record[ASTStmtReader::NumExprFields]);
3321 break;
3322
3323 case EXPR_DECL_REF: {
3324 BitsUnpacker DeclRefExprBits(Record[ASTStmtReader::NumExprFields]);
3325 DeclRefExprBits.advance(5);
3326 bool HasFoundDecl = DeclRefExprBits.getNextBit();
3327 bool HasQualifier = DeclRefExprBits.getNextBit();
3328 bool HasTemplateKWAndArgsInfo = DeclRefExprBits.getNextBit();
3329 unsigned NumTemplateArgs = HasTemplateKWAndArgsInfo
3331 : 0;
3332 S = DeclRefExpr::CreateEmpty(Context, HasQualifier, HasFoundDecl,
3333 HasTemplateKWAndArgsInfo, NumTemplateArgs);
3334 break;
3335 }
3336
3338 S = IntegerLiteral::Create(Context, Empty);
3339 break;
3340
3342 S = FixedPointLiteral::Create(Context, Empty);
3343 break;
3344
3346 S = FloatingLiteral::Create(Context, Empty);
3347 break;
3348
3350 S = new (Context) ImaginaryLiteral(Empty);
3351 break;
3352
3355 Context,
3356 /* NumConcatenated=*/Record[ASTStmtReader::NumExprFields],
3357 /* Length=*/Record[ASTStmtReader::NumExprFields + 1],
3358 /* CharByteWidth=*/Record[ASTStmtReader::NumExprFields + 2]);
3359 break;
3360
3362 S = new (Context) CharacterLiteral(Empty);
3363 break;
3364
3365 case EXPR_PAREN:
3366 S = new (Context) ParenExpr(Empty);
3367 break;
3368
3369 case EXPR_PAREN_LIST:
3371 Context,
3372 /* NumExprs=*/Record[ASTStmtReader::NumExprFields]);
3373 break;
3374
3375 case EXPR_UNARY_OPERATOR: {
3376 BitsUnpacker UnaryOperatorBits(Record[ASTStmtReader::NumStmtFields]);
3377 UnaryOperatorBits.advance(ASTStmtReader::NumExprBits);
3378 bool HasFPFeatures = UnaryOperatorBits.getNextBit();
3379 S = UnaryOperator::CreateEmpty(Context, HasFPFeatures);
3380 break;
3381 }
3382
3383 case EXPR_OFFSETOF:
3384 S = OffsetOfExpr::CreateEmpty(Context,
3387 break;
3388
3390 S = new (Context) UnaryExprOrTypeTraitExpr(Empty);
3391 break;
3392
3394 S = new (Context) ArraySubscriptExpr(Empty);
3395 break;
3396
3398 S = new (Context) MatrixSubscriptExpr(Empty);
3399 break;
3400
3401 case EXPR_ARRAY_SECTION:
3402 S = new (Context) ArraySectionExpr(Empty);
3403 break;
3404
3408 break;
3409
3410 case EXPR_OMP_ITERATOR:
3411 S = OMPIteratorExpr::CreateEmpty(Context,
3413 break;
3414
3415 case EXPR_CALL: {
3416 auto NumArgs = Record[ASTStmtReader::NumExprFields];
3417 BitsUnpacker CallExprBits(Record[ASTStmtReader::NumExprFields + 1]);
3418 CallExprBits.advance(1);
3419 auto HasFPFeatures = CallExprBits.getNextBit();
3420 S = CallExpr::CreateEmpty(Context, NumArgs, HasFPFeatures, Empty);
3421 break;
3422 }
3423
3424 case EXPR_RECOVERY:
3426 Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields]);
3427 break;
3428
3429 case EXPR_MEMBER: {
3430 BitsUnpacker ExprMemberBits(Record[ASTStmtReader::NumExprFields]);
3431 bool HasQualifier = ExprMemberBits.getNextBit();
3432 bool HasFoundDecl = ExprMemberBits.getNextBit();
3433 bool HasTemplateInfo = ExprMemberBits.getNextBit();
3434 unsigned NumTemplateArgs = Record[ASTStmtReader::NumExprFields + 1];
3435 S = MemberExpr::CreateEmpty(Context, HasQualifier, HasFoundDecl,
3436 HasTemplateInfo, NumTemplateArgs);
3437 break;
3438 }
3439
3440 case EXPR_BINARY_OPERATOR: {
3441 BitsUnpacker BinaryOperatorBits(Record[ASTStmtReader::NumExprFields]);
3442 BinaryOperatorBits.advance(/*Size of opcode*/ 6);
3443 bool HasFPFeatures = BinaryOperatorBits.getNextBit();
3444 S = BinaryOperator::CreateEmpty(Context, HasFPFeatures);
3445 break;
3446 }
3447
3449 BitsUnpacker BinaryOperatorBits(Record[ASTStmtReader::NumExprFields]);
3450 BinaryOperatorBits.advance(/*Size of opcode*/ 6);
3451 bool HasFPFeatures = BinaryOperatorBits.getNextBit();
3452 S = CompoundAssignOperator::CreateEmpty(Context, HasFPFeatures);
3453 break;
3454 }
3455
3457 S = new (Context) ConditionalOperator(Empty);
3458 break;
3459
3461 S = new (Context) BinaryConditionalOperator(Empty);
3462 break;
3463
3464 case EXPR_IMPLICIT_CAST: {
3465 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
3466 BitsUnpacker CastExprBits(Record[ASTStmtReader::NumExprFields + 1]);
3467 CastExprBits.advance(7);
3468 bool HasFPFeatures = CastExprBits.getNextBit();
3469 S = ImplicitCastExpr::CreateEmpty(Context, PathSize, HasFPFeatures);
3470 break;
3471 }
3472
3473 case EXPR_CSTYLE_CAST: {
3474 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
3475 BitsUnpacker CastExprBits(Record[ASTStmtReader::NumExprFields + 1]);
3476 CastExprBits.advance(7);
3477 bool HasFPFeatures = CastExprBits.getNextBit();
3478 S = CStyleCastExpr::CreateEmpty(Context, PathSize, HasFPFeatures);
3479 break;
3480 }
3481
3483 S = new (Context) CompoundLiteralExpr(Empty);
3484 break;
3485
3487 S = new (Context) ExtVectorElementExpr(Empty);
3488 break;
3489
3491 S = new (Context) MatrixElementExpr(Empty);
3492 break;
3493
3494 case EXPR_INIT_LIST:
3495 S = new (Context) InitListExpr(Empty);
3496 break;
3497
3501
3502 break;
3503
3505 S = new (Context) DesignatedInitUpdateExpr(Empty);
3506 break;
3507
3509 S = new (Context) ImplicitValueInitExpr(Empty);
3510 break;
3511
3512 case EXPR_NO_INIT:
3513 S = new (Context) NoInitExpr(Empty);
3514 break;
3515
3517 S = new (Context) ArrayInitLoopExpr(Empty);
3518 break;
3519
3521 S = new (Context) ArrayInitIndexExpr(Empty);
3522 break;
3523
3524 case EXPR_VA_ARG:
3525 S = new (Context) VAArgExpr(Empty);
3526 break;
3527
3528 case EXPR_SOURCE_LOC:
3529 S = new (Context) SourceLocExpr(Empty);
3530 break;
3531
3533 S = new (Context) EmbedExpr(Empty);
3534 break;
3535
3536 case EXPR_ADDR_LABEL:
3537 S = new (Context) AddrLabelExpr(Empty);
3538 break;
3539
3540 case EXPR_STMT:
3541 S = new (Context) StmtExpr(Empty);
3542 break;
3543
3544 case EXPR_CHOOSE:
3545 S = new (Context) ChooseExpr(Empty);
3546 break;
3547
3548 case EXPR_GNU_NULL:
3549 S = new (Context) GNUNullExpr(Empty);
3550 break;
3551
3553 S = new (Context) ShuffleVectorExpr(Empty);
3554 break;
3555
3556 case EXPR_CONVERT_VECTOR: {
3557 BitsUnpacker ConvertVectorExprBits(Record[ASTStmtReader::NumStmtFields]);
3558 ConvertVectorExprBits.advance(ASTStmtReader::NumExprBits);
3559 bool HasFPFeatures = ConvertVectorExprBits.getNextBit();
3560 S = ConvertVectorExpr::CreateEmpty(Context, HasFPFeatures);
3561 break;
3562 }
3563
3564 case EXPR_BLOCK:
3565 S = new (Context) BlockExpr(Empty);
3566 break;
3567
3570 Context,
3571 /*NumAssocs=*/Record[ASTStmtReader::NumExprFields]);
3572 break;
3573
3575 S = new (Context) ObjCStringLiteral(Empty);
3576 break;
3577
3579 S = new (Context) ObjCBoxedExpr(Empty);
3580 break;
3581
3585 break;
3586
3591 break;
3592
3593 case EXPR_OBJC_ENCODE:
3594 S = new (Context) ObjCEncodeExpr(Empty);
3595 break;
3596
3598 S = new (Context) ObjCSelectorExpr(Empty);
3599 break;
3600
3602 S = new (Context) ObjCProtocolExpr(Empty);
3603 break;
3604
3606 S = new (Context) ObjCIvarRefExpr(Empty);
3607 break;
3608
3610 S = new (Context) ObjCPropertyRefExpr(Empty);
3611 break;
3612
3614 S = new (Context) ObjCSubscriptRefExpr(Empty);
3615 break;
3616
3618 llvm_unreachable("mismatching AST file");
3619
3621 S = ObjCMessageExpr::CreateEmpty(Context,
3624 break;
3625
3626 case EXPR_OBJC_ISA:
3627 S = new (Context) ObjCIsaExpr(Empty);
3628 break;
3629
3631 S = new (Context) ObjCIndirectCopyRestoreExpr(Empty);
3632 break;
3633
3635 S = new (Context) ObjCBridgedCastExpr(Empty);
3636 break;
3637
3639 S = new (Context) ObjCForCollectionStmt(Empty);
3640 break;
3641
3642 case STMT_OBJC_CATCH:
3643 S = new (Context) ObjCAtCatchStmt(Empty);
3644 break;
3645
3646 case STMT_OBJC_FINALLY:
3647 S = new (Context) ObjCAtFinallyStmt(Empty);
3648 break;
3649
3650 case STMT_OBJC_AT_TRY:
3651 S = ObjCAtTryStmt::CreateEmpty(Context,
3654 break;
3655
3657 S = new (Context) ObjCAtSynchronizedStmt(Empty);
3658 break;
3659
3660 case STMT_OBJC_AT_THROW:
3661 S = new (Context) ObjCAtThrowStmt(Empty);
3662 break;
3663
3665 S = new (Context) ObjCAutoreleasePoolStmt(Empty);
3666 break;
3667
3669 S = new (Context) ObjCBoolLiteralExpr(Empty);
3670 break;
3671
3673 S = new (Context) ObjCAvailabilityCheckExpr(Empty);
3674 break;
3675
3676 case STMT_SEH_LEAVE:
3677 S = new (Context) SEHLeaveStmt(Empty);
3678 break;
3679
3680 case STMT_SEH_EXCEPT:
3681 S = new (Context) SEHExceptStmt(Empty);
3682 break;
3683
3684 case STMT_SEH_FINALLY:
3685 S = new (Context) SEHFinallyStmt(Empty);
3686 break;
3687
3688 case STMT_SEH_TRY:
3689 S = new (Context) SEHTryStmt(Empty);
3690 break;
3691
3692 case STMT_CXX_CATCH:
3693 S = new (Context) CXXCatchStmt(Empty);
3694 break;
3695
3696 case STMT_CXX_TRY:
3697 S = CXXTryStmt::Create(Context, Empty,
3698 /*numHandlers=*/Record[ASTStmtReader::NumStmtFields]);
3699 break;
3700
3703 Context, Empty,
3706 break;
3707
3712 break;
3713
3714 case STMT_CXX_FOR_RANGE:
3715 S = new (Context) CXXForRangeStmt(Empty);
3716 break;
3717
3719 S = new (Context) MSDependentExistsStmt(SourceLocation(), true,
3720 NestedNameSpecifierLoc(),
3721 DeclarationNameInfo(),
3722 nullptr);
3723 break;
3724
3726 S = OMPCanonicalLoop::createEmpty(Context);
3727 break;
3728
3732 break;
3733
3735 S =
3736 OMPParallelDirective::CreateEmpty(Context,
3738 Empty);
3739 break;
3740
3742 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3743 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3744 S = OMPSimdDirective::CreateEmpty(Context, NumClauses,
3745 CollapsedNum, Empty);
3746 break;
3747 }
3748
3750 unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
3751 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3752 S = OMPTileDirective::CreateEmpty(Context, NumClauses, NumLoops);
3753 break;
3754 }
3755
3757 unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
3758 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3759 S = OMPStripeDirective::CreateEmpty(Context, NumClauses, NumLoops);
3760 break;
3761 }
3762
3764 assert(Record[ASTStmtReader::NumStmtFields] == 1 && "Unroll directive accepts only a single loop");
3765 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3766 S = OMPUnrollDirective::CreateEmpty(Context, NumClauses);
3767 break;
3768 }
3769
3771 unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
3772 assert(Record[ASTStmtReader::NumStmtFields + 1] == 0 &&
3773 "Reverse directive has no clauses");
3774 S = OMPReverseDirective::CreateEmpty(Context, NumLoops);
3775 break;
3776 }
3777
3779 unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
3780 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3781 S = OMPSplitDirective::CreateEmpty(Context, NumClauses, NumLoops);
3782 break;
3783 }
3784
3786 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3787 S = OMPFuseDirective::CreateEmpty(Context, NumClauses);
3788 break;
3789 }
3790
3792 unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
3793 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3794 S = OMPInterchangeDirective::CreateEmpty(Context, NumClauses, NumLoops);
3795 break;
3796 }
3797
3799 unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
3800 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3801 S = OMPFlattenDirective::CreateEmpty(Context, NumClauses, NumLoops);
3802 break;
3803 }
3804
3806 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3807 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3808 S = OMPForDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3809 Empty);
3810 break;
3811 }
3812
3814 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3815 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3816 S = OMPForSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3817 Empty);
3818 break;
3819 }
3820
3824 break;
3825
3828 break;
3829
3833 break;
3834
3838 break;
3839
3842 break;
3843
3847 break;
3848
3850 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3851 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3852 S = OMPParallelForDirective::CreateEmpty(Context, NumClauses,
3853 CollapsedNum, Empty);
3854 break;
3855 }
3856
3858 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3859 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3860 S = OMPParallelForSimdDirective::CreateEmpty(Context, NumClauses,
3861 CollapsedNum, Empty);
3862 break;
3863 }
3864
3868 break;
3869
3873 break;
3874
3878 break;
3879
3883 break;
3884
3887 break;
3888
3891 break;
3892
3896 break;
3897
3901 break;
3902
3906 break;
3907
3911 break;
3912
3916 break;
3917
3921 break;
3922
3924 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3925 S = OMPOrderedStandaloneDirective::CreateEmpty(Context, NumClauses,
3926 Empty);
3927 break;
3928 }
3929
3931 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3932 S = OMPOrderedBlockAssocDirective::CreateEmpty(Context, NumClauses,
3933 Empty);
3934 break;
3935 }
3936
3940 break;
3941
3945 break;
3946
3950 break;
3951
3955 break;
3956
3960 break;
3961
3965 break;
3966
3968 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3969 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3970 S = OMPTargetParallelForDirective::CreateEmpty(Context, NumClauses,
3971 CollapsedNum, Empty);
3972 break;
3973 }
3974
3978 break;
3979
3983 break;
3984
3987 break;
3988
3992 break;
3993
3995 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3996 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3997 S = OMPTaskLoopDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3998 Empty);
3999 break;
4000 }
4001
4003 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4004 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4005 S = OMPTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
4006 CollapsedNum, Empty);
4007 break;
4008 }
4009
4011 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4012 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4013 S = OMPMasterTaskLoopDirective::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 = OMPMaskedTaskLoopDirective::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 = OMPMasterTaskLoopSimdDirective::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 = OMPMaskedTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
4038 CollapsedNum, Empty);
4039 break;
4040 }
4041
4043 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4044 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
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 Context, NumClauses, 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];
4077 S = OMPDistributeDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
4078 Empty);
4079 break;
4080 }
4081
4083 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4084 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4085 S = OMPDistributeParallelForDirective::CreateEmpty(Context, NumClauses,
4086 CollapsedNum, Empty);
4087 break;
4088 }
4089
4091 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4092 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4094 CollapsedNum,
4095 Empty);
4096 break;
4097 }
4098
4100 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4101 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4102 S = OMPDistributeSimdDirective::CreateEmpty(Context, NumClauses,
4103 CollapsedNum, Empty);
4104 break;
4105 }
4106
4108 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4109 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4110 S = OMPTargetParallelForSimdDirective::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 = OMPTargetSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
4119 Empty);
4120 break;
4121 }
4122
4124 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4125 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4126 S = OMPTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
4127 CollapsedNum, Empty);
4128 break;
4129 }
4130
4132 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4133 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4134 S = OMPTeamsDistributeSimdDirective::CreateEmpty(Context, NumClauses,
4135 CollapsedNum, Empty);
4136 break;
4137 }
4138
4140 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4141 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4143 Context, NumClauses, 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
4158 break;
4159
4161 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4162 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4163 S = OMPTargetTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
4164 CollapsedNum, Empty);
4165 break;
4166 }
4167
4169 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4170 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4172 Context, NumClauses, 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
4195 break;
4196
4200 break;
4201
4205 break;
4206
4208 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4209 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4210 S = OMPGenericLoopDirective::CreateEmpty(Context, NumClauses,
4211 CollapsedNum, Empty);
4212 break;
4213 }
4214
4216 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4217 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4218 S = OMPTeamsGenericLoopDirective::CreateEmpty(Context, NumClauses,
4219 CollapsedNum, Empty);
4220 break;
4221 }
4222
4224 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4225 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4227 CollapsedNum, Empty);
4228 break;
4229 }
4230
4232 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4233 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4234 S = OMPParallelGenericLoopDirective::CreateEmpty(Context, NumClauses,
4235 CollapsedNum, Empty);
4236 break;
4237 }
4238
4240 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4241 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4243 Context, NumClauses, CollapsedNum, Empty);
4244 break;
4245 }
4246
4248 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4249 S = OMPAssumeDirective::CreateEmpty(Context, NumClauses, Empty);
4250 break;
4251 }
4252
4254 auto NumArgs = Record[ASTStmtReader::NumExprFields];
4255 BitsUnpacker CallExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4256 CallExprBits.advance(1);
4257 auto HasFPFeatures = CallExprBits.getNextBit();
4258 S = CXXOperatorCallExpr::CreateEmpty(Context, NumArgs, HasFPFeatures,
4259 Empty);
4260 break;
4261 }
4262
4263 case EXPR_CXX_MEMBER_CALL: {
4264 auto NumArgs = Record[ASTStmtReader::NumExprFields];
4265 BitsUnpacker CallExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4266 CallExprBits.advance(1);
4267 auto HasFPFeatures = CallExprBits.getNextBit();
4268 S = CXXMemberCallExpr::CreateEmpty(Context, NumArgs, HasFPFeatures,
4269 Empty);
4270 break;
4271 }
4272
4274 S = new (Context) CXXRewrittenBinaryOperator(Empty);
4275 break;
4276
4277 case EXPR_CXX_CONSTRUCT:
4279 Context,
4280 /* NumArgs=*/Record[ASTStmtReader::NumExprFields]);
4281 break;
4282
4284 S = new (Context) CXXInheritedCtorInitExpr(Empty);
4285 break;
4286
4289 Context,
4290 /* NumArgs=*/Record[ASTStmtReader::NumExprFields]);
4291 break;
4292
4293 case EXPR_CXX_STATIC_CAST: {
4294 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
4295 BitsUnpacker CastExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4296 CastExprBits.advance(7);
4297 bool HasFPFeatures = CastExprBits.getNextBit();
4298 S = CXXStaticCastExpr::CreateEmpty(Context, PathSize, HasFPFeatures);
4299 break;
4300 }
4301
4302 case EXPR_CXX_DYNAMIC_CAST: {
4303 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
4304 S = CXXDynamicCastExpr::CreateEmpty(Context, PathSize);
4305 break;
4306 }
4307
4309 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
4310 S = CXXReinterpretCastExpr::CreateEmpty(Context, PathSize);
4311 break;
4312 }
4313
4315 S = CXXConstCastExpr::CreateEmpty(Context);
4316 break;
4317
4320 break;
4321
4323 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
4324 BitsUnpacker CastExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4325 CastExprBits.advance(7);
4326 bool HasFPFeatures = CastExprBits.getNextBit();
4327 S = CXXFunctionalCastExpr::CreateEmpty(Context, PathSize, HasFPFeatures);
4328 break;
4329 }
4330
4331 case EXPR_BUILTIN_BIT_CAST: {
4332#ifndef NDEBUG
4333 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
4334 assert(PathSize == 0 && "Wrong PathSize!");
4335#endif
4336 S = new (Context) BuiltinBitCastExpr(Empty);
4337 break;
4338 }
4339
4341 auto NumArgs = Record[ASTStmtReader::NumExprFields];
4342 BitsUnpacker CallExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4343 CallExprBits.advance(1);
4344 auto HasFPFeatures = CallExprBits.getNextBit();
4345 S = UserDefinedLiteral::CreateEmpty(Context, NumArgs, HasFPFeatures,
4346 Empty);
4347 break;
4348 }
4349
4351 S = new (Context) CXXStdInitializerListExpr(Empty);
4352 break;
4353
4355 S = new (Context) CXXBoolLiteralExpr(Empty);
4356 break;
4357
4359 S = new (Context) CXXNullPtrLiteralExpr(Empty);
4360 break;
4361
4363 S = new (Context) CXXTypeidExpr(Empty, true);
4364 break;
4365
4367 S = new (Context) CXXTypeidExpr(Empty, false);
4368 break;
4369
4371 S = new (Context) CXXUuidofExpr(Empty, true);
4372 break;
4373
4375 S = new (Context) MSPropertyRefExpr(Empty);
4376 break;
4377
4379 S = new (Context) MSPropertySubscriptExpr(Empty);
4380 break;
4381
4383 S = new (Context) CXXUuidofExpr(Empty, false);
4384 break;
4385
4386 case EXPR_CXX_THIS:
4387 S = CXXThisExpr::CreateEmpty(Context);
4388 break;
4389
4390 case EXPR_CXX_THROW:
4391 S = new (Context) CXXThrowExpr(Empty);
4392 break;
4393
4396 Context, /*HasRewrittenInit=*/Record[ASTStmtReader::NumExprFields]);
4397 break;
4398
4401 Context, /*HasRewrittenInit=*/Record[ASTStmtReader::NumExprFields]);
4402 break;
4403
4405 S = new (Context) CXXBindTemporaryExpr(Empty);
4406 break;
4407
4409 S = new (Context) CXXScalarValueInitExpr(Empty);
4410 break;
4411
4412 case EXPR_CXX_NEW:
4414 Context,
4416 /*HasInit=*/Record[ASTStmtReader::NumExprFields + 1],
4417 /*NumPlacementArgs=*/Record[ASTStmtReader::NumExprFields + 2],
4418 /*IsParenTypeId=*/Record[ASTStmtReader::NumExprFields + 3]);
4419 break;
4420
4421 case EXPR_CXX_DELETE:
4422 S = new (Context) CXXDeleteExpr(Empty);
4423 break;
4424
4426 S = new (Context) CXXPseudoDestructorExpr(Empty);
4427 break;
4428
4430 S = ExprWithCleanups::Create(Context, Empty,
4432 break;
4433
4435 unsigned NumTemplateArgs = Record[ASTStmtReader::NumExprFields];
4436 BitsUnpacker DependentScopeMemberBits(
4438 bool HasTemplateKWAndArgsInfo = DependentScopeMemberBits.getNextBit();
4439
4440 bool HasFirstQualifierFoundInScope =
4441 DependentScopeMemberBits.getNextBit();
4443 Context, HasTemplateKWAndArgsInfo, NumTemplateArgs,
4444 HasFirstQualifierFoundInScope);
4445 break;
4446 }
4447
4450 Context, /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]);
4451 break;
4452
4454 BitsUnpacker DependentScopeDeclRefBits(
4456 DependentScopeDeclRefBits.advance(ASTStmtReader::NumExprBits);
4457 bool HasTemplateKWAndArgsInfo = DependentScopeDeclRefBits.getNextBit();
4458 unsigned NumTemplateArgs =
4459 HasTemplateKWAndArgsInfo
4460 ? DependentScopeDeclRefBits.getNextBits(/*Width=*/16)
4461 : 0;
4463 Context, HasTemplateKWAndArgsInfo, NumTemplateArgs);
4464 break;
4465 }
4466
4470 break;
4471
4473 auto NumResults = Record[ASTStmtReader::NumExprFields];
4474 BitsUnpacker OverloadExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4475 auto HasTemplateKWAndArgsInfo = OverloadExprBits.getNextBit();
4476 auto NumTemplateArgs = HasTemplateKWAndArgsInfo
4478 : 0;
4480 Context, NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
4481 break;
4482 }
4483
4485 auto NumResults = Record[ASTStmtReader::NumExprFields];
4486 BitsUnpacker OverloadExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4487 auto HasTemplateKWAndArgsInfo = OverloadExprBits.getNextBit();
4488 auto NumTemplateArgs = HasTemplateKWAndArgsInfo
4490 : 0;
4492 Context, NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
4493 break;
4494 }
4495
4496 case EXPR_TYPE_TRAIT:
4500 break;
4501
4503 S = new (Context) ArrayTypeTraitExpr(Empty);
4504 break;
4505
4507 S = new (Context) ExpressionTraitExpr(Empty);
4508 break;
4509
4510 case EXPR_CXX_NOEXCEPT:
4511 S = new (Context) CXXNoexceptExpr(Empty);
4512 break;
4513
4515 S = new (Context) PackExpansionExpr(Empty);
4516 break;
4517
4518 case EXPR_SIZEOF_PACK:
4520 Context,
4521 /*NumPartialArgs=*/Record[ASTStmtReader::NumExprFields]);
4522 break;
4523
4524 case EXPR_PACK_INDEXING:
4526 Context,
4527 /*TransformedExprs=*/Record[ASTStmtReader::NumExprFields]);
4528 break;
4529
4531 S = new (Context) SubstNonTypeTemplateParmExpr(Empty);
4532 break;
4533
4535 S = new (Context) SubstNonTypeTemplateParmPackExpr(Empty);
4536 break;
4537
4541 break;
4542
4544 S = new (Context) MaterializeTemporaryExpr(Empty);
4545 break;
4546
4547 case EXPR_CXX_FOLD:
4548 S = new (Context) CXXFoldExpr(Empty);
4549 break;
4550
4553 Context, /*numExprs=*/Record[ASTStmtReader::NumExprFields], Empty);
4554 break;
4555
4556 case EXPR_OPAQUE_VALUE:
4557 S = new (Context) OpaqueValueExpr(Empty);
4558 break;
4559
4560 case EXPR_CUDA_KERNEL_CALL: {
4561 auto NumArgs = Record[ASTStmtReader::NumExprFields];
4562 BitsUnpacker CallExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4563 CallExprBits.advance(1);
4564 auto HasFPFeatures = CallExprBits.getNextBit();
4565 S = CUDAKernelCallExpr::CreateEmpty(Context, NumArgs, HasFPFeatures,
4566 Empty);
4567 break;
4568 }
4569
4570 case EXPR_ASTYPE:
4571 S = new (Context) AsTypeExpr(Empty);
4572 break;
4573
4574 case EXPR_PSEUDO_OBJECT: {
4575 unsigned numSemanticExprs = Record[ASTStmtReader::NumExprFields];
4576 S = PseudoObjectExpr::Create(Context, Empty, numSemanticExprs);
4577 break;
4578 }
4579
4580 case EXPR_ATOMIC:
4581 S = new (Context) AtomicExpr(Empty);
4582 break;
4583
4584 case EXPR_LAMBDA: {
4585 unsigned NumCaptures = Record[ASTStmtReader::NumExprFields];
4586 S = LambdaExpr::CreateDeserialized(Context, NumCaptures);
4587 break;
4588 }
4589
4590 case STMT_COROUTINE_BODY: {
4591 unsigned NumParams = Record[ASTStmtReader::NumStmtFields];
4592 S = CoroutineBodyStmt::Create(Context, Empty, NumParams);
4593 break;
4594 }
4595
4596 case STMT_CORETURN:
4597 S = new (Context) CoreturnStmt(Empty);
4598 break;
4599
4600 case EXPR_COAWAIT:
4601 S = new (Context) CoawaitExpr(Empty);
4602 break;
4603
4604 case EXPR_COYIELD:
4605 S = new (Context) CoyieldExpr(Empty);
4606 break;
4607
4609 S = new (Context) DependentCoawaitExpr(Empty);
4610 break;
4611
4613 S = new (Context) ConceptSpecializationExpr(Empty);
4614 break;
4615 }
4616
4618 S = new (Context) CXXExpansionSelectExpr(Empty);
4619 break;
4620
4622 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4623 S = OpenACCComputeConstruct::CreateEmpty(Context, NumClauses);
4624 break;
4625 }
4627 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4628 S = OpenACCLoopConstruct::CreateEmpty(Context, NumClauses);
4629 break;
4630 }
4632 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4633 S = OpenACCCombinedConstruct::CreateEmpty(Context, NumClauses);
4634 break;
4635 }
4637 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4638 S = OpenACCDataConstruct::CreateEmpty(Context, NumClauses);
4639 break;
4640 }
4642 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4643 S = OpenACCEnterDataConstruct::CreateEmpty(Context, NumClauses);
4644 break;
4645 }
4647 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4648 S = OpenACCExitDataConstruct::CreateEmpty(Context, NumClauses);
4649 break;
4650 }
4652 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4653 S = OpenACCHostDataConstruct::CreateEmpty(Context, NumClauses);
4654 break;
4655 }
4657 unsigned NumExprs = Record[ASTStmtReader::NumStmtFields];
4658 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4659 S = OpenACCWaitConstruct::CreateEmpty(Context, NumExprs, NumClauses);
4660 break;
4661 }
4663 unsigned NumVars = Record[ASTStmtReader::NumStmtFields];
4664 S = OpenACCCacheConstruct::CreateEmpty(Context, NumVars);
4665 break;
4666 }
4668 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4669 S = OpenACCInitConstruct::CreateEmpty(Context, NumClauses);
4670 break;
4671 }
4673 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4674 S = OpenACCShutdownConstruct::CreateEmpty(Context, NumClauses);
4675 break;
4676 }
4678 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4679 S = OpenACCSetConstruct::CreateEmpty(Context, NumClauses);
4680 break;
4681 }
4683 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4684 S = OpenACCUpdateConstruct::CreateEmpty(Context, NumClauses);
4685 break;
4686 }
4688 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4689 S = OpenACCAtomicConstruct::CreateEmpty(Context, NumClauses);
4690 break;
4691 }
4692 case EXPR_REQUIRES: {
4693 unsigned numLocalParameters = Record[ASTStmtReader::NumExprFields];
4694 unsigned numRequirement = Record[ASTStmtReader::NumExprFields + 1];
4695 S = RequiresExpr::Create(Context, Empty, numLocalParameters,
4696 numRequirement);
4697 break;
4698 }
4699 case EXPR_HLSL_OUT_ARG:
4700 S = HLSLOutArgExpr::CreateEmpty(Context);
4701 break;
4702 case EXPR_REFLECT: {
4703 S = CXXReflectExpr::CreateEmpty(Context);
4704 break;
4705 }
4706 }
4707
4708 // We hit a STMT_STOP, so we're done with this expression.
4709 if (Finished)
4710 break;
4711
4712 ++NumStatementsRead;
4713
4714 if (S && !IsStmtReference) {
4715 Reader.Visit(S);
4716 StmtEntries[Cursor.GetCurrentBitNo()] = S;
4717 }
4718
4719 assert(Record.getIdx() == Record.size() &&
4720 "Invalid deserialization of statement");
4721 StmtStack.push_back(S);
4722 }
4723Done:
4724 assert(StmtStack.size() > PrevNumStmts && "Read too many sub-stmts!");
4725 assert(StmtStack.size() == PrevNumStmts + 1 && "Extra expressions on stack!");
4726 return StmtStack.pop_back_val();
4727}
This file provides AST data structures related to concepts.
Defines the clang::ASTContext interface.
static concepts::Requirement::SubstitutionDiagnostic * readSubstitutionDiagnostic(ASTRecordReader &Record)
static ConstraintSatisfaction readConstraintSatisfaction(ASTRecordReader &Record)
Defines enumerations for traits support.
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines the C++ template declaration subclasses.
Defines the clang::Expr interface and subclasses for C++ expressions.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the clang::LangOptions interface.
llvm::MachO::Record Record
Definition MachO.h:31
This file defines OpenMP AST classes for clauses.
Defines some OpenMP-specific enums and functions.
static std::string toString(const clang::SanitizerSet &Sanitizers)
Produce a string containing comma-separated names of sanitizers in Sanitizers set.
Defines the clang::SourceLocation class and associated facilities.
Defines various enumerations that describe declaration and type specifiers.
Defines the Objective-C statement AST node classes.
This file defines OpenMP AST classes for executable directives and clauses.
This file defines SYCL AST classes used to represent calls to SYCL kernels.
C Language Family Type Representation.
static OMPAssumeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
static OMPAtomicDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPBarrierDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static OMPCancelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPCancellationPointDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static OMPCriticalDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPDepobjDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPDispatchDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPErrorDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPFlattenDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty 'pragma omp flatten' AST node for deserialization.
static OMPFlushDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPFuseDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses)
Build an empty 'pragma omp fuse' AST node for deserialization.
static OMPGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with a place for NumClauses clauses.
static OMPInterchangeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty 'pragma omp interchange' AST node for deserialization.
static OMPInteropDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
void setNumGeneratedTopLevelLoops(unsigned N)
static OMPMaskedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPMaskedTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPMaskedTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPMasterDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static OMPMasterTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPMasterTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPMetaDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
static OMPOrderedBlockAssocDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPOrderedStandaloneDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPParallelGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPParallelMaskedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPParallelMaskedTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPParallelMaskedTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPParallelMasterDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPParallelMasterTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPParallelMasterTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPParallelSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPReverseDirective * CreateEmpty(const ASTContext &C, unsigned NumLoops)
Build an empty 'pragma omp reverse' AST node for deserialization.
static OMPScanDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPScopeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
void setHasCancel(bool Has)
Set cancel state.
static OMPSectionDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static OMPSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPSingleDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPSplitDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty 'pragma omp split' AST node for deserialization.
static OMPStripeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty 'pragma omp stripe' AST node for deserialization.
static OMPTargetDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
static OMPTargetDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetEnterDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
static OMPTargetExitDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
static OMPTargetParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetParallelGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetTeamsGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetUpdateDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTaskDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTaskgroupDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPTaskwaitDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPTaskyieldDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static OMPTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTeamsGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTileDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty 'pragma omp tile' AST node for deserialization.
static OMPUnrollDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses)
Build an empty 'pragma omp unroll' AST node for deserialization.
static OpenACCAtomicConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
ArrayRef< Expr * > getVarList() const
static OpenACCCacheConstruct * CreateEmpty(const ASTContext &C, unsigned NumVars)
static OpenACCCombinedConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static OpenACCDataConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static OpenACCEnterDataConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static OpenACCExitDataConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static OpenACCHostDataConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static OpenACCInitConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static OpenACCLoopConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static OpenACCSetConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static OpenACCShutdownConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static OpenACCUpdateConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static OpenACCWaitConstruct * CreateEmpty(const ASTContext &C, unsigned NumExprs, unsigned NumClauses)
void setValue(const ASTContext &C, const llvm::APInt &Val)
bool needsCleanup() const
Returns whether the object performed allocations.
Definition APValue.cpp:500
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:4598
void setLabel(LabelDecl *L)
Definition Expr.h:4622
void setLabelLoc(SourceLocation L)
Definition Expr.h:4616
void setAmpAmpLoc(SourceLocation L)
Definition Expr.h:4614
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Definition Expr.h:6075
Represents a loop initializing the elements of an array.
Definition Expr.h:6022
This class represents BOTH the OpenMP Array Section and OpenACC 'subarray', with a boolean differenti...
Definition Expr.h:7273
bool isOMPArraySection() const
Definition Expr.h:7347
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition Expr.h:2769
void setRHS(Expr *E)
Definition Expr.h:2804
void setRBracketLoc(SourceLocation L)
Definition Expr.h:2820
void setLHS(Expr *E)
Definition Expr.h:2800
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:6787
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
Definition Stmt.h:3289
void setSimple(bool V)
Definition Stmt.h:3323
void setAsmLoc(SourceLocation L)
Definition Stmt.h:3320
void setVolatile(bool V)
Definition Stmt.h:3326
unsigned NumInputs
Definition Stmt.h:3304
unsigned getNumClobbers() const
Definition Stmt.h:3380
unsigned getNumOutputs() const
Definition Stmt.h:3348
unsigned NumOutputs
Definition Stmt.h:3303
unsigned NumClobbers
Definition Stmt.h:3305
unsigned getNumInputs() const
Definition Stmt.h:3370
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Definition Expr.h:6982
unsigned getNumSubExprs() const
Definition Expr.h:7055
Represents an attribute applied to a statement.
Definition Stmt.h:2215
static AttributedStmt * CreateEmpty(const ASTContext &C, unsigned NumAttrs)
Definition Stmt.cpp:450
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Definition Expr.h:4501
A builtin binary operation expression such as "x + y" or "x <= y".
Definition Expr.h:4086
void setLHS(Expr *E)
Definition Expr.h:4137
void setHasStoredFPFeatures(bool B)
Set and fetch the bit that shows whether FPFeatures needs to be allocated in Trailing Storage.
Definition Expr.h:4270
void setOperatorLoc(SourceLocation L)
Definition Expr.h:4129
void setRHS(Expr *E)
Definition Expr.h:4139
void setExcludedOverflowPattern(bool B)
Set and get the bit that informs arithmetic overflow sanitizers whether or not they should exclude ce...
Definition Expr.h:4275
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:4288
void setOpcode(Opcode Opc)
Definition Expr.h:4134
BinaryOperatorKind Opcode
Definition Expr.h:4091
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition Expr.h:6726
void setBlockDecl(BlockDecl *BD)
Definition Expr.h:6740
BreakStmt - This represents a break.
Definition Stmt.h:3147
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:4017
static CStyleCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize, bool HasFPFeatures)
Definition Expr.cpp:2159
void setRParenLoc(SourceLocation L)
Definition Expr.h:4053
void setLParenLoc(SourceLocation L)
Definition Expr.h:4050
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:2991
void setRParenLoc(SourceLocation L)
Definition Expr.h:3323
void setCoroElideSafe(bool V=true)
Definition Expr.h:3166
void setArg(unsigned Arg, Expr *ArgExpr)
setArg - Set the specified argument.
Definition Expr.h:3208
void setADLCallKind(ADLCallKind V=UsesADL)
Definition Expr.h:3145
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:3155
void setPreArg(unsigned I, Stmt *PreArg)
Definition Expr.h:3088
void setStoredFPFeatures(FPOptionsOverride F)
Set FPOptionsOverride in trailing storage. Used only by Serialization.
Definition Expr.h:3272
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition Expr.h:3182
void setCallee(Expr *F)
Definition Expr.h:3140
void setBody(Stmt *B)
Definition Decl.cpp:5785
This captures a statement into a function.
Definition Stmt.h:3949
static CapturedStmt * CreateDeserialized(const ASTContext &Context, unsigned NumCaptures)
Definition Stmt.cpp:1471
Expr ** capture_init_iterator
Iterator that walks over the capture initialization arguments.
Definition Stmt.h:4108
void setCapturedRegionKind(CapturedRegionKind Kind)
Set the captured region kind.
Definition Stmt.cpp:1513
CapturedDecl * getCapturedDecl()
Retrieve the outlined function declaration.
Definition Stmt.cpp:1493
Stmt * getCapturedStmt()
Retrieve the statement being captured.
Definition Stmt.h:4053
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument.
Definition Stmt.h:4126
void setCapturedDecl(CapturedDecl *D)
Set the outlined function declaration.
Definition Stmt.cpp:1502
void setCapturedRecordDecl(RecordDecl *D)
Set the record declaration for captured variables.
Definition Stmt.h:4073
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument.
Definition Stmt.h:4136
capture_range captures()
Definition Stmt.h:4087
VariableCaptureKind
The different capture forms: by 'this', by reference, capture for variable-length array type etc.
Definition Stmt.h:3953
CaseStmt - Represent a case statement.
Definition Stmt.h:1932
void setEllipsisLoc(SourceLocation L)
Set the location of the ... in a case statement of the form LHS ... RHS.
Definition Stmt.h:2008
static CaseStmt * CreateEmpty(const ASTContext &Ctx, bool CaseStmtIsGNURange)
Build an empty case statement.
Definition Stmt.cpp:1317
void setLHS(Expr *Val)
Definition Stmt.h:2023
void setSubStmt(Stmt *S)
Definition Stmt.h:2050
void setRHS(Expr *Val)
Definition Stmt.h:2039
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition Expr.h:3724
FPOptionsOverride * getTrailingFPFeatures()
Return a pointer to the trailing FPOptions.
Definition Expr.cpp:2089
path_iterator path_begin()
Definition Expr.h:3794
unsigned path_size() const
Definition Expr.h:3793
void setCastKind(CastKind K)
Definition Expr.h:3769
bool hasStoredFPFeatures() const
Definition Expr.h:3823
CXXBaseSpecifier ** path_iterator
Definition Expr.h:3790
void setSubExpr(Expr *E)
Definition Expr.h:3776
void setValue(unsigned Val)
Definition Expr.h:1659
void setLocation(SourceLocation Location)
Definition Expr.h:1655
void setKind(CharacterLiteralKind kind)
Definition Expr.h:1656
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition Expr.h:4896
void setRParenLoc(SourceLocation L)
Definition Expr.h:4947
void setIsConditionTrue(bool isTrue)
Definition Expr.h:4924
void setBuiltinLoc(SourceLocation L)
Definition Expr.h:4944
void setRHS(Expr *E)
Definition Expr.h:4941
void setCond(Expr *E)
Definition Expr.h:4937
void setLHS(Expr *E)
Definition Expr.h:4939
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:4348
void setComputationResultType(QualType T)
Definition Expr.h:4386
static CompoundAssignOperator * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
Definition Expr.cpp:5158
void setComputationLHSType(QualType T)
Definition Expr.h:4383
CompoundLiteralExpr - [C99 6.5.2.5].
Definition Expr.h:3653
void setFileScope(bool FS)
Definition Expr.h:3686
void setTypeSourceInfo(TypeSourceInfo *tinfo)
Definition Expr.h:3694
void setLParenLoc(SourceLocation L)
Definition Expr.h:3689
void setInitializer(Expr *E)
Definition Expr.h:3683
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition Stmt.h:1752
static CompoundStmt * CreateEmpty(const ASTContext &C, unsigned NumStmts, bool HasFPFeatures)
Definition Stmt.cpp:409
bool hasStoredFPFeatures() const
Definition Stmt.h:1799
Represents the specialization of a concept - evaluates to a prvalue of type bool.
ConditionalOperator - The ?
Definition Expr.h:4439
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition Expr.h:1106
ConstantResultStorageKind getResultStorageKind() const
Definition Expr.h:1175
static ConstantExpr * CreateEmpty(const ASTContext &Context, ConstantResultStorageKind StorageKind)
Definition Expr.cpp:373
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
Definition ASTConcept.h:47
llvm::SmallVector< UnsatisfiedConstraintRecord, 4 > Details
The substituted constraint expr, if the template arguments could be substituted into them,...
Definition ASTConcept.h:67
ContinueStmt - This represents a continue.
Definition Stmt.h:3131
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition Expr.h:4767
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:4840
bool hasStoredFPFeatures() const
Is FPFeatures in Trailing Storage?
Definition Expr.h:4825
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:1294
bool hasTemplateKWAndArgsInfo() const
Definition Expr.h:1415
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:1371
bool hasQualifier() const
Determine whether this declaration reference was preceded by a C++ nested-name-specifier,...
Definition Expr.h:1383
ValueDecl * getDecl()
Definition Expr.h:1362
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
Definition Stmt.h:1643
void setStartLoc(SourceLocation L)
Definition Stmt.h:1665
void setEndLoc(SourceLocation L)
Definition Stmt.h:1667
void setDeclGroup(DeclGroupRef DGR)
Definition Stmt.h:1663
Decl - This represents one declaration (or definition), e.g.
Definition DeclBase.h:86
void setSubStmt(Stmt *S)
Definition Stmt.h:2095
DeferStmt - This represents a deferred statement.
Definition Stmt.h:3248
void setBody(Stmt *S)
Definition Stmt.h:3269
void setDeferLoc(SourceLocation DeferLoc)
Definition Stmt.h:3263
static DeferStmt * CreateEmpty(ASTContext &Context, EmptyShell Empty)
Definition Stmt.cpp:1548
Represents a 'co_await' expression while the type of the promise is dependent.
Definition ExprCXX.h: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:5605
static DesignatedInitExpr * CreateEmpty(const ASTContext &C, unsigned NumIndexExprs)
Definition Expr.cpp:4889
void setSubExpr(unsigned Idx, Expr *E)
Definition Expr.h:5891
void setGNUSyntax(bool GNU)
Definition Expr.h:5870
void setEqualOrColonLoc(SourceLocation L)
Definition Expr.h:5861
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:5885
void setBase(Expr *Base)
Definition Expr.h:5988
void setUpdater(Expr *Updater)
Definition Expr.h:5993
static Designator CreateArrayRangeDesignator(Expr *Start, Expr *End, SourceLocation LBracketLoc, SourceLocation EllipsisLoc)
Creates a GNU array-range designator.
Definition Designator.h:185
static Designator CreateArrayDesignator(Expr *Index, SourceLocation LBracketLoc)
Creates an array designator.
Definition Designator.h:155
static Designator CreateFieldDesignator(const IdentifierInfo *FieldName, SourceLocation DotLoc, SourceLocation FieldLoc)
Creates a field designator.
Definition Designator.h:115
DoStmt - This represents a 'do/while' stmt.
Definition Stmt.h:2844
void setWhileLoc(SourceLocation L)
Definition Stmt.h:2876
void setDoLoc(SourceLocation L)
Definition Stmt.h:2874
void setRParenLoc(SourceLocation L)
Definition Stmt.h:2878
void setBody(Stmt *Body)
Definition Stmt.h:2871
void setCond(Expr *Cond)
Definition Stmt.h:2867
void setAccessorLoc(SourceLocation L)
Definition Expr.h:6643
void setAccessor(IdentifierInfo *II)
Definition Expr.h:6640
void setBase(Expr *E)
Definition Expr.h:6637
Represents a reference to emded data.
Definition Expr.h:5183
ExplicitCastExpr - An explicit cast written in the source code.
Definition Expr.h:3976
void setTypeInfoAsWritten(TypeSourceInfo *writtenTy)
Definition Expr.h:3999
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:113
void setType(QualType t)
Definition Expr.h:146
bool isValueDependent() const
Determines whether the value of this expression depends on.
Definition Expr.h:178
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on.
Definition Expr.h:224
void setValueKind(ExprValueKind Cat)
setValueKind - Set the value kind produced by this expression.
Definition Expr.h:465
void setObjectKind(ExprObjectKind Cat)
setObjectKind - Set the object kind produced by this expression.
Definition Expr.h:468
QualType getType() const
Definition Expr.h:145
void setDependence(ExprDependence Deps)
Each concrete expr subclass is expected to compute its dependence and call this in the constructor.
Definition Expr.h:138
An expression trait intrinsic.
Definition ExprCXX.h:3084
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition Expr.h:6664
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:1607
void setScale(unsigned S)
Definition Expr.h:1610
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:1712
void setValue(const ASTContext &C, const llvm::APFloat &Val)
Definition Expr.h:1693
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:1707
void setExact(bool E)
Definition Expr.h:1724
void setLocation(SourceLocation L)
Definition Expr.h:1732
ForStmt - This represents a 'for (init;cond;inc)' stmt.
Definition Stmt.h:2900
void setBody(Stmt *S)
Definition Stmt.h:2954
void setCond(Expr *E)
Definition Stmt.h:2952
void setForLoc(SourceLocation L)
Definition Stmt.h:2957
void setInc(Expr *E)
Definition Stmt.h:2953
void setLParenLoc(SourceLocation L)
Definition Stmt.h:2959
void setInit(Stmt *S)
Definition Stmt.h:2951
void setConditionVariableDeclStmt(DeclStmt *CondVar)
Definition Stmt.h:2938
void setRParenLoc(SourceLocation L)
Definition Stmt.h:2961
void setSubExpr(Expr *E)
As with any mutator of the AST, be very careful when modifying an existing AST to preserve its invari...
Definition Expr.h:1091
Stmt * SubExpr
Definition Expr.h:1075
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:3458
unsigned getNumLabels() const
Definition Stmt.h:3608
void setAsmStringExpr(Expr *E)
Definition Stmt.h:3487
void setRParenLoc(SourceLocation L)
Definition Stmt.h:3481
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Definition Expr.h:4971
void setTokenLocation(SourceLocation L)
Definition Expr.h:4986
Represents a C11 generic selection.
Definition Expr.h:6236
unsigned getNumAssocs() const
The number of association expressions.
Definition Expr.h:6478
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:2981
void setLabel(LabelDecl *D)
Definition Stmt.h:2995
void setLabelLoc(SourceLocation L)
Definition Stmt.h:3000
void setGotoLoc(SourceLocation L)
Definition Stmt.h:2998
This class represents temporary values used to represent inout and out arguments in HLSL.
Definition Expr.h:7451
static HLSLOutArgExpr * CreateEmpty(const ASTContext &Ctx)
Definition Expr.cpp:5710
IfStmt - This represents an if/then/else.
Definition Stmt.h:2271
void setThen(Stmt *Then)
Definition Stmt.h:2365
void setConditionVariableDeclStmt(DeclStmt *CondVar)
Definition Stmt.h:2416
void setCond(Expr *Cond)
Definition Stmt.h:2356
void setLParenLoc(SourceLocation Loc)
Definition Stmt.h:2490
void setElse(Stmt *Else)
Definition Stmt.h:2379
void setElseLoc(SourceLocation ElseLoc)
Definition Stmt.h:2445
static IfStmt * CreateEmpty(const ASTContext &Ctx, bool HasElse, bool HasVar, bool HasInit)
Create an empty IfStmt optionally with storage for an else statement, condition variable and init exp...
Definition Stmt.cpp:1059
void setStatementKind(IfStatementKind Kind)
Definition Stmt.h:2468
void setRParenLoc(SourceLocation Loc)
Definition Stmt.h:2492
void setIfLoc(SourceLocation IfLoc)
Definition Stmt.h:2438
void setInit(Stmt *Init)
Definition Stmt.h:2431
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1....
Definition Expr.h:1755
void setSubExpr(Expr *E)
Definition Expr.h:1769
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition Expr.h:3901
static ImplicitCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize, bool HasFPFeatures)
Definition Expr.cpp:2132
void setIsPartOfExplicitCast(bool PartOfExplicitCast)
Definition Expr.h:3933
Represents an implicitly-generated value initialization of an object of a given type.
Definition Expr.h:6111
IndirectGotoStmt - This represents an indirect goto.
Definition Stmt.h:3020
void setTarget(Expr *E)
Definition Stmt.h:3044
void setGotoLoc(SourceLocation L)
Definition Stmt.h:3035
void setStarLoc(SourceLocation L)
Definition Stmt.h:3037
Describes an C or C++ initializer list.
Definition Expr.h:5356
void setSyntacticForm(InitListExpr *Init)
Definition Expr.h:5530
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:5515
void setRBraceLoc(SourceLocation Loc)
Definition Expr.h:5517
void sawArrayRangeDesignator(bool ARD=true)
Definition Expr.h:5540
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:1562
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:2158
void setSubStmt(Stmt *SS)
Definition Stmt.h:2183
void setDecl(LabelDecl *D)
Definition Stmt.h:2177
void setIdentLoc(SourceLocation L)
Definition Stmt.h:2174
void setSideEntry(bool SE)
Definition Stmt.h:2206
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition ExprCXX.h: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:3069
void setLabelDecl(LabelDecl *S)
Definition Stmt.h:3109
void setLabelLoc(SourceLocation L)
Definition Stmt.h:3105
void setKwLoc(SourceLocation L)
Definition Stmt.h:3095
This represents a Microsoft inline-assembly statement extension.
Definition Stmt.h:3677
Representation of a Microsoft __if_exists or __if_not_exists statement with a dependent name.
Definition StmtCXX.h:254
A member reference to an MSPropertyDecl.
Definition ExprCXX.h: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:2843
void setRBracketLoc(SourceLocation L)
Definition Expr.h:2890
MatrixSubscriptExpr - Matrix subscript expression for the MatrixType extension.
Definition Expr.h:2913
void setColumnIdx(Expr *E)
Definition Expr.h:2953
void setBase(Expr *E)
Definition Expr.h:2941
void setRowIdx(Expr *E)
Definition Expr.h:2945
void setRBracketLoc(SourceLocation L)
Definition Expr.h:2968
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition Expr.h:3412
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:341
Represents a place-holder for an object not to be initialized by anything.
Definition Expr.h:5931
NullStmt - This is the null statement ";": C99 6.8.3p3.
Definition Stmt.h:1715
void setSemiLoc(SourceLocation L)
Definition Stmt.h:1727
An explicit cast in C or a C-style cast in C++, which uses the syntax ([s1][s2]......
Definition ExprOpenMP.h:24
void setLParenLoc(SourceLocation L)
Definition ExprOpenMP.h:69
static OMPArrayShapingExpr * CreateEmpty(const ASTContext &Context, unsigned NumDims)
Definition Expr.cpp: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:2575
void setOperatorLoc(SourceLocation L)
Definition Expr.h:2609
static OffsetOfExpr * CreateEmpty(const ASTContext &C, unsigned NumComps, unsigned NumExprs)
Definition Expr.cpp:1703
void setIndexExpr(unsigned Idx, Expr *E)
Definition Expr.h:2642
void setTypeSourceInfo(TypeSourceInfo *tsi)
Definition Expr.h:2618
void setComponent(unsigned Idx, OffsetOfNode ON)
Definition Expr.h:2626
unsigned getNumExpressions() const
Definition Expr.h:2646
void setRParenLoc(SourceLocation R)
Definition Expr.h:2613
unsigned getNumComponents() const
Definition Expr.h:2630
Kind
The kind of offsetof node we have.
Definition Expr.h:2472
@ Array
An index into an array.
Definition Expr.h:2474
@ Identifier
A field in a dependent type, known only by its name.
Definition Expr.h:2478
@ Field
A field.
Definition Expr.h:2476
@ Base
An implicit indirection through a C++ base class, when the field found is in a base class.
Definition Expr.h:2481
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
Definition Expr.h:1202
void setIsUnique(bool V)
Definition Expr.h:1254
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:2138
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:2230
void setLParen(SourceLocation Loc)
Definition Expr.h:2256
void setIsProducedByFoldExpansion(bool ProducedByFoldExpansion=true)
Definition Expr.h:2275
void setRParen(SourceLocation Loc)
Definition Expr.h:2260
void setSubExpr(Expr *E)
Definition Expr.h:2249
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:6164
[C99 6.4.2.2] - A predefined identifier such as func.
Definition Expr.h:2053
void setLocation(SourceLocation L)
Definition Expr.h:2095
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:6858
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:7557
child_range children()
Definition Expr.h:7570
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:3172
void setRetValue(Expr *E)
Definition Stmt.h:3201
void setReturnLoc(SourceLocation L)
Definition Stmt.h:3222
void setNRVOCandidate(const VarDecl *Var)
Set the variable that might be used for the named return value optimization.
Definition Stmt.h:3215
static ReturnStmt * CreateEmpty(const ASTContext &Ctx, bool HasNRVOCandidate)
Create an empty return statement, optionally with storage for an NRVO candidate.
Definition Stmt.cpp:1298
Represents a __leave statement.
Definition Stmt.h:3910
void setLeaveLoc(SourceLocation L)
Definition Stmt.h:3921
SYCLKernelCallStmt represents the transformation that is applied to the body of a function declared w...
Definition StmtSYCL.h:36
void setOriginalStmt(CompoundStmt *CS)
Definition StmtSYCL.h:59
void setKernelLaunchStmt(Stmt *S)
Definition StmtSYCL.h:64
void setOutlinedFunctionDecl(OutlinedFunctionDecl *OFD)
Definition StmtSYCL.h:69
static SYCLUniqueStableNameExpr * CreateEmpty(const ASTContext &Ctx)
Definition Expr.cpp:592
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition Expr.h:4691
void setExprs(const ASTContext &C, ArrayRef< Expr * > Exprs)
Definition Expr.cpp:4653
void setRParenLoc(SourceLocation L)
Definition Expr.h:4712
void setBuiltinLoc(SourceLocation L)
Definition Expr.h:4709
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:5074
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:4643
void setRParenLoc(SourceLocation L)
Definition Expr.h:4670
void setLParenLoc(SourceLocation L)
Definition Expr.h:4668
void setSubStmt(CompoundStmt *S)
Definition Expr.h:4662
StmtVisitor - This class implements a simple visitor for Stmt subclasses.
Stmt - This represents one statement.
Definition Stmt.h:85
ExpressionTraitExprBitfields ExpressionTraitExprBits
Definition Stmt.h:1407
GenericSelectionExprBitfields GenericSelectionExprBits
Definition Stmt.h:1371
InitListExprBitfields InitListExprBits
Definition Stmt.h:1369
LambdaExprBitfields LambdaExprBits
Definition Stmt.h:1404
AttributedStmtBitfields AttributedStmtBits
Definition Stmt.h:1342
UnresolvedLookupExprBitfields UnresolvedLookupExprBits
Definition Stmt.h:1400
SubstNonTypeTemplateParmExprBitfields SubstNonTypeTemplateParmExprBits
Definition Stmt.h:1403
CXXNoexceptExprBitfields CXXNoexceptExprBits
Definition Stmt.h:1402
CXXRewrittenBinaryOperatorBitfields CXXRewrittenBinaryOperatorBits
Definition Stmt.h:1383
ExprWithCleanupsBitfields ExprWithCleanupsBits
Definition Stmt.h:1396
StmtClass getStmtClass() const
Definition Stmt.h:1505
CXXScalarValueInitExprBitfields CXXScalarValueInitExprBits
Definition Stmt.h:1390
CXXConstructExprBitfields CXXConstructExprBits
Definition Stmt.h:1395
CXXDependentScopeMemberExprBitfields CXXDependentScopeMemberExprBits
Definition Stmt.h:1398
TypeTraitExprBitfields TypeTraitExprBits
Definition Stmt.h:1393
CXXNewExprBitfields CXXNewExprBits
Definition Stmt.h:1391
SourceLocExprBitfields SourceLocExprBits
Definition Stmt.h:1373
ConstantExprBitfields ConstantExprBits
Definition Stmt.h:1356
RequiresExprBitfields RequiresExprBits
Definition Stmt.h:1405
CXXFoldExprBitfields CXXFoldExprBits
Definition Stmt.h:1408
StmtExprBitfields StmtExprBits
Definition Stmt.h:1378
StringLiteralBitfields StringLiteralBits
Definition Stmt.h:1360
OpaqueValueExprBitfields OpaqueValueExprBits
Definition Stmt.h:1419
CXXThrowExprBitfields CXXThrowExprBits
Definition Stmt.h:1387
MemberExprBitfields MemberExprBits
Definition Stmt.h:1366
PackIndexingExprBitfields PackIndexingExprBits
Definition Stmt.h:1409
DeclRefExprBitfields DeclRefExprBits
Definition Stmt.h:1358
CXXOperatorCallExprBitfields CXXOperatorCallExprBits
Definition Stmt.h:1382
CXXDefaultInitExprBitfields CXXDefaultInitExprBits
Definition Stmt.h:1389
NullStmtBitfields NullStmtBits
Definition Stmt.h:1339
ArrayTypeTraitExprBitfields ArrayTypeTraitExprBits
Definition Stmt.h:1406
PredefinedExprBitfields PredefinedExprBits
Definition Stmt.h:1357
UnresolvedMemberExprBitfields UnresolvedMemberExprBits
Definition Stmt.h:1401
PseudoObjectExprBitfields PseudoObjectExprBits
Definition Stmt.h:1372
CXXDeleteExprBitfields CXXDeleteExprBits
Definition Stmt.h:1392
CXXDefaultArgExprBitfields CXXDefaultArgExprBits
Definition Stmt.h:1388
StringLiteral - This represents a string literal expression, e.g.
Definition Expr.h:1823
unsigned getLength() const
Definition Expr.h:1948
StringLiteralKind getKind() const
Definition Expr.h:1952
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:1989
unsigned getCharByteWidth() const
Definition Expr.h:1950
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:1912
void setKeywordLoc(SourceLocation L)
Definition Stmt.h:1910
void setNextSwitchCase(SwitchCase *SC)
Definition Stmt.h:1907
SwitchStmt - This represents a 'switch' stmt.
Definition Stmt.h:2521
void setCond(Expr *Cond)
Definition Stmt.h:2592
void setSwitchLoc(SourceLocation L)
Definition Stmt.h:2657
void setConditionVariableDeclStmt(DeclStmt *CondVar)
Definition Stmt.h:2647
void setBody(Stmt *Body)
Definition Stmt.h:2599
void setRParenLoc(SourceLocation Loc)
Definition Stmt.h:2661
void setInit(Stmt *Init)
Definition Stmt.h:2609
void setLParenLoc(SourceLocation Loc)
Definition Stmt.h:2659
static SwitchStmt * CreateEmpty(const ASTContext &Ctx, bool HasInit, bool HasVar)
Create an empty switch statement optionally with storage for an init expression and a condition varia...
Definition Stmt.cpp:1178
void setAllEnumCasesCovered()
Set a flag in the SwitchStmt indicating that if the 'switch (X)' is a switch over an enum value then ...
Definition Stmt.h:2677
void setSwitchCaseList(SwitchCase *SC)
Definition Stmt.h:2654
A convenient class for passing around template argument information.
void setLAngleLoc(SourceLocation Loc)
void setRAngleLoc(SourceLocation Loc)
void addArgument(const TemplateArgumentLoc &Loc)
Location wrapper for a TemplateArgument.
pack_iterator pack_begin() const
Iterator referencing the first argument of a template argument pack.
unsigned pack_size() const
The number of template arguments in the given template argument pack.
@ Pack
The template argument is actually a parameter pack.
ArgKind getKind() const
Return the kind of stored template argument.
A container of type source information.
Definition TypeBase.h:8417
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:2673
void setKind(UnaryExprOrTypeTrait K)
Definition Expr.h:2708
void setOperatorLoc(SourceLocation L)
Definition Expr.h:2747
void setRParenLoc(SourceLocation L)
Definition Expr.h:2750
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition Expr.h:2292
void setSubExpr(Expr *E)
Definition Expr.h:2334
void setOperatorLoc(SourceLocation L)
Definition Expr.h:2338
void setCanOverflow(bool C)
Definition Expr.h:2347
bool hasStoredFPFeatures() const
Is FPFeatures in Trailing Storage?
Definition Expr.h:2429
void setOpcode(Opcode Opc)
Definition Expr.h:2331
void setStoredFPFeatures(FPOptionsOverride F)
Set FPFeatures in trailing storage, used by Serialization & ASTImporter.
Definition Expr.h:2443
UnaryOperatorKind Opcode
Definition Expr.h:2306
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:5005
void setVarargABI(VarArgKind Kind)
Definition Expr.h:5030
void setRParenLoc(SourceLocation L)
Definition Expr.h:5045
void setSubExpr(Expr *E)
Definition Expr.h:5027
void setBuiltinLoc(SourceLocation L)
Definition Expr.h:5042
void setWrittenTypeInfo(TypeSourceInfo *TI)
Definition Expr.h:5039
WhileStmt - This represents a 'while' stmt.
Definition Stmt.h:2709
void setCond(Expr *Cond)
Definition Stmt.h:2769
void setBody(Stmt *Body)
Definition Stmt.h:2776
void setLParenLoc(SourceLocation L)
Definition Stmt.h:2818
void setRParenLoc(SourceLocation L)
Definition Stmt.h:2820
void setWhileLoc(SourceLocation L)
Definition Stmt.h:2815
static WhileStmt * CreateEmpty(const ASTContext &Ctx, bool HasVar)
Create an empty while statement optionally with storage for a condition variable.
Definition Stmt.cpp:1240
void setConditionVariableDeclStmt(DeclStmt *CondVar)
Definition Stmt.h:2809
Information about a module that has been loaded by the ASTReader.
Definition ModuleFile.h:158
llvm::BitstreamCursor DeclsCursor
DeclsCursor - This is a cursor to the start of the DECLTYPES_BLOCK block.
Definition ModuleFile.h: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:1100
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:434
CharacterLiteralKind
Definition Expr.h:1627
unsigned long uint64_t
static ASTConstraintSatisfaction * Create(const ASTContext &C, const ConstraintSatisfaction &Satisfaction)
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
void initializeFrom(SourceLocation TemplateKWLoc, const TemplateArgumentListInfo &List, TemplateArgumentLoc *OutArgArray)
Expr * CounterUpdate
Updater for the internal counter: ++CounterVD;.
Definition ExprOpenMP.h:121
Expr * Upper
Normalized upper bound.
Definition ExprOpenMP.h:116
Expr * Update
Update expression for the originally specified iteration variable, calculated as VD = Begin + Counter...
Definition ExprOpenMP.h:119
VarDecl * CounterVD
Internal normalized counter.
Definition ExprOpenMP.h:113
A placeholder type used to construct an empty shell of a type, that will be filled in later (e....
Definition Stmt.h:1445