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