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