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