clang  10.0.0git
ASTReaderStmt.cpp
Go to the documentation of this file.
1 //===- ASTReaderStmt.cpp - Stmt/Expr Deserialization ----------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Statement/expression deserialization. This implements the
10 // ASTReader::ReadStmt method.
11 //
12 //===----------------------------------------------------------------------===//
13 
15 #include "clang/AST/ASTConcept.h"
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/Bitstream/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  ASTRecordReader &Record;
71  llvm::BitstreamCursor &DeclsCursor;
72 
73  SourceLocation readSourceLocation() {
74  return Record.readSourceLocation();
75  }
76 
77  SourceRange readSourceRange() {
78  return Record.readSourceRange();
79  }
80 
81  std::string readString() {
82  return Record.readString();
83  }
84 
85  TypeSourceInfo *readTypeSourceInfo() {
86  return Record.readTypeSourceInfo();
87  }
88 
89  Decl *readDecl() {
90  return Record.readDecl();
91  }
92 
93  template<typename T>
94  T *readDeclAs() {
95  return Record.readDeclAs<T>();
96  }
97 
98  public:
99  ASTStmtReader(ASTRecordReader &Record, llvm::BitstreamCursor &Cursor)
100  : Record(Record), DeclsCursor(Cursor) {}
101 
102  /// The number of record fields required for the Stmt class
103  /// itself.
104  static const unsigned NumStmtFields = 1;
105 
106  /// The number of record fields required for the Expr class
107  /// itself.
108  static const unsigned NumExprFields = NumStmtFields + 7;
109 
110  /// Read and initialize a ExplicitTemplateArgumentList structure.
111  void ReadTemplateKWAndArgsInfo(ASTTemplateKWAndArgsInfo &Args,
112  TemplateArgumentLoc *ArgsLocArray,
113  unsigned NumTemplateArgs);
114 
115  /// Read and initialize a ExplicitTemplateArgumentList structure.
116  void ReadExplicitTemplateArgumentList(ASTTemplateArgumentListInfo &ArgList,
117  unsigned NumTemplateArgs);
118 
119  void VisitStmt(Stmt *S);
120 #define STMT(Type, Base) \
121  void Visit##Type(Type *);
122 #include "clang/AST/StmtNodes.inc"
123  };
124 
125 } // namespace clang
126 
128  TemplateArgumentLoc *ArgsLocArray,
129  unsigned NumTemplateArgs) {
130  SourceLocation TemplateKWLoc = readSourceLocation();
131  TemplateArgumentListInfo ArgInfo;
132  ArgInfo.setLAngleLoc(readSourceLocation());
133  ArgInfo.setRAngleLoc(readSourceLocation());
134  for (unsigned i = 0; i != NumTemplateArgs; ++i)
135  ArgInfo.addArgument(Record.readTemplateArgumentLoc());
136  Args.initializeFrom(TemplateKWLoc, ArgInfo, ArgsLocArray);
137 }
138 
140  S->setIsOMPStructuredBlock(Record.readInt());
141  assert(Record.getIdx() == NumStmtFields && "Incorrect statement field count");
142 }
143 
144 void ASTStmtReader::VisitNullStmt(NullStmt *S) {
145  VisitStmt(S);
146  S->setSemiLoc(readSourceLocation());
147  S->NullStmtBits.HasLeadingEmptyMacro = Record.readInt();
148 }
149 
150 void ASTStmtReader::VisitCompoundStmt(CompoundStmt *S) {
151  VisitStmt(S);
153  unsigned NumStmts = Record.readInt();
154  while (NumStmts--)
155  Stmts.push_back(Record.readSubStmt());
156  S->setStmts(Stmts);
157  S->CompoundStmtBits.LBraceLoc = readSourceLocation();
158  S->RBraceLoc = readSourceLocation();
159 }
160 
161 void ASTStmtReader::VisitSwitchCase(SwitchCase *S) {
162  VisitStmt(S);
163  Record.recordSwitchCaseID(S, Record.readInt());
164  S->setKeywordLoc(readSourceLocation());
165  S->setColonLoc(readSourceLocation());
166 }
167 
168 void ASTStmtReader::VisitCaseStmt(CaseStmt *S) {
169  VisitSwitchCase(S);
170  bool CaseStmtIsGNURange = Record.readInt();
171  S->setLHS(Record.readSubExpr());
172  S->setSubStmt(Record.readSubStmt());
173  if (CaseStmtIsGNURange) {
174  S->setRHS(Record.readSubExpr());
175  S->setEllipsisLoc(readSourceLocation());
176  }
177 }
178 
179 void ASTStmtReader::VisitDefaultStmt(DefaultStmt *S) {
180  VisitSwitchCase(S);
181  S->setSubStmt(Record.readSubStmt());
182 }
183 
184 void ASTStmtReader::VisitLabelStmt(LabelStmt *S) {
185  VisitStmt(S);
186  auto *LD = readDeclAs<LabelDecl>();
187  LD->setStmt(S);
188  S->setDecl(LD);
189  S->setSubStmt(Record.readSubStmt());
190  S->setIdentLoc(readSourceLocation());
191 }
192 
193 void ASTStmtReader::VisitAttributedStmt(AttributedStmt *S) {
194  VisitStmt(S);
195  // NumAttrs in AttributedStmt is set when creating an empty
196  // AttributedStmt in AttributedStmt::CreateEmpty, since it is needed
197  // to allocate the right amount of space for the trailing Attr *.
198  uint64_t NumAttrs = Record.readInt();
199  AttrVec Attrs;
200  Record.readAttributes(Attrs);
201  (void)NumAttrs;
202  assert(NumAttrs == S->AttributedStmtBits.NumAttrs);
203  assert(NumAttrs == Attrs.size());
204  std::copy(Attrs.begin(), Attrs.end(), S->getAttrArrayPtr());
205  S->SubStmt = Record.readSubStmt();
206  S->AttributedStmtBits.AttrLoc = readSourceLocation();
207 }
208 
209 void ASTStmtReader::VisitIfStmt(IfStmt *S) {
210  VisitStmt(S);
211 
212  S->setConstexpr(Record.readInt());
213  bool HasElse = Record.readInt();
214  bool HasVar = Record.readInt();
215  bool HasInit = Record.readInt();
216 
217  S->setCond(Record.readSubExpr());
218  S->setThen(Record.readSubStmt());
219  if (HasElse)
220  S->setElse(Record.readSubStmt());
221  if (HasVar)
222  S->setConditionVariable(Record.getContext(), readDeclAs<VarDecl>());
223  if (HasInit)
224  S->setInit(Record.readSubStmt());
225 
226  S->setIfLoc(readSourceLocation());
227  if (HasElse)
228  S->setElseLoc(readSourceLocation());
229 }
230 
231 void ASTStmtReader::VisitSwitchStmt(SwitchStmt *S) {
232  VisitStmt(S);
233 
234  bool HasInit = Record.readInt();
235  bool HasVar = Record.readInt();
236  bool AllEnumCasesCovered = Record.readInt();
237  if (AllEnumCasesCovered)
239 
240  S->setCond(Record.readSubExpr());
241  S->setBody(Record.readSubStmt());
242  if (HasInit)
243  S->setInit(Record.readSubStmt());
244  if (HasVar)
245  S->setConditionVariable(Record.getContext(), readDeclAs<VarDecl>());
246 
247  S->setSwitchLoc(readSourceLocation());
248 
249  SwitchCase *PrevSC = nullptr;
250  for (auto E = Record.size(); Record.getIdx() != E; ) {
251  SwitchCase *SC = Record.getSwitchCaseWithID(Record.readInt());
252  if (PrevSC)
253  PrevSC->setNextSwitchCase(SC);
254  else
255  S->setSwitchCaseList(SC);
256 
257  PrevSC = SC;
258  }
259 }
260 
261 void ASTStmtReader::VisitWhileStmt(WhileStmt *S) {
262  VisitStmt(S);
263 
264  bool HasVar = Record.readInt();
265 
266  S->setCond(Record.readSubExpr());
267  S->setBody(Record.readSubStmt());
268  if (HasVar)
269  S->setConditionVariable(Record.getContext(), readDeclAs<VarDecl>());
270 
271  S->setWhileLoc(readSourceLocation());
272 }
273 
274 void ASTStmtReader::VisitDoStmt(DoStmt *S) {
275  VisitStmt(S);
276  S->setCond(Record.readSubExpr());
277  S->setBody(Record.readSubStmt());
278  S->setDoLoc(readSourceLocation());
279  S->setWhileLoc(readSourceLocation());
280  S->setRParenLoc(readSourceLocation());
281 }
282 
283 void ASTStmtReader::VisitForStmt(ForStmt *S) {
284  VisitStmt(S);
285  S->setInit(Record.readSubStmt());
286  S->setCond(Record.readSubExpr());
287  S->setConditionVariable(Record.getContext(), readDeclAs<VarDecl>());
288  S->setInc(Record.readSubExpr());
289  S->setBody(Record.readSubStmt());
290  S->setForLoc(readSourceLocation());
291  S->setLParenLoc(readSourceLocation());
292  S->setRParenLoc(readSourceLocation());
293 }
294 
295 void ASTStmtReader::VisitGotoStmt(GotoStmt *S) {
296  VisitStmt(S);
297  S->setLabel(readDeclAs<LabelDecl>());
298  S->setGotoLoc(readSourceLocation());
299  S->setLabelLoc(readSourceLocation());
300 }
301 
302 void ASTStmtReader::VisitIndirectGotoStmt(IndirectGotoStmt *S) {
303  VisitStmt(S);
304  S->setGotoLoc(readSourceLocation());
305  S->setStarLoc(readSourceLocation());
306  S->setTarget(Record.readSubExpr());
307 }
308 
309 void ASTStmtReader::VisitContinueStmt(ContinueStmt *S) {
310  VisitStmt(S);
311  S->setContinueLoc(readSourceLocation());
312 }
313 
314 void ASTStmtReader::VisitBreakStmt(BreakStmt *S) {
315  VisitStmt(S);
316  S->setBreakLoc(readSourceLocation());
317 }
318 
319 void ASTStmtReader::VisitReturnStmt(ReturnStmt *S) {
320  VisitStmt(S);
321 
322  bool HasNRVOCandidate = Record.readInt();
323 
324  S->setRetValue(Record.readSubExpr());
325  if (HasNRVOCandidate)
326  S->setNRVOCandidate(readDeclAs<VarDecl>());
327 
328  S->setReturnLoc(readSourceLocation());
329 }
330 
331 void ASTStmtReader::VisitDeclStmt(DeclStmt *S) {
332  VisitStmt(S);
333  S->setStartLoc(readSourceLocation());
334  S->setEndLoc(readSourceLocation());
335 
336  if (Record.size() - Record.getIdx() == 1) {
337  // Single declaration
338  S->setDeclGroup(DeclGroupRef(readDecl()));
339  } else {
341  int N = Record.size() - Record.getIdx();
342  Decls.reserve(N);
343  for (int I = 0; I < N; ++I)
344  Decls.push_back(readDecl());
345  S->setDeclGroup(DeclGroupRef(DeclGroup::Create(Record.getContext(),
346  Decls.data(),
347  Decls.size())));
348  }
349 }
350 
351 void ASTStmtReader::VisitAsmStmt(AsmStmt *S) {
352  VisitStmt(S);
353  S->NumOutputs = Record.readInt();
354  S->NumInputs = Record.readInt();
355  S->NumClobbers = Record.readInt();
356  S->setAsmLoc(readSourceLocation());
357  S->setVolatile(Record.readInt());
358  S->setSimple(Record.readInt());
359 }
360 
361 void ASTStmtReader::VisitGCCAsmStmt(GCCAsmStmt *S) {
362  VisitAsmStmt(S);
363  S->NumLabels = Record.readInt();
364  S->setRParenLoc(readSourceLocation());
365  S->setAsmString(cast_or_null<StringLiteral>(Record.readSubStmt()));
366 
367  unsigned NumOutputs = S->getNumOutputs();
368  unsigned NumInputs = S->getNumInputs();
369  unsigned NumClobbers = S->getNumClobbers();
370  unsigned NumLabels = S->getNumLabels();
371 
372  // Outputs and inputs
376  for (unsigned I = 0, N = NumOutputs + NumInputs; I != N; ++I) {
377  Names.push_back(Record.readIdentifier());
378  Constraints.push_back(cast_or_null<StringLiteral>(Record.readSubStmt()));
379  Exprs.push_back(Record.readSubStmt());
380  }
381 
382  // Constraints
384  for (unsigned I = 0; I != NumClobbers; ++I)
385  Clobbers.push_back(cast_or_null<StringLiteral>(Record.readSubStmt()));
386 
387  // Labels
388  for (unsigned I = 0, N = NumLabels; I != N; ++I)
389  Exprs.push_back(Record.readSubStmt());
390 
391  S->setOutputsAndInputsAndClobbers(Record.getContext(),
392  Names.data(), Constraints.data(),
393  Exprs.data(), NumOutputs, NumInputs,
394  NumLabels,
395  Clobbers.data(), NumClobbers);
396 }
397 
398 void ASTStmtReader::VisitMSAsmStmt(MSAsmStmt *S) {
399  VisitAsmStmt(S);
400  S->LBraceLoc = readSourceLocation();
401  S->EndLoc = readSourceLocation();
402  S->NumAsmToks = Record.readInt();
403  std::string AsmStr = readString();
404 
405  // Read the tokens.
406  SmallVector<Token, 16> AsmToks;
407  AsmToks.reserve(S->NumAsmToks);
408  for (unsigned i = 0, e = S->NumAsmToks; i != e; ++i) {
409  AsmToks.push_back(Record.readToken());
410  }
411 
412  // The calls to reserve() for the FooData vectors are mandatory to
413  // prevent dead StringRefs in the Foo vectors.
414 
415  // Read the clobbers.
416  SmallVector<std::string, 16> ClobbersData;
418  ClobbersData.reserve(S->NumClobbers);
419  Clobbers.reserve(S->NumClobbers);
420  for (unsigned i = 0, e = S->NumClobbers; i != e; ++i) {
421  ClobbersData.push_back(readString());
422  Clobbers.push_back(ClobbersData.back());
423  }
424 
425  // Read the operands.
426  unsigned NumOperands = S->NumOutputs + S->NumInputs;
428  SmallVector<std::string, 16> ConstraintsData;
429  SmallVector<StringRef, 16> Constraints;
430  Exprs.reserve(NumOperands);
431  ConstraintsData.reserve(NumOperands);
432  Constraints.reserve(NumOperands);
433  for (unsigned i = 0; i != NumOperands; ++i) {
434  Exprs.push_back(cast<Expr>(Record.readSubStmt()));
435  ConstraintsData.push_back(readString());
436  Constraints.push_back(ConstraintsData.back());
437  }
438 
439  S->initialize(Record.getContext(), AsmStr, AsmToks,
440  Constraints, Exprs, Clobbers);
441 }
442 
443 void ASTStmtReader::VisitCoroutineBodyStmt(CoroutineBodyStmt *S) {
444  VisitStmt(S);
445  assert(Record.peekInt() == S->NumParams);
446  Record.skipInts(1);
447  auto *StoredStmts = S->getStoredStmts();
448  for (unsigned i = 0;
449  i < CoroutineBodyStmt::SubStmt::FirstParamMove + S->NumParams; ++i)
450  StoredStmts[i] = Record.readSubStmt();
451 }
452 
453 void ASTStmtReader::VisitCoreturnStmt(CoreturnStmt *S) {
454  VisitStmt(S);
455  S->CoreturnLoc = Record.readSourceLocation();
456  for (auto &SubStmt: S->SubStmts)
457  SubStmt = Record.readSubStmt();
458  S->IsImplicit = Record.readInt() != 0;
459 }
460 
461 void ASTStmtReader::VisitCoawaitExpr(CoawaitExpr *E) {
462  VisitExpr(E);
463  E->KeywordLoc = readSourceLocation();
464  for (auto &SubExpr: E->SubExprs)
465  SubExpr = Record.readSubStmt();
466  E->OpaqueValue = cast_or_null<OpaqueValueExpr>(Record.readSubStmt());
467  E->setIsImplicit(Record.readInt() != 0);
468 }
469 
470 void ASTStmtReader::VisitCoyieldExpr(CoyieldExpr *E) {
471  VisitExpr(E);
472  E->KeywordLoc = readSourceLocation();
473  for (auto &SubExpr: E->SubExprs)
474  SubExpr = Record.readSubStmt();
475  E->OpaqueValue = cast_or_null<OpaqueValueExpr>(Record.readSubStmt());
476 }
477 
478 void ASTStmtReader::VisitDependentCoawaitExpr(DependentCoawaitExpr *E) {
479  VisitExpr(E);
480  E->KeywordLoc = readSourceLocation();
481  for (auto &SubExpr: E->SubExprs)
482  SubExpr = Record.readSubStmt();
483 }
484 
485 void ASTStmtReader::VisitCapturedStmt(CapturedStmt *S) {
486  VisitStmt(S);
487  Record.skipInts(1);
488  S->setCapturedDecl(readDeclAs<CapturedDecl>());
489  S->setCapturedRegionKind(static_cast<CapturedRegionKind>(Record.readInt()));
490  S->setCapturedRecordDecl(readDeclAs<RecordDecl>());
491 
492  // Capture inits
494  E = S->capture_init_end();
495  I != E; ++I)
496  *I = Record.readSubExpr();
497 
498  // Body
499  S->setCapturedStmt(Record.readSubStmt());
501 
502  // Captures
503  for (auto &I : S->captures()) {
504  I.VarAndKind.setPointer(readDeclAs<VarDecl>());
505  I.VarAndKind.setInt(
506  static_cast<CapturedStmt::VariableCaptureKind>(Record.readInt()));
507  I.Loc = readSourceLocation();
508  }
509 }
510 
511 void ASTStmtReader::VisitExpr(Expr *E) {
512  VisitStmt(E);
513  E->setType(Record.readType());
514  E->setTypeDependent(Record.readInt());
515  E->setValueDependent(Record.readInt());
516  E->setInstantiationDependent(Record.readInt());
517  E->ExprBits.ContainsUnexpandedParameterPack = Record.readInt();
518  E->setValueKind(static_cast<ExprValueKind>(Record.readInt()));
519  E->setObjectKind(static_cast<ExprObjectKind>(Record.readInt()));
520  assert(Record.getIdx() == NumExprFields &&
521  "Incorrect expression field count");
522 }
523 
524 void ASTStmtReader::VisitConstantExpr(ConstantExpr *E) {
525  VisitExpr(E);
526  E->ConstantExprBits.ResultKind = Record.readInt();
527  switch (E->ConstantExprBits.ResultKind) {
529  E->Int64Result() = Record.readInt();
530  uint64_t tmp = Record.readInt();
531  E->ConstantExprBits.IsUnsigned = tmp & 0x1;
532  E->ConstantExprBits.BitWidth = tmp >> 1;
533  break;
534  }
536  E->APValueResult() = Record.readAPValue();
537  }
538  E->setSubExpr(Record.readSubExpr());
539 }
540 
541 void ASTStmtReader::VisitPredefinedExpr(PredefinedExpr *E) {
542  VisitExpr(E);
543  bool HasFunctionName = Record.readInt();
544  E->PredefinedExprBits.HasFunctionName = HasFunctionName;
545  E->PredefinedExprBits.Kind = Record.readInt();
546  E->setLocation(readSourceLocation());
547  if (HasFunctionName)
548  E->setFunctionName(cast<StringLiteral>(Record.readSubExpr()));
549 }
550 
551 void ASTStmtReader::VisitDeclRefExpr(DeclRefExpr *E) {
552  VisitExpr(E);
553 
554  E->DeclRefExprBits.HasQualifier = Record.readInt();
555  E->DeclRefExprBits.HasFoundDecl = Record.readInt();
556  E->DeclRefExprBits.HasTemplateKWAndArgsInfo = Record.readInt();
557  E->DeclRefExprBits.HadMultipleCandidates = Record.readInt();
558  E->DeclRefExprBits.RefersToEnclosingVariableOrCapture = Record.readInt();
559  E->DeclRefExprBits.NonOdrUseReason = Record.readInt();
560  unsigned NumTemplateArgs = 0;
561  if (E->hasTemplateKWAndArgsInfo())
562  NumTemplateArgs = Record.readInt();
563 
564  if (E->hasQualifier())
565  new (E->getTrailingObjects<NestedNameSpecifierLoc>())
566  NestedNameSpecifierLoc(Record.readNestedNameSpecifierLoc());
567 
568  if (E->hasFoundDecl())
569  *E->getTrailingObjects<NamedDecl *>() = readDeclAs<NamedDecl>();
570 
571  if (E->hasTemplateKWAndArgsInfo())
572  ReadTemplateKWAndArgsInfo(
573  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
574  E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs);
575 
576  E->setDecl(readDeclAs<ValueDecl>());
577  E->setLocation(readSourceLocation());
578  E->DNLoc = Record.readDeclarationNameLoc(E->getDecl()->getDeclName());
579 }
580 
581 void ASTStmtReader::VisitIntegerLiteral(IntegerLiteral *E) {
582  VisitExpr(E);
583  E->setLocation(readSourceLocation());
584  E->setValue(Record.getContext(), Record.readAPInt());
585 }
586 
587 void ASTStmtReader::VisitFixedPointLiteral(FixedPointLiteral *E) {
588  VisitExpr(E);
589  E->setLocation(readSourceLocation());
590  E->setValue(Record.getContext(), Record.readAPInt());
591 }
592 
593 void ASTStmtReader::VisitFloatingLiteral(FloatingLiteral *E) {
594  VisitExpr(E);
595  E->setRawSemantics(
596  static_cast<llvm::APFloatBase::Semantics>(Record.readInt()));
597  E->setExact(Record.readInt());
598  E->setValue(Record.getContext(), Record.readAPFloat(E->getSemantics()));
599  E->setLocation(readSourceLocation());
600 }
601 
602 void ASTStmtReader::VisitImaginaryLiteral(ImaginaryLiteral *E) {
603  VisitExpr(E);
604  E->setSubExpr(Record.readSubExpr());
605 }
606 
607 void ASTStmtReader::VisitStringLiteral(StringLiteral *E) {
608  VisitExpr(E);
609 
610  // NumConcatenated, Length and CharByteWidth are set by the empty
611  // ctor since they are needed to allocate storage for the trailing objects.
612  unsigned NumConcatenated = Record.readInt();
613  unsigned Length = Record.readInt();
614  unsigned CharByteWidth = Record.readInt();
615  assert((NumConcatenated == E->getNumConcatenated()) &&
616  "Wrong number of concatenated tokens!");
617  assert((Length == E->getLength()) && "Wrong Length!");
618  assert((CharByteWidth == E->getCharByteWidth()) && "Wrong character width!");
619  E->StringLiteralBits.Kind = Record.readInt();
620  E->StringLiteralBits.IsPascal = Record.readInt();
621 
622  // The character width is originally computed via mapCharByteWidth.
623  // Check that the deserialized character width is consistant with the result
624  // of calling mapCharByteWidth.
625  assert((CharByteWidth ==
626  StringLiteral::mapCharByteWidth(Record.getContext().getTargetInfo(),
627  E->getKind())) &&
628  "Wrong character width!");
629 
630  // Deserialize the trailing array of SourceLocation.
631  for (unsigned I = 0; I < NumConcatenated; ++I)
632  E->setStrTokenLoc(I, readSourceLocation());
633 
634  // Deserialize the trailing array of char holding the string data.
635  char *StrData = E->getStrDataAsChar();
636  for (unsigned I = 0; I < Length * CharByteWidth; ++I)
637  StrData[I] = Record.readInt();
638 }
639 
640 void ASTStmtReader::VisitCharacterLiteral(CharacterLiteral *E) {
641  VisitExpr(E);
642  E->setValue(Record.readInt());
643  E->setLocation(readSourceLocation());
644  E->setKind(static_cast<CharacterLiteral::CharacterKind>(Record.readInt()));
645 }
646 
647 void ASTStmtReader::VisitParenExpr(ParenExpr *E) {
648  VisitExpr(E);
649  E->setLParen(readSourceLocation());
650  E->setRParen(readSourceLocation());
651  E->setSubExpr(Record.readSubExpr());
652 }
653 
654 void ASTStmtReader::VisitParenListExpr(ParenListExpr *E) {
655  VisitExpr(E);
656  unsigned NumExprs = Record.readInt();
657  assert((NumExprs == E->getNumExprs()) && "Wrong NumExprs!");
658  for (unsigned I = 0; I != NumExprs; ++I)
659  E->getTrailingObjects<Stmt *>()[I] = Record.readSubStmt();
660  E->LParenLoc = readSourceLocation();
661  E->RParenLoc = readSourceLocation();
662 }
663 
664 void ASTStmtReader::VisitUnaryOperator(UnaryOperator *E) {
665  VisitExpr(E);
666  E->setSubExpr(Record.readSubExpr());
667  E->setOpcode((UnaryOperator::Opcode)Record.readInt());
668  E->setOperatorLoc(readSourceLocation());
669  E->setCanOverflow(Record.readInt());
670 }
671 
672 void ASTStmtReader::VisitOffsetOfExpr(OffsetOfExpr *E) {
673  VisitExpr(E);
674  assert(E->getNumComponents() == Record.peekInt());
675  Record.skipInts(1);
676  assert(E->getNumExpressions() == Record.peekInt());
677  Record.skipInts(1);
678  E->setOperatorLoc(readSourceLocation());
679  E->setRParenLoc(readSourceLocation());
680  E->setTypeSourceInfo(readTypeSourceInfo());
681  for (unsigned I = 0, N = E->getNumComponents(); I != N; ++I) {
682  auto Kind = static_cast<OffsetOfNode::Kind>(Record.readInt());
683  SourceLocation Start = readSourceLocation();
684  SourceLocation End = readSourceLocation();
685  switch (Kind) {
686  case OffsetOfNode::Array:
687  E->setComponent(I, OffsetOfNode(Start, Record.readInt(), End));
688  break;
689 
690  case OffsetOfNode::Field:
691  E->setComponent(
692  I, OffsetOfNode(Start, readDeclAs<FieldDecl>(), End));
693  break;
694 
696  E->setComponent(
697  I,
698  OffsetOfNode(Start, Record.readIdentifier(), End));
699  break;
700 
701  case OffsetOfNode::Base: {
702  auto *Base = new (Record.getContext()) CXXBaseSpecifier();
703  *Base = Record.readCXXBaseSpecifier();
705  break;
706  }
707  }
708  }
709 
710  for (unsigned I = 0, N = E->getNumExpressions(); I != N; ++I)
711  E->setIndexExpr(I, Record.readSubExpr());
712 }
713 
714 void ASTStmtReader::VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *E) {
715  VisitExpr(E);
716  E->setKind(static_cast<UnaryExprOrTypeTrait>(Record.readInt()));
717  if (Record.peekInt() == 0) {
718  E->setArgument(Record.readSubExpr());
719  Record.skipInts(1);
720  } else {
721  E->setArgument(readTypeSourceInfo());
722  }
723  E->setOperatorLoc(readSourceLocation());
724  E->setRParenLoc(readSourceLocation());
725 }
726 
729  ConstraintSatisfaction Satisfaction;
730  Satisfaction.IsSatisfied = Record.readInt();
731  if (!Satisfaction.IsSatisfied) {
732  unsigned NumDetailRecords = Record.readInt();
733  for (unsigned i = 0; i != NumDetailRecords; ++i) {
734  Expr *ConstraintExpr = Record.readExpr();
735  if (bool IsDiagnostic = Record.readInt()) {
736  SourceLocation DiagLocation = Record.readSourceLocation();
737  std::string DiagMessage = Record.readString();
738  Satisfaction.Details.emplace_back(
739  ConstraintExpr, new (Record.getContext())
741  DiagLocation, DiagMessage});
742  } else
743  Satisfaction.Details.emplace_back(ConstraintExpr, Record.readExpr());
744  }
745  }
746  return Satisfaction;
747 }
748 
749 void ASTStmtReader::VisitConceptSpecializationExpr(
751  VisitExpr(E);
752  unsigned NumTemplateArgs = Record.readInt();
753  E->NestedNameSpec = Record.readNestedNameSpecifierLoc();
754  E->TemplateKWLoc = Record.readSourceLocation();
755  E->ConceptName = Record.readDeclarationNameInfo();
756  E->NamedConcept = readDeclAs<ConceptDecl>();
757  E->ArgsAsWritten = Record.readASTTemplateArgumentListInfo();
759  for (unsigned I = 0; I < NumTemplateArgs; ++I)
760  Args.push_back(Record.readTemplateArgument());
761  E->setTemplateArguments(Args);
762  E->Satisfaction = E->isValueDependent() ? nullptr :
763  ASTConstraintSatisfaction::Create(Record.getContext(),
765 }
766 
769  std::string SubstitutedEntity = Record.readString();
770  SourceLocation DiagLoc = Record.readSourceLocation();
771  std::string DiagMessage = Record.readString();
772  return new (Record.getContext())
773  concepts::Requirement::SubstitutionDiagnostic{SubstitutedEntity, DiagLoc,
774  DiagMessage};
775 }
776 
777 void ASTStmtReader::VisitRequiresExpr(RequiresExpr *E) {
778  VisitExpr(E);
779  unsigned NumLocalParameters = Record.readInt();
780  unsigned NumRequirements = Record.readInt();
781  E->RequiresExprBits.RequiresKWLoc = Record.readSourceLocation();
782  E->RequiresExprBits.IsSatisfied = Record.readInt();
783  E->Body = Record.readDeclAs<RequiresExprBodyDecl>();
784  llvm::SmallVector<ParmVarDecl *, 4> LocalParameters;
785  for (unsigned i = 0; i < NumLocalParameters; ++i)
786  LocalParameters.push_back(cast<ParmVarDecl>(Record.readDecl()));
787  std::copy(LocalParameters.begin(), LocalParameters.end(),
788  E->getTrailingObjects<ParmVarDecl *>());
790  for (unsigned i = 0; i < NumRequirements; ++i) {
791  auto RK =
792  static_cast<concepts::Requirement::RequirementKind>(Record.readInt());
793  concepts::Requirement *R = nullptr;
794  switch (RK) {
796  auto Status =
798  Record.readInt());
800  R = new (Record.getContext())
802  else
803  R = new (Record.getContext())
804  concepts::TypeRequirement(Record.readTypeSourceInfo());
805  } break;
808  auto Status =
810  Record.readInt());
812  Expr *> E;
814  E = readSubstitutionDiagnostic(Record);
815  } else
816  E = Record.readExpr();
817 
819  ConceptSpecializationExpr *SubstitutedConstraintExpr = nullptr;
820  SourceLocation NoexceptLoc;
822  Req.emplace();
823  } else {
824  NoexceptLoc = Record.readSourceLocation();
825  switch (auto returnTypeRequirementKind = Record.readInt()) {
826  case 0:
827  // No return type requirement.
828  Req.emplace();
829  break;
830  case 1: {
831  // type-constraint
832  TemplateParameterList *TPL = Record.readTemplateParameterList();
833  if (Status >=
835  SubstitutedConstraintExpr =
836  cast<ConceptSpecializationExpr>(Record.readExpr());
837  Req.emplace(TPL);
838  } break;
839  case 2:
840  // Substitution failure
841  Req.emplace(readSubstitutionDiagnostic(Record));
842  break;
843  }
844  }
845  if (Expr *Ex = E.dyn_cast<Expr *>())
846  R = new (Record.getContext()) concepts::ExprRequirement(
847  Ex, RK == concepts::Requirement::RK_Simple, NoexceptLoc,
848  std::move(*Req), Status, SubstitutedConstraintExpr);
849  else
850  R = new (Record.getContext()) concepts::ExprRequirement(
851  E.get<concepts::Requirement::SubstitutionDiagnostic *>(),
852  RK == concepts::Requirement::RK_Simple, NoexceptLoc,
853  std::move(*Req));
854  } break;
856  if (bool IsSubstitutionDiagnostic = Record.readInt()) {
857  R = new (Record.getContext()) concepts::NestedRequirement(
859  break;
860  }
861  Expr *E = Record.readExpr();
862  if (E->isInstantiationDependent())
863  R = new (Record.getContext()) concepts::NestedRequirement(E);
864  else
865  R = new (Record.getContext())
866  concepts::NestedRequirement(Record.getContext(), E,
868  } break;
869  }
870  if (!R)
871  continue;
872  Requirements.push_back(R);
873  }
874  std::copy(Requirements.begin(), Requirements.end(),
875  E->getTrailingObjects<concepts::Requirement *>());
876  E->RBraceLoc = Record.readSourceLocation();
877 }
878 
879 void ASTStmtReader::VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
880  VisitExpr(E);
881  E->setLHS(Record.readSubExpr());
882  E->setRHS(Record.readSubExpr());
883  E->setRBracketLoc(readSourceLocation());
884 }
885 
886 void ASTStmtReader::VisitOMPArraySectionExpr(OMPArraySectionExpr *E) {
887  VisitExpr(E);
888  E->setBase(Record.readSubExpr());
889  E->setLowerBound(Record.readSubExpr());
890  E->setLength(Record.readSubExpr());
891  E->setColonLoc(readSourceLocation());
892  E->setRBracketLoc(readSourceLocation());
893 }
894 
895 void ASTStmtReader::VisitCallExpr(CallExpr *E) {
896  VisitExpr(E);
897  unsigned NumArgs = Record.readInt();
898  assert((NumArgs == E->getNumArgs()) && "Wrong NumArgs!");
899  E->setRParenLoc(readSourceLocation());
900  E->setCallee(Record.readSubExpr());
901  for (unsigned I = 0; I != NumArgs; ++I)
902  E->setArg(I, Record.readSubExpr());
903  E->setADLCallKind(static_cast<CallExpr::ADLCallKind>(Record.readInt()));
904 }
905 
906 void ASTStmtReader::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) {
907  VisitCallExpr(E);
908 }
909 
910 void ASTStmtReader::VisitMemberExpr(MemberExpr *E) {
911  VisitExpr(E);
912 
913  bool HasQualifier = Record.readInt();
914  bool HasFoundDecl = Record.readInt();
915  bool HasTemplateInfo = Record.readInt();
916  unsigned NumTemplateArgs = Record.readInt();
917 
918  E->Base = Record.readSubExpr();
919  E->MemberDecl = Record.readDeclAs<ValueDecl>();
920  E->MemberDNLoc = Record.readDeclarationNameLoc(E->MemberDecl->getDeclName());
921  E->MemberLoc = Record.readSourceLocation();
922  E->MemberExprBits.IsArrow = Record.readInt();
923  E->MemberExprBits.HasQualifierOrFoundDecl = HasQualifier || HasFoundDecl;
924  E->MemberExprBits.HasTemplateKWAndArgsInfo = HasTemplateInfo;
925  E->MemberExprBits.HadMultipleCandidates = Record.readInt();
926  E->MemberExprBits.NonOdrUseReason = Record.readInt();
927  E->MemberExprBits.OperatorLoc = Record.readSourceLocation();
928 
929  if (HasQualifier || HasFoundDecl) {
930  DeclAccessPair FoundDecl;
931  if (HasFoundDecl) {
932  auto *FoundD = Record.readDeclAs<NamedDecl>();
933  auto AS = (AccessSpecifier)Record.readInt();
934  FoundDecl = DeclAccessPair::make(FoundD, AS);
935  } else {
936  FoundDecl = DeclAccessPair::make(E->MemberDecl,
937  E->MemberDecl->getAccess());
938  }
939  E->getTrailingObjects<MemberExprNameQualifier>()->FoundDecl = FoundDecl;
940 
941  NestedNameSpecifierLoc QualifierLoc;
942  if (HasQualifier)
943  QualifierLoc = Record.readNestedNameSpecifierLoc();
944  E->getTrailingObjects<MemberExprNameQualifier>()->QualifierLoc =
945  QualifierLoc;
946  }
947 
948  if (HasTemplateInfo)
949  ReadTemplateKWAndArgsInfo(
950  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
951  E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs);
952 }
953 
954 void ASTStmtReader::VisitObjCIsaExpr(ObjCIsaExpr *E) {
955  VisitExpr(E);
956  E->setBase(Record.readSubExpr());
957  E->setIsaMemberLoc(readSourceLocation());
958  E->setOpLoc(readSourceLocation());
959  E->setArrow(Record.readInt());
960 }
961 
962 void ASTStmtReader::
963 VisitObjCIndirectCopyRestoreExpr(ObjCIndirectCopyRestoreExpr *E) {
964  VisitExpr(E);
965  E->Operand = Record.readSubExpr();
966  E->setShouldCopy(Record.readInt());
967 }
968 
969 void ASTStmtReader::VisitObjCBridgedCastExpr(ObjCBridgedCastExpr *E) {
970  VisitExplicitCastExpr(E);
971  E->LParenLoc = readSourceLocation();
972  E->BridgeKeywordLoc = readSourceLocation();
973  E->Kind = Record.readInt();
974 }
975 
976 void ASTStmtReader::VisitCastExpr(CastExpr *E) {
977  VisitExpr(E);
978  unsigned NumBaseSpecs = Record.readInt();
979  assert(NumBaseSpecs == E->path_size());
980  E->setSubExpr(Record.readSubExpr());
981  E->setCastKind((CastKind)Record.readInt());
982  CastExpr::path_iterator BaseI = E->path_begin();
983  while (NumBaseSpecs--) {
984  auto *BaseSpec = new (Record.getContext()) CXXBaseSpecifier;
985  *BaseSpec = Record.readCXXBaseSpecifier();
986  *BaseI++ = BaseSpec;
987  }
988 }
989 
990 void ASTStmtReader::VisitBinaryOperator(BinaryOperator *E) {
991  VisitExpr(E);
992  E->setLHS(Record.readSubExpr());
993  E->setRHS(Record.readSubExpr());
994  E->setOpcode((BinaryOperator::Opcode)Record.readInt());
995  E->setOperatorLoc(readSourceLocation());
996  E->setFPFeatures(FPOptions(Record.readInt()));
997 }
998 
999 void ASTStmtReader::VisitCompoundAssignOperator(CompoundAssignOperator *E) {
1000  VisitBinaryOperator(E);
1001  E->setComputationLHSType(Record.readType());
1002  E->setComputationResultType(Record.readType());
1003 }
1004 
1005 void ASTStmtReader::VisitConditionalOperator(ConditionalOperator *E) {
1006  VisitExpr(E);
1007  E->SubExprs[ConditionalOperator::COND] = Record.readSubExpr();
1008  E->SubExprs[ConditionalOperator::LHS] = Record.readSubExpr();
1009  E->SubExprs[ConditionalOperator::RHS] = Record.readSubExpr();
1010  E->QuestionLoc = readSourceLocation();
1011  E->ColonLoc = readSourceLocation();
1012 }
1013 
1014 void
1015 ASTStmtReader::VisitBinaryConditionalOperator(BinaryConditionalOperator *E) {
1016  VisitExpr(E);
1017  E->OpaqueValue = cast<OpaqueValueExpr>(Record.readSubExpr());
1018  E->SubExprs[BinaryConditionalOperator::COMMON] = Record.readSubExpr();
1019  E->SubExprs[BinaryConditionalOperator::COND] = Record.readSubExpr();
1020  E->SubExprs[BinaryConditionalOperator::LHS] = Record.readSubExpr();
1021  E->SubExprs[BinaryConditionalOperator::RHS] = Record.readSubExpr();
1022  E->QuestionLoc = readSourceLocation();
1023  E->ColonLoc = readSourceLocation();
1024 }
1025 
1026 void ASTStmtReader::VisitImplicitCastExpr(ImplicitCastExpr *E) {
1027  VisitCastExpr(E);
1028  E->setIsPartOfExplicitCast(Record.readInt());
1029 }
1030 
1031 void ASTStmtReader::VisitExplicitCastExpr(ExplicitCastExpr *E) {
1032  VisitCastExpr(E);
1033  E->setTypeInfoAsWritten(readTypeSourceInfo());
1034 }
1035 
1036 void ASTStmtReader::VisitCStyleCastExpr(CStyleCastExpr *E) {
1037  VisitExplicitCastExpr(E);
1038  E->setLParenLoc(readSourceLocation());
1039  E->setRParenLoc(readSourceLocation());
1040 }
1041 
1042 void ASTStmtReader::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
1043  VisitExpr(E);
1044  E->setLParenLoc(readSourceLocation());
1045  E->setTypeSourceInfo(readTypeSourceInfo());
1046  E->setInitializer(Record.readSubExpr());
1047  E->setFileScope(Record.readInt());
1048 }
1049 
1050 void ASTStmtReader::VisitExtVectorElementExpr(ExtVectorElementExpr *E) {
1051  VisitExpr(E);
1052  E->setBase(Record.readSubExpr());
1053  E->setAccessor(Record.readIdentifier());
1054  E->setAccessorLoc(readSourceLocation());
1055 }
1056 
1057 void ASTStmtReader::VisitInitListExpr(InitListExpr *E) {
1058  VisitExpr(E);
1059  if (auto *SyntForm = cast_or_null<InitListExpr>(Record.readSubStmt()))
1060  E->setSyntacticForm(SyntForm);
1061  E->setLBraceLoc(readSourceLocation());
1062  E->setRBraceLoc(readSourceLocation());
1063  bool isArrayFiller = Record.readInt();
1064  Expr *filler = nullptr;
1065  if (isArrayFiller) {
1066  filler = Record.readSubExpr();
1067  E->ArrayFillerOrUnionFieldInit = filler;
1068  } else
1069  E->ArrayFillerOrUnionFieldInit = readDeclAs<FieldDecl>();
1070  E->sawArrayRangeDesignator(Record.readInt());
1071  unsigned NumInits = Record.readInt();
1072  E->reserveInits(Record.getContext(), NumInits);
1073  if (isArrayFiller) {
1074  for (unsigned I = 0; I != NumInits; ++I) {
1075  Expr *init = Record.readSubExpr();
1076  E->updateInit(Record.getContext(), I, init ? init : filler);
1077  }
1078  } else {
1079  for (unsigned I = 0; I != NumInits; ++I)
1080  E->updateInit(Record.getContext(), I, Record.readSubExpr());
1081  }
1082 }
1083 
1084 void ASTStmtReader::VisitDesignatedInitExpr(DesignatedInitExpr *E) {
1086 
1087  VisitExpr(E);
1088  unsigned NumSubExprs = Record.readInt();
1089  assert(NumSubExprs == E->getNumSubExprs() && "Wrong number of subexprs");
1090  for (unsigned I = 0; I != NumSubExprs; ++I)
1091  E->setSubExpr(I, Record.readSubExpr());
1092  E->setEqualOrColonLoc(readSourceLocation());
1093  E->setGNUSyntax(Record.readInt());
1094 
1095  SmallVector<Designator, 4> Designators;
1096  while (Record.getIdx() < Record.size()) {
1097  switch ((DesignatorTypes)Record.readInt()) {
1098  case DESIG_FIELD_DECL: {
1099  auto *Field = readDeclAs<FieldDecl>();
1100  SourceLocation DotLoc = readSourceLocation();
1101  SourceLocation FieldLoc = readSourceLocation();
1102  Designators.push_back(Designator(Field->getIdentifier(), DotLoc,
1103  FieldLoc));
1104  Designators.back().setField(Field);
1105  break;
1106  }
1107 
1108  case DESIG_FIELD_NAME: {
1109  const IdentifierInfo *Name = Record.readIdentifier();
1110  SourceLocation DotLoc = readSourceLocation();
1111  SourceLocation FieldLoc = readSourceLocation();
1112  Designators.push_back(Designator(Name, DotLoc, FieldLoc));
1113  break;
1114  }
1115 
1116  case DESIG_ARRAY: {
1117  unsigned Index = Record.readInt();
1118  SourceLocation LBracketLoc = readSourceLocation();
1119  SourceLocation RBracketLoc = readSourceLocation();
1120  Designators.push_back(Designator(Index, LBracketLoc, RBracketLoc));
1121  break;
1122  }
1123 
1124  case DESIG_ARRAY_RANGE: {
1125  unsigned Index = Record.readInt();
1126  SourceLocation LBracketLoc = readSourceLocation();
1127  SourceLocation EllipsisLoc = readSourceLocation();
1128  SourceLocation RBracketLoc = readSourceLocation();
1129  Designators.push_back(Designator(Index, LBracketLoc, EllipsisLoc,
1130  RBracketLoc));
1131  break;
1132  }
1133  }
1134  }
1135  E->setDesignators(Record.getContext(),
1136  Designators.data(), Designators.size());
1137 }
1138 
1139 void ASTStmtReader::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) {
1140  VisitExpr(E);
1141  E->setBase(Record.readSubExpr());
1142  E->setUpdater(Record.readSubExpr());
1143 }
1144 
1145 void ASTStmtReader::VisitNoInitExpr(NoInitExpr *E) {
1146  VisitExpr(E);
1147 }
1148 
1149 void ASTStmtReader::VisitArrayInitLoopExpr(ArrayInitLoopExpr *E) {
1150  VisitExpr(E);
1151  E->SubExprs[0] = Record.readSubExpr();
1152  E->SubExprs[1] = Record.readSubExpr();
1153 }
1154 
1155 void ASTStmtReader::VisitArrayInitIndexExpr(ArrayInitIndexExpr *E) {
1156  VisitExpr(E);
1157 }
1158 
1159 void ASTStmtReader::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) {
1160  VisitExpr(E);
1161 }
1162 
1163 void ASTStmtReader::VisitVAArgExpr(VAArgExpr *E) {
1164  VisitExpr(E);
1165  E->setSubExpr(Record.readSubExpr());
1166  E->setWrittenTypeInfo(readTypeSourceInfo());
1167  E->setBuiltinLoc(readSourceLocation());
1168  E->setRParenLoc(readSourceLocation());
1169  E->setIsMicrosoftABI(Record.readInt());
1170 }
1171 
1172 void ASTStmtReader::VisitSourceLocExpr(SourceLocExpr *E) {
1173  VisitExpr(E);
1174  E->ParentContext = readDeclAs<DeclContext>();
1175  E->BuiltinLoc = readSourceLocation();
1176  E->RParenLoc = readSourceLocation();
1177  E->SourceLocExprBits.Kind =
1178  static_cast<SourceLocExpr::IdentKind>(Record.readInt());
1179 }
1180 
1181 void ASTStmtReader::VisitAddrLabelExpr(AddrLabelExpr *E) {
1182  VisitExpr(E);
1183  E->setAmpAmpLoc(readSourceLocation());
1184  E->setLabelLoc(readSourceLocation());
1185  E->setLabel(readDeclAs<LabelDecl>());
1186 }
1187 
1188 void ASTStmtReader::VisitStmtExpr(StmtExpr *E) {
1189  VisitExpr(E);
1190  E->setLParenLoc(readSourceLocation());
1191  E->setRParenLoc(readSourceLocation());
1192  E->setSubStmt(cast_or_null<CompoundStmt>(Record.readSubStmt()));
1193 }
1194 
1195 void ASTStmtReader::VisitChooseExpr(ChooseExpr *E) {
1196  VisitExpr(E);
1197  E->setCond(Record.readSubExpr());
1198  E->setLHS(Record.readSubExpr());
1199  E->setRHS(Record.readSubExpr());
1200  E->setBuiltinLoc(readSourceLocation());
1201  E->setRParenLoc(readSourceLocation());
1202  E->setIsConditionTrue(Record.readInt());
1203 }
1204 
1205 void ASTStmtReader::VisitGNUNullExpr(GNUNullExpr *E) {
1206  VisitExpr(E);
1207  E->setTokenLocation(readSourceLocation());
1208 }
1209 
1210 void ASTStmtReader::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
1211  VisitExpr(E);
1213  unsigned NumExprs = Record.readInt();
1214  while (NumExprs--)
1215  Exprs.push_back(Record.readSubExpr());
1216  E->setExprs(Record.getContext(), Exprs);
1217  E->setBuiltinLoc(readSourceLocation());
1218  E->setRParenLoc(readSourceLocation());
1219 }
1220 
1221 void ASTStmtReader::VisitConvertVectorExpr(ConvertVectorExpr *E) {
1222  VisitExpr(E);
1223  E->BuiltinLoc = readSourceLocation();
1224  E->RParenLoc = readSourceLocation();
1225  E->TInfo = readTypeSourceInfo();
1226  E->SrcExpr = Record.readSubExpr();
1227 }
1228 
1229 void ASTStmtReader::VisitBlockExpr(BlockExpr *E) {
1230  VisitExpr(E);
1231  E->setBlockDecl(readDeclAs<BlockDecl>());
1232 }
1233 
1234 void ASTStmtReader::VisitGenericSelectionExpr(GenericSelectionExpr *E) {
1235  VisitExpr(E);
1236 
1237  unsigned NumAssocs = Record.readInt();
1238  assert(NumAssocs == E->getNumAssocs() && "Wrong NumAssocs!");
1239  E->ResultIndex = Record.readInt();
1240  E->GenericSelectionExprBits.GenericLoc = readSourceLocation();
1241  E->DefaultLoc = readSourceLocation();
1242  E->RParenLoc = readSourceLocation();
1243 
1244  Stmt **Stmts = E->getTrailingObjects<Stmt *>();
1245  // Add 1 to account for the controlling expression which is the first
1246  // expression in the trailing array of Stmt *. This is not needed for
1247  // the trailing array of TypeSourceInfo *.
1248  for (unsigned I = 0, N = NumAssocs + 1; I < N; ++I)
1249  Stmts[I] = Record.readSubExpr();
1250 
1251  TypeSourceInfo **TSIs = E->getTrailingObjects<TypeSourceInfo *>();
1252  for (unsigned I = 0, N = NumAssocs; I < N; ++I)
1253  TSIs[I] = readTypeSourceInfo();
1254 }
1255 
1256 void ASTStmtReader::VisitPseudoObjectExpr(PseudoObjectExpr *E) {
1257  VisitExpr(E);
1258  unsigned numSemanticExprs = Record.readInt();
1259  assert(numSemanticExprs + 1 == E->PseudoObjectExprBits.NumSubExprs);
1260  E->PseudoObjectExprBits.ResultIndex = Record.readInt();
1261 
1262  // Read the syntactic expression.
1263  E->getSubExprsBuffer()[0] = Record.readSubExpr();
1264 
1265  // Read all the semantic expressions.
1266  for (unsigned i = 0; i != numSemanticExprs; ++i) {
1267  Expr *subExpr = Record.readSubExpr();
1268  E->getSubExprsBuffer()[i+1] = subExpr;
1269  }
1270 }
1271 
1272 void ASTStmtReader::VisitAtomicExpr(AtomicExpr *E) {
1273  VisitExpr(E);
1274  E->Op = AtomicExpr::AtomicOp(Record.readInt());
1275  E->NumSubExprs = AtomicExpr::getNumSubExprs(E->Op);
1276  for (unsigned I = 0; I != E->NumSubExprs; ++I)
1277  E->SubExprs[I] = Record.readSubExpr();
1278  E->BuiltinLoc = readSourceLocation();
1279  E->RParenLoc = readSourceLocation();
1280 }
1281 
1282 //===----------------------------------------------------------------------===//
1283 // Objective-C Expressions and Statements
1284 
1285 void ASTStmtReader::VisitObjCStringLiteral(ObjCStringLiteral *E) {
1286  VisitExpr(E);
1287  E->setString(cast<StringLiteral>(Record.readSubStmt()));
1288  E->setAtLoc(readSourceLocation());
1289 }
1290 
1291 void ASTStmtReader::VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
1292  VisitExpr(E);
1293  // could be one of several IntegerLiteral, FloatLiteral, etc.
1294  E->SubExpr = Record.readSubStmt();
1295  E->BoxingMethod = readDeclAs<ObjCMethodDecl>();
1296  E->Range = readSourceRange();
1297 }
1298 
1299 void ASTStmtReader::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
1300  VisitExpr(E);
1301  unsigned NumElements = Record.readInt();
1302  assert(NumElements == E->getNumElements() && "Wrong number of elements");
1303  Expr **Elements = E->getElements();
1304  for (unsigned I = 0, N = NumElements; I != N; ++I)
1305  Elements[I] = Record.readSubExpr();
1306  E->ArrayWithObjectsMethod = readDeclAs<ObjCMethodDecl>();
1307  E->Range = readSourceRange();
1308 }
1309 
1310 void ASTStmtReader::VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *E) {
1311  VisitExpr(E);
1312  unsigned NumElements = Record.readInt();
1313  assert(NumElements == E->getNumElements() && "Wrong number of elements");
1314  bool HasPackExpansions = Record.readInt();
1315  assert(HasPackExpansions == E->HasPackExpansions &&"Pack expansion mismatch");
1316  auto *KeyValues =
1317  E->getTrailingObjects<ObjCDictionaryLiteral::KeyValuePair>();
1318  auto *Expansions =
1319  E->getTrailingObjects<ObjCDictionaryLiteral::ExpansionData>();
1320  for (unsigned I = 0; I != NumElements; ++I) {
1321  KeyValues[I].Key = Record.readSubExpr();
1322  KeyValues[I].Value = Record.readSubExpr();
1323  if (HasPackExpansions) {
1324  Expansions[I].EllipsisLoc = readSourceLocation();
1325  Expansions[I].NumExpansionsPlusOne = Record.readInt();
1326  }
1327  }
1328  E->DictWithObjectsMethod = readDeclAs<ObjCMethodDecl>();
1329  E->Range = readSourceRange();
1330 }
1331 
1332 void ASTStmtReader::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
1333  VisitExpr(E);
1334  E->setEncodedTypeSourceInfo(readTypeSourceInfo());
1335  E->setAtLoc(readSourceLocation());
1336  E->setRParenLoc(readSourceLocation());
1337 }
1338 
1339 void ASTStmtReader::VisitObjCSelectorExpr(ObjCSelectorExpr *E) {
1340  VisitExpr(E);
1341  E->setSelector(Record.readSelector());
1342  E->setAtLoc(readSourceLocation());
1343  E->setRParenLoc(readSourceLocation());
1344 }
1345 
1346 void ASTStmtReader::VisitObjCProtocolExpr(ObjCProtocolExpr *E) {
1347  VisitExpr(E);
1348  E->setProtocol(readDeclAs<ObjCProtocolDecl>());
1349  E->setAtLoc(readSourceLocation());
1350  E->ProtoLoc = readSourceLocation();
1351  E->setRParenLoc(readSourceLocation());
1352 }
1353 
1354 void ASTStmtReader::VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) {
1355  VisitExpr(E);
1356  E->setDecl(readDeclAs<ObjCIvarDecl>());
1357  E->setLocation(readSourceLocation());
1358  E->setOpLoc(readSourceLocation());
1359  E->setBase(Record.readSubExpr());
1360  E->setIsArrow(Record.readInt());
1361  E->setIsFreeIvar(Record.readInt());
1362 }
1363 
1364 void ASTStmtReader::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
1365  VisitExpr(E);
1366  unsigned MethodRefFlags = Record.readInt();
1367  bool Implicit = Record.readInt() != 0;
1368  if (Implicit) {
1369  auto *Getter = readDeclAs<ObjCMethodDecl>();
1370  auto *Setter = readDeclAs<ObjCMethodDecl>();
1371  E->setImplicitProperty(Getter, Setter, MethodRefFlags);
1372  } else {
1373  E->setExplicitProperty(readDeclAs<ObjCPropertyDecl>(), MethodRefFlags);
1374  }
1375  E->setLocation(readSourceLocation());
1376  E->setReceiverLocation(readSourceLocation());
1377  switch (Record.readInt()) {
1378  case 0:
1379  E->setBase(Record.readSubExpr());
1380  break;
1381  case 1:
1382  E->setSuperReceiver(Record.readType());
1383  break;
1384  case 2:
1385  E->setClassReceiver(readDeclAs<ObjCInterfaceDecl>());
1386  break;
1387  }
1388 }
1389 
1390 void ASTStmtReader::VisitObjCSubscriptRefExpr(ObjCSubscriptRefExpr *E) {
1391  VisitExpr(E);
1392  E->setRBracket(readSourceLocation());
1393  E->setBaseExpr(Record.readSubExpr());
1394  E->setKeyExpr(Record.readSubExpr());
1395  E->GetAtIndexMethodDecl = readDeclAs<ObjCMethodDecl>();
1396  E->SetAtIndexMethodDecl = readDeclAs<ObjCMethodDecl>();
1397 }
1398 
1399 void ASTStmtReader::VisitObjCMessageExpr(ObjCMessageExpr *E) {
1400  VisitExpr(E);
1401  assert(Record.peekInt() == E->getNumArgs());
1402  Record.skipInts(1);
1403  unsigned NumStoredSelLocs = Record.readInt();
1404  E->SelLocsKind = Record.readInt();
1405  E->setDelegateInitCall(Record.readInt());
1406  E->IsImplicit = Record.readInt();
1407  auto Kind = static_cast<ObjCMessageExpr::ReceiverKind>(Record.readInt());
1408  switch (Kind) {
1410  E->setInstanceReceiver(Record.readSubExpr());
1411  break;
1412 
1414  E->setClassReceiver(readTypeSourceInfo());
1415  break;
1416 
1419  QualType T = Record.readType();
1420  SourceLocation SuperLoc = readSourceLocation();
1421  E->setSuper(SuperLoc, T, Kind == ObjCMessageExpr::SuperInstance);
1422  break;
1423  }
1424  }
1425 
1426  assert(Kind == E->getReceiverKind());
1427 
1428  if (Record.readInt())
1429  E->setMethodDecl(readDeclAs<ObjCMethodDecl>());
1430  else
1431  E->setSelector(Record.readSelector());
1432 
1433  E->LBracLoc = readSourceLocation();
1434  E->RBracLoc = readSourceLocation();
1435 
1436  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1437  E->setArg(I, Record.readSubExpr());
1438 
1439  SourceLocation *Locs = E->getStoredSelLocs();
1440  for (unsigned I = 0; I != NumStoredSelLocs; ++I)
1441  Locs[I] = readSourceLocation();
1442 }
1443 
1444 void ASTStmtReader::VisitObjCForCollectionStmt(ObjCForCollectionStmt *S) {
1445  VisitStmt(S);
1446  S->setElement(Record.readSubStmt());
1447  S->setCollection(Record.readSubExpr());
1448  S->setBody(Record.readSubStmt());
1449  S->setForLoc(readSourceLocation());
1450  S->setRParenLoc(readSourceLocation());
1451 }
1452 
1453 void ASTStmtReader::VisitObjCAtCatchStmt(ObjCAtCatchStmt *S) {
1454  VisitStmt(S);
1455  S->setCatchBody(Record.readSubStmt());
1456  S->setCatchParamDecl(readDeclAs<VarDecl>());
1457  S->setAtCatchLoc(readSourceLocation());
1458  S->setRParenLoc(readSourceLocation());
1459 }
1460 
1461 void ASTStmtReader::VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S) {
1462  VisitStmt(S);
1463  S->setFinallyBody(Record.readSubStmt());
1464  S->setAtFinallyLoc(readSourceLocation());
1465 }
1466 
1467 void ASTStmtReader::VisitObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S) {
1468  VisitStmt(S); // FIXME: no test coverage.
1469  S->setSubStmt(Record.readSubStmt());
1470  S->setAtLoc(readSourceLocation());
1471 }
1472 
1473 void ASTStmtReader::VisitObjCAtTryStmt(ObjCAtTryStmt *S) {
1474  VisitStmt(S);
1475  assert(Record.peekInt() == S->getNumCatchStmts());
1476  Record.skipInts(1);
1477  bool HasFinally = Record.readInt();
1478  S->setTryBody(Record.readSubStmt());
1479  for (unsigned I = 0, N = S->getNumCatchStmts(); I != N; ++I)
1480  S->setCatchStmt(I, cast_or_null<ObjCAtCatchStmt>(Record.readSubStmt()));
1481 
1482  if (HasFinally)
1483  S->setFinallyStmt(Record.readSubStmt());
1484  S->setAtTryLoc(readSourceLocation());
1485 }
1486 
1487 void ASTStmtReader::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
1488  VisitStmt(S); // FIXME: no test coverage.
1489  S->setSynchExpr(Record.readSubStmt());
1490  S->setSynchBody(Record.readSubStmt());
1491  S->setAtSynchronizedLoc(readSourceLocation());
1492 }
1493 
1494 void ASTStmtReader::VisitObjCAtThrowStmt(ObjCAtThrowStmt *S) {
1495  VisitStmt(S); // FIXME: no test coverage.
1496  S->setThrowExpr(Record.readSubStmt());
1497  S->setThrowLoc(readSourceLocation());
1498 }
1499 
1500 void ASTStmtReader::VisitObjCBoolLiteralExpr(ObjCBoolLiteralExpr *E) {
1501  VisitExpr(E);
1502  E->setValue(Record.readInt());
1503  E->setLocation(readSourceLocation());
1504 }
1505 
1506 void ASTStmtReader::VisitObjCAvailabilityCheckExpr(ObjCAvailabilityCheckExpr *E) {
1507  VisitExpr(E);
1508  SourceRange R = Record.readSourceRange();
1509  E->AtLoc = R.getBegin();
1510  E->RParen = R.getEnd();
1511  E->VersionToCheck = Record.readVersionTuple();
1512 }
1513 
1514 //===----------------------------------------------------------------------===//
1515 // C++ Expressions and Statements
1516 //===----------------------------------------------------------------------===//
1517 
1518 void ASTStmtReader::VisitCXXCatchStmt(CXXCatchStmt *S) {
1519  VisitStmt(S);
1520  S->CatchLoc = readSourceLocation();
1521  S->ExceptionDecl = readDeclAs<VarDecl>();
1522  S->HandlerBlock = Record.readSubStmt();
1523 }
1524 
1525 void ASTStmtReader::VisitCXXTryStmt(CXXTryStmt *S) {
1526  VisitStmt(S);
1527  assert(Record.peekInt() == S->getNumHandlers() && "NumStmtFields is wrong ?");
1528  Record.skipInts(1);
1529  S->TryLoc = readSourceLocation();
1530  S->getStmts()[0] = Record.readSubStmt();
1531  for (unsigned i = 0, e = S->getNumHandlers(); i != e; ++i)
1532  S->getStmts()[i + 1] = Record.readSubStmt();
1533 }
1534 
1535 void ASTStmtReader::VisitCXXForRangeStmt(CXXForRangeStmt *S) {
1536  VisitStmt(S);
1537  S->ForLoc = readSourceLocation();
1538  S->CoawaitLoc = readSourceLocation();
1539  S->ColonLoc = readSourceLocation();
1540  S->RParenLoc = readSourceLocation();
1541  S->setInit(Record.readSubStmt());
1542  S->setRangeStmt(Record.readSubStmt());
1543  S->setBeginStmt(Record.readSubStmt());
1544  S->setEndStmt(Record.readSubStmt());
1545  S->setCond(Record.readSubExpr());
1546  S->setInc(Record.readSubExpr());
1547  S->setLoopVarStmt(Record.readSubStmt());
1548  S->setBody(Record.readSubStmt());
1549 }
1550 
1551 void ASTStmtReader::VisitMSDependentExistsStmt(MSDependentExistsStmt *S) {
1552  VisitStmt(S);
1553  S->KeywordLoc = readSourceLocation();
1554  S->IsIfExists = Record.readInt();
1555  S->QualifierLoc = Record.readNestedNameSpecifierLoc();
1556  S->NameInfo = Record.readDeclarationNameInfo();
1557  S->SubStmt = Record.readSubStmt();
1558 }
1559 
1560 void ASTStmtReader::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
1561  VisitCallExpr(E);
1562  E->CXXOperatorCallExprBits.OperatorKind = Record.readInt();
1563  E->CXXOperatorCallExprBits.FPFeatures = Record.readInt();
1564  E->Range = Record.readSourceRange();
1565 }
1566 
1567 void ASTStmtReader::VisitCXXRewrittenBinaryOperator(
1569  VisitExpr(E);
1570  E->CXXRewrittenBinaryOperatorBits.IsReversed = Record.readInt();
1571  E->SemanticForm = Record.readSubExpr();
1572 }
1573 
1574 void ASTStmtReader::VisitCXXConstructExpr(CXXConstructExpr *E) {
1575  VisitExpr(E);
1576 
1577  unsigned NumArgs = Record.readInt();
1578  assert((NumArgs == E->getNumArgs()) && "Wrong NumArgs!");
1579 
1580  E->CXXConstructExprBits.Elidable = Record.readInt();
1581  E->CXXConstructExprBits.HadMultipleCandidates = Record.readInt();
1582  E->CXXConstructExprBits.ListInitialization = Record.readInt();
1583  E->CXXConstructExprBits.StdInitListInitialization = Record.readInt();
1584  E->CXXConstructExprBits.ZeroInitialization = Record.readInt();
1585  E->CXXConstructExprBits.ConstructionKind = Record.readInt();
1586  E->CXXConstructExprBits.Loc = readSourceLocation();
1587  E->Constructor = readDeclAs<CXXConstructorDecl>();
1588  E->ParenOrBraceRange = readSourceRange();
1589 
1590  for (unsigned I = 0; I != NumArgs; ++I)
1591  E->setArg(I, Record.readSubExpr());
1592 }
1593 
1594 void ASTStmtReader::VisitCXXInheritedCtorInitExpr(CXXInheritedCtorInitExpr *E) {
1595  VisitExpr(E);
1596  E->Constructor = readDeclAs<CXXConstructorDecl>();
1597  E->Loc = readSourceLocation();
1598  E->ConstructsVirtualBase = Record.readInt();
1599  E->InheritedFromVirtualBase = Record.readInt();
1600 }
1601 
1602 void ASTStmtReader::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
1603  VisitCXXConstructExpr(E);
1604  E->TSI = readTypeSourceInfo();
1605 }
1606 
1607 void ASTStmtReader::VisitLambdaExpr(LambdaExpr *E) {
1608  VisitExpr(E);
1609  unsigned NumCaptures = Record.readInt();
1610  assert(NumCaptures == E->NumCaptures);(void)NumCaptures;
1611  E->IntroducerRange = readSourceRange();
1612  E->CaptureDefault = static_cast<LambdaCaptureDefault>(Record.readInt());
1613  E->CaptureDefaultLoc = readSourceLocation();
1614  E->ExplicitParams = Record.readInt();
1615  E->ExplicitResultType = Record.readInt();
1616  E->ClosingBrace = readSourceLocation();
1617 
1618  // Read capture initializers.
1620  CEnd = E->capture_init_end();
1621  C != CEnd; ++C)
1622  *C = Record.readSubExpr();
1623 }
1624 
1625 void
1626 ASTStmtReader::VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E) {
1627  VisitExpr(E);
1628  E->SubExpr = Record.readSubExpr();
1629 }
1630 
1631 void ASTStmtReader::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) {
1632  VisitExplicitCastExpr(E);
1633  SourceRange R = readSourceRange();
1634  E->Loc = R.getBegin();
1635  E->RParenLoc = R.getEnd();
1636  R = readSourceRange();
1637  E->AngleBrackets = R;
1638 }
1639 
1640 void ASTStmtReader::VisitCXXStaticCastExpr(CXXStaticCastExpr *E) {
1641  return VisitCXXNamedCastExpr(E);
1642 }
1643 
1644 void ASTStmtReader::VisitCXXDynamicCastExpr(CXXDynamicCastExpr *E) {
1645  return VisitCXXNamedCastExpr(E);
1646 }
1647 
1648 void ASTStmtReader::VisitCXXReinterpretCastExpr(CXXReinterpretCastExpr *E) {
1649  return VisitCXXNamedCastExpr(E);
1650 }
1651 
1652 void ASTStmtReader::VisitCXXConstCastExpr(CXXConstCastExpr *E) {
1653  return VisitCXXNamedCastExpr(E);
1654 }
1655 
1656 void ASTStmtReader::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E) {
1657  VisitExplicitCastExpr(E);
1658  E->setLParenLoc(readSourceLocation());
1659  E->setRParenLoc(readSourceLocation());
1660 }
1661 
1662 void ASTStmtReader::VisitBuiltinBitCastExpr(BuiltinBitCastExpr *E) {
1663  VisitExplicitCastExpr(E);
1664  E->KWLoc = readSourceLocation();
1665  E->RParenLoc = readSourceLocation();
1666 }
1667 
1668 void ASTStmtReader::VisitUserDefinedLiteral(UserDefinedLiteral *E) {
1669  VisitCallExpr(E);
1670  E->UDSuffixLoc = readSourceLocation();
1671 }
1672 
1673 void ASTStmtReader::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) {
1674  VisitExpr(E);
1675  E->setValue(Record.readInt());
1676  E->setLocation(readSourceLocation());
1677 }
1678 
1679 void ASTStmtReader::VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E) {
1680  VisitExpr(E);
1681  E->setLocation(readSourceLocation());
1682 }
1683 
1684 void ASTStmtReader::VisitCXXTypeidExpr(CXXTypeidExpr *E) {
1685  VisitExpr(E);
1686  E->setSourceRange(readSourceRange());
1687  if (E->isTypeOperand()) { // typeid(int)
1689  readTypeSourceInfo());
1690  return;
1691  }
1692 
1693  // typeid(42+2)
1694  E->setExprOperand(Record.readSubExpr());
1695 }
1696 
1697 void ASTStmtReader::VisitCXXThisExpr(CXXThisExpr *E) {
1698  VisitExpr(E);
1699  E->setLocation(readSourceLocation());
1700  E->setImplicit(Record.readInt());
1701 }
1702 
1703 void ASTStmtReader::VisitCXXThrowExpr(CXXThrowExpr *E) {
1704  VisitExpr(E);
1705  E->CXXThrowExprBits.ThrowLoc = readSourceLocation();
1706  E->Operand = Record.readSubExpr();
1707  E->CXXThrowExprBits.IsThrownVariableInScope = Record.readInt();
1708 }
1709 
1710 void ASTStmtReader::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
1711  VisitExpr(E);
1712  E->Param = readDeclAs<ParmVarDecl>();
1713  E->UsedContext = readDeclAs<DeclContext>();
1714  E->CXXDefaultArgExprBits.Loc = readSourceLocation();
1715 }
1716 
1717 void ASTStmtReader::VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E) {
1718  VisitExpr(E);
1719  E->Field = readDeclAs<FieldDecl>();
1720  E->UsedContext = readDeclAs<DeclContext>();
1721  E->CXXDefaultInitExprBits.Loc = readSourceLocation();
1722 }
1723 
1724 void ASTStmtReader::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
1725  VisitExpr(E);
1726  E->setTemporary(Record.readCXXTemporary());
1727  E->setSubExpr(Record.readSubExpr());
1728 }
1729 
1730 void ASTStmtReader::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
1731  VisitExpr(E);
1732  E->TypeInfo = readTypeSourceInfo();
1733  E->CXXScalarValueInitExprBits.RParenLoc = readSourceLocation();
1734 }
1735 
1736 void ASTStmtReader::VisitCXXNewExpr(CXXNewExpr *E) {
1737  VisitExpr(E);
1738 
1739  bool IsArray = Record.readInt();
1740  bool HasInit = Record.readInt();
1741  unsigned NumPlacementArgs = Record.readInt();
1742  bool IsParenTypeId = Record.readInt();
1743 
1744  E->CXXNewExprBits.IsGlobalNew = Record.readInt();
1745  E->CXXNewExprBits.ShouldPassAlignment = Record.readInt();
1746  E->CXXNewExprBits.UsualArrayDeleteWantsSize = Record.readInt();
1747  E->CXXNewExprBits.StoredInitializationStyle = Record.readInt();
1748 
1749  assert((IsArray == E->isArray()) && "Wrong IsArray!");
1750  assert((HasInit == E->hasInitializer()) && "Wrong HasInit!");
1751  assert((NumPlacementArgs == E->getNumPlacementArgs()) &&
1752  "Wrong NumPlacementArgs!");
1753  assert((IsParenTypeId == E->isParenTypeId()) && "Wrong IsParenTypeId!");
1754  (void)IsArray;
1755  (void)HasInit;
1756  (void)NumPlacementArgs;
1757 
1758  E->setOperatorNew(readDeclAs<FunctionDecl>());
1759  E->setOperatorDelete(readDeclAs<FunctionDecl>());
1760  E->AllocatedTypeInfo = readTypeSourceInfo();
1761  if (IsParenTypeId)
1762  E->getTrailingObjects<SourceRange>()[0] = readSourceRange();
1763  E->Range = readSourceRange();
1764  E->DirectInitRange = readSourceRange();
1765 
1766  // Install all the subexpressions.
1768  N = E->raw_arg_end();
1769  I != N; ++I)
1770  *I = Record.readSubStmt();
1771 }
1772 
1773 void ASTStmtReader::VisitCXXDeleteExpr(CXXDeleteExpr *E) {
1774  VisitExpr(E);
1775  E->CXXDeleteExprBits.GlobalDelete = Record.readInt();
1776  E->CXXDeleteExprBits.ArrayForm = Record.readInt();
1777  E->CXXDeleteExprBits.ArrayFormAsWritten = Record.readInt();
1778  E->CXXDeleteExprBits.UsualArrayDeleteWantsSize = Record.readInt();
1779  E->OperatorDelete = readDeclAs<FunctionDecl>();
1780  E->Argument = Record.readSubExpr();
1781  E->CXXDeleteExprBits.Loc = readSourceLocation();
1782 }
1783 
1784 void ASTStmtReader::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
1785  VisitExpr(E);
1786 
1787  E->Base = Record.readSubExpr();
1788  E->IsArrow = Record.readInt();
1789  E->OperatorLoc = readSourceLocation();
1790  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1791  E->ScopeType = readTypeSourceInfo();
1792  E->ColonColonLoc = readSourceLocation();
1793  E->TildeLoc = readSourceLocation();
1794 
1795  IdentifierInfo *II = Record.readIdentifier();
1796  if (II)
1797  E->setDestroyedType(II, readSourceLocation());
1798  else
1799  E->setDestroyedType(readTypeSourceInfo());
1800 }
1801 
1802 void ASTStmtReader::VisitExprWithCleanups(ExprWithCleanups *E) {
1803  VisitExpr(E);
1804 
1805  unsigned NumObjects = Record.readInt();
1806  assert(NumObjects == E->getNumObjects());
1807  for (unsigned i = 0; i != NumObjects; ++i)
1808  E->getTrailingObjects<BlockDecl *>()[i] =
1809  readDeclAs<BlockDecl>();
1810 
1811  E->ExprWithCleanupsBits.CleanupsHaveSideEffects = Record.readInt();
1812  E->SubExpr = Record.readSubExpr();
1813 }
1814 
1815 void ASTStmtReader::VisitCXXDependentScopeMemberExpr(
1817  VisitExpr(E);
1818 
1819  bool HasTemplateKWAndArgsInfo = Record.readInt();
1820  unsigned NumTemplateArgs = Record.readInt();
1821  bool HasFirstQualifierFoundInScope = Record.readInt();
1822 
1823  assert((HasTemplateKWAndArgsInfo == E->hasTemplateKWAndArgsInfo()) &&
1824  "Wrong HasTemplateKWAndArgsInfo!");
1825  assert(
1826  (HasFirstQualifierFoundInScope == E->hasFirstQualifierFoundInScope()) &&
1827  "Wrong HasFirstQualifierFoundInScope!");
1828 
1829  if (HasTemplateKWAndArgsInfo)
1830  ReadTemplateKWAndArgsInfo(
1831  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
1832  E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs);
1833 
1834  assert((NumTemplateArgs == E->getNumTemplateArgs()) &&
1835  "Wrong NumTemplateArgs!");
1836 
1837  E->CXXDependentScopeMemberExprBits.IsArrow = Record.readInt();
1838  E->CXXDependentScopeMemberExprBits.OperatorLoc = readSourceLocation();
1839  E->BaseType = Record.readType();
1840  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1841  E->Base = Record.readSubExpr();
1842 
1843  if (HasFirstQualifierFoundInScope)
1844  *E->getTrailingObjects<NamedDecl *>() = readDeclAs<NamedDecl>();
1845 
1846  E->MemberNameInfo = Record.readDeclarationNameInfo();
1847 }
1848 
1849 void
1850 ASTStmtReader::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) {
1851  VisitExpr(E);
1852 
1853  if (Record.readInt()) // HasTemplateKWAndArgsInfo
1854  ReadTemplateKWAndArgsInfo(
1855  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
1856  E->getTrailingObjects<TemplateArgumentLoc>(),
1857  /*NumTemplateArgs=*/Record.readInt());
1858 
1859  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1860  E->NameInfo = Record.readDeclarationNameInfo();
1861 }
1862 
1863 void
1864 ASTStmtReader::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E) {
1865  VisitExpr(E);
1866  assert(Record.peekInt() == E->arg_size() &&
1867  "Read wrong record during creation ?");
1868  Record.skipInts(1);
1869  for (unsigned I = 0, N = E->arg_size(); I != N; ++I)
1870  E->setArg(I, Record.readSubExpr());
1871  E->TSI = readTypeSourceInfo();
1872  E->setLParenLoc(readSourceLocation());
1873  E->setRParenLoc(readSourceLocation());
1874 }
1875 
1876 void ASTStmtReader::VisitOverloadExpr(OverloadExpr *E) {
1877  VisitExpr(E);
1878 
1879  unsigned NumResults = Record.readInt();
1880  bool HasTemplateKWAndArgsInfo = Record.readInt();
1881  assert((E->getNumDecls() == NumResults) && "Wrong NumResults!");
1882  assert((E->hasTemplateKWAndArgsInfo() == HasTemplateKWAndArgsInfo) &&
1883  "Wrong HasTemplateKWAndArgsInfo!");
1884 
1885  if (HasTemplateKWAndArgsInfo) {
1886  unsigned NumTemplateArgs = Record.readInt();
1887  ReadTemplateKWAndArgsInfo(*E->getTrailingASTTemplateKWAndArgsInfo(),
1889  NumTemplateArgs);
1890  assert((E->getNumTemplateArgs() == NumTemplateArgs) &&
1891  "Wrong NumTemplateArgs!");
1892  }
1893 
1894  UnresolvedSet<8> Decls;
1895  for (unsigned I = 0; I != NumResults; ++I) {
1896  auto *D = readDeclAs<NamedDecl>();
1897  auto AS = (AccessSpecifier)Record.readInt();
1898  Decls.addDecl(D, AS);
1899  }
1900 
1901  DeclAccessPair *Results = E->getTrailingResults();
1902  UnresolvedSetIterator Iter = Decls.begin();
1903  for (unsigned I = 0; I != NumResults; ++I) {
1904  Results[I] = (Iter + I).getPair();
1905  }
1906 
1907  E->NameInfo = Record.readDeclarationNameInfo();
1908  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1909 }
1910 
1911 void ASTStmtReader::VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
1912  VisitOverloadExpr(E);
1913  E->UnresolvedMemberExprBits.IsArrow = Record.readInt();
1914  E->UnresolvedMemberExprBits.HasUnresolvedUsing = Record.readInt();
1915  E->Base = Record.readSubExpr();
1916  E->BaseType = Record.readType();
1917  E->OperatorLoc = readSourceLocation();
1918 }
1919 
1920 void ASTStmtReader::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) {
1921  VisitOverloadExpr(E);
1922  E->UnresolvedLookupExprBits.RequiresADL = Record.readInt();
1923  E->UnresolvedLookupExprBits.Overloaded = Record.readInt();
1924  E->NamingClass = readDeclAs<CXXRecordDecl>();
1925 }
1926 
1927 void ASTStmtReader::VisitTypeTraitExpr(TypeTraitExpr *E) {
1928  VisitExpr(E);
1929  E->TypeTraitExprBits.NumArgs = Record.readInt();
1930  E->TypeTraitExprBits.Kind = Record.readInt();
1931  E->TypeTraitExprBits.Value = Record.readInt();
1932  SourceRange Range = readSourceRange();
1933  E->Loc = Range.getBegin();
1934  E->RParenLoc = Range.getEnd();
1935 
1936  auto **Args = E->getTrailingObjects<TypeSourceInfo *>();
1937  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1938  Args[I] = readTypeSourceInfo();
1939 }
1940 
1941 void ASTStmtReader::VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E) {
1942  VisitExpr(E);
1943  E->ATT = (ArrayTypeTrait)Record.readInt();
1944  E->Value = (unsigned int)Record.readInt();
1945  SourceRange Range = readSourceRange();
1946  E->Loc = Range.getBegin();
1947  E->RParen = Range.getEnd();
1948  E->QueriedType = readTypeSourceInfo();
1949  E->Dimension = Record.readSubExpr();
1950 }
1951 
1952 void ASTStmtReader::VisitExpressionTraitExpr(ExpressionTraitExpr *E) {
1953  VisitExpr(E);
1954  E->ET = (ExpressionTrait)Record.readInt();
1955  E->Value = (bool)Record.readInt();
1956  SourceRange Range = readSourceRange();
1957  E->QueriedExpression = Record.readSubExpr();
1958  E->Loc = Range.getBegin();
1959  E->RParen = Range.getEnd();
1960 }
1961 
1962 void ASTStmtReader::VisitCXXNoexceptExpr(CXXNoexceptExpr *E) {
1963  VisitExpr(E);
1964  E->CXXNoexceptExprBits.Value = Record.readInt();
1965  E->Range = readSourceRange();
1966  E->Operand = Record.readSubExpr();
1967 }
1968 
1969 void ASTStmtReader::VisitPackExpansionExpr(PackExpansionExpr *E) {
1970  VisitExpr(E);
1971  E->EllipsisLoc = readSourceLocation();
1972  E->NumExpansions = Record.readInt();
1973  E->Pattern = Record.readSubExpr();
1974 }
1975 
1976 void ASTStmtReader::VisitSizeOfPackExpr(SizeOfPackExpr *E) {
1977  VisitExpr(E);
1978  unsigned NumPartialArgs = Record.readInt();
1979  E->OperatorLoc = readSourceLocation();
1980  E->PackLoc = readSourceLocation();
1981  E->RParenLoc = readSourceLocation();
1982  E->Pack = Record.readDeclAs<NamedDecl>();
1983  if (E->isPartiallySubstituted()) {
1984  assert(E->Length == NumPartialArgs);
1985  for (auto *I = E->getTrailingObjects<TemplateArgument>(),
1986  *E = I + NumPartialArgs;
1987  I != E; ++I)
1988  new (I) TemplateArgument(Record.readTemplateArgument());
1989  } else if (!E->isValueDependent()) {
1990  E->Length = Record.readInt();
1991  }
1992 }
1993 
1994 void ASTStmtReader::VisitSubstNonTypeTemplateParmExpr(
1996  VisitExpr(E);
1997  E->Param = readDeclAs<NonTypeTemplateParmDecl>();
1998  E->SubstNonTypeTemplateParmExprBits.NameLoc = readSourceLocation();
1999  E->Replacement = Record.readSubExpr();
2000 }
2001 
2002 void ASTStmtReader::VisitSubstNonTypeTemplateParmPackExpr(
2004  VisitExpr(E);
2005  E->Param = readDeclAs<NonTypeTemplateParmDecl>();
2006  TemplateArgument ArgPack = Record.readTemplateArgument();
2007  if (ArgPack.getKind() != TemplateArgument::Pack)
2008  return;
2009 
2010  E->Arguments = ArgPack.pack_begin();
2011  E->NumArguments = ArgPack.pack_size();
2012  E->NameLoc = readSourceLocation();
2013 }
2014 
2015 void ASTStmtReader::VisitFunctionParmPackExpr(FunctionParmPackExpr *E) {
2016  VisitExpr(E);
2017  E->NumParameters = Record.readInt();
2018  E->ParamPack = readDeclAs<ParmVarDecl>();
2019  E->NameLoc = readSourceLocation();
2020  auto **Parms = E->getTrailingObjects<VarDecl *>();
2021  for (unsigned i = 0, n = E->NumParameters; i != n; ++i)
2022  Parms[i] = readDeclAs<VarDecl>();
2023 }
2024 
2025 void ASTStmtReader::VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E) {
2026  VisitExpr(E);
2027  bool HasMaterialzedDecl = Record.readInt();
2028  if (HasMaterialzedDecl)
2029  E->State = cast<LifetimeExtendedTemporaryDecl>(Record.readDecl());
2030  else
2031  E->State = Record.readSubExpr();
2032 }
2033 
2034 void ASTStmtReader::VisitCXXFoldExpr(CXXFoldExpr *E) {
2035  VisitExpr(E);
2036  E->LParenLoc = readSourceLocation();
2037  E->EllipsisLoc = readSourceLocation();
2038  E->RParenLoc = readSourceLocation();
2039  E->NumExpansions = Record.readInt();
2040  E->SubExprs[0] = Record.readSubExpr();
2041  E->SubExprs[1] = Record.readSubExpr();
2042  E->Opcode = (BinaryOperatorKind)Record.readInt();
2043 }
2044 
2045 void ASTStmtReader::VisitOpaqueValueExpr(OpaqueValueExpr *E) {
2046  VisitExpr(E);
2047  E->SourceExpr = Record.readSubExpr();
2048  E->OpaqueValueExprBits.Loc = readSourceLocation();
2049  E->setIsUnique(Record.readInt());
2050 }
2051 
2052 void ASTStmtReader::VisitTypoExpr(TypoExpr *E) {
2053  llvm_unreachable("Cannot read TypoExpr nodes");
2054 }
2055 
2056 //===----------------------------------------------------------------------===//
2057 // Microsoft Expressions and Statements
2058 //===----------------------------------------------------------------------===//
2059 void ASTStmtReader::VisitMSPropertyRefExpr(MSPropertyRefExpr *E) {
2060  VisitExpr(E);
2061  E->IsArrow = (Record.readInt() != 0);
2062  E->BaseExpr = Record.readSubExpr();
2063  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
2064  E->MemberLoc = readSourceLocation();
2065  E->TheDecl = readDeclAs<MSPropertyDecl>();
2066 }
2067 
2068 void ASTStmtReader::VisitMSPropertySubscriptExpr(MSPropertySubscriptExpr *E) {
2069  VisitExpr(E);
2070  E->setBase(Record.readSubExpr());
2071  E->setIdx(Record.readSubExpr());
2072  E->setRBracketLoc(readSourceLocation());
2073 }
2074 
2075 void ASTStmtReader::VisitCXXUuidofExpr(CXXUuidofExpr *E) {
2076  VisitExpr(E);
2077  E->setSourceRange(readSourceRange());
2078  std::string UuidStr = readString();
2079  E->setUuidStr(StringRef(UuidStr).copy(Record.getContext()));
2080  if (E->isTypeOperand()) { // __uuidof(ComType)
2082  readTypeSourceInfo());
2083  return;
2084  }
2085 
2086  // __uuidof(expr)
2087  E->setExprOperand(Record.readSubExpr());
2088 }
2089 
2090 void ASTStmtReader::VisitSEHLeaveStmt(SEHLeaveStmt *S) {
2091  VisitStmt(S);
2092  S->setLeaveLoc(readSourceLocation());
2093 }
2094 
2095 void ASTStmtReader::VisitSEHExceptStmt(SEHExceptStmt *S) {
2096  VisitStmt(S);
2097  S->Loc = readSourceLocation();
2098  S->Children[SEHExceptStmt::FILTER_EXPR] = Record.readSubStmt();
2099  S->Children[SEHExceptStmt::BLOCK] = Record.readSubStmt();
2100 }
2101 
2102 void ASTStmtReader::VisitSEHFinallyStmt(SEHFinallyStmt *S) {
2103  VisitStmt(S);
2104  S->Loc = readSourceLocation();
2105  S->Block = Record.readSubStmt();
2106 }
2107 
2108 void ASTStmtReader::VisitSEHTryStmt(SEHTryStmt *S) {
2109  VisitStmt(S);
2110  S->IsCXXTry = Record.readInt();
2111  S->TryLoc = readSourceLocation();
2112  S->Children[SEHTryStmt::TRY] = Record.readSubStmt();
2113  S->Children[SEHTryStmt::HANDLER] = Record.readSubStmt();
2114 }
2115 
2116 //===----------------------------------------------------------------------===//
2117 // CUDA Expressions and Statements
2118 //===----------------------------------------------------------------------===//
2119 
2120 void ASTStmtReader::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E) {
2121  VisitCallExpr(E);
2122  E->setPreArg(CUDAKernelCallExpr::CONFIG, Record.readSubExpr());
2123 }
2124 
2125 //===----------------------------------------------------------------------===//
2126 // OpenCL Expressions and Statements.
2127 //===----------------------------------------------------------------------===//
2128 void ASTStmtReader::VisitAsTypeExpr(AsTypeExpr *E) {
2129  VisitExpr(E);
2130  E->BuiltinLoc = readSourceLocation();
2131  E->RParenLoc = readSourceLocation();
2132  E->SrcExpr = Record.readSubExpr();
2133 }
2134 
2135 //===----------------------------------------------------------------------===//
2136 // OpenMP Directives.
2137 //===----------------------------------------------------------------------===//
2138 
2139 void ASTStmtReader::VisitOMPExecutableDirective(OMPExecutableDirective *E) {
2140  E->setLocStart(readSourceLocation());
2141  E->setLocEnd(readSourceLocation());
2143  for (unsigned i = 0; i < E->getNumClauses(); ++i)
2144  Clauses.push_back(Record.readOMPClause());
2145  E->setClauses(Clauses);
2146  if (E->hasAssociatedStmt())
2147  E->setAssociatedStmt(Record.readSubStmt());
2148 }
2149 
2150 void ASTStmtReader::VisitOMPLoopDirective(OMPLoopDirective *D) {
2151  VisitStmt(D);
2152  // Two fields (NumClauses and CollapsedNum) were read in ReadStmtFromStream.
2153  Record.skipInts(2);
2154  VisitOMPExecutableDirective(D);
2155  D->setIterationVariable(Record.readSubExpr());
2156  D->setLastIteration(Record.readSubExpr());
2157  D->setCalcLastIteration(Record.readSubExpr());
2158  D->setPreCond(Record.readSubExpr());
2159  D->setCond(Record.readSubExpr());
2160  D->setInit(Record.readSubExpr());
2161  D->setInc(Record.readSubExpr());
2162  D->setPreInits(Record.readSubStmt());
2166  D->setIsLastIterVariable(Record.readSubExpr());
2167  D->setLowerBoundVariable(Record.readSubExpr());
2168  D->setUpperBoundVariable(Record.readSubExpr());
2169  D->setStrideVariable(Record.readSubExpr());
2170  D->setEnsureUpperBound(Record.readSubExpr());
2171  D->setNextLowerBound(Record.readSubExpr());
2172  D->setNextUpperBound(Record.readSubExpr());
2173  D->setNumIterations(Record.readSubExpr());
2174  }
2176  D->setPrevLowerBoundVariable(Record.readSubExpr());
2177  D->setPrevUpperBoundVariable(Record.readSubExpr());
2178  D->setDistInc(Record.readSubExpr());
2179  D->setPrevEnsureUpperBound(Record.readSubExpr());
2180  D->setCombinedLowerBoundVariable(Record.readSubExpr());
2181  D->setCombinedUpperBoundVariable(Record.readSubExpr());
2182  D->setCombinedEnsureUpperBound(Record.readSubExpr());
2183  D->setCombinedInit(Record.readSubExpr());
2184  D->setCombinedCond(Record.readSubExpr());
2185  D->setCombinedNextLowerBound(Record.readSubExpr());
2186  D->setCombinedNextUpperBound(Record.readSubExpr());
2187  D->setCombinedDistCond(Record.readSubExpr());
2188  D->setCombinedParForInDistCond(Record.readSubExpr());
2189  }
2191  unsigned CollapsedNum = D->getCollapsedNumber();
2192  Sub.reserve(CollapsedNum);
2193  for (unsigned i = 0; i < CollapsedNum; ++i)
2194  Sub.push_back(Record.readSubExpr());
2195  D->setCounters(Sub);
2196  Sub.clear();
2197  for (unsigned i = 0; i < CollapsedNum; ++i)
2198  Sub.push_back(Record.readSubExpr());
2199  D->setPrivateCounters(Sub);
2200  Sub.clear();
2201  for (unsigned i = 0; i < CollapsedNum; ++i)
2202  Sub.push_back(Record.readSubExpr());
2203  D->setInits(Sub);
2204  Sub.clear();
2205  for (unsigned i = 0; i < CollapsedNum; ++i)
2206  Sub.push_back(Record.readSubExpr());
2207  D->setUpdates(Sub);
2208  Sub.clear();
2209  for (unsigned i = 0; i < CollapsedNum; ++i)
2210  Sub.push_back(Record.readSubExpr());
2211  D->setFinals(Sub);
2212  Sub.clear();
2213  for (unsigned i = 0; i < CollapsedNum; ++i)
2214  Sub.push_back(Record.readSubExpr());
2215  D->setDependentCounters(Sub);
2216  Sub.clear();
2217  for (unsigned i = 0; i < CollapsedNum; ++i)
2218  Sub.push_back(Record.readSubExpr());
2219  D->setDependentInits(Sub);
2220  Sub.clear();
2221  for (unsigned i = 0; i < CollapsedNum; ++i)
2222  Sub.push_back(Record.readSubExpr());
2223  D->setFinalsConditions(Sub);
2224 }
2225 
2226 void ASTStmtReader::VisitOMPParallelDirective(OMPParallelDirective *D) {
2227  VisitStmt(D);
2228  // The NumClauses field was read in ReadStmtFromStream.
2229  Record.skipInts(1);
2230  VisitOMPExecutableDirective(D);
2231  D->setHasCancel(Record.readInt());
2232 }
2233 
2234 void ASTStmtReader::VisitOMPSimdDirective(OMPSimdDirective *D) {
2235  VisitOMPLoopDirective(D);
2236 }
2237 
2238 void ASTStmtReader::VisitOMPForDirective(OMPForDirective *D) {
2239  VisitOMPLoopDirective(D);
2240  D->setHasCancel(Record.readInt());
2241 }
2242 
2243 void ASTStmtReader::VisitOMPForSimdDirective(OMPForSimdDirective *D) {
2244  VisitOMPLoopDirective(D);
2245 }
2246 
2247 void ASTStmtReader::VisitOMPSectionsDirective(OMPSectionsDirective *D) {
2248  VisitStmt(D);
2249  // The NumClauses field was read in ReadStmtFromStream.
2250  Record.skipInts(1);
2251  VisitOMPExecutableDirective(D);
2252  D->setHasCancel(Record.readInt());
2253 }
2254 
2255 void ASTStmtReader::VisitOMPSectionDirective(OMPSectionDirective *D) {
2256  VisitStmt(D);
2257  VisitOMPExecutableDirective(D);
2258  D->setHasCancel(Record.readInt());
2259 }
2260 
2261 void ASTStmtReader::VisitOMPSingleDirective(OMPSingleDirective *D) {
2262  VisitStmt(D);
2263  // The NumClauses field was read in ReadStmtFromStream.
2264  Record.skipInts(1);
2265  VisitOMPExecutableDirective(D);
2266 }
2267 
2268 void ASTStmtReader::VisitOMPMasterDirective(OMPMasterDirective *D) {
2269  VisitStmt(D);
2270  VisitOMPExecutableDirective(D);
2271 }
2272 
2273 void ASTStmtReader::VisitOMPCriticalDirective(OMPCriticalDirective *D) {
2274  VisitStmt(D);
2275  // The NumClauses field was read in ReadStmtFromStream.
2276  Record.skipInts(1);
2277  VisitOMPExecutableDirective(D);
2278  D->DirName = Record.readDeclarationNameInfo();
2279 }
2280 
2281 void ASTStmtReader::VisitOMPParallelForDirective(OMPParallelForDirective *D) {
2282  VisitOMPLoopDirective(D);
2283  D->setHasCancel(Record.readInt());
2284 }
2285 
2286 void ASTStmtReader::VisitOMPParallelForSimdDirective(
2288  VisitOMPLoopDirective(D);
2289 }
2290 
2291 void ASTStmtReader::VisitOMPParallelMasterDirective(
2293  VisitStmt(D);
2294  // The NumClauses field was read in ReadStmtFromStream.
2295  Record.skipInts(1);
2296  VisitOMPExecutableDirective(D);
2297 }
2298 
2299 void ASTStmtReader::VisitOMPParallelSectionsDirective(
2301  VisitStmt(D);
2302  // The NumClauses field was read in ReadStmtFromStream.
2303  Record.skipInts(1);
2304  VisitOMPExecutableDirective(D);
2305  D->setHasCancel(Record.readInt());
2306 }
2307 
2308 void ASTStmtReader::VisitOMPTaskDirective(OMPTaskDirective *D) {
2309  VisitStmt(D);
2310  // The NumClauses field was read in ReadStmtFromStream.
2311  Record.skipInts(1);
2312  VisitOMPExecutableDirective(D);
2313  D->setHasCancel(Record.readInt());
2314 }
2315 
2316 void ASTStmtReader::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) {
2317  VisitStmt(D);
2318  VisitOMPExecutableDirective(D);
2319 }
2320 
2321 void ASTStmtReader::VisitOMPBarrierDirective(OMPBarrierDirective *D) {
2322  VisitStmt(D);
2323  VisitOMPExecutableDirective(D);
2324 }
2325 
2326 void ASTStmtReader::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) {
2327  VisitStmt(D);
2328  VisitOMPExecutableDirective(D);
2329 }
2330 
2331 void ASTStmtReader::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) {
2332  VisitStmt(D);
2333  // The NumClauses field was read in ReadStmtFromStream.
2334  Record.skipInts(1);
2335  VisitOMPExecutableDirective(D);
2336  D->setReductionRef(Record.readSubExpr());
2337 }
2338 
2339 void ASTStmtReader::VisitOMPFlushDirective(OMPFlushDirective *D) {
2340  VisitStmt(D);
2341  // The NumClauses field was read in ReadStmtFromStream.
2342  Record.skipInts(1);
2343  VisitOMPExecutableDirective(D);
2344 }
2345 
2346 void ASTStmtReader::VisitOMPOrderedDirective(OMPOrderedDirective *D) {
2347  VisitStmt(D);
2348  // The NumClauses field was read in ReadStmtFromStream.
2349  Record.skipInts(1);
2350  VisitOMPExecutableDirective(D);
2351 }
2352 
2353 void ASTStmtReader::VisitOMPAtomicDirective(OMPAtomicDirective *D) {
2354  VisitStmt(D);
2355  // The NumClauses field was read in ReadStmtFromStream.
2356  Record.skipInts(1);
2357  VisitOMPExecutableDirective(D);
2358  D->setX(Record.readSubExpr());
2359  D->setV(Record.readSubExpr());
2360  D->setExpr(Record.readSubExpr());
2361  D->setUpdateExpr(Record.readSubExpr());
2362  D->IsXLHSInRHSPart = Record.readInt() != 0;
2363  D->IsPostfixUpdate = Record.readInt() != 0;
2364 }
2365 
2366 void ASTStmtReader::VisitOMPTargetDirective(OMPTargetDirective *D) {
2367  VisitStmt(D);
2368  // The NumClauses field was read in ReadStmtFromStream.
2369  Record.skipInts(1);
2370  VisitOMPExecutableDirective(D);
2371 }
2372 
2373 void ASTStmtReader::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) {
2374  VisitStmt(D);
2375  Record.skipInts(1);
2376  VisitOMPExecutableDirective(D);
2377 }
2378 
2379 void ASTStmtReader::VisitOMPTargetEnterDataDirective(
2381  VisitStmt(D);
2382  Record.skipInts(1);
2383  VisitOMPExecutableDirective(D);
2384 }
2385 
2386 void ASTStmtReader::VisitOMPTargetExitDataDirective(
2388  VisitStmt(D);
2389  Record.skipInts(1);
2390  VisitOMPExecutableDirective(D);
2391 }
2392 
2393 void ASTStmtReader::VisitOMPTargetParallelDirective(
2395  VisitStmt(D);
2396  Record.skipInts(1);
2397  VisitOMPExecutableDirective(D);
2398 }
2399 
2400 void ASTStmtReader::VisitOMPTargetParallelForDirective(
2402  VisitOMPLoopDirective(D);
2403  D->setHasCancel(Record.readInt());
2404 }
2405 
2406 void ASTStmtReader::VisitOMPTeamsDirective(OMPTeamsDirective *D) {
2407  VisitStmt(D);
2408  // The NumClauses field was read in ReadStmtFromStream.
2409  Record.skipInts(1);
2410  VisitOMPExecutableDirective(D);
2411 }
2412 
2413 void ASTStmtReader::VisitOMPCancellationPointDirective(
2415  VisitStmt(D);
2416  VisitOMPExecutableDirective(D);
2417  D->setCancelRegion(static_cast<OpenMPDirectiveKind>(Record.readInt()));
2418 }
2419 
2420 void ASTStmtReader::VisitOMPCancelDirective(OMPCancelDirective *D) {
2421  VisitStmt(D);
2422  // The NumClauses field was read in ReadStmtFromStream.
2423  Record.skipInts(1);
2424  VisitOMPExecutableDirective(D);
2425  D->setCancelRegion(static_cast<OpenMPDirectiveKind>(Record.readInt()));
2426 }
2427 
2428 void ASTStmtReader::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) {
2429  VisitOMPLoopDirective(D);
2430 }
2431 
2432 void ASTStmtReader::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) {
2433  VisitOMPLoopDirective(D);
2434 }
2435 
2436 void ASTStmtReader::VisitOMPMasterTaskLoopDirective(
2438  VisitOMPLoopDirective(D);
2439 }
2440 
2441 void ASTStmtReader::VisitOMPMasterTaskLoopSimdDirective(
2443  VisitOMPLoopDirective(D);
2444 }
2445 
2446 void ASTStmtReader::VisitOMPParallelMasterTaskLoopDirective(
2448  VisitOMPLoopDirective(D);
2449 }
2450 
2451 void ASTStmtReader::VisitOMPParallelMasterTaskLoopSimdDirective(
2453  VisitOMPLoopDirective(D);
2454 }
2455 
2456 void ASTStmtReader::VisitOMPDistributeDirective(OMPDistributeDirective *D) {
2457  VisitOMPLoopDirective(D);
2458 }
2459 
2460 void ASTStmtReader::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) {
2461  VisitStmt(D);
2462  Record.skipInts(1);
2463  VisitOMPExecutableDirective(D);
2464 }
2465 
2466 void ASTStmtReader::VisitOMPDistributeParallelForDirective(
2468  VisitOMPLoopDirective(D);
2469  D->setHasCancel(Record.readInt());
2470 }
2471 
2472 void ASTStmtReader::VisitOMPDistributeParallelForSimdDirective(
2474  VisitOMPLoopDirective(D);
2475 }
2476 
2477 void ASTStmtReader::VisitOMPDistributeSimdDirective(
2479  VisitOMPLoopDirective(D);
2480 }
2481 
2482 void ASTStmtReader::VisitOMPTargetParallelForSimdDirective(
2484  VisitOMPLoopDirective(D);
2485 }
2486 
2487 void ASTStmtReader::VisitOMPTargetSimdDirective(OMPTargetSimdDirective *D) {
2488  VisitOMPLoopDirective(D);
2489 }
2490 
2491 void ASTStmtReader::VisitOMPTeamsDistributeDirective(
2493  VisitOMPLoopDirective(D);
2494 }
2495 
2496 void ASTStmtReader::VisitOMPTeamsDistributeSimdDirective(
2498  VisitOMPLoopDirective(D);
2499 }
2500 
2501 void ASTStmtReader::VisitOMPTeamsDistributeParallelForSimdDirective(
2503  VisitOMPLoopDirective(D);
2504 }
2505 
2506 void ASTStmtReader::VisitOMPTeamsDistributeParallelForDirective(
2508  VisitOMPLoopDirective(D);
2509  D->setHasCancel(Record.readInt());
2510 }
2511 
2512 void ASTStmtReader::VisitOMPTargetTeamsDirective(OMPTargetTeamsDirective *D) {
2513  VisitStmt(D);
2514  // The NumClauses field was read in ReadStmtFromStream.
2515  Record.skipInts(1);
2516  VisitOMPExecutableDirective(D);
2517 }
2518 
2519 void ASTStmtReader::VisitOMPTargetTeamsDistributeDirective(
2521  VisitOMPLoopDirective(D);
2522 }
2523 
2524 void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForDirective(
2526  VisitOMPLoopDirective(D);
2527  D->setHasCancel(Record.readInt());
2528 }
2529 
2530 void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
2532  VisitOMPLoopDirective(D);
2533 }
2534 
2535 void ASTStmtReader::VisitOMPTargetTeamsDistributeSimdDirective(
2537  VisitOMPLoopDirective(D);
2538 }
2539 
2540 //===----------------------------------------------------------------------===//
2541 // ASTReader Implementation
2542 //===----------------------------------------------------------------------===//
2543 
2545  switch (ReadingKind) {
2546  case Read_None:
2547  llvm_unreachable("should not call this when not reading anything");
2548  case Read_Decl:
2549  case Read_Type:
2550  return ReadStmtFromStream(F);
2551  case Read_Stmt:
2552  return ReadSubStmt();
2553  }
2554 
2555  llvm_unreachable("ReadingKind not set ?");
2556 }
2557 
2559  return cast_or_null<Expr>(ReadStmt(F));
2560 }
2561 
2563  return cast_or_null<Expr>(ReadSubStmt());
2564 }
2565 
2566 // Within the bitstream, expressions are stored in Reverse Polish
2567 // Notation, with each of the subexpressions preceding the
2568 // expression they are stored in. Subexpressions are stored from last to first.
2569 // To evaluate expressions, we continue reading expressions and placing them on
2570 // the stack, with expressions having operands removing those operands from the
2571 // stack. Evaluation terminates when we see a STMT_STOP record, and
2572 // the single remaining expression on the stack is our result.
2573 Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) {
2574  ReadingKindTracker ReadingKind(Read_Stmt, *this);
2575  llvm::BitstreamCursor &Cursor = F.DeclsCursor;
2576 
2577  // Map of offset to previously deserialized stmt. The offset points
2578  // just after the stmt record.
2579  llvm::DenseMap<uint64_t, Stmt *> StmtEntries;
2580 
2581 #ifndef NDEBUG
2582  unsigned PrevNumStmts = StmtStack.size();
2583 #endif
2584 
2585  ASTRecordReader Record(*this, F);
2586  ASTStmtReader Reader(Record, Cursor);
2587  Stmt::EmptyShell Empty;
2588 
2589  while (true) {
2591  Cursor.advanceSkippingSubblocks();
2592  if (!MaybeEntry) {
2593  Error(toString(MaybeEntry.takeError()));
2594  return nullptr;
2595  }
2596  llvm::BitstreamEntry Entry = MaybeEntry.get();
2597 
2598  switch (Entry.Kind) {
2599  case llvm::BitstreamEntry::SubBlock: // Handled for us already.
2601  Error("malformed block record in AST file");
2602  return nullptr;
2603  case llvm::BitstreamEntry::EndBlock:
2604  goto Done;
2605  case llvm::BitstreamEntry::Record:
2606  // The interesting case.
2607  break;
2608  }
2609 
2610  ASTContext &Context = getContext();
2611  Stmt *S = nullptr;
2612  bool Finished = false;
2613  bool IsStmtReference = false;
2614  Expected<unsigned> MaybeStmtCode = Record.readRecord(Cursor, Entry.ID);
2615  if (!MaybeStmtCode) {
2616  Error(toString(MaybeStmtCode.takeError()));
2617  return nullptr;
2618  }
2619  switch ((StmtCode)MaybeStmtCode.get()) {
2620  case STMT_STOP:
2621  Finished = true;
2622  break;
2623 
2624  case STMT_REF_PTR:
2625  IsStmtReference = true;
2626  assert(StmtEntries.find(Record[0]) != StmtEntries.end() &&
2627  "No stmt was recorded for this offset reference!");
2628  S = StmtEntries[Record.readInt()];
2629  break;
2630 
2631  case STMT_NULL_PTR:
2632  S = nullptr;
2633  break;
2634 
2635  case STMT_NULL:
2636  S = new (Context) NullStmt(Empty);
2637  break;
2638 
2639  case STMT_COMPOUND:
2641  Context, /*NumStmts=*/Record[ASTStmtReader::NumStmtFields]);
2642  break;
2643 
2644  case STMT_CASE:
2646  Context,
2647  /*CaseStmtIsGNURange*/ Record[ASTStmtReader::NumStmtFields + 3]);
2648  break;
2649 
2650  case STMT_DEFAULT:
2651  S = new (Context) DefaultStmt(Empty);
2652  break;
2653 
2654  case STMT_LABEL:
2655  S = new (Context) LabelStmt(Empty);
2656  break;
2657 
2658  case STMT_ATTRIBUTED:
2660  Context,
2661  /*NumAttrs*/Record[ASTStmtReader::NumStmtFields]);
2662  break;
2663 
2664  case STMT_IF:
2665  S = IfStmt::CreateEmpty(
2666  Context,
2667  /* HasElse=*/Record[ASTStmtReader::NumStmtFields + 1],
2668  /* HasVar=*/Record[ASTStmtReader::NumStmtFields + 2],
2669  /* HasInit=*/Record[ASTStmtReader::NumStmtFields + 3]);
2670  break;
2671 
2672  case STMT_SWITCH:
2674  Context,
2675  /* HasInit=*/Record[ASTStmtReader::NumStmtFields],
2676  /* HasVar=*/Record[ASTStmtReader::NumStmtFields + 1]);
2677  break;
2678 
2679  case STMT_WHILE:
2681  Context,
2682  /* HasVar=*/Record[ASTStmtReader::NumStmtFields]);
2683  break;
2684 
2685  case STMT_DO:
2686  S = new (Context) DoStmt(Empty);
2687  break;
2688 
2689  case STMT_FOR:
2690  S = new (Context) ForStmt(Empty);
2691  break;
2692 
2693  case STMT_GOTO:
2694  S = new (Context) GotoStmt(Empty);
2695  break;
2696 
2697  case STMT_INDIRECT_GOTO:
2698  S = new (Context) IndirectGotoStmt(Empty);
2699  break;
2700 
2701  case STMT_CONTINUE:
2702  S = new (Context) ContinueStmt(Empty);
2703  break;
2704 
2705  case STMT_BREAK:
2706  S = new (Context) BreakStmt(Empty);
2707  break;
2708 
2709  case STMT_RETURN:
2711  Context, /* HasNRVOCandidate=*/Record[ASTStmtReader::NumStmtFields]);
2712  break;
2713 
2714  case STMT_DECL:
2715  S = new (Context) DeclStmt(Empty);
2716  break;
2717 
2718  case STMT_GCCASM:
2719  S = new (Context) GCCAsmStmt(Empty);
2720  break;
2721 
2722  case STMT_MSASM:
2723  S = new (Context) MSAsmStmt(Empty);
2724  break;
2725 
2726  case STMT_CAPTURED:
2728  Context, Record[ASTStmtReader::NumStmtFields]);
2729  break;
2730 
2731  case EXPR_CONSTANT:
2733  Context,
2734  static_cast<ConstantExpr::ResultStorageKind>(
2736  Empty);
2737  break;
2738 
2739  case EXPR_PREDEFINED:
2741  Context,
2742  /*HasFunctionName*/ Record[ASTStmtReader::NumExprFields]);
2743  break;
2744 
2745  case EXPR_DECL_REF:
2747  Context,
2748  /*HasQualifier=*/Record[ASTStmtReader::NumExprFields],
2749  /*HasFoundDecl=*/Record[ASTStmtReader::NumExprFields + 1],
2750  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields + 2],
2751  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields + 2] ?
2752  Record[ASTStmtReader::NumExprFields + 6] : 0);
2753  break;
2754 
2755  case EXPR_INTEGER_LITERAL:
2756  S = IntegerLiteral::Create(Context, Empty);
2757  break;
2758 
2759  case EXPR_FLOATING_LITERAL:
2760  S = FloatingLiteral::Create(Context, Empty);
2761  break;
2762 
2764  S = new (Context) ImaginaryLiteral(Empty);
2765  break;
2766 
2767  case EXPR_STRING_LITERAL:
2769  Context,
2770  /* NumConcatenated=*/Record[ASTStmtReader::NumExprFields],
2771  /* Length=*/Record[ASTStmtReader::NumExprFields + 1],
2772  /* CharByteWidth=*/Record[ASTStmtReader::NumExprFields + 2]);
2773  break;
2774 
2776  S = new (Context) CharacterLiteral(Empty);
2777  break;
2778 
2779  case EXPR_PAREN:
2780  S = new (Context) ParenExpr(Empty);
2781  break;
2782 
2783  case EXPR_PAREN_LIST:
2785  Context,
2786  /* NumExprs=*/Record[ASTStmtReader::NumExprFields]);
2787  break;
2788 
2789  case EXPR_UNARY_OPERATOR:
2790  S = new (Context) UnaryOperator(Empty);
2791  break;
2792 
2793  case EXPR_OFFSETOF:
2794  S = OffsetOfExpr::CreateEmpty(Context,
2795  Record[ASTStmtReader::NumExprFields],
2796  Record[ASTStmtReader::NumExprFields + 1]);
2797  break;
2798 
2799  case EXPR_SIZEOF_ALIGN_OF:
2800  S = new (Context) UnaryExprOrTypeTraitExpr(Empty);
2801  break;
2802 
2803  case EXPR_ARRAY_SUBSCRIPT:
2804  S = new (Context) ArraySubscriptExpr(Empty);
2805  break;
2806 
2808  S = new (Context) OMPArraySectionExpr(Empty);
2809  break;
2810 
2811  case EXPR_CALL:
2813  Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], Empty);
2814  break;
2815 
2816  case EXPR_MEMBER:
2817  S = MemberExpr::CreateEmpty(Context, Record[ASTStmtReader::NumExprFields],
2818  Record[ASTStmtReader::NumExprFields + 1],
2819  Record[ASTStmtReader::NumExprFields + 2],
2820  Record[ASTStmtReader::NumExprFields + 3]);
2821  break;
2822 
2823  case EXPR_BINARY_OPERATOR:
2824  S = new (Context) BinaryOperator(Empty);
2825  break;
2826 
2828  S = new (Context) CompoundAssignOperator(Empty);
2829  break;
2830 
2832  S = new (Context) ConditionalOperator(Empty);
2833  break;
2834 
2836  S = new (Context) BinaryConditionalOperator(Empty);
2837  break;
2838 
2839  case EXPR_IMPLICIT_CAST:
2840  S = ImplicitCastExpr::CreateEmpty(Context,
2841  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
2842  break;
2843 
2844  case EXPR_CSTYLE_CAST:
2845  S = CStyleCastExpr::CreateEmpty(Context,
2846  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
2847  break;
2848 
2849  case EXPR_COMPOUND_LITERAL:
2850  S = new (Context) CompoundLiteralExpr(Empty);
2851  break;
2852 
2854  S = new (Context) ExtVectorElementExpr(Empty);
2855  break;
2856 
2857  case EXPR_INIT_LIST:
2858  S = new (Context) InitListExpr(Empty);
2859  break;
2860 
2861  case EXPR_DESIGNATED_INIT:
2862  S = DesignatedInitExpr::CreateEmpty(Context,
2863  Record[ASTStmtReader::NumExprFields] - 1);
2864 
2865  break;
2866 
2868  S = new (Context) DesignatedInitUpdateExpr(Empty);
2869  break;
2870 
2872  S = new (Context) ImplicitValueInitExpr(Empty);
2873  break;
2874 
2875  case EXPR_NO_INIT:
2876  S = new (Context) NoInitExpr(Empty);
2877  break;
2878 
2879  case EXPR_ARRAY_INIT_LOOP:
2880  S = new (Context) ArrayInitLoopExpr(Empty);
2881  break;
2882 
2883  case EXPR_ARRAY_INIT_INDEX:
2884  S = new (Context) ArrayInitIndexExpr(Empty);
2885  break;
2886 
2887  case EXPR_VA_ARG:
2888  S = new (Context) VAArgExpr(Empty);
2889  break;
2890 
2891  case EXPR_SOURCE_LOC:
2892  S = new (Context) SourceLocExpr(Empty);
2893  break;
2894 
2895  case EXPR_ADDR_LABEL:
2896  S = new (Context) AddrLabelExpr(Empty);
2897  break;
2898 
2899  case EXPR_STMT:
2900  S = new (Context) StmtExpr(Empty);
2901  break;
2902 
2903  case EXPR_CHOOSE:
2904  S = new (Context) ChooseExpr(Empty);
2905  break;
2906 
2907  case EXPR_GNU_NULL:
2908  S = new (Context) GNUNullExpr(Empty);
2909  break;
2910 
2911  case EXPR_SHUFFLE_VECTOR:
2912  S = new (Context) ShuffleVectorExpr(Empty);
2913  break;
2914 
2915  case EXPR_CONVERT_VECTOR:
2916  S = new (Context) ConvertVectorExpr(Empty);
2917  break;
2918 
2919  case EXPR_BLOCK:
2920  S = new (Context) BlockExpr(Empty);
2921  break;
2922 
2925  Context,
2926  /*NumAssocs=*/Record[ASTStmtReader::NumExprFields]);
2927  break;
2928 
2930  S = new (Context) ObjCStringLiteral(Empty);
2931  break;
2932 
2934  S = new (Context) ObjCBoxedExpr(Empty);
2935  break;
2936 
2938  S = ObjCArrayLiteral::CreateEmpty(Context,
2939  Record[ASTStmtReader::NumExprFields]);
2940  break;
2941 
2944  Record[ASTStmtReader::NumExprFields],
2945  Record[ASTStmtReader::NumExprFields + 1]);
2946  break;
2947 
2948  case EXPR_OBJC_ENCODE:
2949  S = new (Context) ObjCEncodeExpr(Empty);
2950  break;
2951 
2953  S = new (Context) ObjCSelectorExpr(Empty);
2954  break;
2955 
2957  S = new (Context) ObjCProtocolExpr(Empty);
2958  break;
2959 
2961  S = new (Context) ObjCIvarRefExpr(Empty);
2962  break;
2963 
2965  S = new (Context) ObjCPropertyRefExpr(Empty);
2966  break;
2967 
2969  S = new (Context) ObjCSubscriptRefExpr(Empty);
2970  break;
2971 
2973  llvm_unreachable("mismatching AST file");
2974 
2976  S = ObjCMessageExpr::CreateEmpty(Context,
2977  Record[ASTStmtReader::NumExprFields],
2978  Record[ASTStmtReader::NumExprFields + 1]);
2979  break;
2980 
2981  case EXPR_OBJC_ISA:
2982  S = new (Context) ObjCIsaExpr(Empty);
2983  break;
2984 
2986  S = new (Context) ObjCIndirectCopyRestoreExpr(Empty);
2987  break;
2988 
2990  S = new (Context) ObjCBridgedCastExpr(Empty);
2991  break;
2992 
2994  S = new (Context) ObjCForCollectionStmt(Empty);
2995  break;
2996 
2997  case STMT_OBJC_CATCH:
2998  S = new (Context) ObjCAtCatchStmt(Empty);
2999  break;
3000 
3001  case STMT_OBJC_FINALLY:
3002  S = new (Context) ObjCAtFinallyStmt(Empty);
3003  break;
3004 
3005  case STMT_OBJC_AT_TRY:
3006  S = ObjCAtTryStmt::CreateEmpty(Context,
3007  Record[ASTStmtReader::NumStmtFields],
3008  Record[ASTStmtReader::NumStmtFields + 1]);
3009  break;
3010 
3012  S = new (Context) ObjCAtSynchronizedStmt(Empty);
3013  break;
3014 
3015  case STMT_OBJC_AT_THROW:
3016  S = new (Context) ObjCAtThrowStmt(Empty);
3017  break;
3018 
3020  S = new (Context) ObjCAutoreleasePoolStmt(Empty);
3021  break;
3022 
3024  S = new (Context) ObjCBoolLiteralExpr(Empty);
3025  break;
3026 
3028  S = new (Context) ObjCAvailabilityCheckExpr(Empty);
3029  break;
3030 
3031  case STMT_SEH_LEAVE:
3032  S = new (Context) SEHLeaveStmt(Empty);
3033  break;
3034 
3035  case STMT_SEH_EXCEPT:
3036  S = new (Context) SEHExceptStmt(Empty);
3037  break;
3038 
3039  case STMT_SEH_FINALLY:
3040  S = new (Context) SEHFinallyStmt(Empty);
3041  break;
3042 
3043  case STMT_SEH_TRY:
3044  S = new (Context) SEHTryStmt(Empty);
3045  break;
3046 
3047  case STMT_CXX_CATCH:
3048  S = new (Context) CXXCatchStmt(Empty);
3049  break;
3050 
3051  case STMT_CXX_TRY:
3052  S = CXXTryStmt::Create(Context, Empty,
3053  /*numHandlers=*/Record[ASTStmtReader::NumStmtFields]);
3054  break;
3055 
3056  case STMT_CXX_FOR_RANGE:
3057  S = new (Context) CXXForRangeStmt(Empty);
3058  break;
3059 
3061  S = new (Context) MSDependentExistsStmt(SourceLocation(), true,
3064  nullptr);
3065  break;
3066 
3068  S =
3070  Record[ASTStmtReader::NumStmtFields],
3071  Empty);
3072  break;
3073 
3074  case STMT_OMP_SIMD_DIRECTIVE: {
3075  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3076  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3077  S = OMPSimdDirective::CreateEmpty(Context, NumClauses,
3078  CollapsedNum, Empty);
3079  break;
3080  }
3081 
3082  case STMT_OMP_FOR_DIRECTIVE: {
3083  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3084  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3085  S = OMPForDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3086  Empty);
3087  break;
3088  }
3089 
3091  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3092  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3093  S = OMPForSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3094  Empty);
3095  break;
3096  }
3097 
3100  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3101  break;
3102 
3104  S = OMPSectionDirective::CreateEmpty(Context, Empty);
3105  break;
3106 
3109  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3110  break;
3111 
3113  S = OMPMasterDirective::CreateEmpty(Context, Empty);
3114  break;
3115 
3118  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3119  break;
3120 
3122  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3123  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3124  S = OMPParallelForDirective::CreateEmpty(Context, NumClauses,
3125  CollapsedNum, Empty);
3126  break;
3127  }
3128 
3130  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3131  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3132  S = OMPParallelForSimdDirective::CreateEmpty(Context, NumClauses,
3133  CollapsedNum, Empty);
3134  break;
3135  }
3136 
3139  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3140  break;
3141 
3144  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3145  break;
3146 
3149  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3150  break;
3151 
3153  S = OMPTaskyieldDirective::CreateEmpty(Context, Empty);
3154  break;
3155 
3157  S = OMPBarrierDirective::CreateEmpty(Context, Empty);
3158  break;
3159 
3161  S = OMPTaskwaitDirective::CreateEmpty(Context, Empty);
3162  break;
3163 
3166  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3167  break;
3168 
3171  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3172  break;
3173 
3176  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3177  break;
3178 
3181  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3182  break;
3183 
3186  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3187  break;
3188 
3191  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3192  break;
3193 
3196  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3197  break;
3198 
3201  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3202  break;
3203 
3206  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3207  break;
3208 
3210  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3211  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3212  S = OMPTargetParallelForDirective::CreateEmpty(Context, NumClauses,
3213  CollapsedNum, Empty);
3214  break;
3215  }
3216 
3219  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3220  break;
3221 
3224  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3225  break;
3226 
3228  S = OMPCancellationPointDirective::CreateEmpty(Context, Empty);
3229  break;
3230 
3233  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3234  break;
3235 
3237  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3238  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3239  S = OMPTaskLoopDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3240  Empty);
3241  break;
3242  }
3243 
3245  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3246  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3247  S = OMPTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
3248  CollapsedNum, Empty);
3249  break;
3250  }
3251 
3253  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3254  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3255  S = OMPMasterTaskLoopDirective::CreateEmpty(Context, NumClauses,
3256  CollapsedNum, Empty);
3257  break;
3258  }
3259 
3261  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3262  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3263  S = OMPMasterTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
3264  CollapsedNum, Empty);
3265  break;
3266  }
3267 
3269  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3270  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3271  S = OMPParallelMasterTaskLoopDirective::CreateEmpty(Context, NumClauses,
3272  CollapsedNum, Empty);
3273  break;
3274  }
3275 
3277  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3278  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3280  Context, NumClauses, CollapsedNum, Empty);
3281  break;
3282  }
3283 
3285  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3286  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3287  S = OMPDistributeDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3288  Empty);
3289  break;
3290  }
3291 
3293  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3294  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3295  S = OMPDistributeParallelForDirective::CreateEmpty(Context, NumClauses,
3296  CollapsedNum, Empty);
3297  break;
3298  }
3299 
3301  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3302  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3304  CollapsedNum,
3305  Empty);
3306  break;
3307  }
3308 
3310  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3311  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3312  S = OMPDistributeSimdDirective::CreateEmpty(Context, NumClauses,
3313  CollapsedNum, Empty);
3314  break;
3315  }
3316 
3318  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3319  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3320  S = OMPTargetParallelForSimdDirective::CreateEmpty(Context, NumClauses,
3321  CollapsedNum, Empty);
3322  break;
3323  }
3324 
3326  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3327  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3328  S = OMPTargetSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3329  Empty);
3330  break;
3331  }
3332 
3334  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3335  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3336  S = OMPTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
3337  CollapsedNum, Empty);
3338  break;
3339  }
3340 
3342  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3343  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3344  S = OMPTeamsDistributeSimdDirective::CreateEmpty(Context, NumClauses,
3345  CollapsedNum, Empty);
3346  break;
3347  }
3348 
3350  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3351  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3353  Context, NumClauses, CollapsedNum, Empty);
3354  break;
3355  }
3356 
3358  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3359  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3361  Context, NumClauses, CollapsedNum, Empty);
3362  break;
3363  }
3364 
3367  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3368  break;
3369 
3371  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3372  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3373  S = OMPTargetTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
3374  CollapsedNum, Empty);
3375  break;
3376  }
3377 
3379  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3380  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3382  Context, NumClauses, CollapsedNum, Empty);
3383  break;
3384  }
3385 
3387  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3388  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3390  Context, NumClauses, CollapsedNum, Empty);
3391  break;
3392  }
3393 
3395  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3396  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3398  Context, NumClauses, CollapsedNum, Empty);
3399  break;
3400  }
3401 
3404  Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], Empty);
3405  break;
3406 
3407  case EXPR_CXX_MEMBER_CALL:
3409  Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], Empty);
3410  break;
3411 
3413  S = new (Context) CXXRewrittenBinaryOperator(Empty);
3414  break;
3415 
3416  case EXPR_CXX_CONSTRUCT:
3418  Context,
3419  /* NumArgs=*/Record[ASTStmtReader::NumExprFields]);
3420  break;
3421 
3423  S = new (Context) CXXInheritedCtorInitExpr(Empty);
3424  break;
3425 
3428  Context,
3429  /* NumArgs=*/Record[ASTStmtReader::NumExprFields]);
3430  break;
3431 
3432  case EXPR_CXX_STATIC_CAST:
3433  S = CXXStaticCastExpr::CreateEmpty(Context,
3434  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3435  break;
3436 
3437  case EXPR_CXX_DYNAMIC_CAST:
3438  S = CXXDynamicCastExpr::CreateEmpty(Context,
3439  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3440  break;
3441 
3444  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3445  break;
3446 
3447  case EXPR_CXX_CONST_CAST:
3448  S = CXXConstCastExpr::CreateEmpty(Context);
3449  break;
3450 
3453  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3454  break;
3455 
3458  Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], Empty);
3459  break;
3460 
3462  S = new (Context) CXXStdInitializerListExpr(Empty);
3463  break;
3464 
3465  case EXPR_CXX_BOOL_LITERAL:
3466  S = new (Context) CXXBoolLiteralExpr(Empty);
3467  break;
3468 
3470  S = new (Context) CXXNullPtrLiteralExpr(Empty);
3471  break;
3472 
3473  case EXPR_CXX_TYPEID_EXPR:
3474  S = new (Context) CXXTypeidExpr(Empty, true);
3475  break;
3476 
3477  case EXPR_CXX_TYPEID_TYPE:
3478  S = new (Context) CXXTypeidExpr(Empty, false);
3479  break;
3480 
3481  case EXPR_CXX_UUIDOF_EXPR:
3482  S = new (Context) CXXUuidofExpr(Empty, true);
3483  break;
3484 
3486  S = new (Context) MSPropertyRefExpr(Empty);
3487  break;
3488 
3490  S = new (Context) MSPropertySubscriptExpr(Empty);
3491  break;
3492 
3493  case EXPR_CXX_UUIDOF_TYPE:
3494  S = new (Context) CXXUuidofExpr(Empty, false);
3495  break;
3496 
3497  case EXPR_CXX_THIS:
3498  S = new (Context) CXXThisExpr(Empty);
3499  break;
3500 
3501  case EXPR_CXX_THROW:
3502  S = new (Context) CXXThrowExpr(Empty);
3503  break;
3504 
3505  case EXPR_CXX_DEFAULT_ARG:
3506  S = new (Context) CXXDefaultArgExpr(Empty);
3507  break;
3508 
3509  case EXPR_CXX_DEFAULT_INIT:
3510  S = new (Context) CXXDefaultInitExpr(Empty);
3511  break;
3512 
3514  S = new (Context) CXXBindTemporaryExpr(Empty);
3515  break;
3516 
3518  S = new (Context) CXXScalarValueInitExpr(Empty);
3519  break;
3520 
3521  case EXPR_CXX_NEW:
3523  Context,
3524  /*IsArray=*/Record[ASTStmtReader::NumExprFields],
3525  /*HasInit=*/Record[ASTStmtReader::NumExprFields + 1],
3526  /*NumPlacementArgs=*/Record[ASTStmtReader::NumExprFields + 2],
3527  /*IsParenTypeId=*/Record[ASTStmtReader::NumExprFields + 3]);
3528  break;
3529 
3530  case EXPR_CXX_DELETE:
3531  S = new (Context) CXXDeleteExpr(Empty);
3532  break;
3533 
3535  S = new (Context) CXXPseudoDestructorExpr(Empty);
3536  break;
3537 
3539  S = ExprWithCleanups::Create(Context, Empty,
3540  Record[ASTStmtReader::NumExprFields]);
3541  break;
3542 
3545  Context,
3546  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields],
3547  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields + 1],
3548  /*HasFirstQualifierFoundInScope=*/
3549  Record[ASTStmtReader::NumExprFields + 2]);
3550  break;
3551 
3554  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields],
3555  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]
3556  ? Record[ASTStmtReader::NumExprFields + 1]
3557  : 0);
3558  break;
3559 
3562  /*NumArgs=*/Record[ASTStmtReader::NumExprFields]);
3563  break;
3564 
3567  Context,
3568  /*NumResults=*/Record[ASTStmtReader::NumExprFields],
3569  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields + 1],
3570  /*NumTemplateArgs=*/
3571  Record[ASTStmtReader::NumExprFields + 1]
3572  ? Record[ASTStmtReader::NumExprFields + 2]
3573  : 0);
3574  break;
3575 
3578  Context,
3579  /*NumResults=*/Record[ASTStmtReader::NumExprFields],
3580  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields + 1],
3581  /*NumTemplateArgs=*/
3582  Record[ASTStmtReader::NumExprFields + 1]
3583  ? Record[ASTStmtReader::NumExprFields + 2]
3584  : 0);
3585  break;
3586 
3587  case EXPR_TYPE_TRAIT:
3589  Record[ASTStmtReader::NumExprFields]);
3590  break;
3591 
3592  case EXPR_ARRAY_TYPE_TRAIT:
3593  S = new (Context) ArrayTypeTraitExpr(Empty);
3594  break;
3595 
3597  S = new (Context) ExpressionTraitExpr(Empty);
3598  break;
3599 
3600  case EXPR_CXX_NOEXCEPT:
3601  S = new (Context) CXXNoexceptExpr(Empty);
3602  break;
3603 
3604  case EXPR_PACK_EXPANSION:
3605  S = new (Context) PackExpansionExpr(Empty);
3606  break;
3607 
3608  case EXPR_SIZEOF_PACK:
3610  Context,
3611  /*NumPartialArgs=*/Record[ASTStmtReader::NumExprFields]);
3612  break;
3613 
3615  S = new (Context) SubstNonTypeTemplateParmExpr(Empty);
3616  break;
3617 
3619  S = new (Context) SubstNonTypeTemplateParmPackExpr(Empty);
3620  break;
3621 
3624  Record[ASTStmtReader::NumExprFields]);
3625  break;
3626 
3628  S = new (Context) MaterializeTemporaryExpr(Empty);
3629  break;
3630 
3631  case EXPR_CXX_FOLD:
3632  S = new (Context) CXXFoldExpr(Empty);
3633  break;
3634 
3635  case EXPR_OPAQUE_VALUE:
3636  S = new (Context) OpaqueValueExpr(Empty);
3637  break;
3638 
3639  case EXPR_CUDA_KERNEL_CALL:
3641  Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], Empty);
3642  break;
3643 
3644  case EXPR_ASTYPE:
3645  S = new (Context) AsTypeExpr(Empty);
3646  break;
3647 
3648  case EXPR_PSEUDO_OBJECT: {
3649  unsigned numSemanticExprs = Record[ASTStmtReader::NumExprFields];
3650  S = PseudoObjectExpr::Create(Context, Empty, numSemanticExprs);
3651  break;
3652  }
3653 
3654  case EXPR_ATOMIC:
3655  S = new (Context) AtomicExpr(Empty);
3656  break;
3657 
3658  case EXPR_LAMBDA: {
3659  unsigned NumCaptures = Record[ASTStmtReader::NumExprFields];
3660  S = LambdaExpr::CreateDeserialized(Context, NumCaptures);
3661  break;
3662  }
3663 
3664  case STMT_COROUTINE_BODY: {
3665  unsigned NumParams = Record[ASTStmtReader::NumStmtFields];
3666  S = CoroutineBodyStmt::Create(Context, Empty, NumParams);
3667  break;
3668  }
3669 
3670  case STMT_CORETURN:
3671  S = new (Context) CoreturnStmt(Empty);
3672  break;
3673 
3674  case EXPR_COAWAIT:
3675  S = new (Context) CoawaitExpr(Empty);
3676  break;
3677 
3678  case EXPR_COYIELD:
3679  S = new (Context) CoyieldExpr(Empty);
3680  break;
3681 
3683  S = new (Context) DependentCoawaitExpr(Empty);
3684  break;
3685 
3687  unsigned numTemplateArgs = Record[ASTStmtReader::NumExprFields];
3688  S = ConceptSpecializationExpr::Create(Context, Empty, numTemplateArgs);
3689  break;
3690  }
3691 
3692  case EXPR_REQUIRES:
3693  unsigned numLocalParameters = Record[ASTStmtReader::NumExprFields];
3694  unsigned numRequirement = Record[ASTStmtReader::NumExprFields + 1];
3695  S = RequiresExpr::Create(Context, Empty, numLocalParameters,
3696  numRequirement);
3697  break;
3698  }
3699 
3700  // We hit a STMT_STOP, so we're done with this expression.
3701  if (Finished)
3702  break;
3703 
3704  ++NumStatementsRead;
3705 
3706  if (S && !IsStmtReference) {
3707  Reader.Visit(S);
3708  StmtEntries[Cursor.GetCurrentBitNo()] = S;
3709  }
3710 
3711  assert(Record.getIdx() == Record.size() &&
3712  "Invalid deserialization of statement");
3713  StmtStack.push_back(S);
3714  }
3715 Done:
3716  assert(StmtStack.size() > PrevNumStmts && "Read too many sub-stmts!");
3717  assert(StmtStack.size() == PrevNumStmts + 1 && "Extra expressions on stack!");
3718  return StmtStack.pop_back_val();
3719 }
void setPreInits(Stmt *PreInits)
Definition: StmtOpenMP.h:605
void setCombinedParForInDistCond(Expr *CombParForInDistCond)
Definition: StmtOpenMP.h:724
static AttributedStmt * CreateEmpty(const ASTContext &C, unsigned NumAttrs)
Definition: Stmt.cpp:365
void setFPFeatures(FPOptions F)
Definition: Expr.h:3607
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:614
A PredefinedExpr record.
Definition: ASTBitCodes.h:1512
void setCond(Expr *Cond)
Definition: Stmt.h:2283
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:1577
The receiver is the instance of the superclass object.
Definition: ExprObjC.h:1107
Represents a single C99 designator.
Definition: Expr.h:4714
void setConditionVariable(const ASTContext &C, VarDecl *V)
Definition: Stmt.cpp:939
static DependentScopeDeclRefExpr * CreateEmpty(const ASTContext &Context, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition: ExprCXX.cpp:571
void setValueDependent(bool VD)
Set whether this expression is value-dependent or not.
Definition: Expr.h:161
Defines the clang::ASTContext interface.
void setIsOMPStructuredBlock(bool IsOMPStructuredBlock)
Definition: Stmt.h:1116
void setRParenLoc(SourceLocation L)
Definition: ExprCXX.h:1722
A CompoundLiteralExpr record.
Definition: ASTBitCodes.h:1572
This represents &#39;#pragma omp distribute simd&#39; composite directive.
Definition: StmtOpenMP.h:3757
This represents &#39;#pragma omp master&#39; directive.
Definition: StmtOpenMP.h:1591
ConstantExprBitfields ConstantExprBits
Definition: Stmt.h:980
DesignatorTypes
The kinds of designators that can occur in a DesignatedInitExpr.
Definition: ASTBitCodes.h:1878
void setRangeStmt(Stmt *S)
Definition: StmtCXX.h:193
SourceLocation readSourceLocation()
Read a source location, advancing Idx.
The null pointer literal (C++11 [lex.nullptr])
Definition: ExprCXX.h:683
unsigned getNumDecls() const
Gets the number of declarations in the unresolved set.
Definition: ExprCXX.h:2947
This represents &#39;#pragma omp task&#39; directive.
Definition: StmtOpenMP.h:1986
void setEnsureUpperBound(Expr *EUB)
Definition: StmtOpenMP.h:636
This represents a GCC inline-assembly statement extension.
Definition: Stmt.h:2878
static CXXConstructExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs)
Create an empty C++ construction expression.
Definition: ExprCXX.cpp:1086
Represents a &#39;co_await&#39; expression while the type of the promise is dependent.
Definition: ExprCXX.h:4735
void setSubStmt(CompoundStmt *S)
Definition: Expr.h:3972
static OMPMasterTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
The receiver is an object instance.
Definition: ExprObjC.h:1101
unsigned getNumInputs() const
Definition: Stmt.h:2790
static OMPMasterDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:418
UnresolvedMemberExprBitfields UnresolvedMemberExprBits
Definition: Stmt.h:1019
An IndirectGotoStmt record.
Definition: ASTBitCodes.h:1485
A (possibly-)qualified type.
Definition: Type.h:654
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument.
Definition: Stmt.h:3550
StringKind getKind() const
Definition: Expr.h:1826
An AddrLabelExpr record.
Definition: ASTBitCodes.h:1602
void setInc(Expr *E)
Definition: StmtCXX.h:197
void setOperatorLoc(SourceLocation L)
Definition: Expr.h:2440
CXXDeleteExprBitfields CXXDeleteExprBits
Definition: Stmt.h:1010
void setNRVOCandidate(const VarDecl *Var)
Set the variable that might be used for the named return value optimization.
Definition: Stmt.h:2686
Defines enumerations for the type traits support.
void setLocation(SourceLocation L)
Definition: ExprCXX.h:664
A requires-expression requirement which queries the validity and properties of an expression (&#39;simple...
Definition: ExprConcepts.h:253
A CXXStaticCastExpr record.
Definition: ASTBitCodes.h:1730
ASTStmtReader(ASTRecordReader &Record, llvm::BitstreamCursor &Cursor)
void setCombinedCond(Expr *CombCond)
Definition: StmtOpenMP.h:704
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2627
An AttributedStmt record.
Definition: ASTBitCodes.h:1464
A CXXReinterpretCastExpr record.
Definition: ASTBitCodes.h:1736
An ObjCBoolLiteralExpr record.
Definition: ASTBitCodes.h:1695
void setCombinedLowerBoundVariable(Expr *CombLB)
Definition: StmtOpenMP.h:684
void setRHS(Expr *E)
Definition: Expr.h:2503
static OMPTaskwaitDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:664
static OMPTargetParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:860
static ConstraintSatisfaction readConstraintSatisfaction(ASTRecordReader &Record)
void setHasCancel(bool Has)
Set cancel state.
Definition: StmtOpenMP.h:1517
Represents a &#39;co_return&#39; statement in the C++ Coroutines TS.
Definition: StmtCXX.h:456
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:685
void setLastIteration(Expr *LI)
Definition: StmtOpenMP.h:591
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition: Expr.h:2689
IfStmt - This represents an if/then/else.
Definition: Stmt.h:1834
void setPrivateCounters(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:119
void setArrow(bool A)
Definition: ExprObjC.h:1521
C Language Family Type Representation.
unsigned getNumOutputs() const
Definition: Stmt.h:2768
This represents &#39;#pragma omp for simd&#39; directive.
Definition: StmtOpenMP.h:1337
void setOpcode(Opcode Opc)
Definition: Expr.h:3472
void setRParenLoc(SourceLocation L)
Definition: Stmt.h:2902
void setContinueLoc(SourceLocation L)
Definition: Stmt.h:2579
void setThrowExpr(Stmt *S)
Definition: StmtObjC.h:346
void setAtLoc(SourceLocation L)
Definition: ExprObjC.h:472
An ImplicitValueInitExpr record.
Definition: ASTBitCodes.h:1596
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:88
void setDeclGroup(DeclGroupRef DGR)
Definition: Stmt.h:1245
An ImplicitCastExpr record.
Definition: ASTBitCodes.h:1566
This represents &#39;#pragma omp teams distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:4171
void setRBracket(SourceLocation RB)
Definition: ExprObjC.h:882
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Definition: Expr.h:5082
LambdaCaptureDefault
The default, if any, capture method for a lambda expression.
Definition: Lambda.h:22
void setType(QualType t)
Definition: Expr.h:138
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:3037
Defines the C++ template declaration subclasses.
void setPrevEnsureUpperBound(Expr *PrevEUB)
Definition: StmtOpenMP.h:679
This represents &#39;#pragma omp parallel master&#39; directive.
Definition: StmtOpenMP.h:1863
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:4889
Represents an attribute applied to a statement.
Definition: Stmt.h:1776
void setUpperBoundVariable(Expr *UB)
Definition: StmtOpenMP.h:622
void setComputationResultType(QualType T)
Definition: Expr.h:3681
void setNumIterations(Expr *NI)
Definition: StmtOpenMP.h:657
ParenExpr - This represents a parethesized expression, e.g.
Definition: Expr.h:1994
A CXXOperatorCallExpr record.
Definition: ASTBitCodes.h:1712
void setSuper(SourceLocation Loc, QualType T, bool IsInstanceSuper)
Definition: ExprObjC.h:1343
This represents &#39;#pragma omp target teams distribute&#39; combined directive.
Definition: StmtOpenMP.h:4310
A CXXTemporaryObjectExpr record.
Definition: ASTBitCodes.h:1727
Represents Objective-C&#39;s @throw statement.
Definition: StmtObjC.h:332
static OMPParallelMasterDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:568
void setNextLowerBound(Expr *NLB)
Definition: StmtOpenMP.h:643
static RequiresExpr * Create(ASTContext &C, SourceLocation RequiresKWLoc, RequiresExprBodyDecl *Body, ArrayRef< ParmVarDecl *> LocalParameters, ArrayRef< concepts::Requirement *> Requirements, SourceLocation RBraceLoc)
DeclRefExprBitfields DeclRefExprBits
Definition: Stmt.h:982
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1422
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:845
void setADLCallKind(ADLCallKind V=UsesADL)
Definition: Expr.h:2670
unsigned NumOutputs
Definition: Stmt.h:2733
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent...
Definition: ExprCXX.h:2715
void setValue(bool V)
Definition: ExprObjC.h:98
A constant expression context.
Definition: ASTBitCodes.h:1509
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
Definition: Specifiers.h:113
A container of type source information.
Definition: Type.h:6227
void setSwitchCaseList(SwitchCase *SC)
Definition: Stmt.h:2174
Stmt * SubExpr
Definition: Expr.h:952
void setCanOverflow(bool C)
Definition: Expr.h:2090
void setInstanceReceiver(Expr *rec)
Turn this message send into an instance message that computes the receiver object with the given expr...
Definition: ExprObjC.h:1272
Floating point control options.
Definition: LangOptions.h:357
This represents &#39;#pragma omp parallel for&#39; directive.
Definition: StmtOpenMP.h:1715
MS property subscript expression.
Definition: ExprCXX.h:937
void setStartLoc(SourceLocation L)
Definition: Stmt.h:1247
void setForLoc(SourceLocation L)
Definition: Stmt.h:2457
This represents &#39;#pragma omp target teams distribute parallel for&#39; combined directive.
Definition: StmtOpenMP.h:4379
static ObjCDictionaryLiteral * CreateEmpty(const ASTContext &C, unsigned NumElements, bool HasPackExpansions)
Definition: ExprObjC.cpp:104
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
Definition: ExprCXX.h:4419
void setLocation(SourceLocation L)
Definition: ExprObjC.h:590
void setDependentInits(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:151
void setDelegateInitCall(bool isDelegate)
Definition: ExprObjC.h:1414
void setProtocol(ObjCProtocolDecl *P)
Definition: ExprObjC.h:520
void setRParenLoc(SourceLocation L)
Definition: ExprCXX.h:3439
void setIsLastIterVariable(Expr *IL)
Definition: StmtOpenMP.h:608
This represents &#39;#pragma omp target exit data&#39; directive.
Definition: StmtOpenMP.h:2690
void setRAngleLoc(SourceLocation Loc)
Definition: TemplateBase.h:574
static OffsetOfExpr * CreateEmpty(const ASTContext &C, unsigned NumComps, unsigned NumExprs)
Definition: Expr.cpp:1563
static OMPTargetTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Represents a variable declaration or definition.
Definition: Decl.h:820
static OMPParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:178
bool hasTemplateKWAndArgsInfo() const
Definition: Expr.h:1294
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC &#39;id&#39; type.
Definition: ExprObjC.h:1492
void setIsPartOfExplicitCast(bool PartOfExplicitCast)
Definition: Expr.h:3294
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:3077
void setSubExpr(unsigned Idx, Expr *E)
Definition: Expr.h:4896
void setInitializer(Expr *E)
Definition: Expr.h:3105
void setLength(Expr *E)
Set length of the array section.
Definition: ExprOpenMP.h:101
void setOpLoc(SourceLocation L)
Definition: ExprObjC.h:1529
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
Definition: ExprCXX.h:2676
static FunctionParmPackExpr * CreateEmpty(const ASTContext &Context, unsigned NumParams)
Definition: ExprCXX.cpp:1651
void setAsmLoc(SourceLocation L)
Definition: Stmt.h:2750
AttributedStmtBitfields AttributedStmtBits
Definition: Stmt.h:966
static PredefinedExpr * CreateEmpty(const ASTContext &Ctx, bool HasFunctionName)
Create an empty PredefinedExpr.
Definition: Expr.cpp:642
void setCombinedDistCond(Expr *CombDistCond)
Definition: StmtOpenMP.h:719
void setValue(unsigned Val)
Definition: Expr.h:1568
ASTConstraintSatisfaction * Satisfaction
Information about the satisfaction of the named concept with the given arguments. ...
Definition: ExprConcepts.h:56
void setLocation(SourceLocation Location)
Definition: Expr.h:1513
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
Definition: TemplateBase.h:603
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition: ExprCXX.h:715
static DeclRefExpr * CreateEmpty(const ASTContext &Context, bool HasQualifier, bool HasFoundDecl, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Construct an empty declaration reference expression.
Definition: Expr.cpp:586
Stores a list of template parameters for a TemplateDecl and its derived classes.
Definition: DeclTemplate.h:69
unsigned getNumPlacementArgs() const
Definition: ExprCXX.h:2236
void setGNUSyntax(bool GNU)
Definition: Expr.h:4874
Defines the Objective-C statement AST node classes.
A CXXConstructExpr record.
Definition: ASTBitCodes.h:1721
unsigned getNumExpressions() const
Definition: Expr.h:2345
void setBeginStmt(Stmt *S)
Definition: StmtCXX.h:194
void setBase(Expr *E)
Set base of the array section.
Definition: ExprOpenMP.h:84
ReceiverKind
The kind of receiver this message is sending to.
Definition: ExprObjC.h:1096
raw_arg_iterator raw_arg_begin()
Definition: ExprCXX.h:2328
A C++ throw-expression (C++ [except.throw]).
Definition: ExprCXX.h:1140
Represents an expression – generally a full-expression – that introduces cleanups to be run at the ...
Definition: ExprCXX.h:3306
Represents a parameter to a function.
Definition: Decl.h:1595
void setInit(Expr *Init)
Definition: StmtOpenMP.h:603
Defines the clang::Expr interface and subclasses for C++ expressions.
void setThen(Stmt *Then)
Definition: Stmt.h:1926
void setTarget(Expr *E)
Definition: Stmt.h:2544
A ShuffleVectorExpr record.
Definition: ASTBitCodes.h:1617
A C++ static_cast expression (C++ [expr.static.cast]).
Definition: ExprCXX.h:409
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:1732
static OMPTargetExitDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:980
void setAtLoc(SourceLocation L)
Definition: ExprObjC.h:67
Represents a C99 designated initializer expression.
Definition: Expr.h:4639
An OffsetOfExpr record.
Definition: ASTBitCodes.h:1542
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition: Decl.h:272
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:1689
T * readDeclAs()
Reads a declaration from the given position in the record, advancing Idx.
static OMPTargetDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:835
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(), or __builtin_FILE().
Definition: Expr.h:4295
A DesignatedInitExpr record.
Definition: ASTBitCodes.h:1581
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
Definition: ExprConcepts.h:470
This represents &#39;#pragma omp parallel&#39; directive.
Definition: StmtOpenMP.h:357
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition: Expr.h:3999
void setExprOperand(Expr *E)
Definition: ExprCXX.h:1051
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:168
A C++ nested-name-specifier augmented with source location information.
void setLHS(Expr *E)
Definition: Expr.h:2499
static OMPTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Internal struct for storing Key/value pair.
Definition: ExprObjC.h:284
static std::string toString(const clang::SanitizerSet &Sanitizers)
Produce a string containing comma-separated names of sanitizers in Sanitizers set.
void setKeyExpr(Stmt *S)
Definition: ExprObjC.h:894
static OMPTargetParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:911
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:263
void setIsMicrosoftABI(bool IsMS)
Definition: Expr.h:4268
Represents a place-holder for an object not to be initialized by anything.
Definition: Expr.h:4937
Expr * readExpr()
Reads an expression.
static OMPFlushDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:753
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Definition: Expr.h:4210
void setArg(unsigned I, Expr *E)
Definition: ExprCXX.h:3475
void setArg(unsigned Arg, Expr *ArgExpr)
setArg - Set the specified argument.
Definition: Expr.h:2712
The iterator over UnresolvedSets.
Definition: UnresolvedSet.h:32
void setRParen(SourceLocation Loc)
Definition: Expr.h:2023
This represents &#39;#pragma omp target simd&#39; directive.
Definition: StmtOpenMP.h:3895
void setCapturedDecl(CapturedDecl *D)
Set the outlined function declaration.
Definition: Stmt.cpp:1307
void setReturnLoc(SourceLocation L)
Definition: Stmt.h:2693
Represents a C++ member access expression for which lookup produced a set of overloaded functions...
Definition: ExprCXX.h:3771
Defines some OpenMP-specific enums and functions.
void setCond(Expr *Cond)
Definition: Stmt.h:2111
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:5518
OpenMPDirectiveKind getDirectiveKind() const
Definition: StmtOpenMP.h:301
void setIfLoc(SourceLocation IfLoc)
Definition: Stmt.h:1994
This represents &#39;#pragma omp barrier&#39; directive.
Definition: StmtOpenMP.h:2101
void setComponent(unsigned Idx, OffsetOfNode ON)
Definition: Expr.h:2321
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp, [NSNumber numberWithInt:42]];.
Definition: ExprObjC.h:188
unsigned getCharByteWidth() const
Definition: Expr.h:1824
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:420
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition: ExprCXX.h:4269
void setSubStmt(Stmt *S)
Definition: Stmt.h:1624
This represents &#39;#pragma omp critical&#39; directive.
Definition: StmtOpenMP.h:1640
static OMPCriticalDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:440
void setRParenLoc(SourceLocation L)
Definition: Expr.h:3980
void setCond(Expr *Cond)
Definition: StmtOpenMP.h:600
size_t size() const
The length of this record.
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:968
Represents Objective-C&#39;s @catch statement.
Definition: StmtObjC.h:77
void setLBraceLoc(SourceLocation Loc)
Definition: Expr.h:4551
static OMPTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
IndirectGotoStmt - This represents an indirect goto.
Definition: Stmt.h:2520
Describes an C or C++ initializer list.
Definition: Expr.h:4403
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition: ExprCXX.h:764
This represents &#39;#pragma omp distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:3606
void setValue(const ASTContext &C, const llvm::APInt &Val)
Definition: Expr.h:1431
This represents &#39;#pragma omp teams distribute parallel for simd&#39; composite directive.
Definition: StmtOpenMP.h:4100
void setBuiltinLoc(SourceLocation L)
Definition: Expr.h:4018
BinaryOperatorKind
void setSubExpr(Expr *E)
Definition: Expr.h:2012
void setLHS(Expr *E)
Definition: Expr.h:4178
unsigned getLength() const
Definition: Expr.h:1823
ForStmt - This represents a &#39;for (init;cond;inc)&#39; stmt.
Definition: Stmt.h:2410
void setOperatorNew(FunctionDecl *D)
Definition: ExprCXX.h:2219
static DeclAccessPair make(NamedDecl *D, AccessSpecifier AS)
void setLocation(SourceLocation L)
Definition: ExprCXX.h:698
CXXScalarValueInitExprBitfields CXXScalarValueInitExprBits
Definition: Stmt.h:1008
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:303
A convenient class for passing around template argument information.
Definition: TemplateBase.h:554
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
void setSelector(Selector S)
Definition: ExprObjC.h:468
A reference to a previously [de]serialized Stmt record.
Definition: ASTBitCodes.h:1446
void setEndLoc(SourceLocation L)
Definition: Stmt.h:1249
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
Definition: ExprCXX.h:1963
path_iterator path_begin()
Definition: Expr.h:3222
void setLocation(SourceLocation L)
Definition: ExprObjC.h:104
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: ExprCXX.h:3713
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3434
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:5541
CXXForRangeStmt - This represents C++0x [stmt.ranged]&#39;s ranged for statement, represented as &#39;for (ra...
Definition: StmtCXX.h:134
static OMPParallelMasterTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
llvm::Error Error
SourceRange readSourceRange()
Read a source range, advancing Idx.
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:2946
void setString(StringLiteral *S)
Definition: ExprObjC.h:64
void setAsmString(StringLiteral *E)
Definition: Stmt.h:2908
ObjCStringLiteral, used for Objective-C string literals i.e.
Definition: ExprObjC.h:50
std::pair< SourceLocation, StringRef > SubstitutionDiagnostic
Definition: ASTConcept.h:44
CaseStmt - Represent a case statement.
Definition: Stmt.h:1500
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
Definition: Expr.h:5978
void setCombinedInit(Expr *CombInit)
Definition: StmtOpenMP.h:699
void setLHS(Expr *Val)
Definition: Stmt.h:1597
This represents &#39;#pragma omp teams&#39; directive.
Definition: StmtOpenMP.h:2888
void setOperatorLoc(SourceLocation L)
Definition: Expr.h:2303
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:3150
Helper class for OffsetOfExpr.
Definition: Expr.h:2163
A marker record that indicates that we are at the end of an expression.
Definition: ASTBitCodes.h:1440
void setInit(Stmt *Init)
Definition: Stmt.h:2134
This represents &#39;#pragma omp teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:4029
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:1373
void setDestroyedType(IdentifierInfo *II, SourceLocation Loc)
Set the name of destroyed type for a dependent pseudo-destructor expression.
Definition: ExprCXX.h:2593
ArrayTypeTrait
Names for the array type traits.
Definition: TypeTraits.h:90
const llvm::fltSemantics & getSemantics() const
Return the APFloat semantics this literal uses.
Definition: Expr.h:1619
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:1818
static OMPTaskyieldDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:636
void setCond(Expr *E)
Definition: Stmt.h:2452
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:928
void setOpcode(Opcode Opc)
Definition: Expr.h:2074
void ReadTemplateKWAndArgsInfo(ASTTemplateKWAndArgsInfo &Args, TemplateArgumentLoc *ArgsLocArray, unsigned NumTemplateArgs)
Read and initialize a ExplicitTemplateArgumentList structure.
DeclAccessPair * getTrailingResults()
Return the results. Defined after UnresolvedMemberExpr.
Definition: ExprCXX.h:3925
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3511
static OMPParallelMasterTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setRParenLoc(SourceLocation Loc)
Definition: StmtObjC.h:55
void setRParenLoc(SourceLocation R)
Definition: Expr.h:2307
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1202
bool isTypeOperand() const
Definition: ExprCXX.h:1029
void setSourceRange(SourceRange R)
Definition: ExprCXX.h:1062
unsigned NumClobbers
Definition: Stmt.h:2735
void setRParenLoc(SourceLocation L)
Definition: Expr.h:3401
Represents the this expression in C++.
Definition: ExprCXX.h:1097
void setCastKind(CastKind K)
Definition: Expr.h:3197
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
Definition: TemplateBase.h:650
static OMPTargetDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:935
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:981
void setEqualOrColonLoc(SourceLocation L)
Definition: Expr.h:4865
This represents &#39;#pragma omp target parallel for simd&#39; directive.
Definition: StmtOpenMP.h:3825
void setDependentCounters(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:144
void setArgument(Expr *E)
Definition: Expr.h:2424
OpenMP 4.0 [2.4, Array Sections].
Definition: ExprOpenMP.h:44
void setTypeSourceInfo(TypeSourceInfo *tsi)
Definition: Expr.h:2312
ConditionalOperator - The ?: ternary operator.
Definition: Expr.h:3732
static OMPTargetSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
TypeSourceInfo * readTypeSourceInfo()
Reads a declarator info from the given record, advancing Idx.
Definition: ASTReader.cpp:6720
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition: ExprCXX.h:2479
void setAmpAmpLoc(SourceLocation L)
Definition: Expr.h:3925
void setBreakLoc(SourceLocation L)
Definition: Stmt.h:2609
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
Definition: ExprCXX.h:3931
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:1332
A requires-expression requirement which queries the existence of a type name or type template special...
Definition: ExprConcepts.h:198
void setBlockDecl(BlockDecl *BD)
Definition: Expr.h:5595
This represents &#39;#pragma omp taskgroup&#39; directive.
Definition: StmtOpenMP.h:2193
static OMPSingleDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:397
CastKind
CastKind - The kind of operation required for a conversion.
void setSemiLoc(SourceLocation L)
Definition: Stmt.h:1309
void setSubExpr(Expr *E)
Definition: Expr.h:2077
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
Definition: Expr.h:2372
void setLParen(SourceLocation Loc)
Definition: Expr.h:2019
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition: Expr.h:978
Represents a call to the builtin function __builtin_va_arg.
Definition: Expr.h:4244
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
Definition: ASTConcept.h:29
static OMPTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setLeaveLoc(SourceLocation L)
Definition: Stmt.h:3348
void setConditionVariable(const ASTContext &Ctx, VarDecl *V)
Set the condition variable for this if statement.
Definition: Stmt.cpp:894
This represents &#39;#pragma omp distribute&#39; directive.
Definition: StmtOpenMP.h:3480
SubstNonTypeTemplateParmExprBitfields SubstNonTypeTemplateParmExprBits
Definition: Stmt.h:1021
void setInits(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:126
void setOperatorDelete(FunctionDecl *D)
Definition: ExprCXX.h:2221
void setRParenLoc(SourceLocation L)
Definition: Stmt.h:2388
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type...
Definition: ExprCXX.h:2053
void setLocation(SourceLocation Location)
Definition: Expr.h:1566
void setRParenLoc(SourceLocation Loc)
Definition: StmtObjC.h:108
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition: Decl.h:4037
static OMPSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:220
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:619
This represents one expression.
Definition: Expr.h:108
Defines the clang::LangOptions interface.
CXXRewrittenBinaryOperatorBitfields CXXRewrittenBinaryOperatorBits
Definition: Stmt.h:1001
void setDesignators(const ASTContext &C, const Designator *Desigs, unsigned NumDesigs)
Definition: Expr.cpp:4377
void setRBraceLoc(SourceLocation Loc)
Definition: Expr.h:4553
void setInit(Stmt *Init)
Definition: Stmt.h:1987
void setIsImplicit(bool value=true)
Definition: ExprCXX.h:4726
SourceLocation End
void setWhileLoc(SourceLocation L)
Definition: Stmt.h:2328
void setCallee(Expr *F)
Definition: Expr.h:2665
Represents the body of a requires-expression.
Definition: DeclCXX.h:1909
void setRParenLoc(SourceLocation L)
Definition: Expr.h:4021
void setLParenLoc(SourceLocation L)
Definition: Stmt.h:2459
void setBase(Expr *Base)
Definition: Expr.h:4993
Stmt * ReadStmt(ModuleFile &F)
Reads a statement.
static CXXMemberCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, EmptyShell Empty)
Definition: ExprCXX.cpp:708
This represents &#39;#pragma omp master taskloop&#39; directive.
Definition: StmtOpenMP.h:3204
static OMPMasterTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setSyntacticForm(InitListExpr *Init)
Definition: Expr.h:4566
Represents a C++ functional cast expression that builds a temporary object.
Definition: ExprCXX.h:1750
static ReturnStmt * CreateEmpty(const ASTContext &Ctx, bool HasNRVOCandidate)
Create an empty return statement, optionally with storage for an NRVO candidate.
Definition: Stmt.cpp:1101
void setRBracketLoc(SourceLocation L)
Definition: ExprOpenMP.h:112
A C++ const_cast expression (C++ [expr.const.cast]).
Definition: ExprCXX.h:527
void setTypeDependent(bool TD)
Set whether this expression is type-dependent or not.
Definition: Expr.h:179
void setTypeOperandSourceInfo(TypeSourceInfo *TSI)
Definition: ExprCXX.h:1041
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:5579
Field designator where only the field name is known.
Definition: ASTBitCodes.h:1880
static OMPDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Expected< unsigned > readRecord(llvm::BitstreamCursor &Cursor, unsigned AbbrevID)
Reads a record with id AbbrevID from Cursor, resetting the internal state.
Defines an enumeration for C++ overloaded operators.
This represents &#39;#pragma omp target teams distribute parallel for simd&#39; combined directive.
Definition: StmtOpenMP.h:4463
void setRHS(Expr *E)
Definition: Expr.h:3477
void setInc(Expr *E)
Definition: Stmt.h:2453
raw_arg_iterator raw_arg_end()
Definition: ExprCXX.h:2329
static CXXReinterpretCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
Definition: ExprCXX.cpp:876
#define bool
Definition: stdbool.h:15
void setUuidStr(StringRef US)
Definition: ExprCXX.h:1056
void setWrittenTypeInfo(TypeSourceInfo *TI)
Definition: Expr.h:4271
void setRetValue(Expr *E)
Definition: Stmt.h:2671
void setBody(Stmt *S)
Definition: Stmt.h:2454
unsigned getNumTemplateArgs() const
Definition: ExprCXX.h:3003
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
Definition: ExprObjC.h:304
ExprBitfields ExprBits
Definition: Stmt.h:979
void setObjectKind(ExprObjectKind Cat)
setObjectKind - Set the object kind produced by this expression.
Definition: Expr.h:434
bool hasQualifier() const
Determine whether this declaration reference was preceded by a C++ nested-name-specifier, e.g., N::foo.
Definition: Expr.h:1262
void setBody(Stmt *Body)
Definition: Stmt.h:2120
static UserDefinedLiteral * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, EmptyShell Empty)
Definition: ExprCXX.cpp:948
Represents Objective-C&#39;s @synchronized statement.
Definition: StmtObjC.h:277
ObjCSelectorExpr used for @selector in Objective-C.
Definition: ExprObjC.h:454
A CXXStdInitializerListExpr record.
Definition: ASTBitCodes.h:1748
void setFinallyBody(Stmt *S)
Definition: StmtObjC.h:141
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:4091
CXXTryStmt - A C++ try block, including all handlers.
Definition: StmtCXX.h:68
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Definition: Expr.h:5642
An ArraySubscriptExpr record.
Definition: ASTBitCodes.h:1548
Decl * readDecl()
Reads a declaration from the given position in a record in the given module, advancing Idx...
static FloatingLiteral * Create(const ASTContext &C, const llvm::APFloat &V, bool isexact, QualType Type, SourceLocation L)
Definition: Expr.cpp:984
This represents &#39;#pragma omp target teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:4536
CXXDefaultInitExprBitfields CXXDefaultInitExprBits
Definition: Stmt.h:1007
Information about a module that has been loaded by the ASTReader.
Definition: ModuleFile.h:107
ExprWithCleanupsBitfields ExprWithCleanupsBits
Definition: Stmt.h:1014
An ArrayInitLoopExpr record.
Definition: ASTBitCodes.h:1590
unsigned getNumClauses() const
Get number of clauses.
Definition: StmtOpenMP.h:241
A PseudoObjectExpr record.
Definition: ASTBitCodes.h:1629
void setColonLoc(SourceLocation L)
Definition: ExprOpenMP.h:109
void setFinallyStmt(Stmt *S)
Definition: StmtObjC.h:247
Extra data stored in some MemberExpr objects.
Definition: Expr.h:2824
CompoundStmtBitfields CompoundStmtBits
Definition: Stmt.h:964
An ObjCIndirectCopyRestoreExpr record.
Definition: ASTBitCodes.h:1671
This represents &#39;#pragma omp for&#39; directive.
Definition: StmtOpenMP.h:1259
static OMPTargetEnterDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:958
void setValueKind(ExprValueKind Cat)
setValueKind - Set the value kind produced by this expression.
Definition: Expr.h:431
StringLiteralBitfields StringLiteralBits
Definition: Stmt.h:984
void setRParenLoc(SourceLocation L)
Definition: ExprObjC.h:526
bool hasInitializer() const
Whether this new-expression has any initializer at all.
Definition: ExprCXX.h:2262
Represents a folding of a pack over an operator.
Definition: ExprCXX.h:4529
void setEndStmt(Stmt *S)
Definition: StmtCXX.h:195
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
Definition: Stmt.h:2636
This represents &#39;#pragma omp target teams&#39; directive.
Definition: StmtOpenMP.h:4251
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:950
void setBody(Stmt *Body)
Definition: Stmt.h:2292
This represents a Microsoft inline-assembly statement extension.
Definition: Stmt.h:3101
void setColonLoc(SourceLocation L)
Definition: Stmt.h:1482
void setIsArrow(bool A)
Definition: ExprObjC.h:586
void setRParenLoc(SourceLocation L)
Definition: Expr.h:4186
A DesignatedInitUpdateExpr record.
Definition: ASTBitCodes.h:1584
SourceLocation getEnd() const
void setAtLoc(SourceLocation L)
Definition: ExprObjC.h:424
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:2046
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:1234
A member reference to an MSPropertyDecl.
Definition: ExprCXX.h:863
static OMPParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:543
static UnresolvedLookupExpr * CreateEmpty(const ASTContext &Context, unsigned NumResults, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition: ExprCXX.cpp:436
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition: ExprCXX.h:4209
void setForLoc(SourceLocation Loc)
Definition: StmtObjC.h:53
This represents &#39;#pragma omp cancel&#39; directive.
Definition: StmtOpenMP.h:3005
void setDistInc(Expr *DistInc)
Definition: StmtOpenMP.h:674
void setBase(Expr *base)
Definition: ExprObjC.h:582
ValueDecl * getDecl()
Definition: Expr.h:1247
An ObjCAvailabilityCheckExpr record.
Definition: ASTBitCodes.h:1698
void setRParenLoc(SourceLocation L)
Definition: ExprObjC.h:473
std::string readString()
Read a string, advancing Idx.
void setConditionVariable(const ASTContext &Ctx, VarDecl *V)
Set the condition variable of this while statement.
Definition: Stmt.cpp:1057
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:3371
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
NestedNameSpecifierLoc NestedNameSpec
Definition: ASTConcept.h:103
This file defines OpenMP AST classes for clauses.
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1...
Definition: Expr.h:1662
An ObjCForCollectionStmt record.
Definition: ASTBitCodes.h:1674
This represents &#39;#pragma omp flush&#39; directive.
Definition: StmtOpenMP.h:2267
This represents &#39;#pragma omp parallel for simd&#39; directive.
Definition: StmtOpenMP.h:1796
void setRParenLoc(SourceLocation L)
Definition: Expr.h:4277
void setAtTryLoc(SourceLocation Loc)
Definition: StmtObjC.h:205
DoStmt - This represents a &#39;do/while&#39; stmt.
Definition: Stmt.h:2354
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
Definition: Stmt.h:2719
void setTypeOperandSourceInfo(TypeSourceInfo *TSI)
Definition: ExprCXX.h:816
void setBody(Stmt *S)
Definition: StmtCXX.h:199
SourceLocation TemplateKWLoc
The location of the template keyword, if specified when naming the concept.
Definition: ASTConcept.h:107
A MS-style AsmStmt record.
Definition: ASTBitCodes.h:1506
void setConditionVariable(const ASTContext &Ctx, VarDecl *VD)
Set the condition variable in this switch statement.
Definition: Stmt.cpp:1001
void setLocStart(SourceLocation Loc)
Set starting location of directive kind.
Definition: StmtOpenMP.h:233
OpaqueValueExprBitfields OpaqueValueExprBits
Definition: Stmt.h:1031
static OMPParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:492
This represents &#39;#pragma omp parallel master taskloop&#39; directive.
Definition: StmtOpenMP.h:3340
static CoroutineBodyStmt * Create(const ASTContext &C, CtorArgs const &Args)
Definition: StmtCXX.cpp:86
void setSynchExpr(Stmt *S)
Definition: StmtObjC.h:311
This represents &#39;#pragma omp target enter data&#39; directive.
Definition: StmtOpenMP.h:2631
void setUpdates(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:132
void setLowerBoundVariable(Expr *LB)
Definition: StmtOpenMP.h:615
This represents &#39;#pragma omp master taskloop simd&#39; directive.
Definition: StmtOpenMP.h:3272
void setLParenLoc(SourceLocation L)
Definition: ExprCXX.h:1720
void setTypeSourceInfo(TypeSourceInfo *tinfo)
Definition: Expr.h:3116
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Definition: ExprCXX.h:445
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
Definition: Expr.h:1075
void setComputationLHSType(QualType T)
Definition: Expr.h:3678
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition: Expr.h:4067
unsigned getNumArgs() const
Return the number of actual arguments in this message, not counting the receiver. ...
Definition: ExprObjC.h:1382
static OMPSectionDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:374
void setDecl(LabelDecl *D)
Definition: Stmt.h:1750
Kind
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr...
Definition: ExprCXX.h:2844
A field in a dependent type, known only by its name.
Definition: Expr.h:2172
This captures a statement into a function.
Definition: Stmt.h:3376
Represents a call to an inherited base class constructor from an inheriting constructor.
Definition: ExprCXX.h:1613
unsigned path_size() const
Definition: Expr.h:3221
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition: Expr.h:5715
void setLParenLoc(SourceLocation L)
Definition: Expr.h:3398
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on a template...
Definition: Expr.h:200
void setSubStmt(Stmt *S)
Definition: Stmt.h:1669
void setAccessorLoc(SourceLocation L)
Definition: Expr.h:5544
void setGotoLoc(SourceLocation L)
Definition: Stmt.h:2535
static CXXDynamicCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
Definition: ExprCXX.cpp:818
unsigned getNumExprs() const
Return the number of expressions in this paren list.
Definition: Expr.h:5169
void setLocation(SourceLocation L)
Definition: Expr.h:1256
This represents &#39;#pragma omp single&#39; directive.
Definition: StmtOpenMP.h:1535
Encodes a location in the source.
void setLocation(SourceLocation L)
Definition: Expr.h:1956
void setPrevLowerBoundVariable(Expr *PrevLB)
Definition: StmtOpenMP.h:664
void setIterationVariable(Expr *IV)
Definition: StmtOpenMP.h:588
Defines enumerations for expression traits intrinsics.
PseudoObjectExprBitfields PseudoObjectExprBits
Definition: Stmt.h:996
static CXXOperatorCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, EmptyShell Empty)
Definition: ExprCXX.cpp:650
UnresolvedLookupExprBitfields UnresolvedLookupExprBits
Definition: Stmt.h:1018
unsigned getNumHandlers() const
Definition: StmtCXX.h:106
void setUpdater(Expr *Updater)
Definition: Expr.h:4998
CXXThrowExprBitfields CXXThrowExprBits
Definition: Stmt.h:1005
static OMPTaskDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:618
This is a basic class for representing single OpenMP executable directive.
Definition: StmtOpenMP.h:33
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:2384
static CXXConstCastExpr * CreateEmpty(const ASTContext &Context)
Definition: ExprCXX.cpp:890
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
Definition: ExprCXX.h:2100
void setCombinedNextLowerBound(Expr *CombNLB)
Definition: StmtOpenMP.h:709
void setAtCatchLoc(SourceLocation Loc)
Definition: StmtObjC.h:106
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c dictionary literal.
Definition: ExprObjC.h:358
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit...
Definition: ExprCXX.h:564
void setSourceRange(SourceRange R)
Definition: ExprCXX.h:834
Represents a C++2a __builtin_bit_cast(T, v) expression.
Definition: ExprCXX.h:4812
static ObjCAtTryStmt * CreateEmpty(const ASTContext &Context, unsigned NumCatchStmts, bool HasFinally)
Definition: StmtObjC.cpp:57
void setConstexpr(bool C)
Definition: Stmt.h:2008
Represents a call to a member function that may be written either with member call syntax (e...
Definition: ExprCXX.h:171
static StringLiteral * CreateEmpty(const ASTContext &Ctx, unsigned NumConcatenated, unsigned Length, unsigned CharByteWidth)
Construct an empty string literal.
Definition: Expr.cpp:1095
void setIdentLoc(SourceLocation L)
Definition: Stmt.h:1747
GenericSelectionExprBitfields GenericSelectionExprBits
Definition: Stmt.h:995
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:1225
void setInit(Stmt *S)
Definition: StmtCXX.h:191
void setLabelLoc(SourceLocation L)
Definition: Expr.h:3927
A CXXFunctionalCastExpr record.
Definition: ASTBitCodes.h:1742
void setTemporary(CXXTemporary *T)
Definition: ExprCXX.h:1394
static ExprWithCleanups * Create(const ASTContext &C, EmptyShell empty, unsigned numObjects)
Definition: ExprCXX.cpp:1346
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:2193
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:1294
static concepts::Requirement::SubstitutionDiagnostic * readSubstitutionDiagnostic(ASTRecordReader &Record)
void setCatchParamDecl(VarDecl *D)
Definition: StmtObjC.h:103
An ObjCEncodeExpr record.
Definition: ASTBitCodes.h:1644
static OMPAtomicDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:809
This represents &#39;#pragma omp taskwait&#39; directive.
Definition: StmtOpenMP.h:2147
void setLHS(Expr *E)
Definition: Expr.h:3475
void setIsFreeIvar(bool A)
Definition: ExprObjC.h:587
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:5849
void setFinalsConditions(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:157
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:2267
bool isArray() const
Definition: ExprCXX.h:2223
static OMPOrderedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:778
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:91
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition: ExprObjC.h:503
static WhileStmt * CreateEmpty(const ASTContext &Ctx, bool HasVar)
Create an empty while statement optionally with storage for a condition variable. ...
Definition: Stmt.cpp:1043
bool isValueDependent() const
isValueDependent - Determines whether this expression is value-dependent (C++ [temp.dep.constexpr]).
Definition: Expr.h:158
void setDecl(ValueDecl *NewD)
Definition: Expr.h:1249
void setThrowLoc(SourceLocation Loc)
Definition: StmtObjC.h:349
unsigned getIdx() const
The current position in this record.
An ObjCIsa Expr record.
Definition: ASTBitCodes.h:1668
ASTContext & getContext()
Retrieve the AST context that this AST reader supplements.
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:3274
Stmt * getCapturedStmt()
Retrieve the statement being captured.
Definition: Stmt.h:3477
This represents &#39;#pragma omp target&#39; directive.
Definition: StmtOpenMP.h:2514
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:1398
static DesignatedInitExpr * CreateEmpty(const ASTContext &C, unsigned NumIndexExprs)
Definition: Expr.cpp:4370
static DeclGroup * Create(ASTContext &C, Decl **Decls, unsigned NumDecls)
Definition: DeclGroup.cpp:20
bool isParenTypeId() const
Definition: ExprCXX.h:2253
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:891
NullStmtBitfields NullStmtBits
Definition: Stmt.h:963
DeclarationNameInfo ConceptName
The concept name used.
Definition: ASTConcept.h:110
An expression trait intrinsic.
Definition: ExprCXX.h:2785
void setEncodedTypeSourceInfo(TypeSourceInfo *EncType)
Definition: ExprObjC.h:432
static CXXDependentScopeMemberExpr * CreateEmpty(const ASTContext &Ctx, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs, bool HasFirstQualifierFoundInScope)
Definition: ExprCXX.cpp:1467
An AtomicExpr record.
Definition: ASTBitCodes.h:1632
A static requirement that can be used in a requires-expression to check properties of types and expre...
Definition: ExprConcepts.h:145
This represents &#39;#pragma omp ordered&#39; directive.
Definition: StmtOpenMP.h:2323
static ConceptSpecializationExpr * Create(const ASTContext &C, NestedNameSpecifierLoc NNS, SourceLocation TemplateKWLoc, DeclarationNameInfo ConceptNameInfo, NamedDecl *FoundDecl, ConceptDecl *NamedConcept, const ASTTemplateArgumentListInfo *ArgsAsWritten, ArrayRef< TemplateArgument > ConvertedArgs, const ConstraintSatisfaction *Satisfaction)
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition: Expr.h:3954
void setCond(Expr *E)
Definition: StmtCXX.h:196
static SizeOfPackExpr * CreateDeserialized(ASTContext &Context, unsigned NumPartialArgs)
Definition: ExprCXX.cpp:1608
This represents &#39;#pragma omp target update&#39; directive.
Definition: StmtOpenMP.h:3547
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:124
MemberExprBitfields MemberExprBits
Definition: Stmt.h:990
void setSubExpr(Expr *E)
Definition: Expr.h:4264
void setLAngleLoc(SourceLocation Loc)
Definition: TemplateBase.h:573
void sawArrayRangeDesignator(bool ARD=true)
Definition: Expr.h:4576
static CXXTemporaryObjectExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs)
Definition: ExprCXX.cpp:1052
void addArgument(const TemplateArgumentLoc &Loc)
Definition: TemplateBase.h:594
This represents &#39;#pragma omp parallel master taskloop simd&#39; directive.
Definition: StmtOpenMP.h:3411
void setCapturedRecordDecl(RecordDecl *D)
Set the record declaration for captured variables.
Definition: Stmt.h:3497
Representation of a Microsoft __if_exists or __if_not_exists statement with a dependent name...
Definition: StmtCXX.h:252
A placeholder type used to construct an empty shell of a type, that will be filled in later (e...
Definition: Stmt.h:1056
void setSimple(bool V)
Definition: Stmt.h:2753
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:3155
void setRBracketLoc(SourceLocation L)
Definition: ExprCXX.h:976
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:3654
Expr ** getElements()
Retrieve elements of array of literals.
Definition: ExprObjC.h:219
Defines various enumerations that describe declaration and type specifiers.
A POD class for pairing a NamedDecl* with an access specifier.
Represents a C11 generic selection.
Definition: Expr.h:5234
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition: Expr.h:3910
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers...
Definition: ExprObjC.h:1638
Represents a reference to a function parameter pack or init-capture pack that has been substituted bu...
Definition: ExprCXX.h:4337
Represents a template argument.
Definition: TemplateBase.h:50
void setGotoLoc(SourceLocation L)
Definition: Stmt.h:2498
void setPrevUpperBoundVariable(Expr *PrevUB)
Definition: StmtOpenMP.h:669
static CXXUnresolvedConstructExpr * CreateEmpty(const ASTContext &Context, unsigned NumArgs)
Definition: ExprCXX.cpp:1387
void setCombinedEnsureUpperBound(Expr *CombEUB)
Definition: StmtOpenMP.h:694
static OMPForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:272
void setLocation(SourceLocation L)
Definition: Expr.h:1639
NullStmt - This is the null statement ";": C99 6.8.3p3.
Definition: Stmt.h:1297
void setCounters(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:113
bool isTypeOperand() const
Definition: ExprCXX.h:804
unsigned getNumAssocs() const
The number of association expressions.
Definition: Expr.h:5402
Dataflow Directional Tag Classes.
static GenericSelectionExpr * CreateEmpty(const ASTContext &Context, unsigned NumAssocs)
Create an empty generic selection expression for deserialization.
Definition: Expr.cpp:4272
An InitListExpr record.
Definition: ASTBitCodes.h:1578
llvm::BitstreamCursor DeclsCursor
DeclsCursor - This is a cursor to the start of the DECLS_BLOCK block.
Definition: ModuleFile.h:408
void setBuiltinLoc(SourceLocation L)
Definition: Expr.h:4183
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:1903
UnaryOperatorKind
void setValue(bool V)
Definition: ExprCXX.h:658
A CXXBoolLiteralExpr record.
Definition: ASTBitCodes.h:1751
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
Definition: ExprCXX.h:2359
void setCombinedUpperBoundVariable(Expr *CombUB)
Definition: StmtOpenMP.h:689
void setRParenLoc(SourceLocation L)
Definition: Expr.h:2790
static CapturedStmt * CreateDeserialized(const ASTContext &Context, unsigned NumCaptures)
Definition: Stmt.cpp:1276
An ExtVectorElementExpr record.
Definition: ASTBitCodes.h:1575
void setLabel(LabelDecl *L)
Definition: Expr.h:3933
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:3356
This represents &#39;#pragma omp section&#39; directive.
Definition: StmtOpenMP.h:1472
void setAtLoc(SourceLocation L)
Definition: ExprObjC.h:525
This represents &#39;#pragma omp teams distribute&#39; directive.
Definition: StmtOpenMP.h:3961
void setIsUnique(bool V)
Definition: Expr.h:1135
Expr * ReadExpr(ModuleFile &F)
Reads an expression.
void setSubExpr(Expr *E)
Definition: Expr.h:1676
void setExprs(const ASTContext &C, ArrayRef< Expr *> Exprs)
Definition: Expr.cpp:4181
void setSubExpr(Expr *E)
Definition: Expr.h:3204
void setCollection(Expr *E)
Definition: StmtObjC.h:47
void setDecl(ObjCIvarDecl *d)
Definition: ExprObjC.h:578
AccessSpecifier getAccess() const
Definition: DeclBase.h:473
void setFileScope(bool FS)
Definition: Expr.h:3108
void setExact(bool E)
Definition: Expr.h:1631
A runtime availability query.
Definition: ExprObjC.h:1699
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
Definition: ExprCXX.h:487
This represents &#39;#pragma omp simd&#39; directive.
Definition: StmtOpenMP.h:1194
Represents a &#39;co_yield&#39; expression.
Definition: ExprCXX.h:4786
An ObjCAutoreleasePoolStmt record.
Definition: ASTBitCodes.h:1692
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition: ExprCXX.h:4015
A CXXDynamicCastExpr record.
Definition: ASTBitCodes.h:1733
static LambdaExpr * CreateDeserialized(const ASTContext &C, unsigned NumCaptures)
Construct a new lambda expression that will be deserialized from an external source.
Definition: ExprCXX.cpp:1233
static PseudoObjectExpr * Create(const ASTContext &Context, Expr *syntactic, ArrayRef< Expr *> semantic, unsigned resultIndex)
Definition: Expr.cpp:4543
void setInstantiationDependent(bool ID)
Set whether this expression is instantiation-dependent or not.
Definition: Expr.h:205
void setEllipsisLoc(SourceLocation L)
Set the location of the ...
Definition: Stmt.h:1582
Kind
The kind of offsetof node we have.
Definition: Expr.h:2166
void setLParenLoc(SourceLocation L)
Definition: Expr.h:3978
void setSelector(Selector S)
Definition: ExprObjC.h:1351
ExplicitCastExpr - An explicit cast written in the source code.
Definition: Expr.h:3337
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
void setMethodDecl(ObjCMethodDecl *MD)
Definition: ExprObjC.h:1370
This represents &#39;#pragma omp atomic&#39; directive.
Definition: StmtOpenMP.h:2379
static CompoundStmt * CreateEmpty(const ASTContext &C, unsigned NumStmts)
Definition: Stmt.cpp:326
pack_iterator pack_begin() const
Iterator referencing the first argument of a template argument pack.
Definition: TemplateBase.h:339
void setImplicit(bool I)
Definition: ExprCXX.h:1119
An ObjCAtFinallyStmt record.
Definition: ASTBitCodes.h:1680
CXXNewExprBitfields CXXNewExprBits
Definition: Stmt.h:1009
RequiresExprBitfields RequiresExprBits
Definition: Stmt.h:1022
llvm::SmallVector< std::pair< const Expr *, Detail >, 4 > Details
Pairs of unsatisfied atomic constraint expressions along with the substituted constraint expr...
Definition: ASTConcept.h:53
uint64_t readInt()
Returns the current value in this record, and advances to the next value.
Represents a __leave statement.
Definition: Stmt.h:3337
unsigned getCollapsedNumber() const
Get number of collapsed loops.
Definition: StmtOpenMP.h:912
unsigned getNumSubExprs() const
Definition: Expr.h:5914
void setRBracketLoc(SourceLocation L)
Definition: Expr.h:2519
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition: ExprCXX.h:3958
SwitchStmt - This represents a &#39;switch&#39; stmt.
Definition: Stmt.h:2043
CXXConstructExprBitfields CXXConstructExprBits
Definition: Stmt.h:1013
static OMPForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:324
Represents the body of a coroutine.
Definition: StmtCXX.h:317
void setElement(Stmt *S)
Definition: StmtObjC.h:46
TemplateArgumentLoc * getTrailingTemplateArgumentLoc()
Return the optional template arguments.
Definition: ExprCXX.h:3941
Location wrapper for a TemplateArgument.
Definition: TemplateBase.h:449
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:229
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition: Expr.h:2462
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c array literal.
Definition: ExprObjC.h:227
static OMPBarrierDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:650
This file defines OpenMP AST classes for executable directives and clauses.
Represents Objective-C&#39;s collection statement.
Definition: StmtObjC.h:23
static CUDAKernelCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, EmptyShell Empty)
Definition: ExprCXX.cpp:1758
void setRHS(Expr *Val)
Definition: Stmt.h:1613
An ObjCAtSynchronizedStmt record.
Definition: ASTBitCodes.h:1686
unsigned getNumObjects() const
Definition: ExprCXX.h:3337
void setIndexExpr(unsigned Idx, Expr *E)
Definition: Expr.h:2340
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:407
void setVolatile(bool V)
Definition: Stmt.h:2756
void setLowerBound(Expr *E)
Set lower bound of the array section.
Definition: ExprOpenMP.h:95
An implicit indirection through a C++ base class, when the field found is in a base class...
Definition: Expr.h:2175
Represents a call to a CUDA kernel function.
Definition: ExprCXX.h:224
Represents a &#39;co_await&#39; expression.
Definition: ExprCXX.h:4699
TypeTraitExprBitfields TypeTraitExprBits
Definition: Stmt.h:1011
static ImplicitCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
Definition: Expr.cpp:2017
void setSwitchLoc(SourceLocation L)
Definition: Stmt.h:2177
A CXXMemberCallExpr record.
Definition: ASTBitCodes.h:1715
void setAtFinallyLoc(SourceLocation Loc)
Definition: StmtObjC.h:149
void setArg(unsigned Arg, Expr *ArgExpr)
Set the specified argument.
Definition: ExprCXX.h:1583
void setKind(UnaryExprOrTypeTrait K)
Definition: Expr.h:2406
void setRParenLoc(SourceLocation L)
Definition: Expr.h:2443
static ConstantExpr * CreateEmpty(const ASTContext &Context, ResultStorageKind StorageKind, EmptyShell Empty)
Definition: Expr.cpp:307
void setRHS(Expr *E)
Definition: Expr.h:4180
void setOperatorLoc(SourceLocation L)
Definition: Expr.h:3467
void setBody(Stmt *Body)
Definition: Stmt.h:2381
void setValue(const ASTContext &C, const llvm::APFloat &Val)
Definition: Expr.h:1600
Represents Objective-C&#39;s @finally statement.
Definition: StmtObjC.h:127
void setCatchBody(Stmt *S)
Definition: StmtObjC.h:95
static CXXFunctionalCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
Definition: ExprCXX.cpp:910
bool hasAssociatedStmt() const
Returns true if directive has associated statement.
Definition: StmtOpenMP.h:250
void setLParenLoc(SourceLocation L)
Definition: Expr.h:3111
The template argument is actually a parameter pack.
Definition: TemplateBase.h:90
Represents a base class of a C++ class.
Definition: DeclCXX.h:145
void setRParenLoc(SourceLocation L)
Definition: ExprObjC.h:426
unsigned getNumClobbers() const
Definition: Stmt.h:2800
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:546
void setAtSynchronizedLoc(SourceLocation Loc)
Definition: StmtObjC.h:295
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof...
Definition: ExprCXX.h:4179
void setElseLoc(SourceLocation ElseLoc)
Definition: Stmt.h:2001
void setOperatorLoc(SourceLocation L)
Definition: Expr.h:2081
void setLocation(SourceLocation Location)
Definition: Expr.h:1474
A ConvertVectorExpr record.
Definition: ASTBitCodes.h:1620
unsigned arg_size() const
Retrieve the number of arguments.
Definition: ExprCXX.h:3447
void setStarLoc(SourceLocation L)
Definition: Stmt.h:2537
void setLParenLoc(SourceLocation L)
Definition: ExprCXX.h:3434
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:3390
GotoStmt - This represents a direct goto.
Definition: Stmt.h:2481
A use of a default initializer in a constructor or in aggregate initialization.
Definition: ExprCXX.h:1279
static ASTConstraintSatisfaction * Create(const ASTContext &C, const ConstraintSatisfaction &Satisfaction)
Definition: ASTConcept.cpp:52
static CStyleCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
Definition: Expr.cpp:2039
void setLocation(SourceLocation L)
Definition: ExprCXX.h:1113
ConceptDecl * NamedConcept
The concept named.
Definition: ASTConcept.h:119
void setCond(Expr *Cond)
Definition: Stmt.h:2377
CapturedDecl * getCapturedDecl()
Retrieve the outlined function declaration.
Definition: Stmt.cpp:1298
void setBuiltinLoc(SourceLocation L)
Definition: Expr.h:4274
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:2836
GNU array range designator.
Definition: ASTBitCodes.h:1890
void setTemplateArguments(ArrayRef< TemplateArgument > Converted)
Set new template arguments for this concept specialization.
void setBase(Expr *E)
Definition: Expr.h:5538
Defines the clang::SourceLocation class and associated facilities.
An ArrayInitIndexExpr record.
Definition: ASTBitCodes.h:1593
A GCC-style AsmStmt record.
Definition: ASTBitCodes.h:1503
This represents &#39;#pragma omp target parallel&#39; directive.
Definition: StmtOpenMP.h:2748
void setStrideVariable(Expr *ST)
Definition: StmtOpenMP.h:629
static MemberExpr * CreateEmpty(const ASTContext &Context, bool HasQualifier, bool HasFoundDecl, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition: Expr.cpp:1735
ContinueStmt - This represents a continue.
Definition: Stmt.h:2569
static CXXStaticCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
Definition: ExprCXX.cpp:793
Represents a loop initializing the elements of an array.
Definition: Expr.h:5027
static CXXTryStmt * Create(const ASTContext &C, SourceLocation tryLoc, Stmt *tryBlock, ArrayRef< Stmt *> handlers)
Definition: StmtCXX.cpp:25
A requires-expression requirement which is satisfied when a general constraint expression is satisfie...
Definition: ExprConcepts.h:402
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition: Expr.h:4130
static OMPParallelSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:594
CXXDefaultArgExprBitfields CXXDefaultArgExprBits
Definition: Stmt.h:1006
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Definition: Expr.h:3808
CXXCatchStmt - This represents a C++ catch block.
Definition: StmtCXX.h:28
An index into an array.
Definition: Expr.h:2168
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr.type.conv]).
Definition: ExprCXX.h:1688
An ObjCAtCatchStmt record.
Definition: ASTBitCodes.h:1677
static TypeTraitExpr * CreateDeserialized(const ASTContext &C, unsigned NumArgs)
Definition: ExprCXX.cpp:1728
Expr * ReadSubExpr()
Reads a sub-expression operand during statement reading.
WhileStmt - This represents a &#39;while&#39; stmt.
Definition: Stmt.h:2226
CXXOperatorCallExprBitfields CXXOperatorCallExprBits
Definition: Stmt.h:1000
Represents the specialization of a concept - evaluates to a prvalue of type bool. ...
Definition: ExprConcepts.h:40
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:878
void initializeFrom(SourceLocation TemplateKWLoc, const TemplateArgumentListInfo &List, TemplateArgumentLoc *OutArgArray)
Field designator where the field has been resolved to a declaration.
Definition: ASTBitCodes.h:1884
void setIsaMemberLoc(SourceLocation L)
Definition: ExprObjC.h:1526
unsigned getNumConcatenated() const
getNumConcatenated - Get the number of string literal tokens that were concatenated in translation ph...
Definition: Expr.h:1853
static CXXNewExpr * CreateEmpty(const ASTContext &Ctx, bool IsArray, bool HasInit, unsigned NumPlacementArgs, bool IsParenTypeId)
Create an empty c++ new expression.
Definition: ExprCXX.cpp:281
static ParenListExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumExprs)
Create an empty paren list.
Definition: Expr.cpp:4511
A CXXInheritedCtorInitExpr record.
Definition: ASTBitCodes.h:1724
void setExprOperand(Expr *E)
Definition: ExprCXX.h:826
void setPreArg(unsigned I, Stmt *PreArg)
Definition: Expr.h:2622
The receiver is a class.
Definition: ExprObjC.h:1098
Represents Objective-C&#39;s @try ... @catch ... @finally statement.
Definition: StmtObjC.h:165
void setElse(Stmt *Else)
Definition: Stmt.h:1940
This represents &#39;#pragma omp taskloop simd&#39; directive.
Definition: StmtOpenMP.h:3137
void setTokenLocation(SourceLocation L)
Definition: Expr.h:4225
static OMPSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:351
unsigned getNumCatchStmts() const
Retrieve the number of @catch statements in this try-catch-finally block.
Definition: StmtObjC.h:214
StringLiteral - This represents a string literal expression, e.g.
Definition: Expr.h:1711
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2546
void setOpLoc(SourceLocation L)
Definition: ExprObjC.h:598
void setLoopVarStmt(Stmt *S)
Definition: StmtCXX.h:198
void setTryBody(Stmt *S)
Definition: StmtObjC.h:210
An object for streaming information from a record.
Internal struct to describes an element that is a pack expansion, used if any of the elements in the ...
Definition: ExprObjC.h:292
void setPreCond(Expr *PC)
Definition: StmtOpenMP.h:597
RetTy Visit(PTR(Stmt) S, ParamTys... P)
Definition: StmtVisitor.h:43
void setRParenLoc(SourceLocation L)
Definition: Stmt.h:2461
SourceLocExprBitfields SourceLocExprBits
Definition: Stmt.h:997
void reserveInits(const ASTContext &C, unsigned NumInits)
Reserve space for some number of initializers.
Definition: Expr.cpp:2258
static OMPCancelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:730
bool hasTemplateKWAndArgsInfo() const
Definition: ExprCXX.h:2888
Abstract class common to all of the C++ "named"/"keyword" casts.
Definition: ExprCXX.h:353
This represents &#39;#pragma omp sections&#39; directive.
Definition: StmtOpenMP.h:1403
void setNextSwitchCase(SwitchCase *SC)
Definition: Stmt.h:1477
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition: ExprObjC.h:85
const ASTTemplateArgumentListInfo * ArgsAsWritten
The template argument list source info used to specialize the concept.
Definition: ASTConcept.h:123
unsigned getNumComponents() const
Definition: Expr.h:2326
This represents &#39;#pragma omp target data&#39; directive.
Definition: StmtOpenMP.h:2573
void setNextUpperBound(Expr *NUB)
Definition: StmtOpenMP.h:650
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument for this lambda expression...
Definition: ExprCXX.h:1975
A rewritten comparison expression that was originally written using operator syntax.
Definition: ExprCXX.h:273
capture_range captures()
Definition: Stmt.h:3511
void setKind(CharacterKind kind)
Definition: Expr.h:1567
A reference to a declared variable, function, enum, etc.
Definition: Expr.h:1171
static CaseStmt * CreateEmpty(const ASTContext &Ctx, bool CaseStmtIsGNURange)
Build an empty case statement.
Definition: Stmt.cpp:1120
Designator - A designator in a C99 designated initializer.
Definition: Designator.h:36
void setRawSemantics(llvm::APFloatBase::Semantics Sem)
Set the raw enumeration value representing the floating-point semantics of this literal (32-bit IEEE...
Definition: Expr.h:1614
void setLabel(LabelDecl *D)
Definition: Stmt.h:2495
BreakStmt - This represents a break.
Definition: Stmt.h:2599
void setSubStmt(Stmt *SS)
Definition: Stmt.h:1756
unsigned getNumLabels() const
Definition: Stmt.h:3027
static ObjCArrayLiteral * CreateEmpty(const ASTContext &C, unsigned NumElements)
Definition: ExprObjC.cpp:52
void setInc(Expr *Inc)
Definition: StmtOpenMP.h:604
CXXNoexceptExprBitfields CXXNoexceptExprBits
Definition: Stmt.h:1020
unsigned getNumArgs() const
Return the number of arguments to the constructor call.
Definition: ExprCXX.h:1570
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:986
A trivial tuple used to represent a source range.
void setInit(Stmt *S)
Definition: Stmt.h:2451
This represents &#39;#pragma omp taskyield&#39; directive.
Definition: StmtOpenMP.h:2055
This represents a decl that may have a name.
Definition: Decl.h:223
unsigned NumInputs
Definition: Stmt.h:2734
This represents &#39;#pragma omp distribute parallel for simd&#39; composite directive.
Definition: StmtOpenMP.h:3688
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition: ExprCXX.h:645
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type, member-designator).
Definition: Expr.h:2267
This represents &#39;#pragma omp parallel sections&#39; directive.
Definition: StmtOpenMP.h:1914
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
Definition: ExprCXX.h:1000
void setCalcLastIteration(Expr *CLI)
Definition: StmtOpenMP.h:594
static CallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, EmptyShell Empty)
Create an empty call expression, for deserialization.
Definition: Expr.cpp:1406
The receiver is a superclass.
Definition: ExprObjC.h:1104
void setCombinedNextUpperBound(Expr *CombNUB)
Definition: StmtOpenMP.h:714
This file provides AST data structures related to concepts.
SourceLocation getBegin() const
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument.
Definition: Stmt.h:3560
Represents Objective-C&#39;s @autoreleasepool Statement.
Definition: StmtObjC.h:368
void setWhileLoc(SourceLocation L)
Definition: Stmt.h:2386
StmtCode
Record codes for each kind of statement or expression.
Definition: ASTBitCodes.h:1437
void setLocEnd(SourceLocation Loc)
Set ending location of directive.
Definition: StmtOpenMP.h:238
void setArg(unsigned Arg, Expr *ArgExpr)
setArg - Set the specified argument.
Definition: ExprObjC.h:1405
void setFinals(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:138
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:1517
Represents an implicitly-generated value initialization of an object of a given type.
Definition: Expr.h:5117
void setKeywordLoc(SourceLocation L)
Definition: Stmt.h:1480
bool Sub(InterpState &S, CodePtr OpPC)
Definition: Interp.h:140
void setCapturedRegionKind(CapturedRegionKind Kind)
Set the captured region kind.
Definition: Stmt.cpp:1318
A GenericSelectionExpr record.
Definition: ASTBitCodes.h:1626
This represents &#39;#pragma omp target parallel for&#39; directive.
Definition: StmtOpenMP.h:2808
void setBody(Stmt *B)
Definition: Decl.cpp:4749
void setCond(Expr *Cond)
Definition: Stmt.h:1917
static OMPCancellationPointDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:708
void setLabelLoc(SourceLocation L)
Definition: Stmt.h:2500
void setCond(Expr *E)
Definition: Expr.h:4176
void setAtLoc(SourceLocation Loc)
Definition: StmtObjC.h:389
void setIsConditionTrue(bool isTrue)
Definition: Expr.h:4163
CXXDependentScopeMemberExprBitfields CXXDependentScopeMemberExprBits
Definition: Stmt.h:1016
static UnresolvedMemberExpr * CreateEmpty(const ASTContext &Context, unsigned NumResults, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition: ExprCXX.cpp:1557
This represents &#39;#pragma omp taskloop&#39; directive.
Definition: StmtOpenMP.h:3071