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