clang  7.0.0svn
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 }
773 
774 void ASTStmtReader::VisitExplicitCastExpr(ExplicitCastExpr *E) {
775  VisitCastExpr(E);
776  E->setTypeInfoAsWritten(GetTypeSourceInfo());
777 }
778 
779 void ASTStmtReader::VisitCStyleCastExpr(CStyleCastExpr *E) {
780  VisitExplicitCastExpr(E);
781  E->setLParenLoc(ReadSourceLocation());
782  E->setRParenLoc(ReadSourceLocation());
783 }
784 
785 void ASTStmtReader::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
786  VisitExpr(E);
787  E->setLParenLoc(ReadSourceLocation());
788  E->setTypeSourceInfo(GetTypeSourceInfo());
789  E->setInitializer(Record.readSubExpr());
790  E->setFileScope(Record.readInt());
791 }
792 
793 void ASTStmtReader::VisitExtVectorElementExpr(ExtVectorElementExpr *E) {
794  VisitExpr(E);
795  E->setBase(Record.readSubExpr());
796  E->setAccessor(Record.getIdentifierInfo());
797  E->setAccessorLoc(ReadSourceLocation());
798 }
799 
800 void ASTStmtReader::VisitInitListExpr(InitListExpr *E) {
801  VisitExpr(E);
802  if (auto *SyntForm = cast_or_null<InitListExpr>(Record.readSubStmt()))
803  E->setSyntacticForm(SyntForm);
804  E->setLBraceLoc(ReadSourceLocation());
805  E->setRBraceLoc(ReadSourceLocation());
806  bool isArrayFiller = Record.readInt();
807  Expr *filler = nullptr;
808  if (isArrayFiller) {
809  filler = Record.readSubExpr();
810  E->ArrayFillerOrUnionFieldInit = filler;
811  } else
812  E->ArrayFillerOrUnionFieldInit = ReadDeclAs<FieldDecl>();
813  E->sawArrayRangeDesignator(Record.readInt());
814  unsigned NumInits = Record.readInt();
815  E->reserveInits(Record.getContext(), NumInits);
816  if (isArrayFiller) {
817  for (unsigned I = 0; I != NumInits; ++I) {
818  Expr *init = Record.readSubExpr();
819  E->updateInit(Record.getContext(), I, init ? init : filler);
820  }
821  } else {
822  for (unsigned I = 0; I != NumInits; ++I)
823  E->updateInit(Record.getContext(), I, Record.readSubExpr());
824  }
825 }
826 
827 void ASTStmtReader::VisitDesignatedInitExpr(DesignatedInitExpr *E) {
829 
830  VisitExpr(E);
831  unsigned NumSubExprs = Record.readInt();
832  assert(NumSubExprs == E->getNumSubExprs() && "Wrong number of subexprs");
833  for (unsigned I = 0; I != NumSubExprs; ++I)
834  E->setSubExpr(I, Record.readSubExpr());
835  E->setEqualOrColonLoc(ReadSourceLocation());
836  E->setGNUSyntax(Record.readInt());
837 
838  SmallVector<Designator, 4> Designators;
839  while (Record.getIdx() < Record.size()) {
840  switch ((DesignatorTypes)Record.readInt()) {
841  case DESIG_FIELD_DECL: {
842  auto *Field = ReadDeclAs<FieldDecl>();
843  SourceLocation DotLoc = ReadSourceLocation();
844  SourceLocation FieldLoc = ReadSourceLocation();
845  Designators.push_back(Designator(Field->getIdentifier(), DotLoc,
846  FieldLoc));
847  Designators.back().setField(Field);
848  break;
849  }
850 
851  case DESIG_FIELD_NAME: {
852  const IdentifierInfo *Name = Record.getIdentifierInfo();
853  SourceLocation DotLoc = ReadSourceLocation();
854  SourceLocation FieldLoc = ReadSourceLocation();
855  Designators.push_back(Designator(Name, DotLoc, FieldLoc));
856  break;
857  }
858 
859  case DESIG_ARRAY: {
860  unsigned Index = Record.readInt();
861  SourceLocation LBracketLoc = ReadSourceLocation();
862  SourceLocation RBracketLoc = ReadSourceLocation();
863  Designators.push_back(Designator(Index, LBracketLoc, RBracketLoc));
864  break;
865  }
866 
867  case DESIG_ARRAY_RANGE: {
868  unsigned Index = Record.readInt();
869  SourceLocation LBracketLoc = ReadSourceLocation();
870  SourceLocation EllipsisLoc = ReadSourceLocation();
871  SourceLocation RBracketLoc = ReadSourceLocation();
872  Designators.push_back(Designator(Index, LBracketLoc, EllipsisLoc,
873  RBracketLoc));
874  break;
875  }
876  }
877  }
878  E->setDesignators(Record.getContext(),
879  Designators.data(), Designators.size());
880 }
881 
882 void ASTStmtReader::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) {
883  VisitExpr(E);
884  E->setBase(Record.readSubExpr());
885  E->setUpdater(Record.readSubExpr());
886 }
887 
888 void ASTStmtReader::VisitNoInitExpr(NoInitExpr *E) {
889  VisitExpr(E);
890 }
891 
892 void ASTStmtReader::VisitArrayInitLoopExpr(ArrayInitLoopExpr *E) {
893  VisitExpr(E);
894  E->SubExprs[0] = Record.readSubExpr();
895  E->SubExprs[1] = Record.readSubExpr();
896 }
897 
898 void ASTStmtReader::VisitArrayInitIndexExpr(ArrayInitIndexExpr *E) {
899  VisitExpr(E);
900 }
901 
902 void ASTStmtReader::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) {
903  VisitExpr(E);
904 }
905 
906 void ASTStmtReader::VisitVAArgExpr(VAArgExpr *E) {
907  VisitExpr(E);
908  E->setSubExpr(Record.readSubExpr());
909  E->setWrittenTypeInfo(GetTypeSourceInfo());
910  E->setBuiltinLoc(ReadSourceLocation());
911  E->setRParenLoc(ReadSourceLocation());
912  E->setIsMicrosoftABI(Record.readInt());
913 }
914 
915 void ASTStmtReader::VisitAddrLabelExpr(AddrLabelExpr *E) {
916  VisitExpr(E);
917  E->setAmpAmpLoc(ReadSourceLocation());
918  E->setLabelLoc(ReadSourceLocation());
919  E->setLabel(ReadDeclAs<LabelDecl>());
920 }
921 
922 void ASTStmtReader::VisitStmtExpr(StmtExpr *E) {
923  VisitExpr(E);
924  E->setLParenLoc(ReadSourceLocation());
925  E->setRParenLoc(ReadSourceLocation());
926  E->setSubStmt(cast_or_null<CompoundStmt>(Record.readSubStmt()));
927 }
928 
929 void ASTStmtReader::VisitChooseExpr(ChooseExpr *E) {
930  VisitExpr(E);
931  E->setCond(Record.readSubExpr());
932  E->setLHS(Record.readSubExpr());
933  E->setRHS(Record.readSubExpr());
934  E->setBuiltinLoc(ReadSourceLocation());
935  E->setRParenLoc(ReadSourceLocation());
936  E->setIsConditionTrue(Record.readInt());
937 }
938 
939 void ASTStmtReader::VisitGNUNullExpr(GNUNullExpr *E) {
940  VisitExpr(E);
941  E->setTokenLocation(ReadSourceLocation());
942 }
943 
944 void ASTStmtReader::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
945  VisitExpr(E);
947  unsigned NumExprs = Record.readInt();
948  while (NumExprs--)
949  Exprs.push_back(Record.readSubExpr());
950  E->setExprs(Record.getContext(), Exprs);
951  E->setBuiltinLoc(ReadSourceLocation());
952  E->setRParenLoc(ReadSourceLocation());
953 }
954 
955 void ASTStmtReader::VisitConvertVectorExpr(ConvertVectorExpr *E) {
956  VisitExpr(E);
957  E->BuiltinLoc = ReadSourceLocation();
958  E->RParenLoc = ReadSourceLocation();
959  E->TInfo = GetTypeSourceInfo();
960  E->SrcExpr = Record.readSubExpr();
961 }
962 
963 void ASTStmtReader::VisitBlockExpr(BlockExpr *E) {
964  VisitExpr(E);
965  E->setBlockDecl(ReadDeclAs<BlockDecl>());
966 }
967 
968 void ASTStmtReader::VisitGenericSelectionExpr(GenericSelectionExpr *E) {
969  VisitExpr(E);
970  E->NumAssocs = Record.readInt();
971  E->AssocTypes = new (Record.getContext()) TypeSourceInfo*[E->NumAssocs];
972  E->SubExprs =
973  new(Record.getContext()) Stmt*[GenericSelectionExpr::END_EXPR+E->NumAssocs];
974 
975  E->SubExprs[GenericSelectionExpr::CONTROLLING] = Record.readSubExpr();
976  for (unsigned I = 0, N = E->getNumAssocs(); I != N; ++I) {
977  E->AssocTypes[I] = GetTypeSourceInfo();
978  E->SubExprs[GenericSelectionExpr::END_EXPR+I] = Record.readSubExpr();
979  }
980  E->ResultIndex = Record.readInt();
981 
982  E->GenericLoc = ReadSourceLocation();
983  E->DefaultLoc = ReadSourceLocation();
984  E->RParenLoc = ReadSourceLocation();
985 }
986 
987 void ASTStmtReader::VisitPseudoObjectExpr(PseudoObjectExpr *E) {
988  VisitExpr(E);
989  unsigned numSemanticExprs = Record.readInt();
990  assert(numSemanticExprs + 1 == E->PseudoObjectExprBits.NumSubExprs);
991  E->PseudoObjectExprBits.ResultIndex = Record.readInt();
992 
993  // Read the syntactic expression.
994  E->getSubExprsBuffer()[0] = Record.readSubExpr();
995 
996  // Read all the semantic expressions.
997  for (unsigned i = 0; i != numSemanticExprs; ++i) {
998  Expr *subExpr = Record.readSubExpr();
999  E->getSubExprsBuffer()[i+1] = subExpr;
1000  }
1001 }
1002 
1003 void ASTStmtReader::VisitAtomicExpr(AtomicExpr *E) {
1004  VisitExpr(E);
1005  E->Op = AtomicExpr::AtomicOp(Record.readInt());
1006  E->NumSubExprs = AtomicExpr::getNumSubExprs(E->Op);
1007  for (unsigned I = 0; I != E->NumSubExprs; ++I)
1008  E->SubExprs[I] = Record.readSubExpr();
1009  E->BuiltinLoc = ReadSourceLocation();
1010  E->RParenLoc = ReadSourceLocation();
1011 }
1012 
1013 //===----------------------------------------------------------------------===//
1014 // Objective-C Expressions and Statements
1015 
1016 void ASTStmtReader::VisitObjCStringLiteral(ObjCStringLiteral *E) {
1017  VisitExpr(E);
1018  E->setString(cast<StringLiteral>(Record.readSubStmt()));
1019  E->setAtLoc(ReadSourceLocation());
1020 }
1021 
1022 void ASTStmtReader::VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
1023  VisitExpr(E);
1024  // could be one of several IntegerLiteral, FloatLiteral, etc.
1025  E->SubExpr = Record.readSubStmt();
1026  E->BoxingMethod = ReadDeclAs<ObjCMethodDecl>();
1027  E->Range = ReadSourceRange();
1028 }
1029 
1030 void ASTStmtReader::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
1031  VisitExpr(E);
1032  unsigned NumElements = Record.readInt();
1033  assert(NumElements == E->getNumElements() && "Wrong number of elements");
1034  Expr **Elements = E->getElements();
1035  for (unsigned I = 0, N = NumElements; I != N; ++I)
1036  Elements[I] = Record.readSubExpr();
1037  E->ArrayWithObjectsMethod = ReadDeclAs<ObjCMethodDecl>();
1038  E->Range = ReadSourceRange();
1039 }
1040 
1041 void ASTStmtReader::VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *E) {
1042  VisitExpr(E);
1043  unsigned NumElements = Record.readInt();
1044  assert(NumElements == E->getNumElements() && "Wrong number of elements");
1045  bool HasPackExpansions = Record.readInt();
1046  assert(HasPackExpansions == E->HasPackExpansions &&"Pack expansion mismatch");
1047  auto *KeyValues =
1048  E->getTrailingObjects<ObjCDictionaryLiteral::KeyValuePair>();
1049  auto *Expansions =
1050  E->getTrailingObjects<ObjCDictionaryLiteral::ExpansionData>();
1051  for (unsigned I = 0; I != NumElements; ++I) {
1052  KeyValues[I].Key = Record.readSubExpr();
1053  KeyValues[I].Value = Record.readSubExpr();
1054  if (HasPackExpansions) {
1055  Expansions[I].EllipsisLoc = ReadSourceLocation();
1056  Expansions[I].NumExpansionsPlusOne = Record.readInt();
1057  }
1058  }
1059  E->DictWithObjectsMethod = ReadDeclAs<ObjCMethodDecl>();
1060  E->Range = ReadSourceRange();
1061 }
1062 
1063 void ASTStmtReader::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
1064  VisitExpr(E);
1065  E->setEncodedTypeSourceInfo(GetTypeSourceInfo());
1066  E->setAtLoc(ReadSourceLocation());
1067  E->setRParenLoc(ReadSourceLocation());
1068 }
1069 
1070 void ASTStmtReader::VisitObjCSelectorExpr(ObjCSelectorExpr *E) {
1071  VisitExpr(E);
1072  E->setSelector(Record.readSelector());
1073  E->setAtLoc(ReadSourceLocation());
1074  E->setRParenLoc(ReadSourceLocation());
1075 }
1076 
1077 void ASTStmtReader::VisitObjCProtocolExpr(ObjCProtocolExpr *E) {
1078  VisitExpr(E);
1079  E->setProtocol(ReadDeclAs<ObjCProtocolDecl>());
1080  E->setAtLoc(ReadSourceLocation());
1081  E->ProtoLoc = ReadSourceLocation();
1082  E->setRParenLoc(ReadSourceLocation());
1083 }
1084 
1085 void ASTStmtReader::VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) {
1086  VisitExpr(E);
1087  E->setDecl(ReadDeclAs<ObjCIvarDecl>());
1088  E->setLocation(ReadSourceLocation());
1089  E->setOpLoc(ReadSourceLocation());
1090  E->setBase(Record.readSubExpr());
1091  E->setIsArrow(Record.readInt());
1092  E->setIsFreeIvar(Record.readInt());
1093 }
1094 
1095 void ASTStmtReader::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
1096  VisitExpr(E);
1097  unsigned MethodRefFlags = Record.readInt();
1098  bool Implicit = Record.readInt() != 0;
1099  if (Implicit) {
1100  auto *Getter = ReadDeclAs<ObjCMethodDecl>();
1101  auto *Setter = ReadDeclAs<ObjCMethodDecl>();
1102  E->setImplicitProperty(Getter, Setter, MethodRefFlags);
1103  } else {
1104  E->setExplicitProperty(ReadDeclAs<ObjCPropertyDecl>(), MethodRefFlags);
1105  }
1106  E->setLocation(ReadSourceLocation());
1107  E->setReceiverLocation(ReadSourceLocation());
1108  switch (Record.readInt()) {
1109  case 0:
1110  E->setBase(Record.readSubExpr());
1111  break;
1112  case 1:
1113  E->setSuperReceiver(Record.readType());
1114  break;
1115  case 2:
1116  E->setClassReceiver(ReadDeclAs<ObjCInterfaceDecl>());
1117  break;
1118  }
1119 }
1120 
1121 void ASTStmtReader::VisitObjCSubscriptRefExpr(ObjCSubscriptRefExpr *E) {
1122  VisitExpr(E);
1123  E->setRBracket(ReadSourceLocation());
1124  E->setBaseExpr(Record.readSubExpr());
1125  E->setKeyExpr(Record.readSubExpr());
1126  E->GetAtIndexMethodDecl = ReadDeclAs<ObjCMethodDecl>();
1127  E->SetAtIndexMethodDecl = ReadDeclAs<ObjCMethodDecl>();
1128 }
1129 
1130 void ASTStmtReader::VisitObjCMessageExpr(ObjCMessageExpr *E) {
1131  VisitExpr(E);
1132  assert(Record.peekInt() == E->getNumArgs());
1133  Record.skipInts(1);
1134  unsigned NumStoredSelLocs = Record.readInt();
1135  E->SelLocsKind = Record.readInt();
1136  E->setDelegateInitCall(Record.readInt());
1137  E->IsImplicit = Record.readInt();
1138  auto Kind = static_cast<ObjCMessageExpr::ReceiverKind>(Record.readInt());
1139  switch (Kind) {
1141  E->setInstanceReceiver(Record.readSubExpr());
1142  break;
1143 
1145  E->setClassReceiver(GetTypeSourceInfo());
1146  break;
1147 
1150  QualType T = Record.readType();
1151  SourceLocation SuperLoc = ReadSourceLocation();
1152  E->setSuper(SuperLoc, T, Kind == ObjCMessageExpr::SuperInstance);
1153  break;
1154  }
1155  }
1156 
1157  assert(Kind == E->getReceiverKind());
1158 
1159  if (Record.readInt())
1160  E->setMethodDecl(ReadDeclAs<ObjCMethodDecl>());
1161  else
1162  E->setSelector(Record.readSelector());
1163 
1164  E->LBracLoc = ReadSourceLocation();
1165  E->RBracLoc = ReadSourceLocation();
1166 
1167  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1168  E->setArg(I, Record.readSubExpr());
1169 
1170  SourceLocation *Locs = E->getStoredSelLocs();
1171  for (unsigned I = 0; I != NumStoredSelLocs; ++I)
1172  Locs[I] = ReadSourceLocation();
1173 }
1174 
1175 void ASTStmtReader::VisitObjCForCollectionStmt(ObjCForCollectionStmt *S) {
1176  VisitStmt(S);
1177  S->setElement(Record.readSubStmt());
1178  S->setCollection(Record.readSubExpr());
1179  S->setBody(Record.readSubStmt());
1180  S->setForLoc(ReadSourceLocation());
1181  S->setRParenLoc(ReadSourceLocation());
1182 }
1183 
1184 void ASTStmtReader::VisitObjCAtCatchStmt(ObjCAtCatchStmt *S) {
1185  VisitStmt(S);
1186  S->setCatchBody(Record.readSubStmt());
1187  S->setCatchParamDecl(ReadDeclAs<VarDecl>());
1188  S->setAtCatchLoc(ReadSourceLocation());
1189  S->setRParenLoc(ReadSourceLocation());
1190 }
1191 
1192 void ASTStmtReader::VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S) {
1193  VisitStmt(S);
1194  S->setFinallyBody(Record.readSubStmt());
1195  S->setAtFinallyLoc(ReadSourceLocation());
1196 }
1197 
1198 void ASTStmtReader::VisitObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S) {
1199  VisitStmt(S);
1200  S->setSubStmt(Record.readSubStmt());
1201  S->setAtLoc(ReadSourceLocation());
1202 }
1203 
1204 void ASTStmtReader::VisitObjCAtTryStmt(ObjCAtTryStmt *S) {
1205  VisitStmt(S);
1206  assert(Record.peekInt() == S->getNumCatchStmts());
1207  Record.skipInts(1);
1208  bool HasFinally = Record.readInt();
1209  S->setTryBody(Record.readSubStmt());
1210  for (unsigned I = 0, N = S->getNumCatchStmts(); I != N; ++I)
1211  S->setCatchStmt(I, cast_or_null<ObjCAtCatchStmt>(Record.readSubStmt()));
1212 
1213  if (HasFinally)
1214  S->setFinallyStmt(Record.readSubStmt());
1215  S->setAtTryLoc(ReadSourceLocation());
1216 }
1217 
1218 void ASTStmtReader::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
1219  VisitStmt(S);
1220  S->setSynchExpr(Record.readSubStmt());
1221  S->setSynchBody(Record.readSubStmt());
1222  S->setAtSynchronizedLoc(ReadSourceLocation());
1223 }
1224 
1225 void ASTStmtReader::VisitObjCAtThrowStmt(ObjCAtThrowStmt *S) {
1226  VisitStmt(S);
1227  S->setThrowExpr(Record.readSubStmt());
1228  S->setThrowLoc(ReadSourceLocation());
1229 }
1230 
1231 void ASTStmtReader::VisitObjCBoolLiteralExpr(ObjCBoolLiteralExpr *E) {
1232  VisitExpr(E);
1233  E->setValue(Record.readInt());
1234  E->setLocation(ReadSourceLocation());
1235 }
1236 
1237 void ASTStmtReader::VisitObjCAvailabilityCheckExpr(ObjCAvailabilityCheckExpr *E) {
1238  VisitExpr(E);
1239  SourceRange R = Record.readSourceRange();
1240  E->AtLoc = R.getBegin();
1241  E->RParen = R.getEnd();
1242  E->VersionToCheck = Record.readVersionTuple();
1243 }
1244 
1245 //===----------------------------------------------------------------------===//
1246 // C++ Expressions and Statements
1247 //===----------------------------------------------------------------------===//
1248 
1249 void ASTStmtReader::VisitCXXCatchStmt(CXXCatchStmt *S) {
1250  VisitStmt(S);
1251  S->CatchLoc = ReadSourceLocation();
1252  S->ExceptionDecl = ReadDeclAs<VarDecl>();
1253  S->HandlerBlock = Record.readSubStmt();
1254 }
1255 
1256 void ASTStmtReader::VisitCXXTryStmt(CXXTryStmt *S) {
1257  VisitStmt(S);
1258  assert(Record.peekInt() == S->getNumHandlers() && "NumStmtFields is wrong ?");
1259  Record.skipInts(1);
1260  S->TryLoc = ReadSourceLocation();
1261  S->getStmts()[0] = Record.readSubStmt();
1262  for (unsigned i = 0, e = S->getNumHandlers(); i != e; ++i)
1263  S->getStmts()[i + 1] = Record.readSubStmt();
1264 }
1265 
1266 void ASTStmtReader::VisitCXXForRangeStmt(CXXForRangeStmt *S) {
1267  VisitStmt(S);
1268  S->ForLoc = ReadSourceLocation();
1269  S->CoawaitLoc = ReadSourceLocation();
1270  S->ColonLoc = ReadSourceLocation();
1271  S->RParenLoc = ReadSourceLocation();
1272  S->setRangeStmt(Record.readSubStmt());
1273  S->setBeginStmt(Record.readSubStmt());
1274  S->setEndStmt(Record.readSubStmt());
1275  S->setCond(Record.readSubExpr());
1276  S->setInc(Record.readSubExpr());
1277  S->setLoopVarStmt(Record.readSubStmt());
1278  S->setBody(Record.readSubStmt());
1279 }
1280 
1281 void ASTStmtReader::VisitMSDependentExistsStmt(MSDependentExistsStmt *S) {
1282  VisitStmt(S);
1283  S->KeywordLoc = ReadSourceLocation();
1284  S->IsIfExists = Record.readInt();
1285  S->QualifierLoc = Record.readNestedNameSpecifierLoc();
1286  ReadDeclarationNameInfo(S->NameInfo);
1287  S->SubStmt = Record.readSubStmt();
1288 }
1289 
1290 void ASTStmtReader::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
1291  VisitCallExpr(E);
1292  E->Operator = (OverloadedOperatorKind)Record.readInt();
1293  E->Range = Record.readSourceRange();
1294  E->setFPFeatures(FPOptions(Record.readInt()));
1295 }
1296 
1297 void ASTStmtReader::VisitCXXConstructExpr(CXXConstructExpr *E) {
1298  VisitExpr(E);
1299  E->NumArgs = Record.readInt();
1300  if (E->NumArgs)
1301  E->Args = new (Record.getContext()) Stmt*[E->NumArgs];
1302  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1303  E->setArg(I, Record.readSubExpr());
1304  E->setConstructor(ReadDeclAs<CXXConstructorDecl>());
1305  E->setLocation(ReadSourceLocation());
1306  E->setElidable(Record.readInt());
1307  E->setHadMultipleCandidates(Record.readInt());
1308  E->setListInitialization(Record.readInt());
1312  E->ParenOrBraceRange = ReadSourceRange();
1313 }
1314 
1315 void ASTStmtReader::VisitCXXInheritedCtorInitExpr(CXXInheritedCtorInitExpr *E) {
1316  VisitExpr(E);
1317  E->Constructor = ReadDeclAs<CXXConstructorDecl>();
1318  E->Loc = ReadSourceLocation();
1319  E->ConstructsVirtualBase = Record.readInt();
1320  E->InheritedFromVirtualBase = Record.readInt();
1321 }
1322 
1323 void ASTStmtReader::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
1324  VisitCXXConstructExpr(E);
1325  E->Type = GetTypeSourceInfo();
1326 }
1327 
1328 void ASTStmtReader::VisitLambdaExpr(LambdaExpr *E) {
1329  VisitExpr(E);
1330  unsigned NumCaptures = Record.readInt();
1331  assert(NumCaptures == E->NumCaptures);(void)NumCaptures;
1332  E->IntroducerRange = ReadSourceRange();
1333  E->CaptureDefault = static_cast<LambdaCaptureDefault>(Record.readInt());
1334  E->CaptureDefaultLoc = ReadSourceLocation();
1335  E->ExplicitParams = Record.readInt();
1336  E->ExplicitResultType = Record.readInt();
1337  E->ClosingBrace = ReadSourceLocation();
1338 
1339  // Read capture initializers.
1341  CEnd = E->capture_init_end();
1342  C != CEnd; ++C)
1343  *C = Record.readSubExpr();
1344 }
1345 
1346 void
1347 ASTStmtReader::VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E) {
1348  VisitExpr(E);
1349  E->SubExpr = Record.readSubExpr();
1350 }
1351 
1352 void ASTStmtReader::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) {
1353  VisitExplicitCastExpr(E);
1354  SourceRange R = ReadSourceRange();
1355  E->Loc = R.getBegin();
1356  E->RParenLoc = R.getEnd();
1357  R = ReadSourceRange();
1358  E->AngleBrackets = R;
1359 }
1360 
1361 void ASTStmtReader::VisitCXXStaticCastExpr(CXXStaticCastExpr *E) {
1362  return VisitCXXNamedCastExpr(E);
1363 }
1364 
1365 void ASTStmtReader::VisitCXXDynamicCastExpr(CXXDynamicCastExpr *E) {
1366  return VisitCXXNamedCastExpr(E);
1367 }
1368 
1369 void ASTStmtReader::VisitCXXReinterpretCastExpr(CXXReinterpretCastExpr *E) {
1370  return VisitCXXNamedCastExpr(E);
1371 }
1372 
1373 void ASTStmtReader::VisitCXXConstCastExpr(CXXConstCastExpr *E) {
1374  return VisitCXXNamedCastExpr(E);
1375 }
1376 
1377 void ASTStmtReader::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E) {
1378  VisitExplicitCastExpr(E);
1379  E->setLParenLoc(ReadSourceLocation());
1380  E->setRParenLoc(ReadSourceLocation());
1381 }
1382 
1383 void ASTStmtReader::VisitUserDefinedLiteral(UserDefinedLiteral *E) {
1384  VisitCallExpr(E);
1385  E->UDSuffixLoc = ReadSourceLocation();
1386 }
1387 
1388 void ASTStmtReader::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) {
1389  VisitExpr(E);
1390  E->setValue(Record.readInt());
1391  E->setLocation(ReadSourceLocation());
1392 }
1393 
1394 void ASTStmtReader::VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E) {
1395  VisitExpr(E);
1396  E->setLocation(ReadSourceLocation());
1397 }
1398 
1399 void ASTStmtReader::VisitCXXTypeidExpr(CXXTypeidExpr *E) {
1400  VisitExpr(E);
1401  E->setSourceRange(ReadSourceRange());
1402  if (E->isTypeOperand()) { // typeid(int)
1404  GetTypeSourceInfo());
1405  return;
1406  }
1407 
1408  // typeid(42+2)
1409  E->setExprOperand(Record.readSubExpr());
1410 }
1411 
1412 void ASTStmtReader::VisitCXXThisExpr(CXXThisExpr *E) {
1413  VisitExpr(E);
1414  E->setLocation(ReadSourceLocation());
1415  E->setImplicit(Record.readInt());
1416 }
1417 
1418 void ASTStmtReader::VisitCXXThrowExpr(CXXThrowExpr *E) {
1419  VisitExpr(E);
1420  E->ThrowLoc = ReadSourceLocation();
1421  E->Op = Record.readSubExpr();
1422  E->IsThrownVariableInScope = Record.readInt();
1423 }
1424 
1425 void ASTStmtReader::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
1426  VisitExpr(E);
1427  E->Param = ReadDeclAs<ParmVarDecl>();
1428  E->Loc = ReadSourceLocation();
1429 }
1430 
1431 void ASTStmtReader::VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E) {
1432  VisitExpr(E);
1433  E->Field = ReadDeclAs<FieldDecl>();
1434  E->Loc = ReadSourceLocation();
1435 }
1436 
1437 void ASTStmtReader::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
1438  VisitExpr(E);
1439  E->setTemporary(Record.readCXXTemporary());
1440  E->setSubExpr(Record.readSubExpr());
1441 }
1442 
1443 void ASTStmtReader::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
1444  VisitExpr(E);
1445  E->TypeInfo = GetTypeSourceInfo();
1446  E->RParenLoc = ReadSourceLocation();
1447 }
1448 
1449 void ASTStmtReader::VisitCXXNewExpr(CXXNewExpr *E) {
1450  VisitExpr(E);
1451  E->GlobalNew = Record.readInt();
1452  bool isArray = Record.readInt();
1453  E->PassAlignment = Record.readInt();
1454  E->UsualArrayDeleteWantsSize = Record.readInt();
1455  unsigned NumPlacementArgs = Record.readInt();
1456  E->StoredInitializationStyle = Record.readInt();
1457  E->setOperatorNew(ReadDeclAs<FunctionDecl>());
1458  E->setOperatorDelete(ReadDeclAs<FunctionDecl>());
1459  E->AllocatedTypeInfo = GetTypeSourceInfo();
1460  E->TypeIdParens = ReadSourceRange();
1461  E->Range = ReadSourceRange();
1462  E->DirectInitRange = ReadSourceRange();
1463 
1464  E->AllocateArgsArray(Record.getContext(), isArray, NumPlacementArgs,
1465  E->StoredInitializationStyle != 0);
1466 
1467  // Install all the subexpressions.
1469  I != e; ++I)
1470  *I = Record.readSubStmt();
1471 }
1472 
1473 void ASTStmtReader::VisitCXXDeleteExpr(CXXDeleteExpr *E) {
1474  VisitExpr(E);
1475  E->GlobalDelete = Record.readInt();
1476  E->ArrayForm = Record.readInt();
1477  E->ArrayFormAsWritten = Record.readInt();
1478  E->UsualArrayDeleteWantsSize = Record.readInt();
1479  E->OperatorDelete = ReadDeclAs<FunctionDecl>();
1480  E->Argument = Record.readSubExpr();
1481  E->Loc = ReadSourceLocation();
1482 }
1483 
1484 void ASTStmtReader::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
1485  VisitExpr(E);
1486 
1487  E->Base = Record.readSubExpr();
1488  E->IsArrow = Record.readInt();
1489  E->OperatorLoc = ReadSourceLocation();
1490  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1491  E->ScopeType = GetTypeSourceInfo();
1492  E->ColonColonLoc = ReadSourceLocation();
1493  E->TildeLoc = ReadSourceLocation();
1494 
1495  IdentifierInfo *II = Record.getIdentifierInfo();
1496  if (II)
1497  E->setDestroyedType(II, ReadSourceLocation());
1498  else
1499  E->setDestroyedType(GetTypeSourceInfo());
1500 }
1501 
1502 void ASTStmtReader::VisitExprWithCleanups(ExprWithCleanups *E) {
1503  VisitExpr(E);
1504 
1505  unsigned NumObjects = Record.readInt();
1506  assert(NumObjects == E->getNumObjects());
1507  for (unsigned i = 0; i != NumObjects; ++i)
1508  E->getTrailingObjects<BlockDecl *>()[i] =
1509  ReadDeclAs<BlockDecl>();
1510 
1511  E->ExprWithCleanupsBits.CleanupsHaveSideEffects = Record.readInt();
1512  E->SubExpr = Record.readSubExpr();
1513 }
1514 
1515 void
1516 ASTStmtReader::VisitCXXDependentScopeMemberExpr(CXXDependentScopeMemberExpr *E){
1517  VisitExpr(E);
1518 
1519  if (Record.readInt()) // HasTemplateKWAndArgsInfo
1520  ReadTemplateKWAndArgsInfo(
1521  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
1522  E->getTrailingObjects<TemplateArgumentLoc>(),
1523  /*NumTemplateArgs=*/Record.readInt());
1524 
1525  E->Base = Record.readSubExpr();
1526  E->BaseType = Record.readType();
1527  E->IsArrow = Record.readInt();
1528  E->OperatorLoc = ReadSourceLocation();
1529  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1530  E->FirstQualifierFoundInScope = ReadDeclAs<NamedDecl>();
1531  ReadDeclarationNameInfo(E->MemberNameInfo);
1532 }
1533 
1534 void
1535 ASTStmtReader::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) {
1536  VisitExpr(E);
1537 
1538  if (Record.readInt()) // HasTemplateKWAndArgsInfo
1539  ReadTemplateKWAndArgsInfo(
1540  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
1541  E->getTrailingObjects<TemplateArgumentLoc>(),
1542  /*NumTemplateArgs=*/Record.readInt());
1543 
1544  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1545  ReadDeclarationNameInfo(E->NameInfo);
1546 }
1547 
1548 void
1549 ASTStmtReader::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E) {
1550  VisitExpr(E);
1551  assert(Record.peekInt() == E->arg_size() &&
1552  "Read wrong record during creation ?");
1553  Record.skipInts(1);
1554  for (unsigned I = 0, N = E->arg_size(); I != N; ++I)
1555  E->setArg(I, Record.readSubExpr());
1556  E->Type = GetTypeSourceInfo();
1557  E->setLParenLoc(ReadSourceLocation());
1558  E->setRParenLoc(ReadSourceLocation());
1559 }
1560 
1561 void ASTStmtReader::VisitOverloadExpr(OverloadExpr *E) {
1562  VisitExpr(E);
1563 
1564  if (Record.readInt()) // HasTemplateKWAndArgsInfo
1565  ReadTemplateKWAndArgsInfo(*E->getTrailingASTTemplateKWAndArgsInfo(),
1567  /*NumTemplateArgs=*/Record.readInt());
1568 
1569  unsigned NumDecls = Record.readInt();
1570  UnresolvedSet<8> Decls;
1571  for (unsigned i = 0; i != NumDecls; ++i) {
1572  auto *D = ReadDeclAs<NamedDecl>();
1573  auto AS = (AccessSpecifier)Record.readInt();
1574  Decls.addDecl(D, AS);
1575  }
1576  E->initializeResults(Record.getContext(), Decls.begin(), Decls.end());
1577 
1578  ReadDeclarationNameInfo(E->NameInfo);
1579  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1580 }
1581 
1582 void ASTStmtReader::VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
1583  VisitOverloadExpr(E);
1584  E->IsArrow = Record.readInt();
1585  E->HasUnresolvedUsing = Record.readInt();
1586  E->Base = Record.readSubExpr();
1587  E->BaseType = Record.readType();
1588  E->OperatorLoc = ReadSourceLocation();
1589 }
1590 
1591 void ASTStmtReader::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) {
1592  VisitOverloadExpr(E);
1593  E->RequiresADL = Record.readInt();
1594  E->Overloaded = Record.readInt();
1595  E->NamingClass = ReadDeclAs<CXXRecordDecl>();
1596 }
1597 
1598 void ASTStmtReader::VisitTypeTraitExpr(TypeTraitExpr *E) {
1599  VisitExpr(E);
1600  E->TypeTraitExprBits.NumArgs = Record.readInt();
1601  E->TypeTraitExprBits.Kind = Record.readInt();
1602  E->TypeTraitExprBits.Value = Record.readInt();
1603  SourceRange Range = ReadSourceRange();
1604  E->Loc = Range.getBegin();
1605  E->RParenLoc = Range.getEnd();
1606 
1607  auto **Args = E->getTrailingObjects<TypeSourceInfo *>();
1608  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1609  Args[I] = GetTypeSourceInfo();
1610 }
1611 
1612 void ASTStmtReader::VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E) {
1613  VisitExpr(E);
1614  E->ATT = (ArrayTypeTrait)Record.readInt();
1615  E->Value = (unsigned int)Record.readInt();
1616  SourceRange Range = ReadSourceRange();
1617  E->Loc = Range.getBegin();
1618  E->RParen = Range.getEnd();
1619  E->QueriedType = GetTypeSourceInfo();
1620  E->Dimension = Record.readSubExpr();
1621 }
1622 
1623 void ASTStmtReader::VisitExpressionTraitExpr(ExpressionTraitExpr *E) {
1624  VisitExpr(E);
1625  E->ET = (ExpressionTrait)Record.readInt();
1626  E->Value = (bool)Record.readInt();
1627  SourceRange Range = ReadSourceRange();
1628  E->QueriedExpression = Record.readSubExpr();
1629  E->Loc = Range.getBegin();
1630  E->RParen = Range.getEnd();
1631 }
1632 
1633 void ASTStmtReader::VisitCXXNoexceptExpr(CXXNoexceptExpr *E) {
1634  VisitExpr(E);
1635  E->Value = (bool)Record.readInt();
1636  E->Range = ReadSourceRange();
1637  E->Operand = Record.readSubExpr();
1638 }
1639 
1640 void ASTStmtReader::VisitPackExpansionExpr(PackExpansionExpr *E) {
1641  VisitExpr(E);
1642  E->EllipsisLoc = ReadSourceLocation();
1643  E->NumExpansions = Record.readInt();
1644  E->Pattern = Record.readSubExpr();
1645 }
1646 
1647 void ASTStmtReader::VisitSizeOfPackExpr(SizeOfPackExpr *E) {
1648  VisitExpr(E);
1649  unsigned NumPartialArgs = Record.readInt();
1650  E->OperatorLoc = ReadSourceLocation();
1651  E->PackLoc = ReadSourceLocation();
1652  E->RParenLoc = ReadSourceLocation();
1653  E->Pack = Record.readDeclAs<NamedDecl>();
1654  if (E->isPartiallySubstituted()) {
1655  assert(E->Length == NumPartialArgs);
1656  for (auto *I = E->getTrailingObjects<TemplateArgument>(),
1657  *E = I + NumPartialArgs;
1658  I != E; ++I)
1659  new (I) TemplateArgument(Record.readTemplateArgument());
1660  } else if (!E->isValueDependent()) {
1661  E->Length = Record.readInt();
1662  }
1663 }
1664 
1665 void ASTStmtReader::VisitSubstNonTypeTemplateParmExpr(
1667  VisitExpr(E);
1668  E->Param = ReadDeclAs<NonTypeTemplateParmDecl>();
1669  E->NameLoc = ReadSourceLocation();
1670  E->Replacement = Record.readSubExpr();
1671 }
1672 
1673 void ASTStmtReader::VisitSubstNonTypeTemplateParmPackExpr(
1675  VisitExpr(E);
1676  E->Param = ReadDeclAs<NonTypeTemplateParmDecl>();
1677  TemplateArgument ArgPack = Record.readTemplateArgument();
1678  if (ArgPack.getKind() != TemplateArgument::Pack)
1679  return;
1680 
1681  E->Arguments = ArgPack.pack_begin();
1682  E->NumArguments = ArgPack.pack_size();
1683  E->NameLoc = ReadSourceLocation();
1684 }
1685 
1686 void ASTStmtReader::VisitFunctionParmPackExpr(FunctionParmPackExpr *E) {
1687  VisitExpr(E);
1688  E->NumParameters = Record.readInt();
1689  E->ParamPack = ReadDeclAs<ParmVarDecl>();
1690  E->NameLoc = ReadSourceLocation();
1691  auto **Parms = E->getTrailingObjects<ParmVarDecl *>();
1692  for (unsigned i = 0, n = E->NumParameters; i != n; ++i)
1693  Parms[i] = ReadDeclAs<ParmVarDecl>();
1694 }
1695 
1696 void ASTStmtReader::VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E) {
1697  VisitExpr(E);
1698  E->State = Record.readSubExpr();
1699  auto *VD = ReadDeclAs<ValueDecl>();
1700  unsigned ManglingNumber = Record.readInt();
1701  E->setExtendingDecl(VD, ManglingNumber);
1702 }
1703 
1704 void ASTStmtReader::VisitCXXFoldExpr(CXXFoldExpr *E) {
1705  VisitExpr(E);
1706  E->LParenLoc = ReadSourceLocation();
1707  E->EllipsisLoc = ReadSourceLocation();
1708  E->RParenLoc = ReadSourceLocation();
1709  E->SubExprs[0] = Record.readSubExpr();
1710  E->SubExprs[1] = Record.readSubExpr();
1711  E->Opcode = (BinaryOperatorKind)Record.readInt();
1712 }
1713 
1714 void ASTStmtReader::VisitOpaqueValueExpr(OpaqueValueExpr *E) {
1715  VisitExpr(E);
1716  E->SourceExpr = Record.readSubExpr();
1717  E->Loc = ReadSourceLocation();
1718  E->setIsUnique(Record.readInt());
1719 }
1720 
1721 void ASTStmtReader::VisitTypoExpr(TypoExpr *E) {
1722  llvm_unreachable("Cannot read TypoExpr nodes");
1723 }
1724 
1725 //===----------------------------------------------------------------------===//
1726 // Microsoft Expressions and Statements
1727 //===----------------------------------------------------------------------===//
1728 void ASTStmtReader::VisitMSPropertyRefExpr(MSPropertyRefExpr *E) {
1729  VisitExpr(E);
1730  E->IsArrow = (Record.readInt() != 0);
1731  E->BaseExpr = Record.readSubExpr();
1732  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1733  E->MemberLoc = ReadSourceLocation();
1734  E->TheDecl = ReadDeclAs<MSPropertyDecl>();
1735 }
1736 
1737 void ASTStmtReader::VisitMSPropertySubscriptExpr(MSPropertySubscriptExpr *E) {
1738  VisitExpr(E);
1739  E->setBase(Record.readSubExpr());
1740  E->setIdx(Record.readSubExpr());
1741  E->setRBracketLoc(ReadSourceLocation());
1742 }
1743 
1744 void ASTStmtReader::VisitCXXUuidofExpr(CXXUuidofExpr *E) {
1745  VisitExpr(E);
1746  E->setSourceRange(ReadSourceRange());
1747  std::string UuidStr = ReadString();
1748  E->setUuidStr(StringRef(UuidStr).copy(Record.getContext()));
1749  if (E->isTypeOperand()) { // __uuidof(ComType)
1751  GetTypeSourceInfo());
1752  return;
1753  }
1754 
1755  // __uuidof(expr)
1756  E->setExprOperand(Record.readSubExpr());
1757 }
1758 
1759 void ASTStmtReader::VisitSEHLeaveStmt(SEHLeaveStmt *S) {
1760  VisitStmt(S);
1761  S->setLeaveLoc(ReadSourceLocation());
1762 }
1763 
1764 void ASTStmtReader::VisitSEHExceptStmt(SEHExceptStmt *S) {
1765  VisitStmt(S);
1766  S->Loc = ReadSourceLocation();
1767  S->Children[SEHExceptStmt::FILTER_EXPR] = Record.readSubStmt();
1768  S->Children[SEHExceptStmt::BLOCK] = Record.readSubStmt();
1769 }
1770 
1771 void ASTStmtReader::VisitSEHFinallyStmt(SEHFinallyStmt *S) {
1772  VisitStmt(S);
1773  S->Loc = ReadSourceLocation();
1774  S->Block = Record.readSubStmt();
1775 }
1776 
1777 void ASTStmtReader::VisitSEHTryStmt(SEHTryStmt *S) {
1778  VisitStmt(S);
1779  S->IsCXXTry = Record.readInt();
1780  S->TryLoc = ReadSourceLocation();
1781  S->Children[SEHTryStmt::TRY] = Record.readSubStmt();
1782  S->Children[SEHTryStmt::HANDLER] = Record.readSubStmt();
1783 }
1784 
1785 //===----------------------------------------------------------------------===//
1786 // CUDA Expressions and Statements
1787 //===----------------------------------------------------------------------===//
1788 
1789 void ASTStmtReader::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E) {
1790  VisitCallExpr(E);
1791  E->setConfig(cast<CallExpr>(Record.readSubExpr()));
1792 }
1793 
1794 //===----------------------------------------------------------------------===//
1795 // OpenCL Expressions and Statements.
1796 //===----------------------------------------------------------------------===//
1797 void ASTStmtReader::VisitAsTypeExpr(AsTypeExpr *E) {
1798  VisitExpr(E);
1799  E->BuiltinLoc = ReadSourceLocation();
1800  E->RParenLoc = ReadSourceLocation();
1801  E->SrcExpr = Record.readSubExpr();
1802 }
1803 
1804 //===----------------------------------------------------------------------===//
1805 // OpenMP Clauses.
1806 //===----------------------------------------------------------------------===//
1807 
1808 namespace clang {
1809 
1810 class OMPClauseReader : public OMPClauseVisitor<OMPClauseReader> {
1811  ASTStmtReader *Reader;
1812  ASTContext &Context;
1813 
1814 public:
1816  : Reader(R), Context(Record.getContext()) {}
1817 
1818 #define OPENMP_CLAUSE(Name, Class) void Visit##Class(Class *C);
1819 #include "clang/Basic/OpenMPKinds.def"
1820  OMPClause *readClause();
1821  void VisitOMPClauseWithPreInit(OMPClauseWithPreInit *C);
1822  void VisitOMPClauseWithPostUpdate(OMPClauseWithPostUpdate *C);
1823 };
1824 
1825 } // namespace clang
1826 
1828  OMPClause *C;
1829  switch (Reader->Record.readInt()) {
1830  case OMPC_if:
1831  C = new (Context) OMPIfClause();
1832  break;
1833  case OMPC_final:
1834  C = new (Context) OMPFinalClause();
1835  break;
1836  case OMPC_num_threads:
1837  C = new (Context) OMPNumThreadsClause();
1838  break;
1839  case OMPC_safelen:
1840  C = new (Context) OMPSafelenClause();
1841  break;
1842  case OMPC_simdlen:
1843  C = new (Context) OMPSimdlenClause();
1844  break;
1845  case OMPC_collapse:
1846  C = new (Context) OMPCollapseClause();
1847  break;
1848  case OMPC_default:
1849  C = new (Context) OMPDefaultClause();
1850  break;
1851  case OMPC_proc_bind:
1852  C = new (Context) OMPProcBindClause();
1853  break;
1854  case OMPC_schedule:
1855  C = new (Context) OMPScheduleClause();
1856  break;
1857  case OMPC_ordered:
1858  C = new (Context) OMPOrderedClause();
1859  break;
1860  case OMPC_nowait:
1861  C = new (Context) OMPNowaitClause();
1862  break;
1863  case OMPC_untied:
1864  C = new (Context) OMPUntiedClause();
1865  break;
1866  case OMPC_mergeable:
1867  C = new (Context) OMPMergeableClause();
1868  break;
1869  case OMPC_read:
1870  C = new (Context) OMPReadClause();
1871  break;
1872  case OMPC_write:
1873  C = new (Context) OMPWriteClause();
1874  break;
1875  case OMPC_update:
1876  C = new (Context) OMPUpdateClause();
1877  break;
1878  case OMPC_capture:
1879  C = new (Context) OMPCaptureClause();
1880  break;
1881  case OMPC_seq_cst:
1882  C = new (Context) OMPSeqCstClause();
1883  break;
1884  case OMPC_threads:
1885  C = new (Context) OMPThreadsClause();
1886  break;
1887  case OMPC_simd:
1888  C = new (Context) OMPSIMDClause();
1889  break;
1890  case OMPC_nogroup:
1891  C = new (Context) OMPNogroupClause();
1892  break;
1893  case OMPC_private:
1894  C = OMPPrivateClause::CreateEmpty(Context, Reader->Record.readInt());
1895  break;
1896  case OMPC_firstprivate:
1897  C = OMPFirstprivateClause::CreateEmpty(Context, Reader->Record.readInt());
1898  break;
1899  case OMPC_lastprivate:
1900  C = OMPLastprivateClause::CreateEmpty(Context, Reader->Record.readInt());
1901  break;
1902  case OMPC_shared:
1903  C = OMPSharedClause::CreateEmpty(Context, Reader->Record.readInt());
1904  break;
1905  case OMPC_reduction:
1906  C = OMPReductionClause::CreateEmpty(Context, Reader->Record.readInt());
1907  break;
1908  case OMPC_task_reduction:
1909  C = OMPTaskReductionClause::CreateEmpty(Context, Reader->Record.readInt());
1910  break;
1911  case OMPC_in_reduction:
1912  C = OMPInReductionClause::CreateEmpty(Context, Reader->Record.readInt());
1913  break;
1914  case OMPC_linear:
1915  C = OMPLinearClause::CreateEmpty(Context, Reader->Record.readInt());
1916  break;
1917  case OMPC_aligned:
1918  C = OMPAlignedClause::CreateEmpty(Context, Reader->Record.readInt());
1919  break;
1920  case OMPC_copyin:
1921  C = OMPCopyinClause::CreateEmpty(Context, Reader->Record.readInt());
1922  break;
1923  case OMPC_copyprivate:
1924  C = OMPCopyprivateClause::CreateEmpty(Context, Reader->Record.readInt());
1925  break;
1926  case OMPC_flush:
1927  C = OMPFlushClause::CreateEmpty(Context, Reader->Record.readInt());
1928  break;
1929  case OMPC_depend:
1930  C = OMPDependClause::CreateEmpty(Context, Reader->Record.readInt());
1931  break;
1932  case OMPC_device:
1933  C = new (Context) OMPDeviceClause();
1934  break;
1935  case OMPC_map: {
1936  unsigned NumVars = Reader->Record.readInt();
1937  unsigned NumDeclarations = Reader->Record.readInt();
1938  unsigned NumLists = Reader->Record.readInt();
1939  unsigned NumComponents = Reader->Record.readInt();
1940  C = OMPMapClause::CreateEmpty(Context, NumVars, NumDeclarations, NumLists,
1941  NumComponents);
1942  break;
1943  }
1944  case OMPC_num_teams:
1945  C = new (Context) OMPNumTeamsClause();
1946  break;
1947  case OMPC_thread_limit:
1948  C = new (Context) OMPThreadLimitClause();
1949  break;
1950  case OMPC_priority:
1951  C = new (Context) OMPPriorityClause();
1952  break;
1953  case OMPC_grainsize:
1954  C = new (Context) OMPGrainsizeClause();
1955  break;
1956  case OMPC_num_tasks:
1957  C = new (Context) OMPNumTasksClause();
1958  break;
1959  case OMPC_hint:
1960  C = new (Context) OMPHintClause();
1961  break;
1962  case OMPC_dist_schedule:
1963  C = new (Context) OMPDistScheduleClause();
1964  break;
1965  case OMPC_defaultmap:
1966  C = new (Context) OMPDefaultmapClause();
1967  break;
1968  case OMPC_to: {
1969  unsigned NumVars = Reader->Record.readInt();
1970  unsigned NumDeclarations = Reader->Record.readInt();
1971  unsigned NumLists = Reader->Record.readInt();
1972  unsigned NumComponents = Reader->Record.readInt();
1973  C = OMPToClause::CreateEmpty(Context, NumVars, NumDeclarations, NumLists,
1974  NumComponents);
1975  break;
1976  }
1977  case OMPC_from: {
1978  unsigned NumVars = Reader->Record.readInt();
1979  unsigned NumDeclarations = Reader->Record.readInt();
1980  unsigned NumLists = Reader->Record.readInt();
1981  unsigned NumComponents = Reader->Record.readInt();
1982  C = OMPFromClause::CreateEmpty(Context, NumVars, NumDeclarations, NumLists,
1983  NumComponents);
1984  break;
1985  }
1986  case OMPC_use_device_ptr: {
1987  unsigned NumVars = Reader->Record.readInt();
1988  unsigned NumDeclarations = Reader->Record.readInt();
1989  unsigned NumLists = Reader->Record.readInt();
1990  unsigned NumComponents = Reader->Record.readInt();
1991  C = OMPUseDevicePtrClause::CreateEmpty(Context, NumVars, NumDeclarations,
1992  NumLists, NumComponents);
1993  break;
1994  }
1995  case OMPC_is_device_ptr: {
1996  unsigned NumVars = Reader->Record.readInt();
1997  unsigned NumDeclarations = Reader->Record.readInt();
1998  unsigned NumLists = Reader->Record.readInt();
1999  unsigned NumComponents = Reader->Record.readInt();
2000  C = OMPIsDevicePtrClause::CreateEmpty(Context, NumVars, NumDeclarations,
2001  NumLists, NumComponents);
2002  break;
2003  }
2004  }
2005  Visit(C);
2006  C->setLocStart(Reader->ReadSourceLocation());
2007  C->setLocEnd(Reader->ReadSourceLocation());
2008 
2009  return C;
2010 }
2011 
2013  C->setPreInitStmt(Reader->Record.readSubStmt(),
2014  static_cast<OpenMPDirectiveKind>(Reader->Record.readInt()));
2015 }
2016 
2018  VisitOMPClauseWithPreInit(C);
2019  C->setPostUpdateExpr(Reader->Record.readSubExpr());
2020 }
2021 
2022 void OMPClauseReader::VisitOMPIfClause(OMPIfClause *C) {
2023  VisitOMPClauseWithPreInit(C);
2024  C->setNameModifier(static_cast<OpenMPDirectiveKind>(Reader->Record.readInt()));
2025  C->setNameModifierLoc(Reader->ReadSourceLocation());
2026  C->setColonLoc(Reader->ReadSourceLocation());
2027  C->setCondition(Reader->Record.readSubExpr());
2028  C->setLParenLoc(Reader->ReadSourceLocation());
2029 }
2030 
2031 void OMPClauseReader::VisitOMPFinalClause(OMPFinalClause *C) {
2032  C->setCondition(Reader->Record.readSubExpr());
2033  C->setLParenLoc(Reader->ReadSourceLocation());
2034 }
2035 
2036 void OMPClauseReader::VisitOMPNumThreadsClause(OMPNumThreadsClause *C) {
2037  VisitOMPClauseWithPreInit(C);
2038  C->setNumThreads(Reader->Record.readSubExpr());
2039  C->setLParenLoc(Reader->ReadSourceLocation());
2040 }
2041 
2042 void OMPClauseReader::VisitOMPSafelenClause(OMPSafelenClause *C) {
2043  C->setSafelen(Reader->Record.readSubExpr());
2044  C->setLParenLoc(Reader->ReadSourceLocation());
2045 }
2046 
2047 void OMPClauseReader::VisitOMPSimdlenClause(OMPSimdlenClause *C) {
2048  C->setSimdlen(Reader->Record.readSubExpr());
2049  C->setLParenLoc(Reader->ReadSourceLocation());
2050 }
2051 
2052 void OMPClauseReader::VisitOMPCollapseClause(OMPCollapseClause *C) {
2053  C->setNumForLoops(Reader->Record.readSubExpr());
2054  C->setLParenLoc(Reader->ReadSourceLocation());
2055 }
2056 
2057 void OMPClauseReader::VisitOMPDefaultClause(OMPDefaultClause *C) {
2058  C->setDefaultKind(
2059  static_cast<OpenMPDefaultClauseKind>(Reader->Record.readInt()));
2060  C->setLParenLoc(Reader->ReadSourceLocation());
2061  C->setDefaultKindKwLoc(Reader->ReadSourceLocation());
2062 }
2063 
2064 void OMPClauseReader::VisitOMPProcBindClause(OMPProcBindClause *C) {
2065  C->setProcBindKind(
2066  static_cast<OpenMPProcBindClauseKind>(Reader->Record.readInt()));
2067  C->setLParenLoc(Reader->ReadSourceLocation());
2068  C->setProcBindKindKwLoc(Reader->ReadSourceLocation());
2069 }
2070 
2071 void OMPClauseReader::VisitOMPScheduleClause(OMPScheduleClause *C) {
2072  VisitOMPClauseWithPreInit(C);
2073  C->setScheduleKind(
2074  static_cast<OpenMPScheduleClauseKind>(Reader->Record.readInt()));
2075  C->setFirstScheduleModifier(
2076  static_cast<OpenMPScheduleClauseModifier>(Reader->Record.readInt()));
2077  C->setSecondScheduleModifier(
2078  static_cast<OpenMPScheduleClauseModifier>(Reader->Record.readInt()));
2079  C->setChunkSize(Reader->Record.readSubExpr());
2080  C->setLParenLoc(Reader->ReadSourceLocation());
2081  C->setFirstScheduleModifierLoc(Reader->ReadSourceLocation());
2082  C->setSecondScheduleModifierLoc(Reader->ReadSourceLocation());
2083  C->setScheduleKindLoc(Reader->ReadSourceLocation());
2084  C->setCommaLoc(Reader->ReadSourceLocation());
2085 }
2086 
2087 void OMPClauseReader::VisitOMPOrderedClause(OMPOrderedClause *C) {
2088  C->setNumForLoops(Reader->Record.readSubExpr());
2089  C->setLParenLoc(Reader->ReadSourceLocation());
2090 }
2091 
2092 void OMPClauseReader::VisitOMPNowaitClause(OMPNowaitClause *) {}
2093 
2094 void OMPClauseReader::VisitOMPUntiedClause(OMPUntiedClause *) {}
2095 
2096 void OMPClauseReader::VisitOMPMergeableClause(OMPMergeableClause *) {}
2097 
2098 void OMPClauseReader::VisitOMPReadClause(OMPReadClause *) {}
2099 
2100 void OMPClauseReader::VisitOMPWriteClause(OMPWriteClause *) {}
2101 
2102 void OMPClauseReader::VisitOMPUpdateClause(OMPUpdateClause *) {}
2103 
2104 void OMPClauseReader::VisitOMPCaptureClause(OMPCaptureClause *) {}
2105 
2106 void OMPClauseReader::VisitOMPSeqCstClause(OMPSeqCstClause *) {}
2107 
2108 void OMPClauseReader::VisitOMPThreadsClause(OMPThreadsClause *) {}
2109 
2110 void OMPClauseReader::VisitOMPSIMDClause(OMPSIMDClause *) {}
2111 
2112 void OMPClauseReader::VisitOMPNogroupClause(OMPNogroupClause *) {}
2113 
2114 void OMPClauseReader::VisitOMPPrivateClause(OMPPrivateClause *C) {
2115  C->setLParenLoc(Reader->ReadSourceLocation());
2116  unsigned NumVars = C->varlist_size();
2118  Vars.reserve(NumVars);
2119  for (unsigned i = 0; i != NumVars; ++i)
2120  Vars.push_back(Reader->Record.readSubExpr());
2121  C->setVarRefs(Vars);
2122  Vars.clear();
2123  for (unsigned i = 0; i != NumVars; ++i)
2124  Vars.push_back(Reader->Record.readSubExpr());
2125  C->setPrivateCopies(Vars);
2126 }
2127 
2128 void OMPClauseReader::VisitOMPFirstprivateClause(OMPFirstprivateClause *C) {
2129  VisitOMPClauseWithPreInit(C);
2130  C->setLParenLoc(Reader->ReadSourceLocation());
2131  unsigned NumVars = C->varlist_size();
2133  Vars.reserve(NumVars);
2134  for (unsigned i = 0; i != NumVars; ++i)
2135  Vars.push_back(Reader->Record.readSubExpr());
2136  C->setVarRefs(Vars);
2137  Vars.clear();
2138  for (unsigned i = 0; i != NumVars; ++i)
2139  Vars.push_back(Reader->Record.readSubExpr());
2140  C->setPrivateCopies(Vars);
2141  Vars.clear();
2142  for (unsigned i = 0; i != NumVars; ++i)
2143  Vars.push_back(Reader->Record.readSubExpr());
2144  C->setInits(Vars);
2145 }
2146 
2147 void OMPClauseReader::VisitOMPLastprivateClause(OMPLastprivateClause *C) {
2148  VisitOMPClauseWithPostUpdate(C);
2149  C->setLParenLoc(Reader->ReadSourceLocation());
2150  unsigned NumVars = C->varlist_size();
2152  Vars.reserve(NumVars);
2153  for (unsigned i = 0; i != NumVars; ++i)
2154  Vars.push_back(Reader->Record.readSubExpr());
2155  C->setVarRefs(Vars);
2156  Vars.clear();
2157  for (unsigned i = 0; i != NumVars; ++i)
2158  Vars.push_back(Reader->Record.readSubExpr());
2159  C->setPrivateCopies(Vars);
2160  Vars.clear();
2161  for (unsigned i = 0; i != NumVars; ++i)
2162  Vars.push_back(Reader->Record.readSubExpr());
2163  C->setSourceExprs(Vars);
2164  Vars.clear();
2165  for (unsigned i = 0; i != NumVars; ++i)
2166  Vars.push_back(Reader->Record.readSubExpr());
2167  C->setDestinationExprs(Vars);
2168  Vars.clear();
2169  for (unsigned i = 0; i != NumVars; ++i)
2170  Vars.push_back(Reader->Record.readSubExpr());
2171  C->setAssignmentOps(Vars);
2172 }
2173 
2174 void OMPClauseReader::VisitOMPSharedClause(OMPSharedClause *C) {
2175  C->setLParenLoc(Reader->ReadSourceLocation());
2176  unsigned NumVars = C->varlist_size();
2178  Vars.reserve(NumVars);
2179  for (unsigned i = 0; i != NumVars; ++i)
2180  Vars.push_back(Reader->Record.readSubExpr());
2181  C->setVarRefs(Vars);
2182 }
2183 
2184 void OMPClauseReader::VisitOMPReductionClause(OMPReductionClause *C) {
2185  VisitOMPClauseWithPostUpdate(C);
2186  C->setLParenLoc(Reader->ReadSourceLocation());
2187  C->setColonLoc(Reader->ReadSourceLocation());
2188  NestedNameSpecifierLoc NNSL = Reader->Record.readNestedNameSpecifierLoc();
2189  DeclarationNameInfo DNI;
2190  Reader->ReadDeclarationNameInfo(DNI);
2191  C->setQualifierLoc(NNSL);
2192  C->setNameInfo(DNI);
2193 
2194  unsigned NumVars = C->varlist_size();
2196  Vars.reserve(NumVars);
2197  for (unsigned i = 0; i != NumVars; ++i)
2198  Vars.push_back(Reader->Record.readSubExpr());
2199  C->setVarRefs(Vars);
2200  Vars.clear();
2201  for (unsigned i = 0; i != NumVars; ++i)
2202  Vars.push_back(Reader->Record.readSubExpr());
2203  C->setPrivates(Vars);
2204  Vars.clear();
2205  for (unsigned i = 0; i != NumVars; ++i)
2206  Vars.push_back(Reader->Record.readSubExpr());
2207  C->setLHSExprs(Vars);
2208  Vars.clear();
2209  for (unsigned i = 0; i != NumVars; ++i)
2210  Vars.push_back(Reader->Record.readSubExpr());
2211  C->setRHSExprs(Vars);
2212  Vars.clear();
2213  for (unsigned i = 0; i != NumVars; ++i)
2214  Vars.push_back(Reader->Record.readSubExpr());
2215  C->setReductionOps(Vars);
2216 }
2217 
2218 void OMPClauseReader::VisitOMPTaskReductionClause(OMPTaskReductionClause *C) {
2219  VisitOMPClauseWithPostUpdate(C);
2220  C->setLParenLoc(Reader->ReadSourceLocation());
2221  C->setColonLoc(Reader->ReadSourceLocation());
2222  NestedNameSpecifierLoc NNSL = Reader->Record.readNestedNameSpecifierLoc();
2223  DeclarationNameInfo DNI;
2224  Reader->ReadDeclarationNameInfo(DNI);
2225  C->setQualifierLoc(NNSL);
2226  C->setNameInfo(DNI);
2227 
2228  unsigned NumVars = C->varlist_size();
2230  Vars.reserve(NumVars);
2231  for (unsigned I = 0; I != NumVars; ++I)
2232  Vars.push_back(Reader->Record.readSubExpr());
2233  C->setVarRefs(Vars);
2234  Vars.clear();
2235  for (unsigned I = 0; I != NumVars; ++I)
2236  Vars.push_back(Reader->Record.readSubExpr());
2237  C->setPrivates(Vars);
2238  Vars.clear();
2239  for (unsigned I = 0; I != NumVars; ++I)
2240  Vars.push_back(Reader->Record.readSubExpr());
2241  C->setLHSExprs(Vars);
2242  Vars.clear();
2243  for (unsigned I = 0; I != NumVars; ++I)
2244  Vars.push_back(Reader->Record.readSubExpr());
2245  C->setRHSExprs(Vars);
2246  Vars.clear();
2247  for (unsigned I = 0; I != NumVars; ++I)
2248  Vars.push_back(Reader->Record.readSubExpr());
2249  C->setReductionOps(Vars);
2250 }
2251 
2252 void OMPClauseReader::VisitOMPInReductionClause(OMPInReductionClause *C) {
2253  VisitOMPClauseWithPostUpdate(C);
2254  C->setLParenLoc(Reader->ReadSourceLocation());
2255  C->setColonLoc(Reader->ReadSourceLocation());
2256  NestedNameSpecifierLoc NNSL = Reader->Record.readNestedNameSpecifierLoc();
2257  DeclarationNameInfo DNI;
2258  Reader->ReadDeclarationNameInfo(DNI);
2259  C->setQualifierLoc(NNSL);
2260  C->setNameInfo(DNI);
2261 
2262  unsigned NumVars = C->varlist_size();
2264  Vars.reserve(NumVars);
2265  for (unsigned I = 0; I != NumVars; ++I)
2266  Vars.push_back(Reader->Record.readSubExpr());
2267  C->setVarRefs(Vars);
2268  Vars.clear();
2269  for (unsigned I = 0; I != NumVars; ++I)
2270  Vars.push_back(Reader->Record.readSubExpr());
2271  C->setPrivates(Vars);
2272  Vars.clear();
2273  for (unsigned I = 0; I != NumVars; ++I)
2274  Vars.push_back(Reader->Record.readSubExpr());
2275  C->setLHSExprs(Vars);
2276  Vars.clear();
2277  for (unsigned I = 0; I != NumVars; ++I)
2278  Vars.push_back(Reader->Record.readSubExpr());
2279  C->setRHSExprs(Vars);
2280  Vars.clear();
2281  for (unsigned I = 0; I != NumVars; ++I)
2282  Vars.push_back(Reader->Record.readSubExpr());
2283  C->setReductionOps(Vars);
2284  Vars.clear();
2285  for (unsigned I = 0; I != NumVars; ++I)
2286  Vars.push_back(Reader->Record.readSubExpr());
2287  C->setTaskgroupDescriptors(Vars);
2288 }
2289 
2290 void OMPClauseReader::VisitOMPLinearClause(OMPLinearClause *C) {
2291  VisitOMPClauseWithPostUpdate(C);
2292  C->setLParenLoc(Reader->ReadSourceLocation());
2293  C->setColonLoc(Reader->ReadSourceLocation());
2294  C->setModifier(static_cast<OpenMPLinearClauseKind>(Reader->Record.readInt()));
2295  C->setModifierLoc(Reader->ReadSourceLocation());
2296  unsigned NumVars = C->varlist_size();
2298  Vars.reserve(NumVars);
2299  for (unsigned i = 0; i != NumVars; ++i)
2300  Vars.push_back(Reader->Record.readSubExpr());
2301  C->setVarRefs(Vars);
2302  Vars.clear();
2303  for (unsigned i = 0; i != NumVars; ++i)
2304  Vars.push_back(Reader->Record.readSubExpr());
2305  C->setPrivates(Vars);
2306  Vars.clear();
2307  for (unsigned i = 0; i != NumVars; ++i)
2308  Vars.push_back(Reader->Record.readSubExpr());
2309  C->setInits(Vars);
2310  Vars.clear();
2311  for (unsigned i = 0; i != NumVars; ++i)
2312  Vars.push_back(Reader->Record.readSubExpr());
2313  C->setUpdates(Vars);
2314  Vars.clear();
2315  for (unsigned i = 0; i != NumVars; ++i)
2316  Vars.push_back(Reader->Record.readSubExpr());
2317  C->setFinals(Vars);
2318  C->setStep(Reader->Record.readSubExpr());
2319  C->setCalcStep(Reader->Record.readSubExpr());
2320 }
2321 
2322 void OMPClauseReader::VisitOMPAlignedClause(OMPAlignedClause *C) {
2323  C->setLParenLoc(Reader->ReadSourceLocation());
2324  C->setColonLoc(Reader->ReadSourceLocation());
2325  unsigned NumVars = C->varlist_size();
2327  Vars.reserve(NumVars);
2328  for (unsigned i = 0; i != NumVars; ++i)
2329  Vars.push_back(Reader->Record.readSubExpr());
2330  C->setVarRefs(Vars);
2331  C->setAlignment(Reader->Record.readSubExpr());
2332 }
2333 
2334 void OMPClauseReader::VisitOMPCopyinClause(OMPCopyinClause *C) {
2335  C->setLParenLoc(Reader->ReadSourceLocation());
2336  unsigned NumVars = C->varlist_size();
2338  Exprs.reserve(NumVars);
2339  for (unsigned i = 0; i != NumVars; ++i)
2340  Exprs.push_back(Reader->Record.readSubExpr());
2341  C->setVarRefs(Exprs);
2342  Exprs.clear();
2343  for (unsigned i = 0; i != NumVars; ++i)
2344  Exprs.push_back(Reader->Record.readSubExpr());
2345  C->setSourceExprs(Exprs);
2346  Exprs.clear();
2347  for (unsigned i = 0; i != NumVars; ++i)
2348  Exprs.push_back(Reader->Record.readSubExpr());
2349  C->setDestinationExprs(Exprs);
2350  Exprs.clear();
2351  for (unsigned i = 0; i != NumVars; ++i)
2352  Exprs.push_back(Reader->Record.readSubExpr());
2353  C->setAssignmentOps(Exprs);
2354 }
2355 
2356 void OMPClauseReader::VisitOMPCopyprivateClause(OMPCopyprivateClause *C) {
2357  C->setLParenLoc(Reader->ReadSourceLocation());
2358  unsigned NumVars = C->varlist_size();
2360  Exprs.reserve(NumVars);
2361  for (unsigned i = 0; i != NumVars; ++i)
2362  Exprs.push_back(Reader->Record.readSubExpr());
2363  C->setVarRefs(Exprs);
2364  Exprs.clear();
2365  for (unsigned i = 0; i != NumVars; ++i)
2366  Exprs.push_back(Reader->Record.readSubExpr());
2367  C->setSourceExprs(Exprs);
2368  Exprs.clear();
2369  for (unsigned i = 0; i != NumVars; ++i)
2370  Exprs.push_back(Reader->Record.readSubExpr());
2371  C->setDestinationExprs(Exprs);
2372  Exprs.clear();
2373  for (unsigned i = 0; i != NumVars; ++i)
2374  Exprs.push_back(Reader->Record.readSubExpr());
2375  C->setAssignmentOps(Exprs);
2376 }
2377 
2378 void OMPClauseReader::VisitOMPFlushClause(OMPFlushClause *C) {
2379  C->setLParenLoc(Reader->ReadSourceLocation());
2380  unsigned NumVars = C->varlist_size();
2382  Vars.reserve(NumVars);
2383  for (unsigned i = 0; i != NumVars; ++i)
2384  Vars.push_back(Reader->Record.readSubExpr());
2385  C->setVarRefs(Vars);
2386 }
2387 
2388 void OMPClauseReader::VisitOMPDependClause(OMPDependClause *C) {
2389  C->setLParenLoc(Reader->ReadSourceLocation());
2390  C->setDependencyKind(
2391  static_cast<OpenMPDependClauseKind>(Reader->Record.readInt()));
2392  C->setDependencyLoc(Reader->ReadSourceLocation());
2393  C->setColonLoc(Reader->ReadSourceLocation());
2394  unsigned NumVars = C->varlist_size();
2396  Vars.reserve(NumVars);
2397  for (unsigned i = 0; i != NumVars; ++i)
2398  Vars.push_back(Reader->Record.readSubExpr());
2399  C->setVarRefs(Vars);
2400  C->setCounterValue(Reader->Record.readSubExpr());
2401 }
2402 
2403 void OMPClauseReader::VisitOMPDeviceClause(OMPDeviceClause *C) {
2404  VisitOMPClauseWithPreInit(C);
2405  C->setDevice(Reader->Record.readSubExpr());
2406  C->setLParenLoc(Reader->ReadSourceLocation());
2407 }
2408 
2409 void OMPClauseReader::VisitOMPMapClause(OMPMapClause *C) {
2410  C->setLParenLoc(Reader->ReadSourceLocation());
2411  C->setMapTypeModifier(
2412  static_cast<OpenMPMapClauseKind>(Reader->Record.readInt()));
2413  C->setMapType(
2414  static_cast<OpenMPMapClauseKind>(Reader->Record.readInt()));
2415  C->setMapLoc(Reader->ReadSourceLocation());
2416  C->setColonLoc(Reader->ReadSourceLocation());
2417  auto NumVars = C->varlist_size();
2418  auto UniqueDecls = C->getUniqueDeclarationsNum();
2419  auto TotalLists = C->getTotalComponentListNum();
2420  auto TotalComponents = C->getTotalComponentsNum();
2421 
2423  Vars.reserve(NumVars);
2424  for (unsigned i = 0; i != NumVars; ++i)
2425  Vars.push_back(Reader->Record.readSubExpr());
2426  C->setVarRefs(Vars);
2427 
2429  Decls.reserve(UniqueDecls);
2430  for (unsigned i = 0; i < UniqueDecls; ++i)
2431  Decls.push_back(Reader->Record.readDeclAs<ValueDecl>());
2432  C->setUniqueDecls(Decls);
2433 
2434  SmallVector<unsigned, 16> ListsPerDecl;
2435  ListsPerDecl.reserve(UniqueDecls);
2436  for (unsigned i = 0; i < UniqueDecls; ++i)
2437  ListsPerDecl.push_back(Reader->Record.readInt());
2438  C->setDeclNumLists(ListsPerDecl);
2439 
2440  SmallVector<unsigned, 32> ListSizes;
2441  ListSizes.reserve(TotalLists);
2442  for (unsigned i = 0; i < TotalLists; ++i)
2443  ListSizes.push_back(Reader->Record.readInt());
2444  C->setComponentListSizes(ListSizes);
2445 
2447  Components.reserve(TotalComponents);
2448  for (unsigned i = 0; i < TotalComponents; ++i) {
2449  Expr *AssociatedExpr = Reader->Record.readSubExpr();
2450  auto *AssociatedDecl = Reader->Record.readDeclAs<ValueDecl>();
2452  AssociatedExpr, AssociatedDecl));
2453  }
2454  C->setComponents(Components, ListSizes);
2455 }
2456 
2457 void OMPClauseReader::VisitOMPNumTeamsClause(OMPNumTeamsClause *C) {
2458  VisitOMPClauseWithPreInit(C);
2459  C->setNumTeams(Reader->Record.readSubExpr());
2460  C->setLParenLoc(Reader->ReadSourceLocation());
2461 }
2462 
2463 void OMPClauseReader::VisitOMPThreadLimitClause(OMPThreadLimitClause *C) {
2464  VisitOMPClauseWithPreInit(C);
2465  C->setThreadLimit(Reader->Record.readSubExpr());
2466  C->setLParenLoc(Reader->ReadSourceLocation());
2467 }
2468 
2469 void OMPClauseReader::VisitOMPPriorityClause(OMPPriorityClause *C) {
2470  C->setPriority(Reader->Record.readSubExpr());
2471  C->setLParenLoc(Reader->ReadSourceLocation());
2472 }
2473 
2474 void OMPClauseReader::VisitOMPGrainsizeClause(OMPGrainsizeClause *C) {
2475  C->setGrainsize(Reader->Record.readSubExpr());
2476  C->setLParenLoc(Reader->ReadSourceLocation());
2477 }
2478 
2479 void OMPClauseReader::VisitOMPNumTasksClause(OMPNumTasksClause *C) {
2480  C->setNumTasks(Reader->Record.readSubExpr());
2481  C->setLParenLoc(Reader->ReadSourceLocation());
2482 }
2483 
2484 void OMPClauseReader::VisitOMPHintClause(OMPHintClause *C) {
2485  C->setHint(Reader->Record.readSubExpr());
2486  C->setLParenLoc(Reader->ReadSourceLocation());
2487 }
2488 
2489 void OMPClauseReader::VisitOMPDistScheduleClause(OMPDistScheduleClause *C) {
2490  VisitOMPClauseWithPreInit(C);
2491  C->setDistScheduleKind(
2492  static_cast<OpenMPDistScheduleClauseKind>(Reader->Record.readInt()));
2493  C->setChunkSize(Reader->Record.readSubExpr());
2494  C->setLParenLoc(Reader->ReadSourceLocation());
2495  C->setDistScheduleKindLoc(Reader->ReadSourceLocation());
2496  C->setCommaLoc(Reader->ReadSourceLocation());
2497 }
2498 
2499 void OMPClauseReader::VisitOMPDefaultmapClause(OMPDefaultmapClause *C) {
2500  C->setDefaultmapKind(
2501  static_cast<OpenMPDefaultmapClauseKind>(Reader->Record.readInt()));
2502  C->setDefaultmapModifier(
2503  static_cast<OpenMPDefaultmapClauseModifier>(Reader->Record.readInt()));
2504  C->setLParenLoc(Reader->ReadSourceLocation());
2505  C->setDefaultmapModifierLoc(Reader->ReadSourceLocation());
2506  C->setDefaultmapKindLoc(Reader->ReadSourceLocation());
2507 }
2508 
2509 void OMPClauseReader::VisitOMPToClause(OMPToClause *C) {
2510  C->setLParenLoc(Reader->ReadSourceLocation());
2511  auto NumVars = C->varlist_size();
2512  auto UniqueDecls = C->getUniqueDeclarationsNum();
2513  auto TotalLists = C->getTotalComponentListNum();
2514  auto TotalComponents = C->getTotalComponentsNum();
2515 
2517  Vars.reserve(NumVars);
2518  for (unsigned i = 0; i != NumVars; ++i)
2519  Vars.push_back(Reader->Record.readSubExpr());
2520  C->setVarRefs(Vars);
2521 
2523  Decls.reserve(UniqueDecls);
2524  for (unsigned i = 0; i < UniqueDecls; ++i)
2525  Decls.push_back(Reader->Record.readDeclAs<ValueDecl>());
2526  C->setUniqueDecls(Decls);
2527 
2528  SmallVector<unsigned, 16> ListsPerDecl;
2529  ListsPerDecl.reserve(UniqueDecls);
2530  for (unsigned i = 0; i < UniqueDecls; ++i)
2531  ListsPerDecl.push_back(Reader->Record.readInt());
2532  C->setDeclNumLists(ListsPerDecl);
2533 
2534  SmallVector<unsigned, 32> ListSizes;
2535  ListSizes.reserve(TotalLists);
2536  for (unsigned i = 0; i < TotalLists; ++i)
2537  ListSizes.push_back(Reader->Record.readInt());
2538  C->setComponentListSizes(ListSizes);
2539 
2541  Components.reserve(TotalComponents);
2542  for (unsigned i = 0; i < TotalComponents; ++i) {
2543  Expr *AssociatedExpr = Reader->Record.readSubExpr();
2544  auto *AssociatedDecl = Reader->Record.readDeclAs<ValueDecl>();
2546  AssociatedExpr, AssociatedDecl));
2547  }
2548  C->setComponents(Components, ListSizes);
2549 }
2550 
2551 void OMPClauseReader::VisitOMPFromClause(OMPFromClause *C) {
2552  C->setLParenLoc(Reader->ReadSourceLocation());
2553  auto NumVars = C->varlist_size();
2554  auto UniqueDecls = C->getUniqueDeclarationsNum();
2555  auto TotalLists = C->getTotalComponentListNum();
2556  auto TotalComponents = C->getTotalComponentsNum();
2557 
2559  Vars.reserve(NumVars);
2560  for (unsigned i = 0; i != NumVars; ++i)
2561  Vars.push_back(Reader->Record.readSubExpr());
2562  C->setVarRefs(Vars);
2563 
2565  Decls.reserve(UniqueDecls);
2566  for (unsigned i = 0; i < UniqueDecls; ++i)
2567  Decls.push_back(Reader->Record.readDeclAs<ValueDecl>());
2568  C->setUniqueDecls(Decls);
2569 
2570  SmallVector<unsigned, 16> ListsPerDecl;
2571  ListsPerDecl.reserve(UniqueDecls);
2572  for (unsigned i = 0; i < UniqueDecls; ++i)
2573  ListsPerDecl.push_back(Reader->Record.readInt());
2574  C->setDeclNumLists(ListsPerDecl);
2575 
2576  SmallVector<unsigned, 32> ListSizes;
2577  ListSizes.reserve(TotalLists);
2578  for (unsigned i = 0; i < TotalLists; ++i)
2579  ListSizes.push_back(Reader->Record.readInt());
2580  C->setComponentListSizes(ListSizes);
2581 
2583  Components.reserve(TotalComponents);
2584  for (unsigned i = 0; i < TotalComponents; ++i) {
2585  Expr *AssociatedExpr = Reader->Record.readSubExpr();
2586  auto *AssociatedDecl = Reader->Record.readDeclAs<ValueDecl>();
2588  AssociatedExpr, AssociatedDecl));
2589  }
2590  C->setComponents(Components, ListSizes);
2591 }
2592 
2593 void OMPClauseReader::VisitOMPUseDevicePtrClause(OMPUseDevicePtrClause *C) {
2594  C->setLParenLoc(Reader->ReadSourceLocation());
2595  auto NumVars = C->varlist_size();
2596  auto UniqueDecls = C->getUniqueDeclarationsNum();
2597  auto TotalLists = C->getTotalComponentListNum();
2598  auto TotalComponents = C->getTotalComponentsNum();
2599 
2601  Vars.reserve(NumVars);
2602  for (unsigned i = 0; i != NumVars; ++i)
2603  Vars.push_back(Reader->Record.readSubExpr());
2604  C->setVarRefs(Vars);
2605  Vars.clear();
2606  for (unsigned i = 0; i != NumVars; ++i)
2607  Vars.push_back(Reader->Record.readSubExpr());
2608  C->setPrivateCopies(Vars);
2609  Vars.clear();
2610  for (unsigned i = 0; i != NumVars; ++i)
2611  Vars.push_back(Reader->Record.readSubExpr());
2612  C->setInits(Vars);
2613 
2615  Decls.reserve(UniqueDecls);
2616  for (unsigned i = 0; i < UniqueDecls; ++i)
2617  Decls.push_back(Reader->Record.readDeclAs<ValueDecl>());
2618  C->setUniqueDecls(Decls);
2619 
2620  SmallVector<unsigned, 16> ListsPerDecl;
2621  ListsPerDecl.reserve(UniqueDecls);
2622  for (unsigned i = 0; i < UniqueDecls; ++i)
2623  ListsPerDecl.push_back(Reader->Record.readInt());
2624  C->setDeclNumLists(ListsPerDecl);
2625 
2626  SmallVector<unsigned, 32> ListSizes;
2627  ListSizes.reserve(TotalLists);
2628  for (unsigned i = 0; i < TotalLists; ++i)
2629  ListSizes.push_back(Reader->Record.readInt());
2630  C->setComponentListSizes(ListSizes);
2631 
2633  Components.reserve(TotalComponents);
2634  for (unsigned i = 0; i < TotalComponents; ++i) {
2635  Expr *AssociatedExpr = Reader->Record.readSubExpr();
2636  auto *AssociatedDecl = Reader->Record.readDeclAs<ValueDecl>();
2638  AssociatedExpr, AssociatedDecl));
2639  }
2640  C->setComponents(Components, ListSizes);
2641 }
2642 
2643 void OMPClauseReader::VisitOMPIsDevicePtrClause(OMPIsDevicePtrClause *C) {
2644  C->setLParenLoc(Reader->ReadSourceLocation());
2645  auto NumVars = C->varlist_size();
2646  auto UniqueDecls = C->getUniqueDeclarationsNum();
2647  auto TotalLists = C->getTotalComponentListNum();
2648  auto TotalComponents = C->getTotalComponentsNum();
2649 
2651  Vars.reserve(NumVars);
2652  for (unsigned i = 0; i != NumVars; ++i)
2653  Vars.push_back(Reader->Record.readSubExpr());
2654  C->setVarRefs(Vars);
2655  Vars.clear();
2656 
2658  Decls.reserve(UniqueDecls);
2659  for (unsigned i = 0; i < UniqueDecls; ++i)
2660  Decls.push_back(Reader->Record.readDeclAs<ValueDecl>());
2661  C->setUniqueDecls(Decls);
2662 
2663  SmallVector<unsigned, 16> ListsPerDecl;
2664  ListsPerDecl.reserve(UniqueDecls);
2665  for (unsigned i = 0; i < UniqueDecls; ++i)
2666  ListsPerDecl.push_back(Reader->Record.readInt());
2667  C->setDeclNumLists(ListsPerDecl);
2668 
2669  SmallVector<unsigned, 32> ListSizes;
2670  ListSizes.reserve(TotalLists);
2671  for (unsigned i = 0; i < TotalLists; ++i)
2672  ListSizes.push_back(Reader->Record.readInt());
2673  C->setComponentListSizes(ListSizes);
2674 
2676  Components.reserve(TotalComponents);
2677  for (unsigned i = 0; i < TotalComponents; ++i) {
2678  Expr *AssociatedExpr = Reader->Record.readSubExpr();
2679  auto *AssociatedDecl = Reader->Record.readDeclAs<ValueDecl>();
2681  AssociatedExpr, AssociatedDecl));
2682  }
2683  C->setComponents(Components, ListSizes);
2684 }
2685 
2686 //===----------------------------------------------------------------------===//
2687 // OpenMP Directives.
2688 //===----------------------------------------------------------------------===//
2689 
2690 void ASTStmtReader::VisitOMPExecutableDirective(OMPExecutableDirective *E) {
2691  E->setLocStart(ReadSourceLocation());
2692  E->setLocEnd(ReadSourceLocation());
2693  OMPClauseReader ClauseReader(this, Record);
2695  for (unsigned i = 0; i < E->getNumClauses(); ++i)
2696  Clauses.push_back(ClauseReader.readClause());
2697  E->setClauses(Clauses);
2698  if (E->hasAssociatedStmt())
2699  E->setAssociatedStmt(Record.readSubStmt());
2700 }
2701 
2702 void ASTStmtReader::VisitOMPLoopDirective(OMPLoopDirective *D) {
2703  VisitStmt(D);
2704  // Two fields (NumClauses and CollapsedNum) were read in ReadStmtFromStream.
2705  Record.skipInts(2);
2706  VisitOMPExecutableDirective(D);
2707  D->setIterationVariable(Record.readSubExpr());
2708  D->setLastIteration(Record.readSubExpr());
2709  D->setCalcLastIteration(Record.readSubExpr());
2710  D->setPreCond(Record.readSubExpr());
2711  D->setCond(Record.readSubExpr());
2712  D->setInit(Record.readSubExpr());
2713  D->setInc(Record.readSubExpr());
2714  D->setPreInits(Record.readSubStmt());
2718  D->setIsLastIterVariable(Record.readSubExpr());
2719  D->setLowerBoundVariable(Record.readSubExpr());
2720  D->setUpperBoundVariable(Record.readSubExpr());
2721  D->setStrideVariable(Record.readSubExpr());
2722  D->setEnsureUpperBound(Record.readSubExpr());
2723  D->setNextLowerBound(Record.readSubExpr());
2724  D->setNextUpperBound(Record.readSubExpr());
2725  D->setNumIterations(Record.readSubExpr());
2726  }
2730  D->setDistInc(Record.readSubExpr());
2731  D->setPrevEnsureUpperBound(Record.readSubExpr());
2735  D->setCombinedInit(Record.readSubExpr());
2736  D->setCombinedCond(Record.readSubExpr());
2739  }
2741  unsigned CollapsedNum = D->getCollapsedNumber();
2742  Sub.reserve(CollapsedNum);
2743  for (unsigned i = 0; i < CollapsedNum; ++i)
2744  Sub.push_back(Record.readSubExpr());
2745  D->setCounters(Sub);
2746  Sub.clear();
2747  for (unsigned i = 0; i < CollapsedNum; ++i)
2748  Sub.push_back(Record.readSubExpr());
2749  D->setPrivateCounters(Sub);
2750  Sub.clear();
2751  for (unsigned i = 0; i < CollapsedNum; ++i)
2752  Sub.push_back(Record.readSubExpr());
2753  D->setInits(Sub);
2754  Sub.clear();
2755  for (unsigned i = 0; i < CollapsedNum; ++i)
2756  Sub.push_back(Record.readSubExpr());
2757  D->setUpdates(Sub);
2758  Sub.clear();
2759  for (unsigned i = 0; i < CollapsedNum; ++i)
2760  Sub.push_back(Record.readSubExpr());
2761  D->setFinals(Sub);
2762 }
2763 
2764 void ASTStmtReader::VisitOMPParallelDirective(OMPParallelDirective *D) {
2765  VisitStmt(D);
2766  // The NumClauses field was read in ReadStmtFromStream.
2767  Record.skipInts(1);
2768  VisitOMPExecutableDirective(D);
2769  D->setHasCancel(Record.readInt());
2770 }
2771 
2772 void ASTStmtReader::VisitOMPSimdDirective(OMPSimdDirective *D) {
2773  VisitOMPLoopDirective(D);
2774 }
2775 
2776 void ASTStmtReader::VisitOMPForDirective(OMPForDirective *D) {
2777  VisitOMPLoopDirective(D);
2778  D->setHasCancel(Record.readInt());
2779 }
2780 
2781 void ASTStmtReader::VisitOMPForSimdDirective(OMPForSimdDirective *D) {
2782  VisitOMPLoopDirective(D);
2783 }
2784 
2785 void ASTStmtReader::VisitOMPSectionsDirective(OMPSectionsDirective *D) {
2786  VisitStmt(D);
2787  // The NumClauses field was read in ReadStmtFromStream.
2788  Record.skipInts(1);
2789  VisitOMPExecutableDirective(D);
2790  D->setHasCancel(Record.readInt());
2791 }
2792 
2793 void ASTStmtReader::VisitOMPSectionDirective(OMPSectionDirective *D) {
2794  VisitStmt(D);
2795  VisitOMPExecutableDirective(D);
2796  D->setHasCancel(Record.readInt());
2797 }
2798 
2799 void ASTStmtReader::VisitOMPSingleDirective(OMPSingleDirective *D) {
2800  VisitStmt(D);
2801  // The NumClauses field was read in ReadStmtFromStream.
2802  Record.skipInts(1);
2803  VisitOMPExecutableDirective(D);
2804 }
2805 
2806 void ASTStmtReader::VisitOMPMasterDirective(OMPMasterDirective *D) {
2807  VisitStmt(D);
2808  VisitOMPExecutableDirective(D);
2809 }
2810 
2811 void ASTStmtReader::VisitOMPCriticalDirective(OMPCriticalDirective *D) {
2812  VisitStmt(D);
2813  // The NumClauses field was read in ReadStmtFromStream.
2814  Record.skipInts(1);
2815  VisitOMPExecutableDirective(D);
2816  ReadDeclarationNameInfo(D->DirName);
2817 }
2818 
2819 void ASTStmtReader::VisitOMPParallelForDirective(OMPParallelForDirective *D) {
2820  VisitOMPLoopDirective(D);
2821  D->setHasCancel(Record.readInt());
2822 }
2823 
2824 void ASTStmtReader::VisitOMPParallelForSimdDirective(
2826  VisitOMPLoopDirective(D);
2827 }
2828 
2829 void ASTStmtReader::VisitOMPParallelSectionsDirective(
2831  VisitStmt(D);
2832  // The NumClauses field was read in ReadStmtFromStream.
2833  Record.skipInts(1);
2834  VisitOMPExecutableDirective(D);
2835  D->setHasCancel(Record.readInt());
2836 }
2837 
2838 void ASTStmtReader::VisitOMPTaskDirective(OMPTaskDirective *D) {
2839  VisitStmt(D);
2840  // The NumClauses field was read in ReadStmtFromStream.
2841  Record.skipInts(1);
2842  VisitOMPExecutableDirective(D);
2843  D->setHasCancel(Record.readInt());
2844 }
2845 
2846 void ASTStmtReader::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) {
2847  VisitStmt(D);
2848  VisitOMPExecutableDirective(D);
2849 }
2850 
2851 void ASTStmtReader::VisitOMPBarrierDirective(OMPBarrierDirective *D) {
2852  VisitStmt(D);
2853  VisitOMPExecutableDirective(D);
2854 }
2855 
2856 void ASTStmtReader::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) {
2857  VisitStmt(D);
2858  VisitOMPExecutableDirective(D);
2859 }
2860 
2861 void ASTStmtReader::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) {
2862  VisitStmt(D);
2863  // The NumClauses field was read in ReadStmtFromStream.
2864  Record.skipInts(1);
2865  VisitOMPExecutableDirective(D);
2866  D->setReductionRef(Record.readSubExpr());
2867 }
2868 
2869 void ASTStmtReader::VisitOMPFlushDirective(OMPFlushDirective *D) {
2870  VisitStmt(D);
2871  // The NumClauses field was read in ReadStmtFromStream.
2872  Record.skipInts(1);
2873  VisitOMPExecutableDirective(D);
2874 }
2875 
2876 void ASTStmtReader::VisitOMPOrderedDirective(OMPOrderedDirective *D) {
2877  VisitStmt(D);
2878  // The NumClauses field was read in ReadStmtFromStream.
2879  Record.skipInts(1);
2880  VisitOMPExecutableDirective(D);
2881 }
2882 
2883 void ASTStmtReader::VisitOMPAtomicDirective(OMPAtomicDirective *D) {
2884  VisitStmt(D);
2885  // The NumClauses field was read in ReadStmtFromStream.
2886  Record.skipInts(1);
2887  VisitOMPExecutableDirective(D);
2888  D->setX(Record.readSubExpr());
2889  D->setV(Record.readSubExpr());
2890  D->setExpr(Record.readSubExpr());
2891  D->setUpdateExpr(Record.readSubExpr());
2892  D->IsXLHSInRHSPart = Record.readInt() != 0;
2893  D->IsPostfixUpdate = Record.readInt() != 0;
2894 }
2895 
2896 void ASTStmtReader::VisitOMPTargetDirective(OMPTargetDirective *D) {
2897  VisitStmt(D);
2898  // The NumClauses field was read in ReadStmtFromStream.
2899  Record.skipInts(1);
2900  VisitOMPExecutableDirective(D);
2901 }
2902 
2903 void ASTStmtReader::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) {
2904  VisitStmt(D);
2905  Record.skipInts(1);
2906  VisitOMPExecutableDirective(D);
2907 }
2908 
2909 void ASTStmtReader::VisitOMPTargetEnterDataDirective(
2911  VisitStmt(D);
2912  Record.skipInts(1);
2913  VisitOMPExecutableDirective(D);
2914 }
2915 
2916 void ASTStmtReader::VisitOMPTargetExitDataDirective(
2918  VisitStmt(D);
2919  Record.skipInts(1);
2920  VisitOMPExecutableDirective(D);
2921 }
2922 
2923 void ASTStmtReader::VisitOMPTargetParallelDirective(
2925  VisitStmt(D);
2926  Record.skipInts(1);
2927  VisitOMPExecutableDirective(D);
2928 }
2929 
2930 void ASTStmtReader::VisitOMPTargetParallelForDirective(
2932  VisitOMPLoopDirective(D);
2933  D->setHasCancel(Record.readInt());
2934 }
2935 
2936 void ASTStmtReader::VisitOMPTeamsDirective(OMPTeamsDirective *D) {
2937  VisitStmt(D);
2938  // The NumClauses field was read in ReadStmtFromStream.
2939  Record.skipInts(1);
2940  VisitOMPExecutableDirective(D);
2941 }
2942 
2943 void ASTStmtReader::VisitOMPCancellationPointDirective(
2945  VisitStmt(D);
2946  VisitOMPExecutableDirective(D);
2947  D->setCancelRegion(static_cast<OpenMPDirectiveKind>(Record.readInt()));
2948 }
2949 
2950 void ASTStmtReader::VisitOMPCancelDirective(OMPCancelDirective *D) {
2951  VisitStmt(D);
2952  // The NumClauses field was read in ReadStmtFromStream.
2953  Record.skipInts(1);
2954  VisitOMPExecutableDirective(D);
2955  D->setCancelRegion(static_cast<OpenMPDirectiveKind>(Record.readInt()));
2956 }
2957 
2958 void ASTStmtReader::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) {
2959  VisitOMPLoopDirective(D);
2960 }
2961 
2962 void ASTStmtReader::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) {
2963  VisitOMPLoopDirective(D);
2964 }
2965 
2966 void ASTStmtReader::VisitOMPDistributeDirective(OMPDistributeDirective *D) {
2967  VisitOMPLoopDirective(D);
2968 }
2969 
2970 void ASTStmtReader::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) {
2971  VisitStmt(D);
2972  Record.skipInts(1);
2973  VisitOMPExecutableDirective(D);
2974 }
2975 
2976 void ASTStmtReader::VisitOMPDistributeParallelForDirective(
2978  VisitOMPLoopDirective(D);
2979  D->setHasCancel(Record.readInt());
2980 }
2981 
2982 void ASTStmtReader::VisitOMPDistributeParallelForSimdDirective(
2984  VisitOMPLoopDirective(D);
2985 }
2986 
2987 void ASTStmtReader::VisitOMPDistributeSimdDirective(
2989  VisitOMPLoopDirective(D);
2990 }
2991 
2992 void ASTStmtReader::VisitOMPTargetParallelForSimdDirective(
2994  VisitOMPLoopDirective(D);
2995 }
2996 
2997 void ASTStmtReader::VisitOMPTargetSimdDirective(OMPTargetSimdDirective *D) {
2998  VisitOMPLoopDirective(D);
2999 }
3000 
3001 void ASTStmtReader::VisitOMPTeamsDistributeDirective(
3003  VisitOMPLoopDirective(D);
3004 }
3005 
3006 void ASTStmtReader::VisitOMPTeamsDistributeSimdDirective(
3008  VisitOMPLoopDirective(D);
3009 }
3010 
3011 void ASTStmtReader::VisitOMPTeamsDistributeParallelForSimdDirective(
3013  VisitOMPLoopDirective(D);
3014 }
3015 
3016 void ASTStmtReader::VisitOMPTeamsDistributeParallelForDirective(
3018  VisitOMPLoopDirective(D);
3019  D->setHasCancel(Record.readInt());
3020 }
3021 
3022 void ASTStmtReader::VisitOMPTargetTeamsDirective(OMPTargetTeamsDirective *D) {
3023  VisitStmt(D);
3024  // The NumClauses field was read in ReadStmtFromStream.
3025  Record.skipInts(1);
3026  VisitOMPExecutableDirective(D);
3027 }
3028 
3029 void ASTStmtReader::VisitOMPTargetTeamsDistributeDirective(
3031  VisitOMPLoopDirective(D);
3032 }
3033 
3034 void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForDirective(
3036  VisitOMPLoopDirective(D);
3037  D->setHasCancel(Record.readInt());
3038 }
3039 
3040 void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
3042  VisitOMPLoopDirective(D);
3043 }
3044 
3045 void ASTStmtReader::VisitOMPTargetTeamsDistributeSimdDirective(
3047  VisitOMPLoopDirective(D);
3048 }
3049 
3050 //===----------------------------------------------------------------------===//
3051 // ASTReader Implementation
3052 //===----------------------------------------------------------------------===//
3053 
3055  switch (ReadingKind) {
3056  case Read_None:
3057  llvm_unreachable("should not call this when not reading anything");
3058  case Read_Decl:
3059  case Read_Type:
3060  return ReadStmtFromStream(F);
3061  case Read_Stmt:
3062  return ReadSubStmt();
3063  }
3064 
3065  llvm_unreachable("ReadingKind not set ?");
3066 }
3067 
3069  return cast_or_null<Expr>(ReadStmt(F));
3070 }
3071 
3073  return cast_or_null<Expr>(ReadSubStmt());
3074 }
3075 
3076 // Within the bitstream, expressions are stored in Reverse Polish
3077 // Notation, with each of the subexpressions preceding the
3078 // expression they are stored in. Subexpressions are stored from last to first.
3079 // To evaluate expressions, we continue reading expressions and placing them on
3080 // the stack, with expressions having operands removing those operands from the
3081 // stack. Evaluation terminates when we see a STMT_STOP record, and
3082 // the single remaining expression on the stack is our result.
3083 Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) {
3084  ReadingKindTracker ReadingKind(Read_Stmt, *this);
3085  llvm::BitstreamCursor &Cursor = F.DeclsCursor;
3086 
3087  // Map of offset to previously deserialized stmt. The offset points
3088  // just after the stmt record.
3089  llvm::DenseMap<uint64_t, Stmt *> StmtEntries;
3090 
3091 #ifndef NDEBUG
3092  unsigned PrevNumStmts = StmtStack.size();
3093 #endif
3094 
3095  ASTRecordReader Record(*this, F);
3096  ASTStmtReader Reader(Record, Cursor);
3097  Stmt::EmptyShell Empty;
3098 
3099  while (true) {
3100  llvm::BitstreamEntry Entry = Cursor.advanceSkippingSubblocks();
3101 
3102  switch (Entry.Kind) {
3103  case llvm::BitstreamEntry::SubBlock: // Handled for us already.
3105  Error("malformed block record in AST file");
3106  return nullptr;
3107  case llvm::BitstreamEntry::EndBlock:
3108  goto Done;
3109  case llvm::BitstreamEntry::Record:
3110  // The interesting case.
3111  break;
3112  }
3113 
3114  ASTContext &Context = getContext();
3115  Stmt *S = nullptr;
3116  bool Finished = false;
3117  bool IsStmtReference = false;
3118  switch ((StmtCode)Record.readRecord(Cursor, Entry.ID)) {
3119  case STMT_STOP:
3120  Finished = true;
3121  break;
3122 
3123  case STMT_REF_PTR:
3124  IsStmtReference = true;
3125  assert(StmtEntries.find(Record[0]) != StmtEntries.end() &&
3126  "No stmt was recorded for this offset reference!");
3127  S = StmtEntries[Record.readInt()];
3128  break;
3129 
3130  case STMT_NULL_PTR:
3131  S = nullptr;
3132  break;
3133 
3134  case STMT_NULL:
3135  S = new (Context) NullStmt(Empty);
3136  break;
3137 
3138  case STMT_COMPOUND:
3140  Context, /*NumStmts=*/Record[ASTStmtReader::NumStmtFields]);
3141  break;
3142 
3143  case STMT_CASE:
3144  S = new (Context) CaseStmt(Empty);
3145  break;
3146 
3147  case STMT_DEFAULT:
3148  S = new (Context) DefaultStmt(Empty);
3149  break;
3150 
3151  case STMT_LABEL:
3152  S = new (Context) LabelStmt(Empty);
3153  break;
3154 
3155  case STMT_ATTRIBUTED:
3157  Context,
3158  /*NumAttrs*/Record[ASTStmtReader::NumStmtFields]);
3159  break;
3160 
3161  case STMT_IF:
3162  S = new (Context) IfStmt(Empty);
3163  break;
3164 
3165  case STMT_SWITCH:
3166  S = new (Context) SwitchStmt(Empty);
3167  break;
3168 
3169  case STMT_WHILE:
3170  S = new (Context) WhileStmt(Empty);
3171  break;
3172 
3173  case STMT_DO:
3174  S = new (Context) DoStmt(Empty);
3175  break;
3176 
3177  case STMT_FOR:
3178  S = new (Context) ForStmt(Empty);
3179  break;
3180 
3181  case STMT_GOTO:
3182  S = new (Context) GotoStmt(Empty);
3183  break;
3184 
3185  case STMT_INDIRECT_GOTO:
3186  S = new (Context) IndirectGotoStmt(Empty);
3187  break;
3188 
3189  case STMT_CONTINUE:
3190  S = new (Context) ContinueStmt(Empty);
3191  break;
3192 
3193  case STMT_BREAK:
3194  S = new (Context) BreakStmt(Empty);
3195  break;
3196 
3197  case STMT_RETURN:
3198  S = new (Context) ReturnStmt(Empty);
3199  break;
3200 
3201  case STMT_DECL:
3202  S = new (Context) DeclStmt(Empty);
3203  break;
3204 
3205  case STMT_GCCASM:
3206  S = new (Context) GCCAsmStmt(Empty);
3207  break;
3208 
3209  case STMT_MSASM:
3210  S = new (Context) MSAsmStmt(Empty);
3211  break;
3212 
3213  case STMT_CAPTURED:
3215  Record[ASTStmtReader::NumStmtFields]);
3216  break;
3217 
3218  case EXPR_PREDEFINED:
3219  S = new (Context) PredefinedExpr(Empty);
3220  break;
3221 
3222  case EXPR_DECL_REF:
3224  Context,
3225  /*HasQualifier=*/Record[ASTStmtReader::NumExprFields],
3226  /*HasFoundDecl=*/Record[ASTStmtReader::NumExprFields + 1],
3227  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields + 2],
3228  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields + 2] ?
3229  Record[ASTStmtReader::NumExprFields + 5] : 0);
3230  break;
3231 
3232  case EXPR_INTEGER_LITERAL:
3233  S = IntegerLiteral::Create(Context, Empty);
3234  break;
3235 
3236  case EXPR_FLOATING_LITERAL:
3237  S = FloatingLiteral::Create(Context, Empty);
3238  break;
3239 
3241  S = new (Context) ImaginaryLiteral(Empty);
3242  break;
3243 
3244  case EXPR_STRING_LITERAL:
3245  S = StringLiteral::CreateEmpty(Context,
3246  Record[ASTStmtReader::NumExprFields + 1]);
3247  break;
3248 
3250  S = new (Context) CharacterLiteral(Empty);
3251  break;
3252 
3253  case EXPR_PAREN:
3254  S = new (Context) ParenExpr(Empty);
3255  break;
3256 
3257  case EXPR_PAREN_LIST:
3258  S = new (Context) ParenListExpr(Empty);
3259  break;
3260 
3261  case EXPR_UNARY_OPERATOR:
3262  S = new (Context) UnaryOperator(Empty);
3263  break;
3264 
3265  case EXPR_OFFSETOF:
3266  S = OffsetOfExpr::CreateEmpty(Context,
3267  Record[ASTStmtReader::NumExprFields],
3268  Record[ASTStmtReader::NumExprFields + 1]);
3269  break;
3270 
3271  case EXPR_SIZEOF_ALIGN_OF:
3272  S = new (Context) UnaryExprOrTypeTraitExpr(Empty);
3273  break;
3274 
3275  case EXPR_ARRAY_SUBSCRIPT:
3276  S = new (Context) ArraySubscriptExpr(Empty);
3277  break;
3278 
3280  S = new (Context) OMPArraySectionExpr(Empty);
3281  break;
3282 
3283  case EXPR_CALL:
3284  S = new (Context) CallExpr(Context, Stmt::CallExprClass, Empty);
3285  break;
3286 
3287  case EXPR_MEMBER: {
3288  // We load everything here and fully initialize it at creation.
3289  // That way we can use MemberExpr::Create and don't have to duplicate its
3290  // logic with a MemberExpr::CreateEmpty.
3291 
3292  assert(Record.getIdx() == 0);
3293  NestedNameSpecifierLoc QualifierLoc;
3294  if (Record.readInt()) { // HasQualifier.
3295  QualifierLoc = Record.readNestedNameSpecifierLoc();
3296  }
3297 
3298  SourceLocation TemplateKWLoc;
3299  TemplateArgumentListInfo ArgInfo;
3300  bool HasTemplateKWAndArgsInfo = Record.readInt();
3301  if (HasTemplateKWAndArgsInfo) {
3302  TemplateKWLoc = Record.readSourceLocation();
3303  unsigned NumTemplateArgs = Record.readInt();
3304  ArgInfo.setLAngleLoc(Record.readSourceLocation());
3305  ArgInfo.setRAngleLoc(Record.readSourceLocation());
3306  for (unsigned i = 0; i != NumTemplateArgs; ++i)
3307  ArgInfo.addArgument(Record.readTemplateArgumentLoc());
3308  }
3309 
3310  bool HadMultipleCandidates = Record.readInt();
3311 
3312  auto *FoundD = Record.readDeclAs<NamedDecl>();
3313  auto AS = (AccessSpecifier)Record.readInt();
3314  DeclAccessPair FoundDecl = DeclAccessPair::make(FoundD, AS);
3315 
3316  QualType T = Record.readType();
3317  auto VK = static_cast<ExprValueKind>(Record.readInt());
3318  auto OK = static_cast<ExprObjectKind>(Record.readInt());
3319  Expr *Base = ReadSubExpr();
3320  auto *MemberD = Record.readDeclAs<ValueDecl>();
3321  SourceLocation MemberLoc = Record.readSourceLocation();
3322  DeclarationNameInfo MemberNameInfo(MemberD->getDeclName(), MemberLoc);
3323  bool IsArrow = Record.readInt();
3324  SourceLocation OperatorLoc = Record.readSourceLocation();
3325 
3326  S = MemberExpr::Create(Context, Base, IsArrow, OperatorLoc, QualifierLoc,
3327  TemplateKWLoc, MemberD, FoundDecl, MemberNameInfo,
3328  HasTemplateKWAndArgsInfo ? &ArgInfo : nullptr, T,
3329  VK, OK);
3330  Record.readDeclarationNameLoc(cast<MemberExpr>(S)->MemberDNLoc,
3331  MemberD->getDeclName());
3332  if (HadMultipleCandidates)
3333  cast<MemberExpr>(S)->setHadMultipleCandidates(true);
3334  break;
3335  }
3336 
3337  case EXPR_BINARY_OPERATOR:
3338  S = new (Context) BinaryOperator(Empty);
3339  break;
3340 
3342  S = new (Context) CompoundAssignOperator(Empty);
3343  break;
3344 
3346  S = new (Context) ConditionalOperator(Empty);
3347  break;
3348 
3350  S = new (Context) BinaryConditionalOperator(Empty);
3351  break;
3352 
3353  case EXPR_IMPLICIT_CAST:
3354  S = ImplicitCastExpr::CreateEmpty(Context,
3355  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3356  break;
3357 
3358  case EXPR_CSTYLE_CAST:
3359  S = CStyleCastExpr::CreateEmpty(Context,
3360  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3361  break;
3362 
3363  case EXPR_COMPOUND_LITERAL:
3364  S = new (Context) CompoundLiteralExpr(Empty);
3365  break;
3366 
3368  S = new (Context) ExtVectorElementExpr(Empty);
3369  break;
3370 
3371  case EXPR_INIT_LIST:
3372  S = new (Context) InitListExpr(Empty);
3373  break;
3374 
3375  case EXPR_DESIGNATED_INIT:
3376  S = DesignatedInitExpr::CreateEmpty(Context,
3377  Record[ASTStmtReader::NumExprFields] - 1);
3378 
3379  break;
3380 
3382  S = new (Context) DesignatedInitUpdateExpr(Empty);
3383  break;
3384 
3386  S = new (Context) ImplicitValueInitExpr(Empty);
3387  break;
3388 
3389  case EXPR_NO_INIT:
3390  S = new (Context) NoInitExpr(Empty);
3391  break;
3392 
3393  case EXPR_ARRAY_INIT_LOOP:
3394  S = new (Context) ArrayInitLoopExpr(Empty);
3395  break;
3396 
3397  case EXPR_ARRAY_INIT_INDEX:
3398  S = new (Context) ArrayInitIndexExpr(Empty);
3399  break;
3400 
3401  case EXPR_VA_ARG:
3402  S = new (Context) VAArgExpr(Empty);
3403  break;
3404 
3405  case EXPR_ADDR_LABEL:
3406  S = new (Context) AddrLabelExpr(Empty);
3407  break;
3408 
3409  case EXPR_STMT:
3410  S = new (Context) StmtExpr(Empty);
3411  break;
3412 
3413  case EXPR_CHOOSE:
3414  S = new (Context) ChooseExpr(Empty);
3415  break;
3416 
3417  case EXPR_GNU_NULL:
3418  S = new (Context) GNUNullExpr(Empty);
3419  break;
3420 
3421  case EXPR_SHUFFLE_VECTOR:
3422  S = new (Context) ShuffleVectorExpr(Empty);
3423  break;
3424 
3425  case EXPR_CONVERT_VECTOR:
3426  S = new (Context) ConvertVectorExpr(Empty);
3427  break;
3428 
3429  case EXPR_BLOCK:
3430  S = new (Context) BlockExpr(Empty);
3431  break;
3432 
3434  S = new (Context) GenericSelectionExpr(Empty);
3435  break;
3436 
3438  S = new (Context) ObjCStringLiteral(Empty);
3439  break;
3440 
3442  S = new (Context) ObjCBoxedExpr(Empty);
3443  break;
3444 
3446  S = ObjCArrayLiteral::CreateEmpty(Context,
3447  Record[ASTStmtReader::NumExprFields]);
3448  break;
3449 
3452  Record[ASTStmtReader::NumExprFields],
3453  Record[ASTStmtReader::NumExprFields + 1]);
3454  break;
3455 
3456  case EXPR_OBJC_ENCODE:
3457  S = new (Context) ObjCEncodeExpr(Empty);
3458  break;
3459 
3461  S = new (Context) ObjCSelectorExpr(Empty);
3462  break;
3463 
3465  S = new (Context) ObjCProtocolExpr(Empty);
3466  break;
3467 
3469  S = new (Context) ObjCIvarRefExpr(Empty);
3470  break;
3471 
3473  S = new (Context) ObjCPropertyRefExpr(Empty);
3474  break;
3475 
3477  S = new (Context) ObjCSubscriptRefExpr(Empty);
3478  break;
3479 
3481  llvm_unreachable("mismatching AST file");
3482 
3484  S = ObjCMessageExpr::CreateEmpty(Context,
3485  Record[ASTStmtReader::NumExprFields],
3486  Record[ASTStmtReader::NumExprFields + 1]);
3487  break;
3488 
3489  case EXPR_OBJC_ISA:
3490  S = new (Context) ObjCIsaExpr(Empty);
3491  break;
3492 
3494  S = new (Context) ObjCIndirectCopyRestoreExpr(Empty);
3495  break;
3496 
3498  S = new (Context) ObjCBridgedCastExpr(Empty);
3499  break;
3500 
3502  S = new (Context) ObjCForCollectionStmt(Empty);
3503  break;
3504 
3505  case STMT_OBJC_CATCH:
3506  S = new (Context) ObjCAtCatchStmt(Empty);
3507  break;
3508 
3509  case STMT_OBJC_FINALLY:
3510  S = new (Context) ObjCAtFinallyStmt(Empty);
3511  break;
3512 
3513  case STMT_OBJC_AT_TRY:
3514  S = ObjCAtTryStmt::CreateEmpty(Context,
3515  Record[ASTStmtReader::NumStmtFields],
3516  Record[ASTStmtReader::NumStmtFields + 1]);
3517  break;
3518 
3520  S = new (Context) ObjCAtSynchronizedStmt(Empty);
3521  break;
3522 
3523  case STMT_OBJC_AT_THROW:
3524  S = new (Context) ObjCAtThrowStmt(Empty);
3525  break;
3526 
3528  S = new (Context) ObjCAutoreleasePoolStmt(Empty);
3529  break;
3530 
3532  S = new (Context) ObjCBoolLiteralExpr(Empty);
3533  break;
3534 
3536  S = new (Context) ObjCAvailabilityCheckExpr(Empty);
3537  break;
3538 
3539  case STMT_SEH_LEAVE:
3540  S = new (Context) SEHLeaveStmt(Empty);
3541  break;
3542 
3543  case STMT_SEH_EXCEPT:
3544  S = new (Context) SEHExceptStmt(Empty);
3545  break;
3546 
3547  case STMT_SEH_FINALLY:
3548  S = new (Context) SEHFinallyStmt(Empty);
3549  break;
3550 
3551  case STMT_SEH_TRY:
3552  S = new (Context) SEHTryStmt(Empty);
3553  break;
3554 
3555  case STMT_CXX_CATCH:
3556  S = new (Context) CXXCatchStmt(Empty);
3557  break;
3558 
3559  case STMT_CXX_TRY:
3560  S = CXXTryStmt::Create(Context, Empty,
3561  /*NumHandlers=*/Record[ASTStmtReader::NumStmtFields]);
3562  break;
3563 
3564  case STMT_CXX_FOR_RANGE:
3565  S = new (Context) CXXForRangeStmt(Empty);
3566  break;
3567 
3569  S = new (Context) MSDependentExistsStmt(SourceLocation(), true,
3572  nullptr);
3573  break;
3574 
3576  S =
3578  Record[ASTStmtReader::NumStmtFields],
3579  Empty);
3580  break;
3581 
3582  case STMT_OMP_SIMD_DIRECTIVE: {
3583  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3584  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3585  S = OMPSimdDirective::CreateEmpty(Context, NumClauses,
3586  CollapsedNum, Empty);
3587  break;
3588  }
3589 
3590  case STMT_OMP_FOR_DIRECTIVE: {
3591  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3592  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3593  S = OMPForDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3594  Empty);
3595  break;
3596  }
3597 
3599  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3600  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3601  S = OMPForSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3602  Empty);
3603  break;
3604  }
3605 
3608  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3609  break;
3610 
3612  S = OMPSectionDirective::CreateEmpty(Context, Empty);
3613  break;
3614 
3617  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3618  break;
3619 
3621  S = OMPMasterDirective::CreateEmpty(Context, Empty);
3622  break;
3623 
3626  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3627  break;
3628 
3630  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3631  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3632  S = OMPParallelForDirective::CreateEmpty(Context, NumClauses,
3633  CollapsedNum, Empty);
3634  break;
3635  }
3636 
3638  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3639  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3640  S = OMPParallelForSimdDirective::CreateEmpty(Context, NumClauses,
3641  CollapsedNum, Empty);
3642  break;
3643  }
3644 
3647  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3648  break;
3649 
3652  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3653  break;
3654 
3656  S = OMPTaskyieldDirective::CreateEmpty(Context, Empty);
3657  break;
3658 
3660  S = OMPBarrierDirective::CreateEmpty(Context, Empty);
3661  break;
3662 
3664  S = OMPTaskwaitDirective::CreateEmpty(Context, Empty);
3665  break;
3666 
3669  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3670  break;
3671 
3674  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3675  break;
3676 
3679  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3680  break;
3681 
3684  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3685  break;
3686 
3689  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3690  break;
3691 
3694  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3695  break;
3696 
3699  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3700  break;
3701 
3704  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3705  break;
3706 
3709  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3710  break;
3711 
3713  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3714  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3715  S = OMPTargetParallelForDirective::CreateEmpty(Context, NumClauses,
3716  CollapsedNum, Empty);
3717  break;
3718  }
3719 
3722  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3723  break;
3724 
3727  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3728  break;
3729 
3731  S = OMPCancellationPointDirective::CreateEmpty(Context, Empty);
3732  break;
3733 
3736  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3737  break;
3738 
3740  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3741  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3742  S = OMPTaskLoopDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3743  Empty);
3744  break;
3745  }
3746 
3748  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3749  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3750  S = OMPTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
3751  CollapsedNum, Empty);
3752  break;
3753  }
3754 
3756  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3757  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3758  S = OMPDistributeDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3759  Empty);
3760  break;
3761  }
3762 
3764  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3765  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3766  S = OMPDistributeParallelForDirective::CreateEmpty(Context, NumClauses,
3767  CollapsedNum, Empty);
3768  break;
3769  }
3770 
3772  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3773  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3775  CollapsedNum,
3776  Empty);
3777  break;
3778  }
3779 
3781  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3782  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3783  S = OMPDistributeSimdDirective::CreateEmpty(Context, NumClauses,
3784  CollapsedNum, Empty);
3785  break;
3786  }
3787 
3789  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3790  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3791  S = OMPTargetParallelForSimdDirective::CreateEmpty(Context, NumClauses,
3792  CollapsedNum, Empty);
3793  break;
3794  }
3795 
3797  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3798  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3799  S = OMPTargetSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3800  Empty);
3801  break;
3802  }
3803 
3805  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3806  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3807  S = OMPTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
3808  CollapsedNum, Empty);
3809  break;
3810  }
3811 
3813  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3814  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3815  S = OMPTeamsDistributeSimdDirective::CreateEmpty(Context, NumClauses,
3816  CollapsedNum, Empty);
3817  break;
3818  }
3819 
3821  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3822  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3824  Context, NumClauses, CollapsedNum, Empty);
3825  break;
3826  }
3827 
3829  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3830  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3832  Context, NumClauses, CollapsedNum, Empty);
3833  break;
3834  }
3835 
3838  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3839  break;
3840 
3842  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3843  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3844  S = OMPTargetTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
3845  CollapsedNum, Empty);
3846  break;
3847  }
3848 
3850  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3851  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3853  Context, NumClauses, CollapsedNum, Empty);
3854  break;
3855  }
3856 
3858  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3859  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3861  Context, NumClauses, CollapsedNum, Empty);
3862  break;
3863  }
3864 
3866  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3867  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3869  Context, NumClauses, CollapsedNum, Empty);
3870  break;
3871  }
3872 
3874  S = new (Context) CXXOperatorCallExpr(Context, Empty);
3875  break;
3876 
3877  case EXPR_CXX_MEMBER_CALL:
3878  S = new (Context) CXXMemberCallExpr(Context, Empty);
3879  break;
3880 
3881  case EXPR_CXX_CONSTRUCT:
3882  S = new (Context) CXXConstructExpr(Empty);
3883  break;
3884 
3886  S = new (Context) CXXInheritedCtorInitExpr(Empty);
3887  break;
3888 
3890  S = new (Context) CXXTemporaryObjectExpr(Empty);
3891  break;
3892 
3893  case EXPR_CXX_STATIC_CAST:
3894  S = CXXStaticCastExpr::CreateEmpty(Context,
3895  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3896  break;
3897 
3898  case EXPR_CXX_DYNAMIC_CAST:
3899  S = CXXDynamicCastExpr::CreateEmpty(Context,
3900  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3901  break;
3902 
3905  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3906  break;
3907 
3908  case EXPR_CXX_CONST_CAST:
3909  S = CXXConstCastExpr::CreateEmpty(Context);
3910  break;
3911 
3914  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3915  break;
3916 
3918  S = new (Context) UserDefinedLiteral(Context, Empty);
3919  break;
3920 
3922  S = new (Context) CXXStdInitializerListExpr(Empty);
3923  break;
3924 
3925  case EXPR_CXX_BOOL_LITERAL:
3926  S = new (Context) CXXBoolLiteralExpr(Empty);
3927  break;
3928 
3930  S = new (Context) CXXNullPtrLiteralExpr(Empty);
3931  break;
3932 
3933  case EXPR_CXX_TYPEID_EXPR:
3934  S = new (Context) CXXTypeidExpr(Empty, true);
3935  break;
3936 
3937  case EXPR_CXX_TYPEID_TYPE:
3938  S = new (Context) CXXTypeidExpr(Empty, false);
3939  break;
3940 
3941  case EXPR_CXX_UUIDOF_EXPR:
3942  S = new (Context) CXXUuidofExpr(Empty, true);
3943  break;
3944 
3946  S = new (Context) MSPropertyRefExpr(Empty);
3947  break;
3948 
3950  S = new (Context) MSPropertySubscriptExpr(Empty);
3951  break;
3952 
3953  case EXPR_CXX_UUIDOF_TYPE:
3954  S = new (Context) CXXUuidofExpr(Empty, false);
3955  break;
3956 
3957  case EXPR_CXX_THIS:
3958  S = new (Context) CXXThisExpr(Empty);
3959  break;
3960 
3961  case EXPR_CXX_THROW:
3962  S = new (Context) CXXThrowExpr(Empty);
3963  break;
3964 
3965  case EXPR_CXX_DEFAULT_ARG:
3966  S = new (Context) CXXDefaultArgExpr(Empty);
3967  break;
3968 
3969  case EXPR_CXX_DEFAULT_INIT:
3970  S = new (Context) CXXDefaultInitExpr(Empty);
3971  break;
3972 
3974  S = new (Context) CXXBindTemporaryExpr(Empty);
3975  break;
3976 
3978  S = new (Context) CXXScalarValueInitExpr(Empty);
3979  break;
3980 
3981  case EXPR_CXX_NEW:
3982  S = new (Context) CXXNewExpr(Empty);
3983  break;
3984 
3985  case EXPR_CXX_DELETE:
3986  S = new (Context) CXXDeleteExpr(Empty);
3987  break;
3988 
3990  S = new (Context) CXXPseudoDestructorExpr(Empty);
3991  break;
3992 
3994  S = ExprWithCleanups::Create(Context, Empty,
3995  Record[ASTStmtReader::NumExprFields]);
3996  break;
3997 
4000  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields],
4001  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]
4002  ? Record[ASTStmtReader::NumExprFields + 1]
4003  : 0);
4004  break;
4005 
4008  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields],
4009  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]
4010  ? Record[ASTStmtReader::NumExprFields + 1]
4011  : 0);
4012  break;
4013 
4016  /*NumArgs=*/Record[ASTStmtReader::NumExprFields]);
4017  break;
4018 
4021  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields],
4022  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]
4023  ? Record[ASTStmtReader::NumExprFields + 1]
4024  : 0);
4025  break;
4026 
4029  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields],
4030  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]
4031  ? Record[ASTStmtReader::NumExprFields + 1]
4032  : 0);
4033  break;
4034 
4035  case EXPR_TYPE_TRAIT:
4037  Record[ASTStmtReader::NumExprFields]);
4038  break;
4039 
4040  case EXPR_ARRAY_TYPE_TRAIT:
4041  S = new (Context) ArrayTypeTraitExpr(Empty);
4042  break;
4043 
4045  S = new (Context) ExpressionTraitExpr(Empty);
4046  break;
4047 
4048  case EXPR_CXX_NOEXCEPT:
4049  S = new (Context) CXXNoexceptExpr(Empty);
4050  break;
4051 
4052  case EXPR_PACK_EXPANSION:
4053  S = new (Context) PackExpansionExpr(Empty);
4054  break;
4055 
4056  case EXPR_SIZEOF_PACK:
4058  Context,
4059  /*NumPartialArgs=*/Record[ASTStmtReader::NumExprFields]);
4060  break;
4061 
4063  S = new (Context) SubstNonTypeTemplateParmExpr(Empty);
4064  break;
4065 
4067  S = new (Context) SubstNonTypeTemplateParmPackExpr(Empty);
4068  break;
4069 
4072  Record[ASTStmtReader::NumExprFields]);
4073  break;
4074 
4076  S = new (Context) MaterializeTemporaryExpr(Empty);
4077  break;
4078 
4079  case EXPR_CXX_FOLD:
4080  S = new (Context) CXXFoldExpr(Empty);
4081  break;
4082 
4083  case EXPR_OPAQUE_VALUE:
4084  S = new (Context) OpaqueValueExpr(Empty);
4085  break;
4086 
4087  case EXPR_CUDA_KERNEL_CALL:
4088  S = new (Context) CUDAKernelCallExpr(Context, Empty);
4089  break;
4090 
4091  case EXPR_ASTYPE:
4092  S = new (Context) AsTypeExpr(Empty);
4093  break;
4094 
4095  case EXPR_PSEUDO_OBJECT: {
4096  unsigned numSemanticExprs = Record[ASTStmtReader::NumExprFields];
4097  S = PseudoObjectExpr::Create(Context, Empty, numSemanticExprs);
4098  break;
4099  }
4100 
4101  case EXPR_ATOMIC:
4102  S = new (Context) AtomicExpr(Empty);
4103  break;
4104 
4105  case EXPR_LAMBDA: {
4106  unsigned NumCaptures = Record[ASTStmtReader::NumExprFields];
4107  S = LambdaExpr::CreateDeserialized(Context, NumCaptures);
4108  break;
4109  }
4110 
4111  case STMT_COROUTINE_BODY: {
4112  unsigned NumParams = Record[ASTStmtReader::NumStmtFields];
4113  S = CoroutineBodyStmt::Create(Context, Empty, NumParams);
4114  break;
4115  }
4116 
4117  case STMT_CORETURN:
4118  S = new (Context) CoreturnStmt(Empty);
4119  break;
4120 
4121  case EXPR_COAWAIT:
4122  S = new (Context) CoawaitExpr(Empty);
4123  break;
4124 
4125  case EXPR_COYIELD:
4126  S = new (Context) CoyieldExpr(Empty);
4127  break;
4128 
4130  S = new (Context) DependentCoawaitExpr(Empty);
4131  break;
4132  }
4133 
4134  // We hit a STMT_STOP, so we're done with this expression.
4135  if (Finished)
4136  break;
4137 
4138  ++NumStatementsRead;
4139 
4140  if (S && !IsStmtReference) {
4141  Reader.Visit(S);
4142  StmtEntries[Cursor.GetCurrentBitNo()] = S;
4143  }
4144 
4145  assert(Record.getIdx() == Record.size() &&
4146  "Invalid deserialization of statement");
4147  StmtStack.push_back(S);
4148  }
4149 Done:
4150  assert(StmtStack.size() > PrevNumStmts && "Read too many sub-stmts!");
4151  assert(StmtStack.size() == PrevNumStmts + 1 && "Extra expressions on stack!");
4152  return StmtStack.pop_back_val();
4153 }
void setPreInits(Stmt *PreInits)
Definition: StmtOpenMP.h:492
static AttributedStmt * CreateEmpty(const ASTContext &C, unsigned NumAttrs)
Definition: Stmt.cpp:346
void setFPFeatures(FPOptions F)
Definition: Expr.h:3235
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:577
A PredefinedExpr record.
Definition: ASTBitCodes.h:1614
const uint64_t & readInt()
Returns the current value in this record, and advances to the next value.
Definition: ASTReader.h:2376
A call to an overloaded operator written using operator syntax.
Definition: ExprCXX.h:78
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
Definition: ExprObjC.h:1517
The receiver is the instance of the superclass object.
Definition: ExprObjC.h:1060
Represents a single C99 designator.
Definition: Expr.h:4261
void setThen(Stmt *S)
Definition: Stmt.h:988
void setConditionVariable(const ASTContext &C, VarDecl *V)
Definition: Stmt.cpp:847
static OMPDependClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
void setValueDependent(bool VD)
Set whether this expression is value-dependent or not.
Definition: Expr.h:152
Defines the clang::ASTContext interface.
void setRParenLoc(SourceLocation L)
Definition: ExprCXX.h:1505
A CompoundLiteralExpr record.
Definition: ASTBitCodes.h:1674
This represents &#39;#pragma omp distribute simd&#39; composite directive.
Definition: StmtOpenMP.h:3212
This represents &#39;#pragma omp master&#39; directive.
Definition: StmtOpenMP.h:1395
DesignatorTypes
The kinds of designators that can occur in a DesignatedInitExpr.
Definition: ASTBitCodes.h:1967
void setRangeStmt(Stmt *S)
Definition: StmtCXX.h:185
SourceLocation readSourceLocation()
Read a source location, advancing Idx.
Definition: ASTReader.h:2568
The null pointer literal (C++11 [lex.nullptr])
Definition: ExprCXX.h:565
This represents &#39;#pragma omp task&#39; directive.
Definition: StmtOpenMP.h:1735
void setEnsureUpperBound(Expr *EUB)
Definition: StmtOpenMP.h:523
This represents a GCC inline-assembly statement extension.
Definition: Stmt.h:1636
Represents a &#39;co_await&#39; expression while the type of the promise is dependent.
Definition: ExprCXX.h:4344
void setSubStmt(CompoundStmt *S)
Definition: Expr.h:3586
This represents &#39;thread_limit&#39; clause in the &#39;#pragma omp ...&#39; directive.
The receiver is an object instance.
Definition: ExprObjC.h:1054
unsigned getNumInputs() const
Definition: Stmt.h:1552
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:1590
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:2244
An AddrLabelExpr record.
Definition: ASTBitCodes.h:1704
void setInc(Expr *E)
Definition: StmtCXX.h:189
void setOperatorLoc(SourceLocation L)
Definition: Expr.h:2173
static StringLiteral * CreateEmpty(const ASTContext &C, unsigned NumStrs)
Construct an empty string literal.
Definition: Expr.cpp:909
void setRawSemantics(APFloatSemantics Sem)
Set the raw enumeration value representing the floating-point semantics of this literal (32-bit IEEE...
Definition: Expr.h:1478
void setNRVOCandidate(const VarDecl *Var)
Definition: Stmt.h:1461
Defines enumerations for the type traits support.
void setLocation(SourceLocation L)
Definition: ExprCXX.h:550
A CXXStaticCastExpr record.
Definition: ASTBitCodes.h:1826
ASTStmtReader(ASTRecordReader &Record, llvm::BitstreamCursor &Cursor)
void setCombinedCond(Expr *CombCond)
Definition: StmtOpenMP.h:591
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2342
An AttributedStmt record.
Definition: ASTBitCodes.h:1569
void setCond(Expr *E)
Definition: Stmt.h:1149
A CXXReinterpretCastExpr record.
Definition: ASTBitCodes.h:1832
An ObjCBoolLiteralExpr record.
Definition: ASTBitCodes.h:1794
void setCombinedLowerBoundVariable(Expr *CombLB)
Definition: StmtOpenMP.h:571
void setRHS(Expr *E)
Definition: Expr.h:2234
static OMPTaskwaitDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:519
static OMPTargetParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:715
void setHasCancel(bool Has)
Set cancel state.
Definition: StmtOpenMP.h:1322
void setUniqueDecls(ArrayRef< ValueDecl *> UDs)
Set the unique declarations that are in the trailing objects of the class.
Represents a &#39;co_return&#39; statement in the C++ Coroutines TS.
Definition: StmtCXX.h:432
Stmt - This represents one statement.
Definition: Stmt.h:66
static OMPTaskgroupDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:540
void setLastIteration(Expr *LI)
Definition: StmtOpenMP.h:478
This represents clause &#39;in_reduction&#39; in the &#39;#pragma omp task&#39; directives.
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition: Expr.h:2340
IfStmt - This represents an if/then/else.
Definition: Stmt.h:949
Class that handles pre-initialization statement for some clauses, like &#39;shedule&#39;, &#39;firstprivate&#39; etc...
Definition: OpenMPClause.h:99
void setPrivateCounters(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:32
void setArrow(bool A)
Definition: ExprObjC.h:1465
C Language Family Type Representation.
unsigned getNumOutputs() const
Definition: Stmt.h:1530
This represents &#39;#pragma omp for simd&#39; directive.
Definition: StmtOpenMP.h:1145
void setRParenLoc(SourceLocation L)
Definition: Stmt.h:1658
void setContinueLoc(SourceLocation L)
Definition: Stmt.h:1381
void setThrowExpr(Stmt *S)
Definition: StmtObjC.h:327
void setAtLoc(SourceLocation L)
Definition: ExprObjC.h:447
An ImplicitValueInitExpr record.
Definition: ASTBitCodes.h:1698
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:521
This represents &#39;grainsize&#39; clause in the &#39;#pragma omp ...&#39; directive.
An ImplicitCastExpr record.
Definition: ASTBitCodes.h:1668
This represents &#39;#pragma omp teams distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:3623
void setLParenLoc(SourceLocation Loc)
Sets the location of &#39;(&#39;.
void setRBracket(SourceLocation RB)
Definition: ExprObjC.h:839
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Definition: Expr.h:4625
LambdaCaptureDefault
The default, if any, capture method for a lambda expression.
Definition: Lambda.h:23
void setType(QualType t)
Definition: Expr.h:129
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:2739
This represents &#39;if&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:240
Defines the C++ template declaration subclasses.
void setPrevEnsureUpperBound(Expr *PrevEUB)
Definition: StmtOpenMP.h:566
unsigned getNumSubExprs() const
Retrieve the total number of subexpressions in this designated initializer expression, including the actual initialized value and any expressions that occur within array and array-range designators.
Definition: Expr.h:4432
Represents an attribute applied to a statement.
Definition: Stmt.h:897
void setUpperBoundVariable(Expr *UB)
Definition: StmtOpenMP.h:509
void setComputationResultType(QualType T)
Definition: Expr.h:3298
llvm::APFloat readAPFloat(const llvm::fltSemantics &Sem)
Read a floating-point value, advancing Idx.
Definition: ASTReader.h:2588
void setNumIterations(Expr *NI)
Definition: StmtOpenMP.h:544
static OMPMapClause * CreateEmpty(const ASTContext &C, unsigned NumVars, unsigned NumUniqueDeclarations, unsigned NumComponentLists, unsigned NumComponents)
Creates an empty clause with the place for NumVars original expressions, NumUniqueDeclarations declar...
ParenExpr - This represents a parethesized expression, e.g.
Definition: Expr.h:1730
A CXXOperatorCallExpr record.
Definition: ASTBitCodes.h:1811
void setSuper(SourceLocation Loc, QualType T, bool IsInstanceSuper)
Definition: ExprObjC.h:1289
This represents &#39;priority&#39; clause in the &#39;#pragma omp ...&#39; directive.
This represents &#39;#pragma omp target teams distribute&#39; combined directive.
Definition: StmtOpenMP.h:3760
A CXXTemporaryObjectExpr record.
Definition: ASTBitCodes.h:1823
Represents Objective-C&#39;s @throw statement.
Definition: StmtObjC.h:313
void setCond(Expr *E)
Definition: Stmt.h:1194
void setLParenLoc(SourceLocation Loc)
Sets the location of &#39;(&#39;.
Definition: OpenMPClause.h:717
void setNextLowerBound(Expr *NLB)
Definition: StmtOpenMP.h:530
DeclRefExprBitfields DeclRefExprBits
Definition: Stmt.h:302
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1239
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:802
unsigned NumOutputs
Definition: Stmt.h:1495
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent...
Definition: ExprCXX.h:2426
void setValue(bool V)
Definition: ExprObjC.h:95
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
Definition: Specifiers.h: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:1076
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:1823
void setInstanceReceiver(Expr *rec)
Turn this message send into an instance message that computes the receiver object with the given expr...
Definition: ExprObjC.h:1218
Floating point control options.
Definition: LangOptions.h:263
This represents &#39;#pragma omp parallel for&#39; directive.
Definition: StmtOpenMP.h:1516
MS property subscript expression.
Definition: ExprCXX.h:797
void setStartLoc(SourceLocation L)
Definition: Stmt.h:524
void setForLoc(SourceLocation L)
Definition: Stmt.h:1271
void setLParenLoc(SourceLocation Loc)
Sets the location of &#39;(&#39;.
Definition: OpenMPClause.h:584
This represents &#39;#pragma omp target teams distribute parallel for&#39; combined directive.
Definition: StmtOpenMP.h:3828
void setLocation(SourceLocation Loc)
Definition: ExprCXX.h:1305
static ObjCDictionaryLiteral * CreateEmpty(const ASTContext &C, unsigned NumElements, bool HasPackExpansions)
Definition: ExprObjC.cpp:105
void setConditionVariable(const ASTContext &C, VarDecl *V)
Definition: Stmt.cpp:909
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
Definition: ExprCXX.h:4039
void setLParenLoc(SourceLocation Loc)
Sets the location of &#39;(&#39;.
Definition: OpenMPClause.h:529
void setLocation(SourceLocation L)
Definition: ExprObjC.h:557
void setDelegateInitCall(bool isDelegate)
Definition: ExprObjC.h:1360
void setProtocol(ObjCProtocolDecl *P)
Definition: ExprObjC.h:491
void setRParenLoc(SourceLocation L)
Definition: ExprCXX.h:3142
static OMPReductionClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
void setIsLastIterVariable(Expr *IL)
Definition: StmtOpenMP.h:495
void setLParenLoc(SourceLocation Loc)
Sets the location of &#39;(&#39;.
Definition: OpenMPClause.h:954
This represents &#39;#pragma omp target exit data&#39; directive.
Definition: StmtOpenMP.h:2427
void setRAngleLoc(SourceLocation Loc)
Definition: TemplateBase.h:566
static OffsetOfExpr * CreateEmpty(const ASTContext &C, unsigned NumComps, unsigned NumExprs)
Definition: Expr.cpp:1389
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:1104
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC &#39;id&#39; type.
Definition: ExprObjC.h:1436
This represents &#39;num_threads&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:382
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:2715
void setSubExpr(unsigned Idx, Expr *E)
Definition: Expr.h:4439
void setInitializer(Expr *E)
Definition: Expr.h:2743
void setLength(Expr *E)
Set length of the array section.
Definition: ExprOpenMP.h:102
void setOpLoc(SourceLocation L)
Definition: ExprObjC.h:1473
void recordSwitchCaseID(SwitchCase *SC, unsigned ID)
Definition: ASTReader.h:2617
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
Definition: ExprCXX.h:2391
This represents &#39;defaultmap&#39; clause in the &#39;#pragma omp ...&#39; directive.
static FunctionParmPackExpr * CreateEmpty(const ASTContext &Context, unsigned NumParams)
Definition: ExprCXX.cpp:1366
void setInit(Stmt *S)
Definition: Stmt.h:984
void setAsmLoc(SourceLocation L)
Definition: Stmt.h:1512
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:2467
void setValue(unsigned Val)
Definition: Expr.h:1433
void setLocation(SourceLocation Location)
Definition: Expr.h:1378
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
Definition: TemplateBase.h:595
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition: ExprCXX.h:594
static DeclRefExpr * CreateEmpty(const ASTContext &Context, bool HasQualifier, bool HasFoundDecl, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Construct an empty declaration reference expression.
Definition: Expr.cpp:435
void setGNUSyntax(bool GNU)
Definition: Expr.h:4417
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:1817
unsigned getNumExpressions() const
Definition: Expr.h:2078
void setBeginStmt(Stmt *S)
Definition: StmtCXX.h:186
void setBase(Expr *E)
Set base of the array section.
Definition: ExprOpenMP.h:85
ReceiverKind
The kind of receiver this message is sending to.
Definition: ExprObjC.h:1049
raw_arg_iterator raw_arg_begin()
Definition: ExprCXX.h:2041
void initializeResults(const ASTContext &C, UnresolvedSetIterator Begin, UnresolvedSetIterator End)
Definition: ExprCXX.cpp:366
A C++ throw-expression (C++ [except.throw]).
Definition: ExprCXX.h:985
unsigned getTotalComponentsNum() const
Return the total number of components in all lists derived from the clause.
Represents an expression – generally a full-expression – that introduces cleanups to be run at the ...
Definition: ExprCXX.h:3003
Represents a parameter to a function.
Definition: Decl.h:1533
void setInit(Expr *Init)
Definition: StmtOpenMP.h:490
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:1350
A ShuffleVectorExpr record.
Definition: ASTBitCodes.h:1716
This represents &#39;safelen&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:447
A C++ static_cast expression (C++ [expr.static.cast]).
Definition: ExprCXX.h:302
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:858
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:1688
void setAtLoc(SourceLocation L)
Definition: ExprObjC.h:68
Represents a C99 designated initializer expression.
Definition: Expr.h:4186
unsigned varlist_size() const
Definition: OpenMPClause.h:204
An OffsetOfExpr record.
Definition: ASTBitCodes.h:1644
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:2522
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:1788
T * readDeclAs()
Reads a declaration from the given position in the record, advancing Idx.
Definition: ASTReader.h:2490
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:1807
A DesignatedInitExpr record.
Definition: ASTBitCodes.h:1683
This represents &#39;#pragma omp parallel&#39; directive.
Definition: StmtOpenMP.h:274
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition: Expr.h:3613
void setExprOperand(Expr *E)
Definition: ExprCXX.h:907
void setInit(Stmt *S)
Definition: Stmt.h:1064
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:2230
static OMPTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:953
Internal struct for storing Key/value pair.
Definition: ExprObjC.h:268
void setKeyExpr(Stmt *S)
Definition: ExprObjC.h:851
static OMPTargetParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:763
static ObjCMessageExpr * CreateEmpty(const ASTContext &Context, unsigned NumArgs, unsigned NumStoredSelLocs)
Create an empty Objective-C message expression, to be filled in by subsequent calls.
Definition: ExprObjC.cpp:264
This represents clause &#39;lastprivate&#39; in the &#39;#pragma omp ...&#39; directives.
void setIsMicrosoftABI(bool IsMS)
Definition: Expr.h:3882
Represents a place-holder for an object not to be initialized by anything.
Definition: Expr.h:4480
void setNumArgs(const ASTContext &C, unsigned NumArgs)
setNumArgs - This changes the number of arguments present in this call.
Definition: Expr.cpp:1282
void setRequiresZeroInitialization(bool ZeroInit)
Definition: ExprCXX.h:1330
static OMPFlushDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:608
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Definition: Expr.h:3824
This represents clause &#39;map&#39; in the &#39;#pragma omp ...&#39; directives.
void setLParenLoc(SourceLocation Loc)
Sets the location of &#39;(&#39;.
void setArg(unsigned I, Expr *E)
Definition: ExprCXX.h:3174
void setArg(unsigned Arg, Expr *ArgExpr)
setArg - Set the specified argument.
Definition: Expr.h:2362
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:1759
TemplateArgument readTemplateArgument(bool Canonicalize=false)
Read a template argument, advancing Idx.
Definition: ASTReader.h:2532
This represents &#39;#pragma omp target simd&#39; directive.
Definition: StmtOpenMP.h:3348
void setCapturedDecl(CapturedDecl *D)
Set the outlined function declaration.
Definition: Stmt.cpp:1109
void setReturnLoc(SourceLocation L)
Definition: Stmt.h:1453
Represents a C++ member access expression for which lookup produced a set of overloaded functions...
Definition: ExprCXX.h:3442
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:4870
OpenMPDirectiveKind getDirectiveKind() const
Definition: StmtOpenMP.h:244
void VisitOMPClauseWithPostUpdate(OMPClauseWithPostUpdate *C)
This represents &#39;#pragma omp barrier&#39; directive.
Definition: StmtOpenMP.h:1847
void setComponent(unsigned Idx, OffsetOfNode ON)
Definition: Expr.h:2054
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp, [NSNumber numberWithInt:42]];.
Definition: ExprObjC.h:171
TypeSourceInfo * getTypeSourceInfo()
Reads a declarator info from the given record, advancing Idx.
Definition: ASTReader.h:2457
This is a common base class for loop directives (&#39;omp simd&#39;, &#39;omp for&#39;, &#39;omp for simd&#39; etc...
Definition: StmtOpenMP.h:336
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition: ExprCXX.h:3897
void setSubStmt(Stmt *S)
Definition: Stmt.h:794
void setLParenLoc(SourceLocation Loc)
Sets the location of &#39;(&#39;.
This represents &#39;#pragma omp critical&#39; directive.
Definition: StmtOpenMP.h:1442
for(const auto &A :T->param_types())
static OMPCriticalDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:325
void setRParenLoc(SourceLocation L)
Definition: Expr.h:3594
void setCond(Expr *Cond)
Definition: StmtOpenMP.h:487
size_t size() const
The length of this record.
Definition: ASTReader.h:2366
Represents Objective-C&#39;s @catch statement.
Definition: StmtObjC.h:74
void setBody(Stmt *S)
Definition: Stmt.h:1072
void setLBraceLoc(SourceLocation Loc)
Definition: Expr.h:4098
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:1328
Describes an C or C++ initializer list.
Definition: Expr.h:3952
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition: ExprCXX.h:638
This represents &#39;#pragma omp distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:3063
void setValue(const ASTContext &C, const llvm::APInt &Val)
Definition: Expr.h:1296
This represents &#39;#pragma omp teams distribute parallel for simd&#39; composite directive.
Definition: StmtOpenMP.h:3552
void setBuiltinLoc(SourceLocation L)
Definition: Expr.h:3632
BinaryOperatorKind
void setSubExpr(Expr *E)
Definition: Expr.h:1748
void setLHS(Expr *E)
Definition: Expr.h:3792
ForStmt - This represents a &#39;for (init;cond;inc)&#39; stmt.
Definition: Stmt.h:1223
void setOperatorNew(FunctionDecl *D)
Definition: ExprCXX.h:1946
static DeclAccessPair make(NamedDecl *D, AccessSpecifier AS)
void setLocation(SourceLocation L)
Definition: ExprCXX.h:581
void setCond(Expr *E)
Definition: Stmt.h:1070
static OMPDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setSynchBody(Stmt *S)
Definition: StmtObjC.h:288
static OMPIsDevicePtrClause * CreateEmpty(const ASTContext &C, unsigned NumVars, unsigned NumUniqueDeclarations, unsigned NumComponentLists, unsigned NumComponents)
Creates an empty clause with the place for NumVars variables.
A convenient class for passing around template argument information.
Definition: TemplateBase.h:546
static OMPInReductionClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
void setSelector(Selector S)
Definition: ExprObjC.h:443
A reference to a previously [de]serialized Stmt record.
Definition: ASTBitCodes.h:1551
void setEndLoc(SourceLocation L)
Definition: Stmt.h:526
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
Definition: ExprCXX.h:1728
path_iterator path_begin()
Definition: Expr.h:2857
void setLocation(SourceLocation L)
Definition: ExprObjC.h:101
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3065
void setLParenLoc(SourceLocation Loc)
Sets the location of &#39;(&#39;.
Definition: OpenMPClause.h:647
static OMPTargetTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setAccessor(IdentifierInfo *II)
Definition: Expr.h:4893
static OMPToClause * CreateEmpty(const ASTContext &C, unsigned NumVars, unsigned NumUniqueDeclarations, unsigned NumComponentLists, unsigned NumComponents)
Creates an empty clause with the place for NumVars variables.
CXXForRangeStmt - This represents C++0x [stmt.ranged]&#39;s ranged for statement, represented as &#39;for (ra...
Definition: StmtCXX.h:128
Class that handles post-update expression for some clauses, like &#39;lastprivate&#39;, &#39;reduction&#39; etc...
Definition: OpenMPClause.h:135
SourceRange readSourceRange()
Read a source range, advancing Idx.
Definition: ASTReader.h:2573
static const unsigned NumStmtFields
The number of record fields required for the Stmt class itself.
This represents &#39;#pragma omp cancellation point&#39; directive.
Definition: StmtOpenMP.h:2682
void setString(StringLiteral *S)
Definition: ExprObjC.h:65
void setAsmString(StringLiteral *E)
Definition: Stmt.h:1664
This represents &#39;default&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:606
ObjCStringLiteral, used for Objective-C string literals i.e.
Definition: ExprObjC.h:51
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
Definition: Expr.h:5312
This represents &#39;final&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:330
This represents &#39;mergeable&#39; clause in the &#39;#pragma omp ...&#39; directive.
void setCombinedInit(Expr *CombInit)
Definition: StmtOpenMP.h:586
void setListInitialization(bool V)
Definition: ExprCXX.h:1318
void setLHS(Expr *Val)
Definition: Stmt.h:795
This represents &#39;#pragma omp teams&#39; directive.
Definition: StmtOpenMP.h:2625
void setOperatorLoc(SourceLocation L)
Definition: Expr.h:2036
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:2788
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:1152
Helper class for OffsetOfExpr.
Definition: Expr.h:1896
A marker record that indicates that we are at the end of an expression.
Definition: ASTBitCodes.h:1545
This represents &#39;#pragma omp teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:3482
static OMPTargetParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Represents binding an expression to a temporary.
Definition: ExprCXX.h:1196
void setDestroyedType(IdentifierInfo *II, SourceLocation Loc)
Set the name of destroyed type for a dependent pseudo-destructor expression.
Definition: ExprCXX.h:2314
ArrayTypeTrait
Names for the array type traits.
Definition: TypeTraits.h:91
bool isOpenMPWorksharingDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a worksharing directive.
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition: ExprCXX.h:1583
static OMPTaskyieldDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:491
void setCond(Expr *E)
Definition: Stmt.h:1266
static IntegerLiteral * Create(const ASTContext &C, const llvm::APInt &V, QualType type, SourceLocation l)
Returns a new integer literal with value &#39;V&#39; and type &#39;type&#39;.
Definition: Expr.cpp:748
void ReadTemplateKWAndArgsInfo(ASTTemplateKWAndArgsInfo &Args, TemplateArgumentLoc *ArgsLocArray, unsigned NumTemplateArgs)
Read and initialize a ExplicitTemplateArgumentList structure.
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3205
This represents clause &#39;is_device_ptr&#39; in the &#39;#pragma omp ...&#39; directives.
void setRParenLoc(SourceLocation Loc)
Definition: StmtObjC.h:56
CXXBaseSpecifier readCXXBaseSpecifier()
Read a C++ base specifier, advancing Idx.
Definition: ASTReader.h:2554
unsigned getUniqueDeclarationsNum() const
Return the number of unique base declarations in this clause.
void setRParenLoc(SourceLocation R)
Definition: Expr.h:2040
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1042
bool isTypeOperand() const
Definition: ExprCXX.h:885
const uint64_t & peekInt()
Returns the current value in this record, without advancing.
Definition: ASTReader.h:2379
void setSourceRange(SourceRange R)
Definition: ExprCXX.h:918
unsigned NumClobbers
Definition: Stmt.h:1497
void setRParenLoc(SourceLocation L)
Definition: Expr.h:3032
This represents clause &#39;from&#39; in the &#39;#pragma omp ...&#39; directives.
Represents the this expression in C++.
Definition: ExprCXX.h:945
void setCastKind(CastKind K)
Definition: Expr.h:2836
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
Definition: TemplateBase.h:638
static OMPTargetDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:787
static OMPTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setEqualOrColonLoc(SourceLocation L)
Definition: Expr.h:4412
This represents &#39;#pragma omp target parallel for simd&#39; directive.
Definition: StmtOpenMP.h:3280
void setArgument(Expr *E)
Definition: Expr.h:2157
OpenMP 4.0 [2.4, Array Sections].
Definition: ExprOpenMP.h:45
void setTypeSourceInfo(TypeSourceInfo *tsi)
Definition: Expr.h:2045
ConditionalOperator - The ?: ternary operator.
Definition: Expr.h:3349
static OMPTargetSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition: ExprCXX.h:2200
void setAmpAmpLoc(SourceLocation L)
Definition: Expr.h:3539
void setBreakLoc(SourceLocation L)
Definition: Stmt.h:1410
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
Definition: ExprCXX.h:3578
void setFPFeatures(FPOptions F)
Definition: ExprCXX.h:145
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:609
void setBlockDecl(BlockDecl *BD)
Definition: Expr.h:4947
This represents &#39;threads&#39; clause in the &#39;#pragma omp ...&#39; directive.
This represents &#39;#pragma omp taskgroup&#39; directive.
Definition: StmtOpenMP.h:1935
static OMPSingleDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:282
CastKind
CastKind - The kind of operation required for a conversion.
void setSemiLoc(SourceLocation L)
Definition: Stmt.h:592
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:1810
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
Definition: Expr.h:2105
void setLocEnd(SourceLocation Loc)
Sets the ending location of the clause.
Definition: OpenMPClause.h:76
void setLParen(SourceLocation Loc)
Definition: Expr.h:1755
This represents clause &#39;task_reduction&#39; in the &#39;#pragma omp taskgroup&#39; directives.
Represents a call to the builtin function __builtin_va_arg.
Definition: Expr.h:3858
static OMPTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:856
void setLeaveLoc(SourceLocation L)
Definition: Stmt.h:2046
This represents &#39;#pragma omp distribute&#39; directive.
Definition: StmtOpenMP.h:2936
This represents implicit clause &#39;depend&#39; for the &#39;#pragma omp task&#39; directive.
void setString(const ASTContext &C, StringRef Str, StringKind Kind, bool IsPascal)
Sets the string data to the given string data.
Definition: Expr.cpp:1018
void setInits(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:39
void setOperatorDelete(FunctionDecl *D)
Definition: ExprCXX.h:1948
void setRParenLoc(SourceLocation L)
Definition: Stmt.h:1205
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type...
Definition: ExprCXX.h:1805
void setLocation(SourceLocation Location)
Definition: Expr.h:1431
void setRParenLoc(SourceLocation Loc)
Definition: StmtObjC.h:105
Pepresents a block literal declaration, which is like an unnamed FunctionDecl.
Definition: Decl.h:3838
This represents &#39;proc_bind&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:675
static OMPSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:111
This represents &#39;capture&#39; clause in the &#39;#pragma omp atomic&#39; directive.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:636
Expr - This represents one expression.
Definition: Expr.h:106
Defines the clang::LangOptions interface.
void setDesignators(const ASTContext &C, const Designator *Desigs, unsigned NumDesigs)
Definition: Expr.cpp:3812
void setRBraceLoc(SourceLocation Loc)
Definition: Expr.h:4100
void setIsImplicit(bool value=true)
Definition: ExprCXX.h:4335
SourceLocation End
void setWhileLoc(SourceLocation L)
Definition: Stmt.h:1155
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
Definition: Specifiers.h:107
void setCallee(Expr *F)
Definition: Expr.h:2325
void setRParenLoc(SourceLocation L)
Definition: Expr.h:3635
const FunctionProtoType * T
This represents &#39;simdlen&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:501
void setLParenLoc(SourceLocation L)
Definition: Stmt.h:1273
void setBase(Expr *Base)
Definition: Expr.h:4536
Stmt * ReadStmt(ModuleFile &F)
Reads a statement.
void setSyntacticForm(InitListExpr *Init)
Definition: Expr.h:4113
Represents a C++ functional cast expression that builds a temporary object.
Definition: ExprCXX.h:1533
void setRBracketLoc(SourceLocation L)
Definition: ExprOpenMP.h:113
A C++ const_cast expression (C++ [expr.const.cast]).
Definition: ExprCXX.h:420
void setTypeDependent(bool TD)
Set whether this expression is type-dependent or not.
Definition: Expr.h:170
void setTypeOperandSourceInfo(TypeSourceInfo *TSI)
Definition: ExprCXX.h:897
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:4931
Field designator where only the field name is known.
Definition: ASTBitCodes.h:1969
static OMPDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Defines an enumeration for C++ overloaded operators.
This represents &#39;#pragma omp target teams distribute parallel for simd&#39; combined directive.
Definition: StmtOpenMP.h:3912
void setRHS(Expr *E)
Definition: Expr.h:3112
void setInc(Expr *E)
Definition: Stmt.h:1267
raw_arg_iterator raw_arg_end()
Definition: ExprCXX.h:2042
static CXXReinterpretCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
Definition: ExprCXX.cpp:655
#define bool
Definition: stdbool.h:31
void setUuidStr(StringRef US)
Definition: ExprCXX.h:912
void setWrittenTypeInfo(TypeSourceInfo *TI)
Definition: Expr.h:3885
void setRetValue(Expr *E)
Definition: Stmt.h:1450
void setBody(Stmt *S)
Definition: Stmt.h:1268
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
Definition: ExprObjC.h:288
void setLParenLoc(SourceLocation Loc)
Sets the location of &#39;(&#39;.
Definition: OpenMPClause.h:220
ExprBitfields ExprBits
Definition: Stmt.h:298
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:1072
Represents Objective-C&#39;s @synchronized statement.
Definition: StmtObjC.h:262
ObjCSelectorExpr used for @selector in Objective-C.
Definition: ExprObjC.h:429
A CXXStdInitializerListExpr record.
Definition: ASTBitCodes.h:1844
void setFinallyBody(Stmt *S)
Definition: StmtObjC.h:134
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:3727
CXXTryStmt - A C++ try block, including all handlers.
Definition: StmtCXX.h:65
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Definition: Expr.h:4976
An ArraySubscriptExpr record.
Definition: ASTBitCodes.h:1650
Decl * readDecl()
Reads a declaration from the given position in a record in the given module, advancing Idx...
Definition: ASTReader.h:2480
static FloatingLiteral * Create(const ASTContext &C, const llvm::APFloat &V, bool isexact, QualType Type, SourceLocation L)
Definition: Expr.cpp:804
This represents &#39;#pragma omp target teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:3985
void setLParenLoc(SourceLocation Loc)
Sets the location of &#39;(&#39;.
Definition: OpenMPClause.h:359
Information about a module that has been loaded by the ASTReader.
Definition: Module.h: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:925
ExprWithCleanupsBitfields ExprWithCleanupsBits
Definition: Stmt.h:305
static OMPFlushClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
An ArrayInitLoopExpr record.
Definition: ASTBitCodes.h:1692
unsigned getNumClauses() const
Get number of clauses.
Definition: StmtOpenMP.h:184
A PseudoObjectExpr record.
Definition: ASTBitCodes.h:1728
void setColonLoc(SourceLocation L)
Definition: ExprOpenMP.h:110
void setFinallyStmt(Stmt *S)
Definition: StmtObjC.h:236
An ObjCIndirectCopyRestoreExpr record.
Definition: ASTBitCodes.h:1770
This represents &#39;#pragma omp for&#39; directive.
Definition: StmtOpenMP.h:1068
IdentifierInfo * getIdentifierInfo()
Definition: ASTReader.h:2494
static OMPTargetEnterDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:810
void setValueKind(ExprValueKind Cat)
setValueKind - Set the value kind produced by this expression.
Definition: Expr.h:422
static OMPLinearClause * CreateEmpty(const ASTContext &C, unsigned NumVars)
Creates an empty clause with the place for NumVars variables.
void setRParenLoc(SourceLocation L)
Definition: ExprObjC.h:497
Represents a folding of a pack over an operator.
Definition: ExprCXX.h:4149
void setEndStmt(Stmt *S)
Definition: StmtCXX.h:187
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
Definition: Stmt.h:1433
This represents &#39;#pragma omp target teams&#39; directive.
Definition: StmtOpenMP.h:3701
void setAssociatedStmt(Stmt *S)
Set the associated statement for the directive.
Definition: StmtOpenMP.h:85
static OMPDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
An expression that sends a message to the given Objective-C object or class.
Definition: ExprObjC.h:903
This represents a Microsoft inline-assembly statement extension.
Definition: Stmt.h:1811
void setColonLoc(SourceLocation L)
Definition: Stmt.h:738
void setIsArrow(bool A)
Definition: ExprObjC.h:553
void setRParenLoc(SourceLocation L)
Definition: Expr.h:3800
A DesignatedInitUpdateExpr record.
Definition: ASTBitCodes.h:1686
SourceLocation getEnd() const
void setAtLoc(SourceLocation L)
Definition: ExprObjC.h:403
UnaryOperator - This represents the unary-expression&#39;s (except sizeof and alignof), the postinc/postdec operators from postfix-expression, and various extensions.
Definition: Expr.h:1782
bool isOpenMPTaskLoopDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a taskloop directive.
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
Definition: ExprObjC.h:1187
A member reference to an MSPropertyDecl.
Definition: ExprCXX.h:728
static OMPParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:422
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition: ExprCXX.h:3841
static OMPPrivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
void setForLoc(SourceLocation Loc)
Definition: StmtObjC.h:54
This represents &#39;#pragma omp cancel&#39; directive.
Definition: StmtOpenMP.h:2740
This represents &#39;collapse&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:555
This represents clause &#39;firstprivate&#39; in the &#39;#pragma omp ...&#39; directives.
void setDistInc(Expr *DistInc)
Definition: StmtOpenMP.h:561
void setBase(Expr *base)
Definition: ExprObjC.h:549
ValueDecl * getDecl()
Definition: Expr.h:1057
An ObjCAvailabilityCheckExpr record.
Definition: ASTBitCodes.h:1797
void setRParenLoc(SourceLocation L)
Definition: ExprObjC.h:448
std::string readString()
Read a string, advancing Idx.
Definition: ASTReader.h:2593
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:3002
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:2382
This file defines OpenMP AST classes for clauses.
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1...
Definition: Expr.h:1520
An ObjCForCollectionStmt record.
Definition: ASTBitCodes.h:1773
This represents &#39;#pragma omp flush&#39; directive.
Definition: StmtOpenMP.h:2008
This represents &#39;#pragma omp parallel for simd&#39; directive.
Definition: StmtOpenMP.h:1596
void setRParenLoc(SourceLocation L)
Definition: Expr.h:3891
void setAtTryLoc(SourceLocation Loc)
Definition: StmtObjC.h:194
DoStmt - This represents a &#39;do/while&#39; stmt.
Definition: Stmt.h:1174
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
Definition: Stmt.h:1481
This represents &#39;seq_cst&#39; clause in the &#39;#pragma omp atomic&#39; directive.
This represents &#39;untied&#39; clause in the &#39;#pragma omp ...&#39; directive.
void setTypeOperandSourceInfo(TypeSourceInfo *TSI)
Definition: ExprCXX.h:690
void setBody(Stmt *S)
Definition: StmtCXX.h:191
void setOpcode(Opcode O)
Definition: Expr.h:3107
A MS-style AsmStmt record.
Definition: ASTBitCodes.h:1611
unsigned readRecord(llvm::BitstreamCursor &Cursor, unsigned AbbrevID)
Reads a record with id AbbrevID from Cursor, resetting the internal state.
void setLocStart(SourceLocation Loc)
Set starting location of directive kind.
Definition: StmtOpenMP.h:176
static OMPParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:374
static CoroutineBodyStmt * Create(const ASTContext &C, CtorArgs const &Args)
Definition: StmtCXX.cpp:90
void setSynchExpr(Stmt *S)
Definition: StmtObjC.h:296
This represents &#39;#pragma omp target enter data&#39; directive.
Definition: StmtOpenMP.h:2368
void setPostUpdateExpr(Expr *S)
Set pre-initialization statement for the clause.
Definition: OpenMPClause.h:147
void setUpdates(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:45
const llvm::fltSemantics & getSemantics() const
Return the APFloat semantics this literal uses.
Definition: Expr.cpp:814
void setLowerBoundVariable(Expr *LB)
Definition: StmtOpenMP.h:502
void setLParenLoc(SourceLocation L)
Definition: ExprCXX.h:1503
This represents &#39;num_teams&#39; clause in the &#39;#pragma omp ...&#39; directive.
void setTypeSourceInfo(TypeSourceInfo *tinfo)
Definition: Expr.h:2754
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Definition: ExprCXX.h:338
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
Definition: Expr.h:875
void setComputationLHSType(QualType T)
Definition: Expr.h:3295
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition: Expr.h:3681
unsigned getNumArgs() const
Return the number of actual arguments in this message, not counting the receiver. ...
Definition: ExprObjC.h:1328
static OMPSectionDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:259
void setDecl(LabelDecl *D)
Definition: Stmt.h:876
Kind
void setElse(Stmt *S)
Definition: Stmt.h:990
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr...
Definition: ExprCXX.h:2551
A field in a dependent type, known only by its name.
Definition: Expr.h:1905
This captures a statement into a function.
Definition: Stmt.h:2070
Represents a call to an inherited base class constructor from an inheriting constructor.
Definition: ExprCXX.h:1400
unsigned path_size() const
Definition: Expr.h:2856
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition: Expr.h:5049
void setLParenLoc(SourceLocation L)
Definition: Expr.h:3029
void setSubStmt(Stmt *S)
Definition: Stmt.h:832
void setElidable(bool E)
Definition: ExprCXX.h:1309
void setAccessorLoc(SourceLocation L)
Definition: Expr.h:4896
void setGotoLoc(SourceLocation L)
Definition: Stmt.h:1343
static CXXDynamicCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
Definition: ExprCXX.cpp:597
unsigned getTotalComponentListNum() const
Return the number of lists derived from the clause expressions.
CXXTemporary * readCXXTemporary()
Definition: ASTReader.h:2563
void setHadMultipleCandidates(bool V)
Definition: ExprCXX.h:1314
void setLocation(SourceLocation L)
Definition: Expr.h:1066
This represents &#39;#pragma omp single&#39; directive.
Definition: StmtOpenMP.h:1340
Encodes a location in the source.
void setLocation(SourceLocation L)
Definition: Expr.h:1234
void setPrevLowerBoundVariable(Expr *PrevLB)
Definition: StmtOpenMP.h:551
void setIterationVariable(Expr *IV)
Definition: StmtOpenMP.h:475
This represents &#39;hint&#39; clause in the &#39;#pragma omp ...&#39; directive.
Defines enumerations for expression traits intrinsics.
PseudoObjectExprBitfields PseudoObjectExprBits
Definition: Stmt.h:306
Stmt * readSubStmt()
Reads a sub-statement operand during statement reading.
Definition: ASTReader.h:2425
unsigned getNumHandlers() const
Definition: StmtCXX.h:103
void setUpdater(Expr *Updater)
Definition: Expr.h:4541
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:1170
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:1200
static CXXConstCastExpr * CreateEmpty(const ASTContext &Context)
Definition: ExprCXX.cpp:669
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
Definition: ExprCXX.h:1845
void setCombinedNextLowerBound(Expr *CombNLB)
Definition: StmtOpenMP.h:596
void setAtCatchLoc(SourceLocation Loc)
Definition: StmtObjC.h:103
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c dictionary literal.
Definition: ExprObjC.h:342
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit...
Definition: ExprCXX.h:457
void setSourceRange(SourceRange R)
Definition: ExprCXX.h:708
This represents &#39;schedule&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:744
static ObjCAtTryStmt * CreateEmpty(const ASTContext &Context, unsigned NumCatchStmts, bool HasFinally)
Definition: StmtObjC.cpp:58
void setConstexpr(bool C)
Definition: Stmt.h:1002
Represents a call to a member function that may be written either with member call syntax (e...
Definition: ExprCXX.h:164
void setLParenLoc(SourceLocation Loc)
Sets the location of &#39;(&#39;.
Definition: OpenMPClause.h:420
void setIdentLoc(SourceLocation L)
Definition: Stmt.h:880
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:499
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:3541
void readDeclarationNameInfo(DeclarationNameInfo &NameInfo)
Definition: ASTReader.h:2510
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:1838
void setTemporary(CXXTemporary *T)
Definition: ExprCXX.h:1217
static ExprWithCleanups * Create(const ASTContext &C, EmptyShell empty, unsigned numObjects)
Definition: ExprCXX.cpp:1057
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:1095
Expr * readSubExpr()
Reads a sub-expression operand during statement reading.
Definition: ASTReader.h:2428
void VisitStmt(Stmt *S)
StmtVisitor - This class implements a simple visitor for Stmt subclasses.
Definition: StmtVisitor.h:186
void setClassReceiver(TypeSourceInfo *TSInfo)
Definition: ExprObjC.h:1240
void setCatchParamDecl(VarDecl *D)
Definition: StmtObjC.h:100
void setCond(Expr *E)
Definition: Stmt.h:986
An ObjCEncodeExpr record.
Definition: ASTBitCodes.h:1743
static OMPAtomicDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:664
This represents &#39;#pragma omp taskwait&#39; directive.
Definition: StmtOpenMP.h:1891
void setLHS(Expr *E)
Definition: Expr.h:3110
void setPrivateCopies(ArrayRef< Expr *> PrivateCopies)
Set list of helper expressions, required for generation of private copies of original lastprivate var...
void setConfig(CallExpr *E)
Sets the kernel configuration expression.
Definition: ExprCXX.h:225
void setConditionVariable(const ASTContext &C, VarDecl *V)
Definition: Stmt.cpp:875
This is a basic class for representing single OpenMP clause.
Definition: OpenMPClause.h:51
void setIsFreeIvar(bool A)
Definition: ExprObjC.h:554
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load, __atomic_store, and __atomic_compare_exchange_*, for the similarly-named C++11 instructions, and __c11 variants for <stdatomic.h>, and corresponding __opencl_atomic_* for OpenCL 2.0.
Definition: Expr.h:5183
void readDeclarationNameLoc(DeclarationNameLoc &DNLoc, DeclarationName Name)
Definition: ASTReader.h:2507
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:1928
static OMPOrderedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:633
bool isOpenMPLoopBoundSharingDirective(OpenMPDirectiveKind Kind)
Checks if the specified directive kind is one of the composite or combined directives that need loop ...
void addDecl(NamedDecl *D)
Definition: UnresolvedSet.h:89
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition: ExprObjC.h:474
bool isValueDependent() const
isValueDependent - Determines whether this expression is value-dependent (C++ [temp.dep.constexpr]).
Definition: Expr.h:149
void setDecl(ValueDecl *NewD)
Definition: Expr.h:1059
void setThrowLoc(SourceLocation Loc)
Definition: StmtObjC.h:330
unsigned getIdx() const
The current position in this record.
Definition: ASTReader.h:2363
void setVarRefs(ArrayRef< Expr *> VL)
Sets the list of variables for this clause.
Definition: OpenMPClause.h:191
An ObjCIsa Expr record.
Definition: ASTBitCodes.h:1767
ASTContext & getContext()
Retrieve the AST context that this AST reader supplements.
Definition: ASTReader.h:2360
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:2902
Stmt * getCapturedStmt()
Retrieve the statement being captured.
Definition: Stmt.h:2171
This represents &#39;#pragma omp target&#39; directive.
Definition: StmtOpenMP.h:2252
static OMPTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setSubExpr(Expr *E)
Definition: ExprCXX.h:1221
static DesignatedInitExpr * CreateEmpty(const ASTContext &C, unsigned NumIndexExprs)
Definition: Expr.cpp:3805
static DeclGroup * Create(ASTContext &C, Decl **Decls, unsigned NumDecls)
Definition: DeclGroup.cpp:21
static OMPTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setBaseExpr(Stmt *S)
Definition: ExprObjC.h:848
An expression trait intrinsic.
Definition: ExprCXX.h:2496
void setEncodedTypeSourceInfo(TypeSourceInfo *EncType)
Definition: ExprObjC.h:411
An AtomicExpr record.
Definition: ASTBitCodes.h:1731
This represents &#39;#pragma omp ordered&#39; directive.
Definition: StmtOpenMP.h:2063
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition: Expr.h:3568
void setCond(Expr *E)
Definition: StmtCXX.h:188
static SizeOfPackExpr * CreateDeserialized(ASTContext &Context, unsigned NumPartialArgs)
Definition: ExprCXX.cpp:1323
This represents &#39;#pragma omp target update&#39; directive.
Definition: StmtOpenMP.h:3004
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:117
void VisitOMPClauseWithPreInit(OMPClauseWithPreInit *C)
void setSubExpr(Expr *E)
Definition: Expr.h:3878
void setLAngleLoc(SourceLocation Loc)
Definition: TemplateBase.h:565
void sawArrayRangeDesignator(bool ARD=true)
Definition: Expr.h:4123
void addArgument(const TemplateArgumentLoc &Loc)
Definition: TemplateBase.h:586
void setCapturedRecordDecl(RecordDecl *D)
Set the record declaration for captured variables.
Definition: Stmt.h:2191
Representation of a Microsoft __if_exists or __if_not_exists statement with a dependent name...
Definition: StmtCXX.h:240
static MemberExpr * Create(const ASTContext &C, Expr *base, bool isarrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, ValueDecl *memberdecl, DeclAccessPair founddecl, DeclarationNameInfo MemberNameInfo, const TemplateArgumentListInfo *targs, QualType ty, ExprValueKind VK, ExprObjectKind OK)
Definition: Expr.cpp:1468
A placeholder type used to construct an empty shell of a type, that will be filled in later (e...
Definition: Stmt.h:336
void setSimple(bool V)
Definition: Stmt.h:1515
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:2857
void setRBracketLoc(SourceLocation L)
Definition: ExprCXX.h:836
void readAttributes(AttrVec &Attrs)
Reads attributes from the current stream position, advancing Idx.
Definition: ASTReader.h:2608
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:3271
Expr ** getElements()
Retrieve elements of array of literals.
Definition: ExprObjC.h:202
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:4764
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition: Expr.h:3524
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers...
Definition: ExprObjC.h:1572
Represents a reference to a function parameter pack that has been substituted but not yet expanded...
Definition: ExprCXX.h:3961
Represents a template argument.
Definition: