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