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::VisitFloatingLiteral(FloatingLiteral *E) {
537  VisitExpr(E);
538  E->setRawSemantics(static_cast<Stmt::APFloatSemantics>(Record.readInt()));
539  E->setExact(Record.readInt());
540  E->setValue(Record.getContext(), Record.readAPFloat(E->getSemantics()));
541  E->setLocation(ReadSourceLocation());
542 }
543 
544 void ASTStmtReader::VisitImaginaryLiteral(ImaginaryLiteral *E) {
545  VisitExpr(E);
546  E->setSubExpr(Record.readSubExpr());
547 }
548 
549 void ASTStmtReader::VisitStringLiteral(StringLiteral *E) {
550  VisitExpr(E);
551  unsigned Len = Record.readInt();
552  assert(Record.peekInt() == E->getNumConcatenated() &&
553  "Wrong number of concatenated tokens!");
554  Record.skipInts(1);
555  auto kind = static_cast<StringLiteral::StringKind>(Record.readInt());
556  bool isPascal = Record.readInt();
557 
558  // Read string data
559  auto B = &Record.peekInt();
560  SmallString<16> Str(B, B + Len);
561  E->setString(Record.getContext(), Str, kind, isPascal);
562  Record.skipInts(Len);
563 
564  // Read source locations
565  for (unsigned I = 0, N = E->getNumConcatenated(); I != N; ++I)
566  E->setStrTokenLoc(I, ReadSourceLocation());
567 }
568 
569 void ASTStmtReader::VisitCharacterLiteral(CharacterLiteral *E) {
570  VisitExpr(E);
571  E->setValue(Record.readInt());
572  E->setLocation(ReadSourceLocation());
573  E->setKind(static_cast<CharacterLiteral::CharacterKind>(Record.readInt()));
574 }
575 
576 void ASTStmtReader::VisitParenExpr(ParenExpr *E) {
577  VisitExpr(E);
578  E->setLParen(ReadSourceLocation());
579  E->setRParen(ReadSourceLocation());
580  E->setSubExpr(Record.readSubExpr());
581 }
582 
583 void ASTStmtReader::VisitParenListExpr(ParenListExpr *E) {
584  VisitExpr(E);
585  unsigned NumExprs = Record.readInt();
586  E->Exprs = new (Record.getContext()) Stmt*[NumExprs];
587  for (unsigned i = 0; i != NumExprs; ++i)
588  E->Exprs[i] = Record.readSubStmt();
589  E->NumExprs = NumExprs;
590  E->LParenLoc = ReadSourceLocation();
591  E->RParenLoc = ReadSourceLocation();
592 }
593 
594 void ASTStmtReader::VisitUnaryOperator(UnaryOperator *E) {
595  VisitExpr(E);
596  E->setSubExpr(Record.readSubExpr());
598  E->setOperatorLoc(ReadSourceLocation());
599  E->setCanOverflow(Record.readInt());
600 }
601 
602 void ASTStmtReader::VisitOffsetOfExpr(OffsetOfExpr *E) {
603  VisitExpr(E);
604  assert(E->getNumComponents() == Record.peekInt());
605  Record.skipInts(1);
606  assert(E->getNumExpressions() == Record.peekInt());
607  Record.skipInts(1);
608  E->setOperatorLoc(ReadSourceLocation());
609  E->setRParenLoc(ReadSourceLocation());
610  E->setTypeSourceInfo(GetTypeSourceInfo());
611  for (unsigned I = 0, N = E->getNumComponents(); I != N; ++I) {
612  auto Kind = static_cast<OffsetOfNode::Kind>(Record.readInt());
613  SourceLocation Start = ReadSourceLocation();
614  SourceLocation End = ReadSourceLocation();
615  switch (Kind) {
616  case OffsetOfNode::Array:
617  E->setComponent(I, OffsetOfNode(Start, Record.readInt(), End));
618  break;
619 
620  case OffsetOfNode::Field:
621  E->setComponent(
622  I, OffsetOfNode(Start, ReadDeclAs<FieldDecl>(), End));
623  break;
624 
626  E->setComponent(
627  I,
628  OffsetOfNode(Start, Record.getIdentifierInfo(), End));
629  break;
630 
631  case OffsetOfNode::Base: {
632  auto *Base = new (Record.getContext()) CXXBaseSpecifier();
633  *Base = Record.readCXXBaseSpecifier();
635  break;
636  }
637  }
638  }
639 
640  for (unsigned I = 0, N = E->getNumExpressions(); I != N; ++I)
641  E->setIndexExpr(I, Record.readSubExpr());
642 }
643 
644 void ASTStmtReader::VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *E) {
645  VisitExpr(E);
646  E->setKind(static_cast<UnaryExprOrTypeTrait>(Record.readInt()));
647  if (Record.peekInt() == 0) {
648  E->setArgument(Record.readSubExpr());
649  Record.skipInts(1);
650  } else {
651  E->setArgument(GetTypeSourceInfo());
652  }
653  E->setOperatorLoc(ReadSourceLocation());
654  E->setRParenLoc(ReadSourceLocation());
655 }
656 
657 void ASTStmtReader::VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
658  VisitExpr(E);
659  E->setLHS(Record.readSubExpr());
660  E->setRHS(Record.readSubExpr());
661  E->setRBracketLoc(ReadSourceLocation());
662 }
663 
664 void ASTStmtReader::VisitOMPArraySectionExpr(OMPArraySectionExpr *E) {
665  VisitExpr(E);
666  E->setBase(Record.readSubExpr());
667  E->setLowerBound(Record.readSubExpr());
668  E->setLength(Record.readSubExpr());
669  E->setColonLoc(ReadSourceLocation());
670  E->setRBracketLoc(ReadSourceLocation());
671 }
672 
673 void ASTStmtReader::VisitCallExpr(CallExpr *E) {
674  VisitExpr(E);
675  E->setNumArgs(Record.getContext(), Record.readInt());
676  E->setRParenLoc(ReadSourceLocation());
677  E->setCallee(Record.readSubExpr());
678  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
679  E->setArg(I, Record.readSubExpr());
680 }
681 
682 void ASTStmtReader::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) {
683  VisitCallExpr(E);
684 }
685 
686 void ASTStmtReader::VisitMemberExpr(MemberExpr *E) {
687  // Don't call VisitExpr, this is fully initialized at creation.
688  assert(E->getStmtClass() == Stmt::MemberExprClass &&
689  "It's a subclass, we must advance Idx!");
690 }
691 
692 void ASTStmtReader::VisitObjCIsaExpr(ObjCIsaExpr *E) {
693  VisitExpr(E);
694  E->setBase(Record.readSubExpr());
695  E->setIsaMemberLoc(ReadSourceLocation());
696  E->setOpLoc(ReadSourceLocation());
697  E->setArrow(Record.readInt());
698 }
699 
700 void ASTStmtReader::
701 VisitObjCIndirectCopyRestoreExpr(ObjCIndirectCopyRestoreExpr *E) {
702  VisitExpr(E);
703  E->Operand = Record.readSubExpr();
704  E->setShouldCopy(Record.readInt());
705 }
706 
707 void ASTStmtReader::VisitObjCBridgedCastExpr(ObjCBridgedCastExpr *E) {
708  VisitExplicitCastExpr(E);
709  E->LParenLoc = ReadSourceLocation();
710  E->BridgeKeywordLoc = ReadSourceLocation();
711  E->Kind = Record.readInt();
712 }
713 
714 void ASTStmtReader::VisitCastExpr(CastExpr *E) {
715  VisitExpr(E);
716  unsigned NumBaseSpecs = Record.readInt();
717  assert(NumBaseSpecs == E->path_size());
718  E->setSubExpr(Record.readSubExpr());
719  E->setCastKind((CastKind)Record.readInt());
720  CastExpr::path_iterator BaseI = E->path_begin();
721  while (NumBaseSpecs--) {
722  auto *BaseSpec = new (Record.getContext()) CXXBaseSpecifier;
723  *BaseSpec = Record.readCXXBaseSpecifier();
724  *BaseI++ = BaseSpec;
725  }
726 }
727 
728 void ASTStmtReader::VisitBinaryOperator(BinaryOperator *E) {
729  VisitExpr(E);
730  E->setLHS(Record.readSubExpr());
731  E->setRHS(Record.readSubExpr());
733  E->setOperatorLoc(ReadSourceLocation());
734  E->setFPFeatures(FPOptions(Record.readInt()));
735 }
736 
737 void ASTStmtReader::VisitCompoundAssignOperator(CompoundAssignOperator *E) {
738  VisitBinaryOperator(E);
739  E->setComputationLHSType(Record.readType());
740  E->setComputationResultType(Record.readType());
741 }
742 
743 void ASTStmtReader::VisitConditionalOperator(ConditionalOperator *E) {
744  VisitExpr(E);
745  E->SubExprs[ConditionalOperator::COND] = Record.readSubExpr();
746  E->SubExprs[ConditionalOperator::LHS] = Record.readSubExpr();
747  E->SubExprs[ConditionalOperator::RHS] = Record.readSubExpr();
748  E->QuestionLoc = ReadSourceLocation();
749  E->ColonLoc = ReadSourceLocation();
750 }
751 
752 void
753 ASTStmtReader::VisitBinaryConditionalOperator(BinaryConditionalOperator *E) {
754  VisitExpr(E);
755  E->OpaqueValue = cast<OpaqueValueExpr>(Record.readSubExpr());
756  E->SubExprs[BinaryConditionalOperator::COMMON] = Record.readSubExpr();
757  E->SubExprs[BinaryConditionalOperator::COND] = Record.readSubExpr();
758  E->SubExprs[BinaryConditionalOperator::LHS] = Record.readSubExpr();
759  E->SubExprs[BinaryConditionalOperator::RHS] = Record.readSubExpr();
760  E->QuestionLoc = ReadSourceLocation();
761  E->ColonLoc = ReadSourceLocation();
762 }
763 
764 void ASTStmtReader::VisitImplicitCastExpr(ImplicitCastExpr *E) {
765  VisitCastExpr(E);
766 }
767 
768 void ASTStmtReader::VisitExplicitCastExpr(ExplicitCastExpr *E) {
769  VisitCastExpr(E);
770  E->setTypeInfoAsWritten(GetTypeSourceInfo());
771 }
772 
773 void ASTStmtReader::VisitCStyleCastExpr(CStyleCastExpr *E) {
774  VisitExplicitCastExpr(E);
775  E->setLParenLoc(ReadSourceLocation());
776  E->setRParenLoc(ReadSourceLocation());
777 }
778 
779 void ASTStmtReader::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
780  VisitExpr(E);
781  E->setLParenLoc(ReadSourceLocation());
782  E->setTypeSourceInfo(GetTypeSourceInfo());
783  E->setInitializer(Record.readSubExpr());
784  E->setFileScope(Record.readInt());
785 }
786 
787 void ASTStmtReader::VisitExtVectorElementExpr(ExtVectorElementExpr *E) {
788  VisitExpr(E);
789  E->setBase(Record.readSubExpr());
790  E->setAccessor(Record.getIdentifierInfo());
791  E->setAccessorLoc(ReadSourceLocation());
792 }
793 
794 void ASTStmtReader::VisitInitListExpr(InitListExpr *E) {
795  VisitExpr(E);
796  if (auto *SyntForm = cast_or_null<InitListExpr>(Record.readSubStmt()))
797  E->setSyntacticForm(SyntForm);
798  E->setLBraceLoc(ReadSourceLocation());
799  E->setRBraceLoc(ReadSourceLocation());
800  bool isArrayFiller = Record.readInt();
801  Expr *filler = nullptr;
802  if (isArrayFiller) {
803  filler = Record.readSubExpr();
804  E->ArrayFillerOrUnionFieldInit = filler;
805  } else
806  E->ArrayFillerOrUnionFieldInit = ReadDeclAs<FieldDecl>();
807  E->sawArrayRangeDesignator(Record.readInt());
808  unsigned NumInits = Record.readInt();
809  E->reserveInits(Record.getContext(), NumInits);
810  if (isArrayFiller) {
811  for (unsigned I = 0; I != NumInits; ++I) {
812  Expr *init = Record.readSubExpr();
813  E->updateInit(Record.getContext(), I, init ? init : filler);
814  }
815  } else {
816  for (unsigned I = 0; I != NumInits; ++I)
817  E->updateInit(Record.getContext(), I, Record.readSubExpr());
818  }
819 }
820 
821 void ASTStmtReader::VisitDesignatedInitExpr(DesignatedInitExpr *E) {
823 
824  VisitExpr(E);
825  unsigned NumSubExprs = Record.readInt();
826  assert(NumSubExprs == E->getNumSubExprs() && "Wrong number of subexprs");
827  for (unsigned I = 0; I != NumSubExprs; ++I)
828  E->setSubExpr(I, Record.readSubExpr());
829  E->setEqualOrColonLoc(ReadSourceLocation());
830  E->setGNUSyntax(Record.readInt());
831 
832  SmallVector<Designator, 4> Designators;
833  while (Record.getIdx() < Record.size()) {
834  switch ((DesignatorTypes)Record.readInt()) {
835  case DESIG_FIELD_DECL: {
836  auto *Field = ReadDeclAs<FieldDecl>();
837  SourceLocation DotLoc = ReadSourceLocation();
838  SourceLocation FieldLoc = ReadSourceLocation();
839  Designators.push_back(Designator(Field->getIdentifier(), DotLoc,
840  FieldLoc));
841  Designators.back().setField(Field);
842  break;
843  }
844 
845  case DESIG_FIELD_NAME: {
846  const IdentifierInfo *Name = Record.getIdentifierInfo();
847  SourceLocation DotLoc = ReadSourceLocation();
848  SourceLocation FieldLoc = ReadSourceLocation();
849  Designators.push_back(Designator(Name, DotLoc, FieldLoc));
850  break;
851  }
852 
853  case DESIG_ARRAY: {
854  unsigned Index = Record.readInt();
855  SourceLocation LBracketLoc = ReadSourceLocation();
856  SourceLocation RBracketLoc = ReadSourceLocation();
857  Designators.push_back(Designator(Index, LBracketLoc, RBracketLoc));
858  break;
859  }
860 
861  case DESIG_ARRAY_RANGE: {
862  unsigned Index = Record.readInt();
863  SourceLocation LBracketLoc = ReadSourceLocation();
864  SourceLocation EllipsisLoc = ReadSourceLocation();
865  SourceLocation RBracketLoc = ReadSourceLocation();
866  Designators.push_back(Designator(Index, LBracketLoc, EllipsisLoc,
867  RBracketLoc));
868  break;
869  }
870  }
871  }
872  E->setDesignators(Record.getContext(),
873  Designators.data(), Designators.size());
874 }
875 
876 void ASTStmtReader::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) {
877  VisitExpr(E);
878  E->setBase(Record.readSubExpr());
879  E->setUpdater(Record.readSubExpr());
880 }
881 
882 void ASTStmtReader::VisitNoInitExpr(NoInitExpr *E) {
883  VisitExpr(E);
884 }
885 
886 void ASTStmtReader::VisitArrayInitLoopExpr(ArrayInitLoopExpr *E) {
887  VisitExpr(E);
888  E->SubExprs[0] = Record.readSubExpr();
889  E->SubExprs[1] = Record.readSubExpr();
890 }
891 
892 void ASTStmtReader::VisitArrayInitIndexExpr(ArrayInitIndexExpr *E) {
893  VisitExpr(E);
894 }
895 
896 void ASTStmtReader::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) {
897  VisitExpr(E);
898 }
899 
900 void ASTStmtReader::VisitVAArgExpr(VAArgExpr *E) {
901  VisitExpr(E);
902  E->setSubExpr(Record.readSubExpr());
903  E->setWrittenTypeInfo(GetTypeSourceInfo());
904  E->setBuiltinLoc(ReadSourceLocation());
905  E->setRParenLoc(ReadSourceLocation());
906  E->setIsMicrosoftABI(Record.readInt());
907 }
908 
909 void ASTStmtReader::VisitAddrLabelExpr(AddrLabelExpr *E) {
910  VisitExpr(E);
911  E->setAmpAmpLoc(ReadSourceLocation());
912  E->setLabelLoc(ReadSourceLocation());
913  E->setLabel(ReadDeclAs<LabelDecl>());
914 }
915 
916 void ASTStmtReader::VisitStmtExpr(StmtExpr *E) {
917  VisitExpr(E);
918  E->setLParenLoc(ReadSourceLocation());
919  E->setRParenLoc(ReadSourceLocation());
920  E->setSubStmt(cast_or_null<CompoundStmt>(Record.readSubStmt()));
921 }
922 
923 void ASTStmtReader::VisitChooseExpr(ChooseExpr *E) {
924  VisitExpr(E);
925  E->setCond(Record.readSubExpr());
926  E->setLHS(Record.readSubExpr());
927  E->setRHS(Record.readSubExpr());
928  E->setBuiltinLoc(ReadSourceLocation());
929  E->setRParenLoc(ReadSourceLocation());
930  E->setIsConditionTrue(Record.readInt());
931 }
932 
933 void ASTStmtReader::VisitGNUNullExpr(GNUNullExpr *E) {
934  VisitExpr(E);
935  E->setTokenLocation(ReadSourceLocation());
936 }
937 
938 void ASTStmtReader::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
939  VisitExpr(E);
941  unsigned NumExprs = Record.readInt();
942  while (NumExprs--)
943  Exprs.push_back(Record.readSubExpr());
944  E->setExprs(Record.getContext(), Exprs);
945  E->setBuiltinLoc(ReadSourceLocation());
946  E->setRParenLoc(ReadSourceLocation());
947 }
948 
949 void ASTStmtReader::VisitConvertVectorExpr(ConvertVectorExpr *E) {
950  VisitExpr(E);
951  E->BuiltinLoc = ReadSourceLocation();
952  E->RParenLoc = ReadSourceLocation();
953  E->TInfo = GetTypeSourceInfo();
954  E->SrcExpr = Record.readSubExpr();
955 }
956 
957 void ASTStmtReader::VisitBlockExpr(BlockExpr *E) {
958  VisitExpr(E);
959  E->setBlockDecl(ReadDeclAs<BlockDecl>());
960 }
961 
962 void ASTStmtReader::VisitGenericSelectionExpr(GenericSelectionExpr *E) {
963  VisitExpr(E);
964  E->NumAssocs = Record.readInt();
965  E->AssocTypes = new (Record.getContext()) TypeSourceInfo*[E->NumAssocs];
966  E->SubExprs =
967  new(Record.getContext()) Stmt*[GenericSelectionExpr::END_EXPR+E->NumAssocs];
968 
969  E->SubExprs[GenericSelectionExpr::CONTROLLING] = Record.readSubExpr();
970  for (unsigned I = 0, N = E->getNumAssocs(); I != N; ++I) {
971  E->AssocTypes[I] = GetTypeSourceInfo();
972  E->SubExprs[GenericSelectionExpr::END_EXPR+I] = Record.readSubExpr();
973  }
974  E->ResultIndex = Record.readInt();
975 
976  E->GenericLoc = ReadSourceLocation();
977  E->DefaultLoc = ReadSourceLocation();
978  E->RParenLoc = ReadSourceLocation();
979 }
980 
981 void ASTStmtReader::VisitPseudoObjectExpr(PseudoObjectExpr *E) {
982  VisitExpr(E);
983  unsigned numSemanticExprs = Record.readInt();
984  assert(numSemanticExprs + 1 == E->PseudoObjectExprBits.NumSubExprs);
985  E->PseudoObjectExprBits.ResultIndex = Record.readInt();
986 
987  // Read the syntactic expression.
988  E->getSubExprsBuffer()[0] = Record.readSubExpr();
989 
990  // Read all the semantic expressions.
991  for (unsigned i = 0; i != numSemanticExprs; ++i) {
992  Expr *subExpr = Record.readSubExpr();
993  E->getSubExprsBuffer()[i+1] = subExpr;
994  }
995 }
996 
997 void ASTStmtReader::VisitAtomicExpr(AtomicExpr *E) {
998  VisitExpr(E);
999  E->Op = AtomicExpr::AtomicOp(Record.readInt());
1000  E->NumSubExprs = AtomicExpr::getNumSubExprs(E->Op);
1001  for (unsigned I = 0; I != E->NumSubExprs; ++I)
1002  E->SubExprs[I] = Record.readSubExpr();
1003  E->BuiltinLoc = ReadSourceLocation();
1004  E->RParenLoc = ReadSourceLocation();
1005 }
1006 
1007 //===----------------------------------------------------------------------===//
1008 // Objective-C Expressions and Statements
1009 
1010 void ASTStmtReader::VisitObjCStringLiteral(ObjCStringLiteral *E) {
1011  VisitExpr(E);
1012  E->setString(cast<StringLiteral>(Record.readSubStmt()));
1013  E->setAtLoc(ReadSourceLocation());
1014 }
1015 
1016 void ASTStmtReader::VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
1017  VisitExpr(E);
1018  // could be one of several IntegerLiteral, FloatLiteral, etc.
1019  E->SubExpr = Record.readSubStmt();
1020  E->BoxingMethod = ReadDeclAs<ObjCMethodDecl>();
1021  E->Range = ReadSourceRange();
1022 }
1023 
1024 void ASTStmtReader::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
1025  VisitExpr(E);
1026  unsigned NumElements = Record.readInt();
1027  assert(NumElements == E->getNumElements() && "Wrong number of elements");
1028  Expr **Elements = E->getElements();
1029  for (unsigned I = 0, N = NumElements; I != N; ++I)
1030  Elements[I] = Record.readSubExpr();
1031  E->ArrayWithObjectsMethod = ReadDeclAs<ObjCMethodDecl>();
1032  E->Range = ReadSourceRange();
1033 }
1034 
1035 void ASTStmtReader::VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *E) {
1036  VisitExpr(E);
1037  unsigned NumElements = Record.readInt();
1038  assert(NumElements == E->getNumElements() && "Wrong number of elements");
1039  bool HasPackExpansions = Record.readInt();
1040  assert(HasPackExpansions == E->HasPackExpansions &&"Pack expansion mismatch");
1041  auto *KeyValues =
1042  E->getTrailingObjects<ObjCDictionaryLiteral::KeyValuePair>();
1043  auto *Expansions =
1044  E->getTrailingObjects<ObjCDictionaryLiteral::ExpansionData>();
1045  for (unsigned I = 0; I != NumElements; ++I) {
1046  KeyValues[I].Key = Record.readSubExpr();
1047  KeyValues[I].Value = Record.readSubExpr();
1048  if (HasPackExpansions) {
1049  Expansions[I].EllipsisLoc = ReadSourceLocation();
1050  Expansions[I].NumExpansionsPlusOne = Record.readInt();
1051  }
1052  }
1053  E->DictWithObjectsMethod = ReadDeclAs<ObjCMethodDecl>();
1054  E->Range = ReadSourceRange();
1055 }
1056 
1057 void ASTStmtReader::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
1058  VisitExpr(E);
1059  E->setEncodedTypeSourceInfo(GetTypeSourceInfo());
1060  E->setAtLoc(ReadSourceLocation());
1061  E->setRParenLoc(ReadSourceLocation());
1062 }
1063 
1064 void ASTStmtReader::VisitObjCSelectorExpr(ObjCSelectorExpr *E) {
1065  VisitExpr(E);
1066  E->setSelector(Record.readSelector());
1067  E->setAtLoc(ReadSourceLocation());
1068  E->setRParenLoc(ReadSourceLocation());
1069 }
1070 
1071 void ASTStmtReader::VisitObjCProtocolExpr(ObjCProtocolExpr *E) {
1072  VisitExpr(E);
1073  E->setProtocol(ReadDeclAs<ObjCProtocolDecl>());
1074  E->setAtLoc(ReadSourceLocation());
1075  E->ProtoLoc = ReadSourceLocation();
1076  E->setRParenLoc(ReadSourceLocation());
1077 }
1078 
1079 void ASTStmtReader::VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) {
1080  VisitExpr(E);
1081  E->setDecl(ReadDeclAs<ObjCIvarDecl>());
1082  E->setLocation(ReadSourceLocation());
1083  E->setOpLoc(ReadSourceLocation());
1084  E->setBase(Record.readSubExpr());
1085  E->setIsArrow(Record.readInt());
1086  E->setIsFreeIvar(Record.readInt());
1087 }
1088 
1089 void ASTStmtReader::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
1090  VisitExpr(E);
1091  unsigned MethodRefFlags = Record.readInt();
1092  bool Implicit = Record.readInt() != 0;
1093  if (Implicit) {
1094  auto *Getter = ReadDeclAs<ObjCMethodDecl>();
1095  auto *Setter = ReadDeclAs<ObjCMethodDecl>();
1096  E->setImplicitProperty(Getter, Setter, MethodRefFlags);
1097  } else {
1098  E->setExplicitProperty(ReadDeclAs<ObjCPropertyDecl>(), MethodRefFlags);
1099  }
1100  E->setLocation(ReadSourceLocation());
1101  E->setReceiverLocation(ReadSourceLocation());
1102  switch (Record.readInt()) {
1103  case 0:
1104  E->setBase(Record.readSubExpr());
1105  break;
1106  case 1:
1107  E->setSuperReceiver(Record.readType());
1108  break;
1109  case 2:
1110  E->setClassReceiver(ReadDeclAs<ObjCInterfaceDecl>());
1111  break;
1112  }
1113 }
1114 
1115 void ASTStmtReader::VisitObjCSubscriptRefExpr(ObjCSubscriptRefExpr *E) {
1116  VisitExpr(E);
1117  E->setRBracket(ReadSourceLocation());
1118  E->setBaseExpr(Record.readSubExpr());
1119  E->setKeyExpr(Record.readSubExpr());
1120  E->GetAtIndexMethodDecl = ReadDeclAs<ObjCMethodDecl>();
1121  E->SetAtIndexMethodDecl = ReadDeclAs<ObjCMethodDecl>();
1122 }
1123 
1124 void ASTStmtReader::VisitObjCMessageExpr(ObjCMessageExpr *E) {
1125  VisitExpr(E);
1126  assert(Record.peekInt() == E->getNumArgs());
1127  Record.skipInts(1);
1128  unsigned NumStoredSelLocs = Record.readInt();
1129  E->SelLocsKind = Record.readInt();
1130  E->setDelegateInitCall(Record.readInt());
1131  E->IsImplicit = Record.readInt();
1132  auto Kind = static_cast<ObjCMessageExpr::ReceiverKind>(Record.readInt());
1133  switch (Kind) {
1135  E->setInstanceReceiver(Record.readSubExpr());
1136  break;
1137 
1139  E->setClassReceiver(GetTypeSourceInfo());
1140  break;
1141 
1144  QualType T = Record.readType();
1145  SourceLocation SuperLoc = ReadSourceLocation();
1146  E->setSuper(SuperLoc, T, Kind == ObjCMessageExpr::SuperInstance);
1147  break;
1148  }
1149  }
1150 
1151  assert(Kind == E->getReceiverKind());
1152 
1153  if (Record.readInt())
1154  E->setMethodDecl(ReadDeclAs<ObjCMethodDecl>());
1155  else
1156  E->setSelector(Record.readSelector());
1157 
1158  E->LBracLoc = ReadSourceLocation();
1159  E->RBracLoc = ReadSourceLocation();
1160 
1161  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1162  E->setArg(I, Record.readSubExpr());
1163 
1164  SourceLocation *Locs = E->getStoredSelLocs();
1165  for (unsigned I = 0; I != NumStoredSelLocs; ++I)
1166  Locs[I] = ReadSourceLocation();
1167 }
1168 
1169 void ASTStmtReader::VisitObjCForCollectionStmt(ObjCForCollectionStmt *S) {
1170  VisitStmt(S);
1171  S->setElement(Record.readSubStmt());
1172  S->setCollection(Record.readSubExpr());
1173  S->setBody(Record.readSubStmt());
1174  S->setForLoc(ReadSourceLocation());
1175  S->setRParenLoc(ReadSourceLocation());
1176 }
1177 
1178 void ASTStmtReader::VisitObjCAtCatchStmt(ObjCAtCatchStmt *S) {
1179  VisitStmt(S);
1180  S->setCatchBody(Record.readSubStmt());
1181  S->setCatchParamDecl(ReadDeclAs<VarDecl>());
1182  S->setAtCatchLoc(ReadSourceLocation());
1183  S->setRParenLoc(ReadSourceLocation());
1184 }
1185 
1186 void ASTStmtReader::VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S) {
1187  VisitStmt(S);
1188  S->setFinallyBody(Record.readSubStmt());
1189  S->setAtFinallyLoc(ReadSourceLocation());
1190 }
1191 
1192 void ASTStmtReader::VisitObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S) {
1193  VisitStmt(S);
1194  S->setSubStmt(Record.readSubStmt());
1195  S->setAtLoc(ReadSourceLocation());
1196 }
1197 
1198 void ASTStmtReader::VisitObjCAtTryStmt(ObjCAtTryStmt *S) {
1199  VisitStmt(S);
1200  assert(Record.peekInt() == S->getNumCatchStmts());
1201  Record.skipInts(1);
1202  bool HasFinally = Record.readInt();
1203  S->setTryBody(Record.readSubStmt());
1204  for (unsigned I = 0, N = S->getNumCatchStmts(); I != N; ++I)
1205  S->setCatchStmt(I, cast_or_null<ObjCAtCatchStmt>(Record.readSubStmt()));
1206 
1207  if (HasFinally)
1208  S->setFinallyStmt(Record.readSubStmt());
1209  S->setAtTryLoc(ReadSourceLocation());
1210 }
1211 
1212 void ASTStmtReader::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
1213  VisitStmt(S);
1214  S->setSynchExpr(Record.readSubStmt());
1215  S->setSynchBody(Record.readSubStmt());
1216  S->setAtSynchronizedLoc(ReadSourceLocation());
1217 }
1218 
1219 void ASTStmtReader::VisitObjCAtThrowStmt(ObjCAtThrowStmt *S) {
1220  VisitStmt(S);
1221  S->setThrowExpr(Record.readSubStmt());
1222  S->setThrowLoc(ReadSourceLocation());
1223 }
1224 
1225 void ASTStmtReader::VisitObjCBoolLiteralExpr(ObjCBoolLiteralExpr *E) {
1226  VisitExpr(E);
1227  E->setValue(Record.readInt());
1228  E->setLocation(ReadSourceLocation());
1229 }
1230 
1231 void ASTStmtReader::VisitObjCAvailabilityCheckExpr(ObjCAvailabilityCheckExpr *E) {
1232  VisitExpr(E);
1233  SourceRange R = Record.readSourceRange();
1234  E->AtLoc = R.getBegin();
1235  E->RParen = R.getEnd();
1236  E->VersionToCheck = Record.readVersionTuple();
1237 }
1238 
1239 //===----------------------------------------------------------------------===//
1240 // C++ Expressions and Statements
1241 //===----------------------------------------------------------------------===//
1242 
1243 void ASTStmtReader::VisitCXXCatchStmt(CXXCatchStmt *S) {
1244  VisitStmt(S);
1245  S->CatchLoc = ReadSourceLocation();
1246  S->ExceptionDecl = ReadDeclAs<VarDecl>();
1247  S->HandlerBlock = Record.readSubStmt();
1248 }
1249 
1250 void ASTStmtReader::VisitCXXTryStmt(CXXTryStmt *S) {
1251  VisitStmt(S);
1252  assert(Record.peekInt() == S->getNumHandlers() && "NumStmtFields is wrong ?");
1253  Record.skipInts(1);
1254  S->TryLoc = ReadSourceLocation();
1255  S->getStmts()[0] = Record.readSubStmt();
1256  for (unsigned i = 0, e = S->getNumHandlers(); i != e; ++i)
1257  S->getStmts()[i + 1] = Record.readSubStmt();
1258 }
1259 
1260 void ASTStmtReader::VisitCXXForRangeStmt(CXXForRangeStmt *S) {
1261  VisitStmt(S);
1262  S->ForLoc = ReadSourceLocation();
1263  S->CoawaitLoc = ReadSourceLocation();
1264  S->ColonLoc = ReadSourceLocation();
1265  S->RParenLoc = ReadSourceLocation();
1266  S->setRangeStmt(Record.readSubStmt());
1267  S->setBeginStmt(Record.readSubStmt());
1268  S->setEndStmt(Record.readSubStmt());
1269  S->setCond(Record.readSubExpr());
1270  S->setInc(Record.readSubExpr());
1271  S->setLoopVarStmt(Record.readSubStmt());
1272  S->setBody(Record.readSubStmt());
1273 }
1274 
1275 void ASTStmtReader::VisitMSDependentExistsStmt(MSDependentExistsStmt *S) {
1276  VisitStmt(S);
1277  S->KeywordLoc = ReadSourceLocation();
1278  S->IsIfExists = Record.readInt();
1279  S->QualifierLoc = Record.readNestedNameSpecifierLoc();
1280  ReadDeclarationNameInfo(S->NameInfo);
1281  S->SubStmt = Record.readSubStmt();
1282 }
1283 
1284 void ASTStmtReader::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
1285  VisitCallExpr(E);
1286  E->Operator = (OverloadedOperatorKind)Record.readInt();
1287  E->Range = Record.readSourceRange();
1288  E->setFPFeatures(FPOptions(Record.readInt()));
1289 }
1290 
1291 void ASTStmtReader::VisitCXXConstructExpr(CXXConstructExpr *E) {
1292  VisitExpr(E);
1293  E->NumArgs = Record.readInt();
1294  if (E->NumArgs)
1295  E->Args = new (Record.getContext()) Stmt*[E->NumArgs];
1296  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1297  E->setArg(I, Record.readSubExpr());
1298  E->setConstructor(ReadDeclAs<CXXConstructorDecl>());
1299  E->setLocation(ReadSourceLocation());
1300  E->setElidable(Record.readInt());
1301  E->setHadMultipleCandidates(Record.readInt());
1302  E->setListInitialization(Record.readInt());
1306  E->ParenOrBraceRange = ReadSourceRange();
1307 }
1308 
1309 void ASTStmtReader::VisitCXXInheritedCtorInitExpr(CXXInheritedCtorInitExpr *E) {
1310  VisitExpr(E);
1311  E->Constructor = ReadDeclAs<CXXConstructorDecl>();
1312  E->Loc = ReadSourceLocation();
1313  E->ConstructsVirtualBase = Record.readInt();
1314  E->InheritedFromVirtualBase = Record.readInt();
1315 }
1316 
1317 void ASTStmtReader::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
1318  VisitCXXConstructExpr(E);
1319  E->Type = GetTypeSourceInfo();
1320 }
1321 
1322 void ASTStmtReader::VisitLambdaExpr(LambdaExpr *E) {
1323  VisitExpr(E);
1324  unsigned NumCaptures = Record.readInt();
1325  assert(NumCaptures == E->NumCaptures);(void)NumCaptures;
1326  E->IntroducerRange = ReadSourceRange();
1327  E->CaptureDefault = static_cast<LambdaCaptureDefault>(Record.readInt());
1328  E->CaptureDefaultLoc = ReadSourceLocation();
1329  E->ExplicitParams = Record.readInt();
1330  E->ExplicitResultType = Record.readInt();
1331  E->ClosingBrace = ReadSourceLocation();
1332 
1333  // Read capture initializers.
1335  CEnd = E->capture_init_end();
1336  C != CEnd; ++C)
1337  *C = Record.readSubExpr();
1338 }
1339 
1340 void
1341 ASTStmtReader::VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E) {
1342  VisitExpr(E);
1343  E->SubExpr = Record.readSubExpr();
1344 }
1345 
1346 void ASTStmtReader::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) {
1347  VisitExplicitCastExpr(E);
1348  SourceRange R = ReadSourceRange();
1349  E->Loc = R.getBegin();
1350  E->RParenLoc = R.getEnd();
1351  R = ReadSourceRange();
1352  E->AngleBrackets = R;
1353 }
1354 
1355 void ASTStmtReader::VisitCXXStaticCastExpr(CXXStaticCastExpr *E) {
1356  return VisitCXXNamedCastExpr(E);
1357 }
1358 
1359 void ASTStmtReader::VisitCXXDynamicCastExpr(CXXDynamicCastExpr *E) {
1360  return VisitCXXNamedCastExpr(E);
1361 }
1362 
1363 void ASTStmtReader::VisitCXXReinterpretCastExpr(CXXReinterpretCastExpr *E) {
1364  return VisitCXXNamedCastExpr(E);
1365 }
1366 
1367 void ASTStmtReader::VisitCXXConstCastExpr(CXXConstCastExpr *E) {
1368  return VisitCXXNamedCastExpr(E);
1369 }
1370 
1371 void ASTStmtReader::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E) {
1372  VisitExplicitCastExpr(E);
1373  E->setLParenLoc(ReadSourceLocation());
1374  E->setRParenLoc(ReadSourceLocation());
1375 }
1376 
1377 void ASTStmtReader::VisitUserDefinedLiteral(UserDefinedLiteral *E) {
1378  VisitCallExpr(E);
1379  E->UDSuffixLoc = ReadSourceLocation();
1380 }
1381 
1382 void ASTStmtReader::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) {
1383  VisitExpr(E);
1384  E->setValue(Record.readInt());
1385  E->setLocation(ReadSourceLocation());
1386 }
1387 
1388 void ASTStmtReader::VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E) {
1389  VisitExpr(E);
1390  E->setLocation(ReadSourceLocation());
1391 }
1392 
1393 void ASTStmtReader::VisitCXXTypeidExpr(CXXTypeidExpr *E) {
1394  VisitExpr(E);
1395  E->setSourceRange(ReadSourceRange());
1396  if (E->isTypeOperand()) { // typeid(int)
1398  GetTypeSourceInfo());
1399  return;
1400  }
1401 
1402  // typeid(42+2)
1403  E->setExprOperand(Record.readSubExpr());
1404 }
1405 
1406 void ASTStmtReader::VisitCXXThisExpr(CXXThisExpr *E) {
1407  VisitExpr(E);
1408  E->setLocation(ReadSourceLocation());
1409  E->setImplicit(Record.readInt());
1410 }
1411 
1412 void ASTStmtReader::VisitCXXThrowExpr(CXXThrowExpr *E) {
1413  VisitExpr(E);
1414  E->ThrowLoc = ReadSourceLocation();
1415  E->Op = Record.readSubExpr();
1416  E->IsThrownVariableInScope = Record.readInt();
1417 }
1418 
1419 void ASTStmtReader::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
1420  VisitExpr(E);
1421  E->Param = ReadDeclAs<ParmVarDecl>();
1422  E->Loc = ReadSourceLocation();
1423 }
1424 
1425 void ASTStmtReader::VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E) {
1426  VisitExpr(E);
1427  E->Field = ReadDeclAs<FieldDecl>();
1428  E->Loc = ReadSourceLocation();
1429 }
1430 
1431 void ASTStmtReader::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
1432  VisitExpr(E);
1433  E->setTemporary(Record.readCXXTemporary());
1434  E->setSubExpr(Record.readSubExpr());
1435 }
1436 
1437 void ASTStmtReader::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
1438  VisitExpr(E);
1439  E->TypeInfo = GetTypeSourceInfo();
1440  E->RParenLoc = ReadSourceLocation();
1441 }
1442 
1443 void ASTStmtReader::VisitCXXNewExpr(CXXNewExpr *E) {
1444  VisitExpr(E);
1445  E->GlobalNew = Record.readInt();
1446  bool isArray = Record.readInt();
1447  E->PassAlignment = Record.readInt();
1448  E->UsualArrayDeleteWantsSize = Record.readInt();
1449  unsigned NumPlacementArgs = Record.readInt();
1450  E->StoredInitializationStyle = Record.readInt();
1451  E->setOperatorNew(ReadDeclAs<FunctionDecl>());
1452  E->setOperatorDelete(ReadDeclAs<FunctionDecl>());
1453  E->AllocatedTypeInfo = GetTypeSourceInfo();
1454  E->TypeIdParens = ReadSourceRange();
1455  E->Range = ReadSourceRange();
1456  E->DirectInitRange = ReadSourceRange();
1457 
1458  E->AllocateArgsArray(Record.getContext(), isArray, NumPlacementArgs,
1459  E->StoredInitializationStyle != 0);
1460 
1461  // Install all the subexpressions.
1463  I != e; ++I)
1464  *I = Record.readSubStmt();
1465 }
1466 
1467 void ASTStmtReader::VisitCXXDeleteExpr(CXXDeleteExpr *E) {
1468  VisitExpr(E);
1469  E->GlobalDelete = Record.readInt();
1470  E->ArrayForm = Record.readInt();
1471  E->ArrayFormAsWritten = Record.readInt();
1472  E->UsualArrayDeleteWantsSize = Record.readInt();
1473  E->OperatorDelete = ReadDeclAs<FunctionDecl>();
1474  E->Argument = Record.readSubExpr();
1475  E->Loc = ReadSourceLocation();
1476 }
1477 
1478 void ASTStmtReader::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
1479  VisitExpr(E);
1480 
1481  E->Base = Record.readSubExpr();
1482  E->IsArrow = Record.readInt();
1483  E->OperatorLoc = ReadSourceLocation();
1484  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1485  E->ScopeType = GetTypeSourceInfo();
1486  E->ColonColonLoc = ReadSourceLocation();
1487  E->TildeLoc = ReadSourceLocation();
1488 
1489  IdentifierInfo *II = Record.getIdentifierInfo();
1490  if (II)
1491  E->setDestroyedType(II, ReadSourceLocation());
1492  else
1493  E->setDestroyedType(GetTypeSourceInfo());
1494 }
1495 
1496 void ASTStmtReader::VisitExprWithCleanups(ExprWithCleanups *E) {
1497  VisitExpr(E);
1498 
1499  unsigned NumObjects = Record.readInt();
1500  assert(NumObjects == E->getNumObjects());
1501  for (unsigned i = 0; i != NumObjects; ++i)
1502  E->getTrailingObjects<BlockDecl *>()[i] =
1503  ReadDeclAs<BlockDecl>();
1504 
1505  E->ExprWithCleanupsBits.CleanupsHaveSideEffects = Record.readInt();
1506  E->SubExpr = Record.readSubExpr();
1507 }
1508 
1509 void
1510 ASTStmtReader::VisitCXXDependentScopeMemberExpr(CXXDependentScopeMemberExpr *E){
1511  VisitExpr(E);
1512 
1513  if (Record.readInt()) // HasTemplateKWAndArgsInfo
1514  ReadTemplateKWAndArgsInfo(
1515  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
1516  E->getTrailingObjects<TemplateArgumentLoc>(),
1517  /*NumTemplateArgs=*/Record.readInt());
1518 
1519  E->Base = Record.readSubExpr();
1520  E->BaseType = Record.readType();
1521  E->IsArrow = Record.readInt();
1522  E->OperatorLoc = ReadSourceLocation();
1523  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1524  E->FirstQualifierFoundInScope = ReadDeclAs<NamedDecl>();
1525  ReadDeclarationNameInfo(E->MemberNameInfo);
1526 }
1527 
1528 void
1529 ASTStmtReader::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) {
1530  VisitExpr(E);
1531 
1532  if (Record.readInt()) // HasTemplateKWAndArgsInfo
1533  ReadTemplateKWAndArgsInfo(
1534  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
1535  E->getTrailingObjects<TemplateArgumentLoc>(),
1536  /*NumTemplateArgs=*/Record.readInt());
1537 
1538  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1539  ReadDeclarationNameInfo(E->NameInfo);
1540 }
1541 
1542 void
1543 ASTStmtReader::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E) {
1544  VisitExpr(E);
1545  assert(Record.peekInt() == E->arg_size() &&
1546  "Read wrong record during creation ?");
1547  Record.skipInts(1);
1548  for (unsigned I = 0, N = E->arg_size(); I != N; ++I)
1549  E->setArg(I, Record.readSubExpr());
1550  E->Type = GetTypeSourceInfo();
1551  E->setLParenLoc(ReadSourceLocation());
1552  E->setRParenLoc(ReadSourceLocation());
1553 }
1554 
1555 void ASTStmtReader::VisitOverloadExpr(OverloadExpr *E) {
1556  VisitExpr(E);
1557 
1558  if (Record.readInt()) // HasTemplateKWAndArgsInfo
1559  ReadTemplateKWAndArgsInfo(*E->getTrailingASTTemplateKWAndArgsInfo(),
1561  /*NumTemplateArgs=*/Record.readInt());
1562 
1563  unsigned NumDecls = Record.readInt();
1564  UnresolvedSet<8> Decls;
1565  for (unsigned i = 0; i != NumDecls; ++i) {
1566  auto *D = ReadDeclAs<NamedDecl>();
1567  auto AS = (AccessSpecifier)Record.readInt();
1568  Decls.addDecl(D, AS);
1569  }
1570  E->initializeResults(Record.getContext(), Decls.begin(), Decls.end());
1571 
1572  ReadDeclarationNameInfo(E->NameInfo);
1573  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1574 }
1575 
1576 void ASTStmtReader::VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
1577  VisitOverloadExpr(E);
1578  E->IsArrow = Record.readInt();
1579  E->HasUnresolvedUsing = Record.readInt();
1580  E->Base = Record.readSubExpr();
1581  E->BaseType = Record.readType();
1582  E->OperatorLoc = ReadSourceLocation();
1583 }
1584 
1585 void ASTStmtReader::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) {
1586  VisitOverloadExpr(E);
1587  E->RequiresADL = Record.readInt();
1588  E->Overloaded = Record.readInt();
1589  E->NamingClass = ReadDeclAs<CXXRecordDecl>();
1590 }
1591 
1592 void ASTStmtReader::VisitTypeTraitExpr(TypeTraitExpr *E) {
1593  VisitExpr(E);
1594  E->TypeTraitExprBits.NumArgs = Record.readInt();
1595  E->TypeTraitExprBits.Kind = Record.readInt();
1596  E->TypeTraitExprBits.Value = Record.readInt();
1597  SourceRange Range = ReadSourceRange();
1598  E->Loc = Range.getBegin();
1599  E->RParenLoc = Range.getEnd();
1600 
1601  auto **Args = E->getTrailingObjects<TypeSourceInfo *>();
1602  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1603  Args[I] = GetTypeSourceInfo();
1604 }
1605 
1606 void ASTStmtReader::VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E) {
1607  VisitExpr(E);
1608  E->ATT = (ArrayTypeTrait)Record.readInt();
1609  E->Value = (unsigned int)Record.readInt();
1610  SourceRange Range = ReadSourceRange();
1611  E->Loc = Range.getBegin();
1612  E->RParen = Range.getEnd();
1613  E->QueriedType = GetTypeSourceInfo();
1614  E->Dimension = Record.readSubExpr();
1615 }
1616 
1617 void ASTStmtReader::VisitExpressionTraitExpr(ExpressionTraitExpr *E) {
1618  VisitExpr(E);
1619  E->ET = (ExpressionTrait)Record.readInt();
1620  E->Value = (bool)Record.readInt();
1621  SourceRange Range = ReadSourceRange();
1622  E->QueriedExpression = Record.readSubExpr();
1623  E->Loc = Range.getBegin();
1624  E->RParen = Range.getEnd();
1625 }
1626 
1627 void ASTStmtReader::VisitCXXNoexceptExpr(CXXNoexceptExpr *E) {
1628  VisitExpr(E);
1629  E->Value = (bool)Record.readInt();
1630  E->Range = ReadSourceRange();
1631  E->Operand = Record.readSubExpr();
1632 }
1633 
1634 void ASTStmtReader::VisitPackExpansionExpr(PackExpansionExpr *E) {
1635  VisitExpr(E);
1636  E->EllipsisLoc = ReadSourceLocation();
1637  E->NumExpansions = Record.readInt();
1638  E->Pattern = Record.readSubExpr();
1639 }
1640 
1641 void ASTStmtReader::VisitSizeOfPackExpr(SizeOfPackExpr *E) {
1642  VisitExpr(E);
1643  unsigned NumPartialArgs = Record.readInt();
1644  E->OperatorLoc = ReadSourceLocation();
1645  E->PackLoc = ReadSourceLocation();
1646  E->RParenLoc = ReadSourceLocation();
1647  E->Pack = Record.readDeclAs<NamedDecl>();
1648  if (E->isPartiallySubstituted()) {
1649  assert(E->Length == NumPartialArgs);
1650  for (auto *I = E->getTrailingObjects<TemplateArgument>(),
1651  *E = I + NumPartialArgs;
1652  I != E; ++I)
1653  new (I) TemplateArgument(Record.readTemplateArgument());
1654  } else if (!E->isValueDependent()) {
1655  E->Length = Record.readInt();
1656  }
1657 }
1658 
1659 void ASTStmtReader::VisitSubstNonTypeTemplateParmExpr(
1661  VisitExpr(E);
1662  E->Param = ReadDeclAs<NonTypeTemplateParmDecl>();
1663  E->NameLoc = ReadSourceLocation();
1664  E->Replacement = Record.readSubExpr();
1665 }
1666 
1667 void ASTStmtReader::VisitSubstNonTypeTemplateParmPackExpr(
1669  VisitExpr(E);
1670  E->Param = ReadDeclAs<NonTypeTemplateParmDecl>();
1671  TemplateArgument ArgPack = Record.readTemplateArgument();
1672  if (ArgPack.getKind() != TemplateArgument::Pack)
1673  return;
1674 
1675  E->Arguments = ArgPack.pack_begin();
1676  E->NumArguments = ArgPack.pack_size();
1677  E->NameLoc = ReadSourceLocation();
1678 }
1679 
1680 void ASTStmtReader::VisitFunctionParmPackExpr(FunctionParmPackExpr *E) {
1681  VisitExpr(E);
1682  E->NumParameters = Record.readInt();
1683  E->ParamPack = ReadDeclAs<ParmVarDecl>();
1684  E->NameLoc = ReadSourceLocation();
1685  auto **Parms = E->getTrailingObjects<ParmVarDecl *>();
1686  for (unsigned i = 0, n = E->NumParameters; i != n; ++i)
1687  Parms[i] = ReadDeclAs<ParmVarDecl>();
1688 }
1689 
1690 void ASTStmtReader::VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E) {
1691  VisitExpr(E);
1692  E->State = Record.readSubExpr();
1693  auto *VD = ReadDeclAs<ValueDecl>();
1694  unsigned ManglingNumber = Record.readInt();
1695  E->setExtendingDecl(VD, ManglingNumber);
1696 }
1697 
1698 void ASTStmtReader::VisitCXXFoldExpr(CXXFoldExpr *E) {
1699  VisitExpr(E);
1700  E->LParenLoc = ReadSourceLocation();
1701  E->EllipsisLoc = ReadSourceLocation();
1702  E->RParenLoc = ReadSourceLocation();
1703  E->SubExprs[0] = Record.readSubExpr();
1704  E->SubExprs[1] = Record.readSubExpr();
1705  E->Opcode = (BinaryOperatorKind)Record.readInt();
1706 }
1707 
1708 void ASTStmtReader::VisitOpaqueValueExpr(OpaqueValueExpr *E) {
1709  VisitExpr(E);
1710  E->SourceExpr = Record.readSubExpr();
1711  E->Loc = ReadSourceLocation();
1712  E->setIsUnique(Record.readInt());
1713 }
1714 
1715 void ASTStmtReader::VisitTypoExpr(TypoExpr *E) {
1716  llvm_unreachable("Cannot read TypoExpr nodes");
1717 }
1718 
1719 //===----------------------------------------------------------------------===//
1720 // Microsoft Expressions and Statements
1721 //===----------------------------------------------------------------------===//
1722 void ASTStmtReader::VisitMSPropertyRefExpr(MSPropertyRefExpr *E) {
1723  VisitExpr(E);
1724  E->IsArrow = (Record.readInt() != 0);
1725  E->BaseExpr = Record.readSubExpr();
1726  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1727  E->MemberLoc = ReadSourceLocation();
1728  E->TheDecl = ReadDeclAs<MSPropertyDecl>();
1729 }
1730 
1731 void ASTStmtReader::VisitMSPropertySubscriptExpr(MSPropertySubscriptExpr *E) {
1732  VisitExpr(E);
1733  E->setBase(Record.readSubExpr());
1734  E->setIdx(Record.readSubExpr());
1735  E->setRBracketLoc(ReadSourceLocation());
1736 }
1737 
1738 void ASTStmtReader::VisitCXXUuidofExpr(CXXUuidofExpr *E) {
1739  VisitExpr(E);
1740  E->setSourceRange(ReadSourceRange());
1741  std::string UuidStr = ReadString();
1742  E->setUuidStr(StringRef(UuidStr).copy(Record.getContext()));
1743  if (E->isTypeOperand()) { // __uuidof(ComType)
1745  GetTypeSourceInfo());
1746  return;
1747  }
1748 
1749  // __uuidof(expr)
1750  E->setExprOperand(Record.readSubExpr());
1751 }
1752 
1753 void ASTStmtReader::VisitSEHLeaveStmt(SEHLeaveStmt *S) {
1754  VisitStmt(S);
1755  S->setLeaveLoc(ReadSourceLocation());
1756 }
1757 
1758 void ASTStmtReader::VisitSEHExceptStmt(SEHExceptStmt *S) {
1759  VisitStmt(S);
1760  S->Loc = ReadSourceLocation();
1761  S->Children[SEHExceptStmt::FILTER_EXPR] = Record.readSubStmt();
1762  S->Children[SEHExceptStmt::BLOCK] = Record.readSubStmt();
1763 }
1764 
1765 void ASTStmtReader::VisitSEHFinallyStmt(SEHFinallyStmt *S) {
1766  VisitStmt(S);
1767  S->Loc = ReadSourceLocation();
1768  S->Block = Record.readSubStmt();
1769 }
1770 
1771 void ASTStmtReader::VisitSEHTryStmt(SEHTryStmt *S) {
1772  VisitStmt(S);
1773  S->IsCXXTry = Record.readInt();
1774  S->TryLoc = ReadSourceLocation();
1775  S->Children[SEHTryStmt::TRY] = Record.readSubStmt();
1776  S->Children[SEHTryStmt::HANDLER] = Record.readSubStmt();
1777 }
1778 
1779 //===----------------------------------------------------------------------===//
1780 // CUDA Expressions and Statements
1781 //===----------------------------------------------------------------------===//
1782 
1783 void ASTStmtReader::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E) {
1784  VisitCallExpr(E);
1785  E->setConfig(cast<CallExpr>(Record.readSubExpr()));
1786 }
1787 
1788 //===----------------------------------------------------------------------===//
1789 // OpenCL Expressions and Statements.
1790 //===----------------------------------------------------------------------===//
1791 void ASTStmtReader::VisitAsTypeExpr(AsTypeExpr *E) {
1792  VisitExpr(E);
1793  E->BuiltinLoc = ReadSourceLocation();
1794  E->RParenLoc = ReadSourceLocation();
1795  E->SrcExpr = Record.readSubExpr();
1796 }
1797 
1798 //===----------------------------------------------------------------------===//
1799 // OpenMP Clauses.
1800 //===----------------------------------------------------------------------===//
1801 
1802 namespace clang {
1803 
1804 class OMPClauseReader : public OMPClauseVisitor<OMPClauseReader> {
1805  ASTStmtReader *Reader;
1806  ASTContext &Context;
1807 
1808 public:
1810  : Reader(R), Context(Record.getContext()) {}
1811 
1812 #define OPENMP_CLAUSE(Name, Class) void Visit##Class(Class *C);
1813 #include "clang/Basic/OpenMPKinds.def"
1814  OMPClause *readClause();
1815  void VisitOMPClauseWithPreInit(OMPClauseWithPreInit *C);
1816  void VisitOMPClauseWithPostUpdate(OMPClauseWithPostUpdate *C);
1817 };
1818 
1819 } // namespace clang
1820 
1822  OMPClause *C;
1823  switch (Reader->Record.readInt()) {
1824  case OMPC_if:
1825  C = new (Context) OMPIfClause();
1826  break;
1827  case OMPC_final:
1828  C = new (Context) OMPFinalClause();
1829  break;
1830  case OMPC_num_threads:
1831  C = new (Context) OMPNumThreadsClause();
1832  break;
1833  case OMPC_safelen:
1834  C = new (Context) OMPSafelenClause();
1835  break;
1836  case OMPC_simdlen:
1837  C = new (Context) OMPSimdlenClause();
1838  break;
1839  case OMPC_collapse:
1840  C = new (Context) OMPCollapseClause();
1841  break;
1842  case OMPC_default:
1843  C = new (Context) OMPDefaultClause();
1844  break;
1845  case OMPC_proc_bind:
1846  C = new (Context) OMPProcBindClause();
1847  break;
1848  case OMPC_schedule:
1849  C = new (Context) OMPScheduleClause();
1850  break;
1851  case OMPC_ordered:
1852  C = new (Context) OMPOrderedClause();
1853  break;
1854  case OMPC_nowait:
1855  C = new (Context) OMPNowaitClause();
1856  break;
1857  case OMPC_untied:
1858  C = new (Context) OMPUntiedClause();
1859  break;
1860  case OMPC_mergeable:
1861  C = new (Context) OMPMergeableClause();
1862  break;
1863  case OMPC_read:
1864  C = new (Context) OMPReadClause();
1865  break;
1866  case OMPC_write:
1867  C = new (Context) OMPWriteClause();
1868  break;
1869  case OMPC_update:
1870  C = new (Context) OMPUpdateClause();
1871  break;
1872  case OMPC_capture:
1873  C = new (Context) OMPCaptureClause();
1874  break;
1875  case OMPC_seq_cst:
1876  C = new (Context) OMPSeqCstClause();
1877  break;
1878  case OMPC_threads:
1879  C = new (Context) OMPThreadsClause();
1880  break;
1881  case OMPC_simd:
1882  C = new (Context) OMPSIMDClause();
1883  break;
1884  case OMPC_nogroup:
1885  C = new (Context) OMPNogroupClause();
1886  break;
1887  case OMPC_private:
1888  C = OMPPrivateClause::CreateEmpty(Context, Reader->Record.readInt());
1889  break;
1890  case OMPC_firstprivate:
1891  C = OMPFirstprivateClause::CreateEmpty(Context, Reader->Record.readInt());
1892  break;
1893  case OMPC_lastprivate:
1894  C = OMPLastprivateClause::CreateEmpty(Context, Reader->Record.readInt());
1895  break;
1896  case OMPC_shared:
1897  C = OMPSharedClause::CreateEmpty(Context, Reader->Record.readInt());
1898  break;
1899  case OMPC_reduction:
1900  C = OMPReductionClause::CreateEmpty(Context, Reader->Record.readInt());
1901  break;
1902  case OMPC_task_reduction:
1903  C = OMPTaskReductionClause::CreateEmpty(Context, Reader->Record.readInt());
1904  break;
1905  case OMPC_in_reduction:
1906  C = OMPInReductionClause::CreateEmpty(Context, Reader->Record.readInt());
1907  break;
1908  case OMPC_linear:
1909  C = OMPLinearClause::CreateEmpty(Context, Reader->Record.readInt());
1910  break;
1911  case OMPC_aligned:
1912  C = OMPAlignedClause::CreateEmpty(Context, Reader->Record.readInt());
1913  break;
1914  case OMPC_copyin:
1915  C = OMPCopyinClause::CreateEmpty(Context, Reader->Record.readInt());
1916  break;
1917  case OMPC_copyprivate:
1918  C = OMPCopyprivateClause::CreateEmpty(Context, Reader->Record.readInt());
1919  break;
1920  case OMPC_flush:
1921  C = OMPFlushClause::CreateEmpty(Context, Reader->Record.readInt());
1922  break;
1923  case OMPC_depend:
1924  C = OMPDependClause::CreateEmpty(Context, Reader->Record.readInt());
1925  break;
1926  case OMPC_device:
1927  C = new (Context) OMPDeviceClause();
1928  break;
1929  case OMPC_map: {
1930  unsigned NumVars = Reader->Record.readInt();
1931  unsigned NumDeclarations = Reader->Record.readInt();
1932  unsigned NumLists = Reader->Record.readInt();
1933  unsigned NumComponents = Reader->Record.readInt();
1934  C = OMPMapClause::CreateEmpty(Context, NumVars, NumDeclarations, NumLists,
1935  NumComponents);
1936  break;
1937  }
1938  case OMPC_num_teams:
1939  C = new (Context) OMPNumTeamsClause();
1940  break;
1941  case OMPC_thread_limit:
1942  C = new (Context) OMPThreadLimitClause();
1943  break;
1944  case OMPC_priority:
1945  C = new (Context) OMPPriorityClause();
1946  break;
1947  case OMPC_grainsize:
1948  C = new (Context) OMPGrainsizeClause();
1949  break;
1950  case OMPC_num_tasks:
1951  C = new (Context) OMPNumTasksClause();
1952  break;
1953  case OMPC_hint:
1954  C = new (Context) OMPHintClause();
1955  break;
1956  case OMPC_dist_schedule:
1957  C = new (Context) OMPDistScheduleClause();
1958  break;
1959  case OMPC_defaultmap:
1960  C = new (Context) OMPDefaultmapClause();
1961  break;
1962  case OMPC_to: {
1963  unsigned NumVars = Reader->Record.readInt();
1964  unsigned NumDeclarations = Reader->Record.readInt();
1965  unsigned NumLists = Reader->Record.readInt();
1966  unsigned NumComponents = Reader->Record.readInt();
1967  C = OMPToClause::CreateEmpty(Context, NumVars, NumDeclarations, NumLists,
1968  NumComponents);
1969  break;
1970  }
1971  case OMPC_from: {
1972  unsigned NumVars = Reader->Record.readInt();
1973  unsigned NumDeclarations = Reader->Record.readInt();
1974  unsigned NumLists = Reader->Record.readInt();
1975  unsigned NumComponents = Reader->Record.readInt();
1976  C = OMPFromClause::CreateEmpty(Context, NumVars, NumDeclarations, NumLists,
1977  NumComponents);
1978  break;
1979  }
1980  case OMPC_use_device_ptr: {
1981  unsigned NumVars = Reader->Record.readInt();
1982  unsigned NumDeclarations = Reader->Record.readInt();
1983  unsigned NumLists = Reader->Record.readInt();
1984  unsigned NumComponents = Reader->Record.readInt();
1985  C = OMPUseDevicePtrClause::CreateEmpty(Context, NumVars, NumDeclarations,
1986  NumLists, NumComponents);
1987  break;
1988  }
1989  case OMPC_is_device_ptr: {
1990  unsigned NumVars = Reader->Record.readInt();
1991  unsigned NumDeclarations = Reader->Record.readInt();
1992  unsigned NumLists = Reader->Record.readInt();
1993  unsigned NumComponents = Reader->Record.readInt();
1994  C = OMPIsDevicePtrClause::CreateEmpty(Context, NumVars, NumDeclarations,
1995  NumLists, NumComponents);
1996  break;
1997  }
1998  }
1999  Visit(C);
2000  C->setLocStart(Reader->ReadSourceLocation());
2001  C->setLocEnd(Reader->ReadSourceLocation());
2002 
2003  return C;
2004 }
2005 
2007  C->setPreInitStmt(Reader->Record.readSubStmt(),
2008  static_cast<OpenMPDirectiveKind>(Reader->Record.readInt()));
2009 }
2010 
2012  VisitOMPClauseWithPreInit(C);
2013  C->setPostUpdateExpr(Reader->Record.readSubExpr());
2014 }
2015 
2016 void OMPClauseReader::VisitOMPIfClause(OMPIfClause *C) {
2017  VisitOMPClauseWithPreInit(C);
2018  C->setNameModifier(static_cast<OpenMPDirectiveKind>(Reader->Record.readInt()));
2019  C->setNameModifierLoc(Reader->ReadSourceLocation());
2020  C->setColonLoc(Reader->ReadSourceLocation());
2021  C->setCondition(Reader->Record.readSubExpr());
2022  C->setLParenLoc(Reader->ReadSourceLocation());
2023 }
2024 
2025 void OMPClauseReader::VisitOMPFinalClause(OMPFinalClause *C) {
2026  C->setCondition(Reader->Record.readSubExpr());
2027  C->setLParenLoc(Reader->ReadSourceLocation());
2028 }
2029 
2030 void OMPClauseReader::VisitOMPNumThreadsClause(OMPNumThreadsClause *C) {
2031  VisitOMPClauseWithPreInit(C);
2032  C->setNumThreads(Reader->Record.readSubExpr());
2033  C->setLParenLoc(Reader->ReadSourceLocation());
2034 }
2035 
2036 void OMPClauseReader::VisitOMPSafelenClause(OMPSafelenClause *C) {
2037  C->setSafelen(Reader->Record.readSubExpr());
2038  C->setLParenLoc(Reader->ReadSourceLocation());
2039 }
2040 
2041 void OMPClauseReader::VisitOMPSimdlenClause(OMPSimdlenClause *C) {
2042  C->setSimdlen(Reader->Record.readSubExpr());
2043  C->setLParenLoc(Reader->ReadSourceLocation());
2044 }
2045 
2046 void OMPClauseReader::VisitOMPCollapseClause(OMPCollapseClause *C) {
2047  C->setNumForLoops(Reader->Record.readSubExpr());
2048  C->setLParenLoc(Reader->ReadSourceLocation());
2049 }
2050 
2051 void OMPClauseReader::VisitOMPDefaultClause(OMPDefaultClause *C) {
2052  C->setDefaultKind(
2053  static_cast<OpenMPDefaultClauseKind>(Reader->Record.readInt()));
2054  C->setLParenLoc(Reader->ReadSourceLocation());
2055  C->setDefaultKindKwLoc(Reader->ReadSourceLocation());
2056 }
2057 
2058 void OMPClauseReader::VisitOMPProcBindClause(OMPProcBindClause *C) {
2059  C->setProcBindKind(
2060  static_cast<OpenMPProcBindClauseKind>(Reader->Record.readInt()));
2061  C->setLParenLoc(Reader->ReadSourceLocation());
2062  C->setProcBindKindKwLoc(Reader->ReadSourceLocation());
2063 }
2064 
2065 void OMPClauseReader::VisitOMPScheduleClause(OMPScheduleClause *C) {
2066  VisitOMPClauseWithPreInit(C);
2067  C->setScheduleKind(
2068  static_cast<OpenMPScheduleClauseKind>(Reader->Record.readInt()));
2069  C->setFirstScheduleModifier(
2070  static_cast<OpenMPScheduleClauseModifier>(Reader->Record.readInt()));
2071  C->setSecondScheduleModifier(
2072  static_cast<OpenMPScheduleClauseModifier>(Reader->Record.readInt()));
2073  C->setChunkSize(Reader->Record.readSubExpr());
2074  C->setLParenLoc(Reader->ReadSourceLocation());
2075  C->setFirstScheduleModifierLoc(Reader->ReadSourceLocation());
2076  C->setSecondScheduleModifierLoc(Reader->ReadSourceLocation());
2077  C->setScheduleKindLoc(Reader->ReadSourceLocation());
2078  C->setCommaLoc(Reader->ReadSourceLocation());
2079 }
2080 
2081 void OMPClauseReader::VisitOMPOrderedClause(OMPOrderedClause *C) {
2082  C->setNumForLoops(Reader->Record.readSubExpr());
2083  C->setLParenLoc(Reader->ReadSourceLocation());
2084 }
2085 
2086 void OMPClauseReader::VisitOMPNowaitClause(OMPNowaitClause *) {}
2087 
2088 void OMPClauseReader::VisitOMPUntiedClause(OMPUntiedClause *) {}
2089 
2090 void OMPClauseReader::VisitOMPMergeableClause(OMPMergeableClause *) {}
2091 
2092 void OMPClauseReader::VisitOMPReadClause(OMPReadClause *) {}
2093 
2094 void OMPClauseReader::VisitOMPWriteClause(OMPWriteClause *) {}
2095 
2096 void OMPClauseReader::VisitOMPUpdateClause(OMPUpdateClause *) {}
2097 
2098 void OMPClauseReader::VisitOMPCaptureClause(OMPCaptureClause *) {}
2099 
2100 void OMPClauseReader::VisitOMPSeqCstClause(OMPSeqCstClause *) {}
2101 
2102 void OMPClauseReader::VisitOMPThreadsClause(OMPThreadsClause *) {}
2103 
2104 void OMPClauseReader::VisitOMPSIMDClause(OMPSIMDClause *) {}
2105 
2106 void OMPClauseReader::VisitOMPNogroupClause(OMPNogroupClause *) {}
2107 
2108 void OMPClauseReader::VisitOMPPrivateClause(OMPPrivateClause *C) {
2109  C->setLParenLoc(Reader->ReadSourceLocation());
2110  unsigned NumVars = C->varlist_size();
2112  Vars.reserve(NumVars);
2113  for (unsigned i = 0; i != NumVars; ++i)
2114  Vars.push_back(Reader->Record.readSubExpr());
2115  C->setVarRefs(Vars);
2116  Vars.clear();
2117  for (unsigned i = 0; i != NumVars; ++i)
2118  Vars.push_back(Reader->Record.readSubExpr());
2119  C->setPrivateCopies(Vars);
2120 }
2121 
2122 void OMPClauseReader::VisitOMPFirstprivateClause(OMPFirstprivateClause *C) {
2123  VisitOMPClauseWithPreInit(C);
2124  C->setLParenLoc(Reader->ReadSourceLocation());
2125  unsigned NumVars = C->varlist_size();
2127  Vars.reserve(NumVars);
2128  for (unsigned i = 0; i != NumVars; ++i)
2129  Vars.push_back(Reader->Record.readSubExpr());
2130  C->setVarRefs(Vars);
2131  Vars.clear();
2132  for (unsigned i = 0; i != NumVars; ++i)
2133  Vars.push_back(Reader->Record.readSubExpr());
2134  C->setPrivateCopies(Vars);
2135  Vars.clear();
2136  for (unsigned i = 0; i != NumVars; ++i)
2137  Vars.push_back(Reader->Record.readSubExpr());
2138  C->setInits(Vars);
2139 }
2140 
2141 void OMPClauseReader::VisitOMPLastprivateClause(OMPLastprivateClause *C) {
2142  VisitOMPClauseWithPostUpdate(C);
2143  C->setLParenLoc(Reader->ReadSourceLocation());
2144  unsigned NumVars = C->varlist_size();
2146  Vars.reserve(NumVars);
2147  for (unsigned i = 0; i != NumVars; ++i)
2148  Vars.push_back(Reader->Record.readSubExpr());
2149  C->setVarRefs(Vars);
2150  Vars.clear();
2151  for (unsigned i = 0; i != NumVars; ++i)
2152  Vars.push_back(Reader->Record.readSubExpr());
2153  C->setPrivateCopies(Vars);
2154  Vars.clear();
2155  for (unsigned i = 0; i != NumVars; ++i)
2156  Vars.push_back(Reader->Record.readSubExpr());
2157  C->setSourceExprs(Vars);
2158  Vars.clear();
2159  for (unsigned i = 0; i != NumVars; ++i)
2160  Vars.push_back(Reader->Record.readSubExpr());
2161  C->setDestinationExprs(Vars);
2162  Vars.clear();
2163  for (unsigned i = 0; i != NumVars; ++i)
2164  Vars.push_back(Reader->Record.readSubExpr());
2165  C->setAssignmentOps(Vars);
2166 }
2167 
2168 void OMPClauseReader::VisitOMPSharedClause(OMPSharedClause *C) {
2169  C->setLParenLoc(Reader->ReadSourceLocation());
2170  unsigned NumVars = C->varlist_size();
2172  Vars.reserve(NumVars);
2173  for (unsigned i = 0; i != NumVars; ++i)
2174  Vars.push_back(Reader->Record.readSubExpr());
2175  C->setVarRefs(Vars);
2176 }
2177 
2178 void OMPClauseReader::VisitOMPReductionClause(OMPReductionClause *C) {
2179  VisitOMPClauseWithPostUpdate(C);
2180  C->setLParenLoc(Reader->ReadSourceLocation());
2181  C->setColonLoc(Reader->ReadSourceLocation());
2182  NestedNameSpecifierLoc NNSL = Reader->Record.readNestedNameSpecifierLoc();
2183  DeclarationNameInfo DNI;
2184  Reader->ReadDeclarationNameInfo(DNI);
2185  C->setQualifierLoc(NNSL);
2186  C->setNameInfo(DNI);
2187 
2188  unsigned NumVars = C->varlist_size();
2190  Vars.reserve(NumVars);
2191  for (unsigned i = 0; i != NumVars; ++i)
2192  Vars.push_back(Reader->Record.readSubExpr());
2193  C->setVarRefs(Vars);
2194  Vars.clear();
2195  for (unsigned i = 0; i != NumVars; ++i)
2196  Vars.push_back(Reader->Record.readSubExpr());
2197  C->setPrivates(Vars);
2198  Vars.clear();
2199  for (unsigned i = 0; i != NumVars; ++i)
2200  Vars.push_back(Reader->Record.readSubExpr());
2201  C->setLHSExprs(Vars);
2202  Vars.clear();
2203  for (unsigned i = 0; i != NumVars; ++i)
2204  Vars.push_back(Reader->Record.readSubExpr());
2205  C->setRHSExprs(Vars);
2206  Vars.clear();
2207  for (unsigned i = 0; i != NumVars; ++i)
2208  Vars.push_back(Reader->Record.readSubExpr());
2209  C->setReductionOps(Vars);
2210 }
2211 
2212 void OMPClauseReader::VisitOMPTaskReductionClause(OMPTaskReductionClause *C) {
2213  VisitOMPClauseWithPostUpdate(C);
2214  C->setLParenLoc(Reader->ReadSourceLocation());
2215  C->setColonLoc(Reader->ReadSourceLocation());
2216  NestedNameSpecifierLoc NNSL = Reader->Record.readNestedNameSpecifierLoc();
2217  DeclarationNameInfo DNI;
2218  Reader->ReadDeclarationNameInfo(DNI);
2219  C->setQualifierLoc(NNSL);
2220  C->setNameInfo(DNI);
2221 
2222  unsigned NumVars = C->varlist_size();
2224  Vars.reserve(NumVars);
2225  for (unsigned I = 0; I != NumVars; ++I)
2226  Vars.push_back(Reader->Record.readSubExpr());
2227  C->setVarRefs(Vars);
2228  Vars.clear();
2229  for (unsigned I = 0; I != NumVars; ++I)
2230  Vars.push_back(Reader->Record.readSubExpr());
2231  C->setPrivates(Vars);
2232  Vars.clear();
2233  for (unsigned I = 0; I != NumVars; ++I)
2234  Vars.push_back(Reader->Record.readSubExpr());
2235  C->setLHSExprs(Vars);
2236  Vars.clear();
2237  for (unsigned I = 0; I != NumVars; ++I)
2238  Vars.push_back(Reader->Record.readSubExpr());
2239  C->setRHSExprs(Vars);
2240  Vars.clear();
2241  for (unsigned I = 0; I != NumVars; ++I)
2242  Vars.push_back(Reader->Record.readSubExpr());
2243  C->setReductionOps(Vars);
2244 }
2245 
2246 void OMPClauseReader::VisitOMPInReductionClause(OMPInReductionClause *C) {
2247  VisitOMPClauseWithPostUpdate(C);
2248  C->setLParenLoc(Reader->ReadSourceLocation());
2249  C->setColonLoc(Reader->ReadSourceLocation());
2250  NestedNameSpecifierLoc NNSL = Reader->Record.readNestedNameSpecifierLoc();
2251  DeclarationNameInfo DNI;
2252  Reader->ReadDeclarationNameInfo(DNI);
2253  C->setQualifierLoc(NNSL);
2254  C->setNameInfo(DNI);
2255 
2256  unsigned NumVars = C->varlist_size();
2258  Vars.reserve(NumVars);
2259  for (unsigned I = 0; I != NumVars; ++I)
2260  Vars.push_back(Reader->Record.readSubExpr());
2261  C->setVarRefs(Vars);
2262  Vars.clear();
2263  for (unsigned I = 0; I != NumVars; ++I)
2264  Vars.push_back(Reader->Record.readSubExpr());
2265  C->setPrivates(Vars);
2266  Vars.clear();
2267  for (unsigned I = 0; I != NumVars; ++I)
2268  Vars.push_back(Reader->Record.readSubExpr());
2269  C->setLHSExprs(Vars);
2270  Vars.clear();
2271  for (unsigned I = 0; I != NumVars; ++I)
2272  Vars.push_back(Reader->Record.readSubExpr());
2273  C->setRHSExprs(Vars);
2274  Vars.clear();
2275  for (unsigned I = 0; I != NumVars; ++I)
2276  Vars.push_back(Reader->Record.readSubExpr());
2277  C->setReductionOps(Vars);
2278  Vars.clear();
2279  for (unsigned I = 0; I != NumVars; ++I)
2280  Vars.push_back(Reader->Record.readSubExpr());
2281  C->setTaskgroupDescriptors(Vars);
2282 }
2283 
2284 void OMPClauseReader::VisitOMPLinearClause(OMPLinearClause *C) {
2285  VisitOMPClauseWithPostUpdate(C);
2286  C->setLParenLoc(Reader->ReadSourceLocation());
2287  C->setColonLoc(Reader->ReadSourceLocation());
2288  C->setModifier(static_cast<OpenMPLinearClauseKind>(Reader->Record.readInt()));
2289  C->setModifierLoc(Reader->ReadSourceLocation());
2290  unsigned NumVars = C->varlist_size();
2292  Vars.reserve(NumVars);
2293  for (unsigned i = 0; i != NumVars; ++i)
2294  Vars.push_back(Reader->Record.readSubExpr());
2295  C->setVarRefs(Vars);
2296  Vars.clear();
2297  for (unsigned i = 0; i != NumVars; ++i)
2298  Vars.push_back(Reader->Record.readSubExpr());
2299  C->setPrivates(Vars);
2300  Vars.clear();
2301  for (unsigned i = 0; i != NumVars; ++i)
2302  Vars.push_back(Reader->Record.readSubExpr());
2303  C->setInits(Vars);
2304  Vars.clear();
2305  for (unsigned i = 0; i != NumVars; ++i)
2306  Vars.push_back(Reader->Record.readSubExpr());
2307  C->setUpdates(Vars);
2308  Vars.clear();
2309  for (unsigned i = 0; i != NumVars; ++i)
2310  Vars.push_back(Reader->Record.readSubExpr());
2311  C->setFinals(Vars);
2312  C->setStep(Reader->Record.readSubExpr());
2313  C->setCalcStep(Reader->Record.readSubExpr());
2314 }
2315 
2316 void OMPClauseReader::VisitOMPAlignedClause(OMPAlignedClause *C) {
2317  C->setLParenLoc(Reader->ReadSourceLocation());
2318  C->setColonLoc(Reader->ReadSourceLocation());
2319  unsigned NumVars = C->varlist_size();
2321  Vars.reserve(NumVars);
2322  for (unsigned i = 0; i != NumVars; ++i)
2323  Vars.push_back(Reader->Record.readSubExpr());
2324  C->setVarRefs(Vars);
2325  C->setAlignment(Reader->Record.readSubExpr());
2326 }
2327 
2328 void OMPClauseReader::VisitOMPCopyinClause(OMPCopyinClause *C) {
2329  C->setLParenLoc(Reader->ReadSourceLocation());
2330  unsigned NumVars = C->varlist_size();
2332  Exprs.reserve(NumVars);
2333  for (unsigned i = 0; i != NumVars; ++i)
2334  Exprs.push_back(Reader->Record.readSubExpr());
2335  C->setVarRefs(Exprs);
2336  Exprs.clear();
2337  for (unsigned i = 0; i != NumVars; ++i)
2338  Exprs.push_back(Reader->Record.readSubExpr());
2339  C->setSourceExprs(Exprs);
2340  Exprs.clear();
2341  for (unsigned i = 0; i != NumVars; ++i)
2342  Exprs.push_back(Reader->Record.readSubExpr());
2343  C->setDestinationExprs(Exprs);
2344  Exprs.clear();
2345  for (unsigned i = 0; i != NumVars; ++i)
2346  Exprs.push_back(Reader->Record.readSubExpr());
2347  C->setAssignmentOps(Exprs);
2348 }
2349 
2350 void OMPClauseReader::VisitOMPCopyprivateClause(OMPCopyprivateClause *C) {
2351  C->setLParenLoc(Reader->ReadSourceLocation());
2352  unsigned NumVars = C->varlist_size();
2354  Exprs.reserve(NumVars);
2355  for (unsigned i = 0; i != NumVars; ++i)
2356  Exprs.push_back(Reader->Record.readSubExpr());
2357  C->setVarRefs(Exprs);
2358  Exprs.clear();
2359  for (unsigned i = 0; i != NumVars; ++i)
2360  Exprs.push_back(Reader->Record.readSubExpr());
2361  C->setSourceExprs(Exprs);
2362  Exprs.clear();
2363  for (unsigned i = 0; i != NumVars; ++i)
2364  Exprs.push_back(Reader->Record.readSubExpr());
2365  C->setDestinationExprs(Exprs);
2366  Exprs.clear();
2367  for (unsigned i = 0; i != NumVars; ++i)
2368  Exprs.push_back(Reader->Record.readSubExpr());
2369  C->setAssignmentOps(Exprs);
2370 }
2371 
2372 void OMPClauseReader::VisitOMPFlushClause(OMPFlushClause *C) {
2373  C->setLParenLoc(Reader->ReadSourceLocation());
2374  unsigned NumVars = C->varlist_size();
2376  Vars.reserve(NumVars);
2377  for (unsigned i = 0; i != NumVars; ++i)
2378  Vars.push_back(Reader->Record.readSubExpr());
2379  C->setVarRefs(Vars);
2380 }
2381 
2382 void OMPClauseReader::VisitOMPDependClause(OMPDependClause *C) {
2383  C->setLParenLoc(Reader->ReadSourceLocation());
2384  C->setDependencyKind(
2385  static_cast<OpenMPDependClauseKind>(Reader->Record.readInt()));
2386  C->setDependencyLoc(Reader->ReadSourceLocation());
2387  C->setColonLoc(Reader->ReadSourceLocation());
2388  unsigned NumVars = C->varlist_size();
2390  Vars.reserve(NumVars);
2391  for (unsigned i = 0; i != NumVars; ++i)
2392  Vars.push_back(Reader->Record.readSubExpr());
2393  C->setVarRefs(Vars);
2394  C->setCounterValue(Reader->Record.readSubExpr());
2395 }
2396 
2397 void OMPClauseReader::VisitOMPDeviceClause(OMPDeviceClause *C) {
2398  VisitOMPClauseWithPreInit(C);
2399  C->setDevice(Reader->Record.readSubExpr());
2400  C->setLParenLoc(Reader->ReadSourceLocation());
2401 }
2402 
2403 void OMPClauseReader::VisitOMPMapClause(OMPMapClause *C) {
2404  C->setLParenLoc(Reader->ReadSourceLocation());
2405  C->setMapTypeModifier(
2406  static_cast<OpenMPMapClauseKind>(Reader->Record.readInt()));
2407  C->setMapType(
2408  static_cast<OpenMPMapClauseKind>(Reader->Record.readInt()));
2409  C->setMapLoc(Reader->ReadSourceLocation());
2410  C->setColonLoc(Reader->ReadSourceLocation());
2411  auto NumVars = C->varlist_size();
2412  auto UniqueDecls = C->getUniqueDeclarationsNum();
2413  auto TotalLists = C->getTotalComponentListNum();
2414  auto TotalComponents = C->getTotalComponentsNum();
2415 
2417  Vars.reserve(NumVars);
2418  for (unsigned i = 0; i != NumVars; ++i)
2419  Vars.push_back(Reader->Record.readSubExpr());
2420  C->setVarRefs(Vars);
2421 
2423  Decls.reserve(UniqueDecls);
2424  for (unsigned i = 0; i < UniqueDecls; ++i)
2425  Decls.push_back(Reader->Record.readDeclAs<ValueDecl>());
2426  C->setUniqueDecls(Decls);
2427 
2428  SmallVector<unsigned, 16> ListsPerDecl;
2429  ListsPerDecl.reserve(UniqueDecls);
2430  for (unsigned i = 0; i < UniqueDecls; ++i)
2431  ListsPerDecl.push_back(Reader->Record.readInt());
2432  C->setDeclNumLists(ListsPerDecl);
2433 
2434  SmallVector<unsigned, 32> ListSizes;
2435  ListSizes.reserve(TotalLists);
2436  for (unsigned i = 0; i < TotalLists; ++i)
2437  ListSizes.push_back(Reader->Record.readInt());
2438  C->setComponentListSizes(ListSizes);
2439 
2441  Components.reserve(TotalComponents);
2442  for (unsigned i = 0; i < TotalComponents; ++i) {
2443  Expr *AssociatedExpr = Reader->Record.readSubExpr();
2444  auto *AssociatedDecl = Reader->Record.readDeclAs<ValueDecl>();
2446  AssociatedExpr, AssociatedDecl));
2447  }
2448  C->setComponents(Components, ListSizes);
2449 }
2450 
2451 void OMPClauseReader::VisitOMPNumTeamsClause(OMPNumTeamsClause *C) {
2452  VisitOMPClauseWithPreInit(C);
2453  C->setNumTeams(Reader->Record.readSubExpr());
2454  C->setLParenLoc(Reader->ReadSourceLocation());
2455 }
2456 
2457 void OMPClauseReader::VisitOMPThreadLimitClause(OMPThreadLimitClause *C) {
2458  VisitOMPClauseWithPreInit(C);
2459  C->setThreadLimit(Reader->Record.readSubExpr());
2460  C->setLParenLoc(Reader->ReadSourceLocation());
2461 }
2462 
2463 void OMPClauseReader::VisitOMPPriorityClause(OMPPriorityClause *C) {
2464  C->setPriority(Reader->Record.readSubExpr());
2465  C->setLParenLoc(Reader->ReadSourceLocation());
2466 }
2467 
2468 void OMPClauseReader::VisitOMPGrainsizeClause(OMPGrainsizeClause *C) {
2469  C->setGrainsize(Reader->Record.readSubExpr());
2470  C->setLParenLoc(Reader->ReadSourceLocation());
2471 }
2472 
2473 void OMPClauseReader::VisitOMPNumTasksClause(OMPNumTasksClause *C) {
2474  C->setNumTasks(Reader->Record.readSubExpr());
2475  C->setLParenLoc(Reader->ReadSourceLocation());
2476 }
2477 
2478 void OMPClauseReader::VisitOMPHintClause(OMPHintClause *C) {
2479  C->setHint(Reader->Record.readSubExpr());
2480  C->setLParenLoc(Reader->ReadSourceLocation());
2481 }
2482 
2483 void OMPClauseReader::VisitOMPDistScheduleClause(OMPDistScheduleClause *C) {
2484  VisitOMPClauseWithPreInit(C);
2485  C->setDistScheduleKind(
2486  static_cast<OpenMPDistScheduleClauseKind>(Reader->Record.readInt()));
2487  C->setChunkSize(Reader->Record.readSubExpr());
2488  C->setLParenLoc(Reader->ReadSourceLocation());
2489  C->setDistScheduleKindLoc(Reader->ReadSourceLocation());
2490  C->setCommaLoc(Reader->ReadSourceLocation());
2491 }
2492 
2493 void OMPClauseReader::VisitOMPDefaultmapClause(OMPDefaultmapClause *C) {
2494  C->setDefaultmapKind(
2495  static_cast<OpenMPDefaultmapClauseKind>(Reader->Record.readInt()));
2496  C->setDefaultmapModifier(
2497  static_cast<OpenMPDefaultmapClauseModifier>(Reader->Record.readInt()));
2498  C->setLParenLoc(Reader->ReadSourceLocation());
2499  C->setDefaultmapModifierLoc(Reader->ReadSourceLocation());
2500  C->setDefaultmapKindLoc(Reader->ReadSourceLocation());
2501 }
2502 
2503 void OMPClauseReader::VisitOMPToClause(OMPToClause *C) {
2504  C->setLParenLoc(Reader->ReadSourceLocation());
2505  auto NumVars = C->varlist_size();
2506  auto UniqueDecls = C->getUniqueDeclarationsNum();
2507  auto TotalLists = C->getTotalComponentListNum();
2508  auto TotalComponents = C->getTotalComponentsNum();
2509 
2511  Vars.reserve(NumVars);
2512  for (unsigned i = 0; i != NumVars; ++i)
2513  Vars.push_back(Reader->Record.readSubExpr());
2514  C->setVarRefs(Vars);
2515 
2517  Decls.reserve(UniqueDecls);
2518  for (unsigned i = 0; i < UniqueDecls; ++i)
2519  Decls.push_back(Reader->Record.readDeclAs<ValueDecl>());
2520  C->setUniqueDecls(Decls);
2521 
2522  SmallVector<unsigned, 16> ListsPerDecl;
2523  ListsPerDecl.reserve(UniqueDecls);
2524  for (unsigned i = 0; i < UniqueDecls; ++i)
2525  ListsPerDecl.push_back(Reader->Record.readInt());
2526  C->setDeclNumLists(ListsPerDecl);
2527 
2528  SmallVector<unsigned, 32> ListSizes;
2529  ListSizes.reserve(TotalLists);
2530  for (unsigned i = 0; i < TotalLists; ++i)
2531  ListSizes.push_back(Reader->Record.readInt());
2532  C->setComponentListSizes(ListSizes);
2533 
2535  Components.reserve(TotalComponents);
2536  for (unsigned i = 0; i < TotalComponents; ++i) {
2537  Expr *AssociatedExpr = Reader->Record.readSubExpr();
2538  auto *AssociatedDecl = Reader->Record.readDeclAs<ValueDecl>();
2540  AssociatedExpr, AssociatedDecl));
2541  }
2542  C->setComponents(Components, ListSizes);
2543 }
2544 
2545 void OMPClauseReader::VisitOMPFromClause(OMPFromClause *C) {
2546  C->setLParenLoc(Reader->ReadSourceLocation());
2547  auto NumVars = C->varlist_size();
2548  auto UniqueDecls = C->getUniqueDeclarationsNum();
2549  auto TotalLists = C->getTotalComponentListNum();
2550  auto TotalComponents = C->getTotalComponentsNum();
2551 
2553  Vars.reserve(NumVars);
2554  for (unsigned i = 0; i != NumVars; ++i)
2555  Vars.push_back(Reader->Record.readSubExpr());
2556  C->setVarRefs(Vars);
2557 
2559  Decls.reserve(UniqueDecls);
2560  for (unsigned i = 0; i < UniqueDecls; ++i)
2561  Decls.push_back(Reader->Record.readDeclAs<ValueDecl>());
2562  C->setUniqueDecls(Decls);
2563 
2564  SmallVector<unsigned, 16> ListsPerDecl;
2565  ListsPerDecl.reserve(UniqueDecls);
2566  for (unsigned i = 0; i < UniqueDecls; ++i)
2567  ListsPerDecl.push_back(Reader->Record.readInt());
2568  C->setDeclNumLists(ListsPerDecl);
2569 
2570  SmallVector<unsigned, 32> ListSizes;
2571  ListSizes.reserve(TotalLists);
2572  for (unsigned i = 0; i < TotalLists; ++i)
2573  ListSizes.push_back(Reader->Record.readInt());
2574  C->setComponentListSizes(ListSizes);
2575 
2577  Components.reserve(TotalComponents);
2578  for (unsigned i = 0; i < TotalComponents; ++i) {
2579  Expr *AssociatedExpr = Reader->Record.readSubExpr();
2580  auto *AssociatedDecl = Reader->Record.readDeclAs<ValueDecl>();
2582  AssociatedExpr, AssociatedDecl));
2583  }
2584  C->setComponents(Components, ListSizes);
2585 }
2586 
2587 void OMPClauseReader::VisitOMPUseDevicePtrClause(OMPUseDevicePtrClause *C) {
2588  C->setLParenLoc(Reader->ReadSourceLocation());
2589  auto NumVars = C->varlist_size();
2590  auto UniqueDecls = C->getUniqueDeclarationsNum();
2591  auto TotalLists = C->getTotalComponentListNum();
2592  auto TotalComponents = C->getTotalComponentsNum();
2593 
2595  Vars.reserve(NumVars);
2596  for (unsigned i = 0; i != NumVars; ++i)
2597  Vars.push_back(Reader->Record.readSubExpr());
2598  C->setVarRefs(Vars);
2599  Vars.clear();
2600  for (unsigned i = 0; i != NumVars; ++i)
2601  Vars.push_back(Reader->Record.readSubExpr());
2602  C->setPrivateCopies(Vars);
2603  Vars.clear();
2604  for (unsigned i = 0; i != NumVars; ++i)
2605  Vars.push_back(Reader->Record.readSubExpr());
2606  C->setInits(Vars);
2607 
2609  Decls.reserve(UniqueDecls);
2610  for (unsigned i = 0; i < UniqueDecls; ++i)
2611  Decls.push_back(Reader->Record.readDeclAs<ValueDecl>());
2612  C->setUniqueDecls(Decls);
2613 
2614  SmallVector<unsigned, 16> ListsPerDecl;
2615  ListsPerDecl.reserve(UniqueDecls);
2616  for (unsigned i = 0; i < UniqueDecls; ++i)
2617  ListsPerDecl.push_back(Reader->Record.readInt());
2618  C->setDeclNumLists(ListsPerDecl);
2619 
2620  SmallVector<unsigned, 32> ListSizes;
2621  ListSizes.reserve(TotalLists);
2622  for (unsigned i = 0; i < TotalLists; ++i)
2623  ListSizes.push_back(Reader->Record.readInt());
2624  C->setComponentListSizes(ListSizes);
2625 
2627  Components.reserve(TotalComponents);
2628  for (unsigned i = 0; i < TotalComponents; ++i) {
2629  Expr *AssociatedExpr = Reader->Record.readSubExpr();
2630  auto *AssociatedDecl = Reader->Record.readDeclAs<ValueDecl>();
2632  AssociatedExpr, AssociatedDecl));
2633  }
2634  C->setComponents(Components, ListSizes);
2635 }
2636 
2637 void OMPClauseReader::VisitOMPIsDevicePtrClause(OMPIsDevicePtrClause *C) {
2638  C->setLParenLoc(Reader->ReadSourceLocation());
2639  auto NumVars = C->varlist_size();
2640  auto UniqueDecls = C->getUniqueDeclarationsNum();
2641  auto TotalLists = C->getTotalComponentListNum();
2642  auto TotalComponents = C->getTotalComponentsNum();
2643 
2645  Vars.reserve(NumVars);
2646  for (unsigned i = 0; i != NumVars; ++i)
2647  Vars.push_back(Reader->Record.readSubExpr());
2648  C->setVarRefs(Vars);
2649  Vars.clear();
2650 
2652  Decls.reserve(UniqueDecls);
2653  for (unsigned i = 0; i < UniqueDecls; ++i)
2654  Decls.push_back(Reader->Record.readDeclAs<ValueDecl>());
2655  C->setUniqueDecls(Decls);
2656 
2657  SmallVector<unsigned, 16> ListsPerDecl;
2658  ListsPerDecl.reserve(UniqueDecls);
2659  for (unsigned i = 0; i < UniqueDecls; ++i)
2660  ListsPerDecl.push_back(Reader->Record.readInt());
2661  C->setDeclNumLists(ListsPerDecl);
2662 
2663  SmallVector<unsigned, 32> ListSizes;
2664  ListSizes.reserve(TotalLists);
2665  for (unsigned i = 0; i < TotalLists; ++i)
2666  ListSizes.push_back(Reader->Record.readInt());
2667  C->setComponentListSizes(ListSizes);
2668 
2670  Components.reserve(TotalComponents);
2671  for (unsigned i = 0; i < TotalComponents; ++i) {
2672  Expr *AssociatedExpr = Reader->Record.readSubExpr();
2673  auto *AssociatedDecl = Reader->Record.readDeclAs<ValueDecl>();
2675  AssociatedExpr, AssociatedDecl));
2676  }
2677  C->setComponents(Components, ListSizes);
2678 }
2679 
2680 //===----------------------------------------------------------------------===//
2681 // OpenMP Directives.
2682 //===----------------------------------------------------------------------===//
2683 
2684 void ASTStmtReader::VisitOMPExecutableDirective(OMPExecutableDirective *E) {
2685  E->setLocStart(ReadSourceLocation());
2686  E->setLocEnd(ReadSourceLocation());
2687  OMPClauseReader ClauseReader(this, Record);
2689  for (unsigned i = 0; i < E->getNumClauses(); ++i)
2690  Clauses.push_back(ClauseReader.readClause());
2691  E->setClauses(Clauses);
2692  if (E->hasAssociatedStmt())
2693  E->setAssociatedStmt(Record.readSubStmt());
2694 }
2695 
2696 void ASTStmtReader::VisitOMPLoopDirective(OMPLoopDirective *D) {
2697  VisitStmt(D);
2698  // Two fields (NumClauses and CollapsedNum) were read in ReadStmtFromStream.
2699  Record.skipInts(2);
2700  VisitOMPExecutableDirective(D);
2701  D->setIterationVariable(Record.readSubExpr());
2702  D->setLastIteration(Record.readSubExpr());
2703  D->setCalcLastIteration(Record.readSubExpr());
2704  D->setPreCond(Record.readSubExpr());
2705  D->setCond(Record.readSubExpr());
2706  D->setInit(Record.readSubExpr());
2707  D->setInc(Record.readSubExpr());
2708  D->setPreInits(Record.readSubStmt());
2712  D->setIsLastIterVariable(Record.readSubExpr());
2713  D->setLowerBoundVariable(Record.readSubExpr());
2714  D->setUpperBoundVariable(Record.readSubExpr());
2715  D->setStrideVariable(Record.readSubExpr());
2716  D->setEnsureUpperBound(Record.readSubExpr());
2717  D->setNextLowerBound(Record.readSubExpr());
2718  D->setNextUpperBound(Record.readSubExpr());
2719  D->setNumIterations(Record.readSubExpr());
2720  }
2724  D->setDistInc(Record.readSubExpr());
2725  D->setPrevEnsureUpperBound(Record.readSubExpr());
2729  D->setCombinedInit(Record.readSubExpr());
2730  D->setCombinedCond(Record.readSubExpr());
2733  }
2735  unsigned CollapsedNum = D->getCollapsedNumber();
2736  Sub.reserve(CollapsedNum);
2737  for (unsigned i = 0; i < CollapsedNum; ++i)
2738  Sub.push_back(Record.readSubExpr());
2739  D->setCounters(Sub);
2740  Sub.clear();
2741  for (unsigned i = 0; i < CollapsedNum; ++i)
2742  Sub.push_back(Record.readSubExpr());
2743  D->setPrivateCounters(Sub);
2744  Sub.clear();
2745  for (unsigned i = 0; i < CollapsedNum; ++i)
2746  Sub.push_back(Record.readSubExpr());
2747  D->setInits(Sub);
2748  Sub.clear();
2749  for (unsigned i = 0; i < CollapsedNum; ++i)
2750  Sub.push_back(Record.readSubExpr());
2751  D->setUpdates(Sub);
2752  Sub.clear();
2753  for (unsigned i = 0; i < CollapsedNum; ++i)
2754  Sub.push_back(Record.readSubExpr());
2755  D->setFinals(Sub);
2756 }
2757 
2758 void ASTStmtReader::VisitOMPParallelDirective(OMPParallelDirective *D) {
2759  VisitStmt(D);
2760  // The NumClauses field was read in ReadStmtFromStream.
2761  Record.skipInts(1);
2762  VisitOMPExecutableDirective(D);
2763  D->setHasCancel(Record.readInt());
2764 }
2765 
2766 void ASTStmtReader::VisitOMPSimdDirective(OMPSimdDirective *D) {
2767  VisitOMPLoopDirective(D);
2768 }
2769 
2770 void ASTStmtReader::VisitOMPForDirective(OMPForDirective *D) {
2771  VisitOMPLoopDirective(D);
2772  D->setHasCancel(Record.readInt());
2773 }
2774 
2775 void ASTStmtReader::VisitOMPForSimdDirective(OMPForSimdDirective *D) {
2776  VisitOMPLoopDirective(D);
2777 }
2778 
2779 void ASTStmtReader::VisitOMPSectionsDirective(OMPSectionsDirective *D) {
2780  VisitStmt(D);
2781  // The NumClauses field was read in ReadStmtFromStream.
2782  Record.skipInts(1);
2783  VisitOMPExecutableDirective(D);
2784  D->setHasCancel(Record.readInt());
2785 }
2786 
2787 void ASTStmtReader::VisitOMPSectionDirective(OMPSectionDirective *D) {
2788  VisitStmt(D);
2789  VisitOMPExecutableDirective(D);
2790  D->setHasCancel(Record.readInt());
2791 }
2792 
2793 void ASTStmtReader::VisitOMPSingleDirective(OMPSingleDirective *D) {
2794  VisitStmt(D);
2795  // The NumClauses field was read in ReadStmtFromStream.
2796  Record.skipInts(1);
2797  VisitOMPExecutableDirective(D);
2798 }
2799 
2800 void ASTStmtReader::VisitOMPMasterDirective(OMPMasterDirective *D) {
2801  VisitStmt(D);
2802  VisitOMPExecutableDirective(D);
2803 }
2804 
2805 void ASTStmtReader::VisitOMPCriticalDirective(OMPCriticalDirective *D) {
2806  VisitStmt(D);
2807  // The NumClauses field was read in ReadStmtFromStream.
2808  Record.skipInts(1);
2809  VisitOMPExecutableDirective(D);
2810  ReadDeclarationNameInfo(D->DirName);
2811 }
2812 
2813 void ASTStmtReader::VisitOMPParallelForDirective(OMPParallelForDirective *D) {
2814  VisitOMPLoopDirective(D);
2815  D->setHasCancel(Record.readInt());
2816 }
2817 
2818 void ASTStmtReader::VisitOMPParallelForSimdDirective(
2820  VisitOMPLoopDirective(D);
2821 }
2822 
2823 void ASTStmtReader::VisitOMPParallelSectionsDirective(
2825  VisitStmt(D);
2826  // The NumClauses field was read in ReadStmtFromStream.
2827  Record.skipInts(1);
2828  VisitOMPExecutableDirective(D);
2829  D->setHasCancel(Record.readInt());
2830 }
2831 
2832 void ASTStmtReader::VisitOMPTaskDirective(OMPTaskDirective *D) {
2833  VisitStmt(D);
2834  // The NumClauses field was read in ReadStmtFromStream.
2835  Record.skipInts(1);
2836  VisitOMPExecutableDirective(D);
2837  D->setHasCancel(Record.readInt());
2838 }
2839 
2840 void ASTStmtReader::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) {
2841  VisitStmt(D);
2842  VisitOMPExecutableDirective(D);
2843 }
2844 
2845 void ASTStmtReader::VisitOMPBarrierDirective(OMPBarrierDirective *D) {
2846  VisitStmt(D);
2847  VisitOMPExecutableDirective(D);
2848 }
2849 
2850 void ASTStmtReader::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) {
2851  VisitStmt(D);
2852  VisitOMPExecutableDirective(D);
2853 }
2854 
2855 void ASTStmtReader::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) {
2856  VisitStmt(D);
2857  // The NumClauses field was read in ReadStmtFromStream.
2858  Record.skipInts(1);
2859  VisitOMPExecutableDirective(D);
2860  D->setReductionRef(Record.readSubExpr());
2861 }
2862 
2863 void ASTStmtReader::VisitOMPFlushDirective(OMPFlushDirective *D) {
2864  VisitStmt(D);
2865  // The NumClauses field was read in ReadStmtFromStream.
2866  Record.skipInts(1);
2867  VisitOMPExecutableDirective(D);
2868 }
2869 
2870 void ASTStmtReader::VisitOMPOrderedDirective(OMPOrderedDirective *D) {
2871  VisitStmt(D);
2872  // The NumClauses field was read in ReadStmtFromStream.
2873  Record.skipInts(1);
2874  VisitOMPExecutableDirective(D);
2875 }
2876 
2877 void ASTStmtReader::VisitOMPAtomicDirective(OMPAtomicDirective *D) {
2878  VisitStmt(D);
2879  // The NumClauses field was read in ReadStmtFromStream.
2880  Record.skipInts(1);
2881  VisitOMPExecutableDirective(D);
2882  D->setX(Record.readSubExpr());
2883  D->setV(Record.readSubExpr());
2884  D->setExpr(Record.readSubExpr());
2885  D->setUpdateExpr(Record.readSubExpr());
2886  D->IsXLHSInRHSPart = Record.readInt() != 0;
2887  D->IsPostfixUpdate = Record.readInt() != 0;
2888 }
2889 
2890 void ASTStmtReader::VisitOMPTargetDirective(OMPTargetDirective *D) {
2891  VisitStmt(D);
2892  // The NumClauses field was read in ReadStmtFromStream.
2893  Record.skipInts(1);
2894  VisitOMPExecutableDirective(D);
2895 }
2896 
2897 void ASTStmtReader::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) {
2898  VisitStmt(D);
2899  Record.skipInts(1);
2900  VisitOMPExecutableDirective(D);
2901 }
2902 
2903 void ASTStmtReader::VisitOMPTargetEnterDataDirective(
2905  VisitStmt(D);
2906  Record.skipInts(1);
2907  VisitOMPExecutableDirective(D);
2908 }
2909 
2910 void ASTStmtReader::VisitOMPTargetExitDataDirective(
2912  VisitStmt(D);
2913  Record.skipInts(1);
2914  VisitOMPExecutableDirective(D);
2915 }
2916 
2917 void ASTStmtReader::VisitOMPTargetParallelDirective(
2919  VisitStmt(D);
2920  Record.skipInts(1);
2921  VisitOMPExecutableDirective(D);
2922 }
2923 
2924 void ASTStmtReader::VisitOMPTargetParallelForDirective(
2926  VisitOMPLoopDirective(D);
2927  D->setHasCancel(Record.readInt());
2928 }
2929 
2930 void ASTStmtReader::VisitOMPTeamsDirective(OMPTeamsDirective *D) {
2931  VisitStmt(D);
2932  // The NumClauses field was read in ReadStmtFromStream.
2933  Record.skipInts(1);
2934  VisitOMPExecutableDirective(D);
2935 }
2936 
2937 void ASTStmtReader::VisitOMPCancellationPointDirective(
2939  VisitStmt(D);
2940  VisitOMPExecutableDirective(D);
2941  D->setCancelRegion(static_cast<OpenMPDirectiveKind>(Record.readInt()));
2942 }
2943 
2944 void ASTStmtReader::VisitOMPCancelDirective(OMPCancelDirective *D) {
2945  VisitStmt(D);
2946  // The NumClauses field was read in ReadStmtFromStream.
2947  Record.skipInts(1);
2948  VisitOMPExecutableDirective(D);
2949  D->setCancelRegion(static_cast<OpenMPDirectiveKind>(Record.readInt()));
2950 }
2951 
2952 void ASTStmtReader::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) {
2953  VisitOMPLoopDirective(D);
2954 }
2955 
2956 void ASTStmtReader::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) {
2957  VisitOMPLoopDirective(D);
2958 }
2959 
2960 void ASTStmtReader::VisitOMPDistributeDirective(OMPDistributeDirective *D) {
2961  VisitOMPLoopDirective(D);
2962 }
2963 
2964 void ASTStmtReader::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) {
2965  VisitStmt(D);
2966  Record.skipInts(1);
2967  VisitOMPExecutableDirective(D);
2968 }
2969 
2970 void ASTStmtReader::VisitOMPDistributeParallelForDirective(
2972  VisitOMPLoopDirective(D);
2973  D->setHasCancel(Record.readInt());
2974 }
2975 
2976 void ASTStmtReader::VisitOMPDistributeParallelForSimdDirective(
2978  VisitOMPLoopDirective(D);
2979 }
2980 
2981 void ASTStmtReader::VisitOMPDistributeSimdDirective(
2983  VisitOMPLoopDirective(D);
2984 }
2985 
2986 void ASTStmtReader::VisitOMPTargetParallelForSimdDirective(
2988  VisitOMPLoopDirective(D);
2989 }
2990 
2991 void ASTStmtReader::VisitOMPTargetSimdDirective(OMPTargetSimdDirective *D) {
2992  VisitOMPLoopDirective(D);
2993 }
2994 
2995 void ASTStmtReader::VisitOMPTeamsDistributeDirective(
2997  VisitOMPLoopDirective(D);
2998 }
2999 
3000 void ASTStmtReader::VisitOMPTeamsDistributeSimdDirective(
3002  VisitOMPLoopDirective(D);
3003 }
3004 
3005 void ASTStmtReader::VisitOMPTeamsDistributeParallelForSimdDirective(
3007  VisitOMPLoopDirective(D);
3008 }
3009 
3010 void ASTStmtReader::VisitOMPTeamsDistributeParallelForDirective(
3012  VisitOMPLoopDirective(D);
3013  D->setHasCancel(Record.readInt());
3014 }
3015 
3016 void ASTStmtReader::VisitOMPTargetTeamsDirective(OMPTargetTeamsDirective *D) {
3017  VisitStmt(D);
3018  // The NumClauses field was read in ReadStmtFromStream.
3019  Record.skipInts(1);
3020  VisitOMPExecutableDirective(D);
3021 }
3022 
3023 void ASTStmtReader::VisitOMPTargetTeamsDistributeDirective(
3025  VisitOMPLoopDirective(D);
3026 }
3027 
3028 void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForDirective(
3030  VisitOMPLoopDirective(D);
3031  D->setHasCancel(Record.readInt());
3032 }
3033 
3034 void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
3036  VisitOMPLoopDirective(D);
3037 }
3038 
3039 void ASTStmtReader::VisitOMPTargetTeamsDistributeSimdDirective(
3041  VisitOMPLoopDirective(D);
3042 }
3043 
3044 //===----------------------------------------------------------------------===//
3045 // ASTReader Implementation
3046 //===----------------------------------------------------------------------===//
3047 
3049  switch (ReadingKind) {
3050  case Read_None:
3051  llvm_unreachable("should not call this when not reading anything");
3052  case Read_Decl:
3053  case Read_Type:
3054  return ReadStmtFromStream(F);
3055  case Read_Stmt:
3056  return ReadSubStmt();
3057  }
3058 
3059  llvm_unreachable("ReadingKind not set ?");
3060 }
3061 
3063  return cast_or_null<Expr>(ReadStmt(F));
3064 }
3065 
3067  return cast_or_null<Expr>(ReadSubStmt());
3068 }
3069 
3070 // Within the bitstream, expressions are stored in Reverse Polish
3071 // Notation, with each of the subexpressions preceding the
3072 // expression they are stored in. Subexpressions are stored from last to first.
3073 // To evaluate expressions, we continue reading expressions and placing them on
3074 // the stack, with expressions having operands removing those operands from the
3075 // stack. Evaluation terminates when we see a STMT_STOP record, and
3076 // the single remaining expression on the stack is our result.
3077 Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) {
3078  ReadingKindTracker ReadingKind(Read_Stmt, *this);
3079  llvm::BitstreamCursor &Cursor = F.DeclsCursor;
3080 
3081  // Map of offset to previously deserialized stmt. The offset points
3082  // just after the stmt record.
3083  llvm::DenseMap<uint64_t, Stmt *> StmtEntries;
3084 
3085 #ifndef NDEBUG
3086  unsigned PrevNumStmts = StmtStack.size();
3087 #endif
3088 
3089  ASTRecordReader Record(*this, F);
3090  ASTStmtReader Reader(Record, Cursor);
3091  Stmt::EmptyShell Empty;
3092 
3093  while (true) {
3094  llvm::BitstreamEntry Entry = Cursor.advanceSkippingSubblocks();
3095 
3096  switch (Entry.Kind) {
3097  case llvm::BitstreamEntry::SubBlock: // Handled for us already.
3099  Error("malformed block record in AST file");
3100  return nullptr;
3101  case llvm::BitstreamEntry::EndBlock:
3102  goto Done;
3103  case llvm::BitstreamEntry::Record:
3104  // The interesting case.
3105  break;
3106  }
3107 
3108  ASTContext &Context = getContext();
3109  Stmt *S = nullptr;
3110  bool Finished = false;
3111  bool IsStmtReference = false;
3112  switch ((StmtCode)Record.readRecord(Cursor, Entry.ID)) {
3113  case STMT_STOP:
3114  Finished = true;
3115  break;
3116 
3117  case STMT_REF_PTR:
3118  IsStmtReference = true;
3119  assert(StmtEntries.find(Record[0]) != StmtEntries.end() &&
3120  "No stmt was recorded for this offset reference!");
3121  S = StmtEntries[Record.readInt()];
3122  break;
3123 
3124  case STMT_NULL_PTR:
3125  S = nullptr;
3126  break;
3127 
3128  case STMT_NULL:
3129  S = new (Context) NullStmt(Empty);
3130  break;
3131 
3132  case STMT_COMPOUND:
3134  Context, /*NumStmts=*/Record[ASTStmtReader::NumStmtFields]);
3135  break;
3136 
3137  case STMT_CASE:
3138  S = new (Context) CaseStmt(Empty);
3139  break;
3140 
3141  case STMT_DEFAULT:
3142  S = new (Context) DefaultStmt(Empty);
3143  break;
3144 
3145  case STMT_LABEL:
3146  S = new (Context) LabelStmt(Empty);
3147  break;
3148 
3149  case STMT_ATTRIBUTED:
3151  Context,
3152  /*NumAttrs*/Record[ASTStmtReader::NumStmtFields]);
3153  break;
3154 
3155  case STMT_IF:
3156  S = new (Context) IfStmt(Empty);
3157  break;
3158 
3159  case STMT_SWITCH:
3160  S = new (Context) SwitchStmt(Empty);
3161  break;
3162 
3163  case STMT_WHILE:
3164  S = new (Context) WhileStmt(Empty);
3165  break;
3166 
3167  case STMT_DO:
3168  S = new (Context) DoStmt(Empty);
3169  break;
3170 
3171  case STMT_FOR:
3172  S = new (Context) ForStmt(Empty);
3173  break;
3174 
3175  case STMT_GOTO:
3176  S = new (Context) GotoStmt(Empty);
3177  break;
3178 
3179  case STMT_INDIRECT_GOTO:
3180  S = new (Context) IndirectGotoStmt(Empty);
3181  break;
3182 
3183  case STMT_CONTINUE:
3184  S = new (Context) ContinueStmt(Empty);
3185  break;
3186 
3187  case STMT_BREAK:
3188  S = new (Context) BreakStmt(Empty);
3189  break;
3190 
3191  case STMT_RETURN:
3192  S = new (Context) ReturnStmt(Empty);
3193  break;
3194 
3195  case STMT_DECL:
3196  S = new (Context) DeclStmt(Empty);
3197  break;
3198 
3199  case STMT_GCCASM:
3200  S = new (Context) GCCAsmStmt(Empty);
3201  break;
3202 
3203  case STMT_MSASM:
3204  S = new (Context) MSAsmStmt(Empty);
3205  break;
3206 
3207  case STMT_CAPTURED:
3209  Record[ASTStmtReader::NumStmtFields]);
3210  break;
3211 
3212  case EXPR_PREDEFINED:
3213  S = new (Context) PredefinedExpr(Empty);
3214  break;
3215 
3216  case EXPR_DECL_REF:
3218  Context,
3219  /*HasQualifier=*/Record[ASTStmtReader::NumExprFields],
3220  /*HasFoundDecl=*/Record[ASTStmtReader::NumExprFields + 1],
3221  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields + 2],
3222  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields + 2] ?
3223  Record[ASTStmtReader::NumExprFields + 5] : 0);
3224  break;
3225 
3226  case EXPR_INTEGER_LITERAL:
3227  S = IntegerLiteral::Create(Context, Empty);
3228  break;
3229 
3230  case EXPR_FLOATING_LITERAL:
3231  S = FloatingLiteral::Create(Context, Empty);
3232  break;
3233 
3235  S = new (Context) ImaginaryLiteral(Empty);
3236  break;
3237 
3238  case EXPR_STRING_LITERAL:
3239  S = StringLiteral::CreateEmpty(Context,
3240  Record[ASTStmtReader::NumExprFields + 1]);
3241  break;
3242 
3244  S = new (Context) CharacterLiteral(Empty);
3245  break;
3246 
3247  case EXPR_PAREN:
3248  S = new (Context) ParenExpr(Empty);
3249  break;
3250 
3251  case EXPR_PAREN_LIST:
3252  S = new (Context) ParenListExpr(Empty);
3253  break;
3254 
3255  case EXPR_UNARY_OPERATOR:
3256  S = new (Context) UnaryOperator(Empty);
3257  break;
3258 
3259  case EXPR_OFFSETOF:
3260  S = OffsetOfExpr::CreateEmpty(Context,
3261  Record[ASTStmtReader::NumExprFields],
3262  Record[ASTStmtReader::NumExprFields + 1]);
3263  break;
3264 
3265  case EXPR_SIZEOF_ALIGN_OF:
3266  S = new (Context) UnaryExprOrTypeTraitExpr(Empty);
3267  break;
3268 
3269  case EXPR_ARRAY_SUBSCRIPT:
3270  S = new (Context) ArraySubscriptExpr(Empty);
3271  break;
3272 
3274  S = new (Context) OMPArraySectionExpr(Empty);
3275  break;
3276 
3277  case EXPR_CALL:
3278  S = new (Context) CallExpr(Context, Stmt::CallExprClass, Empty);
3279  break;
3280 
3281  case EXPR_MEMBER: {
3282  // We load everything here and fully initialize it at creation.
3283  // That way we can use MemberExpr::Create and don't have to duplicate its
3284  // logic with a MemberExpr::CreateEmpty.
3285 
3286  assert(Record.getIdx() == 0);
3287  NestedNameSpecifierLoc QualifierLoc;
3288  if (Record.readInt()) { // HasQualifier.
3289  QualifierLoc = Record.readNestedNameSpecifierLoc();
3290  }
3291 
3292  SourceLocation TemplateKWLoc;
3293  TemplateArgumentListInfo ArgInfo;
3294  bool HasTemplateKWAndArgsInfo = Record.readInt();
3295  if (HasTemplateKWAndArgsInfo) {
3296  TemplateKWLoc = Record.readSourceLocation();
3297  unsigned NumTemplateArgs = Record.readInt();
3298  ArgInfo.setLAngleLoc(Record.readSourceLocation());
3299  ArgInfo.setRAngleLoc(Record.readSourceLocation());
3300  for (unsigned i = 0; i != NumTemplateArgs; ++i)
3301  ArgInfo.addArgument(Record.readTemplateArgumentLoc());
3302  }
3303 
3304  bool HadMultipleCandidates = Record.readInt();
3305 
3306  auto *FoundD = Record.readDeclAs<NamedDecl>();
3307  auto AS = (AccessSpecifier)Record.readInt();
3308  DeclAccessPair FoundDecl = DeclAccessPair::make(FoundD, AS);
3309 
3310  QualType T = Record.readType();
3311  auto VK = static_cast<ExprValueKind>(Record.readInt());
3312  auto OK = static_cast<ExprObjectKind>(Record.readInt());
3313  Expr *Base = ReadSubExpr();
3314  auto *MemberD = Record.readDeclAs<ValueDecl>();
3315  SourceLocation MemberLoc = Record.readSourceLocation();
3316  DeclarationNameInfo MemberNameInfo(MemberD->getDeclName(), MemberLoc);
3317  bool IsArrow = Record.readInt();
3318  SourceLocation OperatorLoc = Record.readSourceLocation();
3319 
3320  S = MemberExpr::Create(Context, Base, IsArrow, OperatorLoc, QualifierLoc,
3321  TemplateKWLoc, MemberD, FoundDecl, MemberNameInfo,
3322  HasTemplateKWAndArgsInfo ? &ArgInfo : nullptr, T,
3323  VK, OK);
3324  Record.readDeclarationNameLoc(cast<MemberExpr>(S)->MemberDNLoc,
3325  MemberD->getDeclName());
3326  if (HadMultipleCandidates)
3327  cast<MemberExpr>(S)->setHadMultipleCandidates(true);
3328  break;
3329  }
3330 
3331  case EXPR_BINARY_OPERATOR:
3332  S = new (Context) BinaryOperator(Empty);
3333  break;
3334 
3336  S = new (Context) CompoundAssignOperator(Empty);
3337  break;
3338 
3340  S = new (Context) ConditionalOperator(Empty);
3341  break;
3342 
3344  S = new (Context) BinaryConditionalOperator(Empty);
3345  break;
3346 
3347  case EXPR_IMPLICIT_CAST:
3348  S = ImplicitCastExpr::CreateEmpty(Context,
3349  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3350  break;
3351 
3352  case EXPR_CSTYLE_CAST:
3353  S = CStyleCastExpr::CreateEmpty(Context,
3354  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3355  break;
3356 
3357  case EXPR_COMPOUND_LITERAL:
3358  S = new (Context) CompoundLiteralExpr(Empty);
3359  break;
3360 
3362  S = new (Context) ExtVectorElementExpr(Empty);
3363  break;
3364 
3365  case EXPR_INIT_LIST:
3366  S = new (Context) InitListExpr(Empty);
3367  break;
3368 
3369  case EXPR_DESIGNATED_INIT:
3370  S = DesignatedInitExpr::CreateEmpty(Context,
3371  Record[ASTStmtReader::NumExprFields] - 1);
3372 
3373  break;
3374 
3376  S = new (Context) DesignatedInitUpdateExpr(Empty);
3377  break;
3378 
3380  S = new (Context) ImplicitValueInitExpr(Empty);
3381  break;
3382 
3383  case EXPR_NO_INIT:
3384  S = new (Context) NoInitExpr(Empty);
3385  break;
3386 
3387  case EXPR_ARRAY_INIT_LOOP:
3388  S = new (Context) ArrayInitLoopExpr(Empty);
3389  break;
3390 
3391  case EXPR_ARRAY_INIT_INDEX:
3392  S = new (Context) ArrayInitIndexExpr(Empty);
3393  break;
3394 
3395  case EXPR_VA_ARG:
3396  S = new (Context) VAArgExpr(Empty);
3397  break;
3398 
3399  case EXPR_ADDR_LABEL:
3400  S = new (Context) AddrLabelExpr(Empty);
3401  break;
3402 
3403  case EXPR_STMT:
3404  S = new (Context) StmtExpr(Empty);
3405  break;
3406 
3407  case EXPR_CHOOSE:
3408  S = new (Context) ChooseExpr(Empty);
3409  break;
3410 
3411  case EXPR_GNU_NULL:
3412  S = new (Context) GNUNullExpr(Empty);
3413  break;
3414 
3415  case EXPR_SHUFFLE_VECTOR:
3416  S = new (Context) ShuffleVectorExpr(Empty);
3417  break;
3418 
3419  case EXPR_CONVERT_VECTOR:
3420  S = new (Context) ConvertVectorExpr(Empty);
3421  break;
3422 
3423  case EXPR_BLOCK:
3424  S = new (Context) BlockExpr(Empty);
3425  break;
3426 
3428  S = new (Context) GenericSelectionExpr(Empty);
3429  break;
3430 
3432  S = new (Context) ObjCStringLiteral(Empty);
3433  break;
3434 
3436  S = new (Context) ObjCBoxedExpr(Empty);
3437  break;
3438 
3440  S = ObjCArrayLiteral::CreateEmpty(Context,
3441  Record[ASTStmtReader::NumExprFields]);
3442  break;
3443 
3446  Record[ASTStmtReader::NumExprFields],
3447  Record[ASTStmtReader::NumExprFields + 1]);
3448  break;
3449 
3450  case EXPR_OBJC_ENCODE:
3451  S = new (Context) ObjCEncodeExpr(Empty);
3452  break;
3453 
3455  S = new (Context) ObjCSelectorExpr(Empty);
3456  break;
3457 
3459  S = new (Context) ObjCProtocolExpr(Empty);
3460  break;
3461 
3463  S = new (Context) ObjCIvarRefExpr(Empty);
3464  break;
3465 
3467  S = new (Context) ObjCPropertyRefExpr(Empty);
3468  break;
3469 
3471  S = new (Context) ObjCSubscriptRefExpr(Empty);
3472  break;
3473 
3475  llvm_unreachable("mismatching AST file");
3476 
3478  S = ObjCMessageExpr::CreateEmpty(Context,
3479  Record[ASTStmtReader::NumExprFields],
3480  Record[ASTStmtReader::NumExprFields + 1]);
3481  break;
3482 
3483  case EXPR_OBJC_ISA:
3484  S = new (Context) ObjCIsaExpr(Empty);
3485  break;
3486 
3488  S = new (Context) ObjCIndirectCopyRestoreExpr(Empty);
3489  break;
3490 
3492  S = new (Context) ObjCBridgedCastExpr(Empty);
3493  break;
3494 
3496  S = new (Context) ObjCForCollectionStmt(Empty);
3497  break;
3498 
3499  case STMT_OBJC_CATCH:
3500  S = new (Context) ObjCAtCatchStmt(Empty);
3501  break;
3502 
3503  case STMT_OBJC_FINALLY:
3504  S = new (Context) ObjCAtFinallyStmt(Empty);
3505  break;
3506 
3507  case STMT_OBJC_AT_TRY:
3508  S = ObjCAtTryStmt::CreateEmpty(Context,
3509  Record[ASTStmtReader::NumStmtFields],
3510  Record[ASTStmtReader::NumStmtFields + 1]);
3511  break;
3512 
3514  S = new (Context) ObjCAtSynchronizedStmt(Empty);
3515  break;
3516 
3517  case STMT_OBJC_AT_THROW:
3518  S = new (Context) ObjCAtThrowStmt(Empty);
3519  break;
3520 
3522  S = new (Context) ObjCAutoreleasePoolStmt(Empty);
3523  break;
3524 
3526  S = new (Context) ObjCBoolLiteralExpr(Empty);
3527  break;
3528 
3530  S = new (Context) ObjCAvailabilityCheckExpr(Empty);
3531  break;
3532 
3533  case STMT_SEH_LEAVE:
3534  S = new (Context) SEHLeaveStmt(Empty);
3535  break;
3536 
3537  case STMT_SEH_EXCEPT:
3538  S = new (Context) SEHExceptStmt(Empty);
3539  break;
3540 
3541  case STMT_SEH_FINALLY:
3542  S = new (Context) SEHFinallyStmt(Empty);
3543  break;
3544 
3545  case STMT_SEH_TRY:
3546  S = new (Context) SEHTryStmt(Empty);
3547  break;
3548 
3549  case STMT_CXX_CATCH:
3550  S = new (Context) CXXCatchStmt(Empty);
3551  break;
3552 
3553  case STMT_CXX_TRY:
3554  S = CXXTryStmt::Create(Context, Empty,
3555  /*NumHandlers=*/Record[ASTStmtReader::NumStmtFields]);
3556  break;
3557 
3558  case STMT_CXX_FOR_RANGE:
3559  S = new (Context) CXXForRangeStmt(Empty);
3560  break;
3561 
3563  S = new (Context) MSDependentExistsStmt(SourceLocation(), true,
3566  nullptr);
3567  break;
3568 
3570  S =
3572  Record[ASTStmtReader::NumStmtFields],
3573  Empty);
3574  break;
3575 
3576  case STMT_OMP_SIMD_DIRECTIVE: {
3577  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3578  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3579  S = OMPSimdDirective::CreateEmpty(Context, NumClauses,
3580  CollapsedNum, Empty);
3581  break;
3582  }
3583 
3584  case STMT_OMP_FOR_DIRECTIVE: {
3585  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3586  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3587  S = OMPForDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3588  Empty);
3589  break;
3590  }
3591 
3593  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3594  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3595  S = OMPForSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3596  Empty);
3597  break;
3598  }
3599 
3602  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3603  break;
3604 
3606  S = OMPSectionDirective::CreateEmpty(Context, Empty);
3607  break;
3608 
3611  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3612  break;
3613 
3615  S = OMPMasterDirective::CreateEmpty(Context, Empty);
3616  break;
3617 
3620  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3621  break;
3622 
3624  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3625  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3626  S = OMPParallelForDirective::CreateEmpty(Context, NumClauses,
3627  CollapsedNum, Empty);
3628  break;
3629  }
3630 
3632  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3633  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3634  S = OMPParallelForSimdDirective::CreateEmpty(Context, NumClauses,
3635  CollapsedNum, Empty);
3636  break;
3637  }
3638 
3641  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3642  break;
3643 
3646  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3647  break;
3648 
3650  S = OMPTaskyieldDirective::CreateEmpty(Context, Empty);
3651  break;
3652 
3654  S = OMPBarrierDirective::CreateEmpty(Context, Empty);
3655  break;
3656 
3658  S = OMPTaskwaitDirective::CreateEmpty(Context, Empty);
3659  break;
3660 
3663  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3664  break;
3665 
3668  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3669  break;
3670 
3673  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3674  break;
3675 
3678  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3679  break;
3680 
3683  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3684  break;
3685 
3688  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3689  break;
3690 
3693  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3694  break;
3695 
3698  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3699  break;
3700 
3703  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3704  break;
3705 
3707  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3708  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3709  S = OMPTargetParallelForDirective::CreateEmpty(Context, NumClauses,
3710  CollapsedNum, Empty);
3711  break;
3712  }
3713 
3716  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3717  break;
3718 
3721  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3722  break;
3723 
3725  S = OMPCancellationPointDirective::CreateEmpty(Context, Empty);
3726  break;
3727 
3730  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3731  break;
3732 
3734  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3735  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3736  S = OMPTaskLoopDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3737  Empty);
3738  break;
3739  }
3740 
3742  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3743  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3744  S = OMPTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
3745  CollapsedNum, Empty);
3746  break;
3747  }
3748 
3750  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3751  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3752  S = OMPDistributeDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3753  Empty);
3754  break;
3755  }
3756 
3758  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3759  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3760  S = OMPDistributeParallelForDirective::CreateEmpty(Context, NumClauses,
3761  CollapsedNum, Empty);
3762  break;
3763  }
3764 
3766  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3767  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3769  CollapsedNum,
3770  Empty);
3771  break;
3772  }
3773 
3775  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3776  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3777  S = OMPDistributeSimdDirective::CreateEmpty(Context, NumClauses,
3778  CollapsedNum, Empty);
3779  break;
3780  }
3781 
3783  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3784  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3785  S = OMPTargetParallelForSimdDirective::CreateEmpty(Context, NumClauses,
3786  CollapsedNum, Empty);
3787  break;
3788  }
3789 
3791  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3792  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3793  S = OMPTargetSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3794  Empty);
3795  break;
3796  }
3797 
3799  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3800  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3801  S = OMPTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
3802  CollapsedNum, Empty);
3803  break;
3804  }
3805 
3807  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3808  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3809  S = OMPTeamsDistributeSimdDirective::CreateEmpty(Context, NumClauses,
3810  CollapsedNum, Empty);
3811  break;
3812  }
3813 
3815  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3816  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3818  Context, NumClauses, CollapsedNum, Empty);
3819  break;
3820  }
3821 
3823  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3824  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3826  Context, NumClauses, CollapsedNum, Empty);
3827  break;
3828  }
3829 
3832  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3833  break;
3834 
3836  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3837  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3838  S = OMPTargetTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
3839  CollapsedNum, Empty);
3840  break;
3841  }
3842 
3844  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3845  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3847  Context, NumClauses, CollapsedNum, Empty);
3848  break;
3849  }
3850 
3852  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3853  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3855  Context, NumClauses, CollapsedNum, Empty);
3856  break;
3857  }
3858 
3860  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3861  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3863  Context, NumClauses, CollapsedNum, Empty);
3864  break;
3865  }
3866 
3868  S = new (Context) CXXOperatorCallExpr(Context, Empty);
3869  break;
3870 
3871  case EXPR_CXX_MEMBER_CALL:
3872  S = new (Context) CXXMemberCallExpr(Context, Empty);
3873  break;
3874 
3875  case EXPR_CXX_CONSTRUCT:
3876  S = new (Context) CXXConstructExpr(Empty);
3877  break;
3878 
3880  S = new (Context) CXXInheritedCtorInitExpr(Empty);
3881  break;
3882 
3884  S = new (Context) CXXTemporaryObjectExpr(Empty);
3885  break;
3886 
3887  case EXPR_CXX_STATIC_CAST:
3888  S = CXXStaticCastExpr::CreateEmpty(Context,
3889  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3890  break;
3891 
3892  case EXPR_CXX_DYNAMIC_CAST:
3893  S = CXXDynamicCastExpr::CreateEmpty(Context,
3894  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3895  break;
3896 
3899  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3900  break;
3901 
3902  case EXPR_CXX_CONST_CAST:
3903  S = CXXConstCastExpr::CreateEmpty(Context);
3904  break;
3905 
3908  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3909  break;
3910 
3912  S = new (Context) UserDefinedLiteral(Context, Empty);
3913  break;
3914 
3916  S = new (Context) CXXStdInitializerListExpr(Empty);
3917  break;
3918 
3919  case EXPR_CXX_BOOL_LITERAL:
3920  S = new (Context) CXXBoolLiteralExpr(Empty);
3921  break;
3922 
3924  S = new (Context) CXXNullPtrLiteralExpr(Empty);
3925  break;
3926 
3927  case EXPR_CXX_TYPEID_EXPR:
3928  S = new (Context) CXXTypeidExpr(Empty, true);
3929  break;
3930 
3931  case EXPR_CXX_TYPEID_TYPE:
3932  S = new (Context) CXXTypeidExpr(Empty, false);
3933  break;
3934 
3935  case EXPR_CXX_UUIDOF_EXPR:
3936  S = new (Context) CXXUuidofExpr(Empty, true);
3937  break;
3938 
3940  S = new (Context) MSPropertyRefExpr(Empty);
3941  break;
3942 
3944  S = new (Context) MSPropertySubscriptExpr(Empty);
3945  break;
3946 
3947  case EXPR_CXX_UUIDOF_TYPE:
3948  S = new (Context) CXXUuidofExpr(Empty, false);
3949  break;
3950 
3951  case EXPR_CXX_THIS:
3952  S = new (Context) CXXThisExpr(Empty);
3953  break;
3954 
3955  case EXPR_CXX_THROW:
3956  S = new (Context) CXXThrowExpr(Empty);
3957  break;
3958 
3959  case EXPR_CXX_DEFAULT_ARG:
3960  S = new (Context) CXXDefaultArgExpr(Empty);
3961  break;
3962 
3963  case EXPR_CXX_DEFAULT_INIT:
3964  S = new (Context) CXXDefaultInitExpr(Empty);
3965  break;
3966 
3968  S = new (Context) CXXBindTemporaryExpr(Empty);
3969  break;
3970 
3972  S = new (Context) CXXScalarValueInitExpr(Empty);
3973  break;
3974 
3975  case EXPR_CXX_NEW:
3976  S = new (Context) CXXNewExpr(Empty);
3977  break;
3978 
3979  case EXPR_CXX_DELETE:
3980  S = new (Context) CXXDeleteExpr(Empty);
3981  break;
3982 
3984  S = new (Context) CXXPseudoDestructorExpr(Empty);
3985  break;
3986 
3988  S = ExprWithCleanups::Create(Context, Empty,
3989  Record[ASTStmtReader::NumExprFields]);
3990  break;
3991 
3994  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields],
3995  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]
3996  ? Record[ASTStmtReader::NumExprFields + 1]
3997  : 0);
3998  break;
3999 
4002  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields],
4003  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]
4004  ? Record[ASTStmtReader::NumExprFields + 1]
4005  : 0);
4006  break;
4007 
4010  /*NumArgs=*/Record[ASTStmtReader::NumExprFields]);
4011  break;
4012 
4015  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields],
4016  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]
4017  ? Record[ASTStmtReader::NumExprFields + 1]
4018  : 0);
4019  break;
4020 
4023  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields],
4024  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]
4025  ? Record[ASTStmtReader::NumExprFields + 1]
4026  : 0);
4027  break;
4028 
4029  case EXPR_TYPE_TRAIT:
4031  Record[ASTStmtReader::NumExprFields]);
4032  break;
4033 
4034  case EXPR_ARRAY_TYPE_TRAIT:
4035  S = new (Context) ArrayTypeTraitExpr(Empty);
4036  break;
4037 
4039  S = new (Context) ExpressionTraitExpr(Empty);
4040  break;
4041 
4042  case EXPR_CXX_NOEXCEPT:
4043  S = new (Context) CXXNoexceptExpr(Empty);
4044  break;
4045 
4046  case EXPR_PACK_EXPANSION:
4047  S = new (Context) PackExpansionExpr(Empty);
4048  break;
4049 
4050  case EXPR_SIZEOF_PACK:
4052  Context,
4053  /*NumPartialArgs=*/Record[ASTStmtReader::NumExprFields]);
4054  break;
4055 
4057  S = new (Context) SubstNonTypeTemplateParmExpr(Empty);
4058  break;
4059 
4061  S = new (Context) SubstNonTypeTemplateParmPackExpr(Empty);
4062  break;
4063 
4066  Record[ASTStmtReader::NumExprFields]);
4067  break;
4068 
4070  S = new (Context) MaterializeTemporaryExpr(Empty);
4071  break;
4072 
4073  case EXPR_CXX_FOLD:
4074  S = new (Context) CXXFoldExpr(Empty);
4075  break;
4076 
4077  case EXPR_OPAQUE_VALUE:
4078  S = new (Context) OpaqueValueExpr(Empty);
4079  break;
4080 
4081  case EXPR_CUDA_KERNEL_CALL:
4082  S = new (Context) CUDAKernelCallExpr(Context, Empty);
4083  break;
4084 
4085  case EXPR_ASTYPE:
4086  S = new (Context) AsTypeExpr(Empty);
4087  break;
4088 
4089  case EXPR_PSEUDO_OBJECT: {
4090  unsigned numSemanticExprs = Record[ASTStmtReader::NumExprFields];
4091  S = PseudoObjectExpr::Create(Context, Empty, numSemanticExprs);
4092  break;
4093  }
4094 
4095  case EXPR_ATOMIC:
4096  S = new (Context) AtomicExpr(Empty);
4097  break;
4098 
4099  case EXPR_LAMBDA: {
4100  unsigned NumCaptures = Record[ASTStmtReader::NumExprFields];
4101  S = LambdaExpr::CreateDeserialized(Context, NumCaptures);
4102  break;
4103  }
4104 
4105  case STMT_COROUTINE_BODY: {
4106  unsigned NumParams = Record[ASTStmtReader::NumStmtFields];
4107  S = CoroutineBodyStmt::Create(Context, Empty, NumParams);
4108  break;
4109  }
4110 
4111  case STMT_CORETURN:
4112  S = new (Context) CoreturnStmt(Empty);
4113  break;
4114 
4115  case EXPR_COAWAIT:
4116  S = new (Context) CoawaitExpr(Empty);
4117  break;
4118 
4119  case EXPR_COYIELD:
4120  S = new (Context) CoyieldExpr(Empty);
4121  break;
4122 
4124  S = new (Context) DependentCoawaitExpr(Empty);
4125  break;
4126  }
4127 
4128  // We hit a STMT_STOP, so we're done with this expression.
4129  if (Finished)
4130  break;
4131 
4132  ++NumStatementsRead;
4133 
4134  if (S && !IsStmtReference) {
4135  Reader.Visit(S);
4136  StmtEntries[Cursor.GetCurrentBitNo()] = S;
4137  }
4138 
4139  assert(Record.getIdx() == Record.size() &&
4140  "Invalid deserialization of statement");
4141  StmtStack.push_back(S);
4142  }
4143 Done:
4144  assert(StmtStack.size() > PrevNumStmts && "Read too many sub-stmts!");
4145  assert(StmtStack.size() == PrevNumStmts + 1 && "Extra expressions on stack!");
4146  return StmtStack.pop_back_val();
4147 }
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:3194
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:4220
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:3545
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:654
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:2132
static StringLiteral * CreateEmpty(const ASTContext &C, unsigned NumStrs)
Construct an empty string literal.
Definition: Expr.cpp:879
void setRawSemantics(APFloatSemantics Sem)
Set the raw enumeration value representing the floating-point semantics of this literal (32-bit IEEE...
Definition: Expr.h:1437
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:2193
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:2299
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:4584
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:4391
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:3257
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:1689
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:1782
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:1359
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:2674
void setSubExpr(unsigned Idx, Expr *E)
Definition: Expr.h:4398
void setInitializer(Expr *E)
Definition: Expr.h:2702
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:1392
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:4376
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:2037
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:1647
void setAtLoc(SourceLocation L)
Definition: ExprObjC.h:68
Represents a C99 designated initializer expression.
Definition: Expr.h:4145
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:1766
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:3572
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:2189
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:3841
Represents a place-holder for an object not to be initialized by anything.
Definition: Expr.h:4439
void setNumArgs(const ASTContext &C, unsigned NumArgs)
setNumArgs - This changes the number of arguments present in this call.
Definition: Expr.cpp:1252
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:3783
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:2321
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:1718
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:4829
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:2013
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:3553
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:4057
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:3911
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:3591
BinaryOperatorKind
void setSubExpr(Expr *E)
Definition: Expr.h:1707
void setLHS(Expr *E)
Definition: Expr.h:3751
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:2816
void setLocation(SourceLocation L)
Definition: ExprObjC.h:101
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3024
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:4852
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:5271
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:1995
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:2747
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:1855
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:1999
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:2991
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:2795
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:4371
This represents &#39;#pragma omp target parallel for simd&#39; directive.
Definition: StmtOpenMP.h:3280
void setArgument(Expr *E)
Definition: Expr.h:2116
OpenMP 4.0 [2.4, Array Sections].
Definition: ExprOpenMP.h:45
void setTypeSourceInfo(TypeSourceInfo *tsi)
Definition: Expr.h:2004
ConditionalOperator - The ?: ternary operator.
Definition: Expr.h:3308
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:3498
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:4906
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:1769
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
Definition: Expr.h:2064
void setLocEnd(SourceLocation Loc)
Sets the ending location of the clause.
Definition: OpenMPClause.h:76
void setLParen(SourceLocation Loc)
Definition: Expr.h:1714
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:3817
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:988
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:1390
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:3781
void setRBraceLoc(SourceLocation Loc)
Definition: Expr.h:4059
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:2284
void setRParenLoc(SourceLocation L)
Definition: Expr.h:3594
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:4495
Stmt * ReadStmt(ModuleFile &F)
Reads a statement.
void setSyntacticForm(InitListExpr *Init)
Definition: Expr.h:4072
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:4890
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:3071
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:3844
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:4935
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:774
This represents &#39;#pragma omp target teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:3985
void setLParenLoc(SourceLocation Loc)
Sets the location of &#39;(&#39;.
Definition: OpenMPClause.h:359
Information about a module that has been loaded by the ASTReader.
Definition: Module.h: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:3759
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:1741
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:2961
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:1479
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:3850
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:3066
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:784
void setLowerBoundVariable(Expr *LB)
Definition: StmtOpenMP.h:502
void setLParenLoc(SourceLocation L)
Definition: ExprCXX.h:1503
This represents &#39;num_teams&#39; clause in the &#39;#pragma omp ...&#39; directive.
void setTypeSourceInfo(TypeSourceInfo *tinfo)
Definition: Expr.h:2713
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:3254
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition: Expr.h:3640
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:1864
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:2815
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition: Expr.h:5008
void setLParenLoc(SourceLocation L)
Definition: Expr.h:2988
void setSubStmt(Stmt *S)
Definition: Stmt.h:832
void setElidable(bool E)
Definition: ExprCXX.h:1309
void setAccessorLoc(SourceLocation L)
Definition: Expr.h:4855
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:4500
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:3500
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:3069
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:5142
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:1898
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:2861
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:3774
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:3527
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:3837
void setLAngleLoc(SourceLocation Loc)
Definition: TemplateBase.h:565
void sawArrayRangeDesignator(bool ARD=true)
Definition: Expr.h:4082
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:1438
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:3230
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:4723
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition: Expr.h:3483
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers...
Definition: ExprObjC.h:1572
Represents a reference to a function parameter pack that has been substituted but not yet expanded...
Definition: ExprCXX.h:3961
Represents a template argument.
Definition: TemplateBase.h:51
void setGotoLoc(SourceLocation L)
Definition: Stmt.h:1310
void setPrevUpperBoundVariable(Expr *PrevUB)
Definition: StmtOpenMP.h:556