clang  11.0.0git
ASTWriterStmt.cpp
Go to the documentation of this file.
1 //===--- ASTWriterStmt.cpp - Statement and Expression Serialization -------===//
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 /// \file
10 /// Implements serialization for Statements and Expressions.
11 ///
12 //===----------------------------------------------------------------------===//
13 
14 #include "clang/AST/ExprOpenMP.h"
16 #include "clang/Sema/DeclSpec.h"
17 #include "clang/AST/ASTContext.h"
18 #include "clang/AST/DeclCXX.h"
19 #include "clang/AST/DeclObjC.h"
20 #include "clang/AST/DeclTemplate.h"
21 #include "clang/AST/StmtVisitor.h"
22 #include "clang/Lex/Token.h"
23 #include "llvm/Bitstream/BitstreamWriter.h"
24 using namespace clang;
25 
26 //===----------------------------------------------------------------------===//
27 // Statement/expression serialization
28 //===----------------------------------------------------------------------===//
29 
30 namespace clang {
31 
32  class ASTStmtWriter : public StmtVisitor<ASTStmtWriter, void> {
33  ASTWriter &Writer;
34  ASTRecordWriter Record;
35 
37  unsigned AbbrevToUse;
38 
39  public:
41  : Writer(Writer), Record(Writer, Record),
42  Code(serialization::STMT_NULL_PTR), AbbrevToUse(0) {}
43 
44  ASTStmtWriter(const ASTStmtWriter&) = delete;
45 
46  uint64_t Emit() {
47  assert(Code != serialization::STMT_NULL_PTR &&
48  "unhandled sub-statement writing AST file");
49  return Record.EmitStmt(Code, AbbrevToUse);
50  }
51 
53  const TemplateArgumentLoc *Args);
54 
55  void VisitStmt(Stmt *S);
56 #define STMT(Type, Base) \
57  void Visit##Type(Type *);
58 #include "clang/AST/StmtNodes.inc"
59  };
60 }
61 
63  const ASTTemplateKWAndArgsInfo &ArgInfo, const TemplateArgumentLoc *Args) {
64  Record.AddSourceLocation(ArgInfo.TemplateKWLoc);
65  Record.AddSourceLocation(ArgInfo.LAngleLoc);
66  Record.AddSourceLocation(ArgInfo.RAngleLoc);
67  for (unsigned i = 0; i != ArgInfo.NumTemplateArgs; ++i)
68  Record.AddTemplateArgumentLoc(Args[i]);
69 }
70 
72 }
73 
74 void ASTStmtWriter::VisitNullStmt(NullStmt *S) {
75  VisitStmt(S);
76  Record.AddSourceLocation(S->getSemiLoc());
77  Record.push_back(S->NullStmtBits.HasLeadingEmptyMacro);
79 }
80 
81 void ASTStmtWriter::VisitCompoundStmt(CompoundStmt *S) {
82  VisitStmt(S);
83  Record.push_back(S->size());
84  for (auto *CS : S->body())
85  Record.AddStmt(CS);
86  Record.AddSourceLocation(S->getLBracLoc());
87  Record.AddSourceLocation(S->getRBracLoc());
89 }
90 
91 void ASTStmtWriter::VisitSwitchCase(SwitchCase *S) {
92  VisitStmt(S);
93  Record.push_back(Writer.getSwitchCaseID(S));
94  Record.AddSourceLocation(S->getKeywordLoc());
95  Record.AddSourceLocation(S->getColonLoc());
96 }
97 
98 void ASTStmtWriter::VisitCaseStmt(CaseStmt *S) {
99  VisitSwitchCase(S);
100  Record.push_back(S->caseStmtIsGNURange());
101  Record.AddStmt(S->getLHS());
102  Record.AddStmt(S->getSubStmt());
103  if (S->caseStmtIsGNURange()) {
104  Record.AddStmt(S->getRHS());
105  Record.AddSourceLocation(S->getEllipsisLoc());
106  }
108 }
109 
110 void ASTStmtWriter::VisitDefaultStmt(DefaultStmt *S) {
111  VisitSwitchCase(S);
112  Record.AddStmt(S->getSubStmt());
114 }
115 
116 void ASTStmtWriter::VisitLabelStmt(LabelStmt *S) {
117  VisitStmt(S);
118  Record.AddDeclRef(S->getDecl());
119  Record.AddStmt(S->getSubStmt());
120  Record.AddSourceLocation(S->getIdentLoc());
122 }
123 
124 void ASTStmtWriter::VisitAttributedStmt(AttributedStmt *S) {
125  VisitStmt(S);
126  Record.push_back(S->getAttrs().size());
127  Record.AddAttributes(S->getAttrs());
128  Record.AddStmt(S->getSubStmt());
129  Record.AddSourceLocation(S->getAttrLoc());
131 }
132 
133 void ASTStmtWriter::VisitIfStmt(IfStmt *S) {
134  VisitStmt(S);
135 
136  bool HasElse = S->getElse() != nullptr;
137  bool HasVar = S->getConditionVariableDeclStmt() != nullptr;
138  bool HasInit = S->getInit() != nullptr;
139 
140  Record.push_back(S->isConstexpr());
141  Record.push_back(HasElse);
142  Record.push_back(HasVar);
143  Record.push_back(HasInit);
144 
145  Record.AddStmt(S->getCond());
146  Record.AddStmt(S->getThen());
147  if (HasElse)
148  Record.AddStmt(S->getElse());
149  if (HasVar)
150  Record.AddDeclRef(S->getConditionVariable());
151  if (HasInit)
152  Record.AddStmt(S->getInit());
153 
154  Record.AddSourceLocation(S->getIfLoc());
155  if (HasElse)
156  Record.AddSourceLocation(S->getElseLoc());
157 
158  Code = serialization::STMT_IF;
159 }
160 
161 void ASTStmtWriter::VisitSwitchStmt(SwitchStmt *S) {
162  VisitStmt(S);
163 
164  bool HasInit = S->getInit() != nullptr;
165  bool HasVar = S->getConditionVariableDeclStmt() != nullptr;
166  Record.push_back(HasInit);
167  Record.push_back(HasVar);
168  Record.push_back(S->isAllEnumCasesCovered());
169 
170  Record.AddStmt(S->getCond());
171  Record.AddStmt(S->getBody());
172  if (HasInit)
173  Record.AddStmt(S->getInit());
174  if (HasVar)
175  Record.AddDeclRef(S->getConditionVariable());
176 
177  Record.AddSourceLocation(S->getSwitchLoc());
178 
179  for (SwitchCase *SC = S->getSwitchCaseList(); SC;
180  SC = SC->getNextSwitchCase())
181  Record.push_back(Writer.RecordSwitchCaseID(SC));
183 }
184 
185 void ASTStmtWriter::VisitWhileStmt(WhileStmt *S) {
186  VisitStmt(S);
187 
188  bool HasVar = S->getConditionVariableDeclStmt() != nullptr;
189  Record.push_back(HasVar);
190 
191  Record.AddStmt(S->getCond());
192  Record.AddStmt(S->getBody());
193  if (HasVar)
194  Record.AddDeclRef(S->getConditionVariable());
195 
196  Record.AddSourceLocation(S->getWhileLoc());
198 }
199 
200 void ASTStmtWriter::VisitDoStmt(DoStmt *S) {
201  VisitStmt(S);
202  Record.AddStmt(S->getCond());
203  Record.AddStmt(S->getBody());
204  Record.AddSourceLocation(S->getDoLoc());
205  Record.AddSourceLocation(S->getWhileLoc());
206  Record.AddSourceLocation(S->getRParenLoc());
207  Code = serialization::STMT_DO;
208 }
209 
210 void ASTStmtWriter::VisitForStmt(ForStmt *S) {
211  VisitStmt(S);
212  Record.AddStmt(S->getInit());
213  Record.AddStmt(S->getCond());
214  Record.AddDeclRef(S->getConditionVariable());
215  Record.AddStmt(S->getInc());
216  Record.AddStmt(S->getBody());
217  Record.AddSourceLocation(S->getForLoc());
218  Record.AddSourceLocation(S->getLParenLoc());
219  Record.AddSourceLocation(S->getRParenLoc());
221 }
222 
223 void ASTStmtWriter::VisitGotoStmt(GotoStmt *S) {
224  VisitStmt(S);
225  Record.AddDeclRef(S->getLabel());
226  Record.AddSourceLocation(S->getGotoLoc());
227  Record.AddSourceLocation(S->getLabelLoc());
229 }
230 
231 void ASTStmtWriter::VisitIndirectGotoStmt(IndirectGotoStmt *S) {
232  VisitStmt(S);
233  Record.AddSourceLocation(S->getGotoLoc());
234  Record.AddSourceLocation(S->getStarLoc());
235  Record.AddStmt(S->getTarget());
237 }
238 
239 void ASTStmtWriter::VisitContinueStmt(ContinueStmt *S) {
240  VisitStmt(S);
241  Record.AddSourceLocation(S->getContinueLoc());
243 }
244 
245 void ASTStmtWriter::VisitBreakStmt(BreakStmt *S) {
246  VisitStmt(S);
247  Record.AddSourceLocation(S->getBreakLoc());
249 }
250 
251 void ASTStmtWriter::VisitReturnStmt(ReturnStmt *S) {
252  VisitStmt(S);
253 
254  bool HasNRVOCandidate = S->getNRVOCandidate() != nullptr;
255  Record.push_back(HasNRVOCandidate);
256 
257  Record.AddStmt(S->getRetValue());
258  if (HasNRVOCandidate)
259  Record.AddDeclRef(S->getNRVOCandidate());
260 
261  Record.AddSourceLocation(S->getReturnLoc());
263 }
264 
265 void ASTStmtWriter::VisitDeclStmt(DeclStmt *S) {
266  VisitStmt(S);
267  Record.AddSourceLocation(S->getBeginLoc());
268  Record.AddSourceLocation(S->getEndLoc());
269  DeclGroupRef DG = S->getDeclGroup();
270  for (DeclGroupRef::iterator D = DG.begin(), DEnd = DG.end(); D != DEnd; ++D)
271  Record.AddDeclRef(*D);
273 }
274 
275 void ASTStmtWriter::VisitAsmStmt(AsmStmt *S) {
276  VisitStmt(S);
277  Record.push_back(S->getNumOutputs());
278  Record.push_back(S->getNumInputs());
279  Record.push_back(S->getNumClobbers());
280  Record.AddSourceLocation(S->getAsmLoc());
281  Record.push_back(S->isVolatile());
282  Record.push_back(S->isSimple());
283 }
284 
285 void ASTStmtWriter::VisitGCCAsmStmt(GCCAsmStmt *S) {
286  VisitAsmStmt(S);
287  Record.push_back(S->getNumLabels());
288  Record.AddSourceLocation(S->getRParenLoc());
289  Record.AddStmt(S->getAsmString());
290 
291  // Outputs
292  for (unsigned I = 0, N = S->getNumOutputs(); I != N; ++I) {
294  Record.AddStmt(S->getOutputConstraintLiteral(I));
295  Record.AddStmt(S->getOutputExpr(I));
296  }
297 
298  // Inputs
299  for (unsigned I = 0, N = S->getNumInputs(); I != N; ++I) {
300  Record.AddIdentifierRef(S->getInputIdentifier(I));
301  Record.AddStmt(S->getInputConstraintLiteral(I));
302  Record.AddStmt(S->getInputExpr(I));
303  }
304 
305  // Clobbers
306  for (unsigned I = 0, N = S->getNumClobbers(); I != N; ++I)
307  Record.AddStmt(S->getClobberStringLiteral(I));
308 
309  // Labels
310  for (auto *E : S->labels()) Record.AddStmt(E);
311 
313 }
314 
315 void ASTStmtWriter::VisitMSAsmStmt(MSAsmStmt *S) {
316  VisitAsmStmt(S);
317  Record.AddSourceLocation(S->getLBraceLoc());
318  Record.AddSourceLocation(S->getEndLoc());
319  Record.push_back(S->getNumAsmToks());
320  Record.AddString(S->getAsmString());
321 
322  // Tokens
323  for (unsigned I = 0, N = S->getNumAsmToks(); I != N; ++I) {
324  // FIXME: Move this to ASTRecordWriter?
325  Writer.AddToken(S->getAsmToks()[I], Record.getRecordData());
326  }
327 
328  // Clobbers
329  for (unsigned I = 0, N = S->getNumClobbers(); I != N; ++I) {
330  Record.AddString(S->getClobber(I));
331  }
332 
333  // Outputs
334  for (unsigned I = 0, N = S->getNumOutputs(); I != N; ++I) {
335  Record.AddStmt(S->getOutputExpr(I));
336  Record.AddString(S->getOutputConstraint(I));
337  }
338 
339  // Inputs
340  for (unsigned I = 0, N = S->getNumInputs(); I != N; ++I) {
341  Record.AddStmt(S->getInputExpr(I));
342  Record.AddString(S->getInputConstraint(I));
343  }
344 
346 }
347 
348 void ASTStmtWriter::VisitCoroutineBodyStmt(CoroutineBodyStmt *CoroStmt) {
349  VisitStmt(CoroStmt);
350  Record.push_back(CoroStmt->getParamMoves().size());
351  for (Stmt *S : CoroStmt->children())
352  Record.AddStmt(S);
354 }
355 
356 void ASTStmtWriter::VisitCoreturnStmt(CoreturnStmt *S) {
357  VisitStmt(S);
358  Record.AddSourceLocation(S->getKeywordLoc());
359  Record.AddStmt(S->getOperand());
360  Record.AddStmt(S->getPromiseCall());
361  Record.push_back(S->isImplicit());
363 }
364 
365 void ASTStmtWriter::VisitCoroutineSuspendExpr(CoroutineSuspendExpr *E) {
366  VisitExpr(E);
367  Record.AddSourceLocation(E->getKeywordLoc());
368  for (Stmt *S : E->children())
369  Record.AddStmt(S);
370  Record.AddStmt(E->getOpaqueValue());
371 }
372 
373 void ASTStmtWriter::VisitCoawaitExpr(CoawaitExpr *E) {
374  VisitCoroutineSuspendExpr(E);
375  Record.push_back(E->isImplicit());
377 }
378 
379 void ASTStmtWriter::VisitCoyieldExpr(CoyieldExpr *E) {
380  VisitCoroutineSuspendExpr(E);
382 }
383 
384 void ASTStmtWriter::VisitDependentCoawaitExpr(DependentCoawaitExpr *E) {
385  VisitExpr(E);
386  Record.AddSourceLocation(E->getKeywordLoc());
387  for (Stmt *S : E->children())
388  Record.AddStmt(S);
390 }
391 
392 static void
394  const ASTConstraintSatisfaction &Satisfaction) {
395  Record.push_back(Satisfaction.IsSatisfied);
396  if (!Satisfaction.IsSatisfied) {
397  Record.push_back(Satisfaction.NumRecords);
398  for (const auto &DetailRecord : Satisfaction) {
399  Record.AddStmt(const_cast<Expr *>(DetailRecord.first));
400  auto *E = DetailRecord.second.dyn_cast<Expr *>();
401  Record.push_back(E == nullptr);
402  if (E)
403  Record.AddStmt(E);
404  else {
405  auto *Diag = DetailRecord.second.get<std::pair<SourceLocation,
406  StringRef> *>();
407  Record.AddSourceLocation(Diag->first);
408  Record.AddString(Diag->second);
409  }
410  }
411  }
412 }
413 
414 static void
416  ASTRecordWriter &Record,
418  Record.AddString(D->SubstitutedEntity);
419  Record.AddSourceLocation(D->DiagLoc);
420  Record.AddString(D->DiagMessage);
421 }
422 
423 void ASTStmtWriter::VisitConceptSpecializationExpr(
425  VisitExpr(E);
427  Record.push_back(TemplateArgs.size());
429  Record.AddSourceLocation(E->getTemplateKWLoc());
431  Record.AddDeclRef(E->getNamedConcept());
432  Record.AddDeclRef(E->getFoundDecl());
434  for (const TemplateArgument &Arg : TemplateArgs)
435  Record.AddTemplateArgument(Arg);
436  if (!E->isValueDependent())
438 
440 }
441 
442 void ASTStmtWriter::VisitRequiresExpr(RequiresExpr *E) {
443  VisitExpr(E);
444  Record.push_back(E->getLocalParameters().size());
445  Record.push_back(E->getRequirements().size());
446  Record.AddSourceLocation(E->RequiresExprBits.RequiresKWLoc);
447  Record.push_back(E->RequiresExprBits.IsSatisfied);
448  Record.AddDeclRef(E->getBody());
449  for (ParmVarDecl *P : E->getLocalParameters())
450  Record.AddDeclRef(P);
451  for (concepts::Requirement *R : E->getRequirements()) {
452  if (auto *TypeReq = dyn_cast<concepts::TypeRequirement>(R)) {
454  Record.push_back(TypeReq->Status);
456  addSubstitutionDiagnostic(Record, TypeReq->getSubstitutionDiagnostic());
457  else
458  Record.AddTypeSourceInfo(TypeReq->getType());
459  } else if (auto *ExprReq = dyn_cast<concepts::ExprRequirement>(R)) {
460  Record.push_back(ExprReq->getKind());
461  Record.push_back(ExprReq->Status);
462  if (ExprReq->isExprSubstitutionFailure()) {
464  ExprReq->Value.get<concepts::Requirement::SubstitutionDiagnostic *>());
465  } else
466  Record.AddStmt(ExprReq->Value.get<Expr *>());
467  if (ExprReq->getKind() == concepts::Requirement::RK_Compound) {
468  Record.AddSourceLocation(ExprReq->NoexceptLoc);
469  const auto &RetReq = ExprReq->getReturnTypeRequirement();
470  if (RetReq.isSubstitutionFailure()) {
471  Record.push_back(2);
472  addSubstitutionDiagnostic(Record, RetReq.getSubstitutionDiagnostic());
473  } else if (RetReq.isTypeConstraint()) {
474  Record.push_back(1);
476  RetReq.getTypeConstraintTemplateParameterList());
477  if (ExprReq->Status >=
479  Record.AddStmt(
480  ExprReq->getReturnTypeRequirementSubstitutedConstraintExpr());
481  } else {
482  assert(RetReq.isEmpty());
483  Record.push_back(0);
484  }
485  }
486  } else {
487  auto *NestedReq = cast<concepts::NestedRequirement>(R);
489  Record.push_back(NestedReq->isSubstitutionFailure());
490  if (NestedReq->isSubstitutionFailure()){
492  NestedReq->getSubstitutionDiagnostic());
493  } else {
494  Record.AddStmt(NestedReq->Value.get<Expr *>());
495  if (!NestedReq->isDependent())
496  addConstraintSatisfaction(Record, *NestedReq->Satisfaction);
497  }
498  }
499  }
500  Record.AddSourceLocation(E->getEndLoc());
501 
503 }
504 
505 
506 void ASTStmtWriter::VisitCapturedStmt(CapturedStmt *S) {
507  VisitStmt(S);
508  // NumCaptures
509  Record.push_back(std::distance(S->capture_begin(), S->capture_end()));
510 
511  // CapturedDecl and captured region kind
512  Record.AddDeclRef(S->getCapturedDecl());
513  Record.push_back(S->getCapturedRegionKind());
514 
515  Record.AddDeclRef(S->getCapturedRecordDecl());
516 
517  // Capture inits
518  for (auto *I : S->capture_inits())
519  Record.AddStmt(I);
520 
521  // Body
522  Record.AddStmt(S->getCapturedStmt());
523 
524  // Captures
525  for (const auto &I : S->captures()) {
526  if (I.capturesThis() || I.capturesVariableArrayType())
527  Record.AddDeclRef(nullptr);
528  else
529  Record.AddDeclRef(I.getCapturedVar());
530  Record.push_back(I.getCaptureKind());
531  Record.AddSourceLocation(I.getLocation());
532  }
533 
535 }
536 
537 void ASTStmtWriter::VisitExpr(Expr *E) {
538  VisitStmt(E);
539  Record.AddTypeRef(E->getType());
540  Record.push_back(E->isTypeDependent());
541  Record.push_back(E->isValueDependent());
542  Record.push_back(E->isInstantiationDependent());
544  Record.push_back(E->containsErrors());
545  Record.push_back(E->getValueKind());
546  Record.push_back(E->getObjectKind());
547 }
548 
549 void ASTStmtWriter::VisitConstantExpr(ConstantExpr *E) {
550  VisitExpr(E);
551  Record.push_back(E->ConstantExprBits.ResultKind);
552 
553  Record.push_back(E->ConstantExprBits.APValueKind);
554  Record.push_back(E->ConstantExprBits.IsUnsigned);
555  Record.push_back(E->ConstantExprBits.BitWidth);
556  // HasCleanup not serialized since we can just query the APValue.
557  Record.push_back(E->ConstantExprBits.IsImmediateInvocation);
558 
559  switch (E->ConstantExprBits.ResultKind) {
561  break;
563  Record.push_back(E->Int64Result());
564  break;
566  Record.AddAPValue(E->APValueResult());
567  break;
568  default:
569  llvm_unreachable("unexpected ResultKind!");
570  }
571 
572  Record.AddStmt(E->getSubExpr());
574 }
575 
576 void ASTStmtWriter::VisitPredefinedExpr(PredefinedExpr *E) {
577  VisitExpr(E);
578 
579  bool HasFunctionName = E->getFunctionName() != nullptr;
580  Record.push_back(HasFunctionName);
581  Record.push_back(E->getIdentKind()); // FIXME: stable encoding
582  Record.AddSourceLocation(E->getLocation());
583  if (HasFunctionName)
584  Record.AddStmt(E->getFunctionName());
586 }
587 
588 void ASTStmtWriter::VisitDeclRefExpr(DeclRefExpr *E) {
589  VisitExpr(E);
590 
591  Record.push_back(E->hasQualifier());
592  Record.push_back(E->getDecl() != E->getFoundDecl());
593  Record.push_back(E->hasTemplateKWAndArgsInfo());
594  Record.push_back(E->hadMultipleCandidates());
596  Record.push_back(E->isNonOdrUse());
597 
598  if (E->hasTemplateKWAndArgsInfo()) {
599  unsigned NumTemplateArgs = E->getNumTemplateArgs();
600  Record.push_back(NumTemplateArgs);
601  }
602 
604 
605  if ((!E->hasTemplateKWAndArgsInfo()) && (!E->hasQualifier()) &&
606  (E->getDecl() == E->getFoundDecl()) &&
609  AbbrevToUse = Writer.getDeclRefExprAbbrev();
610  }
611 
612  if (E->hasQualifier())
614 
615  if (E->getDecl() != E->getFoundDecl())
616  Record.AddDeclRef(E->getFoundDecl());
617 
618  if (E->hasTemplateKWAndArgsInfo())
619  AddTemplateKWAndArgsInfo(*E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
620  E->getTrailingObjects<TemplateArgumentLoc>());
621 
622  Record.AddDeclRef(E->getDecl());
623  Record.AddSourceLocation(E->getLocation());
624  Record.AddDeclarationNameLoc(E->DNLoc, E->getDecl()->getDeclName());
626 }
627 
628 void ASTStmtWriter::VisitIntegerLiteral(IntegerLiteral *E) {
629  VisitExpr(E);
630  Record.AddSourceLocation(E->getLocation());
631  Record.AddAPInt(E->getValue());
632 
633  if (E->getValue().getBitWidth() == 32) {
634  AbbrevToUse = Writer.getIntegerLiteralAbbrev();
635  }
636 
638 }
639 
640 void ASTStmtWriter::VisitFixedPointLiteral(FixedPointLiteral *E) {
641  VisitExpr(E);
642  Record.AddSourceLocation(E->getLocation());
643  Record.push_back(E->getScale());
644  Record.AddAPInt(E->getValue());
646 }
647 
648 void ASTStmtWriter::VisitFloatingLiteral(FloatingLiteral *E) {
649  VisitExpr(E);
650  Record.push_back(E->getRawSemantics());
651  Record.push_back(E->isExact());
652  Record.AddAPFloat(E->getValue());
653  Record.AddSourceLocation(E->getLocation());
655 }
656 
657 void ASTStmtWriter::VisitImaginaryLiteral(ImaginaryLiteral *E) {
658  VisitExpr(E);
659  Record.AddStmt(E->getSubExpr());
661 }
662 
663 void ASTStmtWriter::VisitStringLiteral(StringLiteral *E) {
664  VisitExpr(E);
665 
666  // Store the various bits of data of StringLiteral.
667  Record.push_back(E->getNumConcatenated());
668  Record.push_back(E->getLength());
669  Record.push_back(E->getCharByteWidth());
670  Record.push_back(E->getKind());
671  Record.push_back(E->isPascal());
672 
673  // Store the trailing array of SourceLocation.
674  for (unsigned I = 0, N = E->getNumConcatenated(); I != N; ++I)
675  Record.AddSourceLocation(E->getStrTokenLoc(I));
676 
677  // Store the trailing array of char holding the string data.
678  StringRef StrData = E->getBytes();
679  for (unsigned I = 0, N = E->getByteLength(); I != N; ++I)
680  Record.push_back(StrData[I]);
681 
683 }
684 
685 void ASTStmtWriter::VisitCharacterLiteral(CharacterLiteral *E) {
686  VisitExpr(E);
687  Record.push_back(E->getValue());
688  Record.AddSourceLocation(E->getLocation());
689  Record.push_back(E->getKind());
690 
691  AbbrevToUse = Writer.getCharacterLiteralAbbrev();
692 
694 }
695 
696 void ASTStmtWriter::VisitParenExpr(ParenExpr *E) {
697  VisitExpr(E);
698  Record.AddSourceLocation(E->getLParen());
699  Record.AddSourceLocation(E->getRParen());
700  Record.AddStmt(E->getSubExpr());
702 }
703 
704 void ASTStmtWriter::VisitParenListExpr(ParenListExpr *E) {
705  VisitExpr(E);
706  Record.push_back(E->getNumExprs());
707  for (auto *SubStmt : E->exprs())
708  Record.AddStmt(SubStmt);
709  Record.AddSourceLocation(E->getLParenLoc());
710  Record.AddSourceLocation(E->getRParenLoc());
712 }
713 
714 void ASTStmtWriter::VisitUnaryOperator(UnaryOperator *E) {
715  VisitExpr(E);
716  bool HasFPFeatures = E->hasStoredFPFeatures();
717  // Write this first for easy access when deserializing, as they affect the
718  // size of the UnaryOperator.
719  Record.push_back(HasFPFeatures);
720  Record.AddStmt(E->getSubExpr());
721  Record.push_back(E->getOpcode()); // FIXME: stable encoding
722  Record.AddSourceLocation(E->getOperatorLoc());
723  Record.push_back(E->canOverflow());
724  if (HasFPFeatures)
727 }
728 
729 void ASTStmtWriter::VisitOffsetOfExpr(OffsetOfExpr *E) {
730  VisitExpr(E);
731  Record.push_back(E->getNumComponents());
732  Record.push_back(E->getNumExpressions());
733  Record.AddSourceLocation(E->getOperatorLoc());
734  Record.AddSourceLocation(E->getRParenLoc());
736  for (unsigned I = 0, N = E->getNumComponents(); I != N; ++I) {
737  const OffsetOfNode &ON = E->getComponent(I);
738  Record.push_back(ON.getKind()); // FIXME: Stable encoding
740  Record.AddSourceLocation(ON.getSourceRange().getEnd());
741  switch (ON.getKind()) {
742  case OffsetOfNode::Array:
743  Record.push_back(ON.getArrayExprIndex());
744  break;
745 
746  case OffsetOfNode::Field:
747  Record.AddDeclRef(ON.getField());
748  break;
749 
751  Record.AddIdentifierRef(ON.getFieldName());
752  break;
753 
754  case OffsetOfNode::Base:
755  Record.AddCXXBaseSpecifier(*ON.getBase());
756  break;
757  }
758  }
759  for (unsigned I = 0, N = E->getNumExpressions(); I != N; ++I)
760  Record.AddStmt(E->getIndexExpr(I));
762 }
763 
764 void ASTStmtWriter::VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *E) {
765  VisitExpr(E);
766  Record.push_back(E->getKind());
767  if (E->isArgumentType())
769  else {
770  Record.push_back(0);
771  Record.AddStmt(E->getArgumentExpr());
772  }
773  Record.AddSourceLocation(E->getOperatorLoc());
774  Record.AddSourceLocation(E->getRParenLoc());
776 }
777 
778 void ASTStmtWriter::VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
779  VisitExpr(E);
780  Record.AddStmt(E->getLHS());
781  Record.AddStmt(E->getRHS());
782  Record.AddSourceLocation(E->getRBracketLoc());
784 }
785 
786 void ASTStmtWriter::VisitMatrixSubscriptExpr(MatrixSubscriptExpr *E) {
787  VisitExpr(E);
788  Record.AddStmt(E->getBase());
789  Record.AddStmt(E->getRowIdx());
790  Record.AddStmt(E->getColumnIdx());
791  Record.AddSourceLocation(E->getRBracketLoc());
793 }
794 
795 void ASTStmtWriter::VisitOMPArraySectionExpr(OMPArraySectionExpr *E) {
796  VisitExpr(E);
797  Record.AddStmt(E->getBase());
798  Record.AddStmt(E->getLowerBound());
799  Record.AddStmt(E->getLength());
800  Record.AddSourceLocation(E->getColonLoc());
801  Record.AddSourceLocation(E->getRBracketLoc());
803 }
804 
805 void ASTStmtWriter::VisitOMPArrayShapingExpr(OMPArrayShapingExpr *E) {
806  VisitExpr(E);
807  Record.push_back(E->getDimensions().size());
808  Record.AddStmt(E->getBase());
809  for (Expr *Dim : E->getDimensions())
810  Record.AddStmt(Dim);
811  for (SourceRange SR : E->getBracketsRanges())
812  Record.AddSourceRange(SR);
813  Record.AddSourceLocation(E->getLParenLoc());
814  Record.AddSourceLocation(E->getRParenLoc());
816 }
817 
818 void ASTStmtWriter::VisitOMPIteratorExpr(OMPIteratorExpr *E) {
819  VisitExpr(E);
820  Record.push_back(E->numOfIterators());
821  Record.AddSourceLocation(E->getIteratorKwLoc());
822  Record.AddSourceLocation(E->getLParenLoc());
823  Record.AddSourceLocation(E->getRParenLoc());
824  for (unsigned I = 0, End = E->numOfIterators(); I < End; ++I) {
825  Record.AddDeclRef(E->getIteratorDecl(I));
826  Record.AddSourceLocation(E->getAssignLoc(I));
828  Record.AddStmt(Range.Begin);
829  Record.AddStmt(Range.End);
830  Record.AddStmt(Range.Step);
831  Record.AddSourceLocation(E->getColonLoc(I));
832  if (Range.Step)
833  Record.AddSourceLocation(E->getSecondColonLoc(I));
834  // Serialize helpers
835  OMPIteratorHelperData &HD = E->getHelper(I);
836  Record.AddDeclRef(HD.CounterVD);
837  Record.AddStmt(HD.Upper);
838  Record.AddStmt(HD.Update);
839  Record.AddStmt(HD.CounterUpdate);
840  }
842 }
843 
844 void ASTStmtWriter::VisitCallExpr(CallExpr *E) {
845  VisitExpr(E);
846  Record.push_back(E->getNumArgs());
847  Record.AddSourceLocation(E->getRParenLoc());
848  Record.AddStmt(E->getCallee());
849  for (CallExpr::arg_iterator Arg = E->arg_begin(), ArgEnd = E->arg_end();
850  Arg != ArgEnd; ++Arg)
851  Record.AddStmt(*Arg);
852  Record.push_back(static_cast<unsigned>(E->getADLCallKind()));
854 }
855 
856 void ASTStmtWriter::VisitRecoveryExpr(RecoveryExpr *E) {
857  VisitExpr(E);
858  Record.push_back(std::distance(E->children().begin(), E->children().end()));
859  Record.AddSourceLocation(E->getBeginLoc());
860  Record.AddSourceLocation(E->getEndLoc());
861  for (Stmt *Child : E->children())
862  Record.AddStmt(Child);
864 }
865 
866 void ASTStmtWriter::VisitMemberExpr(MemberExpr *E) {
867  VisitExpr(E);
868 
869  bool HasQualifier = E->hasQualifier();
870  bool HasFoundDecl =
871  E->hasQualifierOrFoundDecl() &&
872  (E->getFoundDecl().getDecl() != E->getMemberDecl() ||
873  E->getFoundDecl().getAccess() != E->getMemberDecl()->getAccess());
874  bool HasTemplateInfo = E->hasTemplateKWAndArgsInfo();
875  unsigned NumTemplateArgs = E->getNumTemplateArgs();
876 
877  // Write these first for easy access when deserializing, as they affect the
878  // size of the MemberExpr.
879  Record.push_back(HasQualifier);
880  Record.push_back(HasFoundDecl);
881  Record.push_back(HasTemplateInfo);
882  Record.push_back(NumTemplateArgs);
883 
884  Record.AddStmt(E->getBase());
885  Record.AddDeclRef(E->getMemberDecl());
886  Record.AddDeclarationNameLoc(E->MemberDNLoc,
887  E->getMemberDecl()->getDeclName());
888  Record.AddSourceLocation(E->getMemberLoc());
889  Record.push_back(E->isArrow());
890  Record.push_back(E->hadMultipleCandidates());
891  Record.push_back(E->isNonOdrUse());
892  Record.AddSourceLocation(E->getOperatorLoc());
893 
894  if (HasFoundDecl) {
895  DeclAccessPair FoundDecl = E->getFoundDecl();
896  Record.AddDeclRef(FoundDecl.getDecl());
897  Record.push_back(FoundDecl.getAccess());
898  }
899 
900  if (HasQualifier)
902 
903  if (HasTemplateInfo)
904  AddTemplateKWAndArgsInfo(*E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
905  E->getTrailingObjects<TemplateArgumentLoc>());
906 
908 }
909 
910 void ASTStmtWriter::VisitObjCIsaExpr(ObjCIsaExpr *E) {
911  VisitExpr(E);
912  Record.AddStmt(E->getBase());
913  Record.AddSourceLocation(E->getIsaMemberLoc());
914  Record.AddSourceLocation(E->getOpLoc());
915  Record.push_back(E->isArrow());
917 }
918 
919 void ASTStmtWriter::
920 VisitObjCIndirectCopyRestoreExpr(ObjCIndirectCopyRestoreExpr *E) {
921  VisitExpr(E);
922  Record.AddStmt(E->getSubExpr());
923  Record.push_back(E->shouldCopy());
925 }
926 
927 void ASTStmtWriter::VisitObjCBridgedCastExpr(ObjCBridgedCastExpr *E) {
928  VisitExplicitCastExpr(E);
929  Record.AddSourceLocation(E->getLParenLoc());
931  Record.push_back(E->getBridgeKind()); // FIXME: Stable encoding
933 }
934 
935 void ASTStmtWriter::VisitCastExpr(CastExpr *E) {
936  VisitExpr(E);
937  Record.push_back(E->path_size());
938  Record.AddStmt(E->getSubExpr());
939  Record.push_back(E->getCastKind()); // FIXME: stable encoding
940 
942  PI = E->path_begin(), PE = E->path_end(); PI != PE; ++PI)
943  Record.AddCXXBaseSpecifier(**PI);
944 }
945 
946 void ASTStmtWriter::VisitBinaryOperator(BinaryOperator *E) {
947  VisitExpr(E);
948  bool HasFPFeatures = E->hasStoredFPFeatures();
949  // Write this first for easy access when deserializing, as they affect the
950  // size of the UnaryOperator.
951  Record.push_back(HasFPFeatures);
952  Record.push_back(E->getOpcode()); // FIXME: stable encoding
953  Record.AddStmt(E->getLHS());
954  Record.AddStmt(E->getRHS());
955  Record.AddSourceLocation(E->getOperatorLoc());
956  if (HasFPFeatures)
959 }
960 
961 void ASTStmtWriter::VisitCompoundAssignOperator(CompoundAssignOperator *E) {
962  VisitBinaryOperator(E);
963  Record.AddTypeRef(E->getComputationLHSType());
966 }
967 
968 void ASTStmtWriter::VisitConditionalOperator(ConditionalOperator *E) {
969  VisitExpr(E);
970  Record.AddStmt(E->getCond());
971  Record.AddStmt(E->getLHS());
972  Record.AddStmt(E->getRHS());
973  Record.AddSourceLocation(E->getQuestionLoc());
974  Record.AddSourceLocation(E->getColonLoc());
976 }
977 
978 void
979 ASTStmtWriter::VisitBinaryConditionalOperator(BinaryConditionalOperator *E) {
980  VisitExpr(E);
981  Record.AddStmt(E->getOpaqueValue());
982  Record.AddStmt(E->getCommon());
983  Record.AddStmt(E->getCond());
984  Record.AddStmt(E->getTrueExpr());
985  Record.AddStmt(E->getFalseExpr());
986  Record.AddSourceLocation(E->getQuestionLoc());
987  Record.AddSourceLocation(E->getColonLoc());
989 }
990 
991 void ASTStmtWriter::VisitImplicitCastExpr(ImplicitCastExpr *E) {
992  VisitCastExpr(E);
993  Record.push_back(E->isPartOfExplicitCast());
994 
995  if (E->path_size() == 0)
996  AbbrevToUse = Writer.getExprImplicitCastAbbrev();
997 
999 }
1000 
1001 void ASTStmtWriter::VisitExplicitCastExpr(ExplicitCastExpr *E) {
1002  VisitCastExpr(E);
1004 }
1005 
1006 void ASTStmtWriter::VisitCStyleCastExpr(CStyleCastExpr *E) {
1007  VisitExplicitCastExpr(E);
1008  Record.AddSourceLocation(E->getLParenLoc());
1009  Record.AddSourceLocation(E->getRParenLoc());
1011 }
1012 
1013 void ASTStmtWriter::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
1014  VisitExpr(E);
1015  Record.AddSourceLocation(E->getLParenLoc());
1016  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1017  Record.AddStmt(E->getInitializer());
1018  Record.push_back(E->isFileScope());
1020 }
1021 
1022 void ASTStmtWriter::VisitExtVectorElementExpr(ExtVectorElementExpr *E) {
1023  VisitExpr(E);
1024  Record.AddStmt(E->getBase());
1025  Record.AddIdentifierRef(&E->getAccessor());
1026  Record.AddSourceLocation(E->getAccessorLoc());
1028 }
1029 
1030 void ASTStmtWriter::VisitInitListExpr(InitListExpr *E) {
1031  VisitExpr(E);
1032  // NOTE: only add the (possibly null) syntactic form.
1033  // No need to serialize the isSemanticForm flag and the semantic form.
1034  Record.AddStmt(E->getSyntacticForm());
1035  Record.AddSourceLocation(E->getLBraceLoc());
1036  Record.AddSourceLocation(E->getRBraceLoc());
1037  bool isArrayFiller = E->ArrayFillerOrUnionFieldInit.is<Expr*>();
1038  Record.push_back(isArrayFiller);
1039  if (isArrayFiller)
1040  Record.AddStmt(E->getArrayFiller());
1041  else
1043  Record.push_back(E->hadArrayRangeDesignator());
1044  Record.push_back(E->getNumInits());
1045  if (isArrayFiller) {
1046  // ArrayFiller may have filled "holes" due to designated initializer.
1047  // Replace them by 0 to indicate that the filler goes in that place.
1048  Expr *filler = E->getArrayFiller();
1049  for (unsigned I = 0, N = E->getNumInits(); I != N; ++I)
1050  Record.AddStmt(E->getInit(I) != filler ? E->getInit(I) : nullptr);
1051  } else {
1052  for (unsigned I = 0, N = E->getNumInits(); I != N; ++I)
1053  Record.AddStmt(E->getInit(I));
1054  }
1056 }
1057 
1058 void ASTStmtWriter::VisitDesignatedInitExpr(DesignatedInitExpr *E) {
1059  VisitExpr(E);
1060  Record.push_back(E->getNumSubExprs());
1061  for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
1062  Record.AddStmt(E->getSubExpr(I));
1064  Record.push_back(E->usesGNUSyntax());
1065  for (const DesignatedInitExpr::Designator &D : E->designators()) {
1066  if (D.isFieldDesignator()) {
1067  if (FieldDecl *Field = D.getField()) {
1069  Record.AddDeclRef(Field);
1070  } else {
1072  Record.AddIdentifierRef(D.getFieldName());
1073  }
1074  Record.AddSourceLocation(D.getDotLoc());
1075  Record.AddSourceLocation(D.getFieldLoc());
1076  } else if (D.isArrayDesignator()) {
1078  Record.push_back(D.getFirstExprIndex());
1079  Record.AddSourceLocation(D.getLBracketLoc());
1080  Record.AddSourceLocation(D.getRBracketLoc());
1081  } else {
1082  assert(D.isArrayRangeDesignator() && "Unknown designator");
1084  Record.push_back(D.getFirstExprIndex());
1085  Record.AddSourceLocation(D.getLBracketLoc());
1086  Record.AddSourceLocation(D.getEllipsisLoc());
1087  Record.AddSourceLocation(D.getRBracketLoc());
1088  }
1089  }
1091 }
1092 
1093 void ASTStmtWriter::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) {
1094  VisitExpr(E);
1095  Record.AddStmt(E->getBase());
1096  Record.AddStmt(E->getUpdater());
1098 }
1099 
1100 void ASTStmtWriter::VisitNoInitExpr(NoInitExpr *E) {
1101  VisitExpr(E);
1103 }
1104 
1105 void ASTStmtWriter::VisitArrayInitLoopExpr(ArrayInitLoopExpr *E) {
1106  VisitExpr(E);
1107  Record.AddStmt(E->SubExprs[0]);
1108  Record.AddStmt(E->SubExprs[1]);
1110 }
1111 
1112 void ASTStmtWriter::VisitArrayInitIndexExpr(ArrayInitIndexExpr *E) {
1113  VisitExpr(E);
1115 }
1116 
1117 void ASTStmtWriter::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) {
1118  VisitExpr(E);
1120 }
1121 
1122 void ASTStmtWriter::VisitVAArgExpr(VAArgExpr *E) {
1123  VisitExpr(E);
1124  Record.AddStmt(E->getSubExpr());
1126  Record.AddSourceLocation(E->getBuiltinLoc());
1127  Record.AddSourceLocation(E->getRParenLoc());
1128  Record.push_back(E->isMicrosoftABI());
1130 }
1131 
1132 void ASTStmtWriter::VisitSourceLocExpr(SourceLocExpr *E) {
1133  VisitExpr(E);
1134  Record.AddDeclRef(cast_or_null<Decl>(E->getParentContext()));
1135  Record.AddSourceLocation(E->getBeginLoc());
1136  Record.AddSourceLocation(E->getEndLoc());
1137  Record.push_back(E->getIdentKind());
1139 }
1140 
1141 void ASTStmtWriter::VisitAddrLabelExpr(AddrLabelExpr *E) {
1142  VisitExpr(E);
1143  Record.AddSourceLocation(E->getAmpAmpLoc());
1144  Record.AddSourceLocation(E->getLabelLoc());
1145  Record.AddDeclRef(E->getLabel());
1147 }
1148 
1149 void ASTStmtWriter::VisitStmtExpr(StmtExpr *E) {
1150  VisitExpr(E);
1151  Record.AddStmt(E->getSubStmt());
1152  Record.AddSourceLocation(E->getLParenLoc());
1153  Record.AddSourceLocation(E->getRParenLoc());
1154  Record.push_back(E->getTemplateDepth());
1155  Code = serialization::EXPR_STMT;
1156 }
1157 
1158 void ASTStmtWriter::VisitChooseExpr(ChooseExpr *E) {
1159  VisitExpr(E);
1160  Record.AddStmt(E->getCond());
1161  Record.AddStmt(E->getLHS());
1162  Record.AddStmt(E->getRHS());
1163  Record.AddSourceLocation(E->getBuiltinLoc());
1164  Record.AddSourceLocation(E->getRParenLoc());
1165  Record.push_back(E->isConditionDependent() ? false : E->isConditionTrue());
1167 }
1168 
1169 void ASTStmtWriter::VisitGNUNullExpr(GNUNullExpr *E) {
1170  VisitExpr(E);
1171  Record.AddSourceLocation(E->getTokenLocation());
1173 }
1174 
1175 void ASTStmtWriter::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
1176  VisitExpr(E);
1177  Record.push_back(E->getNumSubExprs());
1178  for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
1179  Record.AddStmt(E->getExpr(I));
1180  Record.AddSourceLocation(E->getBuiltinLoc());
1181  Record.AddSourceLocation(E->getRParenLoc());
1183 }
1184 
1185 void ASTStmtWriter::VisitConvertVectorExpr(ConvertVectorExpr *E) {
1186  VisitExpr(E);
1187  Record.AddSourceLocation(E->getBuiltinLoc());
1188  Record.AddSourceLocation(E->getRParenLoc());
1189  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1190  Record.AddStmt(E->getSrcExpr());
1192 }
1193 
1194 void ASTStmtWriter::VisitBlockExpr(BlockExpr *E) {
1195  VisitExpr(E);
1196  Record.AddDeclRef(E->getBlockDecl());
1198 }
1199 
1200 void ASTStmtWriter::VisitGenericSelectionExpr(GenericSelectionExpr *E) {
1201  VisitExpr(E);
1202 
1203  Record.push_back(E->getNumAssocs());
1204  Record.push_back(E->ResultIndex);
1205  Record.AddSourceLocation(E->getGenericLoc());
1206  Record.AddSourceLocation(E->getDefaultLoc());
1207  Record.AddSourceLocation(E->getRParenLoc());
1208 
1209  Stmt **Stmts = E->getTrailingObjects<Stmt *>();
1210  // Add 1 to account for the controlling expression which is the first
1211  // expression in the trailing array of Stmt *. This is not needed for
1212  // the trailing array of TypeSourceInfo *.
1213  for (unsigned I = 0, N = E->getNumAssocs() + 1; I < N; ++I)
1214  Record.AddStmt(Stmts[I]);
1215 
1216  TypeSourceInfo **TSIs = E->getTrailingObjects<TypeSourceInfo *>();
1217  for (unsigned I = 0, N = E->getNumAssocs(); I < N; ++I)
1218  Record.AddTypeSourceInfo(TSIs[I]);
1219 
1221 }
1222 
1223 void ASTStmtWriter::VisitPseudoObjectExpr(PseudoObjectExpr *E) {
1224  VisitExpr(E);
1225  Record.push_back(E->getNumSemanticExprs());
1226 
1227  // Push the result index. Currently, this needs to exactly match
1228  // the encoding used internally for ResultIndex.
1229  unsigned result = E->getResultExprIndex();
1230  result = (result == PseudoObjectExpr::NoResult ? 0 : result + 1);
1231  Record.push_back(result);
1232 
1233  Record.AddStmt(E->getSyntacticForm());
1235  i = E->semantics_begin(), e = E->semantics_end(); i != e; ++i) {
1236  Record.AddStmt(*i);
1237  }
1239 }
1240 
1241 void ASTStmtWriter::VisitAtomicExpr(AtomicExpr *E) {
1242  VisitExpr(E);
1243  Record.push_back(E->getOp());
1244  for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
1245  Record.AddStmt(E->getSubExprs()[I]);
1246  Record.AddSourceLocation(E->getBuiltinLoc());
1247  Record.AddSourceLocation(E->getRParenLoc());
1249 }
1250 
1251 //===----------------------------------------------------------------------===//
1252 // Objective-C Expressions and Statements.
1253 //===----------------------------------------------------------------------===//
1254 
1255 void ASTStmtWriter::VisitObjCStringLiteral(ObjCStringLiteral *E) {
1256  VisitExpr(E);
1257  Record.AddStmt(E->getString());
1258  Record.AddSourceLocation(E->getAtLoc());
1260 }
1261 
1262 void ASTStmtWriter::VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
1263  VisitExpr(E);
1264  Record.AddStmt(E->getSubExpr());
1265  Record.AddDeclRef(E->getBoxingMethod());
1266  Record.AddSourceRange(E->getSourceRange());
1268 }
1269 
1270 void ASTStmtWriter::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
1271  VisitExpr(E);
1272  Record.push_back(E->getNumElements());
1273  for (unsigned i = 0; i < E->getNumElements(); i++)
1274  Record.AddStmt(E->getElement(i));
1276  Record.AddSourceRange(E->getSourceRange());
1278 }
1279 
1280 void ASTStmtWriter::VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *E) {
1281  VisitExpr(E);
1282  Record.push_back(E->getNumElements());
1283  Record.push_back(E->HasPackExpansions);
1284  for (unsigned i = 0; i < E->getNumElements(); i++) {
1285  ObjCDictionaryElement Element = E->getKeyValueElement(i);
1286  Record.AddStmt(Element.Key);
1287  Record.AddStmt(Element.Value);
1288  if (E->HasPackExpansions) {
1289  Record.AddSourceLocation(Element.EllipsisLoc);
1290  unsigned NumExpansions = 0;
1291  if (Element.NumExpansions)
1292  NumExpansions = *Element.NumExpansions + 1;
1293  Record.push_back(NumExpansions);
1294  }
1295  }
1296 
1297  Record.AddDeclRef(E->getDictWithObjectsMethod());
1298  Record.AddSourceRange(E->getSourceRange());
1300 }
1301 
1302 void ASTStmtWriter::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
1303  VisitExpr(E);
1305  Record.AddSourceLocation(E->getAtLoc());
1306  Record.AddSourceLocation(E->getRParenLoc());
1308 }
1309 
1310 void ASTStmtWriter::VisitObjCSelectorExpr(ObjCSelectorExpr *E) {
1311  VisitExpr(E);
1312  Record.AddSelectorRef(E->getSelector());
1313  Record.AddSourceLocation(E->getAtLoc());
1314  Record.AddSourceLocation(E->getRParenLoc());
1316 }
1317 
1318 void ASTStmtWriter::VisitObjCProtocolExpr(ObjCProtocolExpr *E) {
1319  VisitExpr(E);
1320  Record.AddDeclRef(E->getProtocol());
1321  Record.AddSourceLocation(E->getAtLoc());
1322  Record.AddSourceLocation(E->ProtoLoc);
1323  Record.AddSourceLocation(E->getRParenLoc());
1325 }
1326 
1327 void ASTStmtWriter::VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) {
1328  VisitExpr(E);
1329  Record.AddDeclRef(E->getDecl());
1330  Record.AddSourceLocation(E->getLocation());
1331  Record.AddSourceLocation(E->getOpLoc());
1332  Record.AddStmt(E->getBase());
1333  Record.push_back(E->isArrow());
1334  Record.push_back(E->isFreeIvar());
1336 }
1337 
1338 void ASTStmtWriter::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
1339  VisitExpr(E);
1340  Record.push_back(E->SetterAndMethodRefFlags.getInt());
1341  Record.push_back(E->isImplicitProperty());
1342  if (E->isImplicitProperty()) {
1345  } else {
1346  Record.AddDeclRef(E->getExplicitProperty());
1347  }
1348  Record.AddSourceLocation(E->getLocation());
1350  if (E->isObjectReceiver()) {
1351  Record.push_back(0);
1352  Record.AddStmt(E->getBase());
1353  } else if (E->isSuperReceiver()) {
1354  Record.push_back(1);
1355  Record.AddTypeRef(E->getSuperReceiverType());
1356  } else {
1357  Record.push_back(2);
1358  Record.AddDeclRef(E->getClassReceiver());
1359  }
1360 
1362 }
1363 
1364 void ASTStmtWriter::VisitObjCSubscriptRefExpr(ObjCSubscriptRefExpr *E) {
1365  VisitExpr(E);
1366  Record.AddSourceLocation(E->getRBracket());
1367  Record.AddStmt(E->getBaseExpr());
1368  Record.AddStmt(E->getKeyExpr());
1369  Record.AddDeclRef(E->getAtIndexMethodDecl());
1370  Record.AddDeclRef(E->setAtIndexMethodDecl());
1371 
1373 }
1374 
1375 void ASTStmtWriter::VisitObjCMessageExpr(ObjCMessageExpr *E) {
1376  VisitExpr(E);
1377  Record.push_back(E->getNumArgs());
1378  Record.push_back(E->getNumStoredSelLocs());
1379  Record.push_back(E->SelLocsKind);
1380  Record.push_back(E->isDelegateInitCall());
1381  Record.push_back(E->IsImplicit);
1382  Record.push_back((unsigned)E->getReceiverKind()); // FIXME: stable encoding
1383  switch (E->getReceiverKind()) {
1385  Record.AddStmt(E->getInstanceReceiver());
1386  break;
1387 
1390  break;
1391 
1394  Record.AddTypeRef(E->getSuperType());
1395  Record.AddSourceLocation(E->getSuperLoc());
1396  break;
1397  }
1398 
1399  if (E->getMethodDecl()) {
1400  Record.push_back(1);
1401  Record.AddDeclRef(E->getMethodDecl());
1402  } else {
1403  Record.push_back(0);
1404  Record.AddSelectorRef(E->getSelector());
1405  }
1406 
1407  Record.AddSourceLocation(E->getLeftLoc());
1408  Record.AddSourceLocation(E->getRightLoc());
1409 
1410  for (CallExpr::arg_iterator Arg = E->arg_begin(), ArgEnd = E->arg_end();
1411  Arg != ArgEnd; ++Arg)
1412  Record.AddStmt(*Arg);
1413 
1414  SourceLocation *Locs = E->getStoredSelLocs();
1415  for (unsigned i = 0, e = E->getNumStoredSelLocs(); i != e; ++i)
1416  Record.AddSourceLocation(Locs[i]);
1417 
1419 }
1420 
1421 void ASTStmtWriter::VisitObjCForCollectionStmt(ObjCForCollectionStmt *S) {
1422  VisitStmt(S);
1423  Record.AddStmt(S->getElement());
1424  Record.AddStmt(S->getCollection());
1425  Record.AddStmt(S->getBody());
1426  Record.AddSourceLocation(S->getForLoc());
1427  Record.AddSourceLocation(S->getRParenLoc());
1429 }
1430 
1431 void ASTStmtWriter::VisitObjCAtCatchStmt(ObjCAtCatchStmt *S) {
1432  VisitStmt(S);
1433  Record.AddStmt(S->getCatchBody());
1434  Record.AddDeclRef(S->getCatchParamDecl());
1435  Record.AddSourceLocation(S->getAtCatchLoc());
1436  Record.AddSourceLocation(S->getRParenLoc());
1438 }
1439 
1440 void ASTStmtWriter::VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S) {
1441  VisitStmt(S);
1442  Record.AddStmt(S->getFinallyBody());
1443  Record.AddSourceLocation(S->getAtFinallyLoc());
1445 }
1446 
1447 void ASTStmtWriter::VisitObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S) {
1448  VisitStmt(S); // FIXME: no test coverage.
1449  Record.AddStmt(S->getSubStmt());
1450  Record.AddSourceLocation(S->getAtLoc());
1452 }
1453 
1454 void ASTStmtWriter::VisitObjCAtTryStmt(ObjCAtTryStmt *S) {
1455  VisitStmt(S);
1456  Record.push_back(S->getNumCatchStmts());
1457  Record.push_back(S->getFinallyStmt() != nullptr);
1458  Record.AddStmt(S->getTryBody());
1459  for (unsigned I = 0, N = S->getNumCatchStmts(); I != N; ++I)
1460  Record.AddStmt(S->getCatchStmt(I));
1461  if (S->getFinallyStmt())
1462  Record.AddStmt(S->getFinallyStmt());
1463  Record.AddSourceLocation(S->getAtTryLoc());
1465 }
1466 
1467 void ASTStmtWriter::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
1468  VisitStmt(S); // FIXME: no test coverage.
1469  Record.AddStmt(S->getSynchExpr());
1470  Record.AddStmt(S->getSynchBody());
1473 }
1474 
1475 void ASTStmtWriter::VisitObjCAtThrowStmt(ObjCAtThrowStmt *S) {
1476  VisitStmt(S); // FIXME: no test coverage.
1477  Record.AddStmt(S->getThrowExpr());
1478  Record.AddSourceLocation(S->getThrowLoc());
1480 }
1481 
1482 void ASTStmtWriter::VisitObjCBoolLiteralExpr(ObjCBoolLiteralExpr *E) {
1483  VisitExpr(E);
1484  Record.push_back(E->getValue());
1485  Record.AddSourceLocation(E->getLocation());
1487 }
1488 
1489 void ASTStmtWriter::VisitObjCAvailabilityCheckExpr(ObjCAvailabilityCheckExpr *E) {
1490  VisitExpr(E);
1491  Record.AddSourceRange(E->getSourceRange());
1492  Record.AddVersionTuple(E->getVersion());
1494 }
1495 
1496 //===----------------------------------------------------------------------===//
1497 // C++ Expressions and Statements.
1498 //===----------------------------------------------------------------------===//
1499 
1500 void ASTStmtWriter::VisitCXXCatchStmt(CXXCatchStmt *S) {
1501  VisitStmt(S);
1502  Record.AddSourceLocation(S->getCatchLoc());
1503  Record.AddDeclRef(S->getExceptionDecl());
1504  Record.AddStmt(S->getHandlerBlock());
1506 }
1507 
1508 void ASTStmtWriter::VisitCXXTryStmt(CXXTryStmt *S) {
1509  VisitStmt(S);
1510  Record.push_back(S->getNumHandlers());
1511  Record.AddSourceLocation(S->getTryLoc());
1512  Record.AddStmt(S->getTryBlock());
1513  for (unsigned i = 0, e = S->getNumHandlers(); i != e; ++i)
1514  Record.AddStmt(S->getHandler(i));
1516 }
1517 
1518 void ASTStmtWriter::VisitCXXForRangeStmt(CXXForRangeStmt *S) {
1519  VisitStmt(S);
1520  Record.AddSourceLocation(S->getForLoc());
1521  Record.AddSourceLocation(S->getCoawaitLoc());
1522  Record.AddSourceLocation(S->getColonLoc());
1523  Record.AddSourceLocation(S->getRParenLoc());
1524  Record.AddStmt(S->getInit());
1525  Record.AddStmt(S->getRangeStmt());
1526  Record.AddStmt(S->getBeginStmt());
1527  Record.AddStmt(S->getEndStmt());
1528  Record.AddStmt(S->getCond());
1529  Record.AddStmt(S->getInc());
1530  Record.AddStmt(S->getLoopVarStmt());
1531  Record.AddStmt(S->getBody());
1533 }
1534 
1535 void ASTStmtWriter::VisitMSDependentExistsStmt(MSDependentExistsStmt *S) {
1536  VisitStmt(S);
1537  Record.AddSourceLocation(S->getKeywordLoc());
1538  Record.push_back(S->isIfExists());
1540  Record.AddDeclarationNameInfo(S->getNameInfo());
1541  Record.AddStmt(S->getSubStmt());
1543 }
1544 
1545 void ASTStmtWriter::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
1546  VisitCallExpr(E);
1547  Record.push_back(E->getOperator());
1548  Record.AddSourceRange(E->Range);
1549  Record.push_back(E->getFPFeatures().getAsOpaqueInt());
1551 }
1552 
1553 void ASTStmtWriter::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) {
1554  VisitCallExpr(E);
1556 }
1557 
1558 void ASTStmtWriter::VisitCXXRewrittenBinaryOperator(
1560  VisitExpr(E);
1561  Record.push_back(E->isReversed());
1562  Record.AddStmt(E->getSemanticForm());
1564 }
1565 
1566 void ASTStmtWriter::VisitCXXConstructExpr(CXXConstructExpr *E) {
1567  VisitExpr(E);
1568 
1569  Record.push_back(E->getNumArgs());
1570  Record.push_back(E->isElidable());
1571  Record.push_back(E->hadMultipleCandidates());
1572  Record.push_back(E->isListInitialization());
1575  Record.push_back(E->getConstructionKind()); // FIXME: stable encoding
1576  Record.AddSourceLocation(E->getLocation());
1577  Record.AddDeclRef(E->getConstructor());
1578  Record.AddSourceRange(E->getParenOrBraceRange());
1579 
1580  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1581  Record.AddStmt(E->getArg(I));
1582 
1584 }
1585 
1586 void ASTStmtWriter::VisitCXXInheritedCtorInitExpr(CXXInheritedCtorInitExpr *E) {
1587  VisitExpr(E);
1588  Record.AddDeclRef(E->getConstructor());
1589  Record.AddSourceLocation(E->getLocation());
1590  Record.push_back(E->constructsVBase());
1591  Record.push_back(E->inheritedFromVBase());
1593 }
1594 
1595 void ASTStmtWriter::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
1596  VisitCXXConstructExpr(E);
1597  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1599 }
1600 
1601 void ASTStmtWriter::VisitLambdaExpr(LambdaExpr *E) {
1602  VisitExpr(E);
1603  Record.push_back(E->LambdaExprBits.NumCaptures);
1604  Record.AddSourceRange(E->IntroducerRange);
1605  Record.push_back(E->LambdaExprBits.CaptureDefault); // FIXME: stable encoding
1606  Record.AddSourceLocation(E->CaptureDefaultLoc);
1607  Record.push_back(E->LambdaExprBits.ExplicitParams);
1608  Record.push_back(E->LambdaExprBits.ExplicitResultType);
1609  Record.AddSourceLocation(E->ClosingBrace);
1610 
1611  // Add capture initializers.
1613  CEnd = E->capture_init_end();
1614  C != CEnd; ++C) {
1615  Record.AddStmt(*C);
1616  }
1617 
1618  Record.AddStmt(E->getBody());
1619 
1621 }
1622 
1623 void ASTStmtWriter::VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E) {
1624  VisitExpr(E);
1625  Record.AddStmt(E->getSubExpr());
1627 }
1628 
1629 void ASTStmtWriter::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) {
1630  VisitExplicitCastExpr(E);
1632  Record.AddSourceRange(E->getAngleBrackets());
1633 }
1634 
1635 void ASTStmtWriter::VisitCXXStaticCastExpr(CXXStaticCastExpr *E) {
1636  VisitCXXNamedCastExpr(E);
1638 }
1639 
1640 void ASTStmtWriter::VisitCXXDynamicCastExpr(CXXDynamicCastExpr *E) {
1641  VisitCXXNamedCastExpr(E);
1643 }
1644 
1645 void ASTStmtWriter::VisitCXXReinterpretCastExpr(CXXReinterpretCastExpr *E) {
1646  VisitCXXNamedCastExpr(E);
1648 }
1649 
1650 void ASTStmtWriter::VisitCXXConstCastExpr(CXXConstCastExpr *E) {
1651  VisitCXXNamedCastExpr(E);
1653 }
1654 
1655 void ASTStmtWriter::VisitCXXAddrspaceCastExpr(CXXAddrspaceCastExpr *E) {
1656  VisitCXXNamedCastExpr(E);
1658 }
1659 
1660 void ASTStmtWriter::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E) {
1661  VisitExplicitCastExpr(E);
1662  Record.AddSourceLocation(E->getLParenLoc());
1663  Record.AddSourceLocation(E->getRParenLoc());
1665 }
1666 
1667 void ASTStmtWriter::VisitBuiltinBitCastExpr(BuiltinBitCastExpr *E) {
1668  VisitExplicitCastExpr(E);
1669  Record.AddSourceLocation(E->getBeginLoc());
1670  Record.AddSourceLocation(E->getEndLoc());
1672 }
1673 
1674 void ASTStmtWriter::VisitUserDefinedLiteral(UserDefinedLiteral *E) {
1675  VisitCallExpr(E);
1676  Record.AddSourceLocation(E->UDSuffixLoc);
1678 }
1679 
1680 void ASTStmtWriter::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) {
1681  VisitExpr(E);
1682  Record.push_back(E->getValue());
1683  Record.AddSourceLocation(E->getLocation());
1685 }
1686 
1687 void ASTStmtWriter::VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E) {
1688  VisitExpr(E);
1689  Record.AddSourceLocation(E->getLocation());
1691 }
1692 
1693 void ASTStmtWriter::VisitCXXTypeidExpr(CXXTypeidExpr *E) {
1694  VisitExpr(E);
1695  Record.AddSourceRange(E->getSourceRange());
1696  if (E->isTypeOperand()) {
1699  } else {
1700  Record.AddStmt(E->getExprOperand());
1702  }
1703 }
1704 
1705 void ASTStmtWriter::VisitCXXThisExpr(CXXThisExpr *E) {
1706  VisitExpr(E);
1707  Record.AddSourceLocation(E->getLocation());
1708  Record.push_back(E->isImplicit());
1710 }
1711 
1712 void ASTStmtWriter::VisitCXXThrowExpr(CXXThrowExpr *E) {
1713  VisitExpr(E);
1714  Record.AddSourceLocation(E->getThrowLoc());
1715  Record.AddStmt(E->getSubExpr());
1716  Record.push_back(E->isThrownVariableInScope());
1718 }
1719 
1720 void ASTStmtWriter::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
1721  VisitExpr(E);
1722  Record.AddDeclRef(E->getParam());
1723  Record.AddDeclRef(cast_or_null<Decl>(E->getUsedContext()));
1724  Record.AddSourceLocation(E->getUsedLocation());
1726 }
1727 
1728 void ASTStmtWriter::VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E) {
1729  VisitExpr(E);
1730  Record.AddDeclRef(E->getField());
1731  Record.AddDeclRef(cast_or_null<Decl>(E->getUsedContext()));
1732  Record.AddSourceLocation(E->getExprLoc());
1734 }
1735 
1736 void ASTStmtWriter::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
1737  VisitExpr(E);
1738  Record.AddCXXTemporary(E->getTemporary());
1739  Record.AddStmt(E->getSubExpr());
1741 }
1742 
1743 void ASTStmtWriter::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
1744  VisitExpr(E);
1745  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1746  Record.AddSourceLocation(E->getRParenLoc());
1748 }
1749 
1750 void ASTStmtWriter::VisitCXXNewExpr(CXXNewExpr *E) {
1751  VisitExpr(E);
1752 
1753  Record.push_back(E->isArray());
1754  Record.push_back(E->hasInitializer());
1755  Record.push_back(E->getNumPlacementArgs());
1756  Record.push_back(E->isParenTypeId());
1757 
1758  Record.push_back(E->isGlobalNew());
1759  Record.push_back(E->passAlignment());
1761  Record.push_back(E->CXXNewExprBits.StoredInitializationStyle);
1762 
1763  Record.AddDeclRef(E->getOperatorNew());
1764  Record.AddDeclRef(E->getOperatorDelete());
1766  if (E->isParenTypeId())
1767  Record.AddSourceRange(E->getTypeIdParens());
1768  Record.AddSourceRange(E->getSourceRange());
1769  Record.AddSourceRange(E->getDirectInitRange());
1770 
1771  for (CXXNewExpr::arg_iterator I = E->raw_arg_begin(), N = E->raw_arg_end();
1772  I != N; ++I)
1773  Record.AddStmt(*I);
1774 
1776 }
1777 
1778 void ASTStmtWriter::VisitCXXDeleteExpr(CXXDeleteExpr *E) {
1779  VisitExpr(E);
1780  Record.push_back(E->isGlobalDelete());
1781  Record.push_back(E->isArrayForm());
1782  Record.push_back(E->isArrayFormAsWritten());
1784  Record.AddDeclRef(E->getOperatorDelete());
1785  Record.AddStmt(E->getArgument());
1786  Record.AddSourceLocation(E->getBeginLoc());
1787 
1789 }
1790 
1791 void ASTStmtWriter::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
1792  VisitExpr(E);
1793 
1794  Record.AddStmt(E->getBase());
1795  Record.push_back(E->isArrow());
1796  Record.AddSourceLocation(E->getOperatorLoc());
1798  Record.AddTypeSourceInfo(E->getScopeTypeInfo());
1799  Record.AddSourceLocation(E->getColonColonLoc());
1800  Record.AddSourceLocation(E->getTildeLoc());
1801 
1802  // PseudoDestructorTypeStorage.
1804  if (E->getDestroyedTypeIdentifier())
1806  else
1808 
1810 }
1811 
1812 void ASTStmtWriter::VisitExprWithCleanups(ExprWithCleanups *E) {
1813  VisitExpr(E);
1814  Record.push_back(E->getNumObjects());
1815  for (auto &Obj : E->getObjects()) {
1816  if (auto *BD = Obj.dyn_cast<BlockDecl *>()) {
1818  Record.AddDeclRef(BD);
1819  } else if (auto *CLE = Obj.dyn_cast<CompoundLiteralExpr *>()) {
1821  Record.AddStmt(CLE);
1822  }
1823  }
1824 
1825  Record.push_back(E->cleanupsHaveSideEffects());
1826  Record.AddStmt(E->getSubExpr());
1828 }
1829 
1830 void ASTStmtWriter::VisitCXXDependentScopeMemberExpr(
1832  VisitExpr(E);
1833 
1834  // Don't emit anything here (or if you do you will have to update
1835  // the corresponding deserialization function).
1836 
1837  Record.push_back(E->hasTemplateKWAndArgsInfo());
1838  Record.push_back(E->getNumTemplateArgs());
1839  Record.push_back(E->hasFirstQualifierFoundInScope());
1840 
1841  if (E->hasTemplateKWAndArgsInfo()) {
1842  const ASTTemplateKWAndArgsInfo &ArgInfo =
1843  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
1844  AddTemplateKWAndArgsInfo(ArgInfo,
1845  E->getTrailingObjects<TemplateArgumentLoc>());
1846  }
1847 
1848  Record.push_back(E->isArrow());
1849  Record.AddSourceLocation(E->getOperatorLoc());
1850  Record.AddTypeRef(E->getBaseType());
1852  if (!E->isImplicitAccess())
1853  Record.AddStmt(E->getBase());
1854  else
1855  Record.AddStmt(nullptr);
1856 
1857  if (E->hasFirstQualifierFoundInScope())
1859 
1860  Record.AddDeclarationNameInfo(E->MemberNameInfo);
1862 }
1863 
1864 void
1865 ASTStmtWriter::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) {
1866  VisitExpr(E);
1867 
1868  // Don't emit anything here, HasTemplateKWAndArgsInfo must be
1869  // emitted first.
1870 
1871  Record.push_back(E->DependentScopeDeclRefExprBits.HasTemplateKWAndArgsInfo);
1872  if (E->DependentScopeDeclRefExprBits.HasTemplateKWAndArgsInfo) {
1873  const ASTTemplateKWAndArgsInfo &ArgInfo =
1874  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
1875  Record.push_back(ArgInfo.NumTemplateArgs);
1876  AddTemplateKWAndArgsInfo(ArgInfo,
1877  E->getTrailingObjects<TemplateArgumentLoc>());
1878  }
1879 
1881  Record.AddDeclarationNameInfo(E->NameInfo);
1883 }
1884 
1885 void
1886 ASTStmtWriter::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E) {
1887  VisitExpr(E);
1888  Record.push_back(E->arg_size());
1890  ArgI = E->arg_begin(), ArgE = E->arg_end(); ArgI != ArgE; ++ArgI)
1891  Record.AddStmt(*ArgI);
1892  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1893  Record.AddSourceLocation(E->getLParenLoc());
1894  Record.AddSourceLocation(E->getRParenLoc());
1896 }
1897 
1898 void ASTStmtWriter::VisitOverloadExpr(OverloadExpr *E) {
1899  VisitExpr(E);
1900 
1901  Record.push_back(E->getNumDecls());
1902  Record.push_back(E->hasTemplateKWAndArgsInfo());
1903  if (E->hasTemplateKWAndArgsInfo()) {
1904  const ASTTemplateKWAndArgsInfo &ArgInfo =
1906  Record.push_back(ArgInfo.NumTemplateArgs);
1908  }
1909 
1910  for (OverloadExpr::decls_iterator OvI = E->decls_begin(),
1911  OvE = E->decls_end();
1912  OvI != OvE; ++OvI) {
1913  Record.AddDeclRef(OvI.getDecl());
1914  Record.push_back(OvI.getAccess());
1915  }
1916 
1917  Record.AddDeclarationNameInfo(E->getNameInfo());
1919 }
1920 
1921 void ASTStmtWriter::VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
1922  VisitOverloadExpr(E);
1923  Record.push_back(E->isArrow());
1924  Record.push_back(E->hasUnresolvedUsing());
1925  Record.AddStmt(!E->isImplicitAccess() ? E->getBase() : nullptr);
1926  Record.AddTypeRef(E->getBaseType());
1927  Record.AddSourceLocation(E->getOperatorLoc());
1929 }
1930 
1931 void ASTStmtWriter::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) {
1932  VisitOverloadExpr(E);
1933  Record.push_back(E->requiresADL());
1934  Record.push_back(E->isOverloaded());
1935  Record.AddDeclRef(E->getNamingClass());
1937 }
1938 
1939 void ASTStmtWriter::VisitTypeTraitExpr(TypeTraitExpr *E) {
1940  VisitExpr(E);
1941  Record.push_back(E->TypeTraitExprBits.NumArgs);
1942  Record.push_back(E->TypeTraitExprBits.Kind); // FIXME: Stable encoding
1943  Record.push_back(E->TypeTraitExprBits.Value);
1944  Record.AddSourceRange(E->getSourceRange());
1945  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1946  Record.AddTypeSourceInfo(E->getArg(I));
1948 }
1949 
1950 void ASTStmtWriter::VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E) {
1951  VisitExpr(E);
1952  Record.push_back(E->getTrait());
1953  Record.push_back(E->getValue());
1954  Record.AddSourceRange(E->getSourceRange());
1956  Record.AddStmt(E->getDimensionExpression());
1958 }
1959 
1960 void ASTStmtWriter::VisitExpressionTraitExpr(ExpressionTraitExpr *E) {
1961  VisitExpr(E);
1962  Record.push_back(E->getTrait());
1963  Record.push_back(E->getValue());
1964  Record.AddSourceRange(E->getSourceRange());
1965  Record.AddStmt(E->getQueriedExpression());
1967 }
1968 
1969 void ASTStmtWriter::VisitCXXNoexceptExpr(CXXNoexceptExpr *E) {
1970  VisitExpr(E);
1971  Record.push_back(E->getValue());
1972  Record.AddSourceRange(E->getSourceRange());
1973  Record.AddStmt(E->getOperand());
1975 }
1976 
1977 void ASTStmtWriter::VisitPackExpansionExpr(PackExpansionExpr *E) {
1978  VisitExpr(E);
1979  Record.AddSourceLocation(E->getEllipsisLoc());
1980  Record.push_back(E->NumExpansions);
1981  Record.AddStmt(E->getPattern());
1983 }
1984 
1985 void ASTStmtWriter::VisitSizeOfPackExpr(SizeOfPackExpr *E) {
1986  VisitExpr(E);
1987  Record.push_back(E->isPartiallySubstituted() ? E->getPartialArguments().size()
1988  : 0);
1989  Record.AddSourceLocation(E->OperatorLoc);
1990  Record.AddSourceLocation(E->PackLoc);
1991  Record.AddSourceLocation(E->RParenLoc);
1992  Record.AddDeclRef(E->Pack);
1993  if (E->isPartiallySubstituted()) {
1994  for (const auto &TA : E->getPartialArguments())
1995  Record.AddTemplateArgument(TA);
1996  } else if (!E->isValueDependent()) {
1997  Record.push_back(E->getPackLength());
1998  }
2000 }
2001 
2002 void ASTStmtWriter::VisitSubstNonTypeTemplateParmExpr(
2004  VisitExpr(E);
2005  Record.AddDeclRef(E->getParameter());
2006  Record.AddSourceLocation(E->getNameLoc());
2007  Record.AddStmt(E->getReplacement());
2009 }
2010 
2011 void ASTStmtWriter::VisitSubstNonTypeTemplateParmPackExpr(
2013  VisitExpr(E);
2014  Record.AddDeclRef(E->getParameterPack());
2015  Record.AddTemplateArgument(E->getArgumentPack());
2018 }
2019 
2020 void ASTStmtWriter::VisitFunctionParmPackExpr(FunctionParmPackExpr *E) {
2021  VisitExpr(E);
2022  Record.push_back(E->getNumExpansions());
2023  Record.AddDeclRef(E->getParameterPack());
2025  for (FunctionParmPackExpr::iterator I = E->begin(), End = E->end();
2026  I != End; ++I)
2027  Record.AddDeclRef(*I);
2029 }
2030 
2031 void ASTStmtWriter::VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E) {
2032  VisitExpr(E);
2033  Record.push_back(static_cast<bool>(E->getLifetimeExtendedTemporaryDecl()));
2036  else
2037  Record.AddStmt(E->getSubExpr());
2039 }
2040 
2041 void ASTStmtWriter::VisitCXXFoldExpr(CXXFoldExpr *E) {
2042  VisitExpr(E);
2043  Record.AddSourceLocation(E->LParenLoc);
2044  Record.AddSourceLocation(E->EllipsisLoc);
2045  Record.AddSourceLocation(E->RParenLoc);
2046  Record.push_back(E->NumExpansions);
2047  Record.AddStmt(E->SubExprs[0]);
2048  Record.AddStmt(E->SubExprs[1]);
2049  Record.push_back(E->Opcode);
2051 }
2052 
2053 void ASTStmtWriter::VisitOpaqueValueExpr(OpaqueValueExpr *E) {
2054  VisitExpr(E);
2055  Record.AddStmt(E->getSourceExpr());
2056  Record.AddSourceLocation(E->getLocation());
2057  Record.push_back(E->isUnique());
2059 }
2060 
2061 void ASTStmtWriter::VisitTypoExpr(TypoExpr *E) {
2062  VisitExpr(E);
2063  // TODO: Figure out sane writer behavior for a TypoExpr, if necessary
2064  llvm_unreachable("Cannot write TypoExpr nodes");
2065 }
2066 
2067 //===----------------------------------------------------------------------===//
2068 // CUDA Expressions and Statements.
2069 //===----------------------------------------------------------------------===//
2070 
2071 void ASTStmtWriter::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E) {
2072  VisitCallExpr(E);
2073  Record.AddStmt(E->getConfig());
2075 }
2076 
2077 //===----------------------------------------------------------------------===//
2078 // OpenCL Expressions and Statements.
2079 //===----------------------------------------------------------------------===//
2080 void ASTStmtWriter::VisitAsTypeExpr(AsTypeExpr *E) {
2081  VisitExpr(E);
2082  Record.AddSourceLocation(E->getBuiltinLoc());
2083  Record.AddSourceLocation(E->getRParenLoc());
2084  Record.AddStmt(E->getSrcExpr());
2086 }
2087 
2088 //===----------------------------------------------------------------------===//
2089 // Microsoft Expressions and Statements.
2090 //===----------------------------------------------------------------------===//
2091 void ASTStmtWriter::VisitMSPropertyRefExpr(MSPropertyRefExpr *E) {
2092  VisitExpr(E);
2093  Record.push_back(E->isArrow());
2094  Record.AddStmt(E->getBaseExpr());
2096  Record.AddSourceLocation(E->getMemberLoc());
2097  Record.AddDeclRef(E->getPropertyDecl());
2099 }
2100 
2101 void ASTStmtWriter::VisitMSPropertySubscriptExpr(MSPropertySubscriptExpr *E) {
2102  VisitExpr(E);
2103  Record.AddStmt(E->getBase());
2104  Record.AddStmt(E->getIdx());
2105  Record.AddSourceLocation(E->getRBracketLoc());
2107 }
2108 
2109 void ASTStmtWriter::VisitCXXUuidofExpr(CXXUuidofExpr *E) {
2110  VisitExpr(E);
2111  Record.AddSourceRange(E->getSourceRange());
2112  Record.AddDeclRef(E->getGuidDecl());
2113  if (E->isTypeOperand()) {
2116  } else {
2117  Record.AddStmt(E->getExprOperand());
2119  }
2120 }
2121 
2122 void ASTStmtWriter::VisitSEHExceptStmt(SEHExceptStmt *S) {
2123  VisitStmt(S);
2124  Record.AddSourceLocation(S->getExceptLoc());
2125  Record.AddStmt(S->getFilterExpr());
2126  Record.AddStmt(S->getBlock());
2128 }
2129 
2130 void ASTStmtWriter::VisitSEHFinallyStmt(SEHFinallyStmt *S) {
2131  VisitStmt(S);
2132  Record.AddSourceLocation(S->getFinallyLoc());
2133  Record.AddStmt(S->getBlock());
2135 }
2136 
2137 void ASTStmtWriter::VisitSEHTryStmt(SEHTryStmt *S) {
2138  VisitStmt(S);
2139  Record.push_back(S->getIsCXXTry());
2140  Record.AddSourceLocation(S->getTryLoc());
2141  Record.AddStmt(S->getTryBlock());
2142  Record.AddStmt(S->getHandler());
2144 }
2145 
2146 void ASTStmtWriter::VisitSEHLeaveStmt(SEHLeaveStmt *S) {
2147  VisitStmt(S);
2148  Record.AddSourceLocation(S->getLeaveLoc());
2150 }
2151 
2152 //===----------------------------------------------------------------------===//
2153 // OpenMP Directives.
2154 //===----------------------------------------------------------------------===//
2155 void ASTStmtWriter::VisitOMPExecutableDirective(OMPExecutableDirective *E) {
2156  Record.AddSourceLocation(E->getBeginLoc());
2157  Record.AddSourceLocation(E->getEndLoc());
2158  for (unsigned i = 0; i < E->getNumClauses(); ++i) {
2159  Record.writeOMPClause(E->getClause(i));
2160  }
2161  if (E->hasAssociatedStmt())
2162  Record.AddStmt(E->getAssociatedStmt());
2163 }
2164 
2165 void ASTStmtWriter::VisitOMPLoopDirective(OMPLoopDirective *D) {
2166  VisitStmt(D);
2167  Record.push_back(D->getNumClauses());
2168  Record.push_back(D->getCollapsedNumber());
2169  VisitOMPExecutableDirective(D);
2170  Record.AddStmt(D->getIterationVariable());
2171  Record.AddStmt(D->getLastIteration());
2172  Record.AddStmt(D->getCalcLastIteration());
2173  Record.AddStmt(D->getPreCond());
2174  Record.AddStmt(D->getCond());
2175  Record.AddStmt(D->getInit());
2176  Record.AddStmt(D->getInc());
2177  Record.AddStmt(D->getPreInits());
2181  Record.AddStmt(D->getIsLastIterVariable());
2182  Record.AddStmt(D->getLowerBoundVariable());
2183  Record.AddStmt(D->getUpperBoundVariable());
2184  Record.AddStmt(D->getStrideVariable());
2185  Record.AddStmt(D->getEnsureUpperBound());
2186  Record.AddStmt(D->getNextLowerBound());
2187  Record.AddStmt(D->getNextUpperBound());
2188  Record.AddStmt(D->getNumIterations());
2189  }
2191  Record.AddStmt(D->getPrevLowerBoundVariable());
2192  Record.AddStmt(D->getPrevUpperBoundVariable());
2193  Record.AddStmt(D->getDistInc());
2194  Record.AddStmt(D->getPrevEnsureUpperBound());
2197  Record.AddStmt(D->getCombinedEnsureUpperBound());
2198  Record.AddStmt(D->getCombinedInit());
2199  Record.AddStmt(D->getCombinedCond());
2200  Record.AddStmt(D->getCombinedNextLowerBound());
2201  Record.AddStmt(D->getCombinedNextUpperBound());
2202  Record.AddStmt(D->getCombinedDistCond());
2203  Record.AddStmt(D->getCombinedParForInDistCond());
2204  }
2205  for (auto I : D->counters()) {
2206  Record.AddStmt(I);
2207  }
2208  for (auto I : D->private_counters()) {
2209  Record.AddStmt(I);
2210  }
2211  for (auto I : D->inits()) {
2212  Record.AddStmt(I);
2213  }
2214  for (auto I : D->updates()) {
2215  Record.AddStmt(I);
2216  }
2217  for (auto I : D->finals()) {
2218  Record.AddStmt(I);
2219  }
2220  for (Stmt *S : D->dependent_counters())
2221  Record.AddStmt(S);
2222  for (Stmt *S : D->dependent_inits())
2223  Record.AddStmt(S);
2224  for (Stmt *S : D->finals_conditions())
2225  Record.AddStmt(S);
2226 }
2227 
2228 void ASTStmtWriter::VisitOMPParallelDirective(OMPParallelDirective *D) {
2229  VisitStmt(D);
2230  Record.push_back(D->getNumClauses());
2231  VisitOMPExecutableDirective(D);
2232  Record.AddStmt(D->getTaskReductionRefExpr());
2233  Record.push_back(D->hasCancel() ? 1 : 0);
2235 }
2236 
2237 void ASTStmtWriter::VisitOMPSimdDirective(OMPSimdDirective *D) {
2238  VisitOMPLoopDirective(D);
2240 }
2241 
2242 void ASTStmtWriter::VisitOMPForDirective(OMPForDirective *D) {
2243  VisitOMPLoopDirective(D);
2244  Record.AddStmt(D->getTaskReductionRefExpr());
2245  Record.push_back(D->hasCancel() ? 1 : 0);
2247 }
2248 
2249 void ASTStmtWriter::VisitOMPForSimdDirective(OMPForSimdDirective *D) {
2250  VisitOMPLoopDirective(D);
2252 }
2253 
2254 void ASTStmtWriter::VisitOMPSectionsDirective(OMPSectionsDirective *D) {
2255  VisitStmt(D);
2256  Record.push_back(D->getNumClauses());
2257  VisitOMPExecutableDirective(D);
2258  Record.AddStmt(D->getTaskReductionRefExpr());
2259  Record.push_back(D->hasCancel() ? 1 : 0);
2261 }
2262 
2263 void ASTStmtWriter::VisitOMPSectionDirective(OMPSectionDirective *D) {
2264  VisitStmt(D);
2265  VisitOMPExecutableDirective(D);
2266  Record.push_back(D->hasCancel() ? 1 : 0);
2268 }
2269 
2270 void ASTStmtWriter::VisitOMPSingleDirective(OMPSingleDirective *D) {
2271  VisitStmt(D);
2272  Record.push_back(D->getNumClauses());
2273  VisitOMPExecutableDirective(D);
2275 }
2276 
2277 void ASTStmtWriter::VisitOMPMasterDirective(OMPMasterDirective *D) {
2278  VisitStmt(D);
2279  VisitOMPExecutableDirective(D);
2281 }
2282 
2283 void ASTStmtWriter::VisitOMPCriticalDirective(OMPCriticalDirective *D) {
2284  VisitStmt(D);
2285  Record.push_back(D->getNumClauses());
2286  VisitOMPExecutableDirective(D);
2289 }
2290 
2291 void ASTStmtWriter::VisitOMPParallelForDirective(OMPParallelForDirective *D) {
2292  VisitOMPLoopDirective(D);
2293  Record.AddStmt(D->getTaskReductionRefExpr());
2294  Record.push_back(D->hasCancel() ? 1 : 0);
2296 }
2297 
2298 void ASTStmtWriter::VisitOMPParallelForSimdDirective(
2300  VisitOMPLoopDirective(D);
2302 }
2303 
2304 void ASTStmtWriter::VisitOMPParallelMasterDirective(
2306  VisitStmt(D);
2307  Record.push_back(D->getNumClauses());
2308  VisitOMPExecutableDirective(D);
2309  Record.AddStmt(D->getTaskReductionRefExpr());
2311 }
2312 
2313 void ASTStmtWriter::VisitOMPParallelSectionsDirective(
2315  VisitStmt(D);
2316  Record.push_back(D->getNumClauses());
2317  VisitOMPExecutableDirective(D);
2318  Record.AddStmt(D->getTaskReductionRefExpr());
2319  Record.push_back(D->hasCancel() ? 1 : 0);
2321 }
2322 
2323 void ASTStmtWriter::VisitOMPTaskDirective(OMPTaskDirective *D) {
2324  VisitStmt(D);
2325  Record.push_back(D->getNumClauses());
2326  VisitOMPExecutableDirective(D);
2327  Record.push_back(D->hasCancel() ? 1 : 0);
2329 }
2330 
2331 void ASTStmtWriter::VisitOMPAtomicDirective(OMPAtomicDirective *D) {
2332  VisitStmt(D);
2333  Record.push_back(D->getNumClauses());
2334  VisitOMPExecutableDirective(D);
2335  Record.AddStmt(D->getX());
2336  Record.AddStmt(D->getV());
2337  Record.AddStmt(D->getExpr());
2338  Record.AddStmt(D->getUpdateExpr());
2339  Record.push_back(D->isXLHSInRHSPart() ? 1 : 0);
2340  Record.push_back(D->isPostfixUpdate() ? 1 : 0);
2342 }
2343 
2344 void ASTStmtWriter::VisitOMPTargetDirective(OMPTargetDirective *D) {
2345  VisitStmt(D);
2346  Record.push_back(D->getNumClauses());
2347  VisitOMPExecutableDirective(D);
2349 }
2350 
2351 void ASTStmtWriter::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) {
2352  VisitStmt(D);
2353  Record.push_back(D->getNumClauses());
2354  VisitOMPExecutableDirective(D);
2356 }
2357 
2358 void ASTStmtWriter::VisitOMPTargetEnterDataDirective(
2360  VisitStmt(D);
2361  Record.push_back(D->getNumClauses());
2362  VisitOMPExecutableDirective(D);
2364 }
2365 
2366 void ASTStmtWriter::VisitOMPTargetExitDataDirective(
2368  VisitStmt(D);
2369  Record.push_back(D->getNumClauses());
2370  VisitOMPExecutableDirective(D);
2372 }
2373 
2374 void ASTStmtWriter::VisitOMPTargetParallelDirective(
2376  VisitStmt(D);
2377  Record.push_back(D->getNumClauses());
2378  VisitOMPExecutableDirective(D);
2379  Record.AddStmt(D->getTaskReductionRefExpr());
2380  Record.writeBool(D->hasCancel());
2382 }
2383 
2384 void ASTStmtWriter::VisitOMPTargetParallelForDirective(
2386  VisitOMPLoopDirective(D);
2387  Record.AddStmt(D->getTaskReductionRefExpr());
2388  Record.push_back(D->hasCancel() ? 1 : 0);
2390 }
2391 
2392 void ASTStmtWriter::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) {
2393  VisitStmt(D);
2394  VisitOMPExecutableDirective(D);
2396 }
2397 
2398 void ASTStmtWriter::VisitOMPBarrierDirective(OMPBarrierDirective *D) {
2399  VisitStmt(D);
2400  VisitOMPExecutableDirective(D);
2402 }
2403 
2404 void ASTStmtWriter::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) {
2405  VisitStmt(D);
2406  VisitOMPExecutableDirective(D);
2408 }
2409 
2410 void ASTStmtWriter::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) {
2411  VisitStmt(D);
2412  Record.push_back(D->getNumClauses());
2413  VisitOMPExecutableDirective(D);
2414  Record.AddStmt(D->getReductionRef());
2416 }
2417 
2418 void ASTStmtWriter::VisitOMPFlushDirective(OMPFlushDirective *D) {
2419  VisitStmt(D);
2420  Record.push_back(D->getNumClauses());
2421  VisitOMPExecutableDirective(D);
2423 }
2424 
2425 void ASTStmtWriter::VisitOMPDepobjDirective(OMPDepobjDirective *D) {
2426  VisitStmt(D);
2427  Record.push_back(D->getNumClauses());
2428  VisitOMPExecutableDirective(D);
2430 }
2431 
2432 void ASTStmtWriter::VisitOMPScanDirective(OMPScanDirective *D) {
2433  VisitStmt(D);
2434  Record.push_back(D->getNumClauses());
2435  VisitOMPExecutableDirective(D);
2437 }
2438 
2439 void ASTStmtWriter::VisitOMPOrderedDirective(OMPOrderedDirective *D) {
2440  VisitStmt(D);
2441  Record.push_back(D->getNumClauses());
2442  VisitOMPExecutableDirective(D);
2444 }
2445 
2446 void ASTStmtWriter::VisitOMPTeamsDirective(OMPTeamsDirective *D) {
2447  VisitStmt(D);
2448  Record.push_back(D->getNumClauses());
2449  VisitOMPExecutableDirective(D);
2451 }
2452 
2453 void ASTStmtWriter::VisitOMPCancellationPointDirective(
2455  VisitStmt(D);
2456  VisitOMPExecutableDirective(D);
2457  Record.push_back(uint64_t(D->getCancelRegion()));
2459 }
2460 
2461 void ASTStmtWriter::VisitOMPCancelDirective(OMPCancelDirective *D) {
2462  VisitStmt(D);
2463  Record.push_back(D->getNumClauses());
2464  VisitOMPExecutableDirective(D);
2465  Record.push_back(uint64_t(D->getCancelRegion()));
2467 }
2468 
2469 void ASTStmtWriter::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) {
2470  VisitOMPLoopDirective(D);
2471  Record.push_back(D->hasCancel() ? 1 : 0);
2473 }
2474 
2475 void ASTStmtWriter::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) {
2476  VisitOMPLoopDirective(D);
2478 }
2479 
2480 void ASTStmtWriter::VisitOMPMasterTaskLoopDirective(
2482  VisitOMPLoopDirective(D);
2483  Record.push_back(D->hasCancel() ? 1 : 0);
2485 }
2486 
2487 void ASTStmtWriter::VisitOMPMasterTaskLoopSimdDirective(
2489  VisitOMPLoopDirective(D);
2491 }
2492 
2493 void ASTStmtWriter::VisitOMPParallelMasterTaskLoopDirective(
2495  VisitOMPLoopDirective(D);
2496  Record.push_back(D->hasCancel() ? 1 : 0);
2498 }
2499 
2500 void ASTStmtWriter::VisitOMPParallelMasterTaskLoopSimdDirective(
2502  VisitOMPLoopDirective(D);
2504 }
2505 
2506 void ASTStmtWriter::VisitOMPDistributeDirective(OMPDistributeDirective *D) {
2507  VisitOMPLoopDirective(D);
2509 }
2510 
2511 void ASTStmtWriter::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) {
2512  VisitStmt(D);
2513  Record.push_back(D->getNumClauses());
2514  VisitOMPExecutableDirective(D);
2516 }
2517 
2518 void ASTStmtWriter::VisitOMPDistributeParallelForDirective(
2520  VisitOMPLoopDirective(D);
2521  Record.AddStmt(D->getTaskReductionRefExpr());
2522  Record.push_back(D->hasCancel() ? 1 : 0);
2524 }
2525 
2526 void ASTStmtWriter::VisitOMPDistributeParallelForSimdDirective(
2528  VisitOMPLoopDirective(D);
2530 }
2531 
2532 void ASTStmtWriter::VisitOMPDistributeSimdDirective(
2534  VisitOMPLoopDirective(D);
2536 }
2537 
2538 void ASTStmtWriter::VisitOMPTargetParallelForSimdDirective(
2540  VisitOMPLoopDirective(D);
2542 }
2543 
2544 void ASTStmtWriter::VisitOMPTargetSimdDirective(OMPTargetSimdDirective *D) {
2545  VisitOMPLoopDirective(D);
2547 }
2548 
2549 void ASTStmtWriter::VisitOMPTeamsDistributeDirective(
2551  VisitOMPLoopDirective(D);
2553 }
2554 
2555 void ASTStmtWriter::VisitOMPTeamsDistributeSimdDirective(
2557  VisitOMPLoopDirective(D);
2559 }
2560 
2561 void ASTStmtWriter::VisitOMPTeamsDistributeParallelForSimdDirective(
2563  VisitOMPLoopDirective(D);
2565 }
2566 
2567 void ASTStmtWriter::VisitOMPTeamsDistributeParallelForDirective(
2569  VisitOMPLoopDirective(D);
2570  Record.AddStmt(D->getTaskReductionRefExpr());
2571  Record.push_back(D->hasCancel() ? 1 : 0);
2573 }
2574 
2575 void ASTStmtWriter::VisitOMPTargetTeamsDirective(OMPTargetTeamsDirective *D) {
2576  VisitStmt(D);
2577  Record.push_back(D->getNumClauses());
2578  VisitOMPExecutableDirective(D);
2580 }
2581 
2582 void ASTStmtWriter::VisitOMPTargetTeamsDistributeDirective(
2584  VisitOMPLoopDirective(D);
2586 }
2587 
2588 void ASTStmtWriter::VisitOMPTargetTeamsDistributeParallelForDirective(
2590  VisitOMPLoopDirective(D);
2591  Record.AddStmt(D->getTaskReductionRefExpr());
2592  Record.push_back(D->hasCancel() ? 1 : 0);
2594 }
2595 
2596 void ASTStmtWriter::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
2598  VisitOMPLoopDirective(D);
2599  Code = serialization::
2601 }
2602 
2603 void ASTStmtWriter::VisitOMPTargetTeamsDistributeSimdDirective(
2605  VisitOMPLoopDirective(D);
2607 }
2608 
2609 //===----------------------------------------------------------------------===//
2610 // ASTWriter Implementation
2611 //===----------------------------------------------------------------------===//
2612 
2614  assert(SwitchCaseIDs.find(S) == SwitchCaseIDs.end() &&
2615  "SwitchCase recorded twice");
2616  unsigned NextID = SwitchCaseIDs.size();
2617  SwitchCaseIDs[S] = NextID;
2618  return NextID;
2619 }
2620 
2622  assert(SwitchCaseIDs.find(S) != SwitchCaseIDs.end() &&
2623  "SwitchCase hasn't been seen yet");
2624  return SwitchCaseIDs[S];
2625 }
2626 
2628  SwitchCaseIDs.clear();
2629 }
2630 
2631 /// Write the given substatement or subexpression to the
2632 /// bitstream.
2633 void ASTWriter::WriteSubStmt(Stmt *S) {
2634  RecordData Record;
2635  ASTStmtWriter Writer(*this, Record);
2636  ++NumStatements;
2637 
2638  if (!S) {
2639  Stream.EmitRecord(serialization::STMT_NULL_PTR, Record);
2640  return;
2641  }
2642 
2643  llvm::DenseMap<Stmt *, uint64_t>::iterator I = SubStmtEntries.find(S);
2644  if (I != SubStmtEntries.end()) {
2645  Record.push_back(I->second);
2646  Stream.EmitRecord(serialization::STMT_REF_PTR, Record);
2647  return;
2648  }
2649 
2650 #ifndef NDEBUG
2651  assert(!ParentStmts.count(S) && "There is a Stmt cycle!");
2652 
2653  struct ParentStmtInserterRAII {
2654  Stmt *S;
2655  llvm::DenseSet<Stmt *> &ParentStmts;
2656 
2657  ParentStmtInserterRAII(Stmt *S, llvm::DenseSet<Stmt *> &ParentStmts)
2658  : S(S), ParentStmts(ParentStmts) {
2659  ParentStmts.insert(S);
2660  }
2661  ~ParentStmtInserterRAII() {
2662  ParentStmts.erase(S);
2663  }
2664  };
2665 
2666  ParentStmtInserterRAII ParentStmtInserter(S, ParentStmts);
2667 #endif
2668 
2669  Writer.Visit(S);
2670 
2671  uint64_t Offset = Writer.Emit();
2672  SubStmtEntries[S] = Offset;
2673 }
2674 
2675 /// Flush all of the statements that have been added to the
2676 /// queue via AddStmt().
2677 void ASTRecordWriter::FlushStmts() {
2678  // We expect to be the only consumer of the two temporary statement maps,
2679  // assert that they are empty.
2680  assert(Writer->SubStmtEntries.empty() && "unexpected entries in sub-stmt map");
2681  assert(Writer->ParentStmts.empty() && "unexpected entries in parent stmt map");
2682 
2683  for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) {
2684  Writer->WriteSubStmt(StmtsToEmit[I]);
2685 
2686  assert(N == StmtsToEmit.size() && "record modified while being written!");
2687 
2688  // Note that we are at the end of a full expression. Any
2689  // expression records that follow this one are part of a different
2690  // expression.
2691  Writer->Stream.EmitRecord(serialization::STMT_STOP, ArrayRef<uint32_t>());
2692 
2693  Writer->SubStmtEntries.clear();
2694  Writer->ParentStmts.clear();
2695  }
2696 
2697  StmtsToEmit.clear();
2698 }
2699 
2700 void ASTRecordWriter::FlushSubStmts() {
2701  // For a nested statement, write out the substatements in reverse order (so
2702  // that a simple stack machine can be used when loading), and don't emit a
2703  // STMT_STOP after each one.
2704  for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) {
2705  Writer->WriteSubStmt(StmtsToEmit[N - I - 1]);
2706  assert(N == StmtsToEmit.size() && "record modified while being written!");
2707  }
2708 
2709  StmtsToEmit.clear();
2710 }
SourceLocation getRParenLoc() const
Definition: Stmt.h:2421
Expr * getInc()
Definition: Stmt.h:2477
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:614
unsigned getNumSemanticExprs() const
Definition: Expr.h:5978
A PredefinedExpr record.
Definition: ASTBitCodes.h:1574
const Expr * getSubExpr() const
Definition: Expr.h:972
A call to an overloaded operator written using operator syntax.
Definition: ExprCXX.h:82
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
Definition: ExprObjC.h:1566
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:423
The receiver is the instance of the superclass object.
Definition: ExprObjC.h:1097
Represents a single C99 designator.
Definition: Expr.h:4921
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: Expr.h:1351
SourceLocation getRBracLoc() const
Definition: Stmt.h:1474
Defines the clang::ASTContext interface.
A CompoundLiteralExpr record.
Definition: ASTBitCodes.h:1637
This represents &#39;#pragma omp distribute simd&#39; composite directive.
Definition: StmtOpenMP.h:3975
const BlockDecl * getBlockDecl() const
Definition: Expr.h:5796
Expr * getNextUpperBound() const
Definition: StmtOpenMP.h:1007
IdentifierInfo * getInputIdentifier(unsigned i) const
Definition: Stmt.h:3028
This represents &#39;#pragma omp master&#39; directive.
Definition: StmtOpenMP.h:1628
ConstantExprBitfields ConstantExprBits
Definition: Stmt.h:1016
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition: ExprCXX.h:1059
SourceLocation getRParenLoc() const
Definition: Stmt.h:2935
The null pointer literal (C++11 [lex.nullptr])
Definition: ExprCXX.h:729
unsigned getNumDecls() const
Gets the number of declarations in the unresolved set.
Definition: ExprCXX.h:2945
This represents &#39;#pragma omp task&#39; directive.
Definition: StmtOpenMP.h:2062
This represents a GCC inline-assembly statement extension.
Definition: Stmt.h:2912
Represents a &#39;co_await&#39; expression while the type of the promise is dependent.
Definition: ExprCXX.h:4727
SourceLocation getForLoc() const
Definition: StmtCXX.h:201
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
Definition: Expr.h:1287
static DiagnosticBuilder Diag(DiagnosticsEngine *Diags, const LangOptions &Features, FullSourceLoc TokLoc, const char *TokBegin, const char *TokRangeBegin, const char *TokRangeEnd, unsigned DiagID)
Produce a diagnostic highlighting some portion of a literal.
The receiver is an object instance.
Definition: ExprObjC.h:1091
Expr * getLHS() const
Definition: Expr.h:4004
Expr * getUpperBoundVariable() const
Definition: StmtOpenMP.h:975
unsigned getNumInputs() const
Definition: Stmt.h:2824
SourceLocation getOpLoc() const
Definition: ExprObjC.h:1517
Expr * getSyntacticForm()
Return the syntactic form of this expression, i.e.
Definition: Expr.h:5958
SourceLocation getRParenLoc() const
Definition: Expr.h:2997
ObjCDictionaryElement getKeyValueElement(unsigned Index) const
Definition: ExprObjC.h:362
CompoundStmt * getBlock() const
Definition: Stmt.h:3303
An IndirectGotoStmt record.
Definition: ASTBitCodes.h:1547
SourceLocation getForLoc() const
Definition: Stmt.h:2490
SourceLocation getUsedLocation() const
Retrieve the location where this default argument was actually used.
Definition: ExprCXX.h:1253
uint64_t getValue() const
Definition: ExprCXX.h:2760
StringKind getKind() const
Definition: Expr.h:1835
An AddrLabelExpr record.
Definition: ASTBitCodes.h:1667
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Definition: Expr.h:3133
NameKind
The kind of the name stored in this DeclarationName.
Expr * getCond() const
Definition: Expr.h:4389
ObjCMethodDecl * getAtIndexMethodDecl() const
Definition: ExprObjC.h:886
Selector getSelector() const
Definition: ExprObjC.cpp:306
SourceRange getSourceRange() const
Definition: ExprCXX.h:3979
Helper expressions and declaration for OMPIteratorExpr class for each iteration space.
Definition: ExprOpenMP.h:211
void AddToken(const Token &Tok, RecordDataImpl &Record)
Emit a token.
Definition: ASTWriter.cpp:4258
SourceLocation getEllipsisLoc() const
Get the location of the ... in a case statement of the form LHS ... RHS.
Definition: Stmt.h:1609
SourceLocation getLParen() const
Get the location of the left parentheses &#39;(&#39;.
Definition: Expr.h:2091
const Expr * getSubExpr() const
Definition: ExprCXX.h:1167
Expr * getCond()
Definition: Stmt.h:2309
Expr * getExpr(unsigned Index)
getExpr - Return the Expr at the specified index.
Definition: Expr.h:4262
A CXXStaticCastExpr record.
Definition: ASTBitCodes.h:1798
ArrayRef< Expr * > dependent_counters()
Definition: StmtOpenMP.h:1147
unsigned getNumSubExprs() const
getNumSubExprs - Return the size of the SubExprs array.
Definition: Expr.h:4256
bool isSuperReceiver() const
Definition: ExprObjC.h:772
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2627
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:2948
ArrayRef< ParmVarDecl * > getLocalParameters() const
Definition: ExprConcepts.h:508
VarDecl * getParameterPack() const
Get the parameter pack which this expression refers to.
Definition: ExprCXX.h:4361
SourceLocation TemplateKWLoc
The source location of the template keyword; this is used as part of the representation of qualified ...
Definition: TemplateBase.h:663
An AttributedStmt record.
Definition: ASTBitCodes.h:1526
CompoundStmt * getSubStmt()
Definition: Expr.h:4191
A CXXReinterpretCastExpr record.
Definition: ASTBitCodes.h:1804
const Expr * getInit(unsigned Init) const
Definition: Expr.h:4663
const DeclContext * getParentContext() const
If the SourceLocExpr has been resolved return the subexpression representing the resolved value...
Definition: Expr.h:4547
unsigned getNumAsmToks()
Definition: Stmt.h:3165
An ObjCBoolLiteralExpr record.
Definition: ASTBitCodes.h:1763
SourceLocation getRParenLoc() const
Definition: StmtObjC.h:107
bool isThrownVariableInScope() const
Determines whether the variable thrown by this expression (if any!) is within the innermost try block...
Definition: ExprCXX.h:1177
Expr *const * semantics_iterator
Definition: Expr.h:5980
ObjCProtocolDecl * getProtocol() const
Definition: ExprObjC.h:521
Represents a &#39;co_return&#39; statement in the C++ Coroutines TS.
Definition: StmtCXX.h:456
Stmt - This represents one statement.
Definition: Stmt.h:68
Expr * getLowerBoundVariable() const
Definition: StmtOpenMP.h:967
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition: Expr.h:2897
Expr * getDimensionExpression() const
Definition: ExprCXX.h:2762
const ObjCAtFinallyStmt * getFinallyStmt() const
Retrieve the @finally statement, if any.
Definition: StmtObjC.h:235
CXXCatchStmt * getHandler(unsigned i)
Definition: StmtCXX.h:107
bool isArrayFormAsWritten() const
Definition: ExprCXX.h:2387
IfStmt - This represents an if/then/else.
Definition: Stmt.h:1868
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
Definition: Expr.h:2435
SourceLocation getRParenLoc() const
Definition: Expr.h:4243
SourceLocation getLocation() const
Definition: Expr.h:1647
ObjCMethodDecl * setAtIndexMethodDecl() const
Definition: ExprObjC.h:890
void AddNestedNameSpecifierLoc(NestedNameSpecifierLoc NNS)
Emit a nested name specifier with source-location information.
Definition: ASTWriter.cpp:5510
unsigned getNumOutputs() const
Definition: Stmt.h:2802
This represents &#39;#pragma omp for simd&#39; directive.
Definition: StmtOpenMP.h:1361
ArrayRef< CleanupObject > getObjects() const
Definition: ExprCXX.h:3332
Expr * getBase() const
Definition: Expr.h:3127
const StringLiteral * getAsmString() const
Definition: Stmt.h:2940
TypeSourceInfo * getTypeSourceInfo() const
Definition: Expr.h:3324
An ImplicitValueInitExpr record.
Definition: ASTBitCodes.h:1661
iterator end()
Definition: DeclGroup.h:105
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:89
This represents &#39;#pragma omp teams distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:4389
An ImplicitCastExpr record.
Definition: ASTBitCodes.h:1631
Stmt * getHandlerBlock() const
Definition: StmtCXX.h:51
SourceLocation getBeginLoc() const
Returns starting location of directive kind.
Definition: StmtOpenMP.h:225
Expr * CounterUpdate
Updater for the internal counter: ++CounterVD;.
Definition: ExprOpenMP.h:221
llvm::APFloat getValue() const
Definition: Expr.h:1606
ObjCMethodDecl * getImplicitPropertySetter() const
Definition: ExprObjC.h:713
void writeBool(bool Value)
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Definition: Expr.h:5288
FunctionDecl * getOperatorNew() const
Definition: ExprCXX.h:2219
unsigned getScale() const
Definition: Expr.h:1521
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:3035
A BuiltinBitCastExpr record.
Definition: ASTBitCodes.h:1816
DeclarationNameInfo getNameInfo() const
Retrieve the name of the entity we&#39;re testing for, along with location information.
Definition: StmtCXX.h:288
const Expr * getSubExpr() const
Definition: Expr.h:4474
Defines the C++ template declaration subclasses.
Opcode getOpcode() const
Definition: Expr.h:3676
This represents &#39;#pragma omp parallel master&#39; directive.
Definition: StmtOpenMP.h:1913
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:5096
SourceLocation getIdentLoc() const
Definition: Stmt.h:1780
Represents an attribute applied to a statement.
Definition: Stmt.h:1810
Expr * getBase()
Fetches base expression of array shaping expression.
Definition: ExprOpenMP.h:190
ParenExpr - This represents a parethesized expression, e.g.
Definition: Expr.h:2068
NamedDecl * getDecl() const
A CXXOperatorCallExpr record.
Definition: ASTBitCodes.h:1780
bool hasQualifier() const
Determines whether this member expression actually had a C++ nested-name-specifier prior to the name ...
Definition: Expr.h:3147
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies this name, if any.
Definition: StmtCXX.h:284
Expr * getLowerBound()
Get lower bound of array section.
Definition: ExprOpenMP.h:79
This represents &#39;#pragma omp target teams distribute&#39; combined directive.
Definition: StmtOpenMP.h:4541
A CXXTemporaryObjectExpr record.
Definition: ASTBitCodes.h:1795
Represents Objective-C&#39;s @throw statement.
Definition: StmtObjC.h:332
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called...
Definition: ExprCXX.h:1537
SourceLocation getLocation() const
Definition: ExprCXX.h:743
const RecordDecl * getCapturedRecordDecl() const
Retrieve the record declaration for captured variables.
Definition: Stmt.h:3528
SourceLocation getRParenLoc() const
Definition: Expr.h:2580
SourceLocation getKeywordLoc() const
Definition: ExprCXX.h:4756
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1426
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: Stmt.h:1285
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:841
TypeSourceInfo * getTypeInfoAsWritten() const
getTypeInfoAsWritten - Returns the type source info for the type that this expression is casting to...
Definition: Expr.h:3553
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent...
Definition: ExprCXX.h:2715
bool getIsCXXTry() const
Definition: Stmt.h:3345
SourceLocation getLParenLoc() const
Definition: Expr.h:3595
A constant expression context.
Definition: ASTBitCodes.h:1571
Expr * getCombinedParForInDistCond() const
Definition: StmtOpenMP.h:1095
A container of type source information.
Definition: Type.h:6373
This represents &#39;#pragma omp parallel for&#39; directive.
Definition: StmtOpenMP.h:1752
MS property subscript expression.
Definition: ExprCXX.h:960
IdentKind getIdentKind() const
Definition: Expr.h:1999
SourceLocation getGotoLoc() const
Definition: Stmt.h:2570
SourceLocation getRParenLoc() const
Definition: ExprCXX.h:2078
This represents &#39;#pragma omp target teams distribute parallel for&#39; combined directive.
Definition: StmtOpenMP.h:4610
Expr * Update
Update expression for the originally specified iteration variable, calculated as VD = Begin + Counter...
Definition: ExprOpenMP.h:219
Expr * getCombinedEnsureUpperBound() const
Definition: StmtOpenMP.h:1059
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
Definition: ExprCXX.h:4414
float __ovld __cnfn distance(float p0, float p1)
Returns the distance between p0 and p1.
SourceLocation getAccessorLoc() const
Definition: Expr.h:5748
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
Definition: Expr.h:4324
unsigned getDeclRefExprAbbrev() const
Definition: ASTWriter.h:701
VarDecl * CounterVD
Internal normalized counter.
Definition: ExprOpenMP.h:213
const Expr * getSubExpr() const
Definition: Expr.h:1683
SourceLocation getAtLoc() const
Definition: ExprObjC.h:69
SourceLocation getCoawaitLoc() const
Definition: StmtCXX.h:202
Expr * getIndexExpr(unsigned Idx)
Definition: Expr.h:2463
SourceLocation getEndLoc() const
Returns ending location of directive.
Definition: StmtOpenMP.h:227
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:2047
This represents &#39;#pragma omp target exit data&#39; directive.
Definition: StmtOpenMP.h:2824
Stmt * getSubStmt()
Definition: Stmt.h:1701
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
Definition: StmtOpenMP.h:1960
const VarDecl * getNRVOCandidate() const
Retrieve the variable that might be used for the named return value optimization. ...
Definition: Stmt.h:2712
SourceLocation getLParenLoc() const
Definition: Stmt.h:2492
bool hasTemplateKWAndArgsInfo() const
Definition: Expr.h:1297
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:3042
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC &#39;id&#39; type.
Definition: ExprObjC.h:1482
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:3291
ArrayRef< Expr * > dependent_inits()
Definition: StmtOpenMP.h:1153
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprCXX.h:859
SourceLocation getOperatorLoc() const
Retrieve the location of the &#39;.&#39; or &#39;->&#39; operator.
Definition: ExprCXX.h:2545
SourceLocation getAtLoc() const
Definition: ExprObjC.h:471
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
Definition: ExprCXX.h:2676
SourceRange getSourceRange() const
Definition: ExprCXX.h:2344
ObjCInterfaceDecl * getClassReceiver() const
Definition: ExprObjC.h:767
Expr * getCombinedUpperBoundVariable() const
Definition: StmtOpenMP.h:1053
SourceLocation getColonLoc() const
Definition: Expr.h:3960
bool isArrow() const
Definition: ExprObjC.h:1509
SourceLocation getLeftLoc() const
Definition: ExprObjC.h:1406
Expr * getCalcLastIteration() const
Definition: StmtOpenMP.h:935
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition: ExprCXX.h:761
Stmt * getThen()
Definition: Stmt.h:1955
SourceLocation getIfLoc() const
Definition: Stmt.h:2027
unsigned getNumPlacementArgs() const
Definition: ExprCXX.h:2237
TypeSourceInfo * getArgumentTypeInfo() const
Definition: Expr.h:2550
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
Definition: ExprCXX.h:3103
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range that covers this offsetof node.
Definition: Expr.h:2381
capture_iterator capture_begin()
Retrieve an iterator pointing to the first capture.
Definition: Stmt.h:3553
A CXXConstructExpr record.
Definition: ASTBitCodes.h:1789
unsigned getNumExpressions() const
Definition: Expr.h:2478
SourceLocation getLocation() const
Retrieve the location of the literal.
Definition: Expr.h:1475
raw_arg_iterator raw_arg_begin()
Definition: ExprCXX.h:2329
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will call.
Definition: ExprCXX.h:1652
A C++ throw-expression (C++ [except.throw]).
Definition: ExprCXX.h:1147
Expr * getExprOperand() const
Definition: ExprCXX.h:852
Represents an expression – generally a full-expression – that introduces cleanups to be run at the ...
Definition: ExprCXX.h:3304
TypeSourceInfo * getArg(unsigned I) const
Retrieve the Ith argument.
Definition: ExprCXX.h:2679
Represents a parameter to a function.
Definition: Decl.h:1595
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprObjC.h:162
SourceLocation getRParenLoc() const
Definition: Expr.h:5693
SourceLocation getLocation() const
Retrieve the location of the literal.
Definition: Expr.h:1517
void AddString(StringRef Str)
Emit a string.
iterator begin() const
Definition: ExprCXX.h:4369
bool isXLHSInRHSPart() const
Return true if helper update expression has form &#39;OpaqueValueExpr(x) binop OpaqueValueExpr(expr)&#39; and...
Definition: StmtOpenMP.h:2620
void AddSourceRange(SourceRange Range)
Emit a source range.
A ShuffleVectorExpr record.
Definition: ASTBitCodes.h:1682
SourceLocation getBuiltinLoc() const
Definition: Expr.h:4396
ObjCPropertyDecl * getExplicitProperty() const
Definition: ExprObjC.h:703
SourceLocation getRParenLoc() const
Definition: ExprOpenMP.h:171
A C++ static_cast expression (C++ [expr.static.cast]).
Definition: ExprCXX.h:420
void AddTypeSourceInfo(TypeSourceInfo *TInfo)
Emits a reference to a declarator info.
Definition: ASTWriter.cpp:5296
Expr * getExprOperand() const
Definition: ExprCXX.h:1063
const Stmt * getSubStmt() const
Definition: StmtObjC.h:379
SourceLocation getRParenLoc() const
Retrieve the location of the closing parenthesis.
Definition: ExprCXX.h:396
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:1766
Represents a C99 designated initializer expression.
Definition: Expr.h:4846
SourceLocation getAtLoc() const
Definition: ExprObjC.h:525
NamedDecl * getFoundDecl() const
Definition: ASTConcept.h:150
An OffsetOfExpr record.
Definition: ASTBitCodes.h:1604
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition: Decl.h:272
TypeSourceInfo * getEncodedTypeSourceInfo() const
Definition: ExprObjC.h:430
Expr * getSemanticForm()
Get an equivalent semantic form for this expression.
Definition: ExprCXX.h:302
TypeSourceInfo * getScopeTypeInfo() const
Retrieve the scope type in a qualified pseudo-destructor expression.
Definition: ExprCXX.h:2556
SourceLocation getKeywordLoc() const
Definition: StmtCXX.h:476
Stmt * getBody()
Definition: Stmt.h:2413
An ObjCAtThrowStmt record.
Definition: ASTBitCodes.h:1757
SourceLocation getTildeLoc() const
Retrieve the location of the &#39;~&#39;.
Definition: ExprCXX.h:2563
FieldDecl * getField() const
For a field offsetof node, returns the field.
Definition: Expr.h:2360
SourceLocation getRParenLoc() const
Definition: Expr.h:6139
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(), or __builtin_FILE().
Definition: Expr.h:4507
void AddTypeRef(QualType T)
Emit a reference to a type.
An element in an Objective-C dictionary literal.
Definition: ExprObjC.h:263
A DesignatedInitExpr record.
Definition: ASTBitCodes.h:1646
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
Definition: ExprConcepts.h:471
This represents &#39;#pragma omp parallel&#39; directive.
Definition: StmtOpenMP.h:357
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition: Expr.h:4222
bool cleanupsHaveSideEffects() const
Definition: ExprCXX.h:3344
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
Definition: StmtOpenMP.h:3886
QualType getComputationResultType() const
Definition: Expr.h:3916
SourceLocation getRParen() const
Get the location of the right parentheses &#39;)&#39;.
Definition: Expr.h:2095
DeclStmt * getConditionVariableDeclStmt()
If this SwitchStmt has a condition variable, return the faux DeclStmt associated with the creation of...
Definition: Stmt.h:2194
bool isFileScope() const
Definition: Expr.h:3318
Frontend produces RecoveryExprs on semantic errors that prevent creating other well-formed expression...
Definition: Expr.h:6228
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
Definition: StmtOpenMP.h:1492
SourceLocation getAmpAmpLoc() const
Definition: Expr.h:4144
Expr * getEnsureUpperBound() const
Definition: StmtOpenMP.h:991
NameKind getNameKind() const
Determine what kind of name this is.
SourceLocation getEndLoc() const
Definition: Stmt.h:1282
Represents a member of a struct/union/class.
Definition: Decl.h:2740
An explicit cast in C or a C-style cast in C++, which uses the syntax ([s1][s2]...[sn])expr.
Definition: ExprOpenMP.h:122
Expr * getBase()
Retrieve the base object of this member expressions, e.g., the x in x.m.
Definition: ExprCXX.h:3848
Represents a place-holder for an object not to be initialized by anything.
Definition: Expr.h:5144
NonTypeTemplateParmDecl * getParameter() const
Definition: ExprCXX.h:4238
const DeclarationNameInfo & getNameInfo() const
Gets the full name info.
Definition: ExprCXX.h:2948
StringLiteral * getString()
Definition: ExprObjC.h:65
unsigned getArrayExprIndex() const
For an array element node, returns the index into the array of expressions.
Definition: Expr.h:2354
Expr * getInc() const
Definition: StmtOpenMP.h:951
SourceLocation getLabelLoc() const
Definition: Expr.h:4146
SourceLocation getRBraceLoc() const
Definition: Expr.h:4759
SourceLocation getOperatorLoc() const
Definition: Expr.h:2577
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Definition: Expr.h:4424
ArrayRef< Expr * > updates()
Definition: StmtOpenMP.h:1135
SourceLocation getRParenLoc() const
Definition: Expr.h:3598
The iterator over UnresolvedSets.
Definition: UnresolvedSet.h:32
This represents &#39;#pragma omp target simd&#39; directive.
Definition: StmtOpenMP.h:4113
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
Definition: Expr.h:1140
Represents a C++ member access expression for which lookup produced a set of overloaded functions...
Definition: ExprCXX.h:3771
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:5724
const DeclGroupRef getDeclGroup() const
Definition: Stmt.h:1277
OpenMPDirectiveKind getDirectiveKind() const
Definition: StmtOpenMP.h:301
bool isAllEnumCasesCovered() const
Returns true if the SwitchStmt is a switch of an enum value and all cases have been explicitly covere...
Definition: Stmt.h:2231
Expr * getSubExpr()
Definition: Expr.h:3400
This represents &#39;#pragma omp barrier&#39; directive.
Definition: StmtOpenMP.h:2177
SourceLocation getQuestionLoc() const
Definition: Expr.h:3959
void AddTemplateParameterList(const TemplateParameterList *TemplateParams)
Emit a template parameter list.
Definition: ASTWriter.cpp:5564
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp, [NSNumber numberWithInt:42]];.
Definition: ExprObjC.h:190
unsigned getCharByteWidth() const
Definition: Expr.h:1833
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:433
ArrayRef< SourceRange > getBracketsRanges() const
Fetches source ranges for the brackets os the array shaping expression.
Definition: ExprOpenMP.h:185
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition: ExprCXX.h:4264
This represents &#39;#pragma omp critical&#39; directive.
Definition: StmtOpenMP.h:1677
OpenMPDirectiveKind getCancelRegion() const
Get cancellation region for the current cancellation point.
Definition: StmtOpenMP.h:3160
bool hadArrayRangeDesignator() const
Definition: Expr.h:4780
SourceLocation getCatchLoc() const
Definition: StmtCXX.h:48
Selector getSelector() const
Definition: ExprObjC.h:468
void AddIdentifierRef(const IdentifierInfo *II)
Emit a reference to an identifier.
Represents Objective-C&#39;s @catch statement.
Definition: StmtObjC.h:77
SourceLocation getOpLoc() const
Definition: ExprObjC.h:597
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:3599
IndirectGotoStmt - This represents an indirect goto.
Definition: Stmt.h:2554
Describes an C or C++ initializer list.
Definition: Expr.h:4615
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition: ExprCXX.h:809
This represents &#39;#pragma omp distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:3811
bool isArrow() const
Definition: ExprObjC.h:584
ArrayRef< Stmt const * > getParamMoves() const
Definition: StmtCXX.h:417
This represents &#39;#pragma omp teams distribute parallel for simd&#39; composite directive.
Definition: StmtOpenMP.h:4318
Expr * getKeyExpr() const
Definition: ExprObjC.h:883
ASTWriter::RecordDataImpl & getRecordData() const
Extract the underlying record storage.
unsigned getNumExpansions() const
Get the number of parameters in this parameter pack.
Definition: ExprCXX.h:4373
unsigned getLength() const
Definition: Expr.h:1832
ForStmt - This represents a &#39;for (init;cond;inc)&#39; stmt.
Definition: Stmt.h:2444
ArrayRef< Expr * > finals()
Definition: StmtOpenMP.h:1141
Expr * getIsLastIterVariable() const
Definition: StmtOpenMP.h:959
FunctionDecl * getOperatorDelete() const
Definition: ExprCXX.h:2399
Expr * getBaseExpr() const
Definition: ExprObjC.h:880
TemplateArgument getArgumentPack() const
Retrieve the template argument pack containing the substituted template arguments.
Definition: ExprCXX.cpp:1509
bool isElidable() const
Whether this construction is elidable.
Definition: ExprCXX.h:1504
Expr * getOperand() const
Definition: ExprCXX.h:3975
unsigned getIntegerLiteralAbbrev() const
Definition: ASTWriter.h:703
const Expr * getThrowExpr() const
Definition: StmtObjC.h:344
bool isGlobalNew() const
Definition: ExprCXX.h:2260
SourceLocation getParameterPackLocation() const
Retrieve the location of the parameter pack name.
Definition: ExprCXX.h:4295
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
Definition: ExprCXX.h:2395
LabelDecl * getDecl() const
Definition: Stmt.h:1783
Expr * getX()
Get &#39;x&#39; part of the associated expression/statement.
Definition: StmtOpenMP.h:2604
ArrayRef< Expr * > getDimensions() const
Fetches the dimensions for array shaping expression.
Definition: ExprOpenMP.h:180
SourceLocation getLBracLoc() const
Definition: Stmt.h:1473
A reference to a previously [de]serialized Stmt record.
Definition: ASTBitCodes.h:1508
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
Definition: ExprCXX.h:1946
SourceLocation getRParenLoc() const
Definition: StmtCXX.h:204
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
Definition: Expr.h:417
path_iterator path_begin()
Definition: Expr.h:3420
SourceLocation getIsaMemberLoc() const
getMemberLoc - Return the location of the "member", in X->F, it is the location of &#39;F&#39;...
Definition: ExprObjC.h:1514
Stmt * getBody()
Definition: Stmt.h:2478
OpenMP 5.0 [2.1.6 Iterators] Iterators are identifiers that expand to multiple values in the clause o...
Definition: ExprOpenMP.h:248
semantics_iterator semantics_end()
Definition: Expr.h:5988
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: ExprCXX.h:3713
Expr * getIterationVariable() const
Definition: StmtOpenMP.h:927
LifetimeExtendedTemporaryDecl * getLifetimeExtendedTemporaryDecl()
Definition: ExprCXX.h:4454
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3632
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:3890
bool constructsVBase() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
Definition: ExprCXX.h:1656
Stmt * getInit()
Definition: Stmt.h:2457
Expr * getOutputExpr(unsigned i)
Definition: Stmt.cpp:439
iterator begin()
Definition: DeclGroup.h:99
bool hadMultipleCandidates() const
Returns true if this member expression refers to a method that was resolved from an overloaded set ha...
Definition: Expr.h:3254
unsigned getCharacterLiteralAbbrev() const
Definition: ASTWriter.h:702
SourceLocation getThrowLoc() const
Definition: ExprCXX.h:1170
unsigned getResultExprIndex() const
Return the index of the result-bearing expression into the semantics expressions, or PseudoObjectExpr...
Definition: Expr.h:5963
const StringLiteral * getInputConstraintLiteral(unsigned i) const
Definition: Stmt.h:3041
CXXForRangeStmt - This represents C++0x [stmt.ranged]&#39;s ranged for statement, represented as &#39;for (ra...
Definition: StmtCXX.h:134
bool isArrow() const
Definition: Expr.h:3234
ConceptDecl * getNamedConcept() const
Definition: ASTConcept.h:154
labels_range labels()
Definition: Stmt.h:3084
This represents &#39;#pragma omp cancellation point&#39; directive.
Definition: StmtOpenMP.h:3115
ObjCStringLiteral, used for Objective-C string literals i.e.
Definition: ExprObjC.h:52
SourceLocation getEqualOrColonLoc() const
Retrieve the location of the &#39;=&#39; that precedes the initializer value itself, if present.
Definition: Expr.h:5071
const CallExpr * getConfig() const
Definition: ExprCXX.h:258
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
Definition: StmtOpenMP.h:3038
bool isArrow() const
Definition: ExprCXX.h:944
CaseStmt - Represent a case statement.
Definition: Stmt.h:1534
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
Definition: Expr.h:6177
Expr * getCond()
Definition: Stmt.h:2476
IdentKind getIdentKind() const
Definition: Expr.h:4528
SourceLocation getContinueLoc() const
Definition: Stmt.h:2612
This represents &#39;#pragma omp teams&#39; directive.
Definition: StmtOpenMP.h:3057
Expr * getInit() const
Definition: StmtOpenMP.h:947
SourceLocation getEndLoc() const
Definition: Expr.h:4552
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:3361
FieldDecl * getField()
Get the field whose initializer will be used.
Definition: ExprCXX.h:1308
Helper class for OffsetOfExpr.
Definition: Expr.h:2296
A marker record that indicates that we are at the end of an expression.
Definition: ASTBitCodes.h:1502
This represents &#39;#pragma omp teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:4247
Represents binding an expression to a temporary.
Definition: ExprCXX.h:1378
StringLiteral * getClobberStringLiteral(unsigned i)
Definition: Stmt.h:3121
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
Definition: ExprCXX.h:4656
Expr * Key
The key for the dictionary element.
Definition: ExprObjC.h:265
SourceLocation getBuiltinLoc() const
Definition: Expr.h:4485
CXXTemporary * getTemporary()
Definition: ExprCXX.h:1396
bool isOpenMPWorksharingDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a worksharing directive.
ObjCMethodDecl * getArrayWithObjectsMethod() const
Definition: ExprObjC.h:241
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition: ExprCXX.h:1822
CXXRecordDecl * getNamingClass()
Gets the &#39;naming class&#39; (in the sense of C++0x [class.access.base]p5) of the lookup.
Definition: ExprCXX.h:3111
NestedNameSpecifierLoc getQualifierLoc() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name, with source-location information.
Definition: Expr.h:1269
bool isTypeDependent() const
isTypeDependent - Determines whether this expression is type-dependent (C++ [temp.dep.expr]), which means that its type could change from one template instantiation to the next.
Definition: Expr.h:182
SourceLocation getTryLoc() const
Definition: Stmt.h:3342
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3511
FPOptionsOverride getStoredFPFeatures() const
Get FPFeatures from trailing storage.
Definition: Expr.h:3818
This represents &#39;#pragma omp scan&#39; directive.
Definition: StmtOpenMP.h:4848
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "for" statement, if any.
Definition: Stmt.cpp:930
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
Definition: Expr.h:2170
SourceLocation getNameLoc() const
Definition: ExprCXX.h:4230
TypeSourceInfo * getTypeSourceInfo() const
Definition: ExprCXX.h:2074
Stmt * getBody()
Definition: Stmt.h:2149
void AddAPInt(const llvm::APInt &Value)
Emit an integral value.
SourceLocation getLocation() const
Definition: ExprObjC.h:107
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1207
Stmt * getInit()
Definition: Stmt.h:2011
bool isExact() const
Definition: Expr.h:1639
bool isTypeOperand() const
Definition: ExprCXX.h:1052
SourceLocation getTokenLocation() const
getTokenLocation - The location of the __null token.
Definition: Expr.h:4438
llvm::APFloatBase::Semantics getRawSemantics() const
Get a raw enumeration value representing the floating-point semantics of this literal (32-bit IEEE...
Definition: Expr.h:1616
NamedDecl * getFirstQualifierFoundInScope() const
Retrieve the first part of the nested-name-specifier that was found in the scope of the member access...
Definition: ExprCXX.h:3645
Represents the this expression in C++.
Definition: ExprCXX.h:1108
ObjCMethodDecl * getDictWithObjectsMethod() const
Definition: ExprObjC.h:376
arg_iterator arg_end()
Definition: Expr.h:2955
ObjCIvarDecl * getDecl()
Definition: ExprObjC.h:576
SourceLocation getRParenLoc() const
Retrieve the location of the right parentheses (&#39;)&#39;) that follows the argument list.
Definition: ExprCXX.h:3438
TypeSourceInfo * getAllocatedTypeSourceInfo() const
Definition: ExprCXX.h:2198
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
Definition: TemplateBase.h:652
NestedNameSpecifierLoc getQualifierLoc() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name...
Definition: Expr.h:3152
void AddAPValue(const APValue &Value)
Emit an APvalue.
Definition: ASTWriter.cpp:5139
TypeSourceInfo * getQueriedTypeSourceInfo() const
Definition: ExprCXX.h:2758
bool isArrayForm() const
Definition: ExprCXX.h:2386
unsigned RecordSwitchCaseID(SwitchCase *S)
Record an ID for the given switch-case statement.
const ObjCAtCatchStmt * getCatchStmt(unsigned I) const
Retrieve a @catch statement.
Definition: StmtObjC.h:217
This represents &#39;#pragma omp target parallel for simd&#39; directive.
Definition: StmtOpenMP.h:4043
ArrayRef< Expr * > private_counters()
Definition: StmtOpenMP.h:1123
OpenMP 4.0 [2.4, Array Sections].
Definition: ExprOpenMP.h:45
ConditionalOperator - The ?: ternary operator.
Definition: Expr.h:3970
TypeSourceInfo * getTypeSourceInfo() const
Definition: ExprCXX.h:1783
This represents &#39;#pragma omp depobj&#39; directive.
Definition: StmtOpenMP.h:2400
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
Definition: ExprCXX.h:1528
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition: ExprCXX.h:2479
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
Definition: ExprCXX.h:3931
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:1366
unsigned NumTemplateArgs
The number of template arguments in TemplateArgs.
Definition: TemplateBase.h:666
SourceLocation getRBracket() const
Definition: ExprObjC.h:871
bool isMicrosoftABI() const
Returns whether this is really a Win64 ABI va_arg expression.
Definition: Expr.h:4479
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1557
void AddDeclarationNameLoc(const DeclarationNameLoc &DNLoc, DeclarationName Name)
Definition: ASTWriter.cpp:5465
Expr ** getSubExprs()
Definition: Expr.h:6115
CompoundStmt * getSubStmt() const
Retrieve the compound statement that will be included in the program only if the existence of the sym...
Definition: StmtCXX.h:292
This represents &#39;#pragma omp taskgroup&#39; directive.
Definition: StmtOpenMP.h:2269
void AddCXXTemporary(const CXXTemporary *Temp)
Emit a CXXTemporary.
Definition: ASTWriter.cpp:5251
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
Definition: ExprCXX.h:1498
QualType getComputationLHSType() const
Definition: Expr.h:3913
bool hasStoredFPFeatures() const
Definition: Expr.h:3815
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprObjC.h:218
SourceLocation getRParenLoc() const
Definition: ExprObjC.h:472
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
Definition: Expr.h:2505
SourceLocation getTryLoc() const
Definition: StmtCXX.h:94
bool isConstexpr() const
Definition: Stmt.h:2041
Expr * getCombinedLowerBoundVariable() const
Definition: StmtOpenMP.h:1047
SourceLocation getLocation() const
Definition: ExprCXX.h:1500
SourceLocation getRBracketLoc() const
Definition: ExprCXX.h:997
SourceLocation getLocation() const
Definition: Expr.h:1258
unsigned getSwitchCaseID(SwitchCase *S)
Retrieve the ID for the given switch-case statement.
InitListExpr * getUpdater() const
Definition: Expr.h:5203
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition: Expr.h:987
Represents a call to the builtin function __builtin_va_arg.
Definition: Expr.h:4458
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
Definition: StmtOpenMP.h:1825
SourceLocation getLabelLoc() const
Definition: Stmt.h:2533
bool isImplicitAccess() const
True if this is an implicit access, i.e.
Definition: ExprCXX.h:3601
SourceLocation getThrowLoc() const LLVM_READONLY
Definition: StmtObjC.h:348
unsigned Offset
Definition: Format.cpp:2020
static unsigned getNumSubExprs(AtomicOp Op)
Determine the number of arguments the specified atomic builtin should have.
Definition: Expr.cpp:4680
unsigned getValue() const
Definition: Expr.h:1573
This represents &#39;#pragma omp distribute&#39; directive.
Definition: StmtOpenMP.h:3685
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition: Expr.h:5864
SourceLocation getDestroyedTypeLoc() const
Retrieve the starting location of the type being destroyed.
Definition: ExprCXX.h:2587
ObjCMethodDecl * getBoxingMethod() const
Definition: ExprObjC.h:147
SourceLocation getFinallyLoc() const
Definition: Stmt.h:3300
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type...
Definition: ExprCXX.h:2055
ADLCallKind getADLCallKind() const
Definition: Expr.h:2875
const Stmt * getAssociatedStmt() const
Returns statement associated with the directive.
Definition: StmtOpenMP.h:253
SourceLocation getOperatorLoc() const
Retrieve the location of the &#39;->&#39; or &#39;.&#39; operator.
Definition: ExprCXX.h:3870
Expr * getCond() const
Definition: Expr.h:3993
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1829
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition: Decl.h:4058
llvm::MutableArrayRef< Designator > designators()
Definition: Expr.h:5049
DeclAccessPair getFoundDecl() const
Retrieves the declaration found by lookup.
Definition: Expr.h:3137
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:4467
This represents one expression.
Definition: Expr.h:110
SourceLocation getElseLoc() const
Definition: Stmt.h:2030
DeclStmt * getEndStmt()
Definition: StmtCXX.h:165
SourceLocation End
unsigned getTemplateDepth() const
Definition: Expr.h:4203
IdentifierInfo * getFieldName() const
For a field or identifier offsetof node, returns the name of the field.
Definition: Expr.cpp:1527
CXXBaseSpecifier * getBase() const
For a base class node, returns the base specifier.
Definition: Expr.h:2370
void AddTemplateArgument(const TemplateArgument &Arg)
Emit a template argument.
bool isArrow() const
Determine whether this member expression used the &#39;->&#39; operator; otherwise, it used the &#39;...
Definition: ExprCXX.h:3867
StringRef getClobber(unsigned i) const
Definition: Stmt.h:3216
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
Definition: StmtOpenMP.h:419
bool isImplicitAccess() const
True if this is an implicit access, i.e., one in which the member being accessed was not written in t...
Definition: ExprCXX.cpp:1415
SourceLocation getWhileLoc() const
Definition: Stmt.h:2361
This represents &#39;#pragma omp master taskloop&#39; directive.
Definition: StmtOpenMP.h:3385
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
Definition: StmtOpenMP.h:2043
This file defines the classes used to store parsed information about declaration-specifiers and decla...
unsigned getPackLength() const
Retrieve the length of the parameter pack.
Definition: ExprCXX.h:4165
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why? This is only meaningful if the named memb...
Definition: Expr.h:3274
Represents a C++ functional cast expression that builds a temporary object.
Definition: ExprCXX.h:1754
A C++ const_cast expression (C++ [expr.const.cast]).
Definition: ExprCXX.h:538
SourceLocation getLocation() const
Definition: ExprCXX.h:1119
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:5784
Field designator where only the field name is known.
Definition: ASTBitCodes.h:1961
VarDecl * getExceptionDecl() const
Definition: StmtCXX.h:49
IdentifierInfo * getDestroyedTypeIdentifier() const
In a dependent pseudo-destructor expression for which we do not have full type information on the des...
Definition: ExprCXX.h:2579
Expr * getCallee()
Definition: Expr.h:2871
unsigned getNumInits() const
Definition: Expr.h:4645
Stmt * getBody() const
Retrieve the body of the lambda.
Definition: ExprCXX.h:2003
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1345
This represents &#39;#pragma omp target teams distribute parallel for simd&#39; combined directive.
Definition: StmtOpenMP.h:4707
raw_arg_iterator raw_arg_end()
Definition: ExprCXX.h:2330
bool isArrow() const
Determine whether this pseudo-destructor expression was written using an &#39;->&#39; (otherwise, it used a &#39;.
Definition: ExprCXX.h:2542
Stmt * getBody()
Definition: Stmt.h:2321
A CXXAddrspaceCastExpr record.
Definition: ASTBitCodes.h:1810
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
Definition: ExprObjC.h:306
const CompoundStmt * getSynchBody() const
Definition: StmtObjC.h:297
SourceLocation getLParenLoc() const
Definition: Expr.h:5396
Expr * getRHS()
Definition: Stmt.h:1635
bool hasQualifier() const
Determine whether this declaration reference was preceded by a C++ nested-name-specifier, e.g., N::foo.
Definition: Expr.h:1265
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:1822
TypeSourceInfo * getTypeSourceInfo() const
Definition: Expr.h:2442
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:4088
SourceLocation getRBracketLoc() const
Definition: ExprOpenMP.h:100
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:5845
An ArraySubscriptExpr record.
Definition: ASTBitCodes.h:1610
SourceLocation getAtTryLoc() const
Retrieve the location of the @ in the @try.
Definition: StmtObjC.h:204
bool refersToEnclosingVariableOrCapture() const
Does this DeclRefExpr refer to an enclosing local or a captured variable?
Definition: Expr.h:1380
IdentifierInfo & getAccessor() const
Definition: Expr.h:5745
This represents &#39;#pragma omp target teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:4780
ArrayTypeTrait getTrait() const
Definition: ExprCXX.h:2754
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
Definition: StmtOpenMP.h:4686
decls_iterator decls_begin() const
Definition: ExprCXX.h:2934
unsigned size() const
Definition: Stmt.h:1394
unsigned getNumClauses() const
Get number of clauses.
Definition: StmtOpenMP.h:241
An ArrayInitLoopExpr record.
Definition: ASTBitCodes.h:1655
Expr * getDistInc() const
Definition: StmtOpenMP.h:1035
A PseudoObjectExpr record.
Definition: ASTBitCodes.h:1694
SourceRange getAngleBrackets() const LLVM_READONLY
Definition: ExprCXX.h:400
Expr * getNextLowerBound() const
Definition: StmtOpenMP.h:999
Kind getKind() const
Determine what kind of offsetof node this is.
Definition: Expr.h:2350
QualType getType() const
Definition: Expr.h:142
SourceLocation getEndLoc() const
Definition: Expr.h:6251
Expr * getPrevEnsureUpperBound() const
Definition: StmtOpenMP.h:1041
SourceLocation getKeywordLoc() const
Retrieve the location of the __if_exists or __if_not_exists keyword.
Definition: StmtCXX.h:274
capture_init_range capture_inits()
Definition: Stmt.h:3575
This represents &#39;#pragma omp for&#39; directive.
Definition: StmtOpenMP.h:1272
An ObjCIndirectCopyRestoreExpr record.
Definition: ASTBitCodes.h:1739
Expr * getElement(unsigned Index)
getElement - Return the Element at the specified index.
Definition: ExprObjC.h:232
const DeclarationNameInfo & getConceptNameInfo() const
Definition: ASTConcept.h:142
Optional< unsigned > NumExpansions
The number of elements this pack expansion will expand to, if this is a pack expansion and is known...
Definition: ExprObjC.h:275
SourceLocation getSwitchLoc() const
Definition: Stmt.h:2210
LabelDecl * getLabel() const
Definition: Stmt.h:2528
bool hasInitializer() const
Whether this new-expression has any initializer at all.
Definition: ExprCXX.h:2263
const Stmt * getTryBody() const
Retrieve the @try body.
Definition: StmtObjC.h:208
Represents a folding of a pack over an operator.
Definition: ExprCXX.h:4524
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
Definition: Stmt.h:2670
This represents &#39;#pragma omp target teams&#39; directive.
Definition: StmtOpenMP.h:4482
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
Definition: Expr.h:5870
An expression that sends a message to the given Objective-C object or class.
Definition: ExprObjC.h:940
void AddDeclRef(const Decl *D)
Emit a reference to a declaration.
This represents a Microsoft inline-assembly statement extension.
Definition: Stmt.h:3135
SourceLocation getDoLoc() const
Definition: Stmt.h:2417
SwitchCase * getSwitchCaseList()
Definition: Stmt.h:2206
SourceLocation getAtLoc() const
Definition: StmtObjC.h:388
ObjCMethodDecl * getImplicitPropertyGetter() const
Definition: ExprObjC.h:708
A DesignatedInitUpdateExpr record.
Definition: ASTBitCodes.h:1649
SourceLocation getRBracketLoc() const
Definition: Expr.h:2648
void AddStmt(Stmt *S)
Add the given statement or expression to the queue of statements to emit.
SourceLocation getEnd() const
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:2119
Expr * getInputExpr(unsigned i)
Definition: Stmt.cpp:741
Expr * getOutputExpr(unsigned i)
Definition: Stmt.cpp:737
bool isOpenMPTaskLoopDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a taskloop directive.
void AddSelectorRef(Selector S)
Emit a Selector (which is a smart pointer reference).
Definition: ASTWriter.cpp:5228
IteratorRange getIteratorRange(unsigned I)
Gets the iterator range for the given iterator.
Definition: Expr.cpp:4894
SourceLocation getMemberLoc() const
getMemberLoc - Return the location of the "member", in X->F, it is the location of &#39;F&#39;...
Definition: Expr.h:3239
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
Definition: ExprObjC.h:1224
bool usesGNUSyntax() const
Determines whether this designated initializer used the deprecated GNU syntax for designated initiali...
Definition: Expr.h:5080
AtomicOp getOp() const
Definition: Expr.h:6112
A member reference to an MSPropertyDecl.
Definition: ExprCXX.h:889
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition: ExprCXX.h:4206
const OffsetOfNode & getComponent(unsigned Idx) const
Definition: Expr.h:2449
This represents &#39;#pragma omp cancel&#39; directive.
Definition: StmtOpenMP.h:3174
Expr * getTrueExpr() const
getTrueExpr - Return the subexpression which will be evaluated if the condition evaluates to true; th...
Definition: Expr.h:4079
Expr * getCond()
Definition: Stmt.h:1943
ValueDecl * getDecl()
Definition: Expr.h:1250
An ObjCAvailabilityCheckExpr record.
Definition: ASTBitCodes.h:1766
SourceLocation getLocation() const
Definition: Expr.h:2003
SourceLocation getRParenLoc() const
Definition: Expr.h:4488
SourceLocation getForLoc() const
Definition: StmtObjC.h:52
const Expr * getSubExpr() const
Definition: Expr.h:2083
ObjCBridgeCastKind getBridgeKind() const
Determine which kind of bridge is being performed via this cast.
Definition: ExprObjC.h:1652
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprCXX.h:1072
const Expr * getSubExpr() const
Definition: ExprCXX.h:1400
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:3569
const DeclContext * getUsedContext() const
Definition: ExprCXX.h:1249
Expr * getLHS()
An array access can be written A[4] or 4[A] (both are equivalent).
Definition: Expr.h:2629
LambdaExprBitfields LambdaExprBits
Definition: Stmt.h:1061
bool getValue() const
Definition: ExprCXX.h:703
bool hadMultipleCandidates() const
Returns true if this expression refers to a function that was resolved from an overloaded set having ...
Definition: Expr.h:1363
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Definition: ASTConcept.h:158
void writeOMPClause(OMPClause *C)
Definition: ASTWriter.cpp:6129
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1...
Definition: Expr.h:1671
This represents &#39;#pragma omp flush&#39; directive.
Definition: StmtOpenMP.h:2343
An ObjCForCollectionStmt record.
Definition: ASTBitCodes.h:1742
ArrayRef< concepts::Requirement * > getRequirements() const
Definition: ExprConcepts.h:514
This represents &#39;#pragma omp parallel for simd&#39; directive.
Definition: StmtOpenMP.h:1846
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
Definition: Expr.h:424
DoStmt - This represents a &#39;do/while&#39; stmt.
Definition: Stmt.h:2388
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
Definition: Stmt.h:2753
SourceLocation getOperatorLoc() const
Retrieve the location of the &#39;->&#39; or &#39;.&#39; operator.
Definition: ExprCXX.h:3621
SourceLocation getLParenLoc() const
Retrieve the location of the left parentheses (&#39;(&#39;) that precedes the argument list.
Definition: ExprCXX.h:3433
A MS-style AsmStmt record.
Definition: ASTBitCodes.h:1568
void push_back(uint64_t N)
Minimal vector-like interface.
This represents &#39;#pragma omp parallel master taskloop&#39; directive.
Definition: StmtOpenMP.h:3533
Expr * getLastIteration() const
Definition: StmtOpenMP.h:931
bool isPostfixUpdate() const
Return true if &#39;v&#39; expression must be updated to original value of &#39;x&#39;, false if &#39;v&#39; must be updated ...
Definition: StmtOpenMP.h:2623
Expr * getArgument()
Definition: ExprCXX.h:2401
This represents &#39;#pragma omp target enter data&#39; directive.
Definition: StmtOpenMP.h:2765
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
Definition: StmtOpenMP.h:2944
Expr * getStrideVariable() const
Definition: StmtOpenMP.h:983
This represents &#39;#pragma omp master taskloop simd&#39; directive.
Definition: StmtOpenMP.h:3465
SourceLocation getEndLoc() const LLVM_READONLY
Definition: ExprConcepts.h:539
bool getValue() const
Definition: ExprCXX.h:3981
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Definition: ExprCXX.h:456
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
Definition: Expr.h:1090
Expr * getBase() const
Definition: Expr.h:5200
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition: Expr.h:4290
unsigned getNumArgs() const
Return the number of actual arguments in this message, not counting the receiver. ...
Definition: ExprObjC.h:1372
Expr * getCombinedDistCond() const
Definition: StmtOpenMP.h:1089
const Stmt * getPreInits() const
Definition: StmtOpenMP.h:955
#define false
Definition: stdbool.h:17
SourceLocation getLParenLoc() const
Definition: Expr.h:3321
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr...
Definition: ExprCXX.h:2842
A field in a dependent type, known only by its name.
Definition: Expr.h:2305
This captures a statement into a function.
Definition: Stmt.h:3410
Represents a call to an inherited base class constructor from an inheriting constructor.
Definition: ExprCXX.h:1617
ExpressionTrait getTrait() const
Definition: ExprCXX.h:2820
unsigned path_size() const
Definition: Expr.h:3419
Token * getAsmToks()
Definition: Stmt.h:3166
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition: Expr.h:5914
bool isImplicitProperty() const
Definition: ExprObjC.h:700
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on a template...
Definition: Expr.h:203
bool inheritedFromVBase() const
Determine whether the inherited constructor is inherited from a virtual base of the object we constru...
Definition: ExprCXX.h:1666
StringLiteral * getFunctionName()
Definition: Expr.h:2006
unsigned getNumExprs() const
Return the number of expressions in this paren list.
Definition: Expr.h:5377
This represents &#39;#pragma omp single&#39; directive.
Definition: StmtOpenMP.h:1572
Encodes a location in the source.
body_range body()
Definition: Stmt.h:1399
Expr * getRetValue()
Definition: Stmt.h:2703
StringRef getOutputConstraint(unsigned i) const
Definition: Stmt.h:3176
Decl * getIteratorDecl(unsigned I)
Gets the iterator declaration for the given iterator.
Definition: Expr.cpp:4890
SourceLocation getOperatorLoc() const
Definition: Expr.h:3673
const Stmt * getCatchBody() const
Definition: StmtObjC.h:93
unsigned getNumHandlers() const
Definition: StmtCXX.h:106
Expr * getSubExpr() const
Definition: Expr.h:2166
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
Definition: StmtOpenMP.h:1341
NestedNameSpecifierLoc getQualifierLoc() const
Retrieves the nested-name-specifier that qualifies the type name, with source-location information...
Definition: ExprCXX.h:2531
This is a basic class for representing single OpenMP executable directive.
Definition: StmtOpenMP.h:33
SourceLocation getBuiltinLoc() const
getBuiltinLoc - Return the location of the __builtin_astype token.
Definition: Expr.h:5867
bool hasUnresolvedUsing() const
Determine whether the lookup results contain an unresolved using declaration.
Definition: ExprCXX.h:3861
CastKind getCastKind() const
Definition: Expr.h:3394
Expr * getSubExpr(unsigned Idx) const
Definition: Expr.h:5098
SourceLocation getOperatorLoc() const
Retrieve the location of the cast operator keyword, e.g., static_cast.
Definition: ExprCXX.h:393
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
Definition: ExprCXX.h:2101
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c dictionary literal.
Definition: ExprObjC.h:360
OMPClause * getClause(unsigned i) const
Returns specified clause.
Definition: StmtOpenMP.h:247
Expr * getLHS()
Definition: Stmt.h:1623
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit...
Definition: ExprCXX.h:610
Represents a C++2a __builtin_bit_cast(T, v) expression.
Definition: ExprCXX.h:4802
SourceLocation getEllipsisLoc() const
Retrieve the location of the ellipsis that describes this pack expansion.
Definition: ExprCXX.h:4048
Expr * getExpr()
Get &#39;expr&#39; part of the associated expression/statement.
Definition: StmtOpenMP.h:2630
Represents a call to a member function that may be written either with member call syntax (e...
Definition: ExprCXX.h:182
SourceLocation getExceptLoc() const
Definition: Stmt.h:3259
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprObjC.h:382
SourceLocation getLParenLoc() const
Definition: ExprOpenMP.h:168
Stmt * getElse()
Definition: Stmt.h:1964
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
Definition: Stmt.h:1259
DeclarationNameInfo getDirectiveName() const
Return name of the directive.
Definition: StmtOpenMP.h:1736
SourceLocation getLBraceLoc() const
Definition: Stmt.h:3158
A CXXFunctionalCastExpr record.
Definition: ASTBitCodes.h:1813
Expr * getCond()
Definition: Stmt.h:2137
SourceLocation getStrTokenLoc(unsigned TokNum) const
Get one of the string literal token.
Definition: Expr.h:1867
StmtVisitor - This class implements a simple visitor for Stmt subclasses.
Definition: StmtVisitor.h:183
bool canOverflow() const
Returns true if the unary operator can cause an overflow.
Definition: Expr.h:2179
SourceLocation getColonLoc() const
Definition: ExprOpenMP.h:97
SourceLocation RAngleLoc
The source location of the right angle bracket (&#39;>&#39;).
Definition: TemplateBase.h:657
SourceLocation getRParenLoc() const
Definition: Expr.h:4200
An ObjCEncodeExpr record.
Definition: ASTBitCodes.h:1712
SourceLocation getRParenLoc() const
Definition: ExprObjC.h:425
SourceLocation getSuperLoc() const
Retrieve the location of the &#39;super&#39; keyword for a class or instance message to &#39;super&#39;, otherwise an invalid source location.
Definition: ExprObjC.h:1291
This represents &#39;#pragma omp taskwait&#39; directive.
Definition: StmtOpenMP.h:2223
SourceLocation getAtLoc() const
Definition: ExprObjC.h:423
SourceRange getSourceRange() const
Definition: ExprObjC.h:1705
bool isPascal() const
Definition: Expr.h:1844
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:6048
UnaryExprOrTypeTrait getKind() const
Definition: Expr.h:2536
bool isArray() const
Definition: ExprCXX.h:2224
bool isOpenMPLoopBoundSharingDirective(OpenMPDirectiveKind Kind)
Checks if the specified directive kind is one of the composite or combined directives that need loop ...
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition: ExprObjC.h:504
bool isValueDependent() const
isValueDependent - Determines whether this expression is value-dependent (C++ [temp.dep.constexpr]).
Definition: Expr.h:167
SourceLocation getLParenLoc() const
Definition: Expr.h:4198
SourceLocation getGotoLoc() const
Definition: Stmt.h:2531
SourceLocation getAtFinallyLoc() const
Definition: StmtObjC.h:148
AccessSpecifier getAccess() const
static void addConstraintSatisfaction(ASTRecordWriter &Record, const ASTConstraintSatisfaction &Satisfaction)
An ObjCIsa Expr record.
Definition: ASTBitCodes.h:1736
const StringLiteral * getOutputConstraintLiteral(unsigned i) const
Definition: Stmt.h:3013
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:3472
Stmt * getCapturedStmt()
Retrieve the statement being captured.
Definition: Stmt.h:3511
void AddAttributes(ArrayRef< const Attr *> Attrs)
Emit a list of attributes.
Definition: ASTWriter.cpp:4252
SourceLocation getAtCatchLoc() const
Definition: StmtObjC.h:105
CharacterKind getKind() const
Definition: Expr.h:1566
This represents &#39;#pragma omp target&#39; directive.
Definition: StmtOpenMP.h:2648
Expr * getInputExpr(unsigned i)
Definition: Stmt.cpp:450
void AddSourceLocation(SourceLocation Loc)
Emit a source location.
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:2118
Expr * getV()
Get &#39;v&#39; part of the associated expression/statement.
Definition: StmtOpenMP.h:2625
bool isParenTypeId() const
Definition: ExprCXX.h:2254
SourceLocation getEndLoc() const
Definition: Stmt.h:3160
NullStmtBitfields NullStmtBits
Definition: Stmt.h:999
Expr * getSubExpr()
Definition: ExprObjC.h:144
An expression trait intrinsic.
Definition: ExprCXX.h:2785
ArrayRef< Expr * > exprs()
Definition: Expr.h:5392
const ObjCMethodDecl * getMethodDecl() const
Definition: ExprObjC.h:1346
An AtomicExpr record.
Definition: ASTBitCodes.h:1697
A static requirement that can be used in a requires-expression to check properties of types and expre...
Definition: ExprConcepts.h:145
VarDecl * getConditionVariable()
Retrieve the variable declared in this "switch" statement, if any.
Definition: Stmt.cpp:993
DeclStmt * getConditionVariableDeclStmt()
If this WhileStmt has a condition variable, return the faux DeclStmt associated with the creation of ...
Definition: Stmt.h:2349
This represents &#39;#pragma omp ordered&#39; directive.
Definition: StmtOpenMP.h:2457
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition: Expr.h:4174
void AddAPFloat(const llvm::APFloat &Value)
Emit a floating-point value.
Definition: ASTWriter.cpp:5127
This represents &#39;#pragma omp target update&#39; directive.
Definition: StmtOpenMP.h:3752
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:128
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:3449
bool isArgumentType() const
Definition: Expr.h:2546
SourceLocation getKeywordLoc() const
Definition: Stmt.h:1513
MSGuidDecl * getGuidDecl() const
Definition: ExprCXX.h:1068
Expr * getArrayFiller()
If this initializer list initializes an array with more elements than there are initializers in the l...
Definition: Expr.h:4704
SourceLocation getStarLoc() const
Definition: Stmt.h:2572
unsigned numOfIterators() const
Returns number of iterator definitions.
Definition: ExprOpenMP.h:375
bool passAlignment() const
Indicates whether the required alignment should be implicitly passed to the allocation function...
Definition: ExprCXX.h:2294
bool isPartOfExplicitCast() const
Definition: Expr.h:3491
FunctionDecl * getOperatorDelete() const
Definition: ExprCXX.h:2221
This represents &#39;#pragma omp parallel master taskloop simd&#39; directive.
Definition: StmtOpenMP.h:3616
Representation of a Microsoft __if_exists or __if_not_exists statement with a dependent name...
Definition: StmtCXX.h:252
unsigned getExprImplicitCastAbbrev() const
Definition: ASTWriter.h:704
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
Definition: Expr.cpp:226
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
Definition: Expr.h:1374
void AddDeclarationNameInfo(const DeclarationNameInfo &NameInfo)
Definition: ASTWriter.cpp:5496
void VisitStmt(Stmt *S)
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:3153
Expr * Value
The value of the dictionary element.
Definition: ExprObjC.h:268
const Expr * getInitializer() const
Definition: Expr.h:3314
ArrayRef< Expr * > finals_conditions()
Definition: StmtOpenMP.h:1159
Expr * getLHS() const
Definition: Expr.h:3681
void AddTemplateKWAndArgsInfo(const ASTTemplateKWAndArgsInfo &ArgInfo, const TemplateArgumentLoc *Args)
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:3879
SourceLocation getLocation() const LLVM_READONLY
Definition: ExprCXX.h:1668
A POD class for pairing a NamedDecl* with an access specifier.
Represents a C11 generic selection.
Definition: Expr.h:5442
ArrayRef< TemplateArgument > getPartialArguments() const
Get.
Definition: ExprCXX.h:4181
const Expr * getBase() const
Definition: Expr.h:5741
Expr * getInstanceReceiver()
Returns the object expression (receiver) for an instance message, or null for a message that is not a...
Definition: ExprObjC.h:1250
bool isReversed() const
Determine whether this expression was rewritten in reverse form.
Definition: ExprCXX.h:320
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition: Expr.h:4129
SourceLocation getColonLoc(unsigned I) const
Gets the location of the first &#39;:&#39; in the range for the given iterator definition.
Definition: Expr.cpp:4917
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers...
Definition: ExprObjC.h:1625
Represents a reference to a function parameter pack or init-capture pack that has been substituted bu...
Definition: ExprCXX.h:4332
Represents a template argument.
Definition: TemplateBase.h:51
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
Definition: Expr.h:4070
SourceLocation getMemberLoc() const
Definition: ExprCXX.h:945
TypeSourceInfo * getDestroyedTypeInfo() const
Retrieve the source location information for the type being destroyed.
Definition: ExprCXX.h:2572
arg_iterator arg_end()
Definition: ExprObjC.h:1463
Expr * getFalseExpr() const
getFalseExpr - Return the subexpression which will be evaluated if the condnition evaluates to false;...
Definition: Expr.h:4086
NullStmt - This is the null statement ";": C99 6.8.3p3.
Definition: Stmt.h:1331
bool isTypeOperand() const
Definition: ExprCXX.h:841
StringRef getInputConstraint(unsigned i) const
Definition: Stmt.h:3189
SourceLocation getLocation() const
Definition: ExprCXX.h:709
unsigned getNumAssocs() const
The number of association expressions.
Definition: Expr.h:5608
Dataflow Directional Tag Classes.
Expr * getPrevUpperBoundVariable() const
Definition: StmtOpenMP.h:1029
bool isVolatile() const
Definition: Stmt.h:2789
An InitListExpr record.
Definition: ASTBitCodes.h:1643
VarDecl * getConditionVariable()
Retrieve the variable declared in this "while" statement, if any.
Definition: Stmt.cpp:1049
const ASTConstraintSatisfaction & getSatisfaction() const
Get elaborated satisfaction info about the template arguments&#39; satisfaction of the named concept...
Definition: ExprConcepts.h:114
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:1912
SourceLocation getLocation() const
Definition: ExprObjC.h:759
RequiresExprBodyDecl * getBody() const
Definition: ExprConcepts.h:512
A CXXBoolLiteralExpr record.
Definition: ASTBitCodes.h:1825
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
Definition: ExprCXX.h:2360
IdentifierInfo * getOutputIdentifier(unsigned i) const
Definition: Stmt.h:3002
bool isSimple() const
Definition: Stmt.h:2786
OverloadedOperatorKind getOperator() const
Returns the kind of overloaded operator that this expression refers to.
Definition: ExprCXX.h:112
unsigned getAsOpaqueInt() const
Definition: LangOptions.h:498
NonTypeTemplateParmDecl * getParameterPack() const
Retrieve the non-type template parameter pack being substituted.
Definition: ExprCXX.h:4292
MSPropertyDecl * getPropertyDecl() const
Definition: ExprCXX.h:943
static void addSubstitutionDiagnostic(ASTRecordWriter &Record, const concepts::Requirement::SubstitutionDiagnostic *D)
const Stmt * getFinallyBody() const
Definition: StmtObjC.h:139
An ExtVectorElementExpr record.
Definition: ASTBitCodes.h:1640
ArrayRef< const Attr * > getAttrs() const
Definition: Stmt.h:1846
bool isImplicit() const
Definition: ExprCXX.h:1125
Expr * getCond() const
Definition: StmtOpenMP.h:943
This represents &#39;#pragma omp section&#39; directive.
Definition: StmtOpenMP.h:1509
This represents &#39;#pragma omp teams distribute&#39; directive.
Definition: StmtOpenMP.h:4179
QualType getSuperType() const
Retrieve the type referred to by &#39;super&#39;.
Definition: ExprObjC.h:1326
FPOptionsOverride getFPFeatures() const
Definition: ExprCXX.h:171
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
Definition: StmtOpenMP.h:4463
SourceLocation getBeginLoc() const
Definition: Expr.h:6250
SourceLocation EllipsisLoc
The location of the ellipsis, if this is a pack expansion.
Definition: ExprObjC.h:271
TypeSourceInfo * getTypeSourceInfo() const
Retrieve the type source information for the type being constructed.
Definition: ExprCXX.h:3429
AccessSpecifier getAccess() const
Definition: DeclBase.h:478
A runtime availability query.
Definition: ExprObjC.h:1686
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:4690
VarDecl *const * iterator
Iterators over the parameters which the parameter pack expanded into.
Definition: ExprCXX.h:4368
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
Definition: ExprCXX.h:498
This represents &#39;#pragma omp simd&#39; directive.
Definition: StmtOpenMP.h:1207
Stmt * getHandler() const
Definition: Stmt.h:3351
Represents a &#39;co_yield&#39; expression.
Definition: ExprCXX.h:4776
SourceLocation getLBraceLoc() const
Definition: Expr.h:4757
SourceLocation getSemiLoc() const
Definition: Stmt.h:1342
An ObjCAutoreleasePoolStmt record.
Definition: ASTBitCodes.h:1760
Expr * getOperand() const
Retrieve the operand of the &#39;co_return&#39; statement.
Definition: StmtCXX.h:480
const Expr * getReductionRef() const
Returns reference to the task_reduction return variable.
Definition: StmtOpenMP.h:2321
A C++ addrspace_cast expression (currently only enabled for OpenCL).
Definition: ExprCXX.h:574
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition: ExprCXX.h:4012
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
Definition: ExprCXX.h:1517
bool isImplicit() const
Definition: ExprCXX.h:4717
A CXXDynamicCastExpr record.
Definition: ASTBitCodes.h:1801
const NestedNameSpecifierLoc & getNestedNameSpecifierLoc() const
Definition: ASTConcept.h:138
DependentScopeDeclRefExprBitfields DependentScopeDeclRefExprBits
Definition: Stmt.h:1051
const Expr * getSynchExpr() const
Definition: StmtObjC.h:305
Iterator range representation begin:end[:step].
Definition: ExprOpenMP.h:254
Expr * getUpdateExpr()
Get helper expression of the form &#39;OpaqueValueExpr(x) binop OpaqueValueExpr(expr)&#39; or &#39;OpaqueValueExp...
Definition: StmtOpenMP.h:2611
SourceLocation getParameterPackLocation() const
Get the location of the parameter pack.
Definition: ExprCXX.h:4364
semantics_iterator semantics_begin()
Definition: Expr.h:5982
bool isIfExists() const
Determine whether this is an __if_exists statement.
Definition: StmtCXX.h:277
SourceLocation getBeginLoc() const
Definition: Expr.h:4551
NestedNameSpecifierLoc getQualifierLoc() const
Definition: ExprCXX.h:946
ExplicitCastExpr - An explicit cast written in the source code.
Definition: Expr.h:3535
This represents &#39;#pragma omp atomic&#39; directive.
Definition: StmtOpenMP.h:2513
child_range children()
Definition: ExprCXX.h:4676
Expr * getCombinedInit() const
Definition: StmtOpenMP.h:1065
SourceLocation getLParenLoc() const
Definition: ExprObjC.h:1649
DeclStmt * getConditionVariableDeclStmt()
If this IfStmt has a condition variable, return the faux DeclStmt associated with the creation of tha...
Definition: Stmt.h:1999
void AddVersionTuple(const VersionTuple &Version)
Emit a version tuple.
An ObjCAtFinallyStmt record.
Definition: ASTBitCodes.h:1748
SourceLocation getRParenLoc() const
Definition: ExprObjC.h:526
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition: ExprCXX.h:848
CXXNewExprBitfields CXXNewExprBits
Definition: Stmt.h:1048
RequiresExprBitfields RequiresExprBits
Definition: Stmt.h:1062
llvm::APInt getValue() const
Definition: Expr.h:1433
Represents a __leave statement.
Definition: Stmt.h:3371
unsigned getCollapsedNumber() const
Get number of collapsed loops.
Definition: StmtOpenMP.h:925
Expr * getCombinedNextLowerBound() const
Definition: StmtOpenMP.h:1077
ArrayRef< Expr * > counters()
Definition: StmtOpenMP.h:1117
LabelDecl * getLabel() const
Definition: Expr.h:4152
path_iterator path_end()
Definition: Expr.h:3421
iterator end() const
Definition: ExprCXX.h:4370
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition: ExprCXX.h:3958
SwitchStmt - This represents a &#39;switch&#39; stmt.
Definition: Stmt.h:2077
unsigned getByteLength() const
Definition: Expr.h:1831
SourceLocation getColonColonLoc() const
Retrieve the location of the &#39;::&#39; in a qualified pseudo-destructor expression.
Definition: ExprCXX.h:2560
Expr * getCombinedNextUpperBound() const
Definition: StmtOpenMP.h:1083
SourceLocation getBeginLoc() const
Definition: ExprCXX.h:2410
arg_iterator arg_begin()
Definition: ExprObjC.h:1461
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source location information.
Definition: ExprCXX.h:3205
SourceLocation getRParenLoc() const
Definition: StmtObjC.h:54
child_range children()
Definition: Expr.h:6245
Represents the body of a coroutine.
Definition: StmtCXX.h:317
TemplateArgumentLoc * getTrailingTemplateArgumentLoc()
Return the optional template arguments.
Definition: ExprCXX.h:3941
Location wrapper for a TemplateArgument.
Definition: TemplateBase.h:451
Expr * getBase() const
Definition: ExprObjC.h:1507
bool isOpenMPDistributeDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a distribute directive.
Iterator for iterating over Stmt * arrays that contain only T *.
Definition: Stmt.h:1104
SourceLocation getBuiltinLoc() const
Definition: Expr.h:4240
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition: Expr.h:2600
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c array literal.
Definition: ExprObjC.h:229
SourceLocation getLeaveLoc() const
Definition: Stmt.h:3381
Represents Objective-C&#39;s collection statement.
Definition: StmtObjC.h:23
An ObjCAtSynchronizedStmt record.
Definition: ASTBitCodes.h:1754
arg_iterator arg_begin()
Definition: Expr.h:2952
ArrayRef< Expr * > inits()
Definition: StmtOpenMP.h:1129
unsigned getNumObjects() const
Definition: ExprCXX.h:3337
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:409
SourceLocation getLocation() const
Retrieve the location of this expression.
Definition: Expr.h:1112
SourceLocation getLocation() const
Definition: ExprObjC.h:589
An implicit indirection through a C++ base class, when the field found is in a base class...
Definition: Expr.h:2308
Expr * getCond() const
getCond - Return the condition expression; this is defined in terms of the opaque value...
Definition: Expr.h:4074
Represents a call to a CUDA kernel function.
Definition: ExprCXX.h:235
SourceLocation getRParenLoc() const
Definition: Expr.h:4399
Represents a &#39;co_await&#39; expression.
Definition: ExprCXX.h:4691
bool isUnique() const
Definition: Expr.h:1148
TypeTraitExprBitfields TypeTraitExprBits
Definition: Stmt.h:1050
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
Definition: ASTConcept.h:77
bool isDelegateInitCall() const
isDelegateInitCall - Answers whether this message send has been tagged as a "delegate init call"...
Definition: ExprObjC.h:1403
Stmt * getInit()
Definition: Stmt.h:2158
A CXXMemberCallExpr record.
Definition: ASTBitCodes.h:1783
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
Definition: ExprCXX.h:2299
SourceRange getDirectInitRange() const
Definition: ExprCXX.h:2343
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the member name, with source location information...
Definition: ExprCXX.h:3632
Expr * getNumIterations() const
Definition: StmtOpenMP.h:1015
Opcode getOpcode() const
Definition: Expr.h:2161
Expr * getArg(unsigned Arg)
Return the specified argument.
Definition: ExprCXX.h:1577
StringRef getBytes() const
Allow access to clients that need the byte representation, such as ASTWriterStmt::VisitStringLiteral(...
Definition: Expr.h:1811
Represents Objective-C&#39;s @finally statement.
Definition: StmtObjC.h:127
SourceLocation getDefaultLoc() const
Definition: Expr.h:5692
StringRef getAsmString() const
Definition: Stmt.h:3169
bool hasAssociatedStmt() const
Returns true if directive has associated statement.
Definition: StmtOpenMP.h:250
Expr * getPrevLowerBoundVariable() const
Definition: StmtOpenMP.h:1023
uint64_t EmitStmt(unsigned Code, unsigned Abbrev=0)
Emit the record to the stream, preceded by its substatements.
const Expr * getBase() const
Definition: ExprObjC.h:580
bool isArrow() const
Determine whether this member expression used the &#39;->&#39; operator; otherwise, it used the &#39;...
Definition: ExprCXX.h:3618
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: Expr.h:3215
SourceLocation getColonLoc() const
Definition: Stmt.h:1515
Represents a base class of a C++ class.
Definition: DeclCXX.h:146
unsigned getNumClobbers() const
Definition: Stmt.h:2834
bool isImplicit() const
Definition: StmtCXX.h:489
SourceLocation getRParenLoc() const
Definition: Stmt.h:2494
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:548
child_range children()
Definition: ExprCXX.h:4764
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof...
Definition: ExprCXX.h:4176
Represents an expression that might suspend coroutine execution; either a co_await or co_yield expres...
Definition: ExprCXX.h:4606
DeclStmt * getRangeStmt()
Definition: StmtCXX.h:161
A ConvertVectorExpr record.
Definition: ASTBitCodes.h:1685
unsigned arg_size() const
Retrieve the number of arguments.
Definition: ExprCXX.h:3447
Expr * getRHS() const
Definition: Expr.h:4393
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:3390
SourceLocation getAsmLoc() const
Definition: Stmt.h:2783
GotoStmt - This represents a direct goto.
Definition: Stmt.h:2515
A use of a default initializer in a constructor or in aggregate initialization.
Definition: ExprCXX.h:1284
Expr * getTarget()
Definition: Stmt.h:2574
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition: Expr.h:4310
const SwitchCase * getNextSwitchCase() const
Definition: Stmt.h:1509