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