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