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::VisitOMPAssumeDirective(OMPAssumeDirective *D) {
2540 VisitStmt(D);
2541 VisitOMPExecutableDirective(D);
2542}
2543
2544void ASTStmtReader::VisitOMPErrorDirective(OMPErrorDirective *D) {
2545 VisitStmt(D);
2546 // The NumClauses field was read in ReadStmtFromStream.
2547 Record.skipInts(1);
2548 VisitOMPExecutableDirective(D);
2549}
2550
2551void ASTStmtReader::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) {
2552 VisitStmt(D);
2553 VisitOMPExecutableDirective(D);
2554}
2555
2556void ASTStmtReader::VisitOMPFlushDirective(OMPFlushDirective *D) {
2557 VisitStmt(D);
2558 VisitOMPExecutableDirective(D);
2559}
2560
2561void ASTStmtReader::VisitOMPDepobjDirective(OMPDepobjDirective *D) {
2562 VisitStmt(D);
2563 VisitOMPExecutableDirective(D);
2564}
2565
2566void ASTStmtReader::VisitOMPScanDirective(OMPScanDirective *D) {
2567 VisitStmt(D);
2568 VisitOMPExecutableDirective(D);
2569}
2570
2571void ASTStmtReader::VisitOMPOrderedDirective(OMPOrderedDirective *D) {
2572 VisitStmt(D);
2573 VisitOMPExecutableDirective(D);
2574}
2575
2576void ASTStmtReader::VisitOMPAtomicDirective(OMPAtomicDirective *D) {
2577 VisitStmt(D);
2578 VisitOMPExecutableDirective(D);
2579 D->Flags.IsXLHSInRHSPart = Record.readBool() ? 1 : 0;
2580 D->Flags.IsPostfixUpdate = Record.readBool() ? 1 : 0;
2581 D->Flags.IsFailOnly = Record.readBool() ? 1 : 0;
2582}
2583
2584void ASTStmtReader::VisitOMPTargetDirective(OMPTargetDirective *D) {
2585 VisitStmt(D);
2586 VisitOMPExecutableDirective(D);
2587}
2588
2589void ASTStmtReader::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) {
2590 VisitStmt(D);
2591 VisitOMPExecutableDirective(D);
2592}
2593
2594void ASTStmtReader::VisitOMPTargetEnterDataDirective(
2596 VisitStmt(D);
2597 VisitOMPExecutableDirective(D);
2598}
2599
2600void ASTStmtReader::VisitOMPTargetExitDataDirective(
2602 VisitStmt(D);
2603 VisitOMPExecutableDirective(D);
2604}
2605
2606void ASTStmtReader::VisitOMPTargetParallelDirective(
2608 VisitStmt(D);
2609 VisitOMPExecutableDirective(D);
2610 D->setHasCancel(Record.readBool());
2611}
2612
2613void ASTStmtReader::VisitOMPTargetParallelForDirective(
2615 VisitOMPLoopDirective(D);
2616 D->setHasCancel(Record.readBool());
2617}
2618
2619void ASTStmtReader::VisitOMPTeamsDirective(OMPTeamsDirective *D) {
2620 VisitStmt(D);
2621 VisitOMPExecutableDirective(D);
2622}
2623
2624void ASTStmtReader::VisitOMPCancellationPointDirective(
2626 VisitStmt(D);
2627 VisitOMPExecutableDirective(D);
2628 D->setCancelRegion(Record.readEnum<OpenMPDirectiveKind>());
2629}
2630
2631void ASTStmtReader::VisitOMPCancelDirective(OMPCancelDirective *D) {
2632 VisitStmt(D);
2633 VisitOMPExecutableDirective(D);
2634 D->setCancelRegion(Record.readEnum<OpenMPDirectiveKind>());
2635}
2636
2637void ASTStmtReader::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) {
2638 VisitOMPLoopDirective(D);
2639 D->setHasCancel(Record.readBool());
2640}
2641
2642void ASTStmtReader::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) {
2643 VisitOMPLoopDirective(D);
2644}
2645
2646void ASTStmtReader::VisitOMPMasterTaskLoopDirective(
2648 VisitOMPLoopDirective(D);
2649 D->setHasCancel(Record.readBool());
2650}
2651
2652void ASTStmtReader::VisitOMPMaskedTaskLoopDirective(
2654 VisitOMPLoopDirective(D);
2655 D->setHasCancel(Record.readBool());
2656}
2657
2658void ASTStmtReader::VisitOMPMasterTaskLoopSimdDirective(
2660 VisitOMPLoopDirective(D);
2661}
2662
2663void ASTStmtReader::VisitOMPMaskedTaskLoopSimdDirective(
2665 VisitOMPLoopDirective(D);
2666}
2667
2668void ASTStmtReader::VisitOMPParallelMasterTaskLoopDirective(
2670 VisitOMPLoopDirective(D);
2671 D->setHasCancel(Record.readBool());
2672}
2673
2674void ASTStmtReader::VisitOMPParallelMaskedTaskLoopDirective(
2676 VisitOMPLoopDirective(D);
2677 D->setHasCancel(Record.readBool());
2678}
2679
2680void ASTStmtReader::VisitOMPParallelMasterTaskLoopSimdDirective(
2682 VisitOMPLoopDirective(D);
2683}
2684
2685void ASTStmtReader::VisitOMPParallelMaskedTaskLoopSimdDirective(
2687 VisitOMPLoopDirective(D);
2688}
2689
2690void ASTStmtReader::VisitOMPDistributeDirective(OMPDistributeDirective *D) {
2691 VisitOMPLoopDirective(D);
2692}
2693
2694void ASTStmtReader::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) {
2695 VisitStmt(D);
2696 VisitOMPExecutableDirective(D);
2697}
2698
2699void ASTStmtReader::VisitOMPDistributeParallelForDirective(
2701 VisitOMPLoopDirective(D);
2702 D->setHasCancel(Record.readBool());
2703}
2704
2705void ASTStmtReader::VisitOMPDistributeParallelForSimdDirective(
2707 VisitOMPLoopDirective(D);
2708}
2709
2710void ASTStmtReader::VisitOMPDistributeSimdDirective(
2712 VisitOMPLoopDirective(D);
2713}
2714
2715void ASTStmtReader::VisitOMPTargetParallelForSimdDirective(
2717 VisitOMPLoopDirective(D);
2718}
2719
2720void ASTStmtReader::VisitOMPTargetSimdDirective(OMPTargetSimdDirective *D) {
2721 VisitOMPLoopDirective(D);
2722}
2723
2724void ASTStmtReader::VisitOMPTeamsDistributeDirective(
2726 VisitOMPLoopDirective(D);
2727}
2728
2729void ASTStmtReader::VisitOMPTeamsDistributeSimdDirective(
2731 VisitOMPLoopDirective(D);
2732}
2733
2734void ASTStmtReader::VisitOMPTeamsDistributeParallelForSimdDirective(
2736 VisitOMPLoopDirective(D);
2737}
2738
2739void ASTStmtReader::VisitOMPTeamsDistributeParallelForDirective(
2741 VisitOMPLoopDirective(D);
2742 D->setHasCancel(Record.readBool());
2743}
2744
2745void ASTStmtReader::VisitOMPTargetTeamsDirective(OMPTargetTeamsDirective *D) {
2746 VisitStmt(D);
2747 VisitOMPExecutableDirective(D);
2748}
2749
2750void ASTStmtReader::VisitOMPTargetTeamsDistributeDirective(
2752 VisitOMPLoopDirective(D);
2753}
2754
2755void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForDirective(
2757 VisitOMPLoopDirective(D);
2758 D->setHasCancel(Record.readBool());
2759}
2760
2761void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
2763 VisitOMPLoopDirective(D);
2764}
2765
2766void ASTStmtReader::VisitOMPTargetTeamsDistributeSimdDirective(
2768 VisitOMPLoopDirective(D);
2769}
2770
2771void ASTStmtReader::VisitOMPInteropDirective(OMPInteropDirective *D) {
2772 VisitStmt(D);
2773 VisitOMPExecutableDirective(D);
2774}
2775
2776void ASTStmtReader::VisitOMPDispatchDirective(OMPDispatchDirective *D) {
2777 VisitStmt(D);
2778 VisitOMPExecutableDirective(D);
2779 D->setTargetCallLoc(Record.readSourceLocation());
2780}
2781
2782void ASTStmtReader::VisitOMPMaskedDirective(OMPMaskedDirective *D) {
2783 VisitStmt(D);
2784 VisitOMPExecutableDirective(D);
2785}
2786
2787void ASTStmtReader::VisitOMPGenericLoopDirective(OMPGenericLoopDirective *D) {
2788 VisitOMPLoopDirective(D);
2789}
2790
2791void ASTStmtReader::VisitOMPTeamsGenericLoopDirective(
2793 VisitOMPLoopDirective(D);
2794}
2795
2796void ASTStmtReader::VisitOMPTargetTeamsGenericLoopDirective(
2798 VisitOMPLoopDirective(D);
2799 D->setCanBeParallelFor(Record.readBool());
2800}
2801
2802void ASTStmtReader::VisitOMPParallelGenericLoopDirective(
2804 VisitOMPLoopDirective(D);
2805}
2806
2807void ASTStmtReader::VisitOMPTargetParallelGenericLoopDirective(
2809 VisitOMPLoopDirective(D);
2810}
2811
2812//===----------------------------------------------------------------------===//
2813// OpenACC Constructs/Directives.
2814//===----------------------------------------------------------------------===//
2815void ASTStmtReader::VisitOpenACCConstructStmt(OpenACCConstructStmt *S) {
2816 (void)Record.readInt();
2817 S->Kind = Record.readEnum<OpenACCDirectiveKind>();
2818 S->Range = Record.readSourceRange();
2819 S->DirectiveLoc = Record.readSourceLocation();
2820 Record.readOpenACCClauseList(S->Clauses);
2821}
2822
2823void ASTStmtReader::VisitOpenACCAssociatedStmtConstruct(
2825 VisitOpenACCConstructStmt(S);
2826 S->setAssociatedStmt(Record.readSubStmt());
2827}
2828
2829void ASTStmtReader::VisitOpenACCComputeConstruct(OpenACCComputeConstruct *S) {
2830 VisitStmt(S);
2831 VisitOpenACCAssociatedStmtConstruct(S);
2832 S->findAndSetChildLoops();
2833}
2834
2835void ASTStmtReader::VisitOpenACCLoopConstruct(OpenACCLoopConstruct *S) {
2836 VisitStmt(S);
2837 VisitOpenACCAssociatedStmtConstruct(S);
2838}
2839
2840//===----------------------------------------------------------------------===//
2841// ASTReader Implementation
2842//===----------------------------------------------------------------------===//
2843
2845 switch (ReadingKind) {
2846 case Read_None:
2847 llvm_unreachable("should not call this when not reading anything");
2848 case Read_Decl:
2849 case Read_Type:
2850 return ReadStmtFromStream(F);
2851 case Read_Stmt:
2852 return ReadSubStmt();
2853 }
2854
2855 llvm_unreachable("ReadingKind not set ?");
2856}
2857
2859 return cast_or_null<Expr>(ReadStmt(F));
2860}
2861
2863 return cast_or_null<Expr>(ReadSubStmt());
2864}
2865
2866// Within the bitstream, expressions are stored in Reverse Polish
2867// Notation, with each of the subexpressions preceding the
2868// expression they are stored in. Subexpressions are stored from last to first.
2869// To evaluate expressions, we continue reading expressions and placing them on
2870// the stack, with expressions having operands removing those operands from the
2871// stack. Evaluation terminates when we see a STMT_STOP record, and
2872// the single remaining expression on the stack is our result.
2873Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) {
2874 ReadingKindTracker ReadingKind(Read_Stmt, *this);
2875 llvm::BitstreamCursor &Cursor = F.DeclsCursor;
2876
2877 // Map of offset to previously deserialized stmt. The offset points
2878 // just after the stmt record.
2879 llvm::DenseMap<uint64_t, Stmt *> StmtEntries;
2880
2881#ifndef NDEBUG
2882 unsigned PrevNumStmts = StmtStack.size();
2883#endif
2884
2885 ASTRecordReader Record(*this, F);
2886 ASTStmtReader Reader(Record, Cursor);
2888
2889 while (true) {
2891 Cursor.advanceSkippingSubblocks();
2892 if (!MaybeEntry) {
2893 Error(toString(MaybeEntry.takeError()));
2894 return nullptr;
2895 }
2896 llvm::BitstreamEntry Entry = MaybeEntry.get();
2897
2898 switch (Entry.Kind) {
2899 case llvm::BitstreamEntry::SubBlock: // Handled for us already.
2900 case llvm::BitstreamEntry::Error:
2901 Error("malformed block record in AST file");
2902 return nullptr;
2903 case llvm::BitstreamEntry::EndBlock:
2904 goto Done;
2905 case llvm::BitstreamEntry::Record:
2906 // The interesting case.
2907 break;
2908 }
2909
2910 ASTContext &Context = getContext();
2911 Stmt *S = nullptr;
2912 bool Finished = false;
2913 bool IsStmtReference = false;
2914 Expected<unsigned> MaybeStmtCode = Record.readRecord(Cursor, Entry.ID);
2915 if (!MaybeStmtCode) {
2916 Error(toString(MaybeStmtCode.takeError()));
2917 return nullptr;
2918 }
2919 switch ((StmtCode)MaybeStmtCode.get()) {
2920 case STMT_STOP:
2921 Finished = true;
2922 break;
2923
2924 case STMT_REF_PTR:
2925 IsStmtReference = true;
2926 assert(StmtEntries.contains(Record[0]) &&
2927 "No stmt was recorded for this offset reference!");
2928 S = StmtEntries[Record.readInt()];
2929 break;
2930
2931 case STMT_NULL_PTR:
2932 S = nullptr;
2933 break;
2934
2935 case STMT_NULL:
2936 S = new (Context) NullStmt(Empty);
2937 break;
2938
2939 case STMT_COMPOUND: {
2940 unsigned NumStmts = Record[ASTStmtReader::NumStmtFields];
2941 bool HasFPFeatures = Record[ASTStmtReader::NumStmtFields + 1];
2942 S = CompoundStmt::CreateEmpty(Context, NumStmts, HasFPFeatures);
2943 break;
2944 }
2945
2946 case STMT_CASE:
2948 Context,
2949 /*CaseStmtIsGNURange*/ Record[ASTStmtReader::NumStmtFields + 3]);
2950 break;
2951
2952 case STMT_DEFAULT:
2953 S = new (Context) DefaultStmt(Empty);
2954 break;
2955
2956 case STMT_LABEL:
2957 S = new (Context) LabelStmt(Empty);
2958 break;
2959
2960 case STMT_ATTRIBUTED:
2962 Context,
2964 break;
2965
2966 case STMT_IF: {
2968 bool HasElse = IfStmtBits.getNextBit();
2969 bool HasVar = IfStmtBits.getNextBit();
2970 bool HasInit = IfStmtBits.getNextBit();
2971 S = IfStmt::CreateEmpty(Context, HasElse, HasVar, HasInit);
2972 break;
2973 }
2974
2975 case STMT_SWITCH:
2977 Context,
2979 /* HasVar=*/Record[ASTStmtReader::NumStmtFields + 1]);
2980 break;
2981
2982 case STMT_WHILE:
2984 Context,
2986 break;
2987
2988 case STMT_DO:
2989 S = new (Context) DoStmt(Empty);
2990 break;
2991
2992 case STMT_FOR:
2993 S = new (Context) ForStmt(Empty);
2994 break;
2995
2996 case STMT_GOTO:
2997 S = new (Context) GotoStmt(Empty);
2998 break;
2999
3000 case STMT_INDIRECT_GOTO:
3001 S = new (Context) IndirectGotoStmt(Empty);
3002 break;
3003
3004 case STMT_CONTINUE:
3005 S = new (Context) ContinueStmt(Empty);
3006 break;
3007
3008 case STMT_BREAK:
3009 S = new (Context) BreakStmt(Empty);
3010 break;
3011
3012 case STMT_RETURN:
3014 Context, /* HasNRVOCandidate=*/Record[ASTStmtReader::NumStmtFields]);
3015 break;
3016
3017 case STMT_DECL:
3018 S = new (Context) DeclStmt(Empty);
3019 break;
3020
3021 case STMT_GCCASM:
3022 S = new (Context) GCCAsmStmt(Empty);
3023 break;
3024
3025 case STMT_MSASM:
3026 S = new (Context) MSAsmStmt(Empty);
3027 break;
3028
3029 case STMT_CAPTURED:
3032 break;
3033
3034 case EXPR_CONSTANT:
3036 Context, static_cast<ConstantResultStorageKind>(
3037 /*StorageKind=*/Record[ASTStmtReader::NumExprFields]));
3038 break;
3039
3042 break;
3043
3044 case EXPR_PREDEFINED:
3046 Context,
3047 /*HasFunctionName*/ Record[ASTStmtReader::NumExprFields]);
3048 break;
3049
3050 case EXPR_DECL_REF: {
3052 DeclRefExprBits.advance(5);
3053 bool HasFoundDecl = DeclRefExprBits.getNextBit();
3054 bool HasQualifier = DeclRefExprBits.getNextBit();
3055 bool HasTemplateKWAndArgsInfo = DeclRefExprBits.getNextBit();
3056 unsigned NumTemplateArgs = HasTemplateKWAndArgsInfo
3058 : 0;
3059 S = DeclRefExpr::CreateEmpty(Context, HasQualifier, HasFoundDecl,
3060 HasTemplateKWAndArgsInfo, NumTemplateArgs);
3061 break;
3062 }
3063
3065 S = IntegerLiteral::Create(Context, Empty);
3066 break;
3067
3069 S = FixedPointLiteral::Create(Context, Empty);
3070 break;
3071
3073 S = FloatingLiteral::Create(Context, Empty);
3074 break;
3075
3077 S = new (Context) ImaginaryLiteral(Empty);
3078 break;
3079
3082 Context,
3083 /* NumConcatenated=*/Record[ASTStmtReader::NumExprFields],
3084 /* Length=*/Record[ASTStmtReader::NumExprFields + 1],
3085 /* CharByteWidth=*/Record[ASTStmtReader::NumExprFields + 2]);
3086 break;
3087
3089 S = new (Context) CharacterLiteral(Empty);
3090 break;
3091
3092 case EXPR_PAREN:
3093 S = new (Context) ParenExpr(Empty);
3094 break;
3095
3096 case EXPR_PAREN_LIST:
3098 Context,
3099 /* NumExprs=*/Record[ASTStmtReader::NumExprFields]);
3100 break;
3101
3102 case EXPR_UNARY_OPERATOR: {
3104 UnaryOperatorBits.advance(ASTStmtReader::NumExprBits);
3105 bool HasFPFeatures = UnaryOperatorBits.getNextBit();
3106 S = UnaryOperator::CreateEmpty(Context, HasFPFeatures);
3107 break;
3108 }
3109
3110 case EXPR_OFFSETOF:
3111 S = OffsetOfExpr::CreateEmpty(Context,
3114 break;
3115
3117 S = new (Context) UnaryExprOrTypeTraitExpr(Empty);
3118 break;
3119
3121 S = new (Context) ArraySubscriptExpr(Empty);
3122 break;
3123
3125 S = new (Context) MatrixSubscriptExpr(Empty);
3126 break;
3127
3128 case EXPR_ARRAY_SECTION:
3129 S = new (Context) ArraySectionExpr(Empty);
3130 break;
3131
3135 break;
3136
3137 case EXPR_OMP_ITERATOR:
3138 S = OMPIteratorExpr::CreateEmpty(Context,
3140 break;
3141
3142 case EXPR_CALL: {
3143 auto NumArgs = Record[ASTStmtReader::NumExprFields];
3145 CallExprBits.advance(1);
3146 auto HasFPFeatures = CallExprBits.getNextBit();
3147 S = CallExpr::CreateEmpty(Context, NumArgs, HasFPFeatures, Empty);
3148 break;
3149 }
3150
3151 case EXPR_RECOVERY:
3153 Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields]);
3154 break;
3155
3156 case EXPR_MEMBER: {
3158 bool HasQualifier = ExprMemberBits.getNextBit();
3159 bool HasFoundDecl = ExprMemberBits.getNextBit();
3160 bool HasTemplateInfo = ExprMemberBits.getNextBit();
3161 unsigned NumTemplateArgs = Record[ASTStmtReader::NumExprFields + 1];
3162 S = MemberExpr::CreateEmpty(Context, HasQualifier, HasFoundDecl,
3163 HasTemplateInfo, NumTemplateArgs);
3164 break;
3165 }
3166
3167 case EXPR_BINARY_OPERATOR: {
3169 BinaryOperatorBits.advance(/*Size of opcode*/ 6);
3170 bool HasFPFeatures = BinaryOperatorBits.getNextBit();
3171 S = BinaryOperator::CreateEmpty(Context, HasFPFeatures);
3172 break;
3173 }
3174
3177 BinaryOperatorBits.advance(/*Size of opcode*/ 6);
3178 bool HasFPFeatures = BinaryOperatorBits.getNextBit();
3179 S = CompoundAssignOperator::CreateEmpty(Context, HasFPFeatures);
3180 break;
3181 }
3182
3184 S = new (Context) ConditionalOperator(Empty);
3185 break;
3186
3188 S = new (Context) BinaryConditionalOperator(Empty);
3189 break;
3190
3191 case EXPR_IMPLICIT_CAST: {
3192 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
3194 CastExprBits.advance(7);
3195 bool HasFPFeatures = CastExprBits.getNextBit();
3196 S = ImplicitCastExpr::CreateEmpty(Context, PathSize, HasFPFeatures);
3197 break;
3198 }
3199
3200 case EXPR_CSTYLE_CAST: {
3201 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
3203 CastExprBits.advance(7);
3204 bool HasFPFeatures = CastExprBits.getNextBit();
3205 S = CStyleCastExpr::CreateEmpty(Context, PathSize, HasFPFeatures);
3206 break;
3207 }
3208
3210 S = new (Context) CompoundLiteralExpr(Empty);
3211 break;
3212
3214 S = new (Context) ExtVectorElementExpr(Empty);
3215 break;
3216
3217 case EXPR_INIT_LIST:
3218 S = new (Context) InitListExpr(Empty);
3219 break;
3220
3224
3225 break;
3226
3228 S = new (Context) DesignatedInitUpdateExpr(Empty);
3229 break;
3230
3232 S = new (Context) ImplicitValueInitExpr(Empty);
3233 break;
3234
3235 case EXPR_NO_INIT:
3236 S = new (Context) NoInitExpr(Empty);
3237 break;
3238
3240 S = new (Context) ArrayInitLoopExpr(Empty);
3241 break;
3242
3244 S = new (Context) ArrayInitIndexExpr(Empty);
3245 break;
3246
3247 case EXPR_VA_ARG:
3248 S = new (Context) VAArgExpr(Empty);
3249 break;
3250
3251 case EXPR_SOURCE_LOC:
3252 S = new (Context) SourceLocExpr(Empty);
3253 break;
3254
3256 S = new (Context) EmbedExpr(Empty);
3257 break;
3258
3259 case EXPR_ADDR_LABEL:
3260 S = new (Context) AddrLabelExpr(Empty);
3261 break;
3262
3263 case EXPR_STMT:
3264 S = new (Context) StmtExpr(Empty);
3265 break;
3266
3267 case EXPR_CHOOSE:
3268 S = new (Context) ChooseExpr(Empty);
3269 break;
3270
3271 case EXPR_GNU_NULL:
3272 S = new (Context) GNUNullExpr(Empty);
3273 break;
3274
3276 S = new (Context) ShuffleVectorExpr(Empty);
3277 break;
3278
3280 S = new (Context) ConvertVectorExpr(Empty);
3281 break;
3282
3283 case EXPR_BLOCK:
3284 S = new (Context) BlockExpr(Empty);
3285 break;
3286
3289 Context,
3290 /*NumAssocs=*/Record[ASTStmtReader::NumExprFields]);
3291 break;
3292
3294 S = new (Context) ObjCStringLiteral(Empty);
3295 break;
3296
3298 S = new (Context) ObjCBoxedExpr(Empty);
3299 break;
3300
3304 break;
3305
3310 break;
3311
3312 case EXPR_OBJC_ENCODE:
3313 S = new (Context) ObjCEncodeExpr(Empty);
3314 break;
3315
3317 S = new (Context) ObjCSelectorExpr(Empty);
3318 break;
3319
3321 S = new (Context) ObjCProtocolExpr(Empty);
3322 break;
3323
3325 S = new (Context) ObjCIvarRefExpr(Empty);
3326 break;
3327
3329 S = new (Context) ObjCPropertyRefExpr(Empty);
3330 break;
3331
3333 S = new (Context) ObjCSubscriptRefExpr(Empty);
3334 break;
3335
3337 llvm_unreachable("mismatching AST file");
3338
3340 S = ObjCMessageExpr::CreateEmpty(Context,
3343 break;
3344
3345 case EXPR_OBJC_ISA:
3346 S = new (Context) ObjCIsaExpr(Empty);
3347 break;
3348
3350 S = new (Context) ObjCIndirectCopyRestoreExpr(Empty);
3351 break;
3352
3354 S = new (Context) ObjCBridgedCastExpr(Empty);
3355 break;
3356
3358 S = new (Context) ObjCForCollectionStmt(Empty);
3359 break;
3360
3361 case STMT_OBJC_CATCH:
3362 S = new (Context) ObjCAtCatchStmt(Empty);
3363 break;
3364
3365 case STMT_OBJC_FINALLY:
3366 S = new (Context) ObjCAtFinallyStmt(Empty);
3367 break;
3368
3369 case STMT_OBJC_AT_TRY:
3370 S = ObjCAtTryStmt::CreateEmpty(Context,
3373 break;
3374
3376 S = new (Context) ObjCAtSynchronizedStmt(Empty);
3377 break;
3378
3379 case STMT_OBJC_AT_THROW:
3380 S = new (Context) ObjCAtThrowStmt(Empty);
3381 break;
3382
3384 S = new (Context) ObjCAutoreleasePoolStmt(Empty);
3385 break;
3386
3388 S = new (Context) ObjCBoolLiteralExpr(Empty);
3389 break;
3390
3392 S = new (Context) ObjCAvailabilityCheckExpr(Empty);
3393 break;
3394
3395 case STMT_SEH_LEAVE:
3396 S = new (Context) SEHLeaveStmt(Empty);
3397 break;
3398
3399 case STMT_SEH_EXCEPT:
3400 S = new (Context) SEHExceptStmt(Empty);
3401 break;
3402
3403 case STMT_SEH_FINALLY:
3404 S = new (Context) SEHFinallyStmt(Empty);
3405 break;
3406
3407 case STMT_SEH_TRY:
3408 S = new (Context) SEHTryStmt(Empty);
3409 break;
3410
3411 case STMT_CXX_CATCH:
3412 S = new (Context) CXXCatchStmt(Empty);
3413 break;
3414
3415 case STMT_CXX_TRY:
3416 S = CXXTryStmt::Create(Context, Empty,
3417 /*numHandlers=*/Record[ASTStmtReader::NumStmtFields]);
3418 break;
3419
3420 case STMT_CXX_FOR_RANGE:
3421 S = new (Context) CXXForRangeStmt(Empty);
3422 break;
3423
3425 S = new (Context) MSDependentExistsStmt(SourceLocation(), true,
3428 nullptr);
3429 break;
3430
3432 S = OMPCanonicalLoop::createEmpty(Context);
3433 break;
3434
3438 break;
3439
3441 S =
3444 Empty);
3445 break;
3446
3448 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3449 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3450 S = OMPSimdDirective::CreateEmpty(Context, NumClauses,
3451 CollapsedNum, Empty);
3452 break;
3453 }
3454
3456 unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
3457 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3458 S = OMPTileDirective::CreateEmpty(Context, NumClauses, NumLoops);
3459 break;
3460 }
3461
3463 assert(Record[ASTStmtReader::NumStmtFields] == 1 && "Unroll directive accepts only a single loop");
3464 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3465 S = OMPUnrollDirective::CreateEmpty(Context, NumClauses);
3466 break;
3467 }
3468
3470 assert(Record[ASTStmtReader::NumStmtFields] == 1 &&
3471 "Reverse directive accepts only a single loop");
3472 assert(Record[ASTStmtReader::NumStmtFields + 1] == 0 &&
3473 "Reverse directive has no clauses");
3475 break;
3476 }
3477
3479 unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
3480 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3481 S = OMPInterchangeDirective::CreateEmpty(Context, NumClauses, NumLoops);
3482 break;
3483 }
3484
3486 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3487 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3488 S = OMPForDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3489 Empty);
3490 break;
3491 }
3492
3494 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3495 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3496 S = OMPForSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3497 Empty);
3498 break;
3499 }
3500
3504 break;
3505
3508 break;
3509
3513 break;
3514
3518 break;
3519
3522 break;
3523
3527 break;
3528
3530 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3531 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3532 S = OMPParallelForDirective::CreateEmpty(Context, NumClauses,
3533 CollapsedNum, Empty);
3534 break;
3535 }
3536
3538 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3539 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3540 S = OMPParallelForSimdDirective::CreateEmpty(Context, NumClauses,
3541 CollapsedNum, Empty);
3542 break;
3543 }
3544
3548 break;
3549
3553 break;
3554
3558 break;
3559
3563 break;
3564
3567 break;
3568
3571 break;
3572
3576 break;
3577
3581 break;
3582
3586 break;
3587
3591 break;
3592
3596 break;
3597
3601 break;
3602
3604 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3605 bool HasAssociatedStmt = Record[ASTStmtReader::NumStmtFields + 2];
3606 S = OMPOrderedDirective::CreateEmpty(Context, NumClauses,
3607 !HasAssociatedStmt, Empty);
3608 break;
3609 }
3610
3614 break;
3615
3619 break;
3620
3624 break;
3625
3629 break;
3630
3634 break;
3635
3639 break;
3640
3642 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3643 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3644 S = OMPTargetParallelForDirective::CreateEmpty(Context, NumClauses,
3645 CollapsedNum, Empty);
3646 break;
3647 }
3648
3652 break;
3653
3657 break;
3658
3661 break;
3662
3666 break;
3667
3669 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3670 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3671 S = OMPTaskLoopDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3672 Empty);
3673 break;
3674 }
3675
3677 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3678 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3679 S = OMPTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
3680 CollapsedNum, Empty);
3681 break;
3682 }
3683
3685 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3686 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3687 S = OMPMasterTaskLoopDirective::CreateEmpty(Context, NumClauses,
3688 CollapsedNum, Empty);
3689 break;
3690 }
3691
3693 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3694 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3695 S = OMPMaskedTaskLoopDirective::CreateEmpty(Context, NumClauses,
3696 CollapsedNum, Empty);
3697 break;
3698 }
3699
3701 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3702 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3703 S = OMPMasterTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
3704 CollapsedNum, Empty);
3705 break;
3706 }
3707
3709 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3710 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3711 S = OMPMaskedTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
3712 CollapsedNum, Empty);
3713 break;
3714 }
3715
3717 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3718 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3720 CollapsedNum, Empty);
3721 break;
3722 }
3723
3725 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3726 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3728 CollapsedNum, Empty);
3729 break;
3730 }
3731
3733 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3734 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3736 Context, NumClauses, CollapsedNum, Empty);
3737 break;
3738 }
3739
3741 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3742 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3744 Context, NumClauses, CollapsedNum, Empty);
3745 break;
3746 }
3747
3749 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3750 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3751 S = OMPDistributeDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3752 Empty);
3753 break;
3754 }
3755
3757 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3758 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3759 S = OMPDistributeParallelForDirective::CreateEmpty(Context, NumClauses,
3760 CollapsedNum, Empty);
3761 break;
3762 }
3763
3765 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3766 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3768 CollapsedNum,
3769 Empty);
3770 break;
3771 }
3772
3774 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3775 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3776 S = OMPDistributeSimdDirective::CreateEmpty(Context, NumClauses,
3777 CollapsedNum, Empty);
3778 break;
3779 }
3780
3782 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3783 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3784 S = OMPTargetParallelForSimdDirective::CreateEmpty(Context, NumClauses,
3785 CollapsedNum, Empty);
3786 break;
3787 }
3788
3790 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3791 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3792 S = OMPTargetSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3793 Empty);
3794 break;
3795 }
3796
3798 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3799 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3800 S = OMPTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
3801 CollapsedNum, Empty);
3802 break;
3803 }
3804
3806 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3807 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3808 S = OMPTeamsDistributeSimdDirective::CreateEmpty(Context, NumClauses,
3809 CollapsedNum, Empty);
3810 break;
3811 }
3812
3814 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3815 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3817 Context, NumClauses, CollapsedNum, Empty);
3818 break;
3819 }
3820
3822 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3823 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3825 Context, NumClauses, CollapsedNum, Empty);
3826 break;
3827 }
3828
3832 break;
3833
3835 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3836 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3837 S = OMPTargetTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
3838 CollapsedNum, Empty);
3839 break;
3840 }
3841
3843 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3844 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3846 Context, NumClauses, CollapsedNum, Empty);
3847 break;
3848 }
3849
3851 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3852 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3854 Context, NumClauses, CollapsedNum, Empty);
3855 break;
3856 }
3857
3859 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3860 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3862 Context, NumClauses, CollapsedNum, Empty);
3863 break;
3864 }
3865
3869 break;
3870
3874 break;
3875
3879 break;
3880
3882 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3883 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3884 S = OMPGenericLoopDirective::CreateEmpty(Context, NumClauses,
3885 CollapsedNum, Empty);
3886 break;
3887 }
3888
3890 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3891 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3892 S = OMPTeamsGenericLoopDirective::CreateEmpty(Context, NumClauses,
3893 CollapsedNum, Empty);
3894 break;
3895 }
3896
3898 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3899 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3901 CollapsedNum, Empty);
3902 break;
3903 }
3904
3906 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3907 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3908 S = OMPParallelGenericLoopDirective::CreateEmpty(Context, NumClauses,
3909 CollapsedNum, Empty);
3910 break;
3911 }
3912
3914 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
3915 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
3917 Context, NumClauses, CollapsedNum, Empty);
3918 break;
3919 }
3920
3922 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3923 S = OMPAssumeDirective::CreateEmpty(Context, NumClauses, Empty);
3924 break;
3925 }
3926
3928 auto NumArgs = Record[ASTStmtReader::NumExprFields];
3930 CallExprBits.advance(1);
3931 auto HasFPFeatures = CallExprBits.getNextBit();
3932 S = CXXOperatorCallExpr::CreateEmpty(Context, NumArgs, HasFPFeatures,
3933 Empty);
3934 break;
3935 }
3936
3937 case EXPR_CXX_MEMBER_CALL: {
3938 auto NumArgs = Record[ASTStmtReader::NumExprFields];
3940 CallExprBits.advance(1);
3941 auto HasFPFeatures = CallExprBits.getNextBit();
3942 S = CXXMemberCallExpr::CreateEmpty(Context, NumArgs, HasFPFeatures,
3943 Empty);
3944 break;
3945 }
3946
3948 S = new (Context) CXXRewrittenBinaryOperator(Empty);
3949 break;
3950
3951 case EXPR_CXX_CONSTRUCT:
3953 Context,
3954 /* NumArgs=*/Record[ASTStmtReader::NumExprFields]);
3955 break;
3956
3958 S = new (Context) CXXInheritedCtorInitExpr(Empty);
3959 break;
3960
3963 Context,
3964 /* NumArgs=*/Record[ASTStmtReader::NumExprFields]);
3965 break;
3966
3967 case EXPR_CXX_STATIC_CAST: {
3968 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
3970 CastExprBits.advance(7);
3971 bool HasFPFeatures = CastExprBits.getNextBit();
3972 S = CXXStaticCastExpr::CreateEmpty(Context, PathSize, HasFPFeatures);
3973 break;
3974 }
3975
3976 case EXPR_CXX_DYNAMIC_CAST: {
3977 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
3978 S = CXXDynamicCastExpr::CreateEmpty(Context, PathSize);
3979 break;
3980 }
3981
3983 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
3984 S = CXXReinterpretCastExpr::CreateEmpty(Context, PathSize);
3985 break;
3986 }
3987
3989 S = CXXConstCastExpr::CreateEmpty(Context);
3990 break;
3991
3994 break;
3995
3997 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
3999 CastExprBits.advance(7);
4000 bool HasFPFeatures = CastExprBits.getNextBit();
4001 S = CXXFunctionalCastExpr::CreateEmpty(Context, PathSize, HasFPFeatures);
4002 break;
4003 }
4004
4005 case EXPR_BUILTIN_BIT_CAST: {
4006#ifndef NDEBUG
4007 unsigned PathSize = Record[ASTStmtReader::NumExprFields];
4008 assert(PathSize == 0 && "Wrong PathSize!");
4009#endif
4010 S = new (Context) BuiltinBitCastExpr(Empty);
4011 break;
4012 }
4013
4015 auto NumArgs = Record[ASTStmtReader::NumExprFields];
4017 CallExprBits.advance(1);
4018 auto HasFPFeatures = CallExprBits.getNextBit();
4019 S = UserDefinedLiteral::CreateEmpty(Context, NumArgs, HasFPFeatures,
4020 Empty);
4021 break;
4022 }
4023
4025 S = new (Context) CXXStdInitializerListExpr(Empty);
4026 break;
4027
4029 S = new (Context) CXXBoolLiteralExpr(Empty);
4030 break;
4031
4033 S = new (Context) CXXNullPtrLiteralExpr(Empty);
4034 break;
4035
4037 S = new (Context) CXXTypeidExpr(Empty, true);
4038 break;
4039
4041 S = new (Context) CXXTypeidExpr(Empty, false);
4042 break;
4043
4045 S = new (Context) CXXUuidofExpr(Empty, true);
4046 break;
4047
4049 S = new (Context) MSPropertyRefExpr(Empty);
4050 break;
4051
4053 S = new (Context) MSPropertySubscriptExpr(Empty);
4054 break;
4055
4057 S = new (Context) CXXUuidofExpr(Empty, false);
4058 break;
4059
4060 case EXPR_CXX_THIS:
4061 S = CXXThisExpr::CreateEmpty(Context);
4062 break;
4063
4064 case EXPR_CXX_THROW:
4065 S = new (Context) CXXThrowExpr(Empty);
4066 break;
4067
4070 Context, /*HasRewrittenInit=*/Record[ASTStmtReader::NumExprFields]);
4071 break;
4072
4075 Context, /*HasRewrittenInit=*/Record[ASTStmtReader::NumExprFields]);
4076 break;
4077
4079 S = new (Context) CXXBindTemporaryExpr(Empty);
4080 break;
4081
4083 S = new (Context) CXXScalarValueInitExpr(Empty);
4084 break;
4085
4086 case EXPR_CXX_NEW:
4088 Context,
4090 /*HasInit=*/Record[ASTStmtReader::NumExprFields + 1],
4091 /*NumPlacementArgs=*/Record[ASTStmtReader::NumExprFields + 2],
4092 /*IsParenTypeId=*/Record[ASTStmtReader::NumExprFields + 3]);
4093 break;
4094
4095 case EXPR_CXX_DELETE:
4096 S = new (Context) CXXDeleteExpr(Empty);
4097 break;
4098
4100 S = new (Context) CXXPseudoDestructorExpr(Empty);
4101 break;
4102
4104 S = ExprWithCleanups::Create(Context, Empty,
4106 break;
4107
4109 unsigned NumTemplateArgs = Record[ASTStmtReader::NumExprFields];
4110 BitsUnpacker DependentScopeMemberBits(
4112 bool HasTemplateKWAndArgsInfo = DependentScopeMemberBits.getNextBit();
4113
4114 bool HasFirstQualifierFoundInScope =
4115 DependentScopeMemberBits.getNextBit();
4117 Context, HasTemplateKWAndArgsInfo, NumTemplateArgs,
4118 HasFirstQualifierFoundInScope);
4119 break;
4120 }
4121
4123 BitsUnpacker DependentScopeDeclRefBits(
4125 DependentScopeDeclRefBits.advance(ASTStmtReader::NumExprBits);
4126 bool HasTemplateKWAndArgsInfo = DependentScopeDeclRefBits.getNextBit();
4127 unsigned NumTemplateArgs =
4128 HasTemplateKWAndArgsInfo
4129 ? DependentScopeDeclRefBits.getNextBits(/*Width=*/16)
4130 : 0;
4132 Context, HasTemplateKWAndArgsInfo, NumTemplateArgs);
4133 break;
4134 }
4135
4139 break;
4140
4142 auto NumResults = Record[ASTStmtReader::NumExprFields];
4143 BitsUnpacker OverloadExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4144 auto HasTemplateKWAndArgsInfo = OverloadExprBits.getNextBit();
4145 auto NumTemplateArgs = HasTemplateKWAndArgsInfo
4147 : 0;
4149 Context, NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
4150 break;
4151 }
4152
4154 auto NumResults = Record[ASTStmtReader::NumExprFields];
4155 BitsUnpacker OverloadExprBits(Record[ASTStmtReader::NumExprFields + 1]);
4156 auto HasTemplateKWAndArgsInfo = OverloadExprBits.getNextBit();
4157 auto NumTemplateArgs = HasTemplateKWAndArgsInfo
4159 : 0;
4161 Context, NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
4162 break;
4163 }
4164
4165 case EXPR_TYPE_TRAIT:
4168 break;
4169
4171 S = new (Context) ArrayTypeTraitExpr(Empty);
4172 break;
4173
4175 S = new (Context) ExpressionTraitExpr(Empty);
4176 break;
4177
4178 case EXPR_CXX_NOEXCEPT:
4179 S = new (Context) CXXNoexceptExpr(Empty);
4180 break;
4181
4183 S = new (Context) PackExpansionExpr(Empty);
4184 break;
4185
4186 case EXPR_SIZEOF_PACK:
4188 Context,
4189 /*NumPartialArgs=*/Record[ASTStmtReader::NumExprFields]);
4190 break;
4191
4192 case EXPR_PACK_INDEXING:
4194 Context,
4195 /*TransformedExprs=*/Record[ASTStmtReader::NumExprFields]);
4196 break;
4197
4199 S = new (Context) SubstNonTypeTemplateParmExpr(Empty);
4200 break;
4201
4203 S = new (Context) SubstNonTypeTemplateParmPackExpr(Empty);
4204 break;
4205
4209 break;
4210
4212 S = new (Context) MaterializeTemporaryExpr(Empty);
4213 break;
4214
4215 case EXPR_CXX_FOLD:
4216 S = new (Context) CXXFoldExpr(Empty);
4217 break;
4218
4221 Context, /*numExprs=*/Record[ASTStmtReader::NumExprFields], Empty);
4222 break;
4223
4224 case EXPR_OPAQUE_VALUE:
4225 S = new (Context) OpaqueValueExpr(Empty);
4226 break;
4227
4228 case EXPR_CUDA_KERNEL_CALL: {
4229 auto NumArgs = Record[ASTStmtReader::NumExprFields];
4231 CallExprBits.advance(1);
4232 auto HasFPFeatures = CallExprBits.getNextBit();
4233 S = CUDAKernelCallExpr::CreateEmpty(Context, NumArgs, HasFPFeatures,
4234 Empty);
4235 break;
4236 }
4237
4238 case EXPR_ASTYPE:
4239 S = new (Context) AsTypeExpr(Empty);
4240 break;
4241
4242 case EXPR_PSEUDO_OBJECT: {
4243 unsigned numSemanticExprs = Record[ASTStmtReader::NumExprFields];
4244 S = PseudoObjectExpr::Create(Context, Empty, numSemanticExprs);
4245 break;
4246 }
4247
4248 case EXPR_ATOMIC:
4249 S = new (Context) AtomicExpr(Empty);
4250 break;
4251
4252 case EXPR_LAMBDA: {
4253 unsigned NumCaptures = Record[ASTStmtReader::NumExprFields];
4254 S = LambdaExpr::CreateDeserialized(Context, NumCaptures);
4255 break;
4256 }
4257
4258 case STMT_COROUTINE_BODY: {
4259 unsigned NumParams = Record[ASTStmtReader::NumStmtFields];
4260 S = CoroutineBodyStmt::Create(Context, Empty, NumParams);
4261 break;
4262 }
4263
4264 case STMT_CORETURN:
4265 S = new (Context) CoreturnStmt(Empty);
4266 break;
4267
4268 case EXPR_COAWAIT:
4269 S = new (Context) CoawaitExpr(Empty);
4270 break;
4271
4272 case EXPR_COYIELD:
4273 S = new (Context) CoyieldExpr(Empty);
4274 break;
4275
4277 S = new (Context) DependentCoawaitExpr(Empty);
4278 break;
4279
4281 S = new (Context) ConceptSpecializationExpr(Empty);
4282 break;
4283 }
4285 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4286 S = OpenACCComputeConstruct::CreateEmpty(Context, NumClauses);
4287 break;
4288 }
4290 unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
4291 S = OpenACCLoopConstruct::CreateEmpty(Context, NumClauses);
4292 break;
4293 }
4294 case EXPR_REQUIRES:
4295 unsigned numLocalParameters = Record[ASTStmtReader::NumExprFields];
4296 unsigned numRequirement = Record[ASTStmtReader::NumExprFields + 1];
4297 S = RequiresExpr::Create(Context, Empty, numLocalParameters,
4298 numRequirement);
4299 break;
4300 }
4301
4302 // We hit a STMT_STOP, so we're done with this expression.
4303 if (Finished)
4304 break;
4305
4306 ++NumStatementsRead;
4307
4308 if (S && !IsStmtReference) {
4309 Reader.Visit(S);
4310 StmtEntries[Cursor.GetCurrentBitNo()] = S;
4311 }
4312
4313 assert(Record.getIdx() == Record.size() &&
4314 "Invalid deserialization of statement");
4315 StmtStack.push_back(S);
4316 }
4317Done:
4318 assert(StmtStack.size() > PrevNumStmts && "Read too many sub-stmts!");
4319 assert(StmtStack.size() == PrevNumStmts + 1 && "Extra expressions on stack!");
4320 return StmtStack.pop_back_val();
4321}
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:187
ASTContext & getContext()
Retrieve the AST context that this AST reader supplements.
Definition: ASTReader.h:2403
Stmt * ReadSubStmt()
Reads a sub-statement operand during statement reading.
Definition: ASTReader.h:2358
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:2465
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:5291
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:1921
A C++ addrspace_cast expression (currently only enabled for OpenCL).
Definition: ExprCXX.h:601
static CXXAddrspaceCastExpr * CreateEmpty(const ASTContext &Context)
Definition: ExprCXX.cpp:898
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:885
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:1175
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1268
static CXXDefaultArgExpr * CreateEmpty(const ASTContext &C, bool HasRewrittenInit)
Definition: ExprCXX.cpp:1012
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:1066
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:3682
static CXXDependentScopeMemberExpr * CreateEmpty(const ASTContext &Ctx, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs, bool HasFirstQualifierFoundInScope)
Definition: ExprCXX.cpp:1555
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Definition: ExprCXX.h:478
static CXXDynamicCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
Definition: ExprCXX.cpp:807
Represents a folding of a pack over an operator.
Definition: ExprCXX.h:4839
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:918
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:692
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:4125
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:627
Represents a list-initialization with parenthesis.
Definition: ExprCXX.h:4953
static CXXParenListInitExpr * CreateEmpty(ASTContext &C, unsigned numExprs, EmptyShell Empty)
Definition: ExprCXX.cpp:1943
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:871
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:779
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:1141
Represents the this expression in C++.
Definition: ExprCXX.h:1152
static CXXThisExpr * CreateEmpty(const ASTContext &Ctx)
Definition: ExprCXX.cpp:1575
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:3556
static CXXUnresolvedConstructExpr * CreateEmpty(const ASTContext &Context, unsigned NumArgs)
Definition: ExprCXX.cpp:1482
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:5184
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:49
llvm::SmallVector< Detail, 4 > Details
The substituted constraint expr, if the template arguments could be substituted into them,...
Definition: ASTConcept.h:58
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:5265
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:5216
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:3322
static DependentScopeDeclRefExpr * CreateEmpty(const ASTContext &Context, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition: ExprCXX.cpp:547
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:3473
llvm::PointerUnion< BlockDecl *, CompoundLiteralExpr * > CleanupObject
The type of objects that are kept in the cleanup.
Definition: ExprCXX.h:3479
static ExprWithCleanups * Create(const ASTContext &C, EmptyShell empty, unsigned numObjects)
Definition: ExprCXX.cpp:1447
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:4647
static FunctionParmPackExpr * CreateEmpty(const ASTContext &Context, unsigned NumParams)
Definition: ExprCXX.cpp:1805
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:1314
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:4727
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
static OMPAssumeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Definition: StmtOpenMP.cpp:812
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:988
This represents '#pragma omp barrier' directive.
Definition: StmtOpenMP.h:2625
static OMPBarrierDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:840
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:900
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:885
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:930
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:828
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:915
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:961
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:945
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.
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:869
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:854
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:4179
static PackIndexingExpr * CreateDeserialized(ASTContext &Context, unsigned NumTransformedExprs)
Definition: ExprCXX.cpp:1746
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:2033
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:4257
static SizeOfPackExpr * CreateDeserialized(ASTContext &Context, unsigned NumPartialArgs)
Definition: ExprCXX.cpp:1706
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:4483
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition: ExprCXX.h:4568
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:7721
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:1887
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:455
Represents a C++ member access expression for which lookup produced a set of overloaded functions.
Definition: ExprCXX.h:3942
static UnresolvedMemberExpr * CreateEmpty(const ASTContext &Context, unsigned NumResults, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition: ExprCXX.cpp:1655
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:966
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:1506
DesignatorTypes
The kinds of designators that can occur in a DesignatedInitExpr.
Definition: ASTBitCodes.h:2002
@ EXPR_DESIGNATED_INIT
A DesignatedInitExpr record.
Definition: ASTBitCodes.h:1653
@ EXPR_COMPOUND_LITERAL
A CompoundLiteralExpr record.
Definition: ASTBitCodes.h:1644
@ STMT_OMP_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1951
@ EXPR_OBJC_IVAR_REF_EXPR
An ObjCIvarRefExpr record.
Definition: ASTBitCodes.h:1731
@ EXPR_MEMBER
A MemberExpr record.
Definition: ASTBitCodes.h:1626
@ EXPR_CXX_TEMPORARY_OBJECT
A CXXTemporaryObjectExpr record.
Definition: ASTBitCodes.h:1805
@ STMT_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1962
@ EXPR_COMPOUND_ASSIGN_OPERATOR
A CompoundAssignOperator record.
Definition: ASTBitCodes.h:1632
@ EXPR_CXX_STATIC_CAST
A CXXStaticCastExpr record.
Definition: ASTBitCodes.h:1808
@ EXPR_OBJC_STRING_LITERAL
An ObjCStringLiteral record.
Definition: ASTBitCodes.h:1715
@ EXPR_VA_ARG
A VAArgExpr record.
Definition: ASTBitCodes.h:1671
@ STMT_OMP_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1956
@ EXPR_OBJC_ISA
An ObjCIsa Expr record.
Definition: ASTBitCodes.h:1746
@ EXPR_CXX_OPERATOR_CALL
A CXXOperatorCallExpr record.
Definition: ASTBitCodes.h:1790
@ STMT_OBJC_AT_TRY
An ObjCAtTryStmt record.
Definition: ASTBitCodes.h:1761
@ STMT_DO
A DoStmt record.
Definition: ASTBitCodes.h:1545
@ STMT_OBJC_CATCH
An ObjCAtCatchStmt record.
Definition: ASTBitCodes.h:1755
@ STMT_IF
An IfStmt record.
Definition: ASTBitCodes.h:1536
@ EXPR_STRING_LITERAL
A StringLiteral record.
Definition: ASTBitCodes.h:1596
@ EXPR_OBJC_AVAILABILITY_CHECK
An ObjCAvailabilityCheckExpr record.
Definition: ASTBitCodes.h:1776
@ STMT_OMP_PARALLEL_MASKED_TASKLOOP_DIRECTIVE
Definition: ASTBitCodes.h:1946
@ EXPR_MATRIX_SUBSCRIPT
An MatrixSubscriptExpr record.
Definition: ASTBitCodes.h:1620
@ EXPR_PSEUDO_OBJECT
A PseudoObjectExpr record.
Definition: ASTBitCodes.h:1704
@ STMT_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE
Definition: ASTBitCodes.h:1961
@ EXPR_IMPLICIT_CAST
An ImplicitCastExpr record.
Definition: ASTBitCodes.h:1638
@ STMT_CAPTURED
A CapturedStmt record.
Definition: ASTBitCodes.h:1569
@ STMT_OMP_TARGET_PARALLEL_FOR_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1953
@ STMT_GCCASM
A GCC-style AsmStmt record.
Definition: ASTBitCodes.h:1572
@ EXPR_IMAGINARY_LITERAL
An ImaginaryLiteral record.
Definition: ASTBitCodes.h:1593
@ STMT_WHILE
A WhileStmt record.
Definition: ASTBitCodes.h:1542
@ EXPR_CONVERT_VECTOR
A ConvertVectorExpr record.
Definition: ASTBitCodes.h:1695
@ EXPR_OBJC_SUBSCRIPT_REF_EXPR
An ObjCSubscriptRefExpr record.
Definition: ASTBitCodes.h:1737
@ EXPR_STMT
A StmtExpr record.
Definition: ASTBitCodes.h:1677
@ STMT_OMP_PARALLEL_GENERIC_LOOP_DIRECTIVE
Definition: ASTBitCodes.h:1971
@ EXPR_CXX_REINTERPRET_CAST
A CXXReinterpretCastExpr record.
Definition: ASTBitCodes.h:1814
@ EXPR_DESIGNATED_INIT_UPDATE
A DesignatedInitUpdateExpr record.
Definition: ASTBitCodes.h:1656
@ STMT_OBJC_AT_SYNCHRONIZED
An ObjCAtSynchronizedStmt record.
Definition: ASTBitCodes.h:1764
@ STMT_OMP_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE
Definition: ASTBitCodes.h:1950
@ EXPR_BUILTIN_BIT_CAST
A BuiltinBitCastExpr record.
Definition: ASTBitCodes.h:1826
@ STMT_OMP_TARGET_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1963
@ EXPR_CHARACTER_LITERAL
A CharacterLiteral record.
Definition: ASTBitCodes.h:1599
@ EXPR_OBJC_ENCODE
An ObjCEncodeExpr record.
Definition: ASTBitCodes.h:1722
@ EXPR_CSTYLE_CAST
A CStyleCastExpr record.
Definition: ASTBitCodes.h:1641
@ EXPR_OBJC_BOOL_LITERAL
An ObjCBoolLiteralExpr record.
Definition: ASTBitCodes.h:1773
@ EXPR_EXT_VECTOR_ELEMENT
An ExtVectorElementExpr record.
Definition: ASTBitCodes.h:1647
@ EXPR_ATOMIC
An AtomicExpr record.
Definition: ASTBitCodes.h:1707
@ EXPR_OFFSETOF
An OffsetOfExpr record.
Definition: ASTBitCodes.h:1611
@ STMT_RETURN
A ReturnStmt record.
Definition: ASTBitCodes.h:1563
@ STMT_OBJC_FOR_COLLECTION
An ObjCForCollectionStmt record.
Definition: ASTBitCodes.h:1752
@ STMT_OMP_TARGET_TEAMS_DISTRIBUTE_DIRECTIVE
Definition: ASTBitCodes.h:1960
@ EXPR_ARRAY_INIT_LOOP
An ArrayInitLoopExpr record.
Definition: ASTBitCodes.h:1662
@ STMT_OMP_PARALLEL_MASTER_TASKLOOP_DIRECTIVE
Definition: ASTBitCodes.h:1942
@ STMT_OMP_PARALLEL_MASKED_TASKLOOP_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1947
@ STMT_CONTINUE
A ContinueStmt record.
Definition: ASTBitCodes.h:1557
@ EXPR_PREDEFINED
A PredefinedExpr record.
Definition: ASTBitCodes.h:1581
@ EXPR_CXX_BOOL_LITERAL
A CXXBoolLiteralExpr record.
Definition: ASTBitCodes.h:1835
@ EXPR_PAREN_LIST
A ParenListExpr record.
Definition: ASTBitCodes.h:1605
@ EXPR_CXX_PAREN_LIST_INIT
A CXXParenListInitExpr record.
Definition: ASTBitCodes.h:1838
@ STMT_OMP_MASTER_TASKLOOP_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1941
@ STMT_COMPOUND
A CompoundStmt record.
Definition: ASTBitCodes.h:1521
@ STMT_FOR
A ForStmt record.
Definition: ASTBitCodes.h:1548
@ STMT_ATTRIBUTED
An AttributedStmt record.
Definition: ASTBitCodes.h:1533
@ STMT_OMP_TARGET_TEAMS_GENERIC_LOOP_DIRECTIVE
Definition: ASTBitCodes.h:1970
@ EXPR_CXX_REWRITTEN_BINARY_OPERATOR
A CXXRewrittenBinaryOperator record.
Definition: ASTBitCodes.h:1796
@ STMT_GOTO
A GotoStmt record.
Definition: ASTBitCodes.h:1551
@ EXPR_NO_INIT
An NoInitExpr record.
Definition: ASTBitCodes.h:1659
@ EXPR_OBJC_PROTOCOL_EXPR
An ObjCProtocolExpr record.
Definition: ASTBitCodes.h:1728
@ EXPR_ARRAY_INIT_INDEX
An ArrayInitIndexExpr record.
Definition: ASTBitCodes.h:1665
@ EXPR_CXX_CONSTRUCT
A CXXConstructExpr record.
Definition: ASTBitCodes.h:1799
@ STMT_OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE
Definition: ASTBitCodes.h:1958
@ STMT_OMP_PARALLEL_MASTER_TASKLOOP_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1943
@ STMT_OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1957
@ EXPR_CXX_DYNAMIC_CAST
A CXXDynamicCastExpr record.
Definition: ASTBitCodes.h:1811
@ STMT_CXX_TRY
A CXXTryStmt record.
Definition: ASTBitCodes.h:1784
@ EXPR_GENERIC_SELECTION
A GenericSelectionExpr record.
Definition: ASTBitCodes.h:1701
@ EXPR_OBJC_INDIRECT_COPY_RESTORE
An ObjCIndirectCopyRestoreExpr record.
Definition: ASTBitCodes.h:1749
@ EXPR_CXX_INHERITED_CTOR_INIT
A CXXInheritedCtorInitExpr record.
Definition: ASTBitCodes.h:1802
@ EXPR_CALL
A CallExpr record.
Definition: ASTBitCodes.h:1623
@ EXPR_GNU_NULL
A GNUNullExpr record.
Definition: ASTBitCodes.h:1683
@ EXPR_OBJC_PROPERTY_REF_EXPR
An ObjCPropertyRefExpr record.
Definition: ASTBitCodes.h:1734
@ STMT_OMP_TARGET_PARALLEL_FOR_DIRECTIVE
Definition: ASTBitCodes.h:1933
@ EXPR_CXX_CONST_CAST
A CXXConstCastExpr record.
Definition: ASTBitCodes.h:1817
@ STMT_REF_PTR
A reference to a previously [de]serialized Stmt record.
Definition: ASTBitCodes.h:1515
@ EXPR_OBJC_MESSAGE_EXPR
An ObjCMessageExpr record.
Definition: ASTBitCodes.h:1743
@ STMT_CASE
A CaseStmt record.
Definition: ASTBitCodes.h:1524
@ EXPR_CONSTANT
A constant expression context.
Definition: ASTBitCodes.h:1578
@ STMT_STOP
A marker record that indicates that we are at the end of an expression.
Definition: ASTBitCodes.h:1509
@ STMT_MSASM
A MS-style AsmStmt record.
Definition: ASTBitCodes.h:1575
@ EXPR_CONDITIONAL_OPERATOR
A ConditionOperator record.
Definition: ASTBitCodes.h:1635
@ EXPR_BINARY_OPERATOR
A BinaryOperator record.
Definition: ASTBitCodes.h:1629
@ EXPR_CXX_STD_INITIALIZER_LIST
A CXXStdInitializerListExpr record.
Definition: ASTBitCodes.h:1832
@ EXPR_SHUFFLE_VECTOR
A ShuffleVectorExpr record.
Definition: ASTBitCodes.h:1692
@ STMT_OBJC_FINALLY
An ObjCAtFinallyStmt record.
Definition: ASTBitCodes.h:1758
@ EXPR_OBJC_SELECTOR_EXPR
An ObjCSelectorExpr record.
Definition: ASTBitCodes.h:1725
@ EXPR_FLOATING_LITERAL
A FloatingLiteral record.
Definition: ASTBitCodes.h:1590
@ STMT_NULL_PTR
A NULL expression.
Definition: ASTBitCodes.h:1512
@ STMT_DEFAULT
A DefaultStmt record.
Definition: ASTBitCodes.h:1527
@ EXPR_CHOOSE
A ChooseExpr record.
Definition: ASTBitCodes.h:1680
@ STMT_NULL
A NullStmt record.
Definition: ASTBitCodes.h:1518
@ EXPR_BLOCK
BlockExpr.
Definition: ASTBitCodes.h:1698
@ EXPR_DECL_REF
A DeclRefExpr record.
Definition: ASTBitCodes.h:1584
@ EXPR_INIT_LIST
An InitListExpr record.
Definition: ASTBitCodes.h:1650
@ EXPR_IMPLICIT_VALUE_INIT
An ImplicitValueInitExpr record.
Definition: ASTBitCodes.h:1668
@ STMT_OBJC_AUTORELEASE_POOL
An ObjCAutoreleasePoolStmt record.
Definition: ASTBitCodes.h:1770
@ EXPR_RECOVERY
A RecoveryExpr record.
Definition: ASTBitCodes.h:1710
@ EXPR_PAREN
A ParenExpr record.
Definition: ASTBitCodes.h:1602
@ STMT_OMP_TARGET_PARALLEL_GENERIC_LOOP_DIRECTIVE
Definition: ASTBitCodes.h:1972
@ STMT_LABEL
A LabelStmt record.
Definition: ASTBitCodes.h:1530
@ EXPR_CXX_FUNCTIONAL_CAST
A CXXFunctionalCastExpr record.
Definition: ASTBitCodes.h:1823
@ EXPR_USER_DEFINED_LITERAL
A UserDefinedLiteral record.
Definition: ASTBitCodes.h:1829
@ EXPR_INTEGER_LITERAL
An IntegerLiteral record.
Definition: ASTBitCodes.h:1587
@ EXPR_SOURCE_LOC
A SourceLocExpr record.
Definition: ASTBitCodes.h:1686
@ EXPR_CXX_MEMBER_CALL
A CXXMemberCallExpr record.
Definition: ASTBitCodes.h:1793
@ STMT_SWITCH
A SwitchStmt record.
Definition: ASTBitCodes.h:1539
@ STMT_DECL
A DeclStmt record.
Definition: ASTBitCodes.h:1566
@ EXPR_OBJC_KVC_REF_EXPR
UNUSED.
Definition: ASTBitCodes.h:1740
@ EXPR_SUBST_NON_TYPE_TEMPLATE_PARM_PACK
Definition: ASTBitCodes.h:1874
@ STMT_OMP_MASKED_TASKLOOP_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1945
@ EXPR_SIZEOF_ALIGN_OF
A SizefAlignOfExpr record.
Definition: ASTBitCodes.h:1614
@ STMT_BREAK
A BreakStmt record.
Definition: ASTBitCodes.h:1560
@ STMT_OBJC_AT_THROW
An ObjCAtThrowStmt record.
Definition: ASTBitCodes.h:1767
@ EXPR_ADDR_LABEL
An AddrLabelExpr record.
Definition: ASTBitCodes.h:1674
@ STMT_CXX_FOR_RANGE
A CXXForRangeStmt record.
Definition: ASTBitCodes.h:1787
@ EXPR_CXX_ADDRSPACE_CAST
A CXXAddrspaceCastExpr record.
Definition: ASTBitCodes.h:1820
@ EXPR_ARRAY_SUBSCRIPT
An ArraySubscriptExpr record.
Definition: ASTBitCodes.h:1617
@ EXPR_UNARY_OPERATOR
A UnaryOperator record.
Definition: ASTBitCodes.h:1608
@ STMT_CXX_CATCH
A CXXCatchStmt record.
Definition: ASTBitCodes.h:1781
@ EXPR_BUILTIN_PP_EMBED
A EmbedExpr record.
Definition: ASTBitCodes.h:1689
@ STMT_INDIRECT_GOTO
An IndirectGotoStmt record.
Definition: ASTBitCodes.h:1554
@ DESIG_ARRAY_RANGE
GNU array range designator.
Definition: ASTBitCodes.h:2014
@ DESIG_FIELD_NAME
Field designator where only the field name is known.
Definition: ASTBitCodes.h:2004
@ DESIG_FIELD_DECL
Field designator where the field has been resolved to a declaration.
Definition: ASTBitCodes.h:2008
@ DESIG_ARRAY
Array designator.
Definition: ASTBitCodes.h:2011
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:149
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:132
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:123
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