clang  12.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 
14 #include "clang/AST/ASTConcept.h"
15 #include "clang/AST/ASTContext.h"
16 #include "clang/AST/AttrIterator.h"
17 #include "clang/AST/Decl.h"
19 #include "clang/AST/DeclCXX.h"
20 #include "clang/AST/DeclGroup.h"
21 #include "clang/AST/DeclObjC.h"
22 #include "clang/AST/DeclTemplate.h"
25 #include "clang/AST/Expr.h"
26 #include "clang/AST/ExprCXX.h"
27 #include "clang/AST/ExprObjC.h"
28 #include "clang/AST/ExprOpenMP.h"
30 #include "clang/AST/OpenMPClause.h"
32 #include "clang/AST/Stmt.h"
33 #include "clang/AST/StmtCXX.h"
34 #include "clang/AST/StmtObjC.h"
35 #include "clang/AST/StmtOpenMP.h"
36 #include "clang/AST/StmtVisitor.h"
37 #include "clang/AST/TemplateBase.h"
38 #include "clang/AST/Type.h"
42 #include "clang/Basic/LLVM.h"
43 #include "clang/Basic/Lambda.h"
48 #include "clang/Basic/Specifiers.h"
49 #include "clang/Basic/TypeTraits.h"
50 #include "clang/Lex/Token.h"
53 #include "llvm/ADT/BitmaskEnum.h"
54 #include "llvm/ADT/DenseMap.h"
55 #include "llvm/ADT/SmallString.h"
56 #include "llvm/ADT/SmallVector.h"
57 #include "llvm/ADT/StringRef.h"
58 #include "llvm/Bitstream/BitstreamReader.h"
59 #include "llvm/Support/Casting.h"
60 #include "llvm/Support/ErrorHandling.h"
61 #include <algorithm>
62 #include <cassert>
63 #include <cstdint>
64 #include <string>
65 
66 using namespace clang;
67 using namespace serialization;
68 
69 namespace clang {
70 
71  class ASTStmtReader : public StmtVisitor<ASTStmtReader> {
72  ASTRecordReader &Record;
73  llvm::BitstreamCursor &DeclsCursor;
74 
75  SourceLocation readSourceLocation() {
76  return Record.readSourceLocation();
77  }
78 
79  SourceRange readSourceRange() {
80  return Record.readSourceRange();
81  }
82 
83  std::string readString() {
84  return Record.readString();
85  }
86 
87  TypeSourceInfo *readTypeSourceInfo() {
88  return Record.readTypeSourceInfo();
89  }
90 
91  Decl *readDecl() {
92  return Record.readDecl();
93  }
94 
95  template<typename T>
96  T *readDeclAs() {
97  return Record.readDeclAs<T>();
98  }
99 
100  public:
101  ASTStmtReader(ASTRecordReader &Record, llvm::BitstreamCursor &Cursor)
102  : Record(Record), DeclsCursor(Cursor) {}
103 
104  /// The number of record fields required for the Stmt class
105  /// itself.
106  static const unsigned NumStmtFields = 0;
107 
108  /// The number of record fields required for the Expr class
109  /// itself.
110  static const unsigned NumExprFields =
111  NumStmtFields + llvm::BitWidth<ExprDependence> + 3;
112 
113  /// Read and initialize a ExplicitTemplateArgumentList structure.
114  void ReadTemplateKWAndArgsInfo(ASTTemplateKWAndArgsInfo &Args,
115  TemplateArgumentLoc *ArgsLocArray,
116  unsigned NumTemplateArgs);
117 
118  /// Read and initialize a ExplicitTemplateArgumentList structure.
119  void ReadExplicitTemplateArgumentList(ASTTemplateArgumentListInfo &ArgList,
120  unsigned NumTemplateArgs);
121 
122  void VisitStmt(Stmt *S);
123 #define STMT(Type, Base) \
124  void Visit##Type(Type *);
125 #include "clang/AST/StmtNodes.inc"
126  };
127 
128 } // namespace clang
129 
131  TemplateArgumentLoc *ArgsLocArray,
132  unsigned NumTemplateArgs) {
133  SourceLocation TemplateKWLoc = readSourceLocation();
134  TemplateArgumentListInfo ArgInfo;
135  ArgInfo.setLAngleLoc(readSourceLocation());
136  ArgInfo.setRAngleLoc(readSourceLocation());
137  for (unsigned i = 0; i != NumTemplateArgs; ++i)
138  ArgInfo.addArgument(Record.readTemplateArgumentLoc());
139  Args.initializeFrom(TemplateKWLoc, ArgInfo, ArgsLocArray);
140 }
141 
143  assert(Record.getIdx() == NumStmtFields && "Incorrect statement field count");
144 }
145 
146 void ASTStmtReader::VisitNullStmt(NullStmt *S) {
147  VisitStmt(S);
148  S->setSemiLoc(readSourceLocation());
149  S->NullStmtBits.HasLeadingEmptyMacro = Record.readInt();
150 }
151 
152 void ASTStmtReader::VisitCompoundStmt(CompoundStmt *S) {
153  VisitStmt(S);
155  unsigned NumStmts = Record.readInt();
156  while (NumStmts--)
157  Stmts.push_back(Record.readSubStmt());
158  S->setStmts(Stmts);
159  S->CompoundStmtBits.LBraceLoc = readSourceLocation();
160  S->RBraceLoc = readSourceLocation();
161 }
162 
163 void ASTStmtReader::VisitSwitchCase(SwitchCase *S) {
164  VisitStmt(S);
165  Record.recordSwitchCaseID(S, Record.readInt());
166  S->setKeywordLoc(readSourceLocation());
167  S->setColonLoc(readSourceLocation());
168 }
169 
170 void ASTStmtReader::VisitCaseStmt(CaseStmt *S) {
171  VisitSwitchCase(S);
172  bool CaseStmtIsGNURange = Record.readInt();
173  S->setLHS(Record.readSubExpr());
174  S->setSubStmt(Record.readSubStmt());
175  if (CaseStmtIsGNURange) {
176  S->setRHS(Record.readSubExpr());
177  S->setEllipsisLoc(readSourceLocation());
178  }
179 }
180 
181 void ASTStmtReader::VisitDefaultStmt(DefaultStmt *S) {
182  VisitSwitchCase(S);
183  S->setSubStmt(Record.readSubStmt());
184 }
185 
186 void ASTStmtReader::VisitLabelStmt(LabelStmt *S) {
187  VisitStmt(S);
188  auto *LD = readDeclAs<LabelDecl>();
189  LD->setStmt(S);
190  S->setDecl(LD);
191  S->setSubStmt(Record.readSubStmt());
192  S->setIdentLoc(readSourceLocation());
193 }
194 
195 void ASTStmtReader::VisitAttributedStmt(AttributedStmt *S) {
196  VisitStmt(S);
197  // NumAttrs in AttributedStmt is set when creating an empty
198  // AttributedStmt in AttributedStmt::CreateEmpty, since it is needed
199  // to allocate the right amount of space for the trailing Attr *.
200  uint64_t NumAttrs = Record.readInt();
201  AttrVec Attrs;
202  Record.readAttributes(Attrs);
203  (void)NumAttrs;
204  assert(NumAttrs == S->AttributedStmtBits.NumAttrs);
205  assert(NumAttrs == Attrs.size());
206  std::copy(Attrs.begin(), Attrs.end(), S->getAttrArrayPtr());
207  S->SubStmt = Record.readSubStmt();
208  S->AttributedStmtBits.AttrLoc = readSourceLocation();
209 }
210 
211 void ASTStmtReader::VisitIfStmt(IfStmt *S) {
212  VisitStmt(S);
213 
214  S->setConstexpr(Record.readInt());
215  bool HasElse = Record.readInt();
216  bool HasVar = Record.readInt();
217  bool HasInit = Record.readInt();
218 
219  S->setCond(Record.readSubExpr());
220  S->setThen(Record.readSubStmt());
221  if (HasElse)
222  S->setElse(Record.readSubStmt());
223  if (HasVar)
224  S->setConditionVariable(Record.getContext(), readDeclAs<VarDecl>());
225  if (HasInit)
226  S->setInit(Record.readSubStmt());
227 
228  S->setIfLoc(readSourceLocation());
229  if (HasElse)
230  S->setElseLoc(readSourceLocation());
231 }
232 
233 void ASTStmtReader::VisitSwitchStmt(SwitchStmt *S) {
234  VisitStmt(S);
235 
236  bool HasInit = Record.readInt();
237  bool HasVar = Record.readInt();
238  bool AllEnumCasesCovered = Record.readInt();
239  if (AllEnumCasesCovered)
241 
242  S->setCond(Record.readSubExpr());
243  S->setBody(Record.readSubStmt());
244  if (HasInit)
245  S->setInit(Record.readSubStmt());
246  if (HasVar)
247  S->setConditionVariable(Record.getContext(), readDeclAs<VarDecl>());
248 
249  S->setSwitchLoc(readSourceLocation());
250 
251  SwitchCase *PrevSC = nullptr;
252  for (auto E = Record.size(); Record.getIdx() != E; ) {
253  SwitchCase *SC = Record.getSwitchCaseWithID(Record.readInt());
254  if (PrevSC)
255  PrevSC->setNextSwitchCase(SC);
256  else
257  S->setSwitchCaseList(SC);
258 
259  PrevSC = SC;
260  }
261 }
262 
263 void ASTStmtReader::VisitWhileStmt(WhileStmt *S) {
264  VisitStmt(S);
265 
266  bool HasVar = Record.readInt();
267 
268  S->setCond(Record.readSubExpr());
269  S->setBody(Record.readSubStmt());
270  if (HasVar)
271  S->setConditionVariable(Record.getContext(), readDeclAs<VarDecl>());
272 
273  S->setWhileLoc(readSourceLocation());
274  S->setLParenLoc(readSourceLocation());
275  S->setRParenLoc(readSourceLocation());
276 }
277 
278 void ASTStmtReader::VisitDoStmt(DoStmt *S) {
279  VisitStmt(S);
280  S->setCond(Record.readSubExpr());
281  S->setBody(Record.readSubStmt());
282  S->setDoLoc(readSourceLocation());
283  S->setWhileLoc(readSourceLocation());
284  S->setRParenLoc(readSourceLocation());
285 }
286 
287 void ASTStmtReader::VisitForStmt(ForStmt *S) {
288  VisitStmt(S);
289  S->setInit(Record.readSubStmt());
290  S->setCond(Record.readSubExpr());
291  S->setConditionVariable(Record.getContext(), readDeclAs<VarDecl>());
292  S->setInc(Record.readSubExpr());
293  S->setBody(Record.readSubStmt());
294  S->setForLoc(readSourceLocation());
295  S->setLParenLoc(readSourceLocation());
296  S->setRParenLoc(readSourceLocation());
297 }
298 
299 void ASTStmtReader::VisitGotoStmt(GotoStmt *S) {
300  VisitStmt(S);
301  S->setLabel(readDeclAs<LabelDecl>());
302  S->setGotoLoc(readSourceLocation());
303  S->setLabelLoc(readSourceLocation());
304 }
305 
306 void ASTStmtReader::VisitIndirectGotoStmt(IndirectGotoStmt *S) {
307  VisitStmt(S);
308  S->setGotoLoc(readSourceLocation());
309  S->setStarLoc(readSourceLocation());
310  S->setTarget(Record.readSubExpr());
311 }
312 
313 void ASTStmtReader::VisitContinueStmt(ContinueStmt *S) {
314  VisitStmt(S);
315  S->setContinueLoc(readSourceLocation());
316 }
317 
318 void ASTStmtReader::VisitBreakStmt(BreakStmt *S) {
319  VisitStmt(S);
320  S->setBreakLoc(readSourceLocation());
321 }
322 
323 void ASTStmtReader::VisitReturnStmt(ReturnStmt *S) {
324  VisitStmt(S);
325 
326  bool HasNRVOCandidate = Record.readInt();
327 
328  S->setRetValue(Record.readSubExpr());
329  if (HasNRVOCandidate)
330  S->setNRVOCandidate(readDeclAs<VarDecl>());
331 
332  S->setReturnLoc(readSourceLocation());
333 }
334 
335 void ASTStmtReader::VisitDeclStmt(DeclStmt *S) {
336  VisitStmt(S);
337  S->setStartLoc(readSourceLocation());
338  S->setEndLoc(readSourceLocation());
339 
340  if (Record.size() - Record.getIdx() == 1) {
341  // Single declaration
342  S->setDeclGroup(DeclGroupRef(readDecl()));
343  } else {
345  int N = Record.size() - Record.getIdx();
346  Decls.reserve(N);
347  for (int I = 0; I < N; ++I)
348  Decls.push_back(readDecl());
349  S->setDeclGroup(DeclGroupRef(DeclGroup::Create(Record.getContext(),
350  Decls.data(),
351  Decls.size())));
352  }
353 }
354 
355 void ASTStmtReader::VisitAsmStmt(AsmStmt *S) {
356  VisitStmt(S);
357  S->NumOutputs = Record.readInt();
358  S->NumInputs = Record.readInt();
359  S->NumClobbers = Record.readInt();
360  S->setAsmLoc(readSourceLocation());
361  S->setVolatile(Record.readInt());
362  S->setSimple(Record.readInt());
363 }
364 
365 void ASTStmtReader::VisitGCCAsmStmt(GCCAsmStmt *S) {
366  VisitAsmStmt(S);
367  S->NumLabels = Record.readInt();
368  S->setRParenLoc(readSourceLocation());
369  S->setAsmString(cast_or_null<StringLiteral>(Record.readSubStmt()));
370 
371  unsigned NumOutputs = S->getNumOutputs();
372  unsigned NumInputs = S->getNumInputs();
373  unsigned NumClobbers = S->getNumClobbers();
374  unsigned NumLabels = S->getNumLabels();
375 
376  // Outputs and inputs
380  for (unsigned I = 0, N = NumOutputs + NumInputs; I != N; ++I) {
381  Names.push_back(Record.readIdentifier());
382  Constraints.push_back(cast_or_null<StringLiteral>(Record.readSubStmt()));
383  Exprs.push_back(Record.readSubStmt());
384  }
385 
386  // Constraints
388  for (unsigned I = 0; I != NumClobbers; ++I)
389  Clobbers.push_back(cast_or_null<StringLiteral>(Record.readSubStmt()));
390 
391  // Labels
392  for (unsigned I = 0, N = NumLabels; I != N; ++I)
393  Exprs.push_back(Record.readSubStmt());
394 
395  S->setOutputsAndInputsAndClobbers(Record.getContext(),
396  Names.data(), Constraints.data(),
397  Exprs.data(), NumOutputs, NumInputs,
398  NumLabels,
399  Clobbers.data(), NumClobbers);
400 }
401 
402 void ASTStmtReader::VisitMSAsmStmt(MSAsmStmt *S) {
403  VisitAsmStmt(S);
404  S->LBraceLoc = readSourceLocation();
405  S->EndLoc = readSourceLocation();
406  S->NumAsmToks = Record.readInt();
407  std::string AsmStr = readString();
408 
409  // Read the tokens.
410  SmallVector<Token, 16> AsmToks;
411  AsmToks.reserve(S->NumAsmToks);
412  for (unsigned i = 0, e = S->NumAsmToks; i != e; ++i) {
413  AsmToks.push_back(Record.readToken());
414  }
415 
416  // The calls to reserve() for the FooData vectors are mandatory to
417  // prevent dead StringRefs in the Foo vectors.
418 
419  // Read the clobbers.
420  SmallVector<std::string, 16> ClobbersData;
422  ClobbersData.reserve(S->NumClobbers);
423  Clobbers.reserve(S->NumClobbers);
424  for (unsigned i = 0, e = S->NumClobbers; i != e; ++i) {
425  ClobbersData.push_back(readString());
426  Clobbers.push_back(ClobbersData.back());
427  }
428 
429  // Read the operands.
430  unsigned NumOperands = S->NumOutputs + S->NumInputs;
432  SmallVector<std::string, 16> ConstraintsData;
433  SmallVector<StringRef, 16> Constraints;
434  Exprs.reserve(NumOperands);
435  ConstraintsData.reserve(NumOperands);
436  Constraints.reserve(NumOperands);
437  for (unsigned i = 0; i != NumOperands; ++i) {
438  Exprs.push_back(cast<Expr>(Record.readSubStmt()));
439  ConstraintsData.push_back(readString());
440  Constraints.push_back(ConstraintsData.back());
441  }
442 
443  S->initialize(Record.getContext(), AsmStr, AsmToks,
444  Constraints, Exprs, Clobbers);
445 }
446 
447 void ASTStmtReader::VisitCoroutineBodyStmt(CoroutineBodyStmt *S) {
448  VisitStmt(S);
449  assert(Record.peekInt() == S->NumParams);
450  Record.skipInts(1);
451  auto *StoredStmts = S->getStoredStmts();
452  for (unsigned i = 0;
453  i < CoroutineBodyStmt::SubStmt::FirstParamMove + S->NumParams; ++i)
454  StoredStmts[i] = Record.readSubStmt();
455 }
456 
457 void ASTStmtReader::VisitCoreturnStmt(CoreturnStmt *S) {
458  VisitStmt(S);
459  S->CoreturnLoc = Record.readSourceLocation();
460  for (auto &SubStmt: S->SubStmts)
461  SubStmt = Record.readSubStmt();
462  S->IsImplicit = Record.readInt() != 0;
463 }
464 
465 void ASTStmtReader::VisitCoawaitExpr(CoawaitExpr *E) {
466  VisitExpr(E);
467  E->KeywordLoc = readSourceLocation();
468  for (auto &SubExpr: E->SubExprs)
469  SubExpr = Record.readSubStmt();
470  E->OpaqueValue = cast_or_null<OpaqueValueExpr>(Record.readSubStmt());
471  E->setIsImplicit(Record.readInt() != 0);
472 }
473 
474 void ASTStmtReader::VisitCoyieldExpr(CoyieldExpr *E) {
475  VisitExpr(E);
476  E->KeywordLoc = readSourceLocation();
477  for (auto &SubExpr: E->SubExprs)
478  SubExpr = Record.readSubStmt();
479  E->OpaqueValue = cast_or_null<OpaqueValueExpr>(Record.readSubStmt());
480 }
481 
482 void ASTStmtReader::VisitDependentCoawaitExpr(DependentCoawaitExpr *E) {
483  VisitExpr(E);
484  E->KeywordLoc = readSourceLocation();
485  for (auto &SubExpr: E->SubExprs)
486  SubExpr = Record.readSubStmt();
487 }
488 
489 void ASTStmtReader::VisitCapturedStmt(CapturedStmt *S) {
490  VisitStmt(S);
491  Record.skipInts(1);
492  S->setCapturedDecl(readDeclAs<CapturedDecl>());
493  S->setCapturedRegionKind(static_cast<CapturedRegionKind>(Record.readInt()));
494  S->setCapturedRecordDecl(readDeclAs<RecordDecl>());
495 
496  // Capture inits
498  E = S->capture_init_end();
499  I != E; ++I)
500  *I = Record.readSubExpr();
501 
502  // Body
503  S->setCapturedStmt(Record.readSubStmt());
505 
506  // Captures
507  for (auto &I : S->captures()) {
508  I.VarAndKind.setPointer(readDeclAs<VarDecl>());
509  I.VarAndKind.setInt(
510  static_cast<CapturedStmt::VariableCaptureKind>(Record.readInt()));
511  I.Loc = readSourceLocation();
512  }
513 }
514 
515 void ASTStmtReader::VisitExpr(Expr *E) {
516  VisitStmt(E);
517  E->setType(Record.readType());
518 
519  // FIXME: write and read all DependentFlags with a single call.
520  bool TypeDependent = Record.readInt();
521  bool ValueDependent = Record.readInt();
522  bool InstantiationDependent = Record.readInt();
523  bool ContainsUnexpandedTemplateParameters = Record.readInt();
524  bool ContainsErrors = Record.readInt();
525  auto Deps = ExprDependence::None;
526  if (TypeDependent)
527  Deps |= ExprDependence::Type;
528  if (ValueDependent)
529  Deps |= ExprDependence::Value;
530  if (InstantiationDependent)
531  Deps |= ExprDependence::Instantiation;
532  if (ContainsUnexpandedTemplateParameters)
533  Deps |= ExprDependence::UnexpandedPack;
534  if (ContainsErrors)
535  Deps |= ExprDependence::Error;
536  E->setDependence(Deps);
537 
538  E->setValueKind(static_cast<ExprValueKind>(Record.readInt()));
539  E->setObjectKind(static_cast<ExprObjectKind>(Record.readInt()));
540  assert(Record.getIdx() == NumExprFields &&
541  "Incorrect expression field count");
542 }
543 
544 void ASTStmtReader::VisitConstantExpr(ConstantExpr *E) {
545  VisitExpr(E);
546 
547  auto StorageKind = Record.readInt();
548  assert(E->ConstantExprBits.ResultKind == StorageKind && "Wrong ResultKind!");
549 
550  E->ConstantExprBits.APValueKind = Record.readInt();
551  E->ConstantExprBits.IsUnsigned = Record.readInt();
552  E->ConstantExprBits.BitWidth = Record.readInt();
553  E->ConstantExprBits.HasCleanup = false; // Not serialized, see below.
554  E->ConstantExprBits.IsImmediateInvocation = Record.readInt();
555 
556  switch (StorageKind) {
558  break;
559 
561  E->Int64Result() = Record.readInt();
562  break;
563 
565  E->APValueResult() = Record.readAPValue();
566  if (E->APValueResult().needsCleanup()) {
567  E->ConstantExprBits.HasCleanup = true;
568  Record.getContext().addDestruction(&E->APValueResult());
569  }
570  break;
571  default:
572  llvm_unreachable("unexpected ResultKind!");
573  }
574 
575  E->setSubExpr(Record.readSubExpr());
576 }
577 
578 void ASTStmtReader::VisitPredefinedExpr(PredefinedExpr *E) {
579  VisitExpr(E);
580  bool HasFunctionName = Record.readInt();
581  E->PredefinedExprBits.HasFunctionName = HasFunctionName;
582  E->PredefinedExprBits.Kind = Record.readInt();
583  E->setLocation(readSourceLocation());
584  if (HasFunctionName)
585  E->setFunctionName(cast<StringLiteral>(Record.readSubExpr()));
586 }
587 
588 void ASTStmtReader::VisitDeclRefExpr(DeclRefExpr *E) {
589  VisitExpr(E);
590 
591  E->DeclRefExprBits.HasQualifier = Record.readInt();
592  E->DeclRefExprBits.HasFoundDecl = Record.readInt();
593  E->DeclRefExprBits.HasTemplateKWAndArgsInfo = Record.readInt();
594  E->DeclRefExprBits.HadMultipleCandidates = Record.readInt();
595  E->DeclRefExprBits.RefersToEnclosingVariableOrCapture = Record.readInt();
596  E->DeclRefExprBits.NonOdrUseReason = Record.readInt();
597  unsigned NumTemplateArgs = 0;
598  if (E->hasTemplateKWAndArgsInfo())
599  NumTemplateArgs = Record.readInt();
600 
601  if (E->hasQualifier())
602  new (E->getTrailingObjects<NestedNameSpecifierLoc>())
603  NestedNameSpecifierLoc(Record.readNestedNameSpecifierLoc());
604 
605  if (E->hasFoundDecl())
606  *E->getTrailingObjects<NamedDecl *>() = readDeclAs<NamedDecl>();
607 
608  if (E->hasTemplateKWAndArgsInfo())
609  ReadTemplateKWAndArgsInfo(
610  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
611  E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs);
612 
613  E->setDecl(readDeclAs<ValueDecl>());
614  E->setLocation(readSourceLocation());
615  E->DNLoc = Record.readDeclarationNameLoc(E->getDecl()->getDeclName());
616 }
617 
618 void ASTStmtReader::VisitIntegerLiteral(IntegerLiteral *E) {
619  VisitExpr(E);
620  E->setLocation(readSourceLocation());
621  E->setValue(Record.getContext(), Record.readAPInt());
622 }
623 
624 void ASTStmtReader::VisitFixedPointLiteral(FixedPointLiteral *E) {
625  VisitExpr(E);
626  E->setLocation(readSourceLocation());
627  E->setScale(Record.readInt());
628  E->setValue(Record.getContext(), Record.readAPInt());
629 }
630 
631 void ASTStmtReader::VisitFloatingLiteral(FloatingLiteral *E) {
632  VisitExpr(E);
633  E->setRawSemantics(
634  static_cast<llvm::APFloatBase::Semantics>(Record.readInt()));
635  E->setExact(Record.readInt());
636  E->setValue(Record.getContext(), Record.readAPFloat(E->getSemantics()));
637  E->setLocation(readSourceLocation());
638 }
639 
640 void ASTStmtReader::VisitImaginaryLiteral(ImaginaryLiteral *E) {
641  VisitExpr(E);
642  E->setSubExpr(Record.readSubExpr());
643 }
644 
645 void ASTStmtReader::VisitStringLiteral(StringLiteral *E) {
646  VisitExpr(E);
647 
648  // NumConcatenated, Length and CharByteWidth are set by the empty
649  // ctor since they are needed to allocate storage for the trailing objects.
650  unsigned NumConcatenated = Record.readInt();
651  unsigned Length = Record.readInt();
652  unsigned CharByteWidth = Record.readInt();
653  assert((NumConcatenated == E->getNumConcatenated()) &&
654  "Wrong number of concatenated tokens!");
655  assert((Length == E->getLength()) && "Wrong Length!");
656  assert((CharByteWidth == E->getCharByteWidth()) && "Wrong character width!");
657  E->StringLiteralBits.Kind = Record.readInt();
658  E->StringLiteralBits.IsPascal = Record.readInt();
659 
660  // The character width is originally computed via mapCharByteWidth.
661  // Check that the deserialized character width is consistant with the result
662  // of calling mapCharByteWidth.
663  assert((CharByteWidth ==
664  StringLiteral::mapCharByteWidth(Record.getContext().getTargetInfo(),
665  E->getKind())) &&
666  "Wrong character width!");
667 
668  // Deserialize the trailing array of SourceLocation.
669  for (unsigned I = 0; I < NumConcatenated; ++I)
670  E->setStrTokenLoc(I, readSourceLocation());
671 
672  // Deserialize the trailing array of char holding the string data.
673  char *StrData = E->getStrDataAsChar();
674  for (unsigned I = 0; I < Length * CharByteWidth; ++I)
675  StrData[I] = Record.readInt();
676 }
677 
678 void ASTStmtReader::VisitCharacterLiteral(CharacterLiteral *E) {
679  VisitExpr(E);
680  E->setValue(Record.readInt());
681  E->setLocation(readSourceLocation());
682  E->setKind(static_cast<CharacterLiteral::CharacterKind>(Record.readInt()));
683 }
684 
685 void ASTStmtReader::VisitParenExpr(ParenExpr *E) {
686  VisitExpr(E);
687  E->setLParen(readSourceLocation());
688  E->setRParen(readSourceLocation());
689  E->setSubExpr(Record.readSubExpr());
690 }
691 
692 void ASTStmtReader::VisitParenListExpr(ParenListExpr *E) {
693  VisitExpr(E);
694  unsigned NumExprs = Record.readInt();
695  assert((NumExprs == E->getNumExprs()) && "Wrong NumExprs!");
696  for (unsigned I = 0; I != NumExprs; ++I)
697  E->getTrailingObjects<Stmt *>()[I] = Record.readSubStmt();
698  E->LParenLoc = readSourceLocation();
699  E->RParenLoc = readSourceLocation();
700 }
701 
702 void ASTStmtReader::VisitUnaryOperator(UnaryOperator *E) {
703  VisitExpr(E);
704  bool hasFP_Features = Record.readInt();
705  assert(hasFP_Features == E->hasStoredFPFeatures());
706  E->setSubExpr(Record.readSubExpr());
707  E->setOpcode((UnaryOperator::Opcode)Record.readInt());
708  E->setOperatorLoc(readSourceLocation());
709  E->setCanOverflow(Record.readInt());
710  if (hasFP_Features)
711  E->setStoredFPFeatures(FPOptionsOverride(Record.readInt()));
712 }
713 
714 void ASTStmtReader::VisitOffsetOfExpr(OffsetOfExpr *E) {
715  VisitExpr(E);
716  assert(E->getNumComponents() == Record.peekInt());
717  Record.skipInts(1);
718  assert(E->getNumExpressions() == Record.peekInt());
719  Record.skipInts(1);
720  E->setOperatorLoc(readSourceLocation());
721  E->setRParenLoc(readSourceLocation());
722  E->setTypeSourceInfo(readTypeSourceInfo());
723  for (unsigned I = 0, N = E->getNumComponents(); I != N; ++I) {
724  auto Kind = static_cast<OffsetOfNode::Kind>(Record.readInt());
725  SourceLocation Start = readSourceLocation();
726  SourceLocation End = readSourceLocation();
727  switch (Kind) {
728  case OffsetOfNode::Array:
729  E->setComponent(I, OffsetOfNode(Start, Record.readInt(), End));
730  break;
731 
732  case OffsetOfNode::Field:
733  E->setComponent(
734  I, OffsetOfNode(Start, readDeclAs<FieldDecl>(), End));
735  break;
736 
738  E->setComponent(
739  I,
740  OffsetOfNode(Start, Record.readIdentifier(), End));
741  break;
742 
743  case OffsetOfNode::Base: {
744  auto *Base = new (Record.getContext()) CXXBaseSpecifier();
745  *Base = Record.readCXXBaseSpecifier();
747  break;
748  }
749  }
750  }
751 
752  for (unsigned I = 0, N = E->getNumExpressions(); I != N; ++I)
753  E->setIndexExpr(I, Record.readSubExpr());
754 }
755 
756 void ASTStmtReader::VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *E) {
757  VisitExpr(E);
758  E->setKind(static_cast<UnaryExprOrTypeTrait>(Record.readInt()));
759  if (Record.peekInt() == 0) {
760  E->setArgument(Record.readSubExpr());
761  Record.skipInts(1);
762  } else {
763  E->setArgument(readTypeSourceInfo());
764  }
765  E->setOperatorLoc(readSourceLocation());
766  E->setRParenLoc(readSourceLocation());
767 }
768 
771  ConstraintSatisfaction Satisfaction;
772  Satisfaction.IsSatisfied = Record.readInt();
773  if (!Satisfaction.IsSatisfied) {
774  unsigned NumDetailRecords = Record.readInt();
775  for (unsigned i = 0; i != NumDetailRecords; ++i) {
776  Expr *ConstraintExpr = Record.readExpr();
777  if (/* IsDiagnostic */Record.readInt()) {
778  SourceLocation DiagLocation = Record.readSourceLocation();
779  std::string DiagMessage = Record.readString();
780  Satisfaction.Details.emplace_back(
781  ConstraintExpr, new (Record.getContext())
783  DiagLocation, DiagMessage});
784  } else
785  Satisfaction.Details.emplace_back(ConstraintExpr, Record.readExpr());
786  }
787  }
788  return Satisfaction;
789 }
790 
791 void ASTStmtReader::VisitConceptSpecializationExpr(
793  VisitExpr(E);
794  unsigned NumTemplateArgs = Record.readInt();
795  E->NestedNameSpec = Record.readNestedNameSpecifierLoc();
796  E->TemplateKWLoc = Record.readSourceLocation();
797  E->ConceptName = Record.readDeclarationNameInfo();
798  E->NamedConcept = readDeclAs<ConceptDecl>();
799  E->FoundDecl = Record.readDeclAs<NamedDecl>();
800  E->ArgsAsWritten = Record.readASTTemplateArgumentListInfo();
802  for (unsigned I = 0; I < NumTemplateArgs; ++I)
803  Args.push_back(Record.readTemplateArgument());
804  E->setTemplateArguments(Args);
805  E->Satisfaction = E->isValueDependent() ? nullptr :
806  ASTConstraintSatisfaction::Create(Record.getContext(),
808 }
809 
812  std::string SubstitutedEntity = Record.readString();
813  SourceLocation DiagLoc = Record.readSourceLocation();
814  std::string DiagMessage = Record.readString();
815  return new (Record.getContext())
816  concepts::Requirement::SubstitutionDiagnostic{SubstitutedEntity, DiagLoc,
817  DiagMessage};
818 }
819 
820 void ASTStmtReader::VisitRequiresExpr(RequiresExpr *E) {
821  VisitExpr(E);
822  unsigned NumLocalParameters = Record.readInt();
823  unsigned NumRequirements = Record.readInt();
824  E->RequiresExprBits.RequiresKWLoc = Record.readSourceLocation();
825  E->RequiresExprBits.IsSatisfied = Record.readInt();
826  E->Body = Record.readDeclAs<RequiresExprBodyDecl>();
827  llvm::SmallVector<ParmVarDecl *, 4> LocalParameters;
828  for (unsigned i = 0; i < NumLocalParameters; ++i)
829  LocalParameters.push_back(cast<ParmVarDecl>(Record.readDecl()));
830  std::copy(LocalParameters.begin(), LocalParameters.end(),
831  E->getTrailingObjects<ParmVarDecl *>());
833  for (unsigned i = 0; i < NumRequirements; ++i) {
834  auto RK =
835  static_cast<concepts::Requirement::RequirementKind>(Record.readInt());
836  concepts::Requirement *R = nullptr;
837  switch (RK) {
839  auto Status =
841  Record.readInt());
843  R = new (Record.getContext())
845  else
846  R = new (Record.getContext())
847  concepts::TypeRequirement(Record.readTypeSourceInfo());
848  } break;
851  auto Status =
853  Record.readInt());
855  Expr *> E;
857  E = readSubstitutionDiagnostic(Record);
858  } else
859  E = Record.readExpr();
860 
862  ConceptSpecializationExpr *SubstitutedConstraintExpr = nullptr;
863  SourceLocation NoexceptLoc;
865  Req.emplace();
866  } else {
867  NoexceptLoc = Record.readSourceLocation();
868  switch (/* returnTypeRequirementKind */Record.readInt()) {
869  case 0:
870  // No return type requirement.
871  Req.emplace();
872  break;
873  case 1: {
874  // type-constraint
875  TemplateParameterList *TPL = Record.readTemplateParameterList();
876  if (Status >=
878  SubstitutedConstraintExpr =
879  cast<ConceptSpecializationExpr>(Record.readExpr());
880  Req.emplace(TPL);
881  } break;
882  case 2:
883  // Substitution failure
884  Req.emplace(readSubstitutionDiagnostic(Record));
885  break;
886  }
887  }
888  if (Expr *Ex = E.dyn_cast<Expr *>())
889  R = new (Record.getContext()) concepts::ExprRequirement(
890  Ex, RK == concepts::Requirement::RK_Simple, NoexceptLoc,
891  std::move(*Req), Status, SubstitutedConstraintExpr);
892  else
893  R = new (Record.getContext()) concepts::ExprRequirement(
894  E.get<concepts::Requirement::SubstitutionDiagnostic *>(),
895  RK == concepts::Requirement::RK_Simple, NoexceptLoc,
896  std::move(*Req));
897  } break;
899  if (/* IsSubstitutionDiagnostic */Record.readInt()) {
900  R = new (Record.getContext()) concepts::NestedRequirement(
902  break;
903  }
904  Expr *E = Record.readExpr();
905  if (E->isInstantiationDependent())
906  R = new (Record.getContext()) concepts::NestedRequirement(E);
907  else
908  R = new (Record.getContext())
909  concepts::NestedRequirement(Record.getContext(), E,
911  } break;
912  }
913  if (!R)
914  continue;
915  Requirements.push_back(R);
916  }
917  std::copy(Requirements.begin(), Requirements.end(),
918  E->getTrailingObjects<concepts::Requirement *>());
919  E->RBraceLoc = Record.readSourceLocation();
920 }
921 
922 void ASTStmtReader::VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
923  VisitExpr(E);
924  E->setLHS(Record.readSubExpr());
925  E->setRHS(Record.readSubExpr());
926  E->setRBracketLoc(readSourceLocation());
927 }
928 
929 void ASTStmtReader::VisitMatrixSubscriptExpr(MatrixSubscriptExpr *E) {
930  VisitExpr(E);
931  E->setBase(Record.readSubExpr());
932  E->setRowIdx(Record.readSubExpr());
933  E->setColumnIdx(Record.readSubExpr());
934  E->setRBracketLoc(readSourceLocation());
935 }
936 
937 void ASTStmtReader::VisitOMPArraySectionExpr(OMPArraySectionExpr *E) {
938  VisitExpr(E);
939  E->setBase(Record.readSubExpr());
940  E->setLowerBound(Record.readSubExpr());
941  E->setLength(Record.readSubExpr());
942  E->setStride(Record.readSubExpr());
943  E->setColonLocFirst(readSourceLocation());
944  E->setColonLocSecond(readSourceLocation());
945  E->setRBracketLoc(readSourceLocation());
946 }
947 
948 void ASTStmtReader::VisitOMPArrayShapingExpr(OMPArrayShapingExpr *E) {
949  VisitExpr(E);
950  unsigned NumDims = Record.readInt();
951  E->setBase(Record.readSubExpr());
952  SmallVector<Expr *, 4> Dims(NumDims);
953  for (unsigned I = 0; I < NumDims; ++I)
954  Dims[I] = Record.readSubExpr();
955  E->setDimensions(Dims);
956  SmallVector<SourceRange, 4> SRs(NumDims);
957  for (unsigned I = 0; I < NumDims; ++I)
958  SRs[I] = readSourceRange();
959  E->setBracketsRanges(SRs);
960  E->setLParenLoc(readSourceLocation());
961  E->setRParenLoc(readSourceLocation());
962 }
963 
964 void ASTStmtReader::VisitOMPIteratorExpr(OMPIteratorExpr *E) {
965  VisitExpr(E);
966  unsigned NumIters = Record.readInt();
967  E->setIteratorKwLoc(readSourceLocation());
968  E->setLParenLoc(readSourceLocation());
969  E->setRParenLoc(readSourceLocation());
970  for (unsigned I = 0; I < NumIters; ++I) {
971  E->setIteratorDeclaration(I, Record.readDeclRef());
972  E->setAssignmentLoc(I, readSourceLocation());
973  Expr *Begin = Record.readSubExpr();
974  Expr *End = Record.readSubExpr();
975  Expr *Step = Record.readSubExpr();
976  SourceLocation ColonLoc = readSourceLocation();
977  SourceLocation SecColonLoc;
978  if (Step)
979  SecColonLoc = readSourceLocation();
980  E->setIteratorRange(I, Begin, ColonLoc, End, SecColonLoc, Step);
981  // Deserialize helpers
983  HD.CounterVD = cast_or_null<VarDecl>(Record.readDeclRef());
984  HD.Upper = Record.readSubExpr();
985  HD.Update = Record.readSubExpr();
986  HD.CounterUpdate = Record.readSubExpr();
987  E->setHelper(I, HD);
988  }
989 }
990 
991 void ASTStmtReader::VisitCallExpr(CallExpr *E) {
992  VisitExpr(E);
993  unsigned NumArgs = Record.readInt();
994  assert((NumArgs == E->getNumArgs()) && "Wrong NumArgs!");
995  E->setRParenLoc(readSourceLocation());
996  E->setCallee(Record.readSubExpr());
997  for (unsigned I = 0; I != NumArgs; ++I)
998  E->setArg(I, Record.readSubExpr());
999  E->setADLCallKind(static_cast<CallExpr::ADLCallKind>(Record.readInt()));
1000 }
1001 
1002 void ASTStmtReader::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) {
1003  VisitCallExpr(E);
1004 }
1005 
1006 void ASTStmtReader::VisitMemberExpr(MemberExpr *E) {
1007  VisitExpr(E);
1008 
1009  bool HasQualifier = Record.readInt();
1010  bool HasFoundDecl = Record.readInt();
1011  bool HasTemplateInfo = Record.readInt();
1012  unsigned NumTemplateArgs = Record.readInt();
1013 
1014  E->Base = Record.readSubExpr();
1015  E->MemberDecl = Record.readDeclAs<ValueDecl>();
1016  E->MemberDNLoc = Record.readDeclarationNameLoc(E->MemberDecl->getDeclName());
1017  E->MemberLoc = Record.readSourceLocation();
1018  E->MemberExprBits.IsArrow = Record.readInt();
1019  E->MemberExprBits.HasQualifierOrFoundDecl = HasQualifier || HasFoundDecl;
1020  E->MemberExprBits.HasTemplateKWAndArgsInfo = HasTemplateInfo;
1021  E->MemberExprBits.HadMultipleCandidates = Record.readInt();
1022  E->MemberExprBits.NonOdrUseReason = Record.readInt();
1023  E->MemberExprBits.OperatorLoc = Record.readSourceLocation();
1024 
1025  if (HasQualifier || HasFoundDecl) {
1026  DeclAccessPair FoundDecl;
1027  if (HasFoundDecl) {
1028  auto *FoundD = Record.readDeclAs<NamedDecl>();
1029  auto AS = (AccessSpecifier)Record.readInt();
1030  FoundDecl = DeclAccessPair::make(FoundD, AS);
1031  } else {
1032  FoundDecl = DeclAccessPair::make(E->MemberDecl,
1033  E->MemberDecl->getAccess());
1034  }
1035  E->getTrailingObjects<MemberExprNameQualifier>()->FoundDecl = FoundDecl;
1036 
1037  NestedNameSpecifierLoc QualifierLoc;
1038  if (HasQualifier)
1039  QualifierLoc = Record.readNestedNameSpecifierLoc();
1040  E->getTrailingObjects<MemberExprNameQualifier>()->QualifierLoc =
1041  QualifierLoc;
1042  }
1043 
1044  if (HasTemplateInfo)
1045  ReadTemplateKWAndArgsInfo(
1046  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
1047  E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs);
1048 }
1049 
1050 void ASTStmtReader::VisitObjCIsaExpr(ObjCIsaExpr *E) {
1051  VisitExpr(E);
1052  E->setBase(Record.readSubExpr());
1053  E->setIsaMemberLoc(readSourceLocation());
1054  E->setOpLoc(readSourceLocation());
1055  E->setArrow(Record.readInt());
1056 }
1057 
1058 void ASTStmtReader::
1059 VisitObjCIndirectCopyRestoreExpr(ObjCIndirectCopyRestoreExpr *E) {
1060  VisitExpr(E);
1061  E->Operand = Record.readSubExpr();
1062  E->setShouldCopy(Record.readInt());
1063 }
1064 
1065 void ASTStmtReader::VisitObjCBridgedCastExpr(ObjCBridgedCastExpr *E) {
1066  VisitExplicitCastExpr(E);
1067  E->LParenLoc = readSourceLocation();
1068  E->BridgeKeywordLoc = readSourceLocation();
1069  E->Kind = Record.readInt();
1070 }
1071 
1072 void ASTStmtReader::VisitCastExpr(CastExpr *E) {
1073  VisitExpr(E);
1074  unsigned NumBaseSpecs = Record.readInt();
1075  assert(NumBaseSpecs == E->path_size());
1076  E->setSubExpr(Record.readSubExpr());
1077  E->setCastKind((CastKind)Record.readInt());
1078  CastExpr::path_iterator BaseI = E->path_begin();
1079  while (NumBaseSpecs--) {
1080  auto *BaseSpec = new (Record.getContext()) CXXBaseSpecifier;
1081  *BaseSpec = Record.readCXXBaseSpecifier();
1082  *BaseI++ = BaseSpec;
1083  }
1084 }
1085 
1086 void ASTStmtReader::VisitBinaryOperator(BinaryOperator *E) {
1087  bool hasFP_Features;
1089  VisitExpr(E);
1090  E->setHasStoredFPFeatures(hasFP_Features = Record.readInt());
1091  E->setOpcode(opc = (BinaryOperator::Opcode)Record.readInt());
1092  E->setLHS(Record.readSubExpr());
1093  E->setRHS(Record.readSubExpr());
1094  E->setOperatorLoc(readSourceLocation());
1095  if (hasFP_Features)
1096  E->setStoredFPFeatures(FPOptionsOverride(Record.readInt()));
1097 }
1098 
1099 void ASTStmtReader::VisitCompoundAssignOperator(CompoundAssignOperator *E) {
1100  VisitBinaryOperator(E);
1101  E->setComputationLHSType(Record.readType());
1102  E->setComputationResultType(Record.readType());
1103 }
1104 
1105 void ASTStmtReader::VisitConditionalOperator(ConditionalOperator *E) {
1106  VisitExpr(E);
1107  E->SubExprs[ConditionalOperator::COND] = Record.readSubExpr();
1108  E->SubExprs[ConditionalOperator::LHS] = Record.readSubExpr();
1109  E->SubExprs[ConditionalOperator::RHS] = Record.readSubExpr();
1110  E->QuestionLoc = readSourceLocation();
1111  E->ColonLoc = readSourceLocation();
1112 }
1113 
1114 void
1115 ASTStmtReader::VisitBinaryConditionalOperator(BinaryConditionalOperator *E) {
1116  VisitExpr(E);
1117  E->OpaqueValue = cast<OpaqueValueExpr>(Record.readSubExpr());
1118  E->SubExprs[BinaryConditionalOperator::COMMON] = Record.readSubExpr();
1119  E->SubExprs[BinaryConditionalOperator::COND] = Record.readSubExpr();
1120  E->SubExprs[BinaryConditionalOperator::LHS] = Record.readSubExpr();
1121  E->SubExprs[BinaryConditionalOperator::RHS] = Record.readSubExpr();
1122  E->QuestionLoc = readSourceLocation();
1123  E->ColonLoc = readSourceLocation();
1124 }
1125 
1126 void ASTStmtReader::VisitImplicitCastExpr(ImplicitCastExpr *E) {
1127  VisitCastExpr(E);
1128  E->setIsPartOfExplicitCast(Record.readInt());
1129 }
1130 
1131 void ASTStmtReader::VisitExplicitCastExpr(ExplicitCastExpr *E) {
1132  VisitCastExpr(E);
1133  E->setTypeInfoAsWritten(readTypeSourceInfo());
1134 }
1135 
1136 void ASTStmtReader::VisitCStyleCastExpr(CStyleCastExpr *E) {
1137  VisitExplicitCastExpr(E);
1138  E->setLParenLoc(readSourceLocation());
1139  E->setRParenLoc(readSourceLocation());
1140 }
1141 
1142 void ASTStmtReader::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
1143  VisitExpr(E);
1144  E->setLParenLoc(readSourceLocation());
1145  E->setTypeSourceInfo(readTypeSourceInfo());
1146  E->setInitializer(Record.readSubExpr());
1147  E->setFileScope(Record.readInt());
1148 }
1149 
1150 void ASTStmtReader::VisitExtVectorElementExpr(ExtVectorElementExpr *E) {
1151  VisitExpr(E);
1152  E->setBase(Record.readSubExpr());
1153  E->setAccessor(Record.readIdentifier());
1154  E->setAccessorLoc(readSourceLocation());
1155 }
1156 
1157 void ASTStmtReader::VisitInitListExpr(InitListExpr *E) {
1158  VisitExpr(E);
1159  if (auto *SyntForm = cast_or_null<InitListExpr>(Record.readSubStmt()))
1160  E->setSyntacticForm(SyntForm);
1161  E->setLBraceLoc(readSourceLocation());
1162  E->setRBraceLoc(readSourceLocation());
1163  bool isArrayFiller = Record.readInt();
1164  Expr *filler = nullptr;
1165  if (isArrayFiller) {
1166  filler = Record.readSubExpr();
1167  E->ArrayFillerOrUnionFieldInit = filler;
1168  } else
1169  E->ArrayFillerOrUnionFieldInit = readDeclAs<FieldDecl>();
1170  E->sawArrayRangeDesignator(Record.readInt());
1171  unsigned NumInits = Record.readInt();
1172  E->reserveInits(Record.getContext(), NumInits);
1173  if (isArrayFiller) {
1174  for (unsigned I = 0; I != NumInits; ++I) {
1175  Expr *init = Record.readSubExpr();
1176  E->updateInit(Record.getContext(), I, init ? init : filler);
1177  }
1178  } else {
1179  for (unsigned I = 0; I != NumInits; ++I)
1180  E->updateInit(Record.getContext(), I, Record.readSubExpr());
1181  }
1182 }
1183 
1184 void ASTStmtReader::VisitDesignatedInitExpr(DesignatedInitExpr *E) {
1186 
1187  VisitExpr(E);
1188  unsigned NumSubExprs = Record.readInt();
1189  assert(NumSubExprs == E->getNumSubExprs() && "Wrong number of subexprs");
1190  for (unsigned I = 0; I != NumSubExprs; ++I)
1191  E->setSubExpr(I, Record.readSubExpr());
1192  E->setEqualOrColonLoc(readSourceLocation());
1193  E->setGNUSyntax(Record.readInt());
1194 
1195  SmallVector<Designator, 4> Designators;
1196  while (Record.getIdx() < Record.size()) {
1197  switch ((DesignatorTypes)Record.readInt()) {
1198  case DESIG_FIELD_DECL: {
1199  auto *Field = readDeclAs<FieldDecl>();
1200  SourceLocation DotLoc = readSourceLocation();
1201  SourceLocation FieldLoc = readSourceLocation();
1202  Designators.push_back(Designator(Field->getIdentifier(), DotLoc,
1203  FieldLoc));
1204  Designators.back().setField(Field);
1205  break;
1206  }
1207 
1208  case DESIG_FIELD_NAME: {
1209  const IdentifierInfo *Name = Record.readIdentifier();
1210  SourceLocation DotLoc = readSourceLocation();
1211  SourceLocation FieldLoc = readSourceLocation();
1212  Designators.push_back(Designator(Name, DotLoc, FieldLoc));
1213  break;
1214  }
1215 
1216  case DESIG_ARRAY: {
1217  unsigned Index = Record.readInt();
1218  SourceLocation LBracketLoc = readSourceLocation();
1219  SourceLocation RBracketLoc = readSourceLocation();
1220  Designators.push_back(Designator(Index, LBracketLoc, RBracketLoc));
1221  break;
1222  }
1223 
1224  case DESIG_ARRAY_RANGE: {
1225  unsigned Index = Record.readInt();
1226  SourceLocation LBracketLoc = readSourceLocation();
1227  SourceLocation EllipsisLoc = readSourceLocation();
1228  SourceLocation RBracketLoc = readSourceLocation();
1229  Designators.push_back(Designator(Index, LBracketLoc, EllipsisLoc,
1230  RBracketLoc));
1231  break;
1232  }
1233  }
1234  }
1235  E->setDesignators(Record.getContext(),
1236  Designators.data(), Designators.size());
1237 }
1238 
1239 void ASTStmtReader::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) {
1240  VisitExpr(E);
1241  E->setBase(Record.readSubExpr());
1242  E->setUpdater(Record.readSubExpr());
1243 }
1244 
1245 void ASTStmtReader::VisitNoInitExpr(NoInitExpr *E) {
1246  VisitExpr(E);
1247 }
1248 
1249 void ASTStmtReader::VisitArrayInitLoopExpr(ArrayInitLoopExpr *E) {
1250  VisitExpr(E);
1251  E->SubExprs[0] = Record.readSubExpr();
1252  E->SubExprs[1] = Record.readSubExpr();
1253 }
1254 
1255 void ASTStmtReader::VisitArrayInitIndexExpr(ArrayInitIndexExpr *E) {
1256  VisitExpr(E);
1257 }
1258 
1259 void ASTStmtReader::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) {
1260  VisitExpr(E);
1261 }
1262 
1263 void ASTStmtReader::VisitVAArgExpr(VAArgExpr *E) {
1264  VisitExpr(E);
1265  E->setSubExpr(Record.readSubExpr());
1266  E->setWrittenTypeInfo(readTypeSourceInfo());
1267  E->setBuiltinLoc(readSourceLocation());
1268  E->setRParenLoc(readSourceLocation());
1269  E->setIsMicrosoftABI(Record.readInt());
1270 }
1271 
1272 void ASTStmtReader::VisitSourceLocExpr(SourceLocExpr *E) {
1273  VisitExpr(E);
1274  E->ParentContext = readDeclAs<DeclContext>();
1275  E->BuiltinLoc = readSourceLocation();
1276  E->RParenLoc = readSourceLocation();
1277  E->SourceLocExprBits.Kind =
1278  static_cast<SourceLocExpr::IdentKind>(Record.readInt());
1279 }
1280 
1281 void ASTStmtReader::VisitAddrLabelExpr(AddrLabelExpr *E) {
1282  VisitExpr(E);
1283  E->setAmpAmpLoc(readSourceLocation());
1284  E->setLabelLoc(readSourceLocation());
1285  E->setLabel(readDeclAs<LabelDecl>());
1286 }
1287 
1288 void ASTStmtReader::VisitStmtExpr(StmtExpr *E) {
1289  VisitExpr(E);
1290  E->setLParenLoc(readSourceLocation());
1291  E->setRParenLoc(readSourceLocation());
1292  E->setSubStmt(cast_or_null<CompoundStmt>(Record.readSubStmt()));
1293  E->StmtExprBits.TemplateDepth = Record.readInt();
1294 }
1295 
1296 void ASTStmtReader::VisitChooseExpr(ChooseExpr *E) {
1297  VisitExpr(E);
1298  E->setCond(Record.readSubExpr());
1299  E->setLHS(Record.readSubExpr());
1300  E->setRHS(Record.readSubExpr());
1301  E->setBuiltinLoc(readSourceLocation());
1302  E->setRParenLoc(readSourceLocation());
1303  E->setIsConditionTrue(Record.readInt());
1304 }
1305 
1306 void ASTStmtReader::VisitGNUNullExpr(GNUNullExpr *E) {
1307  VisitExpr(E);
1308  E->setTokenLocation(readSourceLocation());
1309 }
1310 
1311 void ASTStmtReader::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
1312  VisitExpr(E);
1314  unsigned NumExprs = Record.readInt();
1315  while (NumExprs--)
1316  Exprs.push_back(Record.readSubExpr());
1317  E->setExprs(Record.getContext(), Exprs);
1318  E->setBuiltinLoc(readSourceLocation());
1319  E->setRParenLoc(readSourceLocation());
1320 }
1321 
1322 void ASTStmtReader::VisitConvertVectorExpr(ConvertVectorExpr *E) {
1323  VisitExpr(E);
1324  E->BuiltinLoc = readSourceLocation();
1325  E->RParenLoc = readSourceLocation();
1326  E->TInfo = readTypeSourceInfo();
1327  E->SrcExpr = Record.readSubExpr();
1328 }
1329 
1330 void ASTStmtReader::VisitBlockExpr(BlockExpr *E) {
1331  VisitExpr(E);
1332  E->setBlockDecl(readDeclAs<BlockDecl>());
1333 }
1334 
1335 void ASTStmtReader::VisitGenericSelectionExpr(GenericSelectionExpr *E) {
1336  VisitExpr(E);
1337 
1338  unsigned NumAssocs = Record.readInt();
1339  assert(NumAssocs == E->getNumAssocs() && "Wrong NumAssocs!");
1340  E->ResultIndex = Record.readInt();
1341  E->GenericSelectionExprBits.GenericLoc = readSourceLocation();
1342  E->DefaultLoc = readSourceLocation();
1343  E->RParenLoc = readSourceLocation();
1344 
1345  Stmt **Stmts = E->getTrailingObjects<Stmt *>();
1346  // Add 1 to account for the controlling expression which is the first
1347  // expression in the trailing array of Stmt *. This is not needed for
1348  // the trailing array of TypeSourceInfo *.
1349  for (unsigned I = 0, N = NumAssocs + 1; I < N; ++I)
1350  Stmts[I] = Record.readSubExpr();
1351 
1352  TypeSourceInfo **TSIs = E->getTrailingObjects<TypeSourceInfo *>();
1353  for (unsigned I = 0, N = NumAssocs; I < N; ++I)
1354  TSIs[I] = readTypeSourceInfo();
1355 }
1356 
1357 void ASTStmtReader::VisitPseudoObjectExpr(PseudoObjectExpr *E) {
1358  VisitExpr(E);
1359  unsigned numSemanticExprs = Record.readInt();
1360  assert(numSemanticExprs + 1 == E->PseudoObjectExprBits.NumSubExprs);
1361  E->PseudoObjectExprBits.ResultIndex = Record.readInt();
1362 
1363  // Read the syntactic expression.
1364  E->getSubExprsBuffer()[0] = Record.readSubExpr();
1365 
1366  // Read all the semantic expressions.
1367  for (unsigned i = 0; i != numSemanticExprs; ++i) {
1368  Expr *subExpr = Record.readSubExpr();
1369  E->getSubExprsBuffer()[i+1] = subExpr;
1370  }
1371 }
1372 
1373 void ASTStmtReader::VisitAtomicExpr(AtomicExpr *E) {
1374  VisitExpr(E);
1375  E->Op = AtomicExpr::AtomicOp(Record.readInt());
1376  E->NumSubExprs = AtomicExpr::getNumSubExprs(E->Op);
1377  for (unsigned I = 0; I != E->NumSubExprs; ++I)
1378  E->SubExprs[I] = Record.readSubExpr();
1379  E->BuiltinLoc = readSourceLocation();
1380  E->RParenLoc = readSourceLocation();
1381 }
1382 
1383 //===----------------------------------------------------------------------===//
1384 // Objective-C Expressions and Statements
1385 
1386 void ASTStmtReader::VisitObjCStringLiteral(ObjCStringLiteral *E) {
1387  VisitExpr(E);
1388  E->setString(cast<StringLiteral>(Record.readSubStmt()));
1389  E->setAtLoc(readSourceLocation());
1390 }
1391 
1392 void ASTStmtReader::VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
1393  VisitExpr(E);
1394  // could be one of several IntegerLiteral, FloatLiteral, etc.
1395  E->SubExpr = Record.readSubStmt();
1396  E->BoxingMethod = readDeclAs<ObjCMethodDecl>();
1397  E->Range = readSourceRange();
1398 }
1399 
1400 void ASTStmtReader::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
1401  VisitExpr(E);
1402  unsigned NumElements = Record.readInt();
1403  assert(NumElements == E->getNumElements() && "Wrong number of elements");
1404  Expr **Elements = E->getElements();
1405  for (unsigned I = 0, N = NumElements; I != N; ++I)
1406  Elements[I] = Record.readSubExpr();
1407  E->ArrayWithObjectsMethod = readDeclAs<ObjCMethodDecl>();
1408  E->Range = readSourceRange();
1409 }
1410 
1411 void ASTStmtReader::VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *E) {
1412  VisitExpr(E);
1413  unsigned NumElements = Record.readInt();
1414  assert(NumElements == E->getNumElements() && "Wrong number of elements");
1415  bool HasPackExpansions = Record.readInt();
1416  assert(HasPackExpansions == E->HasPackExpansions &&"Pack expansion mismatch");
1417  auto *KeyValues =
1418  E->getTrailingObjects<ObjCDictionaryLiteral::KeyValuePair>();
1419  auto *Expansions =
1420  E->getTrailingObjects<ObjCDictionaryLiteral::ExpansionData>();
1421  for (unsigned I = 0; I != NumElements; ++I) {
1422  KeyValues[I].Key = Record.readSubExpr();
1423  KeyValues[I].Value = Record.readSubExpr();
1424  if (HasPackExpansions) {
1425  Expansions[I].EllipsisLoc = readSourceLocation();
1426  Expansions[I].NumExpansionsPlusOne = Record.readInt();
1427  }
1428  }
1429  E->DictWithObjectsMethod = readDeclAs<ObjCMethodDecl>();
1430  E->Range = readSourceRange();
1431 }
1432 
1433 void ASTStmtReader::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
1434  VisitExpr(E);
1435  E->setEncodedTypeSourceInfo(readTypeSourceInfo());
1436  E->setAtLoc(readSourceLocation());
1437  E->setRParenLoc(readSourceLocation());
1438 }
1439 
1440 void ASTStmtReader::VisitObjCSelectorExpr(ObjCSelectorExpr *E) {
1441  VisitExpr(E);
1442  E->setSelector(Record.readSelector());
1443  E->setAtLoc(readSourceLocation());
1444  E->setRParenLoc(readSourceLocation());
1445 }
1446 
1447 void ASTStmtReader::VisitObjCProtocolExpr(ObjCProtocolExpr *E) {
1448  VisitExpr(E);
1449  E->setProtocol(readDeclAs<ObjCProtocolDecl>());
1450  E->setAtLoc(readSourceLocation());
1451  E->ProtoLoc = readSourceLocation();
1452  E->setRParenLoc(readSourceLocation());
1453 }
1454 
1455 void ASTStmtReader::VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) {
1456  VisitExpr(E);
1457  E->setDecl(readDeclAs<ObjCIvarDecl>());
1458  E->setLocation(readSourceLocation());
1459  E->setOpLoc(readSourceLocation());
1460  E->setBase(Record.readSubExpr());
1461  E->setIsArrow(Record.readInt());
1462  E->setIsFreeIvar(Record.readInt());
1463 }
1464 
1465 void ASTStmtReader::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
1466  VisitExpr(E);
1467  unsigned MethodRefFlags = Record.readInt();
1468  bool Implicit = Record.readInt() != 0;
1469  if (Implicit) {
1470  auto *Getter = readDeclAs<ObjCMethodDecl>();
1471  auto *Setter = readDeclAs<ObjCMethodDecl>();
1472  E->setImplicitProperty(Getter, Setter, MethodRefFlags);
1473  } else {
1474  E->setExplicitProperty(readDeclAs<ObjCPropertyDecl>(), MethodRefFlags);
1475  }
1476  E->setLocation(readSourceLocation());
1477  E->setReceiverLocation(readSourceLocation());
1478  switch (Record.readInt()) {
1479  case 0:
1480  E->setBase(Record.readSubExpr());
1481  break;
1482  case 1:
1483  E->setSuperReceiver(Record.readType());
1484  break;
1485  case 2:
1486  E->setClassReceiver(readDeclAs<ObjCInterfaceDecl>());
1487  break;
1488  }
1489 }
1490 
1491 void ASTStmtReader::VisitObjCSubscriptRefExpr(ObjCSubscriptRefExpr *E) {
1492  VisitExpr(E);
1493  E->setRBracket(readSourceLocation());
1494  E->setBaseExpr(Record.readSubExpr());
1495  E->setKeyExpr(Record.readSubExpr());
1496  E->GetAtIndexMethodDecl = readDeclAs<ObjCMethodDecl>();
1497  E->SetAtIndexMethodDecl = readDeclAs<ObjCMethodDecl>();
1498 }
1499 
1500 void ASTStmtReader::VisitObjCMessageExpr(ObjCMessageExpr *E) {
1501  VisitExpr(E);
1502  assert(Record.peekInt() == E->getNumArgs());
1503  Record.skipInts(1);
1504  unsigned NumStoredSelLocs = Record.readInt();
1505  E->SelLocsKind = Record.readInt();
1506  E->setDelegateInitCall(Record.readInt());
1507  E->IsImplicit = Record.readInt();
1508  auto Kind = static_cast<ObjCMessageExpr::ReceiverKind>(Record.readInt());
1509  switch (Kind) {
1511  E->setInstanceReceiver(Record.readSubExpr());
1512  break;
1513 
1515  E->setClassReceiver(readTypeSourceInfo());
1516  break;
1517 
1520  QualType T = Record.readType();
1521  SourceLocation SuperLoc = readSourceLocation();
1522  E->setSuper(SuperLoc, T, Kind == ObjCMessageExpr::SuperInstance);
1523  break;
1524  }
1525  }
1526 
1527  assert(Kind == E->getReceiverKind());
1528 
1529  if (Record.readInt())
1530  E->setMethodDecl(readDeclAs<ObjCMethodDecl>());
1531  else
1532  E->setSelector(Record.readSelector());
1533 
1534  E->LBracLoc = readSourceLocation();
1535  E->RBracLoc = readSourceLocation();
1536 
1537  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1538  E->setArg(I, Record.readSubExpr());
1539 
1540  SourceLocation *Locs = E->getStoredSelLocs();
1541  for (unsigned I = 0; I != NumStoredSelLocs; ++I)
1542  Locs[I] = readSourceLocation();
1543 }
1544 
1545 void ASTStmtReader::VisitObjCForCollectionStmt(ObjCForCollectionStmt *S) {
1546  VisitStmt(S);
1547  S->setElement(Record.readSubStmt());
1548  S->setCollection(Record.readSubExpr());
1549  S->setBody(Record.readSubStmt());
1550  S->setForLoc(readSourceLocation());
1551  S->setRParenLoc(readSourceLocation());
1552 }
1553 
1554 void ASTStmtReader::VisitObjCAtCatchStmt(ObjCAtCatchStmt *S) {
1555  VisitStmt(S);
1556  S->setCatchBody(Record.readSubStmt());
1557  S->setCatchParamDecl(readDeclAs<VarDecl>());
1558  S->setAtCatchLoc(readSourceLocation());
1559  S->setRParenLoc(readSourceLocation());
1560 }
1561 
1562 void ASTStmtReader::VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S) {
1563  VisitStmt(S);
1564  S->setFinallyBody(Record.readSubStmt());
1565  S->setAtFinallyLoc(readSourceLocation());
1566 }
1567 
1568 void ASTStmtReader::VisitObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S) {
1569  VisitStmt(S); // FIXME: no test coverage.
1570  S->setSubStmt(Record.readSubStmt());
1571  S->setAtLoc(readSourceLocation());
1572 }
1573 
1574 void ASTStmtReader::VisitObjCAtTryStmt(ObjCAtTryStmt *S) {
1575  VisitStmt(S);
1576  assert(Record.peekInt() == S->getNumCatchStmts());
1577  Record.skipInts(1);
1578  bool HasFinally = Record.readInt();
1579  S->setTryBody(Record.readSubStmt());
1580  for (unsigned I = 0, N = S->getNumCatchStmts(); I != N; ++I)
1581  S->setCatchStmt(I, cast_or_null<ObjCAtCatchStmt>(Record.readSubStmt()));
1582 
1583  if (HasFinally)
1584  S->setFinallyStmt(Record.readSubStmt());
1585  S->setAtTryLoc(readSourceLocation());
1586 }
1587 
1588 void ASTStmtReader::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
1589  VisitStmt(S); // FIXME: no test coverage.
1590  S->setSynchExpr(Record.readSubStmt());
1591  S->setSynchBody(Record.readSubStmt());
1592  S->setAtSynchronizedLoc(readSourceLocation());
1593 }
1594 
1595 void ASTStmtReader::VisitObjCAtThrowStmt(ObjCAtThrowStmt *S) {
1596  VisitStmt(S); // FIXME: no test coverage.
1597  S->setThrowExpr(Record.readSubStmt());
1598  S->setThrowLoc(readSourceLocation());
1599 }
1600 
1601 void ASTStmtReader::VisitObjCBoolLiteralExpr(ObjCBoolLiteralExpr *E) {
1602  VisitExpr(E);
1603  E->setValue(Record.readInt());
1604  E->setLocation(readSourceLocation());
1605 }
1606 
1607 void ASTStmtReader::VisitObjCAvailabilityCheckExpr(ObjCAvailabilityCheckExpr *E) {
1608  VisitExpr(E);
1609  SourceRange R = Record.readSourceRange();
1610  E->AtLoc = R.getBegin();
1611  E->RParen = R.getEnd();
1612  E->VersionToCheck = Record.readVersionTuple();
1613 }
1614 
1615 //===----------------------------------------------------------------------===//
1616 // C++ Expressions and Statements
1617 //===----------------------------------------------------------------------===//
1618 
1619 void ASTStmtReader::VisitCXXCatchStmt(CXXCatchStmt *S) {
1620  VisitStmt(S);
1621  S->CatchLoc = readSourceLocation();
1622  S->ExceptionDecl = readDeclAs<VarDecl>();
1623  S->HandlerBlock = Record.readSubStmt();
1624 }
1625 
1626 void ASTStmtReader::VisitCXXTryStmt(CXXTryStmt *S) {
1627  VisitStmt(S);
1628  assert(Record.peekInt() == S->getNumHandlers() && "NumStmtFields is wrong ?");
1629  Record.skipInts(1);
1630  S->TryLoc = readSourceLocation();
1631  S->getStmts()[0] = Record.readSubStmt();
1632  for (unsigned i = 0, e = S->getNumHandlers(); i != e; ++i)
1633  S->getStmts()[i + 1] = Record.readSubStmt();
1634 }
1635 
1636 void ASTStmtReader::VisitCXXForRangeStmt(CXXForRangeStmt *S) {
1637  VisitStmt(S);
1638  S->ForLoc = readSourceLocation();
1639  S->CoawaitLoc = readSourceLocation();
1640  S->ColonLoc = readSourceLocation();
1641  S->RParenLoc = readSourceLocation();
1642  S->setInit(Record.readSubStmt());
1643  S->setRangeStmt(Record.readSubStmt());
1644  S->setBeginStmt(Record.readSubStmt());
1645  S->setEndStmt(Record.readSubStmt());
1646  S->setCond(Record.readSubExpr());
1647  S->setInc(Record.readSubExpr());
1648  S->setLoopVarStmt(Record.readSubStmt());
1649  S->setBody(Record.readSubStmt());
1650 }
1651 
1652 void ASTStmtReader::VisitMSDependentExistsStmt(MSDependentExistsStmt *S) {
1653  VisitStmt(S);
1654  S->KeywordLoc = readSourceLocation();
1655  S->IsIfExists = Record.readInt();
1656  S->QualifierLoc = Record.readNestedNameSpecifierLoc();
1657  S->NameInfo = Record.readDeclarationNameInfo();
1658  S->SubStmt = Record.readSubStmt();
1659 }
1660 
1661 void ASTStmtReader::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
1662  VisitCallExpr(E);
1663  E->CXXOperatorCallExprBits.OperatorKind = Record.readInt();
1664  E->Range = Record.readSourceRange();
1665  E->setFPFeatures(FPOptionsOverride(Record.readInt()));
1666 }
1667 
1668 void ASTStmtReader::VisitCXXRewrittenBinaryOperator(
1670  VisitExpr(E);
1671  E->CXXRewrittenBinaryOperatorBits.IsReversed = Record.readInt();
1672  E->SemanticForm = Record.readSubExpr();
1673 }
1674 
1675 void ASTStmtReader::VisitCXXConstructExpr(CXXConstructExpr *E) {
1676  VisitExpr(E);
1677 
1678  unsigned NumArgs = Record.readInt();
1679  assert((NumArgs == E->getNumArgs()) && "Wrong NumArgs!");
1680 
1681  E->CXXConstructExprBits.Elidable = Record.readInt();
1682  E->CXXConstructExprBits.HadMultipleCandidates = Record.readInt();
1683  E->CXXConstructExprBits.ListInitialization = Record.readInt();
1684  E->CXXConstructExprBits.StdInitListInitialization = Record.readInt();
1685  E->CXXConstructExprBits.ZeroInitialization = Record.readInt();
1686  E->CXXConstructExprBits.ConstructionKind = Record.readInt();
1687  E->CXXConstructExprBits.Loc = readSourceLocation();
1688  E->Constructor = readDeclAs<CXXConstructorDecl>();
1689  E->ParenOrBraceRange = readSourceRange();
1690 
1691  for (unsigned I = 0; I != NumArgs; ++I)
1692  E->setArg(I, Record.readSubExpr());
1693 }
1694 
1695 void ASTStmtReader::VisitCXXInheritedCtorInitExpr(CXXInheritedCtorInitExpr *E) {
1696  VisitExpr(E);
1697  E->Constructor = readDeclAs<CXXConstructorDecl>();
1698  E->Loc = readSourceLocation();
1699  E->ConstructsVirtualBase = Record.readInt();
1700  E->InheritedFromVirtualBase = Record.readInt();
1701 }
1702 
1703 void ASTStmtReader::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
1704  VisitCXXConstructExpr(E);
1705  E->TSI = readTypeSourceInfo();
1706 }
1707 
1708 void ASTStmtReader::VisitLambdaExpr(LambdaExpr *E) {
1709  VisitExpr(E);
1710  unsigned NumCaptures = Record.readInt();
1711  (void)NumCaptures;
1712  assert(NumCaptures == E->LambdaExprBits.NumCaptures);
1713  E->IntroducerRange = readSourceRange();
1714  E->LambdaExprBits.CaptureDefault = Record.readInt();
1715  E->CaptureDefaultLoc = readSourceLocation();
1716  E->LambdaExprBits.ExplicitParams = Record.readInt();
1717  E->LambdaExprBits.ExplicitResultType = Record.readInt();
1718  E->ClosingBrace = readSourceLocation();
1719 
1720  // Read capture initializers.
1722  CEnd = E->capture_init_end();
1723  C != CEnd; ++C)
1724  *C = Record.readSubExpr();
1725 
1726  // The body will be lazily deserialized when needed from the call operator
1727  // declaration.
1728 }
1729 
1730 void
1731 ASTStmtReader::VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E) {
1732  VisitExpr(E);
1733  E->SubExpr = Record.readSubExpr();
1734 }
1735 
1736 void ASTStmtReader::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) {
1737  VisitExplicitCastExpr(E);
1738  SourceRange R = readSourceRange();
1739  E->Loc = R.getBegin();
1740  E->RParenLoc = R.getEnd();
1741  R = readSourceRange();
1742  E->AngleBrackets = R;
1743 }
1744 
1745 void ASTStmtReader::VisitCXXStaticCastExpr(CXXStaticCastExpr *E) {
1746  return VisitCXXNamedCastExpr(E);
1747 }
1748 
1749 void ASTStmtReader::VisitCXXDynamicCastExpr(CXXDynamicCastExpr *E) {
1750  return VisitCXXNamedCastExpr(E);
1751 }
1752 
1753 void ASTStmtReader::VisitCXXReinterpretCastExpr(CXXReinterpretCastExpr *E) {
1754  return VisitCXXNamedCastExpr(E);
1755 }
1756 
1757 void ASTStmtReader::VisitCXXAddrspaceCastExpr(CXXAddrspaceCastExpr *E) {
1758  return VisitCXXNamedCastExpr(E);
1759 }
1760 
1761 void ASTStmtReader::VisitCXXConstCastExpr(CXXConstCastExpr *E) {
1762  return VisitCXXNamedCastExpr(E);
1763 }
1764 
1765 void ASTStmtReader::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E) {
1766  VisitExplicitCastExpr(E);
1767  E->setLParenLoc(readSourceLocation());
1768  E->setRParenLoc(readSourceLocation());
1769 }
1770 
1771 void ASTStmtReader::VisitBuiltinBitCastExpr(BuiltinBitCastExpr *E) {
1772  VisitExplicitCastExpr(E);
1773  E->KWLoc = readSourceLocation();
1774  E->RParenLoc = readSourceLocation();
1775 }
1776 
1777 void ASTStmtReader::VisitUserDefinedLiteral(UserDefinedLiteral *E) {
1778  VisitCallExpr(E);
1779  E->UDSuffixLoc = readSourceLocation();
1780 }
1781 
1782 void ASTStmtReader::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) {
1783  VisitExpr(E);
1784  E->setValue(Record.readInt());
1785  E->setLocation(readSourceLocation());
1786 }
1787 
1788 void ASTStmtReader::VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E) {
1789  VisitExpr(E);
1790  E->setLocation(readSourceLocation());
1791 }
1792 
1793 void ASTStmtReader::VisitCXXTypeidExpr(CXXTypeidExpr *E) {
1794  VisitExpr(E);
1795  E->setSourceRange(readSourceRange());
1796  if (E->isTypeOperand())
1797  E->Operand = readTypeSourceInfo();
1798  else
1799  E->Operand = Record.readSubExpr();
1800 }
1801 
1802 void ASTStmtReader::VisitCXXThisExpr(CXXThisExpr *E) {
1803  VisitExpr(E);
1804  E->setLocation(readSourceLocation());
1805  E->setImplicit(Record.readInt());
1806 }
1807 
1808 void ASTStmtReader::VisitCXXThrowExpr(CXXThrowExpr *E) {
1809  VisitExpr(E);
1810  E->CXXThrowExprBits.ThrowLoc = readSourceLocation();
1811  E->Operand = Record.readSubExpr();
1812  E->CXXThrowExprBits.IsThrownVariableInScope = Record.readInt();
1813 }
1814 
1815 void ASTStmtReader::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
1816  VisitExpr(E);
1817  E->Param = readDeclAs<ParmVarDecl>();
1818  E->UsedContext = readDeclAs<DeclContext>();
1819  E->CXXDefaultArgExprBits.Loc = readSourceLocation();
1820 }
1821 
1822 void ASTStmtReader::VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E) {
1823  VisitExpr(E);
1824  E->Field = readDeclAs<FieldDecl>();
1825  E->UsedContext = readDeclAs<DeclContext>();
1826  E->CXXDefaultInitExprBits.Loc = readSourceLocation();
1827 }
1828 
1829 void ASTStmtReader::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
1830  VisitExpr(E);
1831  E->setTemporary(Record.readCXXTemporary());
1832  E->setSubExpr(Record.readSubExpr());
1833 }
1834 
1835 void ASTStmtReader::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
1836  VisitExpr(E);
1837  E->TypeInfo = readTypeSourceInfo();
1838  E->CXXScalarValueInitExprBits.RParenLoc = readSourceLocation();
1839 }
1840 
1841 void ASTStmtReader::VisitCXXNewExpr(CXXNewExpr *E) {
1842  VisitExpr(E);
1843 
1844  bool IsArray = Record.readInt();
1845  bool HasInit = Record.readInt();
1846  unsigned NumPlacementArgs = Record.readInt();
1847  bool IsParenTypeId = Record.readInt();
1848 
1849  E->CXXNewExprBits.IsGlobalNew = Record.readInt();
1850  E->CXXNewExprBits.ShouldPassAlignment = Record.readInt();
1851  E->CXXNewExprBits.UsualArrayDeleteWantsSize = Record.readInt();
1852  E->CXXNewExprBits.StoredInitializationStyle = Record.readInt();
1853 
1854  assert((IsArray == E->isArray()) && "Wrong IsArray!");
1855  assert((HasInit == E->hasInitializer()) && "Wrong HasInit!");
1856  assert((NumPlacementArgs == E->getNumPlacementArgs()) &&
1857  "Wrong NumPlacementArgs!");
1858  assert((IsParenTypeId == E->isParenTypeId()) && "Wrong IsParenTypeId!");
1859  (void)IsArray;
1860  (void)HasInit;
1861  (void)NumPlacementArgs;
1862 
1863  E->setOperatorNew(readDeclAs<FunctionDecl>());
1864  E->setOperatorDelete(readDeclAs<FunctionDecl>());
1865  E->AllocatedTypeInfo = readTypeSourceInfo();
1866  if (IsParenTypeId)
1867  E->getTrailingObjects<SourceRange>()[0] = readSourceRange();
1868  E->Range = readSourceRange();
1869  E->DirectInitRange = readSourceRange();
1870 
1871  // Install all the subexpressions.
1873  N = E->raw_arg_end();
1874  I != N; ++I)
1875  *I = Record.readSubStmt();
1876 }
1877 
1878 void ASTStmtReader::VisitCXXDeleteExpr(CXXDeleteExpr *E) {
1879  VisitExpr(E);
1880  E->CXXDeleteExprBits.GlobalDelete = Record.readInt();
1881  E->CXXDeleteExprBits.ArrayForm = Record.readInt();
1882  E->CXXDeleteExprBits.ArrayFormAsWritten = Record.readInt();
1883  E->CXXDeleteExprBits.UsualArrayDeleteWantsSize = Record.readInt();
1884  E->OperatorDelete = readDeclAs<FunctionDecl>();
1885  E->Argument = Record.readSubExpr();
1886  E->CXXDeleteExprBits.Loc = readSourceLocation();
1887 }
1888 
1889 void ASTStmtReader::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
1890  VisitExpr(E);
1891 
1892  E->Base = Record.readSubExpr();
1893  E->IsArrow = Record.readInt();
1894  E->OperatorLoc = readSourceLocation();
1895  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1896  E->ScopeType = readTypeSourceInfo();
1897  E->ColonColonLoc = readSourceLocation();
1898  E->TildeLoc = readSourceLocation();
1899 
1900  IdentifierInfo *II = Record.readIdentifier();
1901  if (II)
1902  E->setDestroyedType(II, readSourceLocation());
1903  else
1904  E->setDestroyedType(readTypeSourceInfo());
1905 }
1906 
1907 void ASTStmtReader::VisitExprWithCleanups(ExprWithCleanups *E) {
1908  VisitExpr(E);
1909 
1910  unsigned NumObjects = Record.readInt();
1911  assert(NumObjects == E->getNumObjects());
1912  for (unsigned i = 0; i != NumObjects; ++i) {
1913  unsigned CleanupKind = Record.readInt();
1915  if (CleanupKind == COK_Block)
1916  Obj = readDeclAs<BlockDecl>();
1917  else if (CleanupKind == COK_CompoundLiteral)
1918  Obj = cast<CompoundLiteralExpr>(Record.readSubExpr());
1919  else
1920  llvm_unreachable("unexpected cleanup object type");
1921  E->getTrailingObjects<ExprWithCleanups::CleanupObject>()[i] = Obj;
1922  }
1923 
1924  E->ExprWithCleanupsBits.CleanupsHaveSideEffects = Record.readInt();
1925  E->SubExpr = Record.readSubExpr();
1926 }
1927 
1928 void ASTStmtReader::VisitCXXDependentScopeMemberExpr(
1930  VisitExpr(E);
1931 
1932  bool HasTemplateKWAndArgsInfo = Record.readInt();
1933  unsigned NumTemplateArgs = Record.readInt();
1934  bool HasFirstQualifierFoundInScope = Record.readInt();
1935 
1936  assert((HasTemplateKWAndArgsInfo == E->hasTemplateKWAndArgsInfo()) &&
1937  "Wrong HasTemplateKWAndArgsInfo!");
1938  assert(
1939  (HasFirstQualifierFoundInScope == E->hasFirstQualifierFoundInScope()) &&
1940  "Wrong HasFirstQualifierFoundInScope!");
1941 
1942  if (HasTemplateKWAndArgsInfo)
1943  ReadTemplateKWAndArgsInfo(
1944  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
1945  E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs);
1946 
1947  assert((NumTemplateArgs == E->getNumTemplateArgs()) &&
1948  "Wrong NumTemplateArgs!");
1949 
1950  E->CXXDependentScopeMemberExprBits.IsArrow = Record.readInt();
1951  E->CXXDependentScopeMemberExprBits.OperatorLoc = readSourceLocation();
1952  E->BaseType = Record.readType();
1953  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1954  E->Base = Record.readSubExpr();
1955 
1956  if (HasFirstQualifierFoundInScope)
1957  *E->getTrailingObjects<NamedDecl *>() = readDeclAs<NamedDecl>();
1958 
1959  E->MemberNameInfo = Record.readDeclarationNameInfo();
1960 }
1961 
1962 void
1963 ASTStmtReader::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) {
1964  VisitExpr(E);
1965 
1966  if (Record.readInt()) // HasTemplateKWAndArgsInfo
1967  ReadTemplateKWAndArgsInfo(
1968  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
1969  E->getTrailingObjects<TemplateArgumentLoc>(),
1970  /*NumTemplateArgs=*/Record.readInt());
1971 
1972  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1973  E->NameInfo = Record.readDeclarationNameInfo();
1974 }
1975 
1976 void
1977 ASTStmtReader::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E) {
1978  VisitExpr(E);
1979  assert(Record.peekInt() == E->arg_size() &&
1980  "Read wrong record during creation ?");
1981  Record.skipInts(1);
1982  for (unsigned I = 0, N = E->arg_size(); I != N; ++I)
1983  E->setArg(I, Record.readSubExpr());
1984  E->TSI = readTypeSourceInfo();
1985  E->setLParenLoc(readSourceLocation());
1986  E->setRParenLoc(readSourceLocation());
1987 }
1988 
1989 void ASTStmtReader::VisitOverloadExpr(OverloadExpr *E) {
1990  VisitExpr(E);
1991 
1992  unsigned NumResults = Record.readInt();
1993  bool HasTemplateKWAndArgsInfo = Record.readInt();
1994  assert((E->getNumDecls() == NumResults) && "Wrong NumResults!");
1995  assert((E->hasTemplateKWAndArgsInfo() == HasTemplateKWAndArgsInfo) &&
1996  "Wrong HasTemplateKWAndArgsInfo!");
1997 
1998  if (HasTemplateKWAndArgsInfo) {
1999  unsigned NumTemplateArgs = Record.readInt();
2000  ReadTemplateKWAndArgsInfo(*E->getTrailingASTTemplateKWAndArgsInfo(),
2002  NumTemplateArgs);
2003  assert((E->getNumTemplateArgs() == NumTemplateArgs) &&
2004  "Wrong NumTemplateArgs!");
2005  }
2006 
2007  UnresolvedSet<8> Decls;
2008  for (unsigned I = 0; I != NumResults; ++I) {
2009  auto *D = readDeclAs<NamedDecl>();
2010  auto AS = (AccessSpecifier)Record.readInt();
2011  Decls.addDecl(D, AS);
2012  }
2013 
2014  DeclAccessPair *Results = E->getTrailingResults();
2015  UnresolvedSetIterator Iter = Decls.begin();
2016  for (unsigned I = 0; I != NumResults; ++I) {
2017  Results[I] = (Iter + I).getPair();
2018  }
2019 
2020  E->NameInfo = Record.readDeclarationNameInfo();
2021  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
2022 }
2023 
2024 void ASTStmtReader::VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
2025  VisitOverloadExpr(E);
2026  E->UnresolvedMemberExprBits.IsArrow = Record.readInt();
2027  E->UnresolvedMemberExprBits.HasUnresolvedUsing = Record.readInt();
2028  E->Base = Record.readSubExpr();
2029  E->BaseType = Record.readType();
2030  E->OperatorLoc = readSourceLocation();
2031 }
2032 
2033 void ASTStmtReader::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) {
2034  VisitOverloadExpr(E);
2035  E->UnresolvedLookupExprBits.RequiresADL = Record.readInt();
2036  E->UnresolvedLookupExprBits.Overloaded = Record.readInt();
2037  E->NamingClass = readDeclAs<CXXRecordDecl>();
2038 }
2039 
2040 void ASTStmtReader::VisitTypeTraitExpr(TypeTraitExpr *E) {
2041  VisitExpr(E);
2042  E->TypeTraitExprBits.NumArgs = Record.readInt();
2043  E->TypeTraitExprBits.Kind = Record.readInt();
2044  E->TypeTraitExprBits.Value = Record.readInt();
2045  SourceRange Range = readSourceRange();
2046  E->Loc = Range.getBegin();
2047  E->RParenLoc = Range.getEnd();
2048 
2049  auto **Args = E->getTrailingObjects<TypeSourceInfo *>();
2050  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
2051  Args[I] = readTypeSourceInfo();
2052 }
2053 
2054 void ASTStmtReader::VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E) {
2055  VisitExpr(E);
2056  E->ATT = (ArrayTypeTrait)Record.readInt();
2057  E->Value = (unsigned int)Record.readInt();
2058  SourceRange Range = readSourceRange();
2059  E->Loc = Range.getBegin();
2060  E->RParen = Range.getEnd();
2061  E->QueriedType = readTypeSourceInfo();
2062  E->Dimension = Record.readSubExpr();
2063 }
2064 
2065 void ASTStmtReader::VisitExpressionTraitExpr(ExpressionTraitExpr *E) {
2066  VisitExpr(E);
2067  E->ET = (ExpressionTrait)Record.readInt();
2068  E->Value = (bool)Record.readInt();
2069  SourceRange Range = readSourceRange();
2070  E->QueriedExpression = Record.readSubExpr();
2071  E->Loc = Range.getBegin();
2072  E->RParen = Range.getEnd();
2073 }
2074 
2075 void ASTStmtReader::VisitCXXNoexceptExpr(CXXNoexceptExpr *E) {
2076  VisitExpr(E);
2077  E->CXXNoexceptExprBits.Value = Record.readInt();
2078  E->Range = readSourceRange();
2079  E->Operand = Record.readSubExpr();
2080 }
2081 
2082 void ASTStmtReader::VisitPackExpansionExpr(PackExpansionExpr *E) {
2083  VisitExpr(E);
2084  E->EllipsisLoc = readSourceLocation();
2085  E->NumExpansions = Record.readInt();
2086  E->Pattern = Record.readSubExpr();
2087 }
2088 
2089 void ASTStmtReader::VisitSizeOfPackExpr(SizeOfPackExpr *E) {
2090  VisitExpr(E);
2091  unsigned NumPartialArgs = Record.readInt();
2092  E->OperatorLoc = readSourceLocation();
2093  E->PackLoc = readSourceLocation();
2094  E->RParenLoc = readSourceLocation();
2095  E->Pack = Record.readDeclAs<NamedDecl>();
2096  if (E->isPartiallySubstituted()) {
2097  assert(E->Length == NumPartialArgs);
2098  for (auto *I = E->getTrailingObjects<TemplateArgument>(),
2099  *E = I + NumPartialArgs;
2100  I != E; ++I)
2101  new (I) TemplateArgument(Record.readTemplateArgument());
2102  } else if (!E->isValueDependent()) {
2103  E->Length = Record.readInt();
2104  }
2105 }
2106 
2107 void ASTStmtReader::VisitSubstNonTypeTemplateParmExpr(
2109  VisitExpr(E);
2110  E->Param = readDeclAs<NonTypeTemplateParmDecl>();
2111  E->SubstNonTypeTemplateParmExprBits.NameLoc = readSourceLocation();
2112  E->Replacement = Record.readSubExpr();
2113 }
2114 
2115 void ASTStmtReader::VisitSubstNonTypeTemplateParmPackExpr(
2117  VisitExpr(E);
2118  E->Param = readDeclAs<NonTypeTemplateParmDecl>();
2119  TemplateArgument ArgPack = Record.readTemplateArgument();
2120  if (ArgPack.getKind() != TemplateArgument::Pack)
2121  return;
2122 
2123  E->Arguments = ArgPack.pack_begin();
2124  E->NumArguments = ArgPack.pack_size();
2125  E->NameLoc = readSourceLocation();
2126 }
2127 
2128 void ASTStmtReader::VisitFunctionParmPackExpr(FunctionParmPackExpr *E) {
2129  VisitExpr(E);
2130  E->NumParameters = Record.readInt();
2131  E->ParamPack = readDeclAs<ParmVarDecl>();
2132  E->NameLoc = readSourceLocation();
2133  auto **Parms = E->getTrailingObjects<VarDecl *>();
2134  for (unsigned i = 0, n = E->NumParameters; i != n; ++i)
2135  Parms[i] = readDeclAs<VarDecl>();
2136 }
2137 
2138 void ASTStmtReader::VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E) {
2139  VisitExpr(E);
2140  bool HasMaterialzedDecl = Record.readInt();
2141  if (HasMaterialzedDecl)
2142  E->State = cast<LifetimeExtendedTemporaryDecl>(Record.readDecl());
2143  else
2144  E->State = Record.readSubExpr();
2145 }
2146 
2147 void ASTStmtReader::VisitCXXFoldExpr(CXXFoldExpr *E) {
2148  VisitExpr(E);
2149  E->LParenLoc = readSourceLocation();
2150  E->EllipsisLoc = readSourceLocation();
2151  E->RParenLoc = readSourceLocation();
2152  E->NumExpansions = Record.readInt();
2153  E->SubExprs[0] = Record.readSubExpr();
2154  E->SubExprs[1] = Record.readSubExpr();
2155  E->Opcode = (BinaryOperatorKind)Record.readInt();
2156 }
2157 
2158 void ASTStmtReader::VisitOpaqueValueExpr(OpaqueValueExpr *E) {
2159  VisitExpr(E);
2160  E->SourceExpr = Record.readSubExpr();
2161  E->OpaqueValueExprBits.Loc = readSourceLocation();
2162  E->setIsUnique(Record.readInt());
2163 }
2164 
2165 void ASTStmtReader::VisitTypoExpr(TypoExpr *E) {
2166  llvm_unreachable("Cannot read TypoExpr nodes");
2167 }
2168 
2169 void ASTStmtReader::VisitRecoveryExpr(RecoveryExpr *E) {
2170  VisitExpr(E);
2171  unsigned NumArgs = Record.readInt();
2172  E->BeginLoc = readSourceLocation();
2173  E->EndLoc = readSourceLocation();
2174  assert(
2175  (NumArgs == std::distance(E->children().begin(), E->children().end())) &&
2176  "Wrong NumArgs!");
2177  (void)NumArgs;
2178  for (Stmt *&Child : E->children())
2179  Child = Record.readSubStmt();
2180 }
2181 
2182 //===----------------------------------------------------------------------===//
2183 // Microsoft Expressions and Statements
2184 //===----------------------------------------------------------------------===//
2185 void ASTStmtReader::VisitMSPropertyRefExpr(MSPropertyRefExpr *E) {
2186  VisitExpr(E);
2187  E->IsArrow = (Record.readInt() != 0);
2188  E->BaseExpr = Record.readSubExpr();
2189  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
2190  E->MemberLoc = readSourceLocation();
2191  E->TheDecl = readDeclAs<MSPropertyDecl>();
2192 }
2193 
2194 void ASTStmtReader::VisitMSPropertySubscriptExpr(MSPropertySubscriptExpr *E) {
2195  VisitExpr(E);
2196  E->setBase(Record.readSubExpr());
2197  E->setIdx(Record.readSubExpr());
2198  E->setRBracketLoc(readSourceLocation());
2199 }
2200 
2201 void ASTStmtReader::VisitCXXUuidofExpr(CXXUuidofExpr *E) {
2202  VisitExpr(E);
2203  E->setSourceRange(readSourceRange());
2204  E->Guid = readDeclAs<MSGuidDecl>();
2205  if (E->isTypeOperand())
2206  E->Operand = readTypeSourceInfo();
2207  else
2208  E->Operand = Record.readSubExpr();
2209 }
2210 
2211 void ASTStmtReader::VisitSEHLeaveStmt(SEHLeaveStmt *S) {
2212  VisitStmt(S);
2213  S->setLeaveLoc(readSourceLocation());
2214 }
2215 
2216 void ASTStmtReader::VisitSEHExceptStmt(SEHExceptStmt *S) {
2217  VisitStmt(S);
2218  S->Loc = readSourceLocation();
2219  S->Children[SEHExceptStmt::FILTER_EXPR] = Record.readSubStmt();
2220  S->Children[SEHExceptStmt::BLOCK] = Record.readSubStmt();
2221 }
2222 
2223 void ASTStmtReader::VisitSEHFinallyStmt(SEHFinallyStmt *S) {
2224  VisitStmt(S);
2225  S->Loc = readSourceLocation();
2226  S->Block = Record.readSubStmt();
2227 }
2228 
2229 void ASTStmtReader::VisitSEHTryStmt(SEHTryStmt *S) {
2230  VisitStmt(S);
2231  S->IsCXXTry = Record.readInt();
2232  S->TryLoc = readSourceLocation();
2233  S->Children[SEHTryStmt::TRY] = Record.readSubStmt();
2234  S->Children[SEHTryStmt::HANDLER] = Record.readSubStmt();
2235 }
2236 
2237 //===----------------------------------------------------------------------===//
2238 // CUDA Expressions and Statements
2239 //===----------------------------------------------------------------------===//
2240 
2241 void ASTStmtReader::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E) {
2242  VisitCallExpr(E);
2243  E->setPreArg(CUDAKernelCallExpr::CONFIG, Record.readSubExpr());
2244 }
2245 
2246 //===----------------------------------------------------------------------===//
2247 // OpenCL Expressions and Statements.
2248 //===----------------------------------------------------------------------===//
2249 void ASTStmtReader::VisitAsTypeExpr(AsTypeExpr *E) {
2250  VisitExpr(E);
2251  E->BuiltinLoc = readSourceLocation();
2252  E->RParenLoc = readSourceLocation();
2253  E->SrcExpr = Record.readSubExpr();
2254 }
2255 
2256 //===----------------------------------------------------------------------===//
2257 // OpenMP Directives.
2258 //===----------------------------------------------------------------------===//
2259 
2260 void ASTStmtReader::VisitOMPExecutableDirective(OMPExecutableDirective *E) {
2261  E->setLocStart(readSourceLocation());
2262  E->setLocEnd(readSourceLocation());
2264  for (unsigned i = 0; i < E->getNumClauses(); ++i)
2265  Clauses.push_back(Record.readOMPClause());
2266  E->setClauses(Clauses);
2267  if (E->hasAssociatedStmt())
2268  E->setAssociatedStmt(Record.readSubStmt());
2269 }
2270 
2271 void ASTStmtReader::VisitOMPLoopDirective(OMPLoopDirective *D) {
2272  VisitStmt(D);
2273  // Two fields (NumClauses and CollapsedNum) were read in ReadStmtFromStream.
2274  Record.skipInts(2);
2275  VisitOMPExecutableDirective(D);
2276  D->setIterationVariable(Record.readSubExpr());
2277  D->setLastIteration(Record.readSubExpr());
2278  D->setCalcLastIteration(Record.readSubExpr());
2279  D->setPreCond(Record.readSubExpr());
2280  D->setCond(Record.readSubExpr());
2281  D->setInit(Record.readSubExpr());
2282  D->setInc(Record.readSubExpr());
2283  D->setPreInits(Record.readSubStmt());
2287  D->setIsLastIterVariable(Record.readSubExpr());
2288  D->setLowerBoundVariable(Record.readSubExpr());
2289  D->setUpperBoundVariable(Record.readSubExpr());
2290  D->setStrideVariable(Record.readSubExpr());
2291  D->setEnsureUpperBound(Record.readSubExpr());
2292  D->setNextLowerBound(Record.readSubExpr());
2293  D->setNextUpperBound(Record.readSubExpr());
2294  D->setNumIterations(Record.readSubExpr());
2295  }
2297  D->setPrevLowerBoundVariable(Record.readSubExpr());
2298  D->setPrevUpperBoundVariable(Record.readSubExpr());
2299  D->setDistInc(Record.readSubExpr());
2300  D->setPrevEnsureUpperBound(Record.readSubExpr());
2301  D->setCombinedLowerBoundVariable(Record.readSubExpr());
2302  D->setCombinedUpperBoundVariable(Record.readSubExpr());
2303  D->setCombinedEnsureUpperBound(Record.readSubExpr());
2304  D->setCombinedInit(Record.readSubExpr());
2305  D->setCombinedCond(Record.readSubExpr());
2306  D->setCombinedNextLowerBound(Record.readSubExpr());
2307  D->setCombinedNextUpperBound(Record.readSubExpr());
2308  D->setCombinedDistCond(Record.readSubExpr());
2309  D->setCombinedParForInDistCond(Record.readSubExpr());
2310  }
2312  unsigned CollapsedNum = D->getCollapsedNumber();
2313  Sub.reserve(CollapsedNum);
2314  for (unsigned i = 0; i < CollapsedNum; ++i)
2315  Sub.push_back(Record.readSubExpr());
2316  D->setCounters(Sub);
2317  Sub.clear();
2318  for (unsigned i = 0; i < CollapsedNum; ++i)
2319  Sub.push_back(Record.readSubExpr());
2320  D->setPrivateCounters(Sub);
2321  Sub.clear();
2322  for (unsigned i = 0; i < CollapsedNum; ++i)
2323  Sub.push_back(Record.readSubExpr());
2324  D->setInits(Sub);
2325  Sub.clear();
2326  for (unsigned i = 0; i < CollapsedNum; ++i)
2327  Sub.push_back(Record.readSubExpr());
2328  D->setUpdates(Sub);
2329  Sub.clear();
2330  for (unsigned i = 0; i < CollapsedNum; ++i)
2331  Sub.push_back(Record.readSubExpr());
2332  D->setFinals(Sub);
2333  Sub.clear();
2334  for (unsigned i = 0; i < CollapsedNum; ++i)
2335  Sub.push_back(Record.readSubExpr());
2336  D->setDependentCounters(Sub);
2337  Sub.clear();
2338  for (unsigned i = 0; i < CollapsedNum; ++i)
2339  Sub.push_back(Record.readSubExpr());
2340  D->setDependentInits(Sub);
2341  Sub.clear();
2342  for (unsigned i = 0; i < CollapsedNum; ++i)
2343  Sub.push_back(Record.readSubExpr());
2344  D->setFinalsConditions(Sub);
2345 }
2346 
2347 void ASTStmtReader::VisitOMPParallelDirective(OMPParallelDirective *D) {
2348  VisitStmt(D);
2349  // The NumClauses field was read in ReadStmtFromStream.
2350  Record.skipInts(1);
2351  VisitOMPExecutableDirective(D);
2352  D->setTaskReductionRefExpr(Record.readSubExpr());
2353  D->setHasCancel(Record.readInt());
2354 }
2355 
2356 void ASTStmtReader::VisitOMPSimdDirective(OMPSimdDirective *D) {
2357  VisitOMPLoopDirective(D);
2358 }
2359 
2360 void ASTStmtReader::VisitOMPForDirective(OMPForDirective *D) {
2361  VisitOMPLoopDirective(D);
2362  D->setTaskReductionRefExpr(Record.readSubExpr());
2363  D->setHasCancel(Record.readInt());
2364 }
2365 
2366 void ASTStmtReader::VisitOMPForSimdDirective(OMPForSimdDirective *D) {
2367  VisitOMPLoopDirective(D);
2368 }
2369 
2370 void ASTStmtReader::VisitOMPSectionsDirective(OMPSectionsDirective *D) {
2371  VisitStmt(D);
2372  // The NumClauses field was read in ReadStmtFromStream.
2373  Record.skipInts(1);
2374  VisitOMPExecutableDirective(D);
2375  D->setTaskReductionRefExpr(Record.readSubExpr());
2376  D->setHasCancel(Record.readInt());
2377 }
2378 
2379 void ASTStmtReader::VisitOMPSectionDirective(OMPSectionDirective *D) {
2380  VisitStmt(D);
2381  VisitOMPExecutableDirective(D);
2382  D->setHasCancel(Record.readInt());
2383 }
2384 
2385 void ASTStmtReader::VisitOMPSingleDirective(OMPSingleDirective *D) {
2386  VisitStmt(D);
2387  // The NumClauses field was read in ReadStmtFromStream.
2388  Record.skipInts(1);
2389  VisitOMPExecutableDirective(D);
2390 }
2391 
2392 void ASTStmtReader::VisitOMPMasterDirective(OMPMasterDirective *D) {
2393  VisitStmt(D);
2394  VisitOMPExecutableDirective(D);
2395 }
2396 
2397 void ASTStmtReader::VisitOMPCriticalDirective(OMPCriticalDirective *D) {
2398  VisitStmt(D);
2399  // The NumClauses field was read in ReadStmtFromStream.
2400  Record.skipInts(1);
2401  VisitOMPExecutableDirective(D);
2402  D->DirName = Record.readDeclarationNameInfo();
2403 }
2404 
2405 void ASTStmtReader::VisitOMPParallelForDirective(OMPParallelForDirective *D) {
2406  VisitOMPLoopDirective(D);
2407  D->setTaskReductionRefExpr(Record.readSubExpr());
2408  D->setHasCancel(Record.readInt());
2409 }
2410 
2411 void ASTStmtReader::VisitOMPParallelForSimdDirective(
2413  VisitOMPLoopDirective(D);
2414 }
2415 
2416 void ASTStmtReader::VisitOMPParallelMasterDirective(
2418  VisitStmt(D);
2419  // The NumClauses field was read in ReadStmtFromStream.
2420  Record.skipInts(1);
2421  VisitOMPExecutableDirective(D);
2422  D->setTaskReductionRefExpr(Record.readSubExpr());
2423 }
2424 
2425 void ASTStmtReader::VisitOMPParallelSectionsDirective(
2427  VisitStmt(D);
2428  // The NumClauses field was read in ReadStmtFromStream.
2429  Record.skipInts(1);
2430  VisitOMPExecutableDirective(D);
2431  D->setTaskReductionRefExpr(Record.readSubExpr());
2432  D->setHasCancel(Record.readInt());
2433 }
2434 
2435 void ASTStmtReader::VisitOMPTaskDirective(OMPTaskDirective *D) {
2436  VisitStmt(D);
2437  // The NumClauses field was read in ReadStmtFromStream.
2438  Record.skipInts(1);
2439  VisitOMPExecutableDirective(D);
2440  D->setHasCancel(Record.readInt());
2441 }
2442 
2443 void ASTStmtReader::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) {
2444  VisitStmt(D);
2445  VisitOMPExecutableDirective(D);
2446 }
2447 
2448 void ASTStmtReader::VisitOMPBarrierDirective(OMPBarrierDirective *D) {
2449  VisitStmt(D);
2450  VisitOMPExecutableDirective(D);
2451 }
2452 
2453 void ASTStmtReader::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) {
2454  VisitStmt(D);
2455  VisitOMPExecutableDirective(D);
2456 }
2457 
2458 void ASTStmtReader::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) {
2459  VisitStmt(D);
2460  // The NumClauses field was read in ReadStmtFromStream.
2461  Record.skipInts(1);
2462  VisitOMPExecutableDirective(D);
2463  D->setReductionRef(Record.readSubExpr());
2464 }
2465 
2466 void ASTStmtReader::VisitOMPFlushDirective(OMPFlushDirective *D) {
2467  VisitStmt(D);
2468  // The NumClauses field was read in ReadStmtFromStream.
2469  Record.skipInts(1);
2470  VisitOMPExecutableDirective(D);
2471 }
2472 
2473 void ASTStmtReader::VisitOMPDepobjDirective(OMPDepobjDirective *D) {
2474  VisitStmt(D);
2475  // The NumClauses field was read in ReadStmtFromStream.
2476  Record.skipInts(1);
2477  VisitOMPExecutableDirective(D);
2478 }
2479 
2480 void ASTStmtReader::VisitOMPScanDirective(OMPScanDirective *D) {
2481  VisitStmt(D);
2482  // The NumClauses field was read in ReadStmtFromStream.
2483  Record.skipInts(1);
2484  VisitOMPExecutableDirective(D);
2485 }
2486 
2487 void ASTStmtReader::VisitOMPOrderedDirective(OMPOrderedDirective *D) {
2488  VisitStmt(D);
2489  // The NumClauses field was read in ReadStmtFromStream.
2490  Record.skipInts(1);
2491  VisitOMPExecutableDirective(D);
2492 }
2493 
2494 void ASTStmtReader::VisitOMPAtomicDirective(OMPAtomicDirective *D) {
2495  VisitStmt(D);
2496  // The NumClauses field was read in ReadStmtFromStream.
2497  Record.skipInts(1);
2498  VisitOMPExecutableDirective(D);
2499  D->setX(Record.readSubExpr());
2500  D->setV(Record.readSubExpr());
2501  D->setExpr(Record.readSubExpr());
2502  D->setUpdateExpr(Record.readSubExpr());
2503  D->IsXLHSInRHSPart = Record.readInt() != 0;
2504  D->IsPostfixUpdate = Record.readInt() != 0;
2505 }
2506 
2507 void ASTStmtReader::VisitOMPTargetDirective(OMPTargetDirective *D) {
2508  VisitStmt(D);
2509  // The NumClauses field was read in ReadStmtFromStream.
2510  Record.skipInts(1);
2511  VisitOMPExecutableDirective(D);
2512 }
2513 
2514 void ASTStmtReader::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) {
2515  VisitStmt(D);
2516  Record.skipInts(1);
2517  VisitOMPExecutableDirective(D);
2518 }
2519 
2520 void ASTStmtReader::VisitOMPTargetEnterDataDirective(
2522  VisitStmt(D);
2523  Record.skipInts(1);
2524  VisitOMPExecutableDirective(D);
2525 }
2526 
2527 void ASTStmtReader::VisitOMPTargetExitDataDirective(
2529  VisitStmt(D);
2530  Record.skipInts(1);
2531  VisitOMPExecutableDirective(D);
2532 }
2533 
2534 void ASTStmtReader::VisitOMPTargetParallelDirective(
2536  VisitStmt(D);
2537  Record.skipInts(1);
2538  VisitOMPExecutableDirective(D);
2539  D->setTaskReductionRefExpr(Record.readSubExpr());
2540  D->setHasCancel(Record.readBool());
2541 }
2542 
2543 void ASTStmtReader::VisitOMPTargetParallelForDirective(
2545  VisitOMPLoopDirective(D);
2546  D->setTaskReductionRefExpr(Record.readSubExpr());
2547  D->setHasCancel(Record.readInt());
2548 }
2549 
2550 void ASTStmtReader::VisitOMPTeamsDirective(OMPTeamsDirective *D) {
2551  VisitStmt(D);
2552  // The NumClauses field was read in ReadStmtFromStream.
2553  Record.skipInts(1);
2554  VisitOMPExecutableDirective(D);
2555 }
2556 
2557 void ASTStmtReader::VisitOMPCancellationPointDirective(
2559  VisitStmt(D);
2560  VisitOMPExecutableDirective(D);
2561  D->setCancelRegion(static_cast<OpenMPDirectiveKind>(Record.readInt()));
2562 }
2563 
2564 void ASTStmtReader::VisitOMPCancelDirective(OMPCancelDirective *D) {
2565  VisitStmt(D);
2566  // The NumClauses field was read in ReadStmtFromStream.
2567  Record.skipInts(1);
2568  VisitOMPExecutableDirective(D);
2569  D->setCancelRegion(static_cast<OpenMPDirectiveKind>(Record.readInt()));
2570 }
2571 
2572 void ASTStmtReader::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) {
2573  VisitOMPLoopDirective(D);
2574  D->setHasCancel(Record.readInt());
2575 }
2576 
2577 void ASTStmtReader::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) {
2578  VisitOMPLoopDirective(D);
2579 }
2580 
2581 void ASTStmtReader::VisitOMPMasterTaskLoopDirective(
2583  VisitOMPLoopDirective(D);
2584  D->setHasCancel(Record.readInt());
2585 }
2586 
2587 void ASTStmtReader::VisitOMPMasterTaskLoopSimdDirective(
2589  VisitOMPLoopDirective(D);
2590 }
2591 
2592 void ASTStmtReader::VisitOMPParallelMasterTaskLoopDirective(
2594  VisitOMPLoopDirective(D);
2595  D->setHasCancel(Record.readInt());
2596 }
2597 
2598 void ASTStmtReader::VisitOMPParallelMasterTaskLoopSimdDirective(
2600  VisitOMPLoopDirective(D);
2601 }
2602 
2603 void ASTStmtReader::VisitOMPDistributeDirective(OMPDistributeDirective *D) {
2604  VisitOMPLoopDirective(D);
2605 }
2606 
2607 void ASTStmtReader::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) {
2608  VisitStmt(D);
2609  Record.skipInts(1);
2610  VisitOMPExecutableDirective(D);
2611 }
2612 
2613 void ASTStmtReader::VisitOMPDistributeParallelForDirective(
2615  VisitOMPLoopDirective(D);
2616  D->setTaskReductionRefExpr(Record.readSubExpr());
2617  D->setHasCancel(Record.readInt());
2618 }
2619 
2620 void ASTStmtReader::VisitOMPDistributeParallelForSimdDirective(
2622  VisitOMPLoopDirective(D);
2623 }
2624 
2625 void ASTStmtReader::VisitOMPDistributeSimdDirective(
2627  VisitOMPLoopDirective(D);
2628 }
2629 
2630 void ASTStmtReader::VisitOMPTargetParallelForSimdDirective(
2632  VisitOMPLoopDirective(D);
2633 }
2634 
2635 void ASTStmtReader::VisitOMPTargetSimdDirective(OMPTargetSimdDirective *D) {
2636  VisitOMPLoopDirective(D);
2637 }
2638 
2639 void ASTStmtReader::VisitOMPTeamsDistributeDirective(
2641  VisitOMPLoopDirective(D);
2642 }
2643 
2644 void ASTStmtReader::VisitOMPTeamsDistributeSimdDirective(
2646  VisitOMPLoopDirective(D);
2647 }
2648 
2649 void ASTStmtReader::VisitOMPTeamsDistributeParallelForSimdDirective(
2651  VisitOMPLoopDirective(D);
2652 }
2653 
2654 void ASTStmtReader::VisitOMPTeamsDistributeParallelForDirective(
2656  VisitOMPLoopDirective(D);
2657  D->setTaskReductionRefExpr(Record.readSubExpr());
2658  D->setHasCancel(Record.readInt());
2659 }
2660 
2661 void ASTStmtReader::VisitOMPTargetTeamsDirective(OMPTargetTeamsDirective *D) {
2662  VisitStmt(D);
2663  // The NumClauses field was read in ReadStmtFromStream.
2664  Record.skipInts(1);
2665  VisitOMPExecutableDirective(D);
2666 }
2667 
2668 void ASTStmtReader::VisitOMPTargetTeamsDistributeDirective(
2670  VisitOMPLoopDirective(D);
2671 }
2672 
2673 void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForDirective(
2675  VisitOMPLoopDirective(D);
2676  D->setTaskReductionRefExpr(Record.readSubExpr());
2677  D->setHasCancel(Record.readInt());
2678 }
2679 
2680 void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
2682  VisitOMPLoopDirective(D);
2683 }
2684 
2685 void ASTStmtReader::VisitOMPTargetTeamsDistributeSimdDirective(
2687  VisitOMPLoopDirective(D);
2688 }
2689 
2690 //===----------------------------------------------------------------------===//
2691 // ASTReader Implementation
2692 //===----------------------------------------------------------------------===//
2693 
2695  switch (ReadingKind) {
2696  case Read_None:
2697  llvm_unreachable("should not call this when not reading anything");
2698  case Read_Decl:
2699  case Read_Type:
2700  return ReadStmtFromStream(F);
2701  case Read_Stmt:
2702  return ReadSubStmt();
2703  }
2704 
2705  llvm_unreachable("ReadingKind not set ?");
2706 }
2707 
2709  return cast_or_null<Expr>(ReadStmt(F));
2710 }
2711 
2713  return cast_or_null<Expr>(ReadSubStmt());
2714 }
2715 
2716 // Within the bitstream, expressions are stored in Reverse Polish
2717 // Notation, with each of the subexpressions preceding the
2718 // expression they are stored in. Subexpressions are stored from last to first.
2719 // To evaluate expressions, we continue reading expressions and placing them on
2720 // the stack, with expressions having operands removing those operands from the
2721 // stack. Evaluation terminates when we see a STMT_STOP record, and
2722 // the single remaining expression on the stack is our result.
2723 Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) {
2724  ReadingKindTracker ReadingKind(Read_Stmt, *this);
2725  llvm::BitstreamCursor &Cursor = F.DeclsCursor;
2726 
2727  // Map of offset to previously deserialized stmt. The offset points
2728  // just after the stmt record.
2729  llvm::DenseMap<uint64_t, Stmt *> StmtEntries;
2730 
2731 #ifndef NDEBUG
2732  unsigned PrevNumStmts = StmtStack.size();
2733 #endif
2734 
2735  ASTRecordReader Record(*this, F);
2736  ASTStmtReader Reader(Record, Cursor);
2737  Stmt::EmptyShell Empty;
2738 
2739  while (true) {
2741  Cursor.advanceSkippingSubblocks();
2742  if (!MaybeEntry) {
2743  Error(toString(MaybeEntry.takeError()));
2744  return nullptr;
2745  }
2746  llvm::BitstreamEntry Entry = MaybeEntry.get();
2747 
2748  switch (Entry.Kind) {
2749  case llvm::BitstreamEntry::SubBlock: // Handled for us already.
2751  Error("malformed block record in AST file");
2752  return nullptr;
2753  case llvm::BitstreamEntry::EndBlock:
2754  goto Done;
2755  case llvm::BitstreamEntry::Record:
2756  // The interesting case.
2757  break;
2758  }
2759 
2760  ASTContext &Context = getContext();
2761  Stmt *S = nullptr;
2762  bool Finished = false;
2763  bool IsStmtReference = false;
2764  Expected<unsigned> MaybeStmtCode = Record.readRecord(Cursor, Entry.ID);
2765  if (!MaybeStmtCode) {
2766  Error(toString(MaybeStmtCode.takeError()));
2767  return nullptr;
2768  }
2769  switch ((StmtCode)MaybeStmtCode.get()) {
2770  case STMT_STOP:
2771  Finished = true;
2772  break;
2773 
2774  case STMT_REF_PTR:
2775  IsStmtReference = true;
2776  assert(StmtEntries.find(Record[0]) != StmtEntries.end() &&
2777  "No stmt was recorded for this offset reference!");
2778  S = StmtEntries[Record.readInt()];
2779  break;
2780 
2781  case STMT_NULL_PTR:
2782  S = nullptr;
2783  break;
2784 
2785  case STMT_NULL:
2786  S = new (Context) NullStmt(Empty);
2787  break;
2788 
2789  case STMT_COMPOUND:
2791  Context, /*NumStmts=*/Record[ASTStmtReader::NumStmtFields]);
2792  break;
2793 
2794  case STMT_CASE:
2796  Context,
2797  /*CaseStmtIsGNURange*/ Record[ASTStmtReader::NumStmtFields + 3]);
2798  break;
2799 
2800  case STMT_DEFAULT:
2801  S = new (Context) DefaultStmt(Empty);
2802  break;
2803 
2804  case STMT_LABEL:
2805  S = new (Context) LabelStmt(Empty);
2806  break;
2807 
2808  case STMT_ATTRIBUTED:
2810  Context,
2811  /*NumAttrs*/Record[ASTStmtReader::NumStmtFields]);
2812  break;
2813 
2814  case STMT_IF:
2815  S = IfStmt::CreateEmpty(
2816  Context,
2817  /* HasElse=*/Record[ASTStmtReader::NumStmtFields + 1],
2818  /* HasVar=*/Record[ASTStmtReader::NumStmtFields + 2],
2819  /* HasInit=*/Record[ASTStmtReader::NumStmtFields + 3]);
2820  break;
2821 
2822  case STMT_SWITCH:
2824  Context,
2825  /* HasInit=*/Record[ASTStmtReader::NumStmtFields],
2826  /* HasVar=*/Record[ASTStmtReader::NumStmtFields + 1]);
2827  break;
2828 
2829  case STMT_WHILE:
2831  Context,
2832  /* HasVar=*/Record[ASTStmtReader::NumStmtFields]);
2833  break;
2834 
2835  case STMT_DO:
2836  S = new (Context) DoStmt(Empty);
2837  break;
2838 
2839  case STMT_FOR:
2840  S = new (Context) ForStmt(Empty);
2841  break;
2842 
2843  case STMT_GOTO:
2844  S = new (Context) GotoStmt(Empty);
2845  break;
2846 
2847  case STMT_INDIRECT_GOTO:
2848  S = new (Context) IndirectGotoStmt(Empty);
2849  break;
2850 
2851  case STMT_CONTINUE:
2852  S = new (Context) ContinueStmt(Empty);
2853  break;
2854 
2855  case STMT_BREAK:
2856  S = new (Context) BreakStmt(Empty);
2857  break;
2858 
2859  case STMT_RETURN:
2861  Context, /* HasNRVOCandidate=*/Record[ASTStmtReader::NumStmtFields]);
2862  break;
2863 
2864  case STMT_DECL:
2865  S = new (Context) DeclStmt(Empty);
2866  break;
2867 
2868  case STMT_GCCASM:
2869  S = new (Context) GCCAsmStmt(Empty);
2870  break;
2871 
2872  case STMT_MSASM:
2873  S = new (Context) MSAsmStmt(Empty);
2874  break;
2875 
2876  case STMT_CAPTURED:
2878  Context, Record[ASTStmtReader::NumStmtFields]);
2879  break;
2880 
2881  case EXPR_CONSTANT:
2883  Context, static_cast<ConstantExpr::ResultStorageKind>(
2884  /*StorageKind=*/Record[ASTStmtReader::NumExprFields]));
2885  break;
2886 
2887  case EXPR_PREDEFINED:
2889  Context,
2890  /*HasFunctionName*/ Record[ASTStmtReader::NumExprFields]);
2891  break;
2892 
2893  case EXPR_DECL_REF:
2895  Context,
2896  /*HasQualifier=*/Record[ASTStmtReader::NumExprFields],
2897  /*HasFoundDecl=*/Record[ASTStmtReader::NumExprFields + 1],
2898  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields + 2],
2899  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields + 2] ?
2900  Record[ASTStmtReader::NumExprFields + 6] : 0);
2901  break;
2902 
2903  case EXPR_INTEGER_LITERAL:
2904  S = IntegerLiteral::Create(Context, Empty);
2905  break;
2906 
2908  S = FixedPointLiteral::Create(Context, Empty);
2909  break;
2910 
2911  case EXPR_FLOATING_LITERAL:
2912  S = FloatingLiteral::Create(Context, Empty);
2913  break;
2914 
2916  S = new (Context) ImaginaryLiteral(Empty);
2917  break;
2918 
2919  case EXPR_STRING_LITERAL:
2921  Context,
2922  /* NumConcatenated=*/Record[ASTStmtReader::NumExprFields],
2923  /* Length=*/Record[ASTStmtReader::NumExprFields + 1],
2924  /* CharByteWidth=*/Record[ASTStmtReader::NumExprFields + 2]);
2925  break;
2926 
2928  S = new (Context) CharacterLiteral(Empty);
2929  break;
2930 
2931  case EXPR_PAREN:
2932  S = new (Context) ParenExpr(Empty);
2933  break;
2934 
2935  case EXPR_PAREN_LIST:
2937  Context,
2938  /* NumExprs=*/Record[ASTStmtReader::NumExprFields]);
2939  break;
2940 
2941  case EXPR_UNARY_OPERATOR:
2942  S = UnaryOperator::CreateEmpty(Context,
2943  Record[ASTStmtReader::NumExprFields]);
2944  break;
2945 
2946  case EXPR_OFFSETOF:
2947  S = OffsetOfExpr::CreateEmpty(Context,
2948  Record[ASTStmtReader::NumExprFields],
2949  Record[ASTStmtReader::NumExprFields + 1]);
2950  break;
2951 
2952  case EXPR_SIZEOF_ALIGN_OF:
2953  S = new (Context) UnaryExprOrTypeTraitExpr(Empty);
2954  break;
2955 
2956  case EXPR_ARRAY_SUBSCRIPT:
2957  S = new (Context) ArraySubscriptExpr(Empty);
2958  break;
2959 
2960  case EXPR_MATRIX_SUBSCRIPT:
2961  S = new (Context) MatrixSubscriptExpr(Empty);
2962  break;
2963 
2965  S = new (Context) OMPArraySectionExpr(Empty);
2966  break;
2967 
2970  Context, Record[ASTStmtReader::NumExprFields]);
2971  break;
2972 
2973  case EXPR_OMP_ITERATOR:
2974  S = OMPIteratorExpr::CreateEmpty(Context,
2975  Record[ASTStmtReader::NumExprFields]);
2976  break;
2977 
2978  case EXPR_CALL:
2980  Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], Empty);
2981  break;
2982 
2983  case EXPR_RECOVERY:
2985  Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields]);
2986  break;
2987 
2988  case EXPR_MEMBER:
2989  S = MemberExpr::CreateEmpty(Context, Record[ASTStmtReader::NumExprFields],
2990  Record[ASTStmtReader::NumExprFields + 1],
2991  Record[ASTStmtReader::NumExprFields + 2],
2992  Record[ASTStmtReader::NumExprFields + 3]);
2993  break;
2994 
2995  case EXPR_BINARY_OPERATOR:
2996  S = BinaryOperator::CreateEmpty(Context,
2997  Record[ASTStmtReader::NumExprFields]);
2998  break;
2999 
3002  Context, Record[ASTStmtReader::NumExprFields]);
3003  break;
3004 
3006  S = new (Context) ConditionalOperator(Empty);
3007  break;
3008 
3010  S = new (Context) BinaryConditionalOperator(Empty);
3011  break;
3012 
3013  case EXPR_IMPLICIT_CAST:
3014  S = ImplicitCastExpr::CreateEmpty(Context,
3015  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3016  break;
3017 
3018  case EXPR_CSTYLE_CAST:
3019  S = CStyleCastExpr::CreateEmpty(Context,
3020  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3021  break;
3022 
3023  case EXPR_COMPOUND_LITERAL:
3024  S = new (Context) CompoundLiteralExpr(Empty);
3025  break;
3026 
3028  S = new (Context) ExtVectorElementExpr(Empty);
3029  break;
3030 
3031  case EXPR_INIT_LIST:
3032  S = new (Context) InitListExpr(Empty);
3033  break;
3034 
3035  case EXPR_DESIGNATED_INIT:
3036  S = DesignatedInitExpr::CreateEmpty(Context,
3037  Record[ASTStmtReader::NumExprFields] - 1);
3038 
3039  break;
3040 
3042  S = new (Context) DesignatedInitUpdateExpr(Empty);
3043  break;
3044 
3046  S = new (Context) ImplicitValueInitExpr(Empty);
3047  break;
3048 
3049  case EXPR_NO_INIT:
3050  S = new (Context) NoInitExpr(Empty);
3051  break;
3052 
3053  case EXPR_ARRAY_INIT_LOOP:
3054  S = new (Context) ArrayInitLoopExpr(Empty);
3055  break;
3056 
3057  case EXPR_ARRAY_INIT_INDEX:
3058  S = new (Context) ArrayInitIndexExpr(Empty);
3059  break;
3060 
3061  case EXPR_VA_ARG:
3062  S = new (Context) VAArgExpr(Empty);
3063  break;
3064 
3065  case EXPR_SOURCE_LOC:
3066  S = new (Context) SourceLocExpr(Empty);
3067  break;
3068 
3069  case EXPR_ADDR_LABEL:
3070  S = new (Context) AddrLabelExpr(Empty);
3071  break;
3072 
3073  case EXPR_STMT:
3074  S = new (Context) StmtExpr(Empty);
3075  break;
3076 
3077  case EXPR_CHOOSE:
3078  S = new (Context) ChooseExpr(Empty);
3079  break;
3080 
3081  case EXPR_GNU_NULL:
3082  S = new (Context) GNUNullExpr(Empty);
3083  break;
3084 
3085  case EXPR_SHUFFLE_VECTOR:
3086  S = new (Context) ShuffleVectorExpr(Empty);
3087  break;
3088 
3089  case EXPR_CONVERT_VECTOR:
3090  S = new (Context) ConvertVectorExpr(Empty);
3091  break;
3092 
3093  case EXPR_BLOCK:
3094  S = new (Context) BlockExpr(Empty);
3095  break;
3096 
3099  Context,
3100  /*NumAssocs=*/Record[ASTStmtReader::NumExprFields]);
3101  break;
3102 
3104  S = new (Context) ObjCStringLiteral(Empty);
3105  break;
3106 
3108  S = new (Context) ObjCBoxedExpr(Empty);
3109  break;
3110 
3112  S = ObjCArrayLiteral::CreateEmpty(Context,
3113  Record[ASTStmtReader::NumExprFields]);
3114  break;
3115 
3118  Record[ASTStmtReader::NumExprFields],
3119  Record[ASTStmtReader::NumExprFields + 1]);
3120  break;
3121 
3122  case EXPR_OBJC_ENCODE:
3123  S = new (Context) ObjCEncodeExpr(Empty);
3124  break;
3125 
3127  S = new (Context) ObjCSelectorExpr(Empty);
3128  break;
3129 
3131  S = new (Context) ObjCProtocolExpr(Empty);
3132  break;
3133 
3135  S = new (Context) ObjCIvarRefExpr(Empty);
3136  break;
3137 
3139  S = new (Context) ObjCPropertyRefExpr(Empty);
3140  break;
3141 
3143  S = new (Context) ObjCSubscriptRefExpr(Empty);
3144  break;
3145 
3147  llvm_unreachable("mismatching AST file");
3148 
3150  S = ObjCMessageExpr::CreateEmpty(Context,
3151  Record[ASTStmtReader::NumExprFields],
3152  Record[ASTStmtReader::NumExprFields + 1]);
3153  break;
3154 
3155  case EXPR_OBJC_ISA:
3156  S = new (Context) ObjCIsaExpr(Empty);
3157  break;
3158 
3160  S = new (Context) ObjCIndirectCopyRestoreExpr(Empty);
3161  break;
3162 
3164  S = new (Context) ObjCBridgedCastExpr(Empty);
3165  break;
3166 
3168  S = new (Context) ObjCForCollectionStmt(Empty);
3169  break;
3170 
3171  case STMT_OBJC_CATCH:
3172  S = new (Context) ObjCAtCatchStmt(Empty);
3173  break;
3174 
3175  case STMT_OBJC_FINALLY:
3176  S = new (Context) ObjCAtFinallyStmt(Empty);
3177  break;
3178 
3179  case STMT_OBJC_AT_TRY:
3180  S = ObjCAtTryStmt::CreateEmpty(Context,
3181  Record[ASTStmtReader::NumStmtFields],
3182  Record[ASTStmtReader::NumStmtFields + 1]);
3183  break;
3184 
3186  S = new (Context) ObjCAtSynchronizedStmt(Empty);
3187  break;
3188 
3189  case STMT_OBJC_AT_THROW:
3190  S = new (Context) ObjCAtThrowStmt(Empty);
3191  break;
3192 
3194  S = new (Context) ObjCAutoreleasePoolStmt(Empty);
3195  break;
3196 
3198  S = new (Context) ObjCBoolLiteralExpr(Empty);
3199  break;
3200 
3202  S = new (Context) ObjCAvailabilityCheckExpr(Empty);
3203  break;
3204 
3205  case STMT_SEH_LEAVE:
3206  S = new (Context) SEHLeaveStmt(Empty);
3207  break;
3208 
3209  case STMT_SEH_EXCEPT:
3210  S = new (Context) SEHExceptStmt(Empty);
3211  break;
3212 
3213  case STMT_SEH_FINALLY:
3214  S = new (Context) SEHFinallyStmt(Empty);
3215  break;
3216 
3217  case STMT_SEH_TRY:
3218  S = new (Context) SEHTryStmt(Empty);
3219  break;
3220 
3221  case STMT_CXX_CATCH:
3222  S = new (Context) CXXCatchStmt(Empty);
3223  break;
3224 
3225  case STMT_CXX_TRY:
3226  S = CXXTryStmt::Create(Context, Empty,
3227  /*numHandlers=*/Record[ASTStmtReader::NumStmtFields]);
3228  break;
3229 
3230  case STMT_CXX_FOR_RANGE:
3231  S = new (Context) CXXForRangeStmt(Empty);
3232  break;
3233 
3235  S = new (Context) MSDependentExistsStmt(SourceLocation(), true,
3238  nullptr);
3239  break;
3240 
3242  S =
3244  Record[ASTStmtReader::NumStmtFields],
3245  Empty);
3246  break;
3247 
3248  case STMT_OMP_SIMD_DIRECTIVE: {
3249  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3250  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3251  S = OMPSimdDirective::CreateEmpty(Context, NumClauses,
3252  CollapsedNum, Empty);
3253  break;
3254  }
3255 
3256  case STMT_OMP_FOR_DIRECTIVE: {
3257  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3258  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3259  S = OMPForDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3260  Empty);
3261  break;
3262  }
3263 
3265  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3266  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3267  S = OMPForSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3268  Empty);
3269  break;
3270  }
3271 
3274  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3275  break;
3276 
3278  S = OMPSectionDirective::CreateEmpty(Context, Empty);
3279  break;
3280 
3283  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3284  break;
3285 
3287  S = OMPMasterDirective::CreateEmpty(Context, Empty);
3288  break;
3289 
3292  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3293  break;
3294 
3296  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3297  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3298  S = OMPParallelForDirective::CreateEmpty(Context, NumClauses,
3299  CollapsedNum, Empty);
3300  break;
3301  }
3302 
3304  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3305  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3306  S = OMPParallelForSimdDirective::CreateEmpty(Context, NumClauses,
3307  CollapsedNum, Empty);
3308  break;
3309  }
3310 
3313  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3314  break;
3315 
3318  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3319  break;
3320 
3323  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3324  break;
3325 
3327  S = OMPTaskyieldDirective::CreateEmpty(Context, Empty);
3328  break;
3329 
3331  S = OMPBarrierDirective::CreateEmpty(Context, Empty);
3332  break;
3333 
3335  S = OMPTaskwaitDirective::CreateEmpty(Context, Empty);
3336  break;
3337 
3340  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3341  break;
3342 
3345  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3346  break;
3347 
3350  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3351  break;
3352 
3355  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3356  break;
3357 
3360  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3361  break;
3362 
3365  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3366  break;
3367 
3370  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3371  break;
3372 
3375  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3376  break;
3377 
3380  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3381  break;
3382 
3385  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3386  break;
3387 
3390  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3391  break;
3392 
3394  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3395  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3396  S = OMPTargetParallelForDirective::CreateEmpty(Context, NumClauses,
3397  CollapsedNum, Empty);
3398  break;
3399  }
3400 
3403  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3404  break;
3405 
3408  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3409  break;
3410 
3412  S = OMPCancellationPointDirective::CreateEmpty(Context, Empty);
3413  break;
3414 
3417  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3418  break;
3419 
3421  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3422  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3423  S = OMPTaskLoopDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3424  Empty);
3425  break;
3426  }
3427 
3429  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3430  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3431  S = OMPTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
3432  CollapsedNum, Empty);
3433  break;
3434  }
3435 
3437  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3438  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3439  S = OMPMasterTaskLoopDirective::CreateEmpty(Context, NumClauses,
3440  CollapsedNum, Empty);
3441  break;
3442  }
3443 
3445  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3446  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3447  S = OMPMasterTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
3448  CollapsedNum, Empty);
3449  break;
3450  }
3451 
3453  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3454  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3455  S = OMPParallelMasterTaskLoopDirective::CreateEmpty(Context, NumClauses,
3456  CollapsedNum, Empty);
3457  break;
3458  }
3459 
3461  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3462  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3464  Context, NumClauses, CollapsedNum, Empty);
3465  break;
3466  }
3467 
3469  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3470  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3471  S = OMPDistributeDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3472  Empty);
3473  break;
3474  }
3475 
3477  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3478  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3479  S = OMPDistributeParallelForDirective::CreateEmpty(Context, NumClauses,
3480  CollapsedNum, Empty);
3481  break;
3482  }
3483 
3485  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3486  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3488  CollapsedNum,
3489  Empty);
3490  break;
3491  }
3492 
3494  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3495  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3496  S = OMPDistributeSimdDirective::CreateEmpty(Context, NumClauses,
3497  CollapsedNum, Empty);
3498  break;
3499  }
3500 
3502  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3503  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3504  S = OMPTargetParallelForSimdDirective::CreateEmpty(Context, NumClauses,
3505  CollapsedNum, Empty);
3506  break;
3507  }
3508 
3510  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3511  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3512  S = OMPTargetSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3513  Empty);
3514  break;
3515  }
3516 
3518  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3519  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3520  S = OMPTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
3521  CollapsedNum, Empty);
3522  break;
3523  }
3524 
3526  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3527  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3528  S = OMPTeamsDistributeSimdDirective::CreateEmpty(Context, NumClauses,
3529  CollapsedNum, Empty);
3530  break;
3531  }
3532 
3534  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3535  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3537  Context, NumClauses, CollapsedNum, Empty);
3538  break;
3539  }
3540 
3542  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3543  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3545  Context, NumClauses, CollapsedNum, Empty);
3546  break;
3547  }
3548 
3551  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3552  break;
3553 
3555  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3556  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3557  S = OMPTargetTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
3558  CollapsedNum, Empty);
3559  break;
3560  }
3561 
3563  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3564  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3566  Context, NumClauses, CollapsedNum, Empty);
3567  break;
3568  }
3569 
3571  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3572  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3574  Context, NumClauses, CollapsedNum, Empty);
3575  break;
3576  }
3577 
3579  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3580  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3582  Context, NumClauses, CollapsedNum, Empty);
3583  break;
3584  }
3585 
3588  Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], Empty);
3589  break;
3590 
3591  case EXPR_CXX_MEMBER_CALL:
3593  Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], Empty);
3594  break;
3595 
3597  S = new (Context) CXXRewrittenBinaryOperator(Empty);
3598  break;
3599 
3600  case EXPR_CXX_CONSTRUCT:
3602  Context,
3603  /* NumArgs=*/Record[ASTStmtReader::NumExprFields]);
3604  break;
3605 
3607  S = new (Context) CXXInheritedCtorInitExpr(Empty);
3608  break;
3609 
3612  Context,
3613  /* NumArgs=*/Record[ASTStmtReader::NumExprFields]);
3614  break;
3615 
3616  case EXPR_CXX_STATIC_CAST:
3617  S = CXXStaticCastExpr::CreateEmpty(Context,
3618  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3619  break;
3620 
3621  case EXPR_CXX_DYNAMIC_CAST:
3622  S = CXXDynamicCastExpr::CreateEmpty(Context,
3623  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3624  break;
3625 
3628  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3629  break;
3630 
3631  case EXPR_CXX_CONST_CAST:
3632  S = CXXConstCastExpr::CreateEmpty(Context);
3633  break;
3634 
3636  S = CXXAddrspaceCastExpr::CreateEmpty(Context);
3637  break;
3638 
3641  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3642  break;
3643 
3644  case EXPR_BUILTIN_BIT_CAST:
3645  assert(Record[ASTStmtReader::NumExprFields] == 0 && "Wrong PathSize!");
3646  S = new (Context) BuiltinBitCastExpr(Empty);
3647  break;
3648 
3651  Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], Empty);
3652  break;
3653 
3655  S = new (Context) CXXStdInitializerListExpr(Empty);
3656  break;
3657 
3658  case EXPR_CXX_BOOL_LITERAL:
3659  S = new (Context) CXXBoolLiteralExpr(Empty);
3660  break;
3661 
3663  S = new (Context) CXXNullPtrLiteralExpr(Empty);
3664  break;
3665 
3666  case EXPR_CXX_TYPEID_EXPR:
3667  S = new (Context) CXXTypeidExpr(Empty, true);
3668  break;
3669 
3670  case EXPR_CXX_TYPEID_TYPE:
3671  S = new (Context) CXXTypeidExpr(Empty, false);
3672  break;
3673 
3674  case EXPR_CXX_UUIDOF_EXPR:
3675  S = new (Context) CXXUuidofExpr(Empty, true);
3676  break;
3677 
3679  S = new (Context) MSPropertyRefExpr(Empty);
3680  break;
3681 
3683  S = new (Context) MSPropertySubscriptExpr(Empty);
3684  break;
3685 
3686  case EXPR_CXX_UUIDOF_TYPE:
3687  S = new (Context) CXXUuidofExpr(Empty, false);
3688  break;
3689 
3690  case EXPR_CXX_THIS:
3691  S = new (Context) CXXThisExpr(Empty);
3692  break;
3693 
3694  case EXPR_CXX_THROW:
3695  S = new (Context) CXXThrowExpr(Empty);
3696  break;
3697 
3698  case EXPR_CXX_DEFAULT_ARG:
3699  S = new (Context) CXXDefaultArgExpr(Empty);
3700  break;
3701 
3702  case EXPR_CXX_DEFAULT_INIT:
3703  S = new (Context) CXXDefaultInitExpr(Empty);
3704  break;
3705 
3707  S = new (Context) CXXBindTemporaryExpr(Empty);
3708  break;
3709 
3711  S = new (Context) CXXScalarValueInitExpr(Empty);
3712  break;
3713 
3714  case EXPR_CXX_NEW:
3716  Context,
3717  /*IsArray=*/Record[ASTStmtReader::NumExprFields],
3718  /*HasInit=*/Record[ASTStmtReader::NumExprFields + 1],
3719  /*NumPlacementArgs=*/Record[ASTStmtReader::NumExprFields + 2],
3720  /*IsParenTypeId=*/Record[ASTStmtReader::NumExprFields + 3]);
3721  break;
3722 
3723  case EXPR_CXX_DELETE:
3724  S = new (Context) CXXDeleteExpr(Empty);
3725  break;
3726 
3728  S = new (Context) CXXPseudoDestructorExpr(Empty);
3729  break;
3730 
3732  S = ExprWithCleanups::Create(Context, Empty,
3733  Record[ASTStmtReader::NumExprFields]);
3734  break;
3735 
3738  Context,
3739  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields],
3740  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields + 1],
3741  /*HasFirstQualifierFoundInScope=*/
3742  Record[ASTStmtReader::NumExprFields + 2]);
3743  break;
3744 
3747  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields],
3748  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]
3749  ? Record[ASTStmtReader::NumExprFields + 1]
3750  : 0);
3751  break;
3752 
3755  /*NumArgs=*/Record[ASTStmtReader::NumExprFields]);
3756  break;
3757 
3760  Context,
3761  /*NumResults=*/Record[ASTStmtReader::NumExprFields],
3762  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields + 1],
3763  /*NumTemplateArgs=*/
3764  Record[ASTStmtReader::NumExprFields + 1]
3765  ? Record[ASTStmtReader::NumExprFields + 2]
3766  : 0);
3767  break;
3768 
3771  Context,
3772  /*NumResults=*/Record[ASTStmtReader::NumExprFields],
3773  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields + 1],
3774  /*NumTemplateArgs=*/
3775  Record[ASTStmtReader::NumExprFields + 1]
3776  ? Record[ASTStmtReader::NumExprFields + 2]
3777  : 0);
3778  break;
3779 
3780  case EXPR_TYPE_TRAIT:
3782  Record[ASTStmtReader::NumExprFields]);
3783  break;
3784 
3785  case EXPR_ARRAY_TYPE_TRAIT:
3786  S = new (Context) ArrayTypeTraitExpr(Empty);
3787  break;
3788 
3790  S = new (Context) ExpressionTraitExpr(Empty);
3791  break;
3792 
3793  case EXPR_CXX_NOEXCEPT:
3794  S = new (Context) CXXNoexceptExpr(Empty);
3795  break;
3796 
3797  case EXPR_PACK_EXPANSION:
3798  S = new (Context) PackExpansionExpr(Empty);
3799  break;
3800 
3801  case EXPR_SIZEOF_PACK:
3803  Context,
3804  /*NumPartialArgs=*/Record[ASTStmtReader::NumExprFields]);
3805  break;
3806 
3808  S = new (Context) SubstNonTypeTemplateParmExpr(Empty);
3809  break;
3810 
3812  S = new (Context) SubstNonTypeTemplateParmPackExpr(Empty);
3813  break;
3814 
3817  Record[ASTStmtReader::NumExprFields]);
3818  break;
3819 
3821  S = new (Context) MaterializeTemporaryExpr(Empty);
3822  break;
3823 
3824  case EXPR_CXX_FOLD:
3825  S = new (Context) CXXFoldExpr(Empty);
3826  break;
3827 
3828  case EXPR_OPAQUE_VALUE:
3829  S = new (Context) OpaqueValueExpr(Empty);
3830  break;
3831 
3832  case EXPR_CUDA_KERNEL_CALL:
3834  Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], Empty);
3835  break;
3836 
3837  case EXPR_ASTYPE:
3838  S = new (Context) AsTypeExpr(Empty);
3839  break;
3840 
3841  case EXPR_PSEUDO_OBJECT: {
3842  unsigned numSemanticExprs = Record[ASTStmtReader::NumExprFields];
3843  S = PseudoObjectExpr::Create(Context, Empty, numSemanticExprs);
3844  break;
3845  }
3846 
3847  case EXPR_ATOMIC:
3848  S = new (Context) AtomicExpr(Empty);
3849  break;
3850 
3851  case EXPR_LAMBDA: {
3852  unsigned NumCaptures = Record[ASTStmtReader::NumExprFields];
3853  S = LambdaExpr::CreateDeserialized(Context, NumCaptures);
3854  break;
3855  }
3856 
3857  case STMT_COROUTINE_BODY: {
3858  unsigned NumParams = Record[ASTStmtReader::NumStmtFields];
3859  S = CoroutineBodyStmt::Create(Context, Empty, NumParams);
3860  break;
3861  }
3862 
3863  case STMT_CORETURN:
3864  S = new (Context) CoreturnStmt(Empty);
3865  break;
3866 
3867  case EXPR_COAWAIT:
3868  S = new (Context) CoawaitExpr(Empty);
3869  break;
3870 
3871  case EXPR_COYIELD:
3872  S = new (Context) CoyieldExpr(Empty);
3873  break;
3874 
3876  S = new (Context) DependentCoawaitExpr(Empty);
3877  break;
3878 
3880  unsigned numTemplateArgs = Record[ASTStmtReader::NumExprFields];
3881  S = ConceptSpecializationExpr::Create(Context, Empty, numTemplateArgs);
3882  break;
3883  }
3884 
3885  case EXPR_REQUIRES:
3886  unsigned numLocalParameters = Record[ASTStmtReader::NumExprFields];
3887  unsigned numRequirement = Record[ASTStmtReader::NumExprFields + 1];
3888  S = RequiresExpr::Create(Context, Empty, numLocalParameters,
3889  numRequirement);
3890  break;
3891  }
3892 
3893  // We hit a STMT_STOP, so we're done with this expression.
3894  if (Finished)
3895  break;
3896 
3897  ++NumStatementsRead;
3898 
3899  if (S && !IsStmtReference) {
3900  Reader.Visit(S);
3901  StmtEntries[Cursor.GetCurrentBitNo()] = S;
3902  }
3903 
3904  assert(Record.getIdx() == Record.size() &&
3905  "Invalid deserialization of statement");
3906  StmtStack.push_back(S);
3907  }
3908 Done:
3909  assert(StmtStack.size() > PrevNumStmts && "Read too many sub-stmts!");
3910  assert(StmtStack.size() == PrevNumStmts + 1 && "Extra expressions on stack!");
3911  return StmtStack.pop_back_val();
3912 }
void setPreInits(Stmt *PreInits)
Definition: StmtOpenMP.h:618
void setCombinedParForInDistCond(Expr *CombParForInDistCond)
Definition: StmtOpenMP.h:737
static AttributedStmt * CreateEmpty(const ASTContext &C, unsigned NumAttrs)
Definition: Stmt.cpp:364
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:614
A PredefinedExpr record.
Definition: ASTBitCodes.h:1574
void setCond(Expr *Cond)
Definition: Stmt.h:2319
A call to an overloaded operator written using operator syntax.
Definition: ExprCXX.h:82
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
Definition: ExprObjC.h:1566
The receiver is the instance of the superclass object.
Definition: ExprObjC.h:1097
Represents a single C99 designator.
Definition: Expr.h:4933
void setConditionVariable(const ASTContext &C, VarDecl *V)
Definition: Stmt.cpp:938
static DependentScopeDeclRefExpr * CreateEmpty(const ASTContext &Context, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition: ExprCXX.cpp:480
Defines the clang::ASTContext interface.
void setRParenLoc(SourceLocation L)
Definition: ExprCXX.h:1726
A CompoundLiteralExpr record.
Definition: ASTBitCodes.h:1637
This represents &#39;#pragma omp distribute simd&#39; composite directive.
Definition: StmtOpenMP.h:3975
This represents &#39;#pragma omp master&#39; directive.
Definition: StmtOpenMP.h:1628
ConstantExprBitfields ConstantExprBits
Definition: Stmt.h:1016
DesignatorTypes
The kinds of designators that can occur in a DesignatedInitExpr.
Definition: ASTBitCodes.h:1959
void setRangeStmt(Stmt *S)
Definition: StmtCXX.h:193
static OMPDepobjDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:782
SourceLocation readSourceLocation()
Read a source location, advancing Idx.
The null pointer literal (C++11 [lex.nullptr])
Definition: ExprCXX.h:729
unsigned getNumDecls() const
Gets the number of declarations in the unresolved set.
Definition: ExprCXX.h:2937
This represents &#39;#pragma omp task&#39; directive.
Definition: StmtOpenMP.h:2062
void setEnsureUpperBound(Expr *EUB)
Definition: StmtOpenMP.h:649
This represents a GCC inline-assembly statement extension.
Definition: Stmt.h:2919
static CXXConstructExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs)
Create an empty C++ construction expression.
Definition: ExprCXX.cpp:1011
Represents a &#39;co_await&#39; expression while the type of the promise is dependent.
Definition: ExprCXX.h:4719
void setSubStmt(CompoundStmt *S)
Definition: Expr.h:4205
static OMPMasterTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
The receiver is an object instance.
Definition: ExprObjC.h:1091
unsigned getNumInputs() const
Definition: Stmt.h:2831
static OMPMasterDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:421
UnresolvedMemberExprBitfields UnresolvedMemberExprBits
Definition: Stmt.h:1058
An IndirectGotoStmt record.
Definition: ASTBitCodes.h:1547
A (possibly-)qualified type.
Definition: Type.h:655
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument.
Definition: Stmt.h:3591
StringKind getKind() const
Definition: Expr.h:1847
An AddrLabelExpr record.
Definition: ASTBitCodes.h:1667
void setInc(Expr *E)
Definition: StmtCXX.h:197
void setOperatorLoc(SourceLocation L)
Definition: Expr.h:2590
CXXDeleteExprBitfields CXXDeleteExprBits
Definition: Stmt.h:1049
void setRParenLoc(SourceLocation L)
Definition: Stmt.h:2369
Helper expressions and declaration for OMPIteratorExpr class for each iteration space.
Definition: ExprOpenMP.h:235
void setNRVOCandidate(const VarDecl *Var)
Set the variable that might be used for the named return value optimization.
Definition: Stmt.h:2727
Defines enumerations for the type traits support.
void setLocation(SourceLocation L)
Definition: ExprCXX.h:710
A requires-expression requirement which queries the validity and properties of an expression (&#39;simple...
Definition: ExprConcepts.h:254
A CXXStaticCastExpr record.
Definition: ASTBitCodes.h:1798
ASTStmtReader(ASTRecordReader &Record, llvm::BitstreamCursor &Cursor)
void setLParenLoc(SourceLocation L)
Definition: Stmt.h:2367
void setCombinedCond(Expr *CombCond)
Definition: StmtOpenMP.h:717
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2619
An AttributedStmt record.
Definition: ASTBitCodes.h:1526
A CXXReinterpretCastExpr record.
Definition: ASTBitCodes.h:1804
static OMPIteratorExpr * CreateEmpty(const ASTContext &Context, unsigned NumIterators)
Definition: Expr.cpp:4978
An ObjCBoolLiteralExpr record.
Definition: ASTBitCodes.h:1763
void setCombinedLowerBoundVariable(Expr *CombLB)
Definition: StmtOpenMP.h:697
void setRHS(Expr *E)
Definition: Expr.h:2647
static OMPTaskwaitDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:671
static OMPTargetParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:914
static ConstraintSatisfaction readConstraintSatisfaction(ASTRecordReader &Record)
void setHasCancel(bool Has)
Set cancel state.
Definition: StmtOpenMP.h:1554
Represents a &#39;co_return&#39; statement in the C++ Coroutines TS.
Definition: StmtCXX.h:456
Stmt - This represents one statement.
Definition: Stmt.h:68
static OMPTaskgroupDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:692
void setLastIteration(Expr *LI)
Definition: StmtOpenMP.h:604
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition: Expr.h:2909
IfStmt - This represents an if/then/else.
Definition: Stmt.h:1866
void setPrivateCounters(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:118
void setLParenLoc(SourceLocation L)
Definition: ExprOpenMP.h:367
void setArrow(bool A)
Definition: ExprObjC.h:1510
C Language Family Type Representation.
unsigned getNumOutputs() const
Definition: Stmt.h:2809
This represents &#39;#pragma omp for simd&#39; directive.
Definition: StmtOpenMP.h:1361
void setOpcode(Opcode Opc)
Definition: Expr.h:3691
void setRParenLoc(SourceLocation L)
Definition: Stmt.h:2943
void setContinueLoc(SourceLocation L)
Definition: Stmt.h:2620
void setThrowExpr(Stmt *S)
Definition: StmtObjC.h:346
void setAtLoc(SourceLocation L)
Definition: ExprObjC.h:473
An ImplicitValueInitExpr record.
Definition: ASTBitCodes.h:1661
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:89
void setDeclGroup(DeclGroupRef DGR)
Definition: Stmt.h:1277
An ImplicitCastExpr record.
Definition: ASTBitCodes.h:1631
This represents &#39;#pragma omp teams distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:4389
Expr * CounterUpdate
Updater for the internal counter: ++CounterVD;.
Definition: ExprOpenMP.h:245
void setRBracket(SourceLocation RB)
Definition: ExprObjC.h:872
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Definition: Expr.h:5300
void setType(QualType t)
Definition: Expr.h:143
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:3027
A BuiltinBitCastExpr record.
Definition: ASTBitCodes.h:1816
Defines the C++ template declaration subclasses.
void setPrevEnsureUpperBound(Expr *PrevEUB)
Definition: StmtOpenMP.h:692
This represents &#39;#pragma omp parallel master&#39; directive.
Definition: StmtOpenMP.h:1913
unsigned getNumSubExprs() const
Retrieve the total number of subexpressions in this designated initializer expression, including the actual initialized value and any expressions that occur within array and array-range designators.
Definition: Expr.h:5108
An MatrixSubscriptExpr record.
Definition: ASTBitCodes.h:1613
Represents an attribute applied to a statement.
Definition: Stmt.h:1808
void setUpperBoundVariable(Expr *UB)
Definition: StmtOpenMP.h:635
void setComputationResultType(QualType T)
Definition: Expr.h:3929
void setNumIterations(Expr *NI)
Definition: StmtOpenMP.h:670
ParenExpr - This represents a parethesized expression, e.g.
Definition: Expr.h:2080
A CXXOperatorCallExpr record.
Definition: ASTBitCodes.h:1780
static FixedPointLiteral * Create(const ASTContext &C, EmptyShell Empty)
Returns an empty fixed-point literal.
Definition: Expr.cpp:918
void setSuper(SourceLocation Loc, QualType T, bool IsInstanceSuper)
Definition: ExprObjC.h:1333
This represents &#39;#pragma omp target teams distribute&#39; combined directive.
Definition: StmtOpenMP.h:4541
A CXXTemporaryObjectExpr record.
Definition: ASTBitCodes.h:1795
Represents Objective-C&#39;s @throw statement.
Definition: StmtObjC.h:332
static OMPParallelMasterDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:573
void setNextLowerBound(Expr *NLB)
Definition: StmtOpenMP.h:656
static RequiresExpr * Create(ASTContext &C, SourceLocation RequiresKWLoc, RequiresExprBodyDecl *Body, ArrayRef< ParmVarDecl *> LocalParameters, ArrayRef< concepts::Requirement *> Requirements, SourceLocation RBraceLoc)
DeclRefExprBitfields DeclRefExprBits
Definition: Stmt.h:1018
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1426
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:841
void setADLCallKind(ADLCallKind V=UsesADL)
Definition: Expr.h:2890
unsigned NumOutputs
Definition: Stmt.h:2774
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent...
Definition: ExprCXX.h:2707
A constant expression context.
Definition: ASTBitCodes.h:1571
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
Definition: Specifiers.h:115
void setRParenLoc(SourceLocation L)
Definition: ExprOpenMP.h:370
A container of type source information.
Definition: Type.h:6373
void setSwitchCaseList(SwitchCase *SC)
Definition: Stmt.h:2206
Stmt * SubExpr
Definition: Expr.h:973
void setCanOverflow(bool C)
Definition: Expr.h:2192
void setInstanceReceiver(Expr *rec)
Turn this message send into an instance message that computes the receiver object with the given expr...
Definition: ExprObjC.h:1262
This represents &#39;#pragma omp parallel for&#39; directive.
Definition: StmtOpenMP.h:1752
MS property subscript expression.
Definition: ExprCXX.h:960
void setStartLoc(SourceLocation L)
Definition: Stmt.h:1279
void setForLoc(SourceLocation L)
Definition: Stmt.h:2498
This represents &#39;#pragma omp target teams distribute parallel for&#39; combined directive.
Definition: StmtOpenMP.h:4610
Expr * Update
Update expression for the originally specified iteration variable, calculated as VD = Begin + Counter...
Definition: ExprOpenMP.h:243
static ObjCDictionaryLiteral * CreateEmpty(const ASTContext &C, unsigned NumElements, bool HasPackExpansions)
Definition: ExprObjC.cpp:88
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
Definition: ExprCXX.h:4406
float __ovld __cnfn distance(float p0, float p1)
Returns the distance between p0 and p1.
void setLocation(SourceLocation L)
Definition: ExprObjC.h:590
void setDependentInits(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:150
VarDecl * CounterVD
Internal normalized counter.
Definition: ExprOpenMP.h:237
void setDelegateInitCall(bool isDelegate)
Definition: ExprObjC.h:1404
void setProtocol(ObjCProtocolDecl *P)
Definition: ExprObjC.h:522
void setRParenLoc(SourceLocation L)
Definition: ExprCXX.h:3431
void setIsLastIterVariable(Expr *IL)
Definition: StmtOpenMP.h:621
This represents &#39;#pragma omp target exit data&#39; directive.
Definition: StmtOpenMP.h:2824
void setRAngleLoc(SourceLocation Loc)
Definition: TemplateBase.h:576
static OffsetOfExpr * CreateEmpty(const ASTContext &C, unsigned NumComps, unsigned NumExprs)
Definition: Expr.cpp:1505
static OMPTargetTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Represents a variable declaration or definition.
Definition: Decl.h:820
static OMPParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:179
bool hasTemplateKWAndArgsInfo() const
Definition: Expr.h:1309
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC &#39;id&#39; type.
Definition: ExprObjC.h:1482
void setIsPartOfExplicitCast(bool PartOfExplicitCast)
Definition: Expr.h:3504
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:3303
static CompoundAssignOperator * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
Definition: Expr.cpp:4524
void setSubExpr(unsigned Idx, Expr *E)
Definition: Expr.h:5115
void setInitializer(Expr *E)
Definition: Expr.h:3328
void setLength(Expr *E)
Set length of the array section.
Definition: ExprOpenMP.h:105
void setOpLoc(SourceLocation L)
Definition: ExprObjC.h:1518
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
Definition: ExprCXX.h:2668
void setStoredFPFeatures(FPOptionsOverride F)
Set FPFeatures in trailing storage, used only by Serialization.
Definition: Expr.h:3835
static FunctionParmPackExpr * CreateEmpty(const ASTContext &Context, unsigned NumParams)
Definition: ExprCXX.cpp:1569
void setAsmLoc(SourceLocation L)
Definition: Stmt.h:2791
AttributedStmtBitfields AttributedStmtBits
Definition: Stmt.h:1002
static PredefinedExpr * CreateEmpty(const ASTContext &Ctx, bool HasFunctionName)
Create an empty PredefinedExpr.
Definition: Expr.cpp:582
void setCombinedDistCond(Expr *CombDistCond)
Definition: StmtOpenMP.h:732
void setValue(unsigned Val)
Definition: Expr.h:1589
ASTConstraintSatisfaction * Satisfaction
Information about the satisfaction of the named concept with the given arguments. ...
Definition: ExprConcepts.h:56
void setLocation(SourceLocation Location)
Definition: Expr.h:1531
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
Definition: TemplateBase.h:605
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition: ExprCXX.h:761
static DeclRefExpr * CreateEmpty(const ASTContext &Context, bool HasQualifier, bool HasFoundDecl, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Construct an empty declaration reference expression.
Definition: Expr.cpp:472
Stores a list of template parameters for a TemplateDecl and its derived classes.
Definition: DeclTemplate.h:69
unsigned getNumPlacementArgs() const
Definition: ExprCXX.h:2229
void setGNUSyntax(bool GNU)
Definition: Expr.h:5093
Defines the Objective-C statement AST node classes.
A CXXConstructExpr record.
Definition: ASTBitCodes.h:1789
unsigned getNumExpressions() const
Definition: Expr.h:2490
void setBeginStmt(Stmt *S)
Definition: StmtCXX.h:194
void setBase(Expr *E)
Set base of the array section.
Definition: ExprOpenMP.h:88
ReceiverKind
The kind of receiver this message is sending to.
Definition: ExprObjC.h:1086
raw_arg_iterator raw_arg_begin()
Definition: ExprCXX.h:2321
A C++ throw-expression (C++ [except.throw]).
Definition: ExprCXX.h:1147
Represents an expression – generally a full-expression – that introduces cleanups to be run at the ...
Definition: ExprCXX.h:3296
Represents a parameter to a function.
Definition: Decl.h:1595
void setInit(Expr *Init)
Definition: StmtOpenMP.h:616
Defines the clang::Expr interface and subclasses for C++ expressions.
void setThen(Stmt *Then)
Definition: Stmt.h:1958
void setTarget(Expr *E)
Definition: Stmt.h:2585
A ShuffleVectorExpr record.
Definition: ASTBitCodes.h:1682
A C++ static_cast expression (C++ [expr.static.cast]).
Definition: ExprCXX.h:420
void setRParenLoc(SourceLocation L)
Definition: ExprOpenMP.h:196
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:1764
static OMPTargetExitDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
void setAtLoc(SourceLocation L)
Definition: ExprObjC.h:70
Represents a C99 designated initializer expression.
Definition: Expr.h:4858
An OffsetOfExpr record.
Definition: ASTBitCodes.h:1604
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition: Decl.h:272
MatchType Type
static OMPTargetTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
One of these records is kept for each identifier that is lexed.
An ObjCAtThrowStmt record.
Definition: ASTBitCodes.h:1757
T * readDeclAs()
Reads a declaration from the given position in the record, advancing Idx.
static OMPTargetDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:886
Step
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(), or __builtin_FILE().
Definition: Expr.h:4519
A DesignatedInitExpr record.
Definition: ASTBitCodes.h:1646
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
Definition: ExprConcepts.h:471
This represents &#39;#pragma omp parallel&#39; directive.
Definition: StmtOpenMP.h:357
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition: Expr.h:4234
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:174
A C++ nested-name-specifier augmented with source location information.
void setLHS(Expr *E)
Definition: Expr.h:2643
static OMPTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Internal struct for storing Key/value pair.
Definition: ExprObjC.h:286
Frontend produces RecoveryExprs on semantic errors that prevent creating other well-formed expression...
Definition: Expr.h:6246
void setKeyExpr(Stmt *S)
Definition: ExprObjC.h:884
static OMPTargetParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:966
static ObjCMessageExpr * CreateEmpty(const ASTContext &Context, unsigned NumArgs, unsigned NumStoredSelLocs)
Create an empty Objective-C message expression, to be filled in by subsequent calls.
Definition: ExprObjC.cpp:232
void setIsMicrosoftABI(bool IsMS)
Definition: Expr.h:4492
An explicit cast in C or a C-style cast in C++, which uses the syntax ([s1][s2]...[sn])expr.
Definition: ExprOpenMP.h:146
Represents a place-holder for an object not to be initialized by anything.
Definition: Expr.h:5156
Expr * readExpr()
Reads an expression.
static OMPFlushDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:760
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Definition: Expr.h:4436
void setArg(unsigned I, Expr *E)
Definition: ExprCXX.h:3467
void setArg(unsigned Arg, Expr *ArgExpr)
setArg - Set the specified argument.
Definition: Expr.h:2932
The iterator over UnresolvedSets.
Definition: UnresolvedSet.h:32
void setRParen(SourceLocation Loc)
Definition: Expr.h:2108
This represents &#39;#pragma omp target simd&#39; directive.
Definition: StmtOpenMP.h:4113
void setCapturedDecl(CapturedDecl *D)
Set the outlined function declaration.
Definition: Stmt.cpp:1311
void setReturnLoc(SourceLocation L)
Definition: Stmt.h:2734
Represents a C++ member access expression for which lookup produced a set of overloaded functions...
Definition: ExprCXX.h:3763
Defines some OpenMP-specific enums and functions.
void setCond(Expr *Cond)
Definition: Stmt.h:2143
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:5736
OpenMPDirectiveKind getDirectiveKind() const
Definition: StmtOpenMP.h:301
void setIfLoc(SourceLocation IfLoc)
Definition: Stmt.h:2026
This represents &#39;#pragma omp barrier&#39; directive.
Definition: StmtOpenMP.h:2177
void setComponent(unsigned Idx, OffsetOfNode ON)
Definition: Expr.h:2466
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp, [NSNumber numberWithInt:42]];.
Definition: ExprObjC.h:190
unsigned getCharByteWidth() const
Definition: Expr.h:1845
This is a common base class for loop directives (&#39;omp simd&#39;, &#39;omp for&#39;, &#39;omp for simd&#39; etc...
Definition: StmtOpenMP.h:433
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition: ExprCXX.h:4256
void setSubStmt(Stmt *S)
Definition: Stmt.h:1656
This represents &#39;#pragma omp critical&#39; directive.
Definition: StmtOpenMP.h:1677
static OMPCriticalDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:443
void setRParenLoc(SourceLocation L)
Definition: Expr.h:4213
void setCond(Expr *Cond)
Definition: StmtOpenMP.h:613
size_t size() const
The length of this record.
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:989
Represents Objective-C&#39;s @catch statement.
Definition: StmtObjC.h:77
void setLBraceLoc(SourceLocation Loc)
Definition: Expr.h:4770
static OMPTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
IndirectGotoStmt - This represents an indirect goto.
Definition: Stmt.h:2561
Describes an C or C++ initializer list.
Definition: Expr.h:4627
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition: ExprCXX.h:809
This represents &#39;#pragma omp distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:3811
void setValue(const ASTContext &C, const llvm::APInt &Val)
Definition: Expr.h:1446
This represents &#39;#pragma omp teams distribute parallel for simd&#39; composite directive.
Definition: StmtOpenMP.h:4318
void setBuiltinLoc(SourceLocation L)
Definition: Expr.h:4253
BinaryOperatorKind
void setSubExpr(Expr *E)
Definition: Expr.h:2097
void setBase(Expr *E)
Definition: Expr.h:2718
void setLHS(Expr *E)
Definition: Expr.h:4404
unsigned getLength() const
Definition: Expr.h:1844
ForStmt - This represents a &#39;for (init;cond;inc)&#39; stmt.
Definition: Stmt.h:2451
void setOperatorNew(FunctionDecl *D)
Definition: ExprCXX.h:2212
static DeclAccessPair make(NamedDecl *D, AccessSpecifier AS)
__device__ int
void setLocation(SourceLocation L)
Definition: ExprCXX.h:744
CXXScalarValueInitExprBitfields CXXScalarValueInitExprBits
Definition: Stmt.h:1047
static OMPDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setSynchBody(Stmt *S)
Definition: StmtObjC.h:303
A convenient class for passing around template argument information.
Definition: TemplateBase.h:556
static RecoveryExpr * CreateEmpty(ASTContext &Ctx, unsigned NumSubExprs)
Definition: Expr.cpp:4802
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
void setSelector(Selector S)
Definition: ExprObjC.h:469
A reference to a previously [de]serialized Stmt record.
Definition: ASTBitCodes.h:1508
void setEndLoc(SourceLocation L)
Definition: Stmt.h:1281
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
Definition: ExprCXX.h:1949
path_iterator path_begin()
Definition: Expr.h:3432
void setLocation(SourceLocation L)
Definition: ExprObjC.h:108
OpenMP 5.0 [2.1.6 Iterators] Iterators are identifiers that expand to multiple values in the clause o...
Definition: ExprOpenMP.h:272
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: ExprCXX.h:3705
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3644
static OMPTargetTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setAccessor(IdentifierInfo *II)
Definition: Expr.h:5758
CXXForRangeStmt - This represents C++0x [stmt.ranged]&#39;s ranged for statement, represented as &#39;for (ra...
Definition: StmtCXX.h:134
static OMPParallelMasterTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
llvm::Error Error
SourceRange readSourceRange()
Read a source range, advancing Idx.
static const unsigned NumStmtFields
The number of record fields required for the Stmt class itself.
This represents &#39;#pragma omp cancellation point&#39; directive.
Definition: StmtOpenMP.h:3115
void setString(StringLiteral *S)
Definition: ExprObjC.h:67
void setAsmString(StringLiteral *E)
Definition: Stmt.h:2949
ObjCStringLiteral, used for Objective-C string literals i.e.
Definition: ExprObjC.h:52
std::pair< SourceLocation, StringRef > SubstitutionDiagnostic
Definition: ASTConcept.h:44
CaseStmt - Represent a case statement.
Definition: Stmt.h:1532
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
Definition: Expr.h:6189
void setCombinedInit(Expr *CombInit)
Definition: StmtOpenMP.h:712
void setLHS(Expr *Val)
Definition: Stmt.h:1629
This represents &#39;#pragma omp teams&#39; directive.
Definition: StmtOpenMP.h:3057
void setOperatorLoc(SourceLocation L)
Definition: Expr.h:2448
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:3373
Helper class for OffsetOfExpr.
Definition: Expr.h:2308
A marker record that indicates that we are at the end of an expression.
Definition: ASTBitCodes.h:1502
void setInit(Stmt *Init)
Definition: Stmt.h:2166
This represents &#39;#pragma omp teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:4247
static OMPTargetParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Represents binding an expression to a temporary.
Definition: ExprCXX.h:1378
void setDestroyedType(IdentifierInfo *II, SourceLocation Loc)
Set the name of destroyed type for a dependent pseudo-destructor expression.
Definition: ExprCXX.h:2585
ArrayTypeTrait
Names for the array type traits.
Definition: TypeTraits.h:42
const llvm::fltSemantics & getSemantics() const
Return the APFloat semantics this literal uses.
Definition: Expr.h:1640
bool isOpenMPWorksharingDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a worksharing directive.
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition: ExprCXX.h:1822
static OMPTaskyieldDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:643
void setCond(Expr *E)
Definition: Stmt.h:2493
static IntegerLiteral * Create(const ASTContext &C, const llvm::APInt &V, QualType type, SourceLocation l)
Returns a new integer literal with value &#39;V&#39; and type &#39;type&#39;.
Definition: Expr.cpp:888
void setOpcode(Opcode Opc)
Definition: Expr.h:2176
void ReadTemplateKWAndArgsInfo(ASTTemplateKWAndArgsInfo &Args, TemplateArgumentLoc *ArgsLocArray, unsigned NumTemplateArgs)
Read and initialize a ExplicitTemplateArgumentList structure.
DeclAccessPair * getTrailingResults()
Return the results. Defined after UnresolvedMemberExpr.
Definition: ExprCXX.h:3917
bool needsCleanup() const
Returns whether the object performed allocations.
Definition: APValue.cpp:335
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3503
This represents &#39;#pragma omp scan&#39; directive.
Definition: StmtOpenMP.h:4848
static OMPParallelMasterTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setRParenLoc(SourceLocation Loc)
Definition: StmtObjC.h:55
void setRParenLoc(SourceLocation R)
Definition: Expr.h:2452
void setColonLocSecond(SourceLocation L)
Definition: ExprOpenMP.h:122
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1207
bool isTypeOperand() const
Definition: ExprCXX.h:1052
void setSourceRange(SourceRange R)
Definition: ExprCXX.h:1073
unsigned NumClobbers
Definition: Stmt.h:2776
void setRParenLoc(SourceLocation L)
Definition: Expr.h:3611
Represents the this expression in C++.
Definition: ExprCXX.h:1108
void setCastKind(CastKind K)
Definition: Expr.h:3407
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
Definition: TemplateBase.h:652
static OMPTargetDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:990
static OMPTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
PredefinedExprBitfields PredefinedExprBits
Definition: Stmt.h:1017
void setEqualOrColonLoc(SourceLocation L)
Definition: Expr.h:5084
This represents &#39;#pragma omp target parallel for simd&#39; directive.
Definition: StmtOpenMP.h:4043
void setDependentCounters(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:143
void setArgument(Expr *E)
Definition: Expr.h:2574
OpenMP 5.0 [2.1.5, Array Sections].
Definition: ExprOpenMP.h:56
void setTypeSourceInfo(TypeSourceInfo *tsi)
Definition: Expr.h:2457
ConditionalOperator - The ?: ternary operator.
Definition: Expr.h:3982
static OMPTargetSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents &#39;#pragma omp depobj&#39; directive.
Definition: StmtOpenMP.h:2400
TypeSourceInfo * readTypeSourceInfo()
Reads a declarator info from the given record, advancing Idx.
Definition: ASTReader.cpp:6792
void setLParenLoc(SourceLocation L)
Definition: ExprOpenMP.h:193
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition: ExprCXX.h:2471
void setAmpAmpLoc(SourceLocation L)
Definition: Expr.h:4157
void setBreakLoc(SourceLocation L)
Definition: Stmt.h:2650
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
Definition: ExprCXX.h:3923
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:1364
A requires-expression requirement which queries the existence of a type name or type template special...
Definition: ExprConcepts.h:199
void setBlockDecl(BlockDecl *BD)
Definition: Expr.h:5810
This represents &#39;#pragma omp taskgroup&#39; directive.
Definition: StmtOpenMP.h:2269
static OMPSingleDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:400
CastKind
CastKind - The kind of operation required for a conversion.
void setSemiLoc(SourceLocation L)
Definition: Stmt.h:1341
The FPOptions override type is value of the new FPOptions plus a mask showing which fields are actual...
Definition: LangOptions.h:458
void setSubExpr(Expr *E)
Definition: Expr.h:2179
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
Definition: Expr.h:2517
void setLParen(SourceLocation Loc)
Definition: Expr.h:2104
void setDependence(ExprDependence Deps)
Each concrete expr subclass is expected to compute its dependence and call this in the constructor...
Definition: Expr.h:135
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition: Expr.h:999
Represents a call to the builtin function __builtin_va_arg.
Definition: Expr.h:4470
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
Definition: ASTConcept.h:29
static OMPTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setLeaveLoc(SourceLocation L)
Definition: Stmt.h:3389
void setConditionVariable(const ASTContext &Ctx, VarDecl *V)
Set the condition variable for this if statement.
Definition: Stmt.cpp:893
This represents &#39;#pragma omp distribute&#39; directive.
Definition: StmtOpenMP.h:3685
SubstNonTypeTemplateParmExprBitfields SubstNonTypeTemplateParmExprBits
Definition: Stmt.h:1060
void setInits(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:125
void setOperatorDelete(FunctionDecl *D)
Definition: ExprCXX.h:2214
void setRParenLoc(SourceLocation L)
Definition: Stmt.h:2429
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type...
Definition: ExprCXX.h:2047
void setLocation(SourceLocation Location)
Definition: Expr.h:1587
void setIteratorKwLoc(SourceLocation L)
Definition: ExprOpenMP.h:373
void setRParenLoc(SourceLocation Loc)
Definition: StmtObjC.h:108
static OMPSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:221
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:619
This represents one expression.
Definition: Expr.h:110
Defines the clang::LangOptions interface.
CXXRewrittenBinaryOperatorBitfields CXXRewrittenBinaryOperatorBits
Definition: Stmt.h:1040
void setDesignators(const ASTContext &C, const Designator *Desigs, unsigned NumDesigs)
Definition: Expr.cpp:4332
void setRBraceLoc(SourceLocation Loc)
Definition: Expr.h:4772
llvm::PointerUnion< BlockDecl *, CompoundLiteralExpr * > CleanupObject
The type of objects that are kept in the cleanup.
Definition: ExprCXX.h:3306
void setInit(Stmt *Init)
Definition: Stmt.h:2019
void setIsImplicit(bool value=true)
Definition: ExprCXX.h:4710
SourceLocation End
void setWhileLoc(SourceLocation L)
Definition: Stmt.h:2364
void setCallee(Expr *F)
Definition: Expr.h:2885
Represents the body of a requires-expression.
Definition: DeclCXX.h:1938
void setRParenLoc(SourceLocation L)
Definition: Expr.h:4256
void setLParenLoc(SourceLocation L)
Definition: Stmt.h:2500
void setBase(Expr *Base)
Definition: Expr.h:5213
Stmt * ReadStmt(ModuleFile &F)
Reads a statement.
static CXXMemberCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, EmptyShell Empty)
Definition: ExprCXX.cpp:617
This represents &#39;#pragma omp master taskloop&#39; directive.
Definition: StmtOpenMP.h:3385
static OMPMasterTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setSyntacticForm(InitListExpr *Init)
Definition: Expr.h:4785
Represents a C++ functional cast expression that builds a temporary object.
Definition: ExprCXX.h:1754
static ReturnStmt * CreateEmpty(const ASTContext &Ctx, bool HasNRVOCandidate)
Create an empty return statement, optionally with storage for an NRVO candidate.
Definition: Stmt.cpp:1105
void setRBracketLoc(SourceLocation L)
Definition: ExprOpenMP.h:125
A C++ const_cast expression (C++ [expr.const.cast]).
Definition: ExprCXX.h:538
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:5796
Field designator where only the field name is known.
Definition: ASTBitCodes.h:1961
static OMPDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Expected< unsigned > readRecord(llvm::BitstreamCursor &Cursor, unsigned AbbrevID)
Reads a record with id AbbrevID from Cursor, resetting the internal state.
Defines an enumeration for C++ overloaded operators.
This represents &#39;#pragma omp target teams distribute parallel for simd&#39; combined directive.
Definition: StmtOpenMP.h:4707
void setRHS(Expr *E)
Definition: Expr.h:3696
void setInc(Expr *E)
Definition: Stmt.h:2494
raw_arg_iterator raw_arg_end()
Definition: ExprCXX.h:2322
static CXXReinterpretCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
Definition: ExprCXX.cpp:786
#define bool
Definition: stdbool.h:15
void setWrittenTypeInfo(TypeSourceInfo *TI)
Definition: Expr.h:4495
void setRetValue(Expr *E)
Definition: Stmt.h:2712
void setBody(Stmt *S)
Definition: Stmt.h:2495
unsigned getNumTemplateArgs() const
Definition: ExprCXX.h:2993
A CXXAddrspaceCastExpr record.
Definition: ASTBitCodes.h:1810
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
Definition: ExprObjC.h:306
void setObjectKind(ExprObjectKind Cat)
setObjectKind - Set the object kind produced by this expression.
Definition: Expr.h:449
bool hasQualifier() const
Determine whether this declaration reference was preceded by a C++ nested-name-specifier, e.g., N::foo.
Definition: Expr.h:1277
void setBody(Stmt *Body)
Definition: Stmt.h:2152
static UserDefinedLiteral * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, EmptyShell Empty)
Definition: ExprCXX.cpp:871
Represents Objective-C&#39;s @synchronized statement.
Definition: StmtObjC.h:277
ObjCSelectorExpr used for @selector in Objective-C.
Definition: ExprObjC.h:454
SourceLocation Begin
A CXXStdInitializerListExpr record.
Definition: ASTBitCodes.h:1822
void setFinallyBody(Stmt *S)
Definition: StmtObjC.h:141
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:4080
CXXTryStmt - A C++ try block, including all handlers.
Definition: StmtCXX.h:68
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Definition: Expr.h:5857
An ArraySubscriptExpr record.
Definition: ASTBitCodes.h:1610
Decl * readDecl()
Reads a declaration from the given position in a record in the given module, advancing Idx...
static FloatingLiteral * Create(const ASTContext &C, const llvm::APFloat &V, bool isexact, QualType Type, SourceLocation L)
Definition: Expr.cpp:949
This represents &#39;#pragma omp target teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:4780
CXXDefaultInitExprBitfields CXXDefaultInitExprBits
Definition: Stmt.h:1046
Information about a module that has been loaded by the ASTReader.
Definition: ModuleFile.h:106
ExprWithCleanupsBitfields ExprWithCleanupsBits
Definition: Stmt.h:1053
An ArrayInitLoopExpr record.
Definition: ASTBitCodes.h:1655
unsigned getNumClauses() const
Get number of clauses.
Definition: StmtOpenMP.h:241
A PseudoObjectExpr record.
Definition: ASTBitCodes.h:1694
void setFinallyStmt(Stmt *S)
Definition: StmtObjC.h:247
Extra data stored in some MemberExpr objects.
Definition: Expr.h:3050
CompoundStmtBitfields CompoundStmtBits
Definition: Stmt.h:1000
An ObjCIndirectCopyRestoreExpr record.
Definition: ASTBitCodes.h:1739
This represents &#39;#pragma omp for&#39; directive.
Definition: StmtOpenMP.h:1272
static OMPTargetEnterDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
void setValueKind(ExprValueKind Cat)
setValueKind - Set the value kind produced by this expression.
Definition: Expr.h:446
StringLiteralBitfields StringLiteralBits
Definition: Stmt.h:1020
void setStoredFPFeatures(FPOptionsOverride F)
Set FPFeatures in trailing storage, used only by Serialization.
Definition: Expr.h:2283
void setRParenLoc(SourceLocation L)
Definition: ExprObjC.h:528
bool hasInitializer() const
Whether this new-expression has any initializer at all.
Definition: ExprCXX.h:2255
static OMPArrayShapingExpr * CreateEmpty(const ASTContext &Context, unsigned NumDims)
Definition: Expr.cpp:4847
Represents a folding of a pack over an operator.
Definition: ExprCXX.h:4516
void setEndStmt(Stmt *S)
Definition: StmtCXX.h:195
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
Definition: Stmt.h:2677
This represents &#39;#pragma omp target teams&#39; directive.
Definition: StmtOpenMP.h:4482
void setAssociatedStmt(Stmt *S)
Set the associated statement for the directive.
Definition: StmtOpenMP.h:85
static OMPDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
An expression that sends a message to the given Objective-C object or class.
Definition: ExprObjC.h:940
void setBody(Stmt *Body)
Definition: Stmt.h:2328
This represents a Microsoft inline-assembly statement extension.
Definition: Stmt.h:3142
void setColonLoc(SourceLocation L)
Definition: Stmt.h:1514
void setIsArrow(bool A)
Definition: ExprObjC.h:586
void setRParenLoc(SourceLocation L)
Definition: Expr.h:4412
A DesignatedInitUpdateExpr record.
Definition: ASTBitCodes.h:1649
SourceLocation getEnd() const
void setAtLoc(SourceLocation L)
Definition: ExprObjC.h:424
UnaryOperator - This represents the unary-expression&#39;s (except sizeof and alignof), the postinc/postdec operators from postfix-expression, and various extensions.
Definition: Expr.h:2131
bool isOpenMPTaskLoopDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a taskloop directive.
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
Definition: ExprObjC.h:1224
A member reference to an MSPropertyDecl.
Definition: ExprCXX.h:889
static OMPParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:547
static UnresolvedLookupExpr * CreateEmpty(const ASTContext &Context, unsigned NumResults, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition: ExprCXX.cpp:388
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition: ExprCXX.h:4198
void setForLoc(SourceLocation Loc)
Definition: StmtObjC.h:53
This represents &#39;#pragma omp cancel&#39; directive.
Definition: StmtOpenMP.h:3174
void setDistInc(Expr *DistInc)
Definition: StmtOpenMP.h:687
void setBase(Expr *base)
Definition: ExprObjC.h:582
ValueDecl * getDecl()
Definition: Expr.h:1262
An ObjCAvailabilityCheckExpr record.
Definition: ASTBitCodes.h:1766
void setRParenLoc(SourceLocation L)
Definition: ExprObjC.h:474
std::string readString()
Read a string, advancing Idx.
void setConditionVariable(const ASTContext &Ctx, VarDecl *V)
Set the condition variable of this while statement.
Definition: Stmt.cpp:1061
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr.cast]), which uses the syntax (Type)expr.
Definition: Expr.h:3581
void setRowIdx(Expr *E)
Definition: Expr.h:2722
static OMPDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setClauses(ArrayRef< OMPClause *> Clauses)
Sets the list of variables for this clause.
Definition: StmtOpenMP.cpp:19
LambdaExprBitfields LambdaExprBits
Definition: Stmt.h:1061
NestedNameSpecifierLoc NestedNameSpec
Definition: ASTConcept.h:103
NamedDecl * FoundDecl
The declaration found by name lookup when the expression was created.
Definition: ASTConcept.h:116
This file defines OpenMP AST classes for clauses.
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1...
Definition: Expr.h:1683
An ObjCForCollectionStmt record.
Definition: ASTBitCodes.h:1742
This represents &#39;#pragma omp flush&#39; directive.
Definition: StmtOpenMP.h:2343
This represents &#39;#pragma omp parallel for simd&#39; directive.
Definition: StmtOpenMP.h:1846
void setRParenLoc(SourceLocation L)
Definition: Expr.h:4501
void setAtTryLoc(SourceLocation Loc)
Definition: StmtObjC.h:205
DoStmt - This represents a &#39;do/while&#39; stmt.
Definition: Stmt.h:2395
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
Definition: Stmt.h:2760
void setBody(Stmt *S)
Definition: StmtCXX.h:199
SourceLocation TemplateKWLoc
The location of the template keyword, if specified when naming the concept.
Definition: ASTConcept.h:107
A MS-style AsmStmt record.
Definition: ASTBitCodes.h:1568
void setConditionVariable(const ASTContext &Ctx, VarDecl *VD)
Set the condition variable in this switch statement.
Definition: Stmt.cpp:1000
void setLocStart(SourceLocation Loc)
Set starting location of directive kind.
Definition: StmtOpenMP.h:233
OpaqueValueExprBitfields OpaqueValueExprBits
Definition: Stmt.h:1071
static OMPParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:496
This represents &#39;#pragma omp parallel master taskloop&#39; directive.
Definition: StmtOpenMP.h:3533
static CoroutineBodyStmt * Create(const ASTContext &C, CtorArgs const &Args)
Definition: StmtCXX.cpp:86
void setSynchExpr(Stmt *S)
Definition: StmtObjC.h:311
This represents &#39;#pragma omp target enter data&#39; directive.
Definition: StmtOpenMP.h:2765
void setUpdates(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:131
void setLowerBoundVariable(Expr *LB)
Definition: StmtOpenMP.h:628
This represents &#39;#pragma omp master taskloop simd&#39; directive.
Definition: StmtOpenMP.h:3465
void setLParenLoc(SourceLocation L)
Definition: ExprCXX.h:1724
void setTypeSourceInfo(TypeSourceInfo *tinfo)
Definition: Expr.h:3339
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Definition: ExprCXX.h:456
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
Definition: Expr.h:1102
void setComputationLHSType(QualType T)
Definition: Expr.h:3926
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition: Expr.h:4302
unsigned getNumArgs() const
Return the number of actual arguments in this message, not counting the receiver. ...
Definition: ExprObjC.h:1372
static OMPSectionDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:377
void setDecl(LabelDecl *D)
Definition: Stmt.h:1782
static CXXAddrspaceCastExpr * CreateEmpty(const ASTContext &Context)
Definition: ExprCXX.cpp:813
Kind
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr...
Definition: ExprCXX.h:2834
A field in a dependent type, known only by its name.
Definition: Expr.h:2317
This captures a statement into a function.
Definition: Stmt.h:3417
Represents a call to an inherited base class constructor from an inheriting constructor.
Definition: ExprCXX.h:1617
unsigned path_size() const
Definition: Expr.h:3431
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition: Expr.h:5926
void setLParenLoc(SourceLocation L)
Definition: Expr.h:3608
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on...
Definition: Expr.h:215
void setSubStmt(Stmt *S)
Definition: Stmt.h:1701
void setAccessorLoc(SourceLocation L)
Definition: Expr.h:5761
void setGotoLoc(SourceLocation L)
Definition: Stmt.h:2576
static CXXDynamicCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
Definition: ExprCXX.cpp:728
unsigned getNumExprs() const
Return the number of expressions in this paren list.
Definition: Expr.h:5389
void setLocation(SourceLocation L)
Definition: Expr.h:1271
This represents &#39;#pragma omp single&#39; directive.
Definition: StmtOpenMP.h:1572
Encodes a location in the source.
void setLocation(SourceLocation L)
Definition: Expr.h:2016
void setPrevLowerBoundVariable(Expr *PrevLB)
Definition: StmtOpenMP.h:677
void setIterationVariable(Expr *IV)
Definition: StmtOpenMP.h:601
Defines enumerations for expression traits intrinsics.
PseudoObjectExprBitfields PseudoObjectExprBits
Definition: Stmt.h:1032
static CXXOperatorCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, EmptyShell Empty)
Definition: ExprCXX.cpp:559
UnresolvedLookupExprBitfields UnresolvedLookupExprBits
Definition: Stmt.h:1057
unsigned getNumHandlers() const
Definition: StmtCXX.h:106
static ConstantExpr * CreateEmpty(const ASTContext &Context, ResultStorageKind StorageKind)
Definition: Expr.cpp:315
void setUpdater(Expr *Updater)
Definition: Expr.h:5218
CXXThrowExprBitfields CXXThrowExprBits
Definition: Stmt.h:1044
static OMPTaskDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:625
This is a basic class for representing single OpenMP executable directive.
Definition: StmtOpenMP.h:33
static OMPTargetUpdateDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setDoLoc(SourceLocation L)
Definition: Stmt.h:2425
static CXXConstCastExpr * CreateEmpty(const ASTContext &Context)
Definition: ExprCXX.cpp:800
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
Definition: ExprCXX.h:2093
void setCombinedNextLowerBound(Expr *CombNLB)
Definition: StmtOpenMP.h:722
void setAtCatchLoc(SourceLocation Loc)
Definition: StmtObjC.h:106
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c dictionary literal.
Definition: ExprObjC.h:360
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit...
Definition: ExprCXX.h:610
void setSourceRange(SourceRange R)
Definition: ExprCXX.h:860
Represents a C++2a __builtin_bit_cast(T, v) expression.
Definition: ExprCXX.h:4794
static ObjCAtTryStmt * CreateEmpty(const ASTContext &Context, unsigned NumCatchStmts, bool HasFinally)
Definition: StmtObjC.cpp:57
void setConstexpr(bool C)
Definition: Stmt.h:2040
Represents a call to a member function that may be written either with member call syntax (e...
Definition: ExprCXX.h:182
static StringLiteral * CreateEmpty(const ASTContext &Ctx, unsigned NumConcatenated, unsigned Length, unsigned CharByteWidth)
Construct an empty string literal.
Definition: Expr.cpp:1061
void setIdentLoc(SourceLocation L)
Definition: Stmt.h:1779
GenericSelectionExprBitfields GenericSelectionExprBits
Definition: Stmt.h:1031
Defines several types used to describe C++ lambda expressions that are shared between the parser and ...
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
Definition: Stmt.h:1257
void setInit(Stmt *S)
Definition: StmtCXX.h:191
void setLabelLoc(SourceLocation L)
Definition: Expr.h:4159
A CXXFunctionalCastExpr record.
Definition: ASTBitCodes.h:1813
void setTemporary(CXXTemporary *T)
Definition: ExprCXX.h:1398
static ExprWithCleanups * Create(const ASTContext &C, EmptyShell empty, unsigned numObjects)
Definition: ExprCXX.cpp:1277
void setAllEnumCasesCovered()
Set a flag in the SwitchStmt indicating that if the &#39;switch (X)&#39; is a switch over an enum value then ...
Definition: Stmt.h:2225
void VisitStmt(Stmt *S)
StmtVisitor - This class implements a simple visitor for Stmt subclasses.
Definition: StmtVisitor.h:183
void setClassReceiver(TypeSourceInfo *TSInfo)
Definition: ExprObjC.h:1284
static concepts::Requirement::SubstitutionDiagnostic * readSubstitutionDiagnostic(ASTRecordReader &Record)
void setCatchParamDecl(VarDecl *D)
Definition: StmtObjC.h:103
An ObjCEncodeExpr record.
Definition: ASTBitCodes.h:1712
static OMPAtomicDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:860
This represents &#39;#pragma omp taskwait&#39; directive.
Definition: StmtOpenMP.h:2223
void setLHS(Expr *E)
Definition: Expr.h:3694
void setIsFreeIvar(bool A)
Definition: ExprObjC.h:587
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load, __atomic_store, and __atomic_compare_exchange_*, for the similarly-named C++11 instructions, and __c11 variants for <stdatomic.h>, and corresponding __opencl_atomic_* for OpenCL 2.0.
Definition: Expr.h:6060
void setFinalsConditions(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:156
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:2146
bool isArray() const
Definition: ExprCXX.h:2216
static OMPOrderedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:829
bool isOpenMPLoopBoundSharingDirective(OpenMPDirectiveKind Kind)
Checks if the specified directive kind is one of the composite or combined directives that need loop ...
void addDecl(NamedDecl *D)
Definition: UnresolvedSet.h:91
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition: ExprObjC.h:504
static WhileStmt * CreateEmpty(const ASTContext &Ctx, bool HasVar)
Create an empty while statement optionally with storage for a condition variable. ...
Definition: Stmt.cpp:1047
bool isValueDependent() const
Determines whether the value of this expression depends on.
Definition: Expr.h:169
void setDecl(ValueDecl *NewD)
Definition: Expr.h:1264
void setThrowLoc(SourceLocation Loc)
Definition: StmtObjC.h:349
void setScale(unsigned S)
Definition: Expr.h:1534
unsigned getIdx() const
The current position in this record.
An ObjCIsa Expr record.
Definition: ASTBitCodes.h:1736
ASTContext & getContext()
Retrieve the AST context that this AST reader supplements.
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:3484
Stmt * getCapturedStmt()
Retrieve the statement being captured.
Definition: Stmt.h:3518
static BinaryOperator * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
Definition: Expr.cpp:4502
This represents &#39;#pragma omp target&#39; directive.
Definition: StmtOpenMP.h:2648
static OMPTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setSubExpr(Expr *E)
Definition: ExprCXX.h:1402
static DesignatedInitExpr * CreateEmpty(const ASTContext &C, unsigned NumIndexExprs)
Definition: Expr.cpp:4325
static DeclGroup * Create(ASTContext &C, Decl **Decls, unsigned NumDecls)
Definition: DeclGroup.cpp:20
bool isParenTypeId() const
Definition: ExprCXX.h:2246
static OMPTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setBaseExpr(Stmt *S)
Definition: ExprObjC.h:881
NullStmtBitfields NullStmtBits
Definition: Stmt.h:999
DeclarationNameInfo ConceptName
The concept name used.
Definition: ASTConcept.h:110
An expression trait intrinsic.
Definition: ExprCXX.h:2777
void setEncodedTypeSourceInfo(TypeSourceInfo *EncType)
Definition: ExprObjC.h:432
static CXXDependentScopeMemberExpr * CreateEmpty(const ASTContext &Ctx, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs, bool HasFirstQualifierFoundInScope)
Definition: ExprCXX.cpp:1385
An AtomicExpr record.
Definition: ASTBitCodes.h:1697
A static requirement that can be used in a requires-expression to check properties of types and expre...
Definition: ExprConcepts.h:145
This represents &#39;#pragma omp ordered&#39; directive.
Definition: StmtOpenMP.h:2457
static ConceptSpecializationExpr * Create(const ASTContext &C, NestedNameSpecifierLoc NNS, SourceLocation TemplateKWLoc, DeclarationNameInfo ConceptNameInfo, NamedDecl *FoundDecl, ConceptDecl *NamedConcept, const ASTTemplateArgumentListInfo *ArgsAsWritten, ArrayRef< TemplateArgument > ConvertedArgs, const ConstraintSatisfaction *Satisfaction)
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition: Expr.h:4186
void setCond(Expr *E)
Definition: StmtCXX.h:196
static OMPScanDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:804
static SizeOfPackExpr * CreateDeserialized(ASTContext &Context, unsigned NumPartialArgs)
Definition: ExprCXX.cpp:1526
This represents &#39;#pragma omp target update&#39; directive.
Definition: StmtOpenMP.h:3752
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:128
MemberExprBitfields MemberExprBits
Definition: Stmt.h:1026
void setSubExpr(Expr *E)
Definition: Expr.h:4488
void setLAngleLoc(SourceLocation Loc)
Definition: TemplateBase.h:575
void sawArrayRangeDesignator(bool ARD=true)
Definition: Expr.h:4795
static CXXTemporaryObjectExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs)
Definition: ExprCXX.cpp:977
void addArgument(const TemplateArgumentLoc &Loc)
Definition: TemplateBase.h:596
This represents &#39;#pragma omp parallel master taskloop simd&#39; directive.
Definition: StmtOpenMP.h:3616
void setCapturedRecordDecl(RecordDecl *D)
Set the record declaration for captured variables.
Definition: Stmt.h:3538
Representation of a Microsoft __if_exists or __if_not_exists statement with a dependent name...
Definition: StmtCXX.h:252
A placeholder type used to construct an empty shell of a type, that will be filled in later (e...
Definition: Stmt.h:1096
void setSimple(bool V)
Definition: Stmt.h:2794
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:3145
void setRBracketLoc(SourceLocation L)
Definition: ExprCXX.h:998
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:3891
Expr ** getElements()
Retrieve elements of array of literals.
Definition: ExprObjC.h:221
void setColonLocFirst(SourceLocation L)
Definition: ExprOpenMP.h:119
Defines various enumerations that describe declaration and type specifiers.
A POD class for pairing a NamedDecl* with an access specifier.
Represents a C11 generic selection.
Definition: Expr.h:5454
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition: Expr.h:4141
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers...
Definition: ExprObjC.h:1625
Represents a reference to a function parameter pack or init-capture pack that has been substituted bu...
Definition: ExprCXX.h:4324
Represents a template argument.
Definition: TemplateBase.h:51
void setGotoLoc(SourceLocation L)
Definition: Stmt.h:2539
void setPrevUpperBoundVariable(Expr *PrevUB)
Definition: StmtOpenMP.h:682
static CXXUnresolvedConstructExpr * CreateEmpty(const ASTContext &Context, unsigned NumArgs)
Definition: ExprCXX.cpp:1312
void setCombinedEnsureUpperBound(Expr *CombEUB)
Definition: StmtOpenMP.h:707
static OMPForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:273
void setLocation(SourceLocation L)
Definition: Expr.h:1660
NullStmt - This is the null statement ";": C99 6.8.3p3.
Definition: Stmt.h:1329
void setCounters(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:112
bool isTypeOperand() const
Definition: ExprCXX.h:841
unsigned getNumAssocs() const
The number of association expressions.
Definition: Expr.h:5620
Dataflow Directional Tag Classes.
static GenericSelectionExpr * CreateEmpty(const ASTContext &Context, unsigned NumAssocs)
Create an empty generic selection expression for deserialization.
Definition: Expr.cpp:4258
An InitListExpr record.
Definition: ASTBitCodes.h:1643
llvm::BitstreamCursor DeclsCursor
DeclsCursor - This is a cursor to the start of the DECLTYPES_BLOCK block.
Definition: ModuleFile.h:425
void setBuiltinLoc(SourceLocation L)
Definition: Expr.h:4409
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:1924
UnaryOperatorKind
void setValue(bool V)
Definition: ExprCXX.h:704
A CXXBoolLiteralExpr record.
Definition: ASTBitCodes.h:1825
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
Definition: ExprCXX.h:2352
void setCombinedUpperBoundVariable(Expr *CombUB)
Definition: StmtOpenMP.h:702
void setRParenLoc(SourceLocation L)
Definition: Expr.h:3010
static CapturedStmt * CreateDeserialized(const ASTContext &Context, unsigned NumCaptures)
Definition: Stmt.cpp:1280
An ExtVectorElementExpr record.
Definition: ASTBitCodes.h:1640
void setLabel(LabelDecl *L)
Definition: Expr.h:4165
static OMPTargetTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setTypeInfoAsWritten(TypeSourceInfo *writtenTy)
Definition: Expr.h:3566
This represents &#39;#pragma omp section&#39; directive.
Definition: StmtOpenMP.h:1509
void setAtLoc(SourceLocation L)
Definition: ExprObjC.h:527
This represents &#39;#pragma omp teams distribute&#39; directive.
Definition: StmtOpenMP.h:4179
void setIsUnique(bool V)
Definition: Expr.h:1154
Expr * ReadExpr(ModuleFile &F)
Reads an expression.
void setSubExpr(Expr *E)
Definition: Expr.h:1697
void setExprs(const ASTContext &C, ArrayRef< Expr *> Exprs)
Definition: Expr.cpp:4170
void setSubExpr(Expr *E)
Definition: Expr.h:3414
void setCollection(Expr *E)
Definition: StmtObjC.h:47
void setDecl(ObjCIvarDecl *d)
Definition: ExprObjC.h:578
AccessSpecifier getAccess() const
Definition: DeclBase.h:478
void setFileScope(bool FS)
Definition: Expr.h:3331
void setExact(bool E)
Definition: Expr.h:1652
A runtime availability query.
Definition: ExprObjC.h:1686
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
Definition: ExprCXX.h:498
This represents &#39;#pragma omp simd&#39; directive.
Definition: StmtOpenMP.h:1207
Represents a &#39;co_yield&#39; expression.
Definition: ExprCXX.h:4768
An ObjCAutoreleasePoolStmt record.
Definition: ASTBitCodes.h:1760
A C++ addrspace_cast expression (currently only enabled for OpenCL).
Definition: ExprCXX.h:574
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition: ExprCXX.h:4004
A CXXDynamicCastExpr record.
Definition: ASTBitCodes.h:1801
static LambdaExpr * CreateDeserialized(const ASTContext &C, unsigned NumCaptures)
Construct a new lambda expression that will be deserialized from an external source.
Definition: ExprCXX.cpp:1147
void setFPFeatures(FPOptionsOverride F)
Definition: ExprCXX.h:170
static PseudoObjectExpr * Create(const ASTContext &Context, Expr *syntactic, ArrayRef< Expr *> semantic, unsigned resultIndex)
Definition: Expr.cpp:4602
void setEllipsisLoc(SourceLocation L)
Set the location of the ...
Definition: Stmt.h:1614
Kind
The kind of offsetof node we have.
Definition: Expr.h:2311
void setLParenLoc(SourceLocation L)
Definition: Expr.h:4211
void setSelector(Selector S)
Definition: ExprObjC.h:1341
ExplicitCastExpr - An explicit cast written in the source code.
Definition: Expr.h:3547
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
void setMethodDecl(ObjCMethodDecl *MD)
Definition: ExprObjC.h:1360
This represents &#39;#pragma omp atomic&#39; directive.
Definition: StmtOpenMP.h:2513
static CompoundStmt * CreateEmpty(const ASTContext &C, unsigned NumStmts)
Definition: Stmt.cpp:325
pack_iterator pack_begin() const
Iterator referencing the first argument of a template argument pack.
Definition: TemplateBase.h:341
void setImplicit(bool I)
Definition: ExprCXX.h:1126
An ObjCAtFinallyStmt record.
Definition: ASTBitCodes.h:1748
CXXNewExprBitfields CXXNewExprBits
Definition: Stmt.h:1048
RequiresExprBitfields RequiresExprBits
Definition: Stmt.h:1062
llvm::SmallVector< std::pair< const Expr *, Detail >, 4 > Details
Pairs of unsatisfied atomic constraint expressions along with the substituted constraint expr...
Definition: ASTConcept.h:53
uint64_t readInt()
Returns the current value in this record, and advances to the next value.
Represents a __leave statement.
Definition: Stmt.h:3378
unsigned getCollapsedNumber() const
Get number of collapsed loops.
Definition: StmtOpenMP.h:925
unsigned getNumSubExprs() const
Definition: Expr.h:6125
void setRBracketLoc(SourceLocation L)
Definition: Expr.h:2663
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition: ExprCXX.h:3950
SwitchStmt - This represents a &#39;switch&#39; stmt.
Definition: Stmt.h:2075
std::string toString(const til::SExpr *E)
CXXConstructExprBitfields CXXConstructExprBits
Definition: Stmt.h:1052
static OMPForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:325
static UnaryOperator * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
Definition: Expr.cpp:4546
child_range children()
Definition: Expr.h:6263
Represents the body of a coroutine.
Definition: StmtCXX.h:317
void setElement(Stmt *S)
Definition: StmtObjC.h:46
TemplateArgumentLoc * getTrailingTemplateArgumentLoc()
Return the optional template arguments.
Definition: ExprCXX.h:3933
Location wrapper for a TemplateArgument.
Definition: TemplateBase.h:451
bool isOpenMPDistributeDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a distribute directive.
static const unsigned NumExprFields
The number of record fields required for the Expr class itself.
void setCatchStmt(unsigned I, ObjCAtCatchStmt *S)
Set a particular catch statement.
Definition: StmtObjC.h:229
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition: Expr.h:2612
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c array literal.
Definition: ExprObjC.h:229
static OMPBarrierDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:657
This file defines OpenMP AST classes for executable directives and clauses.
void setRBracketLoc(SourceLocation L)
Definition: Expr.h:2745
Represents Objective-C&#39;s collection statement.
Definition: StmtObjC.h:23
static CUDAKernelCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, EmptyShell Empty)
Definition: ExprCXX.cpp:1667
void setRHS(Expr *Val)
Definition: Stmt.h:1645
An ObjCAtSynchronizedStmt record.
Definition: ASTBitCodes.h:1754
unsigned getNumObjects() const
Definition: ExprCXX.h:3329
void setIndexExpr(unsigned Idx, Expr *E)
Definition: Expr.h:2485
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:409
void setVolatile(bool V)
Definition: Stmt.h:2797
void setLowerBound(Expr *E)
Set lower bound of the array section.
Definition: ExprOpenMP.h:99
An implicit indirection through a C++ base class, when the field found is in a base class...
Definition: Expr.h:2320
Represents a call to a CUDA kernel function.
Definition: ExprCXX.h:235
Represents a &#39;co_await&#39; expression.
Definition: ExprCXX.h:4683
TypeTraitExprBitfields TypeTraitExprBits
Definition: Stmt.h:1050
static ImplicitCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
Definition: Expr.cpp:1906
void setSwitchLoc(SourceLocation L)
Definition: Stmt.h:2209
A CXXMemberCallExpr record.
Definition: ASTBitCodes.h:1783
void setAtFinallyLoc(SourceLocation Loc)
Definition: StmtObjC.h:149
void setArg(unsigned Arg, Expr *ArgExpr)
Set the specified argument.
Definition: ExprCXX.h:1587
void setKind(UnaryExprOrTypeTrait K)
Definition: Expr.h:2551
void setRParenLoc(SourceLocation L)
Definition: Expr.h:2593
void setRHS(Expr *E)
Definition: Expr.h:4406
void setOperatorLoc(SourceLocation L)
Definition: Expr.h:3686
void setBody(Stmt *Body)
Definition: Stmt.h:2422
void setValue(const ASTContext &C, const llvm::APFloat &Val)
Definition: Expr.h:1621
Represents Objective-C&#39;s @finally statement.
Definition: StmtObjC.h:127
void setCatchBody(Stmt *S)
Definition: StmtObjC.h:95
static CXXFunctionalCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
Definition: ExprCXX.cpp:833
bool hasAssociatedStmt() const
Returns true if directive has associated statement.
Definition: StmtOpenMP.h:250
void setLParenLoc(SourceLocation L)
Definition: Expr.h:3334
The template argument is actually a parameter pack.
Definition: TemplateBase.h:90
Represents a base class of a C++ class.
Definition: DeclCXX.h:146
void setRParenLoc(SourceLocation L)
Definition: ExprObjC.h:426
unsigned getNumClobbers() const
Definition: Stmt.h:2841
static OMPTargetTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:548
void setAtSynchronizedLoc(SourceLocation Loc)
Definition: StmtObjC.h:295