clang  7.0.0svn
ASTReaderStmt.cpp
Go to the documentation of this file.
1 //===--- ASTReaderStmt.cpp - Stmt/Expr Deserialization ----------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // Statement/expression deserialization. This implements the
11 // ASTReader::ReadStmt method.
12 //
13 //===----------------------------------------------------------------------===//
14 
16 #include "clang/AST/ASTContext.h"
17 #include "clang/AST/DeclCXX.h"
18 #include "clang/AST/DeclTemplate.h"
19 #include "clang/AST/StmtVisitor.h"
20 #include "clang/Lex/Token.h"
21 #include "llvm/ADT/SmallString.h"
22 using namespace clang;
23 using namespace clang::serialization;
24 
25 namespace clang {
26 
27  class ASTStmtReader : public StmtVisitor<ASTStmtReader> {
28  friend class OMPClauseReader;
29 
30  ASTRecordReader &Record;
31  llvm::BitstreamCursor &DeclsCursor;
32 
33  SourceLocation ReadSourceLocation() {
34  return Record.readSourceLocation();
35  }
36 
37  SourceRange ReadSourceRange() {
38  return Record.readSourceRange();
39  }
40 
41  std::string ReadString() {
42  return Record.readString();
43  }
44 
45  TypeSourceInfo *GetTypeSourceInfo() {
46  return Record.getTypeSourceInfo();
47  }
48 
49  Decl *ReadDecl() {
50  return Record.readDecl();
51  }
52 
53  template<typename T>
54  T *ReadDeclAs() {
55  return Record.readDeclAs<T>();
56  }
57 
58  void ReadDeclarationNameLoc(DeclarationNameLoc &DNLoc,
59  DeclarationName Name) {
60  Record.readDeclarationNameLoc(DNLoc, Name);
61  }
62 
63  void ReadDeclarationNameInfo(DeclarationNameInfo &NameInfo) {
64  Record.readDeclarationNameInfo(NameInfo);
65  }
66 
67  public:
68  ASTStmtReader(ASTRecordReader &Record, llvm::BitstreamCursor &Cursor)
69  : Record(Record), DeclsCursor(Cursor) {}
70 
71  /// \brief The number of record fields required for the Stmt class
72  /// itself.
73  static const unsigned NumStmtFields = 0;
74 
75  /// \brief The number of record fields required for the Expr class
76  /// itself.
77  static const unsigned NumExprFields = NumStmtFields + 7;
78 
79  /// \brief Read and initialize a ExplicitTemplateArgumentList structure.
80  void ReadTemplateKWAndArgsInfo(ASTTemplateKWAndArgsInfo &Args,
81  TemplateArgumentLoc *ArgsLocArray,
82  unsigned NumTemplateArgs);
83  /// \brief Read and initialize a ExplicitTemplateArgumentList structure.
84  void ReadExplicitTemplateArgumentList(ASTTemplateArgumentListInfo &ArgList,
85  unsigned NumTemplateArgs);
86 
87  void VisitStmt(Stmt *S);
88 #define STMT(Type, Base) \
89  void Visit##Type(Type *);
90 #include "clang/AST/StmtNodes.inc"
91  };
92 }
93 
95  TemplateArgumentLoc *ArgsLocArray,
96  unsigned NumTemplateArgs) {
97  SourceLocation TemplateKWLoc = ReadSourceLocation();
99  ArgInfo.setLAngleLoc(ReadSourceLocation());
100  ArgInfo.setRAngleLoc(ReadSourceLocation());
101  for (unsigned i = 0; i != NumTemplateArgs; ++i)
102  ArgInfo.addArgument(Record.readTemplateArgumentLoc());
103  Args.initializeFrom(TemplateKWLoc, ArgInfo, ArgsLocArray);
104 }
105 
107  assert(Record.getIdx() == NumStmtFields && "Incorrect statement field count");
108 }
109 
110 void ASTStmtReader::VisitNullStmt(NullStmt *S) {
111  VisitStmt(S);
112  S->setSemiLoc(ReadSourceLocation());
113  S->HasLeadingEmptyMacro = Record.readInt();
114 }
115 
116 void ASTStmtReader::VisitCompoundStmt(CompoundStmt *S) {
117  VisitStmt(S);
119  unsigned NumStmts = Record.readInt();
120  while (NumStmts--)
121  Stmts.push_back(Record.readSubStmt());
122  S->setStmts(Stmts);
123  S->LBraceLoc = ReadSourceLocation();
124  S->RBraceLoc = ReadSourceLocation();
125 }
126 
127 void ASTStmtReader::VisitSwitchCase(SwitchCase *S) {
128  VisitStmt(S);
129  Record.recordSwitchCaseID(S, Record.readInt());
130  S->setKeywordLoc(ReadSourceLocation());
131  S->setColonLoc(ReadSourceLocation());
132 }
133 
134 void ASTStmtReader::VisitCaseStmt(CaseStmt *S) {
135  VisitSwitchCase(S);
136  S->setLHS(Record.readSubExpr());
137  S->setRHS(Record.readSubExpr());
138  S->setSubStmt(Record.readSubStmt());
139  S->setEllipsisLoc(ReadSourceLocation());
140 }
141 
142 void ASTStmtReader::VisitDefaultStmt(DefaultStmt *S) {
143  VisitSwitchCase(S);
144  S->setSubStmt(Record.readSubStmt());
145 }
146 
147 void ASTStmtReader::VisitLabelStmt(LabelStmt *S) {
148  VisitStmt(S);
149  LabelDecl *LD = ReadDeclAs<LabelDecl>();
150  LD->setStmt(S);
151  S->setDecl(LD);
152  S->setSubStmt(Record.readSubStmt());
153  S->setIdentLoc(ReadSourceLocation());
154 }
155 
156 void ASTStmtReader::VisitAttributedStmt(AttributedStmt *S) {
157  VisitStmt(S);
158  uint64_t NumAttrs = Record.readInt();
159  AttrVec Attrs;
160  Record.readAttributes(Attrs);
161  (void)NumAttrs;
162  assert(NumAttrs == S->NumAttrs);
163  assert(NumAttrs == Attrs.size());
164  std::copy(Attrs.begin(), Attrs.end(), S->getAttrArrayPtr());
165  S->SubStmt = Record.readSubStmt();
166  S->AttrLoc = ReadSourceLocation();
167 }
168 
169 void ASTStmtReader::VisitIfStmt(IfStmt *S) {
170  VisitStmt(S);
171  S->setConstexpr(Record.readInt());
172  S->setInit(Record.readSubStmt());
173  S->setConditionVariable(Record.getContext(), ReadDeclAs<VarDecl>());
174  S->setCond(Record.readSubExpr());
175  S->setThen(Record.readSubStmt());
176  S->setElse(Record.readSubStmt());
177  S->setIfLoc(ReadSourceLocation());
178  S->setElseLoc(ReadSourceLocation());
179 }
180 
181 void ASTStmtReader::VisitSwitchStmt(SwitchStmt *S) {
182  VisitStmt(S);
183  S->setInit(Record.readSubStmt());
184  S->setConditionVariable(Record.getContext(), ReadDeclAs<VarDecl>());
185  S->setCond(Record.readSubExpr());
186  S->setBody(Record.readSubStmt());
187  S->setSwitchLoc(ReadSourceLocation());
188  if (Record.readInt())
190 
191  SwitchCase *PrevSC = nullptr;
192  for (auto E = Record.size(); Record.getIdx() != E; ) {
193  SwitchCase *SC = Record.getSwitchCaseWithID(Record.readInt());
194  if (PrevSC)
195  PrevSC->setNextSwitchCase(SC);
196  else
197  S->setSwitchCaseList(SC);
198 
199  PrevSC = SC;
200  }
201 }
202 
203 void ASTStmtReader::VisitWhileStmt(WhileStmt *S) {
204  VisitStmt(S);
205  S->setConditionVariable(Record.getContext(), ReadDeclAs<VarDecl>());
206 
207  S->setCond(Record.readSubExpr());
208  S->setBody(Record.readSubStmt());
209  S->setWhileLoc(ReadSourceLocation());
210 }
211 
212 void ASTStmtReader::VisitDoStmt(DoStmt *S) {
213  VisitStmt(S);
214  S->setCond(Record.readSubExpr());
215  S->setBody(Record.readSubStmt());
216  S->setDoLoc(ReadSourceLocation());
217  S->setWhileLoc(ReadSourceLocation());
218  S->setRParenLoc(ReadSourceLocation());
219 }
220 
221 void ASTStmtReader::VisitForStmt(ForStmt *S) {
222  VisitStmt(S);
223  S->setInit(Record.readSubStmt());
224  S->setCond(Record.readSubExpr());
225  S->setConditionVariable(Record.getContext(), ReadDeclAs<VarDecl>());
226  S->setInc(Record.readSubExpr());
227  S->setBody(Record.readSubStmt());
228  S->setForLoc(ReadSourceLocation());
229  S->setLParenLoc(ReadSourceLocation());
230  S->setRParenLoc(ReadSourceLocation());
231 }
232 
233 void ASTStmtReader::VisitGotoStmt(GotoStmt *S) {
234  VisitStmt(S);
235  S->setLabel(ReadDeclAs<LabelDecl>());
236  S->setGotoLoc(ReadSourceLocation());
237  S->setLabelLoc(ReadSourceLocation());
238 }
239 
240 void ASTStmtReader::VisitIndirectGotoStmt(IndirectGotoStmt *S) {
241  VisitStmt(S);
242  S->setGotoLoc(ReadSourceLocation());
243  S->setStarLoc(ReadSourceLocation());
244  S->setTarget(Record.readSubExpr());
245 }
246 
247 void ASTStmtReader::VisitContinueStmt(ContinueStmt *S) {
248  VisitStmt(S);
249  S->setContinueLoc(ReadSourceLocation());
250 }
251 
252 void ASTStmtReader::VisitBreakStmt(BreakStmt *S) {
253  VisitStmt(S);
254  S->setBreakLoc(ReadSourceLocation());
255 }
256 
257 void ASTStmtReader::VisitReturnStmt(ReturnStmt *S) {
258  VisitStmt(S);
259  S->setRetValue(Record.readSubExpr());
260  S->setReturnLoc(ReadSourceLocation());
261  S->setNRVOCandidate(ReadDeclAs<VarDecl>());
262 }
263 
264 void ASTStmtReader::VisitDeclStmt(DeclStmt *S) {
265  VisitStmt(S);
266  S->setStartLoc(ReadSourceLocation());
267  S->setEndLoc(ReadSourceLocation());
268 
269  if (Record.size() - Record.getIdx() == 1) {
270  // Single declaration
271  S->setDeclGroup(DeclGroupRef(ReadDecl()));
272  } else {
274  int N = Record.size() - Record.getIdx();
275  Decls.reserve(N);
276  for (int I = 0; I < N; ++I)
277  Decls.push_back(ReadDecl());
279  Decls.data(),
280  Decls.size())));
281  }
282 }
283 
284 void ASTStmtReader::VisitAsmStmt(AsmStmt *S) {
285  VisitStmt(S);
286  S->NumOutputs = Record.readInt();
287  S->NumInputs = Record.readInt();
288  S->NumClobbers = Record.readInt();
289  S->setAsmLoc(ReadSourceLocation());
290  S->setVolatile(Record.readInt());
291  S->setSimple(Record.readInt());
292 }
293 
294 void ASTStmtReader::VisitGCCAsmStmt(GCCAsmStmt *S) {
295  VisitAsmStmt(S);
296  S->setRParenLoc(ReadSourceLocation());
297  S->setAsmString(cast_or_null<StringLiteral>(Record.readSubStmt()));
298 
299  unsigned NumOutputs = S->getNumOutputs();
300  unsigned NumInputs = S->getNumInputs();
301  unsigned NumClobbers = S->getNumClobbers();
302 
303  // Outputs and inputs
307  for (unsigned I = 0, N = NumOutputs + NumInputs; I != N; ++I) {
308  Names.push_back(Record.getIdentifierInfo());
309  Constraints.push_back(cast_or_null<StringLiteral>(Record.readSubStmt()));
310  Exprs.push_back(Record.readSubStmt());
311  }
312 
313  // Constraints
315  for (unsigned I = 0; I != NumClobbers; ++I)
316  Clobbers.push_back(cast_or_null<StringLiteral>(Record.readSubStmt()));
317 
318  S->setOutputsAndInputsAndClobbers(Record.getContext(),
319  Names.data(), Constraints.data(),
320  Exprs.data(), NumOutputs, NumInputs,
321  Clobbers.data(), NumClobbers);
322 }
323 
324 void ASTStmtReader::VisitMSAsmStmt(MSAsmStmt *S) {
325  VisitAsmStmt(S);
326  S->LBraceLoc = ReadSourceLocation();
327  S->EndLoc = ReadSourceLocation();
328  S->NumAsmToks = Record.readInt();
329  std::string AsmStr = ReadString();
330 
331  // Read the tokens.
332  SmallVector<Token, 16> AsmToks;
333  AsmToks.reserve(S->NumAsmToks);
334  for (unsigned i = 0, e = S->NumAsmToks; i != e; ++i) {
335  AsmToks.push_back(Record.readToken());
336  }
337 
338  // The calls to reserve() for the FooData vectors are mandatory to
339  // prevent dead StringRefs in the Foo vectors.
340 
341  // Read the clobbers.
342  SmallVector<std::string, 16> ClobbersData;
344  ClobbersData.reserve(S->NumClobbers);
345  Clobbers.reserve(S->NumClobbers);
346  for (unsigned i = 0, e = S->NumClobbers; i != e; ++i) {
347  ClobbersData.push_back(ReadString());
348  Clobbers.push_back(ClobbersData.back());
349  }
350 
351  // Read the operands.
352  unsigned NumOperands = S->NumOutputs + S->NumInputs;
354  SmallVector<std::string, 16> ConstraintsData;
355  SmallVector<StringRef, 16> Constraints;
356  Exprs.reserve(NumOperands);
357  ConstraintsData.reserve(NumOperands);
358  Constraints.reserve(NumOperands);
359  for (unsigned i = 0; i != NumOperands; ++i) {
360  Exprs.push_back(cast<Expr>(Record.readSubStmt()));
361  ConstraintsData.push_back(ReadString());
362  Constraints.push_back(ConstraintsData.back());
363  }
364 
365  S->initialize(Record.getContext(), AsmStr, AsmToks,
366  Constraints, Exprs, Clobbers);
367 }
368 
369 void ASTStmtReader::VisitCoroutineBodyStmt(CoroutineBodyStmt *S) {
370  VisitStmt(S);
371  assert(Record.peekInt() == S->NumParams);
372  Record.skipInts(1);
373  auto *StoredStmts = S->getStoredStmts();
374  for (unsigned i = 0;
375  i < CoroutineBodyStmt::SubStmt::FirstParamMove + S->NumParams; ++i)
376  StoredStmts[i] = Record.readSubStmt();
377 }
378 
379 void ASTStmtReader::VisitCoreturnStmt(CoreturnStmt *S) {
380  VisitStmt(S);
381  S->CoreturnLoc = Record.readSourceLocation();
382  for (auto &SubStmt: S->SubStmts)
383  SubStmt = Record.readSubStmt();
384  S->IsImplicit = Record.readInt() != 0;
385 }
386 
387 void ASTStmtReader::VisitCoawaitExpr(CoawaitExpr *E) {
388  VisitExpr(E);
389  E->KeywordLoc = ReadSourceLocation();
390  for (auto &SubExpr: E->SubExprs)
391  SubExpr = Record.readSubStmt();
392  E->OpaqueValue = cast_or_null<OpaqueValueExpr>(Record.readSubStmt());
393  E->setIsImplicit(Record.readInt() != 0);
394 }
395 
396 void ASTStmtReader::VisitCoyieldExpr(CoyieldExpr *E) {
397  VisitExpr(E);
398  E->KeywordLoc = ReadSourceLocation();
399  for (auto &SubExpr: E->SubExprs)
400  SubExpr = Record.readSubStmt();
401  E->OpaqueValue = cast_or_null<OpaqueValueExpr>(Record.readSubStmt());
402 }
403 
404 void ASTStmtReader::VisitDependentCoawaitExpr(DependentCoawaitExpr *E) {
405  VisitExpr(E);
406  E->KeywordLoc = ReadSourceLocation();
407  for (auto &SubExpr: E->SubExprs)
408  SubExpr = Record.readSubStmt();
409 }
410 
411 void ASTStmtReader::VisitCapturedStmt(CapturedStmt *S) {
412  VisitStmt(S);
413  Record.skipInts(1);
414  S->setCapturedDecl(ReadDeclAs<CapturedDecl>());
415  S->setCapturedRegionKind(static_cast<CapturedRegionKind>(Record.readInt()));
416  S->setCapturedRecordDecl(ReadDeclAs<RecordDecl>());
417 
418  // Capture inits
420  E = S->capture_init_end();
421  I != E; ++I)
422  *I = Record.readSubExpr();
423 
424  // Body
425  S->setCapturedStmt(Record.readSubStmt());
427 
428  // Captures
429  for (auto &I : S->captures()) {
430  I.VarAndKind.setPointer(ReadDeclAs<VarDecl>());
431  I.VarAndKind.setInt(
432  static_cast<CapturedStmt::VariableCaptureKind>(Record.readInt()));
433  I.Loc = ReadSourceLocation();
434  }
435 }
436 
437 void ASTStmtReader::VisitExpr(Expr *E) {
438  VisitStmt(E);
439  E->setType(Record.readType());
440  E->setTypeDependent(Record.readInt());
441  E->setValueDependent(Record.readInt());
442  E->setInstantiationDependent(Record.readInt());
443  E->ExprBits.ContainsUnexpandedParameterPack = Record.readInt();
444  E->setValueKind(static_cast<ExprValueKind>(Record.readInt()));
445  E->setObjectKind(static_cast<ExprObjectKind>(Record.readInt()));
446  assert(Record.getIdx() == NumExprFields &&
447  "Incorrect expression field count");
448 }
449 
450 void ASTStmtReader::VisitPredefinedExpr(PredefinedExpr *E) {
451  VisitExpr(E);
452  E->setLocation(ReadSourceLocation());
453  E->Type = (PredefinedExpr::IdentType)Record.readInt();
454  E->FnName = cast_or_null<StringLiteral>(Record.readSubExpr());
455 }
456 
457 void ASTStmtReader::VisitDeclRefExpr(DeclRefExpr *E) {
458  VisitExpr(E);
459 
460  E->DeclRefExprBits.HasQualifier = Record.readInt();
461  E->DeclRefExprBits.HasFoundDecl = Record.readInt();
462  E->DeclRefExprBits.HasTemplateKWAndArgsInfo = Record.readInt();
463  E->DeclRefExprBits.HadMultipleCandidates = Record.readInt();
464  E->DeclRefExprBits.RefersToEnclosingVariableOrCapture = Record.readInt();
465  unsigned NumTemplateArgs = 0;
466  if (E->hasTemplateKWAndArgsInfo())
467  NumTemplateArgs = Record.readInt();
468 
469  if (E->hasQualifier())
470  new (E->getTrailingObjects<NestedNameSpecifierLoc>())
472 
473  if (E->hasFoundDecl())
474  *E->getTrailingObjects<NamedDecl *>() = ReadDeclAs<NamedDecl>();
475 
476  if (E->hasTemplateKWAndArgsInfo())
477  ReadTemplateKWAndArgsInfo(
478  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
479  E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs);
480 
481  E->setDecl(ReadDeclAs<ValueDecl>());
482  E->setLocation(ReadSourceLocation());
483  ReadDeclarationNameLoc(E->DNLoc, E->getDecl()->getDeclName());
484 }
485 
486 void ASTStmtReader::VisitIntegerLiteral(IntegerLiteral *E) {
487  VisitExpr(E);
488  E->setLocation(ReadSourceLocation());
489  E->setValue(Record.getContext(), Record.readAPInt());
490 }
491 
492 void ASTStmtReader::VisitFloatingLiteral(FloatingLiteral *E) {
493  VisitExpr(E);
494  E->setRawSemantics(static_cast<Stmt::APFloatSemantics>(Record.readInt()));
495  E->setExact(Record.readInt());
496  E->setValue(Record.getContext(), Record.readAPFloat(E->getSemantics()));
497  E->setLocation(ReadSourceLocation());
498 }
499 
500 void ASTStmtReader::VisitImaginaryLiteral(ImaginaryLiteral *E) {
501  VisitExpr(E);
502  E->setSubExpr(Record.readSubExpr());
503 }
504 
505 void ASTStmtReader::VisitStringLiteral(StringLiteral *E) {
506  VisitExpr(E);
507  unsigned Len = Record.readInt();
508  assert(Record.peekInt() == E->getNumConcatenated() &&
509  "Wrong number of concatenated tokens!");
510  Record.skipInts(1);
512  static_cast<StringLiteral::StringKind>(Record.readInt());
513  bool isPascal = Record.readInt();
514 
515  // Read string data
516  auto B = &Record.peekInt();
517  SmallString<16> Str(B, B + Len);
518  E->setString(Record.getContext(), Str, kind, isPascal);
519  Record.skipInts(Len);
520 
521  // Read source locations
522  for (unsigned I = 0, N = E->getNumConcatenated(); I != N; ++I)
523  E->setStrTokenLoc(I, ReadSourceLocation());
524 }
525 
526 void ASTStmtReader::VisitCharacterLiteral(CharacterLiteral *E) {
527  VisitExpr(E);
528  E->setValue(Record.readInt());
529  E->setLocation(ReadSourceLocation());
530  E->setKind(static_cast<CharacterLiteral::CharacterKind>(Record.readInt()));
531 }
532 
533 void ASTStmtReader::VisitParenExpr(ParenExpr *E) {
534  VisitExpr(E);
535  E->setLParen(ReadSourceLocation());
536  E->setRParen(ReadSourceLocation());
537  E->setSubExpr(Record.readSubExpr());
538 }
539 
540 void ASTStmtReader::VisitParenListExpr(ParenListExpr *E) {
541  VisitExpr(E);
542  unsigned NumExprs = Record.readInt();
543  E->Exprs = new (Record.getContext()) Stmt*[NumExprs];
544  for (unsigned i = 0; i != NumExprs; ++i)
545  E->Exprs[i] = Record.readSubStmt();
546  E->NumExprs = NumExprs;
547  E->LParenLoc = ReadSourceLocation();
548  E->RParenLoc = ReadSourceLocation();
549 }
550 
551 void ASTStmtReader::VisitUnaryOperator(UnaryOperator *E) {
552  VisitExpr(E);
553  E->setSubExpr(Record.readSubExpr());
555  E->setOperatorLoc(ReadSourceLocation());
556  E->setCanOverflow(Record.readInt());
557 }
558 
559 void ASTStmtReader::VisitOffsetOfExpr(OffsetOfExpr *E) {
560  VisitExpr(E);
561  assert(E->getNumComponents() == Record.peekInt());
562  Record.skipInts(1);
563  assert(E->getNumExpressions() == Record.peekInt());
564  Record.skipInts(1);
565  E->setOperatorLoc(ReadSourceLocation());
566  E->setRParenLoc(ReadSourceLocation());
567  E->setTypeSourceInfo(GetTypeSourceInfo());
568  for (unsigned I = 0, N = E->getNumComponents(); I != N; ++I) {
569  OffsetOfNode::Kind Kind = static_cast<OffsetOfNode::Kind>(Record.readInt());
570  SourceLocation Start = ReadSourceLocation();
571  SourceLocation End = ReadSourceLocation();
572  switch (Kind) {
573  case OffsetOfNode::Array:
574  E->setComponent(I, OffsetOfNode(Start, Record.readInt(), End));
575  break;
576 
577  case OffsetOfNode::Field:
578  E->setComponent(
579  I, OffsetOfNode(Start, ReadDeclAs<FieldDecl>(), End));
580  break;
581 
583  E->setComponent(
584  I,
585  OffsetOfNode(Start, Record.getIdentifierInfo(), End));
586  break;
587 
588  case OffsetOfNode::Base: {
589  CXXBaseSpecifier *Base = new (Record.getContext()) CXXBaseSpecifier();
590  *Base = Record.readCXXBaseSpecifier();
591  E->setComponent(I, OffsetOfNode(Base));
592  break;
593  }
594  }
595  }
596 
597  for (unsigned I = 0, N = E->getNumExpressions(); I != N; ++I)
598  E->setIndexExpr(I, Record.readSubExpr());
599 }
600 
601 void ASTStmtReader::VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *E) {
602  VisitExpr(E);
603  E->setKind(static_cast<UnaryExprOrTypeTrait>(Record.readInt()));
604  if (Record.peekInt() == 0) {
605  E->setArgument(Record.readSubExpr());
606  Record.skipInts(1);
607  } else {
608  E->setArgument(GetTypeSourceInfo());
609  }
610  E->setOperatorLoc(ReadSourceLocation());
611  E->setRParenLoc(ReadSourceLocation());
612 }
613 
614 void ASTStmtReader::VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
615  VisitExpr(E);
616  E->setLHS(Record.readSubExpr());
617  E->setRHS(Record.readSubExpr());
618  E->setRBracketLoc(ReadSourceLocation());
619 }
620 
621 void ASTStmtReader::VisitOMPArraySectionExpr(OMPArraySectionExpr *E) {
622  VisitExpr(E);
623  E->setBase(Record.readSubExpr());
624  E->setLowerBound(Record.readSubExpr());
625  E->setLength(Record.readSubExpr());
626  E->setColonLoc(ReadSourceLocation());
627  E->setRBracketLoc(ReadSourceLocation());
628 }
629 
630 void ASTStmtReader::VisitCallExpr(CallExpr *E) {
631  VisitExpr(E);
632  E->setNumArgs(Record.getContext(), Record.readInt());
633  E->setRParenLoc(ReadSourceLocation());
634  E->setCallee(Record.readSubExpr());
635  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
636  E->setArg(I, Record.readSubExpr());
637 }
638 
639 void ASTStmtReader::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) {
640  VisitCallExpr(E);
641 }
642 
643 void ASTStmtReader::VisitMemberExpr(MemberExpr *E) {
644  // Don't call VisitExpr, this is fully initialized at creation.
645  assert(E->getStmtClass() == Stmt::MemberExprClass &&
646  "It's a subclass, we must advance Idx!");
647 }
648 
649 void ASTStmtReader::VisitObjCIsaExpr(ObjCIsaExpr *E) {
650  VisitExpr(E);
651  E->setBase(Record.readSubExpr());
652  E->setIsaMemberLoc(ReadSourceLocation());
653  E->setOpLoc(ReadSourceLocation());
654  E->setArrow(Record.readInt());
655 }
656 
657 void ASTStmtReader::
658 VisitObjCIndirectCopyRestoreExpr(ObjCIndirectCopyRestoreExpr *E) {
659  VisitExpr(E);
660  E->Operand = Record.readSubExpr();
661  E->setShouldCopy(Record.readInt());
662 }
663 
664 void ASTStmtReader::VisitObjCBridgedCastExpr(ObjCBridgedCastExpr *E) {
665  VisitExplicitCastExpr(E);
666  E->LParenLoc = ReadSourceLocation();
667  E->BridgeKeywordLoc = ReadSourceLocation();
668  E->Kind = Record.readInt();
669 }
670 
671 void ASTStmtReader::VisitCastExpr(CastExpr *E) {
672  VisitExpr(E);
673  unsigned NumBaseSpecs = Record.readInt();
674  assert(NumBaseSpecs == E->path_size());
675  E->setSubExpr(Record.readSubExpr());
676  E->setCastKind((CastKind)Record.readInt());
677  CastExpr::path_iterator BaseI = E->path_begin();
678  while (NumBaseSpecs--) {
679  CXXBaseSpecifier *BaseSpec = new (Record.getContext()) CXXBaseSpecifier;
680  *BaseSpec = Record.readCXXBaseSpecifier();
681  *BaseI++ = BaseSpec;
682  }
683 }
684 
685 void ASTStmtReader::VisitBinaryOperator(BinaryOperator *E) {
686  VisitExpr(E);
687  E->setLHS(Record.readSubExpr());
688  E->setRHS(Record.readSubExpr());
690  E->setOperatorLoc(ReadSourceLocation());
691  E->setFPFeatures(FPOptions(Record.readInt()));
692 }
693 
694 void ASTStmtReader::VisitCompoundAssignOperator(CompoundAssignOperator *E) {
695  VisitBinaryOperator(E);
696  E->setComputationLHSType(Record.readType());
697  E->setComputationResultType(Record.readType());
698 }
699 
700 void ASTStmtReader::VisitConditionalOperator(ConditionalOperator *E) {
701  VisitExpr(E);
702  E->SubExprs[ConditionalOperator::COND] = Record.readSubExpr();
703  E->SubExprs[ConditionalOperator::LHS] = Record.readSubExpr();
704  E->SubExprs[ConditionalOperator::RHS] = Record.readSubExpr();
705  E->QuestionLoc = ReadSourceLocation();
706  E->ColonLoc = ReadSourceLocation();
707 }
708 
709 void
710 ASTStmtReader::VisitBinaryConditionalOperator(BinaryConditionalOperator *E) {
711  VisitExpr(E);
712  E->OpaqueValue = cast<OpaqueValueExpr>(Record.readSubExpr());
713  E->SubExprs[BinaryConditionalOperator::COMMON] = Record.readSubExpr();
714  E->SubExprs[BinaryConditionalOperator::COND] = Record.readSubExpr();
715  E->SubExprs[BinaryConditionalOperator::LHS] = Record.readSubExpr();
716  E->SubExprs[BinaryConditionalOperator::RHS] = Record.readSubExpr();
717  E->QuestionLoc = ReadSourceLocation();
718  E->ColonLoc = ReadSourceLocation();
719 }
720 
721 void ASTStmtReader::VisitImplicitCastExpr(ImplicitCastExpr *E) {
722  VisitCastExpr(E);
723 }
724 
725 void ASTStmtReader::VisitExplicitCastExpr(ExplicitCastExpr *E) {
726  VisitCastExpr(E);
727  E->setTypeInfoAsWritten(GetTypeSourceInfo());
728 }
729 
730 void ASTStmtReader::VisitCStyleCastExpr(CStyleCastExpr *E) {
731  VisitExplicitCastExpr(E);
732  E->setLParenLoc(ReadSourceLocation());
733  E->setRParenLoc(ReadSourceLocation());
734 }
735 
736 void ASTStmtReader::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
737  VisitExpr(E);
738  E->setLParenLoc(ReadSourceLocation());
739  E->setTypeSourceInfo(GetTypeSourceInfo());
740  E->setInitializer(Record.readSubExpr());
741  E->setFileScope(Record.readInt());
742 }
743 
744 void ASTStmtReader::VisitExtVectorElementExpr(ExtVectorElementExpr *E) {
745  VisitExpr(E);
746  E->setBase(Record.readSubExpr());
747  E->setAccessor(Record.getIdentifierInfo());
748  E->setAccessorLoc(ReadSourceLocation());
749 }
750 
751 void ASTStmtReader::VisitInitListExpr(InitListExpr *E) {
752  VisitExpr(E);
753  if (InitListExpr *SyntForm = cast_or_null<InitListExpr>(Record.readSubStmt()))
754  E->setSyntacticForm(SyntForm);
755  E->setLBraceLoc(ReadSourceLocation());
756  E->setRBraceLoc(ReadSourceLocation());
757  bool isArrayFiller = Record.readInt();
758  Expr *filler = nullptr;
759  if (isArrayFiller) {
760  filler = Record.readSubExpr();
761  E->ArrayFillerOrUnionFieldInit = filler;
762  } else
763  E->ArrayFillerOrUnionFieldInit = ReadDeclAs<FieldDecl>();
764  E->sawArrayRangeDesignator(Record.readInt());
765  unsigned NumInits = Record.readInt();
766  E->reserveInits(Record.getContext(), NumInits);
767  if (isArrayFiller) {
768  for (unsigned I = 0; I != NumInits; ++I) {
769  Expr *init = Record.readSubExpr();
770  E->updateInit(Record.getContext(), I, init ? init : filler);
771  }
772  } else {
773  for (unsigned I = 0; I != NumInits; ++I)
774  E->updateInit(Record.getContext(), I, Record.readSubExpr());
775  }
776 }
777 
778 void ASTStmtReader::VisitDesignatedInitExpr(DesignatedInitExpr *E) {
780 
781  VisitExpr(E);
782  unsigned NumSubExprs = Record.readInt();
783  assert(NumSubExprs == E->getNumSubExprs() && "Wrong number of subexprs");
784  for (unsigned I = 0; I != NumSubExprs; ++I)
785  E->setSubExpr(I, Record.readSubExpr());
786  E->setEqualOrColonLoc(ReadSourceLocation());
787  E->setGNUSyntax(Record.readInt());
788 
789  SmallVector<Designator, 4> Designators;
790  while (Record.getIdx() < Record.size()) {
791  switch ((DesignatorTypes)Record.readInt()) {
792  case DESIG_FIELD_DECL: {
793  FieldDecl *Field = ReadDeclAs<FieldDecl>();
794  SourceLocation DotLoc = ReadSourceLocation();
795  SourceLocation FieldLoc = ReadSourceLocation();
796  Designators.push_back(Designator(Field->getIdentifier(), DotLoc,
797  FieldLoc));
798  Designators.back().setField(Field);
799  break;
800  }
801 
802  case DESIG_FIELD_NAME: {
803  const IdentifierInfo *Name = Record.getIdentifierInfo();
804  SourceLocation DotLoc = ReadSourceLocation();
805  SourceLocation FieldLoc = ReadSourceLocation();
806  Designators.push_back(Designator(Name, DotLoc, FieldLoc));
807  break;
808  }
809 
810  case DESIG_ARRAY: {
811  unsigned Index = Record.readInt();
812  SourceLocation LBracketLoc = ReadSourceLocation();
813  SourceLocation RBracketLoc = ReadSourceLocation();
814  Designators.push_back(Designator(Index, LBracketLoc, RBracketLoc));
815  break;
816  }
817 
818  case DESIG_ARRAY_RANGE: {
819  unsigned Index = Record.readInt();
820  SourceLocation LBracketLoc = ReadSourceLocation();
821  SourceLocation EllipsisLoc = ReadSourceLocation();
822  SourceLocation RBracketLoc = ReadSourceLocation();
823  Designators.push_back(Designator(Index, LBracketLoc, EllipsisLoc,
824  RBracketLoc));
825  break;
826  }
827  }
828  }
829  E->setDesignators(Record.getContext(),
830  Designators.data(), Designators.size());
831 }
832 
833 void ASTStmtReader::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) {
834  VisitExpr(E);
835  E->setBase(Record.readSubExpr());
836  E->setUpdater(Record.readSubExpr());
837 }
838 
839 void ASTStmtReader::VisitNoInitExpr(NoInitExpr *E) {
840  VisitExpr(E);
841 }
842 
843 void ASTStmtReader::VisitArrayInitLoopExpr(ArrayInitLoopExpr *E) {
844  VisitExpr(E);
845  E->SubExprs[0] = Record.readSubExpr();
846  E->SubExprs[1] = Record.readSubExpr();
847 }
848 
849 void ASTStmtReader::VisitArrayInitIndexExpr(ArrayInitIndexExpr *E) {
850  VisitExpr(E);
851 }
852 
853 void ASTStmtReader::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) {
854  VisitExpr(E);
855 }
856 
857 void ASTStmtReader::VisitVAArgExpr(VAArgExpr *E) {
858  VisitExpr(E);
859  E->setSubExpr(Record.readSubExpr());
860  E->setWrittenTypeInfo(GetTypeSourceInfo());
861  E->setBuiltinLoc(ReadSourceLocation());
862  E->setRParenLoc(ReadSourceLocation());
863  E->setIsMicrosoftABI(Record.readInt());
864 }
865 
866 void ASTStmtReader::VisitAddrLabelExpr(AddrLabelExpr *E) {
867  VisitExpr(E);
868  E->setAmpAmpLoc(ReadSourceLocation());
869  E->setLabelLoc(ReadSourceLocation());
870  E->setLabel(ReadDeclAs<LabelDecl>());
871 }
872 
873 void ASTStmtReader::VisitStmtExpr(StmtExpr *E) {
874  VisitExpr(E);
875  E->setLParenLoc(ReadSourceLocation());
876  E->setRParenLoc(ReadSourceLocation());
877  E->setSubStmt(cast_or_null<CompoundStmt>(Record.readSubStmt()));
878 }
879 
880 void ASTStmtReader::VisitChooseExpr(ChooseExpr *E) {
881  VisitExpr(E);
882  E->setCond(Record.readSubExpr());
883  E->setLHS(Record.readSubExpr());
884  E->setRHS(Record.readSubExpr());
885  E->setBuiltinLoc(ReadSourceLocation());
886  E->setRParenLoc(ReadSourceLocation());
887  E->setIsConditionTrue(Record.readInt());
888 }
889 
890 void ASTStmtReader::VisitGNUNullExpr(GNUNullExpr *E) {
891  VisitExpr(E);
892  E->setTokenLocation(ReadSourceLocation());
893 }
894 
895 void ASTStmtReader::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
896  VisitExpr(E);
898  unsigned NumExprs = Record.readInt();
899  while (NumExprs--)
900  Exprs.push_back(Record.readSubExpr());
901  E->setExprs(Record.getContext(), Exprs);
902  E->setBuiltinLoc(ReadSourceLocation());
903  E->setRParenLoc(ReadSourceLocation());
904 }
905 
906 void ASTStmtReader::VisitConvertVectorExpr(ConvertVectorExpr *E) {
907  VisitExpr(E);
908  E->BuiltinLoc = ReadSourceLocation();
909  E->RParenLoc = ReadSourceLocation();
910  E->TInfo = GetTypeSourceInfo();
911  E->SrcExpr = Record.readSubExpr();
912 }
913 
914 void ASTStmtReader::VisitBlockExpr(BlockExpr *E) {
915  VisitExpr(E);
916  E->setBlockDecl(ReadDeclAs<BlockDecl>());
917 }
918 
919 void ASTStmtReader::VisitGenericSelectionExpr(GenericSelectionExpr *E) {
920  VisitExpr(E);
921  E->NumAssocs = Record.readInt();
922  E->AssocTypes = new (Record.getContext()) TypeSourceInfo*[E->NumAssocs];
923  E->SubExprs =
924  new(Record.getContext()) Stmt*[GenericSelectionExpr::END_EXPR+E->NumAssocs];
925 
926  E->SubExprs[GenericSelectionExpr::CONTROLLING] = Record.readSubExpr();
927  for (unsigned I = 0, N = E->getNumAssocs(); I != N; ++I) {
928  E->AssocTypes[I] = GetTypeSourceInfo();
929  E->SubExprs[GenericSelectionExpr::END_EXPR+I] = Record.readSubExpr();
930  }
931  E->ResultIndex = Record.readInt();
932 
933  E->GenericLoc = ReadSourceLocation();
934  E->DefaultLoc = ReadSourceLocation();
935  E->RParenLoc = ReadSourceLocation();
936 }
937 
938 void ASTStmtReader::VisitPseudoObjectExpr(PseudoObjectExpr *E) {
939  VisitExpr(E);
940  unsigned numSemanticExprs = Record.readInt();
941  assert(numSemanticExprs + 1 == E->PseudoObjectExprBits.NumSubExprs);
942  E->PseudoObjectExprBits.ResultIndex = Record.readInt();
943 
944  // Read the syntactic expression.
945  E->getSubExprsBuffer()[0] = Record.readSubExpr();
946 
947  // Read all the semantic expressions.
948  for (unsigned i = 0; i != numSemanticExprs; ++i) {
949  Expr *subExpr = Record.readSubExpr();
950  E->getSubExprsBuffer()[i+1] = subExpr;
951  }
952 }
953 
954 void ASTStmtReader::VisitAtomicExpr(AtomicExpr *E) {
955  VisitExpr(E);
956  E->Op = AtomicExpr::AtomicOp(Record.readInt());
957  E->NumSubExprs = AtomicExpr::getNumSubExprs(E->Op);
958  for (unsigned I = 0; I != E->NumSubExprs; ++I)
959  E->SubExprs[I] = Record.readSubExpr();
960  E->BuiltinLoc = ReadSourceLocation();
961  E->RParenLoc = ReadSourceLocation();
962 }
963 
964 //===----------------------------------------------------------------------===//
965 // Objective-C Expressions and Statements
966 
967 void ASTStmtReader::VisitObjCStringLiteral(ObjCStringLiteral *E) {
968  VisitExpr(E);
969  E->setString(cast<StringLiteral>(Record.readSubStmt()));
970  E->setAtLoc(ReadSourceLocation());
971 }
972 
973 void ASTStmtReader::VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
974  VisitExpr(E);
975  // could be one of several IntegerLiteral, FloatLiteral, etc.
976  E->SubExpr = Record.readSubStmt();
977  E->BoxingMethod = ReadDeclAs<ObjCMethodDecl>();
978  E->Range = ReadSourceRange();
979 }
980 
981 void ASTStmtReader::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
982  VisitExpr(E);
983  unsigned NumElements = Record.readInt();
984  assert(NumElements == E->getNumElements() && "Wrong number of elements");
985  Expr **Elements = E->getElements();
986  for (unsigned I = 0, N = NumElements; I != N; ++I)
987  Elements[I] = Record.readSubExpr();
988  E->ArrayWithObjectsMethod = ReadDeclAs<ObjCMethodDecl>();
989  E->Range = ReadSourceRange();
990 }
991 
992 void ASTStmtReader::VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *E) {
993  VisitExpr(E);
994  unsigned NumElements = Record.readInt();
995  assert(NumElements == E->getNumElements() && "Wrong number of elements");
996  bool HasPackExpansions = Record.readInt();
997  assert(HasPackExpansions == E->HasPackExpansions &&"Pack expansion mismatch");
999  E->getTrailingObjects<ObjCDictionaryLiteral::KeyValuePair>();
1001  E->getTrailingObjects<ObjCDictionaryLiteral::ExpansionData>();
1002  for (unsigned I = 0; I != NumElements; ++I) {
1003  KeyValues[I].Key = Record.readSubExpr();
1004  KeyValues[I].Value = Record.readSubExpr();
1005  if (HasPackExpansions) {
1006  Expansions[I].EllipsisLoc = ReadSourceLocation();
1007  Expansions[I].NumExpansionsPlusOne = Record.readInt();
1008  }
1009  }
1010  E->DictWithObjectsMethod = ReadDeclAs<ObjCMethodDecl>();
1011  E->Range = ReadSourceRange();
1012 }
1013 
1014 void ASTStmtReader::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
1015  VisitExpr(E);
1016  E->setEncodedTypeSourceInfo(GetTypeSourceInfo());
1017  E->setAtLoc(ReadSourceLocation());
1018  E->setRParenLoc(ReadSourceLocation());
1019 }
1020 
1021 void ASTStmtReader::VisitObjCSelectorExpr(ObjCSelectorExpr *E) {
1022  VisitExpr(E);
1023  E->setSelector(Record.readSelector());
1024  E->setAtLoc(ReadSourceLocation());
1025  E->setRParenLoc(ReadSourceLocation());
1026 }
1027 
1028 void ASTStmtReader::VisitObjCProtocolExpr(ObjCProtocolExpr *E) {
1029  VisitExpr(E);
1030  E->setProtocol(ReadDeclAs<ObjCProtocolDecl>());
1031  E->setAtLoc(ReadSourceLocation());
1032  E->ProtoLoc = ReadSourceLocation();
1033  E->setRParenLoc(ReadSourceLocation());
1034 }
1035 
1036 void ASTStmtReader::VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) {
1037  VisitExpr(E);
1038  E->setDecl(ReadDeclAs<ObjCIvarDecl>());
1039  E->setLocation(ReadSourceLocation());
1040  E->setOpLoc(ReadSourceLocation());
1041  E->setBase(Record.readSubExpr());
1042  E->setIsArrow(Record.readInt());
1043  E->setIsFreeIvar(Record.readInt());
1044 }
1045 
1046 void ASTStmtReader::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
1047  VisitExpr(E);
1048  unsigned MethodRefFlags = Record.readInt();
1049  bool Implicit = Record.readInt() != 0;
1050  if (Implicit) {
1051  ObjCMethodDecl *Getter = ReadDeclAs<ObjCMethodDecl>();
1052  ObjCMethodDecl *Setter = ReadDeclAs<ObjCMethodDecl>();
1053  E->setImplicitProperty(Getter, Setter, MethodRefFlags);
1054  } else {
1055  E->setExplicitProperty(ReadDeclAs<ObjCPropertyDecl>(), MethodRefFlags);
1056  }
1057  E->setLocation(ReadSourceLocation());
1058  E->setReceiverLocation(ReadSourceLocation());
1059  switch (Record.readInt()) {
1060  case 0:
1061  E->setBase(Record.readSubExpr());
1062  break;
1063  case 1:
1064  E->setSuperReceiver(Record.readType());
1065  break;
1066  case 2:
1067  E->setClassReceiver(ReadDeclAs<ObjCInterfaceDecl>());
1068  break;
1069  }
1070 }
1071 
1072 void ASTStmtReader::VisitObjCSubscriptRefExpr(ObjCSubscriptRefExpr *E) {
1073  VisitExpr(E);
1074  E->setRBracket(ReadSourceLocation());
1075  E->setBaseExpr(Record.readSubExpr());
1076  E->setKeyExpr(Record.readSubExpr());
1077  E->GetAtIndexMethodDecl = ReadDeclAs<ObjCMethodDecl>();
1078  E->SetAtIndexMethodDecl = ReadDeclAs<ObjCMethodDecl>();
1079 }
1080 
1081 void ASTStmtReader::VisitObjCMessageExpr(ObjCMessageExpr *E) {
1082  VisitExpr(E);
1083  assert(Record.peekInt() == E->getNumArgs());
1084  Record.skipInts(1);
1085  unsigned NumStoredSelLocs = Record.readInt();
1086  E->SelLocsKind = Record.readInt();
1087  E->setDelegateInitCall(Record.readInt());
1088  E->IsImplicit = Record.readInt();
1090  = static_cast<ObjCMessageExpr::ReceiverKind>(Record.readInt());
1091  switch (Kind) {
1093  E->setInstanceReceiver(Record.readSubExpr());
1094  break;
1095 
1097  E->setClassReceiver(GetTypeSourceInfo());
1098  break;
1099 
1102  QualType T = Record.readType();
1103  SourceLocation SuperLoc = ReadSourceLocation();
1104  E->setSuper(SuperLoc, T, Kind == ObjCMessageExpr::SuperInstance);
1105  break;
1106  }
1107  }
1108 
1109  assert(Kind == E->getReceiverKind());
1110 
1111  if (Record.readInt())
1112  E->setMethodDecl(ReadDeclAs<ObjCMethodDecl>());
1113  else
1114  E->setSelector(Record.readSelector());
1115 
1116  E->LBracLoc = ReadSourceLocation();
1117  E->RBracLoc = ReadSourceLocation();
1118 
1119  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1120  E->setArg(I, Record.readSubExpr());
1121 
1122  SourceLocation *Locs = E->getStoredSelLocs();
1123  for (unsigned I = 0; I != NumStoredSelLocs; ++I)
1124  Locs[I] = ReadSourceLocation();
1125 }
1126 
1127 void ASTStmtReader::VisitObjCForCollectionStmt(ObjCForCollectionStmt *S) {
1128  VisitStmt(S);
1129  S->setElement(Record.readSubStmt());
1130  S->setCollection(Record.readSubExpr());
1131  S->setBody(Record.readSubStmt());
1132  S->setForLoc(ReadSourceLocation());
1133  S->setRParenLoc(ReadSourceLocation());
1134 }
1135 
1136 void ASTStmtReader::VisitObjCAtCatchStmt(ObjCAtCatchStmt *S) {
1137  VisitStmt(S);
1138  S->setCatchBody(Record.readSubStmt());
1139  S->setCatchParamDecl(ReadDeclAs<VarDecl>());
1140  S->setAtCatchLoc(ReadSourceLocation());
1141  S->setRParenLoc(ReadSourceLocation());
1142 }
1143 
1144 void ASTStmtReader::VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S) {
1145  VisitStmt(S);
1146  S->setFinallyBody(Record.readSubStmt());
1147  S->setAtFinallyLoc(ReadSourceLocation());
1148 }
1149 
1150 void ASTStmtReader::VisitObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S) {
1151  VisitStmt(S);
1152  S->setSubStmt(Record.readSubStmt());
1153  S->setAtLoc(ReadSourceLocation());
1154 }
1155 
1156 void ASTStmtReader::VisitObjCAtTryStmt(ObjCAtTryStmt *S) {
1157  VisitStmt(S);
1158  assert(Record.peekInt() == S->getNumCatchStmts());
1159  Record.skipInts(1);
1160  bool HasFinally = Record.readInt();
1161  S->setTryBody(Record.readSubStmt());
1162  for (unsigned I = 0, N = S->getNumCatchStmts(); I != N; ++I)
1163  S->setCatchStmt(I, cast_or_null<ObjCAtCatchStmt>(Record.readSubStmt()));
1164 
1165  if (HasFinally)
1166  S->setFinallyStmt(Record.readSubStmt());
1167  S->setAtTryLoc(ReadSourceLocation());
1168 }
1169 
1170 void ASTStmtReader::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
1171  VisitStmt(S);
1172  S->setSynchExpr(Record.readSubStmt());
1173  S->setSynchBody(Record.readSubStmt());
1174  S->setAtSynchronizedLoc(ReadSourceLocation());
1175 }
1176 
1177 void ASTStmtReader::VisitObjCAtThrowStmt(ObjCAtThrowStmt *S) {
1178  VisitStmt(S);
1179  S->setThrowExpr(Record.readSubStmt());
1180  S->setThrowLoc(ReadSourceLocation());
1181 }
1182 
1183 void ASTStmtReader::VisitObjCBoolLiteralExpr(ObjCBoolLiteralExpr *E) {
1184  VisitExpr(E);
1185  E->setValue(Record.readInt());
1186  E->setLocation(ReadSourceLocation());
1187 }
1188 
1189 void ASTStmtReader::VisitObjCAvailabilityCheckExpr(ObjCAvailabilityCheckExpr *E) {
1190  VisitExpr(E);
1191  SourceRange R = Record.readSourceRange();
1192  E->AtLoc = R.getBegin();
1193  E->RParen = R.getEnd();
1194  E->VersionToCheck = Record.readVersionTuple();
1195 }
1196 
1197 //===----------------------------------------------------------------------===//
1198 // C++ Expressions and Statements
1199 //===----------------------------------------------------------------------===//
1200 
1201 void ASTStmtReader::VisitCXXCatchStmt(CXXCatchStmt *S) {
1202  VisitStmt(S);
1203  S->CatchLoc = ReadSourceLocation();
1204  S->ExceptionDecl = ReadDeclAs<VarDecl>();
1205  S->HandlerBlock = Record.readSubStmt();
1206 }
1207 
1208 void ASTStmtReader::VisitCXXTryStmt(CXXTryStmt *S) {
1209  VisitStmt(S);
1210  assert(Record.peekInt() == S->getNumHandlers() && "NumStmtFields is wrong ?");
1211  Record.skipInts(1);
1212  S->TryLoc = ReadSourceLocation();
1213  S->getStmts()[0] = Record.readSubStmt();
1214  for (unsigned i = 0, e = S->getNumHandlers(); i != e; ++i)
1215  S->getStmts()[i + 1] = Record.readSubStmt();
1216 }
1217 
1218 void ASTStmtReader::VisitCXXForRangeStmt(CXXForRangeStmt *S) {
1219  VisitStmt(S);
1220  S->ForLoc = ReadSourceLocation();
1221  S->CoawaitLoc = ReadSourceLocation();
1222  S->ColonLoc = ReadSourceLocation();
1223  S->RParenLoc = ReadSourceLocation();
1224  S->setRangeStmt(Record.readSubStmt());
1225  S->setBeginStmt(Record.readSubStmt());
1226  S->setEndStmt(Record.readSubStmt());
1227  S->setCond(Record.readSubExpr());
1228  S->setInc(Record.readSubExpr());
1229  S->setLoopVarStmt(Record.readSubStmt());
1230  S->setBody(Record.readSubStmt());
1231 }
1232 
1233 void ASTStmtReader::VisitMSDependentExistsStmt(MSDependentExistsStmt *S) {
1234  VisitStmt(S);
1235  S->KeywordLoc = ReadSourceLocation();
1236  S->IsIfExists = Record.readInt();
1237  S->QualifierLoc = Record.readNestedNameSpecifierLoc();
1238  ReadDeclarationNameInfo(S->NameInfo);
1239  S->SubStmt = Record.readSubStmt();
1240 }
1241 
1242 void ASTStmtReader::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
1243  VisitCallExpr(E);
1244  E->Operator = (OverloadedOperatorKind)Record.readInt();
1245  E->Range = Record.readSourceRange();
1246  E->setFPFeatures(FPOptions(Record.readInt()));
1247 }
1248 
1249 void ASTStmtReader::VisitCXXConstructExpr(CXXConstructExpr *E) {
1250  VisitExpr(E);
1251  E->NumArgs = Record.readInt();
1252  if (E->NumArgs)
1253  E->Args = new (Record.getContext()) Stmt*[E->NumArgs];
1254  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1255  E->setArg(I, Record.readSubExpr());
1256  E->setConstructor(ReadDeclAs<CXXConstructorDecl>());
1257  E->setLocation(ReadSourceLocation());
1258  E->setElidable(Record.readInt());
1259  E->setHadMultipleCandidates(Record.readInt());
1260  E->setListInitialization(Record.readInt());
1264  E->ParenOrBraceRange = ReadSourceRange();
1265 }
1266 
1267 void ASTStmtReader::VisitCXXInheritedCtorInitExpr(CXXInheritedCtorInitExpr *E) {
1268  VisitExpr(E);
1269  E->Constructor = ReadDeclAs<CXXConstructorDecl>();
1270  E->Loc = ReadSourceLocation();
1271  E->ConstructsVirtualBase = Record.readInt();
1272  E->InheritedFromVirtualBase = Record.readInt();
1273 }
1274 
1275 void ASTStmtReader::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
1276  VisitCXXConstructExpr(E);
1277  E->Type = GetTypeSourceInfo();
1278 }
1279 
1280 void ASTStmtReader::VisitLambdaExpr(LambdaExpr *E) {
1281  VisitExpr(E);
1282  unsigned NumCaptures = Record.readInt();
1283  assert(NumCaptures == E->NumCaptures);(void)NumCaptures;
1284  E->IntroducerRange = ReadSourceRange();
1285  E->CaptureDefault = static_cast<LambdaCaptureDefault>(Record.readInt());
1286  E->CaptureDefaultLoc = ReadSourceLocation();
1287  E->ExplicitParams = Record.readInt();
1288  E->ExplicitResultType = Record.readInt();
1289  E->ClosingBrace = ReadSourceLocation();
1290 
1291  // Read capture initializers.
1293  CEnd = E->capture_init_end();
1294  C != CEnd; ++C)
1295  *C = Record.readSubExpr();
1296 }
1297 
1298 void
1299 ASTStmtReader::VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E) {
1300  VisitExpr(E);
1301  E->SubExpr = Record.readSubExpr();
1302 }
1303 
1304 void ASTStmtReader::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) {
1305  VisitExplicitCastExpr(E);
1306  SourceRange R = ReadSourceRange();
1307  E->Loc = R.getBegin();
1308  E->RParenLoc = R.getEnd();
1309  R = ReadSourceRange();
1310  E->AngleBrackets = R;
1311 }
1312 
1313 void ASTStmtReader::VisitCXXStaticCastExpr(CXXStaticCastExpr *E) {
1314  return VisitCXXNamedCastExpr(E);
1315 }
1316 
1317 void ASTStmtReader::VisitCXXDynamicCastExpr(CXXDynamicCastExpr *E) {
1318  return VisitCXXNamedCastExpr(E);
1319 }
1320 
1321 void ASTStmtReader::VisitCXXReinterpretCastExpr(CXXReinterpretCastExpr *E) {
1322  return VisitCXXNamedCastExpr(E);
1323 }
1324 
1325 void ASTStmtReader::VisitCXXConstCastExpr(CXXConstCastExpr *E) {
1326  return VisitCXXNamedCastExpr(E);
1327 }
1328 
1329 void ASTStmtReader::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E) {
1330  VisitExplicitCastExpr(E);
1331  E->setLParenLoc(ReadSourceLocation());
1332  E->setRParenLoc(ReadSourceLocation());
1333 }
1334 
1335 void ASTStmtReader::VisitUserDefinedLiteral(UserDefinedLiteral *E) {
1336  VisitCallExpr(E);
1337  E->UDSuffixLoc = ReadSourceLocation();
1338 }
1339 
1340 void ASTStmtReader::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) {
1341  VisitExpr(E);
1342  E->setValue(Record.readInt());
1343  E->setLocation(ReadSourceLocation());
1344 }
1345 
1346 void ASTStmtReader::VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E) {
1347  VisitExpr(E);
1348  E->setLocation(ReadSourceLocation());
1349 }
1350 
1351 void ASTStmtReader::VisitCXXTypeidExpr(CXXTypeidExpr *E) {
1352  VisitExpr(E);
1353  E->setSourceRange(ReadSourceRange());
1354  if (E->isTypeOperand()) { // typeid(int)
1356  GetTypeSourceInfo());
1357  return;
1358  }
1359 
1360  // typeid(42+2)
1361  E->setExprOperand(Record.readSubExpr());
1362 }
1363 
1364 void ASTStmtReader::VisitCXXThisExpr(CXXThisExpr *E) {
1365  VisitExpr(E);
1366  E->setLocation(ReadSourceLocation());
1367  E->setImplicit(Record.readInt());
1368 }
1369 
1370 void ASTStmtReader::VisitCXXThrowExpr(CXXThrowExpr *E) {
1371  VisitExpr(E);
1372  E->ThrowLoc = ReadSourceLocation();
1373  E->Op = Record.readSubExpr();
1374  E->IsThrownVariableInScope = Record.readInt();
1375 }
1376 
1377 void ASTStmtReader::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
1378  VisitExpr(E);
1379  E->Param = ReadDeclAs<ParmVarDecl>();
1380  E->Loc = ReadSourceLocation();
1381 }
1382 
1383 void ASTStmtReader::VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E) {
1384  VisitExpr(E);
1385  E->Field = ReadDeclAs<FieldDecl>();
1386  E->Loc = ReadSourceLocation();
1387 }
1388 
1389 void ASTStmtReader::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
1390  VisitExpr(E);
1391  E->setTemporary(Record.readCXXTemporary());
1392  E->setSubExpr(Record.readSubExpr());
1393 }
1394 
1395 void ASTStmtReader::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
1396  VisitExpr(E);
1397  E->TypeInfo = GetTypeSourceInfo();
1398  E->RParenLoc = ReadSourceLocation();
1399 }
1400 
1401 void ASTStmtReader::VisitCXXNewExpr(CXXNewExpr *E) {
1402  VisitExpr(E);
1403  E->GlobalNew = Record.readInt();
1404  bool isArray = Record.readInt();
1405  E->PassAlignment = Record.readInt();
1406  E->UsualArrayDeleteWantsSize = Record.readInt();
1407  unsigned NumPlacementArgs = Record.readInt();
1408  E->StoredInitializationStyle = Record.readInt();
1409  E->setOperatorNew(ReadDeclAs<FunctionDecl>());
1410  E->setOperatorDelete(ReadDeclAs<FunctionDecl>());
1411  E->AllocatedTypeInfo = GetTypeSourceInfo();
1412  E->TypeIdParens = ReadSourceRange();
1413  E->Range = ReadSourceRange();
1414  E->DirectInitRange = ReadSourceRange();
1415 
1416  E->AllocateArgsArray(Record.getContext(), isArray, NumPlacementArgs,
1417  E->StoredInitializationStyle != 0);
1418 
1419  // Install all the subexpressions.
1421  I != e; ++I)
1422  *I = Record.readSubStmt();
1423 }
1424 
1425 void ASTStmtReader::VisitCXXDeleteExpr(CXXDeleteExpr *E) {
1426  VisitExpr(E);
1427  E->GlobalDelete = Record.readInt();
1428  E->ArrayForm = Record.readInt();
1429  E->ArrayFormAsWritten = Record.readInt();
1430  E->UsualArrayDeleteWantsSize = Record.readInt();
1431  E->OperatorDelete = ReadDeclAs<FunctionDecl>();
1432  E->Argument = Record.readSubExpr();
1433  E->Loc = ReadSourceLocation();
1434 }
1435 
1436 void ASTStmtReader::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
1437  VisitExpr(E);
1438 
1439  E->Base = Record.readSubExpr();
1440  E->IsArrow = Record.readInt();
1441  E->OperatorLoc = ReadSourceLocation();
1442  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1443  E->ScopeType = GetTypeSourceInfo();
1444  E->ColonColonLoc = ReadSourceLocation();
1445  E->TildeLoc = ReadSourceLocation();
1446 
1447  IdentifierInfo *II = Record.getIdentifierInfo();
1448  if (II)
1449  E->setDestroyedType(II, ReadSourceLocation());
1450  else
1451  E->setDestroyedType(GetTypeSourceInfo());
1452 }
1453 
1454 void ASTStmtReader::VisitExprWithCleanups(ExprWithCleanups *E) {
1455  VisitExpr(E);
1456 
1457  unsigned NumObjects = Record.readInt();
1458  assert(NumObjects == E->getNumObjects());
1459  for (unsigned i = 0; i != NumObjects; ++i)
1460  E->getTrailingObjects<BlockDecl *>()[i] =
1461  ReadDeclAs<BlockDecl>();
1462 
1463  E->ExprWithCleanupsBits.CleanupsHaveSideEffects = Record.readInt();
1464  E->SubExpr = Record.readSubExpr();
1465 }
1466 
1467 void
1468 ASTStmtReader::VisitCXXDependentScopeMemberExpr(CXXDependentScopeMemberExpr *E){
1469  VisitExpr(E);
1470 
1471  if (Record.readInt()) // HasTemplateKWAndArgsInfo
1472  ReadTemplateKWAndArgsInfo(
1473  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
1474  E->getTrailingObjects<TemplateArgumentLoc>(),
1475  /*NumTemplateArgs=*/Record.readInt());
1476 
1477  E->Base = Record.readSubExpr();
1478  E->BaseType = Record.readType();
1479  E->IsArrow = Record.readInt();
1480  E->OperatorLoc = ReadSourceLocation();
1481  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1482  E->FirstQualifierFoundInScope = ReadDeclAs<NamedDecl>();
1483  ReadDeclarationNameInfo(E->MemberNameInfo);
1484 }
1485 
1486 void
1487 ASTStmtReader::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) {
1488  VisitExpr(E);
1489 
1490  if (Record.readInt()) // HasTemplateKWAndArgsInfo
1491  ReadTemplateKWAndArgsInfo(
1492  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
1493  E->getTrailingObjects<TemplateArgumentLoc>(),
1494  /*NumTemplateArgs=*/Record.readInt());
1495 
1496  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1497  ReadDeclarationNameInfo(E->NameInfo);
1498 }
1499 
1500 void
1501 ASTStmtReader::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E) {
1502  VisitExpr(E);
1503  assert(Record.peekInt() == E->arg_size() &&
1504  "Read wrong record during creation ?");
1505  Record.skipInts(1);
1506  for (unsigned I = 0, N = E->arg_size(); I != N; ++I)
1507  E->setArg(I, Record.readSubExpr());
1508  E->Type = GetTypeSourceInfo();
1509  E->setLParenLoc(ReadSourceLocation());
1510  E->setRParenLoc(ReadSourceLocation());
1511 }
1512 
1513 void ASTStmtReader::VisitOverloadExpr(OverloadExpr *E) {
1514  VisitExpr(E);
1515 
1516  if (Record.readInt()) // HasTemplateKWAndArgsInfo
1517  ReadTemplateKWAndArgsInfo(*E->getTrailingASTTemplateKWAndArgsInfo(),
1519  /*NumTemplateArgs=*/Record.readInt());
1520 
1521  unsigned NumDecls = Record.readInt();
1522  UnresolvedSet<8> Decls;
1523  for (unsigned i = 0; i != NumDecls; ++i) {
1524  NamedDecl *D = ReadDeclAs<NamedDecl>();
1525  AccessSpecifier AS = (AccessSpecifier)Record.readInt();
1526  Decls.addDecl(D, AS);
1527  }
1528  E->initializeResults(Record.getContext(), Decls.begin(), Decls.end());
1529 
1530  ReadDeclarationNameInfo(E->NameInfo);
1531  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1532 }
1533 
1534 void ASTStmtReader::VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
1535  VisitOverloadExpr(E);
1536  E->IsArrow = Record.readInt();
1537  E->HasUnresolvedUsing = Record.readInt();
1538  E->Base = Record.readSubExpr();
1539  E->BaseType = Record.readType();
1540  E->OperatorLoc = ReadSourceLocation();
1541 }
1542 
1543 void ASTStmtReader::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) {
1544  VisitOverloadExpr(E);
1545  E->RequiresADL = Record.readInt();
1546  E->Overloaded = Record.readInt();
1547  E->NamingClass = ReadDeclAs<CXXRecordDecl>();
1548 }
1549 
1550 void ASTStmtReader::VisitTypeTraitExpr(TypeTraitExpr *E) {
1551  VisitExpr(E);
1552  E->TypeTraitExprBits.NumArgs = Record.readInt();
1553  E->TypeTraitExprBits.Kind = Record.readInt();
1554  E->TypeTraitExprBits.Value = Record.readInt();
1555  SourceRange Range = ReadSourceRange();
1556  E->Loc = Range.getBegin();
1557  E->RParenLoc = Range.getEnd();
1558 
1559  TypeSourceInfo **Args = E->getTrailingObjects<TypeSourceInfo *>();
1560  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1561  Args[I] = GetTypeSourceInfo();
1562 }
1563 
1564 void ASTStmtReader::VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E) {
1565  VisitExpr(E);
1566  E->ATT = (ArrayTypeTrait)Record.readInt();
1567  E->Value = (unsigned int)Record.readInt();
1568  SourceRange Range = ReadSourceRange();
1569  E->Loc = Range.getBegin();
1570  E->RParen = Range.getEnd();
1571  E->QueriedType = GetTypeSourceInfo();
1572  E->Dimension = Record.readSubExpr();
1573 }
1574 
1575 void ASTStmtReader::VisitExpressionTraitExpr(ExpressionTraitExpr *E) {
1576  VisitExpr(E);
1577  E->ET = (ExpressionTrait)Record.readInt();
1578  E->Value = (bool)Record.readInt();
1579  SourceRange Range = ReadSourceRange();
1580  E->QueriedExpression = Record.readSubExpr();
1581  E->Loc = Range.getBegin();
1582  E->RParen = Range.getEnd();
1583 }
1584 
1585 void ASTStmtReader::VisitCXXNoexceptExpr(CXXNoexceptExpr *E) {
1586  VisitExpr(E);
1587  E->Value = (bool)Record.readInt();
1588  E->Range = ReadSourceRange();
1589  E->Operand = Record.readSubExpr();
1590 }
1591 
1592 void ASTStmtReader::VisitPackExpansionExpr(PackExpansionExpr *E) {
1593  VisitExpr(E);
1594  E->EllipsisLoc = ReadSourceLocation();
1595  E->NumExpansions = Record.readInt();
1596  E->Pattern = Record.readSubExpr();
1597 }
1598 
1599 void ASTStmtReader::VisitSizeOfPackExpr(SizeOfPackExpr *E) {
1600  VisitExpr(E);
1601  unsigned NumPartialArgs = Record.readInt();
1602  E->OperatorLoc = ReadSourceLocation();
1603  E->PackLoc = ReadSourceLocation();
1604  E->RParenLoc = ReadSourceLocation();
1605  E->Pack = Record.readDeclAs<NamedDecl>();
1606  if (E->isPartiallySubstituted()) {
1607  assert(E->Length == NumPartialArgs);
1608  for (auto *I = E->getTrailingObjects<TemplateArgument>(),
1609  *E = I + NumPartialArgs;
1610  I != E; ++I)
1611  new (I) TemplateArgument(Record.readTemplateArgument());
1612  } else if (!E->isValueDependent()) {
1613  E->Length = Record.readInt();
1614  }
1615 }
1616 
1617 void ASTStmtReader::VisitSubstNonTypeTemplateParmExpr(
1619  VisitExpr(E);
1620  E->Param = ReadDeclAs<NonTypeTemplateParmDecl>();
1621  E->NameLoc = ReadSourceLocation();
1622  E->Replacement = Record.readSubExpr();
1623 }
1624 
1625 void ASTStmtReader::VisitSubstNonTypeTemplateParmPackExpr(
1627  VisitExpr(E);
1628  E->Param = ReadDeclAs<NonTypeTemplateParmDecl>();
1629  TemplateArgument ArgPack = Record.readTemplateArgument();
1630  if (ArgPack.getKind() != TemplateArgument::Pack)
1631  return;
1632 
1633  E->Arguments = ArgPack.pack_begin();
1634  E->NumArguments = ArgPack.pack_size();
1635  E->NameLoc = ReadSourceLocation();
1636 }
1637 
1638 void ASTStmtReader::VisitFunctionParmPackExpr(FunctionParmPackExpr *E) {
1639  VisitExpr(E);
1640  E->NumParameters = Record.readInt();
1641  E->ParamPack = ReadDeclAs<ParmVarDecl>();
1642  E->NameLoc = ReadSourceLocation();
1643  ParmVarDecl **Parms = E->getTrailingObjects<ParmVarDecl *>();
1644  for (unsigned i = 0, n = E->NumParameters; i != n; ++i)
1645  Parms[i] = ReadDeclAs<ParmVarDecl>();
1646 }
1647 
1648 void ASTStmtReader::VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E) {
1649  VisitExpr(E);
1650  E->State = Record.readSubExpr();
1651  auto VD = ReadDeclAs<ValueDecl>();
1652  unsigned ManglingNumber = Record.readInt();
1653  E->setExtendingDecl(VD, ManglingNumber);
1654 }
1655 
1656 void ASTStmtReader::VisitCXXFoldExpr(CXXFoldExpr *E) {
1657  VisitExpr(E);
1658  E->LParenLoc = ReadSourceLocation();
1659  E->EllipsisLoc = ReadSourceLocation();
1660  E->RParenLoc = ReadSourceLocation();
1661  E->SubExprs[0] = Record.readSubExpr();
1662  E->SubExprs[1] = Record.readSubExpr();
1663  E->Opcode = (BinaryOperatorKind)Record.readInt();
1664 }
1665 
1666 void ASTStmtReader::VisitOpaqueValueExpr(OpaqueValueExpr *E) {
1667  VisitExpr(E);
1668  E->SourceExpr = Record.readSubExpr();
1669  E->Loc = ReadSourceLocation();
1670 }
1671 
1672 void ASTStmtReader::VisitTypoExpr(TypoExpr *E) {
1673  llvm_unreachable("Cannot read TypoExpr nodes");
1674 }
1675 
1676 //===----------------------------------------------------------------------===//
1677 // Microsoft Expressions and Statements
1678 //===----------------------------------------------------------------------===//
1679 void ASTStmtReader::VisitMSPropertyRefExpr(MSPropertyRefExpr *E) {
1680  VisitExpr(E);
1681  E->IsArrow = (Record.readInt() != 0);
1682  E->BaseExpr = Record.readSubExpr();
1683  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1684  E->MemberLoc = ReadSourceLocation();
1685  E->TheDecl = ReadDeclAs<MSPropertyDecl>();
1686 }
1687 
1688 void ASTStmtReader::VisitMSPropertySubscriptExpr(MSPropertySubscriptExpr *E) {
1689  VisitExpr(E);
1690  E->setBase(Record.readSubExpr());
1691  E->setIdx(Record.readSubExpr());
1692  E->setRBracketLoc(ReadSourceLocation());
1693 }
1694 
1695 void ASTStmtReader::VisitCXXUuidofExpr(CXXUuidofExpr *E) {
1696  VisitExpr(E);
1697  E->setSourceRange(ReadSourceRange());
1698  std::string UuidStr = ReadString();
1699  E->setUuidStr(StringRef(UuidStr).copy(Record.getContext()));
1700  if (E->isTypeOperand()) { // __uuidof(ComType)
1702  GetTypeSourceInfo());
1703  return;
1704  }
1705 
1706  // __uuidof(expr)
1707  E->setExprOperand(Record.readSubExpr());
1708 }
1709 
1710 void ASTStmtReader::VisitSEHLeaveStmt(SEHLeaveStmt *S) {
1711  VisitStmt(S);
1712  S->setLeaveLoc(ReadSourceLocation());
1713 }
1714 
1715 void ASTStmtReader::VisitSEHExceptStmt(SEHExceptStmt *S) {
1716  VisitStmt(S);
1717  S->Loc = ReadSourceLocation();
1718  S->Children[SEHExceptStmt::FILTER_EXPR] = Record.readSubStmt();
1719  S->Children[SEHExceptStmt::BLOCK] = Record.readSubStmt();
1720 }
1721 
1722 void ASTStmtReader::VisitSEHFinallyStmt(SEHFinallyStmt *S) {
1723  VisitStmt(S);
1724  S->Loc = ReadSourceLocation();
1725  S->Block = Record.readSubStmt();
1726 }
1727 
1728 void ASTStmtReader::VisitSEHTryStmt(SEHTryStmt *S) {
1729  VisitStmt(S);
1730  S->IsCXXTry = Record.readInt();
1731  S->TryLoc = ReadSourceLocation();
1732  S->Children[SEHTryStmt::TRY] = Record.readSubStmt();
1733  S->Children[SEHTryStmt::HANDLER] = Record.readSubStmt();
1734 }
1735 
1736 //===----------------------------------------------------------------------===//
1737 // CUDA Expressions and Statements
1738 //===----------------------------------------------------------------------===//
1739 
1740 void ASTStmtReader::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E) {
1741  VisitCallExpr(E);
1742  E->setConfig(cast<CallExpr>(Record.readSubExpr()));
1743 }
1744 
1745 //===----------------------------------------------------------------------===//
1746 // OpenCL Expressions and Statements.
1747 //===----------------------------------------------------------------------===//
1748 void ASTStmtReader::VisitAsTypeExpr(AsTypeExpr *E) {
1749  VisitExpr(E);
1750  E->BuiltinLoc = ReadSourceLocation();
1751  E->RParenLoc = ReadSourceLocation();
1752  E->SrcExpr = Record.readSubExpr();
1753 }
1754 
1755 //===----------------------------------------------------------------------===//
1756 // OpenMP Clauses.
1757 //===----------------------------------------------------------------------===//
1758 
1759 namespace clang {
1760 class OMPClauseReader : public OMPClauseVisitor<OMPClauseReader> {
1761  ASTStmtReader *Reader;
1762  ASTContext &Context;
1763 public:
1765  : Reader(R), Context(Record.getContext()) {}
1766 #define OPENMP_CLAUSE(Name, Class) void Visit##Class(Class *C);
1767 #include "clang/Basic/OpenMPKinds.def"
1768  OMPClause *readClause();
1769  void VisitOMPClauseWithPreInit(OMPClauseWithPreInit *C);
1770  void VisitOMPClauseWithPostUpdate(OMPClauseWithPostUpdate *C);
1771 };
1772 }
1773 
1775  OMPClause *C;
1776  switch (Reader->Record.readInt()) {
1777  case OMPC_if:
1778  C = new (Context) OMPIfClause();
1779  break;
1780  case OMPC_final:
1781  C = new (Context) OMPFinalClause();
1782  break;
1783  case OMPC_num_threads:
1784  C = new (Context) OMPNumThreadsClause();
1785  break;
1786  case OMPC_safelen:
1787  C = new (Context) OMPSafelenClause();
1788  break;
1789  case OMPC_simdlen:
1790  C = new (Context) OMPSimdlenClause();
1791  break;
1792  case OMPC_collapse:
1793  C = new (Context) OMPCollapseClause();
1794  break;
1795  case OMPC_default:
1796  C = new (Context) OMPDefaultClause();
1797  break;
1798  case OMPC_proc_bind:
1799  C = new (Context) OMPProcBindClause();
1800  break;
1801  case OMPC_schedule:
1802  C = new (Context) OMPScheduleClause();
1803  break;
1804  case OMPC_ordered:
1805  C = new (Context) OMPOrderedClause();
1806  break;
1807  case OMPC_nowait:
1808  C = new (Context) OMPNowaitClause();
1809  break;
1810  case OMPC_untied:
1811  C = new (Context) OMPUntiedClause();
1812  break;
1813  case OMPC_mergeable:
1814  C = new (Context) OMPMergeableClause();
1815  break;
1816  case OMPC_read:
1817  C = new (Context) OMPReadClause();
1818  break;
1819  case OMPC_write:
1820  C = new (Context) OMPWriteClause();
1821  break;
1822  case OMPC_update:
1823  C = new (Context) OMPUpdateClause();
1824  break;
1825  case OMPC_capture:
1826  C = new (Context) OMPCaptureClause();
1827  break;
1828  case OMPC_seq_cst:
1829  C = new (Context) OMPSeqCstClause();
1830  break;
1831  case OMPC_threads:
1832  C = new (Context) OMPThreadsClause();
1833  break;
1834  case OMPC_simd:
1835  C = new (Context) OMPSIMDClause();
1836  break;
1837  case OMPC_nogroup:
1838  C = new (Context) OMPNogroupClause();
1839  break;
1840  case OMPC_private:
1841  C = OMPPrivateClause::CreateEmpty(Context, Reader->Record.readInt());
1842  break;
1843  case OMPC_firstprivate:
1844  C = OMPFirstprivateClause::CreateEmpty(Context, Reader->Record.readInt());
1845  break;
1846  case OMPC_lastprivate:
1847  C = OMPLastprivateClause::CreateEmpty(Context, Reader->Record.readInt());
1848  break;
1849  case OMPC_shared:
1850  C = OMPSharedClause::CreateEmpty(Context, Reader->Record.readInt());
1851  break;
1852  case OMPC_reduction:
1853  C = OMPReductionClause::CreateEmpty(Context, Reader->Record.readInt());
1854  break;
1855  case OMPC_task_reduction:
1856  C = OMPTaskReductionClause::CreateEmpty(Context, Reader->Record.readInt());
1857  break;
1858  case OMPC_in_reduction:
1859  C = OMPInReductionClause::CreateEmpty(Context, Reader->Record.readInt());
1860  break;
1861  case OMPC_linear:
1862  C = OMPLinearClause::CreateEmpty(Context, Reader->Record.readInt());
1863  break;
1864  case OMPC_aligned:
1865  C = OMPAlignedClause::CreateEmpty(Context, Reader->Record.readInt());
1866  break;
1867  case OMPC_copyin:
1868  C = OMPCopyinClause::CreateEmpty(Context, Reader->Record.readInt());
1869  break;
1870  case OMPC_copyprivate:
1871  C = OMPCopyprivateClause::CreateEmpty(Context, Reader->Record.readInt());
1872  break;
1873  case OMPC_flush:
1874  C = OMPFlushClause::CreateEmpty(Context, Reader->Record.readInt());
1875  break;
1876  case OMPC_depend:
1877  C = OMPDependClause::CreateEmpty(Context, Reader->Record.readInt());
1878  break;
1879  case OMPC_device:
1880  C = new (Context) OMPDeviceClause();
1881  break;
1882  case OMPC_map: {
1883  unsigned NumVars = Reader->Record.readInt();
1884  unsigned NumDeclarations = Reader->Record.readInt();
1885  unsigned NumLists = Reader->Record.readInt();
1886  unsigned NumComponents = Reader->Record.readInt();
1887  C = OMPMapClause::CreateEmpty(Context, NumVars, NumDeclarations, NumLists,
1888  NumComponents);
1889  break;
1890  }
1891  case OMPC_num_teams:
1892  C = new (Context) OMPNumTeamsClause();
1893  break;
1894  case OMPC_thread_limit:
1895  C = new (Context) OMPThreadLimitClause();
1896  break;
1897  case OMPC_priority:
1898  C = new (Context) OMPPriorityClause();
1899  break;
1900  case OMPC_grainsize:
1901  C = new (Context) OMPGrainsizeClause();
1902  break;
1903  case OMPC_num_tasks:
1904  C = new (Context) OMPNumTasksClause();
1905  break;
1906  case OMPC_hint:
1907  C = new (Context) OMPHintClause();
1908  break;
1909  case OMPC_dist_schedule:
1910  C = new (Context) OMPDistScheduleClause();
1911  break;
1912  case OMPC_defaultmap:
1913  C = new (Context) OMPDefaultmapClause();
1914  break;
1915  case OMPC_to: {
1916  unsigned NumVars = Reader->Record.readInt();
1917  unsigned NumDeclarations = Reader->Record.readInt();
1918  unsigned NumLists = Reader->Record.readInt();
1919  unsigned NumComponents = Reader->Record.readInt();
1920  C = OMPToClause::CreateEmpty(Context, NumVars, NumDeclarations, NumLists,
1921  NumComponents);
1922  break;
1923  }
1924  case OMPC_from: {
1925  unsigned NumVars = Reader->Record.readInt();
1926  unsigned NumDeclarations = Reader->Record.readInt();
1927  unsigned NumLists = Reader->Record.readInt();
1928  unsigned NumComponents = Reader->Record.readInt();
1929  C = OMPFromClause::CreateEmpty(Context, NumVars, NumDeclarations, NumLists,
1930  NumComponents);
1931  break;
1932  }
1933  case OMPC_use_device_ptr: {
1934  unsigned NumVars = Reader->Record.readInt();
1935  unsigned NumDeclarations = Reader->Record.readInt();
1936  unsigned NumLists = Reader->Record.readInt();
1937  unsigned NumComponents = Reader->Record.readInt();
1938  C = OMPUseDevicePtrClause::CreateEmpty(Context, NumVars, NumDeclarations,
1939  NumLists, NumComponents);
1940  break;
1941  }
1942  case OMPC_is_device_ptr: {
1943  unsigned NumVars = Reader->Record.readInt();
1944  unsigned NumDeclarations = Reader->Record.readInt();
1945  unsigned NumLists = Reader->Record.readInt();
1946  unsigned NumComponents = Reader->Record.readInt();
1947  C = OMPIsDevicePtrClause::CreateEmpty(Context, NumVars, NumDeclarations,
1948  NumLists, NumComponents);
1949  break;
1950  }
1951  }
1952  Visit(C);
1953  C->setLocStart(Reader->ReadSourceLocation());
1954  C->setLocEnd(Reader->ReadSourceLocation());
1955 
1956  return C;
1957 }
1958 
1960  C->setPreInitStmt(Reader->Record.readSubStmt(),
1961  static_cast<OpenMPDirectiveKind>(Reader->Record.readInt()));
1962 }
1963 
1965  VisitOMPClauseWithPreInit(C);
1966  C->setPostUpdateExpr(Reader->Record.readSubExpr());
1967 }
1968 
1969 void OMPClauseReader::VisitOMPIfClause(OMPIfClause *C) {
1970  VisitOMPClauseWithPreInit(C);
1971  C->setNameModifier(static_cast<OpenMPDirectiveKind>(Reader->Record.readInt()));
1972  C->setNameModifierLoc(Reader->ReadSourceLocation());
1973  C->setColonLoc(Reader->ReadSourceLocation());
1974  C->setCondition(Reader->Record.readSubExpr());
1975  C->setLParenLoc(Reader->ReadSourceLocation());
1976 }
1977 
1978 void OMPClauseReader::VisitOMPFinalClause(OMPFinalClause *C) {
1979  C->setCondition(Reader->Record.readSubExpr());
1980  C->setLParenLoc(Reader->ReadSourceLocation());
1981 }
1982 
1983 void OMPClauseReader::VisitOMPNumThreadsClause(OMPNumThreadsClause *C) {
1984  VisitOMPClauseWithPreInit(C);
1985  C->setNumThreads(Reader->Record.readSubExpr());
1986  C->setLParenLoc(Reader->ReadSourceLocation());
1987 }
1988 
1989 void OMPClauseReader::VisitOMPSafelenClause(OMPSafelenClause *C) {
1990  C->setSafelen(Reader->Record.readSubExpr());
1991  C->setLParenLoc(Reader->ReadSourceLocation());
1992 }
1993 
1994 void OMPClauseReader::VisitOMPSimdlenClause(OMPSimdlenClause *C) {
1995  C->setSimdlen(Reader->Record.readSubExpr());
1996  C->setLParenLoc(Reader->ReadSourceLocation());
1997 }
1998 
1999 void OMPClauseReader::VisitOMPCollapseClause(OMPCollapseClause *C) {
2000  C->setNumForLoops(Reader->Record.readSubExpr());
2001  C->setLParenLoc(Reader->ReadSourceLocation());
2002 }
2003 
2004 void OMPClauseReader::VisitOMPDefaultClause(OMPDefaultClause *C) {
2005  C->setDefaultKind(
2006  static_cast<OpenMPDefaultClauseKind>(Reader->Record.readInt()));
2007  C->setLParenLoc(Reader->ReadSourceLocation());
2008  C->setDefaultKindKwLoc(Reader->ReadSourceLocation());
2009 }
2010 
2011 void OMPClauseReader::VisitOMPProcBindClause(OMPProcBindClause *C) {
2012  C->setProcBindKind(
2013  static_cast<OpenMPProcBindClauseKind>(Reader->Record.readInt()));
2014  C->setLParenLoc(Reader->ReadSourceLocation());
2015  C->setProcBindKindKwLoc(Reader->ReadSourceLocation());
2016 }
2017 
2018 void OMPClauseReader::VisitOMPScheduleClause(OMPScheduleClause *C) {
2019  VisitOMPClauseWithPreInit(C);
2020  C->setScheduleKind(
2021  static_cast<OpenMPScheduleClauseKind>(Reader->Record.readInt()));
2022  C->setFirstScheduleModifier(
2023  static_cast<OpenMPScheduleClauseModifier>(Reader->Record.readInt()));
2024  C->setSecondScheduleModifier(
2025  static_cast<OpenMPScheduleClauseModifier>(Reader->Record.readInt()));
2026  C->setChunkSize(Reader->Record.readSubExpr());
2027  C->setLParenLoc(Reader->ReadSourceLocation());
2028  C->setFirstScheduleModifierLoc(Reader->ReadSourceLocation());
2029  C->setSecondScheduleModifierLoc(Reader->ReadSourceLocation());
2030  C->setScheduleKindLoc(Reader->ReadSourceLocation());
2031  C->setCommaLoc(Reader->ReadSourceLocation());
2032 }
2033 
2034 void OMPClauseReader::VisitOMPOrderedClause(OMPOrderedClause *C) {
2035  C->setNumForLoops(Reader->Record.readSubExpr());
2036  C->setLParenLoc(Reader->ReadSourceLocation());
2037 }
2038 
2039 void OMPClauseReader::VisitOMPNowaitClause(OMPNowaitClause *) {}
2040 
2041 void OMPClauseReader::VisitOMPUntiedClause(OMPUntiedClause *) {}
2042 
2043 void OMPClauseReader::VisitOMPMergeableClause(OMPMergeableClause *) {}
2044 
2045 void OMPClauseReader::VisitOMPReadClause(OMPReadClause *) {}
2046 
2047 void OMPClauseReader::VisitOMPWriteClause(OMPWriteClause *) {}
2048 
2049 void OMPClauseReader::VisitOMPUpdateClause(OMPUpdateClause *) {}
2050 
2051 void OMPClauseReader::VisitOMPCaptureClause(OMPCaptureClause *) {}
2052 
2053 void OMPClauseReader::VisitOMPSeqCstClause(OMPSeqCstClause *) {}
2054 
2055 void OMPClauseReader::VisitOMPThreadsClause(OMPThreadsClause *) {}
2056 
2057 void OMPClauseReader::VisitOMPSIMDClause(OMPSIMDClause *) {}
2058 
2059 void OMPClauseReader::VisitOMPNogroupClause(OMPNogroupClause *) {}
2060 
2061 void OMPClauseReader::VisitOMPPrivateClause(OMPPrivateClause *C) {
2062  C->setLParenLoc(Reader->ReadSourceLocation());
2063  unsigned NumVars = C->varlist_size();
2065  Vars.reserve(NumVars);
2066  for (unsigned i = 0; i != NumVars; ++i)
2067  Vars.push_back(Reader->Record.readSubExpr());
2068  C->setVarRefs(Vars);
2069  Vars.clear();
2070  for (unsigned i = 0; i != NumVars; ++i)
2071  Vars.push_back(Reader->Record.readSubExpr());
2072  C->setPrivateCopies(Vars);
2073 }
2074 
2075 void OMPClauseReader::VisitOMPFirstprivateClause(OMPFirstprivateClause *C) {
2076  VisitOMPClauseWithPreInit(C);
2077  C->setLParenLoc(Reader->ReadSourceLocation());
2078  unsigned NumVars = C->varlist_size();
2080  Vars.reserve(NumVars);
2081  for (unsigned i = 0; i != NumVars; ++i)
2082  Vars.push_back(Reader->Record.readSubExpr());
2083  C->setVarRefs(Vars);
2084  Vars.clear();
2085  for (unsigned i = 0; i != NumVars; ++i)
2086  Vars.push_back(Reader->Record.readSubExpr());
2087  C->setPrivateCopies(Vars);
2088  Vars.clear();
2089  for (unsigned i = 0; i != NumVars; ++i)
2090  Vars.push_back(Reader->Record.readSubExpr());
2091  C->setInits(Vars);
2092 }
2093 
2094 void OMPClauseReader::VisitOMPLastprivateClause(OMPLastprivateClause *C) {
2095  VisitOMPClauseWithPostUpdate(C);
2096  C->setLParenLoc(Reader->ReadSourceLocation());
2097  unsigned NumVars = C->varlist_size();
2099  Vars.reserve(NumVars);
2100  for (unsigned i = 0; i != NumVars; ++i)
2101  Vars.push_back(Reader->Record.readSubExpr());
2102  C->setVarRefs(Vars);
2103  Vars.clear();
2104  for (unsigned i = 0; i != NumVars; ++i)
2105  Vars.push_back(Reader->Record.readSubExpr());
2106  C->setPrivateCopies(Vars);
2107  Vars.clear();
2108  for (unsigned i = 0; i != NumVars; ++i)
2109  Vars.push_back(Reader->Record.readSubExpr());
2110  C->setSourceExprs(Vars);
2111  Vars.clear();
2112  for (unsigned i = 0; i != NumVars; ++i)
2113  Vars.push_back(Reader->Record.readSubExpr());
2114  C->setDestinationExprs(Vars);
2115  Vars.clear();
2116  for (unsigned i = 0; i != NumVars; ++i)
2117  Vars.push_back(Reader->Record.readSubExpr());
2118  C->setAssignmentOps(Vars);
2119 }
2120 
2121 void OMPClauseReader::VisitOMPSharedClause(OMPSharedClause *C) {
2122  C->setLParenLoc(Reader->ReadSourceLocation());
2123  unsigned NumVars = C->varlist_size();
2125  Vars.reserve(NumVars);
2126  for (unsigned i = 0; i != NumVars; ++i)
2127  Vars.push_back(Reader->Record.readSubExpr());
2128  C->setVarRefs(Vars);
2129 }
2130 
2131 void OMPClauseReader::VisitOMPReductionClause(OMPReductionClause *C) {
2132  VisitOMPClauseWithPostUpdate(C);
2133  C->setLParenLoc(Reader->ReadSourceLocation());
2134  C->setColonLoc(Reader->ReadSourceLocation());
2135  NestedNameSpecifierLoc NNSL = Reader->Record.readNestedNameSpecifierLoc();
2136  DeclarationNameInfo DNI;
2137  Reader->ReadDeclarationNameInfo(DNI);
2138  C->setQualifierLoc(NNSL);
2139  C->setNameInfo(DNI);
2140 
2141  unsigned NumVars = C->varlist_size();
2143  Vars.reserve(NumVars);
2144  for (unsigned i = 0; i != NumVars; ++i)
2145  Vars.push_back(Reader->Record.readSubExpr());
2146  C->setVarRefs(Vars);
2147  Vars.clear();
2148  for (unsigned i = 0; i != NumVars; ++i)
2149  Vars.push_back(Reader->Record.readSubExpr());
2150  C->setPrivates(Vars);
2151  Vars.clear();
2152  for (unsigned i = 0; i != NumVars; ++i)
2153  Vars.push_back(Reader->Record.readSubExpr());
2154  C->setLHSExprs(Vars);
2155  Vars.clear();
2156  for (unsigned i = 0; i != NumVars; ++i)
2157  Vars.push_back(Reader->Record.readSubExpr());
2158  C->setRHSExprs(Vars);
2159  Vars.clear();
2160  for (unsigned i = 0; i != NumVars; ++i)
2161  Vars.push_back(Reader->Record.readSubExpr());
2162  C->setReductionOps(Vars);
2163 }
2164 
2165 void OMPClauseReader::VisitOMPTaskReductionClause(OMPTaskReductionClause *C) {
2166  VisitOMPClauseWithPostUpdate(C);
2167  C->setLParenLoc(Reader->ReadSourceLocation());
2168  C->setColonLoc(Reader->ReadSourceLocation());
2169  NestedNameSpecifierLoc NNSL = Reader->Record.readNestedNameSpecifierLoc();
2170  DeclarationNameInfo DNI;
2171  Reader->ReadDeclarationNameInfo(DNI);
2172  C->setQualifierLoc(NNSL);
2173  C->setNameInfo(DNI);
2174 
2175  unsigned NumVars = C->varlist_size();
2177  Vars.reserve(NumVars);
2178  for (unsigned I = 0; I != NumVars; ++I)
2179  Vars.push_back(Reader->Record.readSubExpr());
2180  C->setVarRefs(Vars);
2181  Vars.clear();
2182  for (unsigned I = 0; I != NumVars; ++I)
2183  Vars.push_back(Reader->Record.readSubExpr());
2184  C->setPrivates(Vars);
2185  Vars.clear();
2186  for (unsigned I = 0; I != NumVars; ++I)
2187  Vars.push_back(Reader->Record.readSubExpr());
2188  C->setLHSExprs(Vars);
2189  Vars.clear();
2190  for (unsigned I = 0; I != NumVars; ++I)
2191  Vars.push_back(Reader->Record.readSubExpr());
2192  C->setRHSExprs(Vars);
2193  Vars.clear();
2194  for (unsigned I = 0; I != NumVars; ++I)
2195  Vars.push_back(Reader->Record.readSubExpr());
2196  C->setReductionOps(Vars);
2197 }
2198 
2199 void OMPClauseReader::VisitOMPInReductionClause(OMPInReductionClause *C) {
2200  VisitOMPClauseWithPostUpdate(C);
2201  C->setLParenLoc(Reader->ReadSourceLocation());
2202  C->setColonLoc(Reader->ReadSourceLocation());
2203  NestedNameSpecifierLoc NNSL = Reader->Record.readNestedNameSpecifierLoc();
2204  DeclarationNameInfo DNI;
2205  Reader->ReadDeclarationNameInfo(DNI);
2206  C->setQualifierLoc(NNSL);
2207  C->setNameInfo(DNI);
2208 
2209  unsigned NumVars = C->varlist_size();
2211  Vars.reserve(NumVars);
2212  for (unsigned I = 0; I != NumVars; ++I)
2213  Vars.push_back(Reader->Record.readSubExpr());
2214  C->setVarRefs(Vars);
2215  Vars.clear();
2216  for (unsigned I = 0; I != NumVars; ++I)
2217  Vars.push_back(Reader->Record.readSubExpr());
2218  C->setPrivates(Vars);
2219  Vars.clear();
2220  for (unsigned I = 0; I != NumVars; ++I)
2221  Vars.push_back(Reader->Record.readSubExpr());
2222  C->setLHSExprs(Vars);
2223  Vars.clear();
2224  for (unsigned I = 0; I != NumVars; ++I)
2225  Vars.push_back(Reader->Record.readSubExpr());
2226  C->setRHSExprs(Vars);
2227  Vars.clear();
2228  for (unsigned I = 0; I != NumVars; ++I)
2229  Vars.push_back(Reader->Record.readSubExpr());
2230  C->setReductionOps(Vars);
2231  Vars.clear();
2232  for (unsigned I = 0; I != NumVars; ++I)
2233  Vars.push_back(Reader->Record.readSubExpr());
2234  C->setTaskgroupDescriptors(Vars);
2235 }
2236 
2237 void OMPClauseReader::VisitOMPLinearClause(OMPLinearClause *C) {
2238  VisitOMPClauseWithPostUpdate(C);
2239  C->setLParenLoc(Reader->ReadSourceLocation());
2240  C->setColonLoc(Reader->ReadSourceLocation());
2241  C->setModifier(static_cast<OpenMPLinearClauseKind>(Reader->Record.readInt()));
2242  C->setModifierLoc(Reader->ReadSourceLocation());
2243  unsigned NumVars = C->varlist_size();
2245  Vars.reserve(NumVars);
2246  for (unsigned i = 0; i != NumVars; ++i)
2247  Vars.push_back(Reader->Record.readSubExpr());
2248  C->setVarRefs(Vars);
2249  Vars.clear();
2250  for (unsigned i = 0; i != NumVars; ++i)
2251  Vars.push_back(Reader->Record.readSubExpr());
2252  C->setPrivates(Vars);
2253  Vars.clear();
2254  for (unsigned i = 0; i != NumVars; ++i)
2255  Vars.push_back(Reader->Record.readSubExpr());
2256  C->setInits(Vars);
2257  Vars.clear();
2258  for (unsigned i = 0; i != NumVars; ++i)
2259  Vars.push_back(Reader->Record.readSubExpr());
2260  C->setUpdates(Vars);
2261  Vars.clear();
2262  for (unsigned i = 0; i != NumVars; ++i)
2263  Vars.push_back(Reader->Record.readSubExpr());
2264  C->setFinals(Vars);
2265  C->setStep(Reader->Record.readSubExpr());
2266  C->setCalcStep(Reader->Record.readSubExpr());
2267 }
2268 
2269 void OMPClauseReader::VisitOMPAlignedClause(OMPAlignedClause *C) {
2270  C->setLParenLoc(Reader->ReadSourceLocation());
2271  C->setColonLoc(Reader->ReadSourceLocation());
2272  unsigned NumVars = C->varlist_size();
2274  Vars.reserve(NumVars);
2275  for (unsigned i = 0; i != NumVars; ++i)
2276  Vars.push_back(Reader->Record.readSubExpr());
2277  C->setVarRefs(Vars);
2278  C->setAlignment(Reader->Record.readSubExpr());
2279 }
2280 
2281 void OMPClauseReader::VisitOMPCopyinClause(OMPCopyinClause *C) {
2282  C->setLParenLoc(Reader->ReadSourceLocation());
2283  unsigned NumVars = C->varlist_size();
2285  Exprs.reserve(NumVars);
2286  for (unsigned i = 0; i != NumVars; ++i)
2287  Exprs.push_back(Reader->Record.readSubExpr());
2288  C->setVarRefs(Exprs);
2289  Exprs.clear();
2290  for (unsigned i = 0; i != NumVars; ++i)
2291  Exprs.push_back(Reader->Record.readSubExpr());
2292  C->setSourceExprs(Exprs);
2293  Exprs.clear();
2294  for (unsigned i = 0; i != NumVars; ++i)
2295  Exprs.push_back(Reader->Record.readSubExpr());
2296  C->setDestinationExprs(Exprs);
2297  Exprs.clear();
2298  for (unsigned i = 0; i != NumVars; ++i)
2299  Exprs.push_back(Reader->Record.readSubExpr());
2300  C->setAssignmentOps(Exprs);
2301 }
2302 
2303 void OMPClauseReader::VisitOMPCopyprivateClause(OMPCopyprivateClause *C) {
2304  C->setLParenLoc(Reader->ReadSourceLocation());
2305  unsigned NumVars = C->varlist_size();
2307  Exprs.reserve(NumVars);
2308  for (unsigned i = 0; i != NumVars; ++i)
2309  Exprs.push_back(Reader->Record.readSubExpr());
2310  C->setVarRefs(Exprs);
2311  Exprs.clear();
2312  for (unsigned i = 0; i != NumVars; ++i)
2313  Exprs.push_back(Reader->Record.readSubExpr());
2314  C->setSourceExprs(Exprs);
2315  Exprs.clear();
2316  for (unsigned i = 0; i != NumVars; ++i)
2317  Exprs.push_back(Reader->Record.readSubExpr());
2318  C->setDestinationExprs(Exprs);
2319  Exprs.clear();
2320  for (unsigned i = 0; i != NumVars; ++i)
2321  Exprs.push_back(Reader->Record.readSubExpr());
2322  C->setAssignmentOps(Exprs);
2323 }
2324 
2325 void OMPClauseReader::VisitOMPFlushClause(OMPFlushClause *C) {
2326  C->setLParenLoc(Reader->ReadSourceLocation());
2327  unsigned NumVars = C->varlist_size();
2329  Vars.reserve(NumVars);
2330  for (unsigned i = 0; i != NumVars; ++i)
2331  Vars.push_back(Reader->Record.readSubExpr());
2332  C->setVarRefs(Vars);
2333 }
2334 
2335 void OMPClauseReader::VisitOMPDependClause(OMPDependClause *C) {
2336  C->setLParenLoc(Reader->ReadSourceLocation());
2337  C->setDependencyKind(
2338  static_cast<OpenMPDependClauseKind>(Reader->Record.readInt()));
2339  C->setDependencyLoc(Reader->ReadSourceLocation());
2340  C->setColonLoc(Reader->ReadSourceLocation());
2341  unsigned NumVars = C->varlist_size();
2343  Vars.reserve(NumVars);
2344  for (unsigned i = 0; i != NumVars; ++i)
2345  Vars.push_back(Reader->Record.readSubExpr());
2346  C->setVarRefs(Vars);
2347  C->setCounterValue(Reader->Record.readSubExpr());
2348 }
2349 
2350 void OMPClauseReader::VisitOMPDeviceClause(OMPDeviceClause *C) {
2351  VisitOMPClauseWithPreInit(C);
2352  C->setDevice(Reader->Record.readSubExpr());
2353  C->setLParenLoc(Reader->ReadSourceLocation());
2354 }
2355 
2356 void OMPClauseReader::VisitOMPMapClause(OMPMapClause *C) {
2357  C->setLParenLoc(Reader->ReadSourceLocation());
2358  C->setMapTypeModifier(
2359  static_cast<OpenMPMapClauseKind>(Reader->Record.readInt()));
2360  C->setMapType(
2361  static_cast<OpenMPMapClauseKind>(Reader->Record.readInt()));
2362  C->setMapLoc(Reader->ReadSourceLocation());
2363  C->setColonLoc(Reader->ReadSourceLocation());
2364  auto NumVars = C->varlist_size();
2365  auto UniqueDecls = C->getUniqueDeclarationsNum();
2366  auto TotalLists = C->getTotalComponentListNum();
2367  auto TotalComponents = C->getTotalComponentsNum();
2368 
2370  Vars.reserve(NumVars);
2371  for (unsigned i = 0; i != NumVars; ++i)
2372  Vars.push_back(Reader->Record.readSubExpr());
2373  C->setVarRefs(Vars);
2374 
2376  Decls.reserve(UniqueDecls);
2377  for (unsigned i = 0; i < UniqueDecls; ++i)
2378  Decls.push_back(Reader->Record.readDeclAs<ValueDecl>());
2379  C->setUniqueDecls(Decls);
2380 
2381  SmallVector<unsigned, 16> ListsPerDecl;
2382  ListsPerDecl.reserve(UniqueDecls);
2383  for (unsigned i = 0; i < UniqueDecls; ++i)
2384  ListsPerDecl.push_back(Reader->Record.readInt());
2385  C->setDeclNumLists(ListsPerDecl);
2386 
2387  SmallVector<unsigned, 32> ListSizes;
2388  ListSizes.reserve(TotalLists);
2389  for (unsigned i = 0; i < TotalLists; ++i)
2390  ListSizes.push_back(Reader->Record.readInt());
2391  C->setComponentListSizes(ListSizes);
2392 
2394  Components.reserve(TotalComponents);
2395  for (unsigned i = 0; i < TotalComponents; ++i) {
2396  Expr *AssociatedExpr = Reader->Record.readSubExpr();
2397  ValueDecl *AssociatedDecl = Reader->Record.readDeclAs<ValueDecl>();
2399  AssociatedExpr, AssociatedDecl));
2400  }
2401  C->setComponents(Components, ListSizes);
2402 }
2403 
2404 void OMPClauseReader::VisitOMPNumTeamsClause(OMPNumTeamsClause *C) {
2405  VisitOMPClauseWithPreInit(C);
2406  C->setNumTeams(Reader->Record.readSubExpr());
2407  C->setLParenLoc(Reader->ReadSourceLocation());
2408 }
2409 
2410 void OMPClauseReader::VisitOMPThreadLimitClause(OMPThreadLimitClause *C) {
2411  VisitOMPClauseWithPreInit(C);
2412  C->setThreadLimit(Reader->Record.readSubExpr());
2413  C->setLParenLoc(Reader->ReadSourceLocation());
2414 }
2415 
2416 void OMPClauseReader::VisitOMPPriorityClause(OMPPriorityClause *C) {
2417  C->setPriority(Reader->Record.readSubExpr());
2418  C->setLParenLoc(Reader->ReadSourceLocation());
2419 }
2420 
2421 void OMPClauseReader::VisitOMPGrainsizeClause(OMPGrainsizeClause *C) {
2422  C->setGrainsize(Reader->Record.readSubExpr());
2423  C->setLParenLoc(Reader->ReadSourceLocation());
2424 }
2425 
2426 void OMPClauseReader::VisitOMPNumTasksClause(OMPNumTasksClause *C) {
2427  C->setNumTasks(Reader->Record.readSubExpr());
2428  C->setLParenLoc(Reader->ReadSourceLocation());
2429 }
2430 
2431 void OMPClauseReader::VisitOMPHintClause(OMPHintClause *C) {
2432  C->setHint(Reader->Record.readSubExpr());
2433  C->setLParenLoc(Reader->ReadSourceLocation());
2434 }
2435 
2436 void OMPClauseReader::VisitOMPDistScheduleClause(OMPDistScheduleClause *C) {
2437  VisitOMPClauseWithPreInit(C);
2438  C->setDistScheduleKind(
2439  static_cast<OpenMPDistScheduleClauseKind>(Reader->Record.readInt()));
2440  C->setChunkSize(Reader->Record.readSubExpr());
2441  C->setLParenLoc(Reader->ReadSourceLocation());
2442  C->setDistScheduleKindLoc(Reader->ReadSourceLocation());
2443  C->setCommaLoc(Reader->ReadSourceLocation());
2444 }
2445 
2446 void OMPClauseReader::VisitOMPDefaultmapClause(OMPDefaultmapClause *C) {
2447  C->setDefaultmapKind(
2448  static_cast<OpenMPDefaultmapClauseKind>(Reader->Record.readInt()));
2449  C->setDefaultmapModifier(
2450  static_cast<OpenMPDefaultmapClauseModifier>(Reader->Record.readInt()));
2451  C->setLParenLoc(Reader->ReadSourceLocation());
2452  C->setDefaultmapModifierLoc(Reader->ReadSourceLocation());
2453  C->setDefaultmapKindLoc(Reader->ReadSourceLocation());
2454 }
2455 
2456 void OMPClauseReader::VisitOMPToClause(OMPToClause *C) {
2457  C->setLParenLoc(Reader->ReadSourceLocation());
2458  auto NumVars = C->varlist_size();
2459  auto UniqueDecls = C->getUniqueDeclarationsNum();
2460  auto TotalLists = C->getTotalComponentListNum();
2461  auto TotalComponents = C->getTotalComponentsNum();
2462 
2464  Vars.reserve(NumVars);
2465  for (unsigned i = 0; i != NumVars; ++i)
2466  Vars.push_back(Reader->Record.readSubExpr());
2467  C->setVarRefs(Vars);
2468 
2470  Decls.reserve(UniqueDecls);
2471  for (unsigned i = 0; i < UniqueDecls; ++i)
2472  Decls.push_back(Reader->Record.readDeclAs<ValueDecl>());
2473  C->setUniqueDecls(Decls);
2474 
2475  SmallVector<unsigned, 16> ListsPerDecl;
2476  ListsPerDecl.reserve(UniqueDecls);
2477  for (unsigned i = 0; i < UniqueDecls; ++i)
2478  ListsPerDecl.push_back(Reader->Record.readInt());
2479  C->setDeclNumLists(ListsPerDecl);
2480 
2481  SmallVector<unsigned, 32> ListSizes;
2482  ListSizes.reserve(TotalLists);
2483  for (unsigned i = 0; i < TotalLists; ++i)
2484  ListSizes.push_back(Reader->Record.readInt());
2485  C->setComponentListSizes(ListSizes);
2486 
2488  Components.reserve(TotalComponents);
2489  for (unsigned i = 0; i < TotalComponents; ++i) {
2490  Expr *AssociatedExpr = Reader->Record.readSubExpr();
2491  ValueDecl *AssociatedDecl = Reader->Record.readDeclAs<ValueDecl>();
2493  AssociatedExpr, AssociatedDecl));
2494  }
2495  C->setComponents(Components, ListSizes);
2496 }
2497 
2498 void OMPClauseReader::VisitOMPFromClause(OMPFromClause *C) {
2499  C->setLParenLoc(Reader->ReadSourceLocation());
2500  auto NumVars = C->varlist_size();
2501  auto UniqueDecls = C->getUniqueDeclarationsNum();
2502  auto TotalLists = C->getTotalComponentListNum();
2503  auto TotalComponents = C->getTotalComponentsNum();
2504 
2506  Vars.reserve(NumVars);
2507  for (unsigned i = 0; i != NumVars; ++i)
2508  Vars.push_back(Reader->Record.readSubExpr());
2509  C->setVarRefs(Vars);
2510 
2512  Decls.reserve(UniqueDecls);
2513  for (unsigned i = 0; i < UniqueDecls; ++i)
2514  Decls.push_back(Reader->Record.readDeclAs<ValueDecl>());
2515  C->setUniqueDecls(Decls);
2516 
2517  SmallVector<unsigned, 16> ListsPerDecl;
2518  ListsPerDecl.reserve(UniqueDecls);
2519  for (unsigned i = 0; i < UniqueDecls; ++i)
2520  ListsPerDecl.push_back(Reader->Record.readInt());
2521  C->setDeclNumLists(ListsPerDecl);
2522 
2523  SmallVector<unsigned, 32> ListSizes;
2524  ListSizes.reserve(TotalLists);
2525  for (unsigned i = 0; i < TotalLists; ++i)
2526  ListSizes.push_back(Reader->Record.readInt());
2527  C->setComponentListSizes(ListSizes);
2528 
2530  Components.reserve(TotalComponents);
2531  for (unsigned i = 0; i < TotalComponents; ++i) {
2532  Expr *AssociatedExpr = Reader->Record.readSubExpr();
2533  ValueDecl *AssociatedDecl = Reader->Record.readDeclAs<ValueDecl>();
2535  AssociatedExpr, AssociatedDecl));
2536  }
2537  C->setComponents(Components, ListSizes);
2538 }
2539 
2540 void OMPClauseReader::VisitOMPUseDevicePtrClause(OMPUseDevicePtrClause *C) {
2541  C->setLParenLoc(Reader->ReadSourceLocation());
2542  auto NumVars = C->varlist_size();
2543  auto UniqueDecls = C->getUniqueDeclarationsNum();
2544  auto TotalLists = C->getTotalComponentListNum();
2545  auto TotalComponents = C->getTotalComponentsNum();
2546 
2548  Vars.reserve(NumVars);
2549  for (unsigned i = 0; i != NumVars; ++i)
2550  Vars.push_back(Reader->Record.readSubExpr());
2551  C->setVarRefs(Vars);
2552  Vars.clear();
2553  for (unsigned i = 0; i != NumVars; ++i)
2554  Vars.push_back(Reader->Record.readSubExpr());
2555  C->setPrivateCopies(Vars);
2556  Vars.clear();
2557  for (unsigned i = 0; i != NumVars; ++i)
2558  Vars.push_back(Reader->Record.readSubExpr());
2559  C->setInits(Vars);
2560 
2562  Decls.reserve(UniqueDecls);
2563  for (unsigned i = 0; i < UniqueDecls; ++i)
2564  Decls.push_back(Reader->Record.readDeclAs<ValueDecl>());
2565  C->setUniqueDecls(Decls);
2566 
2567  SmallVector<unsigned, 16> ListsPerDecl;
2568  ListsPerDecl.reserve(UniqueDecls);
2569  for (unsigned i = 0; i < UniqueDecls; ++i)
2570  ListsPerDecl.push_back(Reader->Record.readInt());
2571  C->setDeclNumLists(ListsPerDecl);
2572 
2573  SmallVector<unsigned, 32> ListSizes;
2574  ListSizes.reserve(TotalLists);
2575  for (unsigned i = 0; i < TotalLists; ++i)
2576  ListSizes.push_back(Reader->Record.readInt());
2577  C->setComponentListSizes(ListSizes);
2578 
2580  Components.reserve(TotalComponents);
2581  for (unsigned i = 0; i < TotalComponents; ++i) {
2582  Expr *AssociatedExpr = Reader->Record.readSubExpr();
2583  ValueDecl *AssociatedDecl = Reader->Record.readDeclAs<ValueDecl>();
2585  AssociatedExpr, AssociatedDecl));
2586  }
2587  C->setComponents(Components, ListSizes);
2588 }
2589 
2590 void OMPClauseReader::VisitOMPIsDevicePtrClause(OMPIsDevicePtrClause *C) {
2591  C->setLParenLoc(Reader->ReadSourceLocation());
2592  auto NumVars = C->varlist_size();
2593  auto UniqueDecls = C->getUniqueDeclarationsNum();
2594  auto TotalLists = C->getTotalComponentListNum();
2595  auto TotalComponents = C->getTotalComponentsNum();
2596 
2598  Vars.reserve(NumVars);
2599  for (unsigned i = 0; i != NumVars; ++i)
2600  Vars.push_back(Reader->Record.readSubExpr());
2601  C->setVarRefs(Vars);
2602  Vars.clear();
2603 
2605  Decls.reserve(UniqueDecls);
2606  for (unsigned i = 0; i < UniqueDecls; ++i)
2607  Decls.push_back(Reader->Record.readDeclAs<ValueDecl>());
2608  C->setUniqueDecls(Decls);
2609 
2610  SmallVector<unsigned, 16> ListsPerDecl;
2611  ListsPerDecl.reserve(UniqueDecls);
2612  for (unsigned i = 0; i < UniqueDecls; ++i)
2613  ListsPerDecl.push_back(Reader->Record.readInt());
2614  C->setDeclNumLists(ListsPerDecl);
2615 
2616  SmallVector<unsigned, 32> ListSizes;
2617  ListSizes.reserve(TotalLists);
2618  for (unsigned i = 0; i < TotalLists; ++i)
2619  ListSizes.push_back(Reader->Record.readInt());
2620  C->setComponentListSizes(ListSizes);
2621 
2623  Components.reserve(TotalComponents);
2624  for (unsigned i = 0; i < TotalComponents; ++i) {
2625  Expr *AssociatedExpr = Reader->Record.readSubExpr();
2626  ValueDecl *AssociatedDecl = Reader->Record.readDeclAs<ValueDecl>();
2628  AssociatedExpr, AssociatedDecl));
2629  }
2630  C->setComponents(Components, ListSizes);
2631 }
2632 
2633 //===----------------------------------------------------------------------===//
2634 // OpenMP Directives.
2635 //===----------------------------------------------------------------------===//
2636 void ASTStmtReader::VisitOMPExecutableDirective(OMPExecutableDirective *E) {
2637  E->setLocStart(ReadSourceLocation());
2638  E->setLocEnd(ReadSourceLocation());
2639  OMPClauseReader ClauseReader(this, Record);
2641  for (unsigned i = 0; i < E->getNumClauses(); ++i)
2642  Clauses.push_back(ClauseReader.readClause());
2643  E->setClauses(Clauses);
2644  if (E->hasAssociatedStmt())
2645  E->setAssociatedStmt(Record.readSubStmt());
2646 }
2647 
2648 void ASTStmtReader::VisitOMPLoopDirective(OMPLoopDirective *D) {
2649  VisitStmt(D);
2650  // Two fields (NumClauses and CollapsedNum) were read in ReadStmtFromStream.
2651  Record.skipInts(2);
2652  VisitOMPExecutableDirective(D);
2653  D->setIterationVariable(Record.readSubExpr());
2654  D->setLastIteration(Record.readSubExpr());
2655  D->setCalcLastIteration(Record.readSubExpr());
2656  D->setPreCond(Record.readSubExpr());
2657  D->setCond(Record.readSubExpr());
2658  D->setInit(Record.readSubExpr());
2659  D->setInc(Record.readSubExpr());
2660  D->setPreInits(Record.readSubStmt());
2664  D->setIsLastIterVariable(Record.readSubExpr());
2665  D->setLowerBoundVariable(Record.readSubExpr());
2666  D->setUpperBoundVariable(Record.readSubExpr());
2667  D->setStrideVariable(Record.readSubExpr());
2668  D->setEnsureUpperBound(Record.readSubExpr());
2669  D->setNextLowerBound(Record.readSubExpr());
2670  D->setNextUpperBound(Record.readSubExpr());
2671  D->setNumIterations(Record.readSubExpr());
2672  }
2676  D->setDistInc(Record.readSubExpr());
2677  D->setPrevEnsureUpperBound(Record.readSubExpr());
2681  D->setCombinedInit(Record.readSubExpr());
2682  D->setCombinedCond(Record.readSubExpr());
2685  }
2687  unsigned CollapsedNum = D->getCollapsedNumber();
2688  Sub.reserve(CollapsedNum);
2689  for (unsigned i = 0; i < CollapsedNum; ++i)
2690  Sub.push_back(Record.readSubExpr());
2691  D->setCounters(Sub);
2692  Sub.clear();
2693  for (unsigned i = 0; i < CollapsedNum; ++i)
2694  Sub.push_back(Record.readSubExpr());
2695  D->setPrivateCounters(Sub);
2696  Sub.clear();
2697  for (unsigned i = 0; i < CollapsedNum; ++i)
2698  Sub.push_back(Record.readSubExpr());
2699  D->setInits(Sub);
2700  Sub.clear();
2701  for (unsigned i = 0; i < CollapsedNum; ++i)
2702  Sub.push_back(Record.readSubExpr());
2703  D->setUpdates(Sub);
2704  Sub.clear();
2705  for (unsigned i = 0; i < CollapsedNum; ++i)
2706  Sub.push_back(Record.readSubExpr());
2707  D->setFinals(Sub);
2708 }
2709 
2710 void ASTStmtReader::VisitOMPParallelDirective(OMPParallelDirective *D) {
2711  VisitStmt(D);
2712  // The NumClauses field was read in ReadStmtFromStream.
2713  Record.skipInts(1);
2714  VisitOMPExecutableDirective(D);
2715  D->setHasCancel(Record.readInt());
2716 }
2717 
2718 void ASTStmtReader::VisitOMPSimdDirective(OMPSimdDirective *D) {
2719  VisitOMPLoopDirective(D);
2720 }
2721 
2722 void ASTStmtReader::VisitOMPForDirective(OMPForDirective *D) {
2723  VisitOMPLoopDirective(D);
2724  D->setHasCancel(Record.readInt());
2725 }
2726 
2727 void ASTStmtReader::VisitOMPForSimdDirective(OMPForSimdDirective *D) {
2728  VisitOMPLoopDirective(D);
2729 }
2730 
2731 void ASTStmtReader::VisitOMPSectionsDirective(OMPSectionsDirective *D) {
2732  VisitStmt(D);
2733  // The NumClauses field was read in ReadStmtFromStream.
2734  Record.skipInts(1);
2735  VisitOMPExecutableDirective(D);
2736  D->setHasCancel(Record.readInt());
2737 }
2738 
2739 void ASTStmtReader::VisitOMPSectionDirective(OMPSectionDirective *D) {
2740  VisitStmt(D);
2741  VisitOMPExecutableDirective(D);
2742  D->setHasCancel(Record.readInt());
2743 }
2744 
2745 void ASTStmtReader::VisitOMPSingleDirective(OMPSingleDirective *D) {
2746  VisitStmt(D);
2747  // The NumClauses field was read in ReadStmtFromStream.
2748  Record.skipInts(1);
2749  VisitOMPExecutableDirective(D);
2750 }
2751 
2752 void ASTStmtReader::VisitOMPMasterDirective(OMPMasterDirective *D) {
2753  VisitStmt(D);
2754  VisitOMPExecutableDirective(D);
2755 }
2756 
2757 void ASTStmtReader::VisitOMPCriticalDirective(OMPCriticalDirective *D) {
2758  VisitStmt(D);
2759  // The NumClauses field was read in ReadStmtFromStream.
2760  Record.skipInts(1);
2761  VisitOMPExecutableDirective(D);
2762  ReadDeclarationNameInfo(D->DirName);
2763 }
2764 
2765 void ASTStmtReader::VisitOMPParallelForDirective(OMPParallelForDirective *D) {
2766  VisitOMPLoopDirective(D);
2767  D->setHasCancel(Record.readInt());
2768 }
2769 
2770 void ASTStmtReader::VisitOMPParallelForSimdDirective(
2772  VisitOMPLoopDirective(D);
2773 }
2774 
2775 void ASTStmtReader::VisitOMPParallelSectionsDirective(
2777  VisitStmt(D);
2778  // The NumClauses field was read in ReadStmtFromStream.
2779  Record.skipInts(1);
2780  VisitOMPExecutableDirective(D);
2781  D->setHasCancel(Record.readInt());
2782 }
2783 
2784 void ASTStmtReader::VisitOMPTaskDirective(OMPTaskDirective *D) {
2785  VisitStmt(D);
2786  // The NumClauses field was read in ReadStmtFromStream.
2787  Record.skipInts(1);
2788  VisitOMPExecutableDirective(D);
2789  D->setHasCancel(Record.readInt());
2790 }
2791 
2792 void ASTStmtReader::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) {
2793  VisitStmt(D);
2794  VisitOMPExecutableDirective(D);
2795 }
2796 
2797 void ASTStmtReader::VisitOMPBarrierDirective(OMPBarrierDirective *D) {
2798  VisitStmt(D);
2799  VisitOMPExecutableDirective(D);
2800 }
2801 
2802 void ASTStmtReader::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) {
2803  VisitStmt(D);
2804  VisitOMPExecutableDirective(D);
2805 }
2806 
2807 void ASTStmtReader::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) {
2808  VisitStmt(D);
2809  // The NumClauses field was read in ReadStmtFromStream.
2810  Record.skipInts(1);
2811  VisitOMPExecutableDirective(D);
2812  D->setReductionRef(Record.readSubExpr());
2813 }
2814 
2815 void ASTStmtReader::VisitOMPFlushDirective(OMPFlushDirective *D) {
2816  VisitStmt(D);
2817  // The NumClauses field was read in ReadStmtFromStream.
2818  Record.skipInts(1);
2819  VisitOMPExecutableDirective(D);
2820 }
2821 
2822 void ASTStmtReader::VisitOMPOrderedDirective(OMPOrderedDirective *D) {
2823  VisitStmt(D);
2824  // The NumClauses field was read in ReadStmtFromStream.
2825  Record.skipInts(1);
2826  VisitOMPExecutableDirective(D);
2827 }
2828 
2829 void ASTStmtReader::VisitOMPAtomicDirective(OMPAtomicDirective *D) {
2830  VisitStmt(D);
2831  // The NumClauses field was read in ReadStmtFromStream.
2832  Record.skipInts(1);
2833  VisitOMPExecutableDirective(D);
2834  D->setX(Record.readSubExpr());
2835  D->setV(Record.readSubExpr());
2836  D->setExpr(Record.readSubExpr());
2837  D->setUpdateExpr(Record.readSubExpr());
2838  D->IsXLHSInRHSPart = Record.readInt() != 0;
2839  D->IsPostfixUpdate = Record.readInt() != 0;
2840 }
2841 
2842 void ASTStmtReader::VisitOMPTargetDirective(OMPTargetDirective *D) {
2843  VisitStmt(D);
2844  // The NumClauses field was read in ReadStmtFromStream.
2845  Record.skipInts(1);
2846  VisitOMPExecutableDirective(D);
2847 }
2848 
2849 void ASTStmtReader::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) {
2850  VisitStmt(D);
2851  Record.skipInts(1);
2852  VisitOMPExecutableDirective(D);
2853 }
2854 
2855 void ASTStmtReader::VisitOMPTargetEnterDataDirective(
2857  VisitStmt(D);
2858  Record.skipInts(1);
2859  VisitOMPExecutableDirective(D);
2860 }
2861 
2862 void ASTStmtReader::VisitOMPTargetExitDataDirective(
2864  VisitStmt(D);
2865  Record.skipInts(1);
2866  VisitOMPExecutableDirective(D);
2867 }
2868 
2869 void ASTStmtReader::VisitOMPTargetParallelDirective(
2871  VisitStmt(D);
2872  Record.skipInts(1);
2873  VisitOMPExecutableDirective(D);
2874 }
2875 
2876 void ASTStmtReader::VisitOMPTargetParallelForDirective(
2878  VisitOMPLoopDirective(D);
2879  D->setHasCancel(Record.readInt());
2880 }
2881 
2882 void ASTStmtReader::VisitOMPTeamsDirective(OMPTeamsDirective *D) {
2883  VisitStmt(D);
2884  // The NumClauses field was read in ReadStmtFromStream.
2885  Record.skipInts(1);
2886  VisitOMPExecutableDirective(D);
2887 }
2888 
2889 void ASTStmtReader::VisitOMPCancellationPointDirective(
2891  VisitStmt(D);
2892  VisitOMPExecutableDirective(D);
2893  D->setCancelRegion(static_cast<OpenMPDirectiveKind>(Record.readInt()));
2894 }
2895 
2896 void ASTStmtReader::VisitOMPCancelDirective(OMPCancelDirective *D) {
2897  VisitStmt(D);
2898  // The NumClauses field was read in ReadStmtFromStream.
2899  Record.skipInts(1);
2900  VisitOMPExecutableDirective(D);
2901  D->setCancelRegion(static_cast<OpenMPDirectiveKind>(Record.readInt()));
2902 }
2903 
2904 void ASTStmtReader::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) {
2905  VisitOMPLoopDirective(D);
2906 }
2907 
2908 void ASTStmtReader::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) {
2909  VisitOMPLoopDirective(D);
2910 }
2911 
2912 void ASTStmtReader::VisitOMPDistributeDirective(OMPDistributeDirective *D) {
2913  VisitOMPLoopDirective(D);
2914 }
2915 
2916 void ASTStmtReader::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) {
2917  VisitStmt(D);
2918  Record.skipInts(1);
2919  VisitOMPExecutableDirective(D);
2920 }
2921 void ASTStmtReader::VisitOMPDistributeParallelForDirective(
2923  VisitOMPLoopDirective(D);
2924  D->setHasCancel(Record.readInt());
2925 }
2926 
2927 void ASTStmtReader::VisitOMPDistributeParallelForSimdDirective(
2929  VisitOMPLoopDirective(D);
2930 }
2931 
2932 void ASTStmtReader::VisitOMPDistributeSimdDirective(
2934  VisitOMPLoopDirective(D);
2935 }
2936 
2937 void ASTStmtReader::VisitOMPTargetParallelForSimdDirective(
2939  VisitOMPLoopDirective(D);
2940 }
2941 
2942 void ASTStmtReader::VisitOMPTargetSimdDirective(OMPTargetSimdDirective *D) {
2943  VisitOMPLoopDirective(D);
2944 }
2945 
2946 void ASTStmtReader::VisitOMPTeamsDistributeDirective(
2948  VisitOMPLoopDirective(D);
2949 }
2950 
2951 void ASTStmtReader::VisitOMPTeamsDistributeSimdDirective(
2953  VisitOMPLoopDirective(D);
2954 }
2955 
2956 void ASTStmtReader::VisitOMPTeamsDistributeParallelForSimdDirective(
2958  VisitOMPLoopDirective(D);
2959 }
2960 
2961 void ASTStmtReader::VisitOMPTeamsDistributeParallelForDirective(
2963  VisitOMPLoopDirective(D);
2964  D->setHasCancel(Record.readInt());
2965 }
2966 
2967 void ASTStmtReader::VisitOMPTargetTeamsDirective(OMPTargetTeamsDirective *D) {
2968  VisitStmt(D);
2969  // The NumClauses field was read in ReadStmtFromStream.
2970  Record.skipInts(1);
2971  VisitOMPExecutableDirective(D);
2972 }
2973 
2974 void ASTStmtReader::VisitOMPTargetTeamsDistributeDirective(
2976  VisitOMPLoopDirective(D);
2977 }
2978 
2979 void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForDirective(
2981  VisitOMPLoopDirective(D);
2982  D->setHasCancel(Record.readInt());
2983 }
2984 
2985 void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
2987  VisitOMPLoopDirective(D);
2988 }
2989 
2990 void ASTStmtReader::VisitOMPTargetTeamsDistributeSimdDirective(
2992  VisitOMPLoopDirective(D);
2993 }
2994 
2995 //===----------------------------------------------------------------------===//
2996 // ASTReader Implementation
2997 //===----------------------------------------------------------------------===//
2998 
3000  switch (ReadingKind) {
3001  case Read_None:
3002  llvm_unreachable("should not call this when not reading anything");
3003  case Read_Decl:
3004  case Read_Type:
3005  return ReadStmtFromStream(F);
3006  case Read_Stmt:
3007  return ReadSubStmt();
3008  }
3009 
3010  llvm_unreachable("ReadingKind not set ?");
3011 }
3012 
3014  return cast_or_null<Expr>(ReadStmt(F));
3015 }
3016 
3018  return cast_or_null<Expr>(ReadSubStmt());
3019 }
3020 
3021 // Within the bitstream, expressions are stored in Reverse Polish
3022 // Notation, with each of the subexpressions preceding the
3023 // expression they are stored in. Subexpressions are stored from last to first.
3024 // To evaluate expressions, we continue reading expressions and placing them on
3025 // the stack, with expressions having operands removing those operands from the
3026 // stack. Evaluation terminates when we see a STMT_STOP record, and
3027 // the single remaining expression on the stack is our result.
3028 Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) {
3029 
3030  ReadingKindTracker ReadingKind(Read_Stmt, *this);
3031  llvm::BitstreamCursor &Cursor = F.DeclsCursor;
3032 
3033  // Map of offset to previously deserialized stmt. The offset points
3034  // just after the stmt record.
3035  llvm::DenseMap<uint64_t, Stmt *> StmtEntries;
3036 
3037 #ifndef NDEBUG
3038  unsigned PrevNumStmts = StmtStack.size();
3039 #endif
3040 
3041  ASTRecordReader Record(*this, F);
3042  ASTStmtReader Reader(Record, Cursor);
3043  Stmt::EmptyShell Empty;
3044 
3045  while (true) {
3046  llvm::BitstreamEntry Entry = Cursor.advanceSkippingSubblocks();
3047 
3048  switch (Entry.Kind) {
3049  case llvm::BitstreamEntry::SubBlock: // Handled for us already.
3051  Error("malformed block record in AST file");
3052  return nullptr;
3053  case llvm::BitstreamEntry::EndBlock:
3054  goto Done;
3055  case llvm::BitstreamEntry::Record:
3056  // The interesting case.
3057  break;
3058  }
3059 
3060  ASTContext &Context = getContext();
3061  Stmt *S = nullptr;
3062  bool Finished = false;
3063  bool IsStmtReference = false;
3064  switch ((StmtCode)Record.readRecord(Cursor, Entry.ID)) {
3065  case STMT_STOP:
3066  Finished = true;
3067  break;
3068 
3069  case STMT_REF_PTR:
3070  IsStmtReference = true;
3071  assert(StmtEntries.find(Record[0]) != StmtEntries.end() &&
3072  "No stmt was recorded for this offset reference!");
3073  S = StmtEntries[Record.readInt()];
3074  break;
3075 
3076  case STMT_NULL_PTR:
3077  S = nullptr;
3078  break;
3079 
3080  case STMT_NULL:
3081  S = new (Context) NullStmt(Empty);
3082  break;
3083 
3084  case STMT_COMPOUND:
3086  Context, /*NumStmts=*/Record[ASTStmtReader::NumStmtFields]);
3087  break;
3088 
3089  case STMT_CASE:
3090  S = new (Context) CaseStmt(Empty);
3091  break;
3092 
3093  case STMT_DEFAULT:
3094  S = new (Context) DefaultStmt(Empty);
3095  break;
3096 
3097  case STMT_LABEL:
3098  S = new (Context) LabelStmt(Empty);
3099  break;
3100 
3101  case STMT_ATTRIBUTED:
3103  Context,
3104  /*NumAttrs*/Record[ASTStmtReader::NumStmtFields]);
3105  break;
3106 
3107  case STMT_IF:
3108  S = new (Context) IfStmt(Empty);
3109  break;
3110 
3111  case STMT_SWITCH:
3112  S = new (Context) SwitchStmt(Empty);
3113  break;
3114 
3115  case STMT_WHILE:
3116  S = new (Context) WhileStmt(Empty);
3117  break;
3118 
3119  case STMT_DO:
3120  S = new (Context) DoStmt(Empty);
3121  break;
3122 
3123  case STMT_FOR:
3124  S = new (Context) ForStmt(Empty);
3125  break;
3126 
3127  case STMT_GOTO:
3128  S = new (Context) GotoStmt(Empty);
3129  break;
3130 
3131  case STMT_INDIRECT_GOTO:
3132  S = new (Context) IndirectGotoStmt(Empty);
3133  break;
3134 
3135  case STMT_CONTINUE:
3136  S = new (Context) ContinueStmt(Empty);
3137  break;
3138 
3139  case STMT_BREAK:
3140  S = new (Context) BreakStmt(Empty);
3141  break;
3142 
3143  case STMT_RETURN:
3144  S = new (Context) ReturnStmt(Empty);
3145  break;
3146 
3147  case STMT_DECL:
3148  S = new (Context) DeclStmt(Empty);
3149  break;
3150 
3151  case STMT_GCCASM:
3152  S = new (Context) GCCAsmStmt(Empty);
3153  break;
3154 
3155  case STMT_MSASM:
3156  S = new (Context) MSAsmStmt(Empty);
3157  break;
3158 
3159  case STMT_CAPTURED:
3161  Record[ASTStmtReader::NumStmtFields]);
3162  break;
3163 
3164  case EXPR_PREDEFINED:
3165  S = new (Context) PredefinedExpr(Empty);
3166  break;
3167 
3168  case EXPR_DECL_REF:
3170  Context,
3171  /*HasQualifier=*/Record[ASTStmtReader::NumExprFields],
3172  /*HasFoundDecl=*/Record[ASTStmtReader::NumExprFields + 1],
3173  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields + 2],
3174  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields + 2] ?
3175  Record[ASTStmtReader::NumExprFields + 5] : 0);
3176  break;
3177 
3178  case EXPR_INTEGER_LITERAL:
3179  S = IntegerLiteral::Create(Context, Empty);
3180  break;
3181 
3182  case EXPR_FLOATING_LITERAL:
3183  S = FloatingLiteral::Create(Context, Empty);
3184  break;
3185 
3187  S = new (Context) ImaginaryLiteral(Empty);
3188  break;
3189 
3190  case EXPR_STRING_LITERAL:
3191  S = StringLiteral::CreateEmpty(Context,
3192  Record[ASTStmtReader::NumExprFields + 1]);
3193  break;
3194 
3196  S = new (Context) CharacterLiteral(Empty);
3197  break;
3198 
3199  case EXPR_PAREN:
3200  S = new (Context) ParenExpr(Empty);
3201  break;
3202 
3203  case EXPR_PAREN_LIST:
3204  S = new (Context) ParenListExpr(Empty);
3205  break;
3206 
3207  case EXPR_UNARY_OPERATOR:
3208  S = new (Context) UnaryOperator(Empty);
3209  break;
3210 
3211  case EXPR_OFFSETOF:
3212  S = OffsetOfExpr::CreateEmpty(Context,
3213  Record[ASTStmtReader::NumExprFields],
3214  Record[ASTStmtReader::NumExprFields + 1]);
3215  break;
3216 
3217  case EXPR_SIZEOF_ALIGN_OF:
3218  S = new (Context) UnaryExprOrTypeTraitExpr(Empty);
3219  break;
3220 
3221  case EXPR_ARRAY_SUBSCRIPT:
3222  S = new (Context) ArraySubscriptExpr(Empty);
3223  break;
3224 
3226  S = new (Context) OMPArraySectionExpr(Empty);
3227  break;
3228 
3229  case EXPR_CALL:
3230  S = new (Context) CallExpr(Context, Stmt::CallExprClass, Empty);
3231  break;
3232 
3233  case EXPR_MEMBER: {
3234  // We load everything here and fully initialize it at creation.
3235  // That way we can use MemberExpr::Create and don't have to duplicate its
3236  // logic with a MemberExpr::CreateEmpty.
3237 
3238  assert(Record.getIdx() == 0);
3239  NestedNameSpecifierLoc QualifierLoc;
3240  if (Record.readInt()) { // HasQualifier.
3241  QualifierLoc = Record.readNestedNameSpecifierLoc();
3242  }
3243 
3244  SourceLocation TemplateKWLoc;
3245  TemplateArgumentListInfo ArgInfo;
3246  bool HasTemplateKWAndArgsInfo = Record.readInt();
3247  if (HasTemplateKWAndArgsInfo) {
3248  TemplateKWLoc = Record.readSourceLocation();
3249  unsigned NumTemplateArgs = Record.readInt();
3250  ArgInfo.setLAngleLoc(Record.readSourceLocation());
3251  ArgInfo.setRAngleLoc(Record.readSourceLocation());
3252  for (unsigned i = 0; i != NumTemplateArgs; ++i)
3253  ArgInfo.addArgument(Record.readTemplateArgumentLoc());
3254  }
3255 
3256  bool HadMultipleCandidates = Record.readInt();
3257 
3258  NamedDecl *FoundD = Record.readDeclAs<NamedDecl>();
3259  AccessSpecifier AS = (AccessSpecifier)Record.readInt();
3260  DeclAccessPair FoundDecl = DeclAccessPair::make(FoundD, AS);
3261 
3262  QualType T = Record.readType();
3263  ExprValueKind VK = static_cast<ExprValueKind>(Record.readInt());
3264  ExprObjectKind OK = static_cast<ExprObjectKind>(Record.readInt());
3265  Expr *Base = ReadSubExpr();
3266  ValueDecl *MemberD = Record.readDeclAs<ValueDecl>();
3267  SourceLocation MemberLoc = Record.readSourceLocation();
3268  DeclarationNameInfo MemberNameInfo(MemberD->getDeclName(), MemberLoc);
3269  bool IsArrow = Record.readInt();
3270  SourceLocation OperatorLoc = Record.readSourceLocation();
3271 
3272  S = MemberExpr::Create(Context, Base, IsArrow, OperatorLoc, QualifierLoc,
3273  TemplateKWLoc, MemberD, FoundDecl, MemberNameInfo,
3274  HasTemplateKWAndArgsInfo ? &ArgInfo : nullptr, T,
3275  VK, OK);
3276  Record.readDeclarationNameLoc(cast<MemberExpr>(S)->MemberDNLoc,
3277  MemberD->getDeclName());
3278  if (HadMultipleCandidates)
3279  cast<MemberExpr>(S)->setHadMultipleCandidates(true);
3280  break;
3281  }
3282 
3283  case EXPR_BINARY_OPERATOR:
3284  S = new (Context) BinaryOperator(Empty);
3285  break;
3286 
3288  S = new (Context) CompoundAssignOperator(Empty);
3289  break;
3290 
3292  S = new (Context) ConditionalOperator(Empty);
3293  break;
3294 
3296  S = new (Context) BinaryConditionalOperator(Empty);
3297  break;
3298 
3299  case EXPR_IMPLICIT_CAST:
3300  S = ImplicitCastExpr::CreateEmpty(Context,
3301  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3302  break;
3303 
3304  case EXPR_CSTYLE_CAST:
3305  S = CStyleCastExpr::CreateEmpty(Context,
3306  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3307  break;
3308 
3309  case EXPR_COMPOUND_LITERAL:
3310  S = new (Context) CompoundLiteralExpr(Empty);
3311  break;
3312 
3314  S = new (Context) ExtVectorElementExpr(Empty);
3315  break;
3316 
3317  case EXPR_INIT_LIST:
3318  S = new (Context) InitListExpr(Empty);
3319  break;
3320 
3321  case EXPR_DESIGNATED_INIT:
3322  S = DesignatedInitExpr::CreateEmpty(Context,
3323  Record[ASTStmtReader::NumExprFields] - 1);
3324 
3325  break;
3326 
3328  S = new (Context) DesignatedInitUpdateExpr(Empty);
3329  break;
3330 
3332  S = new (Context) ImplicitValueInitExpr(Empty);
3333  break;
3334 
3335  case EXPR_NO_INIT:
3336  S = new (Context) NoInitExpr(Empty);
3337  break;
3338 
3339  case EXPR_ARRAY_INIT_LOOP:
3340  S = new (Context) ArrayInitLoopExpr(Empty);
3341  break;
3342 
3343  case EXPR_ARRAY_INIT_INDEX:
3344  S = new (Context) ArrayInitIndexExpr(Empty);
3345  break;
3346 
3347  case EXPR_VA_ARG:
3348  S = new (Context) VAArgExpr(Empty);
3349  break;
3350 
3351  case EXPR_ADDR_LABEL:
3352  S = new (Context) AddrLabelExpr(Empty);
3353  break;
3354 
3355  case EXPR_STMT:
3356  S = new (Context) StmtExpr(Empty);
3357  break;
3358 
3359  case EXPR_CHOOSE:
3360  S = new (Context) ChooseExpr(Empty);
3361  break;
3362 
3363  case EXPR_GNU_NULL:
3364  S = new (Context) GNUNullExpr(Empty);
3365  break;
3366 
3367  case EXPR_SHUFFLE_VECTOR:
3368  S = new (Context) ShuffleVectorExpr(Empty);
3369  break;
3370 
3371  case EXPR_CONVERT_VECTOR:
3372  S = new (Context) ConvertVectorExpr(Empty);
3373  break;
3374 
3375  case EXPR_BLOCK:
3376  S = new (Context) BlockExpr(Empty);
3377  break;
3378 
3380  S = new (Context) GenericSelectionExpr(Empty);
3381  break;
3382 
3384  S = new (Context) ObjCStringLiteral(Empty);
3385  break;
3387  S = new (Context) ObjCBoxedExpr(Empty);
3388  break;
3390  S = ObjCArrayLiteral::CreateEmpty(Context,
3391  Record[ASTStmtReader::NumExprFields]);
3392  break;
3395  Record[ASTStmtReader::NumExprFields],
3396  Record[ASTStmtReader::NumExprFields + 1]);
3397  break;
3398  case EXPR_OBJC_ENCODE:
3399  S = new (Context) ObjCEncodeExpr(Empty);
3400  break;
3402  S = new (Context) ObjCSelectorExpr(Empty);
3403  break;
3405  S = new (Context) ObjCProtocolExpr(Empty);
3406  break;
3408  S = new (Context) ObjCIvarRefExpr(Empty);
3409  break;
3411  S = new (Context) ObjCPropertyRefExpr(Empty);
3412  break;
3414  S = new (Context) ObjCSubscriptRefExpr(Empty);
3415  break;
3417  llvm_unreachable("mismatching AST file");
3419  S = ObjCMessageExpr::CreateEmpty(Context,
3420  Record[ASTStmtReader::NumExprFields],
3421  Record[ASTStmtReader::NumExprFields + 1]);
3422  break;
3423  case EXPR_OBJC_ISA:
3424  S = new (Context) ObjCIsaExpr(Empty);
3425  break;
3427  S = new (Context) ObjCIndirectCopyRestoreExpr(Empty);
3428  break;
3430  S = new (Context) ObjCBridgedCastExpr(Empty);
3431  break;
3433  S = new (Context) ObjCForCollectionStmt(Empty);
3434  break;
3435  case STMT_OBJC_CATCH:
3436  S = new (Context) ObjCAtCatchStmt(Empty);
3437  break;
3438  case STMT_OBJC_FINALLY:
3439  S = new (Context) ObjCAtFinallyStmt(Empty);
3440  break;
3441  case STMT_OBJC_AT_TRY:
3442  S = ObjCAtTryStmt::CreateEmpty(Context,
3443  Record[ASTStmtReader::NumStmtFields],
3444  Record[ASTStmtReader::NumStmtFields + 1]);
3445  break;
3447  S = new (Context) ObjCAtSynchronizedStmt(Empty);
3448  break;
3449  case STMT_OBJC_AT_THROW:
3450  S = new (Context) ObjCAtThrowStmt(Empty);
3451  break;
3453  S = new (Context) ObjCAutoreleasePoolStmt(Empty);
3454  break;
3456  S = new (Context) ObjCBoolLiteralExpr(Empty);
3457  break;
3459  S = new (Context) ObjCAvailabilityCheckExpr(Empty);
3460  break;
3461  case STMT_SEH_LEAVE:
3462  S = new (Context) SEHLeaveStmt(Empty);
3463  break;
3464  case STMT_SEH_EXCEPT:
3465  S = new (Context) SEHExceptStmt(Empty);
3466  break;
3467  case STMT_SEH_FINALLY:
3468  S = new (Context) SEHFinallyStmt(Empty);
3469  break;
3470  case STMT_SEH_TRY:
3471  S = new (Context) SEHTryStmt(Empty);
3472  break;
3473  case STMT_CXX_CATCH:
3474  S = new (Context) CXXCatchStmt(Empty);
3475  break;
3476 
3477  case STMT_CXX_TRY:
3478  S = CXXTryStmt::Create(Context, Empty,
3479  /*NumHandlers=*/Record[ASTStmtReader::NumStmtFields]);
3480  break;
3481 
3482  case STMT_CXX_FOR_RANGE:
3483  S = new (Context) CXXForRangeStmt(Empty);
3484  break;
3485 
3487  S = new (Context) MSDependentExistsStmt(SourceLocation(), true,
3490  nullptr);
3491  break;
3492 
3494  S =
3496  Record[ASTStmtReader::NumStmtFields],
3497  Empty);
3498  break;
3499 
3500  case STMT_OMP_SIMD_DIRECTIVE: {
3501  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3502  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3503  S = OMPSimdDirective::CreateEmpty(Context, NumClauses,
3504  CollapsedNum, Empty);
3505  break;
3506  }
3507 
3508  case STMT_OMP_FOR_DIRECTIVE: {
3509  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3510  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3511  S = OMPForDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3512  Empty);
3513  break;
3514  }
3515 
3517  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3518  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3519  S = OMPForSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3520  Empty);
3521  break;
3522  }
3523 
3526  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3527  break;
3528 
3530  S = OMPSectionDirective::CreateEmpty(Context, Empty);
3531  break;
3532 
3535  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3536  break;
3537 
3539  S = OMPMasterDirective::CreateEmpty(Context, Empty);
3540  break;
3541 
3544  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3545  break;
3546 
3548  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3549  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3550  S = OMPParallelForDirective::CreateEmpty(Context, NumClauses,
3551  CollapsedNum, Empty);
3552  break;
3553  }
3554 
3556  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3557  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3558  S = OMPParallelForSimdDirective::CreateEmpty(Context, NumClauses,
3559  CollapsedNum, Empty);
3560  break;
3561  }
3562 
3565  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3566  break;
3567 
3570  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3571  break;
3572 
3574  S = OMPTaskyieldDirective::CreateEmpty(Context, Empty);
3575  break;
3576 
3578  S = OMPBarrierDirective::CreateEmpty(Context, Empty);
3579  break;
3580 
3582  S = OMPTaskwaitDirective::CreateEmpty(Context, Empty);
3583  break;
3584 
3587  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3588  break;
3589 
3592  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3593  break;
3594 
3597  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3598  break;
3599 
3602  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3603  break;
3604 
3607  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3608  break;
3609 
3612  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3613  break;
3614 
3617  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3618  break;
3619 
3622  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3623  break;
3624 
3627  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3628  break;
3629 
3631  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3632  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3633  S = OMPTargetParallelForDirective::CreateEmpty(Context, NumClauses,
3634  CollapsedNum, Empty);
3635  break;
3636  }
3637 
3640  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3641  break;
3642 
3645  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3646  break;
3647 
3649  S = OMPCancellationPointDirective::CreateEmpty(Context, Empty);
3650  break;
3651 
3654  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3655  break;
3656 
3658  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3659  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3660  S = OMPTaskLoopDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3661  Empty);
3662  break;
3663  }
3664 
3666  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3667  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3668  S = OMPTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
3669  CollapsedNum, Empty);
3670  break;
3671  }
3672 
3674  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3675  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3676  S = OMPDistributeDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3677  Empty);
3678  break;
3679  }
3680 
3682  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3683  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3684  S = OMPDistributeParallelForDirective::CreateEmpty(Context, NumClauses,
3685  CollapsedNum, Empty);
3686  break;
3687  }
3688 
3690  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3691  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3693  CollapsedNum,
3694  Empty);
3695  break;
3696  }
3697 
3699  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3700  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3701  S = OMPDistributeSimdDirective::CreateEmpty(Context, NumClauses,
3702  CollapsedNum, Empty);
3703  break;
3704  }
3705 
3707  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3708  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3709  S = OMPTargetParallelForSimdDirective::CreateEmpty(Context, NumClauses,
3710  CollapsedNum, Empty);
3711  break;
3712  }
3713 
3715  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3716  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3717  S = OMPTargetSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3718  Empty);
3719  break;
3720  }
3721 
3723  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3724  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3725  S = OMPTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
3726  CollapsedNum, Empty);
3727  break;
3728  }
3729 
3731  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3732  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3733  S = OMPTeamsDistributeSimdDirective::CreateEmpty(Context, NumClauses,
3734  CollapsedNum, Empty);
3735  break;
3736  }
3737 
3739  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3740  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3742  Context, NumClauses, CollapsedNum, Empty);
3743  break;
3744  }
3745 
3747  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3748  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3750  Context, NumClauses, CollapsedNum, Empty);
3751  break;
3752  }
3753 
3756  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3757  break;
3758  }
3759 
3761  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3762  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3763  S = OMPTargetTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
3764  CollapsedNum, Empty);
3765  break;
3766  }
3767 
3769  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3770  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3772  Context, NumClauses, CollapsedNum, Empty);
3773  break;
3774  }
3775 
3777  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3778  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3780  Context, NumClauses, CollapsedNum, Empty);
3781  break;
3782  }
3783 
3785  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3786  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3788  Context, NumClauses, CollapsedNum, Empty);
3789  break;
3790  }
3791 
3793  S = new (Context) CXXOperatorCallExpr(Context, Empty);
3794  break;
3795 
3796  case EXPR_CXX_MEMBER_CALL:
3797  S = new (Context) CXXMemberCallExpr(Context, Empty);
3798  break;
3799 
3800  case EXPR_CXX_CONSTRUCT:
3801  S = new (Context) CXXConstructExpr(Empty);
3802  break;
3803 
3805  S = new (Context) CXXInheritedCtorInitExpr(Empty);
3806  break;
3807 
3809  S = new (Context) CXXTemporaryObjectExpr(Empty);
3810  break;
3811 
3812  case EXPR_CXX_STATIC_CAST:
3813  S = CXXStaticCastExpr::CreateEmpty(Context,
3814  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3815  break;
3816 
3817  case EXPR_CXX_DYNAMIC_CAST:
3818  S = CXXDynamicCastExpr::CreateEmpty(Context,
3819  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3820  break;
3821 
3824  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3825  break;
3826 
3827  case EXPR_CXX_CONST_CAST:
3828  S = CXXConstCastExpr::CreateEmpty(Context);
3829  break;
3830 
3833  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3834  break;
3835 
3837  S = new (Context) UserDefinedLiteral(Context, Empty);
3838  break;
3839 
3841  S = new (Context) CXXStdInitializerListExpr(Empty);
3842  break;
3843 
3844  case EXPR_CXX_BOOL_LITERAL:
3845  S = new (Context) CXXBoolLiteralExpr(Empty);
3846  break;
3847 
3849  S = new (Context) CXXNullPtrLiteralExpr(Empty);
3850  break;
3851  case EXPR_CXX_TYPEID_EXPR:
3852  S = new (Context) CXXTypeidExpr(Empty, true);
3853  break;
3854  case EXPR_CXX_TYPEID_TYPE:
3855  S = new (Context) CXXTypeidExpr(Empty, false);
3856  break;
3857  case EXPR_CXX_UUIDOF_EXPR:
3858  S = new (Context) CXXUuidofExpr(Empty, true);
3859  break;
3861  S = new (Context) MSPropertyRefExpr(Empty);
3862  break;
3864  S = new (Context) MSPropertySubscriptExpr(Empty);
3865  break;
3866  case EXPR_CXX_UUIDOF_TYPE:
3867  S = new (Context) CXXUuidofExpr(Empty, false);
3868  break;
3869  case EXPR_CXX_THIS:
3870  S = new (Context) CXXThisExpr(Empty);
3871  break;
3872  case EXPR_CXX_THROW:
3873  S = new (Context) CXXThrowExpr(Empty);
3874  break;
3875  case EXPR_CXX_DEFAULT_ARG:
3876  S = new (Context) CXXDefaultArgExpr(Empty);
3877  break;
3878  case EXPR_CXX_DEFAULT_INIT:
3879  S = new (Context) CXXDefaultInitExpr(Empty);
3880  break;
3882  S = new (Context) CXXBindTemporaryExpr(Empty);
3883  break;
3884 
3886  S = new (Context) CXXScalarValueInitExpr(Empty);
3887  break;
3888  case EXPR_CXX_NEW:
3889  S = new (Context) CXXNewExpr(Empty);
3890  break;
3891  case EXPR_CXX_DELETE:
3892  S = new (Context) CXXDeleteExpr(Empty);
3893  break;
3895  S = new (Context) CXXPseudoDestructorExpr(Empty);
3896  break;
3897 
3899  S = ExprWithCleanups::Create(Context, Empty,
3900  Record[ASTStmtReader::NumExprFields]);
3901  break;
3902 
3905  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields],
3906  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]
3907  ? Record[ASTStmtReader::NumExprFields + 1]
3908  : 0);
3909  break;
3910 
3913  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields],
3914  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]
3915  ? Record[ASTStmtReader::NumExprFields + 1]
3916  : 0);
3917  break;
3918 
3921  /*NumArgs=*/Record[ASTStmtReader::NumExprFields]);
3922  break;
3923 
3926  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields],
3927  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]
3928  ? Record[ASTStmtReader::NumExprFields + 1]
3929  : 0);
3930  break;
3931 
3934  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields],
3935  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]
3936  ? Record[ASTStmtReader::NumExprFields + 1]
3937  : 0);
3938  break;
3939 
3940  case EXPR_TYPE_TRAIT:
3942  Record[ASTStmtReader::NumExprFields]);
3943  break;
3944 
3945  case EXPR_ARRAY_TYPE_TRAIT:
3946  S = new (Context) ArrayTypeTraitExpr(Empty);
3947  break;
3948 
3950  S = new (Context) ExpressionTraitExpr(Empty);
3951  break;
3952 
3953  case EXPR_CXX_NOEXCEPT:
3954  S = new (Context) CXXNoexceptExpr(Empty);
3955  break;
3956 
3957  case EXPR_PACK_EXPANSION:
3958  S = new (Context) PackExpansionExpr(Empty);
3959  break;
3960 
3961  case EXPR_SIZEOF_PACK:
3963  Context,
3964  /*NumPartialArgs=*/Record[ASTStmtReader::NumExprFields]);
3965  break;
3966 
3968  S = new (Context) SubstNonTypeTemplateParmExpr(Empty);
3969  break;
3970 
3972  S = new (Context) SubstNonTypeTemplateParmPackExpr(Empty);
3973  break;
3974 
3977  Record[ASTStmtReader::NumExprFields]);
3978  break;
3979 
3981  S = new (Context) MaterializeTemporaryExpr(Empty);
3982  break;
3983 
3984  case EXPR_CXX_FOLD:
3985  S = new (Context) CXXFoldExpr(Empty);
3986  break;
3987 
3988  case EXPR_OPAQUE_VALUE:
3989  S = new (Context) OpaqueValueExpr(Empty);
3990  break;
3991 
3992  case EXPR_CUDA_KERNEL_CALL:
3993  S = new (Context) CUDAKernelCallExpr(Context, Empty);
3994  break;
3995 
3996  case EXPR_ASTYPE:
3997  S = new (Context) AsTypeExpr(Empty);
3998  break;
3999 
4000  case EXPR_PSEUDO_OBJECT: {
4001  unsigned numSemanticExprs = Record[ASTStmtReader::NumExprFields];
4002  S = PseudoObjectExpr::Create(Context, Empty, numSemanticExprs);
4003  break;
4004  }
4005 
4006  case EXPR_ATOMIC:
4007  S = new (Context) AtomicExpr(Empty);
4008  break;
4009 
4010  case EXPR_LAMBDA: {
4011  unsigned NumCaptures = Record[ASTStmtReader::NumExprFields];
4012  S = LambdaExpr::CreateDeserialized(Context, NumCaptures);
4013  break;
4014  }
4015 
4016  case STMT_COROUTINE_BODY: {
4017  unsigned NumParams = Record[ASTStmtReader::NumStmtFields];
4018  S = CoroutineBodyStmt::Create(Context, Empty, NumParams);
4019  break;
4020  }
4021 
4022  case STMT_CORETURN:
4023  S = new (Context) CoreturnStmt(Empty);
4024  break;
4025 
4026  case EXPR_COAWAIT:
4027  S = new (Context) CoawaitExpr(Empty);
4028  break;
4029 
4030  case EXPR_COYIELD:
4031  S = new (Context) CoyieldExpr(Empty);
4032  break;
4033 
4035  S = new (Context) DependentCoawaitExpr(Empty);
4036  break;
4037 
4038  }
4039 
4040  // We hit a STMT_STOP, so we're done with this expression.
4041  if (Finished)
4042  break;
4043 
4044  ++NumStatementsRead;
4045 
4046  if (S && !IsStmtReference) {
4047  Reader.Visit(S);
4048  StmtEntries[Cursor.GetCurrentBitNo()] = S;
4049  }
4050 
4051  assert(Record.getIdx() == Record.size() &&
4052  "Invalid deserialization of statement");
4053  StmtStack.push_back(S);
4054  }
4055 Done:
4056  assert(StmtStack.size() > PrevNumStmts && "Read too many sub-stmts!");
4057  assert(StmtStack.size() == PrevNumStmts + 1 && "Extra expressions on stack!");
4058  return StmtStack.pop_back_val();
4059 }
void setPreInits(Stmt *PreInits)
Definition: StmtOpenMP.h:492
static AttributedStmt * CreateEmpty(const ASTContext &C, unsigned NumAttrs)
Definition: Stmt.cpp:345
void setFPFeatures(FPOptions F)
Definition: Expr.h:3168
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:577
A PredefinedExpr record.
Definition: ASTBitCodes.h:1539
const uint64_t & readInt()
Returns the current value in this record, and advances to the next value.
Definition: ASTReader.h:2371
A call to an overloaded operator written using operator syntax.
Definition: ExprCXX.h:78
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
Definition: ExprObjC.h:1517
The receiver is the instance of the superclass object.
Definition: ExprObjC.h:1060
Represents a single C99 designator.
Definition: Expr.h:4194
void setThen(Stmt *S)
Definition: Stmt.h:972
void setConditionVariable(const ASTContext &C, VarDecl *V)
Definition: Stmt.cpp:846
static OMPDependClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
void setValueDependent(bool VD)
Set whether this expression is value-dependent or not.
Definition: Expr.h:152
Defines the clang::ASTContext interface.
void setRParenLoc(SourceLocation L)
Definition: ExprCXX.h:1505
A CompoundLiteralExpr record.
Definition: ASTBitCodes.h:1599
This represents &#39;#pragma omp distribute simd&#39; composite directive.
Definition: StmtOpenMP.h:3212
This represents &#39;#pragma omp master&#39; directive.
Definition: StmtOpenMP.h:1395
DesignatorTypes
The kinds of designators that can occur in a DesignatedInitExpr.
Definition: ASTBitCodes.h:1892
void setRangeStmt(Stmt *S)
Definition: StmtCXX.h:185
SourceLocation readSourceLocation()
Read a source location, advancing Idx.
Definition: ASTReader.h:2563
The null pointer literal (C++11 [lex.nullptr])
Definition: ExprCXX.h:565
This represents &#39;#pragma omp task&#39; directive.
Definition: StmtOpenMP.h:1735
void setEnsureUpperBound(Expr *EUB)
Definition: StmtOpenMP.h:523
This represents a GCC inline-assembly statement extension.
Definition: Stmt.h:1620
Represents a &#39;co_await&#39; expression while the type of the promise is dependent.
Definition: ExprCXX.h:4344
void setSubStmt(CompoundStmt *S)
Definition: Expr.h:3519
This represents &#39;thread_limit&#39; clause in the &#39;#pragma omp ...&#39; directive.
The receiver is an object instance.
Definition: ExprObjC.h:1054
unsigned getNumInputs() const
Definition: Stmt.h:1536
static OMPMasterDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:303
void setLParenLoc(SourceLocation Loc)
Sets the location of &#39;(&#39;.
static OMPCopyinClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
An IndirectGotoStmt record.
Definition: ASTBitCodes.h:1515
This represents clause &#39;copyin&#39; in the &#39;#pragma omp ...&#39; directives.
A (possibly-)qualified type.
Definition: Type.h:653
static OMPUseDevicePtrClause * CreateEmpty(const ASTContext &C, unsigned NumVars, unsigned NumUniqueDeclarations, unsigned NumComponentLists, unsigned NumComponents)
Creates an empty clause with the place for NumVars variables.
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument.
Definition: Stmt.h:2232
An AddrLabelExpr record.
Definition: ASTBitCodes.h:1629
void setInc(Expr *E)
Definition: StmtCXX.h:189
void setOperatorLoc(SourceLocation L)
Definition: Expr.h:2108
static StringLiteral * CreateEmpty(const ASTContext &C, unsigned NumStrs)
Construct an empty string literal.
Definition: Expr.cpp:879
void setRawSemantics(APFloatSemantics Sem)
Set the raw enumeration value representing the floating-point semantics of this literal (32-bit IEEE...
Definition: Expr.h:1421
void setNRVOCandidate(const VarDecl *Var)
Definition: Stmt.h:1445
void setLocation(SourceLocation L)
Definition: ExprCXX.h:550
A CXXStaticCastExpr record.
Definition: ASTBitCodes.h:1751
ASTStmtReader(ASTRecordReader &Record, llvm::BitstreamCursor &Cursor)
void setCombinedCond(Expr *CombCond)
Definition: StmtOpenMP.h:591
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2342
An AttributedStmt record.
Definition: ASTBitCodes.h:1494
void setCond(Expr *E)
Definition: Stmt.h:1133
A CXXReinterpretCastExpr record.
Definition: ASTBitCodes.h:1757
An ObjCBoolLiteralExpr record.
Definition: ASTBitCodes.h:1719
void setCombinedLowerBoundVariable(Expr *CombLB)
Definition: StmtOpenMP.h:571
void setRHS(Expr *E)
Definition: Expr.h:2169
static OMPTaskwaitDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:519
static OMPTargetParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:715
void setHasCancel(bool Has)
Set cancel state.
Definition: StmtOpenMP.h:1322
void setUniqueDecls(ArrayRef< ValueDecl *> UDs)
Set the unique declarations that are in the trailing objects of the class.
Represents a &#39;co_return&#39; statement in the C++ Coroutines TS.
Definition: StmtCXX.h:432
Stmt - This represents one statement.
Definition: Stmt.h:66
static OMPTaskgroupDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:540
void setLastIteration(Expr *LI)
Definition: StmtOpenMP.h:478
This represents clause &#39;in_reduction&#39; in the &#39;#pragma omp task&#39; directives.
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition: Expr.h:2275
IfStmt - This represents an if/then/else.
Definition: Stmt.h:933
Class that handles pre-initialization statement for some clauses, like &#39;shedule&#39;, &#39;firstprivate&#39; etc...
Definition: OpenMPClause.h:99
void setPrivateCounters(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:32
void setArrow(bool A)
Definition: ExprObjC.h:1465
unsigned getNumOutputs() const
Definition: Stmt.h:1514
This represents &#39;#pragma omp for simd&#39; directive.
Definition: StmtOpenMP.h:1145
void setRParenLoc(SourceLocation L)
Definition: Stmt.h:1642
void setContinueLoc(SourceLocation L)
Definition: Stmt.h:1365
void setThrowExpr(Stmt *S)
Definition: StmtObjC.h:327
void setAtLoc(SourceLocation L)
Definition: ExprObjC.h:447
An ImplicitValueInitExpr record.
Definition: ASTBitCodes.h:1623
static OMPFirstprivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:86
void setDeclGroup(DeclGroupRef DGR)
Definition: Stmt.h:509
This represents &#39;grainsize&#39; clause in the &#39;#pragma omp ...&#39; directive.
An ImplicitCastExpr record.
Definition: ASTBitCodes.h:1593
This represents &#39;#pragma omp teams distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:3623
void setLParenLoc(SourceLocation Loc)
Sets the location of &#39;(&#39;.
void setRBracket(SourceLocation RB)
Definition: ExprObjC.h:839
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Definition: Expr.h:4558
LambdaCaptureDefault
The default, if any, capture method for a lambda expression.
Definition: Lambda.h:23
void setType(QualType t)
Definition: Expr.h:129
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:2739
This represents &#39;if&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:240
Defines the C++ template declaration subclasses.
void setPrevEnsureUpperBound(Expr *PrevEUB)
Definition: StmtOpenMP.h:566
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:4365
Represents an attribute applied to a statement.
Definition: Stmt.h:881
void setUpperBoundVariable(Expr *UB)
Definition: StmtOpenMP.h:509
void setComputationResultType(QualType T)
Definition: Expr.h:3231
llvm::APFloat readAPFloat(const llvm::fltSemantics &Sem)
Read a floating-point value, advancing Idx.
Definition: ASTReader.h:2583
void setNumIterations(Expr *NI)
Definition: StmtOpenMP.h:544
static OMPMapClause * CreateEmpty(const ASTContext &C, unsigned NumVars, unsigned NumUniqueDeclarations, unsigned NumComponentLists, unsigned NumComponents)
Creates an empty clause with the place for NumVars original expressions, NumUniqueDeclarations declar...
ParenExpr - This represents a parethesized expression, e.g.
Definition: Expr.h:1665
A CXXOperatorCallExpr record.
Definition: ASTBitCodes.h:1736
void setSuper(SourceLocation Loc, QualType T, bool IsInstanceSuper)
Definition: ExprObjC.h:1289
This represents &#39;priority&#39; clause in the &#39;#pragma omp ...&#39; directive.
This represents &#39;#pragma omp target teams distribute&#39; combined directive.
Definition: StmtOpenMP.h:3760
A CXXTemporaryObjectExpr record.
Definition: ASTBitCodes.h:1748
Represents Objective-C&#39;s @throw statement.
Definition: StmtObjC.h:313
void setCond(Expr *E)
Definition: Stmt.h:1178
void setLParenLoc(SourceLocation Loc)
Sets the location of &#39;(&#39;.
Definition: OpenMPClause.h:717
void setNextLowerBound(Expr *NLB)
Definition: StmtOpenMP.h:530
DeclRefExprBitfields DeclRefExprBits
Definition: Stmt.h:292
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1239
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:802
unsigned NumOutputs
Definition: Stmt.h:1479
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent...
Definition: ExprCXX.h:2426
void setValue(bool V)
Definition: ExprObjC.h:95
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
Definition: Specifiers.h:95
A container of type source information.
Definition: Decl.h:86
This represents &#39;update&#39; clause in the &#39;#pragma omp atomic&#39; directive.
void setSwitchCaseList(SwitchCase *SC)
Set the case list for this switch statement.
Definition: Stmt.h:1060
void setComponents(ArrayRef< MappableComponent > Components, ArrayRef< unsigned > CLSs)
Set the components that are in the trailing objects of the class.
void setCanOverflow(bool C)
Definition: Expr.h:1758
void setInstanceReceiver(Expr *rec)
Turn this message send into an instance message that computes the receiver object with the given expr...
Definition: ExprObjC.h:1218
Floating point control options.
Definition: LangOptions.h:225
This represents &#39;#pragma omp parallel for&#39; directive.
Definition: StmtOpenMP.h:1516
MS property subscript expression.
Definition: ExprCXX.h:797
void setStartLoc(SourceLocation L)
Definition: Stmt.h:512
void setForLoc(SourceLocation L)
Definition: Stmt.h:1255
void setLParenLoc(SourceLocation Loc)
Sets the location of &#39;(&#39;.
Definition: OpenMPClause.h:584
This represents &#39;#pragma omp target teams distribute parallel for&#39; combined directive.
Definition: StmtOpenMP.h:3828
void setLocation(SourceLocation Loc)
Definition: ExprCXX.h:1305
static ObjCDictionaryLiteral * CreateEmpty(const ASTContext &C, unsigned NumElements, bool HasPackExpansions)
Definition: ExprObjC.cpp:105
void setConditionVariable(const ASTContext &C, VarDecl *V)
Definition: Stmt.cpp:908
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
Definition: ExprCXX.h:4039
void setLParenLoc(SourceLocation Loc)
Sets the location of &#39;(&#39;.
Definition: OpenMPClause.h:529
void setLocation(SourceLocation L)
Definition: ExprObjC.h:557
void setDelegateInitCall(bool isDelegate)
Definition: ExprObjC.h:1360
void setProtocol(ObjCProtocolDecl *P)
Definition: ExprObjC.h:491
void setRParenLoc(SourceLocation L)
Definition: ExprCXX.h:3142
static OMPReductionClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
void setIsLastIterVariable(Expr *IL)
Definition: StmtOpenMP.h:495
void setLParenLoc(SourceLocation Loc)
Sets the location of &#39;(&#39;.
Definition: OpenMPClause.h:954
This represents &#39;#pragma omp target exit data&#39; directive.
Definition: StmtOpenMP.h:2427
void setRAngleLoc(SourceLocation Loc)
Definition: TemplateBase.h:566
static OffsetOfExpr * CreateEmpty(const ASTContext &C, unsigned NumComps, unsigned NumExprs)
Definition: Expr.cpp:1358
This represents &#39;read&#39; clause in the &#39;#pragma omp atomic&#39; directive.
static OMPTargetTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents clause &#39;private&#39; in the &#39;#pragma omp ...&#39; directives.
static OMPParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:72
bool hasTemplateKWAndArgsInfo() const
Definition: Expr.h:1088
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC &#39;id&#39; type.
Definition: ExprObjC.h:1436
This represents &#39;num_threads&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:382
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:2650
void setSubExpr(unsigned Idx, Expr *E)
Definition: Expr.h:4372
void setInitializer(Expr *E)
Definition: Expr.h:2678
void setLength(Expr *E)
Set length of the array section.
Definition: ExprOpenMP.h:102
void setOpLoc(SourceLocation L)
Definition: ExprObjC.h:1473
void recordSwitchCaseID(SwitchCase *SC, unsigned ID)
Definition: ASTReader.h:2612
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
Definition: ExprCXX.h:2391
This represents &#39;defaultmap&#39; clause in the &#39;#pragma omp ...&#39; directive.
static FunctionParmPackExpr * CreateEmpty(const ASTContext &Context, unsigned NumParams)
Definition: ExprCXX.cpp:1367
void setInit(Stmt *S)
Definition: Stmt.h:968
void setAsmLoc(SourceLocation L)
Definition: Stmt.h:1496
static DependentScopeDeclRefExpr * CreateEmpty(const ASTContext &C, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition: ExprCXX.cpp:437
QualType readType()
Read a type from the current position in the record.
Definition: ASTReader.h:2462
ObjCMethodDecl - Represents an instance or class method declaration.
Definition: DeclObjC.h:139
void setValue(unsigned Val)
Definition: Expr.h:1376
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
Definition: TemplateBase.h:595
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition: ExprCXX.h:594
static DeclRefExpr * CreateEmpty(const ASTContext &Context, bool HasQualifier, bool HasFoundDecl, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Construct an empty declaration reference expression.
Definition: Expr.cpp:435
void setGNUSyntax(bool GNU)
Definition: Expr.h:4350
This represents implicit clause &#39;flush&#39; for the &#39;#pragma omp flush&#39; directive.
A CXXConstructExpr record.
Definition: ASTBitCodes.h:1742
unsigned getNumExpressions() const
Definition: Expr.h:2013
void setBeginStmt(Stmt *S)
Definition: StmtCXX.h:186
void setBase(Expr *E)
Set base of the array section.
Definition: ExprOpenMP.h:85
ReceiverKind
The kind of receiver this message is sending to.
Definition: ExprObjC.h:1049
raw_arg_iterator raw_arg_begin()
Definition: ExprCXX.h:2041
void initializeResults(const ASTContext &C, UnresolvedSetIterator Begin, UnresolvedSetIterator End)
Definition: ExprCXX.cpp:366
A C++ throw-expression (C++ [except.throw]).
Definition: ExprCXX.h:985
unsigned getTotalComponentsNum() const
Return the total number of components in all lists derived from the clause.
Represents an expression – generally a full-expression – that introduces cleanups to be run at the ...
Definition: ExprCXX.h:3003
Represents a parameter to a function.
Definition: Decl.h:1515
void setInit(Expr *Init)
Definition: StmtOpenMP.h:490
static OMPTaskReductionClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
This represents &#39;nogroup&#39; clause in the &#39;#pragma omp ...&#39; directive.
void setTarget(Expr *E)
Definition: Stmt.h:1334
A ShuffleVectorExpr record.
Definition: ASTBitCodes.h:1641
This represents &#39;safelen&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:447
A C++ static_cast expression (C++ [expr.static.cast]).
Definition: ExprCXX.h:302
IdentifierInfo * getIdentifier() const
Get the identifier that names this declaration, if there is one.
Definition: Decl.h:269
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:842
void AllocateArgsArray(const ASTContext &C, bool isArray, unsigned numPlaceArgs, bool hasInitializer)
Definition: ExprCXX.cpp:161
static OMPTargetExitDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:832
void setStrTokenLoc(unsigned TokNum, SourceLocation L)
Definition: Expr.h:1623
void setAtLoc(SourceLocation L)
Definition: ExprObjC.h:68
Represents a C99 designated initializer expression.
Definition: Expr.h:4119
unsigned varlist_size() const
Definition: OpenMPClause.h:204
An OffsetOfExpr record.
Definition: ASTBitCodes.h:1569
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition: Decl.h:297
NestedNameSpecifierLoc readNestedNameSpecifierLoc()
Definition: ASTReader.h:2517
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:1713
T * readDeclAs()
Reads a declaration from the given position in the record, advancing Idx.
Definition: ASTReader.h:2485
static OMPTargetDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:690
void setOpcode(Opcode O)
Definition: Expr.h:1742
A DesignatedInitExpr record.
Definition: ASTBitCodes.h:1608
This represents &#39;#pragma omp parallel&#39; directive.
Definition: StmtOpenMP.h:274
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition: Expr.h:3546
void setExprOperand(Expr *E)
Definition: ExprCXX.h:907
void setInit(Stmt *S)
Definition: Stmt.h:1048
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:149
A C++ nested-name-specifier augmented with source location information.
This represents &#39;simd&#39; clause in the &#39;#pragma omp ...&#39; directive.
void setLHS(Expr *E)
Definition: Expr.h:2165
static OMPTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:953
Internal struct for storing Key/value pair.
Definition: ExprObjC.h:268
void setKeyExpr(Stmt *S)
Definition: ExprObjC.h:851
static OMPTargetParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:763
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:264
Represents a member of a struct/union/class.
Definition: Decl.h:2488
This represents clause &#39;lastprivate&#39; in the &#39;#pragma omp ...&#39; directives.
void setIsMicrosoftABI(bool IsMS)
Definition: Expr.h:3815
Represents a place-holder for an object not to be initialized by anything.
Definition: Expr.h:4413
void setNumArgs(const ASTContext &C, unsigned NumArgs)
setNumArgs - This changes the number of arguments present in this call.
Definition: Expr.cpp:1251
void setRequiresZeroInitialization(bool ZeroInit)
Definition: ExprCXX.h:1330
static OMPFlushDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:608
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Definition: Expr.h:3757
This represents clause &#39;map&#39; in the &#39;#pragma omp ...&#39; directives.
void setLParenLoc(SourceLocation Loc)
Sets the location of &#39;(&#39;.
void setArg(unsigned I, Expr *E)
Definition: ExprCXX.h:3174
void setArg(unsigned Arg, Expr *ArgExpr)
setArg - Set the specified argument.
Definition: Expr.h:2297
This represents clause &#39;to&#39; in the &#39;#pragma omp ...&#39; directives.
void setColonLoc(SourceLocation Loc)
Sets the location of &#39;:&#39;.
void setRParen(SourceLocation Loc)
Definition: Expr.h:1694
TemplateArgument readTemplateArgument(bool Canonicalize=false)
Read a template argument, advancing Idx.
Definition: ASTReader.h:2527
This represents &#39;#pragma omp target simd&#39; directive.
Definition: StmtOpenMP.h:3348
void setCapturedDecl(CapturedDecl *D)
Set the outlined function declaration.
Definition: Stmt.cpp:1109
void setReturnLoc(SourceLocation L)
Definition: Stmt.h:1437
Represents a C++ member access expression for which lookup produced a set of overloaded functions...
Definition: ExprCXX.h:3442
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:4803
OpenMPDirectiveKind getDirectiveKind() const
Definition: StmtOpenMP.h:244
void VisitOMPClauseWithPostUpdate(OMPClauseWithPostUpdate *C)
This represents &#39;#pragma omp barrier&#39; directive.
Definition: StmtOpenMP.h:1847
void setComponent(unsigned Idx, OffsetOfNode ON)
Definition: Expr.h:1989
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp, [NSNumber numberWithInt:42]];.
Definition: ExprObjC.h:171
TypeSourceInfo * getTypeSourceInfo()
Reads a declarator info from the given record, advancing Idx.
Definition: ASTReader.h:2452
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:336
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition: ExprCXX.h:3897
void setSubStmt(Stmt *S)
Definition: Stmt.h:778
void setLParenLoc(SourceLocation Loc)
Sets the location of &#39;(&#39;.
This represents &#39;#pragma omp critical&#39; directive.
Definition: StmtOpenMP.h:1442
for(const auto &A :T->param_types())
static OMPCriticalDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:325
void setRParenLoc(SourceLocation L)
Definition: Expr.h:3527
void setCond(Expr *Cond)
Definition: StmtOpenMP.h:487
size_t size() const
The length of this record.
Definition: ASTReader.h:2361
Represents Objective-C&#39;s @catch statement.
Definition: StmtObjC.h:74
void setBody(Stmt *S)
Definition: Stmt.h:1056
void setLBraceLoc(SourceLocation Loc)
Definition: Expr.h:4031
This represents clause &#39;copyprivate&#39; in the &#39;#pragma omp ...&#39; directives.
static OMPTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:903
IndirectGotoStmt - This represents an indirect goto.
Definition: Stmt.h:1312
Describes an C or C++ initializer list.
Definition: Expr.h:3885
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition: ExprCXX.h:638
This represents &#39;#pragma omp distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:3063
void setValue(const ASTContext &C, const llvm::APInt &Val)
Definition: Expr.h:1280
This represents &#39;#pragma omp teams distribute parallel for simd&#39; composite directive.
Definition: StmtOpenMP.h:3552
void setBuiltinLoc(SourceLocation L)
Definition: Expr.h:3565
BinaryOperatorKind
void setSubExpr(Expr *E)
Definition: Expr.h:1683
void setLHS(Expr *E)
Definition: Expr.h:3725
ForStmt - This represents a &#39;for (init;cond;inc)&#39; stmt.
Definition: Stmt.h:1207
void setOperatorNew(FunctionDecl *D)
Definition: ExprCXX.h:1946
static DeclAccessPair make(NamedDecl *D, AccessSpecifier AS)
void setLocation(SourceLocation L)
Definition: ExprCXX.h:581
void setCond(Expr *E)
Definition: Stmt.h:1054
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:288
static OMPIsDevicePtrClause * CreateEmpty(const ASTContext &C, unsigned NumVars, unsigned NumUniqueDeclarations, unsigned NumComponentLists, unsigned NumComponents)
Creates an empty clause with the place for NumVars variables.
A convenient class for passing around template argument information.
Definition: TemplateBase.h:546
static OMPInReductionClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
void setSelector(Selector S)
Definition: ExprObjC.h:443
A reference to a previously [de]serialized Stmt record.
Definition: ASTBitCodes.h:1476
void setEndLoc(SourceLocation L)
Definition: Stmt.h:514
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
Definition: ExprCXX.h:1728
path_iterator path_begin()
Definition: Expr.h:2790
void setLocation(SourceLocation L)
Definition: ExprObjC.h:101
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:2998
void setLParenLoc(SourceLocation Loc)
Sets the location of &#39;(&#39;.
Definition: OpenMPClause.h:647
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:4826
static OMPToClause * CreateEmpty(const ASTContext &C, unsigned NumVars, unsigned NumUniqueDeclarations, unsigned NumComponentLists, unsigned NumComponents)
Creates an empty clause with the place for NumVars variables.
CXXForRangeStmt - This represents C++0x [stmt.ranged]&#39;s ranged for statement, represented as &#39;for (ra...
Definition: StmtCXX.h:128
Class that handles post-update expression for some clauses, like &#39;lastprivate&#39;, &#39;reduction&#39; etc...
Definition: OpenMPClause.h:135
SourceRange readSourceRange()
Read a source range, advancing Idx.
Definition: ASTReader.h:2568
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:2682
void setString(StringLiteral *S)
Definition: ExprObjC.h:65
void setAsmString(StringLiteral *E)
Definition: Stmt.h:1648
This represents &#39;default&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:606
ObjCStringLiteral, used for Objective-C string literals i.e.
Definition: ExprObjC.h:51
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
Definition: Expr.h:5245
This represents &#39;final&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:330
This represents &#39;mergeable&#39; clause in the &#39;#pragma omp ...&#39; directive.
void setCombinedInit(Expr *CombInit)
Definition: StmtOpenMP.h:586
void setListInitialization(bool V)
Definition: ExprCXX.h:1318
void setLHS(Expr *Val)
Definition: Stmt.h:779
This represents &#39;#pragma omp teams&#39; directive.
Definition: StmtOpenMP.h:2625
void setOperatorLoc(SourceLocation L)
Definition: Expr.h:1971
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:2723
void setLParenLoc(SourceLocation Loc)
Sets the location of &#39;(&#39;.
This represents clause &#39;reduction&#39; in the &#39;#pragma omp ...&#39; directives.
void setBody(Stmt *S)
Definition: Stmt.h:1136
Helper class for OffsetOfExpr.
Definition: Expr.h:1831
A marker record that indicates that we are at the end of an expression.
Definition: ASTBitCodes.h:1470
This represents &#39;#pragma omp teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:3482
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:1196
void setDestroyedType(IdentifierInfo *II, SourceLocation Loc)
Set the name of destroyed type for a dependent pseudo-destructor expression.
Definition: ExprCXX.h:2314
ArrayTypeTrait
Names for the array type traits.
Definition: TypeTraits.h:91
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:1583
static OMPTaskyieldDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:491
void setCond(Expr *E)
Definition: Stmt.h:1250
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:748
void ReadTemplateKWAndArgsInfo(ASTTemplateKWAndArgsInfo &Args, TemplateArgumentLoc *ArgsLocArray, unsigned NumTemplateArgs)
Read and initialize a ExplicitTemplateArgumentList structure.
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3205
This represents clause &#39;is_device_ptr&#39; in the &#39;#pragma omp ...&#39; directives.
void setRParenLoc(SourceLocation Loc)
Definition: StmtObjC.h:56
CXXBaseSpecifier readCXXBaseSpecifier()
Read a C++ base specifier, advancing Idx.
Definition: ASTReader.h:2549
unsigned getUniqueDeclarationsNum() const
Return the number of unique base declarations in this clause.
void setRParenLoc(SourceLocation R)
Definition: Expr.h:1975
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1042
void setStmt(LabelStmt *T)
Definition: Decl.h:493
bool isTypeOperand() const
Definition: ExprCXX.h:885
const uint64_t & peekInt()
Returns the current value in this record, without advancing.
Definition: ASTReader.h:2374
void setSourceRange(SourceRange R)
Definition: ExprCXX.h:918
unsigned NumClobbers
Definition: Stmt.h:1481
void setRParenLoc(SourceLocation L)
Definition: Expr.h:2965
This represents clause &#39;from&#39; in the &#39;#pragma omp ...&#39; directives.
Represents the this expression in C++.
Definition: ExprCXX.h:945
void setCastKind(CastKind K)
Definition: Expr.h:2771
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
Definition: TemplateBase.h:638
static OMPTargetDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:787
static OMPTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setEqualOrColonLoc(SourceLocation L)
Definition: Expr.h:4345
This represents &#39;#pragma omp target parallel for simd&#39; directive.
Definition: StmtOpenMP.h:3280
void setArgument(Expr *E)
Definition: Expr.h:2092
OpenMP 4.0 [2.4, Array Sections].
Definition: ExprOpenMP.h:45
void setTypeSourceInfo(TypeSourceInfo *tsi)
Definition: Expr.h:1980
ConditionalOperator - The ?: ternary operator.
Definition: Expr.h:3282
static OMPTargetSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition: ExprCXX.h:2200
void setAmpAmpLoc(SourceLocation L)
Definition: Expr.h:3472
void setBreakLoc(SourceLocation L)
Definition: Stmt.h:1394
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
Definition: ExprCXX.h:3578
void setFPFeatures(FPOptions F)
Definition: ExprCXX.h:145
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:595
void setBlockDecl(BlockDecl *BD)
Definition: Expr.h:4880
This represents &#39;threads&#39; clause in the &#39;#pragma omp ...&#39; directive.
This represents &#39;#pragma omp taskgroup&#39; directive.
Definition: StmtOpenMP.h:1935
static OMPSingleDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:282
CastKind
CastKind - The kind of operation required for a conversion.
void setSemiLoc(SourceLocation L)
Definition: Stmt.h:578
This represents clause &#39;aligned&#39; in the &#39;#pragma omp ...&#39; directives.
static OMPAlignedClause * CreateEmpty(const ASTContext &C, unsigned NumVars)
Creates an empty clause with the place for NumVars variables.
void setSubExpr(Expr *E)
Definition: Expr.h:1745
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
Definition: Expr.h:2040
void setLocEnd(SourceLocation Loc)
Sets the ending location of the clause.
Definition: OpenMPClause.h:76
void setLParen(SourceLocation Loc)
Definition: Expr.h:1690
This represents clause &#39;task_reduction&#39; in the &#39;#pragma omp taskgroup&#39; directives.
Represents a call to the builtin function __builtin_va_arg.
Definition: Expr.h:3791
static OMPTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:856
void setLeaveLoc(SourceLocation L)
Definition: Stmt.h:2034
This represents &#39;#pragma omp distribute&#39; directive.
Definition: StmtOpenMP.h:2936
This represents implicit clause &#39;depend&#39; for the &#39;#pragma omp task&#39; directive.
void setString(const ASTContext &C, StringRef Str, StringKind Kind, bool IsPascal)
Sets the string data to the given string data.
Definition: Expr.cpp:987
void setInits(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:39
void setOperatorDelete(FunctionDecl *D)
Definition: ExprCXX.h:1948
void setRParenLoc(SourceLocation L)
Definition: Stmt.h:1189
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type...
Definition: ExprCXX.h:1805
void setLocation(SourceLocation Location)
Definition: Expr.h:1374
void setRParenLoc(SourceLocation Loc)
Definition: StmtObjC.h:105
Pepresents a block literal declaration, which is like an unnamed FunctionDecl.
Definition: Decl.h:3713
This represents &#39;proc_bind&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:675
static OMPSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:111
This represents &#39;capture&#39; clause in the &#39;#pragma omp atomic&#39; directive.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:636
Expr - This represents one expression.
Definition: Expr.h:106
void setDesignators(const ASTContext &C, const Designator *Desigs, unsigned NumDesigs)
Definition: Expr.cpp:3775
void setRBraceLoc(SourceLocation Loc)
Definition: Expr.h:4033
void setIsImplicit(bool value=true)
Definition: ExprCXX.h:4335
SourceLocation End
void setWhileLoc(SourceLocation L)
Definition: Stmt.h:1139
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
Definition: Specifiers.h:104
void setCallee(Expr *F)
Definition: Expr.h:2260
void setRParenLoc(SourceLocation L)
Definition: Expr.h:3568
const FunctionProtoType * T
This represents &#39;simdlen&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:501
void setLParenLoc(SourceLocation L)
Definition: Stmt.h:1257
void setBase(Expr *Base)
Definition: Expr.h:4469
Stmt * ReadStmt(ModuleFile &F)
Reads a statement.
void setSyntacticForm(InitListExpr *Init)
Definition: Expr.h:4046
Represents a C++ functional cast expression that builds a temporary object.
Definition: ExprCXX.h:1533
void setRBracketLoc(SourceLocation L)
Definition: ExprOpenMP.h:113
A C++ const_cast expression (C++ [expr.const.cast]).
Definition: ExprCXX.h:420
void setTypeDependent(bool TD)
Set whether this expression is type-dependent or not.
Definition: Expr.h:170
void setTypeOperandSourceInfo(TypeSourceInfo *TSI)
Definition: ExprCXX.h:897
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:4864
Field designator where only the field name is known.
Definition: ASTBitCodes.h:1894
static OMPDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents &#39;#pragma omp target teams distribute parallel for simd&#39; combined directive.
Definition: StmtOpenMP.h:3912
void setRHS(Expr *E)
Definition: Expr.h:3045
void setInc(Expr *E)
Definition: Stmt.h:1251
raw_arg_iterator raw_arg_end()
Definition: ExprCXX.h:2042
static CXXReinterpretCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
Definition: ExprCXX.cpp:656
#define bool
Definition: stdbool.h:31
void setUuidStr(StringRef US)
Definition: ExprCXX.h:912
void setWrittenTypeInfo(TypeSourceInfo *TI)
Definition: Expr.h:3818
void setRetValue(Expr *E)
Definition: Stmt.h:1434
void setBody(Stmt *S)
Definition: Stmt.h:1252
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
Definition: ExprObjC.h:288
void setLParenLoc(SourceLocation Loc)
Sets the location of &#39;(&#39;.
Definition: OpenMPClause.h:220
ExprBitfields ExprBits
Definition: Stmt.h:288
void setObjectKind(ExprObjectKind Cat)
setObjectKind - Set the object kind produced by this expression.
Definition: Expr.h:425
bool hasQualifier() const
Determine whether this declaration reference was preceded by a C++ nested-name-specifier, e.g., N::foo.
Definition: Expr.h:1056
Represents Objective-C&#39;s @synchronized statement.
Definition: StmtObjC.h:262
ObjCSelectorExpr used for @selector in Objective-C.
Definition: ExprObjC.h:429
A CXXStdInitializerListExpr record.
Definition: ASTBitCodes.h:1769
void setFinallyBody(Stmt *S)
Definition: StmtObjC.h:134
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:3727
CXXTryStmt - A C++ try block, including all handlers.
Definition: StmtCXX.h:65
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Definition: Expr.h:4909
An ArraySubscriptExpr record.
Definition: ASTBitCodes.h:1575
Decl * readDecl()
Reads a declaration from the given position in a record in the given module, advancing Idx...
Definition: ASTReader.h:2475
static FloatingLiteral * Create(const ASTContext &C, const llvm::APFloat &V, bool isexact, QualType Type, SourceLocation L)
Definition: Expr.cpp:774
This represents &#39;#pragma omp target teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:3985
void setLParenLoc(SourceLocation Loc)
Sets the location of &#39;(&#39;.
Definition: OpenMPClause.h:359
Information about a module that has been loaded by the ASTReader.
Definition: Module.h:100
void setDeclNumLists(ArrayRef< unsigned > DNLs)
Set the number of lists per declaration that are in the trailing objects of the class.
This represents &#39;ordered&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:925
ExprWithCleanupsBitfields ExprWithCleanupsBits
Definition: Stmt.h:295
static OMPFlushClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
An ArrayInitLoopExpr record.
Definition: ASTBitCodes.h:1617
unsigned getNumClauses() const
Get number of clauses.
Definition: StmtOpenMP.h:184
A PseudoObjectExpr record.
Definition: ASTBitCodes.h:1653
void setColonLoc(SourceLocation L)
Definition: ExprOpenMP.h:110
void setFinallyStmt(Stmt *S)
Definition: StmtObjC.h:236
An ObjCIndirectCopyRestoreExpr record.
Definition: ASTBitCodes.h:1695
This represents &#39;#pragma omp for&#39; directive.
Definition: StmtOpenMP.h:1068
IdentifierInfo * getIdentifierInfo()
Definition: ASTReader.h:2489
static OMPTargetEnterDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:810
void setValueKind(ExprValueKind Cat)
setValueKind - Set the value kind produced by this expression.
Definition: Expr.h:422
static OMPLinearClause * CreateEmpty(const ASTContext &C, unsigned NumVars)
Creates an empty clause with the place for NumVars variables.
void setRParenLoc(SourceLocation L)
Definition: ExprObjC.h:497
Represents a folding of a pack over an operator.
Definition: ExprCXX.h:4149
void setEndStmt(Stmt *S)
Definition: StmtCXX.h:187
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
Definition: Stmt.h:1417
This represents &#39;#pragma omp target teams&#39; directive.
Definition: StmtOpenMP.h:3701
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:903
This represents a Microsoft inline-assembly statement extension.
Definition: Stmt.h:1799
void setColonLoc(SourceLocation L)
Definition: Stmt.h:722
void setIsArrow(bool A)
Definition: ExprObjC.h:553
void setRParenLoc(SourceLocation L)
Definition: Expr.h:3733
A DesignatedInitUpdateExpr record.
Definition: ASTBitCodes.h:1611
SourceLocation getEnd() const
void setAtLoc(SourceLocation L)
Definition: ExprObjC.h:403
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:1717
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:1187
A member reference to an MSPropertyDecl.
Definition: ExprCXX.h:728
static OMPParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:422
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition: ExprCXX.h:3841
static OMPPrivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
void setForLoc(SourceLocation Loc)
Definition: StmtObjC.h:54
This represents &#39;#pragma omp cancel&#39; directive.
Definition: StmtOpenMP.h:2740
This represents &#39;collapse&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:555
This represents clause &#39;firstprivate&#39; in the &#39;#pragma omp ...&#39; directives.
void setDistInc(Expr *DistInc)
Definition: StmtOpenMP.h:561
void setBase(Expr *base)
Definition: ExprObjC.h:549
ValueDecl * getDecl()
Definition: Expr.h:1041
An ObjCAvailabilityCheckExpr record.
Definition: ASTBitCodes.h:1722
void setRParenLoc(SourceLocation L)
Definition: ExprObjC.h:448
std::string readString()
Read a string, advancing Idx.
Definition: ASTReader.h:2588
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:2935
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:20
void skipInts(unsigned N)
Skips the specified number of values.
Definition: ASTReader.h:2377
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1...
Definition: Expr.h:1463
An ObjCForCollectionStmt record.
Definition: ASTBitCodes.h:1698
This represents &#39;#pragma omp flush&#39; directive.
Definition: StmtOpenMP.h:2008
This represents &#39;#pragma omp parallel for simd&#39; directive.
Definition: StmtOpenMP.h:1596
void setRParenLoc(SourceLocation L)
Definition: Expr.h:3824
void setAtTryLoc(SourceLocation Loc)
Definition: StmtObjC.h:194
DoStmt - This represents a &#39;do/while&#39; stmt.
Definition: Stmt.h:1158
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
Definition: Stmt.h:1465
This represents &#39;seq_cst&#39; clause in the &#39;#pragma omp atomic&#39; directive.
This represents &#39;untied&#39; clause in the &#39;#pragma omp ...&#39; directive.
void setTypeOperandSourceInfo(TypeSourceInfo *TSI)
Definition: ExprCXX.h:690
void setBody(Stmt *S)
Definition: StmtCXX.h:191
void setOpcode(Opcode O)
Definition: Expr.h:3040
A MS-style AsmStmt record.
Definition: ASTBitCodes.h:1536
unsigned readRecord(llvm::BitstreamCursor &Cursor, unsigned AbbrevID)
Reads a record with id AbbrevID from Cursor, resetting the internal state.
void setLocStart(SourceLocation Loc)
Set starting location of directive kind.
Definition: StmtOpenMP.h:176
static OMPParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:374
static CoroutineBodyStmt * Create(const ASTContext &C, CtorArgs const &Args)
Definition: StmtCXX.cpp:90
void setSynchExpr(Stmt *S)
Definition: StmtObjC.h:296
This represents &#39;#pragma omp target enter data&#39; directive.
Definition: StmtOpenMP.h:2368
void setPostUpdateExpr(Expr *S)
Set pre-initialization statement for the clause.
Definition: OpenMPClause.h:147
void setUpdates(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:45
const llvm::fltSemantics & getSemantics() const
Return the APFloat semantics this literal uses.
Definition: Expr.cpp:784
void setLowerBoundVariable(Expr *LB)
Definition: StmtOpenMP.h:502
void setLParenLoc(SourceLocation L)
Definition: ExprCXX.h:1503
This represents &#39;num_teams&#39; clause in the &#39;#pragma omp ...&#39; directive.
void setTypeSourceInfo(TypeSourceInfo *tinfo)
Definition: Expr.h:2689
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Definition: ExprCXX.h:338
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
Definition: Expr.h:868
void setComputationLHSType(QualType T)
Definition: Expr.h:3228
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition: Expr.h:3614
unsigned getNumArgs() const
Return the number of actual arguments in this message, not counting the receiver. ...
Definition: ExprObjC.h:1328
static OMPSectionDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:259
void setDecl(LabelDecl *D)
Definition: Stmt.h:860
Kind
void setElse(Stmt *S)
Definition: Stmt.h:974
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr...
Definition: ExprCXX.h:2551
A field in a dependent type, known only by its name.
Definition: Expr.h:1840
This captures a statement into a function.
Definition: Stmt.h:2058
Represents a call to an inherited base class constructor from an inheriting constructor.
Definition: ExprCXX.h:1400
unsigned path_size() const
Definition: Expr.h:2789
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition: Expr.h:4982
void setLParenLoc(SourceLocation L)
Definition: Expr.h:2962
void setSubStmt(Stmt *S)
Definition: Stmt.h:816
void setElidable(bool E)
Definition: ExprCXX.h:1309
void setAccessorLoc(SourceLocation L)
Definition: Expr.h:4829
void setGotoLoc(SourceLocation L)
Definition: Stmt.h:1327
static CXXDynamicCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
Definition: ExprCXX.cpp:598
unsigned getTotalComponentListNum() const
Return the number of lists derived from the clause expressions.
CXXTemporary * readCXXTemporary()
Definition: ASTReader.h:2558
void setHadMultipleCandidates(bool V)
Definition: ExprCXX.h:1314
void setLocation(SourceLocation L)
Definition: Expr.h:1050
This represents &#39;#pragma omp single&#39; directive.
Definition: StmtOpenMP.h:1340
Encodes a location in the source.
void setLocation(SourceLocation L)
Definition: Expr.h:1218
void setPrevLowerBoundVariable(Expr *PrevLB)
Definition: StmtOpenMP.h:551
void setIterationVariable(Expr *IV)
Definition: StmtOpenMP.h:475
This represents &#39;hint&#39; clause in the &#39;#pragma omp ...&#39; directive.
PseudoObjectExprBitfields PseudoObjectExprBits
Definition: Stmt.h:296
Stmt * readSubStmt()
Reads a sub-statement operand during statement reading.
Definition: ASTReader.h:2420
unsigned getNumHandlers() const
Definition: StmtCXX.h:103
void setUpdater(Expr *Updater)
Definition: Expr.h:4474
static OMPTaskDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:473
This is a basic class for representing single OpenMP executable directive.
Definition: StmtOpenMP.h:33
static CXXDependentScopeMemberExpr * CreateEmpty(const ASTContext &C, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition: ExprCXX.cpp:1171
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:1184
static CXXConstCastExpr * CreateEmpty(const ASTContext &Context)
Definition: ExprCXX.cpp:670
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
Definition: ExprCXX.h:1845
void setCombinedNextLowerBound(Expr *CombNLB)
Definition: StmtOpenMP.h:596
void setAtCatchLoc(SourceLocation Loc)
Definition: StmtObjC.h:103
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c dictionary literal.
Definition: ExprObjC.h:342
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit...
Definition: ExprCXX.h:457
void setSourceRange(SourceRange R)
Definition: ExprCXX.h:708
This represents &#39;schedule&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:744
static ObjCAtTryStmt * CreateEmpty(const ASTContext &Context, unsigned NumCatchStmts, bool HasFinally)
Definition: StmtObjC.cpp:58
void setConstexpr(bool C)
Definition: Stmt.h:986
Represents a call to a member function that may be written either with member call syntax (e...
Definition: ExprCXX.h:164
void setLParenLoc(SourceLocation Loc)
Sets the location of &#39;(&#39;.
Definition: OpenMPClause.h:420
void setIdentLoc(SourceLocation L)
Definition: Stmt.h:864
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
Definition: Stmt.h:487
OpenMPDirectiveKind
OpenMP directives.
Definition: OpenMPKinds.h:23
Represents the declaration of a label.
Definition: Decl.h:468
This represents clause &#39;shared&#39; in the &#39;#pragma omp ...&#39; directives.
void setLabelLoc(SourceLocation L)
Definition: Expr.h:3474
void readDeclarationNameInfo(DeclarationNameInfo &NameInfo)
Definition: ASTReader.h:2505
ExprObjectKind
A further classification of the kind of object referenced by an l-value or x-value.
Definition: Specifiers.h:121
A CXXFunctionalCastExpr record.
Definition: ASTBitCodes.h:1763
void setTemporary(CXXTemporary *T)
Definition: ExprCXX.h:1217
static ExprWithCleanups * Create(const ASTContext &C, EmptyShell empty, unsigned numObjects)
Definition: ExprCXX.cpp:1058
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:1079
Expr * readSubExpr()
Reads a sub-expression operand during statement reading.
Definition: ASTReader.h:2423
void VisitStmt(Stmt *S)
StmtVisitor - This class implements a simple visitor for Stmt subclasses.
Definition: StmtVisitor.h:186
void setClassReceiver(TypeSourceInfo *TSInfo)
Definition: ExprObjC.h:1240
void setCatchParamDecl(VarDecl *D)
Definition: StmtObjC.h:100
void setCond(Expr *E)
Definition: Stmt.h:970
An ObjCEncodeExpr record.
Definition: ASTBitCodes.h:1668
static OMPAtomicDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:664
This represents &#39;#pragma omp taskwait&#39; directive.
Definition: StmtOpenMP.h:1891
void setLHS(Expr *E)
Definition: Expr.h:3043
void setPrivateCopies(ArrayRef< Expr *> PrivateCopies)
Set list of helper expressions, required for generation of private copies of original lastprivate var...
void setConfig(CallExpr *E)
Sets the kernel configuration expression.
Definition: ExprCXX.h:225
void setConditionVariable(const ASTContext &C, VarDecl *V)
Definition: Stmt.cpp:874
This is a basic class for representing single OpenMP clause.
Definition: OpenMPClause.h:51
void setIsFreeIvar(bool A)
Definition: ExprObjC.h:554
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:5116
void readDeclarationNameLoc(DeclarationNameLoc &DNLoc, DeclarationName Name)
Definition: ASTReader.h:2502
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:1897
static OMPOrderedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:633
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:89
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition: ExprObjC.h:474
bool isValueDependent() const
isValueDependent - Determines whether this expression is value-dependent (C++ [temp.dep.constexpr]).
Definition: Expr.h:149
void setDecl(ValueDecl *NewD)
Definition: Expr.h:1043
void setThrowLoc(SourceLocation Loc)
Definition: StmtObjC.h:330
unsigned getIdx() const
The current position in this record.
Definition: ASTReader.h:2358
void setVarRefs(ArrayRef< Expr *> VL)
Sets the list of variables for this clause.
Definition: OpenMPClause.h:191
An ObjCIsa Expr record.
Definition: ASTBitCodes.h:1692
ASTContext & getContext()
Retrieve the AST context that this AST reader supplements.
Definition: ASTReader.h:2355
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:2835
Stmt * getCapturedStmt()
Retrieve the statement being captured.
Definition: Stmt.h:2159
This represents &#39;#pragma omp target&#39; directive.
Definition: StmtOpenMP.h:2252
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:1221
static DesignatedInitExpr * CreateEmpty(const ASTContext &C, unsigned NumIndexExprs)
Definition: Expr.cpp:3768
static DeclGroup * Create(ASTContext &C, Decl **Decls, unsigned NumDecls)
Definition: DeclGroup.cpp:21
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:848
An expression trait intrinsic.
Definition: ExprCXX.h:2496
void setEncodedTypeSourceInfo(TypeSourceInfo *EncType)
Definition: ExprObjC.h:411
An AtomicExpr record.
Definition: ASTBitCodes.h:1656
This represents &#39;#pragma omp ordered&#39; directive.
Definition: StmtOpenMP.h:2063
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition: Expr.h:3501
void setCond(Expr *E)
Definition: StmtCXX.h:188
static SizeOfPackExpr * CreateDeserialized(ASTContext &Context, unsigned NumPartialArgs)
Definition: ExprCXX.cpp:1324
This represents &#39;#pragma omp target update&#39; directive.
Definition: StmtOpenMP.h:3004
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:117
void VisitOMPClauseWithPreInit(OMPClauseWithPreInit *C)
void setSubExpr(Expr *E)
Definition: Expr.h:3811
void setLAngleLoc(SourceLocation Loc)
Definition: TemplateBase.h:565
void sawArrayRangeDesignator(bool ARD=true)
Definition: Expr.h:4056
void addArgument(const TemplateArgumentLoc &Loc)
Definition: TemplateBase.h:586
void setCapturedRecordDecl(RecordDecl *D)
Set the record declaration for captured variables.
Definition: Stmt.h:2179
Representation of a Microsoft __if_exists or __if_not_exists statement with a dependent name...
Definition: StmtCXX.h:240
static MemberExpr * Create(const ASTContext &C, Expr *base, bool isarrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, ValueDecl *memberdecl, DeclAccessPair founddecl, DeclarationNameInfo MemberNameInfo, const TemplateArgumentListInfo *targs, QualType ty, ExprValueKind VK, ExprObjectKind OK)
Definition: Expr.cpp:1437
A placeholder type used to construct an empty shell of a type, that will be filled in later (e...
Definition: Stmt.h:325
void setSimple(bool V)
Definition: Stmt.h:1499
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:2857
void setRBracketLoc(SourceLocation L)
Definition: ExprCXX.h:836
void readAttributes(AttrVec &Attrs)
Reads attributes from the current stream position, advancing Idx.
Definition: ASTReader.h:2603
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:3204
Expr ** getElements()
Retrieve elements of array of literals.
Definition: ExprObjC.h:202
A POD class for pairing a NamedDecl* with an access specifier.
DeclarationNameLoc - Additional source/type location info for a declaration name. ...
Represents a C11 generic selection.
Definition: Expr.h:4697
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition: Expr.h:3457
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers...
Definition: ExprObjC.h:1572
Represents a reference to a function parameter pack that has been substituted but not yet expanded...
Definition: ExprCXX.h:3961
Represents a template argument.
Definition: TemplateBase.h:51
void setGotoLoc(SourceLocation L)
Definition: Stmt.h:1294
void setPrevUpperBoundVariable(Expr *PrevUB)
Definition: StmtOpenMP.h:556
void setCombinedEnsureUpperBound(Expr *CombEUB)
Definition: StmtOpenMP.h:581
static OMPForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:160
void setLocation(SourceLocation L)
Definition: Expr.h:1440
NullStmt - This is the null statement ";": C99 6.8.3p3.
Definition: Stmt.h:556
void setLParenLoc(SourceLocation Loc)
Sets the location of &#39;(&#39;.
void setCounters(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:26
bool isTypeOperand() const
Definition: ExprCXX.h:678
unsigned getNumAssocs() const
Definition: Expr.h:4724
Dataflow Directional Tag Classes.
void setExtendingDecl(const ValueDecl *ExtendedBy, unsigned ManglingNumber)
Definition: ExprCXX.cpp:1373
This represents &#39;device&#39; clause in the &#39;#pragma omp ...&#39; directive.
An InitListExpr record.
Definition: ASTBitCodes.h:1605
OMPClauseReader(ASTStmtReader *R, ASTRecordReader &Record)
llvm::BitstreamCursor DeclsCursor
DeclsCursor - This is a cursor to the start of the DECLS_BLOCK block.
Definition: Module.h:393
void setBuiltinLoc(SourceLocation L)
Definition: Expr.h:3730
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:1188
UnaryOperatorKind
void setValue(bool V)
Definition: ExprCXX.h:544
A CXXBoolLiteralExpr record.
Definition: ASTBitCodes.h:1772
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
Definition: ExprCXX.h:2074
void setLParenLoc(SourceLocation Loc)
Sets the location of &#39;(&#39;.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
Definition: OperatorKinds.h:22
void setCombinedUpperBoundVariable(Expr *CombUB)
Definition: StmtOpenMP.h:576
void setRParenLoc(SourceLocation L)
Definition: Expr.h:2355
static CapturedStmt * CreateDeserialized(const ASTContext &Context, unsigned NumCaptures)
Definition: Stmt.cpp:1082
</