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