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