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 if (/* IsDiagnostic */Record.readInt()) {
811 SourceLocation DiagLocation = Record.readSourceLocation();
812 StringRef DiagMessage = C.backupStr(Record.readString());
813
814 Satisfaction.Details.emplace_back(
816 DiagLocation, DiagMessage));
817 } else
818 Satisfaction.Details.emplace_back(Record.readExpr());
819 }
820 }
821 return Satisfaction;
822}
823
824void ASTStmtReader::VisitConceptSpecializationExpr(
826 VisitExpr(E);
827 E->SpecDecl = Record.readDeclAs<ImplicitConceptSpecializationDecl>();
828 if (Record.readBool())
829 E->ConceptRef = Record.readConceptReference();
830 E->Satisfaction = E->isValueDependent() ? nullptr :
831 ASTConstraintSatisfaction::Create(Record.getContext(),
833}
834
837 const ASTContext &C = Record.getContext();
838 StringRef SubstitutedEntity = C.backupStr(Record.readString());
839 SourceLocation DiagLoc = Record.readSourceLocation();
840 StringRef DiagMessage = C.backupStr(Record.readString());
841
842 return new (Record.getContext())
843 concepts::Requirement::SubstitutionDiagnostic{SubstitutedEntity, DiagLoc,
844 DiagMessage};
845}
846
847void ASTStmtReader::VisitRequiresExpr(RequiresExpr *E) {
848 VisitExpr(E);
849 unsigned NumLocalParameters = Record.readInt();
850 unsigned NumRequirements = Record.readInt();
851 E->RequiresExprBits.RequiresKWLoc = Record.readSourceLocation();
852 E->RequiresExprBits.IsSatisfied = Record.readInt();
853 E->Body = Record.readDeclAs<RequiresExprBodyDecl>();
854 llvm::SmallVector<ParmVarDecl *, 4> LocalParameters;
855 for (unsigned i = 0; i < NumLocalParameters; ++i)
856 LocalParameters.push_back(cast<ParmVarDecl>(Record.readDecl()));
857 std::copy(LocalParameters.begin(), LocalParameters.end(),
858 E->getTrailingObjects<ParmVarDecl *>());
859 llvm::SmallVector<concepts::Requirement *, 4> Requirements;
860 for (unsigned i = 0; i < NumRequirements; ++i) {
861 auto RK =
862 static_cast<concepts::Requirement::RequirementKind>(Record.readInt());
863 concepts::Requirement *R = nullptr;
864 switch (RK) {
866 auto Status =
868 Record.readInt());
870 R = new (Record.getContext())
871 concepts::TypeRequirement(readSubstitutionDiagnostic(Record));
872 else
873 R = new (Record.getContext())
874 concepts::TypeRequirement(Record.readTypeSourceInfo());
875 } break;
878 auto Status =
880 Record.readInt());
881 llvm::PointerUnion<concepts::Requirement::SubstitutionDiagnostic *,
882 Expr *> E;
884 E = readSubstitutionDiagnostic(Record);
885 } else
886 E = Record.readExpr();
887
888 std::optional<concepts::ExprRequirement::ReturnTypeRequirement> Req;
889 ConceptSpecializationExpr *SubstitutedConstraintExpr = nullptr;
890 SourceLocation NoexceptLoc;
892 Req.emplace();
893 } else {
894 NoexceptLoc = Record.readSourceLocation();
895 switch (/* returnTypeRequirementKind */Record.readInt()) {
896 case 0:
897 // No return type requirement.
898 Req.emplace();
899 break;
900 case 1: {
901 // type-constraint
902 TemplateParameterList *TPL = Record.readTemplateParameterList();
903 if (Status >=
905 SubstitutedConstraintExpr =
906 cast<ConceptSpecializationExpr>(Record.readExpr());
907 Req.emplace(TPL);
908 } break;
909 case 2:
910 // Substitution failure
911 Req.emplace(readSubstitutionDiagnostic(Record));
912 break;
913 }
914 }
915 if (Expr *Ex = E.dyn_cast<Expr *>())
916 R = new (Record.getContext()) concepts::ExprRequirement(
917 Ex, RK == concepts::Requirement::RK_Simple, NoexceptLoc,
918 std::move(*Req), Status, SubstitutedConstraintExpr);
919 else
920 R = new (Record.getContext()) concepts::ExprRequirement(
922 RK == concepts::Requirement::RK_Simple, NoexceptLoc,
923 std::move(*Req));
924 } break;
926 ASTContext &C = Record.getContext();
927 bool HasInvalidConstraint = Record.readInt();
928 if (HasInvalidConstraint) {
929 StringRef InvalidConstraint = C.backupStr(Record.readString());
930 R = new (C) concepts::NestedRequirement(
931 Record.getContext(), InvalidConstraint,
933 break;
934 }
935 Expr *E = Record.readExpr();
937 R = new (C) concepts::NestedRequirement(E);
938 else
939 R = new (C) concepts::NestedRequirement(
940 C, E, readConstraintSatisfaction(Record));
941 } break;
942 }
943 if (!R)
944 continue;
945 Requirements.push_back(R);
946 }
947 std::copy(Requirements.begin(), Requirements.end(),
948 E->getTrailingObjects<concepts::Requirement *>());
949 E->LParenLoc = Record.readSourceLocation();
950 E->RParenLoc = Record.readSourceLocation();
951 E->RBraceLoc = Record.readSourceLocation();
952}
953
954void ASTStmtReader::VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
955 VisitExpr(E);
956 E->setLHS(Record.readSubExpr());
957 E->setRHS(Record.readSubExpr());
958 E->setRBracketLoc(readSourceLocation());
959}
960
961void ASTStmtReader::VisitMatrixSubscriptExpr(MatrixSubscriptExpr *E) {
962 VisitExpr(E);
963 E->setBase(Record.readSubExpr());
964 E->setRowIdx(Record.readSubExpr());
965 E->setColumnIdx(Record.readSubExpr());
966 E->setRBracketLoc(readSourceLocation());
967}
968
969void ASTStmtReader::VisitArraySectionExpr(ArraySectionExpr *E) {
970 VisitExpr(E);
971 E->ASType = Record.readEnum<ArraySectionExpr::ArraySectionType>();
972
973 E->setBase(Record.readSubExpr());
974 E->setLowerBound(Record.readSubExpr());
975 E->setLength(Record.readSubExpr());
976
977 if (E->isOMPArraySection())
978 E->setStride(Record.readSubExpr());
979
980 E->setColonLocFirst(readSourceLocation());
981
982 if (E->isOMPArraySection())
983 E->setColonLocSecond(readSourceLocation());
984
985 E->setRBracketLoc(readSourceLocation());
986}
987
988void ASTStmtReader::VisitOMPArrayShapingExpr(OMPArrayShapingExpr *E) {
989 VisitExpr(E);
990 unsigned NumDims = Record.readInt();
991 E->setBase(Record.readSubExpr());
992 SmallVector<Expr *, 4> Dims(NumDims);
993 for (unsigned I = 0; I < NumDims; ++I)
994 Dims[I] = Record.readSubExpr();
995 E->setDimensions(Dims);
996 SmallVector<SourceRange, 4> SRs(NumDims);
997 for (unsigned I = 0; I < NumDims; ++I)
998 SRs[I] = readSourceRange();
999 E->setBracketsRanges(SRs);
1000 E->setLParenLoc(readSourceLocation());
1001 E->setRParenLoc(readSourceLocation());
1002}
1003
1004void ASTStmtReader::VisitOMPIteratorExpr(OMPIteratorExpr *E) {
1005 VisitExpr(E);
1006 unsigned NumIters = Record.readInt();
1007 E->setIteratorKwLoc(readSourceLocation());
1008 E->setLParenLoc(readSourceLocation());
1009 E->setRParenLoc(readSourceLocation());
1010 for (unsigned I = 0; I < NumIters; ++I) {
1011 E->setIteratorDeclaration(I, Record.readDeclRef());
1012 E->setAssignmentLoc(I, readSourceLocation());
1013 Expr *Begin = Record.readSubExpr();
1014 Expr *End = Record.readSubExpr();
1015 Expr *Step = Record.readSubExpr();
1016 SourceLocation ColonLoc = readSourceLocation();
1017 SourceLocation SecColonLoc;
1018 if (Step)
1019 SecColonLoc = readSourceLocation();
1020 E->setIteratorRange(I, Begin, ColonLoc, End, SecColonLoc, Step);
1021 // Deserialize helpers
1022 OMPIteratorHelperData HD;
1023 HD.CounterVD = cast_or_null<VarDecl>(Record.readDeclRef());
1024 HD.Upper = Record.readSubExpr();
1025 HD.Update = Record.readSubExpr();
1026 HD.CounterUpdate = Record.readSubExpr();
1027 E->setHelper(I, HD);
1028 }
1029}
1030
1031void ASTStmtReader::VisitCallExpr(CallExpr *E) {
1032 VisitExpr(E);
1033
1034 unsigned NumArgs = Record.readInt();
1035 CurrentUnpackingBits.emplace(Record.readInt());
1036 E->setADLCallKind(
1037 static_cast<CallExpr::ADLCallKind>(CurrentUnpackingBits->getNextBit()));
1038 bool HasFPFeatures = CurrentUnpackingBits->getNextBit();
1039 E->setCoroElideSafe(CurrentUnpackingBits->getNextBit());
1040 E->setUsesMemberSyntax(CurrentUnpackingBits->getNextBit());
1041 assert((NumArgs == E->getNumArgs()) && "Wrong NumArgs!");
1042 E->setRParenLoc(readSourceLocation());
1043 E->setCallee(Record.readSubExpr());
1044 for (unsigned I = 0; I != NumArgs; ++I)
1045 E->setArg(I, Record.readSubExpr());
1046
1047 if (HasFPFeatures)
1049 FPOptionsOverride::getFromOpaqueInt(Record.readInt()));
1050
1051 if (E->getStmtClass() == Stmt::CallExprClass)
1052 E->updateTrailingSourceLoc();
1053}
1054
1055void ASTStmtReader::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) {
1056 VisitCallExpr(E);
1057}
1058
1059void ASTStmtReader::VisitMemberExpr(MemberExpr *E) {
1060 VisitExpr(E);
1061
1062 CurrentUnpackingBits.emplace(Record.readInt());
1063 bool HasQualifier = CurrentUnpackingBits->getNextBit();
1064 bool HasFoundDecl = CurrentUnpackingBits->getNextBit();
1065 bool HasTemplateInfo = CurrentUnpackingBits->getNextBit();
1066 unsigned NumTemplateArgs = Record.readInt();
1067
1068 E->Base = Record.readSubExpr();
1069 E->MemberDecl = Record.readDeclAs<ValueDecl>();
1070 E->MemberDNLoc = Record.readDeclarationNameLoc(E->MemberDecl->getDeclName());
1071 E->MemberLoc = Record.readSourceLocation();
1072 E->MemberExprBits.IsArrow = CurrentUnpackingBits->getNextBit();
1073 E->MemberExprBits.HasQualifier = HasQualifier;
1074 E->MemberExprBits.HasFoundDecl = HasFoundDecl;
1075 E->MemberExprBits.HasTemplateKWAndArgsInfo = HasTemplateInfo;
1076 E->MemberExprBits.HadMultipleCandidates = CurrentUnpackingBits->getNextBit();
1077 E->MemberExprBits.NonOdrUseReason =
1078 CurrentUnpackingBits->getNextBits(/*Width=*/2);
1079 E->MemberExprBits.OperatorLoc = Record.readSourceLocation();
1080
1081 if (HasQualifier)
1082 new (E->getTrailingObjects<NestedNameSpecifierLoc>())
1083 NestedNameSpecifierLoc(Record.readNestedNameSpecifierLoc());
1084
1085 if (HasFoundDecl) {
1086 auto *FoundD = Record.readDeclAs<NamedDecl>();
1087 auto AS = (AccessSpecifier)CurrentUnpackingBits->getNextBits(/*Width=*/2);
1088 *E->getTrailingObjects<DeclAccessPair>() = DeclAccessPair::make(FoundD, AS);
1089 }
1090
1091 if (HasTemplateInfo)
1093 *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
1094 E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs);
1095}
1096
1097void ASTStmtReader::VisitObjCIsaExpr(ObjCIsaExpr *E) {
1098 VisitExpr(E);
1099 E->setBase(Record.readSubExpr());
1100 E->setIsaMemberLoc(readSourceLocation());
1101 E->setOpLoc(readSourceLocation());
1102 E->setArrow(Record.readInt());
1103}
1104
1105void ASTStmtReader::
1106VisitObjCIndirectCopyRestoreExpr(ObjCIndirectCopyRestoreExpr *E) {
1107 VisitExpr(E);
1108 E->Operand = Record.readSubExpr();
1109 E->setShouldCopy(Record.readInt());
1110}
1111
1112void ASTStmtReader::VisitObjCBridgedCastExpr(ObjCBridgedCastExpr *E) {
1113 VisitExplicitCastExpr(E);
1114 E->LParenLoc = readSourceLocation();
1115 E->BridgeKeywordLoc = readSourceLocation();
1116 E->Kind = Record.readInt();
1117}
1118
1119void ASTStmtReader::VisitCastExpr(CastExpr *E) {
1120 VisitExpr(E);
1121 unsigned NumBaseSpecs = Record.readInt();
1122 assert(NumBaseSpecs == E->path_size());
1123
1124 CurrentUnpackingBits.emplace(Record.readInt());
1125 E->setCastKind((CastKind)CurrentUnpackingBits->getNextBits(/*Width=*/7));
1126 unsigned HasFPFeatures = CurrentUnpackingBits->getNextBit();
1127 assert(E->hasStoredFPFeatures() == HasFPFeatures);
1128
1129 E->setSubExpr(Record.readSubExpr());
1130
1132 while (NumBaseSpecs--) {
1133 auto *BaseSpec = new (Record.getContext()) CXXBaseSpecifier;
1134 *BaseSpec = Record.readCXXBaseSpecifier();
1135 *BaseI++ = BaseSpec;
1136 }
1137 if (HasFPFeatures)
1138 *E->getTrailingFPFeatures() =
1139 FPOptionsOverride::getFromOpaqueInt(Record.readInt());
1140}
1141
1142void ASTStmtReader::VisitBinaryOperator(BinaryOperator *E) {
1143 VisitExpr(E);
1144 CurrentUnpackingBits.emplace(Record.readInt());
1145 E->setOpcode(
1146 (BinaryOperator::Opcode)CurrentUnpackingBits->getNextBits(/*Width=*/6));
1147 bool hasFP_Features = CurrentUnpackingBits->getNextBit();
1148 E->setHasStoredFPFeatures(hasFP_Features);
1149 E->setExcludedOverflowPattern(CurrentUnpackingBits->getNextBit());
1150 E->setLHS(Record.readSubExpr());
1151 E->setRHS(Record.readSubExpr());
1152 E->setOperatorLoc(readSourceLocation());
1153 if (hasFP_Features)
1155 FPOptionsOverride::getFromOpaqueInt(Record.readInt()));
1156}
1157
1158void ASTStmtReader::VisitCompoundAssignOperator(CompoundAssignOperator *E) {
1159 VisitBinaryOperator(E);
1160 E->setComputationLHSType(Record.readType());
1161 E->setComputationResultType(Record.readType());
1162}
1163
1164void ASTStmtReader::VisitConditionalOperator(ConditionalOperator *E) {
1165 VisitExpr(E);
1166 E->SubExprs[ConditionalOperator::COND] = Record.readSubExpr();
1167 E->SubExprs[ConditionalOperator::LHS] = Record.readSubExpr();
1168 E->SubExprs[ConditionalOperator::RHS] = Record.readSubExpr();
1169 E->QuestionLoc = readSourceLocation();
1170 E->ColonLoc = readSourceLocation();
1171}
1172
1173void
1174ASTStmtReader::VisitBinaryConditionalOperator(BinaryConditionalOperator *E) {
1175 VisitExpr(E);
1176 E->OpaqueValue = cast<OpaqueValueExpr>(Record.readSubExpr());
1177 E->SubExprs[BinaryConditionalOperator::COMMON] = Record.readSubExpr();
1178 E->SubExprs[BinaryConditionalOperator::COND] = Record.readSubExpr();
1179 E->SubExprs[BinaryConditionalOperator::LHS] = Record.readSubExpr();
1180 E->SubExprs[BinaryConditionalOperator::RHS] = Record.readSubExpr();
1181 E->QuestionLoc = readSourceLocation();
1182 E->ColonLoc = readSourceLocation();
1183}
1184
1185void ASTStmtReader::VisitImplicitCastExpr(ImplicitCastExpr *E) {
1186 VisitCastExpr(E);
1187 E->setIsPartOfExplicitCast(CurrentUnpackingBits->getNextBit());
1188}
1189
1190void ASTStmtReader::VisitExplicitCastExpr(ExplicitCastExpr *E) {
1191 VisitCastExpr(E);
1192 E->setTypeInfoAsWritten(readTypeSourceInfo());
1193}
1194
1195void ASTStmtReader::VisitCStyleCastExpr(CStyleCastExpr *E) {
1196 VisitExplicitCastExpr(E);
1197 E->setLParenLoc(readSourceLocation());
1198 E->setRParenLoc(readSourceLocation());
1199}
1200
1201void ASTStmtReader::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
1202 VisitExpr(E);
1203 E->setLParenLoc(readSourceLocation());
1204 E->setTypeSourceInfo(readTypeSourceInfo());
1205 E->setInitializer(Record.readSubExpr());
1206 E->setFileScope(Record.readInt());
1207}
1208
1209void ASTStmtReader::VisitExtVectorElementExpr(ExtVectorElementExpr *E) {
1210 VisitExpr(E);
1211 E->setBase(Record.readSubExpr());
1212 E->setAccessor(Record.readIdentifier());
1213 E->setAccessorLoc(readSourceLocation());
1214}
1215
1216void ASTStmtReader::VisitInitListExpr(InitListExpr *E) {
1217 VisitExpr(E);
1218 if (auto *SyntForm = cast_or_null<InitListExpr>(Record.readSubStmt()))
1219 E->setSyntacticForm(SyntForm);
1220 E->setLBraceLoc(readSourceLocation());
1221 E->setRBraceLoc(readSourceLocation());
1222 bool isArrayFiller = Record.readInt();
1223 Expr *filler = nullptr;
1224 if (isArrayFiller) {
1225 filler = Record.readSubExpr();
1226 E->ArrayFillerOrUnionFieldInit = filler;
1227 } else
1228 E->ArrayFillerOrUnionFieldInit = readDeclAs<FieldDecl>();
1229 E->sawArrayRangeDesignator(Record.readInt());
1230 unsigned NumInits = Record.readInt();
1231 E->reserveInits(Record.getContext(), NumInits);
1232 if (isArrayFiller) {
1233 for (unsigned I = 0; I != NumInits; ++I) {
1234 Expr *init = Record.readSubExpr();
1235 E->updateInit(Record.getContext(), I, init ? init : filler);
1236 }
1237 } else {
1238 for (unsigned I = 0; I != NumInits; ++I)
1239 E->updateInit(Record.getContext(), I, Record.readSubExpr());
1240 }
1241}
1242
1243void ASTStmtReader::VisitDesignatedInitExpr(DesignatedInitExpr *E) {
1244 using Designator = DesignatedInitExpr::Designator;
1245
1246 VisitExpr(E);
1247 unsigned NumSubExprs = Record.readInt();
1248 assert(NumSubExprs == E->getNumSubExprs() && "Wrong number of subexprs");
1249 for (unsigned I = 0; I != NumSubExprs; ++I)
1250 E->setSubExpr(I, Record.readSubExpr());
1251 E->setEqualOrColonLoc(readSourceLocation());
1252 E->setGNUSyntax(Record.readInt());
1253
1254 SmallVector<Designator, 4> Designators;
1255 while (Record.getIdx() < Record.size()) {
1256 switch ((DesignatorTypes)Record.readInt()) {
1257 case DESIG_FIELD_DECL: {
1258 auto *Field = readDeclAs<FieldDecl>();
1259 SourceLocation DotLoc = readSourceLocation();
1260 SourceLocation FieldLoc = readSourceLocation();
1261 Designators.push_back(Designator::CreateFieldDesignator(
1262 Field->getIdentifier(), DotLoc, FieldLoc));
1263 Designators.back().setFieldDecl(Field);
1264 break;
1265 }
1266
1267 case DESIG_FIELD_NAME: {
1268 const IdentifierInfo *Name = Record.readIdentifier();
1269 SourceLocation DotLoc = readSourceLocation();
1270 SourceLocation FieldLoc = readSourceLocation();
1271 Designators.push_back(Designator::CreateFieldDesignator(Name, DotLoc,
1272 FieldLoc));
1273 break;
1274 }
1275
1276 case DESIG_ARRAY: {
1277 unsigned Index = Record.readInt();
1278 SourceLocation LBracketLoc = readSourceLocation();
1279 SourceLocation RBracketLoc = readSourceLocation();
1280 Designators.push_back(Designator::CreateArrayDesignator(Index,
1281 LBracketLoc,
1282 RBracketLoc));
1283 break;
1284 }
1285
1286 case DESIG_ARRAY_RANGE: {
1287 unsigned Index = Record.readInt();
1288 SourceLocation LBracketLoc = readSourceLocation();
1289 SourceLocation EllipsisLoc = readSourceLocation();
1290 SourceLocation RBracketLoc = readSourceLocation();
1291 Designators.push_back(Designator::CreateArrayRangeDesignator(
1292 Index, LBracketLoc, EllipsisLoc, RBracketLoc));
1293 break;
1294 }
1295 }
1296 }
1297 E->setDesignators(Record.getContext(),
1298 Designators.data(), Designators.size());
1299}
1300
1301void ASTStmtReader::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) {
1302 VisitExpr(E);
1303 E->setBase(Record.readSubExpr());
1304 E->setUpdater(Record.readSubExpr());
1305}
1306
1307void ASTStmtReader::VisitNoInitExpr(NoInitExpr *E) {
1308 VisitExpr(E);
1309}
1310
1311void ASTStmtReader::VisitArrayInitLoopExpr(ArrayInitLoopExpr *E) {
1312 VisitExpr(E);
1313 E->SubExprs[0] = Record.readSubExpr();
1314 E->SubExprs[1] = Record.readSubExpr();
1315}
1316
1317void ASTStmtReader::VisitArrayInitIndexExpr(ArrayInitIndexExpr *E) {
1318 VisitExpr(E);
1319}
1320
1321void ASTStmtReader::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) {
1322 VisitExpr(E);
1323}
1324
1325void ASTStmtReader::VisitVAArgExpr(VAArgExpr *E) {
1326 VisitExpr(E);
1327 E->setSubExpr(Record.readSubExpr());
1328 E->setWrittenTypeInfo(readTypeSourceInfo());
1329 E->setBuiltinLoc(readSourceLocation());
1330 E->setRParenLoc(readSourceLocation());
1331 E->setIsMicrosoftABI(Record.readInt());
1332}
1333
1334void ASTStmtReader::VisitSourceLocExpr(SourceLocExpr *E) {
1335 VisitExpr(E);
1336 E->ParentContext = readDeclAs<DeclContext>();
1337 E->BuiltinLoc = readSourceLocation();
1338 E->RParenLoc = readSourceLocation();
1339 E->SourceLocExprBits.Kind = Record.readInt();
1340}
1341
1342void ASTStmtReader::VisitEmbedExpr(EmbedExpr *E) {
1343 VisitExpr(E);
1344 E->EmbedKeywordLoc = readSourceLocation();
1345 EmbedDataStorage *Data = new (Record.getContext()) EmbedDataStorage;
1346 Data->BinaryData = cast<StringLiteral>(Record.readSubStmt());
1347 E->Data = Data;
1348 E->Begin = Record.readInt();
1349 E->NumOfElements = Record.readInt();
1350}
1351
1352void ASTStmtReader::VisitAddrLabelExpr(AddrLabelExpr *E) {
1353 VisitExpr(E);
1354 E->setAmpAmpLoc(readSourceLocation());
1355 E->setLabelLoc(readSourceLocation());
1356 E->setLabel(readDeclAs<LabelDecl>());
1357}
1358
1359void ASTStmtReader::VisitStmtExpr(StmtExpr *E) {
1360 VisitExpr(E);
1361 E->setLParenLoc(readSourceLocation());
1362 E->setRParenLoc(readSourceLocation());
1363 E->setSubStmt(cast_or_null<CompoundStmt>(Record.readSubStmt()));
1364 E->StmtExprBits.TemplateDepth = Record.readInt();
1365}
1366
1367void ASTStmtReader::VisitChooseExpr(ChooseExpr *E) {
1368 VisitExpr(E);
1369 E->setCond(Record.readSubExpr());
1370 E->setLHS(Record.readSubExpr());
1371 E->setRHS(Record.readSubExpr());
1372 E->setBuiltinLoc(readSourceLocation());
1373 E->setRParenLoc(readSourceLocation());
1374 E->setIsConditionTrue(Record.readInt());
1375}
1376
1377void ASTStmtReader::VisitGNUNullExpr(GNUNullExpr *E) {
1378 VisitExpr(E);
1379 E->setTokenLocation(readSourceLocation());
1380}
1381
1382void ASTStmtReader::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
1383 VisitExpr(E);
1384 SmallVector<Expr *, 16> Exprs;
1385 unsigned NumExprs = Record.readInt();
1386 while (NumExprs--)
1387 Exprs.push_back(Record.readSubExpr());
1388 E->setExprs(Record.getContext(), Exprs);
1389 E->setBuiltinLoc(readSourceLocation());
1390 E->setRParenLoc(readSourceLocation());
1391}
1392
1393void ASTStmtReader::VisitConvertVectorExpr(ConvertVectorExpr *E) {
1394 VisitExpr(E);
1395 bool HasFPFeatures = CurrentUnpackingBits->getNextBit();
1396 assert(HasFPFeatures == E->hasStoredFPFeatures());
1397 E->BuiltinLoc = readSourceLocation();
1398 E->RParenLoc = readSourceLocation();
1399 E->TInfo = readTypeSourceInfo();
1400 E->SrcExpr = Record.readSubExpr();
1401 if (HasFPFeatures)
1403 FPOptionsOverride::getFromOpaqueInt(Record.readInt()));
1404}
1405
1406void ASTStmtReader::VisitBlockExpr(BlockExpr *E) {
1407 VisitExpr(E);
1408 E->setBlockDecl(readDeclAs<BlockDecl>());
1409}
1410
1411void ASTStmtReader::VisitGenericSelectionExpr(GenericSelectionExpr *E) {
1412 VisitExpr(E);
1413
1414 unsigned NumAssocs = Record.readInt();
1415 assert(NumAssocs == E->getNumAssocs() && "Wrong NumAssocs!");
1416 E->IsExprPredicate = Record.readInt();
1417 E->ResultIndex = Record.readInt();
1418 E->GenericSelectionExprBits.GenericLoc = readSourceLocation();
1419 E->DefaultLoc = readSourceLocation();
1420 E->RParenLoc = readSourceLocation();
1421
1422 Stmt **Stmts = E->getTrailingObjects<Stmt *>();
1423 // Add 1 to account for the controlling expression which is the first
1424 // expression in the trailing array of Stmt *. This is not needed for
1425 // the trailing array of TypeSourceInfo *.
1426 for (unsigned I = 0, N = NumAssocs + 1; I < N; ++I)
1427 Stmts[I] = Record.readSubExpr();
1428
1429 TypeSourceInfo **TSIs = E->getTrailingObjects<TypeSourceInfo *>();
1430 for (unsigned I = 0, N = NumAssocs; I < N; ++I)
1431 TSIs[I] = readTypeSourceInfo();
1432}
1433
1434void ASTStmtReader::VisitPseudoObjectExpr(PseudoObjectExpr *E) {
1435 VisitExpr(E);
1436 unsigned numSemanticExprs = Record.readInt();
1437 assert(numSemanticExprs + 1 == E->PseudoObjectExprBits.NumSubExprs);
1438 E->PseudoObjectExprBits.ResultIndex = Record.readInt();
1439
1440 // Read the syntactic expression.
1441 E->getTrailingObjects()[0] = Record.readSubExpr();
1442
1443 // Read all the semantic expressions.
1444 for (unsigned i = 0; i != numSemanticExprs; ++i) {
1445 Expr *subExpr = Record.readSubExpr();
1446 E->getTrailingObjects()[i + 1] = subExpr;
1447 }
1448}
1449
1450void ASTStmtReader::VisitAtomicExpr(AtomicExpr *E) {
1451 VisitExpr(E);
1452 E->Op = AtomicExpr::AtomicOp(Record.readInt());
1453 E->NumSubExprs = AtomicExpr::getNumSubExprs(E->Op);
1454 for (unsigned I = 0; I != E->NumSubExprs; ++I)
1455 E->SubExprs[I] = Record.readSubExpr();
1456 E->BuiltinLoc = readSourceLocation();
1457 E->RParenLoc = readSourceLocation();
1458}
1459
1460//===----------------------------------------------------------------------===//
1461// Objective-C Expressions and Statements
1462
1463void ASTStmtReader::VisitObjCStringLiteral(ObjCStringLiteral *E) {
1464 VisitExpr(E);
1465 E->setString(cast<StringLiteral>(Record.readSubStmt()));
1466 E->setAtLoc(readSourceLocation());
1467}
1468
1469void ASTStmtReader::VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
1470 VisitExpr(E);
1471 // could be one of several IntegerLiteral, FloatLiteral, etc.
1472 E->SubExpr = Record.readSubStmt();
1473 E->BoxingMethod = readDeclAs<ObjCMethodDecl>();
1474 E->Range = readSourceRange();
1475}
1476
1477void ASTStmtReader::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
1478 VisitExpr(E);
1479 unsigned NumElements = Record.readInt();
1480 assert(NumElements == E->getNumElements() && "Wrong number of elements");
1481 Expr **Elements = E->getElements();
1482 for (unsigned I = 0, N = NumElements; I != N; ++I)
1483 Elements[I] = Record.readSubExpr();
1484 E->ArrayWithObjectsMethod = readDeclAs<ObjCMethodDecl>();
1485 E->Range = readSourceRange();
1486}
1487
1488void ASTStmtReader::VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *E) {
1489 VisitExpr(E);
1490 unsigned NumElements = Record.readInt();
1491 assert(NumElements == E->getNumElements() && "Wrong number of elements");
1492 bool HasPackExpansions = Record.readInt();
1493 assert(HasPackExpansions == E->HasPackExpansions &&"Pack expansion mismatch");
1494 auto *KeyValues =
1495 E->getTrailingObjects<ObjCDictionaryLiteral::KeyValuePair>();
1496 auto *Expansions =
1497 E->getTrailingObjects<ObjCDictionaryLiteral::ExpansionData>();
1498 for (unsigned I = 0; I != NumElements; ++I) {
1499 KeyValues[I].Key = Record.readSubExpr();
1500 KeyValues[I].Value = Record.readSubExpr();
1501 if (HasPackExpansions) {
1502 Expansions[I].EllipsisLoc = readSourceLocation();
1503 Expansions[I].NumExpansionsPlusOne = Record.readInt();
1504 }
1505 }
1506 E->DictWithObjectsMethod = readDeclAs<ObjCMethodDecl>();
1507 E->Range = readSourceRange();
1508}
1509
1510void ASTStmtReader::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
1511 VisitExpr(E);
1512 E->setEncodedTypeSourceInfo(readTypeSourceInfo());
1513 E->setAtLoc(readSourceLocation());
1514 E->setRParenLoc(readSourceLocation());
1515}
1516
1517void ASTStmtReader::VisitObjCSelectorExpr(ObjCSelectorExpr *E) {
1518 VisitExpr(E);
1519 E->setSelector(Record.readSelector());
1520 E->setAtLoc(readSourceLocation());
1521 E->setRParenLoc(readSourceLocation());
1522}
1523
1524void ASTStmtReader::VisitObjCProtocolExpr(ObjCProtocolExpr *E) {
1525 VisitExpr(E);
1526 E->setProtocol(readDeclAs<ObjCProtocolDecl>());
1527 E->setAtLoc(readSourceLocation());
1528 E->ProtoLoc = readSourceLocation();
1529 E->setRParenLoc(readSourceLocation());
1530}
1531
1532void ASTStmtReader::VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) {
1533 VisitExpr(E);
1534 E->setDecl(readDeclAs<ObjCIvarDecl>());
1535 E->setLocation(readSourceLocation());
1536 E->setOpLoc(readSourceLocation());
1537 E->setBase(Record.readSubExpr());
1538 E->setIsArrow(Record.readInt());
1539 E->setIsFreeIvar(Record.readInt());
1540}
1541
1542void ASTStmtReader::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
1543 VisitExpr(E);
1544 unsigned MethodRefFlags = Record.readInt();
1545 bool Implicit = Record.readInt() != 0;
1546 if (Implicit) {
1547 auto *Getter = readDeclAs<ObjCMethodDecl>();
1548 auto *Setter = readDeclAs<ObjCMethodDecl>();
1549 E->setImplicitProperty(Getter, Setter, MethodRefFlags);
1550 } else {
1551 E->setExplicitProperty(readDeclAs<ObjCPropertyDecl>(), MethodRefFlags);
1552 }
1553 E->setLocation(readSourceLocation());
1554 E->setReceiverLocation(readSourceLocation());
1555 switch (Record.readInt()) {
1556 case 0:
1557 E->setBase(Record.readSubExpr());
1558 break;
1559 case 1:
1560 E->setSuperReceiver(Record.readType());
1561 break;
1562 case 2:
1563 E->setClassReceiver(readDeclAs<ObjCInterfaceDecl>());
1564 break;
1565 }
1566}
1567
1568void ASTStmtReader::VisitObjCSubscriptRefExpr(ObjCSubscriptRefExpr *E) {
1569 VisitExpr(E);
1570 E->setRBracket(readSourceLocation());
1571 E->setBaseExpr(Record.readSubExpr());
1572 E->setKeyExpr(Record.readSubExpr());
1573 E->GetAtIndexMethodDecl = readDeclAs<ObjCMethodDecl>();
1574 E->SetAtIndexMethodDecl = readDeclAs<ObjCMethodDecl>();
1575}
1576
1577void ASTStmtReader::VisitObjCMessageExpr(ObjCMessageExpr *E) {
1578 VisitExpr(E);
1579 assert(Record.peekInt() == E->getNumArgs());
1580 Record.skipInts(1);
1581 unsigned NumStoredSelLocs = Record.readInt();
1582 E->SelLocsKind = Record.readInt();
1583 E->setDelegateInitCall(Record.readInt());
1584 E->IsImplicit = Record.readInt();
1585 auto Kind = static_cast<ObjCMessageExpr::ReceiverKind>(Record.readInt());
1586 switch (Kind) {
1588 E->setInstanceReceiver(Record.readSubExpr());
1589 break;
1590
1592 E->setClassReceiver(readTypeSourceInfo());
1593 break;
1594
1597 QualType T = Record.readType();
1598 SourceLocation SuperLoc = readSourceLocation();
1599 E->setSuper(SuperLoc, T, Kind == ObjCMessageExpr::SuperInstance);
1600 break;
1601 }
1602 }
1603
1604 assert(Kind == E->getReceiverKind());
1605
1606 if (Record.readInt())
1607 E->setMethodDecl(readDeclAs<ObjCMethodDecl>());
1608 else
1609 E->setSelector(Record.readSelector());
1610
1611 E->LBracLoc = readSourceLocation();
1612 E->RBracLoc = readSourceLocation();
1613
1614 for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1615 E->setArg(I, Record.readSubExpr());
1616
1617 SourceLocation *Locs = E->getStoredSelLocs();
1618 for (unsigned I = 0; I != NumStoredSelLocs; ++I)
1619 Locs[I] = readSourceLocation();
1620}
1621
1622void ASTStmtReader::VisitObjCForCollectionStmt(ObjCForCollectionStmt *S) {
1623 VisitStmt(S);
1624 S->setElement(Record.readSubStmt());
1625 S->setCollection(Record.readSubExpr());
1626 S->setBody(Record.readSubStmt());
1627 S->setForLoc(readSourceLocation());
1628 S->setRParenLoc(readSourceLocation());
1629}
1630
1631void ASTStmtReader::VisitObjCAtCatchStmt(ObjCAtCatchStmt *S) {
1632 VisitStmt(S);
1633 S->setCatchBody(Record.readSubStmt());
1634 S->setCatchParamDecl(readDeclAs<VarDecl>());
1635 S->setAtCatchLoc(readSourceLocation());
1636 S->setRParenLoc(readSourceLocation());
1637}
1638
1639void ASTStmtReader::VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S) {
1640 VisitStmt(S);
1641 S->setFinallyBody(Record.readSubStmt());
1642 S->setAtFinallyLoc(readSourceLocation());
1643}
1644
1645void ASTStmtReader::VisitObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S) {
1646 VisitStmt(S); // FIXME: no test coverage.
1647 S->setSubStmt(Record.readSubStmt());
1648 S->setAtLoc(readSourceLocation());
1649}
1650
1651void ASTStmtReader::VisitObjCAtTryStmt(ObjCAtTryStmt *S) {
1652 VisitStmt(S);
1653 assert(Record.peekInt() == S->getNumCatchStmts());
1654 Record.skipInts(1);
1655 bool HasFinally = Record.readInt();
1656 S->setTryBody(Record.readSubStmt());
1657 for (unsigned I = 0, N = S->getNumCatchStmts(); I != N; ++I)
1658 S->setCatchStmt(I, cast_or_null<ObjCAtCatchStmt>(Record.readSubStmt()));
1659
1660 if (HasFinally)
1661 S->setFinallyStmt(Record.readSubStmt());
1662 S->setAtTryLoc(readSourceLocation());
1663}
1664
1665void ASTStmtReader::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
1666 VisitStmt(S); // FIXME: no test coverage.
1667 S->setSynchExpr(Record.readSubStmt());
1668 S->setSynchBody(Record.readSubStmt());
1669 S->setAtSynchronizedLoc(readSourceLocation());
1670}
1671
1672void ASTStmtReader::VisitObjCAtThrowStmt(ObjCAtThrowStmt *S) {
1673 VisitStmt(S); // FIXME: no test coverage.
1674 S->setThrowExpr(Record.readSubStmt());
1675 S->setThrowLoc(readSourceLocation());
1676}
1677
1678void ASTStmtReader::VisitObjCBoolLiteralExpr(ObjCBoolLiteralExpr *E) {
1679 VisitExpr(E);
1680 E->setValue(Record.readInt());
1681 E->setLocation(readSourceLocation());
1682}
1683
1684void ASTStmtReader::VisitObjCAvailabilityCheckExpr(ObjCAvailabilityCheckExpr *E) {
1685 VisitExpr(E);
1686 SourceRange R = Record.readSourceRange();
1687 E->AtLoc = R.getBegin();
1688 E->RParen = R.getEnd();
1689 E->VersionToCheck = Record.readVersionTuple();
1690}
1691
1692//===----------------------------------------------------------------------===//
1693// C++ Expressions and Statements
1694//===----------------------------------------------------------------------===//
1695
1696void ASTStmtReader::VisitCXXCatchStmt(CXXCatchStmt *S) {
1697 VisitStmt(S);
1698 S->CatchLoc = readSourceLocation();
1699 S->ExceptionDecl = readDeclAs<VarDecl>();
1700 S->HandlerBlock = Record.readSubStmt();
1701}
1702
1703void ASTStmtReader::VisitCXXTryStmt(CXXTryStmt *S) {
1704 VisitStmt(S);
1705 assert(Record.peekInt() == S->getNumHandlers() && "NumStmtFields is wrong ?");
1706 Record.skipInts(1);
1707 S->TryLoc = readSourceLocation();
1708 S->getStmts()[0] = Record.readSubStmt();
1709 for (unsigned i = 0, e = S->getNumHandlers(); i != e; ++i)
1710 S->getStmts()[i + 1] = Record.readSubStmt();
1711}
1712
1713void ASTStmtReader::VisitCXXForRangeStmt(CXXForRangeStmt *S) {
1714 VisitStmt(S);
1715 S->ForLoc = readSourceLocation();
1716 S->CoawaitLoc = readSourceLocation();
1717 S->ColonLoc = readSourceLocation();
1718 S->RParenLoc = readSourceLocation();
1719 S->setInit(Record.readSubStmt());
1720 S->setRangeStmt(Record.readSubStmt());
1721 S->setBeginStmt(Record.readSubStmt());
1722 S->setEndStmt(Record.readSubStmt());
1723 S->setCond(Record.readSubExpr());
1724 S->setInc(Record.readSubExpr());
1725 S->setLoopVarStmt(Record.readSubStmt());
1726 S->setBody(Record.readSubStmt());
1727}
1728
1729void ASTStmtReader::VisitMSDependentExistsStmt(MSDependentExistsStmt *S) {
1730 VisitStmt(S);
1731 S->KeywordLoc = readSourceLocation();
1732 S->IsIfExists = Record.readInt();
1733 S->QualifierLoc = Record.readNestedNameSpecifierLoc();
1734 S->NameInfo = Record.readDeclarationNameInfo();
1735 S->SubStmt = Record.readSubStmt();
1736}
1737
1738void ASTStmtReader::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
1739 VisitCallExpr(E);
1740 E->CXXOperatorCallExprBits.OperatorKind = Record.readInt();
1741 E->BeginLoc = Record.readSourceLocation();
1742}
1743
1744void ASTStmtReader::VisitCXXRewrittenBinaryOperator(
1746 VisitExpr(E);
1747 E->CXXRewrittenBinaryOperatorBits.IsReversed = Record.readInt();
1748 E->SemanticForm = Record.readSubExpr();
1749}
1750
1751void ASTStmtReader::VisitCXXConstructExpr(CXXConstructExpr *E) {
1752 VisitExpr(E);
1753
1754 unsigned NumArgs = Record.readInt();
1755 assert((NumArgs == E->getNumArgs()) && "Wrong NumArgs!");
1756
1757 E->CXXConstructExprBits.Elidable = Record.readInt();
1758 E->CXXConstructExprBits.HadMultipleCandidates = Record.readInt();
1759 E->CXXConstructExprBits.ListInitialization = Record.readInt();
1760 E->CXXConstructExprBits.StdInitListInitialization = Record.readInt();
1761 E->CXXConstructExprBits.ZeroInitialization = Record.readInt();
1762 E->CXXConstructExprBits.ConstructionKind = Record.readInt();
1763 E->CXXConstructExprBits.IsImmediateEscalating = Record.readInt();
1764 E->CXXConstructExprBits.Loc = readSourceLocation();
1765 E->Constructor = readDeclAs<CXXConstructorDecl>();
1766 E->ParenOrBraceRange = readSourceRange();
1767
1768 for (unsigned I = 0; I != NumArgs; ++I)
1769 E->setArg(I, Record.readSubExpr());
1770}
1771
1772void ASTStmtReader::VisitCXXInheritedCtorInitExpr(CXXInheritedCtorInitExpr *E) {
1773 VisitExpr(E);
1774 E->Constructor = readDeclAs<CXXConstructorDecl>();
1775 E->Loc = readSourceLocation();
1776 E->ConstructsVirtualBase = Record.readInt();
1777 E->InheritedFromVirtualBase = Record.readInt();
1778}
1779
1780void ASTStmtReader::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
1781 VisitCXXConstructExpr(E);
1782 E->TSI = readTypeSourceInfo();
1783}
1784
1785void ASTStmtReader::VisitLambdaExpr(LambdaExpr *E) {
1786 VisitExpr(E);
1787 unsigned NumCaptures = Record.readInt();
1788 (void)NumCaptures;
1789 assert(NumCaptures == E->LambdaExprBits.NumCaptures);
1790 E->IntroducerRange = readSourceRange();
1791 E->LambdaExprBits.CaptureDefault = Record.readInt();
1792 E->CaptureDefaultLoc = readSourceLocation();
1793 E->LambdaExprBits.ExplicitParams = Record.readInt();
1794 E->LambdaExprBits.ExplicitResultType = Record.readInt();
1795 E->ClosingBrace = readSourceLocation();
1796
1797 // Read capture initializers.
1799 CEnd = E->capture_init_end();
1800 C != CEnd; ++C)
1801 *C = Record.readSubExpr();
1802
1803 // The body will be lazily deserialized when needed from the call operator
1804 // declaration.
1805}
1806
1807void
1808ASTStmtReader::VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E) {
1809 VisitExpr(E);
1810 E->SubExpr = Record.readSubExpr();
1811}
1812
1813void ASTStmtReader::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) {
1814 VisitExplicitCastExpr(E);
1815 SourceRange R = readSourceRange();
1816 E->Loc = R.getBegin();
1817 E->RParenLoc = R.getEnd();
1818 if (CurrentUnpackingBits->getNextBit())
1819 E->AngleBrackets = readSourceRange();
1820}
1821
1822void ASTStmtReader::VisitCXXStaticCastExpr(CXXStaticCastExpr *E) {
1823 return VisitCXXNamedCastExpr(E);
1824}
1825
1826void ASTStmtReader::VisitCXXDynamicCastExpr(CXXDynamicCastExpr *E) {
1827 return VisitCXXNamedCastExpr(E);
1828}
1829
1830void ASTStmtReader::VisitCXXReinterpretCastExpr(CXXReinterpretCastExpr *E) {
1831 return VisitCXXNamedCastExpr(E);
1832}
1833
1834void ASTStmtReader::VisitCXXAddrspaceCastExpr(CXXAddrspaceCastExpr *E) {
1835 return VisitCXXNamedCastExpr(E);
1836}
1837
1838void ASTStmtReader::VisitCXXConstCastExpr(CXXConstCastExpr *E) {
1839 return VisitCXXNamedCastExpr(E);
1840}
1841
1842void ASTStmtReader::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E) {
1843 VisitExplicitCastExpr(E);
1844 E->setLParenLoc(readSourceLocation());
1845 E->setRParenLoc(readSourceLocation());
1846}
1847
1848void ASTStmtReader::VisitBuiltinBitCastExpr(BuiltinBitCastExpr *E) {
1849 VisitExplicitCastExpr(E);
1850 E->KWLoc = readSourceLocation();
1851 E->RParenLoc = readSourceLocation();
1852}
1853
1854void ASTStmtReader::VisitUserDefinedLiteral(UserDefinedLiteral *E) {
1855 VisitCallExpr(E);
1856 E->UDSuffixLoc = readSourceLocation();
1857}
1858
1859void ASTStmtReader::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) {
1860 VisitExpr(E);
1861 E->setValue(Record.readInt());
1862 E->setLocation(readSourceLocation());
1863}
1864
1865void ASTStmtReader::VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E) {
1866 VisitExpr(E);
1867 E->setLocation(readSourceLocation());
1868}
1869
1870void ASTStmtReader::VisitCXXTypeidExpr(CXXTypeidExpr *E) {
1871 VisitExpr(E);
1872 E->setSourceRange(readSourceRange());
1873 if (E->isTypeOperand())
1874 E->Operand = readTypeSourceInfo();
1875 else
1876 E->Operand = Record.readSubExpr();
1877}
1878
1879void ASTStmtReader::VisitCXXThisExpr(CXXThisExpr *E) {
1880 VisitExpr(E);
1881 E->setLocation(readSourceLocation());
1882 E->setImplicit(Record.readInt());
1884}
1885
1886void ASTStmtReader::VisitCXXThrowExpr(CXXThrowExpr *E) {
1887 VisitExpr(E);
1888 E->CXXThrowExprBits.ThrowLoc = readSourceLocation();
1889 E->Operand = Record.readSubExpr();
1890 E->CXXThrowExprBits.IsThrownVariableInScope = Record.readInt();
1891}
1892
1893void ASTStmtReader::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
1894 VisitExpr(E);
1895 E->Param = readDeclAs<ParmVarDecl>();
1896 E->UsedContext = readDeclAs<DeclContext>();
1897 E->CXXDefaultArgExprBits.Loc = readSourceLocation();
1898 E->CXXDefaultArgExprBits.HasRewrittenInit = Record.readInt();
1899 if (E->CXXDefaultArgExprBits.HasRewrittenInit)
1900 *E->getTrailingObjects() = Record.readSubExpr();
1901}
1902
1903void ASTStmtReader::VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E) {
1904 VisitExpr(E);
1905 E->CXXDefaultInitExprBits.HasRewrittenInit = Record.readInt();
1906 E->Field = readDeclAs<FieldDecl>();
1907 E->UsedContext = readDeclAs<DeclContext>();
1908 E->CXXDefaultInitExprBits.Loc = readSourceLocation();
1909 if (E->CXXDefaultInitExprBits.HasRewrittenInit)
1910 *E->getTrailingObjects() = Record.readSubExpr();
1911}
1912
1913void ASTStmtReader::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
1914 VisitExpr(E);
1915 E->setTemporary(Record.readCXXTemporary());
1916 E->setSubExpr(Record.readSubExpr());
1917}
1918
1919void ASTStmtReader::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
1920 VisitExpr(E);
1921 E->TypeInfo = readTypeSourceInfo();
1922 E->CXXScalarValueInitExprBits.RParenLoc = readSourceLocation();
1923}
1924
1925void ASTStmtReader::VisitCXXNewExpr(CXXNewExpr *E) {
1926 VisitExpr(E);
1927
1928 bool IsArray = Record.readInt();
1929 bool HasInit = Record.readInt();
1930 unsigned NumPlacementArgs = Record.readInt();
1931 bool IsParenTypeId = Record.readInt();
1932
1933 E->CXXNewExprBits.IsGlobalNew = Record.readInt();
1934 E->CXXNewExprBits.ShouldPassAlignment = Record.readInt();
1935 E->CXXNewExprBits.ShouldPassTypeIdentity = Record.readInt();
1936 E->CXXNewExprBits.UsualArrayDeleteWantsSize = Record.readInt();
1937 E->CXXNewExprBits.HasInitializer = Record.readInt();
1938 E->CXXNewExprBits.StoredInitializationStyle = Record.readInt();
1939
1940 assert((IsArray == E->isArray()) && "Wrong IsArray!");
1941 assert((HasInit == E->hasInitializer()) && "Wrong HasInit!");
1942 assert((NumPlacementArgs == E->getNumPlacementArgs()) &&
1943 "Wrong NumPlacementArgs!");
1944 assert((IsParenTypeId == E->isParenTypeId()) && "Wrong IsParenTypeId!");
1945 (void)IsArray;
1946 (void)HasInit;
1947 (void)NumPlacementArgs;
1948
1949 E->setOperatorNew(readDeclAs<FunctionDecl>());
1950 E->setOperatorDelete(readDeclAs<FunctionDecl>());
1951 E->AllocatedTypeInfo = readTypeSourceInfo();
1952 if (IsParenTypeId)
1953 E->getTrailingObjects<SourceRange>()[0] = readSourceRange();
1954 E->Range = readSourceRange();
1955 E->DirectInitRange = readSourceRange();
1956
1957 // Install all the subexpressions.
1959 N = E->raw_arg_end();
1960 I != N; ++I)
1961 *I = Record.readSubStmt();
1962}
1963
1964void ASTStmtReader::VisitCXXDeleteExpr(CXXDeleteExpr *E) {
1965 VisitExpr(E);
1966 E->CXXDeleteExprBits.GlobalDelete = Record.readInt();
1967 E->CXXDeleteExprBits.ArrayForm = Record.readInt();
1968 E->CXXDeleteExprBits.ArrayFormAsWritten = Record.readInt();
1969 E->CXXDeleteExprBits.UsualArrayDeleteWantsSize = Record.readInt();
1970 E->OperatorDelete = readDeclAs<FunctionDecl>();
1971 E->Argument = Record.readSubExpr();
1972 E->CXXDeleteExprBits.Loc = readSourceLocation();
1973}
1974
1975void ASTStmtReader::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
1976 VisitExpr(E);
1977
1978 E->Base = Record.readSubExpr();
1979 E->IsArrow = Record.readInt();
1980 E->OperatorLoc = readSourceLocation();
1981 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1982 E->ScopeType = readTypeSourceInfo();
1983 E->ColonColonLoc = readSourceLocation();
1984 E->TildeLoc = readSourceLocation();
1985
1986 IdentifierInfo *II = Record.readIdentifier();
1987 if (II)
1988 E->setDestroyedType(II, readSourceLocation());
1989 else
1990 E->setDestroyedType(readTypeSourceInfo());
1991}
1992
1993void ASTStmtReader::VisitExprWithCleanups(ExprWithCleanups *E) {
1994 VisitExpr(E);
1995
1996 unsigned NumObjects = Record.readInt();
1997 assert(NumObjects == E->getNumObjects());
1998 for (unsigned i = 0; i != NumObjects; ++i) {
1999 unsigned CleanupKind = Record.readInt();
2001 if (CleanupKind == COK_Block)
2002 Obj = readDeclAs<BlockDecl>();
2003 else if (CleanupKind == COK_CompoundLiteral)
2004 Obj = cast<CompoundLiteralExpr>(Record.readSubExpr());
2005 else
2006 llvm_unreachable("unexpected cleanup object type");
2007 E->getTrailingObjects()[i] = Obj;
2008 }
2009
2010 E->ExprWithCleanupsBits.CleanupsHaveSideEffects = Record.readInt();
2011 E->SubExpr = Record.readSubExpr();
2012}
2013
2014void ASTStmtReader::VisitCXXDependentScopeMemberExpr(
2016 VisitExpr(E);
2017
2018 unsigned NumTemplateArgs = Record.readInt();
2019 CurrentUnpackingBits.emplace(Record.readInt());
2020 bool HasTemplateKWAndArgsInfo = CurrentUnpackingBits->getNextBit();
2021 bool HasFirstQualifierFoundInScope = CurrentUnpackingBits->getNextBit();
2022
2023 assert((HasTemplateKWAndArgsInfo == E->hasTemplateKWAndArgsInfo()) &&
2024 "Wrong HasTemplateKWAndArgsInfo!");
2025 assert(
2026 (HasFirstQualifierFoundInScope == E->hasFirstQualifierFoundInScope()) &&
2027 "Wrong HasFirstQualifierFoundInScope!");
2028
2029 if (HasTemplateKWAndArgsInfo)
2031 *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
2032 E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs);
2033
2034 assert((NumTemplateArgs == E->getNumTemplateArgs()) &&
2035 "Wrong NumTemplateArgs!");
2036
2038 CurrentUnpackingBits->getNextBit();
2039
2040 E->BaseType = Record.readType();
2041 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
2042 // not ImplicitAccess
2043 if (CurrentUnpackingBits->getNextBit())
2044 E->Base = Record.readSubExpr();
2045 else
2046 E->Base = nullptr;
2047
2048 E->CXXDependentScopeMemberExprBits.OperatorLoc = readSourceLocation();
2049
2050 if (HasFirstQualifierFoundInScope)
2051 *E->getTrailingObjects<NamedDecl *>() = readDeclAs<NamedDecl>();
2052
2053 E->MemberNameInfo = Record.readDeclarationNameInfo();
2054}
2055
2056void
2057ASTStmtReader::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) {
2058 VisitExpr(E);
2059
2060 if (CurrentUnpackingBits->getNextBit()) // HasTemplateKWAndArgsInfo
2062 *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
2063 E->getTrailingObjects<TemplateArgumentLoc>(),
2064 /*NumTemplateArgs=*/CurrentUnpackingBits->getNextBits(/*Width=*/16));
2065
2066 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
2067 E->NameInfo = Record.readDeclarationNameInfo();
2068}
2069
2070void
2071ASTStmtReader::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E) {
2072 VisitExpr(E);
2073 assert(Record.peekInt() == E->getNumArgs() &&
2074 "Read wrong record during creation ?");
2075 Record.skipInts(1);
2076 for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
2077 E->setArg(I, Record.readSubExpr());
2078 E->TypeAndInitForm.setPointer(readTypeSourceInfo());
2079 E->setLParenLoc(readSourceLocation());
2080 E->setRParenLoc(readSourceLocation());
2081 E->TypeAndInitForm.setInt(Record.readInt());
2082}
2083
2084void ASTStmtReader::VisitOverloadExpr(OverloadExpr *E) {
2085 VisitExpr(E);
2086
2087 unsigned NumResults = Record.readInt();
2088 CurrentUnpackingBits.emplace(Record.readInt());
2089 bool HasTemplateKWAndArgsInfo = CurrentUnpackingBits->getNextBit();
2090 assert((E->getNumDecls() == NumResults) && "Wrong NumResults!");
2091 assert((E->hasTemplateKWAndArgsInfo() == HasTemplateKWAndArgsInfo) &&
2092 "Wrong HasTemplateKWAndArgsInfo!");
2093
2094 unsigned NumTemplateArgs = 0;
2095 if (HasTemplateKWAndArgsInfo) {
2096 NumTemplateArgs = Record.readInt();
2099 NumTemplateArgs);
2100 }
2101
2102 UnresolvedSet<8> Decls;
2103 for (unsigned I = 0; I != NumResults; ++I) {
2104 auto *D = readDeclAs<NamedDecl>();
2105 auto AS = (AccessSpecifier)Record.readInt();
2106 Decls.addDecl(D, AS);
2107 }
2108
2109 DeclAccessPair *Results = E->getTrailingResults();
2110 UnresolvedSetIterator Iter = Decls.begin();
2111 for (unsigned I = 0; I != NumResults; ++I) {
2112 Results[I] = (Iter + I).getPair();
2113 }
2114
2115 assert((E->getNumTemplateArgs() == NumTemplateArgs) &&
2116 "Wrong NumTemplateArgs!");
2117
2118 E->NameInfo = Record.readDeclarationNameInfo();
2119 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
2120}
2121
2122void ASTStmtReader::VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
2123 VisitOverloadExpr(E);
2124 E->UnresolvedMemberExprBits.IsArrow = CurrentUnpackingBits->getNextBit();
2125 E->UnresolvedMemberExprBits.HasUnresolvedUsing =
2126 CurrentUnpackingBits->getNextBit();
2127
2128 if (/*!isImplicitAccess=*/CurrentUnpackingBits->getNextBit())
2129 E->Base = Record.readSubExpr();
2130 else
2131 E->Base = nullptr;
2132
2133 E->OperatorLoc = readSourceLocation();
2134
2135 E->BaseType = Record.readType();
2136}
2137
2138void ASTStmtReader::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) {
2139 VisitOverloadExpr(E);
2140 E->UnresolvedLookupExprBits.RequiresADL = CurrentUnpackingBits->getNextBit();
2141 E->NamingClass = readDeclAs<CXXRecordDecl>();
2142}
2143
2144void ASTStmtReader::VisitTypeTraitExpr(TypeTraitExpr *E) {
2145 VisitExpr(E);
2146 E->TypeTraitExprBits.IsBooleanTypeTrait = Record.readInt();
2147 E->TypeTraitExprBits.NumArgs = Record.readInt();
2148 E->TypeTraitExprBits.Kind = Record.readInt();
2149
2150 if (E->TypeTraitExprBits.IsBooleanTypeTrait)
2151 E->TypeTraitExprBits.Value = Record.readInt();
2152 else
2153 *E->getTrailingObjects<APValue>() = Record.readAPValue();
2154
2155 SourceRange Range = readSourceRange();
2156 E->Loc = Range.getBegin();
2157 E->RParenLoc = Range.getEnd();
2158
2159 auto **Args = E->getTrailingObjects<TypeSourceInfo *>();
2160 for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
2161 Args[I] = readTypeSourceInfo();
2162}
2163
2164void ASTStmtReader::VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E) {
2165 VisitExpr(E);
2166 E->ArrayTypeTraitExprBits.ATT = (ArrayTypeTrait)Record.readInt();
2167 E->Value = (unsigned int)Record.readInt();
2168 SourceRange Range = readSourceRange();
2169 E->Loc = Range.getBegin();
2170 E->RParen = Range.getEnd();
2171 E->QueriedType = readTypeSourceInfo();
2172 E->Dimension = Record.readSubExpr();
2173}
2174
2175void ASTStmtReader::VisitExpressionTraitExpr(ExpressionTraitExpr *E) {
2176 VisitExpr(E);
2177 E->ExpressionTraitExprBits.ET = (ExpressionTrait)Record.readInt();
2178 E->ExpressionTraitExprBits.Value = (bool)Record.readInt();
2179 SourceRange Range = readSourceRange();
2180 E->QueriedExpression = Record.readSubExpr();
2181 E->Loc = Range.getBegin();
2182 E->RParen = Range.getEnd();
2183}
2184
2185void ASTStmtReader::VisitCXXNoexceptExpr(CXXNoexceptExpr *E) {
2186 VisitExpr(E);
2187 E->CXXNoexceptExprBits.Value = Record.readInt();
2188 E->Range = readSourceRange();
2189 E->Operand = Record.readSubExpr();
2190}
2191
2192void ASTStmtReader::VisitPackExpansionExpr(PackExpansionExpr *E) {
2193 VisitExpr(E);
2194 E->EllipsisLoc = readSourceLocation();
2195 E->NumExpansions = Record.readInt();
2196 E->Pattern = Record.readSubExpr();
2197}
2198
2199void ASTStmtReader::VisitSizeOfPackExpr(SizeOfPackExpr *E) {
2200 VisitExpr(E);
2201 unsigned NumPartialArgs = Record.readInt();
2202 E->OperatorLoc = readSourceLocation();
2203 E->PackLoc = readSourceLocation();
2204 E->RParenLoc = readSourceLocation();
2205 E->Pack = Record.readDeclAs<NamedDecl>();
2206 if (E->isPartiallySubstituted()) {
2207 assert(E->Length == NumPartialArgs);
2208 for (auto *I = E->getTrailingObjects(), *E = I + NumPartialArgs; I != E;
2209 ++I)
2210 new (I) TemplateArgument(Record.readTemplateArgument());
2211 } else if (!E->isValueDependent()) {
2212 E->Length = Record.readInt();
2213 }
2214}
2215
2216void ASTStmtReader::VisitPackIndexingExpr(PackIndexingExpr *E) {
2217 VisitExpr(E);
2218 E->PackIndexingExprBits.TransformedExpressions = Record.readInt();
2219 E->PackIndexingExprBits.FullySubstituted = Record.readInt();
2220 E->EllipsisLoc = readSourceLocation();
2221 E->RSquareLoc = readSourceLocation();
2222 E->SubExprs[0] = Record.readStmt();
2223 E->SubExprs[1] = Record.readStmt();
2224 auto **Exprs = E->getTrailingObjects();
2225 for (unsigned I = 0; I < E->PackIndexingExprBits.TransformedExpressions; ++I)
2226 Exprs[I] = Record.readExpr();
2227}
2228
2229void ASTStmtReader::VisitSubstNonTypeTemplateParmExpr(
2231 VisitExpr(E);
2232 E->AssociatedDeclAndRef.setPointer(readDeclAs<Decl>());
2233 E->AssociatedDeclAndRef.setInt(CurrentUnpackingBits->getNextBit());
2234 E->Index = CurrentUnpackingBits->getNextBits(/*Width=*/12);
2235 E->PackIndex = Record.readUnsignedOrNone().toInternalRepresentation();
2236 E->Final = CurrentUnpackingBits->getNextBit();
2237 E->SubstNonTypeTemplateParmExprBits.NameLoc = readSourceLocation();
2238 E->Replacement = Record.readSubExpr();
2239}
2240
2241void ASTStmtReader::VisitSubstNonTypeTemplateParmPackExpr(
2243 VisitExpr(E);
2244 E->AssociatedDecl = readDeclAs<Decl>();
2245 E->Final = CurrentUnpackingBits->getNextBit();
2246 E->Index = Record.readInt();
2247 TemplateArgument ArgPack = Record.readTemplateArgument();
2248 if (ArgPack.getKind() != TemplateArgument::Pack)
2249 return;
2250
2251 E->Arguments = ArgPack.pack_begin();
2252 E->NumArguments = ArgPack.pack_size();
2253 E->NameLoc = readSourceLocation();
2254}
2255
2256void ASTStmtReader::VisitFunctionParmPackExpr(FunctionParmPackExpr *E) {
2257 VisitExpr(E);
2258 E->NumParameters = Record.readInt();
2259 E->ParamPack = readDeclAs<ValueDecl>();
2260 E->NameLoc = readSourceLocation();
2261 auto **Parms = E->getTrailingObjects();
2262 for (unsigned i = 0, n = E->NumParameters; i != n; ++i)
2263 Parms[i] = readDeclAs<ValueDecl>();
2264}
2265
2266void ASTStmtReader::VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E) {
2267 VisitExpr(E);
2268 bool HasMaterialzedDecl = Record.readInt();
2269 if (HasMaterialzedDecl)
2270 E->State = cast<LifetimeExtendedTemporaryDecl>(Record.readDecl());
2271 else
2272 E->State = Record.readSubExpr();
2273}
2274
2275void ASTStmtReader::VisitCXXFoldExpr(CXXFoldExpr *E) {
2276 VisitExpr(E);
2277 E->LParenLoc = readSourceLocation();
2278 E->EllipsisLoc = readSourceLocation();
2279 E->RParenLoc = readSourceLocation();
2280 E->NumExpansions = Record.readUnsignedOrNone();
2281 E->SubExprs[0] = Record.readSubExpr();
2282 E->SubExprs[1] = Record.readSubExpr();
2283 E->SubExprs[2] = Record.readSubExpr();
2284 E->CXXFoldExprBits.Opcode = (BinaryOperatorKind)Record.readInt();
2285}
2286
2287void ASTStmtReader::VisitCXXParenListInitExpr(CXXParenListInitExpr *E) {
2288 VisitExpr(E);
2289 unsigned ExpectedNumExprs = Record.readInt();
2290 assert(E->NumExprs == ExpectedNumExprs &&
2291 "expected number of expressions does not equal the actual number of "
2292 "serialized expressions.");
2293 E->NumUserSpecifiedExprs = Record.readInt();
2294 E->InitLoc = readSourceLocation();
2295 E->LParenLoc = readSourceLocation();
2296 E->RParenLoc = readSourceLocation();
2297 for (unsigned I = 0; I < ExpectedNumExprs; I++)
2298 E->getTrailingObjects()[I] = Record.readSubExpr();
2299
2300 bool HasArrayFillerOrUnionDecl = Record.readBool();
2301 if (HasArrayFillerOrUnionDecl) {
2302 bool HasArrayFiller = Record.readBool();
2303 if (HasArrayFiller) {
2304 E->setArrayFiller(Record.readSubExpr());
2305 } else {
2306 E->setInitializedFieldInUnion(readDeclAs<FieldDecl>());
2307 }
2308 }
2309 E->updateDependence();
2310}
2311
2312void ASTStmtReader::VisitOpaqueValueExpr(OpaqueValueExpr *E) {
2313 VisitExpr(E);
2314 E->SourceExpr = Record.readSubExpr();
2315 E->OpaqueValueExprBits.Loc = readSourceLocation();
2316 E->setIsUnique(Record.readInt());
2317}
2318
2319void ASTStmtReader::VisitRecoveryExpr(RecoveryExpr *E) {
2320 VisitExpr(E);
2321 unsigned NumArgs = Record.readInt();
2322 E->BeginLoc = readSourceLocation();
2323 E->EndLoc = readSourceLocation();
2324 assert((NumArgs + 0LL ==
2325 std::distance(E->children().begin(), E->children().end())) &&
2326 "Wrong NumArgs!");
2327 (void)NumArgs;
2328 for (Stmt *&Child : E->children())
2329 Child = Record.readSubStmt();
2330}
2331
2332//===----------------------------------------------------------------------===//
2333// Microsoft Expressions and Statements
2334//===----------------------------------------------------------------------===//
2335void ASTStmtReader::VisitMSPropertyRefExpr(MSPropertyRefExpr *E) {
2336 VisitExpr(E);
2337 E->IsArrow = (Record.readInt() != 0);
2338 E->BaseExpr = Record.readSubExpr();
2339 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
2340 E->MemberLoc = readSourceLocation();
2341 E->TheDecl = readDeclAs<MSPropertyDecl>();
2342}
2343
2344void ASTStmtReader::VisitMSPropertySubscriptExpr(MSPropertySubscriptExpr *E) {
2345 VisitExpr(E);
2346 E->setBase(Record.readSubExpr());
2347 E->setIdx(Record.readSubExpr());
2348 E->setRBracketLoc(readSourceLocation());
2349}
2350
2351void ASTStmtReader::VisitCXXUuidofExpr(CXXUuidofExpr *E) {
2352 VisitExpr(E);
2353 E->setSourceRange(readSourceRange());
2354 E->Guid = readDeclAs<MSGuidDecl>();
2355 if (E->isTypeOperand())
2356 E->Operand = readTypeSourceInfo();
2357 else
2358 E->Operand = Record.readSubExpr();
2359}
2360
2361void ASTStmtReader::VisitSEHLeaveStmt(SEHLeaveStmt *S) {
2362 VisitStmt(S);
2363 S->setLeaveLoc(readSourceLocation());
2364}
2365
2366void ASTStmtReader::VisitSEHExceptStmt(SEHExceptStmt *S) {
2367 VisitStmt(S);
2368 S->Loc = readSourceLocation();
2369 S->Children[SEHExceptStmt::FILTER_EXPR] = Record.readSubStmt();
2370 S->Children[SEHExceptStmt::BLOCK] = Record.readSubStmt();
2371}
2372
2373void ASTStmtReader::VisitSEHFinallyStmt(SEHFinallyStmt *S) {
2374 VisitStmt(S);
2375 S->Loc = readSourceLocation();
2376 S->Block = Record.readSubStmt();
2377}
2378
2379void ASTStmtReader::VisitSEHTryStmt(SEHTryStmt *S) {
2380 VisitStmt(S);
2381 S->IsCXXTry = Record.readInt();
2382 S->TryLoc = readSourceLocation();
2383 S->Children[SEHTryStmt::TRY] = Record.readSubStmt();
2384 S->Children[SEHTryStmt::HANDLER] = Record.readSubStmt();
2385}
2386
2387//===----------------------------------------------------------------------===//
2388// CUDA Expressions and Statements
2389//===----------------------------------------------------------------------===//
2390
2391void ASTStmtReader::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E) {
2392 VisitCallExpr(E);
2393 E->setPreArg(CUDAKernelCallExpr::CONFIG, Record.readSubExpr());
2394}
2395
2396//===----------------------------------------------------------------------===//
2397// OpenCL Expressions and Statements.
2398//===----------------------------------------------------------------------===//
2399void ASTStmtReader::VisitAsTypeExpr(AsTypeExpr *E) {
2400 VisitExpr(E);
2401 E->BuiltinLoc = readSourceLocation();
2402 E->RParenLoc = readSourceLocation();
2403 E->SrcExpr = Record.readSubExpr();
2404}
2405
2406//===----------------------------------------------------------------------===//
2407// OpenMP Directives.
2408//===----------------------------------------------------------------------===//
2409
2410void ASTStmtReader::VisitOMPCanonicalLoop(OMPCanonicalLoop *S) {
2411 VisitStmt(S);
2412 for (Stmt *&SubStmt : S->SubStmts)
2413 SubStmt = Record.readSubStmt();
2414}
2415
2416void ASTStmtReader::VisitOMPExecutableDirective(OMPExecutableDirective *E) {
2417 Record.readOMPChildren(E->Data);
2418 E->setLocStart(readSourceLocation());
2419 E->setLocEnd(readSourceLocation());
2420}
2421
2422void ASTStmtReader::VisitOMPLoopBasedDirective(OMPLoopBasedDirective *D) {
2423 VisitStmt(D);
2424 // Field CollapsedNum was read in ReadStmtFromStream.
2425 Record.skipInts(1);
2426 VisitOMPExecutableDirective(D);
2427}
2428
2429void ASTStmtReader::VisitOMPLoopDirective(OMPLoopDirective *D) {
2430 VisitOMPLoopBasedDirective(D);
2431}
2432
2433void ASTStmtReader::VisitOMPMetaDirective(OMPMetaDirective *D) {
2434 VisitStmt(D);
2435 // The NumClauses field was read in ReadStmtFromStream.
2436 Record.skipInts(1);
2437 VisitOMPExecutableDirective(D);
2438}
2439
2440void ASTStmtReader::VisitOMPParallelDirective(OMPParallelDirective *D) {
2441 VisitStmt(D);
2442 VisitOMPExecutableDirective(D);
2443 D->setHasCancel(Record.readBool());
2444}
2445
2446void ASTStmtReader::VisitOMPSimdDirective(OMPSimdDirective *D) {
2447 VisitOMPLoopDirective(D);
2448}
2449
2450void ASTStmtReader::VisitOMPCanonicalLoopNestTransformationDirective(
2451 OMPCanonicalLoopNestTransformationDirective *D) {
2452 VisitOMPLoopBasedDirective(D);
2453 D->setNumGeneratedLoops(Record.readUInt32());
2454}
2455
2456void ASTStmtReader::VisitOMPTileDirective(OMPTileDirective *D) {
2457 VisitOMPCanonicalLoopNestTransformationDirective(D);
2458}
2459
2460void ASTStmtReader::VisitOMPStripeDirective(OMPStripeDirective *D) {
2461 VisitOMPCanonicalLoopNestTransformationDirective(D);
2462}
2463
2464void ASTStmtReader::VisitOMPUnrollDirective(OMPUnrollDirective *D) {
2465 VisitOMPCanonicalLoopNestTransformationDirective(D);
2466}
2467
2468void ASTStmtReader::VisitOMPReverseDirective(OMPReverseDirective *D) {
2469 VisitOMPCanonicalLoopNestTransformationDirective(D);
2470}
2471
2472void ASTStmtReader::VisitOMPInterchangeDirective(OMPInterchangeDirective *D) {
2473 VisitOMPCanonicalLoopNestTransformationDirective(D);
2474}
2475
2476void ASTStmtReader::VisitOMPForDirective(OMPForDirective *D) {
2477 VisitOMPLoopDirective(D);
2478 D->setHasCancel(Record.readBool());
2479}
2480
2481void ASTStmtReader::VisitOMPForSimdDirective(OMPForSimdDirective *D) {
2482 VisitOMPLoopDirective(D);
2483}
2484
2485void ASTStmtReader::VisitOMPSectionsDirective(OMPSectionsDirective *D) {
2486 VisitStmt(D);
2487 VisitOMPExecutableDirective(D);
2488 D->setHasCancel(Record.readBool());
2489}
2490
2491void ASTStmtReader::VisitOMPSectionDirective(OMPSectionDirective *D) {
2492 VisitStmt(D);
2493 VisitOMPExecutableDirective(D);
2494 D->setHasCancel(Record.readBool());
2495}
2496
2497void ASTStmtReader::VisitOMPScopeDirective(OMPScopeDirective *D) {
2498 VisitStmt(D);
2499 VisitOMPExecutableDirective(D);
2500}
2501
2502void ASTStmtReader::VisitOMPSingleDirective(OMPSingleDirective *D) {
2503 VisitStmt(D);
2504 VisitOMPExecutableDirective(D);
2505}
2506
2507void ASTStmtReader::VisitOMPMasterDirective(OMPMasterDirective *D) {
2508 VisitStmt(D);
2509 VisitOMPExecutableDirective(D);
2510}
2511
2512void ASTStmtReader::VisitOMPCriticalDirective(OMPCriticalDirective *D) {
2513 VisitStmt(D);
2514 VisitOMPExecutableDirective(D);
2515 D->DirName = Record.readDeclarationNameInfo();
2516}
2517
2518void ASTStmtReader::VisitOMPParallelForDirective(OMPParallelForDirective *D) {
2519 VisitOMPLoopDirective(D);
2520 D->setHasCancel(Record.readBool());
2521}
2522
2523void ASTStmtReader::VisitOMPParallelForSimdDirective(
2524 OMPParallelForSimdDirective *D) {
2525 VisitOMPLoopDirective(D);
2526}
2527
2528void ASTStmtReader::VisitOMPParallelMasterDirective(
2529 OMPParallelMasterDirective *D) {
2530 VisitStmt(D);
2531 VisitOMPExecutableDirective(D);
2532}
2533
2534void ASTStmtReader::VisitOMPParallelMaskedDirective(
2535 OMPParallelMaskedDirective *D) {
2536 VisitStmt(D);
2537 VisitOMPExecutableDirective(D);
2538}
2539
2540void ASTStmtReader::VisitOMPParallelSectionsDirective(
2541 OMPParallelSectionsDirective *D) {
2542 VisitStmt(D);
2543 VisitOMPExecutableDirective(D);
2544 D->setHasCancel(Record.readBool());
2545}
2546
2547void ASTStmtReader::VisitOMPTaskDirective(OMPTaskDirective *D) {
2548 VisitStmt(D);
2549 VisitOMPExecutableDirective(D);
2550 D->setHasCancel(Record.readBool());
2551}
2552
2553void ASTStmtReader::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) {
2554 VisitStmt(D);
2555 VisitOMPExecutableDirective(D);
2556}
2557
2558void ASTStmtReader::VisitOMPBarrierDirective(OMPBarrierDirective *D) {
2559 VisitStmt(D);
2560 VisitOMPExecutableDirective(D);
2561}
2562
2563void ASTStmtReader::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) {
2564 VisitStmt(D);
2565 // The NumClauses field was read in ReadStmtFromStream.
2566 Record.skipInts(1);
2567 VisitOMPExecutableDirective(D);
2568}
2569
2570void ASTStmtReader::VisitOMPAssumeDirective(OMPAssumeDirective *D) {
2571 VisitStmt(D);
2572 VisitOMPExecutableDirective(D);
2573}
2574
2575void ASTStmtReader::VisitOMPErrorDirective(OMPErrorDirective *D) {
2576 VisitStmt(D);
2577 // The NumClauses field was read in ReadStmtFromStream.
2578 Record.skipInts(1);
2579 VisitOMPExecutableDirective(D);
2580}
2581
2582void ASTStmtReader::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) {
2583 VisitStmt(D);
2584 VisitOMPExecutableDirective(D);
2585}
2586
2587void ASTStmtReader::VisitOMPFlushDirective(OMPFlushDirective *D) {
2588 VisitStmt(D);
2589 VisitOMPExecutableDirective(D);
2590}
2591
2592void ASTStmtReader::VisitOMPDepobjDirective(OMPDepobjDirective *D) {
2593 VisitStmt(D);
2594 VisitOMPExecutableDirective(D);
2595}
2596
2597void ASTStmtReader::VisitOMPScanDirective(OMPScanDirective *D) {
2598 VisitStmt(D);
2599 VisitOMPExecutableDirective(D);
2600}
2601
2602void ASTStmtReader::VisitOMPOrderedDirective(OMPOrderedDirective *D) {
2603 VisitStmt(D);
2604 VisitOMPExecutableDirective(D);
2605}
2606
2607void ASTStmtReader::VisitOMPAtomicDirective(OMPAtomicDirective *D) {
2608 VisitStmt(D);
2609 VisitOMPExecutableDirective(D);
2610 D->Flags.IsXLHSInRHSPart = Record.readBool() ? 1 : 0;
2611 D->Flags.IsPostfixUpdate = Record.readBool() ? 1 : 0;
2612 D->Flags.IsFailOnly = Record.readBool() ? 1 : 0;
2613}
2614
2615void ASTStmtReader::VisitOMPTargetDirective(OMPTargetDirective *D) {
2616 VisitStmt(D);
2617 VisitOMPExecutableDirective(D);
2618}
2619
2620void ASTStmtReader::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) {
2621 VisitStmt(D);
2622 VisitOMPExecutableDirective(D);
2623}
2624
2625void ASTStmtReader::VisitOMPTargetEnterDataDirective(
2626 OMPTargetEnterDataDirective *D) {
2627 VisitStmt(D);
2628 VisitOMPExecutableDirective(D);
2629}
2630
2631void ASTStmtReader::VisitOMPTargetExitDataDirective(
2632 OMPTargetExitDataDirective *D) {
2633 VisitStmt(D);
2634 VisitOMPExecutableDirective(D);
2635}
2636
2637void ASTStmtReader::VisitOMPTargetParallelDirective(
2638 OMPTargetParallelDirective *D) {
2639 VisitStmt(D);
2640 VisitOMPExecutableDirective(D);
2641 D->setHasCancel(Record.readBool());
2642}
2643
2644void ASTStmtReader::VisitOMPTargetParallelForDirective(
2645 OMPTargetParallelForDirective *D) {
2646 VisitOMPLoopDirective(D);
2647 D->setHasCancel(Record.readBool());
2648}
2649
2650void ASTStmtReader::VisitOMPTeamsDirective(OMPTeamsDirective *D) {
2651 VisitStmt(D);
2652 VisitOMPExecutableDirective(D);
2653}
2654
2655void ASTStmtReader::VisitOMPCancellationPointDirective(
2656 OMPCancellationPointDirective *D) {
2657 VisitStmt(D);
2658 VisitOMPExecutableDirective(D);
2659 D->setCancelRegion(Record.readEnum<OpenMPDirectiveKind>());
2660}
2661
2662void ASTStmtReader::VisitOMPCancelDirective(OMPCancelDirective *D) {
2663 VisitStmt(D);
2664 VisitOMPExecutableDirective(D);
2665 D->setCancelRegion(Record.readEnum<OpenMPDirectiveKind>());
2666}
2667
2668void ASTStmtReader::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) {
2669 VisitOMPLoopDirective(D);
2670 D->setHasCancel(Record.readBool());
2671}
2672
2673void ASTStmtReader::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) {
2674 VisitOMPLoopDirective(D);
2675}
2676
2677void ASTStmtReader::VisitOMPMasterTaskLoopDirective(
2678 OMPMasterTaskLoopDirective *D) {
2679 VisitOMPLoopDirective(D);
2680 D->setHasCancel(Record.readBool());
2681}
2682
2683void ASTStmtReader::VisitOMPMaskedTaskLoopDirective(
2684 OMPMaskedTaskLoopDirective *D) {
2685 VisitOMPLoopDirective(D);
2686 D->setHasCancel(Record.readBool());
2687}
2688
2689void ASTStmtReader::VisitOMPMasterTaskLoopSimdDirective(
2690 OMPMasterTaskLoopSimdDirective *D) {
2691 VisitOMPLoopDirective(D);
2692}
2693
2694void ASTStmtReader::VisitOMPMaskedTaskLoopSimdDirective(
2695 OMPMaskedTaskLoopSimdDirective *D) {
2696 VisitOMPLoopDirective(D);
2697}
2698
2699void ASTStmtReader::VisitOMPParallelMasterTaskLoopDirective(
2700 OMPParallelMasterTaskLoopDirective *D) {
2701 VisitOMPLoopDirective(D);
2702 D->setHasCancel(Record.readBool());
2703}
2704
2705void ASTStmtReader::VisitOMPParallelMaskedTaskLoopDirective(
2706 OMPParallelMaskedTaskLoopDirective *D) {
2707 VisitOMPLoopDirective(D);
2708 D->setHasCancel(Record.readBool());
2709}
2710
2711void ASTStmtReader::VisitOMPParallelMasterTaskLoopSimdDirective(
2712 OMPParallelMasterTaskLoopSimdDirective *D) {
2713 VisitOMPLoopDirective(D);
2714}
2715
2716void ASTStmtReader::VisitOMPParallelMaskedTaskLoopSimdDirective(
2717 OMPParallelMaskedTaskLoopSimdDirective *D) {
2718 VisitOMPLoopDirective(D);
2719}
2720
2721void ASTStmtReader::VisitOMPDistributeDirective(OMPDistributeDirective *D) {
2722 VisitOMPLoopDirective(D);
2723}
2724
2725void ASTStmtReader::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) {
2726 VisitStmt(D);
2727 VisitOMPExecutableDirective(D);
2728}
2729
2730void ASTStmtReader::VisitOMPDistributeParallelForDirective(
2731 OMPDistributeParallelForDirective *D) {
2732 VisitOMPLoopDirective(D);
2733 D->setHasCancel(Record.readBool());
2734}
2735
2736void ASTStmtReader::VisitOMPDistributeParallelForSimdDirective(
2737 OMPDistributeParallelForSimdDirective *D) {
2738 VisitOMPLoopDirective(D);
2739}
2740
2741void ASTStmtReader::VisitOMPDistributeSimdDirective(
2742 OMPDistributeSimdDirective *D) {
2743 VisitOMPLoopDirective(D);
2744}
2745
2746void ASTStmtReader::VisitOMPTargetParallelForSimdDirective(
2747 OMPTargetParallelForSimdDirective *D) {
2748 VisitOMPLoopDirective(D);
2749}
2750
2751void ASTStmtReader::VisitOMPTargetSimdDirective(OMPTargetSimdDirective *D) {
2752 VisitOMPLoopDirective(D);
2753}
2754
2755void ASTStmtReader::VisitOMPTeamsDistributeDirective(
2756 OMPTeamsDistributeDirective *D) {
2757 VisitOMPLoopDirective(D);
2758}
2759
2760void ASTStmtReader::VisitOMPTeamsDistributeSimdDirective(
2761 OMPTeamsDistributeSimdDirective *D) {
2762 VisitOMPLoopDirective(D);
2763}
2764
2765void ASTStmtReader::VisitOMPTeamsDistributeParallelForSimdDirective(
2766 OMPTeamsDistributeParallelForSimdDirective *D) {
2767 VisitOMPLoopDirective(D);
2768}
2769
2770void ASTStmtReader::VisitOMPTeamsDistributeParallelForDirective(
2771 OMPTeamsDistributeParallelForDirective *D) {
2772 VisitOMPLoopDirective(D);
2773 D->setHasCancel(Record.readBool());
2774}
2775
2776void ASTStmtReader::VisitOMPTargetTeamsDirective(OMPTargetTeamsDirective *D) {
2777 VisitStmt(D);
2778 VisitOMPExecutableDirective(D);
2779}
2780
2781void ASTStmtReader::VisitOMPTargetTeamsDistributeDirective(
2782 OMPTargetTeamsDistributeDirective *D) {
2783 VisitOMPLoopDirective(D);
2784}
2785
2786void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForDirective(
2787 OMPTargetTeamsDistributeParallelForDirective *D) {
2788 VisitOMPLoopDirective(D);
2789 D->setHasCancel(Record.readBool());
2790}
2791
2792void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
2793 OMPTargetTeamsDistributeParallelForSimdDirective *D) {
2794 VisitOMPLoopDirective(D);
2795}
2796
2797void ASTStmtReader::VisitOMPTargetTeamsDistributeSimdDirective(
2798 OMPTargetTeamsDistributeSimdDirective *D) {
2799 VisitOMPLoopDirective(D);
2800}
2801
2802void ASTStmtReader::VisitOMPInteropDirective(OMPInteropDirective *D) {
2803 VisitStmt(D);
2804 VisitOMPExecutableDirective(D);
2805}
2806
2807void ASTStmtReader::VisitOMPDispatchDirective(OMPDispatchDirective *D) {
2808 VisitStmt(D);
2809 VisitOMPExecutableDirective(D);
2810 D->setTargetCallLoc(Record.readSourceLocation());
2811}
2812
2813void ASTStmtReader::VisitOMPMaskedDirective(OMPMaskedDirective *D) {
2814 VisitStmt(D);
2815 VisitOMPExecutableDirective(D);
2816}
2817
2818void ASTStmtReader::VisitOMPGenericLoopDirective(OMPGenericLoopDirective *D) {
2819 VisitOMPLoopDirective(D);
2820}
2821
2822void ASTStmtReader::VisitOMPTeamsGenericLoopDirective(
2823 OMPTeamsGenericLoopDirective *D) {
2824 VisitOMPLoopDirective(D);
2825}
2826
2827void ASTStmtReader::VisitOMPTargetTeamsGenericLoopDirective(
2828 OMPTargetTeamsGenericLoopDirective *D) {
2829 VisitOMPLoopDirective(D);
2830 D->setCanBeParallelFor(Record.readBool());
2831}
2832
2833void ASTStmtReader::VisitOMPParallelGenericLoopDirective(
2834 OMPParallelGenericLoopDirective *D) {
2835 VisitOMPLoopDirective(D);
2836}
2837
2838void ASTStmtReader::VisitOMPTargetParallelGenericLoopDirective(
2839 OMPTargetParallelGenericLoopDirective *D) {
2840 VisitOMPLoopDirective(D);
2841}
2842
2843//===----------------------------------------------------------------------===//
2844// OpenACC Constructs/Directives.
2845//===----------------------------------------------------------------------===//
2846void ASTStmtReader::VisitOpenACCConstructStmt(OpenACCConstructStmt *S) {
2847 (void)Record.readInt();
2848 S->Kind = Record.readEnum<OpenACCDirectiveKind>();
2849 S->Range = Record.readSourceRange();
2850 S->DirectiveLoc = Record.readSourceLocation();
2851 Record.readOpenACCClauseList(S->Clauses);
2852}
2853
2854void ASTStmtReader::VisitOpenACCAssociatedStmtConstruct(
2856 VisitOpenACCConstructStmt(S);
2857 S->setAssociatedStmt(Record.readSubStmt());
2858}
2859
2860void ASTStmtReader::VisitOpenACCComputeConstruct(OpenACCComputeConstruct *S) {
2861 VisitStmt(S);
2862 VisitOpenACCAssociatedStmtConstruct(S);
2863}
2864
2865void ASTStmtReader::VisitOpenACCLoopConstruct(OpenACCLoopConstruct *S) {
2866 VisitStmt(S);
2867 VisitOpenACCAssociatedStmtConstruct(S);
2868 S->ParentComputeConstructKind = Record.readEnum<OpenACCDirectiveKind>();
2869}
2870
2871void ASTStmtReader::VisitOpenACCCombinedConstruct(OpenACCCombinedConstruct *S) {
2872 VisitStmt(S);
2873 VisitOpenACCAssociatedStmtConstruct(S);
2874}
2875
2876void ASTStmtReader::VisitOpenACCDataConstruct(OpenACCDataConstruct *S) {
2877 VisitStmt(S);
2878 VisitOpenACCAssociatedStmtConstruct(S);
2879}
2880
2881void ASTStmtReader::VisitOpenACCEnterDataConstruct(
2882 OpenACCEnterDataConstruct *S) {
2883 VisitStmt(S);
2884 VisitOpenACCConstructStmt(S);
2885}
2886
2887void ASTStmtReader::VisitOpenACCExitDataConstruct(OpenACCExitDataConstruct *S) {
2888 VisitStmt(S);
2889 VisitOpenACCConstructStmt(S);
2890}
2891
2892void ASTStmtReader::VisitOpenACCInitConstruct(OpenACCInitConstruct *S) {
2893 VisitStmt(S);
2894 VisitOpenACCConstructStmt(S);
2895}
2896
2897void ASTStmtReader::VisitOpenACCShutdownConstruct(OpenACCShutdownConstruct *S) {
2898 VisitStmt(S);
2899 VisitOpenACCConstructStmt(S);
2900}
2901
2902void ASTStmtReader::VisitOpenACCSetConstruct(OpenACCSetConstruct *S) {
2903 VisitStmt(S);
2904 VisitOpenACCConstructStmt(S);
2905}
2906
2907void ASTStmtReader::VisitOpenACCUpdateConstruct(OpenACCUpdateConstruct *S) {
2908 VisitStmt(S);
2909 VisitOpenACCConstructStmt(S);
2910}
2911
2912void ASTStmtReader::VisitOpenACCHostDataConstruct(OpenACCHostDataConstruct *S) {
2913 VisitStmt(S);
2914 VisitOpenACCAssociatedStmtConstruct(S);
2915}
2916
2917void ASTStmtReader::VisitOpenACCWaitConstruct(OpenACCWaitConstruct *S) {
2918 VisitStmt(S);
2919 // Consume the count of Expressions.
2920 (void)Record.readInt();
2921 VisitOpenACCConstructStmt(S);
2922 S->LParenLoc = Record.readSourceLocation();
2923 S->RParenLoc = Record.readSourceLocation();
2924 S->QueuesLoc = Record.readSourceLocation();
2925
2926 for (unsigned I = 0; I < S->NumExprs; ++I) {
2927 S->getExprPtr()[I] = cast_if_present<Expr>(Record.readSubStmt());
2928 assert((I == 0 || S->getExprPtr()[I] != nullptr) &&
2929 "Only first expression should be null");
2930 }
2931}
2932
2933void ASTStmtReader::VisitOpenACCCacheConstruct(OpenACCCacheConstruct *S) {
2934 VisitStmt(S);
2935 (void)Record.readInt();
2936 VisitOpenACCConstructStmt(S);
2937 S->ParensLoc = Record.readSourceRange();
2938 S->ReadOnlyLoc = Record.readSourceLocation();
2939 for (unsigned I = 0; I < S->NumVars; ++I)
2940 S->getVarList()[I] = cast<Expr>(Record.readSubStmt());
2941}
2942
2943void ASTStmtReader::VisitOpenACCAtomicConstruct(OpenACCAtomicConstruct *S) {
2944 VisitStmt(S);
2945 VisitOpenACCConstructStmt(S);
2946 S->AtomicKind = Record.readEnum<OpenACCAtomicKind>();
2947 S->setAssociatedStmt(Record.readSubStmt());
2948}
2949
2950//===----------------------------------------------------------------------===//
2951// HLSL Constructs/Directives.
2952//===----------------------------------------------------------------------===//
2953
2954void ASTStmtReader::VisitHLSLOutArgExpr(HLSLOutArgExpr *S) {
2955 VisitExpr(S);
2956 S->SubExprs[HLSLOutArgExpr::BaseLValue] = Record.readSubExpr();
2957 S->SubExprs[HLSLOutArgExpr::CastedTemporary] = Record.readSubExpr();
2958 S->SubExprs[HLSLOutArgExpr::WritebackCast] = Record.readSubExpr();
2959 S->IsInOut = Record.readBool();
2960}
2961
2962//===----------------------------------------------------------------------===//
2963// ASTReader Implementation
2964//===----------------------------------------------------------------------===//
2965
2967 switch (ReadingKind) {
2968 case Read_None:
2969 llvm_unreachable("should not call this when not reading anything");
2970 case Read_Decl:
2971 case Read_Type:
2972 return ReadStmtFromStream(F);
2973 case Read_Stmt:
2974 return ReadSubStmt();
2975 }
2976
2977 llvm_unreachable("ReadingKind not set ?");
2978}
2979
2981 return cast_or_null<Expr>(ReadStmt(F));
2982}
2983
2985 return cast_or_null<Expr>(ReadSubStmt());
2986}
2987
2988// Within the bitstream, expressions are stored in Reverse Polish
2989// Notation, with each of the subexpressions preceding the
2990// expression they are stored in. Subexpressions are stored from last to first.
2991// To evaluate expressions, we continue reading expressions and placing them on
2992// the stack, with expressions having operands removing those operands from the
2993// stack. Evaluation terminates when we see a STMT_STOP record, and
2994// the single remaining expression on the stack is our result.
2995Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) {
2996 ReadingKindTracker ReadingKind(Read_Stmt, *this);
2997 llvm::BitstreamCursor &Cursor = F.DeclsCursor;
2998
2999 // Map of offset to previously deserialized stmt. The offset points
3000 // just after the stmt record.
3001 llvm::DenseMap<uint64_t, Stmt *> StmtEntries;
3002
3003#ifndef NDEBUG
3004 unsigned PrevNumStmts = StmtStack.size();
3005#endif
3006
3007 ASTRecordReader Record(*this, F);
3008 ASTStmtReader Reader(Record, Cursor);
3010
3011 while (true) {
3013 Cursor.advanceSkippingSubblocks();
3014 if (!MaybeEntry) {
3015 Error(toString(MaybeEntry.takeError()));
3016 return nullptr;
3017 }
3018 llvm::BitstreamEntry Entry = MaybeEntry.get();
3019
3020 switch (Entry.Kind) {
3021 case llvm::BitstreamEntry::SubBlock: // Handled for us already.
3022 case llvm::BitstreamEntry::Error:
3023 Error("malformed block record in AST file");
3024 return nullptr;
3025 case llvm::BitstreamEntry::EndBlock:
3026 goto Done;
3027 case llvm::BitstreamEntry::Record:
3028 // The interesting case.
3029 break;
3030 }
3031
3032 ASTContext &Context = getContext();
3033 Stmt *S = nullptr;
3034 bool Finished = false;
3035 bool IsStmtReference = false;
3036 Expected<unsigned> MaybeStmtCode = Record.readRecord(Cursor, Entry.ID);
3037 if (!MaybeStmtCode) {
3038 Error(toString(MaybeStmtCode.takeError()));
3039 return nullptr;
3040 }
3041 switch ((StmtCode)MaybeStmtCode.get()) {
3042 case STMT_STOP:
3043 Finished = true;
3044 break;
3045
3046 case STMT_REF_PTR:
3047 IsStmtReference = true;
3048 assert(StmtEntries.contains(Record[0]) &&
3049 "No stmt was recorded for this offset reference!");
3050 S = StmtEntries[Record.readInt()];
3051 break;
3052
3053 case STMT_NULL_PTR:
3054 S = nullptr;
3055 break;
3056
3057 case STMT_NULL:
3058 S = new (Context) NullStmt(Empty);
3059 break;
3060
3061 case STMT_COMPOUND: {
3062 unsigned NumStmts = Record[ASTStmtReader::NumStmtFields];
3063 bool HasFPFeatures = Record[ASTStmtReader::NumStmtFields + 1];
3064 S = CompoundStmt::CreateEmpty(Context, NumStmts, HasFPFeatures);
3065 break;
3066 }
3067
3068 case STMT_CASE:
3070 Context,
3071 /*CaseStmtIsGNURange*/ Record[ASTStmtReader::NumStmtFields + 3]);
3072 break;
3073
3074 case STMT_DEFAULT:
3075 S = new (Context) DefaultStmt(Empty);
3076 break;
3077
3078 case STMT_LABEL:
3079 S = new (Context) LabelStmt(Empty);
3080 break;
3081
3082 case STMT_ATTRIBUTED:
3084 Context,
3086 break;
3087
3088 case STMT_IF: {
3089 BitsUnpacker IfStmtBits(Record[ASTStmtReader::NumStmtFields]);
3090 bool HasElse = IfStmtBits.getNextBit();
3091 bool HasVar = IfStmtBits.getNextBit();
3092 bool HasInit = IfStmtBits.getNextBit();
3093 S = IfStmt::CreateEmpty(Context, HasElse, HasVar, HasInit);
3094 break;
3095 }
3096
3097 case STMT_SWITCH:
3099 Context,
3101 /* HasVar=*/Record[ASTStmtReader::NumStmtFields + 1]);
3102 break;
3103
3104 case STMT_WHILE:
3106 Context,
3108 break;
3109
3110 case STMT_DO:
3111 S = new (Context) DoStmt(Empty);
3112 break;
3113
3114 case STMT_FOR:
3115 S = new (Context) ForStmt(Empty);
3116 break;
3117
3118 case STMT_GOTO:
3119 S = new (Context) GotoStmt(Empty);
3120 break;
3121
3122 case STMT_INDIRECT_GOTO:
3123 S = new (Context) IndirectGotoStmt(Empty);
3124 break;
3125
3126 case STMT_CONTINUE:
3127 S = new (Context) ContinueStmt(Empty);
3128 break;
3129
3130 case STMT_BREAK:
3131 S = new (Context) BreakStmt(Empty);
3132 break;
3133
3134 case STMT_RETURN:
3136 Context, /* HasNRVOCandidate=*/Record[ASTStmtReader::NumStmtFields]);
3137 break;
3138
3139 case STMT_DECL:
3140 S = new (Context) DeclStmt(Empty);
3141 break;
3142
3143 case STMT_GCCASM:
3144 S = new (Context) GCCAsmStmt(Empty);
3145 break;
3146
3147 case STMT_MSASM:
3148 S = new (Context) MSAsmStmt(Empty);
3149 break;
3150
3151 case STMT_CAPTURED:
3154 break;
3155
3157 S = new (Context) SYCLKernelCallStmt(Empty);
3158 break;
3159
3160 case EXPR_CONSTANT:
3162 Context, static_cast<ConstantResultStorageKind>(
3163 /*StorageKind=*/Record[ASTStmtReader::NumExprFields]));
3164 break;
3165
3168 break;
3169
3172 break;
3173
3174 case EXPR_PREDEFINED:
3176 Context,
3177 /*HasFunctionName*/ Record[ASTStmtReader::NumExprFields]);
3178 break;
3179
3180 case EXPR_DECL_REF: {
3181 BitsUnpacker DeclRefExprBits(Record[ASTStmtReader::NumExprFields]);
3182 DeclRefExprBits.advance(5);
3183 bool HasFoundDecl = DeclRefExprBits.getNextBit();
3184 bool HasQualifier = DeclRefExprBits.getNextBit();
3185 bool HasTemplateKWAndArgsInfo = DeclRefExprBits.getNextBit();
3186 unsigned NumTemplateArgs = HasTemplateKWAndArgsInfo
3188 : 0;
3189 S = DeclRefExpr::CreateEmpty(Context, HasQualifier, HasFoundDecl,
3190 HasTemplateKWAndArgsInfo, NumTemplateArgs);
3191 break;
3192 }
3193
3195 S = IntegerLiteral::Create(Context, Empty);
3196 break;
3197
3199 S = FixedPointLiteral::Create(Context, Empty);
3200 break;
3201
3203 S = FloatingLiteral::Create(Context, Empty);
3204 break;
3205
3207 S = new (Context) ImaginaryLiteral(Empty);
3208 break;
3209
3212 Context,
3213 /* NumConcatenated=*/Record[ASTStmtReader::NumExprFields],
3214 /* Length=*/Record[ASTStmtReader::NumExprFields + 1],
3215 /* CharByteWidth=*/Record[ASTStmtReader::NumExprFields + 2]);
3216 break;
3217
3219 S = new (Context) CharacterLiteral(Empty);
3220 break;
3221
3222 case EXPR_PAREN:
3223 S = new (Context) ParenExpr(Empty);
3224 break;
3225
3226 case EXPR_PAREN_LIST:
3228 Context,
3229 /* NumExprs=*/Record[ASTStmtReader::NumExprFields]);
3230 break;
3231
3232 case EXPR_UNARY_OPERATOR: {
3233 BitsUnpacker UnaryOperatorBits(Record[ASTStmtReader::NumStmtFields]);
3234 UnaryOperatorBits.advance(ASTStmtReader::NumExprBits);
3235 bool HasFPFeatures = UnaryOperatorBits.getNextBit();
3236 S = UnaryOperator::CreateEmpty(Context, HasFPFeatures);
3237 break;
3238 }
3239
3240 case EXPR_OFFSETOF:
3241 S = OffsetOfExpr::CreateEmpty(Context,
3244 break;
3245
3247 S = new (Context) UnaryExprOrTypeTraitExpr(Empty);
3248 break;
3249
3251 S = new (Context) ArraySubscriptExpr(Empty);
3252 break;
3253
3255 S = new (Context) MatrixSubscriptExpr(Empty);
3256 break;
3257
3258 case EXPR_ARRAY_SECTION:
3259 S = new (Context) ArraySectionExpr(Empty);
3260 break;
3261
3265 break;
3266
3267 case EXPR_OMP_ITERATOR:
3268 S = OMPIteratorExpr::CreateEmpty(Context,
3270 break;
3271
3272 case EXPR_CALL: {
3273 auto NumArgs = Record[ASTStmtReader::NumExprFields];
3274 BitsUnpacker CallExprBits(Record[ASTStmtReader::NumExprFields + 1]);
3275 CallExprBits.advance(1);
3276 auto HasFPFeatures = CallExprBits.getNextBit();
3277 S = CallExpr::CreateEmpty(Context, NumArgs, HasFPFeatures, Empty);
3278 break;
3279 }
3280
3281 case EXPR_RECOVERY:
3283 Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields]);
3284 break;
3285
3286 case EXPR_MEMBER: {
3287 BitsUnpacker ExprMemberBits(Record[ASTStmtReader::NumExprFields]);
3288 bool HasQualifier = ExprMemberBits.getNextBit();
3289 bool HasFoundDecl = ExprMemberBits.getNextBit();
3290 bool HasTemplateInfo = ExprMemberBits.getNextBit();
3291 unsigned NumTemplateArgs = Record[ASTStmtReader::NumExprFields + 1];
3292 S = MemberExpr::CreateEmpty(Context, HasQualifier, HasFoundDecl,
3293 HasTemplateInfo, NumTemplateArgs);
3294 break;
3295 }
3296
3297 case EXPR_BINARY_OPERATOR: {
3298 BitsUnpacker BinaryOperatorBits(Record[ASTStmtReader::NumExprFields]);
3299 BinaryOperatorBits.advance(/*Size of opcode*/ 6);
3300 bool HasFPFeatures = BinaryOperatorBits.getNextBit();
3301 S = BinaryOperator::CreateEmpty(Context, HasFPFeatures);
3302 break;
3303 }
3304
3306 BitsUnpacker BinaryOperatorBits(Record[ASTStmtReader::NumExprFields]);
3307 BinaryOperatorBits.advance(/*Size of opcode*/ 6);
3308 bool HasFPFeatures = BinaryOperatorBits.getNextBit();
3309 S = CompoundAssignOperator::CreateEmpty(Context, HasFPFeatures);
3310 break;
3311 }
3312
3314 S = new (Context) ConditionalOperator(Empty);
3315 break;
3316
3318 S = new (Context) BinaryConditionalOperator(Empty);
3319 break;
3320
3321 case EXPR_IMPLICIT_CAST: {
3322 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
3323 BitsUnpacker CastExprBits(Record[ASTStmtReader::NumExprFields + 1]);
3324 CastExprBits.advance(7);
3325 bool HasFPFeatures = CastExprBits.getNextBit();
3326 S = ImplicitCastExpr::CreateEmpty(Context, PathSize, HasFPFeatures);
3327 break;
3328 }
3329
3330 case EXPR_CSTYLE_CAST: {
3331 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
3332 BitsUnpacker CastExprBits(Record[ASTStmtReader::NumExprFields + 1]);
3333 CastExprBits.advance(7);
3334 bool HasFPFeatures = CastExprBits.getNextBit();
3335 S = CStyleCastExpr::CreateEmpty(Context, PathSize, HasFPFeatures);
3336 break;
3337 }
3338
3340 S = new (Context) CompoundLiteralExpr(Empty);
3341 break;
3342
3344 S = new (Context) ExtVectorElementExpr(Empty);
3345 break;
3346
3347 case EXPR_INIT_LIST:
3348 S = new (Context) InitListExpr(Empty);
3349 break;
3350
3354
3355 break;
3356
3358 S = new (Context) DesignatedInitUpdateExpr(Empty);
3359 break;
3360
3362 S = new (Context) ImplicitValueInitExpr(Empty);
3363 break;
3364
3365 case EXPR_NO_INIT:
3366 S = new (Context) NoInitExpr(Empty);
3367 break;
3368
3370 S = new (Context) ArrayInitLoopExpr(Empty);
3371 break;
3372
3374 S = new (Context) ArrayInitIndexExpr(Empty);
3375 break;
3376
3377 case EXPR_VA_ARG:
3378 S = new (Context) VAArgExpr(Empty);
3379 break;
3380
3381 case EXPR_SOURCE_LOC:
3382 S = new (Context) SourceLocExpr(Empty);
3383 break;
3384
3386 S = new (Context) EmbedExpr(Empty);
3387 break;
3388
3389 case EXPR_ADDR_LABEL:
3390 S = new (Context) AddrLabelExpr(Empty);
3391 break;
3392
3393 case EXPR_STMT:
3394 S = new (Context) StmtExpr(Empty);
3395 break;
3396
3397 case EXPR_CHOOSE:
3398 S = new (Context) ChooseExpr(Empty);
3399 break;
3400
3401 case EXPR_GNU_NULL:
3402 S = new (Context) GNUNullExpr(Empty);
3403 break;
3404
3406 S = new (Context) ShuffleVectorExpr(Empty);
3407 break;
3408
3409 case EXPR_CONVERT_VECTOR: {
3410 BitsUnpacker ConvertVectorExprBits(Record[ASTStmtReader::NumStmtFields]);
3411 ConvertVectorExprBits.advance(ASTStmtReader::NumExprBits);
3412 bool HasFPFeatures = ConvertVectorExprBits.getNextBit();
3413 S = ConvertVectorExpr::CreateEmpty(Context, HasFPFeatures);
3414 break;
3415 }
3416
3417 case EXPR_BLOCK:
3418 S = new (Context) BlockExpr(Empty);
3419 break;
3420
3423 Context,
3424 /*NumAssocs=*/Record[ASTStmtReader::NumExprFields]);
3425 break;
3426
3428 S = new (Context) ObjCStringLiteral(Empty);
3429 break;
3430
3432 S = new (Context) ObjCBoxedExpr(Empty);
3433 break;
3434
3438 break;
3439
3444 break;
3445
3446 case EXPR_OBJC_ENCODE:
3447 S = new (Context) ObjCEncodeExpr(Empty);
3448 break;
3449
3451 S = new (Context) ObjCSelectorExpr(Empty);
3452 break;
3453
3455 S = new (Context) ObjCProtocolExpr(Empty);
3456 break;
3457
3459 S = new (Context) ObjCIvarRefExpr(Empty);
3460 break;
3461
3463 S = new (Context) ObjCPropertyRefExpr(Empty);
3464 break;
3465
3467 S = new (Context) ObjCSubscriptRefExpr(Empty);
3468 break;
3469
3471 llvm_unreachable("mismatching AST file");
3472
3474 S = ObjCMessageExpr::CreateEmpty(Context,
3477 break;
3478
3479 case EXPR_OBJC_ISA:
3480 S = new (Context) ObjCIsaExpr(Empty);
3481 break;
3482
3484 S = new (Context) ObjCIndirectCopyRestoreExpr(Empty);
3485 break;
3486
3488 S = new (Context) ObjCBridgedCastExpr(Empty);
3489 break;
3490
3492 S = new (Context) ObjCForCollectionStmt(Empty);
3493 break;
3494
3495 case STMT_OBJC_CATCH:
3496 S = new (Context) ObjCAtCatchStmt(Empty);
3497 break;
3498
3499 case STMT_OBJC_FINALLY:
3500 S = new (Context) ObjCAtFinallyStmt(Empty);
3501 break;
3502
3503 case STMT_OBJC_AT_TRY:
3504 S = ObjCAtTryStmt::CreateEmpty(Context,
3507 break;
3508
3510 S = new (Context) ObjCAtSynchronizedStmt(Empty);
3511 break;
3512
3513 case STMT_OBJC_AT_THROW:
3514 S = new (Context) ObjCAtThrowStmt(Empty);
3515 break;
3516
3518 S = new (Context) ObjCAutoreleasePoolStmt(Empty);
3519 break;
3520
3522 S = new (Context) ObjCBoolLiteralExpr(Empty);
3523 break;
3524
3526 S = new (Context) ObjCAvailabilityCheckExpr(Empty);
3527 break;
3528
3529 case STMT_SEH_LEAVE:
3530 S = new (Context) SEHLeaveStmt(Empty);
3531 break;
3532
3533 case STMT_SEH_EXCEPT:
3534 S = new (Context) SEHExceptStmt(Empty);
3535 break;
3536
3537 case STMT_SEH_FINALLY:
3538 S = new (Context) SEHFinallyStmt(Empty);
3539 break;
3540
3541 case STMT_SEH_TRY:
3542 S = new (Context) SEHTryStmt(Empty);
3543 break;
3544
3545 case STMT_CXX_CATCH:
3546 S = new (Context) CXXCatchStmt(Empty);
3547 break;
3548
3549 case STMT_CXX_TRY:
3550 S = CXXTryStmt::Create(Context, Empty,
3551 /*numHandlers=*/Record[ASTStmtReader::NumStmtFields]);
3552 break;
3553
3554 case STMT_CXX_FOR_RANGE:
3555 S = new (Context) CXXForRangeStmt(Empty);
3556 break;
3557
3559 S = new (Context) MSDependentExistsStmt(SourceLocation(), true,
3560 NestedNameSpecifierLoc(),
3561 DeclarationNameInfo(),
3562 nullptr);
3563 break;
3564
3566 S = OMPCanonicalLoop::createEmpty(Context);
3567 break;
3568
3572 break;
3573
3575 S =
3576 OMPParallelDirective::CreateEmpty(Context,
3578 Empty);
3579 break;
3580
3582 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3583 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3584 S = OMPSimdDirective::CreateEmpty(Context, NumClauses,
3585 CollapsedNum, Empty);
3586 break;
3587 }
3588
3590 unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
3591 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3592 S = OMPTileDirective::CreateEmpty(Context, NumClauses, NumLoops);
3593 break;
3594 }
3595
3597 unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
3598 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3599 S = OMPStripeDirective::CreateEmpty(Context, NumClauses, NumLoops);
3600 break;
3601 }
3602
3604 assert(Record[ASTStmtReader::NumStmtFields] == 1 && "Unroll directive accepts only a single loop");
3605 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3606 S = OMPUnrollDirective::CreateEmpty(Context, NumClauses);
3607 break;
3608 }
3609
3611 unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
3612 assert(Record[ASTStmtReader::NumStmtFields + 1] == 0 &&
3613 "Reverse directive has no clauses");
3614 S = OMPReverseDirective::CreateEmpty(Context, NumLoops);
3615 break;
3616 }
3617
3619 unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
3620 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3621 S = OMPInterchangeDirective::CreateEmpty(Context, NumClauses, NumLoops);
3622 break;
3623 }
3624
3626 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3627 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3628 S = OMPForDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3629 Empty);
3630 break;
3631 }
3632
3634 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3635 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3636 S = OMPForSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3637 Empty);
3638 break;
3639 }
3640
3642 S = OMPSectionsDirective::CreateEmpty(
3644 break;
3645
3647 S = OMPSectionDirective::CreateEmpty(Context, Empty);
3648 break;
3649
3651 S = OMPScopeDirective::CreateEmpty(
3653 break;
3654
3656 S = OMPSingleDirective::CreateEmpty(
3658 break;
3659
3661 S = OMPMasterDirective::CreateEmpty(Context, Empty);
3662 break;
3663
3665 S = OMPCriticalDirective::CreateEmpty(
3667 break;
3668
3670 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3671 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3672 S = OMPParallelForDirective::CreateEmpty(Context, NumClauses,
3673 CollapsedNum, Empty);
3674 break;
3675 }
3676
3678 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3679 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3680 S = OMPParallelForSimdDirective::CreateEmpty(Context, NumClauses,
3681 CollapsedNum, Empty);
3682 break;
3683 }
3684
3686 S = OMPParallelMasterDirective::CreateEmpty(
3688 break;
3689
3691 S = OMPParallelMaskedDirective::CreateEmpty(
3693 break;
3694
3696 S = OMPParallelSectionsDirective::CreateEmpty(
3698 break;
3699
3701 S = OMPTaskDirective::CreateEmpty(
3703 break;
3704
3706 S = OMPTaskyieldDirective::CreateEmpty(Context, Empty);
3707 break;
3708
3710 S = OMPBarrierDirective::CreateEmpty(Context, Empty);
3711 break;
3712
3714 S = OMPTaskwaitDirective::CreateEmpty(
3716 break;
3717
3721 break;
3722
3724 S = OMPTaskgroupDirective::CreateEmpty(
3726 break;
3727
3729 S = OMPFlushDirective::CreateEmpty(
3731 break;
3732
3734 S = OMPDepobjDirective::CreateEmpty(
3736 break;
3737
3741 break;
3742
3744 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3745 bool HasAssociatedStmt = Record[ASTStmtReader::NumStmtFields + 2];
3746 S = OMPOrderedDirective::CreateEmpty(Context, NumClauses,
3747 !HasAssociatedStmt, Empty);
3748 break;
3749 }
3750
3752 S = OMPAtomicDirective::CreateEmpty(
3754 break;
3755
3759 break;
3760
3764 break;
3765
3769 break;
3770
3774 break;
3775
3779 break;
3780
3782 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3783 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3784 S = OMPTargetParallelForDirective::CreateEmpty(Context, NumClauses,
3785 CollapsedNum, Empty);
3786 break;
3787 }
3788
3792 break;
3793
3797 break;
3798
3801 break;
3802
3806 break;
3807
3809 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3810 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3811 S = OMPTaskLoopDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3812 Empty);
3813 break;
3814 }
3815
3817 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3818 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3819 S = OMPTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
3820 CollapsedNum, Empty);
3821 break;
3822 }
3823
3825 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3826 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3827 S = OMPMasterTaskLoopDirective::CreateEmpty(Context, NumClauses,
3828 CollapsedNum, Empty);
3829 break;
3830 }
3831
3833 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3834 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3835 S = OMPMaskedTaskLoopDirective::CreateEmpty(Context, NumClauses,
3836 CollapsedNum, Empty);
3837 break;
3838 }
3839
3841 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3842 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3843 S = OMPMasterTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
3844 CollapsedNum, Empty);
3845 break;
3846 }
3847
3849 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3850 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3851 S = OMPMaskedTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
3852 CollapsedNum, Empty);
3853 break;
3854 }
3855
3857 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3858 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3860 CollapsedNum, Empty);
3861 break;
3862 }
3863
3865 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3866 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3868 CollapsedNum, Empty);
3869 break;
3870 }
3871
3873 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3874 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3876 Context, NumClauses, CollapsedNum, Empty);
3877 break;
3878 }
3879
3881 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3882 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3884 Context, NumClauses, CollapsedNum, Empty);
3885 break;
3886 }
3887
3889 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3890 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3891 S = OMPDistributeDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3892 Empty);
3893 break;
3894 }
3895
3897 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3898 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3899 S = OMPDistributeParallelForDirective::CreateEmpty(Context, NumClauses,
3900 CollapsedNum, Empty);
3901 break;
3902 }
3903
3905 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3906 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3908 CollapsedNum,
3909 Empty);
3910 break;
3911 }
3912
3914 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3915 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3916 S = OMPDistributeSimdDirective::CreateEmpty(Context, NumClauses,
3917 CollapsedNum, Empty);
3918 break;
3919 }
3920
3922 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3923 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3924 S = OMPTargetParallelForSimdDirective::CreateEmpty(Context, NumClauses,
3925 CollapsedNum, Empty);
3926 break;
3927 }
3928
3930 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3931 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3932 S = OMPTargetSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3933 Empty);
3934 break;
3935 }
3936
3938 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3939 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3940 S = OMPTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
3941 CollapsedNum, Empty);
3942 break;
3943 }
3944
3946 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3947 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3948 S = OMPTeamsDistributeSimdDirective::CreateEmpty(Context, NumClauses,
3949 CollapsedNum, Empty);
3950 break;
3951 }
3952
3954 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3955 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3957 Context, NumClauses, CollapsedNum, Empty);
3958 break;
3959 }
3960
3962 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3963 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3965 Context, NumClauses, CollapsedNum, Empty);
3966 break;
3967 }
3968
3972 break;
3973
3975 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3976 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3977 S = OMPTargetTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
3978 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
3991 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3992 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3994 Context, NumClauses, CollapsedNum, Empty);
3995 break;
3996 }
3997
3999 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4000 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4002 Context, NumClauses, CollapsedNum, Empty);
4003 break;
4004 }
4005
4009 break;
4010
4014 break;
4015
4019 break;
4020
4022 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4023 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4024 S = OMPGenericLoopDirective::CreateEmpty(Context, NumClauses,
4025 CollapsedNum, Empty);
4026 break;
4027 }
4028
4030 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4031 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4032 S = OMPTeamsGenericLoopDirective::CreateEmpty(Context, NumClauses,
4033 CollapsedNum, Empty);
4034 break;
4035 }
4036
4038 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4039 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4041 CollapsedNum, Empty);
4042 break;
4043 }
4044
4046 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4047 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4048 S = OMPParallelGenericLoopDirective::CreateEmpty(Context, NumClauses,
4049 CollapsedNum, Empty);
4050 break;
4051 }
4052
4054 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
4055 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4057 Context, NumClauses, CollapsedNum, Empty);
4058 break;
4059 }
4060
4062 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4063 S = OMPAssumeDirective::CreateEmpty(Context, NumClauses, Empty);
4064 break;
4065 }
4066
4068 auto NumArgs = Record[ASTStmtReader::NumExprFields];
4069 BitsUnpacker CallExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4070 CallExprBits.advance(1);
4071 auto HasFPFeatures = CallExprBits.getNextBit();
4072 S = CXXOperatorCallExpr::CreateEmpty(Context, NumArgs, HasFPFeatures,
4073 Empty);
4074 break;
4075 }
4076
4077 case EXPR_CXX_MEMBER_CALL: {
4078 auto NumArgs = Record[ASTStmtReader::NumExprFields];
4079 BitsUnpacker CallExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4080 CallExprBits.advance(1);
4081 auto HasFPFeatures = CallExprBits.getNextBit();
4082 S = CXXMemberCallExpr::CreateEmpty(Context, NumArgs, HasFPFeatures,
4083 Empty);
4084 break;
4085 }
4086
4088 S = new (Context) CXXRewrittenBinaryOperator(Empty);
4089 break;
4090
4091 case EXPR_CXX_CONSTRUCT:
4093 Context,
4094 /* NumArgs=*/Record[ASTStmtReader::NumExprFields]);
4095 break;
4096
4098 S = new (Context) CXXInheritedCtorInitExpr(Empty);
4099 break;
4100
4103 Context,
4104 /* NumArgs=*/Record[ASTStmtReader::NumExprFields]);
4105 break;
4106
4107 case EXPR_CXX_STATIC_CAST: {
4108 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
4109 BitsUnpacker CastExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4110 CastExprBits.advance(7);
4111 bool HasFPFeatures = CastExprBits.getNextBit();
4112 S = CXXStaticCastExpr::CreateEmpty(Context, PathSize, HasFPFeatures);
4113 break;
4114 }
4115
4116 case EXPR_CXX_DYNAMIC_CAST: {
4117 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
4118 S = CXXDynamicCastExpr::CreateEmpty(Context, PathSize);
4119 break;
4120 }
4121
4123 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
4124 S = CXXReinterpretCastExpr::CreateEmpty(Context, PathSize);
4125 break;
4126 }
4127
4129 S = CXXConstCastExpr::CreateEmpty(Context);
4130 break;
4131
4134 break;
4135
4137 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
4138 BitsUnpacker CastExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4139 CastExprBits.advance(7);
4140 bool HasFPFeatures = CastExprBits.getNextBit();
4141 S = CXXFunctionalCastExpr::CreateEmpty(Context, PathSize, HasFPFeatures);
4142 break;
4143 }
4144
4145 case EXPR_BUILTIN_BIT_CAST: {
4146#ifndef NDEBUG
4147 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
4148 assert(PathSize == 0 && "Wrong PathSize!");
4149#endif
4150 S = new (Context) BuiltinBitCastExpr(Empty);
4151 break;
4152 }
4153
4155 auto NumArgs = Record[ASTStmtReader::NumExprFields];
4156 BitsUnpacker CallExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4157 CallExprBits.advance(1);
4158 auto HasFPFeatures = CallExprBits.getNextBit();
4159 S = UserDefinedLiteral::CreateEmpty(Context, NumArgs, HasFPFeatures,
4160 Empty);
4161 break;
4162 }
4163
4165 S = new (Context) CXXStdInitializerListExpr(Empty);
4166 break;
4167
4169 S = new (Context) CXXBoolLiteralExpr(Empty);
4170 break;
4171
4173 S = new (Context) CXXNullPtrLiteralExpr(Empty);
4174 break;
4175
4177 S = new (Context) CXXTypeidExpr(Empty, true);
4178 break;
4179
4181 S = new (Context) CXXTypeidExpr(Empty, false);
4182 break;
4183
4185 S = new (Context) CXXUuidofExpr(Empty, true);
4186 break;
4187
4189 S = new (Context) MSPropertyRefExpr(Empty);
4190 break;
4191
4193 S = new (Context) MSPropertySubscriptExpr(Empty);
4194 break;
4195
4197 S = new (Context) CXXUuidofExpr(Empty, false);
4198 break;
4199
4200 case EXPR_CXX_THIS:
4201 S = CXXThisExpr::CreateEmpty(Context);
4202 break;
4203
4204 case EXPR_CXX_THROW:
4205 S = new (Context) CXXThrowExpr(Empty);
4206 break;
4207
4210 Context, /*HasRewrittenInit=*/Record[ASTStmtReader::NumExprFields]);
4211 break;
4212
4215 Context, /*HasRewrittenInit=*/Record[ASTStmtReader::NumExprFields]);
4216 break;
4217
4219 S = new (Context) CXXBindTemporaryExpr(Empty);
4220 break;
4221
4223 S = new (Context) CXXScalarValueInitExpr(Empty);
4224 break;
4225
4226 case EXPR_CXX_NEW:
4228 Context,
4230 /*HasInit=*/Record[ASTStmtReader::NumExprFields + 1],
4231 /*NumPlacementArgs=*/Record[ASTStmtReader::NumExprFields + 2],
4232 /*IsParenTypeId=*/Record[ASTStmtReader::NumExprFields + 3]);
4233 break;
4234
4235 case EXPR_CXX_DELETE:
4236 S = new (Context) CXXDeleteExpr(Empty);
4237 break;
4238
4240 S = new (Context) CXXPseudoDestructorExpr(Empty);
4241 break;
4242
4244 S = ExprWithCleanups::Create(Context, Empty,
4246 break;
4247
4249 unsigned NumTemplateArgs = Record[ASTStmtReader::NumExprFields];
4250 BitsUnpacker DependentScopeMemberBits(
4252 bool HasTemplateKWAndArgsInfo = DependentScopeMemberBits.getNextBit();
4253
4254 bool HasFirstQualifierFoundInScope =
4255 DependentScopeMemberBits.getNextBit();
4257 Context, HasTemplateKWAndArgsInfo, NumTemplateArgs,
4258 HasFirstQualifierFoundInScope);
4259 break;
4260 }
4261
4263 BitsUnpacker DependentScopeDeclRefBits(
4265 DependentScopeDeclRefBits.advance(ASTStmtReader::NumExprBits);
4266 bool HasTemplateKWAndArgsInfo = DependentScopeDeclRefBits.getNextBit();
4267 unsigned NumTemplateArgs =
4268 HasTemplateKWAndArgsInfo
4269 ? DependentScopeDeclRefBits.getNextBits(/*Width=*/16)
4270 : 0;
4272 Context, HasTemplateKWAndArgsInfo, NumTemplateArgs);
4273 break;
4274 }
4275
4279 break;
4280
4282 auto NumResults = Record[ASTStmtReader::NumExprFields];
4283 BitsUnpacker OverloadExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4284 auto HasTemplateKWAndArgsInfo = OverloadExprBits.getNextBit();
4285 auto NumTemplateArgs = HasTemplateKWAndArgsInfo
4287 : 0;
4289 Context, NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
4290 break;
4291 }
4292
4294 auto NumResults = Record[ASTStmtReader::NumExprFields];
4295 BitsUnpacker OverloadExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4296 auto HasTemplateKWAndArgsInfo = OverloadExprBits.getNextBit();
4297 auto NumTemplateArgs = HasTemplateKWAndArgsInfo
4299 : 0;
4301 Context, NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
4302 break;
4303 }
4304
4305 case EXPR_TYPE_TRAIT:
4309 break;
4310
4312 S = new (Context) ArrayTypeTraitExpr(Empty);
4313 break;
4314
4316 S = new (Context) ExpressionTraitExpr(Empty);
4317 break;
4318
4319 case EXPR_CXX_NOEXCEPT:
4320 S = new (Context) CXXNoexceptExpr(Empty);
4321 break;
4322
4324 S = new (Context) PackExpansionExpr(Empty);
4325 break;
4326
4327 case EXPR_SIZEOF_PACK:
4329 Context,
4330 /*NumPartialArgs=*/Record[ASTStmtReader::NumExprFields]);
4331 break;
4332
4333 case EXPR_PACK_INDEXING:
4335 Context,
4336 /*TransformedExprs=*/Record[ASTStmtReader::NumExprFields]);
4337 break;
4338
4340 S = new (Context) SubstNonTypeTemplateParmExpr(Empty);
4341 break;
4342
4344 S = new (Context) SubstNonTypeTemplateParmPackExpr(Empty);
4345 break;
4346
4350 break;
4351
4353 S = new (Context) MaterializeTemporaryExpr(Empty);
4354 break;
4355
4356 case EXPR_CXX_FOLD:
4357 S = new (Context) CXXFoldExpr(Empty);
4358 break;
4359
4362 Context, /*numExprs=*/Record[ASTStmtReader::NumExprFields], Empty);
4363 break;
4364
4365 case EXPR_OPAQUE_VALUE:
4366 S = new (Context) OpaqueValueExpr(Empty);
4367 break;
4368
4369 case EXPR_CUDA_KERNEL_CALL: {
4370 auto NumArgs = Record[ASTStmtReader::NumExprFields];
4371 BitsUnpacker CallExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4372 CallExprBits.advance(1);
4373 auto HasFPFeatures = CallExprBits.getNextBit();
4374 S = CUDAKernelCallExpr::CreateEmpty(Context, NumArgs, HasFPFeatures,
4375 Empty);
4376 break;
4377 }
4378
4379 case EXPR_ASTYPE:
4380 S = new (Context) AsTypeExpr(Empty);
4381 break;
4382
4383 case EXPR_PSEUDO_OBJECT: {
4384 unsigned numSemanticExprs = Record[ASTStmtReader::NumExprFields];
4385 S = PseudoObjectExpr::Create(Context, Empty, numSemanticExprs);
4386 break;
4387 }
4388
4389 case EXPR_ATOMIC:
4390 S = new (Context) AtomicExpr(Empty);
4391 break;
4392
4393 case EXPR_LAMBDA: {
4394 unsigned NumCaptures = Record[ASTStmtReader::NumExprFields];
4395 S = LambdaExpr::CreateDeserialized(Context, NumCaptures);
4396 break;
4397 }
4398
4399 case STMT_COROUTINE_BODY: {
4400 unsigned NumParams = Record[ASTStmtReader::NumStmtFields];
4401 S = CoroutineBodyStmt::Create(Context, Empty, NumParams);
4402 break;
4403 }
4404
4405 case STMT_CORETURN:
4406 S = new (Context) CoreturnStmt(Empty);
4407 break;
4408
4409 case EXPR_COAWAIT:
4410 S = new (Context) CoawaitExpr(Empty);
4411 break;
4412
4413 case EXPR_COYIELD:
4414 S = new (Context) CoyieldExpr(Empty);
4415 break;
4416
4418 S = new (Context) DependentCoawaitExpr(Empty);
4419 break;
4420
4422 S = new (Context) ConceptSpecializationExpr(Empty);
4423 break;
4424 }
4426 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4427 S = OpenACCComputeConstruct::CreateEmpty(Context, NumClauses);
4428 break;
4429 }
4431 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4432 S = OpenACCLoopConstruct::CreateEmpty(Context, NumClauses);
4433 break;
4434 }
4436 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4437 S = OpenACCCombinedConstruct::CreateEmpty(Context, NumClauses);
4438 break;
4439 }
4441 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4442 S = OpenACCDataConstruct::CreateEmpty(Context, NumClauses);
4443 break;
4444 }
4446 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4447 S = OpenACCEnterDataConstruct::CreateEmpty(Context, NumClauses);
4448 break;
4449 }
4451 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4452 S = OpenACCExitDataConstruct::CreateEmpty(Context, NumClauses);
4453 break;
4454 }
4456 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4457 S = OpenACCHostDataConstruct::CreateEmpty(Context, NumClauses);
4458 break;
4459 }
4461 unsigned NumExprs = Record[ASTStmtReader::NumStmtFields];
4462 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
4463 S = OpenACCWaitConstruct::CreateEmpty(Context, NumExprs, NumClauses);
4464 break;
4465 }
4467 unsigned NumVars = Record[ASTStmtReader::NumStmtFields];
4468 S = OpenACCCacheConstruct::CreateEmpty(Context, NumVars);
4469 break;
4470 }
4472 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4473 S = OpenACCInitConstruct::CreateEmpty(Context, NumClauses);
4474 break;
4475 }
4477 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4478 S = OpenACCShutdownConstruct::CreateEmpty(Context, NumClauses);
4479 break;
4480 }
4482 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4483 S = OpenACCSetConstruct::CreateEmpty(Context, NumClauses);
4484 break;
4485 }
4487 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4488 S = OpenACCUpdateConstruct::CreateEmpty(Context, NumClauses);
4489 break;
4490 }
4492 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4493 S = OpenACCAtomicConstruct::CreateEmpty(Context, NumClauses);
4494 break;
4495 }
4496 case EXPR_REQUIRES: {
4497 unsigned numLocalParameters = Record[ASTStmtReader::NumExprFields];
4498 unsigned numRequirement = Record[ASTStmtReader::NumExprFields + 1];
4499 S = RequiresExpr::Create(Context, Empty, numLocalParameters,
4500 numRequirement);
4501 break;
4502 }
4503 case EXPR_HLSL_OUT_ARG:
4504 S = HLSLOutArgExpr::CreateEmpty(Context);
4505 break;
4506 }
4507
4508 // We hit a STMT_STOP, so we're done with this expression.
4509 if (Finished)
4510 break;
4511
4512 ++NumStatementsRead;
4513
4514 if (S && !IsStmtReference) {
4515 Reader.Visit(S);
4516 StmtEntries[Cursor.GetCurrentBitNo()] = S;
4517 }
4518
4519 assert(Record.getIdx() == Record.size() &&
4520 "Invalid deserialization of statement");
4521 StmtStack.push_back(S);
4522 }
4523Done:
4524 assert(StmtStack.size() > PrevNumStmts && "Read too many sub-stmts!");
4525 assert(StmtStack.size() == PrevNumStmts + 1 && "Extra expressions on stack!");
4526 return StmtStack.pop_back_val();
4527}
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 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:188
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:4486
void setLabel(LabelDecl *L)
Definition Expr.h:4510
void setLabelLoc(SourceLocation L)
Definition Expr.h:4504
void setAmpAmpLoc(SourceLocation L)
Definition Expr.h:4502
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Definition Expr.h:5957
Represents a loop initializing the elements of an array.
Definition Expr.h:5904
This class represents BOTH the OpenMP Array Section and OpenACC 'subarray', with a boolean differenti...
Definition Expr.h:7092
bool isOMPArraySection() const
Definition Expr.h:7154
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition Expr.h:2723
void setRHS(Expr *E)
Definition Expr.h:2758
void setRBracketLoc(SourceLocation L)
Definition Expr.h:2774
void setLHS(Expr *E)
Definition Expr.h:2754
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
Definition ExprCXX.h:2990
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Definition Expr.h:6621
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:6816
unsigned getNumSubExprs() const
Definition Expr.h:6889
Represents an attribute applied to a statement.
Definition Stmt.h:2203
static AttributedStmt * CreateEmpty(const ASTContext &C, unsigned NumAttrs)
Definition Stmt.cpp:441
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Definition Expr.h:4389
A builtin binary operation expression such as "x + y" or "x <= y".
Definition Expr.h:3974
void setLHS(Expr *E)
Definition Expr.h:4025
void setHasStoredFPFeatures(bool B)
Set and fetch the bit that shows whether FPFeatures needs to be allocated in Trailing Storage.
Definition Expr.h:4158
void setOperatorLoc(SourceLocation L)
Definition Expr.h:4017
void setRHS(Expr *E)
Definition Expr.h:4027
void setExcludedOverflowPattern(bool B)
Set and get the bit that informs arithmetic overflow sanitizers whether or not they should exclude ce...
Definition Expr.h:4163
static BinaryOperator * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
Definition Expr.cpp:4930
void setStoredFPFeatures(FPOptionsOverride F)
Set FPFeatures in trailing storage, used only by Serialization.
Definition Expr.h:4176
void setOpcode(Opcode Opc)
Definition Expr.h:4022
BinaryOperatorKind Opcode
Definition Expr.h:3979
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition Expr.h:6560
void setBlockDecl(BlockDecl *BD)
Definition Expr.h:6574
BreakStmt - This represents a break.
Definition Stmt.h:3135
Represents a C++2a __builtin_bit_cast(T, v) expression.
Definition ExprCXX.h:5470
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr....
Definition Expr.h:3905
static CStyleCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize, bool HasFPFeatures)
Definition Expr.cpp:2117
void setRParenLoc(SourceLocation L)
Definition Expr.h:3941
void setLParenLoc(SourceLocation L)
Definition Expr.h:3938
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:2620
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition ExprCXX.h:3864
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition ExprCXX.h:4058
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:5026
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:2349
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:2458
bool hasInitializer() const
Whether this new-expression has any initializer at all.
Definition ExprCXX.h:2518
Stmt ** raw_arg_iterator
Definition ExprCXX.h:2587
void setOperatorDelete(FunctionDecl *D)
Definition ExprCXX.h:2456
unsigned getNumPlacementArgs() const
Definition ExprCXX.h:2488
bool isParenTypeId() const
Definition ExprCXX.h:2509
raw_arg_iterator raw_arg_end()
Definition ExprCXX.h:2590
raw_arg_iterator raw_arg_begin()
Definition ExprCXX.h:2589
void setOperatorNew(FunctionDecl *D)
Definition ExprCXX.h:2454
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition ExprCXX.h:4303
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:5135
void setInitializedFieldInUnion(FieldDecl *FD)
Definition ExprCXX.h:5209
static CXXParenListInitExpr * CreateEmpty(ASTContext &C, unsigned numExprs, EmptyShell Empty)
Definition ExprCXX.cpp:1996
void setArrayFiller(Expr *E)
Definition ExprCXX.h:5199
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition ExprCXX.h:2739
void setDestroyedType(IdentifierInfo *II, SourceLocation Loc)
Set the name of destroyed type for a dependent pseudo-destructor expression.
Definition ExprCXX.h:2854
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:3738
void setRParenLoc(SourceLocation L)
Definition ExprCXX.h:3788
void setArg(unsigned I, Expr *E)
Definition ExprCXX.h:3824
void setLParenLoc(SourceLocation L)
Definition ExprCXX.h:3783
unsigned getNumArgs() const
Retrieve the number of arguments.
Definition ExprCXX.h:3796
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:2879
void setRParenLoc(SourceLocation L)
Definition Expr.h:3211
void setCoroElideSafe(bool V=true)
Definition Expr.h:3054
void setArg(unsigned Arg, Expr *ArgExpr)
setArg - Set the specified argument.
Definition Expr.h:3096
void setADLCallKind(ADLCallKind V=UsesADL)
Definition Expr.h:3033
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:3043
void setPreArg(unsigned I, Stmt *PreArg)
Definition Expr.h:2976
void setStoredFPFeatures(FPOptionsOverride F)
Set FPOptionsOverride in trailing storage. Used only by Serialization.
Definition Expr.h:3160
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition Expr.h:3070
void setCallee(Expr *F)
Definition Expr.h:3028
void setBody(Stmt *B)
Definition Decl.cpp:5567
This captures a statement into a function.
Definition Stmt.h:3886
static CapturedStmt * CreateDeserialized(const ASTContext &Context, unsigned NumCaptures)
Definition Stmt.cpp:1429
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:1471
CapturedDecl * getCapturedDecl()
Retrieve the outlined function declaration.
Definition Stmt.cpp:1451
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:1460
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:1275
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:3612
FPOptionsOverride * getTrailingFPFeatures()
Return a pointer to the trailing FPOptions.
Definition Expr.cpp:2048
path_iterator path_begin()
Definition Expr.h:3682
unsigned path_size() const
Definition Expr.h:3681
void setCastKind(CastKind K)
Definition Expr.h:3657
bool hasStoredFPFeatures() const
Definition Expr.h:3711
CXXBaseSpecifier ** path_iterator
Definition Expr.h:3678
void setSubExpr(Expr *E)
Definition Expr.h:3664
void setValue(unsigned Val)
Definition Expr.h:1637
void setLocation(SourceLocation Location)
Definition Expr.h:1633
void setKind(CharacterLiteralKind kind)
Definition Expr.h:1634
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition Expr.h:4784
void setRParenLoc(SourceLocation L)
Definition Expr.h:4835
void setIsConditionTrue(bool isTrue)
Definition Expr.h:4812
void setBuiltinLoc(SourceLocation L)
Definition Expr.h:4832
void setRHS(Expr *E)
Definition Expr.h:4829
void setCond(Expr *E)
Definition Expr.h:4825
void setLHS(Expr *E)
Definition Expr.h:4827
Represents a 'co_await' expression.
Definition ExprCXX.h:5363
void setIsImplicit(bool value=true)
Definition ExprCXX.h:5386
CompoundAssignOperator - For compound assignments (e.g.
Definition Expr.h:4236
void setComputationResultType(QualType T)
Definition Expr.h:4274
static CompoundAssignOperator * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
Definition Expr.cpp:4952
void setComputationLHSType(QualType T)
Definition Expr.h:4271
CompoundLiteralExpr - [C99 6.5.2.5].
Definition Expr.h:3541
void setFileScope(bool FS)
Definition Expr.h:3574
void setTypeSourceInfo(TypeSourceInfo *tinfo)
Definition Expr.h:3582
void setLParenLoc(SourceLocation L)
Definition Expr.h:3577
void setInitializer(Expr *E)
Definition Expr.h:3571
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:400
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:4327
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition Expr.h:1084
ConstantResultStorageKind getResultStorageKind() const
Definition Expr.h:1153
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:37
std::pair< SourceLocation, StringRef > SubstitutionDiagnostic
Definition ASTConcept.h:51
llvm::SmallVector< Detail, 4 > Details
The substituted constraint expr, if the template arguments could be substituted into them,...
Definition ASTConcept.h:60
ContinueStmt - This represents a continue.
Definition Stmt.h:3119
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition Expr.h:4655
static ConvertVectorExpr * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
Definition Expr.cpp:5479
void setStoredFPFeatures(FPOptionsOverride F)
Set FPFeatures in trailing storage, used by Serialization & ASTImporter.
Definition Expr.h:4728
bool hasStoredFPFeatures() const
Is FPFeatures in Trailing Storage?
Definition Expr.h:4713
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:5444
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:1272
bool hasTemplateKWAndArgsInfo() const
Definition Expr.h:1393
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:1349
bool hasQualifier() const
Determine whether this declaration reference was preceded by a C++ nested-name-specifier,...
Definition Expr.h:1361
ValueDecl * getDecl()
Definition Expr.h:1340
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:5395
A qualified reference to a name whose declaration cannot yet be resolved.
Definition ExprCXX.h:3504
static DependentScopeDeclRefExpr * CreateEmpty(const ASTContext &Context, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition ExprCXX.cpp:559
Represents a C99 designated initializer expression.
Definition Expr.h:5487
static DesignatedInitExpr * CreateEmpty(const ASTContext &C, unsigned NumIndexExprs)
Definition Expr.cpp:4684
void setSubExpr(unsigned Idx, Expr *E)
Definition Expr.h:5773
void setGNUSyntax(bool GNU)
Definition Expr.h:5752
void setEqualOrColonLoc(SourceLocation L)
Definition Expr.h:5743
void setDesignators(const ASTContext &C, const Designator *Desigs, unsigned NumDesigs)
Definition Expr.cpp:4691
unsigned getNumSubExprs() const
Retrieve the total number of subexpressions in this designated initializer expression,...
Definition Expr.h:5767
void setBase(Expr *Base)
Definition Expr.h:5870
void setUpdater(Expr *Updater)
Definition Expr.h:5875
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:5062
ExplicitCastExpr - An explicit cast written in the source code.
Definition Expr.h:3864
void setTypeInfoAsWritten(TypeSourceInfo *writtenTy)
Definition Expr.h:3887
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition ExprCXX.h:3655
unsigned getNumObjects() const
Definition ExprCXX.h:3683
llvm::PointerUnion< BlockDecl *, CompoundLiteralExpr * > CleanupObject
The type of objects that are kept in the cleanup.
Definition ExprCXX.h:3661
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:3063
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition Expr.h:6500
void setAccessor(IdentifierInfo *II)
Definition Expr.h:6522
void setBase(Expr *E)
Definition Expr.h:6519
void setAccessorLoc(SourceLocation L)
Definition Expr.h:6525
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:1585
void setScale(unsigned S)
Definition Expr.h:1588
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:1690
void setValue(const ASTContext &C, const llvm::APFloat &Val)
Definition Expr.h:1671
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:1685
void setExact(bool E)
Definition Expr.h:1702
void setLocation(SourceLocation L)
Definition Expr.h:1710
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:1069
Stmt * SubExpr
Definition Expr.h:1053
Represents a reference to a function parameter pack, init-capture pack, or binding pack that has been...
Definition ExprCXX.h:4835
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:4859
void setTokenLocation(SourceLocation L)
Definition Expr.h:4874
Represents a C11 generic selection.
Definition Expr.h:6114
unsigned getNumAssocs() const
The number of association expressions.
Definition Expr.h:6354
static GenericSelectionExpr * CreateEmpty(const ASTContext &Context, unsigned NumAssocs)
Create an empty generic selection expression for deserialization.
Definition Expr.cpp:4618
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:7258
static HLSLOutArgExpr * CreateEmpty(const ASTContext &Ctx)
Definition Expr.cpp:5465
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:1017
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:1733
void setSubExpr(Expr *E)
Definition Expr.h:1747
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition Expr.h:3789
static ImplicitCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize, bool HasFPFeatures)
Definition Expr.cpp:2090
void setIsPartOfExplicitCast(bool PartOfExplicitCast)
Definition Expr.h:3821
Represents an implicitly-generated value initialization of an object of a given type.
Definition Expr.h:5993
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:5235
void setSyntacticForm(InitListExpr *Init)
Definition Expr.h:5412
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:5397
void setRBraceLoc(SourceLocation Loc)
Definition Expr.h:5399
void sawArrayRangeDesignator(bool ARD=true)
Definition Expr.h:5422
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:1540
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:4914
MatrixSubscriptExpr - Matrix subscript expression for the MatrixType extension.
Definition Expr.h:2801
void setColumnIdx(Expr *E)
Definition Expr.h:2841
void setBase(Expr *E)
Definition Expr.h:2829
void setRowIdx(Expr *E)
Definition Expr.h:2833
void setRBracketLoc(SourceLocation L)
Definition Expr.h:2856
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition Expr.h:3300
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:339
Represents a place-holder for an object not to be initialized by anything.
Definition Expr.h:5813
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:5319
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:5448
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:2529
void setOperatorLoc(SourceLocation L)
Definition Expr.h:2563
static OffsetOfExpr * CreateEmpty(const ASTContext &C, unsigned NumComps, unsigned NumExprs)
Definition Expr.cpp:1662
void setIndexExpr(unsigned Idx, Expr *E)
Definition Expr.h:2596
void setTypeSourceInfo(TypeSourceInfo *tsi)
Definition Expr.h:2572
void setComponent(unsigned Idx, OffsetOfNode ON)
Definition Expr.h:2580
unsigned getNumExpressions() const
Definition Expr.h:2600
void setRParenLoc(SourceLocation R)
Definition Expr.h:2567
unsigned getNumComponents() const
Definition Expr.h:2584
Kind
The kind of offsetof node we have.
Definition Expr.h:2426
@ Array
An index into an array.
Definition Expr.h:2428
@ Identifier
A field in a dependent type, known only by its name.
Definition Expr.h:2432
@ Field
A field.
Definition Expr.h:2430
@ Base
An implicit indirection through a C++ base class, when the field found is in a base class.
Definition Expr.h:2435
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
Definition Expr.h:1180
void setIsUnique(bool V)
Definition Expr.h:1232
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:2092
static OpenACCAsteriskSizeExpr * CreateEmpty(const ASTContext &C)
Definition Expr.cpp:5475
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:3122
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
Definition ExprCXX.h:4276
unsigned getNumDecls() const
Gets the number of declarations in the unresolved set.
Definition ExprCXX.h:3226
TemplateArgumentLoc * getTrailingTemplateArgumentLoc()
Return the optional template arguments.
Definition ExprCXX.h:4286
DeclAccessPair * getTrailingResults()
Return the results. Defined after UnresolvedMemberExpr.
Definition ExprCXX.h:4270
bool hasTemplateKWAndArgsInfo() const
Definition ExprCXX.h:3166
unsigned getNumTemplateArgs() const
Definition ExprCXX.h:3324
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition ExprCXX.h:4357
static PackIndexingExpr * CreateDeserialized(ASTContext &Context, unsigned NumTransformedExprs)
Definition ExprCXX.cpp:1761
ParenExpr - This represents a parenthesized expression, e.g.
Definition Expr.h:2184
void setLParen(SourceLocation Loc)
Definition Expr.h:2210
void setIsProducedByFoldExpansion(bool ProducedByFoldExpansion=true)
Definition Expr.h:2229
void setRParen(SourceLocation Loc)
Definition Expr.h:2214
void setSubExpr(Expr *E)
Definition Expr.h:2203
static ParenListExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumExprs)
Create an empty paren list.
Definition Expr.cpp:4819
unsigned getNumExprs() const
Return the number of expressions in this paren list.
Definition Expr.h:6046
[C99 6.4.2.2] - A predefined identifier such as func.
Definition Expr.h:2007
void setLocation(SourceLocation L)
Definition Expr.h:2049
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:6692
static PseudoObjectExpr * Create(const ASTContext &Context, Expr *syntactic, ArrayRef< Expr * > semantic, unsigned resultIndex)
Definition Expr.cpp:5032
Frontend produces RecoveryExprs on semantic errors that prevent creating other well-formed expression...
Definition Expr.h:7364
child_range children()
Definition Expr.h:7377
static RecoveryExpr * CreateEmpty(ASTContext &Ctx, unsigned NumSubExprs)
Definition Expr.cpp:5274
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:1256
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:4579
void setExprs(const ASTContext &C, ArrayRef< Expr * > Exprs)
Definition Expr.cpp:4448
void setRParenLoc(SourceLocation L)
Definition Expr.h:4600
void setBuiltinLoc(SourceLocation L)
Definition Expr.h:4597
Represents an expression that computes the length of a parameter pack.
Definition ExprCXX.h:4435
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:4520
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(),...
Definition Expr.h:4953
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:4531
void setRParenLoc(SourceLocation L)
Definition Expr.h:4558
void setLParenLoc(SourceLocation L)
Definition Expr.h:4556
void setSubStmt(CompoundStmt *S)
Definition Expr.h:4550
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:1801
unsigned getLength() const
Definition Expr.h:1911
StringLiteralKind getKind() const
Definition Expr.h:1914
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:1942
unsigned getCharByteWidth() const
Definition Expr.h:1912
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition ExprCXX.h:4658
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition ExprCXX.h:4748
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:1136
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:8256
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition ExprCXX.h:2890
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
Definition ExprCXX.h:2952
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:2627
void setKind(UnaryExprOrTypeTrait K)
Definition Expr.h:2662
void setOperatorLoc(SourceLocation L)
Definition Expr.h:2701
void setRParenLoc(SourceLocation L)
Definition Expr.h:2704
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition Expr.h:2246
void setSubExpr(Expr *E)
Definition Expr.h:2288
void setOperatorLoc(SourceLocation L)
Definition Expr.h:2292
void setCanOverflow(bool C)
Definition Expr.h:2301
bool hasStoredFPFeatures() const
Is FPFeatures in Trailing Storage?
Definition Expr.h:2383
void setOpcode(Opcode Opc)
Definition Expr.h:2285
void setStoredFPFeatures(FPOptionsOverride F)
Set FPFeatures in trailing storage, used by Serialization & ASTImporter.
Definition Expr.h:2397
UnaryOperatorKind Opcode
Definition Expr.h:2260
static UnaryOperator * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
Definition Expr.cpp:4974
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition ExprCXX.h:3384
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:4120
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:4893
void setRParenLoc(SourceLocation L)
Definition Expr.h:4924
void setIsMicrosoftABI(bool IsMS)
Definition Expr.h:4915
void setSubExpr(Expr *E)
Definition Expr.h:4911
void setBuiltinLoc(SourceLocation L)
Definition Expr.h:4921
void setWrittenTypeInfo(TypeSourceInfo *TI)
Definition Expr.h:4918
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:1198
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:1078
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
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:437
CharacterLiteralKind
Definition Expr.h:1605
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