clang  8.0.0svn
ASTReaderStmt.cpp
Go to the documentation of this file.
1 //===- ASTReaderStmt.cpp - Stmt/Expr Deserialization ----------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // Statement/expression deserialization. This implements the
11 // ASTReader::ReadStmt method.
12 //
13 //===----------------------------------------------------------------------===//
14 
16 #include "clang/AST/ASTContext.h"
17 #include "clang/AST/AttrIterator.h"
18 #include "clang/AST/Decl.h"
20 #include "clang/AST/DeclCXX.h"
21 #include "clang/AST/DeclGroup.h"
22 #include "clang/AST/DeclObjC.h"
23 #include "clang/AST/DeclTemplate.h"
25 #include "clang/AST/Expr.h"
26 #include "clang/AST/ExprCXX.h"
27 #include "clang/AST/ExprObjC.h"
28 #include "clang/AST/ExprOpenMP.h"
30 #include "clang/AST/OpenMPClause.h"
32 #include "clang/AST/Stmt.h"
33 #include "clang/AST/StmtCXX.h"
34 #include "clang/AST/StmtObjC.h"
35 #include "clang/AST/StmtOpenMP.h"
36 #include "clang/AST/StmtVisitor.h"
37 #include "clang/AST/TemplateBase.h"
38 #include "clang/AST/Type.h"
42 #include "clang/Basic/LLVM.h"
43 #include "clang/Basic/Lambda.h"
48 #include "clang/Basic/Specifiers.h"
49 #include "clang/Basic/TypeTraits.h"
50 #include "clang/Lex/Token.h"
52 #include "llvm/ADT/DenseMap.h"
53 #include "llvm/ADT/SmallString.h"
54 #include "llvm/ADT/SmallVector.h"
55 #include "llvm/ADT/StringRef.h"
56 #include "llvm/Bitcode/BitstreamReader.h"
57 #include "llvm/Support/Casting.h"
58 #include "llvm/Support/ErrorHandling.h"
59 #include <algorithm>
60 #include <cassert>
61 #include <cstdint>
62 #include <string>
63 
64 using namespace clang;
65 using namespace serialization;
66 
67 namespace clang {
68 
69  class ASTStmtReader : public StmtVisitor<ASTStmtReader> {
70  friend class OMPClauseReader;
71 
72  ASTRecordReader &Record;
73  llvm::BitstreamCursor &DeclsCursor;
74 
75  SourceLocation ReadSourceLocation() {
76  return Record.readSourceLocation();
77  }
78 
79  SourceRange ReadSourceRange() {
80  return Record.readSourceRange();
81  }
82 
83  std::string ReadString() {
84  return Record.readString();
85  }
86 
87  TypeSourceInfo *GetTypeSourceInfo() {
88  return Record.getTypeSourceInfo();
89  }
90 
91  Decl *ReadDecl() {
92  return Record.readDecl();
93  }
94 
95  template<typename T>
96  T *ReadDeclAs() {
97  return Record.readDeclAs<T>();
98  }
99 
100  void ReadDeclarationNameLoc(DeclarationNameLoc &DNLoc,
101  DeclarationName Name) {
102  Record.readDeclarationNameLoc(DNLoc, Name);
103  }
104 
105  void ReadDeclarationNameInfo(DeclarationNameInfo &NameInfo) {
106  Record.readDeclarationNameInfo(NameInfo);
107  }
108 
109  public:
110  ASTStmtReader(ASTRecordReader &Record, llvm::BitstreamCursor &Cursor)
111  : Record(Record), DeclsCursor(Cursor) {}
112 
113  /// The number of record fields required for the Stmt class
114  /// itself.
115  static const unsigned NumStmtFields = 0;
116 
117  /// The number of record fields required for the Expr class
118  /// itself.
119  static const unsigned NumExprFields = NumStmtFields + 7;
120 
121  /// Read and initialize a ExplicitTemplateArgumentList structure.
122  void ReadTemplateKWAndArgsInfo(ASTTemplateKWAndArgsInfo &Args,
123  TemplateArgumentLoc *ArgsLocArray,
124  unsigned NumTemplateArgs);
125 
126  /// Read and initialize a ExplicitTemplateArgumentList structure.
127  void ReadExplicitTemplateArgumentList(ASTTemplateArgumentListInfo &ArgList,
128  unsigned NumTemplateArgs);
129 
130  void VisitStmt(Stmt *S);
131 #define STMT(Type, Base) \
132  void Visit##Type(Type *);
133 #include "clang/AST/StmtNodes.inc"
134  };
135 
136 } // namespace clang
137 
139  TemplateArgumentLoc *ArgsLocArray,
140  unsigned NumTemplateArgs) {
141  SourceLocation TemplateKWLoc = ReadSourceLocation();
142  TemplateArgumentListInfo ArgInfo;
143  ArgInfo.setLAngleLoc(ReadSourceLocation());
144  ArgInfo.setRAngleLoc(ReadSourceLocation());
145  for (unsigned i = 0; i != NumTemplateArgs; ++i)
146  ArgInfo.addArgument(Record.readTemplateArgumentLoc());
147  Args.initializeFrom(TemplateKWLoc, ArgInfo, ArgsLocArray);
148 }
149 
151  assert(Record.getIdx() == NumStmtFields && "Incorrect statement field count");
152 }
153 
154 void ASTStmtReader::VisitNullStmt(NullStmt *S) {
155  VisitStmt(S);
156  S->setSemiLoc(ReadSourceLocation());
157  S->HasLeadingEmptyMacro = Record.readInt();
158 }
159 
160 void ASTStmtReader::VisitCompoundStmt(CompoundStmt *S) {
161  VisitStmt(S);
163  unsigned NumStmts = Record.readInt();
164  while (NumStmts--)
165  Stmts.push_back(Record.readSubStmt());
166  S->setStmts(Stmts);
167  S->LBraceLoc = ReadSourceLocation();
168  S->RBraceLoc = ReadSourceLocation();
169 }
170 
171 void ASTStmtReader::VisitSwitchCase(SwitchCase *S) {
172  VisitStmt(S);
173  Record.recordSwitchCaseID(S, Record.readInt());
174  S->setKeywordLoc(ReadSourceLocation());
175  S->setColonLoc(ReadSourceLocation());
176 }
177 
178 void ASTStmtReader::VisitCaseStmt(CaseStmt *S) {
179  VisitSwitchCase(S);
180  S->setLHS(Record.readSubExpr());
181  S->setRHS(Record.readSubExpr());
182  S->setSubStmt(Record.readSubStmt());
183  S->setEllipsisLoc(ReadSourceLocation());
184 }
185 
186 void ASTStmtReader::VisitDefaultStmt(DefaultStmt *S) {
187  VisitSwitchCase(S);
188  S->setSubStmt(Record.readSubStmt());
189 }
190 
191 void ASTStmtReader::VisitLabelStmt(LabelStmt *S) {
192  VisitStmt(S);
193  auto *LD = ReadDeclAs<LabelDecl>();
194  LD->setStmt(S);
195  S->setDecl(LD);
196  S->setSubStmt(Record.readSubStmt());
197  S->setIdentLoc(ReadSourceLocation());
198 }
199 
200 void ASTStmtReader::VisitAttributedStmt(AttributedStmt *S) {
201  VisitStmt(S);
202  uint64_t NumAttrs = Record.readInt();
203  AttrVec Attrs;
204  Record.readAttributes(Attrs);
205  (void)NumAttrs;
206  assert(NumAttrs == S->NumAttrs);
207  assert(NumAttrs == Attrs.size());
208  std::copy(Attrs.begin(), Attrs.end(), S->getAttrArrayPtr());
209  S->SubStmt = Record.readSubStmt();
210  S->AttrLoc = ReadSourceLocation();
211 }
212 
213 void ASTStmtReader::VisitIfStmt(IfStmt *S) {
214  VisitStmt(S);
215  S->setConstexpr(Record.readInt());
216  S->setInit(Record.readSubStmt());
217  S->setConditionVariable(Record.getContext(), ReadDeclAs<VarDecl>());
218  S->setCond(Record.readSubExpr());
219  S->setThen(Record.readSubStmt());
220  S->setElse(Record.readSubStmt());
221  S->setIfLoc(ReadSourceLocation());
222  S->setElseLoc(ReadSourceLocation());
223 }
224 
225 void ASTStmtReader::VisitSwitchStmt(SwitchStmt *S) {
226  VisitStmt(S);
227  S->setInit(Record.readSubStmt());
228  S->setConditionVariable(Record.getContext(), ReadDeclAs<VarDecl>());
229  S->setCond(Record.readSubExpr());
230  S->setBody(Record.readSubStmt());
231  S->setSwitchLoc(ReadSourceLocation());
232  if (Record.readInt())
234 
235  SwitchCase *PrevSC = nullptr;
236  for (auto E = Record.size(); Record.getIdx() != E; ) {
237  SwitchCase *SC = Record.getSwitchCaseWithID(Record.readInt());
238  if (PrevSC)
239  PrevSC->setNextSwitchCase(SC);
240  else
241  S->setSwitchCaseList(SC);
242 
243  PrevSC = SC;
244  }
245 }
246 
247 void ASTStmtReader::VisitWhileStmt(WhileStmt *S) {
248  VisitStmt(S);
249  S->setConditionVariable(Record.getContext(), ReadDeclAs<VarDecl>());
250 
251  S->setCond(Record.readSubExpr());
252  S->setBody(Record.readSubStmt());
253  S->setWhileLoc(ReadSourceLocation());
254 }
255 
256 void ASTStmtReader::VisitDoStmt(DoStmt *S) {
257  VisitStmt(S);
258  S->setCond(Record.readSubExpr());
259  S->setBody(Record.readSubStmt());
260  S->setDoLoc(ReadSourceLocation());
261  S->setWhileLoc(ReadSourceLocation());
262  S->setRParenLoc(ReadSourceLocation());
263 }
264 
265 void ASTStmtReader::VisitForStmt(ForStmt *S) {
266  VisitStmt(S);
267  S->setInit(Record.readSubStmt());
268  S->setCond(Record.readSubExpr());
269  S->setConditionVariable(Record.getContext(), ReadDeclAs<VarDecl>());
270  S->setInc(Record.readSubExpr());
271  S->setBody(Record.readSubStmt());
272  S->setForLoc(ReadSourceLocation());
273  S->setLParenLoc(ReadSourceLocation());
274  S->setRParenLoc(ReadSourceLocation());
275 }
276 
277 void ASTStmtReader::VisitGotoStmt(GotoStmt *S) {
278  VisitStmt(S);
279  S->setLabel(ReadDeclAs<LabelDecl>());
280  S->setGotoLoc(ReadSourceLocation());
281  S->setLabelLoc(ReadSourceLocation());
282 }
283 
284 void ASTStmtReader::VisitIndirectGotoStmt(IndirectGotoStmt *S) {
285  VisitStmt(S);
286  S->setGotoLoc(ReadSourceLocation());
287  S->setStarLoc(ReadSourceLocation());
288  S->setTarget(Record.readSubExpr());
289 }
290 
291 void ASTStmtReader::VisitContinueStmt(ContinueStmt *S) {
292  VisitStmt(S);
293  S->setContinueLoc(ReadSourceLocation());
294 }
295 
296 void ASTStmtReader::VisitBreakStmt(BreakStmt *S) {
297  VisitStmt(S);
298  S->setBreakLoc(ReadSourceLocation());
299 }
300 
301 void ASTStmtReader::VisitReturnStmt(ReturnStmt *S) {
302  VisitStmt(S);
303  S->setRetValue(Record.readSubExpr());
304  S->setReturnLoc(ReadSourceLocation());
305  S->setNRVOCandidate(ReadDeclAs<VarDecl>());
306 }
307 
308 void ASTStmtReader::VisitDeclStmt(DeclStmt *S) {
309  VisitStmt(S);
310  S->setStartLoc(ReadSourceLocation());
311  S->setEndLoc(ReadSourceLocation());
312 
313  if (Record.size() - Record.getIdx() == 1) {
314  // Single declaration
315  S->setDeclGroup(DeclGroupRef(ReadDecl()));
316  } else {
318  int N = Record.size() - Record.getIdx();
319  Decls.reserve(N);
320  for (int I = 0; I < N; ++I)
321  Decls.push_back(ReadDecl());
323  Decls.data(),
324  Decls.size())));
325  }
326 }
327 
328 void ASTStmtReader::VisitAsmStmt(AsmStmt *S) {
329  VisitStmt(S);
330  S->NumOutputs = Record.readInt();
331  S->NumInputs = Record.readInt();
332  S->NumClobbers = Record.readInt();
333  S->setAsmLoc(ReadSourceLocation());
334  S->setVolatile(Record.readInt());
335  S->setSimple(Record.readInt());
336 }
337 
338 void ASTStmtReader::VisitGCCAsmStmt(GCCAsmStmt *S) {
339  VisitAsmStmt(S);
340  S->setRParenLoc(ReadSourceLocation());
341  S->setAsmString(cast_or_null<StringLiteral>(Record.readSubStmt()));
342 
343  unsigned NumOutputs = S->getNumOutputs();
344  unsigned NumInputs = S->getNumInputs();
345  unsigned NumClobbers = S->getNumClobbers();
346 
347  // Outputs and inputs
351  for (unsigned I = 0, N = NumOutputs + NumInputs; I != N; ++I) {
352  Names.push_back(Record.getIdentifierInfo());
353  Constraints.push_back(cast_or_null<StringLiteral>(Record.readSubStmt()));
354  Exprs.push_back(Record.readSubStmt());
355  }
356 
357  // Constraints
359  for (unsigned I = 0; I != NumClobbers; ++I)
360  Clobbers.push_back(cast_or_null<StringLiteral>(Record.readSubStmt()));
361 
362  S->setOutputsAndInputsAndClobbers(Record.getContext(),
363  Names.data(), Constraints.data(),
364  Exprs.data(), NumOutputs, NumInputs,
365  Clobbers.data(), NumClobbers);
366 }
367 
368 void ASTStmtReader::VisitMSAsmStmt(MSAsmStmt *S) {
369  VisitAsmStmt(S);
370  S->LBraceLoc = ReadSourceLocation();
371  S->EndLoc = ReadSourceLocation();
372  S->NumAsmToks = Record.readInt();
373  std::string AsmStr = ReadString();
374 
375  // Read the tokens.
376  SmallVector<Token, 16> AsmToks;
377  AsmToks.reserve(S->NumAsmToks);
378  for (unsigned i = 0, e = S->NumAsmToks; i != e; ++i) {
379  AsmToks.push_back(Record.readToken());
380  }
381 
382  // The calls to reserve() for the FooData vectors are mandatory to
383  // prevent dead StringRefs in the Foo vectors.
384 
385  // Read the clobbers.
386  SmallVector<std::string, 16> ClobbersData;
388  ClobbersData.reserve(S->NumClobbers);
389  Clobbers.reserve(S->NumClobbers);
390  for (unsigned i = 0, e = S->NumClobbers; i != e; ++i) {
391  ClobbersData.push_back(ReadString());
392  Clobbers.push_back(ClobbersData.back());
393  }
394 
395  // Read the operands.
396  unsigned NumOperands = S->NumOutputs + S->NumInputs;
398  SmallVector<std::string, 16> ConstraintsData;
399  SmallVector<StringRef, 16> Constraints;
400  Exprs.reserve(NumOperands);
401  ConstraintsData.reserve(NumOperands);
402  Constraints.reserve(NumOperands);
403  for (unsigned i = 0; i != NumOperands; ++i) {
404  Exprs.push_back(cast<Expr>(Record.readSubStmt()));
405  ConstraintsData.push_back(ReadString());
406  Constraints.push_back(ConstraintsData.back());
407  }
408 
409  S->initialize(Record.getContext(), AsmStr, AsmToks,
410  Constraints, Exprs, Clobbers);
411 }
412 
413 void ASTStmtReader::VisitCoroutineBodyStmt(CoroutineBodyStmt *S) {
414  VisitStmt(S);
415  assert(Record.peekInt() == S->NumParams);
416  Record.skipInts(1);
417  auto *StoredStmts = S->getStoredStmts();
418  for (unsigned i = 0;
419  i < CoroutineBodyStmt::SubStmt::FirstParamMove + S->NumParams; ++i)
420  StoredStmts[i] = Record.readSubStmt();
421 }
422 
423 void ASTStmtReader::VisitCoreturnStmt(CoreturnStmt *S) {
424  VisitStmt(S);
425  S->CoreturnLoc = Record.readSourceLocation();
426  for (auto &SubStmt: S->SubStmts)
427  SubStmt = Record.readSubStmt();
428  S->IsImplicit = Record.readInt() != 0;
429 }
430 
431 void ASTStmtReader::VisitCoawaitExpr(CoawaitExpr *E) {
432  VisitExpr(E);
433  E->KeywordLoc = ReadSourceLocation();
434  for (auto &SubExpr: E->SubExprs)
435  SubExpr = Record.readSubStmt();
436  E->OpaqueValue = cast_or_null<OpaqueValueExpr>(Record.readSubStmt());
437  E->setIsImplicit(Record.readInt() != 0);
438 }
439 
440 void ASTStmtReader::VisitCoyieldExpr(CoyieldExpr *E) {
441  VisitExpr(E);
442  E->KeywordLoc = ReadSourceLocation();
443  for (auto &SubExpr: E->SubExprs)
444  SubExpr = Record.readSubStmt();
445  E->OpaqueValue = cast_or_null<OpaqueValueExpr>(Record.readSubStmt());
446 }
447 
448 void ASTStmtReader::VisitDependentCoawaitExpr(DependentCoawaitExpr *E) {
449  VisitExpr(E);
450  E->KeywordLoc = ReadSourceLocation();
451  for (auto &SubExpr: E->SubExprs)
452  SubExpr = Record.readSubStmt();
453 }
454 
455 void ASTStmtReader::VisitCapturedStmt(CapturedStmt *S) {
456  VisitStmt(S);
457  Record.skipInts(1);
458  S->setCapturedDecl(ReadDeclAs<CapturedDecl>());
459  S->setCapturedRegionKind(static_cast<CapturedRegionKind>(Record.readInt()));
460  S->setCapturedRecordDecl(ReadDeclAs<RecordDecl>());
461 
462  // Capture inits
464  E = S->capture_init_end();
465  I != E; ++I)
466  *I = Record.readSubExpr();
467 
468  // Body
469  S->setCapturedStmt(Record.readSubStmt());
471 
472  // Captures
473  for (auto &I : S->captures()) {
474  I.VarAndKind.setPointer(ReadDeclAs<VarDecl>());
475  I.VarAndKind.setInt(
476  static_cast<CapturedStmt::VariableCaptureKind>(Record.readInt()));
477  I.Loc = ReadSourceLocation();
478  }
479 }
480 
481 void ASTStmtReader::VisitExpr(Expr *E) {
482  VisitStmt(E);
483  E->setType(Record.readType());
484  E->setTypeDependent(Record.readInt());
485  E->setValueDependent(Record.readInt());
486  E->setInstantiationDependent(Record.readInt());
487  E->ExprBits.ContainsUnexpandedParameterPack = Record.readInt();
488  E->setValueKind(static_cast<ExprValueKind>(Record.readInt()));
489  E->setObjectKind(static_cast<ExprObjectKind>(Record.readInt()));
490  assert(Record.getIdx() == NumExprFields &&
491  "Incorrect expression field count");
492 }
493 
494 void ASTStmtReader::VisitPredefinedExpr(PredefinedExpr *E) {
495  VisitExpr(E);
496  E->setLocation(ReadSourceLocation());
497  E->Type = (PredefinedExpr::IdentType)Record.readInt();
498  E->FnName = cast_or_null<StringLiteral>(Record.readSubExpr());
499 }
500 
501 void ASTStmtReader::VisitDeclRefExpr(DeclRefExpr *E) {
502  VisitExpr(E);
503 
504  E->DeclRefExprBits.HasQualifier = Record.readInt();
505  E->DeclRefExprBits.HasFoundDecl = Record.readInt();
506  E->DeclRefExprBits.HasTemplateKWAndArgsInfo = Record.readInt();
507  E->DeclRefExprBits.HadMultipleCandidates = Record.readInt();
508  E->DeclRefExprBits.RefersToEnclosingVariableOrCapture = Record.readInt();
509  unsigned NumTemplateArgs = 0;
510  if (E->hasTemplateKWAndArgsInfo())
511  NumTemplateArgs = Record.readInt();
512 
513  if (E->hasQualifier())
514  new (E->getTrailingObjects<NestedNameSpecifierLoc>())
516 
517  if (E->hasFoundDecl())
518  *E->getTrailingObjects<NamedDecl *>() = ReadDeclAs<NamedDecl>();
519 
520  if (E->hasTemplateKWAndArgsInfo())
521  ReadTemplateKWAndArgsInfo(
522  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
523  E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs);
524 
525  E->setDecl(ReadDeclAs<ValueDecl>());
526  E->setLocation(ReadSourceLocation());
527  ReadDeclarationNameLoc(E->DNLoc, E->getDecl()->getDeclName());
528 }
529 
530 void ASTStmtReader::VisitIntegerLiteral(IntegerLiteral *E) {
531  VisitExpr(E);
532  E->setLocation(ReadSourceLocation());
533  E->setValue(Record.getContext(), Record.readAPInt());
534 }
535 
536 void ASTStmtReader::VisitFixedPointLiteral(FixedPointLiteral *E) {
537  VisitExpr(E);
538  E->setLocation(ReadSourceLocation());
539  E->setValue(Record.getContext(), Record.readAPInt());
540 }
541 
542 void ASTStmtReader::VisitFloatingLiteral(FloatingLiteral *E) {
543  VisitExpr(E);
544  E->setRawSemantics(static_cast<Stmt::APFloatSemantics>(Record.readInt()));
545  E->setExact(Record.readInt());
546  E->setValue(Record.getContext(), Record.readAPFloat(E->getSemantics()));
547  E->setLocation(ReadSourceLocation());
548 }
549 
550 void ASTStmtReader::VisitImaginaryLiteral(ImaginaryLiteral *E) {
551  VisitExpr(E);
552  E->setSubExpr(Record.readSubExpr());
553 }
554 
555 void ASTStmtReader::VisitStringLiteral(StringLiteral *E) {
556  VisitExpr(E);
557  unsigned Len = Record.readInt();
558  assert(Record.peekInt() == E->getNumConcatenated() &&
559  "Wrong number of concatenated tokens!");
560  Record.skipInts(1);
561  auto kind = static_cast<StringLiteral::StringKind>(Record.readInt());
562  bool isPascal = Record.readInt();
563 
564  // Read string data
565  auto B = &Record.peekInt();
566  SmallString<16> Str(B, B + Len);
567  E->setString(Record.getContext(), Str, kind, isPascal);
568  Record.skipInts(Len);
569 
570  // Read source locations
571  for (unsigned I = 0, N = E->getNumConcatenated(); I != N; ++I)
572  E->setStrTokenLoc(I, ReadSourceLocation());
573 }
574 
575 void ASTStmtReader::VisitCharacterLiteral(CharacterLiteral *E) {
576  VisitExpr(E);
577  E->setValue(Record.readInt());
578  E->setLocation(ReadSourceLocation());
579  E->setKind(static_cast<CharacterLiteral::CharacterKind>(Record.readInt()));
580 }
581 
582 void ASTStmtReader::VisitParenExpr(ParenExpr *E) {
583  VisitExpr(E);
584  E->setLParen(ReadSourceLocation());
585  E->setRParen(ReadSourceLocation());
586  E->setSubExpr(Record.readSubExpr());
587 }
588 
589 void ASTStmtReader::VisitParenListExpr(ParenListExpr *E) {
590  VisitExpr(E);
591  unsigned NumExprs = Record.readInt();
592  E->Exprs = new (Record.getContext()) Stmt*[NumExprs];
593  for (unsigned i = 0; i != NumExprs; ++i)
594  E->Exprs[i] = Record.readSubStmt();
595  E->NumExprs = NumExprs;
596  E->LParenLoc = ReadSourceLocation();
597  E->RParenLoc = ReadSourceLocation();
598 }
599 
600 void ASTStmtReader::VisitUnaryOperator(UnaryOperator *E) {
601  VisitExpr(E);
602  E->setSubExpr(Record.readSubExpr());
604  E->setOperatorLoc(ReadSourceLocation());
605  E->setCanOverflow(Record.readInt());
606 }
607 
608 void ASTStmtReader::VisitOffsetOfExpr(OffsetOfExpr *E) {
609  VisitExpr(E);
610  assert(E->getNumComponents() == Record.peekInt());
611  Record.skipInts(1);
612  assert(E->getNumExpressions() == Record.peekInt());
613  Record.skipInts(1);
614  E->setOperatorLoc(ReadSourceLocation());
615  E->setRParenLoc(ReadSourceLocation());
616  E->setTypeSourceInfo(GetTypeSourceInfo());
617  for (unsigned I = 0, N = E->getNumComponents(); I != N; ++I) {
618  auto Kind = static_cast<OffsetOfNode::Kind>(Record.readInt());
619  SourceLocation Start = ReadSourceLocation();
620  SourceLocation End = ReadSourceLocation();
621  switch (Kind) {
622  case OffsetOfNode::Array:
623  E->setComponent(I, OffsetOfNode(Start, Record.readInt(), End));
624  break;
625 
626  case OffsetOfNode::Field:
627  E->setComponent(
628  I, OffsetOfNode(Start, ReadDeclAs<FieldDecl>(), End));
629  break;
630 
632  E->setComponent(
633  I,
634  OffsetOfNode(Start, Record.getIdentifierInfo(), End));
635  break;
636 
637  case OffsetOfNode::Base: {
638  auto *Base = new (Record.getContext()) CXXBaseSpecifier();
639  *Base = Record.readCXXBaseSpecifier();
641  break;
642  }
643  }
644  }
645 
646  for (unsigned I = 0, N = E->getNumExpressions(); I != N; ++I)
647  E->setIndexExpr(I, Record.readSubExpr());
648 }
649 
650 void ASTStmtReader::VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *E) {
651  VisitExpr(E);
652  E->setKind(static_cast<UnaryExprOrTypeTrait>(Record.readInt()));
653  if (Record.peekInt() == 0) {
654  E->setArgument(Record.readSubExpr());
655  Record.skipInts(1);
656  } else {
657  E->setArgument(GetTypeSourceInfo());
658  }
659  E->setOperatorLoc(ReadSourceLocation());
660  E->setRParenLoc(ReadSourceLocation());
661 }
662 
663 void ASTStmtReader::VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
664  VisitExpr(E);
665  E->setLHS(Record.readSubExpr());
666  E->setRHS(Record.readSubExpr());
667  E->setRBracketLoc(ReadSourceLocation());
668 }
669 
670 void ASTStmtReader::VisitOMPArraySectionExpr(OMPArraySectionExpr *E) {
671  VisitExpr(E);
672  E->setBase(Record.readSubExpr());
673  E->setLowerBound(Record.readSubExpr());
674  E->setLength(Record.readSubExpr());
675  E->setColonLoc(ReadSourceLocation());
676  E->setRBracketLoc(ReadSourceLocation());
677 }
678 
679 void ASTStmtReader::VisitCallExpr(CallExpr *E) {
680  VisitExpr(E);
681  E->setNumArgs(Record.getContext(), Record.readInt());
682  E->setRParenLoc(ReadSourceLocation());
683  E->setCallee(Record.readSubExpr());
684  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
685  E->setArg(I, Record.readSubExpr());
686 }
687 
688 void ASTStmtReader::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) {
689  VisitCallExpr(E);
690 }
691 
692 void ASTStmtReader::VisitMemberExpr(MemberExpr *E) {
693  // Don't call VisitExpr, this is fully initialized at creation.
694  assert(E->getStmtClass() == Stmt::MemberExprClass &&
695  "It's a subclass, we must advance Idx!");
696 }
697 
698 void ASTStmtReader::VisitObjCIsaExpr(ObjCIsaExpr *E) {
699  VisitExpr(E);
700  E->setBase(Record.readSubExpr());
701  E->setIsaMemberLoc(ReadSourceLocation());
702  E->setOpLoc(ReadSourceLocation());
703  E->setArrow(Record.readInt());
704 }
705 
706 void ASTStmtReader::
707 VisitObjCIndirectCopyRestoreExpr(ObjCIndirectCopyRestoreExpr *E) {
708  VisitExpr(E);
709  E->Operand = Record.readSubExpr();
710  E->setShouldCopy(Record.readInt());
711 }
712 
713 void ASTStmtReader::VisitObjCBridgedCastExpr(ObjCBridgedCastExpr *E) {
714  VisitExplicitCastExpr(E);
715  E->LParenLoc = ReadSourceLocation();
716  E->BridgeKeywordLoc = ReadSourceLocation();
717  E->Kind = Record.readInt();
718 }
719 
720 void ASTStmtReader::VisitCastExpr(CastExpr *E) {
721  VisitExpr(E);
722  unsigned NumBaseSpecs = Record.readInt();
723  assert(NumBaseSpecs == E->path_size());
724  E->setSubExpr(Record.readSubExpr());
725  E->setCastKind((CastKind)Record.readInt());
726  CastExpr::path_iterator BaseI = E->path_begin();
727  while (NumBaseSpecs--) {
728  auto *BaseSpec = new (Record.getContext()) CXXBaseSpecifier;
729  *BaseSpec = Record.readCXXBaseSpecifier();
730  *BaseI++ = BaseSpec;
731  }
732 }
733 
734 void ASTStmtReader::VisitBinaryOperator(BinaryOperator *E) {
735  VisitExpr(E);
736  E->setLHS(Record.readSubExpr());
737  E->setRHS(Record.readSubExpr());
739  E->setOperatorLoc(ReadSourceLocation());
740  E->setFPFeatures(FPOptions(Record.readInt()));
741 }
742 
743 void ASTStmtReader::VisitCompoundAssignOperator(CompoundAssignOperator *E) {
744  VisitBinaryOperator(E);
745  E->setComputationLHSType(Record.readType());
746  E->setComputationResultType(Record.readType());
747 }
748 
749 void ASTStmtReader::VisitConditionalOperator(ConditionalOperator *E) {
750  VisitExpr(E);
751  E->SubExprs[ConditionalOperator::COND] = Record.readSubExpr();
752  E->SubExprs[ConditionalOperator::LHS] = Record.readSubExpr();
753  E->SubExprs[ConditionalOperator::RHS] = Record.readSubExpr();
754  E->QuestionLoc = ReadSourceLocation();
755  E->ColonLoc = ReadSourceLocation();
756 }
757 
758 void
759 ASTStmtReader::VisitBinaryConditionalOperator(BinaryConditionalOperator *E) {
760  VisitExpr(E);
761  E->OpaqueValue = cast<OpaqueValueExpr>(Record.readSubExpr());
762  E->SubExprs[BinaryConditionalOperator::COMMON] = Record.readSubExpr();
763  E->SubExprs[BinaryConditionalOperator::COND] = Record.readSubExpr();
764  E->SubExprs[BinaryConditionalOperator::LHS] = Record.readSubExpr();
765  E->SubExprs[BinaryConditionalOperator::RHS] = Record.readSubExpr();
766  E->QuestionLoc = ReadSourceLocation();
767  E->ColonLoc = ReadSourceLocation();
768 }
769 
770 void ASTStmtReader::VisitImplicitCastExpr(ImplicitCastExpr *E) {
771  VisitCastExpr(E);
772  E->setIsPartOfExplicitCast(Record.readInt());
773 }
774 
775 void ASTStmtReader::VisitExplicitCastExpr(ExplicitCastExpr *E) {
776  VisitCastExpr(E);
777  E->setTypeInfoAsWritten(GetTypeSourceInfo());
778 }
779 
780 void ASTStmtReader::VisitCStyleCastExpr(CStyleCastExpr *E) {
781  VisitExplicitCastExpr(E);
782  E->setLParenLoc(ReadSourceLocation());
783  E->setRParenLoc(ReadSourceLocation());
784 }
785 
786 void ASTStmtReader::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
787  VisitExpr(E);
788  E->setLParenLoc(ReadSourceLocation());
789  E->setTypeSourceInfo(GetTypeSourceInfo());
790  E->setInitializer(Record.readSubExpr());
791  E->setFileScope(Record.readInt());
792 }
793 
794 void ASTStmtReader::VisitExtVectorElementExpr(ExtVectorElementExpr *E) {
795  VisitExpr(E);
796  E->setBase(Record.readSubExpr());
797  E->setAccessor(Record.getIdentifierInfo());
798  E->setAccessorLoc(ReadSourceLocation());
799 }
800 
801 void ASTStmtReader::VisitInitListExpr(InitListExpr *E) {
802  VisitExpr(E);
803  if (auto *SyntForm = cast_or_null<InitListExpr>(Record.readSubStmt()))
804  E->setSyntacticForm(SyntForm);
805  E->setLBraceLoc(ReadSourceLocation());
806  E->setRBraceLoc(ReadSourceLocation());
807  bool isArrayFiller = Record.readInt();
808  Expr *filler = nullptr;
809  if (isArrayFiller) {
810  filler = Record.readSubExpr();
811  E->ArrayFillerOrUnionFieldInit = filler;
812  } else
813  E->ArrayFillerOrUnionFieldInit = ReadDeclAs<FieldDecl>();
814  E->sawArrayRangeDesignator(Record.readInt());
815  unsigned NumInits = Record.readInt();
816  E->reserveInits(Record.getContext(), NumInits);
817  if (isArrayFiller) {
818  for (unsigned I = 0; I != NumInits; ++I) {
819  Expr *init = Record.readSubExpr();
820  E->updateInit(Record.getContext(), I, init ? init : filler);
821  }
822  } else {
823  for (unsigned I = 0; I != NumInits; ++I)
824  E->updateInit(Record.getContext(), I, Record.readSubExpr());
825  }
826 }
827 
828 void ASTStmtReader::VisitDesignatedInitExpr(DesignatedInitExpr *E) {
830 
831  VisitExpr(E);
832  unsigned NumSubExprs = Record.readInt();
833  assert(NumSubExprs == E->getNumSubExprs() && "Wrong number of subexprs");
834  for (unsigned I = 0; I != NumSubExprs; ++I)
835  E->setSubExpr(I, Record.readSubExpr());
836  E->setEqualOrColonLoc(ReadSourceLocation());
837  E->setGNUSyntax(Record.readInt());
838 
839  SmallVector<Designator, 4> Designators;
840  while (Record.getIdx() < Record.size()) {
841  switch ((DesignatorTypes)Record.readInt()) {
842  case DESIG_FIELD_DECL: {
843  auto *Field = ReadDeclAs<FieldDecl>();
844  SourceLocation DotLoc = ReadSourceLocation();
845  SourceLocation FieldLoc = ReadSourceLocation();
846  Designators.push_back(Designator(Field->getIdentifier(), DotLoc,
847  FieldLoc));
848  Designators.back().setField(Field);
849  break;
850  }
851 
852  case DESIG_FIELD_NAME: {
853  const IdentifierInfo *Name = Record.getIdentifierInfo();
854  SourceLocation DotLoc = ReadSourceLocation();
855  SourceLocation FieldLoc = ReadSourceLocation();
856  Designators.push_back(Designator(Name, DotLoc, FieldLoc));
857  break;
858  }
859 
860  case DESIG_ARRAY: {
861  unsigned Index = Record.readInt();
862  SourceLocation LBracketLoc = ReadSourceLocation();
863  SourceLocation RBracketLoc = ReadSourceLocation();
864  Designators.push_back(Designator(Index, LBracketLoc, RBracketLoc));
865  break;
866  }
867 
868  case DESIG_ARRAY_RANGE: {
869  unsigned Index = Record.readInt();
870  SourceLocation LBracketLoc = ReadSourceLocation();
871  SourceLocation EllipsisLoc = ReadSourceLocation();
872  SourceLocation RBracketLoc = ReadSourceLocation();
873  Designators.push_back(Designator(Index, LBracketLoc, EllipsisLoc,
874  RBracketLoc));
875  break;
876  }
877  }
878  }
879  E->setDesignators(Record.getContext(),
880  Designators.data(), Designators.size());
881 }
882 
883 void ASTStmtReader::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) {
884  VisitExpr(E);
885  E->setBase(Record.readSubExpr());
886  E->setUpdater(Record.readSubExpr());
887 }
888 
889 void ASTStmtReader::VisitNoInitExpr(NoInitExpr *E) {
890  VisitExpr(E);
891 }
892 
893 void ASTStmtReader::VisitArrayInitLoopExpr(ArrayInitLoopExpr *E) {
894  VisitExpr(E);
895  E->SubExprs[0] = Record.readSubExpr();
896  E->SubExprs[1] = Record.readSubExpr();
897 }
898 
899 void ASTStmtReader::VisitArrayInitIndexExpr(ArrayInitIndexExpr *E) {
900  VisitExpr(E);
901 }
902 
903 void ASTStmtReader::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) {
904  VisitExpr(E);
905 }
906 
907 void ASTStmtReader::VisitVAArgExpr(VAArgExpr *E) {
908  VisitExpr(E);
909  E->setSubExpr(Record.readSubExpr());
910  E->setWrittenTypeInfo(GetTypeSourceInfo());
911  E->setBuiltinLoc(ReadSourceLocation());
912  E->setRParenLoc(ReadSourceLocation());
913  E->setIsMicrosoftABI(Record.readInt());
914 }
915 
916 void ASTStmtReader::VisitAddrLabelExpr(AddrLabelExpr *E) {
917  VisitExpr(E);
918  E->setAmpAmpLoc(ReadSourceLocation());
919  E->setLabelLoc(ReadSourceLocation());
920  E->setLabel(ReadDeclAs<LabelDecl>());
921 }
922 
923 void ASTStmtReader::VisitStmtExpr(StmtExpr *E) {
924  VisitExpr(E);
925  E->setLParenLoc(ReadSourceLocation());
926  E->setRParenLoc(ReadSourceLocation());
927  E->setSubStmt(cast_or_null<CompoundStmt>(Record.readSubStmt()));
928 }
929 
930 void ASTStmtReader::VisitChooseExpr(ChooseExpr *E) {
931  VisitExpr(E);
932  E->setCond(Record.readSubExpr());
933  E->setLHS(Record.readSubExpr());
934  E->setRHS(Record.readSubExpr());
935  E->setBuiltinLoc(ReadSourceLocation());
936  E->setRParenLoc(ReadSourceLocation());
937  E->setIsConditionTrue(Record.readInt());
938 }
939 
940 void ASTStmtReader::VisitGNUNullExpr(GNUNullExpr *E) {
941  VisitExpr(E);
942  E->setTokenLocation(ReadSourceLocation());
943 }
944 
945 void ASTStmtReader::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
946  VisitExpr(E);
948  unsigned NumExprs = Record.readInt();
949  while (NumExprs--)
950  Exprs.push_back(Record.readSubExpr());
951  E->setExprs(Record.getContext(), Exprs);
952  E->setBuiltinLoc(ReadSourceLocation());
953  E->setRParenLoc(ReadSourceLocation());
954 }
955 
956 void ASTStmtReader::VisitConvertVectorExpr(ConvertVectorExpr *E) {
957  VisitExpr(E);
958  E->BuiltinLoc = ReadSourceLocation();
959  E->RParenLoc = ReadSourceLocation();
960  E->TInfo = GetTypeSourceInfo();
961  E->SrcExpr = Record.readSubExpr();
962 }
963 
964 void ASTStmtReader::VisitBlockExpr(BlockExpr *E) {
965  VisitExpr(E);
966  E->setBlockDecl(ReadDeclAs<BlockDecl>());
967 }
968 
969 void ASTStmtReader::VisitGenericSelectionExpr(GenericSelectionExpr *E) {
970  VisitExpr(E);
971  E->NumAssocs = Record.readInt();
972  E->AssocTypes = new (Record.getContext()) TypeSourceInfo*[E->NumAssocs];
973  E->SubExprs =
974  new(Record.getContext()) Stmt*[GenericSelectionExpr::END_EXPR+E->NumAssocs];
975 
976  E->SubExprs[GenericSelectionExpr::CONTROLLING] = Record.readSubExpr();
977  for (unsigned I = 0, N = E->getNumAssocs(); I != N; ++I) {
978  E->AssocTypes[I] = GetTypeSourceInfo();
979  E->SubExprs[GenericSelectionExpr::END_EXPR+I] = Record.readSubExpr();
980  }
981  E->ResultIndex = Record.readInt();
982 
983  E->GenericLoc = ReadSourceLocation();
984  E->DefaultLoc = ReadSourceLocation();
985  E->RParenLoc = ReadSourceLocation();
986 }
987 
988 void ASTStmtReader::VisitPseudoObjectExpr(PseudoObjectExpr *E) {
989  VisitExpr(E);
990  unsigned numSemanticExprs = Record.readInt();
991  assert(numSemanticExprs + 1 == E->PseudoObjectExprBits.NumSubExprs);
992  E->PseudoObjectExprBits.ResultIndex = Record.readInt();
993 
994  // Read the syntactic expression.
995  E->getSubExprsBuffer()[0] = Record.readSubExpr();
996 
997  // Read all the semantic expressions.
998  for (unsigned i = 0; i != numSemanticExprs; ++i) {
999  Expr *subExpr = Record.readSubExpr();
1000  E->getSubExprsBuffer()[i+1] = subExpr;
1001  }
1002 }
1003 
1004 void ASTStmtReader::VisitAtomicExpr(AtomicExpr *E) {
1005  VisitExpr(E);
1006  E->Op = AtomicExpr::AtomicOp(Record.readInt());
1007  E->NumSubExprs = AtomicExpr::getNumSubExprs(E->Op);
1008  for (unsigned I = 0; I != E->NumSubExprs; ++I)
1009  E->SubExprs[I] = Record.readSubExpr();
1010  E->BuiltinLoc = ReadSourceLocation();
1011  E->RParenLoc = ReadSourceLocation();
1012 }
1013 
1014 //===----------------------------------------------------------------------===//
1015 // Objective-C Expressions and Statements
1016 
1017 void ASTStmtReader::VisitObjCStringLiteral(ObjCStringLiteral *E) {
1018  VisitExpr(E);
1019  E->setString(cast<StringLiteral>(Record.readSubStmt()));
1020  E->setAtLoc(ReadSourceLocation());
1021 }
1022 
1023 void ASTStmtReader::VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
1024  VisitExpr(E);
1025  // could be one of several IntegerLiteral, FloatLiteral, etc.
1026  E->SubExpr = Record.readSubStmt();
1027  E->BoxingMethod = ReadDeclAs<ObjCMethodDecl>();
1028  E->Range = ReadSourceRange();
1029 }
1030 
1031 void ASTStmtReader::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
1032  VisitExpr(E);
1033  unsigned NumElements = Record.readInt();
1034  assert(NumElements == E->getNumElements() && "Wrong number of elements");
1035  Expr **Elements = E->getElements();
1036  for (unsigned I = 0, N = NumElements; I != N; ++I)
1037  Elements[I] = Record.readSubExpr();
1038  E->ArrayWithObjectsMethod = ReadDeclAs<ObjCMethodDecl>();
1039  E->Range = ReadSourceRange();
1040 }
1041 
1042 void ASTStmtReader::VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *E) {
1043  VisitExpr(E);
1044  unsigned NumElements = Record.readInt();
1045  assert(NumElements == E->getNumElements() && "Wrong number of elements");
1046  bool HasPackExpansions = Record.readInt();
1047  assert(HasPackExpansions == E->HasPackExpansions &&"Pack expansion mismatch");
1048  auto *KeyValues =
1049  E->getTrailingObjects<ObjCDictionaryLiteral::KeyValuePair>();
1050  auto *Expansions =
1051  E->getTrailingObjects<ObjCDictionaryLiteral::ExpansionData>();
1052  for (unsigned I = 0; I != NumElements; ++I) {
1053  KeyValues[I].Key = Record.readSubExpr();
1054  KeyValues[I].Value = Record.readSubExpr();
1055  if (HasPackExpansions) {
1056  Expansions[I].EllipsisLoc = ReadSourceLocation();
1057  Expansions[I].NumExpansionsPlusOne = Record.readInt();
1058  }
1059  }
1060  E->DictWithObjectsMethod = ReadDeclAs<ObjCMethodDecl>();
1061  E->Range = ReadSourceRange();
1062 }
1063 
1064 void ASTStmtReader::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
1065  VisitExpr(E);
1066  E->setEncodedTypeSourceInfo(GetTypeSourceInfo());
1067  E->setAtLoc(ReadSourceLocation());
1068  E->setRParenLoc(ReadSourceLocation());
1069 }
1070 
1071 void ASTStmtReader::VisitObjCSelectorExpr(ObjCSelectorExpr *E) {
1072  VisitExpr(E);
1073  E->setSelector(Record.readSelector());
1074  E->setAtLoc(ReadSourceLocation());
1075  E->setRParenLoc(ReadSourceLocation());
1076 }
1077 
1078 void ASTStmtReader::VisitObjCProtocolExpr(ObjCProtocolExpr *E) {
1079  VisitExpr(E);
1080  E->setProtocol(ReadDeclAs<ObjCProtocolDecl>());
1081  E->setAtLoc(ReadSourceLocation());
1082  E->ProtoLoc = ReadSourceLocation();
1083  E->setRParenLoc(ReadSourceLocation());
1084 }
1085 
1086 void ASTStmtReader::VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) {
1087  VisitExpr(E);
1088  E->setDecl(ReadDeclAs<ObjCIvarDecl>());
1089  E->setLocation(ReadSourceLocation());
1090  E->setOpLoc(ReadSourceLocation());
1091  E->setBase(Record.readSubExpr());
1092  E->setIsArrow(Record.readInt());
1093  E->setIsFreeIvar(Record.readInt());
1094 }
1095 
1096 void ASTStmtReader::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
1097  VisitExpr(E);
1098  unsigned MethodRefFlags = Record.readInt();
1099  bool Implicit = Record.readInt() != 0;
1100  if (Implicit) {
1101  auto *Getter = ReadDeclAs<ObjCMethodDecl>();
1102  auto *Setter = ReadDeclAs<ObjCMethodDecl>();
1103  E->setImplicitProperty(Getter, Setter, MethodRefFlags);
1104  } else {
1105  E->setExplicitProperty(ReadDeclAs<ObjCPropertyDecl>(), MethodRefFlags);
1106  }
1107  E->setLocation(ReadSourceLocation());
1108  E->setReceiverLocation(ReadSourceLocation());
1109  switch (Record.readInt()) {
1110  case 0:
1111  E->setBase(Record.readSubExpr());
1112  break;
1113  case 1:
1114  E->setSuperReceiver(Record.readType());
1115  break;
1116  case 2:
1117  E->setClassReceiver(ReadDeclAs<ObjCInterfaceDecl>());
1118  break;
1119  }
1120 }
1121 
1122 void ASTStmtReader::VisitObjCSubscriptRefExpr(ObjCSubscriptRefExpr *E) {
1123  VisitExpr(E);
1124  E->setRBracket(ReadSourceLocation());
1125  E->setBaseExpr(Record.readSubExpr());
1126  E->setKeyExpr(Record.readSubExpr());
1127  E->GetAtIndexMethodDecl = ReadDeclAs<ObjCMethodDecl>();
1128  E->SetAtIndexMethodDecl = ReadDeclAs<ObjCMethodDecl>();
1129 }
1130 
1131 void ASTStmtReader::VisitObjCMessageExpr(ObjCMessageExpr *E) {
1132  VisitExpr(E);
1133  assert(Record.peekInt() == E->getNumArgs());
1134  Record.skipInts(1);
1135  unsigned NumStoredSelLocs = Record.readInt();
1136  E->SelLocsKind = Record.readInt();
1137  E->setDelegateInitCall(Record.readInt());
1138  E->IsImplicit = Record.readInt();
1139  auto Kind = static_cast<ObjCMessageExpr::ReceiverKind>(Record.readInt());
1140  switch (Kind) {
1142  E->setInstanceReceiver(Record.readSubExpr());
1143  break;
1144 
1146  E->setClassReceiver(GetTypeSourceInfo());
1147  break;
1148 
1151  QualType T = Record.readType();
1152  SourceLocation SuperLoc = ReadSourceLocation();
1153  E->setSuper(SuperLoc, T, Kind == ObjCMessageExpr::SuperInstance);
1154  break;
1155  }
1156  }
1157 
1158  assert(Kind == E->getReceiverKind());
1159 
1160  if (Record.readInt())
1161  E->setMethodDecl(ReadDeclAs<ObjCMethodDecl>());
1162  else
1163  E->setSelector(Record.readSelector());
1164 
1165  E->LBracLoc = ReadSourceLocation();
1166  E->RBracLoc = ReadSourceLocation();
1167 
1168  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1169  E->setArg(I, Record.readSubExpr());
1170 
1171  SourceLocation *Locs = E->getStoredSelLocs();
1172  for (unsigned I = 0; I != NumStoredSelLocs; ++I)
1173  Locs[I] = ReadSourceLocation();
1174 }
1175 
1176 void ASTStmtReader::VisitObjCForCollectionStmt(ObjCForCollectionStmt *S) {
1177  VisitStmt(S);
1178  S->setElement(Record.readSubStmt());
1179  S->setCollection(Record.readSubExpr());
1180  S->setBody(Record.readSubStmt());
1181  S->setForLoc(ReadSourceLocation());
1182  S->setRParenLoc(ReadSourceLocation());
1183 }
1184 
1185 void ASTStmtReader::VisitObjCAtCatchStmt(ObjCAtCatchStmt *S) {
1186  VisitStmt(S);
1187  S->setCatchBody(Record.readSubStmt());
1188  S->setCatchParamDecl(ReadDeclAs<VarDecl>());
1189  S->setAtCatchLoc(ReadSourceLocation());
1190  S->setRParenLoc(ReadSourceLocation());
1191 }
1192 
1193 void ASTStmtReader::VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S) {
1194  VisitStmt(S);
1195  S->setFinallyBody(Record.readSubStmt());
1196  S->setAtFinallyLoc(ReadSourceLocation());
1197 }
1198 
1199 void ASTStmtReader::VisitObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S) {
1200  VisitStmt(S);
1201  S->setSubStmt(Record.readSubStmt());
1202  S->setAtLoc(ReadSourceLocation());
1203 }
1204 
1205 void ASTStmtReader::VisitObjCAtTryStmt(ObjCAtTryStmt *S) {
1206  VisitStmt(S);
1207  assert(Record.peekInt() == S->getNumCatchStmts());
1208  Record.skipInts(1);
1209  bool HasFinally = Record.readInt();
1210  S->setTryBody(Record.readSubStmt());
1211  for (unsigned I = 0, N = S->getNumCatchStmts(); I != N; ++I)
1212  S->setCatchStmt(I, cast_or_null<ObjCAtCatchStmt>(Record.readSubStmt()));
1213 
1214  if (HasFinally)
1215  S->setFinallyStmt(Record.readSubStmt());
1216  S->setAtTryLoc(ReadSourceLocation());
1217 }
1218 
1219 void ASTStmtReader::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
1220  VisitStmt(S);
1221  S->setSynchExpr(Record.readSubStmt());
1222  S->setSynchBody(Record.readSubStmt());
1223  S->setAtSynchronizedLoc(ReadSourceLocation());
1224 }
1225 
1226 void ASTStmtReader::VisitObjCAtThrowStmt(ObjCAtThrowStmt *S) {
1227  VisitStmt(S);
1228  S->setThrowExpr(Record.readSubStmt());
1229  S->setThrowLoc(ReadSourceLocation());
1230 }
1231 
1232 void ASTStmtReader::VisitObjCBoolLiteralExpr(ObjCBoolLiteralExpr *E) {
1233  VisitExpr(E);
1234  E->setValue(Record.readInt());
1235  E->setLocation(ReadSourceLocation());
1236 }
1237 
1238 void ASTStmtReader::VisitObjCAvailabilityCheckExpr(ObjCAvailabilityCheckExpr *E) {
1239  VisitExpr(E);
1240  SourceRange R = Record.readSourceRange();
1241  E->AtLoc = R.getBegin();
1242  E->RParen = R.getEnd();
1243  E->VersionToCheck = Record.readVersionTuple();
1244 }
1245 
1246 //===----------------------------------------------------------------------===//
1247 // C++ Expressions and Statements
1248 //===----------------------------------------------------------------------===//
1249 
1250 void ASTStmtReader::VisitCXXCatchStmt(CXXCatchStmt *S) {
1251  VisitStmt(S);
1252  S->CatchLoc = ReadSourceLocation();
1253  S->ExceptionDecl = ReadDeclAs<VarDecl>();
1254  S->HandlerBlock = Record.readSubStmt();
1255 }
1256 
1257 void ASTStmtReader::VisitCXXTryStmt(CXXTryStmt *S) {
1258  VisitStmt(S);
1259  assert(Record.peekInt() == S->getNumHandlers() && "NumStmtFields is wrong ?");
1260  Record.skipInts(1);
1261  S->TryLoc = ReadSourceLocation();
1262  S->getStmts()[0] = Record.readSubStmt();
1263  for (unsigned i = 0, e = S->getNumHandlers(); i != e; ++i)
1264  S->getStmts()[i + 1] = Record.readSubStmt();
1265 }
1266 
1267 void ASTStmtReader::VisitCXXForRangeStmt(CXXForRangeStmt *S) {
1268  VisitStmt(S);
1269  S->ForLoc = ReadSourceLocation();
1270  S->CoawaitLoc = ReadSourceLocation();
1271  S->ColonLoc = ReadSourceLocation();
1272  S->RParenLoc = ReadSourceLocation();
1273  S->setRangeStmt(Record.readSubStmt());
1274  S->setBeginStmt(Record.readSubStmt());
1275  S->setEndStmt(Record.readSubStmt());
1276  S->setCond(Record.readSubExpr());
1277  S->setInc(Record.readSubExpr());
1278  S->setLoopVarStmt(Record.readSubStmt());
1279  S->setBody(Record.readSubStmt());
1280 }
1281 
1282 void ASTStmtReader::VisitMSDependentExistsStmt(MSDependentExistsStmt *S) {
1283  VisitStmt(S);
1284  S->KeywordLoc = ReadSourceLocation();
1285  S->IsIfExists = Record.readInt();
1286  S->QualifierLoc = Record.readNestedNameSpecifierLoc();
1287  ReadDeclarationNameInfo(S->NameInfo);
1288  S->SubStmt = Record.readSubStmt();
1289 }
1290 
1291 void ASTStmtReader::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
1292  VisitCallExpr(E);
1293  E->Operator = (OverloadedOperatorKind)Record.readInt();
1294  E->Range = Record.readSourceRange();
1295  E->setFPFeatures(FPOptions(Record.readInt()));
1296 }
1297 
1298 void ASTStmtReader::VisitCXXConstructExpr(CXXConstructExpr *E) {
1299  VisitExpr(E);
1300  E->NumArgs = Record.readInt();
1301  if (E->NumArgs)
1302  E->Args = new (Record.getContext()) Stmt*[E->NumArgs];
1303  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1304  E->setArg(I, Record.readSubExpr());
1305  E->setConstructor(ReadDeclAs<CXXConstructorDecl>());
1306  E->setLocation(ReadSourceLocation());
1307  E->setElidable(Record.readInt());
1308  E->setHadMultipleCandidates(Record.readInt());
1309  E->setListInitialization(Record.readInt());
1313  E->ParenOrBraceRange = ReadSourceRange();
1314 }
1315 
1316 void ASTStmtReader::VisitCXXInheritedCtorInitExpr(CXXInheritedCtorInitExpr *E) {
1317  VisitExpr(E);
1318  E->Constructor = ReadDeclAs<CXXConstructorDecl>();
1319  E->Loc = ReadSourceLocation();
1320  E->ConstructsVirtualBase = Record.readInt();
1321  E->InheritedFromVirtualBase = Record.readInt();
1322 }
1323 
1324 void ASTStmtReader::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
1325  VisitCXXConstructExpr(E);
1326  E->Type = GetTypeSourceInfo();
1327 }
1328 
1329 void ASTStmtReader::VisitLambdaExpr(LambdaExpr *E) {
1330  VisitExpr(E);
1331  unsigned NumCaptures = Record.readInt();
1332  assert(NumCaptures == E->NumCaptures);(void)NumCaptures;
1333  E->IntroducerRange = ReadSourceRange();
1334  E->CaptureDefault = static_cast<LambdaCaptureDefault>(Record.readInt());
1335  E->CaptureDefaultLoc = ReadSourceLocation();
1336  E->ExplicitParams = Record.readInt();
1337  E->ExplicitResultType = Record.readInt();
1338  E->ClosingBrace = ReadSourceLocation();
1339 
1340  // Read capture initializers.
1342  CEnd = E->capture_init_end();
1343  C != CEnd; ++C)
1344  *C = Record.readSubExpr();
1345 }
1346 
1347 void
1348 ASTStmtReader::VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E) {
1349  VisitExpr(E);
1350  E->SubExpr = Record.readSubExpr();
1351 }
1352 
1353 void ASTStmtReader::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) {
1354  VisitExplicitCastExpr(E);
1355  SourceRange R = ReadSourceRange();
1356  E->Loc = R.getBegin();
1357  E->RParenLoc = R.getEnd();
1358  R = ReadSourceRange();
1359  E->AngleBrackets = R;
1360 }
1361 
1362 void ASTStmtReader::VisitCXXStaticCastExpr(CXXStaticCastExpr *E) {
1363  return VisitCXXNamedCastExpr(E);
1364 }
1365 
1366 void ASTStmtReader::VisitCXXDynamicCastExpr(CXXDynamicCastExpr *E) {
1367  return VisitCXXNamedCastExpr(E);
1368 }
1369 
1370 void ASTStmtReader::VisitCXXReinterpretCastExpr(CXXReinterpretCastExpr *E) {
1371  return VisitCXXNamedCastExpr(E);
1372 }
1373 
1374 void ASTStmtReader::VisitCXXConstCastExpr(CXXConstCastExpr *E) {
1375  return VisitCXXNamedCastExpr(E);
1376 }
1377 
1378 void ASTStmtReader::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E) {
1379  VisitExplicitCastExpr(E);
1380  E->setLParenLoc(ReadSourceLocation());
1381  E->setRParenLoc(ReadSourceLocation());
1382 }
1383 
1384 void ASTStmtReader::VisitUserDefinedLiteral(UserDefinedLiteral *E) {
1385  VisitCallExpr(E);
1386  E->UDSuffixLoc = ReadSourceLocation();
1387 }
1388 
1389 void ASTStmtReader::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) {
1390  VisitExpr(E);
1391  E->setValue(Record.readInt());
1392  E->setLocation(ReadSourceLocation());
1393 }
1394 
1395 void ASTStmtReader::VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E) {
1396  VisitExpr(E);
1397  E->setLocation(ReadSourceLocation());
1398 }
1399 
1400 void ASTStmtReader::VisitCXXTypeidExpr(CXXTypeidExpr *E) {
1401  VisitExpr(E);
1402  E->setSourceRange(ReadSourceRange());
1403  if (E->isTypeOperand()) { // typeid(int)
1405  GetTypeSourceInfo());
1406  return;
1407  }
1408 
1409  // typeid(42+2)
1410  E->setExprOperand(Record.readSubExpr());
1411 }
1412 
1413 void ASTStmtReader::VisitCXXThisExpr(CXXThisExpr *E) {
1414  VisitExpr(E);
1415  E->setLocation(ReadSourceLocation());
1416  E->setImplicit(Record.readInt());
1417 }
1418 
1419 void ASTStmtReader::VisitCXXThrowExpr(CXXThrowExpr *E) {
1420  VisitExpr(E);
1421  E->ThrowLoc = ReadSourceLocation();
1422  E->Op = Record.readSubExpr();
1423  E->IsThrownVariableInScope = Record.readInt();
1424 }
1425 
1426 void ASTStmtReader::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
1427  VisitExpr(E);
1428  E->Param = ReadDeclAs<ParmVarDecl>();
1429  E->Loc = ReadSourceLocation();
1430 }
1431 
1432 void ASTStmtReader::VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E) {
1433  VisitExpr(E);
1434  E->Field = ReadDeclAs<FieldDecl>();
1435  E->Loc = ReadSourceLocation();
1436 }
1437 
1438 void ASTStmtReader::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
1439  VisitExpr(E);
1440  E->setTemporary(Record.readCXXTemporary());
1441  E->setSubExpr(Record.readSubExpr());
1442 }
1443 
1444 void ASTStmtReader::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
1445  VisitExpr(E);
1446  E->TypeInfo = GetTypeSourceInfo();
1447  E->RParenLoc = ReadSourceLocation();
1448 }
1449 
1450 void ASTStmtReader::VisitCXXNewExpr(CXXNewExpr *E) {
1451  VisitExpr(E);
1452  E->GlobalNew = Record.readInt();
1453  bool isArray = Record.readInt();
1454  E->PassAlignment = Record.readInt();
1455  E->UsualArrayDeleteWantsSize = Record.readInt();
1456  unsigned NumPlacementArgs = Record.readInt();
1457  E->StoredInitializationStyle = Record.readInt();
1458  E->setOperatorNew(ReadDeclAs<FunctionDecl>());
1459  E->setOperatorDelete(ReadDeclAs<FunctionDecl>());
1460  E->AllocatedTypeInfo = GetTypeSourceInfo();
1461  E->TypeIdParens = ReadSourceRange();
1462  E->Range = ReadSourceRange();
1463  E->DirectInitRange = ReadSourceRange();
1464 
1465  E->AllocateArgsArray(Record.getContext(), isArray, NumPlacementArgs,
1466  E->StoredInitializationStyle != 0);
1467 
1468  // Install all the subexpressions.
1470  I != e; ++I)
1471  *I = Record.readSubStmt();
1472 }
1473 
1474 void ASTStmtReader::VisitCXXDeleteExpr(CXXDeleteExpr *E) {
1475  VisitExpr(E);
1476  E->GlobalDelete = Record.readInt();
1477  E->ArrayForm = Record.readInt();
1478  E->ArrayFormAsWritten = Record.readInt();
1479  E->UsualArrayDeleteWantsSize = Record.readInt();
1480  E->OperatorDelete = ReadDeclAs<FunctionDecl>();
1481  E->Argument = Record.readSubExpr();
1482  E->Loc = ReadSourceLocation();
1483 }
1484 
1485 void ASTStmtReader::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
1486  VisitExpr(E);
1487 
1488  E->Base = Record.readSubExpr();
1489  E->IsArrow = Record.readInt();
1490  E->OperatorLoc = ReadSourceLocation();
1491  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1492  E->ScopeType = GetTypeSourceInfo();
1493  E->ColonColonLoc = ReadSourceLocation();
1494  E->TildeLoc = ReadSourceLocation();
1495 
1496  IdentifierInfo *II = Record.getIdentifierInfo();
1497  if (II)
1498  E->setDestroyedType(II, ReadSourceLocation());
1499  else
1500  E->setDestroyedType(GetTypeSourceInfo());
1501 }
1502 
1503 void ASTStmtReader::VisitExprWithCleanups(ExprWithCleanups *E) {
1504  VisitExpr(E);
1505 
1506  unsigned NumObjects = Record.readInt();
1507  assert(NumObjects == E->getNumObjects());
1508  for (unsigned i = 0; i != NumObjects; ++i)
1509  E->getTrailingObjects<BlockDecl *>()[i] =
1510  ReadDeclAs<BlockDecl>();
1511 
1512  E->ExprWithCleanupsBits.CleanupsHaveSideEffects = Record.readInt();
1513  E->SubExpr = Record.readSubExpr();
1514 }
1515 
1516 void
1517 ASTStmtReader::VisitCXXDependentScopeMemberExpr(CXXDependentScopeMemberExpr *E){
1518  VisitExpr(E);
1519 
1520  if (Record.readInt()) // HasTemplateKWAndArgsInfo
1521  ReadTemplateKWAndArgsInfo(
1522  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
1523  E->getTrailingObjects<TemplateArgumentLoc>(),
1524  /*NumTemplateArgs=*/Record.readInt());
1525 
1526  E->Base = Record.readSubExpr();
1527  E->BaseType = Record.readType();
1528  E->IsArrow = Record.readInt();
1529  E->OperatorLoc = ReadSourceLocation();
1530  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1531  E->FirstQualifierFoundInScope = ReadDeclAs<NamedDecl>();
1532  ReadDeclarationNameInfo(E->MemberNameInfo);
1533 }
1534 
1535 void
1536 ASTStmtReader::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) {
1537  VisitExpr(E);
1538 
1539  if (Record.readInt()) // HasTemplateKWAndArgsInfo
1540  ReadTemplateKWAndArgsInfo(
1541  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
1542  E->getTrailingObjects<TemplateArgumentLoc>(),
1543  /*NumTemplateArgs=*/Record.readInt());
1544 
1545  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1546  ReadDeclarationNameInfo(E->NameInfo);
1547 }
1548 
1549 void
1550 ASTStmtReader::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E) {
1551  VisitExpr(E);
1552  assert(Record.peekInt() == E->arg_size() &&
1553  "Read wrong record during creation ?");
1554  Record.skipInts(1);
1555  for (unsigned I = 0, N = E->arg_size(); I != N; ++I)
1556  E->setArg(I, Record.readSubExpr());
1557  E->Type = GetTypeSourceInfo();
1558  E->setLParenLoc(ReadSourceLocation());
1559  E->setRParenLoc(ReadSourceLocation());
1560 }
1561 
1562 void ASTStmtReader::VisitOverloadExpr(OverloadExpr *E) {
1563  VisitExpr(E);
1564 
1565  if (Record.readInt()) // HasTemplateKWAndArgsInfo
1566  ReadTemplateKWAndArgsInfo(*E->getTrailingASTTemplateKWAndArgsInfo(),
1568  /*NumTemplateArgs=*/Record.readInt());
1569 
1570  unsigned NumDecls = Record.readInt();
1571  UnresolvedSet<8> Decls;
1572  for (unsigned i = 0; i != NumDecls; ++i) {
1573  auto *D = ReadDeclAs<NamedDecl>();
1574  auto AS = (AccessSpecifier)Record.readInt();
1575  Decls.addDecl(D, AS);
1576  }
1577  E->initializeResults(Record.getContext(), Decls.begin(), Decls.end());
1578 
1579  ReadDeclarationNameInfo(E->NameInfo);
1580  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1581 }
1582 
1583 void ASTStmtReader::VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
1584  VisitOverloadExpr(E);
1585  E->IsArrow = Record.readInt();
1586  E->HasUnresolvedUsing = Record.readInt();
1587  E->Base = Record.readSubExpr();
1588  E->BaseType = Record.readType();
1589  E->OperatorLoc = ReadSourceLocation();
1590 }
1591 
1592 void ASTStmtReader::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) {
1593  VisitOverloadExpr(E);
1594  E->RequiresADL = Record.readInt();
1595  E->Overloaded = Record.readInt();
1596  E->NamingClass = ReadDeclAs<CXXRecordDecl>();
1597 }
1598 
1599 void ASTStmtReader::VisitTypeTraitExpr(TypeTraitExpr *E) {
1600  VisitExpr(E);
1601  E->TypeTraitExprBits.NumArgs = Record.readInt();
1602  E->TypeTraitExprBits.Kind = Record.readInt();
1603  E->TypeTraitExprBits.Value = Record.readInt();
1604  SourceRange Range = ReadSourceRange();
1605  E->Loc = Range.getBegin();
1606  E->RParenLoc = Range.getEnd();
1607 
1608  auto **Args = E->getTrailingObjects<TypeSourceInfo *>();
1609  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1610  Args[I] = GetTypeSourceInfo();
1611 }
1612 
1613 void ASTStmtReader::VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E) {
1614  VisitExpr(E);
1615  E->ATT = (ArrayTypeTrait)Record.readInt();
1616  E->Value = (unsigned int)Record.readInt();
1617  SourceRange Range = ReadSourceRange();
1618  E->Loc = Range.getBegin();
1619  E->RParen = Range.getEnd();
1620  E->QueriedType = GetTypeSourceInfo();
1621  E->Dimension = Record.readSubExpr();
1622 }
1623 
1624 void ASTStmtReader::VisitExpressionTraitExpr(ExpressionTraitExpr *E) {
1625  VisitExpr(E);
1626  E->ET = (ExpressionTrait)Record.readInt();
1627  E->Value = (bool)Record.readInt();
1628  SourceRange Range = ReadSourceRange();
1629  E->QueriedExpression = Record.readSubExpr();
1630  E->Loc = Range.getBegin();
1631  E->RParen = Range.getEnd();
1632 }
1633 
1634 void ASTStmtReader::VisitCXXNoexceptExpr(CXXNoexceptExpr *E) {
1635  VisitExpr(E);
1636  E->Value = (bool)Record.readInt();
1637  E->Range = ReadSourceRange();
1638  E->Operand = Record.readSubExpr();
1639 }
1640 
1641 void ASTStmtReader::VisitPackExpansionExpr(PackExpansionExpr *E) {
1642  VisitExpr(E);
1643  E->EllipsisLoc = ReadSourceLocation();
1644  E->NumExpansions = Record.readInt();
1645  E->Pattern = Record.readSubExpr();
1646 }
1647 
1648 void ASTStmtReader::VisitSizeOfPackExpr(SizeOfPackExpr *E) {
1649  VisitExpr(E);
1650  unsigned NumPartialArgs = Record.readInt();
1651  E->OperatorLoc = ReadSourceLocation();
1652  E->PackLoc = ReadSourceLocation();
1653  E->RParenLoc = ReadSourceLocation();
1654  E->Pack = Record.readDeclAs<NamedDecl>();
1655  if (E->isPartiallySubstituted()) {
1656  assert(E->Length == NumPartialArgs);
1657  for (auto *I = E->getTrailingObjects<TemplateArgument>(),
1658  *E = I + NumPartialArgs;
1659  I != E; ++I)
1660  new (I) TemplateArgument(Record.readTemplateArgument());
1661  } else if (!E->isValueDependent()) {
1662  E->Length = Record.readInt();
1663  }
1664 }
1665 
1666 void ASTStmtReader::VisitSubstNonTypeTemplateParmExpr(
1668  VisitExpr(E);
1669  E->Param = ReadDeclAs<NonTypeTemplateParmDecl>();
1670  E->NameLoc = ReadSourceLocation();
1671  E->Replacement = Record.readSubExpr();
1672 }
1673 
1674 void ASTStmtReader::VisitSubstNonTypeTemplateParmPackExpr(
1676  VisitExpr(E);
1677  E->Param = ReadDeclAs<NonTypeTemplateParmDecl>();
1678  TemplateArgument ArgPack = Record.readTemplateArgument();
1679  if (ArgPack.getKind() != TemplateArgument::Pack)
1680  return;
1681 
1682  E->Arguments = ArgPack.pack_begin();
1683  E->NumArguments = ArgPack.pack_size();
1684  E->NameLoc = ReadSourceLocation();
1685 }
1686 
1687 void ASTStmtReader::VisitFunctionParmPackExpr(FunctionParmPackExpr *E) {
1688  VisitExpr(E);
1689  E->NumParameters = Record.readInt();
1690  E->ParamPack = ReadDeclAs<ParmVarDecl>();
1691  E->NameLoc = ReadSourceLocation();
1692  auto **Parms = E->getTrailingObjects<ParmVarDecl *>();
1693  for (unsigned i = 0, n = E->NumParameters; i != n; ++i)
1694  Parms[i] = ReadDeclAs<ParmVarDecl>();
1695 }
1696 
1697 void ASTStmtReader::VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E) {
1698  VisitExpr(E);
1699  E->State = Record.readSubExpr();
1700  auto *VD = ReadDeclAs<ValueDecl>();
1701  unsigned ManglingNumber = Record.readInt();
1702  E->setExtendingDecl(VD, ManglingNumber);
1703 }
1704 
1705 void ASTStmtReader::VisitCXXFoldExpr(CXXFoldExpr *E) {
1706  VisitExpr(E);
1707  E->LParenLoc = ReadSourceLocation();
1708  E->EllipsisLoc = ReadSourceLocation();
1709  E->RParenLoc = ReadSourceLocation();
1710  E->SubExprs[0] = Record.readSubExpr();
1711  E->SubExprs[1] = Record.readSubExpr();
1712  E->Opcode = (BinaryOperatorKind)Record.readInt();
1713 }
1714 
1715 void ASTStmtReader::VisitOpaqueValueExpr(OpaqueValueExpr *E) {
1716  VisitExpr(E);
1717  E->SourceExpr = Record.readSubExpr();
1718  E->Loc = ReadSourceLocation();
1719  E->setIsUnique(Record.readInt());
1720 }
1721 
1722 void ASTStmtReader::VisitTypoExpr(TypoExpr *E) {
1723  llvm_unreachable("Cannot read TypoExpr nodes");
1724 }
1725 
1726 //===----------------------------------------------------------------------===//
1727 // Microsoft Expressions and Statements
1728 //===----------------------------------------------------------------------===//
1729 void ASTStmtReader::VisitMSPropertyRefExpr(MSPropertyRefExpr *E) {
1730  VisitExpr(E);
1731  E->IsArrow = (Record.readInt() != 0);
1732  E->BaseExpr = Record.readSubExpr();
1733  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1734  E->MemberLoc = ReadSourceLocation();
1735  E->TheDecl = ReadDeclAs<MSPropertyDecl>();
1736 }
1737 
1738 void ASTStmtReader::VisitMSPropertySubscriptExpr(MSPropertySubscriptExpr *E) {
1739  VisitExpr(E);
1740  E->setBase(Record.readSubExpr());
1741  E->setIdx(Record.readSubExpr());
1742  E->setRBracketLoc(ReadSourceLocation());
1743 }
1744 
1745 void ASTStmtReader::VisitCXXUuidofExpr(CXXUuidofExpr *E) {
1746  VisitExpr(E);
1747  E->setSourceRange(ReadSourceRange());
1748  std::string UuidStr = ReadString();
1749  E->setUuidStr(StringRef(UuidStr).copy(Record.getContext()));
1750  if (E->isTypeOperand()) { // __uuidof(ComType)
1752  GetTypeSourceInfo());
1753  return;
1754  }
1755 
1756  // __uuidof(expr)
1757  E->setExprOperand(Record.readSubExpr());
1758 }
1759 
1760 void ASTStmtReader::VisitSEHLeaveStmt(SEHLeaveStmt *S) {
1761  VisitStmt(S);
1762  S->setLeaveLoc(ReadSourceLocation());
1763 }
1764 
1765 void ASTStmtReader::VisitSEHExceptStmt(SEHExceptStmt *S) {
1766  VisitStmt(S);
1767  S->Loc = ReadSourceLocation();
1768  S->Children[SEHExceptStmt::FILTER_EXPR] = Record.readSubStmt();
1769  S->Children[SEHExceptStmt::BLOCK] = Record.readSubStmt();
1770 }
1771 
1772 void ASTStmtReader::VisitSEHFinallyStmt(SEHFinallyStmt *S) {
1773  VisitStmt(S);
1774  S->Loc = ReadSourceLocation();
1775  S->Block = Record.readSubStmt();
1776 }
1777 
1778 void ASTStmtReader::VisitSEHTryStmt(SEHTryStmt *S) {
1779  VisitStmt(S);
1780  S->IsCXXTry = Record.readInt();
1781  S->TryLoc = ReadSourceLocation();
1782  S->Children[SEHTryStmt::TRY] = Record.readSubStmt();
1783  S->Children[SEHTryStmt::HANDLER] = Record.readSubStmt();
1784 }
1785 
1786 //===----------------------------------------------------------------------===//
1787 // CUDA Expressions and Statements
1788 //===----------------------------------------------------------------------===//
1789 
1790 void ASTStmtReader::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E) {
1791  VisitCallExpr(E);
1792  E->setConfig(cast<CallExpr>(Record.readSubExpr()));
1793 }
1794 
1795 //===----------------------------------------------------------------------===//
1796 // OpenCL Expressions and Statements.
1797 //===----------------------------------------------------------------------===//
1798 void ASTStmtReader::VisitAsTypeExpr(AsTypeExpr *E) {
1799  VisitExpr(E);
1800  E->BuiltinLoc = ReadSourceLocation();
1801  E->RParenLoc = ReadSourceLocation();
1802  E->SrcExpr = Record.readSubExpr();
1803 }
1804 
1805 //===----------------------------------------------------------------------===//
1806 // OpenMP Directives.
1807 //===----------------------------------------------------------------------===//
1808 
1809 void ASTStmtReader::VisitOMPExecutableDirective(OMPExecutableDirective *E) {
1810  E->setLocStart(ReadSourceLocation());
1811  E->setLocEnd(ReadSourceLocation());
1812  OMPClauseReader ClauseReader(Record);
1814  for (unsigned i = 0; i < E->getNumClauses(); ++i)
1815  Clauses.push_back(ClauseReader.readClause());
1816  E->setClauses(Clauses);
1817  if (E->hasAssociatedStmt())
1818  E->setAssociatedStmt(Record.readSubStmt());
1819 }
1820 
1821 void ASTStmtReader::VisitOMPLoopDirective(OMPLoopDirective *D) {
1822  VisitStmt(D);
1823  // Two fields (NumClauses and CollapsedNum) were read in ReadStmtFromStream.
1824  Record.skipInts(2);
1825  VisitOMPExecutableDirective(D);
1826  D->setIterationVariable(Record.readSubExpr());
1827  D->setLastIteration(Record.readSubExpr());
1828  D->setCalcLastIteration(Record.readSubExpr());
1829  D->setPreCond(Record.readSubExpr());
1830  D->setCond(Record.readSubExpr());
1831  D->setInit(Record.readSubExpr());
1832  D->setInc(Record.readSubExpr());
1833  D->setPreInits(Record.readSubStmt());
1837  D->setIsLastIterVariable(Record.readSubExpr());
1838  D->setLowerBoundVariable(Record.readSubExpr());
1839  D->setUpperBoundVariable(Record.readSubExpr());
1840  D->setStrideVariable(Record.readSubExpr());
1841  D->setEnsureUpperBound(Record.readSubExpr());
1842  D->setNextLowerBound(Record.readSubExpr());
1843  D->setNextUpperBound(Record.readSubExpr());
1844  D->setNumIterations(Record.readSubExpr());
1845  }
1849  D->setDistInc(Record.readSubExpr());
1850  D->setPrevEnsureUpperBound(Record.readSubExpr());
1854  D->setCombinedInit(Record.readSubExpr());
1855  D->setCombinedCond(Record.readSubExpr());
1858  }
1860  unsigned CollapsedNum = D->getCollapsedNumber();
1861  Sub.reserve(CollapsedNum);
1862  for (unsigned i = 0; i < CollapsedNum; ++i)
1863  Sub.push_back(Record.readSubExpr());
1864  D->setCounters(Sub);
1865  Sub.clear();
1866  for (unsigned i = 0; i < CollapsedNum; ++i)
1867  Sub.push_back(Record.readSubExpr());
1868  D->setPrivateCounters(Sub);
1869  Sub.clear();
1870  for (unsigned i = 0; i < CollapsedNum; ++i)
1871  Sub.push_back(Record.readSubExpr());
1872  D->setInits(Sub);
1873  Sub.clear();
1874  for (unsigned i = 0; i < CollapsedNum; ++i)
1875  Sub.push_back(Record.readSubExpr());
1876  D->setUpdates(Sub);
1877  Sub.clear();
1878  for (unsigned i = 0; i < CollapsedNum; ++i)
1879  Sub.push_back(Record.readSubExpr());
1880  D->setFinals(Sub);
1881 }
1882 
1883 void ASTStmtReader::VisitOMPParallelDirective(OMPParallelDirective *D) {
1884  VisitStmt(D);
1885  // The NumClauses field was read in ReadStmtFromStream.
1886  Record.skipInts(1);
1887  VisitOMPExecutableDirective(D);
1888  D->setHasCancel(Record.readInt());
1889 }
1890 
1891 void ASTStmtReader::VisitOMPSimdDirective(OMPSimdDirective *D) {
1892  VisitOMPLoopDirective(D);
1893 }
1894 
1895 void ASTStmtReader::VisitOMPForDirective(OMPForDirective *D) {
1896  VisitOMPLoopDirective(D);
1897  D->setHasCancel(Record.readInt());
1898 }
1899 
1900 void ASTStmtReader::VisitOMPForSimdDirective(OMPForSimdDirective *D) {
1901  VisitOMPLoopDirective(D);
1902 }
1903 
1904 void ASTStmtReader::VisitOMPSectionsDirective(OMPSectionsDirective *D) {
1905  VisitStmt(D);
1906  // The NumClauses field was read in ReadStmtFromStream.
1907  Record.skipInts(1);
1908  VisitOMPExecutableDirective(D);
1909  D->setHasCancel(Record.readInt());
1910 }
1911 
1912 void ASTStmtReader::VisitOMPSectionDirective(OMPSectionDirective *D) {
1913  VisitStmt(D);
1914  VisitOMPExecutableDirective(D);
1915  D->setHasCancel(Record.readInt());
1916 }
1917 
1918 void ASTStmtReader::VisitOMPSingleDirective(OMPSingleDirective *D) {
1919  VisitStmt(D);
1920  // The NumClauses field was read in ReadStmtFromStream.
1921  Record.skipInts(1);
1922  VisitOMPExecutableDirective(D);
1923 }
1924 
1925 void ASTStmtReader::VisitOMPMasterDirective(OMPMasterDirective *D) {
1926  VisitStmt(D);
1927  VisitOMPExecutableDirective(D);
1928 }
1929 
1930 void ASTStmtReader::VisitOMPCriticalDirective(OMPCriticalDirective *D) {
1931  VisitStmt(D);
1932  // The NumClauses field was read in ReadStmtFromStream.
1933  Record.skipInts(1);
1934  VisitOMPExecutableDirective(D);
1935  ReadDeclarationNameInfo(D->DirName);
1936 }
1937 
1938 void ASTStmtReader::VisitOMPParallelForDirective(OMPParallelForDirective *D) {
1939  VisitOMPLoopDirective(D);
1940  D->setHasCancel(Record.readInt());
1941 }
1942 
1943 void ASTStmtReader::VisitOMPParallelForSimdDirective(
1945  VisitOMPLoopDirective(D);
1946 }
1947 
1948 void ASTStmtReader::VisitOMPParallelSectionsDirective(
1950  VisitStmt(D);
1951  // The NumClauses field was read in ReadStmtFromStream.
1952  Record.skipInts(1);
1953  VisitOMPExecutableDirective(D);
1954  D->setHasCancel(Record.readInt());
1955 }
1956 
1957 void ASTStmtReader::VisitOMPTaskDirective(OMPTaskDirective *D) {
1958  VisitStmt(D);
1959  // The NumClauses field was read in ReadStmtFromStream.
1960  Record.skipInts(1);
1961  VisitOMPExecutableDirective(D);
1962  D->setHasCancel(Record.readInt());
1963 }
1964 
1965 void ASTStmtReader::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) {
1966  VisitStmt(D);
1967  VisitOMPExecutableDirective(D);
1968 }
1969 
1970 void ASTStmtReader::VisitOMPBarrierDirective(OMPBarrierDirective *D) {
1971  VisitStmt(D);
1972  VisitOMPExecutableDirective(D);
1973 }
1974 
1975 void ASTStmtReader::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) {
1976  VisitStmt(D);
1977  VisitOMPExecutableDirective(D);
1978 }
1979 
1980 void ASTStmtReader::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) {
1981  VisitStmt(D);
1982  // The NumClauses field was read in ReadStmtFromStream.
1983  Record.skipInts(1);
1984  VisitOMPExecutableDirective(D);
1985  D->setReductionRef(Record.readSubExpr());
1986 }
1987 
1988 void ASTStmtReader::VisitOMPFlushDirective(OMPFlushDirective *D) {
1989  VisitStmt(D);
1990  // The NumClauses field was read in ReadStmtFromStream.
1991  Record.skipInts(1);
1992  VisitOMPExecutableDirective(D);
1993 }
1994 
1995 void ASTStmtReader::VisitOMPOrderedDirective(OMPOrderedDirective *D) {
1996  VisitStmt(D);
1997  // The NumClauses field was read in ReadStmtFromStream.
1998  Record.skipInts(1);
1999  VisitOMPExecutableDirective(D);
2000 }
2001 
2002 void ASTStmtReader::VisitOMPAtomicDirective(OMPAtomicDirective *D) {
2003  VisitStmt(D);
2004  // The NumClauses field was read in ReadStmtFromStream.
2005  Record.skipInts(1);
2006  VisitOMPExecutableDirective(D);
2007  D->setX(Record.readSubExpr());
2008  D->setV(Record.readSubExpr());
2009  D->setExpr(Record.readSubExpr());
2010  D->setUpdateExpr(Record.readSubExpr());
2011  D->IsXLHSInRHSPart = Record.readInt() != 0;
2012  D->IsPostfixUpdate = Record.readInt() != 0;
2013 }
2014 
2015 void ASTStmtReader::VisitOMPTargetDirective(OMPTargetDirective *D) {
2016  VisitStmt(D);
2017  // The NumClauses field was read in ReadStmtFromStream.
2018  Record.skipInts(1);
2019  VisitOMPExecutableDirective(D);
2020 }
2021 
2022 void ASTStmtReader::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) {
2023  VisitStmt(D);
2024  Record.skipInts(1);
2025  VisitOMPExecutableDirective(D);
2026 }
2027 
2028 void ASTStmtReader::VisitOMPTargetEnterDataDirective(
2030  VisitStmt(D);
2031  Record.skipInts(1);
2032  VisitOMPExecutableDirective(D);
2033 }
2034 
2035 void ASTStmtReader::VisitOMPTargetExitDataDirective(
2037  VisitStmt(D);
2038  Record.skipInts(1);
2039  VisitOMPExecutableDirective(D);
2040 }
2041 
2042 void ASTStmtReader::VisitOMPTargetParallelDirective(
2044  VisitStmt(D);
2045  Record.skipInts(1);
2046  VisitOMPExecutableDirective(D);
2047 }
2048 
2049 void ASTStmtReader::VisitOMPTargetParallelForDirective(
2051  VisitOMPLoopDirective(D);
2052  D->setHasCancel(Record.readInt());
2053 }
2054 
2055 void ASTStmtReader::VisitOMPTeamsDirective(OMPTeamsDirective *D) {
2056  VisitStmt(D);
2057  // The NumClauses field was read in ReadStmtFromStream.
2058  Record.skipInts(1);
2059  VisitOMPExecutableDirective(D);
2060 }
2061 
2062 void ASTStmtReader::VisitOMPCancellationPointDirective(
2064  VisitStmt(D);
2065  VisitOMPExecutableDirective(D);
2066  D->setCancelRegion(static_cast<OpenMPDirectiveKind>(Record.readInt()));
2067 }
2068 
2069 void ASTStmtReader::VisitOMPCancelDirective(OMPCancelDirective *D) {
2070  VisitStmt(D);
2071  // The NumClauses field was read in ReadStmtFromStream.
2072  Record.skipInts(1);
2073  VisitOMPExecutableDirective(D);
2074  D->setCancelRegion(static_cast<OpenMPDirectiveKind>(Record.readInt()));
2075 }
2076 
2077 void ASTStmtReader::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) {
2078  VisitOMPLoopDirective(D);
2079 }
2080 
2081 void ASTStmtReader::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) {
2082  VisitOMPLoopDirective(D);
2083 }
2084 
2085 void ASTStmtReader::VisitOMPDistributeDirective(OMPDistributeDirective *D) {
2086  VisitOMPLoopDirective(D);
2087 }
2088 
2089 void ASTStmtReader::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) {
2090  VisitStmt(D);
2091  Record.skipInts(1);
2092  VisitOMPExecutableDirective(D);
2093 }
2094 
2095 void ASTStmtReader::VisitOMPDistributeParallelForDirective(
2097  VisitOMPLoopDirective(D);
2098  D->setHasCancel(Record.readInt());
2099 }
2100 
2101 void ASTStmtReader::VisitOMPDistributeParallelForSimdDirective(
2103  VisitOMPLoopDirective(D);
2104 }
2105 
2106 void ASTStmtReader::VisitOMPDistributeSimdDirective(
2108  VisitOMPLoopDirective(D);
2109 }
2110 
2111 void ASTStmtReader::VisitOMPTargetParallelForSimdDirective(
2113  VisitOMPLoopDirective(D);
2114 }
2115 
2116 void ASTStmtReader::VisitOMPTargetSimdDirective(OMPTargetSimdDirective *D) {
2117  VisitOMPLoopDirective(D);
2118 }
2119 
2120 void ASTStmtReader::VisitOMPTeamsDistributeDirective(
2122  VisitOMPLoopDirective(D);
2123 }
2124 
2125 void ASTStmtReader::VisitOMPTeamsDistributeSimdDirective(
2127  VisitOMPLoopDirective(D);
2128 }
2129 
2130 void ASTStmtReader::VisitOMPTeamsDistributeParallelForSimdDirective(
2132  VisitOMPLoopDirective(D);
2133 }
2134 
2135 void ASTStmtReader::VisitOMPTeamsDistributeParallelForDirective(
2137  VisitOMPLoopDirective(D);
2138  D->setHasCancel(Record.readInt());
2139 }
2140 
2141 void ASTStmtReader::VisitOMPTargetTeamsDirective(OMPTargetTeamsDirective *D) {
2142  VisitStmt(D);
2143  // The NumClauses field was read in ReadStmtFromStream.
2144  Record.skipInts(1);
2145  VisitOMPExecutableDirective(D);
2146 }
2147 
2148 void ASTStmtReader::VisitOMPTargetTeamsDistributeDirective(
2150  VisitOMPLoopDirective(D);
2151 }
2152 
2153 void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForDirective(
2155  VisitOMPLoopDirective(D);
2156  D->setHasCancel(Record.readInt());
2157 }
2158 
2159 void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
2161  VisitOMPLoopDirective(D);
2162 }
2163 
2164 void ASTStmtReader::VisitOMPTargetTeamsDistributeSimdDirective(
2166  VisitOMPLoopDirective(D);
2167 }
2168 
2169 //===----------------------------------------------------------------------===//
2170 // ASTReader Implementation
2171 //===----------------------------------------------------------------------===//
2172 
2174  switch (ReadingKind) {
2175  case Read_None:
2176  llvm_unreachable("should not call this when not reading anything");
2177  case Read_Decl:
2178  case Read_Type:
2179  return ReadStmtFromStream(F);
2180  case Read_Stmt:
2181  return ReadSubStmt();
2182  }
2183 
2184  llvm_unreachable("ReadingKind not set ?");
2185 }
2186 
2188  return cast_or_null<Expr>(ReadStmt(F));
2189 }
2190 
2192  return cast_or_null<Expr>(ReadSubStmt());
2193 }
2194 
2195 // Within the bitstream, expressions are stored in Reverse Polish
2196 // Notation, with each of the subexpressions preceding the
2197 // expression they are stored in. Subexpressions are stored from last to first.
2198 // To evaluate expressions, we continue reading expressions and placing them on
2199 // the stack, with expressions having operands removing those operands from the
2200 // stack. Evaluation terminates when we see a STMT_STOP record, and
2201 // the single remaining expression on the stack is our result.
2202 Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) {
2203  ReadingKindTracker ReadingKind(Read_Stmt, *this);
2204  llvm::BitstreamCursor &Cursor = F.DeclsCursor;
2205 
2206  // Map of offset to previously deserialized stmt. The offset points
2207  // just after the stmt record.
2208  llvm::DenseMap<uint64_t, Stmt *> StmtEntries;
2209 
2210 #ifndef NDEBUG
2211  unsigned PrevNumStmts = StmtStack.size();
2212 #endif
2213 
2214  ASTRecordReader Record(*this, F);
2215  ASTStmtReader Reader(Record, Cursor);
2216  Stmt::EmptyShell Empty;
2217 
2218  while (true) {
2219  llvm::BitstreamEntry Entry = Cursor.advanceSkippingSubblocks();
2220 
2221  switch (Entry.Kind) {
2222  case llvm::BitstreamEntry::SubBlock: // Handled for us already.
2224  Error("malformed block record in AST file");
2225  return nullptr;
2226  case llvm::BitstreamEntry::EndBlock:
2227  goto Done;
2228  case llvm::BitstreamEntry::Record:
2229  // The interesting case.
2230  break;
2231  }
2232 
2233  ASTContext &Context = getContext();
2234  Stmt *S = nullptr;
2235  bool Finished = false;
2236  bool IsStmtReference = false;
2237  switch ((StmtCode)Record.readRecord(Cursor, Entry.ID)) {
2238  case STMT_STOP:
2239  Finished = true;
2240  break;
2241 
2242  case STMT_REF_PTR:
2243  IsStmtReference = true;
2244  assert(StmtEntries.find(Record[0]) != StmtEntries.end() &&
2245  "No stmt was recorded for this offset reference!");
2246  S = StmtEntries[Record.readInt()];
2247  break;
2248 
2249  case STMT_NULL_PTR:
2250  S = nullptr;
2251  break;
2252 
2253  case STMT_NULL:
2254  S = new (Context) NullStmt(Empty);
2255  break;
2256 
2257  case STMT_COMPOUND:
2259  Context, /*NumStmts=*/Record[ASTStmtReader::NumStmtFields]);
2260  break;
2261 
2262  case STMT_CASE:
2263  S = new (Context) CaseStmt(Empty);
2264  break;
2265 
2266  case STMT_DEFAULT:
2267  S = new (Context) DefaultStmt(Empty);
2268  break;
2269 
2270  case STMT_LABEL:
2271  S = new (Context) LabelStmt(Empty);
2272  break;
2273 
2274  case STMT_ATTRIBUTED:
2276  Context,
2277  /*NumAttrs*/Record[ASTStmtReader::NumStmtFields]);
2278  break;
2279 
2280  case STMT_IF:
2281  S = new (Context) IfStmt(Empty);
2282  break;
2283 
2284  case STMT_SWITCH:
2285  S = new (Context) SwitchStmt(Empty);
2286  break;
2287 
2288  case STMT_WHILE:
2289  S = new (Context) WhileStmt(Empty);
2290  break;
2291 
2292  case STMT_DO:
2293  S = new (Context) DoStmt(Empty);
2294  break;
2295 
2296  case STMT_FOR:
2297  S = new (Context) ForStmt(Empty);
2298  break;
2299 
2300  case STMT_GOTO:
2301  S = new (Context) GotoStmt(Empty);
2302  break;
2303 
2304  case STMT_INDIRECT_GOTO:
2305  S = new (Context) IndirectGotoStmt(Empty);
2306  break;
2307 
2308  case STMT_CONTINUE:
2309  S = new (Context) ContinueStmt(Empty);
2310  break;
2311 
2312  case STMT_BREAK:
2313  S = new (Context) BreakStmt(Empty);
2314  break;
2315 
2316  case STMT_RETURN:
2317  S = new (Context) ReturnStmt(Empty);
2318  break;
2319 
2320  case STMT_DECL:
2321  S = new (Context) DeclStmt(Empty);
2322  break;
2323 
2324  case STMT_GCCASM:
2325  S = new (Context) GCCAsmStmt(Empty);
2326  break;
2327 
2328  case STMT_MSASM:
2329  S = new (Context) MSAsmStmt(Empty);
2330  break;
2331 
2332  case STMT_CAPTURED:
2334  Record[ASTStmtReader::NumStmtFields]);
2335  break;
2336 
2337  case EXPR_PREDEFINED:
2338  S = new (Context) PredefinedExpr(Empty);
2339  break;
2340 
2341  case EXPR_DECL_REF:
2343  Context,
2344  /*HasQualifier=*/Record[ASTStmtReader::NumExprFields],
2345  /*HasFoundDecl=*/Record[ASTStmtReader::NumExprFields + 1],
2346  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields + 2],
2347  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields + 2] ?
2348  Record[ASTStmtReader::NumExprFields + 5] : 0);
2349  break;
2350 
2351  case EXPR_INTEGER_LITERAL:
2352  S = IntegerLiteral::Create(Context, Empty);
2353  break;
2354 
2355  case EXPR_FLOATING_LITERAL:
2356  S = FloatingLiteral::Create(Context, Empty);
2357  break;
2358 
2360  S = new (Context) ImaginaryLiteral(Empty);
2361  break;
2362 
2363  case EXPR_STRING_LITERAL:
2364  S = StringLiteral::CreateEmpty(Context,
2365  Record[ASTStmtReader::NumExprFields + 1]);
2366  break;
2367 
2369  S = new (Context) CharacterLiteral(Empty);
2370  break;
2371 
2372  case EXPR_PAREN:
2373  S = new (Context) ParenExpr(Empty);
2374  break;
2375 
2376  case EXPR_PAREN_LIST:
2377  S = new (Context) ParenListExpr(Empty);
2378  break;
2379 
2380  case EXPR_UNARY_OPERATOR:
2381  S = new (Context) UnaryOperator(Empty);
2382  break;
2383 
2384  case EXPR_OFFSETOF:
2385  S = OffsetOfExpr::CreateEmpty(Context,
2386  Record[ASTStmtReader::NumExprFields],
2387  Record[ASTStmtReader::NumExprFields + 1]);
2388  break;
2389 
2390  case EXPR_SIZEOF_ALIGN_OF:
2391  S = new (Context) UnaryExprOrTypeTraitExpr(Empty);
2392  break;
2393 
2394  case EXPR_ARRAY_SUBSCRIPT:
2395  S = new (Context) ArraySubscriptExpr(Empty);
2396  break;
2397 
2399  S = new (Context) OMPArraySectionExpr(Empty);
2400  break;
2401 
2402  case EXPR_CALL:
2403  S = new (Context) CallExpr(Context, Stmt::CallExprClass, Empty);
2404  break;
2405 
2406  case EXPR_MEMBER: {
2407  // We load everything here and fully initialize it at creation.
2408  // That way we can use MemberExpr::Create and don't have to duplicate its
2409  // logic with a MemberExpr::CreateEmpty.
2410 
2411  assert(Record.getIdx() == 0);
2412  NestedNameSpecifierLoc QualifierLoc;
2413  if (Record.readInt()) { // HasQualifier.
2414  QualifierLoc = Record.readNestedNameSpecifierLoc();
2415  }
2416 
2417  SourceLocation TemplateKWLoc;
2418  TemplateArgumentListInfo ArgInfo;
2419  bool HasTemplateKWAndArgsInfo = Record.readInt();
2420  if (HasTemplateKWAndArgsInfo) {
2421  TemplateKWLoc = Record.readSourceLocation();
2422  unsigned NumTemplateArgs = Record.readInt();
2423  ArgInfo.setLAngleLoc(Record.readSourceLocation());
2424  ArgInfo.setRAngleLoc(Record.readSourceLocation());
2425  for (unsigned i = 0; i != NumTemplateArgs; ++i)
2426  ArgInfo.addArgument(Record.readTemplateArgumentLoc());
2427  }
2428 
2429  bool HadMultipleCandidates = Record.readInt();
2430 
2431  auto *FoundD = Record.readDeclAs<NamedDecl>();
2432  auto AS = (AccessSpecifier)Record.readInt();
2433  DeclAccessPair FoundDecl = DeclAccessPair::make(FoundD, AS);
2434 
2435  QualType T = Record.readType();
2436  auto VK = static_cast<ExprValueKind>(Record.readInt());
2437  auto OK = static_cast<ExprObjectKind>(Record.readInt());
2438  Expr *Base = ReadSubExpr();
2439  auto *MemberD = Record.readDeclAs<ValueDecl>();
2440  SourceLocation MemberLoc = Record.readSourceLocation();
2441  DeclarationNameInfo MemberNameInfo(MemberD->getDeclName(), MemberLoc);
2442  bool IsArrow = Record.readInt();
2443  SourceLocation OperatorLoc = Record.readSourceLocation();
2444 
2445  S = MemberExpr::Create(Context, Base, IsArrow, OperatorLoc, QualifierLoc,
2446  TemplateKWLoc, MemberD, FoundDecl, MemberNameInfo,
2447  HasTemplateKWAndArgsInfo ? &ArgInfo : nullptr, T,
2448  VK, OK);
2449  Record.readDeclarationNameLoc(cast<MemberExpr>(S)->MemberDNLoc,
2450  MemberD->getDeclName());
2451  if (HadMultipleCandidates)
2452  cast<MemberExpr>(S)->setHadMultipleCandidates(true);
2453  break;
2454  }
2455 
2456  case EXPR_BINARY_OPERATOR:
2457  S = new (Context) BinaryOperator(Empty);
2458  break;
2459 
2461  S = new (Context) CompoundAssignOperator(Empty);
2462  break;
2463 
2465  S = new (Context) ConditionalOperator(Empty);
2466  break;
2467 
2469  S = new (Context) BinaryConditionalOperator(Empty);
2470  break;
2471 
2472  case EXPR_IMPLICIT_CAST:
2473  S = ImplicitCastExpr::CreateEmpty(Context,
2474  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
2475  break;
2476 
2477  case EXPR_CSTYLE_CAST:
2478  S = CStyleCastExpr::CreateEmpty(Context,
2479  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
2480  break;
2481 
2482  case EXPR_COMPOUND_LITERAL:
2483  S = new (Context) CompoundLiteralExpr(Empty);
2484  break;
2485 
2487  S = new (Context) ExtVectorElementExpr(Empty);
2488  break;
2489 
2490  case EXPR_INIT_LIST:
2491  S = new (Context) InitListExpr(Empty);
2492  break;
2493 
2494  case EXPR_DESIGNATED_INIT:
2495  S = DesignatedInitExpr::CreateEmpty(Context,
2496  Record[ASTStmtReader::NumExprFields] - 1);
2497 
2498  break;
2499 
2501  S = new (Context) DesignatedInitUpdateExpr(Empty);
2502  break;
2503 
2505  S = new (Context) ImplicitValueInitExpr(Empty);
2506  break;
2507 
2508  case EXPR_NO_INIT:
2509  S = new (Context) NoInitExpr(Empty);
2510  break;
2511 
2512  case EXPR_ARRAY_INIT_LOOP:
2513  S = new (Context) ArrayInitLoopExpr(Empty);
2514  break;
2515 
2516  case EXPR_ARRAY_INIT_INDEX:
2517  S = new (Context) ArrayInitIndexExpr(Empty);
2518  break;
2519 
2520  case EXPR_VA_ARG:
2521  S = new (Context) VAArgExpr(Empty);
2522  break;
2523 
2524  case EXPR_ADDR_LABEL:
2525  S = new (Context) AddrLabelExpr(Empty);
2526  break;
2527 
2528  case EXPR_STMT:
2529  S = new (Context) StmtExpr(Empty);
2530  break;
2531 
2532  case EXPR_CHOOSE:
2533  S = new (Context) ChooseExpr(Empty);
2534  break;
2535 
2536  case EXPR_GNU_NULL:
2537  S = new (Context) GNUNullExpr(Empty);
2538  break;
2539 
2540  case EXPR_SHUFFLE_VECTOR:
2541  S = new (Context) ShuffleVectorExpr(Empty);
2542  break;
2543 
2544  case EXPR_CONVERT_VECTOR:
2545  S = new (Context) ConvertVectorExpr(Empty);
2546  break;
2547 
2548  case EXPR_BLOCK:
2549  S = new (Context) BlockExpr(Empty);
2550  break;
2551 
2553  S = new (Context) GenericSelectionExpr(Empty);
2554  break;
2555 
2557  S = new (Context) ObjCStringLiteral(Empty);
2558  break;
2559 
2561  S = new (Context) ObjCBoxedExpr(Empty);
2562  break;
2563 
2565  S = ObjCArrayLiteral::CreateEmpty(Context,
2566  Record[ASTStmtReader::NumExprFields]);
2567  break;
2568 
2571  Record[ASTStmtReader::NumExprFields],
2572  Record[ASTStmtReader::NumExprFields + 1]);
2573  break;
2574 
2575  case EXPR_OBJC_ENCODE:
2576  S = new (Context) ObjCEncodeExpr(Empty);
2577  break;
2578 
2580  S = new (Context) ObjCSelectorExpr(Empty);
2581  break;
2582 
2584  S = new (Context) ObjCProtocolExpr(Empty);
2585  break;
2586 
2588  S = new (Context) ObjCIvarRefExpr(Empty);
2589  break;
2590 
2592  S = new (Context) ObjCPropertyRefExpr(Empty);
2593  break;
2594 
2596  S = new (Context) ObjCSubscriptRefExpr(Empty);
2597  break;
2598 
2600  llvm_unreachable("mismatching AST file");
2601 
2603  S = ObjCMessageExpr::CreateEmpty(Context,
2604  Record[ASTStmtReader::NumExprFields],
2605  Record[ASTStmtReader::NumExprFields + 1]);
2606  break;
2607 
2608  case EXPR_OBJC_ISA:
2609  S = new (Context) ObjCIsaExpr(Empty);
2610  break;
2611 
2613  S = new (Context) ObjCIndirectCopyRestoreExpr(Empty);
2614  break;
2615 
2617  S = new (Context) ObjCBridgedCastExpr(Empty);
2618  break;
2619 
2621  S = new (Context) ObjCForCollectionStmt(Empty);
2622  break;
2623 
2624  case STMT_OBJC_CATCH:
2625  S = new (Context) ObjCAtCatchStmt(Empty);
2626  break;
2627 
2628  case STMT_OBJC_FINALLY:
2629  S = new (Context) ObjCAtFinallyStmt(Empty);
2630  break;
2631 
2632  case STMT_OBJC_AT_TRY:
2633  S = ObjCAtTryStmt::CreateEmpty(Context,
2634  Record[ASTStmtReader::NumStmtFields],
2635  Record[ASTStmtReader::NumStmtFields + 1]);
2636  break;
2637 
2639  S = new (Context) ObjCAtSynchronizedStmt(Empty);
2640  break;
2641 
2642  case STMT_OBJC_AT_THROW:
2643  S = new (Context) ObjCAtThrowStmt(Empty);
2644  break;
2645 
2647  S = new (Context) ObjCAutoreleasePoolStmt(Empty);
2648  break;
2649 
2651  S = new (Context) ObjCBoolLiteralExpr(Empty);
2652  break;
2653 
2655  S = new (Context) ObjCAvailabilityCheckExpr(Empty);
2656  break;
2657 
2658  case STMT_SEH_LEAVE:
2659  S = new (Context) SEHLeaveStmt(Empty);
2660  break;
2661 
2662  case STMT_SEH_EXCEPT:
2663  S = new (Context) SEHExceptStmt(Empty);
2664  break;
2665 
2666  case STMT_SEH_FINALLY:
2667  S = new (Context) SEHFinallyStmt(Empty);
2668  break;
2669 
2670  case STMT_SEH_TRY:
2671  S = new (Context) SEHTryStmt(Empty);
2672  break;
2673 
2674  case STMT_CXX_CATCH:
2675  S = new (Context) CXXCatchStmt(Empty);
2676  break;
2677 
2678  case STMT_CXX_TRY:
2679  S = CXXTryStmt::Create(Context, Empty,
2680  /*NumHandlers=*/Record[ASTStmtReader::NumStmtFields]);
2681  break;
2682 
2683  case STMT_CXX_FOR_RANGE:
2684  S = new (Context) CXXForRangeStmt(Empty);
2685  break;
2686 
2688  S = new (Context) MSDependentExistsStmt(SourceLocation(), true,
2691  nullptr);
2692  break;
2693 
2695  S =
2697  Record[ASTStmtReader::NumStmtFields],
2698  Empty);
2699  break;
2700 
2701  case STMT_OMP_SIMD_DIRECTIVE: {
2702  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2703  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2704  S = OMPSimdDirective::CreateEmpty(Context, NumClauses,
2705  CollapsedNum, Empty);
2706  break;
2707  }
2708 
2709  case STMT_OMP_FOR_DIRECTIVE: {
2710  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2711  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2712  S = OMPForDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
2713  Empty);
2714  break;
2715  }
2716 
2718  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2719  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2720  S = OMPForSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
2721  Empty);
2722  break;
2723  }
2724 
2727  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2728  break;
2729 
2731  S = OMPSectionDirective::CreateEmpty(Context, Empty);
2732  break;
2733 
2736  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2737  break;
2738 
2740  S = OMPMasterDirective::CreateEmpty(Context, Empty);
2741  break;
2742 
2745  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2746  break;
2747 
2749  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2750  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2751  S = OMPParallelForDirective::CreateEmpty(Context, NumClauses,
2752  CollapsedNum, Empty);
2753  break;
2754  }
2755 
2757  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2758  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2759  S = OMPParallelForSimdDirective::CreateEmpty(Context, NumClauses,
2760  CollapsedNum, Empty);
2761  break;
2762  }
2763 
2766  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2767  break;
2768 
2771  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2772  break;
2773 
2775  S = OMPTaskyieldDirective::CreateEmpty(Context, Empty);
2776  break;
2777 
2779  S = OMPBarrierDirective::CreateEmpty(Context, Empty);
2780  break;
2781 
2783  S = OMPTaskwaitDirective::CreateEmpty(Context, Empty);
2784  break;
2785 
2788  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2789  break;
2790 
2793  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2794  break;
2795 
2798  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2799  break;
2800 
2803  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2804  break;
2805 
2808  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2809  break;
2810 
2813  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2814  break;
2815 
2818  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2819  break;
2820 
2823  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2824  break;
2825 
2828  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2829  break;
2830 
2832  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2833  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2834  S = OMPTargetParallelForDirective::CreateEmpty(Context, NumClauses,
2835  CollapsedNum, Empty);
2836  break;
2837  }
2838 
2841  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2842  break;
2843 
2846  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2847  break;
2848 
2850  S = OMPCancellationPointDirective::CreateEmpty(Context, Empty);
2851  break;
2852 
2855  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2856  break;
2857 
2859  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2860  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2861  S = OMPTaskLoopDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
2862  Empty);
2863  break;
2864  }
2865 
2867  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2868  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2869  S = OMPTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
2870  CollapsedNum, Empty);
2871  break;
2872  }
2873 
2875  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2876  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2877  S = OMPDistributeDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
2878  Empty);
2879  break;
2880  }
2881 
2883  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2884  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2885  S = OMPDistributeParallelForDirective::CreateEmpty(Context, NumClauses,
2886  CollapsedNum, Empty);
2887  break;
2888  }
2889 
2891  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2892  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2894  CollapsedNum,
2895  Empty);
2896  break;
2897  }
2898 
2900  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2901  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2902  S = OMPDistributeSimdDirective::CreateEmpty(Context, NumClauses,
2903  CollapsedNum, Empty);
2904  break;
2905  }
2906 
2908  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2909  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2910  S = OMPTargetParallelForSimdDirective::CreateEmpty(Context, NumClauses,
2911  CollapsedNum, Empty);
2912  break;
2913  }
2914 
2916  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
2917  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2918  S = OMPTargetSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
2919  Empty);
2920  break;
2921  }
2922 
2924  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
2925  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2926  S = OMPTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
2927  CollapsedNum, Empty);
2928  break;
2929  }
2930 
2932  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2933  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2934  S = OMPTeamsDistributeSimdDirective::CreateEmpty(Context, NumClauses,
2935  CollapsedNum, Empty);
2936  break;
2937  }
2938 
2940  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
2941  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2943  Context, NumClauses, CollapsedNum, Empty);
2944  break;
2945  }
2946 
2948  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
2949  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2951  Context, NumClauses, CollapsedNum, Empty);
2952  break;
2953  }
2954 
2957  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2958  break;
2959 
2961  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
2962  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2963  S = OMPTargetTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
2964  CollapsedNum, Empty);
2965  break;
2966  }
2967 
2969  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
2970  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2972  Context, NumClauses, CollapsedNum, Empty);
2973  break;
2974  }
2975 
2977  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
2978  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2980  Context, NumClauses, CollapsedNum, Empty);
2981  break;
2982  }
2983 
2985  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
2986  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2988  Context, NumClauses, CollapsedNum, Empty);
2989  break;
2990  }
2991 
2993  S = new (Context) CXXOperatorCallExpr(Context, Empty);
2994  break;
2995 
2996  case EXPR_CXX_MEMBER_CALL:
2997  S = new (Context) CXXMemberCallExpr(Context, Empty);
2998  break;
2999 
3000  case EXPR_CXX_CONSTRUCT:
3001  S = new (Context) CXXConstructExpr(Empty);
3002  break;
3003 
3005  S = new (Context) CXXInheritedCtorInitExpr(Empty);
3006  break;
3007 
3009  S = new (Context) CXXTemporaryObjectExpr(Empty);
3010  break;
3011 
3012  case EXPR_CXX_STATIC_CAST:
3013  S = CXXStaticCastExpr::CreateEmpty(Context,
3014  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3015  break;
3016 
3017  case EXPR_CXX_DYNAMIC_CAST:
3018  S = CXXDynamicCastExpr::CreateEmpty(Context,
3019  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3020  break;
3021 
3024  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3025  break;
3026 
3027  case EXPR_CXX_CONST_CAST:
3028  S = CXXConstCastExpr::CreateEmpty(Context);
3029  break;
3030 
3033  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3034  break;
3035 
3037  S = new (Context) UserDefinedLiteral(Context, Empty);
3038  break;
3039 
3041  S = new (Context) CXXStdInitializerListExpr(Empty);
3042  break;
3043 
3044  case EXPR_CXX_BOOL_LITERAL:
3045  S = new (Context) CXXBoolLiteralExpr(Empty);
3046  break;
3047 
3049  S = new (Context) CXXNullPtrLiteralExpr(Empty);
3050  break;
3051 
3052  case EXPR_CXX_TYPEID_EXPR:
3053  S = new (Context) CXXTypeidExpr(Empty, true);
3054  break;
3055 
3056  case EXPR_CXX_TYPEID_TYPE:
3057  S = new (Context) CXXTypeidExpr(Empty, false);
3058  break;
3059 
3060  case EXPR_CXX_UUIDOF_EXPR:
3061  S = new (Context) CXXUuidofExpr(Empty, true);
3062  break;
3063 
3065  S = new (Context) MSPropertyRefExpr(Empty);
3066  break;
3067 
3069  S = new (Context) MSPropertySubscriptExpr(Empty);
3070  break;
3071 
3072  case EXPR_CXX_UUIDOF_TYPE:
3073  S = new (Context) CXXUuidofExpr(Empty, false);
3074  break;
3075 
3076  case EXPR_CXX_THIS:
3077  S = new (Context) CXXThisExpr(Empty);
3078  break;
3079 
3080  case EXPR_CXX_THROW:
3081  S = new (Context) CXXThrowExpr(Empty);
3082  break;
3083 
3084  case EXPR_CXX_DEFAULT_ARG:
3085  S = new (Context) CXXDefaultArgExpr(Empty);
3086  break;
3087 
3088  case EXPR_CXX_DEFAULT_INIT:
3089  S = new (Context) CXXDefaultInitExpr(Empty);
3090  break;
3091 
3093  S = new (Context) CXXBindTemporaryExpr(Empty);
3094  break;
3095 
3097  S = new (Context) CXXScalarValueInitExpr(Empty);
3098  break;
3099 
3100  case EXPR_CXX_NEW:
3101  S = new (Context) CXXNewExpr(Empty);
3102  break;
3103 
3104  case EXPR_CXX_DELETE:
3105  S = new (Context) CXXDeleteExpr(Empty);
3106  break;
3107 
3109  S = new (Context) CXXPseudoDestructorExpr(Empty);
3110  break;
3111 
3113  S = ExprWithCleanups::Create(Context, Empty,
3114  Record[ASTStmtReader::NumExprFields]);
3115  break;
3116 
3119  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields],
3120  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]
3121  ? Record[ASTStmtReader::NumExprFields + 1]
3122  : 0);
3123  break;
3124 
3127  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields],
3128  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]
3129  ? Record[ASTStmtReader::NumExprFields + 1]
3130  : 0);
3131  break;
3132 
3135  /*NumArgs=*/Record[ASTStmtReader::NumExprFields]);
3136  break;
3137 
3140  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields],
3141  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]
3142  ? Record[ASTStmtReader::NumExprFields + 1]
3143  : 0);
3144  break;
3145 
3148  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields],
3149  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]
3150  ? Record[ASTStmtReader::NumExprFields + 1]
3151  : 0);
3152  break;
3153 
3154  case EXPR_TYPE_TRAIT:
3156  Record[ASTStmtReader::NumExprFields]);
3157  break;
3158 
3159  case EXPR_ARRAY_TYPE_TRAIT:
3160  S = new (Context) ArrayTypeTraitExpr(Empty);
3161  break;
3162 
3164  S = new (Context) ExpressionTraitExpr(Empty);
3165  break;
3166 
3167  case EXPR_CXX_NOEXCEPT:
3168  S = new (Context) CXXNoexceptExpr(Empty);
3169  break;
3170 
3171  case EXPR_PACK_EXPANSION:
3172  S = new (Context) PackExpansionExpr(Empty);
3173  break;
3174 
3175  case EXPR_SIZEOF_PACK:
3177  Context,
3178  /*NumPartialArgs=*/Record[ASTStmtReader::NumExprFields]);
3179  break;
3180 
3182  S = new (Context) SubstNonTypeTemplateParmExpr(Empty);
3183  break;
3184 
3186  S = new (Context) SubstNonTypeTemplateParmPackExpr(Empty);
3187  break;
3188 
3191  Record[ASTStmtReader::NumExprFields]);
3192  break;
3193 
3195  S = new (Context) MaterializeTemporaryExpr(Empty);
3196  break;
3197 
3198  case EXPR_CXX_FOLD:
3199  S = new (Context) CXXFoldExpr(Empty);
3200  break;
3201 
3202  case EXPR_OPAQUE_VALUE:
3203  S = new (Context) OpaqueValueExpr(Empty);
3204  break;
3205 
3206  case EXPR_CUDA_KERNEL_CALL:
3207  S = new (Context) CUDAKernelCallExpr(Context, Empty);
3208  break;
3209 
3210  case EXPR_ASTYPE:
3211  S = new (Context) AsTypeExpr(Empty);
3212  break;
3213 
3214  case EXPR_PSEUDO_OBJECT: {
3215  unsigned numSemanticExprs = Record[ASTStmtReader::NumExprFields];
3216  S = PseudoObjectExpr::Create(Context, Empty, numSemanticExprs);
3217  break;
3218  }
3219 
3220  case EXPR_ATOMIC:
3221  S = new (Context) AtomicExpr(Empty);
3222  break;
3223 
3224  case EXPR_LAMBDA: {
3225  unsigned NumCaptures = Record[ASTStmtReader::NumExprFields];
3226  S = LambdaExpr::CreateDeserialized(Context, NumCaptures);
3227  break;
3228  }
3229 
3230  case STMT_COROUTINE_BODY: {
3231  unsigned NumParams = Record[ASTStmtReader::NumStmtFields];
3232  S = CoroutineBodyStmt::Create(Context, Empty, NumParams);
3233  break;
3234  }
3235 
3236  case STMT_CORETURN:
3237  S = new (Context) CoreturnStmt(Empty);
3238  break;
3239 
3240  case EXPR_COAWAIT:
3241  S = new (Context) CoawaitExpr(Empty);
3242  break;
3243 
3244  case EXPR_COYIELD:
3245  S = new (Context) CoyieldExpr(Empty);
3246  break;
3247 
3249  S = new (Context) DependentCoawaitExpr(Empty);
3250  break;
3251  }
3252 
3253  // We hit a STMT_STOP, so we're done with this expression.
3254  if (Finished)
3255  break;
3256 
3257  ++NumStatementsRead;
3258 
3259  if (S && !IsStmtReference) {
3260  Reader.Visit(S);
3261  StmtEntries[Cursor.GetCurrentBitNo()] = S;
3262  }
3263 
3264  assert(Record.getIdx() == Record.size() &&
3265  "Invalid deserialization of statement");
3266  StmtStack.push_back(S);
3267  }
3268 Done:
3269  assert(StmtStack.size() > PrevNumStmts && "Read too many sub-stmts!");
3270  assert(StmtStack.size() == PrevNumStmts + 1 && "Extra expressions on stack!");
3271  return StmtStack.pop_back_val();
3272 }
void setPreInits(Stmt *PreInits)
Definition: StmtOpenMP.h:494
static AttributedStmt * CreateEmpty(const ASTContext &C, unsigned NumAttrs)
Definition: Stmt.cpp:355
void setFPFeatures(FPOptions F)
Definition: Expr.h:3272
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:577
A PredefinedExpr record.
Definition: ASTBitCodes.h:1617
const uint64_t & readInt()
Returns the current value in this record, and advances to the next value.
Definition: ASTReader.h:2401
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:1518
The receiver is the instance of the superclass object.
Definition: ExprObjC.h:1061
Represents a single C99 designator.
Definition: Expr.h:4304
void setThen(Stmt *S)
Definition: Stmt.h:998
void setConditionVariable(const ASTContext &C, VarDecl *V)
Definition: Stmt.cpp:856
void setValueDependent(bool VD)
Set whether this expression is value-dependent or not.
Definition: Expr.h:151
Defines the clang::ASTContext interface.
void setRParenLoc(SourceLocation L)
Definition: ExprCXX.h:1533
A CompoundLiteralExpr record.
Definition: ASTBitCodes.h:1677
This represents &#39;#pragma omp distribute simd&#39; composite directive.
Definition: StmtOpenMP.h:3214
This represents &#39;#pragma omp master&#39; directive.
Definition: StmtOpenMP.h:1397
DesignatorTypes
The kinds of designators that can occur in a DesignatedInitExpr.
Definition: ASTBitCodes.h:1970
void setRangeStmt(Stmt *S)
Definition: StmtCXX.h:183
SourceLocation readSourceLocation()
Read a source location, advancing Idx.
Definition: ASTReader.h:2598
The null pointer literal (C++11 [lex.nullptr])
Definition: ExprCXX.h:585
This represents &#39;#pragma omp task&#39; directive.
Definition: StmtOpenMP.h:1737
void setEnsureUpperBound(Expr *EUB)
Definition: StmtOpenMP.h:525
This represents a GCC inline-assembly statement extension.
Definition: Stmt.h:1647
Represents a &#39;co_await&#39; expression while the type of the promise is dependent.
Definition: ExprCXX.h:4376
void setSubStmt(CompoundStmt *S)
Definition: Expr.h:3629
The receiver is an object instance.
Definition: ExprObjC.h:1055
unsigned getNumInputs() const
Definition: Stmt.h:1563
static OMPMasterDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:303
An IndirectGotoStmt record.
Definition: ASTBitCodes.h:1593
A (possibly-)qualified type.
Definition: Type.h:642
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument.
Definition: Stmt.h:2251
An AddrLabelExpr record.
Definition: ASTBitCodes.h:1707
void setInc(Expr *E)
Definition: StmtCXX.h:187
void setOperatorLoc(SourceLocation L)
Definition: Expr.h:2175
static StringLiteral * CreateEmpty(const ASTContext &C, unsigned NumStrs)
Construct an empty string literal.
Definition: Expr.cpp:913
void setRawSemantics(APFloatSemantics Sem)
Set the raw enumeration value representing the floating-point semantics of this literal (32-bit IEEE...
Definition: Expr.h:1478
void setNRVOCandidate(const VarDecl *Var)
Definition: Stmt.h:1472
Defines enumerations for the type traits support.
void setLocation(SourceLocation L)
Definition: ExprCXX.h:570
A CXXStaticCastExpr record.
Definition: ASTBitCodes.h:1829
ASTStmtReader(ASTRecordReader &Record, llvm::BitstreamCursor &Cursor)
void setCombinedCond(Expr *CombCond)
Definition: StmtOpenMP.h:593
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2372
An AttributedStmt record.
Definition: ASTBitCodes.h:1572
void setCond(Expr *E)
Definition: Stmt.h:1160
A CXXReinterpretCastExpr record.
Definition: ASTBitCodes.h:1835
An ObjCBoolLiteralExpr record.
Definition: ASTBitCodes.h:1797
void setCombinedLowerBoundVariable(Expr *CombLB)
Definition: StmtOpenMP.h:573
void setRHS(Expr *E)
Definition: Expr.h:2236
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:1324
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:480
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition: Expr.h:2342
IfStmt - This represents an if/then/else.
Definition: Stmt.h:959
void setPrivateCounters(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:32
void setArrow(bool A)
Definition: ExprObjC.h:1466
C Language Family Type Representation.
unsigned getNumOutputs() const
Definition: Stmt.h:1541
This represents &#39;#pragma omp for simd&#39; directive.
Definition: StmtOpenMP.h:1147
void setRParenLoc(SourceLocation L)
Definition: Stmt.h:1669
void setContinueLoc(SourceLocation L)
Definition: Stmt.h:1392
void setThrowExpr(Stmt *S)
Definition: StmtObjC.h:327
void setAtLoc(SourceLocation L)
Definition: ExprObjC.h:447
An ImplicitValueInitExpr record.
Definition: ASTBitCodes.h:1701
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:86
void setDeclGroup(DeclGroupRef DGR)
Definition: Stmt.h:527
An ImplicitCastExpr record.
Definition: ASTBitCodes.h:1671
This represents &#39;#pragma omp teams distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:3625
void setRBracket(SourceLocation RB)
Definition: ExprObjC.h:840
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Definition: Expr.h:4668
LambdaCaptureDefault
The default, if any, capture method for a lambda expression.
Definition: Lambda.h:23
void setType(QualType t)
Definition: Expr.h:128
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:2769
Defines the C++ template declaration subclasses.
void setPrevEnsureUpperBound(Expr *PrevEUB)
Definition: StmtOpenMP.h:568
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:4475
Represents an attribute applied to a statement.
Definition: Stmt.h:905
void setUpperBoundVariable(Expr *UB)
Definition: StmtOpenMP.h:511
void setComputationResultType(QualType T)
Definition: Expr.h:3341
llvm::APFloat readAPFloat(const llvm::fltSemantics &Sem)
Read a floating-point value, advancing Idx.
Definition: ASTReader.h:2618
void setNumIterations(Expr *NI)
Definition: StmtOpenMP.h:546
ParenExpr - This represents a parethesized expression, e.g.
Definition: Expr.h:1732
A CXXOperatorCallExpr record.
Definition: ASTBitCodes.h:1814
void setSuper(SourceLocation Loc, QualType T, bool IsInstanceSuper)
Definition: ExprObjC.h:1290
This represents &#39;#pragma omp target teams distribute&#39; combined directive.
Definition: StmtOpenMP.h:3762
A CXXTemporaryObjectExpr record.
Definition: ASTBitCodes.h:1826
Represents Objective-C&#39;s @throw statement.
Definition: StmtObjC.h:313
void setCond(Expr *E)
Definition: Stmt.h:1205
void setNextLowerBound(Expr *NLB)
Definition: StmtOpenMP.h:532
DeclRefExprBitfields DeclRefExprBits
Definition: Stmt.h:304
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1262
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:803
unsigned NumOutputs
Definition: Stmt.h:1506
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent...
Definition: ExprCXX.h:2456
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
void setSwitchCaseList(SwitchCase *SC)
Set the case list for this switch statement.
Definition: Stmt.h:1086
void setCanOverflow(bool C)
Definition: Expr.h:1825
void setInstanceReceiver(Expr *rec)
Turn this message send into an instance message that computes the receiver object with the given expr...
Definition: ExprObjC.h:1219
Floating point control options.
Definition: LangOptions.h:274
This represents &#39;#pragma omp parallel for&#39; directive.
Definition: StmtOpenMP.h:1518
MS property subscript expression.
Definition: ExprCXX.h:818
void setStartLoc(SourceLocation L)
Definition: Stmt.h:529
void setForLoc(SourceLocation L)
Definition: Stmt.h:1282
This represents &#39;#pragma omp target teams distribute parallel for&#39; combined directive.
Definition: StmtOpenMP.h:3830
void setLocation(SourceLocation Loc)
Definition: ExprCXX.h:1328
static ObjCDictionaryLiteral * CreateEmpty(const ASTContext &C, unsigned NumElements, bool HasPackExpansions)
Definition: ExprObjC.cpp:105
void setConditionVariable(const ASTContext &C, VarDecl *V)
Definition: Stmt.cpp:918
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
Definition: ExprCXX.h:4077
void setLocation(SourceLocation L)
Definition: ExprObjC.h:557
void setDelegateInitCall(bool isDelegate)
Definition: ExprObjC.h:1361
void setProtocol(ObjCProtocolDecl *P)
Definition: ExprObjC.h:491
void setRParenLoc(SourceLocation L)
Definition: ExprCXX.h:3174
void setIsLastIterVariable(Expr *IL)
Definition: StmtOpenMP.h:497
This represents &#39;#pragma omp target exit data&#39; directive.
Definition: StmtOpenMP.h:2429
void setRAngleLoc(SourceLocation Loc)
Definition: TemplateBase.h:572
static OffsetOfExpr * CreateEmpty(const ASTContext &C, unsigned NumComps, unsigned NumExprs)
Definition: Expr.cpp:1393
static OMPTargetTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
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:1103
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC &#39;id&#39; type.
Definition: ExprObjC.h:1437
void setIsPartOfExplicitCast(bool PartOfExplicitCast)
Definition: Expr.h:2950
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:2717
void setSubExpr(unsigned Idx, Expr *E)
Definition: Expr.h:4482
void setInitializer(Expr *E)
Definition: Expr.h:2745
void setLength(Expr *E)
Set length of the array section.
Definition: ExprOpenMP.h:102
void setOpLoc(SourceLocation L)
Definition: ExprObjC.h:1474
void recordSwitchCaseID(SwitchCase *SC, unsigned ID)
Definition: ASTReader.h:2652
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
Definition: ExprCXX.h:2421
static FunctionParmPackExpr * CreateEmpty(const ASTContext &Context, unsigned NumParams)
Definition: ExprCXX.cpp:1382
void setInit(Stmt *S)
Definition: Stmt.h:994
void setAsmLoc(SourceLocation L)
Definition: Stmt.h:1523
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:2497
void setValue(unsigned Val)
Definition: Expr.h:1433
void setLocation(SourceLocation Location)
Definition: Expr.h:1378
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
Definition: TemplateBase.h:601
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition: ExprCXX.h:614
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:4460
Defines the Objective-C statement AST node classes.
A CXXConstructExpr record.
Definition: ASTBitCodes.h:1820
unsigned getNumExpressions() const
Definition: Expr.h:2080
void setBeginStmt(Stmt *S)
Definition: StmtCXX.h:184
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:1050
raw_arg_iterator raw_arg_begin()
Definition: ExprCXX.h:2069
void initializeResults(const ASTContext &C, UnresolvedSetIterator Begin, UnresolvedSetIterator End)
Definition: ExprCXX.cpp:366
A C++ throw-expression (C++ [except.throw]).
Definition: ExprCXX.h:1006
Represents an expression – generally a full-expression – that introduces cleanups to be run at the ...
Definition: ExprCXX.h:3033
Represents a parameter to a function.
Definition: Decl.h:1536
void setInit(Expr *Init)
Definition: StmtOpenMP.h:492
Defines the clang::Expr interface and subclasses for C++ expressions.
void setTarget(Expr *E)
Definition: Stmt.h:1361
A ShuffleVectorExpr record.
Definition: ASTBitCodes.h:1719
A C++ static_cast expression (C++ [expr.static.cast]).
Definition: ExprCXX.h:302
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:864
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:1690
void setAtLoc(SourceLocation L)
Definition: ExprObjC.h:68
Represents a C99 designated initializer expression.
Definition: Expr.h:4229
An OffsetOfExpr record.
Definition: ASTBitCodes.h:1647
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition: Decl.h:297
NestedNameSpecifierLoc readNestedNameSpecifierLoc()
Definition: ASTReader.h:2552
static OMPTargetTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
One of these records is kept for each identifier that is lexed.
An ObjCAtThrowStmt record.
Definition: ASTBitCodes.h:1791
T * readDeclAs()
Reads a declaration from the given position in the record, advancing Idx.
Definition: ASTReader.h:2520
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:1809
A DesignatedInitExpr record.
Definition: ASTBitCodes.h:1686
This represents &#39;#pragma omp parallel&#39; directive.
Definition: StmtOpenMP.h:276
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition: Expr.h:3656
void setExprOperand(Expr *E)
Definition: ExprCXX.h:928
void setInit(Stmt *S)
Definition: Stmt.h:1074
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:154
A C++ nested-name-specifier augmented with source location information.
void setLHS(Expr *E)
Definition: Expr.h:2232
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:852
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
void setIsMicrosoftABI(bool IsMS)
Definition: Expr.h:3925
Represents a place-holder for an object not to be initialized by anything.
Definition: Expr.h:4523
void setNumArgs(const ASTContext &C, unsigned NumArgs)
setNumArgs - This changes the number of arguments present in this call.
Definition: Expr.cpp:1286
void setRequiresZeroInitialization(bool ZeroInit)
Definition: ExprCXX.h:1353
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:3867
void setArg(unsigned I, Expr *E)
Definition: ExprCXX.h:3212
void setArg(unsigned Arg, Expr *ArgExpr)
setArg - Set the specified argument.
Definition: Expr.h:2364
void setRParen(SourceLocation Loc)
Definition: Expr.h:1761
TemplateArgument readTemplateArgument(bool Canonicalize=false)
Read a template argument, advancing Idx.
Definition: ASTReader.h:2562
This represents &#39;#pragma omp target simd&#39; directive.
Definition: StmtOpenMP.h:3350
void setCapturedDecl(CapturedDecl *D)
Set the outlined function declaration.
Definition: Stmt.cpp:1118
void setReturnLoc(SourceLocation L)
Definition: Stmt.h:1464
Represents a C++ member access expression for which lookup produced a set of overloaded functions...
Definition: ExprCXX.h:3480
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:4913
OpenMPDirectiveKind getDirectiveKind() const
Definition: StmtOpenMP.h:244
This represents &#39;#pragma omp barrier&#39; directive.
Definition: StmtOpenMP.h:1849
void setComponent(unsigned Idx, OffsetOfNode ON)
Definition: Expr.h:2056
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:2482
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:338
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition: ExprCXX.h:3935
void setSubStmt(Stmt *S)
Definition: Stmt.h:798
This represents &#39;#pragma omp critical&#39; directive.
Definition: StmtOpenMP.h:1444
static OMPCriticalDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:325
void setRParenLoc(SourceLocation L)
Definition: Expr.h:3637
void setCond(Expr *Cond)
Definition: StmtOpenMP.h:489
size_t size() const
The length of this record.
Definition: ASTReader.h:2391
Represents Objective-C&#39;s @catch statement.
Definition: StmtObjC.h:74
void setBody(Stmt *S)
Definition: Stmt.h:1082
void setLBraceLoc(SourceLocation Loc)
Definition: Expr.h:4141
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:1339
Describes an C or C++ initializer list.
Definition: Expr.h:3995
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition: ExprCXX.h:659
This represents &#39;#pragma omp distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:3065
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:3554
void setBuiltinLoc(SourceLocation L)
Definition: Expr.h:3675
BinaryOperatorKind
void setSubExpr(Expr *E)
Definition: Expr.h:1750
void setLHS(Expr *E)
Definition: Expr.h:3835
ForStmt - This represents a &#39;for (init;cond;inc)&#39; stmt.
Definition: Stmt.h:1234
void setOperatorNew(FunctionDecl *D)
Definition: ExprCXX.h:1974
static DeclAccessPair make(NamedDecl *D, AccessSpecifier AS)
void setLocation(SourceLocation L)
Definition: ExprCXX.h:601
void setCond(Expr *E)
Definition: Stmt.h:1080
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
A convenient class for passing around template argument information.
Definition: TemplateBase.h:552
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:1554
void setEndLoc(SourceLocation L)
Definition: Stmt.h:531
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
Definition: ExprCXX.h:1756
path_iterator path_begin()
Definition: Expr.h:2879
void setLocation(SourceLocation L)
Definition: ExprObjC.h:101
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3102
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:4936
CXXForRangeStmt - This represents C++0x [stmt.ranged]&#39;s ranged for statement, represented as &#39;for (ra...
Definition: StmtCXX.h:126
SourceRange readSourceRange()
Read a source range, advancing Idx.
Definition: ASTReader.h:2603
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:2684
void setString(StringLiteral *S)
Definition: ExprObjC.h:65
void setAsmString(StringLiteral *E)
Definition: Stmt.h:1675
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:5359
void setCombinedInit(Expr *CombInit)
Definition: StmtOpenMP.h:588
void setListInitialization(bool V)
Definition: ExprCXX.h:1341
void setLHS(Expr *Val)
Definition: Stmt.h:799
This represents &#39;#pragma omp teams&#39; directive.
Definition: StmtOpenMP.h:2627
void setOperatorLoc(SourceLocation L)
Definition: Expr.h:2038
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:2790
void setBody(Stmt *S)
Definition: Stmt.h:1163
Helper class for OffsetOfExpr.
Definition: Expr.h:1898
A marker record that indicates that we are at the end of an expression.
Definition: ASTBitCodes.h:1548
This represents &#39;#pragma omp teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:3484
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:1217
void setDestroyedType(IdentifierInfo *II, SourceLocation Loc)
Set the name of destroyed type for a dependent pseudo-destructor expression.
Definition: ExprCXX.h:2342
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:1611
static OMPTaskyieldDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:491
void setCond(Expr *E)
Definition: Stmt.h:1277
static IntegerLiteral * Create(const ASTContext &C, const llvm::APInt &V, QualType type, SourceLocation l)
Returns a new integer literal with value &#39;V&#39; and type &#39;type&#39;.
Definition: Expr.cpp:752
void ReadTemplateKWAndArgsInfo(ASTTemplateKWAndArgsInfo &Args, TemplateArgumentLoc *ArgsLocArray, unsigned NumTemplateArgs)
Read and initialize a ExplicitTemplateArgumentList structure.
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3243
void setRParenLoc(SourceLocation Loc)
Definition: StmtObjC.h:56
CXXBaseSpecifier readCXXBaseSpecifier()
Read a C++ base specifier, advancing Idx.
Definition: ASTReader.h:2584
void setRParenLoc(SourceLocation R)
Definition: Expr.h:2042
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1063
bool isTypeOperand() const
Definition: ExprCXX.h:906
const uint64_t & peekInt()
Returns the current value in this record, without advancing.
Definition: ASTReader.h:2404
void setSourceRange(SourceRange R)
Definition: ExprCXX.h:939
unsigned NumClobbers
Definition: Stmt.h:1508
void setRParenLoc(SourceLocation L)
Definition: Expr.h:3069
Represents the this expression in C++.
Definition: ExprCXX.h:966
void setCastKind(CastKind K)
Definition: Expr.h:2850
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
Definition: TemplateBase.h:644
static OMPTargetDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:787
static OMPTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setEqualOrColonLoc(SourceLocation L)
Definition: Expr.h:4455
This represents &#39;#pragma omp target parallel for simd&#39; directive.
Definition: StmtOpenMP.h:3282
void setArgument(Expr *E)
Definition: Expr.h:2159
OpenMP 4.0 [2.4, Array Sections].
Definition: ExprOpenMP.h:45
void setTypeSourceInfo(TypeSourceInfo *tsi)
Definition: Expr.h:2047
ConditionalOperator - The ?: ternary operator.
Definition: Expr.h:3392
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:2228
void setAmpAmpLoc(SourceLocation L)
Definition: Expr.h:3582
void setBreakLoc(SourceLocation L)
Definition: Stmt.h:1421
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
Definition: ExprCXX.h:3616
void setFPFeatures(FPOptions F)
Definition: ExprCXX.h:145
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:613
void setBlockDecl(BlockDecl *BD)
Definition: Expr.h:4990
This represents &#39;#pragma omp taskgroup&#39; directive.
Definition: StmtOpenMP.h:1937
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:596
void setSubExpr(Expr *E)
Definition: Expr.h:1812
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
Definition: Expr.h:2107
void setLParen(SourceLocation Loc)
Definition: Expr.h:1757
for(unsigned I=0, E=TL.getNumArgs();I !=E;++I)
Represents a call to the builtin function __builtin_va_arg.
Definition: Expr.h:3901
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:2053
This represents &#39;#pragma omp distribute&#39; directive.
Definition: StmtOpenMP.h:2938
void setString(const ASTContext &C, StringRef Str, StringKind Kind, bool IsPascal)
Sets the string data to the given string data.
Definition: Expr.cpp:1022
void setInits(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:39
void setOperatorDelete(FunctionDecl *D)
Definition: ExprCXX.h:1976
void setRParenLoc(SourceLocation L)
Definition: Stmt.h:1216
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type...
Definition: ExprCXX.h:1833
void setLocation(SourceLocation Location)
Definition: Expr.h:1431
void setRParenLoc(SourceLocation Loc)
Definition: StmtObjC.h:105
Pepresents a block literal declaration, which is like an unnamed FunctionDecl.
Definition: Decl.h:3835
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
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:636
This represents one expression.
Definition: Expr.h:105
Defines the clang::LangOptions interface.
void setDesignators(const ASTContext &C, const Designator *Desigs, unsigned NumDesigs)
Definition: Expr.cpp:3856
void setRBraceLoc(SourceLocation Loc)
Definition: Expr.h:4143
void setIsImplicit(bool value=true)
Definition: ExprCXX.h:4367
SourceLocation End
void setWhileLoc(SourceLocation L)
Definition: Stmt.h:1166
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
Definition: Specifiers.h:107
void setCallee(Expr *F)
Definition: Expr.h:2327
void setRParenLoc(SourceLocation L)
Definition: Expr.h:3678
void setLParenLoc(SourceLocation L)
Definition: Stmt.h:1284
void setBase(Expr *Base)
Definition: Expr.h:4579
Stmt * ReadStmt(ModuleFile &F)
Reads a statement.
void setSyntacticForm(InitListExpr *Init)
Definition: Expr.h:4156
Represents a C++ functional cast expression that builds a temporary object.
Definition: ExprCXX.h:1561
void setRBracketLoc(SourceLocation L)
Definition: ExprOpenMP.h:113
A C++ const_cast expression (C++ [expr.const.cast]).
Definition: ExprCXX.h:435
void setTypeDependent(bool TD)
Set whether this expression is type-dependent or not.
Definition: Expr.h:169
void setTypeOperandSourceInfo(TypeSourceInfo *TSI)
Definition: ExprCXX.h:918
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:4974
Field designator where only the field name is known.
Definition: ASTBitCodes.h:1972
static OMPDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Defines an enumeration for C++ overloaded operators.
This represents &#39;#pragma omp target teams distribute parallel for simd&#39; combined directive.
Definition: StmtOpenMP.h:3914
void setRHS(Expr *E)
Definition: Expr.h:3149
void setInc(Expr *E)
Definition: Stmt.h:1278
raw_arg_iterator raw_arg_end()
Definition: ExprCXX.h:2070
static CXXReinterpretCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
Definition: ExprCXX.cpp:665
#define bool
Definition: stdbool.h:31
void setUuidStr(StringRef US)
Definition: ExprCXX.h:933
void setWrittenTypeInfo(TypeSourceInfo *TI)
Definition: Expr.h:3928
void setRetValue(Expr *E)
Definition: Stmt.h:1461
void setBody(Stmt *S)
Definition: Stmt.h:1279
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
Definition: ExprObjC.h:288
ExprBitfields ExprBits
Definition: Stmt.h:300
void setObjectKind(ExprObjectKind Cat)
setObjectKind - Set the object kind produced by this expression.
Definition: Expr.h:424
bool hasQualifier() const
Determine whether this declaration reference was preceded by a C++ nested-name-specifier, e.g., N::foo.
Definition: Expr.h:1071
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:1847
void setFinallyBody(Stmt *S)
Definition: StmtObjC.h:134
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:3765
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:5023
An ArraySubscriptExpr record.
Definition: ASTBitCodes.h:1653
Decl * readDecl()
Reads a declaration from the given position in a record in the given module, advancing Idx...
Definition: ASTReader.h:2510
static FloatingLiteral * Create(const ASTContext &C, const llvm::APFloat &V, bool isexact, QualType Type, SourceLocation L)
Definition: Expr.cpp:808
This represents &#39;#pragma omp target teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:3987
Information about a module that has been loaded by the ASTReader.
Definition: Module.h:108
ExprWithCleanupsBitfields ExprWithCleanupsBits
Definition: Stmt.h:307
An ArrayInitLoopExpr record.
Definition: ASTBitCodes.h:1695
unsigned getNumClauses() const
Get number of clauses.
Definition: StmtOpenMP.h:184
A PseudoObjectExpr record.
Definition: ASTBitCodes.h:1731
void setColonLoc(SourceLocation L)
Definition: ExprOpenMP.h:110
void setFinallyStmt(Stmt *S)
Definition: StmtObjC.h:236
An ObjCIndirectCopyRestoreExpr record.
Definition: ASTBitCodes.h:1773
This represents &#39;#pragma omp for&#39; directive.
Definition: StmtOpenMP.h:1070
IdentifierInfo * getIdentifierInfo()
Definition: ASTReader.h:2524
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:421
void setRParenLoc(SourceLocation L)
Definition: ExprObjC.h:497
Represents a folding of a pack over an operator.
Definition: ExprCXX.h:4187
void setEndStmt(Stmt *S)
Definition: StmtCXX.h:185
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
Definition: Stmt.h:1444
This represents &#39;#pragma omp target teams&#39; directive.
Definition: StmtOpenMP.h:3703
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:904
This represents a Microsoft inline-assembly statement extension.
Definition: Stmt.h:1822
void setColonLoc(SourceLocation L)
Definition: Stmt.h:742
void setIsArrow(bool A)
Definition: ExprObjC.h:553
void setRParenLoc(SourceLocation L)
Definition: Expr.h:3843
A DesignatedInitUpdateExpr record.
Definition: ASTBitCodes.h:1689
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:1784
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:1188
A member reference to an MSPropertyDecl.
Definition: ExprCXX.h:749
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:3879
void setForLoc(SourceLocation Loc)
Definition: StmtObjC.h:54
This represents &#39;#pragma omp cancel&#39; directive.
Definition: StmtOpenMP.h:2742
void setDistInc(Expr *DistInc)
Definition: StmtOpenMP.h:563
void setBase(Expr *base)
Definition: ExprObjC.h:549
ValueDecl * getDecl()
Definition: Expr.h:1056
An ObjCAvailabilityCheckExpr record.
Definition: ASTBitCodes.h:1800
void setRParenLoc(SourceLocation L)
Definition: ExprObjC.h:448
std::string readString()
Read a string, advancing Idx.
Definition: ASTReader.h:2623
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:3034
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:2407
This file defines OpenMP AST classes for clauses.
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1...
Definition: Expr.h:1520
An ObjCForCollectionStmt record.
Definition: ASTBitCodes.h:1776
This represents &#39;#pragma omp flush&#39; directive.
Definition: StmtOpenMP.h:2010
This represents &#39;#pragma omp parallel for simd&#39; directive.
Definition: StmtOpenMP.h:1598
void setRParenLoc(SourceLocation L)
Definition: Expr.h:3934
void setAtTryLoc(SourceLocation Loc)
Definition: StmtObjC.h:194
DoStmt - This represents a &#39;do/while&#39; stmt.
Definition: Stmt.h:1185
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
Definition: Stmt.h:1492
void setTypeOperandSourceInfo(TypeSourceInfo *TSI)
Definition: ExprCXX.h:711
void setBody(Stmt *S)
Definition: StmtCXX.h:189
void setOpcode(Opcode O)
Definition: Expr.h:3144
A MS-style AsmStmt record.
Definition: ASTBitCodes.h:1614
unsigned readRecord(llvm::BitstreamCursor &Cursor, unsigned AbbrevID)
Reads a record with id AbbrevID from Cursor, resetting the internal state.
void setLocStart(SourceLocation Loc)
Set starting location of directive kind.
Definition: StmtOpenMP.h: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:86
void setSynchExpr(Stmt *S)
Definition: StmtObjC.h:296
This represents &#39;#pragma omp target enter data&#39; directive.
Definition: StmtOpenMP.h:2370
void setUpdates(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:45
const llvm::fltSemantics & getSemantics() const
Return the APFloat semantics this literal uses.
Definition: Expr.cpp:818
void setLowerBoundVariable(Expr *LB)
Definition: StmtOpenMP.h:504
void setLParenLoc(SourceLocation L)
Definition: ExprCXX.h:1531
void setTypeSourceInfo(TypeSourceInfo *tinfo)
Definition: Expr.h:2756
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Definition: ExprCXX.h:343
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
Definition: Expr.h:874
void setComputationLHSType(QualType T)
Definition: Expr.h:3338
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition: Expr.h:3724
unsigned getNumArgs() const
Return the number of actual arguments in this message, not counting the receiver. ...
Definition: ExprObjC.h:1329
static OMPSectionDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:259
void setDecl(LabelDecl *D)
Definition: Stmt.h:882
Kind
void setElse(Stmt *S)
Definition: Stmt.h:1000
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr...
Definition: ExprCXX.h:2581
A field in a dependent type, known only by its name.
Definition: Expr.h:1907
This captures a statement into a function.
Definition: Stmt.h:2077
Represents a call to an inherited base class constructor from an inheriting constructor.
Definition: ExprCXX.h:1423
unsigned path_size() const
Definition: Expr.h:2874
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition: Expr.h:5096
void setLParenLoc(SourceLocation L)
Definition: Expr.h:3066
void setSubStmt(Stmt *S)
Definition: Stmt.h:836
void setElidable(bool E)
Definition: ExprCXX.h:1332
void setAccessorLoc(SourceLocation L)
Definition: Expr.h:4939
void setGotoLoc(SourceLocation L)
Definition: Stmt.h:1354
static CXXDynamicCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
Definition: ExprCXX.cpp:603
CXXTemporary * readCXXTemporary()
Definition: ASTReader.h:2593
void setHadMultipleCandidates(bool V)
Definition: ExprCXX.h:1337
void setLocation(SourceLocation L)
Definition: Expr.h:1065
This represents &#39;#pragma omp single&#39; directive.
Definition: StmtOpenMP.h:1342
Encodes a location in the source.
void setLocation(SourceLocation L)
Definition: Expr.h:1234
void setPrevLowerBoundVariable(Expr *PrevLB)
Definition: StmtOpenMP.h:553
void setIterationVariable(Expr *IV)
Definition: StmtOpenMP.h:477
Defines enumerations for expression traits intrinsics.
PseudoObjectExprBitfields PseudoObjectExprBits
Definition: Stmt.h:308
Stmt * readSubStmt()
Reads a sub-statement operand during statement reading.
Definition: ASTReader.h:2450
unsigned getNumHandlers() const
Definition: StmtCXX.h:103
void setUpdater(Expr *Updater)
Definition: Expr.h:4584
static OMPTaskDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:473
This is a basic class for representing single OpenMP executable directive.
Definition: StmtOpenMP.h:33
static CXXDependentScopeMemberExpr * CreateEmpty(const ASTContext &C, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition: ExprCXX.cpp:1186
static OMPTargetUpdateDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setDoLoc(SourceLocation L)
Definition: Stmt.h:1211
static CXXConstCastExpr * CreateEmpty(const ASTContext &Context)
Definition: ExprCXX.cpp:681
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
Definition: ExprCXX.h:1873
void setCombinedNextLowerBound(Expr *CombNLB)
Definition: StmtOpenMP.h:598
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:477
void setSourceRange(SourceRange R)
Definition: ExprCXX.h:729
static ObjCAtTryStmt * CreateEmpty(const ASTContext &Context, unsigned NumCatchStmts, bool HasFinally)
Definition: StmtObjC.cpp:58
void setConstexpr(bool C)
Definition: Stmt.h:1012
Represents a call to a member function that may be written either with member call syntax (e...
Definition: ExprCXX.h:164
void setIdentLoc(SourceLocation L)
Definition: Stmt.h:886
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:505
void setLabelLoc(SourceLocation L)
Definition: Expr.h:3584
void readDeclarationNameInfo(DeclarationNameInfo &NameInfo)
Definition: ASTReader.h:2540
ExprObjectKind
A further classification of the kind of object referenced by an l-value or x-value.
Definition: Specifiers.h:124
A CXXFunctionalCastExpr record.
Definition: ASTBitCodes.h:1841
void setTemporary(CXXTemporary *T)
Definition: ExprCXX.h:1238
static ExprWithCleanups * Create(const ASTContext &C, EmptyShell empty, unsigned numObjects)
Definition: ExprCXX.cpp:1073
void setAllEnumCasesCovered()
Set a flag in the SwitchStmt indicating that if the &#39;switch (X)&#39; is a switch over an enum value then ...
Definition: Stmt.h:1105
Expr * readSubExpr()
Reads a sub-expression operand during statement reading.
Definition: ASTReader.h:2453
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:1241
void setCatchParamDecl(VarDecl *D)
Definition: StmtObjC.h:100
void setCond(Expr *E)
Definition: Stmt.h:996
An ObjCEncodeExpr record.
Definition: ASTBitCodes.h:1746
static OMPAtomicDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:664
This represents &#39;#pragma omp taskwait&#39; directive.
Definition: StmtOpenMP.h:1893
void setLHS(Expr *E)
Definition: Expr.h:3147
void setConfig(CallExpr *E)
Sets the kernel configuration expression.
Definition: ExprCXX.h:225
void setConditionVariable(const ASTContext &C, VarDecl *V)
Definition: Stmt.cpp:884
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:5230
void readDeclarationNameLoc(DeclarationNameLoc &DNLoc, DeclarationName Name)
Definition: ASTReader.h:2537
Expr * updateInit(const ASTContext &C, unsigned Init, Expr *expr)
Updates the initializer at index Init with the new expression expr, and returns the old expression at...
Definition: Expr.cpp:1972
static OMPOrderedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:633
bool isOpenMPLoopBoundSharingDirective(OpenMPDirectiveKind Kind)
Checks if the specified directive kind is one of the composite or combined directives that need loop ...
void addDecl(NamedDecl *D)
Definition: UnresolvedSet.h:89
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition: ExprObjC.h:474
bool isValueDependent() const
isValueDependent - Determines whether this expression is value-dependent (C++ [temp.dep.constexpr]).
Definition: Expr.h:148
void setDecl(ValueDecl *NewD)
Definition: Expr.h:1058
void setThrowLoc(SourceLocation Loc)
Definition: StmtObjC.h:330
unsigned getIdx() const
The current position in this record.
Definition: ASTReader.h:2388
An ObjCIsa Expr record.
Definition: ASTBitCodes.h:1770
ASTContext & getContext()
Retrieve the AST context that this AST reader supplements.
Definition: ASTReader.h:2385
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:2924
Stmt * getCapturedStmt()
Retrieve the statement being captured.
Definition: Stmt.h:2178
This represents &#39;#pragma omp target&#39; directive.
Definition: StmtOpenMP.h:2254
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:1242
static DesignatedInitExpr * CreateEmpty(const ASTContext &C, unsigned NumIndexExprs)
Definition: Expr.cpp:3849
static DeclGroup * Create(ASTContext &C, Decl **Decls, unsigned NumDecls)
Definition: DeclGroup.cpp:21
static OMPTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setBaseExpr(Stmt *S)
Definition: ExprObjC.h:849
An expression trait intrinsic.
Definition: ExprCXX.h:2526
void setEncodedTypeSourceInfo(TypeSourceInfo *EncType)
Definition: ExprObjC.h:411
An AtomicExpr record.
Definition: ASTBitCodes.h:1734
This represents &#39;#pragma omp ordered&#39; directive.
Definition: StmtOpenMP.h:2065
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition: Expr.h:3611
void setCond(Expr *E)
Definition: StmtCXX.h:186
static SizeOfPackExpr * CreateDeserialized(ASTContext &Context, unsigned NumPartialArgs)
Definition: ExprCXX.cpp:1339
This represents &#39;#pragma omp target update&#39; directive.
Definition: StmtOpenMP.h:3006
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:117
void setSubExpr(Expr *E)
Definition: Expr.h:3921
void setLAngleLoc(SourceLocation Loc)
Definition: TemplateBase.h:571
void sawArrayRangeDesignator(bool ARD=true)
Definition: Expr.h:4166
void addArgument(const TemplateArgumentLoc &Loc)
Definition: TemplateBase.h:592
void setCapturedRecordDecl(RecordDecl *D)
Set the record declaration for captured variables.
Definition: Stmt.h:2198
Representation of a Microsoft __if_exists or __if_not_exists statement with a dependent name...
Definition: StmtCXX.h:238
static MemberExpr * Create(const ASTContext &C, Expr *base, bool isarrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, ValueDecl *memberdecl, DeclAccessPair founddecl, DeclarationNameInfo MemberNameInfo, const TemplateArgumentListInfo *targs, QualType ty, ExprValueKind VK, ExprObjectKind OK)
Definition: Expr.cpp:1472
A placeholder type used to construct an empty shell of a type, that will be filled in later (e...
Definition: Stmt.h:338
void setSimple(bool V)
Definition: Stmt.h:1526
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:2887
void setRBracketLoc(SourceLocation L)
Definition: ExprCXX.h:857
void readAttributes(AttrVec &Attrs)
Reads attributes from the current stream position, advancing Idx.
Definition: ASTReader.h:2643
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:3314
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:4807
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition: Expr.h:3567
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers...
Definition: ExprObjC.h:1575
Represents a reference to a function parameter pack that has been substituted but not yet expanded...
Definition: ExprCXX.h:3999
Represents a template argument.
Definition: TemplateBase.h:51
void setGotoLoc(SourceLocation L)
Definition: Stmt.h:1321
void setPrevUpperBoundVariable(Expr *PrevUB)
Definition: StmtOpenMP.h:558
void setCombinedEnsureUpperBound(Expr *CombEUB)
Definition: StmtOpenMP.h:583
static OMPForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:160
void setLocation(SourceLocation L)
Definition: Expr.h:1497
NullStmt - This is the null statement ";": C99 6.8.3p3.
Definition: Stmt.h:574
void setCounters(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:26
bool isTypeOperand() const
Definition: ExprCXX.h:699
unsigned getNumAssocs() const
Definition: Expr.h:4834
Dataflow Directional Tag Classes.
void setExtendingDecl(const ValueDecl *ExtendedBy, unsigned ManglingNumber)
Definition: ExprCXX.cpp:1388
An InitListExpr record.
Definition: ASTBitCodes.h:1683
llvm::BitstreamCursor DeclsCursor
DeclsCursor - This is a cursor to the start of the DECLS_BLOCK block.
Definition: Module.h:406
void setBuiltinLoc(SourceLocation L)
Definition: Expr.h:3840
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:1203
UnaryOperatorKind
void setValue(bool V)
Definition: ExprCXX.h:564
A CXXBoolLiteralExpr record.
Definition: ASTBitCodes.h:1850
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
Definition: ExprCXX.h:2100
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
Definition: OperatorKinds.h:22
void setCombinedUpperBoundVariable(Expr *CombUB)
Definition: StmtOpenMP.h:578
void setRParenLoc(SourceLocation L)
Definition: Expr.h:2422
static CapturedStmt * CreateDeserialized(const ASTContext &Context, unsigned NumCaptures)
Definition: Stmt.cpp:1091
An ExtVectorElementExpr record.
Definition: ASTBitCodes.h:1680
void setLabel(LabelDecl *L)
Definition: Expr.h:3590
static OMPTargetTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setTypeInfoAsWritten(TypeSourceInfo *writtenTy)
Definition: Expr.h:3019
This represents &#39;#pragma omp section&#39; directive.
Definition: StmtOpenMP.h:1280
void setAtLoc(SourceLocation L)
Definition: ExprObjC.h:496
This represents &#39;#pragma omp teams distribute&#39; directive.
Definition: StmtOpenMP.h:3416
void setIsUnique(bool V)
Definition: Expr.h:935
Selector readSelector()
Read a selector from the Record, advancing Idx.
Definition: ASTReader.h:2529
Expr * ReadExpr(ModuleFile &F)
Reads an expression.
void setSubExpr(Expr *E)
Definition: Expr.h:1534
void setExprs(const ASTContext &C, ArrayRef< Expr *> Exprs)
Definition: Expr.cpp:3700
void setSubExpr(Expr *E)
Definition: Expr.h:2857
void setCollection(Expr *E)
Definition: StmtObjC.h:48
void setDecl(ObjCIvarDecl *d)
Definition: ExprObjC.h:545
void setFileScope(bool FS)
Definition: Expr.h:2748
void setExact(bool E)
Definition: Expr.h:1489
A runtime availability query.
Definition: ExprObjC.h:1641
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
Definition: ExprCXX.h:390
This represents &#39;#pragma omp simd&#39; directive.
Definition: StmtOpenMP.h:1005
void setConstructionKind(ConstructionKind CK)
Definition: ExprCXX.h:1362
Represents a &#39;co_yield&#39; expression.
Definition: ExprCXX.h:4423
An ObjCAutoreleasePoolStmt record.
Definition: ASTBitCodes.h:1794
DeclarationName - The name of a declaration.
StmtClass getStmtClass() const
Definition: Stmt.h:391
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition: ExprCXX.h:3693
A CXXDynamicCastExpr record.
Definition: ASTBitCodes.h:1832
static LambdaExpr * CreateDeserialized(const ASTContext &C, unsigned NumCaptures)
Construct a new lambda expression that will be deserialized from an external source.
Definition: ExprCXX.cpp:964
static PseudoObjectExpr * Create(const ASTContext &Context, Expr *syntactic, ArrayRef< Expr *> semantic, unsigned resultIndex)
Definition: Expr.cpp:4001
void setInstantiationDependent(bool ID)
Set whether this expression is instantiation-dependent or not.
Definition: Expr.h:195
void setEllipsisLoc(SourceLocation L)
Definition: Stmt.h:780
Kind
The kind of offsetof node we have.
Definition: Expr.h:1901
TemplateArgumentLoc readTemplateArgumentLoc()
Reads a TemplateArgumentLoc, advancing Idx.
Definition: ASTReader.h:2472
void setLParenLoc(SourceLocation L)
Definition: Expr.h:3635
void setSelector(Selector S)
Definition: ExprObjC.h:1298
ExplicitCastExpr - An explicit cast written in the source code.
Definition: Expr.h:3000
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
void setMethodDecl(ObjCMethodDecl *MD)
Definition: ExprObjC.h:1317
This represents &#39;#pragma omp atomic&#39; directive.
Definition: StmtOpenMP.h:2120
static CompoundStmt * CreateEmpty(const ASTContext &C, unsigned NumStmts)
Definition: Stmt.cpp:333
pack_iterator pack_begin() const
Iterator referencing the first argument of a template argument pack.
Definition: TemplateBase.h:340
void setImplicit(bool I)
Definition: ExprCXX.h:989
void setBody(Stmt *S)
Definition: Stmt.h:1208
An ObjCAtFinallyStmt record.
Definition: ASTBitCodes.h:1782
VersionTuple readVersionTuple()
Read a version tuple, advancing Idx.
Definition: ASTReader.h:2633
Represents a __leave statement.
Definition: Stmt.h:2042
unsigned getCollapsedNumber() const
Get number of collapsed loops.
Definition: StmtOpenMP.h:761
unsigned getNumSubExprs() const
Definition: Expr.h:5295
void setRBracketLoc(SourceLocation L)
Definition: Expr.h:2260
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition: ExprCXX.h:3641
SwitchStmt - This represents a &#39;switch&#39; stmt.
Definition: Stmt.h:1037
static OMPForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:209
Represents the body of a coroutine.
Definition: StmtCXX.h:299
void setElement(Stmt *S)
Definition: StmtObjC.h:47
TemplateArgumentLoc * getTrailingTemplateArgumentLoc()
Return the optional template arguments.
Definition: ExprCXX.h:3628
Location wrapper for a TemplateArgument.
Definition: TemplateBase.h:450
void setConditionVariable(const ASTContext &C, VarDecl *V)
Definition: Stmt.cpp:821
bool isOpenMPDistributeDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a distribute directive.
static const unsigned NumExprFields
The number of record fields required for the Expr class itself.
void setCatchStmt(unsigned I, ObjCAtCatchStmt *S)
Set a particular catch statement.
Definition: StmtObjC.h:218
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition: Expr.h:2197
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c array literal.
Definition: ExprObjC.h:210
static OMPBarrierDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:505
This file defines OpenMP AST classes for executable directives and clauses.
Represents Objective-C&#39;s collection statement.
Definition: StmtObjC.h:24
void setRHS(Expr *Val)
Definition: Stmt.h:800
An ObjCAtSynchronizedStmt record.
Definition: ASTBitCodes.h:1788
unsigned getNumObjects() const
Definition: ExprCXX.h:3066
void setIndexExpr(unsigned Idx, Expr *E)
Definition: Expr.h:2075
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:386
void setVolatile(bool V)
Definition: Stmt.h:1529
void setLowerBound(Expr *E)
Set lower bound of the array section.
Definition: ExprOpenMP.h:96
An implicit indirection through a C++ base class, when the field found is in a base class...
Definition: Expr.h:1910
static UnresolvedMemberExpr * CreateEmpty(const ASTContext &C, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition: ExprCXX.cpp:1283
Represents a call to a CUDA kernel function.
Definition: ExprCXX.h:203
Represents a &#39;co_await&#39; expression.
Definition: ExprCXX.h:4340
TypeTraitExprBitfields TypeTraitExprBits
Definition: Stmt.h:312
static ImplicitCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
Definition: Expr.cpp:1801
void setSwitchLoc(SourceLocation L)
Definition: Stmt.h:1089
A CXXMemberCallExpr record.
Definition: ASTBitCodes.h:1817
void setAtFinallyLoc(SourceLocation Loc)
Definition: StmtObjC.h:142
void setArg(unsigned Arg, Expr *ArgExpr)
Set the specified argument.
Definition: ExprCXX.h:1398
void setKind(UnaryExprOrTypeTrait K)
Definition: Expr.h:2141
void setRParenLoc(SourceLocation L)
Definition: Expr.h:2178
void setRHS(Expr *E)
Definition: Expr.h:3837
void setOperatorLoc(SourceLocation L)
Definition: Expr.h:3141
void setValue(const ASTContext &C, const llvm::APFloat &Val)
Definition: Expr.h:1465
Represents Objective-C&#39;s @finally statement.
Definition: StmtObjC.h:120
void setCatchBody(Stmt *S)
Definition: StmtObjC.h:92
static CXXFunctionalCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
Definition: ExprCXX.cpp:703
bool hasAssociatedStmt() const
Returns true if directive has associated statement.
Definition: StmtOpenMP.h:193
void setLParenLoc(SourceLocation L)
Definition: Expr.h:2751
The template argument is actually a parameter pack.
Definition: TemplateBase.h:91
Represents a base class of a C++ class.
Definition: DeclCXX.h:192
void setRParenLoc(SourceLocation L)
Definition: ExprObjC.h:405
unsigned getNumClobbers() const
Definition: Stmt.h:1573
static OMPTargetTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:513
void setAtSynchronizedLoc(SourceLocation Loc)
Definition: StmtObjC.h:280
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof...
Definition: ExprCXX.h:3853
void setOperatorLoc(SourceLocation L)
Definition: Expr.h:1816
void setLocation(SourceLocation Location)
Definition: Expr.h:1339
A ConvertVectorExpr record.
Definition: ASTBitCodes.h:1722
unsigned arg_size() const
Retrieve the number of arguments.
Definition: ExprCXX.h:3182
void setStarLoc(SourceLocation L)
Definition: Stmt.h:1356
void setLParenLoc(SourceLocation L)
Definition: ExprCXX.h:3169
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:3122
GotoStmt - This represents a direct goto.
Definition: Stmt.h:1305
A use of a default initializer in a constructor or in aggregate initialization.
Definition: ExprCXX.h:1134
static CStyleCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
Definition: Expr.cpp:1827
void setLocation(SourceLocation L)
Definition: ExprCXX.h:983
static UnresolvedLookupExpr * CreateEmpty(const ASTContext &C, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition: ExprCXX.cpp:285
CapturedDecl * getCapturedDecl()
Retrieve the outlined function declaration.
Definition: Stmt.cpp:1109
void setBuiltinLoc(SourceLocation L)
Definition: Expr.h:3931
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition: Expr.h:2467
GNU array range designator.
Definition: ASTBitCodes.h:1982
void setBase(Expr *E)
Definition: Expr.h:4933
Defines the clang::SourceLocation class and associated facilities.
An ArrayInitIndexExpr record.
Definition: ASTBitCodes.h:1698
A GCC-style AsmStmt record.
Definition: ASTBitCodes.h:1611
This represents &#39;#pragma omp target parallel&#39; directive.
Definition: StmtOpenMP.h:2487
void setStrideVariable(Expr *ST)
Definition: StmtOpenMP.h:518
ContinueStmt - This represents a continue.
Definition: Stmt.h:1382
static CXXStaticCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
Definition: ExprCXX.cpp:574
Represents a loop initializing the elements of an array.
Definition: Expr.h:4613
static CXXTryStmt * Create(const ASTContext &C, SourceLocation tryLoc, Stmt *tryBlock, ArrayRef< Stmt *> handlers)
Definition: StmtCXX.cpp:26
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition: Expr.h:3787
static OMPParallelSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:449
void setElseLoc(SourceLocation L)
Definition: Stmt.h:1009
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Definition: Expr.h:3465
CXXCatchStmt - This represents a C++ catch block.
Definition: StmtCXX.h:29
An index into an array.
Definition: Expr.h:1903
static CXXUnresolvedConstructExpr * CreateEmpty(const ASTContext &C, unsigned NumArgs)
Definition: ExprCXX.cpp:1117
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr.type.conv]).
Definition: ExprCXX.h:1494
An ObjCAtCatchStmt record.
Definition: ASTBitCodes.h:1779
static TypeTraitExpr * CreateDeserialized(const ASTContext &C, unsigned NumArgs)
Definition: ExprCXX.cpp:1445
Expr * ReadSubExpr()
Reads a sub-expression operand during statement reading.
WhileStmt - This represents a &#39;while&#39; stmt.
Definition: Stmt.h:1129
void initializeFrom(SourceLocation TemplateKWLoc, const TemplateArgumentListInfo &List, TemplateArgumentLoc *OutArgArray)
void setIfLoc(SourceLocation L)
Definition: Stmt.h:1007
Field designator where the field has been resolved to a declaration.
Definition: ASTBitCodes.h:1976
void setIsaMemberLoc(SourceLocation L)
Definition: ExprObjC.h:1471
unsigned getNumConcatenated() const
getNumConcatenated - Get the number of string literal tokens that were concatenated in translation ph...
Definition: Expr.h:1684
A CXXInheritedCtorInitExpr record.
Definition: ASTBitCodes.h:1823
unsigned kind
All of the diagnostics that can be emitted by the frontend.
Definition: DiagnosticIDs.h:61
void setExprOperand(Expr *E)
Definition: ExprCXX.h:721
The receiver is a class.
Definition: ExprObjC.h:1052
Represents Objective-C&#39;s @try ... @catch ... @finally statement.
Definition: StmtObjC.h:154
This represents &#39;#pragma omp taskloop simd&#39; directive.
Definition: StmtOpenMP.h:2872
void setTokenLocation(SourceLocation L)
Definition: Expr.h:3882
static OMPSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:236
unsigned getNumCatchStmts() const
Retrieve the number of @catch statements in this try-catch-finally block.
Definition: StmtObjC.h:203
StringLiteral - This represents a string literal expression, e.g.
Definition: Expr.h:1568
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2285
llvm::APInt readAPInt()
Read an integral value, advancing Idx.
Definition: ASTReader.h:2608
void setOpLoc(SourceLocation L)
Definition: ExprObjC.h:565
void setLoopVarStmt(Stmt *S)
Definition: StmtCXX.h:188
void setTryBody(Stmt *S)
Definition: StmtObjC.h:199
An object for streaming information from a record.
Definition: ASTReader.h:2362
Internal struct to describes an element that is a pack expansion, used if any of the elements in the ...
Definition: ExprObjC.h:276
void setPreCond(Expr *PC)
Definition: StmtOpenMP.h:486
RetTy Visit(PTR(Stmt) S, ParamTys... P)
Definition: StmtVisitor.h:46
void setRParenLoc(SourceLocation L)
Definition: Stmt.h:1286
void reserveInits(const ASTContext &C, unsigned NumInits)
Reserve space for some number of initializers.
Definition: Expr.cpp:1963
static OMPCancelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:585
Abstract class common to all of the C++ "named"/"keyword" casts.
Definition: ExprCXX.h:246
This represents &#39;#pragma omp sections&#39; directive.
Definition: StmtOpenMP.h:1212
void setNextSwitchCase(SwitchCase *SC)
Definition: Stmt.h:737
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition: ExprObjC.h:82
unsigned getNumComponents() const
Definition: Expr.h:2061
This represents &#39;#pragma omp target data&#39; directive.
Definition: StmtOpenMP.h:2312
void setNextUpperBound(Expr *NUB)
Definition: StmtOpenMP.h:539
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument for this lambda expression...
Definition: ExprCXX.h:1768
capture_range captures()
Definition: Stmt.h:2212
void setKind(CharacterKind kind)
Definition: Expr.h:1432
A reference to a declared variable, function, enum, etc.
Definition: Expr.h:971
Designator - A designator in a C99 designated initializer.
Definition: Designator.h:37
void setLabel(LabelDecl *D)
Definition: Stmt.h:1318
Token readToken()
Reads a token out of a record, advancing Idx.
Definition: ASTReader.h:2648
BreakStmt - This represents a break.
Definition: Stmt.h:1408
void setSubStmt(Stmt *SS)
Definition: Stmt.h:887
static ObjCArrayLiteral * CreateEmpty(const ASTContext &C, unsigned NumElements)
Definition: ExprObjC.cpp:53
void setInc(Expr *Inc)
Definition: StmtOpenMP.h:493
unsigned getNumArgs() const
Definition: ExprCXX.h:1385
A trivial tuple used to represent a source range.
void setInit(Stmt *S)
Definition: Stmt.h:1276
This represents &#39;#pragma omp taskyield&#39; directive.
Definition: StmtOpenMP.h:1805
This represents a decl that may have a name.
Definition: Decl.h:248
unsigned NumInputs
Definition: Stmt.h:1507
This represents &#39;#pragma omp distribute parallel for simd&#39; composite directive.
Definition: StmtOpenMP.h:3145
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition: ExprCXX.h:550
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type, member-designator).
Definition: Expr.h:2002
This represents &#39;#pragma omp parallel sections&#39; directive.
Definition: StmtOpenMP.h:1666
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
Definition: ExprCXX.h:877
void setCalcLastIteration(Expr *CLI)
Definition: StmtOpenMP.h:483
SwitchCase * getSwitchCaseWithID(unsigned ID)
Retrieve the switch-case statement with the given ID.
Definition: ASTReader.h:2657
void setStdInitListInitialization(bool V)
Definition: ExprCXX.h:1348
The receiver is a superclass.
Definition: ExprObjC.h:1058
void setCombinedNextUpperBound(Expr *CombNUB)
Definition: StmtOpenMP.h:603
SourceLocation getBegin() const
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument.
Definition: Stmt.h:2261
Represents Objective-C&#39;s @autoreleasepool Statement.
Definition: StmtObjC.h:345
void setWhileLoc(SourceLocation L)
Definition: Stmt.h:1213
StmtCode
Record codes for each kind of statement or expression.
Definition: ASTBitCodes.h:1545
void setLocEnd(SourceLocation Loc)
Set ending location of directive.
Definition: StmtOpenMP.h:181
void setArg(unsigned Arg, Expr *ArgExpr)
setArg - Set the specified argument.
Definition: ExprObjC.h:1352
void setFinals(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:51
static OMPTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setBase(Expr *E)
Definition: ExprObjC.h:1462
Represents an implicitly-generated value initialization of an object of a given type.
Definition: Expr.h:4703
void setKeywordLoc(SourceLocation L)
Definition: Stmt.h:740
void setCapturedRegionKind(CapturedRegionKind Kind)
Set the captured region kind.
Definition: Stmt.cpp:1129
A GenericSelectionExpr record.
Definition: ASTBitCodes.h:1728
This represents &#39;#pragma omp target parallel for&#39; directive.
Definition: StmtOpenMP.h:2547
void setBody(Stmt *B)
Definition: Decl.cpp:4445
static OMPCancellationPointDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:563
void setLabelLoc(SourceLocation L)
Definition: Stmt.h:1323
#define BLOCK(DERIVED, BASE)
Definition: Template.h:470
void setCond(Expr *E)
Definition: Expr.h:3833
void setAtLoc(SourceLocation Loc)
Definition: StmtObjC.h:366
void setIsConditionTrue(bool isTrue)
Definition: Expr.h:3820
OMPClause * readClause()
This represents &#39;#pragma omp taskloop&#39; directive.
Definition: StmtOpenMP.h:2807