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 
599  // NumConcatenated, Length and CharByteWidth are set by the empty
600  // ctor since they are needed to allocate storage for the trailing objects.
601  unsigned NumConcatenated = Record.readInt();
602  unsigned Length = Record.readInt();
603  unsigned CharByteWidth = Record.readInt();
604  assert((NumConcatenated == E->getNumConcatenated()) &&
605  "Wrong number of concatenated tokens!");
606  assert((Length == E->getLength()) && "Wrong Length!");
607  assert((CharByteWidth == E->getCharByteWidth()) && "Wrong character width!");
608  E->StringLiteralBits.Kind = Record.readInt();
609  E->StringLiteralBits.IsPascal = Record.readInt();
610 
611  // The character width is originally computed via mapCharByteWidth.
612  // Check that the deserialized character width is consistant with the result
613  // of calling mapCharByteWidth.
614  assert((CharByteWidth ==
615  StringLiteral::mapCharByteWidth(Record.getContext().getTargetInfo(),
616  E->getKind())) &&
617  "Wrong character width!");
618 
619  // Deserialize the trailing array of SourceLocation.
620  for (unsigned I = 0; I < NumConcatenated; ++I)
621  E->setStrTokenLoc(I, ReadSourceLocation());
622 
623  // Deserialize the trailing array of char holding the string data.
624  char *StrData = E->getStrDataAsChar();
625  for (unsigned I = 0; I < Length * CharByteWidth; ++I)
626  StrData[I] = Record.readInt();
627 }
628 
629 void ASTStmtReader::VisitCharacterLiteral(CharacterLiteral *E) {
630  VisitExpr(E);
631  E->setValue(Record.readInt());
632  E->setLocation(ReadSourceLocation());
633  E->setKind(static_cast<CharacterLiteral::CharacterKind>(Record.readInt()));
634 }
635 
636 void ASTStmtReader::VisitParenExpr(ParenExpr *E) {
637  VisitExpr(E);
638  E->setLParen(ReadSourceLocation());
639  E->setRParen(ReadSourceLocation());
640  E->setSubExpr(Record.readSubExpr());
641 }
642 
643 void ASTStmtReader::VisitParenListExpr(ParenListExpr *E) {
644  VisitExpr(E);
645  unsigned NumExprs = Record.readInt();
646  assert((NumExprs == E->getNumExprs()) && "Wrong NumExprs!");
647  for (unsigned I = 0; I != NumExprs; ++I)
648  E->getTrailingObjects<Stmt *>()[I] = Record.readSubStmt();
649  E->LParenLoc = ReadSourceLocation();
650  E->RParenLoc = ReadSourceLocation();
651 }
652 
653 void ASTStmtReader::VisitUnaryOperator(UnaryOperator *E) {
654  VisitExpr(E);
655  E->setSubExpr(Record.readSubExpr());
657  E->setOperatorLoc(ReadSourceLocation());
658  E->setCanOverflow(Record.readInt());
659 }
660 
661 void ASTStmtReader::VisitOffsetOfExpr(OffsetOfExpr *E) {
662  VisitExpr(E);
663  assert(E->getNumComponents() == Record.peekInt());
664  Record.skipInts(1);
665  assert(E->getNumExpressions() == Record.peekInt());
666  Record.skipInts(1);
667  E->setOperatorLoc(ReadSourceLocation());
668  E->setRParenLoc(ReadSourceLocation());
669  E->setTypeSourceInfo(GetTypeSourceInfo());
670  for (unsigned I = 0, N = E->getNumComponents(); I != N; ++I) {
671  auto Kind = static_cast<OffsetOfNode::Kind>(Record.readInt());
672  SourceLocation Start = ReadSourceLocation();
673  SourceLocation End = ReadSourceLocation();
674  switch (Kind) {
675  case OffsetOfNode::Array:
676  E->setComponent(I, OffsetOfNode(Start, Record.readInt(), End));
677  break;
678 
679  case OffsetOfNode::Field:
680  E->setComponent(
681  I, OffsetOfNode(Start, ReadDeclAs<FieldDecl>(), End));
682  break;
683 
685  E->setComponent(
686  I,
687  OffsetOfNode(Start, Record.getIdentifierInfo(), End));
688  break;
689 
690  case OffsetOfNode::Base: {
691  auto *Base = new (Record.getContext()) CXXBaseSpecifier();
692  *Base = Record.readCXXBaseSpecifier();
694  break;
695  }
696  }
697  }
698 
699  for (unsigned I = 0, N = E->getNumExpressions(); I != N; ++I)
700  E->setIndexExpr(I, Record.readSubExpr());
701 }
702 
703 void ASTStmtReader::VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *E) {
704  VisitExpr(E);
705  E->setKind(static_cast<UnaryExprOrTypeTrait>(Record.readInt()));
706  if (Record.peekInt() == 0) {
707  E->setArgument(Record.readSubExpr());
708  Record.skipInts(1);
709  } else {
710  E->setArgument(GetTypeSourceInfo());
711  }
712  E->setOperatorLoc(ReadSourceLocation());
713  E->setRParenLoc(ReadSourceLocation());
714 }
715 
716 void ASTStmtReader::VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
717  VisitExpr(E);
718  E->setLHS(Record.readSubExpr());
719  E->setRHS(Record.readSubExpr());
720  E->setRBracketLoc(ReadSourceLocation());
721 }
722 
723 void ASTStmtReader::VisitOMPArraySectionExpr(OMPArraySectionExpr *E) {
724  VisitExpr(E);
725  E->setBase(Record.readSubExpr());
726  E->setLowerBound(Record.readSubExpr());
727  E->setLength(Record.readSubExpr());
728  E->setColonLoc(ReadSourceLocation());
729  E->setRBracketLoc(ReadSourceLocation());
730 }
731 
732 void ASTStmtReader::VisitCallExpr(CallExpr *E) {
733  VisitExpr(E);
734  unsigned NumArgs = Record.readInt();
735  assert((NumArgs == E->getNumArgs()) && "Wrong NumArgs!");
736  E->setRParenLoc(ReadSourceLocation());
737  E->setCallee(Record.readSubExpr());
738  for (unsigned I = 0; I != NumArgs; ++I)
739  E->setArg(I, Record.readSubExpr());
740 }
741 
742 void ASTStmtReader::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) {
743  VisitCallExpr(E);
744 }
745 
746 void ASTStmtReader::VisitMemberExpr(MemberExpr *E) {
747  // Don't call VisitExpr, this is fully initialized at creation.
748  assert(E->getStmtClass() == Stmt::MemberExprClass &&
749  "It's a subclass, we must advance Idx!");
750 }
751 
752 void ASTStmtReader::VisitObjCIsaExpr(ObjCIsaExpr *E) {
753  VisitExpr(E);
754  E->setBase(Record.readSubExpr());
755  E->setIsaMemberLoc(ReadSourceLocation());
756  E->setOpLoc(ReadSourceLocation());
757  E->setArrow(Record.readInt());
758 }
759 
760 void ASTStmtReader::
761 VisitObjCIndirectCopyRestoreExpr(ObjCIndirectCopyRestoreExpr *E) {
762  VisitExpr(E);
763  E->Operand = Record.readSubExpr();
764  E->setShouldCopy(Record.readInt());
765 }
766 
767 void ASTStmtReader::VisitObjCBridgedCastExpr(ObjCBridgedCastExpr *E) {
768  VisitExplicitCastExpr(E);
769  E->LParenLoc = ReadSourceLocation();
770  E->BridgeKeywordLoc = ReadSourceLocation();
771  E->Kind = Record.readInt();
772 }
773 
774 void ASTStmtReader::VisitCastExpr(CastExpr *E) {
775  VisitExpr(E);
776  unsigned NumBaseSpecs = Record.readInt();
777  assert(NumBaseSpecs == E->path_size());
778  E->setSubExpr(Record.readSubExpr());
779  E->setCastKind((CastKind)Record.readInt());
780  CastExpr::path_iterator BaseI = E->path_begin();
781  while (NumBaseSpecs--) {
782  auto *BaseSpec = new (Record.getContext()) CXXBaseSpecifier;
783  *BaseSpec = Record.readCXXBaseSpecifier();
784  *BaseI++ = BaseSpec;
785  }
786 }
787 
788 void ASTStmtReader::VisitBinaryOperator(BinaryOperator *E) {
789  VisitExpr(E);
790  E->setLHS(Record.readSubExpr());
791  E->setRHS(Record.readSubExpr());
793  E->setOperatorLoc(ReadSourceLocation());
794  E->setFPFeatures(FPOptions(Record.readInt()));
795 }
796 
797 void ASTStmtReader::VisitCompoundAssignOperator(CompoundAssignOperator *E) {
798  VisitBinaryOperator(E);
799  E->setComputationLHSType(Record.readType());
800  E->setComputationResultType(Record.readType());
801 }
802 
803 void ASTStmtReader::VisitConditionalOperator(ConditionalOperator *E) {
804  VisitExpr(E);
805  E->SubExprs[ConditionalOperator::COND] = Record.readSubExpr();
806  E->SubExprs[ConditionalOperator::LHS] = Record.readSubExpr();
807  E->SubExprs[ConditionalOperator::RHS] = Record.readSubExpr();
808  E->QuestionLoc = ReadSourceLocation();
809  E->ColonLoc = ReadSourceLocation();
810 }
811 
812 void
813 ASTStmtReader::VisitBinaryConditionalOperator(BinaryConditionalOperator *E) {
814  VisitExpr(E);
815  E->OpaqueValue = cast<OpaqueValueExpr>(Record.readSubExpr());
816  E->SubExprs[BinaryConditionalOperator::COMMON] = Record.readSubExpr();
817  E->SubExprs[BinaryConditionalOperator::COND] = Record.readSubExpr();
818  E->SubExprs[BinaryConditionalOperator::LHS] = Record.readSubExpr();
819  E->SubExprs[BinaryConditionalOperator::RHS] = Record.readSubExpr();
820  E->QuestionLoc = ReadSourceLocation();
821  E->ColonLoc = ReadSourceLocation();
822 }
823 
824 void ASTStmtReader::VisitImplicitCastExpr(ImplicitCastExpr *E) {
825  VisitCastExpr(E);
826  E->setIsPartOfExplicitCast(Record.readInt());
827 }
828 
829 void ASTStmtReader::VisitExplicitCastExpr(ExplicitCastExpr *E) {
830  VisitCastExpr(E);
831  E->setTypeInfoAsWritten(GetTypeSourceInfo());
832 }
833 
834 void ASTStmtReader::VisitCStyleCastExpr(CStyleCastExpr *E) {
835  VisitExplicitCastExpr(E);
836  E->setLParenLoc(ReadSourceLocation());
837  E->setRParenLoc(ReadSourceLocation());
838 }
839 
840 void ASTStmtReader::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
841  VisitExpr(E);
842  E->setLParenLoc(ReadSourceLocation());
843  E->setTypeSourceInfo(GetTypeSourceInfo());
844  E->setInitializer(Record.readSubExpr());
845  E->setFileScope(Record.readInt());
846 }
847 
848 void ASTStmtReader::VisitExtVectorElementExpr(ExtVectorElementExpr *E) {
849  VisitExpr(E);
850  E->setBase(Record.readSubExpr());
851  E->setAccessor(Record.getIdentifierInfo());
852  E->setAccessorLoc(ReadSourceLocation());
853 }
854 
855 void ASTStmtReader::VisitInitListExpr(InitListExpr *E) {
856  VisitExpr(E);
857  if (auto *SyntForm = cast_or_null<InitListExpr>(Record.readSubStmt()))
858  E->setSyntacticForm(SyntForm);
859  E->setLBraceLoc(ReadSourceLocation());
860  E->setRBraceLoc(ReadSourceLocation());
861  bool isArrayFiller = Record.readInt();
862  Expr *filler = nullptr;
863  if (isArrayFiller) {
864  filler = Record.readSubExpr();
865  E->ArrayFillerOrUnionFieldInit = filler;
866  } else
867  E->ArrayFillerOrUnionFieldInit = ReadDeclAs<FieldDecl>();
868  E->sawArrayRangeDesignator(Record.readInt());
869  unsigned NumInits = Record.readInt();
870  E->reserveInits(Record.getContext(), NumInits);
871  if (isArrayFiller) {
872  for (unsigned I = 0; I != NumInits; ++I) {
873  Expr *init = Record.readSubExpr();
874  E->updateInit(Record.getContext(), I, init ? init : filler);
875  }
876  } else {
877  for (unsigned I = 0; I != NumInits; ++I)
878  E->updateInit(Record.getContext(), I, Record.readSubExpr());
879  }
880 }
881 
882 void ASTStmtReader::VisitDesignatedInitExpr(DesignatedInitExpr *E) {
884 
885  VisitExpr(E);
886  unsigned NumSubExprs = Record.readInt();
887  assert(NumSubExprs == E->getNumSubExprs() && "Wrong number of subexprs");
888  for (unsigned I = 0; I != NumSubExprs; ++I)
889  E->setSubExpr(I, Record.readSubExpr());
890  E->setEqualOrColonLoc(ReadSourceLocation());
891  E->setGNUSyntax(Record.readInt());
892 
893  SmallVector<Designator, 4> Designators;
894  while (Record.getIdx() < Record.size()) {
895  switch ((DesignatorTypes)Record.readInt()) {
896  case DESIG_FIELD_DECL: {
897  auto *Field = ReadDeclAs<FieldDecl>();
898  SourceLocation DotLoc = ReadSourceLocation();
899  SourceLocation FieldLoc = ReadSourceLocation();
900  Designators.push_back(Designator(Field->getIdentifier(), DotLoc,
901  FieldLoc));
902  Designators.back().setField(Field);
903  break;
904  }
905 
906  case DESIG_FIELD_NAME: {
907  const IdentifierInfo *Name = Record.getIdentifierInfo();
908  SourceLocation DotLoc = ReadSourceLocation();
909  SourceLocation FieldLoc = ReadSourceLocation();
910  Designators.push_back(Designator(Name, DotLoc, FieldLoc));
911  break;
912  }
913 
914  case DESIG_ARRAY: {
915  unsigned Index = Record.readInt();
916  SourceLocation LBracketLoc = ReadSourceLocation();
917  SourceLocation RBracketLoc = ReadSourceLocation();
918  Designators.push_back(Designator(Index, LBracketLoc, RBracketLoc));
919  break;
920  }
921 
922  case DESIG_ARRAY_RANGE: {
923  unsigned Index = Record.readInt();
924  SourceLocation LBracketLoc = ReadSourceLocation();
925  SourceLocation EllipsisLoc = ReadSourceLocation();
926  SourceLocation RBracketLoc = ReadSourceLocation();
927  Designators.push_back(Designator(Index, LBracketLoc, EllipsisLoc,
928  RBracketLoc));
929  break;
930  }
931  }
932  }
933  E->setDesignators(Record.getContext(),
934  Designators.data(), Designators.size());
935 }
936 
937 void ASTStmtReader::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) {
938  VisitExpr(E);
939  E->setBase(Record.readSubExpr());
940  E->setUpdater(Record.readSubExpr());
941 }
942 
943 void ASTStmtReader::VisitNoInitExpr(NoInitExpr *E) {
944  VisitExpr(E);
945 }
946 
947 void ASTStmtReader::VisitArrayInitLoopExpr(ArrayInitLoopExpr *E) {
948  VisitExpr(E);
949  E->SubExprs[0] = Record.readSubExpr();
950  E->SubExprs[1] = Record.readSubExpr();
951 }
952 
953 void ASTStmtReader::VisitArrayInitIndexExpr(ArrayInitIndexExpr *E) {
954  VisitExpr(E);
955 }
956 
957 void ASTStmtReader::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) {
958  VisitExpr(E);
959 }
960 
961 void ASTStmtReader::VisitVAArgExpr(VAArgExpr *E) {
962  VisitExpr(E);
963  E->setSubExpr(Record.readSubExpr());
964  E->setWrittenTypeInfo(GetTypeSourceInfo());
965  E->setBuiltinLoc(ReadSourceLocation());
966  E->setRParenLoc(ReadSourceLocation());
967  E->setIsMicrosoftABI(Record.readInt());
968 }
969 
970 void ASTStmtReader::VisitAddrLabelExpr(AddrLabelExpr *E) {
971  VisitExpr(E);
972  E->setAmpAmpLoc(ReadSourceLocation());
973  E->setLabelLoc(ReadSourceLocation());
974  E->setLabel(ReadDeclAs<LabelDecl>());
975 }
976 
977 void ASTStmtReader::VisitStmtExpr(StmtExpr *E) {
978  VisitExpr(E);
979  E->setLParenLoc(ReadSourceLocation());
980  E->setRParenLoc(ReadSourceLocation());
981  E->setSubStmt(cast_or_null<CompoundStmt>(Record.readSubStmt()));
982 }
983 
984 void ASTStmtReader::VisitChooseExpr(ChooseExpr *E) {
985  VisitExpr(E);
986  E->setCond(Record.readSubExpr());
987  E->setLHS(Record.readSubExpr());
988  E->setRHS(Record.readSubExpr());
989  E->setBuiltinLoc(ReadSourceLocation());
990  E->setRParenLoc(ReadSourceLocation());
991  E->setIsConditionTrue(Record.readInt());
992 }
993 
994 void ASTStmtReader::VisitGNUNullExpr(GNUNullExpr *E) {
995  VisitExpr(E);
996  E->setTokenLocation(ReadSourceLocation());
997 }
998 
999 void ASTStmtReader::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
1000  VisitExpr(E);
1002  unsigned NumExprs = Record.readInt();
1003  while (NumExprs--)
1004  Exprs.push_back(Record.readSubExpr());
1005  E->setExprs(Record.getContext(), Exprs);
1006  E->setBuiltinLoc(ReadSourceLocation());
1007  E->setRParenLoc(ReadSourceLocation());
1008 }
1009 
1010 void ASTStmtReader::VisitConvertVectorExpr(ConvertVectorExpr *E) {
1011  VisitExpr(E);
1012  E->BuiltinLoc = ReadSourceLocation();
1013  E->RParenLoc = ReadSourceLocation();
1014  E->TInfo = GetTypeSourceInfo();
1015  E->SrcExpr = Record.readSubExpr();
1016 }
1017 
1018 void ASTStmtReader::VisitBlockExpr(BlockExpr *E) {
1019  VisitExpr(E);
1020  E->setBlockDecl(ReadDeclAs<BlockDecl>());
1021 }
1022 
1023 void ASTStmtReader::VisitGenericSelectionExpr(GenericSelectionExpr *E) {
1024  VisitExpr(E);
1025  E->NumAssocs = Record.readInt();
1026  E->AssocTypes = new (Record.getContext()) TypeSourceInfo*[E->NumAssocs];
1027  E->SubExprs =
1028  new(Record.getContext()) Stmt*[GenericSelectionExpr::END_EXPR+E->NumAssocs];
1029 
1030  E->SubExprs[GenericSelectionExpr::CONTROLLING] = Record.readSubExpr();
1031  for (unsigned I = 0, N = E->getNumAssocs(); I != N; ++I) {
1032  E->AssocTypes[I] = GetTypeSourceInfo();
1033  E->SubExprs[GenericSelectionExpr::END_EXPR+I] = Record.readSubExpr();
1034  }
1035  E->ResultIndex = Record.readInt();
1036 
1037  E->GenericLoc = ReadSourceLocation();
1038  E->DefaultLoc = ReadSourceLocation();
1039  E->RParenLoc = ReadSourceLocation();
1040 }
1041 
1042 void ASTStmtReader::VisitPseudoObjectExpr(PseudoObjectExpr *E) {
1043  VisitExpr(E);
1044  unsigned numSemanticExprs = Record.readInt();
1045  assert(numSemanticExprs + 1 == E->PseudoObjectExprBits.NumSubExprs);
1046  E->PseudoObjectExprBits.ResultIndex = Record.readInt();
1047 
1048  // Read the syntactic expression.
1049  E->getSubExprsBuffer()[0] = Record.readSubExpr();
1050 
1051  // Read all the semantic expressions.
1052  for (unsigned i = 0; i != numSemanticExprs; ++i) {
1053  Expr *subExpr = Record.readSubExpr();
1054  E->getSubExprsBuffer()[i+1] = subExpr;
1055  }
1056 }
1057 
1058 void ASTStmtReader::VisitAtomicExpr(AtomicExpr *E) {
1059  VisitExpr(E);
1060  E->Op = AtomicExpr::AtomicOp(Record.readInt());
1061  E->NumSubExprs = AtomicExpr::getNumSubExprs(E->Op);
1062  for (unsigned I = 0; I != E->NumSubExprs; ++I)
1063  E->SubExprs[I] = Record.readSubExpr();
1064  E->BuiltinLoc = ReadSourceLocation();
1065  E->RParenLoc = ReadSourceLocation();
1066 }
1067 
1068 //===----------------------------------------------------------------------===//
1069 // Objective-C Expressions and Statements
1070 
1071 void ASTStmtReader::VisitObjCStringLiteral(ObjCStringLiteral *E) {
1072  VisitExpr(E);
1073  E->setString(cast<StringLiteral>(Record.readSubStmt()));
1074  E->setAtLoc(ReadSourceLocation());
1075 }
1076 
1077 void ASTStmtReader::VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
1078  VisitExpr(E);
1079  // could be one of several IntegerLiteral, FloatLiteral, etc.
1080  E->SubExpr = Record.readSubStmt();
1081  E->BoxingMethod = ReadDeclAs<ObjCMethodDecl>();
1082  E->Range = ReadSourceRange();
1083 }
1084 
1085 void ASTStmtReader::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
1086  VisitExpr(E);
1087  unsigned NumElements = Record.readInt();
1088  assert(NumElements == E->getNumElements() && "Wrong number of elements");
1089  Expr **Elements = E->getElements();
1090  for (unsigned I = 0, N = NumElements; I != N; ++I)
1091  Elements[I] = Record.readSubExpr();
1092  E->ArrayWithObjectsMethod = ReadDeclAs<ObjCMethodDecl>();
1093  E->Range = ReadSourceRange();
1094 }
1095 
1096 void ASTStmtReader::VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *E) {
1097  VisitExpr(E);
1098  unsigned NumElements = Record.readInt();
1099  assert(NumElements == E->getNumElements() && "Wrong number of elements");
1100  bool HasPackExpansions = Record.readInt();
1101  assert(HasPackExpansions == E->HasPackExpansions &&"Pack expansion mismatch");
1102  auto *KeyValues =
1103  E->getTrailingObjects<ObjCDictionaryLiteral::KeyValuePair>();
1104  auto *Expansions =
1105  E->getTrailingObjects<ObjCDictionaryLiteral::ExpansionData>();
1106  for (unsigned I = 0; I != NumElements; ++I) {
1107  KeyValues[I].Key = Record.readSubExpr();
1108  KeyValues[I].Value = Record.readSubExpr();
1109  if (HasPackExpansions) {
1110  Expansions[I].EllipsisLoc = ReadSourceLocation();
1111  Expansions[I].NumExpansionsPlusOne = Record.readInt();
1112  }
1113  }
1114  E->DictWithObjectsMethod = ReadDeclAs<ObjCMethodDecl>();
1115  E->Range = ReadSourceRange();
1116 }
1117 
1118 void ASTStmtReader::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
1119  VisitExpr(E);
1120  E->setEncodedTypeSourceInfo(GetTypeSourceInfo());
1121  E->setAtLoc(ReadSourceLocation());
1122  E->setRParenLoc(ReadSourceLocation());
1123 }
1124 
1125 void ASTStmtReader::VisitObjCSelectorExpr(ObjCSelectorExpr *E) {
1126  VisitExpr(E);
1127  E->setSelector(Record.readSelector());
1128  E->setAtLoc(ReadSourceLocation());
1129  E->setRParenLoc(ReadSourceLocation());
1130 }
1131 
1132 void ASTStmtReader::VisitObjCProtocolExpr(ObjCProtocolExpr *E) {
1133  VisitExpr(E);
1134  E->setProtocol(ReadDeclAs<ObjCProtocolDecl>());
1135  E->setAtLoc(ReadSourceLocation());
1136  E->ProtoLoc = ReadSourceLocation();
1137  E->setRParenLoc(ReadSourceLocation());
1138 }
1139 
1140 void ASTStmtReader::VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) {
1141  VisitExpr(E);
1142  E->setDecl(ReadDeclAs<ObjCIvarDecl>());
1143  E->setLocation(ReadSourceLocation());
1144  E->setOpLoc(ReadSourceLocation());
1145  E->setBase(Record.readSubExpr());
1146  E->setIsArrow(Record.readInt());
1147  E->setIsFreeIvar(Record.readInt());
1148 }
1149 
1150 void ASTStmtReader::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
1151  VisitExpr(E);
1152  unsigned MethodRefFlags = Record.readInt();
1153  bool Implicit = Record.readInt() != 0;
1154  if (Implicit) {
1155  auto *Getter = ReadDeclAs<ObjCMethodDecl>();
1156  auto *Setter = ReadDeclAs<ObjCMethodDecl>();
1157  E->setImplicitProperty(Getter, Setter, MethodRefFlags);
1158  } else {
1159  E->setExplicitProperty(ReadDeclAs<ObjCPropertyDecl>(), MethodRefFlags);
1160  }
1161  E->setLocation(ReadSourceLocation());
1162  E->setReceiverLocation(ReadSourceLocation());
1163  switch (Record.readInt()) {
1164  case 0:
1165  E->setBase(Record.readSubExpr());
1166  break;
1167  case 1:
1168  E->setSuperReceiver(Record.readType());
1169  break;
1170  case 2:
1171  E->setClassReceiver(ReadDeclAs<ObjCInterfaceDecl>());
1172  break;
1173  }
1174 }
1175 
1176 void ASTStmtReader::VisitObjCSubscriptRefExpr(ObjCSubscriptRefExpr *E) {
1177  VisitExpr(E);
1178  E->setRBracket(ReadSourceLocation());
1179  E->setBaseExpr(Record.readSubExpr());
1180  E->setKeyExpr(Record.readSubExpr());
1181  E->GetAtIndexMethodDecl = ReadDeclAs<ObjCMethodDecl>();
1182  E->SetAtIndexMethodDecl = ReadDeclAs<ObjCMethodDecl>();
1183 }
1184 
1185 void ASTStmtReader::VisitObjCMessageExpr(ObjCMessageExpr *E) {
1186  VisitExpr(E);
1187  assert(Record.peekInt() == E->getNumArgs());
1188  Record.skipInts(1);
1189  unsigned NumStoredSelLocs = Record.readInt();
1190  E->SelLocsKind = Record.readInt();
1191  E->setDelegateInitCall(Record.readInt());
1192  E->IsImplicit = Record.readInt();
1193  auto Kind = static_cast<ObjCMessageExpr::ReceiverKind>(Record.readInt());
1194  switch (Kind) {
1196  E->setInstanceReceiver(Record.readSubExpr());
1197  break;
1198 
1200  E->setClassReceiver(GetTypeSourceInfo());
1201  break;
1202 
1205  QualType T = Record.readType();
1206  SourceLocation SuperLoc = ReadSourceLocation();
1207  E->setSuper(SuperLoc, T, Kind == ObjCMessageExpr::SuperInstance);
1208  break;
1209  }
1210  }
1211 
1212  assert(Kind == E->getReceiverKind());
1213 
1214  if (Record.readInt())
1215  E->setMethodDecl(ReadDeclAs<ObjCMethodDecl>());
1216  else
1217  E->setSelector(Record.readSelector());
1218 
1219  E->LBracLoc = ReadSourceLocation();
1220  E->RBracLoc = ReadSourceLocation();
1221 
1222  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1223  E->setArg(I, Record.readSubExpr());
1224 
1225  SourceLocation *Locs = E->getStoredSelLocs();
1226  for (unsigned I = 0; I != NumStoredSelLocs; ++I)
1227  Locs[I] = ReadSourceLocation();
1228 }
1229 
1230 void ASTStmtReader::VisitObjCForCollectionStmt(ObjCForCollectionStmt *S) {
1231  VisitStmt(S);
1232  S->setElement(Record.readSubStmt());
1233  S->setCollection(Record.readSubExpr());
1234  S->setBody(Record.readSubStmt());
1235  S->setForLoc(ReadSourceLocation());
1236  S->setRParenLoc(ReadSourceLocation());
1237 }
1238 
1239 void ASTStmtReader::VisitObjCAtCatchStmt(ObjCAtCatchStmt *S) {
1240  VisitStmt(S);
1241  S->setCatchBody(Record.readSubStmt());
1242  S->setCatchParamDecl(ReadDeclAs<VarDecl>());
1243  S->setAtCatchLoc(ReadSourceLocation());
1244  S->setRParenLoc(ReadSourceLocation());
1245 }
1246 
1247 void ASTStmtReader::VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S) {
1248  VisitStmt(S);
1249  S->setFinallyBody(Record.readSubStmt());
1250  S->setAtFinallyLoc(ReadSourceLocation());
1251 }
1252 
1253 void ASTStmtReader::VisitObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S) {
1254  VisitStmt(S);
1255  S->setSubStmt(Record.readSubStmt());
1256  S->setAtLoc(ReadSourceLocation());
1257 }
1258 
1259 void ASTStmtReader::VisitObjCAtTryStmt(ObjCAtTryStmt *S) {
1260  VisitStmt(S);
1261  assert(Record.peekInt() == S->getNumCatchStmts());
1262  Record.skipInts(1);
1263  bool HasFinally = Record.readInt();
1264  S->setTryBody(Record.readSubStmt());
1265  for (unsigned I = 0, N = S->getNumCatchStmts(); I != N; ++I)
1266  S->setCatchStmt(I, cast_or_null<ObjCAtCatchStmt>(Record.readSubStmt()));
1267 
1268  if (HasFinally)
1269  S->setFinallyStmt(Record.readSubStmt());
1270  S->setAtTryLoc(ReadSourceLocation());
1271 }
1272 
1273 void ASTStmtReader::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
1274  VisitStmt(S);
1275  S->setSynchExpr(Record.readSubStmt());
1276  S->setSynchBody(Record.readSubStmt());
1277  S->setAtSynchronizedLoc(ReadSourceLocation());
1278 }
1279 
1280 void ASTStmtReader::VisitObjCAtThrowStmt(ObjCAtThrowStmt *S) {
1281  VisitStmt(S);
1282  S->setThrowExpr(Record.readSubStmt());
1283  S->setThrowLoc(ReadSourceLocation());
1284 }
1285 
1286 void ASTStmtReader::VisitObjCBoolLiteralExpr(ObjCBoolLiteralExpr *E) {
1287  VisitExpr(E);
1288  E->setValue(Record.readInt());
1289  E->setLocation(ReadSourceLocation());
1290 }
1291 
1292 void ASTStmtReader::VisitObjCAvailabilityCheckExpr(ObjCAvailabilityCheckExpr *E) {
1293  VisitExpr(E);
1294  SourceRange R = Record.readSourceRange();
1295  E->AtLoc = R.getBegin();
1296  E->RParen = R.getEnd();
1297  E->VersionToCheck = Record.readVersionTuple();
1298 }
1299 
1300 //===----------------------------------------------------------------------===//
1301 // C++ Expressions and Statements
1302 //===----------------------------------------------------------------------===//
1303 
1304 void ASTStmtReader::VisitCXXCatchStmt(CXXCatchStmt *S) {
1305  VisitStmt(S);
1306  S->CatchLoc = ReadSourceLocation();
1307  S->ExceptionDecl = ReadDeclAs<VarDecl>();
1308  S->HandlerBlock = Record.readSubStmt();
1309 }
1310 
1311 void ASTStmtReader::VisitCXXTryStmt(CXXTryStmt *S) {
1312  VisitStmt(S);
1313  assert(Record.peekInt() == S->getNumHandlers() && "NumStmtFields is wrong ?");
1314  Record.skipInts(1);
1315  S->TryLoc = ReadSourceLocation();
1316  S->getStmts()[0] = Record.readSubStmt();
1317  for (unsigned i = 0, e = S->getNumHandlers(); i != e; ++i)
1318  S->getStmts()[i + 1] = Record.readSubStmt();
1319 }
1320 
1321 void ASTStmtReader::VisitCXXForRangeStmt(CXXForRangeStmt *S) {
1322  VisitStmt(S);
1323  S->ForLoc = ReadSourceLocation();
1324  S->CoawaitLoc = ReadSourceLocation();
1325  S->ColonLoc = ReadSourceLocation();
1326  S->RParenLoc = ReadSourceLocation();
1327  S->setInit(Record.readSubStmt());
1328  S->setRangeStmt(Record.readSubStmt());
1329  S->setBeginStmt(Record.readSubStmt());
1330  S->setEndStmt(Record.readSubStmt());
1331  S->setCond(Record.readSubExpr());
1332  S->setInc(Record.readSubExpr());
1333  S->setLoopVarStmt(Record.readSubStmt());
1334  S->setBody(Record.readSubStmt());
1335 }
1336 
1337 void ASTStmtReader::VisitMSDependentExistsStmt(MSDependentExistsStmt *S) {
1338  VisitStmt(S);
1339  S->KeywordLoc = ReadSourceLocation();
1340  S->IsIfExists = Record.readInt();
1341  S->QualifierLoc = Record.readNestedNameSpecifierLoc();
1342  ReadDeclarationNameInfo(S->NameInfo);
1343  S->SubStmt = Record.readSubStmt();
1344 }
1345 
1346 void ASTStmtReader::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
1347  VisitCallExpr(E);
1348  E->Operator = (OverloadedOperatorKind)Record.readInt();
1349  E->Range = Record.readSourceRange();
1350  E->setFPFeatures(FPOptions(Record.readInt()));
1351 }
1352 
1353 void ASTStmtReader::VisitCXXConstructExpr(CXXConstructExpr *E) {
1354  VisitExpr(E);
1355  E->NumArgs = Record.readInt();
1356  if (E->NumArgs)
1357  E->Args = new (Record.getContext()) Stmt*[E->NumArgs];
1358  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1359  E->setArg(I, Record.readSubExpr());
1360  E->setConstructor(ReadDeclAs<CXXConstructorDecl>());
1361  E->setLocation(ReadSourceLocation());
1362  E->setElidable(Record.readInt());
1363  E->setHadMultipleCandidates(Record.readInt());
1364  E->setListInitialization(Record.readInt());
1368  E->ParenOrBraceRange = ReadSourceRange();
1369 }
1370 
1371 void ASTStmtReader::VisitCXXInheritedCtorInitExpr(CXXInheritedCtorInitExpr *E) {
1372  VisitExpr(E);
1373  E->Constructor = ReadDeclAs<CXXConstructorDecl>();
1374  E->Loc = ReadSourceLocation();
1375  E->ConstructsVirtualBase = Record.readInt();
1376  E->InheritedFromVirtualBase = Record.readInt();
1377 }
1378 
1379 void ASTStmtReader::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
1380  VisitCXXConstructExpr(E);
1381  E->Type = GetTypeSourceInfo();
1382 }
1383 
1384 void ASTStmtReader::VisitLambdaExpr(LambdaExpr *E) {
1385  VisitExpr(E);
1386  unsigned NumCaptures = Record.readInt();
1387  assert(NumCaptures == E->NumCaptures);(void)NumCaptures;
1388  E->IntroducerRange = ReadSourceRange();
1389  E->CaptureDefault = static_cast<LambdaCaptureDefault>(Record.readInt());
1390  E->CaptureDefaultLoc = ReadSourceLocation();
1391  E->ExplicitParams = Record.readInt();
1392  E->ExplicitResultType = Record.readInt();
1393  E->ClosingBrace = ReadSourceLocation();
1394 
1395  // Read capture initializers.
1397  CEnd = E->capture_init_end();
1398  C != CEnd; ++C)
1399  *C = Record.readSubExpr();
1400 }
1401 
1402 void
1403 ASTStmtReader::VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E) {
1404  VisitExpr(E);
1405  E->SubExpr = Record.readSubExpr();
1406 }
1407 
1408 void ASTStmtReader::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) {
1409  VisitExplicitCastExpr(E);
1410  SourceRange R = ReadSourceRange();
1411  E->Loc = R.getBegin();
1412  E->RParenLoc = R.getEnd();
1413  R = ReadSourceRange();
1414  E->AngleBrackets = R;
1415 }
1416 
1417 void ASTStmtReader::VisitCXXStaticCastExpr(CXXStaticCastExpr *E) {
1418  return VisitCXXNamedCastExpr(E);
1419 }
1420 
1421 void ASTStmtReader::VisitCXXDynamicCastExpr(CXXDynamicCastExpr *E) {
1422  return VisitCXXNamedCastExpr(E);
1423 }
1424 
1425 void ASTStmtReader::VisitCXXReinterpretCastExpr(CXXReinterpretCastExpr *E) {
1426  return VisitCXXNamedCastExpr(E);
1427 }
1428 
1429 void ASTStmtReader::VisitCXXConstCastExpr(CXXConstCastExpr *E) {
1430  return VisitCXXNamedCastExpr(E);
1431 }
1432 
1433 void ASTStmtReader::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E) {
1434  VisitExplicitCastExpr(E);
1435  E->setLParenLoc(ReadSourceLocation());
1436  E->setRParenLoc(ReadSourceLocation());
1437 }
1438 
1439 void ASTStmtReader::VisitUserDefinedLiteral(UserDefinedLiteral *E) {
1440  VisitCallExpr(E);
1441  E->UDSuffixLoc = ReadSourceLocation();
1442 }
1443 
1444 void ASTStmtReader::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) {
1445  VisitExpr(E);
1446  E->setValue(Record.readInt());
1447  E->setLocation(ReadSourceLocation());
1448 }
1449 
1450 void ASTStmtReader::VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E) {
1451  VisitExpr(E);
1452  E->setLocation(ReadSourceLocation());
1453 }
1454 
1455 void ASTStmtReader::VisitCXXTypeidExpr(CXXTypeidExpr *E) {
1456  VisitExpr(E);
1457  E->setSourceRange(ReadSourceRange());
1458  if (E->isTypeOperand()) { // typeid(int)
1460  GetTypeSourceInfo());
1461  return;
1462  }
1463 
1464  // typeid(42+2)
1465  E->setExprOperand(Record.readSubExpr());
1466 }
1467 
1468 void ASTStmtReader::VisitCXXThisExpr(CXXThisExpr *E) {
1469  VisitExpr(E);
1470  E->setLocation(ReadSourceLocation());
1471  E->setImplicit(Record.readInt());
1472 }
1473 
1474 void ASTStmtReader::VisitCXXThrowExpr(CXXThrowExpr *E) {
1475  VisitExpr(E);
1476  E->CXXThrowExprBits.ThrowLoc = ReadSourceLocation();
1477  E->Operand = Record.readSubExpr();
1478  E->CXXThrowExprBits.IsThrownVariableInScope = Record.readInt();
1479 }
1480 
1481 void ASTStmtReader::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
1482  VisitExpr(E);
1483  E->Param = ReadDeclAs<ParmVarDecl>();
1484  E->CXXDefaultArgExprBits.Loc = ReadSourceLocation();
1485 }
1486 
1487 void ASTStmtReader::VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E) {
1488  VisitExpr(E);
1489  E->Field = ReadDeclAs<FieldDecl>();
1490  E->CXXDefaultInitExprBits.Loc = ReadSourceLocation();
1491 }
1492 
1493 void ASTStmtReader::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
1494  VisitExpr(E);
1495  E->setTemporary(Record.readCXXTemporary());
1496  E->setSubExpr(Record.readSubExpr());
1497 }
1498 
1499 void ASTStmtReader::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
1500  VisitExpr(E);
1501  E->TypeInfo = GetTypeSourceInfo();
1502  E->RParenLoc = ReadSourceLocation();
1503 }
1504 
1505 void ASTStmtReader::VisitCXXNewExpr(CXXNewExpr *E) {
1506  VisitExpr(E);
1507  E->GlobalNew = Record.readInt();
1508  bool isArray = Record.readInt();
1509  E->PassAlignment = Record.readInt();
1510  E->UsualArrayDeleteWantsSize = Record.readInt();
1511  unsigned NumPlacementArgs = Record.readInt();
1512  E->StoredInitializationStyle = Record.readInt();
1513  E->setOperatorNew(ReadDeclAs<FunctionDecl>());
1514  E->setOperatorDelete(ReadDeclAs<FunctionDecl>());
1515  E->AllocatedTypeInfo = GetTypeSourceInfo();
1516  E->TypeIdParens = ReadSourceRange();
1517  E->Range = ReadSourceRange();
1518  E->DirectInitRange = ReadSourceRange();
1519 
1520  E->AllocateArgsArray(Record.getContext(), isArray, NumPlacementArgs,
1521  E->StoredInitializationStyle != 0);
1522 
1523  // Install all the subexpressions.
1525  I != e; ++I)
1526  *I = Record.readSubStmt();
1527 }
1528 
1529 void ASTStmtReader::VisitCXXDeleteExpr(CXXDeleteExpr *E) {
1530  VisitExpr(E);
1531  E->CXXDeleteExprBits.GlobalDelete = Record.readInt();
1532  E->CXXDeleteExprBits.ArrayForm = Record.readInt();
1533  E->CXXDeleteExprBits.ArrayFormAsWritten = Record.readInt();
1534  E->CXXDeleteExprBits.UsualArrayDeleteWantsSize = Record.readInt();
1535  E->OperatorDelete = ReadDeclAs<FunctionDecl>();
1536  E->Argument = Record.readSubExpr();
1537  E->CXXDeleteExprBits.Loc = ReadSourceLocation();
1538 }
1539 
1540 void ASTStmtReader::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
1541  VisitExpr(E);
1542 
1543  E->Base = Record.readSubExpr();
1544  E->IsArrow = Record.readInt();
1545  E->OperatorLoc = ReadSourceLocation();
1546  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1547  E->ScopeType = GetTypeSourceInfo();
1548  E->ColonColonLoc = ReadSourceLocation();
1549  E->TildeLoc = ReadSourceLocation();
1550 
1551  IdentifierInfo *II = Record.getIdentifierInfo();
1552  if (II)
1553  E->setDestroyedType(II, ReadSourceLocation());
1554  else
1555  E->setDestroyedType(GetTypeSourceInfo());
1556 }
1557 
1558 void ASTStmtReader::VisitExprWithCleanups(ExprWithCleanups *E) {
1559  VisitExpr(E);
1560 
1561  unsigned NumObjects = Record.readInt();
1562  assert(NumObjects == E->getNumObjects());
1563  for (unsigned i = 0; i != NumObjects; ++i)
1564  E->getTrailingObjects<BlockDecl *>()[i] =
1565  ReadDeclAs<BlockDecl>();
1566 
1567  E->ExprWithCleanupsBits.CleanupsHaveSideEffects = Record.readInt();
1568  E->SubExpr = Record.readSubExpr();
1569 }
1570 
1571 void
1572 ASTStmtReader::VisitCXXDependentScopeMemberExpr(CXXDependentScopeMemberExpr *E){
1573  VisitExpr(E);
1574 
1575  if (Record.readInt()) // HasTemplateKWAndArgsInfo
1576  ReadTemplateKWAndArgsInfo(
1577  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
1578  E->getTrailingObjects<TemplateArgumentLoc>(),
1579  /*NumTemplateArgs=*/Record.readInt());
1580 
1581  E->Base = Record.readSubExpr();
1582  E->BaseType = Record.readType();
1583  E->IsArrow = Record.readInt();
1584  E->OperatorLoc = ReadSourceLocation();
1585  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1586  E->FirstQualifierFoundInScope = ReadDeclAs<NamedDecl>();
1587  ReadDeclarationNameInfo(E->MemberNameInfo);
1588 }
1589 
1590 void
1591 ASTStmtReader::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) {
1592  VisitExpr(E);
1593 
1594  if (Record.readInt()) // HasTemplateKWAndArgsInfo
1595  ReadTemplateKWAndArgsInfo(
1596  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
1597  E->getTrailingObjects<TemplateArgumentLoc>(),
1598  /*NumTemplateArgs=*/Record.readInt());
1599 
1600  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1601  ReadDeclarationNameInfo(E->NameInfo);
1602 }
1603 
1604 void
1605 ASTStmtReader::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E) {
1606  VisitExpr(E);
1607  assert(Record.peekInt() == E->arg_size() &&
1608  "Read wrong record during creation ?");
1609  Record.skipInts(1);
1610  for (unsigned I = 0, N = E->arg_size(); I != N; ++I)
1611  E->setArg(I, Record.readSubExpr());
1612  E->Type = GetTypeSourceInfo();
1613  E->setLParenLoc(ReadSourceLocation());
1614  E->setRParenLoc(ReadSourceLocation());
1615 }
1616 
1617 void ASTStmtReader::VisitOverloadExpr(OverloadExpr *E) {
1618  VisitExpr(E);
1619 
1620  if (Record.readInt()) // HasTemplateKWAndArgsInfo
1621  ReadTemplateKWAndArgsInfo(*E->getTrailingASTTemplateKWAndArgsInfo(),
1623  /*NumTemplateArgs=*/Record.readInt());
1624 
1625  unsigned NumDecls = Record.readInt();
1626  UnresolvedSet<8> Decls;
1627  for (unsigned i = 0; i != NumDecls; ++i) {
1628  auto *D = ReadDeclAs<NamedDecl>();
1629  auto AS = (AccessSpecifier)Record.readInt();
1630  Decls.addDecl(D, AS);
1631  }
1632  E->initializeResults(Record.getContext(), Decls.begin(), Decls.end());
1633 
1634  ReadDeclarationNameInfo(E->NameInfo);
1635  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1636 }
1637 
1638 void ASTStmtReader::VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
1639  VisitOverloadExpr(E);
1640  E->IsArrow = Record.readInt();
1641  E->HasUnresolvedUsing = Record.readInt();
1642  E->Base = Record.readSubExpr();
1643  E->BaseType = Record.readType();
1644  E->OperatorLoc = ReadSourceLocation();
1645 }
1646 
1647 void ASTStmtReader::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) {
1648  VisitOverloadExpr(E);
1649  E->RequiresADL = Record.readInt();
1650  E->Overloaded = Record.readInt();
1651  E->NamingClass = ReadDeclAs<CXXRecordDecl>();
1652 }
1653 
1654 void ASTStmtReader::VisitTypeTraitExpr(TypeTraitExpr *E) {
1655  VisitExpr(E);
1656  E->TypeTraitExprBits.NumArgs = Record.readInt();
1657  E->TypeTraitExprBits.Kind = Record.readInt();
1658  E->TypeTraitExprBits.Value = Record.readInt();
1659  SourceRange Range = ReadSourceRange();
1660  E->Loc = Range.getBegin();
1661  E->RParenLoc = Range.getEnd();
1662 
1663  auto **Args = E->getTrailingObjects<TypeSourceInfo *>();
1664  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1665  Args[I] = GetTypeSourceInfo();
1666 }
1667 
1668 void ASTStmtReader::VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E) {
1669  VisitExpr(E);
1670  E->ATT = (ArrayTypeTrait)Record.readInt();
1671  E->Value = (unsigned int)Record.readInt();
1672  SourceRange Range = ReadSourceRange();
1673  E->Loc = Range.getBegin();
1674  E->RParen = Range.getEnd();
1675  E->QueriedType = GetTypeSourceInfo();
1676  E->Dimension = Record.readSubExpr();
1677 }
1678 
1679 void ASTStmtReader::VisitExpressionTraitExpr(ExpressionTraitExpr *E) {
1680  VisitExpr(E);
1681  E->ET = (ExpressionTrait)Record.readInt();
1682  E->Value = (bool)Record.readInt();
1683  SourceRange Range = ReadSourceRange();
1684  E->QueriedExpression = Record.readSubExpr();
1685  E->Loc = Range.getBegin();
1686  E->RParen = Range.getEnd();
1687 }
1688 
1689 void ASTStmtReader::VisitCXXNoexceptExpr(CXXNoexceptExpr *E) {
1690  VisitExpr(E);
1691  E->Value = (bool)Record.readInt();
1692  E->Range = ReadSourceRange();
1693  E->Operand = Record.readSubExpr();
1694 }
1695 
1696 void ASTStmtReader::VisitPackExpansionExpr(PackExpansionExpr *E) {
1697  VisitExpr(E);
1698  E->EllipsisLoc = ReadSourceLocation();
1699  E->NumExpansions = Record.readInt();
1700  E->Pattern = Record.readSubExpr();
1701 }
1702 
1703 void ASTStmtReader::VisitSizeOfPackExpr(SizeOfPackExpr *E) {
1704  VisitExpr(E);
1705  unsigned NumPartialArgs = Record.readInt();
1706  E->OperatorLoc = ReadSourceLocation();
1707  E->PackLoc = ReadSourceLocation();
1708  E->RParenLoc = ReadSourceLocation();
1709  E->Pack = Record.readDeclAs<NamedDecl>();
1710  if (E->isPartiallySubstituted()) {
1711  assert(E->Length == NumPartialArgs);
1712  for (auto *I = E->getTrailingObjects<TemplateArgument>(),
1713  *E = I + NumPartialArgs;
1714  I != E; ++I)
1715  new (I) TemplateArgument(Record.readTemplateArgument());
1716  } else if (!E->isValueDependent()) {
1717  E->Length = Record.readInt();
1718  }
1719 }
1720 
1721 void ASTStmtReader::VisitSubstNonTypeTemplateParmExpr(
1723  VisitExpr(E);
1724  E->Param = ReadDeclAs<NonTypeTemplateParmDecl>();
1725  E->NameLoc = ReadSourceLocation();
1726  E->Replacement = Record.readSubExpr();
1727 }
1728 
1729 void ASTStmtReader::VisitSubstNonTypeTemplateParmPackExpr(
1731  VisitExpr(E);
1732  E->Param = ReadDeclAs<NonTypeTemplateParmDecl>();
1733  TemplateArgument ArgPack = Record.readTemplateArgument();
1734  if (ArgPack.getKind() != TemplateArgument::Pack)
1735  return;
1736 
1737  E->Arguments = ArgPack.pack_begin();
1738  E->NumArguments = ArgPack.pack_size();
1739  E->NameLoc = ReadSourceLocation();
1740 }
1741 
1742 void ASTStmtReader::VisitFunctionParmPackExpr(FunctionParmPackExpr *E) {
1743  VisitExpr(E);
1744  E->NumParameters = Record.readInt();
1745  E->ParamPack = ReadDeclAs<ParmVarDecl>();
1746  E->NameLoc = ReadSourceLocation();
1747  auto **Parms = E->getTrailingObjects<ParmVarDecl *>();
1748  for (unsigned i = 0, n = E->NumParameters; i != n; ++i)
1749  Parms[i] = ReadDeclAs<ParmVarDecl>();
1750 }
1751 
1752 void ASTStmtReader::VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E) {
1753  VisitExpr(E);
1754  E->State = Record.readSubExpr();
1755  auto *VD = ReadDeclAs<ValueDecl>();
1756  unsigned ManglingNumber = Record.readInt();
1757  E->setExtendingDecl(VD, ManglingNumber);
1758 }
1759 
1760 void ASTStmtReader::VisitCXXFoldExpr(CXXFoldExpr *E) {
1761  VisitExpr(E);
1762  E->LParenLoc = ReadSourceLocation();
1763  E->EllipsisLoc = ReadSourceLocation();
1764  E->RParenLoc = ReadSourceLocation();
1765  E->SubExprs[0] = Record.readSubExpr();
1766  E->SubExprs[1] = Record.readSubExpr();
1767  E->Opcode = (BinaryOperatorKind)Record.readInt();
1768 }
1769 
1770 void ASTStmtReader::VisitOpaqueValueExpr(OpaqueValueExpr *E) {
1771  VisitExpr(E);
1772  E->SourceExpr = Record.readSubExpr();
1773  E->Loc = ReadSourceLocation();
1774  E->setIsUnique(Record.readInt());
1775 }
1776 
1777 void ASTStmtReader::VisitTypoExpr(TypoExpr *E) {
1778  llvm_unreachable("Cannot read TypoExpr nodes");
1779 }
1780 
1781 //===----------------------------------------------------------------------===//
1782 // Microsoft Expressions and Statements
1783 //===----------------------------------------------------------------------===//
1784 void ASTStmtReader::VisitMSPropertyRefExpr(MSPropertyRefExpr *E) {
1785  VisitExpr(E);
1786  E->IsArrow = (Record.readInt() != 0);
1787  E->BaseExpr = Record.readSubExpr();
1788  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1789  E->MemberLoc = ReadSourceLocation();
1790  E->TheDecl = ReadDeclAs<MSPropertyDecl>();
1791 }
1792 
1793 void ASTStmtReader::VisitMSPropertySubscriptExpr(MSPropertySubscriptExpr *E) {
1794  VisitExpr(E);
1795  E->setBase(Record.readSubExpr());
1796  E->setIdx(Record.readSubExpr());
1797  E->setRBracketLoc(ReadSourceLocation());
1798 }
1799 
1800 void ASTStmtReader::VisitCXXUuidofExpr(CXXUuidofExpr *E) {
1801  VisitExpr(E);
1802  E->setSourceRange(ReadSourceRange());
1803  std::string UuidStr = ReadString();
1804  E->setUuidStr(StringRef(UuidStr).copy(Record.getContext()));
1805  if (E->isTypeOperand()) { // __uuidof(ComType)
1807  GetTypeSourceInfo());
1808  return;
1809  }
1810 
1811  // __uuidof(expr)
1812  E->setExprOperand(Record.readSubExpr());
1813 }
1814 
1815 void ASTStmtReader::VisitSEHLeaveStmt(SEHLeaveStmt *S) {
1816  VisitStmt(S);
1817  S->setLeaveLoc(ReadSourceLocation());
1818 }
1819 
1820 void ASTStmtReader::VisitSEHExceptStmt(SEHExceptStmt *S) {
1821  VisitStmt(S);
1822  S->Loc = ReadSourceLocation();
1823  S->Children[SEHExceptStmt::FILTER_EXPR] = Record.readSubStmt();
1824  S->Children[SEHExceptStmt::BLOCK] = Record.readSubStmt();
1825 }
1826 
1827 void ASTStmtReader::VisitSEHFinallyStmt(SEHFinallyStmt *S) {
1828  VisitStmt(S);
1829  S->Loc = ReadSourceLocation();
1830  S->Block = Record.readSubStmt();
1831 }
1832 
1833 void ASTStmtReader::VisitSEHTryStmt(SEHTryStmt *S) {
1834  VisitStmt(S);
1835  S->IsCXXTry = Record.readInt();
1836  S->TryLoc = ReadSourceLocation();
1837  S->Children[SEHTryStmt::TRY] = Record.readSubStmt();
1838  S->Children[SEHTryStmt::HANDLER] = Record.readSubStmt();
1839 }
1840 
1841 //===----------------------------------------------------------------------===//
1842 // CUDA Expressions and Statements
1843 //===----------------------------------------------------------------------===//
1844 
1845 void ASTStmtReader::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E) {
1846  VisitCallExpr(E);
1847  E->setConfig(cast<CallExpr>(Record.readSubExpr()));
1848 }
1849 
1850 //===----------------------------------------------------------------------===//
1851 // OpenCL Expressions and Statements.
1852 //===----------------------------------------------------------------------===//
1853 void ASTStmtReader::VisitAsTypeExpr(AsTypeExpr *E) {
1854  VisitExpr(E);
1855  E->BuiltinLoc = ReadSourceLocation();
1856  E->RParenLoc = ReadSourceLocation();
1857  E->SrcExpr = Record.readSubExpr();
1858 }
1859 
1860 //===----------------------------------------------------------------------===//
1861 // OpenMP Directives.
1862 //===----------------------------------------------------------------------===//
1863 
1864 void ASTStmtReader::VisitOMPExecutableDirective(OMPExecutableDirective *E) {
1865  E->setLocStart(ReadSourceLocation());
1866  E->setLocEnd(ReadSourceLocation());
1867  OMPClauseReader ClauseReader(Record);
1869  for (unsigned i = 0; i < E->getNumClauses(); ++i)
1870  Clauses.push_back(ClauseReader.readClause());
1871  E->setClauses(Clauses);
1872  if (E->hasAssociatedStmt())
1873  E->setAssociatedStmt(Record.readSubStmt());
1874 }
1875 
1876 void ASTStmtReader::VisitOMPLoopDirective(OMPLoopDirective *D) {
1877  VisitStmt(D);
1878  // Two fields (NumClauses and CollapsedNum) were read in ReadStmtFromStream.
1879  Record.skipInts(2);
1880  VisitOMPExecutableDirective(D);
1881  D->setIterationVariable(Record.readSubExpr());
1882  D->setLastIteration(Record.readSubExpr());
1883  D->setCalcLastIteration(Record.readSubExpr());
1884  D->setPreCond(Record.readSubExpr());
1885  D->setCond(Record.readSubExpr());
1886  D->setInit(Record.readSubExpr());
1887  D->setInc(Record.readSubExpr());
1888  D->setPreInits(Record.readSubStmt());
1892  D->setIsLastIterVariable(Record.readSubExpr());
1893  D->setLowerBoundVariable(Record.readSubExpr());
1894  D->setUpperBoundVariable(Record.readSubExpr());
1895  D->setStrideVariable(Record.readSubExpr());
1896  D->setEnsureUpperBound(Record.readSubExpr());
1897  D->setNextLowerBound(Record.readSubExpr());
1898  D->setNextUpperBound(Record.readSubExpr());
1899  D->setNumIterations(Record.readSubExpr());
1900  }
1904  D->setDistInc(Record.readSubExpr());
1905  D->setPrevEnsureUpperBound(Record.readSubExpr());
1909  D->setCombinedInit(Record.readSubExpr());
1910  D->setCombinedCond(Record.readSubExpr());
1913  D->setCombinedDistCond(Record.readSubExpr());
1915  }
1917  unsigned CollapsedNum = D->getCollapsedNumber();
1918  Sub.reserve(CollapsedNum);
1919  for (unsigned i = 0; i < CollapsedNum; ++i)
1920  Sub.push_back(Record.readSubExpr());
1921  D->setCounters(Sub);
1922  Sub.clear();
1923  for (unsigned i = 0; i < CollapsedNum; ++i)
1924  Sub.push_back(Record.readSubExpr());
1925  D->setPrivateCounters(Sub);
1926  Sub.clear();
1927  for (unsigned i = 0; i < CollapsedNum; ++i)
1928  Sub.push_back(Record.readSubExpr());
1929  D->setInits(Sub);
1930  Sub.clear();
1931  for (unsigned i = 0; i < CollapsedNum; ++i)
1932  Sub.push_back(Record.readSubExpr());
1933  D->setUpdates(Sub);
1934  Sub.clear();
1935  for (unsigned i = 0; i < CollapsedNum; ++i)
1936  Sub.push_back(Record.readSubExpr());
1937  D->setFinals(Sub);
1938 }
1939 
1940 void ASTStmtReader::VisitOMPParallelDirective(OMPParallelDirective *D) {
1941  VisitStmt(D);
1942  // The NumClauses field was read in ReadStmtFromStream.
1943  Record.skipInts(1);
1944  VisitOMPExecutableDirective(D);
1945  D->setHasCancel(Record.readInt());
1946 }
1947 
1948 void ASTStmtReader::VisitOMPSimdDirective(OMPSimdDirective *D) {
1949  VisitOMPLoopDirective(D);
1950 }
1951 
1952 void ASTStmtReader::VisitOMPForDirective(OMPForDirective *D) {
1953  VisitOMPLoopDirective(D);
1954  D->setHasCancel(Record.readInt());
1955 }
1956 
1957 void ASTStmtReader::VisitOMPForSimdDirective(OMPForSimdDirective *D) {
1958  VisitOMPLoopDirective(D);
1959 }
1960 
1961 void ASTStmtReader::VisitOMPSectionsDirective(OMPSectionsDirective *D) {
1962  VisitStmt(D);
1963  // The NumClauses field was read in ReadStmtFromStream.
1964  Record.skipInts(1);
1965  VisitOMPExecutableDirective(D);
1966  D->setHasCancel(Record.readInt());
1967 }
1968 
1969 void ASTStmtReader::VisitOMPSectionDirective(OMPSectionDirective *D) {
1970  VisitStmt(D);
1971  VisitOMPExecutableDirective(D);
1972  D->setHasCancel(Record.readInt());
1973 }
1974 
1975 void ASTStmtReader::VisitOMPSingleDirective(OMPSingleDirective *D) {
1976  VisitStmt(D);
1977  // The NumClauses field was read in ReadStmtFromStream.
1978  Record.skipInts(1);
1979  VisitOMPExecutableDirective(D);
1980 }
1981 
1982 void ASTStmtReader::VisitOMPMasterDirective(OMPMasterDirective *D) {
1983  VisitStmt(D);
1984  VisitOMPExecutableDirective(D);
1985 }
1986 
1987 void ASTStmtReader::VisitOMPCriticalDirective(OMPCriticalDirective *D) {
1988  VisitStmt(D);
1989  // The NumClauses field was read in ReadStmtFromStream.
1990  Record.skipInts(1);
1991  VisitOMPExecutableDirective(D);
1992  ReadDeclarationNameInfo(D->DirName);
1993 }
1994 
1995 void ASTStmtReader::VisitOMPParallelForDirective(OMPParallelForDirective *D) {
1996  VisitOMPLoopDirective(D);
1997  D->setHasCancel(Record.readInt());
1998 }
1999 
2000 void ASTStmtReader::VisitOMPParallelForSimdDirective(
2002  VisitOMPLoopDirective(D);
2003 }
2004 
2005 void ASTStmtReader::VisitOMPParallelSectionsDirective(
2007  VisitStmt(D);
2008  // The NumClauses field was read in ReadStmtFromStream.
2009  Record.skipInts(1);
2010  VisitOMPExecutableDirective(D);
2011  D->setHasCancel(Record.readInt());
2012 }
2013 
2014 void ASTStmtReader::VisitOMPTaskDirective(OMPTaskDirective *D) {
2015  VisitStmt(D);
2016  // The NumClauses field was read in ReadStmtFromStream.
2017  Record.skipInts(1);
2018  VisitOMPExecutableDirective(D);
2019  D->setHasCancel(Record.readInt());
2020 }
2021 
2022 void ASTStmtReader::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) {
2023  VisitStmt(D);
2024  VisitOMPExecutableDirective(D);
2025 }
2026 
2027 void ASTStmtReader::VisitOMPBarrierDirective(OMPBarrierDirective *D) {
2028  VisitStmt(D);
2029  VisitOMPExecutableDirective(D);
2030 }
2031 
2032 void ASTStmtReader::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) {
2033  VisitStmt(D);
2034  VisitOMPExecutableDirective(D);
2035 }
2036 
2037 void ASTStmtReader::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) {
2038  VisitStmt(D);
2039  // The NumClauses field was read in ReadStmtFromStream.
2040  Record.skipInts(1);
2041  VisitOMPExecutableDirective(D);
2042  D->setReductionRef(Record.readSubExpr());
2043 }
2044 
2045 void ASTStmtReader::VisitOMPFlushDirective(OMPFlushDirective *D) {
2046  VisitStmt(D);
2047  // The NumClauses field was read in ReadStmtFromStream.
2048  Record.skipInts(1);
2049  VisitOMPExecutableDirective(D);
2050 }
2051 
2052 void ASTStmtReader::VisitOMPOrderedDirective(OMPOrderedDirective *D) {
2053  VisitStmt(D);
2054  // The NumClauses field was read in ReadStmtFromStream.
2055  Record.skipInts(1);
2056  VisitOMPExecutableDirective(D);
2057 }
2058 
2059 void ASTStmtReader::VisitOMPAtomicDirective(OMPAtomicDirective *D) {
2060  VisitStmt(D);
2061  // The NumClauses field was read in ReadStmtFromStream.
2062  Record.skipInts(1);
2063  VisitOMPExecutableDirective(D);
2064  D->setX(Record.readSubExpr());
2065  D->setV(Record.readSubExpr());
2066  D->setExpr(Record.readSubExpr());
2067  D->setUpdateExpr(Record.readSubExpr());
2068  D->IsXLHSInRHSPart = Record.readInt() != 0;
2069  D->IsPostfixUpdate = Record.readInt() != 0;
2070 }
2071 
2072 void ASTStmtReader::VisitOMPTargetDirective(OMPTargetDirective *D) {
2073  VisitStmt(D);
2074  // The NumClauses field was read in ReadStmtFromStream.
2075  Record.skipInts(1);
2076  VisitOMPExecutableDirective(D);
2077 }
2078 
2079 void ASTStmtReader::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) {
2080  VisitStmt(D);
2081  Record.skipInts(1);
2082  VisitOMPExecutableDirective(D);
2083 }
2084 
2085 void ASTStmtReader::VisitOMPTargetEnterDataDirective(
2087  VisitStmt(D);
2088  Record.skipInts(1);
2089  VisitOMPExecutableDirective(D);
2090 }
2091 
2092 void ASTStmtReader::VisitOMPTargetExitDataDirective(
2094  VisitStmt(D);
2095  Record.skipInts(1);
2096  VisitOMPExecutableDirective(D);
2097 }
2098 
2099 void ASTStmtReader::VisitOMPTargetParallelDirective(
2101  VisitStmt(D);
2102  Record.skipInts(1);
2103  VisitOMPExecutableDirective(D);
2104 }
2105 
2106 void ASTStmtReader::VisitOMPTargetParallelForDirective(
2108  VisitOMPLoopDirective(D);
2109  D->setHasCancel(Record.readInt());
2110 }
2111 
2112 void ASTStmtReader::VisitOMPTeamsDirective(OMPTeamsDirective *D) {
2113  VisitStmt(D);
2114  // The NumClauses field was read in ReadStmtFromStream.
2115  Record.skipInts(1);
2116  VisitOMPExecutableDirective(D);
2117 }
2118 
2119 void ASTStmtReader::VisitOMPCancellationPointDirective(
2121  VisitStmt(D);
2122  VisitOMPExecutableDirective(D);
2123  D->setCancelRegion(static_cast<OpenMPDirectiveKind>(Record.readInt()));
2124 }
2125 
2126 void ASTStmtReader::VisitOMPCancelDirective(OMPCancelDirective *D) {
2127  VisitStmt(D);
2128  // The NumClauses field was read in ReadStmtFromStream.
2129  Record.skipInts(1);
2130  VisitOMPExecutableDirective(D);
2131  D->setCancelRegion(static_cast<OpenMPDirectiveKind>(Record.readInt()));
2132 }
2133 
2134 void ASTStmtReader::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) {
2135  VisitOMPLoopDirective(D);
2136 }
2137 
2138 void ASTStmtReader::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) {
2139  VisitOMPLoopDirective(D);
2140 }
2141 
2142 void ASTStmtReader::VisitOMPDistributeDirective(OMPDistributeDirective *D) {
2143  VisitOMPLoopDirective(D);
2144 }
2145 
2146 void ASTStmtReader::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) {
2147  VisitStmt(D);
2148  Record.skipInts(1);
2149  VisitOMPExecutableDirective(D);
2150 }
2151 
2152 void ASTStmtReader::VisitOMPDistributeParallelForDirective(
2154  VisitOMPLoopDirective(D);
2155  D->setHasCancel(Record.readInt());
2156 }
2157 
2158 void ASTStmtReader::VisitOMPDistributeParallelForSimdDirective(
2160  VisitOMPLoopDirective(D);
2161 }
2162 
2163 void ASTStmtReader::VisitOMPDistributeSimdDirective(
2165  VisitOMPLoopDirective(D);
2166 }
2167 
2168 void ASTStmtReader::VisitOMPTargetParallelForSimdDirective(
2170  VisitOMPLoopDirective(D);
2171 }
2172 
2173 void ASTStmtReader::VisitOMPTargetSimdDirective(OMPTargetSimdDirective *D) {
2174  VisitOMPLoopDirective(D);
2175 }
2176 
2177 void ASTStmtReader::VisitOMPTeamsDistributeDirective(
2179  VisitOMPLoopDirective(D);
2180 }
2181 
2182 void ASTStmtReader::VisitOMPTeamsDistributeSimdDirective(
2184  VisitOMPLoopDirective(D);
2185 }
2186 
2187 void ASTStmtReader::VisitOMPTeamsDistributeParallelForSimdDirective(
2189  VisitOMPLoopDirective(D);
2190 }
2191 
2192 void ASTStmtReader::VisitOMPTeamsDistributeParallelForDirective(
2194  VisitOMPLoopDirective(D);
2195  D->setHasCancel(Record.readInt());
2196 }
2197 
2198 void ASTStmtReader::VisitOMPTargetTeamsDirective(OMPTargetTeamsDirective *D) {
2199  VisitStmt(D);
2200  // The NumClauses field was read in ReadStmtFromStream.
2201  Record.skipInts(1);
2202  VisitOMPExecutableDirective(D);
2203 }
2204 
2205 void ASTStmtReader::VisitOMPTargetTeamsDistributeDirective(
2207  VisitOMPLoopDirective(D);
2208 }
2209 
2210 void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForDirective(
2212  VisitOMPLoopDirective(D);
2213  D->setHasCancel(Record.readInt());
2214 }
2215 
2216 void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
2218  VisitOMPLoopDirective(D);
2219 }
2220 
2221 void ASTStmtReader::VisitOMPTargetTeamsDistributeSimdDirective(
2223  VisitOMPLoopDirective(D);
2224 }
2225 
2226 //===----------------------------------------------------------------------===//
2227 // ASTReader Implementation
2228 //===----------------------------------------------------------------------===//
2229 
2231  switch (ReadingKind) {
2232  case Read_None:
2233  llvm_unreachable("should not call this when not reading anything");
2234  case Read_Decl:
2235  case Read_Type:
2236  return ReadStmtFromStream(F);
2237  case Read_Stmt:
2238  return ReadSubStmt();
2239  }
2240 
2241  llvm_unreachable("ReadingKind not set ?");
2242 }
2243 
2245  return cast_or_null<Expr>(ReadStmt(F));
2246 }
2247 
2249  return cast_or_null<Expr>(ReadSubStmt());
2250 }
2251 
2252 // Within the bitstream, expressions are stored in Reverse Polish
2253 // Notation, with each of the subexpressions preceding the
2254 // expression they are stored in. Subexpressions are stored from last to first.
2255 // To evaluate expressions, we continue reading expressions and placing them on
2256 // the stack, with expressions having operands removing those operands from the
2257 // stack. Evaluation terminates when we see a STMT_STOP record, and
2258 // the single remaining expression on the stack is our result.
2259 Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) {
2260  ReadingKindTracker ReadingKind(Read_Stmt, *this);
2261  llvm::BitstreamCursor &Cursor = F.DeclsCursor;
2262 
2263  // Map of offset to previously deserialized stmt. The offset points
2264  // just after the stmt record.
2265  llvm::DenseMap<uint64_t, Stmt *> StmtEntries;
2266 
2267 #ifndef NDEBUG
2268  unsigned PrevNumStmts = StmtStack.size();
2269 #endif
2270 
2271  ASTRecordReader Record(*this, F);
2272  ASTStmtReader Reader(Record, Cursor);
2273  Stmt::EmptyShell Empty;
2274 
2275  while (true) {
2276  llvm::BitstreamEntry Entry = Cursor.advanceSkippingSubblocks();
2277 
2278  switch (Entry.Kind) {
2279  case llvm::BitstreamEntry::SubBlock: // Handled for us already.
2281  Error("malformed block record in AST file");
2282  return nullptr;
2283  case llvm::BitstreamEntry::EndBlock:
2284  goto Done;
2285  case llvm::BitstreamEntry::Record:
2286  // The interesting case.
2287  break;
2288  }
2289 
2290  ASTContext &Context = getContext();
2291  Stmt *S = nullptr;
2292  bool Finished = false;
2293  bool IsStmtReference = false;
2294  switch ((StmtCode)Record.readRecord(Cursor, Entry.ID)) {
2295  case STMT_STOP:
2296  Finished = true;
2297  break;
2298 
2299  case STMT_REF_PTR:
2300  IsStmtReference = true;
2301  assert(StmtEntries.find(Record[0]) != StmtEntries.end() &&
2302  "No stmt was recorded for this offset reference!");
2303  S = StmtEntries[Record.readInt()];
2304  break;
2305 
2306  case STMT_NULL_PTR:
2307  S = nullptr;
2308  break;
2309 
2310  case STMT_NULL:
2311  S = new (Context) NullStmt(Empty);
2312  break;
2313 
2314  case STMT_COMPOUND:
2316  Context, /*NumStmts=*/Record[ASTStmtReader::NumStmtFields]);
2317  break;
2318 
2319  case STMT_CASE:
2321  Context,
2322  /*CaseStmtIsGNURange*/ Record[ASTStmtReader::NumStmtFields + 3]);
2323  break;
2324 
2325  case STMT_DEFAULT:
2326  S = new (Context) DefaultStmt(Empty);
2327  break;
2328 
2329  case STMT_LABEL:
2330  S = new (Context) LabelStmt(Empty);
2331  break;
2332 
2333  case STMT_ATTRIBUTED:
2335  Context,
2336  /*NumAttrs*/Record[ASTStmtReader::NumStmtFields]);
2337  break;
2338 
2339  case STMT_IF:
2340  S = IfStmt::CreateEmpty(
2341  Context,
2342  /* HasElse=*/Record[ASTStmtReader::NumStmtFields + 1],
2343  /* HasVar=*/Record[ASTStmtReader::NumStmtFields + 2],
2344  /* HasInit=*/Record[ASTStmtReader::NumStmtFields + 3]);
2345  break;
2346 
2347  case STMT_SWITCH:
2349  Context,
2350  /* HasInit=*/Record[ASTStmtReader::NumStmtFields],
2351  /* HasVar=*/Record[ASTStmtReader::NumStmtFields + 1]);
2352  break;
2353 
2354  case STMT_WHILE:
2356  Context,
2357  /* HasVar=*/Record[ASTStmtReader::NumStmtFields]);
2358  break;
2359 
2360  case STMT_DO:
2361  S = new (Context) DoStmt(Empty);
2362  break;
2363 
2364  case STMT_FOR:
2365  S = new (Context) ForStmt(Empty);
2366  break;
2367 
2368  case STMT_GOTO:
2369  S = new (Context) GotoStmt(Empty);
2370  break;
2371 
2372  case STMT_INDIRECT_GOTO:
2373  S = new (Context) IndirectGotoStmt(Empty);
2374  break;
2375 
2376  case STMT_CONTINUE:
2377  S = new (Context) ContinueStmt(Empty);
2378  break;
2379 
2380  case STMT_BREAK:
2381  S = new (Context) BreakStmt(Empty);
2382  break;
2383 
2384  case STMT_RETURN:
2386  Context, /* HasNRVOCandidate=*/Record[ASTStmtReader::NumStmtFields]);
2387  break;
2388 
2389  case STMT_DECL:
2390  S = new (Context) DeclStmt(Empty);
2391  break;
2392 
2393  case STMT_GCCASM:
2394  S = new (Context) GCCAsmStmt(Empty);
2395  break;
2396 
2397  case STMT_MSASM:
2398  S = new (Context) MSAsmStmt(Empty);
2399  break;
2400 
2401  case STMT_CAPTURED:
2403  Context, Record[ASTStmtReader::NumStmtFields]);
2404  break;
2405 
2406  case EXPR_CONSTANT:
2407  S = new (Context) ConstantExpr(Empty);
2408  break;
2409 
2410  case EXPR_PREDEFINED:
2412  Context,
2413  /*HasFunctionName*/ Record[ASTStmtReader::NumExprFields]);
2414  break;
2415 
2416  case EXPR_DECL_REF:
2418  Context,
2419  /*HasQualifier=*/Record[ASTStmtReader::NumExprFields],
2420  /*HasFoundDecl=*/Record[ASTStmtReader::NumExprFields + 1],
2421  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields + 2],
2422  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields + 2] ?
2423  Record[ASTStmtReader::NumExprFields + 5] : 0);
2424  break;
2425 
2426  case EXPR_INTEGER_LITERAL:
2427  S = IntegerLiteral::Create(Context, Empty);
2428  break;
2429 
2430  case EXPR_FLOATING_LITERAL:
2431  S = FloatingLiteral::Create(Context, Empty);
2432  break;
2433 
2435  S = new (Context) ImaginaryLiteral(Empty);
2436  break;
2437 
2438  case EXPR_STRING_LITERAL:
2440  Context,
2441  /* NumConcatenated=*/Record[ASTStmtReader::NumExprFields],
2442  /* Length=*/Record[ASTStmtReader::NumExprFields + 1],
2443  /* CharByteWidth=*/Record[ASTStmtReader::NumExprFields + 2]);
2444  break;
2445 
2447  S = new (Context) CharacterLiteral(Empty);
2448  break;
2449 
2450  case EXPR_PAREN:
2451  S = new (Context) ParenExpr(Empty);
2452  break;
2453 
2454  case EXPR_PAREN_LIST:
2456  Context,
2457  /* NumExprs=*/Record[ASTStmtReader::NumExprFields]);
2458  break;
2459 
2460  case EXPR_UNARY_OPERATOR:
2461  S = new (Context) UnaryOperator(Empty);
2462  break;
2463 
2464  case EXPR_OFFSETOF:
2465  S = OffsetOfExpr::CreateEmpty(Context,
2466  Record[ASTStmtReader::NumExprFields],
2467  Record[ASTStmtReader::NumExprFields + 1]);
2468  break;
2469 
2470  case EXPR_SIZEOF_ALIGN_OF:
2471  S = new (Context) UnaryExprOrTypeTraitExpr(Empty);
2472  break;
2473 
2474  case EXPR_ARRAY_SUBSCRIPT:
2475  S = new (Context) ArraySubscriptExpr(Empty);
2476  break;
2477 
2479  S = new (Context) OMPArraySectionExpr(Empty);
2480  break;
2481 
2482  case EXPR_CALL:
2483  S = new (Context) CallExpr(
2484  Context, /* NumArgs=*/Record[ASTStmtReader::NumExprFields],
2485  Empty);
2486  break;
2487 
2488  case EXPR_MEMBER: {
2489  // We load everything here and fully initialize it at creation.
2490  // That way we can use MemberExpr::Create and don't have to duplicate its
2491  // logic with a MemberExpr::CreateEmpty.
2492 
2493  assert(Record.getIdx() == 0);
2494  NestedNameSpecifierLoc QualifierLoc;
2495  if (Record.readInt()) { // HasQualifier.
2496  QualifierLoc = Record.readNestedNameSpecifierLoc();
2497  }
2498 
2499  SourceLocation TemplateKWLoc;
2500  TemplateArgumentListInfo ArgInfo;
2501  bool HasTemplateKWAndArgsInfo = Record.readInt();
2502  if (HasTemplateKWAndArgsInfo) {
2503  TemplateKWLoc = Record.readSourceLocation();
2504  unsigned NumTemplateArgs = Record.readInt();
2505  ArgInfo.setLAngleLoc(Record.readSourceLocation());
2506  ArgInfo.setRAngleLoc(Record.readSourceLocation());
2507  for (unsigned i = 0; i != NumTemplateArgs; ++i)
2508  ArgInfo.addArgument(Record.readTemplateArgumentLoc());
2509  }
2510 
2511  bool HadMultipleCandidates = Record.readInt();
2512 
2513  auto *FoundD = Record.readDeclAs<NamedDecl>();
2514  auto AS = (AccessSpecifier)Record.readInt();
2515  DeclAccessPair FoundDecl = DeclAccessPair::make(FoundD, AS);
2516 
2517  QualType T = Record.readType();
2518  auto VK = static_cast<ExprValueKind>(Record.readInt());
2519  auto OK = static_cast<ExprObjectKind>(Record.readInt());
2520  Expr *Base = ReadSubExpr();
2521  auto *MemberD = Record.readDeclAs<ValueDecl>();
2522  SourceLocation MemberLoc = Record.readSourceLocation();
2523  DeclarationNameInfo MemberNameInfo(MemberD->getDeclName(), MemberLoc);
2524  bool IsArrow = Record.readInt();
2525  SourceLocation OperatorLoc = Record.readSourceLocation();
2526 
2527  S = MemberExpr::Create(Context, Base, IsArrow, OperatorLoc, QualifierLoc,
2528  TemplateKWLoc, MemberD, FoundDecl, MemberNameInfo,
2529  HasTemplateKWAndArgsInfo ? &ArgInfo : nullptr, T,
2530  VK, OK);
2531  Record.readDeclarationNameLoc(cast<MemberExpr>(S)->MemberDNLoc,
2532  MemberD->getDeclName());
2533  if (HadMultipleCandidates)
2534  cast<MemberExpr>(S)->setHadMultipleCandidates(true);
2535  break;
2536  }
2537 
2538  case EXPR_BINARY_OPERATOR:
2539  S = new (Context) BinaryOperator(Empty);
2540  break;
2541 
2543  S = new (Context) CompoundAssignOperator(Empty);
2544  break;
2545 
2547  S = new (Context) ConditionalOperator(Empty);
2548  break;
2549 
2551  S = new (Context) BinaryConditionalOperator(Empty);
2552  break;
2553 
2554  case EXPR_IMPLICIT_CAST:
2555  S = ImplicitCastExpr::CreateEmpty(Context,
2556  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
2557  break;
2558 
2559  case EXPR_CSTYLE_CAST:
2560  S = CStyleCastExpr::CreateEmpty(Context,
2561  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
2562  break;
2563 
2564  case EXPR_COMPOUND_LITERAL:
2565  S = new (Context) CompoundLiteralExpr(Empty);
2566  break;
2567 
2569  S = new (Context) ExtVectorElementExpr(Empty);
2570  break;
2571 
2572  case EXPR_INIT_LIST:
2573  S = new (Context) InitListExpr(Empty);
2574  break;
2575 
2576  case EXPR_DESIGNATED_INIT:
2577  S = DesignatedInitExpr::CreateEmpty(Context,
2578  Record[ASTStmtReader::NumExprFields] - 1);
2579 
2580  break;
2581 
2583  S = new (Context) DesignatedInitUpdateExpr(Empty);
2584  break;
2585 
2587  S = new (Context) ImplicitValueInitExpr(Empty);
2588  break;
2589 
2590  case EXPR_NO_INIT:
2591  S = new (Context) NoInitExpr(Empty);
2592  break;
2593 
2594  case EXPR_ARRAY_INIT_LOOP:
2595  S = new (Context) ArrayInitLoopExpr(Empty);
2596  break;
2597 
2598  case EXPR_ARRAY_INIT_INDEX:
2599  S = new (Context) ArrayInitIndexExpr(Empty);
2600  break;
2601 
2602  case EXPR_VA_ARG:
2603  S = new (Context) VAArgExpr(Empty);
2604  break;
2605 
2606  case EXPR_ADDR_LABEL:
2607  S = new (Context) AddrLabelExpr(Empty);
2608  break;
2609 
2610  case EXPR_STMT:
2611  S = new (Context) StmtExpr(Empty);
2612  break;
2613 
2614  case EXPR_CHOOSE:
2615  S = new (Context) ChooseExpr(Empty);
2616  break;
2617 
2618  case EXPR_GNU_NULL:
2619  S = new (Context) GNUNullExpr(Empty);
2620  break;
2621 
2622  case EXPR_SHUFFLE_VECTOR:
2623  S = new (Context) ShuffleVectorExpr(Empty);
2624  break;
2625 
2626  case EXPR_CONVERT_VECTOR:
2627  S = new (Context) ConvertVectorExpr(Empty);
2628  break;
2629 
2630  case EXPR_BLOCK:
2631  S = new (Context) BlockExpr(Empty);
2632  break;
2633 
2635  S = new (Context) GenericSelectionExpr(Empty);
2636  break;
2637 
2639  S = new (Context) ObjCStringLiteral(Empty);
2640  break;
2641 
2643  S = new (Context) ObjCBoxedExpr(Empty);
2644  break;
2645 
2647  S = ObjCArrayLiteral::CreateEmpty(Context,
2648  Record[ASTStmtReader::NumExprFields]);
2649  break;
2650 
2653  Record[ASTStmtReader::NumExprFields],
2654  Record[ASTStmtReader::NumExprFields + 1]);
2655  break;
2656 
2657  case EXPR_OBJC_ENCODE:
2658  S = new (Context) ObjCEncodeExpr(Empty);
2659  break;
2660 
2662  S = new (Context) ObjCSelectorExpr(Empty);
2663  break;
2664 
2666  S = new (Context) ObjCProtocolExpr(Empty);
2667  break;
2668 
2670  S = new (Context) ObjCIvarRefExpr(Empty);
2671  break;
2672 
2674  S = new (Context) ObjCPropertyRefExpr(Empty);
2675  break;
2676 
2678  S = new (Context) ObjCSubscriptRefExpr(Empty);
2679  break;
2680 
2682  llvm_unreachable("mismatching AST file");
2683 
2685  S = ObjCMessageExpr::CreateEmpty(Context,
2686  Record[ASTStmtReader::NumExprFields],
2687  Record[ASTStmtReader::NumExprFields + 1]);
2688  break;
2689 
2690  case EXPR_OBJC_ISA:
2691  S = new (Context) ObjCIsaExpr(Empty);
2692  break;
2693 
2695  S = new (Context) ObjCIndirectCopyRestoreExpr(Empty);
2696  break;
2697 
2699  S = new (Context) ObjCBridgedCastExpr(Empty);
2700  break;
2701 
2703  S = new (Context) ObjCForCollectionStmt(Empty);
2704  break;
2705 
2706  case STMT_OBJC_CATCH:
2707  S = new (Context) ObjCAtCatchStmt(Empty);
2708  break;
2709 
2710  case STMT_OBJC_FINALLY:
2711  S = new (Context) ObjCAtFinallyStmt(Empty);
2712  break;
2713 
2714  case STMT_OBJC_AT_TRY:
2715  S = ObjCAtTryStmt::CreateEmpty(Context,
2716  Record[ASTStmtReader::NumStmtFields],
2717  Record[ASTStmtReader::NumStmtFields + 1]);
2718  break;
2719 
2721  S = new (Context) ObjCAtSynchronizedStmt(Empty);
2722  break;
2723 
2724  case STMT_OBJC_AT_THROW:
2725  S = new (Context) ObjCAtThrowStmt(Empty);
2726  break;
2727 
2729  S = new (Context) ObjCAutoreleasePoolStmt(Empty);
2730  break;
2731 
2733  S = new (Context) ObjCBoolLiteralExpr(Empty);
2734  break;
2735 
2737  S = new (Context) ObjCAvailabilityCheckExpr(Empty);
2738  break;
2739 
2740  case STMT_SEH_LEAVE:
2741  S = new (Context) SEHLeaveStmt(Empty);
2742  break;
2743 
2744  case STMT_SEH_EXCEPT:
2745  S = new (Context) SEHExceptStmt(Empty);
2746  break;
2747 
2748  case STMT_SEH_FINALLY:
2749  S = new (Context) SEHFinallyStmt(Empty);
2750  break;
2751 
2752  case STMT_SEH_TRY:
2753  S = new (Context) SEHTryStmt(Empty);
2754  break;
2755 
2756  case STMT_CXX_CATCH:
2757  S = new (Context) CXXCatchStmt(Empty);
2758  break;
2759 
2760  case STMT_CXX_TRY:
2761  S = CXXTryStmt::Create(Context, Empty,
2762  /*NumHandlers=*/Record[ASTStmtReader::NumStmtFields]);
2763  break;
2764 
2765  case STMT_CXX_FOR_RANGE:
2766  S = new (Context) CXXForRangeStmt(Empty);
2767  break;
2768 
2770  S = new (Context) MSDependentExistsStmt(SourceLocation(), true,
2773  nullptr);
2774  break;
2775 
2777  S =
2779  Record[ASTStmtReader::NumStmtFields],
2780  Empty);
2781  break;
2782 
2783  case STMT_OMP_SIMD_DIRECTIVE: {
2784  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2785  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2786  S = OMPSimdDirective::CreateEmpty(Context, NumClauses,
2787  CollapsedNum, Empty);
2788  break;
2789  }
2790 
2791  case STMT_OMP_FOR_DIRECTIVE: {
2792  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2793  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2794  S = OMPForDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
2795  Empty);
2796  break;
2797  }
2798 
2800  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2801  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2802  S = OMPForSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
2803  Empty);
2804  break;
2805  }
2806 
2809  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2810  break;
2811 
2813  S = OMPSectionDirective::CreateEmpty(Context, Empty);
2814  break;
2815 
2818  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2819  break;
2820 
2822  S = OMPMasterDirective::CreateEmpty(Context, Empty);
2823  break;
2824 
2827  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2828  break;
2829 
2831  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2832  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2833  S = OMPParallelForDirective::CreateEmpty(Context, NumClauses,
2834  CollapsedNum, Empty);
2835  break;
2836  }
2837 
2839  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2840  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2841  S = OMPParallelForSimdDirective::CreateEmpty(Context, NumClauses,
2842  CollapsedNum, Empty);
2843  break;
2844  }
2845 
2848  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2849  break;
2850 
2853  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2854  break;
2855 
2857  S = OMPTaskyieldDirective::CreateEmpty(Context, Empty);
2858  break;
2859 
2861  S = OMPBarrierDirective::CreateEmpty(Context, Empty);
2862  break;
2863 
2865  S = OMPTaskwaitDirective::CreateEmpty(Context, 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 
2895  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2896  break;
2897 
2900  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2901  break;
2902 
2905  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2906  break;
2907 
2910  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2911  break;
2912 
2914  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2915  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2916  S = OMPTargetParallelForDirective::CreateEmpty(Context, NumClauses,
2917  CollapsedNum, Empty);
2918  break;
2919  }
2920 
2923  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2924  break;
2925 
2928  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2929  break;
2930 
2932  S = OMPCancellationPointDirective::CreateEmpty(Context, Empty);
2933  break;
2934 
2937  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2938  break;
2939 
2941  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2942  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2943  S = OMPTaskLoopDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
2944  Empty);
2945  break;
2946  }
2947 
2949  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2950  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2951  S = OMPTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
2952  CollapsedNum, Empty);
2953  break;
2954  }
2955 
2957  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2958  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2959  S = OMPDistributeDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
2960  Empty);
2961  break;
2962  }
2963 
2965  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2966  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2967  S = OMPDistributeParallelForDirective::CreateEmpty(Context, NumClauses,
2968  CollapsedNum, Empty);
2969  break;
2970  }
2971 
2973  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2974  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2976  CollapsedNum,
2977  Empty);
2978  break;
2979  }
2980 
2982  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2983  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2984  S = OMPDistributeSimdDirective::CreateEmpty(Context, NumClauses,
2985  CollapsedNum, Empty);
2986  break;
2987  }
2988 
2990  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2991  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2992  S = OMPTargetParallelForSimdDirective::CreateEmpty(Context, NumClauses,
2993  CollapsedNum, Empty);
2994  break;
2995  }
2996 
2998  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
2999  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3000  S = OMPTargetSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3001  Empty);
3002  break;
3003  }
3004 
3006  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3007  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3008  S = OMPTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
3009  CollapsedNum, Empty);
3010  break;
3011  }
3012 
3014  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3015  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3016  S = OMPTeamsDistributeSimdDirective::CreateEmpty(Context, NumClauses,
3017  CollapsedNum, Empty);
3018  break;
3019  }
3020 
3022  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3023  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3025  Context, NumClauses, CollapsedNum, Empty);
3026  break;
3027  }
3028 
3030  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3031  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3033  Context, NumClauses, CollapsedNum, Empty);
3034  break;
3035  }
3036 
3039  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3040  break;
3041 
3043  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3044  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3045  S = OMPTargetTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
3046  CollapsedNum, Empty);
3047  break;
3048  }
3049 
3051  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3052  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3054  Context, NumClauses, CollapsedNum, Empty);
3055  break;
3056  }
3057 
3059  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3060  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3062  Context, NumClauses, CollapsedNum, Empty);
3063  break;
3064  }
3065 
3067  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3068  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3070  Context, NumClauses, CollapsedNum, Empty);
3071  break;
3072  }
3073 
3075  S = new (Context) CXXOperatorCallExpr(
3076  Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields],
3077  Empty);
3078  break;
3079 
3080  case EXPR_CXX_MEMBER_CALL:
3081  S = new (Context) CXXMemberCallExpr(
3082  Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields],
3083  Empty);
3084  break;
3085 
3086  case EXPR_CXX_CONSTRUCT:
3087  S = new (Context) CXXConstructExpr(Empty);
3088  break;
3089 
3091  S = new (Context) CXXInheritedCtorInitExpr(Empty);
3092  break;
3093 
3095  S = new (Context) CXXTemporaryObjectExpr(Empty);
3096  break;
3097 
3098  case EXPR_CXX_STATIC_CAST:
3099  S = CXXStaticCastExpr::CreateEmpty(Context,
3100  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3101  break;
3102 
3103  case EXPR_CXX_DYNAMIC_CAST:
3104  S = CXXDynamicCastExpr::CreateEmpty(Context,
3105  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3106  break;
3107 
3110  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3111  break;
3112 
3113  case EXPR_CXX_CONST_CAST:
3114  S = CXXConstCastExpr::CreateEmpty(Context);
3115  break;
3116 
3119  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3120  break;
3121 
3123  S = new (Context) UserDefinedLiteral(
3124  Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], Empty);
3125  break;
3126 
3128  S = new (Context) CXXStdInitializerListExpr(Empty);
3129  break;
3130 
3131  case EXPR_CXX_BOOL_LITERAL:
3132  S = new (Context) CXXBoolLiteralExpr(Empty);
3133  break;
3134 
3136  S = new (Context) CXXNullPtrLiteralExpr(Empty);
3137  break;
3138 
3139  case EXPR_CXX_TYPEID_EXPR:
3140  S = new (Context) CXXTypeidExpr(Empty, true);
3141  break;
3142 
3143  case EXPR_CXX_TYPEID_TYPE:
3144  S = new (Context) CXXTypeidExpr(Empty, false);
3145  break;
3146 
3147  case EXPR_CXX_UUIDOF_EXPR:
3148  S = new (Context) CXXUuidofExpr(Empty, true);
3149  break;
3150 
3152  S = new (Context) MSPropertyRefExpr(Empty);
3153  break;
3154 
3156  S = new (Context) MSPropertySubscriptExpr(Empty);
3157  break;
3158 
3159  case EXPR_CXX_UUIDOF_TYPE:
3160  S = new (Context) CXXUuidofExpr(Empty, false);
3161  break;
3162 
3163  case EXPR_CXX_THIS:
3164  S = new (Context) CXXThisExpr(Empty);
3165  break;
3166 
3167  case EXPR_CXX_THROW:
3168  S = new (Context) CXXThrowExpr(Empty);
3169  break;
3170 
3171  case EXPR_CXX_DEFAULT_ARG:
3172  S = new (Context) CXXDefaultArgExpr(Empty);
3173  break;
3174 
3175  case EXPR_CXX_DEFAULT_INIT:
3176  S = new (Context) CXXDefaultInitExpr(Empty);
3177  break;
3178 
3180  S = new (Context) CXXBindTemporaryExpr(Empty);
3181  break;
3182 
3184  S = new (Context) CXXScalarValueInitExpr(Empty);
3185  break;
3186 
3187  case EXPR_CXX_NEW:
3188  S = new (Context) CXXNewExpr(Empty);
3189  break;
3190 
3191  case EXPR_CXX_DELETE:
3192  S = new (Context) CXXDeleteExpr(Empty);
3193  break;
3194 
3196  S = new (Context) CXXPseudoDestructorExpr(Empty);
3197  break;
3198 
3200  S = ExprWithCleanups::Create(Context, Empty,
3201  Record[ASTStmtReader::NumExprFields]);
3202  break;
3203 
3206  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields],
3207  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]
3208  ? Record[ASTStmtReader::NumExprFields + 1]
3209  : 0);
3210  break;
3211 
3214  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields],
3215  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]
3216  ? Record[ASTStmtReader::NumExprFields + 1]
3217  : 0);
3218  break;
3219 
3222  /*NumArgs=*/Record[ASTStmtReader::NumExprFields]);
3223  break;
3224 
3227  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields],
3228  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]
3229  ? Record[ASTStmtReader::NumExprFields + 1]
3230  : 0);
3231  break;
3232 
3235  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields],
3236  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]
3237  ? Record[ASTStmtReader::NumExprFields + 1]
3238  : 0);
3239  break;
3240 
3241  case EXPR_TYPE_TRAIT:
3243  Record[ASTStmtReader::NumExprFields]);
3244  break;
3245 
3246  case EXPR_ARRAY_TYPE_TRAIT:
3247  S = new (Context) ArrayTypeTraitExpr(Empty);
3248  break;
3249 
3251  S = new (Context) ExpressionTraitExpr(Empty);
3252  break;
3253 
3254  case EXPR_CXX_NOEXCEPT:
3255  S = new (Context) CXXNoexceptExpr(Empty);
3256  break;
3257 
3258  case EXPR_PACK_EXPANSION:
3259  S = new (Context) PackExpansionExpr(Empty);
3260  break;
3261 
3262  case EXPR_SIZEOF_PACK:
3264  Context,
3265  /*NumPartialArgs=*/Record[ASTStmtReader::NumExprFields]);
3266  break;
3267 
3269  S = new (Context) SubstNonTypeTemplateParmExpr(Empty);
3270  break;
3271 
3273  S = new (Context) SubstNonTypeTemplateParmPackExpr(Empty);
3274  break;
3275 
3278  Record[ASTStmtReader::NumExprFields]);
3279  break;
3280 
3282  S = new (Context) MaterializeTemporaryExpr(Empty);
3283  break;
3284 
3285  case EXPR_CXX_FOLD:
3286  S = new (Context) CXXFoldExpr(Empty);
3287  break;
3288 
3289  case EXPR_OPAQUE_VALUE:
3290  S = new (Context) OpaqueValueExpr(Empty);
3291  break;
3292 
3293  case EXPR_CUDA_KERNEL_CALL:
3294  S = new (Context) CUDAKernelCallExpr(
3295  Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], Empty);
3296  break;
3297 
3298  case EXPR_ASTYPE:
3299  S = new (Context) AsTypeExpr(Empty);
3300  break;
3301 
3302  case EXPR_PSEUDO_OBJECT: {
3303  unsigned numSemanticExprs = Record[ASTStmtReader::NumExprFields];
3304  S = PseudoObjectExpr::Create(Context, Empty, numSemanticExprs);
3305  break;
3306  }
3307 
3308  case EXPR_ATOMIC:
3309  S = new (Context) AtomicExpr(Empty);
3310  break;
3311 
3312  case EXPR_LAMBDA: {
3313  unsigned NumCaptures = Record[ASTStmtReader::NumExprFields];
3314  S = LambdaExpr::CreateDeserialized(Context, NumCaptures);
3315  break;
3316  }
3317 
3318  case STMT_COROUTINE_BODY: {
3319  unsigned NumParams = Record[ASTStmtReader::NumStmtFields];
3320  S = CoroutineBodyStmt::Create(Context, Empty, NumParams);
3321  break;
3322  }
3323 
3324  case STMT_CORETURN:
3325  S = new (Context) CoreturnStmt(Empty);
3326  break;
3327 
3328  case EXPR_COAWAIT:
3329  S = new (Context) CoawaitExpr(Empty);
3330  break;
3331 
3332  case EXPR_COYIELD:
3333  S = new (Context) CoyieldExpr(Empty);
3334  break;
3335 
3337  S = new (Context) DependentCoawaitExpr(Empty);
3338  break;
3339  }
3340 
3341  // We hit a STMT_STOP, so we're done with this expression.
3342  if (Finished)
3343  break;
3344 
3345  ++NumStatementsRead;
3346 
3347  if (S && !IsStmtReference) {
3348  Reader.Visit(S);
3349  StmtEntries[Cursor.GetCurrentBitNo()] = S;
3350  }
3351 
3352  assert(Record.getIdx() == Record.size() &&
3353  "Invalid deserialization of statement");
3354  StmtStack.push_back(S);
3355  }
3356 Done:
3357  assert(StmtStack.size() > PrevNumStmts && "Read too many sub-stmts!");
3358  assert(StmtStack.size() == PrevNumStmts + 1 && "Extra expressions on stack!");
3359  return StmtStack.pop_back_val();
3360 }
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:361
void setFPFeatures(FPOptions F)
Definition: Expr.h:3403
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:1900
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:4440
void setConditionVariable(const ASTContext &C, VarDecl *V)
Definition: Stmt.cpp:910
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:1528
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:591
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:2455
Represents a &#39;co_await&#39; expression while the type of the promise is dependent.
Definition: ExprCXX.h:4346
void setSubStmt(CompoundStmt *S)
Definition: Expr.h:3765
The receiver is an object instance.
Definition: ExprObjC.h:1055
unsigned getNumInputs() const
Definition: Stmt.h:2371
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:3059
StringKind getKind() const
Definition: Expr.h:1692
An AddrLabelExpr record.
Definition: ASTBitCodes.h:1719
void setInc(Expr *E)
Definition: StmtCXX.h:190
void setOperatorLoc(SourceLocation L)
Definition: Expr.h:2301
CXXDeleteExprBitfields CXXDeleteExprBits
Definition: Stmt.h:720
void setRawSemantics(APFloatSemantics Sem)
Set the raw enumeration value representing the floating-point semantics of this literal (32-bit IEEE...
Definition: Expr.h:1486
void setNRVOCandidate(const VarDecl *Var)
Set the variable that might be used for the named return value optimization.
Definition: Stmt.h:2273
Defines enumerations for the type traits support.
void setLocation(SourceLocation L)
Definition: ExprCXX.h:576
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:2355
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:2364
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:2468
IfStmt - This represents an if/then/else.
Definition: Stmt.h:1467
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:2349
This represents &#39;#pragma omp for simd&#39; directive.
Definition: StmtOpenMP.h:1181
void setOpcode(Opcode Opc)
Definition: Expr.h:3271
void setRParenLoc(SourceLocation L)
Definition: Stmt.h:2477
void setContinueLoc(SourceLocation L)
Definition: Stmt.h:2174
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:943
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:4804
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:2748
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:4611
Represents an attribute applied to a statement.
Definition: Stmt.h:1413
void setUpperBoundVariable(Expr *UB)
Definition: StmtOpenMP.h:513
void setComputationResultType(QualType T)
Definition: Expr.h:3477
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:1855
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:698
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1257
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:803
unsigned NumOutputs
Definition: Stmt.h:2314
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent...
Definition: ExprCXX.h:2439
void setValue(bool V)
Definition: ExprObjC.h:95
A constant expression context.
Definition: ASTBitCodes.h:1626
const TargetInfo & getTargetInfo() const
Definition: ASTContext.h:689
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:1797
Stmt * SubExpr
Definition: Expr.h:879
void setCanOverflow(bool C)
Definition: Expr.h:1951
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:823
void setStartLoc(SourceLocation L)
Definition: Stmt.h:945
void setForLoc(SourceLocation L)
Definition: Stmt.h:2064
This represents &#39;#pragma omp target teams distribute parallel for&#39; combined directive.
Definition: StmtOpenMP.h:3864
void setLocation(SourceLocation Loc)
Definition: ExprCXX.h:1323
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:4047
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:3144
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:1396
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:1172
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:3076
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:2844
void setSubExpr(unsigned Idx, Expr *E)
Definition: Expr.h:4618
void setInitializer(Expr *E)
Definition: Expr.h:2872
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:2404
static FunctionParmPackExpr * CreateEmpty(const ASTContext &Context, unsigned NumParams)
Definition: ExprCXX.cpp:1378
void setAsmLoc(SourceLocation L)
Definition: Stmt.h:2331
static DependentScopeDeclRefExpr * CreateEmpty(const ASTContext &C, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition: ExprCXX.cpp:437
AttributedStmtBitfields AttributedStmtBits
Definition: Stmt.h:683
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:1441
void setLocation(SourceLocation Location)
Definition: Expr.h:1386
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:619
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:4596
Defines the Objective-C statement AST node classes.
A CXXConstructExpr record.
Definition: ASTBitCodes.h:1832
unsigned getNumExpressions() const
Definition: Expr.h:2206
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:2064
void initializeResults(const ASTContext &C, UnresolvedSetIterator Begin, UnresolvedSetIterator End)
Definition: ExprCXX.cpp:366
A C++ throw-expression (C++ [except.throw]).
Definition: ExprCXX.h:1010
Represents an expression – generally a full-expression – that introduces cleanups to be run at the ...
Definition: ExprCXX.h:3012
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:1559
void setTarget(Expr *E)
Definition: Stmt.h:2143
A ShuffleVectorExpr record.
Definition: ASTBitCodes.h:1731
A C++ static_cast expression (C++ [expr.static.cast]).
Definition: ExprCXX.h:307
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:1373
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 setAtLoc(SourceLocation L)
Definition: ExprObjC.h:68
Represents a C99 designated initializer expression.
Definition: Expr.h:4365
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
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:3792
void setExprOperand(Expr *E)
Definition: ExprCXX.h:933
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:2360
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:4061
Represents a place-holder for an object not to be initialized by anything.
Definition: Expr.h:4659
void setRequiresZeroInitialization(bool ZeroInit)
Definition: ExprCXX.h:1348
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:4003
void setArg(unsigned I, Expr *E)
Definition: ExprCXX.h:3182
void setArg(unsigned Arg, Expr *ArgExpr)
setArg - Set the specified argument.
Definition: Expr.h:2490
void setRParen(SourceLocation Loc)
Definition: Expr.h:1884
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:1274
void setReturnLoc(SourceLocation L)
Definition: Stmt.h:2280
Represents a C++ member access expression for which lookup produced a set of overloaded functions...
Definition: ExprCXX.h:3450
Defines some OpenMP-specific enums and functions.
void setCond(Expr *Cond)
Definition: Stmt.h:1734
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:5062
OpenMPDirectiveKind getDirectiveKind() const
Definition: StmtOpenMP.h:244
void setIfLoc(SourceLocation IfLoc)
Definition: Stmt.h:1627
This represents &#39;#pragma omp barrier&#39; directive.
Definition: StmtOpenMP.h:1883
void setComponent(unsigned Idx, OffsetOfNode ON)
Definition: Expr.h:2182
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
unsigned getCharByteWidth() const
Definition: Expr.h:1690
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:3905
void setSubStmt(Stmt *S)
Definition: Stmt.h:1298
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:3773
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:895
Represents Objective-C&#39;s @catch statement.
Definition: StmtObjC.h:74
void setLBraceLoc(SourceLocation Loc)
Definition: Expr.h:4277
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:2119
Describes an C or C++ initializer list.
Definition: Expr.h:4131
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition: ExprCXX.h:664
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:1304
This represents &#39;#pragma omp teams distribute parallel for simd&#39; composite directive.
Definition: StmtOpenMP.h:3588
void setBuiltinLoc(SourceLocation L)
Definition: Expr.h:3811
BinaryOperatorKind
void setSubExpr(Expr *E)
Definition: Expr.h:1873
void setLHS(Expr *E)
Definition: Expr.h:3971
unsigned getLength() const
Definition: Expr.h:1689
ForStmt - This represents a &#39;for (init;cond;inc)&#39; stmt.
Definition: Stmt.h:2017
void setOperatorNew(FunctionDecl *D)
Definition: ExprCXX.h:1969
static DeclAccessPair make(NamedDecl *D, AccessSpecifier AS)
void setLocation(SourceLocation L)
Definition: ExprCXX.h:606
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:947
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
Definition: ExprCXX.h:1751
path_iterator path_begin()
Definition: Expr.h:3006
void setLocation(SourceLocation L)
Definition: ExprObjC.h:101
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3233
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:5085
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:2483
ObjCStringLiteral, used for Objective-C string literals i.e.
Definition: ExprObjC.h:51
CaseStmt - Represent a case statement.
Definition: Stmt.h:1174
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
Definition: Expr.h:5508
void setCombinedInit(Expr *CombInit)
Definition: StmtOpenMP.h:590
void setListInitialization(bool V)
Definition: ExprCXX.h:1336
void setLHS(Expr *Val)
Definition: Stmt.h:1271
This represents &#39;#pragma omp teams&#39; directive.
Definition: StmtOpenMP.h:2661
void setOperatorLoc(SourceLocation L)
Definition: Expr.h:2164
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:2917
Helper class for OffsetOfExpr.
Definition: Expr.h:2024
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:1757
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:1212
void setDestroyedType(IdentifierInfo *II, SourceLocation Loc)
Set the name of destroyed type for a dependent pseudo-destructor expression.
Definition: ExprCXX.h:2325
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:1606
static OMPTaskyieldDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:491
void setCond(Expr *E)
Definition: Stmt.h:2059
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 setOpcode(Opcode Opc)
Definition: Expr.h:1935
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:3213
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:2168
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1068
bool isTypeOperand() const
Definition: ExprCXX.h:911
const uint64_t & peekInt()
Returns the current value in this record, without advancing.
Definition: ASTReader.h:2404
void setSourceRange(SourceRange R)
Definition: ExprCXX.h:944
unsigned NumClobbers
Definition: Stmt.h:2316
void setRParenLoc(SourceLocation L)
Definition: Expr.h:3200
Represents the this expression in C++.
Definition: ExprCXX.h:971
void setCastKind(CastKind K)
Definition: Expr.h:2977
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:697
void setEqualOrColonLoc(SourceLocation L)
Definition: Expr.h:4591
This represents &#39;#pragma omp target parallel for simd&#39; directive.
Definition: StmtOpenMP.h:3316
void setArgument(Expr *E)
Definition: Expr.h:2285
OpenMP 4.0 [2.4, Array Sections].
Definition: ExprOpenMP.h:45
void setTypeSourceInfo(TypeSourceInfo *tsi)
Definition: Expr.h:2173
ConditionalOperator - The ?: ternary operator.
Definition: Expr.h:3528
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:2211
void setAmpAmpLoc(SourceLocation L)
Definition: Expr.h:3718
void setBreakLoc(SourceLocation L)
Definition: Stmt.h:2200
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
Definition: ExprCXX.h:3586
void setFPFeatures(FPOptions F)
Definition: ExprCXX.h:147
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:1021
void setBlockDecl(BlockDecl *BD)
Definition: Expr.h:5139
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:1002
void setSubExpr(Expr *E)
Definition: Expr.h:1938
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
Definition: Expr.h:2233
void setLParen(SourceLocation Loc)
Definition: Expr.h:1880
ConstantExpr - An expression that occurs in a constant context.
Definition: Expr.h:904
for(unsigned I=0, E=TL.getNumArgs();I !=E;++I)
Represents a call to the builtin function __builtin_va_arg.
Definition: Expr.h:4037
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:2861
void setConditionVariable(const ASTContext &Ctx, VarDecl *V)
Set the condition variable for this if statement.
Definition: Stmt.cpp:871
This represents &#39;#pragma omp distribute&#39; directive.
Definition: StmtOpenMP.h:2972
void setInits(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:39
void setOperatorDelete(FunctionDecl *D)
Definition: ExprCXX.h:1971
void setRParenLoc(SourceLocation L)
Definition: Stmt.h:1999
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type...
Definition: ExprCXX.h:1828
void setLocation(SourceLocation Location)
Definition: Expr.h:1439
void setRParenLoc(SourceLocation Loc)
Definition: StmtObjC.h:105
Pepresents a block literal declaration, which is like an unnamed FunctionDecl.
Definition: Decl.h:3867
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:3889
void setRBraceLoc(SourceLocation Loc)
Definition: Expr.h:4279
void setInit(Stmt *Init)
Definition: Stmt.h:1620
void setIsImplicit(bool value=true)
Definition: ExprCXX.h:4337
SourceLocation End
void setWhileLoc(SourceLocation L)
Definition: Stmt.h:1945
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
Definition: Specifiers.h:107
void setCallee(Expr *F)
Definition: Expr.h:2453
void setRParenLoc(SourceLocation L)
Definition: Expr.h:3814
void setLParenLoc(SourceLocation L)
Definition: Stmt.h:2066
void setBase(Expr *Base)
Definition: Expr.h:4715
Stmt * ReadStmt(ModuleFile &F)
Reads a statement.
void setSyntacticForm(InitListExpr *Init)
Definition: Expr.h:4292
Represents a C++ functional cast expression that builds a temporary object.
Definition: ExprCXX.h:1556
static ReturnStmt * CreateEmpty(const ASTContext &Ctx, bool HasNRVOCandidate)
Create an empty return statement, optionally with storage for an NRVO candidate.
Definition: Stmt.cpp:1072
void setRBracketLoc(SourceLocation L)
Definition: ExprOpenMP.h:113
A C++ const_cast expression (C++ [expr.const.cast]).
Definition: ExprCXX.h:440
void setTypeDependent(bool TD)
Set whether this expression is type-dependent or not.
Definition: Expr.h:170
void setTypeOperandSourceInfo(TypeSourceInfo *TSI)
Definition: ExprCXX.h:923
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:5123
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:3276
void setInc(Expr *E)
Definition: Stmt.h:2060
raw_arg_iterator raw_arg_end()
Definition: ExprCXX.h:2065
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:938
void setWrittenTypeInfo(TypeSourceInfo *TI)
Definition: Expr.h:4064
void setRetValue(Expr *E)
Definition: Stmt.h:2258
void setBody(Stmt *S)
Definition: Stmt.h:2061
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
Definition: ExprObjC.h:288
ExprBitfields ExprBits
Definition: Stmt.h:696
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:1140
void setBody(Stmt *Body)
Definition: Stmt.h:1743
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:3735
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:5172
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
CXXDefaultInitExprBitfields CXXDefaultInitExprBits
Definition: Stmt.h:719
Information about a module that has been loaded by the ASTReader.
Definition: Module.h:108
ExprWithCleanupsBitfields ExprWithCleanupsBits
Definition: Stmt.h:722
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:681
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
StringLiteralBitfields StringLiteralBits
Definition: Stmt.h:700
void setRParenLoc(SourceLocation L)
Definition: ExprObjC.h:497
Represents a folding of a pack over an operator.
Definition: ExprCXX.h:4157
void setEndStmt(Stmt *S)
Definition: StmtCXX.h:188
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
Definition: Stmt.h:2223
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:1909
This represents a Microsoft inline-assembly statement extension.
Definition: Stmt.h:2630
void setColonLoc(SourceLocation L)
Definition: Stmt.h:1156
void setIsArrow(bool A)
Definition: ExprObjC.h:553
void setRParenLoc(SourceLocation L)
Definition: Expr.h:3979
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:1907
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:754
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:3849
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:1125
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:1028
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:3165
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:1528
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:4070
void setAtTryLoc(SourceLocation Loc)
Definition: StmtObjC.h:194
DoStmt - This represents a &#39;do/while&#39; stmt.
Definition: Stmt.h:1965
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
Definition: Stmt.h:2300
void setTypeOperandSourceInfo(TypeSourceInfo *TSI)
Definition: ExprCXX.h:716
void setBody(Stmt *S)
Definition: StmtCXX.h:192
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:972
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:1526
void setTypeSourceInfo(TypeSourceInfo *tinfo)
Definition: Expr.h:2883
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Definition: ExprCXX.h:348
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
Definition: Expr.h:945
void setComputationLHSType(QualType T)
Definition: Expr.h:3474
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition: Expr.h:3860
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:1391
Kind
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr...
Definition: ExprCXX.h:2560
A field in a dependent type, known only by its name.
Definition: Expr.h:2033
This captures a statement into a function.
Definition: Stmt.h:2885
Represents a call to an inherited base class constructor from an inheriting constructor.
Definition: ExprCXX.h:1418
unsigned path_size() const
Definition: Expr.h:3001
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition: Expr.h:5245
void setLParenLoc(SourceLocation L)
Definition: Expr.h:3197
void setSubStmt(Stmt *S)
Definition: Stmt.h:1337
void setElidable(bool E)
Definition: ExprCXX.h:1327
void setAccessorLoc(SourceLocation L)
Definition: Expr.h:5088
void setGotoLoc(SourceLocation L)
Definition: Stmt.h:2134
static CXXDynamicCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
Definition: ExprCXX.cpp:603
CXXTemporary * readCXXTemporary()
Definition: ASTReader.h:2593
unsigned getNumExprs() const
Return the number of expressions in this paren list.
Definition: Expr.h:4891
void setHadMultipleCandidates(bool V)
Definition: ExprCXX.h:1332
void setLocation(SourceLocation L)
Definition: Expr.h:1134
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:1822
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:711
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:4720
CXXThrowExprBitfields CXXThrowExprBits
Definition: Stmt.h:717
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:1182
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:1995
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:1868
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:482
void setSourceRange(SourceRange R)
Definition: ExprCXX.h:734
static ObjCAtTryStmt * CreateEmpty(const ASTContext &Context, unsigned NumCatchStmts, bool HasFinally)
Definition: StmtObjC.cpp:58
void setConstexpr(bool C)
Definition: Stmt.h:1641
Represents a call to a member function that may be written either with member call syntax (e...
Definition: ExprCXX.h:166
static StringLiteral * CreateEmpty(const ASTContext &Ctx, unsigned NumConcatenated, unsigned Length, unsigned CharByteWidth)
Construct an empty string literal.
Definition: Expr.cpp:980
void setIdentLoc(SourceLocation L)
Definition: Stmt.h:1388
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:923
void setInit(Stmt *S)
Definition: StmtCXX.h:184
void setLabelLoc(SourceLocation L)
Definition: Expr.h:3720
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:1233
static ExprWithCleanups * Create(const ASTContext &C, EmptyShell empty, unsigned numObjects)
Definition: ExprCXX.cpp:1069
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:1816
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:183
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:3274
void setConfig(CallExpr *E)
Sets the kernel configuration expression.
Definition: ExprCXX.h:230
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:5379
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:1982
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:1014
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:1127
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:3051
Stmt * getCapturedStmt()
Retrieve the statement being captured.
Definition: Stmt.h:2986
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:1237
static DesignatedInitExpr * CreateEmpty(const ASTContext &C, unsigned NumIndexExprs)
Definition: Expr.cpp:3882
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:680
An expression trait intrinsic.
Definition: ExprCXX.h:2505
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:3747
void setCond(Expr *E)
Definition: StmtCXX.h:189
static SizeOfPackExpr * CreateDeserialized(ASTContext &Context, unsigned NumPartialArgs)
Definition: ExprCXX.cpp:1335
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:4057
void setLAngleLoc(SourceLocation Loc)
Definition: TemplateBase.h:571
void sawArrayRangeDesignator(bool ARD=true)
Definition: Expr.h:4302
void addArgument(const TemplateArgumentLoc &Loc)
Definition: TemplateBase.h:592
void setCapturedRecordDecl(RecordDecl *D)
Set the record declaration for captured variables.
Definition: Stmt.h:3006
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:1475
A placeholder type used to construct an empty shell of a type, that will be filled in later (e...
Definition: Stmt.h:756
void setSimple(bool V)
Definition: Stmt.h:2334
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:2866
void setRBracketLoc(SourceLocation L)
Definition: ExprCXX.h:862
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:3450
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:4956
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition: Expr.h:3703
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:3969
Represents a template argument.
Definition: TemplateBase.h:51
void setGotoLoc(SourceLocation L)
Definition: Stmt.h:2101
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:1505
NullStmt - This is the null statement ";": C99 6.8.3p3.
Definition: Stmt.h:990
void setCounters(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:26
bool isTypeOperand() const
Definition: ExprCXX.h:704
unsigned getNumAssocs() const
Definition: Expr.h:4983
Dataflow Directional Tag Classes.
void setExtendingDecl(const ValueDecl *ExtendedBy, unsigned ManglingNumber)
Definition: ExprCXX.cpp:1384
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:3976
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:1769
UnaryOperatorKind
void setValue(bool V)
Definition: ExprCXX.h:570
A CXXBoolLiteralExpr record.
Definition: ASTBitCodes.h:1862
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
Definition: ExprCXX.h:2095
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:2556
static CapturedStmt * CreateDeserialized(const ASTContext &Context, unsigned NumCaptures)
Definition: Stmt.cpp:1247
An ExtVectorElementExpr record.
Definition: ASTBitCodes.h:1692
void setLabel(LabelDecl *L)
Definition: Expr.h:3726
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:3150
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:1006
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:1542
void setExprs(const ASTContext &C, ArrayRef< Expr *> Exprs)
Definition: Expr.cpp:3733
void setSubExpr(Expr *E)
Definition: Expr.h:2984
void setCollection(Expr *E)
Definition: StmtObjC.h:48
void setDecl(ObjCIvarDecl *d)
Definition: ExprObjC.h:545
void setFileScope(bool FS)
Definition: Expr.h:2875
void setExact(bool E)
Definition: Expr.h:1497
A runtime availability query.
Definition: ExprObjC.h:1641
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
Definition: ExprCXX.h:395
This represents &#39;#pragma omp simd&#39; directive.
Definition: StmtOpenMP.h:1039
void setConstructionKind(ConstructionKind CK)
Definition: ExprCXX.h:1357
Represents a &#39;co_yield&#39; expression.
Definition: ExprCXX.h:4393
An ObjCAutoreleasePoolStmt record.
Definition: ASTBitCodes.h:1806
The name of a declaration.
StmtClass getStmtClass() const
Definition: Stmt.h:809
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition: ExprCXX.h:3663
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:965
static PseudoObjectExpr * Create(const ASTContext &Context, Expr *syntactic, ArrayRef< Expr *> semantic, unsigned resultIndex)
Definition: Expr.cpp:4055
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:1256
Kind
The kind of offsetof node we have.
Definition: Expr.h:2027
TemplateArgumentLoc readTemplateArgumentLoc()
Reads a TemplateArgumentLoc, advancing Idx.
Definition: ASTReader.h:2472
void setLParenLoc(SourceLocation L)
Definition: Expr.h:3771
void setSelector(Selector S)
Definition: ExprObjC.h:1298
ExplicitCastExpr - An explicit cast written in the source code.
Definition: Expr.h:3131
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:339
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:993
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:2850
unsigned getCollapsedNumber() const
Get number of collapsed loops.
Definition: StmtOpenMP.h:783
unsigned getNumSubExprs() const
Definition: Expr.h:5444
void setRBracketLoc(SourceLocation L)
Definition: Expr.h:2380
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition: ExprCXX.h:3611
SwitchStmt - This represents a &#39;switch&#39; stmt.
Definition: Stmt.h:1666
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:3598
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:2323
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:1287
An ObjCAtSynchronizedStmt record.
Definition: ASTBitCodes.h:1800
unsigned getNumObjects() const
Definition: ExprCXX.h:3043
void setIndexExpr(unsigned Idx, Expr *E)
Definition: Expr.h:2201
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:386
void setVolatile(bool V)
Definition: Stmt.h:2337
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:2036
static UnresolvedMemberExpr * CreateEmpty(const ASTContext &C, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition: ExprCXX.cpp:1279
Represents a call to a CUDA kernel function.
Definition: ExprCXX.h:206
Represents a &#39;co_await&#39; expression.
Definition: ExprCXX.h:4310
TypeTraitExprBitfields TypeTraitExprBits
Definition: Stmt.h:721
static ImplicitCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
Definition: Expr.cpp:1811
void setSwitchLoc(SourceLocation L)
Definition: Stmt.h:1800
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:1393
void setKind(UnaryExprOrTypeTrait K)
Definition: Expr.h:2267
void setRParenLoc(SourceLocation L)
Definition: Expr.h:2304
void setRHS(Expr *E)
Definition: Expr.h:3973
void setOperatorLoc(SourceLocation L)
Definition: Expr.h:3266
void setBody(Stmt *Body)
Definition: Stmt.h:1992
void setValue(const ASTContext &C, const llvm::APFloat &Val)
Definition: Expr.h:1473
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:2878
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:2381
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:3823
void setElseLoc(SourceLocation ElseLoc)
Definition: Stmt.h:1634
void setOperatorLoc(SourceLocation L)
Definition: Expr.h:1942
void setLocation(SourceLocation Location)
Definition: Expr.h:1347
A ConvertVectorExpr record.
Definition: ASTBitCodes.h:1734
unsigned arg_size() const
Retrieve the number of arguments.
Definition: ExprCXX.h:3152
void setStarLoc(SourceLocation L)
Definition: Stmt.h:2136
void setLParenLoc(SourceLocation L)
Definition: ExprCXX.h:3139
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:3092
GotoStmt - This represents a direct goto.
Definition: Stmt.h:2084
A use of a default initializer in a constructor or in aggregate initialization.
Definition: ExprCXX.h:1132
static CStyleCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
Definition: Expr.cpp:1837
void setLocation(SourceLocation L)
Definition: ExprCXX.h:987
void setCond(Expr *Cond)
Definition: Stmt.h:1988
static UnresolvedLookupExpr * CreateEmpty(const ASTContext &C, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition: ExprCXX.cpp:285
CapturedDecl * getCapturedDecl()
Retrieve the outlined function declaration.
Definition: Stmt.cpp:1265
void setBuiltinLoc(SourceLocation L)
Definition: Expr.h:4067
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:2601
GNU array range designator.
Definition: ASTBitCodes.h:1994
void setBase(Expr *E)
Definition: Expr.h:5082
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:2164
static CXXStaticCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
Definition: ExprCXX.cpp:574
Represents a loop initializing the elements of an array.
Definition: Expr.h:4749
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:3923
static OMPParallelSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:449
CXXDefaultArgExprBitfields CXXDefaultArgExprBits
Definition: Stmt.h:718
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Definition: Expr.h:3601
CXXCatchStmt - This represents a C++ catch block.
Definition: StmtCXX.h:29
An index into an array.
Definition: Expr.h:2029
static CXXUnresolvedConstructExpr * CreateEmpty(const ASTContext &C, unsigned NumArgs)
Definition: ExprCXX.cpp:1113
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr.type.conv]).
Definition: ExprCXX.h:1489
An ObjCAtCatchStmt record.
Definition: ASTBitCodes.h:1791
static TypeTraitExpr * CreateDeserialized(const ASTContext &C, unsigned NumArgs)
Definition: ExprCXX.cpp:1441
Expr * ReadSubExpr()
Reads a sub-expression operand during statement reading.
WhileStmt - This represents a &#39;while&#39; stmt.
Definition: Stmt.h:1843
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:855
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:1719
static ParenListExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumExprs)
Create an empty paren list.
Definition: Expr.cpp:4023
A CXXInheritedCtorInitExpr record.
Definition: ASTBitCodes.h:1835
void setExprOperand(Expr *E)
Definition: ExprCXX.h:726
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:1573
This represents &#39;#pragma omp taskloop simd&#39; directive.
Definition: StmtOpenMP.h:2906
void setTokenLocation(SourceLocation L)
Definition: Expr.h:4018
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:1577
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2407
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:43
void setRParenLoc(SourceLocation L)
Definition: Stmt.h:2068
void reserveInits(const ASTContext &C, unsigned NumInits)
Reserve space for some number of initializers.
Definition: Expr.cpp:1973
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:251
This represents &#39;#pragma omp sections&#39; directive.
Definition: StmtOpenMP.h:1246
void setNextSwitchCase(SwitchCase *SC)
Definition: Stmt.h:1151
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition: ExprObjC.h:82
unsigned getNumComponents() const
Definition: Expr.h:2187
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:1763
capture_range captures()
Definition: Stmt.h:3020
void setKind(CharacterKind kind)
Definition: Expr.h:1440
A reference to a declared variable, function, enum, etc.
Definition: Expr.h:1042
static CaseStmt * CreateEmpty(const ASTContext &Ctx, bool CaseStmtIsGNURange)
Build an empty case statement.
Definition: Stmt.cpp:1091
Designator - A designator in a C99 designated initializer.
Definition: Designator.h:37
void setLabel(LabelDecl *D)
Definition: Stmt.h:2098
Token readToken()
Reads a token out of a record, advancing Idx.
Definition: ASTReader.h:2648
BreakStmt - This represents a break.
Definition: Stmt.h:2190
void setSubStmt(Stmt *SS)
Definition: Stmt.h:1397
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:1380
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:957
A trivial tuple used to represent a source range.
void setInit(Stmt *S)
Definition: Stmt.h:2058
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:2315
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:557
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type, member-designator).
Definition: Expr.h:2128
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:882
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:1343
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:3069
Represents Objective-C&#39;s @autoreleasepool Statement.
Definition: StmtObjC.h:345
void setWhileLoc(SourceLocation L)
Definition: Stmt.h:1997
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:4839
void setKeywordLoc(SourceLocation L)
Definition: Stmt.h:1154
void setCapturedRegionKind(CapturedRegionKind Kind)
Set the captured region kind.
Definition: Stmt.cpp:1285
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:4481
void setCond(Expr *Cond)
Definition: Stmt.h:1550
static OMPCancellationPointDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:563
void setLabelLoc(SourceLocation L)
Definition: Stmt.h:2103
#define BLOCK(DERIVED, BASE)
Definition: Template.h:470
void setCond(Expr *E)
Definition: Expr.h:3969
void setAtLoc(SourceLocation Loc)
Definition: StmtObjC.h:366
void setIsConditionTrue(bool isTrue)
Definition: Expr.h:3956
OMPClause * readClause()
This represents &#39;#pragma omp taskloop&#39; directive.
Definition: StmtOpenMP.h:2841