clang  10.0.0svn
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::VisitConceptSpecializationExpr(
739  VisitExpr(E);
740  unsigned NumTemplateArgs = Record.readInt();
741  E->NestedNameSpec = Record.readNestedNameSpecifierLoc();
742  E->TemplateKWLoc = Record.readSourceLocation();
743  E->ConceptNameLoc = Record.readSourceLocation();
744  E->FoundDecl = ReadDeclAs<NamedDecl>();
745  E->NamedConcept.setPointer(ReadDeclAs<ConceptDecl>());
746  const ASTTemplateArgumentListInfo *ArgsAsWritten =
749  for (unsigned I = 0; I < NumTemplateArgs; ++I)
750  Args.push_back(Record.readTemplateArgument());
751  E->setTemplateArguments(ArgsAsWritten, Args);
752  E->NamedConcept.setInt(Record.readInt() == 1);
753 }
754 
755 void ASTStmtReader::VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
756  VisitExpr(E);
757  E->setLHS(Record.readSubExpr());
758  E->setRHS(Record.readSubExpr());
759  E->setRBracketLoc(ReadSourceLocation());
760 }
761 
762 void ASTStmtReader::VisitOMPArraySectionExpr(OMPArraySectionExpr *E) {
763  VisitExpr(E);
764  E->setBase(Record.readSubExpr());
765  E->setLowerBound(Record.readSubExpr());
766  E->setLength(Record.readSubExpr());
767  E->setColonLoc(ReadSourceLocation());
768  E->setRBracketLoc(ReadSourceLocation());
769 }
770 
771 void ASTStmtReader::VisitCallExpr(CallExpr *E) {
772  VisitExpr(E);
773  unsigned NumArgs = Record.readInt();
774  assert((NumArgs == E->getNumArgs()) && "Wrong NumArgs!");
775  E->setRParenLoc(ReadSourceLocation());
776  E->setCallee(Record.readSubExpr());
777  for (unsigned I = 0; I != NumArgs; ++I)
778  E->setArg(I, Record.readSubExpr());
779  E->setADLCallKind(static_cast<CallExpr::ADLCallKind>(Record.readInt()));
780 }
781 
782 void ASTStmtReader::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) {
783  VisitCallExpr(E);
784 }
785 
786 void ASTStmtReader::VisitMemberExpr(MemberExpr *E) {
787  VisitExpr(E);
788 
789  bool HasQualifier = Record.readInt();
790  bool HasFoundDecl = Record.readInt();
791  bool HasTemplateInfo = Record.readInt();
792  unsigned NumTemplateArgs = Record.readInt();
793 
794  E->Base = Record.readSubExpr();
795  E->MemberDecl = Record.readDeclAs<ValueDecl>();
796  Record.readDeclarationNameLoc(E->MemberDNLoc, E->MemberDecl->getDeclName());
797  E->MemberLoc = Record.readSourceLocation();
798  E->MemberExprBits.IsArrow = Record.readInt();
799  E->MemberExprBits.HasQualifierOrFoundDecl = HasQualifier || HasFoundDecl;
800  E->MemberExprBits.HasTemplateKWAndArgsInfo = HasTemplateInfo;
801  E->MemberExprBits.HadMultipleCandidates = Record.readInt();
802  E->MemberExprBits.NonOdrUseReason = Record.readInt();
803  E->MemberExprBits.OperatorLoc = Record.readSourceLocation();
804 
805  if (HasQualifier || HasFoundDecl) {
806  DeclAccessPair FoundDecl;
807  if (HasFoundDecl) {
808  auto *FoundD = Record.readDeclAs<NamedDecl>();
809  auto AS = (AccessSpecifier)Record.readInt();
810  FoundDecl = DeclAccessPair::make(FoundD, AS);
811  } else {
812  FoundDecl = DeclAccessPair::make(E->MemberDecl,
813  E->MemberDecl->getAccess());
814  }
815  E->getTrailingObjects<MemberExprNameQualifier>()->FoundDecl = FoundDecl;
816 
817  NestedNameSpecifierLoc QualifierLoc;
818  if (HasQualifier)
819  QualifierLoc = Record.readNestedNameSpecifierLoc();
820  E->getTrailingObjects<MemberExprNameQualifier>()->QualifierLoc =
821  QualifierLoc;
822  }
823 
824  if (HasTemplateInfo)
825  ReadTemplateKWAndArgsInfo(
826  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
827  E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs);
828 }
829 
830 void ASTStmtReader::VisitObjCIsaExpr(ObjCIsaExpr *E) {
831  VisitExpr(E);
832  E->setBase(Record.readSubExpr());
833  E->setIsaMemberLoc(ReadSourceLocation());
834  E->setOpLoc(ReadSourceLocation());
835  E->setArrow(Record.readInt());
836 }
837 
838 void ASTStmtReader::
839 VisitObjCIndirectCopyRestoreExpr(ObjCIndirectCopyRestoreExpr *E) {
840  VisitExpr(E);
841  E->Operand = Record.readSubExpr();
842  E->setShouldCopy(Record.readInt());
843 }
844 
845 void ASTStmtReader::VisitObjCBridgedCastExpr(ObjCBridgedCastExpr *E) {
846  VisitExplicitCastExpr(E);
847  E->LParenLoc = ReadSourceLocation();
848  E->BridgeKeywordLoc = ReadSourceLocation();
849  E->Kind = Record.readInt();
850 }
851 
852 void ASTStmtReader::VisitCastExpr(CastExpr *E) {
853  VisitExpr(E);
854  unsigned NumBaseSpecs = Record.readInt();
855  assert(NumBaseSpecs == E->path_size());
856  E->setSubExpr(Record.readSubExpr());
857  E->setCastKind((CastKind)Record.readInt());
858  CastExpr::path_iterator BaseI = E->path_begin();
859  while (NumBaseSpecs--) {
860  auto *BaseSpec = new (Record.getContext()) CXXBaseSpecifier;
861  *BaseSpec = Record.readCXXBaseSpecifier();
862  *BaseI++ = BaseSpec;
863  }
864 }
865 
866 void ASTStmtReader::VisitBinaryOperator(BinaryOperator *E) {
867  VisitExpr(E);
868  E->setLHS(Record.readSubExpr());
869  E->setRHS(Record.readSubExpr());
871  E->setOperatorLoc(ReadSourceLocation());
872  E->setFPFeatures(FPOptions(Record.readInt()));
873 }
874 
875 void ASTStmtReader::VisitCompoundAssignOperator(CompoundAssignOperator *E) {
876  VisitBinaryOperator(E);
877  E->setComputationLHSType(Record.readType());
878  E->setComputationResultType(Record.readType());
879 }
880 
881 void ASTStmtReader::VisitConditionalOperator(ConditionalOperator *E) {
882  VisitExpr(E);
883  E->SubExprs[ConditionalOperator::COND] = Record.readSubExpr();
884  E->SubExprs[ConditionalOperator::LHS] = Record.readSubExpr();
885  E->SubExprs[ConditionalOperator::RHS] = Record.readSubExpr();
886  E->QuestionLoc = ReadSourceLocation();
887  E->ColonLoc = ReadSourceLocation();
888 }
889 
890 void
891 ASTStmtReader::VisitBinaryConditionalOperator(BinaryConditionalOperator *E) {
892  VisitExpr(E);
893  E->OpaqueValue = cast<OpaqueValueExpr>(Record.readSubExpr());
894  E->SubExprs[BinaryConditionalOperator::COMMON] = Record.readSubExpr();
895  E->SubExprs[BinaryConditionalOperator::COND] = Record.readSubExpr();
896  E->SubExprs[BinaryConditionalOperator::LHS] = Record.readSubExpr();
897  E->SubExprs[BinaryConditionalOperator::RHS] = Record.readSubExpr();
898  E->QuestionLoc = ReadSourceLocation();
899  E->ColonLoc = ReadSourceLocation();
900 }
901 
902 void ASTStmtReader::VisitImplicitCastExpr(ImplicitCastExpr *E) {
903  VisitCastExpr(E);
904  E->setIsPartOfExplicitCast(Record.readInt());
905 }
906 
907 void ASTStmtReader::VisitExplicitCastExpr(ExplicitCastExpr *E) {
908  VisitCastExpr(E);
909  E->setTypeInfoAsWritten(GetTypeSourceInfo());
910 }
911 
912 void ASTStmtReader::VisitCStyleCastExpr(CStyleCastExpr *E) {
913  VisitExplicitCastExpr(E);
914  E->setLParenLoc(ReadSourceLocation());
915  E->setRParenLoc(ReadSourceLocation());
916 }
917 
918 void ASTStmtReader::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
919  VisitExpr(E);
920  E->setLParenLoc(ReadSourceLocation());
921  E->setTypeSourceInfo(GetTypeSourceInfo());
922  E->setInitializer(Record.readSubExpr());
923  E->setFileScope(Record.readInt());
924 }
925 
926 void ASTStmtReader::VisitExtVectorElementExpr(ExtVectorElementExpr *E) {
927  VisitExpr(E);
928  E->setBase(Record.readSubExpr());
929  E->setAccessor(Record.getIdentifierInfo());
930  E->setAccessorLoc(ReadSourceLocation());
931 }
932 
933 void ASTStmtReader::VisitInitListExpr(InitListExpr *E) {
934  VisitExpr(E);
935  if (auto *SyntForm = cast_or_null<InitListExpr>(Record.readSubStmt()))
936  E->setSyntacticForm(SyntForm);
937  E->setLBraceLoc(ReadSourceLocation());
938  E->setRBraceLoc(ReadSourceLocation());
939  bool isArrayFiller = Record.readInt();
940  Expr *filler = nullptr;
941  if (isArrayFiller) {
942  filler = Record.readSubExpr();
943  E->ArrayFillerOrUnionFieldInit = filler;
944  } else
945  E->ArrayFillerOrUnionFieldInit = ReadDeclAs<FieldDecl>();
946  E->sawArrayRangeDesignator(Record.readInt());
947  unsigned NumInits = Record.readInt();
948  E->reserveInits(Record.getContext(), NumInits);
949  if (isArrayFiller) {
950  for (unsigned I = 0; I != NumInits; ++I) {
951  Expr *init = Record.readSubExpr();
952  E->updateInit(Record.getContext(), I, init ? init : filler);
953  }
954  } else {
955  for (unsigned I = 0; I != NumInits; ++I)
956  E->updateInit(Record.getContext(), I, Record.readSubExpr());
957  }
958 }
959 
960 void ASTStmtReader::VisitDesignatedInitExpr(DesignatedInitExpr *E) {
962 
963  VisitExpr(E);
964  unsigned NumSubExprs = Record.readInt();
965  assert(NumSubExprs == E->getNumSubExprs() && "Wrong number of subexprs");
966  for (unsigned I = 0; I != NumSubExprs; ++I)
967  E->setSubExpr(I, Record.readSubExpr());
968  E->setEqualOrColonLoc(ReadSourceLocation());
969  E->setGNUSyntax(Record.readInt());
970 
971  SmallVector<Designator, 4> Designators;
972  while (Record.getIdx() < Record.size()) {
973  switch ((DesignatorTypes)Record.readInt()) {
974  case DESIG_FIELD_DECL: {
975  auto *Field = ReadDeclAs<FieldDecl>();
976  SourceLocation DotLoc = ReadSourceLocation();
977  SourceLocation FieldLoc = ReadSourceLocation();
978  Designators.push_back(Designator(Field->getIdentifier(), DotLoc,
979  FieldLoc));
980  Designators.back().setField(Field);
981  break;
982  }
983 
984  case DESIG_FIELD_NAME: {
985  const IdentifierInfo *Name = Record.getIdentifierInfo();
986  SourceLocation DotLoc = ReadSourceLocation();
987  SourceLocation FieldLoc = ReadSourceLocation();
988  Designators.push_back(Designator(Name, DotLoc, FieldLoc));
989  break;
990  }
991 
992  case DESIG_ARRAY: {
993  unsigned Index = Record.readInt();
994  SourceLocation LBracketLoc = ReadSourceLocation();
995  SourceLocation RBracketLoc = ReadSourceLocation();
996  Designators.push_back(Designator(Index, LBracketLoc, RBracketLoc));
997  break;
998  }
999 
1000  case DESIG_ARRAY_RANGE: {
1001  unsigned Index = Record.readInt();
1002  SourceLocation LBracketLoc = ReadSourceLocation();
1003  SourceLocation EllipsisLoc = ReadSourceLocation();
1004  SourceLocation RBracketLoc = ReadSourceLocation();
1005  Designators.push_back(Designator(Index, LBracketLoc, EllipsisLoc,
1006  RBracketLoc));
1007  break;
1008  }
1009  }
1010  }
1011  E->setDesignators(Record.getContext(),
1012  Designators.data(), Designators.size());
1013 }
1014 
1015 void ASTStmtReader::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) {
1016  VisitExpr(E);
1017  E->setBase(Record.readSubExpr());
1018  E->setUpdater(Record.readSubExpr());
1019 }
1020 
1021 void ASTStmtReader::VisitNoInitExpr(NoInitExpr *E) {
1022  VisitExpr(E);
1023 }
1024 
1025 void ASTStmtReader::VisitArrayInitLoopExpr(ArrayInitLoopExpr *E) {
1026  VisitExpr(E);
1027  E->SubExprs[0] = Record.readSubExpr();
1028  E->SubExprs[1] = Record.readSubExpr();
1029 }
1030 
1031 void ASTStmtReader::VisitArrayInitIndexExpr(ArrayInitIndexExpr *E) {
1032  VisitExpr(E);
1033 }
1034 
1035 void ASTStmtReader::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) {
1036  VisitExpr(E);
1037 }
1038 
1039 void ASTStmtReader::VisitVAArgExpr(VAArgExpr *E) {
1040  VisitExpr(E);
1041  E->setSubExpr(Record.readSubExpr());
1042  E->setWrittenTypeInfo(GetTypeSourceInfo());
1043  E->setBuiltinLoc(ReadSourceLocation());
1044  E->setRParenLoc(ReadSourceLocation());
1045  E->setIsMicrosoftABI(Record.readInt());
1046 }
1047 
1048 void ASTStmtReader::VisitSourceLocExpr(SourceLocExpr *E) {
1049  VisitExpr(E);
1050  E->ParentContext = ReadDeclAs<DeclContext>();
1051  E->BuiltinLoc = ReadSourceLocation();
1052  E->RParenLoc = ReadSourceLocation();
1053  E->SourceLocExprBits.Kind =
1054  static_cast<SourceLocExpr::IdentKind>(Record.readInt());
1055 }
1056 
1057 void ASTStmtReader::VisitAddrLabelExpr(AddrLabelExpr *E) {
1058  VisitExpr(E);
1059  E->setAmpAmpLoc(ReadSourceLocation());
1060  E->setLabelLoc(ReadSourceLocation());
1061  E->setLabel(ReadDeclAs<LabelDecl>());
1062 }
1063 
1064 void ASTStmtReader::VisitStmtExpr(StmtExpr *E) {
1065  VisitExpr(E);
1066  E->setLParenLoc(ReadSourceLocation());
1067  E->setRParenLoc(ReadSourceLocation());
1068  E->setSubStmt(cast_or_null<CompoundStmt>(Record.readSubStmt()));
1069 }
1070 
1071 void ASTStmtReader::VisitChooseExpr(ChooseExpr *E) {
1072  VisitExpr(E);
1073  E->setCond(Record.readSubExpr());
1074  E->setLHS(Record.readSubExpr());
1075  E->setRHS(Record.readSubExpr());
1076  E->setBuiltinLoc(ReadSourceLocation());
1077  E->setRParenLoc(ReadSourceLocation());
1078  E->setIsConditionTrue(Record.readInt());
1079 }
1080 
1081 void ASTStmtReader::VisitGNUNullExpr(GNUNullExpr *E) {
1082  VisitExpr(E);
1083  E->setTokenLocation(ReadSourceLocation());
1084 }
1085 
1086 void ASTStmtReader::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
1087  VisitExpr(E);
1089  unsigned NumExprs = Record.readInt();
1090  while (NumExprs--)
1091  Exprs.push_back(Record.readSubExpr());
1092  E->setExprs(Record.getContext(), Exprs);
1093  E->setBuiltinLoc(ReadSourceLocation());
1094  E->setRParenLoc(ReadSourceLocation());
1095 }
1096 
1097 void ASTStmtReader::VisitConvertVectorExpr(ConvertVectorExpr *E) {
1098  VisitExpr(E);
1099  E->BuiltinLoc = ReadSourceLocation();
1100  E->RParenLoc = ReadSourceLocation();
1101  E->TInfo = GetTypeSourceInfo();
1102  E->SrcExpr = Record.readSubExpr();
1103 }
1104 
1105 void ASTStmtReader::VisitBlockExpr(BlockExpr *E) {
1106  VisitExpr(E);
1107  E->setBlockDecl(ReadDeclAs<BlockDecl>());
1108 }
1109 
1110 void ASTStmtReader::VisitGenericSelectionExpr(GenericSelectionExpr *E) {
1111  VisitExpr(E);
1112 
1113  unsigned NumAssocs = Record.readInt();
1114  assert(NumAssocs == E->getNumAssocs() && "Wrong NumAssocs!");
1115  E->ResultIndex = Record.readInt();
1116  E->GenericSelectionExprBits.GenericLoc = ReadSourceLocation();
1117  E->DefaultLoc = ReadSourceLocation();
1118  E->RParenLoc = ReadSourceLocation();
1119 
1120  Stmt **Stmts = E->getTrailingObjects<Stmt *>();
1121  // Add 1 to account for the controlling expression which is the first
1122  // expression in the trailing array of Stmt *. This is not needed for
1123  // the trailing array of TypeSourceInfo *.
1124  for (unsigned I = 0, N = NumAssocs + 1; I < N; ++I)
1125  Stmts[I] = Record.readSubExpr();
1126 
1127  TypeSourceInfo **TSIs = E->getTrailingObjects<TypeSourceInfo *>();
1128  for (unsigned I = 0, N = NumAssocs; I < N; ++I)
1129  TSIs[I] = GetTypeSourceInfo();
1130 }
1131 
1132 void ASTStmtReader::VisitPseudoObjectExpr(PseudoObjectExpr *E) {
1133  VisitExpr(E);
1134  unsigned numSemanticExprs = Record.readInt();
1135  assert(numSemanticExprs + 1 == E->PseudoObjectExprBits.NumSubExprs);
1136  E->PseudoObjectExprBits.ResultIndex = Record.readInt();
1137 
1138  // Read the syntactic expression.
1139  E->getSubExprsBuffer()[0] = Record.readSubExpr();
1140 
1141  // Read all the semantic expressions.
1142  for (unsigned i = 0; i != numSemanticExprs; ++i) {
1143  Expr *subExpr = Record.readSubExpr();
1144  E->getSubExprsBuffer()[i+1] = subExpr;
1145  }
1146 }
1147 
1148 void ASTStmtReader::VisitAtomicExpr(AtomicExpr *E) {
1149  VisitExpr(E);
1150  E->Op = AtomicExpr::AtomicOp(Record.readInt());
1151  E->NumSubExprs = AtomicExpr::getNumSubExprs(E->Op);
1152  for (unsigned I = 0; I != E->NumSubExprs; ++I)
1153  E->SubExprs[I] = Record.readSubExpr();
1154  E->BuiltinLoc = ReadSourceLocation();
1155  E->RParenLoc = ReadSourceLocation();
1156 }
1157 
1158 //===----------------------------------------------------------------------===//
1159 // Objective-C Expressions and Statements
1160 
1161 void ASTStmtReader::VisitObjCStringLiteral(ObjCStringLiteral *E) {
1162  VisitExpr(E);
1163  E->setString(cast<StringLiteral>(Record.readSubStmt()));
1164  E->setAtLoc(ReadSourceLocation());
1165 }
1166 
1167 void ASTStmtReader::VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
1168  VisitExpr(E);
1169  // could be one of several IntegerLiteral, FloatLiteral, etc.
1170  E->SubExpr = Record.readSubStmt();
1171  E->BoxingMethod = ReadDeclAs<ObjCMethodDecl>();
1172  E->Range = ReadSourceRange();
1173 }
1174 
1175 void ASTStmtReader::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
1176  VisitExpr(E);
1177  unsigned NumElements = Record.readInt();
1178  assert(NumElements == E->getNumElements() && "Wrong number of elements");
1179  Expr **Elements = E->getElements();
1180  for (unsigned I = 0, N = NumElements; I != N; ++I)
1181  Elements[I] = Record.readSubExpr();
1182  E->ArrayWithObjectsMethod = ReadDeclAs<ObjCMethodDecl>();
1183  E->Range = ReadSourceRange();
1184 }
1185 
1186 void ASTStmtReader::VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *E) {
1187  VisitExpr(E);
1188  unsigned NumElements = Record.readInt();
1189  assert(NumElements == E->getNumElements() && "Wrong number of elements");
1190  bool HasPackExpansions = Record.readInt();
1191  assert(HasPackExpansions == E->HasPackExpansions &&"Pack expansion mismatch");
1192  auto *KeyValues =
1193  E->getTrailingObjects<ObjCDictionaryLiteral::KeyValuePair>();
1194  auto *Expansions =
1195  E->getTrailingObjects<ObjCDictionaryLiteral::ExpansionData>();
1196  for (unsigned I = 0; I != NumElements; ++I) {
1197  KeyValues[I].Key = Record.readSubExpr();
1198  KeyValues[I].Value = Record.readSubExpr();
1199  if (HasPackExpansions) {
1200  Expansions[I].EllipsisLoc = ReadSourceLocation();
1201  Expansions[I].NumExpansionsPlusOne = Record.readInt();
1202  }
1203  }
1204  E->DictWithObjectsMethod = ReadDeclAs<ObjCMethodDecl>();
1205  E->Range = ReadSourceRange();
1206 }
1207 
1208 void ASTStmtReader::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
1209  VisitExpr(E);
1210  E->setEncodedTypeSourceInfo(GetTypeSourceInfo());
1211  E->setAtLoc(ReadSourceLocation());
1212  E->setRParenLoc(ReadSourceLocation());
1213 }
1214 
1215 void ASTStmtReader::VisitObjCSelectorExpr(ObjCSelectorExpr *E) {
1216  VisitExpr(E);
1217  E->setSelector(Record.readSelector());
1218  E->setAtLoc(ReadSourceLocation());
1219  E->setRParenLoc(ReadSourceLocation());
1220 }
1221 
1222 void ASTStmtReader::VisitObjCProtocolExpr(ObjCProtocolExpr *E) {
1223  VisitExpr(E);
1224  E->setProtocol(ReadDeclAs<ObjCProtocolDecl>());
1225  E->setAtLoc(ReadSourceLocation());
1226  E->ProtoLoc = ReadSourceLocation();
1227  E->setRParenLoc(ReadSourceLocation());
1228 }
1229 
1230 void ASTStmtReader::VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) {
1231  VisitExpr(E);
1232  E->setDecl(ReadDeclAs<ObjCIvarDecl>());
1233  E->setLocation(ReadSourceLocation());
1234  E->setOpLoc(ReadSourceLocation());
1235  E->setBase(Record.readSubExpr());
1236  E->setIsArrow(Record.readInt());
1237  E->setIsFreeIvar(Record.readInt());
1238 }
1239 
1240 void ASTStmtReader::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
1241  VisitExpr(E);
1242  unsigned MethodRefFlags = Record.readInt();
1243  bool Implicit = Record.readInt() != 0;
1244  if (Implicit) {
1245  auto *Getter = ReadDeclAs<ObjCMethodDecl>();
1246  auto *Setter = ReadDeclAs<ObjCMethodDecl>();
1247  E->setImplicitProperty(Getter, Setter, MethodRefFlags);
1248  } else {
1249  E->setExplicitProperty(ReadDeclAs<ObjCPropertyDecl>(), MethodRefFlags);
1250  }
1251  E->setLocation(ReadSourceLocation());
1252  E->setReceiverLocation(ReadSourceLocation());
1253  switch (Record.readInt()) {
1254  case 0:
1255  E->setBase(Record.readSubExpr());
1256  break;
1257  case 1:
1258  E->setSuperReceiver(Record.readType());
1259  break;
1260  case 2:
1261  E->setClassReceiver(ReadDeclAs<ObjCInterfaceDecl>());
1262  break;
1263  }
1264 }
1265 
1266 void ASTStmtReader::VisitObjCSubscriptRefExpr(ObjCSubscriptRefExpr *E) {
1267  VisitExpr(E);
1268  E->setRBracket(ReadSourceLocation());
1269  E->setBaseExpr(Record.readSubExpr());
1270  E->setKeyExpr(Record.readSubExpr());
1271  E->GetAtIndexMethodDecl = ReadDeclAs<ObjCMethodDecl>();
1272  E->SetAtIndexMethodDecl = ReadDeclAs<ObjCMethodDecl>();
1273 }
1274 
1275 void ASTStmtReader::VisitObjCMessageExpr(ObjCMessageExpr *E) {
1276  VisitExpr(E);
1277  assert(Record.peekInt() == E->getNumArgs());
1278  Record.skipInts(1);
1279  unsigned NumStoredSelLocs = Record.readInt();
1280  E->SelLocsKind = Record.readInt();
1281  E->setDelegateInitCall(Record.readInt());
1282  E->IsImplicit = Record.readInt();
1283  auto Kind = static_cast<ObjCMessageExpr::ReceiverKind>(Record.readInt());
1284  switch (Kind) {
1286  E->setInstanceReceiver(Record.readSubExpr());
1287  break;
1288 
1290  E->setClassReceiver(GetTypeSourceInfo());
1291  break;
1292 
1295  QualType T = Record.readType();
1296  SourceLocation SuperLoc = ReadSourceLocation();
1297  E->setSuper(SuperLoc, T, Kind == ObjCMessageExpr::SuperInstance);
1298  break;
1299  }
1300  }
1301 
1302  assert(Kind == E->getReceiverKind());
1303 
1304  if (Record.readInt())
1305  E->setMethodDecl(ReadDeclAs<ObjCMethodDecl>());
1306  else
1307  E->setSelector(Record.readSelector());
1308 
1309  E->LBracLoc = ReadSourceLocation();
1310  E->RBracLoc = ReadSourceLocation();
1311 
1312  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1313  E->setArg(I, Record.readSubExpr());
1314 
1315  SourceLocation *Locs = E->getStoredSelLocs();
1316  for (unsigned I = 0; I != NumStoredSelLocs; ++I)
1317  Locs[I] = ReadSourceLocation();
1318 }
1319 
1320 void ASTStmtReader::VisitObjCForCollectionStmt(ObjCForCollectionStmt *S) {
1321  VisitStmt(S);
1322  S->setElement(Record.readSubStmt());
1323  S->setCollection(Record.readSubExpr());
1324  S->setBody(Record.readSubStmt());
1325  S->setForLoc(ReadSourceLocation());
1326  S->setRParenLoc(ReadSourceLocation());
1327 }
1328 
1329 void ASTStmtReader::VisitObjCAtCatchStmt(ObjCAtCatchStmt *S) {
1330  VisitStmt(S);
1331  S->setCatchBody(Record.readSubStmt());
1332  S->setCatchParamDecl(ReadDeclAs<VarDecl>());
1333  S->setAtCatchLoc(ReadSourceLocation());
1334  S->setRParenLoc(ReadSourceLocation());
1335 }
1336 
1337 void ASTStmtReader::VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S) {
1338  VisitStmt(S);
1339  S->setFinallyBody(Record.readSubStmt());
1340  S->setAtFinallyLoc(ReadSourceLocation());
1341 }
1342 
1343 void ASTStmtReader::VisitObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S) {
1344  VisitStmt(S); // FIXME: no test coverage.
1345  S->setSubStmt(Record.readSubStmt());
1346  S->setAtLoc(ReadSourceLocation());
1347 }
1348 
1349 void ASTStmtReader::VisitObjCAtTryStmt(ObjCAtTryStmt *S) {
1350  VisitStmt(S);
1351  assert(Record.peekInt() == S->getNumCatchStmts());
1352  Record.skipInts(1);
1353  bool HasFinally = Record.readInt();
1354  S->setTryBody(Record.readSubStmt());
1355  for (unsigned I = 0, N = S->getNumCatchStmts(); I != N; ++I)
1356  S->setCatchStmt(I, cast_or_null<ObjCAtCatchStmt>(Record.readSubStmt()));
1357 
1358  if (HasFinally)
1359  S->setFinallyStmt(Record.readSubStmt());
1360  S->setAtTryLoc(ReadSourceLocation());
1361 }
1362 
1363 void ASTStmtReader::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
1364  VisitStmt(S); // FIXME: no test coverage.
1365  S->setSynchExpr(Record.readSubStmt());
1366  S->setSynchBody(Record.readSubStmt());
1367  S->setAtSynchronizedLoc(ReadSourceLocation());
1368 }
1369 
1370 void ASTStmtReader::VisitObjCAtThrowStmt(ObjCAtThrowStmt *S) {
1371  VisitStmt(S); // FIXME: no test coverage.
1372  S->setThrowExpr(Record.readSubStmt());
1373  S->setThrowLoc(ReadSourceLocation());
1374 }
1375 
1376 void ASTStmtReader::VisitObjCBoolLiteralExpr(ObjCBoolLiteralExpr *E) {
1377  VisitExpr(E);
1378  E->setValue(Record.readInt());
1379  E->setLocation(ReadSourceLocation());
1380 }
1381 
1382 void ASTStmtReader::VisitObjCAvailabilityCheckExpr(ObjCAvailabilityCheckExpr *E) {
1383  VisitExpr(E);
1384  SourceRange R = Record.readSourceRange();
1385  E->AtLoc = R.getBegin();
1386  E->RParen = R.getEnd();
1387  E->VersionToCheck = Record.readVersionTuple();
1388 }
1389 
1390 //===----------------------------------------------------------------------===//
1391 // C++ Expressions and Statements
1392 //===----------------------------------------------------------------------===//
1393 
1394 void ASTStmtReader::VisitCXXCatchStmt(CXXCatchStmt *S) {
1395  VisitStmt(S);
1396  S->CatchLoc = ReadSourceLocation();
1397  S->ExceptionDecl = ReadDeclAs<VarDecl>();
1398  S->HandlerBlock = Record.readSubStmt();
1399 }
1400 
1401 void ASTStmtReader::VisitCXXTryStmt(CXXTryStmt *S) {
1402  VisitStmt(S);
1403  assert(Record.peekInt() == S->getNumHandlers() && "NumStmtFields is wrong ?");
1404  Record.skipInts(1);
1405  S->TryLoc = ReadSourceLocation();
1406  S->getStmts()[0] = Record.readSubStmt();
1407  for (unsigned i = 0, e = S->getNumHandlers(); i != e; ++i)
1408  S->getStmts()[i + 1] = Record.readSubStmt();
1409 }
1410 
1411 void ASTStmtReader::VisitCXXForRangeStmt(CXXForRangeStmt *S) {
1412  VisitStmt(S);
1413  S->ForLoc = ReadSourceLocation();
1414  S->CoawaitLoc = ReadSourceLocation();
1415  S->ColonLoc = ReadSourceLocation();
1416  S->RParenLoc = ReadSourceLocation();
1417  S->setInit(Record.readSubStmt());
1418  S->setRangeStmt(Record.readSubStmt());
1419  S->setBeginStmt(Record.readSubStmt());
1420  S->setEndStmt(Record.readSubStmt());
1421  S->setCond(Record.readSubExpr());
1422  S->setInc(Record.readSubExpr());
1423  S->setLoopVarStmt(Record.readSubStmt());
1424  S->setBody(Record.readSubStmt());
1425 }
1426 
1427 void ASTStmtReader::VisitMSDependentExistsStmt(MSDependentExistsStmt *S) {
1428  VisitStmt(S);
1429  S->KeywordLoc = ReadSourceLocation();
1430  S->IsIfExists = Record.readInt();
1431  S->QualifierLoc = Record.readNestedNameSpecifierLoc();
1432  ReadDeclarationNameInfo(S->NameInfo);
1433  S->SubStmt = Record.readSubStmt();
1434 }
1435 
1436 void ASTStmtReader::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
1437  VisitCallExpr(E);
1438  E->CXXOperatorCallExprBits.OperatorKind = Record.readInt();
1439  E->CXXOperatorCallExprBits.FPFeatures = Record.readInt();
1440  E->Range = Record.readSourceRange();
1441 }
1442 
1443 void ASTStmtReader::VisitCXXRewrittenBinaryOperator(
1445  VisitExpr(E);
1446  E->CXXRewrittenBinaryOperatorBits.IsReversed = Record.readInt();
1447  E->SemanticForm = Record.readSubExpr();
1448 }
1449 
1450 void ASTStmtReader::VisitCXXConstructExpr(CXXConstructExpr *E) {
1451  VisitExpr(E);
1452 
1453  unsigned NumArgs = Record.readInt();
1454  assert((NumArgs == E->getNumArgs()) && "Wrong NumArgs!");
1455 
1456  E->CXXConstructExprBits.Elidable = Record.readInt();
1457  E->CXXConstructExprBits.HadMultipleCandidates = Record.readInt();
1458  E->CXXConstructExprBits.ListInitialization = Record.readInt();
1459  E->CXXConstructExprBits.StdInitListInitialization = Record.readInt();
1460  E->CXXConstructExprBits.ZeroInitialization = Record.readInt();
1461  E->CXXConstructExprBits.ConstructionKind = Record.readInt();
1462  E->CXXConstructExprBits.Loc = ReadSourceLocation();
1463  E->Constructor = ReadDeclAs<CXXConstructorDecl>();
1464  E->ParenOrBraceRange = ReadSourceRange();
1465 
1466  for (unsigned I = 0; I != NumArgs; ++I)
1467  E->setArg(I, Record.readSubExpr());
1468 }
1469 
1470 void ASTStmtReader::VisitCXXInheritedCtorInitExpr(CXXInheritedCtorInitExpr *E) {
1471  VisitExpr(E);
1472  E->Constructor = ReadDeclAs<CXXConstructorDecl>();
1473  E->Loc = ReadSourceLocation();
1474  E->ConstructsVirtualBase = Record.readInt();
1475  E->InheritedFromVirtualBase = Record.readInt();
1476 }
1477 
1478 void ASTStmtReader::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
1479  VisitCXXConstructExpr(E);
1480  E->TSI = GetTypeSourceInfo();
1481 }
1482 
1483 void ASTStmtReader::VisitLambdaExpr(LambdaExpr *E) {
1484  VisitExpr(E);
1485  unsigned NumCaptures = Record.readInt();
1486  assert(NumCaptures == E->NumCaptures);(void)NumCaptures;
1487  E->IntroducerRange = ReadSourceRange();
1488  E->CaptureDefault = static_cast<LambdaCaptureDefault>(Record.readInt());
1489  E->CaptureDefaultLoc = ReadSourceLocation();
1490  E->ExplicitParams = Record.readInt();
1491  E->ExplicitResultType = Record.readInt();
1492  E->ClosingBrace = ReadSourceLocation();
1493 
1494  // Read capture initializers.
1496  CEnd = E->capture_init_end();
1497  C != CEnd; ++C)
1498  *C = Record.readSubExpr();
1499 }
1500 
1501 void
1502 ASTStmtReader::VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E) {
1503  VisitExpr(E);
1504  E->SubExpr = Record.readSubExpr();
1505 }
1506 
1507 void ASTStmtReader::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) {
1508  VisitExplicitCastExpr(E);
1509  SourceRange R = ReadSourceRange();
1510  E->Loc = R.getBegin();
1511  E->RParenLoc = R.getEnd();
1512  R = ReadSourceRange();
1513  E->AngleBrackets = R;
1514 }
1515 
1516 void ASTStmtReader::VisitCXXStaticCastExpr(CXXStaticCastExpr *E) {
1517  return VisitCXXNamedCastExpr(E);
1518 }
1519 
1520 void ASTStmtReader::VisitCXXDynamicCastExpr(CXXDynamicCastExpr *E) {
1521  return VisitCXXNamedCastExpr(E);
1522 }
1523 
1524 void ASTStmtReader::VisitCXXReinterpretCastExpr(CXXReinterpretCastExpr *E) {
1525  return VisitCXXNamedCastExpr(E);
1526 }
1527 
1528 void ASTStmtReader::VisitCXXConstCastExpr(CXXConstCastExpr *E) {
1529  return VisitCXXNamedCastExpr(E);
1530 }
1531 
1532 void ASTStmtReader::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E) {
1533  VisitExplicitCastExpr(E);
1534  E->setLParenLoc(ReadSourceLocation());
1535  E->setRParenLoc(ReadSourceLocation());
1536 }
1537 
1538 void ASTStmtReader::VisitBuiltinBitCastExpr(BuiltinBitCastExpr *E) {
1539  VisitExplicitCastExpr(E);
1540  E->KWLoc = ReadSourceLocation();
1541  E->RParenLoc = ReadSourceLocation();
1542 }
1543 
1544 void ASTStmtReader::VisitUserDefinedLiteral(UserDefinedLiteral *E) {
1545  VisitCallExpr(E);
1546  E->UDSuffixLoc = ReadSourceLocation();
1547 }
1548 
1549 void ASTStmtReader::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) {
1550  VisitExpr(E);
1551  E->setValue(Record.readInt());
1552  E->setLocation(ReadSourceLocation());
1553 }
1554 
1555 void ASTStmtReader::VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E) {
1556  VisitExpr(E);
1557  E->setLocation(ReadSourceLocation());
1558 }
1559 
1560 void ASTStmtReader::VisitCXXTypeidExpr(CXXTypeidExpr *E) {
1561  VisitExpr(E);
1562  E->setSourceRange(ReadSourceRange());
1563  if (E->isTypeOperand()) { // typeid(int)
1565  GetTypeSourceInfo());
1566  return;
1567  }
1568 
1569  // typeid(42+2)
1570  E->setExprOperand(Record.readSubExpr());
1571 }
1572 
1573 void ASTStmtReader::VisitCXXThisExpr(CXXThisExpr *E) {
1574  VisitExpr(E);
1575  E->setLocation(ReadSourceLocation());
1576  E->setImplicit(Record.readInt());
1577 }
1578 
1579 void ASTStmtReader::VisitCXXThrowExpr(CXXThrowExpr *E) {
1580  VisitExpr(E);
1581  E->CXXThrowExprBits.ThrowLoc = ReadSourceLocation();
1582  E->Operand = Record.readSubExpr();
1583  E->CXXThrowExprBits.IsThrownVariableInScope = Record.readInt();
1584 }
1585 
1586 void ASTStmtReader::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
1587  VisitExpr(E);
1588  E->Param = ReadDeclAs<ParmVarDecl>();
1589  E->UsedContext = ReadDeclAs<DeclContext>();
1590  E->CXXDefaultArgExprBits.Loc = ReadSourceLocation();
1591 }
1592 
1593 void ASTStmtReader::VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E) {
1594  VisitExpr(E);
1595  E->Field = ReadDeclAs<FieldDecl>();
1596  E->UsedContext = ReadDeclAs<DeclContext>();
1597  E->CXXDefaultInitExprBits.Loc = ReadSourceLocation();
1598 }
1599 
1600 void ASTStmtReader::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
1601  VisitExpr(E);
1602  E->setTemporary(Record.readCXXTemporary());
1603  E->setSubExpr(Record.readSubExpr());
1604 }
1605 
1606 void ASTStmtReader::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
1607  VisitExpr(E);
1608  E->TypeInfo = GetTypeSourceInfo();
1609  E->CXXScalarValueInitExprBits.RParenLoc = ReadSourceLocation();
1610 }
1611 
1612 void ASTStmtReader::VisitCXXNewExpr(CXXNewExpr *E) {
1613  VisitExpr(E);
1614 
1615  bool IsArray = Record.readInt();
1616  bool HasInit = Record.readInt();
1617  unsigned NumPlacementArgs = Record.readInt();
1618  bool IsParenTypeId = Record.readInt();
1619 
1620  E->CXXNewExprBits.IsGlobalNew = Record.readInt();
1621  E->CXXNewExprBits.ShouldPassAlignment = Record.readInt();
1622  E->CXXNewExprBits.UsualArrayDeleteWantsSize = Record.readInt();
1623  E->CXXNewExprBits.StoredInitializationStyle = Record.readInt();
1624 
1625  assert((IsArray == E->isArray()) && "Wrong IsArray!");
1626  assert((HasInit == E->hasInitializer()) && "Wrong HasInit!");
1627  assert((NumPlacementArgs == E->getNumPlacementArgs()) &&
1628  "Wrong NumPlacementArgs!");
1629  assert((IsParenTypeId == E->isParenTypeId()) && "Wrong IsParenTypeId!");
1630  (void)IsArray;
1631  (void)HasInit;
1632  (void)NumPlacementArgs;
1633 
1634  E->setOperatorNew(ReadDeclAs<FunctionDecl>());
1635  E->setOperatorDelete(ReadDeclAs<FunctionDecl>());
1636  E->AllocatedTypeInfo = GetTypeSourceInfo();
1637  if (IsParenTypeId)
1638  E->getTrailingObjects<SourceRange>()[0] = ReadSourceRange();
1639  E->Range = ReadSourceRange();
1640  E->DirectInitRange = ReadSourceRange();
1641 
1642  // Install all the subexpressions.
1644  N = E->raw_arg_end();
1645  I != N; ++I)
1646  *I = Record.readSubStmt();
1647 }
1648 
1649 void ASTStmtReader::VisitCXXDeleteExpr(CXXDeleteExpr *E) {
1650  VisitExpr(E);
1651  E->CXXDeleteExprBits.GlobalDelete = Record.readInt();
1652  E->CXXDeleteExprBits.ArrayForm = Record.readInt();
1653  E->CXXDeleteExprBits.ArrayFormAsWritten = Record.readInt();
1654  E->CXXDeleteExprBits.UsualArrayDeleteWantsSize = Record.readInt();
1655  E->OperatorDelete = ReadDeclAs<FunctionDecl>();
1656  E->Argument = Record.readSubExpr();
1657  E->CXXDeleteExprBits.Loc = ReadSourceLocation();
1658 }
1659 
1660 void ASTStmtReader::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
1661  VisitExpr(E);
1662 
1663  E->Base = Record.readSubExpr();
1664  E->IsArrow = Record.readInt();
1665  E->OperatorLoc = ReadSourceLocation();
1666  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1667  E->ScopeType = GetTypeSourceInfo();
1668  E->ColonColonLoc = ReadSourceLocation();
1669  E->TildeLoc = ReadSourceLocation();
1670 
1671  IdentifierInfo *II = Record.getIdentifierInfo();
1672  if (II)
1673  E->setDestroyedType(II, ReadSourceLocation());
1674  else
1675  E->setDestroyedType(GetTypeSourceInfo());
1676 }
1677 
1678 void ASTStmtReader::VisitExprWithCleanups(ExprWithCleanups *E) {
1679  VisitExpr(E);
1680 
1681  unsigned NumObjects = Record.readInt();
1682  assert(NumObjects == E->getNumObjects());
1683  for (unsigned i = 0; i != NumObjects; ++i)
1684  E->getTrailingObjects<BlockDecl *>()[i] =
1685  ReadDeclAs<BlockDecl>();
1686 
1687  E->ExprWithCleanupsBits.CleanupsHaveSideEffects = Record.readInt();
1688  E->SubExpr = Record.readSubExpr();
1689 }
1690 
1691 void ASTStmtReader::VisitCXXDependentScopeMemberExpr(
1693  VisitExpr(E);
1694 
1695  bool HasTemplateKWAndArgsInfo = Record.readInt();
1696  unsigned NumTemplateArgs = Record.readInt();
1697  bool HasFirstQualifierFoundInScope = Record.readInt();
1698 
1699  assert((HasTemplateKWAndArgsInfo == E->hasTemplateKWAndArgsInfo()) &&
1700  "Wrong HasTemplateKWAndArgsInfo!");
1701  assert(
1702  (HasFirstQualifierFoundInScope == E->hasFirstQualifierFoundInScope()) &&
1703  "Wrong HasFirstQualifierFoundInScope!");
1704 
1705  if (HasTemplateKWAndArgsInfo)
1706  ReadTemplateKWAndArgsInfo(
1707  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
1708  E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs);
1709 
1710  assert((NumTemplateArgs == E->getNumTemplateArgs()) &&
1711  "Wrong NumTemplateArgs!");
1712 
1713  E->CXXDependentScopeMemberExprBits.IsArrow = Record.readInt();
1714  E->CXXDependentScopeMemberExprBits.OperatorLoc = ReadSourceLocation();
1715  E->BaseType = Record.readType();
1716  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1717  E->Base = Record.readSubExpr();
1718 
1719  if (HasFirstQualifierFoundInScope)
1720  *E->getTrailingObjects<NamedDecl *>() = ReadDeclAs<NamedDecl>();
1721 
1722  ReadDeclarationNameInfo(E->MemberNameInfo);
1723 }
1724 
1725 void
1726 ASTStmtReader::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) {
1727  VisitExpr(E);
1728 
1729  if (Record.readInt()) // HasTemplateKWAndArgsInfo
1730  ReadTemplateKWAndArgsInfo(
1731  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
1732  E->getTrailingObjects<TemplateArgumentLoc>(),
1733  /*NumTemplateArgs=*/Record.readInt());
1734 
1735  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1736  ReadDeclarationNameInfo(E->NameInfo);
1737 }
1738 
1739 void
1740 ASTStmtReader::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E) {
1741  VisitExpr(E);
1742  assert(Record.peekInt() == E->arg_size() &&
1743  "Read wrong record during creation ?");
1744  Record.skipInts(1);
1745  for (unsigned I = 0, N = E->arg_size(); I != N; ++I)
1746  E->setArg(I, Record.readSubExpr());
1747  E->TSI = GetTypeSourceInfo();
1748  E->setLParenLoc(ReadSourceLocation());
1749  E->setRParenLoc(ReadSourceLocation());
1750 }
1751 
1752 void ASTStmtReader::VisitOverloadExpr(OverloadExpr *E) {
1753  VisitExpr(E);
1754 
1755  unsigned NumResults = Record.readInt();
1756  bool HasTemplateKWAndArgsInfo = Record.readInt();
1757  assert((E->getNumDecls() == NumResults) && "Wrong NumResults!");
1758  assert((E->hasTemplateKWAndArgsInfo() == HasTemplateKWAndArgsInfo) &&
1759  "Wrong HasTemplateKWAndArgsInfo!");
1760 
1761  if (HasTemplateKWAndArgsInfo) {
1762  unsigned NumTemplateArgs = Record.readInt();
1763  ReadTemplateKWAndArgsInfo(*E->getTrailingASTTemplateKWAndArgsInfo(),
1765  NumTemplateArgs);
1766  assert((E->getNumTemplateArgs() == NumTemplateArgs) &&
1767  "Wrong NumTemplateArgs!");
1768  }
1769 
1770  UnresolvedSet<8> Decls;
1771  for (unsigned I = 0; I != NumResults; ++I) {
1772  auto *D = ReadDeclAs<NamedDecl>();
1773  auto AS = (AccessSpecifier)Record.readInt();
1774  Decls.addDecl(D, AS);
1775  }
1776 
1777  DeclAccessPair *Results = E->getTrailingResults();
1778  UnresolvedSetIterator Iter = Decls.begin();
1779  for (unsigned I = 0; I != NumResults; ++I) {
1780  Results[I] = (Iter + I).getPair();
1781  }
1782 
1783  ReadDeclarationNameInfo(E->NameInfo);
1784  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1785 }
1786 
1787 void ASTStmtReader::VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
1788  VisitOverloadExpr(E);
1789  E->UnresolvedMemberExprBits.IsArrow = Record.readInt();
1790  E->UnresolvedMemberExprBits.HasUnresolvedUsing = Record.readInt();
1791  E->Base = Record.readSubExpr();
1792  E->BaseType = Record.readType();
1793  E->OperatorLoc = ReadSourceLocation();
1794 }
1795 
1796 void ASTStmtReader::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) {
1797  VisitOverloadExpr(E);
1798  E->UnresolvedLookupExprBits.RequiresADL = Record.readInt();
1799  E->UnresolvedLookupExprBits.Overloaded = Record.readInt();
1800  E->NamingClass = ReadDeclAs<CXXRecordDecl>();
1801 }
1802 
1803 void ASTStmtReader::VisitTypeTraitExpr(TypeTraitExpr *E) {
1804  VisitExpr(E);
1805  E->TypeTraitExprBits.NumArgs = Record.readInt();
1806  E->TypeTraitExprBits.Kind = Record.readInt();
1807  E->TypeTraitExprBits.Value = Record.readInt();
1808  SourceRange Range = ReadSourceRange();
1809  E->Loc = Range.getBegin();
1810  E->RParenLoc = Range.getEnd();
1811 
1812  auto **Args = E->getTrailingObjects<TypeSourceInfo *>();
1813  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1814  Args[I] = GetTypeSourceInfo();
1815 }
1816 
1817 void ASTStmtReader::VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E) {
1818  VisitExpr(E);
1819  E->ATT = (ArrayTypeTrait)Record.readInt();
1820  E->Value = (unsigned int)Record.readInt();
1821  SourceRange Range = ReadSourceRange();
1822  E->Loc = Range.getBegin();
1823  E->RParen = Range.getEnd();
1824  E->QueriedType = GetTypeSourceInfo();
1825  E->Dimension = Record.readSubExpr();
1826 }
1827 
1828 void ASTStmtReader::VisitExpressionTraitExpr(ExpressionTraitExpr *E) {
1829  VisitExpr(E);
1830  E->ET = (ExpressionTrait)Record.readInt();
1831  E->Value = (bool)Record.readInt();
1832  SourceRange Range = ReadSourceRange();
1833  E->QueriedExpression = Record.readSubExpr();
1834  E->Loc = Range.getBegin();
1835  E->RParen = Range.getEnd();
1836 }
1837 
1838 void ASTStmtReader::VisitCXXNoexceptExpr(CXXNoexceptExpr *E) {
1839  VisitExpr(E);
1840  E->CXXNoexceptExprBits.Value = Record.readInt();
1841  E->Range = ReadSourceRange();
1842  E->Operand = Record.readSubExpr();
1843 }
1844 
1845 void ASTStmtReader::VisitPackExpansionExpr(PackExpansionExpr *E) {
1846  VisitExpr(E);
1847  E->EllipsisLoc = ReadSourceLocation();
1848  E->NumExpansions = Record.readInt();
1849  E->Pattern = Record.readSubExpr();
1850 }
1851 
1852 void ASTStmtReader::VisitSizeOfPackExpr(SizeOfPackExpr *E) {
1853  VisitExpr(E);
1854  unsigned NumPartialArgs = Record.readInt();
1855  E->OperatorLoc = ReadSourceLocation();
1856  E->PackLoc = ReadSourceLocation();
1857  E->RParenLoc = ReadSourceLocation();
1858  E->Pack = Record.readDeclAs<NamedDecl>();
1859  if (E->isPartiallySubstituted()) {
1860  assert(E->Length == NumPartialArgs);
1861  for (auto *I = E->getTrailingObjects<TemplateArgument>(),
1862  *E = I + NumPartialArgs;
1863  I != E; ++I)
1864  new (I) TemplateArgument(Record.readTemplateArgument());
1865  } else if (!E->isValueDependent()) {
1866  E->Length = Record.readInt();
1867  }
1868 }
1869 
1870 void ASTStmtReader::VisitSubstNonTypeTemplateParmExpr(
1872  VisitExpr(E);
1873  E->Param = ReadDeclAs<NonTypeTemplateParmDecl>();
1874  E->SubstNonTypeTemplateParmExprBits.NameLoc = ReadSourceLocation();
1875  E->Replacement = Record.readSubExpr();
1876 }
1877 
1878 void ASTStmtReader::VisitSubstNonTypeTemplateParmPackExpr(
1880  VisitExpr(E);
1881  E->Param = ReadDeclAs<NonTypeTemplateParmDecl>();
1882  TemplateArgument ArgPack = Record.readTemplateArgument();
1883  if (ArgPack.getKind() != TemplateArgument::Pack)
1884  return;
1885 
1886  E->Arguments = ArgPack.pack_begin();
1887  E->NumArguments = ArgPack.pack_size();
1888  E->NameLoc = ReadSourceLocation();
1889 }
1890 
1891 void ASTStmtReader::VisitFunctionParmPackExpr(FunctionParmPackExpr *E) {
1892  VisitExpr(E);
1893  E->NumParameters = Record.readInt();
1894  E->ParamPack = ReadDeclAs<ParmVarDecl>();
1895  E->NameLoc = ReadSourceLocation();
1896  auto **Parms = E->getTrailingObjects<VarDecl *>();
1897  for (unsigned i = 0, n = E->NumParameters; i != n; ++i)
1898  Parms[i] = ReadDeclAs<VarDecl>();
1899 }
1900 
1901 void ASTStmtReader::VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E) {
1902  VisitExpr(E);
1903  E->State = Record.readSubExpr();
1904  auto *VD = ReadDeclAs<ValueDecl>();
1905  unsigned ManglingNumber = Record.readInt();
1906  E->setExtendingDecl(VD, ManglingNumber);
1907 }
1908 
1909 void ASTStmtReader::VisitCXXFoldExpr(CXXFoldExpr *E) {
1910  VisitExpr(E);
1911  E->LParenLoc = ReadSourceLocation();
1912  E->EllipsisLoc = ReadSourceLocation();
1913  E->RParenLoc = ReadSourceLocation();
1914  E->NumExpansions = Record.readInt();
1915  E->SubExprs[0] = Record.readSubExpr();
1916  E->SubExprs[1] = Record.readSubExpr();
1917  E->Opcode = (BinaryOperatorKind)Record.readInt();
1918 }
1919 
1920 void ASTStmtReader::VisitOpaqueValueExpr(OpaqueValueExpr *E) {
1921  VisitExpr(E);
1922  E->SourceExpr = Record.readSubExpr();
1923  E->OpaqueValueExprBits.Loc = ReadSourceLocation();
1924  E->setIsUnique(Record.readInt());
1925 }
1926 
1927 void ASTStmtReader::VisitTypoExpr(TypoExpr *E) {
1928  llvm_unreachable("Cannot read TypoExpr nodes");
1929 }
1930 
1931 //===----------------------------------------------------------------------===//
1932 // Microsoft Expressions and Statements
1933 //===----------------------------------------------------------------------===//
1934 void ASTStmtReader::VisitMSPropertyRefExpr(MSPropertyRefExpr *E) {
1935  VisitExpr(E);
1936  E->IsArrow = (Record.readInt() != 0);
1937  E->BaseExpr = Record.readSubExpr();
1938  E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1939  E->MemberLoc = ReadSourceLocation();
1940  E->TheDecl = ReadDeclAs<MSPropertyDecl>();
1941 }
1942 
1943 void ASTStmtReader::VisitMSPropertySubscriptExpr(MSPropertySubscriptExpr *E) {
1944  VisitExpr(E);
1945  E->setBase(Record.readSubExpr());
1946  E->setIdx(Record.readSubExpr());
1947  E->setRBracketLoc(ReadSourceLocation());
1948 }
1949 
1950 void ASTStmtReader::VisitCXXUuidofExpr(CXXUuidofExpr *E) {
1951  VisitExpr(E);
1952  E->setSourceRange(ReadSourceRange());
1953  std::string UuidStr = ReadString();
1954  E->setUuidStr(StringRef(UuidStr).copy(Record.getContext()));
1955  if (E->isTypeOperand()) { // __uuidof(ComType)
1957  GetTypeSourceInfo());
1958  return;
1959  }
1960 
1961  // __uuidof(expr)
1962  E->setExprOperand(Record.readSubExpr());
1963 }
1964 
1965 void ASTStmtReader::VisitSEHLeaveStmt(SEHLeaveStmt *S) {
1966  VisitStmt(S);
1967  S->setLeaveLoc(ReadSourceLocation());
1968 }
1969 
1970 void ASTStmtReader::VisitSEHExceptStmt(SEHExceptStmt *S) {
1971  VisitStmt(S);
1972  S->Loc = ReadSourceLocation();
1973  S->Children[SEHExceptStmt::FILTER_EXPR] = Record.readSubStmt();
1974  S->Children[SEHExceptStmt::BLOCK] = Record.readSubStmt();
1975 }
1976 
1977 void ASTStmtReader::VisitSEHFinallyStmt(SEHFinallyStmt *S) {
1978  VisitStmt(S);
1979  S->Loc = ReadSourceLocation();
1980  S->Block = Record.readSubStmt();
1981 }
1982 
1983 void ASTStmtReader::VisitSEHTryStmt(SEHTryStmt *S) {
1984  VisitStmt(S);
1985  S->IsCXXTry = Record.readInt();
1986  S->TryLoc = ReadSourceLocation();
1987  S->Children[SEHTryStmt::TRY] = Record.readSubStmt();
1988  S->Children[SEHTryStmt::HANDLER] = Record.readSubStmt();
1989 }
1990 
1991 //===----------------------------------------------------------------------===//
1992 // CUDA Expressions and Statements
1993 //===----------------------------------------------------------------------===//
1994 
1995 void ASTStmtReader::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E) {
1996  VisitCallExpr(E);
1997  E->setPreArg(CUDAKernelCallExpr::CONFIG, Record.readSubExpr());
1998 }
1999 
2000 //===----------------------------------------------------------------------===//
2001 // OpenCL Expressions and Statements.
2002 //===----------------------------------------------------------------------===//
2003 void ASTStmtReader::VisitAsTypeExpr(AsTypeExpr *E) {
2004  VisitExpr(E);
2005  E->BuiltinLoc = ReadSourceLocation();
2006  E->RParenLoc = ReadSourceLocation();
2007  E->SrcExpr = Record.readSubExpr();
2008 }
2009 
2010 //===----------------------------------------------------------------------===//
2011 // OpenMP Directives.
2012 //===----------------------------------------------------------------------===//
2013 
2014 void ASTStmtReader::VisitOMPExecutableDirective(OMPExecutableDirective *E) {
2015  E->setLocStart(ReadSourceLocation());
2016  E->setLocEnd(ReadSourceLocation());
2017  OMPClauseReader ClauseReader(Record);
2019  for (unsigned i = 0; i < E->getNumClauses(); ++i)
2020  Clauses.push_back(ClauseReader.readClause());
2021  E->setClauses(Clauses);
2022  if (E->hasAssociatedStmt())
2023  E->setAssociatedStmt(Record.readSubStmt());
2024 }
2025 
2026 void ASTStmtReader::VisitOMPLoopDirective(OMPLoopDirective *D) {
2027  VisitStmt(D);
2028  // Two fields (NumClauses and CollapsedNum) were read in ReadStmtFromStream.
2029  Record.skipInts(2);
2030  VisitOMPExecutableDirective(D);
2031  D->setIterationVariable(Record.readSubExpr());
2032  D->setLastIteration(Record.readSubExpr());
2033  D->setCalcLastIteration(Record.readSubExpr());
2034  D->setPreCond(Record.readSubExpr());
2035  D->setCond(Record.readSubExpr());
2036  D->setInit(Record.readSubExpr());
2037  D->setInc(Record.readSubExpr());
2038  D->setPreInits(Record.readSubStmt());
2042  D->setIsLastIterVariable(Record.readSubExpr());
2043  D->setLowerBoundVariable(Record.readSubExpr());
2044  D->setUpperBoundVariable(Record.readSubExpr());
2045  D->setStrideVariable(Record.readSubExpr());
2046  D->setEnsureUpperBound(Record.readSubExpr());
2047  D->setNextLowerBound(Record.readSubExpr());
2048  D->setNextUpperBound(Record.readSubExpr());
2049  D->setNumIterations(Record.readSubExpr());
2050  }
2054  D->setDistInc(Record.readSubExpr());
2055  D->setPrevEnsureUpperBound(Record.readSubExpr());
2059  D->setCombinedInit(Record.readSubExpr());
2060  D->setCombinedCond(Record.readSubExpr());
2063  D->setCombinedDistCond(Record.readSubExpr());
2065  }
2067  unsigned CollapsedNum = D->getCollapsedNumber();
2068  Sub.reserve(CollapsedNum);
2069  for (unsigned i = 0; i < CollapsedNum; ++i)
2070  Sub.push_back(Record.readSubExpr());
2071  D->setCounters(Sub);
2072  Sub.clear();
2073  for (unsigned i = 0; i < CollapsedNum; ++i)
2074  Sub.push_back(Record.readSubExpr());
2075  D->setPrivateCounters(Sub);
2076  Sub.clear();
2077  for (unsigned i = 0; i < CollapsedNum; ++i)
2078  Sub.push_back(Record.readSubExpr());
2079  D->setInits(Sub);
2080  Sub.clear();
2081  for (unsigned i = 0; i < CollapsedNum; ++i)
2082  Sub.push_back(Record.readSubExpr());
2083  D->setUpdates(Sub);
2084  Sub.clear();
2085  for (unsigned i = 0; i < CollapsedNum; ++i)
2086  Sub.push_back(Record.readSubExpr());
2087  D->setFinals(Sub);
2088  Sub.clear();
2089  for (unsigned i = 0; i < CollapsedNum; ++i)
2090  Sub.push_back(Record.readSubExpr());
2091  D->setDependentCounters(Sub);
2092  Sub.clear();
2093  for (unsigned i = 0; i < CollapsedNum; ++i)
2094  Sub.push_back(Record.readSubExpr());
2095  D->setDependentInits(Sub);
2096  Sub.clear();
2097  for (unsigned i = 0; i < CollapsedNum; ++i)
2098  Sub.push_back(Record.readSubExpr());
2099  D->setFinalsConditions(Sub);
2100 }
2101 
2102 void ASTStmtReader::VisitOMPParallelDirective(OMPParallelDirective *D) {
2103  VisitStmt(D);
2104  // The NumClauses field was read in ReadStmtFromStream.
2105  Record.skipInts(1);
2106  VisitOMPExecutableDirective(D);
2107  D->setHasCancel(Record.readInt());
2108 }
2109 
2110 void ASTStmtReader::VisitOMPSimdDirective(OMPSimdDirective *D) {
2111  VisitOMPLoopDirective(D);
2112 }
2113 
2114 void ASTStmtReader::VisitOMPForDirective(OMPForDirective *D) {
2115  VisitOMPLoopDirective(D);
2116  D->setHasCancel(Record.readInt());
2117 }
2118 
2119 void ASTStmtReader::VisitOMPForSimdDirective(OMPForSimdDirective *D) {
2120  VisitOMPLoopDirective(D);
2121 }
2122 
2123 void ASTStmtReader::VisitOMPSectionsDirective(OMPSectionsDirective *D) {
2124  VisitStmt(D);
2125  // The NumClauses field was read in ReadStmtFromStream.
2126  Record.skipInts(1);
2127  VisitOMPExecutableDirective(D);
2128  D->setHasCancel(Record.readInt());
2129 }
2130 
2131 void ASTStmtReader::VisitOMPSectionDirective(OMPSectionDirective *D) {
2132  VisitStmt(D);
2133  VisitOMPExecutableDirective(D);
2134  D->setHasCancel(Record.readInt());
2135 }
2136 
2137 void ASTStmtReader::VisitOMPSingleDirective(OMPSingleDirective *D) {
2138  VisitStmt(D);
2139  // The NumClauses field was read in ReadStmtFromStream.
2140  Record.skipInts(1);
2141  VisitOMPExecutableDirective(D);
2142 }
2143 
2144 void ASTStmtReader::VisitOMPMasterDirective(OMPMasterDirective *D) {
2145  VisitStmt(D);
2146  VisitOMPExecutableDirective(D);
2147 }
2148 
2149 void ASTStmtReader::VisitOMPCriticalDirective(OMPCriticalDirective *D) {
2150  VisitStmt(D);
2151  // The NumClauses field was read in ReadStmtFromStream.
2152  Record.skipInts(1);
2153  VisitOMPExecutableDirective(D);
2154  ReadDeclarationNameInfo(D->DirName);
2155 }
2156 
2157 void ASTStmtReader::VisitOMPParallelForDirective(OMPParallelForDirective *D) {
2158  VisitOMPLoopDirective(D);
2159  D->setHasCancel(Record.readInt());
2160 }
2161 
2162 void ASTStmtReader::VisitOMPParallelForSimdDirective(
2164  VisitOMPLoopDirective(D);
2165 }
2166 
2167 void ASTStmtReader::VisitOMPParallelSectionsDirective(
2169  VisitStmt(D);
2170  // The NumClauses field was read in ReadStmtFromStream.
2171  Record.skipInts(1);
2172  VisitOMPExecutableDirective(D);
2173  D->setHasCancel(Record.readInt());
2174 }
2175 
2176 void ASTStmtReader::VisitOMPTaskDirective(OMPTaskDirective *D) {
2177  VisitStmt(D);
2178  // The NumClauses field was read in ReadStmtFromStream.
2179  Record.skipInts(1);
2180  VisitOMPExecutableDirective(D);
2181  D->setHasCancel(Record.readInt());
2182 }
2183 
2184 void ASTStmtReader::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) {
2185  VisitStmt(D);
2186  VisitOMPExecutableDirective(D);
2187 }
2188 
2189 void ASTStmtReader::VisitOMPBarrierDirective(OMPBarrierDirective *D) {
2190  VisitStmt(D);
2191  VisitOMPExecutableDirective(D);
2192 }
2193 
2194 void ASTStmtReader::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) {
2195  VisitStmt(D);
2196  VisitOMPExecutableDirective(D);
2197 }
2198 
2199 void ASTStmtReader::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) {
2200  VisitStmt(D);
2201  // The NumClauses field was read in ReadStmtFromStream.
2202  Record.skipInts(1);
2203  VisitOMPExecutableDirective(D);
2204  D->setReductionRef(Record.readSubExpr());
2205 }
2206 
2207 void ASTStmtReader::VisitOMPFlushDirective(OMPFlushDirective *D) {
2208  VisitStmt(D);
2209  // The NumClauses field was read in ReadStmtFromStream.
2210  Record.skipInts(1);
2211  VisitOMPExecutableDirective(D);
2212 }
2213 
2214 void ASTStmtReader::VisitOMPOrderedDirective(OMPOrderedDirective *D) {
2215  VisitStmt(D);
2216  // The NumClauses field was read in ReadStmtFromStream.
2217  Record.skipInts(1);
2218  VisitOMPExecutableDirective(D);
2219 }
2220 
2221 void ASTStmtReader::VisitOMPAtomicDirective(OMPAtomicDirective *D) {
2222  VisitStmt(D);
2223  // The NumClauses field was read in ReadStmtFromStream.
2224  Record.skipInts(1);
2225  VisitOMPExecutableDirective(D);
2226  D->setX(Record.readSubExpr());
2227  D->setV(Record.readSubExpr());
2228  D->setExpr(Record.readSubExpr());
2229  D->setUpdateExpr(Record.readSubExpr());
2230  D->IsXLHSInRHSPart = Record.readInt() != 0;
2231  D->IsPostfixUpdate = Record.readInt() != 0;
2232 }
2233 
2234 void ASTStmtReader::VisitOMPTargetDirective(OMPTargetDirective *D) {
2235  VisitStmt(D);
2236  // The NumClauses field was read in ReadStmtFromStream.
2237  Record.skipInts(1);
2238  VisitOMPExecutableDirective(D);
2239 }
2240 
2241 void ASTStmtReader::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) {
2242  VisitStmt(D);
2243  Record.skipInts(1);
2244  VisitOMPExecutableDirective(D);
2245 }
2246 
2247 void ASTStmtReader::VisitOMPTargetEnterDataDirective(
2249  VisitStmt(D);
2250  Record.skipInts(1);
2251  VisitOMPExecutableDirective(D);
2252 }
2253 
2254 void ASTStmtReader::VisitOMPTargetExitDataDirective(
2256  VisitStmt(D);
2257  Record.skipInts(1);
2258  VisitOMPExecutableDirective(D);
2259 }
2260 
2261 void ASTStmtReader::VisitOMPTargetParallelDirective(
2263  VisitStmt(D);
2264  Record.skipInts(1);
2265  VisitOMPExecutableDirective(D);
2266 }
2267 
2268 void ASTStmtReader::VisitOMPTargetParallelForDirective(
2270  VisitOMPLoopDirective(D);
2271  D->setHasCancel(Record.readInt());
2272 }
2273 
2274 void ASTStmtReader::VisitOMPTeamsDirective(OMPTeamsDirective *D) {
2275  VisitStmt(D);
2276  // The NumClauses field was read in ReadStmtFromStream.
2277  Record.skipInts(1);
2278  VisitOMPExecutableDirective(D);
2279 }
2280 
2281 void ASTStmtReader::VisitOMPCancellationPointDirective(
2283  VisitStmt(D);
2284  VisitOMPExecutableDirective(D);
2285  D->setCancelRegion(static_cast<OpenMPDirectiveKind>(Record.readInt()));
2286 }
2287 
2288 void ASTStmtReader::VisitOMPCancelDirective(OMPCancelDirective *D) {
2289  VisitStmt(D);
2290  // The NumClauses field was read in ReadStmtFromStream.
2291  Record.skipInts(1);
2292  VisitOMPExecutableDirective(D);
2293  D->setCancelRegion(static_cast<OpenMPDirectiveKind>(Record.readInt()));
2294 }
2295 
2296 void ASTStmtReader::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) {
2297  VisitOMPLoopDirective(D);
2298 }
2299 
2300 void ASTStmtReader::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) {
2301  VisitOMPLoopDirective(D);
2302 }
2303 
2304 void ASTStmtReader::VisitOMPMasterTaskLoopDirective(
2306  VisitOMPLoopDirective(D);
2307 }
2308 
2309 void ASTStmtReader::VisitOMPMasterTaskLoopSimdDirective(
2311  VisitOMPLoopDirective(D);
2312 }
2313 
2314 void ASTStmtReader::VisitOMPParallelMasterTaskLoopDirective(
2316  VisitOMPLoopDirective(D);
2317 }
2318 
2319 void ASTStmtReader::VisitOMPDistributeDirective(OMPDistributeDirective *D) {
2320  VisitOMPLoopDirective(D);
2321 }
2322 
2323 void ASTStmtReader::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) {
2324  VisitStmt(D);
2325  Record.skipInts(1);
2326  VisitOMPExecutableDirective(D);
2327 }
2328 
2329 void ASTStmtReader::VisitOMPDistributeParallelForDirective(
2331  VisitOMPLoopDirective(D);
2332  D->setHasCancel(Record.readInt());
2333 }
2334 
2335 void ASTStmtReader::VisitOMPDistributeParallelForSimdDirective(
2337  VisitOMPLoopDirective(D);
2338 }
2339 
2340 void ASTStmtReader::VisitOMPDistributeSimdDirective(
2342  VisitOMPLoopDirective(D);
2343 }
2344 
2345 void ASTStmtReader::VisitOMPTargetParallelForSimdDirective(
2347  VisitOMPLoopDirective(D);
2348 }
2349 
2350 void ASTStmtReader::VisitOMPTargetSimdDirective(OMPTargetSimdDirective *D) {
2351  VisitOMPLoopDirective(D);
2352 }
2353 
2354 void ASTStmtReader::VisitOMPTeamsDistributeDirective(
2356  VisitOMPLoopDirective(D);
2357 }
2358 
2359 void ASTStmtReader::VisitOMPTeamsDistributeSimdDirective(
2361  VisitOMPLoopDirective(D);
2362 }
2363 
2364 void ASTStmtReader::VisitOMPTeamsDistributeParallelForSimdDirective(
2366  VisitOMPLoopDirective(D);
2367 }
2368 
2369 void ASTStmtReader::VisitOMPTeamsDistributeParallelForDirective(
2371  VisitOMPLoopDirective(D);
2372  D->setHasCancel(Record.readInt());
2373 }
2374 
2375 void ASTStmtReader::VisitOMPTargetTeamsDirective(OMPTargetTeamsDirective *D) {
2376  VisitStmt(D);
2377  // The NumClauses field was read in ReadStmtFromStream.
2378  Record.skipInts(1);
2379  VisitOMPExecutableDirective(D);
2380 }
2381 
2382 void ASTStmtReader::VisitOMPTargetTeamsDistributeDirective(
2384  VisitOMPLoopDirective(D);
2385 }
2386 
2387 void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForDirective(
2389  VisitOMPLoopDirective(D);
2390  D->setHasCancel(Record.readInt());
2391 }
2392 
2393 void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
2395  VisitOMPLoopDirective(D);
2396 }
2397 
2398 void ASTStmtReader::VisitOMPTargetTeamsDistributeSimdDirective(
2400  VisitOMPLoopDirective(D);
2401 }
2402 
2403 //===----------------------------------------------------------------------===//
2404 // ASTReader Implementation
2405 //===----------------------------------------------------------------------===//
2406 
2408  switch (ReadingKind) {
2409  case Read_None:
2410  llvm_unreachable("should not call this when not reading anything");
2411  case Read_Decl:
2412  case Read_Type:
2413  return ReadStmtFromStream(F);
2414  case Read_Stmt:
2415  return ReadSubStmt();
2416  }
2417 
2418  llvm_unreachable("ReadingKind not set ?");
2419 }
2420 
2422  return cast_or_null<Expr>(ReadStmt(F));
2423 }
2424 
2426  return cast_or_null<Expr>(ReadSubStmt());
2427 }
2428 
2429 // Within the bitstream, expressions are stored in Reverse Polish
2430 // Notation, with each of the subexpressions preceding the
2431 // expression they are stored in. Subexpressions are stored from last to first.
2432 // To evaluate expressions, we continue reading expressions and placing them on
2433 // the stack, with expressions having operands removing those operands from the
2434 // stack. Evaluation terminates when we see a STMT_STOP record, and
2435 // the single remaining expression on the stack is our result.
2436 Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) {
2437  ReadingKindTracker ReadingKind(Read_Stmt, *this);
2438  llvm::BitstreamCursor &Cursor = F.DeclsCursor;
2439 
2440  // Map of offset to previously deserialized stmt. The offset points
2441  // just after the stmt record.
2442  llvm::DenseMap<uint64_t, Stmt *> StmtEntries;
2443 
2444 #ifndef NDEBUG
2445  unsigned PrevNumStmts = StmtStack.size();
2446 #endif
2447 
2448  ASTRecordReader Record(*this, F);
2449  ASTStmtReader Reader(Record, Cursor);
2450  Stmt::EmptyShell Empty;
2451 
2452  while (true) {
2454  Cursor.advanceSkippingSubblocks();
2455  if (!MaybeEntry) {
2456  Error(toString(MaybeEntry.takeError()));
2457  return nullptr;
2458  }
2459  llvm::BitstreamEntry Entry = MaybeEntry.get();
2460 
2461  switch (Entry.Kind) {
2462  case llvm::BitstreamEntry::SubBlock: // Handled for us already.
2464  Error("malformed block record in AST file");
2465  return nullptr;
2466  case llvm::BitstreamEntry::EndBlock:
2467  goto Done;
2468  case llvm::BitstreamEntry::Record:
2469  // The interesting case.
2470  break;
2471  }
2472 
2473  ASTContext &Context = getContext();
2474  Stmt *S = nullptr;
2475  bool Finished = false;
2476  bool IsStmtReference = false;
2477  Expected<unsigned> MaybeStmtCode = Record.readRecord(Cursor, Entry.ID);
2478  if (!MaybeStmtCode) {
2479  Error(toString(MaybeStmtCode.takeError()));
2480  return nullptr;
2481  }
2482  switch ((StmtCode)MaybeStmtCode.get()) {
2483  case STMT_STOP:
2484  Finished = true;
2485  break;
2486 
2487  case STMT_REF_PTR:
2488  IsStmtReference = true;
2489  assert(StmtEntries.find(Record[0]) != StmtEntries.end() &&
2490  "No stmt was recorded for this offset reference!");
2491  S = StmtEntries[Record.readInt()];
2492  break;
2493 
2494  case STMT_NULL_PTR:
2495  S = nullptr;
2496  break;
2497 
2498  case STMT_NULL:
2499  S = new (Context) NullStmt(Empty);
2500  break;
2501 
2502  case STMT_COMPOUND:
2504  Context, /*NumStmts=*/Record[ASTStmtReader::NumStmtFields]);
2505  break;
2506 
2507  case STMT_CASE:
2509  Context,
2510  /*CaseStmtIsGNURange*/ Record[ASTStmtReader::NumStmtFields + 3]);
2511  break;
2512 
2513  case STMT_DEFAULT:
2514  S = new (Context) DefaultStmt(Empty);
2515  break;
2516 
2517  case STMT_LABEL:
2518  S = new (Context) LabelStmt(Empty);
2519  break;
2520 
2521  case STMT_ATTRIBUTED:
2523  Context,
2524  /*NumAttrs*/Record[ASTStmtReader::NumStmtFields]);
2525  break;
2526 
2527  case STMT_IF:
2528  S = IfStmt::CreateEmpty(
2529  Context,
2530  /* HasElse=*/Record[ASTStmtReader::NumStmtFields + 1],
2531  /* HasVar=*/Record[ASTStmtReader::NumStmtFields + 2],
2532  /* HasInit=*/Record[ASTStmtReader::NumStmtFields + 3]);
2533  break;
2534 
2535  case STMT_SWITCH:
2537  Context,
2538  /* HasInit=*/Record[ASTStmtReader::NumStmtFields],
2539  /* HasVar=*/Record[ASTStmtReader::NumStmtFields + 1]);
2540  break;
2541 
2542  case STMT_WHILE:
2544  Context,
2545  /* HasVar=*/Record[ASTStmtReader::NumStmtFields]);
2546  break;
2547 
2548  case STMT_DO:
2549  S = new (Context) DoStmt(Empty);
2550  break;
2551 
2552  case STMT_FOR:
2553  S = new (Context) ForStmt(Empty);
2554  break;
2555 
2556  case STMT_GOTO:
2557  S = new (Context) GotoStmt(Empty);
2558  break;
2559 
2560  case STMT_INDIRECT_GOTO:
2561  S = new (Context) IndirectGotoStmt(Empty);
2562  break;
2563 
2564  case STMT_CONTINUE:
2565  S = new (Context) ContinueStmt(Empty);
2566  break;
2567 
2568  case STMT_BREAK:
2569  S = new (Context) BreakStmt(Empty);
2570  break;
2571 
2572  case STMT_RETURN:
2574  Context, /* HasNRVOCandidate=*/Record[ASTStmtReader::NumStmtFields]);
2575  break;
2576 
2577  case STMT_DECL:
2578  S = new (Context) DeclStmt(Empty);
2579  break;
2580 
2581  case STMT_GCCASM:
2582  S = new (Context) GCCAsmStmt(Empty);
2583  break;
2584 
2585  case STMT_MSASM:
2586  S = new (Context) MSAsmStmt(Empty);
2587  break;
2588 
2589  case STMT_CAPTURED:
2591  Context, Record[ASTStmtReader::NumStmtFields]);
2592  break;
2593 
2594  case EXPR_CONSTANT:
2596  Context,
2597  static_cast<ConstantExpr::ResultStorageKind>(
2599  Empty);
2600  break;
2601 
2602  case EXPR_PREDEFINED:
2604  Context,
2605  /*HasFunctionName*/ Record[ASTStmtReader::NumExprFields]);
2606  break;
2607 
2608  case EXPR_DECL_REF:
2610  Context,
2611  /*HasQualifier=*/Record[ASTStmtReader::NumExprFields],
2612  /*HasFoundDecl=*/Record[ASTStmtReader::NumExprFields + 1],
2613  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields + 2],
2614  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields + 2] ?
2615  Record[ASTStmtReader::NumExprFields + 6] : 0);
2616  break;
2617 
2618  case EXPR_INTEGER_LITERAL:
2619  S = IntegerLiteral::Create(Context, Empty);
2620  break;
2621 
2622  case EXPR_FLOATING_LITERAL:
2623  S = FloatingLiteral::Create(Context, Empty);
2624  break;
2625 
2627  S = new (Context) ImaginaryLiteral(Empty);
2628  break;
2629 
2630  case EXPR_STRING_LITERAL:
2632  Context,
2633  /* NumConcatenated=*/Record[ASTStmtReader::NumExprFields],
2634  /* Length=*/Record[ASTStmtReader::NumExprFields + 1],
2635  /* CharByteWidth=*/Record[ASTStmtReader::NumExprFields + 2]);
2636  break;
2637 
2639  S = new (Context) CharacterLiteral(Empty);
2640  break;
2641 
2642  case EXPR_PAREN:
2643  S = new (Context) ParenExpr(Empty);
2644  break;
2645 
2646  case EXPR_PAREN_LIST:
2648  Context,
2649  /* NumExprs=*/Record[ASTStmtReader::NumExprFields]);
2650  break;
2651 
2652  case EXPR_UNARY_OPERATOR:
2653  S = new (Context) UnaryOperator(Empty);
2654  break;
2655 
2656  case EXPR_OFFSETOF:
2657  S = OffsetOfExpr::CreateEmpty(Context,
2658  Record[ASTStmtReader::NumExprFields],
2659  Record[ASTStmtReader::NumExprFields + 1]);
2660  break;
2661 
2662  case EXPR_SIZEOF_ALIGN_OF:
2663  S = new (Context) UnaryExprOrTypeTraitExpr(Empty);
2664  break;
2665 
2666  case EXPR_ARRAY_SUBSCRIPT:
2667  S = new (Context) ArraySubscriptExpr(Empty);
2668  break;
2669 
2671  S = new (Context) OMPArraySectionExpr(Empty);
2672  break;
2673 
2674  case EXPR_CALL:
2676  Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], Empty);
2677  break;
2678 
2679  case EXPR_MEMBER:
2680  S = MemberExpr::CreateEmpty(Context, Record[ASTStmtReader::NumExprFields],
2681  Record[ASTStmtReader::NumExprFields + 1],
2682  Record[ASTStmtReader::NumExprFields + 2],
2683  Record[ASTStmtReader::NumExprFields + 3]);
2684  break;
2685 
2686  case EXPR_BINARY_OPERATOR:
2687  S = new (Context) BinaryOperator(Empty);
2688  break;
2689 
2691  S = new (Context) CompoundAssignOperator(Empty);
2692  break;
2693 
2695  S = new (Context) ConditionalOperator(Empty);
2696  break;
2697 
2699  S = new (Context) BinaryConditionalOperator(Empty);
2700  break;
2701 
2702  case EXPR_IMPLICIT_CAST:
2703  S = ImplicitCastExpr::CreateEmpty(Context,
2704  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
2705  break;
2706 
2707  case EXPR_CSTYLE_CAST:
2708  S = CStyleCastExpr::CreateEmpty(Context,
2709  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
2710  break;
2711 
2712  case EXPR_COMPOUND_LITERAL:
2713  S = new (Context) CompoundLiteralExpr(Empty);
2714  break;
2715 
2717  S = new (Context) ExtVectorElementExpr(Empty);
2718  break;
2719 
2720  case EXPR_INIT_LIST:
2721  S = new (Context) InitListExpr(Empty);
2722  break;
2723 
2724  case EXPR_DESIGNATED_INIT:
2725  S = DesignatedInitExpr::CreateEmpty(Context,
2726  Record[ASTStmtReader::NumExprFields] - 1);
2727 
2728  break;
2729 
2731  S = new (Context) DesignatedInitUpdateExpr(Empty);
2732  break;
2733 
2735  S = new (Context) ImplicitValueInitExpr(Empty);
2736  break;
2737 
2738  case EXPR_NO_INIT:
2739  S = new (Context) NoInitExpr(Empty);
2740  break;
2741 
2742  case EXPR_ARRAY_INIT_LOOP:
2743  S = new (Context) ArrayInitLoopExpr(Empty);
2744  break;
2745 
2746  case EXPR_ARRAY_INIT_INDEX:
2747  S = new (Context) ArrayInitIndexExpr(Empty);
2748  break;
2749 
2750  case EXPR_VA_ARG:
2751  S = new (Context) VAArgExpr(Empty);
2752  break;
2753 
2754  case EXPR_SOURCE_LOC:
2755  S = new (Context) SourceLocExpr(Empty);
2756  break;
2757 
2758  case EXPR_ADDR_LABEL:
2759  S = new (Context) AddrLabelExpr(Empty);
2760  break;
2761 
2762  case EXPR_STMT:
2763  S = new (Context) StmtExpr(Empty);
2764  break;
2765 
2766  case EXPR_CHOOSE:
2767  S = new (Context) ChooseExpr(Empty);
2768  break;
2769 
2770  case EXPR_GNU_NULL:
2771  S = new (Context) GNUNullExpr(Empty);
2772  break;
2773 
2774  case EXPR_SHUFFLE_VECTOR:
2775  S = new (Context) ShuffleVectorExpr(Empty);
2776  break;
2777 
2778  case EXPR_CONVERT_VECTOR:
2779  S = new (Context) ConvertVectorExpr(Empty);
2780  break;
2781 
2782  case EXPR_BLOCK:
2783  S = new (Context) BlockExpr(Empty);
2784  break;
2785 
2788  Context,
2789  /*NumAssocs=*/Record[ASTStmtReader::NumExprFields]);
2790  break;
2791 
2793  S = new (Context) ObjCStringLiteral(Empty);
2794  break;
2795 
2797  S = new (Context) ObjCBoxedExpr(Empty);
2798  break;
2799 
2801  S = ObjCArrayLiteral::CreateEmpty(Context,
2802  Record[ASTStmtReader::NumExprFields]);
2803  break;
2804 
2807  Record[ASTStmtReader::NumExprFields],
2808  Record[ASTStmtReader::NumExprFields + 1]);
2809  break;
2810 
2811  case EXPR_OBJC_ENCODE:
2812  S = new (Context) ObjCEncodeExpr(Empty);
2813  break;
2814 
2816  S = new (Context) ObjCSelectorExpr(Empty);
2817  break;
2818 
2820  S = new (Context) ObjCProtocolExpr(Empty);
2821  break;
2822 
2824  S = new (Context) ObjCIvarRefExpr(Empty);
2825  break;
2826 
2828  S = new (Context) ObjCPropertyRefExpr(Empty);
2829  break;
2830 
2832  S = new (Context) ObjCSubscriptRefExpr(Empty);
2833  break;
2834 
2836  llvm_unreachable("mismatching AST file");
2837 
2839  S = ObjCMessageExpr::CreateEmpty(Context,
2840  Record[ASTStmtReader::NumExprFields],
2841  Record[ASTStmtReader::NumExprFields + 1]);
2842  break;
2843 
2844  case EXPR_OBJC_ISA:
2845  S = new (Context) ObjCIsaExpr(Empty);
2846  break;
2847 
2849  S = new (Context) ObjCIndirectCopyRestoreExpr(Empty);
2850  break;
2851 
2853  S = new (Context) ObjCBridgedCastExpr(Empty);
2854  break;
2855 
2857  S = new (Context) ObjCForCollectionStmt(Empty);
2858  break;
2859 
2860  case STMT_OBJC_CATCH:
2861  S = new (Context) ObjCAtCatchStmt(Empty);
2862  break;
2863 
2864  case STMT_OBJC_FINALLY:
2865  S = new (Context) ObjCAtFinallyStmt(Empty);
2866  break;
2867 
2868  case STMT_OBJC_AT_TRY:
2869  S = ObjCAtTryStmt::CreateEmpty(Context,
2870  Record[ASTStmtReader::NumStmtFields],
2871  Record[ASTStmtReader::NumStmtFields + 1]);
2872  break;
2873 
2875  S = new (Context) ObjCAtSynchronizedStmt(Empty);
2876  break;
2877 
2878  case STMT_OBJC_AT_THROW:
2879  S = new (Context) ObjCAtThrowStmt(Empty);
2880  break;
2881 
2883  S = new (Context) ObjCAutoreleasePoolStmt(Empty);
2884  break;
2885 
2887  S = new (Context) ObjCBoolLiteralExpr(Empty);
2888  break;
2889 
2891  S = new (Context) ObjCAvailabilityCheckExpr(Empty);
2892  break;
2893 
2894  case STMT_SEH_LEAVE:
2895  S = new (Context) SEHLeaveStmt(Empty);
2896  break;
2897 
2898  case STMT_SEH_EXCEPT:
2899  S = new (Context) SEHExceptStmt(Empty);
2900  break;
2901 
2902  case STMT_SEH_FINALLY:
2903  S = new (Context) SEHFinallyStmt(Empty);
2904  break;
2905 
2906  case STMT_SEH_TRY:
2907  S = new (Context) SEHTryStmt(Empty);
2908  break;
2909 
2910  case STMT_CXX_CATCH:
2911  S = new (Context) CXXCatchStmt(Empty);
2912  break;
2913 
2914  case STMT_CXX_TRY:
2915  S = CXXTryStmt::Create(Context, Empty,
2916  /*numHandlers=*/Record[ASTStmtReader::NumStmtFields]);
2917  break;
2918 
2919  case STMT_CXX_FOR_RANGE:
2920  S = new (Context) CXXForRangeStmt(Empty);
2921  break;
2922 
2924  S = new (Context) MSDependentExistsStmt(SourceLocation(), true,
2927  nullptr);
2928  break;
2929 
2931  S =
2933  Record[ASTStmtReader::NumStmtFields],
2934  Empty);
2935  break;
2936 
2937  case STMT_OMP_SIMD_DIRECTIVE: {
2938  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2939  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2940  S = OMPSimdDirective::CreateEmpty(Context, NumClauses,
2941  CollapsedNum, Empty);
2942  break;
2943  }
2944 
2945  case STMT_OMP_FOR_DIRECTIVE: {
2946  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2947  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2948  S = OMPForDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
2949  Empty);
2950  break;
2951  }
2952 
2954  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2955  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2956  S = OMPForSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
2957  Empty);
2958  break;
2959  }
2960 
2963  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2964  break;
2965 
2967  S = OMPSectionDirective::CreateEmpty(Context, Empty);
2968  break;
2969 
2972  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2973  break;
2974 
2976  S = OMPMasterDirective::CreateEmpty(Context, Empty);
2977  break;
2978 
2981  Context, Record[ASTStmtReader::NumStmtFields], Empty);
2982  break;
2983 
2985  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2986  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2987  S = OMPParallelForDirective::CreateEmpty(Context, NumClauses,
2988  CollapsedNum, Empty);
2989  break;
2990  }
2991 
2993  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
2994  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2995  S = OMPParallelForSimdDirective::CreateEmpty(Context, NumClauses,
2996  CollapsedNum, Empty);
2997  break;
2998  }
2999 
3002  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3003  break;
3004 
3007  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3008  break;
3009 
3011  S = OMPTaskyieldDirective::CreateEmpty(Context, Empty);
3012  break;
3013 
3015  S = OMPBarrierDirective::CreateEmpty(Context, Empty);
3016  break;
3017 
3019  S = OMPTaskwaitDirective::CreateEmpty(Context, Empty);
3020  break;
3021 
3024  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3025  break;
3026 
3029  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3030  break;
3031 
3034  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3035  break;
3036 
3039  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3040  break;
3041 
3044  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3045  break;
3046 
3049  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3050  break;
3051 
3054  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3055  break;
3056 
3059  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3060  break;
3061 
3064  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3065  break;
3066 
3068  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3069  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3070  S = OMPTargetParallelForDirective::CreateEmpty(Context, NumClauses,
3071  CollapsedNum, Empty);
3072  break;
3073  }
3074 
3077  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3078  break;
3079 
3082  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3083  break;
3084 
3086  S = OMPCancellationPointDirective::CreateEmpty(Context, Empty);
3087  break;
3088 
3091  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3092  break;
3093 
3095  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3096  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3097  S = OMPTaskLoopDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3098  Empty);
3099  break;
3100  }
3101 
3103  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3104  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3105  S = OMPTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
3106  CollapsedNum, Empty);
3107  break;
3108  }
3109 
3111  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3112  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3113  S = OMPMasterTaskLoopDirective::CreateEmpty(Context, NumClauses,
3114  CollapsedNum, Empty);
3115  break;
3116  }
3117 
3119  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3120  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3121  S = OMPMasterTaskLoopSimdDirective::CreateEmpty(Context, NumClauses,
3122  CollapsedNum, Empty);
3123  break;
3124  }
3125 
3127  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3128  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3129  S = OMPParallelMasterTaskLoopDirective::CreateEmpty(Context, NumClauses,
3130  CollapsedNum, Empty);
3131  break;
3132  }
3133 
3135  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3136  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3137  S = OMPDistributeDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3138  Empty);
3139  break;
3140  }
3141 
3143  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3144  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3145  S = OMPDistributeParallelForDirective::CreateEmpty(Context, NumClauses,
3146  CollapsedNum, Empty);
3147  break;
3148  }
3149 
3151  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3152  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3154  CollapsedNum,
3155  Empty);
3156  break;
3157  }
3158 
3160  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3161  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3162  S = OMPDistributeSimdDirective::CreateEmpty(Context, NumClauses,
3163  CollapsedNum, Empty);
3164  break;
3165  }
3166 
3168  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3169  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3170  S = OMPTargetParallelForSimdDirective::CreateEmpty(Context, NumClauses,
3171  CollapsedNum, Empty);
3172  break;
3173  }
3174 
3176  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3177  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3178  S = OMPTargetSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum,
3179  Empty);
3180  break;
3181  }
3182 
3184  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3185  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3186  S = OMPTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
3187  CollapsedNum, Empty);
3188  break;
3189  }
3190 
3192  unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
3193  unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3194  S = OMPTeamsDistributeSimdDirective::CreateEmpty(Context, NumClauses,
3195  CollapsedNum, Empty);
3196  break;
3197  }
3198 
3200  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3201  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3203  Context, NumClauses, CollapsedNum, Empty);
3204  break;
3205  }
3206 
3208  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3209  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3211  Context, NumClauses, CollapsedNum, Empty);
3212  break;
3213  }
3214 
3217  Context, Record[ASTStmtReader::NumStmtFields], Empty);
3218  break;
3219 
3221  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3222  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3223  S = OMPTargetTeamsDistributeDirective::CreateEmpty(Context, NumClauses,
3224  CollapsedNum, Empty);
3225  break;
3226  }
3227 
3229  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3230  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3232  Context, NumClauses, CollapsedNum, Empty);
3233  break;
3234  }
3235 
3237  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3238  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3240  Context, NumClauses, CollapsedNum, Empty);
3241  break;
3242  }
3243 
3245  auto NumClauses = Record[ASTStmtReader::NumStmtFields];
3246  auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3248  Context, NumClauses, CollapsedNum, Empty);
3249  break;
3250  }
3251 
3254  Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], Empty);
3255  break;
3256 
3257  case EXPR_CXX_MEMBER_CALL:
3259  Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], Empty);
3260  break;
3261 
3263  S = new (Context) CXXRewrittenBinaryOperator(Empty);
3264  break;
3265 
3266  case EXPR_CXX_CONSTRUCT:
3268  Context,
3269  /* NumArgs=*/Record[ASTStmtReader::NumExprFields]);
3270  break;
3271 
3273  S = new (Context) CXXInheritedCtorInitExpr(Empty);
3274  break;
3275 
3278  Context,
3279  /* NumArgs=*/Record[ASTStmtReader::NumExprFields]);
3280  break;
3281 
3282  case EXPR_CXX_STATIC_CAST:
3283  S = CXXStaticCastExpr::CreateEmpty(Context,
3284  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3285  break;
3286 
3287  case EXPR_CXX_DYNAMIC_CAST:
3288  S = CXXDynamicCastExpr::CreateEmpty(Context,
3289  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3290  break;
3291 
3294  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3295  break;
3296 
3297  case EXPR_CXX_CONST_CAST:
3298  S = CXXConstCastExpr::CreateEmpty(Context);
3299  break;
3300 
3303  /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
3304  break;
3305 
3308  Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], Empty);
3309  break;
3310 
3312  S = new (Context) CXXStdInitializerListExpr(Empty);
3313  break;
3314 
3315  case EXPR_CXX_BOOL_LITERAL:
3316  S = new (Context) CXXBoolLiteralExpr(Empty);
3317  break;
3318 
3320  S = new (Context) CXXNullPtrLiteralExpr(Empty);
3321  break;
3322 
3323  case EXPR_CXX_TYPEID_EXPR:
3324  S = new (Context) CXXTypeidExpr(Empty, true);
3325  break;
3326 
3327  case EXPR_CXX_TYPEID_TYPE:
3328  S = new (Context) CXXTypeidExpr(Empty, false);
3329  break;
3330 
3331  case EXPR_CXX_UUIDOF_EXPR:
3332  S = new (Context) CXXUuidofExpr(Empty, true);
3333  break;
3334 
3336  S = new (Context) MSPropertyRefExpr(Empty);
3337  break;
3338 
3340  S = new (Context) MSPropertySubscriptExpr(Empty);
3341  break;
3342 
3343  case EXPR_CXX_UUIDOF_TYPE:
3344  S = new (Context) CXXUuidofExpr(Empty, false);
3345  break;
3346 
3347  case EXPR_CXX_THIS:
3348  S = new (Context) CXXThisExpr(Empty);
3349  break;
3350 
3351  case EXPR_CXX_THROW:
3352  S = new (Context) CXXThrowExpr(Empty);
3353  break;
3354 
3355  case EXPR_CXX_DEFAULT_ARG:
3356  S = new (Context) CXXDefaultArgExpr(Empty);
3357  break;
3358 
3359  case EXPR_CXX_DEFAULT_INIT:
3360  S = new (Context) CXXDefaultInitExpr(Empty);
3361  break;
3362 
3364  S = new (Context) CXXBindTemporaryExpr(Empty);
3365  break;
3366 
3368  S = new (Context) CXXScalarValueInitExpr(Empty);
3369  break;
3370 
3371  case EXPR_CXX_NEW:
3373  Context,
3374  /*IsArray=*/Record[ASTStmtReader::NumExprFields],
3375  /*HasInit=*/Record[ASTStmtReader::NumExprFields + 1],
3376  /*NumPlacementArgs=*/Record[ASTStmtReader::NumExprFields + 2],
3377  /*IsParenTypeId=*/Record[ASTStmtReader::NumExprFields + 3]);
3378  break;
3379 
3380  case EXPR_CXX_DELETE:
3381  S = new (Context) CXXDeleteExpr(Empty);
3382  break;
3383 
3385  S = new (Context) CXXPseudoDestructorExpr(Empty);
3386  break;
3387 
3389  S = ExprWithCleanups::Create(Context, Empty,
3390  Record[ASTStmtReader::NumExprFields]);
3391  break;
3392 
3395  Context,
3396  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields],
3397  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields + 1],
3398  /*HasFirstQualifierFoundInScope=*/
3399  Record[ASTStmtReader::NumExprFields + 2]);
3400  break;
3401 
3404  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields],
3405  /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]
3406  ? Record[ASTStmtReader::NumExprFields + 1]
3407  : 0);
3408  break;
3409 
3412  /*NumArgs=*/Record[ASTStmtReader::NumExprFields]);
3413  break;
3414 
3417  Context,
3418  /*NumResults=*/Record[ASTStmtReader::NumExprFields],
3419  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields + 1],
3420  /*NumTemplateArgs=*/
3421  Record[ASTStmtReader::NumExprFields + 1]
3422  ? Record[ASTStmtReader::NumExprFields + 2]
3423  : 0);
3424  break;
3425 
3428  Context,
3429  /*NumResults=*/Record[ASTStmtReader::NumExprFields],
3430  /*HasTemplateKWAndArgsInfo=*/Record[ASTStmtReader::NumExprFields + 1],
3431  /*NumTemplateArgs=*/
3432  Record[ASTStmtReader::NumExprFields + 1]
3433  ? Record[ASTStmtReader::NumExprFields + 2]
3434  : 0);
3435  break;
3436 
3437  case EXPR_TYPE_TRAIT:
3439  Record[ASTStmtReader::NumExprFields]);
3440  break;
3441 
3442  case EXPR_ARRAY_TYPE_TRAIT:
3443  S = new (Context) ArrayTypeTraitExpr(Empty);
3444  break;
3445 
3447  S = new (Context) ExpressionTraitExpr(Empty);
3448  break;
3449 
3450  case EXPR_CXX_NOEXCEPT:
3451  S = new (Context) CXXNoexceptExpr(Empty);
3452  break;
3453 
3454  case EXPR_PACK_EXPANSION:
3455  S = new (Context) PackExpansionExpr(Empty);
3456  break;
3457 
3458  case EXPR_SIZEOF_PACK:
3460  Context,
3461  /*NumPartialArgs=*/Record[ASTStmtReader::NumExprFields]);
3462  break;
3463 
3465  S = new (Context) SubstNonTypeTemplateParmExpr(Empty);
3466  break;
3467 
3469  S = new (Context) SubstNonTypeTemplateParmPackExpr(Empty);
3470  break;
3471 
3474  Record[ASTStmtReader::NumExprFields]);
3475  break;
3476 
3478  S = new (Context) MaterializeTemporaryExpr(Empty);
3479  break;
3480 
3481  case EXPR_CXX_FOLD:
3482  S = new (Context) CXXFoldExpr(Empty);
3483  break;
3484 
3485  case EXPR_OPAQUE_VALUE:
3486  S = new (Context) OpaqueValueExpr(Empty);
3487  break;
3488 
3489  case EXPR_CUDA_KERNEL_CALL:
3491  Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], Empty);
3492  break;
3493 
3494  case EXPR_ASTYPE:
3495  S = new (Context) AsTypeExpr(Empty);
3496  break;
3497 
3498  case EXPR_PSEUDO_OBJECT: {
3499  unsigned numSemanticExprs = Record[ASTStmtReader::NumExprFields];
3500  S = PseudoObjectExpr::Create(Context, Empty, numSemanticExprs);
3501  break;
3502  }
3503 
3504  case EXPR_ATOMIC:
3505  S = new (Context) AtomicExpr(Empty);
3506  break;
3507 
3508  case EXPR_LAMBDA: {
3509  unsigned NumCaptures = Record[ASTStmtReader::NumExprFields];
3510  S = LambdaExpr::CreateDeserialized(Context, NumCaptures);
3511  break;
3512  }
3513 
3514  case STMT_COROUTINE_BODY: {
3515  unsigned NumParams = Record[ASTStmtReader::NumStmtFields];
3516  S = CoroutineBodyStmt::Create(Context, Empty, NumParams);
3517  break;
3518  }
3519 
3520  case STMT_CORETURN:
3521  S = new (Context) CoreturnStmt(Empty);
3522  break;
3523 
3524  case EXPR_COAWAIT:
3525  S = new (Context) CoawaitExpr(Empty);
3526  break;
3527 
3528  case EXPR_COYIELD:
3529  S = new (Context) CoyieldExpr(Empty);
3530  break;
3531 
3533  S = new (Context) DependentCoawaitExpr(Empty);
3534  break;
3535 
3537  unsigned numTemplateArgs = Record[ASTStmtReader::NumExprFields];
3538  S = ConceptSpecializationExpr::Create(Context, Empty, numTemplateArgs);
3539  break;
3540 
3541  }
3542 
3543  // We hit a STMT_STOP, so we're done with this expression.
3544  if (Finished)
3545  break;
3546 
3547  ++NumStatementsRead;
3548 
3549  if (S && !IsStmtReference) {
3550  Reader.Visit(S);
3551  StmtEntries[Cursor.GetCurrentBitNo()] = S;
3552  }
3553 
3554  assert(Record.getIdx() == Record.size() &&
3555  "Invalid deserialization of statement");
3556  StmtStack.push_back(S);
3557  }
3558 Done:
3559  assert(StmtStack.size() > PrevNumStmts && "Read too many sub-stmts!");
3560  assert(StmtStack.size() == PrevNumStmts + 1 && "Extra expressions on stack!");
3561  return StmtStack.pop_back_val();
3562 }
void setPreInits(Stmt *PreInits)
Definition: StmtOpenMP.h:604
void setCombinedParForInDistCond(Expr *CombParForInDistCond)
Definition: StmtOpenMP.h:723
static AttributedStmt * CreateEmpty(const ASTContext &C, unsigned NumAttrs)
Definition: Stmt.cpp:364
void setFPFeatures(FPOptions F)
Definition: Expr.h:3582
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:614
A PredefinedExpr record.
Definition: ASTBitCodes.h:1643
void setCond(Expr *Cond)
Definition: Stmt.h:2267
const uint64_t & readInt()
Returns the current value in this record, and advances to the next value.
Definition: ASTReader.h:2414
A call to an overloaded operator written using operator syntax.
Definition: ExprCXX.h:78
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
Definition: ExprObjC.h:1577
The receiver is the instance of the superclass object.
Definition: ExprObjC.h:1107
Represents a single C99 designator.
Definition: Expr.h:4686
void setConditionVariable(const ASTContext &C, VarDecl *V)
Definition: Stmt.cpp:932
static DependentScopeDeclRefExpr * CreateEmpty(const ASTContext &Context, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition: ExprCXX.cpp:570
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:1104
void setRParenLoc(SourceLocation L)
Definition: ExprCXX.h:1722
A CompoundLiteralExpr record.
Definition: ASTBitCodes.h:1703
This represents &#39;#pragma omp distribute simd&#39; composite directive.
Definition: StmtOpenMP.h:3614
This represents &#39;#pragma omp master&#39; directive.
Definition: StmtOpenMP.h:1592
ConstantExprBitfields ConstantExprBits
Definition: Stmt.h:969
DesignatorTypes
The kinds of designators that can occur in a DesignatedInitExpr.
Definition: ASTBitCodes.h:2006
void setRangeStmt(Stmt *S)
Definition: StmtCXX.h:193
void setTemplateArguments(const ASTTemplateArgumentListInfo *ArgsAsWritten, ArrayRef< TemplateArgument > Converted)
Set new template arguments for this concept specialization.
Definition: ExprCXX.cpp:1778
SourceLocation readSourceLocation()
Read a source location, advancing Idx.
Definition: ASTReader.h:2619
The null pointer literal (C++11 [lex.nullptr])
Definition: ExprCXX.h:683
unsigned getNumDecls() const
Gets the number of declarations in the unresolved set.
Definition: ExprCXX.h:2947
This represents &#39;#pragma omp task&#39; directive.
Definition: StmtOpenMP.h:1932
void setEnsureUpperBound(Expr *EUB)
Definition: StmtOpenMP.h:635
This represents a GCC inline-assembly statement extension.
Definition: Stmt.h:2862
static CXXConstructExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs)
Create an empty C++ construction expression.
Definition: ExprCXX.cpp:1085
Represents a &#39;co_await&#39; expression while the type of the promise is dependent.
Definition: ExprCXX.h:4741
void setSubStmt(CompoundStmt *S)
Definition: Expr.h:3944
static OMPMasterTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
The receiver is an object instance.
Definition: ExprObjC.h:1101
unsigned getNumInputs() const
Definition: Stmt.h:2774
static OMPMasterDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:349
UnresolvedMemberExprBitfields UnresolvedMemberExprBits
Definition: Stmt.h:1008
An IndirectGotoStmt record.
Definition: ASTBitCodes.h:1616
A (possibly-)qualified type.
Definition: Type.h:643
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument.
Definition: Stmt.h:3534
StringKind getKind() const
Definition: Expr.h:1801
An AddrLabelExpr record.
Definition: ASTBitCodes.h:1733
void setInc(Expr *E)
Definition: StmtCXX.h:197
void setOperatorLoc(SourceLocation L)
Definition: Expr.h:2415
CXXDeleteExprBitfields CXXDeleteExprBits
Definition: Stmt.h:999
void setNRVOCandidate(const VarDecl *Var)
Set the variable that might be used for the named return value optimization.
Definition: Stmt.h:2670
Defines enumerations for the type traits support.
void setLocation(SourceLocation L)
Definition: ExprCXX.h:664
A CXXStaticCastExpr record.
Definition: ASTBitCodes.h:1861
ASTStmtReader(ASTRecordReader &Record, llvm::BitstreamCursor &Cursor)
void setCombinedCond(Expr *CombCond)
Definition: StmtOpenMP.h:703
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2627
An AttributedStmt record.
Definition: ASTBitCodes.h:1595
A CXXReinterpretCastExpr record.
Definition: ASTBitCodes.h:1867
An ObjCBoolLiteralExpr record.
Definition: ASTBitCodes.h:1826
void setCombinedLowerBoundVariable(Expr *CombLB)
Definition: StmtOpenMP.h:683
void setRHS(Expr *E)
Definition: Expr.h:2478
static OMPTaskwaitDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:571
static OMPTargetParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:767
void setHasCancel(bool Has)
Set cancel state.
Definition: StmtOpenMP.h:1519
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:592
void setLastIteration(Expr *LI)
Definition: StmtOpenMP.h:590
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition: Expr.h:2664
IfStmt - This represents an if/then/else.
Definition: Stmt.h:1822
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:2752
This represents &#39;#pragma omp for simd&#39; directive.
Definition: StmtOpenMP.h:1342
void setOpcode(Opcode Opc)
Definition: Expr.h:3447
void setRParenLoc(SourceLocation L)
Definition: Stmt.h:2886
void setContinueLoc(SourceLocation L)
Definition: Stmt.h:2563
void setThrowExpr(Stmt *S)
Definition: StmtObjC.h:346
void setAtLoc(SourceLocation L)
Definition: ExprObjC.h:472
An ImplicitValueInitExpr record.
Definition: ASTBitCodes.h:1727
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:88
void setDeclGroup(DeclGroupRef DGR)
Definition: Stmt.h:1233
An ImplicitCastExpr record.
Definition: ASTBitCodes.h:1697
This represents &#39;#pragma omp teams distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:4025
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:5054
LambdaCaptureDefault
The default, if any, capture method for a lambda expression.
Definition: Lambda.h:22
void setType(QualType t)
Definition: Expr.h:138
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:3037
Defines the C++ template declaration subclasses.
void setPrevEnsureUpperBound(Expr *PrevEUB)
Definition: StmtOpenMP.h:678
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:4861
Represents an attribute applied to a statement.
Definition: Stmt.h:1764
void setUpperBoundVariable(Expr *UB)
Definition: StmtOpenMP.h:621
void setComputationResultType(QualType T)
Definition: Expr.h:3656
llvm::APFloat readAPFloat(const llvm::fltSemantics &Sem)
Read a floating-point value, advancing Idx.
Definition: ASTReader.h:2641
void setNumIterations(Expr *NI)
Definition: StmtOpenMP.h:656
ParenExpr - This represents a parethesized expression, e.g.
Definition: Expr.h:1969
A CXXOperatorCallExpr record.
Definition: ASTBitCodes.h:1843
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:4162
A CXXTemporaryObjectExpr record.
Definition: ASTBitCodes.h:1858
Represents Objective-C&#39;s @throw statement.
Definition: StmtObjC.h:332
void setNextLowerBound(Expr *NLB)
Definition: StmtOpenMP.h:642
DeclRefExprBitfields DeclRefExprBits
Definition: Stmt.h:971
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1422
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:845
void setADLCallKind(ADLCallKind V=UsesADL)
Definition: Expr.h:2645
unsigned NumOutputs
Definition: Stmt.h:2717
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent...
Definition: ExprCXX.h:2715
void setValue(bool V)
Definition: ExprObjC.h:98
A constant expression context.
Definition: ASTBitCodes.h:1640
const TargetInfo & getTargetInfo() const
Definition: ASTContext.h:706
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
Definition: Specifiers.h:113
A container of type source information.
Definition: Decl.h:86
void setSwitchCaseList(SwitchCase *SC)
Definition: Stmt.h:2158
Stmt * SubExpr
Definition: Expr.h:927
void setCanOverflow(bool C)
Definition: Expr.h:2065
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:323
This represents &#39;#pragma omp parallel for&#39; directive.
Definition: StmtOpenMP.h:1713
MS property subscript expression.
Definition: ExprCXX.h:937
void setStartLoc(SourceLocation L)
Definition: Stmt.h:1235
void setForLoc(SourceLocation L)
Definition: Stmt.h:2441
This represents &#39;#pragma omp target teams distribute parallel for&#39; combined directive.
Definition: StmtOpenMP.h:4230
static ObjCDictionaryLiteral * CreateEmpty(const ASTContext &C, unsigned NumElements, bool HasPackExpansions)
Definition: ExprObjC.cpp:104
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
Definition: ExprCXX.h:4419
void setLocation(SourceLocation L)
Definition: ExprObjC.h:590
void setDependentInits(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:82
void setDelegateInitCall(bool isDelegate)
Definition: ExprObjC.h:1414
void setProtocol(ObjCProtocolDecl *P)
Definition: ExprObjC.h:520
void setRParenLoc(SourceLocation L)
Definition: ExprCXX.h:3439
void setIsLastIterVariable(Expr *IL)
Definition: StmtOpenMP.h:607
This represents &#39;#pragma omp target exit data&#39; directive.
Definition: StmtOpenMP.h:2624
void setRAngleLoc(SourceLocation Loc)
Definition: TemplateBase.h:574
static OffsetOfExpr * CreateEmpty(const ASTContext &C, unsigned NumComps, unsigned NumExprs)
Definition: Expr.cpp:1560
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:827
static OMPParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:109
bool hasTemplateKWAndArgsInfo() const
Definition: Expr.h:1269
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:3269
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:3052
void setSubExpr(unsigned Idx, Expr *E)
Definition: Expr.h:4868
void setInitializer(Expr *E)
Definition: Expr.h:3080
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:2675
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
Definition: ExprCXX.h:2676
static FunctionParmPackExpr * CreateEmpty(const ASTContext &Context, unsigned NumParams)
Definition: ExprCXX.cpp:1650
void setAsmLoc(SourceLocation L)
Definition: Stmt.h:2734
AttributedStmtBitfields AttributedStmtBits
Definition: Stmt.h:955
QualType readType()
Read a type from the current position in the record.
Definition: ASTReader.h:2518
static PredefinedExpr * CreateEmpty(const ASTContext &Ctx, bool HasFunctionName)
Create an empty PredefinedExpr.
Definition: Expr.cpp:639
void setCombinedDistCond(Expr *CombDistCond)
Definition: StmtOpenMP.h:718
void setValue(unsigned Val)
Definition: Expr.h:1543
void setLocation(SourceLocation Location)
Definition: Expr.h:1488
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
Definition: TemplateBase.h:603
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition: ExprCXX.h:715
static DeclRefExpr * CreateEmpty(const ASTContext &Context, bool HasQualifier, bool HasFoundDecl, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Construct an empty declaration reference expression.
Definition: Expr.cpp:583
unsigned getNumPlacementArgs() const
Definition: ExprCXX.h:2236
void setGNUSyntax(bool GNU)
Definition: Expr.h:4846
Defines the Objective-C statement AST node classes.
A CXXConstructExpr record.
Definition: ASTBitCodes.h:1852
unsigned getNumExpressions() const
Definition: Expr.h:2320
void setBeginStmt(Stmt *S)
Definition: StmtCXX.h:194
void setBase(Expr *E)
Set base of the array section.
Definition: ExprOpenMP.h:84
ReceiverKind
The kind of receiver this message is sending to.
Definition: ExprObjC.h:1096
raw_arg_iterator raw_arg_begin()
Definition: ExprCXX.h:2328
A C++ throw-expression (C++ [except.throw]).
Definition: ExprCXX.h:1140
Represents an expression – generally a full-expression – that introduces cleanups to be run at the ...
Definition: ExprCXX.h:3306
void setInit(Expr *Init)
Definition: StmtOpenMP.h:602
Defines the clang::Expr interface and subclasses for C++ expressions.
void setThen(Stmt *Then)
Definition: Stmt.h:1914
void setTarget(Expr *E)
Definition: Stmt.h:2528
A ShuffleVectorExpr record.
Definition: ASTBitCodes.h:1748
A C++ static_cast expression (C++ [expr.static.cast]).
Definition: ExprCXX.h:409
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:1720
static OMPTargetExitDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:887
void setAtLoc(SourceLocation L)
Definition: ExprObjC.h:67
Represents a C99 designated initializer expression.
Definition: Expr.h:4611
An OffsetOfExpr record.
Definition: ASTBitCodes.h:1673
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:2573
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:1820
T * readDeclAs()
Reads a declaration from the given position in the record, advancing Idx.
Definition: ASTReader.h:2541
static OMPTargetDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:742
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(), or __builtin_FILE().
Definition: Expr.h:4267
A DesignatedInitExpr record.
Definition: ASTBitCodes.h:1712
This represents &#39;#pragma omp parallel&#39; directive.
Definition: StmtOpenMP.h:357
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition: Expr.h:3971
void setExprOperand(Expr *E)
Definition: ExprCXX.h:1051
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:160
A C++ nested-name-specifier augmented with source location information.
void setLHS(Expr *E)
Definition: Expr.h:2474
static OMPTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Internal struct for storing Key/value pair.
Definition: ExprObjC.h:284
static std::string toString(const clang::SanitizerSet &Sanitizers)
Produce a string containing comma-separated names of sanitizers in Sanitizers set.
void setKeyExpr(Stmt *S)
Definition: ExprObjC.h:894
static OMPTargetParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:818
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:4240
Represents a place-holder for an object not to be initialized by anything.
Definition: Expr.h:4909
static OMPFlushDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:660
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Definition: Expr.h:4182
void setArg(unsigned I, Expr *E)
Definition: ExprCXX.h:3475
void setArg(unsigned Arg, Expr *ArgExpr)
setArg - Set the specified argument.
Definition: Expr.h:2687
The iterator over UnresolvedSets.
Definition: UnresolvedSet.h:31
void setRParen(SourceLocation Loc)
Definition: Expr.h:1998
TemplateArgument readTemplateArgument(bool Canonicalize=false)
Read a template argument, advancing Idx.
Definition: ASTReader.h:2583
This represents &#39;#pragma omp target simd&#39; directive.
Definition: StmtOpenMP.h:3750
void setCapturedDecl(CapturedDecl *D)
Set the outlined function declaration.
Definition: Stmt.cpp:1300
void setReturnLoc(SourceLocation L)
Definition: Stmt.h:2677
Represents a C++ member access expression for which lookup produced a set of overloaded functions...
Definition: ExprCXX.h:3771
Defines some OpenMP-specific enums and functions.
void setCond(Expr *Cond)
Definition: Stmt.h:2095
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:5490
OpenMPDirectiveKind getDirectiveKind() const
Definition: StmtOpenMP.h:301
void setIfLoc(SourceLocation IfLoc)
Definition: Stmt.h:1982
This represents &#39;#pragma omp barrier&#39; directive.
Definition: StmtOpenMP.h:2044
void setComponent(unsigned Idx, OffsetOfNode ON)
Definition: Expr.h:2296
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:2503
unsigned getCharByteWidth() const
Definition: Expr.h:1799
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:419
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition: ExprCXX.h:4269
void setSubStmt(Stmt *S)
Definition: Stmt.h:1612
This represents &#39;#pragma omp critical&#39; directive.
Definition: StmtOpenMP.h:1639
static OMPCriticalDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:371
void setRParenLoc(SourceLocation L)
Definition: Expr.h:3952
void setCond(Expr *Cond)
Definition: StmtOpenMP.h:599
size_t size() const
The length of this record.
Definition: ASTReader.h:2404
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:943
Represents Objective-C&#39;s @catch statement.
Definition: StmtObjC.h:77
void setLBraceLoc(SourceLocation Loc)
Definition: Expr.h:4523
static OMPTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:961
IndirectGotoStmt - This represents an indirect goto.
Definition: Stmt.h:2504
Describes an C or C++ initializer list.
Definition: Expr.h:4375
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition: ExprCXX.h:764
This represents &#39;#pragma omp distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:3465
void setValue(const ASTContext &C, const llvm::APInt &Val)
Definition: Expr.h:1406
This represents &#39;#pragma omp teams distribute parallel for simd&#39; composite directive.
Definition: StmtOpenMP.h:3954
void setBuiltinLoc(SourceLocation L)
Definition: Expr.h:3990
BinaryOperatorKind
void setSubExpr(Expr *E)
Definition: Expr.h:1987
void setLHS(Expr *E)
Definition: Expr.h:4150
unsigned getLength() const
Definition: Expr.h:1798
ForStmt - This represents a &#39;for (init;cond;inc)&#39; stmt.
Definition: Stmt.h:2394
void setOperatorNew(FunctionDecl *D)
Definition: ExprCXX.h:2219
static DeclAccessPair make(NamedDecl *D, AccessSpecifier AS)
void setLocation(SourceLocation L)
Definition: ExprCXX.h:698
CXXScalarValueInitExprBitfields CXXScalarValueInitExprBits
Definition: Stmt.h:997
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:1577
void setEndLoc(SourceLocation L)
Definition: Stmt.h:1237
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
Definition: ExprCXX.h:1963
path_iterator path_begin()
Definition: Expr.h:3197
void setLocation(SourceLocation L)
Definition: ExprObjC.h:104
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: ExprCXX.h:3713
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3409
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:5513
CXXForRangeStmt - This represents C++0x [stmt.ranged]&#39;s ranged for statement, represented as &#39;for (ra...
Definition: StmtCXX.h:134
static OMPParallelMasterTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
llvm::Error Error
SourceRange readSourceRange()
Read a source range, advancing Idx.
Definition: ASTReader.h:2624
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:2879
void setString(StringLiteral *S)
Definition: ExprObjC.h:64
void setAsmString(StringLiteral *E)
Definition: Stmt.h:2892
ObjCStringLiteral, used for Objective-C string literals i.e.
Definition: ExprObjC.h:50
CaseStmt - Represent a case statement.
Definition: Stmt.h:1488
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
Definition: Expr.h:5936
void setCombinedInit(Expr *CombInit)
Definition: StmtOpenMP.h:698
void setLHS(Expr *Val)
Definition: Stmt.h:1585
This represents &#39;#pragma omp teams&#39; directive.
Definition: StmtOpenMP.h:2822
void setOperatorLoc(SourceLocation L)
Definition: Expr.h:2278
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:3125
Helper class for OffsetOfExpr.
Definition: Expr.h:2138
A marker record that indicates that we are at the end of an expression.
Definition: ASTBitCodes.h:1571
void setInit(Stmt *Init)
Definition: Stmt.h:2118
This represents &#39;#pragma omp teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:3884
static OMPTargetParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Represents binding an expression to a temporary.
Definition: ExprCXX.h:1373
void setDestroyedType(IdentifierInfo *II, SourceLocation Loc)
Set the name of destroyed type for a dependent pseudo-destructor expression.
Definition: ExprCXX.h:2593
ArrayTypeTrait
Names for the array type traits.
Definition: TypeTraits.h:90
const llvm::fltSemantics & getSemantics() const
Return the APFloat semantics this literal uses.
Definition: Expr.h:1594
bool isOpenMPWorksharingDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a worksharing directive.
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition: ExprCXX.h:1818
static OMPTaskyieldDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:543
void setCond(Expr *E)
Definition: Stmt.h:2436
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:925
void setOpcode(Opcode Opc)
Definition: Expr.h:2049
void ReadTemplateKWAndArgsInfo(ASTTemplateKWAndArgsInfo &Args, TemplateArgumentLoc *ArgsLocArray, unsigned NumTemplateArgs)
Read and initialize a ExplicitTemplateArgumentList structure.
DeclAccessPair * getTrailingResults()
Return the results. Defined after UnresolvedMemberExpr.
Definition: ExprCXX.h:3925
const ASTTemplateArgumentListInfo * readASTTemplateArgumentListInfo()
Definition: ASTReader.h:2498
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3511
void setRParenLoc(SourceLocation Loc)
Definition: StmtObjC.h:55
CXXBaseSpecifier readCXXBaseSpecifier()
Read a C++ base specifier, advancing Idx.
Definition: ASTReader.h:2605
void setRParenLoc(SourceLocation R)
Definition: Expr.h:2282
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1202
bool isTypeOperand() const
Definition: ExprCXX.h:1029
const uint64_t & peekInt()
Returns the current value in this record, without advancing.
Definition: ASTReader.h:2417
void setSourceRange(SourceRange R)
Definition: ExprCXX.h:1062
unsigned NumClobbers
Definition: Stmt.h:2719
void setRParenLoc(SourceLocation L)
Definition: Expr.h:3376
Represents the this expression in C++.
Definition: ExprCXX.h:1097
void setCastKind(CastKind K)
Definition: Expr.h:3172
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:842
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:970
void setEqualOrColonLoc(SourceLocation L)
Definition: Expr.h:4837
This represents &#39;#pragma omp target parallel for simd&#39; directive.
Definition: StmtOpenMP.h:3682
void setDependentCounters(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:75
void setArgument(Expr *E)
Definition: Expr.h:2399
OpenMP 4.0 [2.4, Array Sections].
Definition: ExprOpenMP.h:44
void setTypeSourceInfo(TypeSourceInfo *tsi)
Definition: Expr.h:2287
ConditionalOperator - The ?: ternary operator.
Definition: Expr.h:3707
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:2479
void setAmpAmpLoc(SourceLocation L)
Definition: Expr.h:3897
void setBreakLoc(SourceLocation L)
Definition: Stmt.h:2593
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
Definition: ExprCXX.h:3931
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:1320
void setBlockDecl(BlockDecl *BD)
Definition: Expr.h:5567
This represents &#39;#pragma omp taskgroup&#39; directive.
Definition: StmtOpenMP.h:2132
static OMPSingleDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:328
CastKind
CastKind - The kind of operation required for a conversion.
void setSemiLoc(SourceLocation L)
Definition: Stmt.h:1297
void setSubExpr(Expr *E)
Definition: Expr.h:2052
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
Definition: Expr.h:2347
void setLParen(SourceLocation Loc)
Definition: Expr.h:1994
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition: Expr.h:953
Represents a call to the builtin function __builtin_va_arg.
Definition: Expr.h:4216
static OMPTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:911
void setLeaveLoc(SourceLocation L)
Definition: Stmt.h:3332
void setConditionVariable(const ASTContext &Ctx, VarDecl *V)
Set the condition variable for this if statement.
Definition: Stmt.cpp:893
This represents &#39;#pragma omp distribute&#39; directive.
Definition: StmtOpenMP.h:3338
SubstNonTypeTemplateParmExprBitfields SubstNonTypeTemplateParmExprBits
Definition: Stmt.h:1010
void setInits(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:57
void setOperatorDelete(FunctionDecl *D)
Definition: ExprCXX.h:2221
void setRParenLoc(SourceLocation L)
Definition: Stmt.h:2372
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type...
Definition: ExprCXX.h:2053
void setLocation(SourceLocation Location)
Definition: Expr.h:1541
void setRParenLoc(SourceLocation Loc)
Definition: StmtObjC.h:108
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition: Decl.h:3951
static OMPSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:151
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:644
This represents one expression.
Definition: Expr.h:108
Defines the clang::LangOptions interface.
CXXRewrittenBinaryOperatorBitfields CXXRewrittenBinaryOperatorBits
Definition: Stmt.h:990
void setDesignators(const ASTContext &C, const Designator *Desigs, unsigned NumDesigs)
Definition: Expr.cpp:4318
void setRBraceLoc(SourceLocation Loc)
Definition: Expr.h:4525
void setInit(Stmt *Init)
Definition: Stmt.h:1975
void setIsImplicit(bool value=true)
Definition: ExprCXX.h:4732
SourceLocation End
void setWhileLoc(SourceLocation L)
Definition: Stmt.h:2312
void setCallee(Expr *F)
Definition: Expr.h:2640
void setRParenLoc(SourceLocation L)
Definition: Expr.h:3993
void setLParenLoc(SourceLocation L)
Definition: Stmt.h:2443
void setBase(Expr *Base)
Definition: Expr.h:4965
Stmt * ReadStmt(ModuleFile &F)
Reads a statement.
static CXXMemberCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, EmptyShell Empty)
Definition: ExprCXX.cpp:707
This represents &#39;#pragma omp master taskloop&#39; directive.
Definition: StmtOpenMP.h:3134
static OMPMasterTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setSyntacticForm(InitListExpr *Init)
Definition: Expr.h:4538
Represents a C++ functional cast expression that builds a temporary object.
Definition: ExprCXX.h:1750
static ReturnStmt * CreateEmpty(const ASTContext &Ctx, bool HasNRVOCandidate)
Create an empty return statement, optionally with storage for an NRVO candidate.
Definition: Stmt.cpp:1094
void setRBracketLoc(SourceLocation L)
Definition: ExprOpenMP.h:112
A C++ const_cast expression (C++ [expr.const.cast]).
Definition: ExprCXX.h:527
void setTypeDependent(bool TD)
Set whether this expression is type-dependent or not.
Definition: Expr.h:179
void setTypeOperandSourceInfo(TypeSourceInfo *TSI)
Definition: ExprCXX.h:1041
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:5551
Field designator where only the field name is known.
Definition: ASTBitCodes.h:2008
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:4314
void setRHS(Expr *E)
Definition: Expr.h:3452
void setInc(Expr *E)
Definition: Stmt.h:2437
raw_arg_iterator raw_arg_end()
Definition: ExprCXX.h:2329
static CXXReinterpretCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
Definition: ExprCXX.cpp:875
#define bool
Definition: stdbool.h:15
void setUuidStr(StringRef US)
Definition: ExprCXX.h:1056
void setWrittenTypeInfo(TypeSourceInfo *TI)
Definition: Expr.h:4243
void setRetValue(Expr *E)
Definition: Stmt.h:2655
void setBody(Stmt *S)
Definition: Stmt.h:2438
unsigned getNumTemplateArgs() const
Definition: ExprCXX.h:3003
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
Definition: ExprObjC.h:304
ExprBitfields ExprBits
Definition: Stmt.h:968
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:1237
void setBody(Stmt *Body)
Definition: Stmt.h:2104
static UserDefinedLiteral * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, EmptyShell Empty)
Definition: ExprCXX.cpp:947
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:1879
void setFinallyBody(Stmt *S)
Definition: StmtObjC.h:141
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:4091
CXXTryStmt - A C++ try block, including all handlers.
Definition: StmtCXX.h:68
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Definition: Expr.h:5600
An ArraySubscriptExpr record.
Definition: ASTBitCodes.h:1679
Decl * readDecl()
Reads a declaration from the given position in a record in the given module, advancing Idx...
Definition: ASTReader.h:2531
static FloatingLiteral * Create(const ASTContext &C, const llvm::APFloat &V, bool isexact, QualType Type, SourceLocation L)
Definition: Expr.cpp:981
This represents &#39;#pragma omp target teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:4387
CXXDefaultInitExprBitfields CXXDefaultInitExprBits
Definition: Stmt.h:996
Information about a module that has been loaded by the ASTReader.
Definition: Module.h:107
ExprWithCleanupsBitfields ExprWithCleanupsBits
Definition: Stmt.h:1003
An ArrayInitLoopExpr record.
Definition: ASTBitCodes.h:1721
unsigned getNumClauses() const
Get number of clauses.
Definition: StmtOpenMP.h:241
A PseudoObjectExpr record.
Definition: ASTBitCodes.h:1760
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:2799
CompoundStmtBitfields CompoundStmtBits
Definition: Stmt.h:953
An ObjCIndirectCopyRestoreExpr record.
Definition: ASTBitCodes.h:1802
This represents &#39;#pragma omp for&#39; directive.
Definition: StmtOpenMP.h:1265
IdentifierInfo * getIdentifierInfo()
Definition: ASTReader.h:2545
static OMPTargetEnterDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
Definition: StmtOpenMP.cpp:865
void setValueKind(ExprValueKind Cat)
setValueKind - Set the value kind produced by this expression.
Definition: Expr.h:431
StringLiteralBitfields StringLiteralBits
Definition: Stmt.h:973
void setRParenLoc(SourceLocation L)
Definition: ExprObjC.h:526
bool hasInitializer() const
Whether this new-expression has any initializer at all.
Definition: ExprCXX.h:2262
Represents a folding of a pack over an operator.
Definition: ExprCXX.h:4535
void setEndStmt(Stmt *S)
Definition: StmtCXX.h:195
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
Definition: Stmt.h:2620
This represents &#39;#pragma omp target teams&#39; directive.
Definition: StmtOpenMP.h:4103
void setAssociatedStmt(Stmt *S)
Set the associated statement for the directive.
Definition: StmtOpenMP.h:85
static OMPDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
An expression that sends a message to the given Objective-C object or class.
Definition: ExprObjC.h:950
void setBody(Stmt *Body)
Definition: Stmt.h:2276
This represents a Microsoft inline-assembly statement extension.
Definition: Stmt.h:3085
void setColonLoc(SourceLocation L)
Definition: Stmt.h:1470
void setIsArrow(bool A)
Definition: ExprObjC.h:586
void setRParenLoc(SourceLocation L)
Definition: Expr.h:4158
A DesignatedInitUpdateExpr record.
Definition: ASTBitCodes.h:1715
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:2021
bool isOpenMPTaskLoopDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a taskloop directive.
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
Definition: ExprObjC.h:1234
A member reference to an MSPropertyDecl.
Definition: ExprCXX.h:863
static OMPParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:474
static UnresolvedLookupExpr * CreateEmpty(const ASTContext &Context, unsigned NumResults, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition: ExprCXX.cpp:435
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition: ExprCXX.h:4209
void setForLoc(SourceLocation Loc)
Definition: StmtObjC.h:53
This represents &#39;#pragma omp cancel&#39; directive.
Definition: StmtOpenMP.h:2937
void setDistInc(Expr *DistInc)
Definition: StmtOpenMP.h:673
void setBase(Expr *base)
Definition: ExprObjC.h:582
ValueDecl * getDecl()
Definition: Expr.h:1222
An ObjCAvailabilityCheckExpr record.
Definition: ASTBitCodes.h:1829
void setRParenLoc(SourceLocation L)
Definition: ExprObjC.h:473
std::string readString()
Read a string, advancing Idx.
Definition: ASTReader.h:2646
void setConditionVariable(const ASTContext &Ctx, VarDecl *V)
Set the condition variable of this while statement.
Definition: Stmt.cpp:1050
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:3346
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:2420
This file defines OpenMP AST classes for clauses.
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1...
Definition: Expr.h:1637
An ObjCForCollectionStmt record.
Definition: ASTBitCodes.h:1805
This represents &#39;#pragma omp flush&#39; directive.
Definition: StmtOpenMP.h:2205
This represents &#39;#pragma omp parallel for simd&#39; directive.
Definition: StmtOpenMP.h:1793
void setRParenLoc(SourceLocation L)
Definition: Expr.h:4249
void setAtTryLoc(SourceLocation Loc)
Definition: StmtObjC.h:205
DoStmt - This represents a &#39;do/while&#39; stmt.
Definition: Stmt.h:2338
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
Definition: Stmt.h:2703
void setTypeOperandSourceInfo(TypeSourceInfo *TSI)
Definition: ExprCXX.h:816
void setBody(Stmt *S)
Definition: StmtCXX.h:199
A MS-style AsmStmt record.
Definition: ASTBitCodes.h:1637
void setConditionVariable(const ASTContext &Ctx, VarDecl *VD)
Set the condition variable in this switch statement.
Definition: Stmt.cpp:994
void setLocStart(SourceLocation Loc)
Set starting location of directive kind.
Definition: StmtOpenMP.h:233
OpaqueValueExprBitfields OpaqueValueExprBits
Definition: Stmt.h:1019
static OMPParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:423
This represents &#39;#pragma omp parallel master taskloop&#39; directive.
Definition: StmtOpenMP.h:3270
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:2565
void setUpdates(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:63
void setLowerBoundVariable(Expr *LB)
Definition: StmtOpenMP.h:614
This represents &#39;#pragma omp master taskloop simd&#39; directive.
Definition: StmtOpenMP.h:3202
void setLParenLoc(SourceLocation L)
Definition: ExprCXX.h:1720
void setTypeSourceInfo(TypeSourceInfo *tinfo)
Definition: Expr.h:3091
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Definition: ExprCXX.h:445
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
Definition: Expr.h:1050
void setComputationLHSType(QualType T)
Definition: Expr.h:3653
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition: Expr.h:4039
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:305
void setDecl(LabelDecl *D)
Definition: Stmt.h:1738
Kind
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr...
Definition: ExprCXX.h:2844
A field in a dependent type, known only by its name.
Definition: Expr.h:2147
This captures a statement into a function.
Definition: Stmt.h:3360
Represents a call to an inherited base class constructor from an inheriting constructor.
Definition: ExprCXX.h:1613
unsigned path_size() const
Definition: Expr.h:3196
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition: Expr.h:5673
void setLParenLoc(SourceLocation L)
Definition: Expr.h:3373
void setSubStmt(Stmt *S)
Definition: Stmt.h:1657
void setAccessorLoc(SourceLocation L)
Definition: Expr.h:5516
void setGotoLoc(SourceLocation L)
Definition: Stmt.h:2519
static CXXDynamicCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
Definition: ExprCXX.cpp:817
CXXTemporary * readCXXTemporary()
Definition: ASTReader.h:2614
unsigned getNumExprs() const
Return the number of expressions in this paren list.
Definition: Expr.h:5141
void setLocation(SourceLocation L)
Definition: Expr.h:1231
This represents &#39;#pragma omp single&#39; directive.
Definition: StmtOpenMP.h:1537
Encodes a location in the source.
void setLocation(SourceLocation L)
Definition: Expr.h:1931
void setPrevLowerBoundVariable(Expr *PrevLB)
Definition: StmtOpenMP.h:663
void setIterationVariable(Expr *IV)
Definition: StmtOpenMP.h:587
Defines enumerations for expression traits intrinsics.
PseudoObjectExprBitfields PseudoObjectExprBits
Definition: Stmt.h:985
Stmt * readSubStmt()
Reads a sub-statement operand during statement reading.
Definition: ASTReader.h:2471
static CXXOperatorCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, EmptyShell Empty)
Definition: ExprCXX.cpp:649
UnresolvedLookupExprBitfields UnresolvedLookupExprBits
Definition: Stmt.h:1007
unsigned getNumHandlers() const
Definition: StmtCXX.h:106
void setUpdater(Expr *Updater)
Definition: Expr.h:4970
CXXThrowExprBitfields CXXThrowExprBits
Definition: Stmt.h:994
static OMPTaskDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:525
This is a basic class for representing single OpenMP executable directive.
Definition: StmtOpenMP.h:33
static OMPTargetUpdateDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setDoLoc(SourceLocation L)
Definition: Stmt.h:2368
static CXXConstCastExpr * CreateEmpty(const ASTContext &Context)
Definition: ExprCXX.cpp:889
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
Definition: ExprCXX.h:2100
void setCombinedNextLowerBound(Expr *CombNLB)
Definition: StmtOpenMP.h:708
void setAtCatchLoc(SourceLocation Loc)
Definition: StmtObjC.h:106
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c dictionary literal.
Definition: ExprObjC.h:358
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit...
Definition: ExprCXX.h:564
void setSourceRange(SourceRange R)
Definition: ExprCXX.h:834
Represents a C++2a __builtin_bit_cast(T, v) expression.
Definition: ExprCXX.h:4818
static ObjCAtTryStmt * CreateEmpty(const ASTContext &Context, unsigned NumCatchStmts, bool HasFinally)
Definition: StmtObjC.cpp:57
void setConstexpr(bool C)
Definition: Stmt.h:1996
Represents a call to a member function that may be written either with member call syntax (e...
Definition: ExprCXX.h:171
static StringLiteral * CreateEmpty(const ASTContext &Ctx, unsigned NumConcatenated, unsigned Length, unsigned CharByteWidth)
Construct an empty string literal.
Definition: Expr.cpp:1092
void setIdentLoc(SourceLocation L)
Definition: Stmt.h:1735
GenericSelectionExprBitfields GenericSelectionExprBits
Definition: Stmt.h:984
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:1213
void setInit(Stmt *S)
Definition: StmtCXX.h:191
void setLabelLoc(SourceLocation L)
Definition: Expr.h:3899
void readDeclarationNameInfo(DeclarationNameInfo &NameInfo)
Definition: ASTReader.h:2561
A CXXFunctionalCastExpr record.
Definition: ASTBitCodes.h:1873
void setTemporary(CXXTemporary *T)
Definition: ExprCXX.h:1394
static ExprWithCleanups * Create(const ASTContext &C, EmptyShell empty, unsigned numObjects)
Definition: ExprCXX.cpp:1345
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:2177
Expr * readSubExpr()
Reads a sub-expression operand during statement reading.
Definition: ASTReader.h:2474
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:1775
static OMPAtomicDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:716
This represents &#39;#pragma omp taskwait&#39; directive.
Definition: StmtOpenMP.h:2088
void setLHS(Expr *E)
Definition: Expr.h:3450
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:5807
void readDeclarationNameLoc(DeclarationNameLoc &DNLoc, DeclarationName Name)
Definition: ASTReader.h:2558
void setFinalsConditions(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:88
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:2250
bool isArray() const
Definition: ExprCXX.h:2223
static OMPOrderedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:685
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:1036
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:1224
void setThrowLoc(SourceLocation Loc)
Definition: StmtObjC.h:349
unsigned getIdx() const
The current position in this record.
Definition: ASTReader.h:2401
An ObjCIsa Expr record.
Definition: ASTBitCodes.h:1799
ASTContext & getContext()
Retrieve the AST context that this AST reader supplements.
Definition: ASTReader.h:2398
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:3249
Stmt * getCapturedStmt()
Retrieve the statement being captured.
Definition: Stmt.h:3461
This represents &#39;#pragma omp target&#39; directive.
Definition: StmtOpenMP.h:2449
static OMPTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setSubExpr(Expr *E)
Definition: ExprCXX.h:1398
static DesignatedInitExpr * CreateEmpty(const ASTContext &C, unsigned NumIndexExprs)
Definition: Expr.cpp:4311
static DeclGroup * Create(ASTContext &C, Decl **Decls, unsigned NumDecls)
Definition: DeclGroup.cpp:20
bool isParenTypeId() const
Definition: ExprCXX.h:2253
static OMPTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setBaseExpr(Stmt *S)
Definition: ExprObjC.h:891
NullStmtBitfields NullStmtBits
Definition: Stmt.h:952
An expression trait intrinsic.
Definition: ExprCXX.h:2785
void setEncodedTypeSourceInfo(TypeSourceInfo *EncType)
Definition: ExprObjC.h:432
static CXXDependentScopeMemberExpr * CreateEmpty(const ASTContext &Ctx, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs, bool HasFirstQualifierFoundInScope)
Definition: ExprCXX.cpp:1466
An AtomicExpr record.
Definition: ASTBitCodes.h:1763
This represents &#39;#pragma omp ordered&#39; directive.
Definition: StmtOpenMP.h:2260
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition: Expr.h:3926
void setCond(Expr *E)
Definition: StmtCXX.h:196
static SizeOfPackExpr * CreateDeserialized(ASTContext &Context, unsigned NumPartialArgs)
Definition: ExprCXX.cpp:1607
This represents &#39;#pragma omp target update&#39; directive.
Definition: StmtOpenMP.h:3406
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:124
MemberExprBitfields MemberExprBits
Definition: Stmt.h:979
void setSubExpr(Expr *E)
Definition: Expr.h:4236
void setLAngleLoc(SourceLocation Loc)
Definition: TemplateBase.h:573
void sawArrayRangeDesignator(bool ARD=true)
Definition: Expr.h:4548
static CXXTemporaryObjectExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs)
Definition: ExprCXX.cpp:1051
void addArgument(const TemplateArgumentLoc &Loc)
Definition: TemplateBase.h:594
void setCapturedRecordDecl(RecordDecl *D)
Set the record declaration for captured variables.
Definition: Stmt.h:3481
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:1044
void setSimple(bool V)
Definition: Stmt.h:2737
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:3155
void setRBracketLoc(SourceLocation L)
Definition: ExprCXX.h:976
void readAttributes(AttrVec &Attrs)
Reads attributes from the current stream position, advancing Idx.
Definition: ASTReader.h:2666
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:3629
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:5206
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition: Expr.h:3882
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers...
Definition: ExprObjC.h:1638
Represents a reference to a function parameter pack or init-capture pack that has been substituted bu...
Definition: ExprCXX.h:4337
Represents a template argument.
Definition: TemplateBase.h:50
void setGotoLoc(SourceLocation L)
Definition: Stmt.h:2482
void setPrevUpperBoundVariable(Expr *PrevUB)
Definition: StmtOpenMP.h:668
static CXXUnresolvedConstructExpr * CreateEmpty(const ASTContext &Context, unsigned NumArgs)
Definition: ExprCXX.cpp:1386
void setCombinedEnsureUpperBound(Expr *CombEUB)
Definition: StmtOpenMP.h:693
static OMPForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:203
void setLocation(SourceLocation L)
Definition: Expr.h:1614
NullStmt - This is the null statement ";": C99 6.8.3p3.
Definition: Stmt.h:1285
void setCounters(ArrayRef< Expr *> A)
Definition: StmtOpenMP.cpp:44
bool isTypeOperand() const
Definition: ExprCXX.h:804
unsigned getNumAssocs() const
The number of association expressions.
Definition: Expr.h:5374
Dataflow Directional Tag Classes.
static GenericSelectionExpr * CreateEmpty(const ASTContext &Context, unsigned NumAssocs)
Create an empty generic selection expression for deserialization.
Definition: Expr.cpp:4213
void setExtendingDecl(const ValueDecl *ExtendedBy, unsigned ManglingNumber)
Definition: ExprCXX.cpp:1656
An InitListExpr record.
Definition: ASTBitCodes.h:1709
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:4155
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:1878
UnaryOperatorKind
void setValue(bool V)
Definition: ExprCXX.h:658
A CXXBoolLiteralExpr record.
Definition: ASTBitCodes.h:1882
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
Definition: ExprCXX.h:2359
void setCombinedUpperBoundVariable(Expr *CombUB)
Definition: StmtOpenMP.h:688
void setRParenLoc(SourceLocation L)
Definition: Expr.h:2765
static CapturedStmt * CreateDeserialized(const ASTContext &Context, unsigned NumCaptures)
Definition: Stmt.cpp:1269
An ExtVectorElementExpr record.
Definition: ASTBitCodes.h:1706
void setLabel(LabelDecl *L)
Definition: Expr.h:3905
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:3331
This represents &#39;#pragma omp section&#39; directive.
Definition: StmtOpenMP.h:1475
void setAtLoc(SourceLocation L)
Definition: ExprObjC.h:525
This represents &#39;#pragma omp teams distribute&#39; directive.
Definition: StmtOpenMP.h:3816
void setIsUnique(bool V)
Definition: Expr.h:1110
Selector readSelector()
Read a selector from the Record, advancing Idx.
Definition: ASTReader.h:2550
Expr * ReadExpr(ModuleFile &F)
Reads an expression.
void setSubExpr(Expr *E)
Definition: Expr.h:1651
void setExprs(const ASTContext &C, ArrayRef< Expr *> Exprs)
Definition: Expr.cpp:4122
void setSubExpr(Expr *E)
Definition: Expr.h:3179
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:3083
void setExact(bool E)
Definition: Expr.h:1606
A runtime availability query.
Definition: ExprObjC.h:1699
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
Definition: ExprCXX.h:487
This represents &#39;#pragma omp simd&#39; directive.
Definition: StmtOpenMP.h:1200
Represents a &#39;co_yield&#39; expression.
Definition: ExprCXX.h:4792
An ObjCAutoreleasePoolStmt record.
Definition: ASTBitCodes.h:1823
The name of a declaration.
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition: ExprCXX.h:4015
A CXXDynamicCastExpr record.
Definition: ASTBitCodes.h:1864
static LambdaExpr * CreateDeserialized(const ASTContext &C, unsigned NumCaptures)
Construct a new lambda expression that will be deserialized from an external source.
Definition: ExprCXX.cpp:1232
static PseudoObjectExpr * Create(const ASTContext &Context, Expr *syntactic, ArrayRef< Expr *> semantic, unsigned resultIndex)
Definition: Expr.cpp:4484
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:1570
Kind
The kind of offsetof node we have.
Definition: Expr.h:2141
TemplateArgumentLoc readTemplateArgumentLoc()
Reads a TemplateArgumentLoc, advancing Idx.
Definition: ASTReader.h:2493
void setLParenLoc(SourceLocation L)
Definition: Expr.h:3950
void setSelector(Selector S)
Definition: ExprObjC.h:1351
ExplicitCastExpr - An explicit cast written in the source code.
Definition: Expr.h:3312
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:2315
static CompoundStmt * CreateEmpty(const ASTContext &C, unsigned NumStmts)
Definition: Stmt.cpp:325
pack_iterator pack_begin() const
Iterator referencing the first argument of a template argument pack.
Definition: TemplateBase.h:339
void setImplicit(bool I)
Definition: ExprCXX.h:1119
An ObjCAtFinallyStmt record.
Definition: ASTBitCodes.h:1811
VersionTuple readVersionTuple()
Read a version tuple, advancing Idx.
Definition: ASTReader.h:2656
CXXNewExprBitfields CXXNewExprBits
Definition: Stmt.h:998
Represents a __leave statement.
Definition: Stmt.h:3321
unsigned getCollapsedNumber() const
Get number of collapsed loops.
Definition: StmtOpenMP.h:911
unsigned getNumSubExprs() const
Definition: Expr.h:5872
void setRBracketLoc(SourceLocation L)
Definition: Expr.h:2494
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition: ExprCXX.h:3958
SwitchStmt - This represents a &#39;switch&#39; stmt.
Definition: Stmt.h:2027
CXXConstructExprBitfields CXXConstructExprBits
Definition: Stmt.h:1002
static OMPForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:255
Represents the body of a coroutine.
Definition: StmtCXX.h:317
void setElement(Stmt *S)
Definition: StmtObjC.h:46
TemplateArgumentLoc * getTrailingTemplateArgumentLoc()
Return the optional template arguments.
Definition: ExprCXX.h:3941
Location wrapper for a TemplateArgument.
Definition: TemplateBase.h:449
bool isOpenMPDistributeDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a distribute directive.
static const unsigned NumExprFields
The number of record fields required for the Expr class itself.
void setCatchStmt(unsigned I, ObjCAtCatchStmt *S)
Set a particular catch statement.
Definition: StmtObjC.h:229
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition: Expr.h:2437
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:557
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:1743
void setRHS(Expr *Val)
Definition: Stmt.h:1601
An ObjCAtSynchronizedStmt record.
Definition: ASTBitCodes.h:1817
unsigned getNumObjects() const
Definition: ExprCXX.h:3337
void setIndexExpr(unsigned Idx, Expr *E)
Definition: Expr.h:2315
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:407
void setVolatile(bool V)
Definition: Stmt.h:2740
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:2150
Represents a call to a CUDA kernel function.
Definition: ExprCXX.h:224
Represents a &#39;co_await&#39; expression.
Definition: ExprCXX.h:4705
TypeTraitExprBitfields TypeTraitExprBits
Definition: Stmt.h:1000
static ImplicitCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
Definition: Expr.cpp:2000
void setSwitchLoc(SourceLocation L)
Definition: Stmt.h:2161
A CXXMemberCallExpr record.
Definition: ASTBitCodes.h:1846
void setAtFinallyLoc(SourceLocation Loc)
Definition: StmtObjC.h:149
void setArg(unsigned Arg, Expr *ArgExpr)
Set the specified argument.
Definition: ExprCXX.h:1583
void setKind(UnaryExprOrTypeTrait K)
Definition: Expr.h:2381
void setRParenLoc(SourceLocation L)
Definition: Expr.h:2418
static ConstantExpr * CreateEmpty(const ASTContext &Context, ResultStorageKind StorageKind, EmptyShell Empty)
Definition: Expr.cpp:304
void setRHS(Expr *E)
Definition: Expr.h:4152
void setOperatorLoc(SourceLocation L)
Definition: Expr.h:3442
void setBody(Stmt *Body)
Definition: Stmt.h:2365
void setValue(const ASTContext &C, const llvm::APFloat &Val)
Definition: Expr.h:1575
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:909
bool hasAssociatedStmt() const
Returns true if directive has associated statement.
Definition: StmtOpenMP.h:250
void setLParenLoc(SourceLocation L)
Definition: Expr.h:3086
The template argument is actually a parameter pack.
Definition: TemplateBase.h:90
Represents a base class of a C++ class.
Definition: DeclCXX.h:147
void setRParenLoc(SourceLocation L)
Definition: ExprObjC.h:426
unsigned getNumClobbers() const
Definition: Stmt.h:2784
static OMPTargetTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:546
void setAtSynchronizedLoc(SourceLocation Loc)
Definition: StmtObjC.h:295
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof...
Definition: ExprCXX.h:4179
void setElseLoc(SourceLocation ElseLoc)
Definition: Stmt.h:1989
void setOperatorLoc(SourceLocation L)
Definition: Expr.h:2056
void setLocation(SourceLocation Location)
Definition: Expr.h:1449
A ConvertVectorExpr record.
Definition: ASTBitCodes.h:1751
unsigned arg_size() const
Retrieve the number of arguments.
Definition: ExprCXX.h:3447
void setStarLoc(SourceLocation L)
Definition: Stmt.h:2521
void setLParenLoc(SourceLocation L)
Definition: ExprCXX.h:3434
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:3390
GotoStmt - This represents a direct goto.
Definition: Stmt.h:2465
A use of a default initializer in a constructor or in aggregate initialization.
Definition: ExprCXX.h:1279
static CStyleCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
Definition: Expr.cpp:2022
void setLocation(SourceLocation L)
Definition: ExprCXX.h:1113
void setCond(Expr *Cond)
Definition: Stmt.h:2361
CapturedDecl * getCapturedDecl()
Retrieve the outlined function declaration.
Definition: Stmt.cpp:1291
void setBuiltinLoc(SourceLocation L)
Definition: Expr.h:4246
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:2811
GNU array range designator.
Definition: ASTBitCodes.h:2018
void setBase(Expr *E)
Definition: Expr.h:5510
Defines the clang::SourceLocation class and associated facilities.
An ArrayInitIndexExpr record.
Definition: ASTBitCodes.h:1724
A GCC-style AsmStmt record.
Definition: ASTBitCodes.h:1634
This represents &#39;#pragma omp target parallel&#39; directive.
Definition: StmtOpenMP.h:2682
void setStrideVariable(Expr *ST)
Definition: StmtOpenMP.h:628
static MemberExpr * CreateEmpty(const ASTContext &Context, bool HasQualifier, bool HasFoundDecl, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Definition: Expr.cpp:1718
ContinueStmt - This represents a continue.
Definition: Stmt.h:2553
static CXXStaticCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
Definition: ExprCXX.cpp:792
Represents a loop initializing the elements of an array.
Definition: Expr.h:4999
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:4102
static OMPParallelSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:501
CXXDefaultArgExprBitfields CXXDefaultArgExprBits
Definition: Stmt.h:995
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Definition: Expr.h:3780
CXXCatchStmt - This represents a C++ catch block.
Definition: StmtCXX.h:28
An index into an array.
Definition: Expr.h:2143
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr.type.conv]).
Definition: ExprCXX.h:1688
An ObjCAtCatchStmt record.
Definition: ASTBitCodes.h:1808
static TypeTraitExpr * CreateDeserialized(const ASTContext &C, unsigned NumArgs)
Definition: ExprCXX.cpp:1713
Expr * ReadSubExpr()
Reads a sub-expression operand during statement reading.
WhileStmt - This represents a &#39;while&#39; stmt.
Definition: Stmt.h:2210
CXXOperatorCallExprBitfields CXXOperatorCallExprBits
Definition: Stmt.h:989
Represents the specialization of a concept - evaluates to a prvalue of type bool. ...
Definition: ExprCXX.h:4849
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:877
void initializeFrom(SourceLocation TemplateKWLoc, const TemplateArgumentListInfo &List, TemplateArgumentLoc *OutArgArray)
Field designator where the field has been resolved to a declaration.
Definition: ASTBitCodes.h:2012
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:1828
static CXXNewExpr * CreateEmpty(const ASTContext &Ctx, bool IsArray, bool HasInit, unsigned NumPlacementArgs, bool IsParenTypeId)
Create an empty c++ new expression.
Definition: ExprCXX.cpp:280
static ParenListExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumExprs)
Create an empty paren list.
Definition: Expr.cpp:4452
A CXXInheritedCtorInitExpr record.
Definition: ASTBitCodes.h:1855
void setExprOperand(Expr *E)
Definition: ExprCXX.h:826
void setPreArg(unsigned I, Stmt *PreArg)
Definition: Expr.h:2597
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:1928
This represents &#39;#pragma omp taskloop simd&#39; directive.
Definition: StmtOpenMP.h:3067
void setTokenLocation(SourceLocation L)
Definition: Expr.h:4197
static OMPSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Definition: StmtOpenMP.cpp:282
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:1686
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2521
llvm::APInt readAPInt()
Read an integral value, advancing Idx.
Definition: ASTReader.h:2631
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:2374
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:596
RetTy Visit(PTR(Stmt) S, ParamTys... P)
Definition: StmtVisitor.h:42
void setRParenLoc(SourceLocation L)
Definition: Stmt.h:2445
SourceLocExprBitfields SourceLocExprBits
Definition: Stmt.h:986
void reserveInits(const ASTContext &C, unsigned NumInits)
Reserve space for some number of initializers.
Definition: Expr.cpp:2241
static OMPCancelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
Definition: StmtOpenMP.cpp:637
bool hasTemplateKWAndArgsInfo() const
Definition: ExprCXX.h:2888
Abstract class common to all of the C++ "named"/"keyword" casts.
Definition: ExprCXX.h:353</