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