clang  10.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 
15 #include "clang/Sema/DeclSpec.h"
16 #include "clang/AST/ASTContext.h"
17 #include "clang/AST/DeclCXX.h"
18 #include "clang/AST/DeclObjC.h"
19 #include "clang/AST/DeclTemplate.h"
20 #include "clang/AST/StmtVisitor.h"
21 #include "clang/Lex/Token.h"
22 #include "llvm/Bitstream/BitstreamWriter.h"
23 using namespace clang;
24 
25 //===----------------------------------------------------------------------===//
26 // Statement/expression serialization
27 //===----------------------------------------------------------------------===//
28 
29 namespace clang {
30 
31  class ASTStmtWriter : public StmtVisitor<ASTStmtWriter, void> {
32  ASTWriter &Writer;
33  ASTRecordWriter Record;
34 
36  unsigned AbbrevToUse;
37 
38  public:
40  : Writer(Writer), Record(Writer, Record),
41  Code(serialization::STMT_NULL_PTR), AbbrevToUse(0) {}
42 
43  ASTStmtWriter(const ASTStmtWriter&) = delete;
44 
45  uint64_t Emit() {
46  assert(Code != serialization::STMT_NULL_PTR &&
47  "unhandled sub-statement writing AST file");
48  return Record.EmitStmt(Code, AbbrevToUse);
49  }
50 
52  const TemplateArgumentLoc *Args);
53 
54  void VisitStmt(Stmt *S);
55 #define STMT(Type, Base) \
56  void Visit##Type(Type *);
57 #include "clang/AST/StmtNodes.inc"
58  };
59 }
60 
62  const ASTTemplateKWAndArgsInfo &ArgInfo, const TemplateArgumentLoc *Args) {
63  Record.AddSourceLocation(ArgInfo.TemplateKWLoc);
64  Record.AddSourceLocation(ArgInfo.LAngleLoc);
65  Record.AddSourceLocation(ArgInfo.RAngleLoc);
66  for (unsigned i = 0; i != ArgInfo.NumTemplateArgs; ++i)
67  Record.AddTemplateArgumentLoc(Args[i]);
68 }
69 
71  Record.push_back(S->StmtBits.IsOMPStructuredBlock);
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());
433  for (const TemplateArgument &Arg : TemplateArgs)
434  Record.AddTemplateArgument(Arg);
435  if (!E->isValueDependent())
437 
439 }
440 
441 void ASTStmtWriter::VisitRequiresExpr(RequiresExpr *E) {
442  VisitExpr(E);
443  Record.push_back(E->getLocalParameters().size());
444  Record.push_back(E->getRequirements().size());
445  Record.AddSourceLocation(E->RequiresExprBits.RequiresKWLoc);
446  Record.push_back(E->RequiresExprBits.IsSatisfied);
447  Record.AddDeclRef(E->getBody());
448  for (ParmVarDecl *P : E->getLocalParameters())
449  Record.AddDeclRef(P);
450  for (concepts::Requirement *R : E->getRequirements()) {
451  if (auto *TypeReq = dyn_cast<concepts::TypeRequirement>(R)) {
453  Record.push_back(TypeReq->Status);
455  addSubstitutionDiagnostic(Record, TypeReq->getSubstitutionDiagnostic());
456  else
457  Record.AddTypeSourceInfo(TypeReq->getType());
458  } else if (auto *ExprReq = dyn_cast<concepts::ExprRequirement>(R)) {
459  Record.push_back(ExprReq->getKind());
460  Record.push_back(ExprReq->Status);
461  if (ExprReq->isExprSubstitutionFailure()) {
463  ExprReq->Value.get<concepts::Requirement::SubstitutionDiagnostic *>());
464  } else
465  Record.AddStmt(ExprReq->Value.get<Expr *>());
466  if (ExprReq->getKind() == concepts::Requirement::RK_Compound) {
467  Record.AddSourceLocation(ExprReq->NoexceptLoc);
468  const auto &RetReq = ExprReq->getReturnTypeRequirement();
469  if (RetReq.isSubstitutionFailure()) {
470  Record.push_back(2);
471  addSubstitutionDiagnostic(Record, RetReq.getSubstitutionDiagnostic());
472  } else if (RetReq.isTypeConstraint()) {
473  Record.push_back(1);
475  RetReq.getTypeConstraintTemplateParameterList());
476  if (ExprReq->Status >=
478  Record.AddStmt(
479  ExprReq->getReturnTypeRequirementSubstitutedConstraintExpr());
480  } else {
481  assert(RetReq.isEmpty());
482  Record.push_back(0);
483  }
484  }
485  } else {
486  auto *NestedReq = cast<concepts::NestedRequirement>(R);
488  Record.push_back(NestedReq->isSubstitutionFailure());
489  if (NestedReq->isSubstitutionFailure()){
491  NestedReq->getSubstitutionDiagnostic());
492  } else {
493  Record.AddStmt(NestedReq->Value.get<Expr *>());
494  if (!NestedReq->isDependent())
495  addConstraintSatisfaction(Record, *NestedReq->Satisfaction);
496  }
497  }
498  }
499  Record.AddSourceLocation(E->getEndLoc());
500 
502 }
503 
504 
505 void ASTStmtWriter::VisitCapturedStmt(CapturedStmt *S) {
506  VisitStmt(S);
507  // NumCaptures
508  Record.push_back(std::distance(S->capture_begin(), S->capture_end()));
509 
510  // CapturedDecl and captured region kind
511  Record.AddDeclRef(S->getCapturedDecl());
512  Record.push_back(S->getCapturedRegionKind());
513 
514  Record.AddDeclRef(S->getCapturedRecordDecl());
515 
516  // Capture inits
517  for (auto *I : S->capture_inits())
518  Record.AddStmt(I);
519 
520  // Body
521  Record.AddStmt(S->getCapturedStmt());
522 
523  // Captures
524  for (const auto &I : S->captures()) {
525  if (I.capturesThis() || I.capturesVariableArrayType())
526  Record.AddDeclRef(nullptr);
527  else
528  Record.AddDeclRef(I.getCapturedVar());
529  Record.push_back(I.getCaptureKind());
530  Record.AddSourceLocation(I.getLocation());
531  }
532 
534 }
535 
536 void ASTStmtWriter::VisitExpr(Expr *E) {
537  VisitStmt(E);
538  Record.AddTypeRef(E->getType());
539  Record.push_back(E->isTypeDependent());
540  Record.push_back(E->isValueDependent());
541  Record.push_back(E->isInstantiationDependent());
543  Record.push_back(E->getValueKind());
544  Record.push_back(E->getObjectKind());
545 }
546 
547 void ASTStmtWriter::VisitConstantExpr(ConstantExpr *E) {
548  VisitExpr(E);
549  Record.push_back(static_cast<uint64_t>(E->ConstantExprBits.ResultKind));
550  switch (E->ConstantExprBits.ResultKind) {
552  Record.push_back(E->Int64Result());
553  Record.push_back(E->ConstantExprBits.IsUnsigned |
554  E->ConstantExprBits.BitWidth << 1);
555  break;
557  Record.AddAPValue(E->APValueResult());
558  }
559  Record.AddStmt(E->getSubExpr());
561 }
562 
563 void ASTStmtWriter::VisitPredefinedExpr(PredefinedExpr *E) {
564  VisitExpr(E);
565 
566  bool HasFunctionName = E->getFunctionName() != nullptr;
567  Record.push_back(HasFunctionName);
568  Record.push_back(E->getIdentKind()); // FIXME: stable encoding
569  Record.AddSourceLocation(E->getLocation());
570  if (HasFunctionName)
571  Record.AddStmt(E->getFunctionName());
573 }
574 
575 void ASTStmtWriter::VisitDeclRefExpr(DeclRefExpr *E) {
576  VisitExpr(E);
577 
578  Record.push_back(E->hasQualifier());
579  Record.push_back(E->getDecl() != E->getFoundDecl());
580  Record.push_back(E->hasTemplateKWAndArgsInfo());
581  Record.push_back(E->hadMultipleCandidates());
583  Record.push_back(E->isNonOdrUse());
584 
585  if (E->hasTemplateKWAndArgsInfo()) {
586  unsigned NumTemplateArgs = E->getNumTemplateArgs();
587  Record.push_back(NumTemplateArgs);
588  }
589 
591 
592  if ((!E->hasTemplateKWAndArgsInfo()) && (!E->hasQualifier()) &&
593  (E->getDecl() == E->getFoundDecl()) &&
596  AbbrevToUse = Writer.getDeclRefExprAbbrev();
597  }
598 
599  if (E->hasQualifier())
601 
602  if (E->getDecl() != E->getFoundDecl())
603  Record.AddDeclRef(E->getFoundDecl());
604 
605  if (E->hasTemplateKWAndArgsInfo())
606  AddTemplateKWAndArgsInfo(*E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
607  E->getTrailingObjects<TemplateArgumentLoc>());
608 
609  Record.AddDeclRef(E->getDecl());
610  Record.AddSourceLocation(E->getLocation());
611  Record.AddDeclarationNameLoc(E->DNLoc, E->getDecl()->getDeclName());
613 }
614 
615 void ASTStmtWriter::VisitIntegerLiteral(IntegerLiteral *E) {
616  VisitExpr(E);
617  Record.AddSourceLocation(E->getLocation());
618  Record.AddAPInt(E->getValue());
619 
620  if (E->getValue().getBitWidth() == 32) {
621  AbbrevToUse = Writer.getIntegerLiteralAbbrev();
622  }
623 
625 }
626 
627 void ASTStmtWriter::VisitFixedPointLiteral(FixedPointLiteral *E) {
628  VisitExpr(E);
629  Record.AddSourceLocation(E->getLocation());
630  Record.AddAPInt(E->getValue());
632 }
633 
634 void ASTStmtWriter::VisitFloatingLiteral(FloatingLiteral *E) {
635  VisitExpr(E);
636  Record.push_back(E->getRawSemantics());
637  Record.push_back(E->isExact());
638  Record.AddAPFloat(E->getValue());
639  Record.AddSourceLocation(E->getLocation());
641 }
642 
643 void ASTStmtWriter::VisitImaginaryLiteral(ImaginaryLiteral *E) {
644  VisitExpr(E);
645  Record.AddStmt(E->getSubExpr());
647 }
648 
649 void ASTStmtWriter::VisitStringLiteral(StringLiteral *E) {
650  VisitExpr(E);
651 
652  // Store the various bits of data of StringLiteral.
653  Record.push_back(E->getNumConcatenated());
654  Record.push_back(E->getLength());
655  Record.push_back(E->getCharByteWidth());
656  Record.push_back(E->getKind());
657  Record.push_back(E->isPascal());
658 
659  // Store the trailing array of SourceLocation.
660  for (unsigned I = 0, N = E->getNumConcatenated(); I != N; ++I)
661  Record.AddSourceLocation(E->getStrTokenLoc(I));
662 
663  // Store the trailing array of char holding the string data.
664  StringRef StrData = E->getBytes();
665  for (unsigned I = 0, N = E->getByteLength(); I != N; ++I)
666  Record.push_back(StrData[I]);
667 
669 }
670 
671 void ASTStmtWriter::VisitCharacterLiteral(CharacterLiteral *E) {
672  VisitExpr(E);
673  Record.push_back(E->getValue());
674  Record.AddSourceLocation(E->getLocation());
675  Record.push_back(E->getKind());
676 
677  AbbrevToUse = Writer.getCharacterLiteralAbbrev();
678 
680 }
681 
682 void ASTStmtWriter::VisitParenExpr(ParenExpr *E) {
683  VisitExpr(E);
684  Record.AddSourceLocation(E->getLParen());
685  Record.AddSourceLocation(E->getRParen());
686  Record.AddStmt(E->getSubExpr());
688 }
689 
690 void ASTStmtWriter::VisitParenListExpr(ParenListExpr *E) {
691  VisitExpr(E);
692  Record.push_back(E->getNumExprs());
693  for (auto *SubStmt : E->exprs())
694  Record.AddStmt(SubStmt);
695  Record.AddSourceLocation(E->getLParenLoc());
696  Record.AddSourceLocation(E->getRParenLoc());
698 }
699 
700 void ASTStmtWriter::VisitUnaryOperator(UnaryOperator *E) {
701  VisitExpr(E);
702  Record.AddStmt(E->getSubExpr());
703  Record.push_back(E->getOpcode()); // FIXME: stable encoding
704  Record.AddSourceLocation(E->getOperatorLoc());
705  Record.push_back(E->canOverflow());
707 }
708 
709 void ASTStmtWriter::VisitOffsetOfExpr(OffsetOfExpr *E) {
710  VisitExpr(E);
711  Record.push_back(E->getNumComponents());
712  Record.push_back(E->getNumExpressions());
713  Record.AddSourceLocation(E->getOperatorLoc());
714  Record.AddSourceLocation(E->getRParenLoc());
716  for (unsigned I = 0, N = E->getNumComponents(); I != N; ++I) {
717  const OffsetOfNode &ON = E->getComponent(I);
718  Record.push_back(ON.getKind()); // FIXME: Stable encoding
720  Record.AddSourceLocation(ON.getSourceRange().getEnd());
721  switch (ON.getKind()) {
722  case OffsetOfNode::Array:
723  Record.push_back(ON.getArrayExprIndex());
724  break;
725 
726  case OffsetOfNode::Field:
727  Record.AddDeclRef(ON.getField());
728  break;
729 
731  Record.AddIdentifierRef(ON.getFieldName());
732  break;
733 
734  case OffsetOfNode::Base:
735  Record.AddCXXBaseSpecifier(*ON.getBase());
736  break;
737  }
738  }
739  for (unsigned I = 0, N = E->getNumExpressions(); I != N; ++I)
740  Record.AddStmt(E->getIndexExpr(I));
742 }
743 
744 void ASTStmtWriter::VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *E) {
745  VisitExpr(E);
746  Record.push_back(E->getKind());
747  if (E->isArgumentType())
749  else {
750  Record.push_back(0);
751  Record.AddStmt(E->getArgumentExpr());
752  }
753  Record.AddSourceLocation(E->getOperatorLoc());
754  Record.AddSourceLocation(E->getRParenLoc());
756 }
757 
758 void ASTStmtWriter::VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
759  VisitExpr(E);
760  Record.AddStmt(E->getLHS());
761  Record.AddStmt(E->getRHS());
762  Record.AddSourceLocation(E->getRBracketLoc());
764 }
765 
766 void ASTStmtWriter::VisitOMPArraySectionExpr(OMPArraySectionExpr *E) {
767  VisitExpr(E);
768  Record.AddStmt(E->getBase());
769  Record.AddStmt(E->getLowerBound());
770  Record.AddStmt(E->getLength());
771  Record.AddSourceLocation(E->getColonLoc());
772  Record.AddSourceLocation(E->getRBracketLoc());
774 }
775 
776 void ASTStmtWriter::VisitCallExpr(CallExpr *E) {
777  VisitExpr(E);
778  Record.push_back(E->getNumArgs());
779  Record.AddSourceLocation(E->getRParenLoc());
780  Record.AddStmt(E->getCallee());
781  for (CallExpr::arg_iterator Arg = E->arg_begin(), ArgEnd = E->arg_end();
782  Arg != ArgEnd; ++Arg)
783  Record.AddStmt(*Arg);
784  Record.push_back(static_cast<unsigned>(E->getADLCallKind()));
786 }
787 
788 void ASTStmtWriter::VisitMemberExpr(MemberExpr *E) {
789  VisitExpr(E);
790 
791  bool HasQualifier = E->hasQualifier();
792  bool HasFoundDecl =
793  E->hasQualifierOrFoundDecl() &&
794  (E->getFoundDecl().getDecl() != E->getMemberDecl() ||
795  E->getFoundDecl().getAccess() != E->getMemberDecl()->getAccess());
796  bool HasTemplateInfo = E->hasTemplateKWAndArgsInfo();
797  unsigned NumTemplateArgs = E->getNumTemplateArgs();
798 
799  // Write these first for easy access when deserializing, as they affect the
800  // size of the MemberExpr.
801  Record.push_back(HasQualifier);
802  Record.push_back(HasFoundDecl);
803  Record.push_back(HasTemplateInfo);
804  Record.push_back(NumTemplateArgs);
805 
806  Record.AddStmt(E->getBase());
807  Record.AddDeclRef(E->getMemberDecl());
808  Record.AddDeclarationNameLoc(E->MemberDNLoc,
809  E->getMemberDecl()->getDeclName());
810  Record.AddSourceLocation(E->getMemberLoc());
811  Record.push_back(E->isArrow());
812  Record.push_back(E->hadMultipleCandidates());
813  Record.push_back(E->isNonOdrUse());
814  Record.AddSourceLocation(E->getOperatorLoc());
815 
816  if (HasFoundDecl) {
817  DeclAccessPair FoundDecl = E->getFoundDecl();
818  Record.AddDeclRef(FoundDecl.getDecl());
819  Record.push_back(FoundDecl.getAccess());
820  }
821 
822  if (HasQualifier)
824 
825  if (HasTemplateInfo)
826  AddTemplateKWAndArgsInfo(*E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
827  E->getTrailingObjects<TemplateArgumentLoc>());
828 
830 }
831 
832 void ASTStmtWriter::VisitObjCIsaExpr(ObjCIsaExpr *E) {
833  VisitExpr(E);
834  Record.AddStmt(E->getBase());
835  Record.AddSourceLocation(E->getIsaMemberLoc());
836  Record.AddSourceLocation(E->getOpLoc());
837  Record.push_back(E->isArrow());
839 }
840 
841 void ASTStmtWriter::
842 VisitObjCIndirectCopyRestoreExpr(ObjCIndirectCopyRestoreExpr *E) {
843  VisitExpr(E);
844  Record.AddStmt(E->getSubExpr());
845  Record.push_back(E->shouldCopy());
847 }
848 
849 void ASTStmtWriter::VisitObjCBridgedCastExpr(ObjCBridgedCastExpr *E) {
850  VisitExplicitCastExpr(E);
851  Record.AddSourceLocation(E->getLParenLoc());
853  Record.push_back(E->getBridgeKind()); // FIXME: Stable encoding
855 }
856 
857 void ASTStmtWriter::VisitCastExpr(CastExpr *E) {
858  VisitExpr(E);
859  Record.push_back(E->path_size());
860  Record.AddStmt(E->getSubExpr());
861  Record.push_back(E->getCastKind()); // FIXME: stable encoding
862 
864  PI = E->path_begin(), PE = E->path_end(); PI != PE; ++PI)
865  Record.AddCXXBaseSpecifier(**PI);
866 }
867 
868 void ASTStmtWriter::VisitBinaryOperator(BinaryOperator *E) {
869  VisitExpr(E);
870  Record.AddStmt(E->getLHS());
871  Record.AddStmt(E->getRHS());
872  Record.push_back(E->getOpcode()); // FIXME: stable encoding
873  Record.AddSourceLocation(E->getOperatorLoc());
874  Record.push_back(E->getFPFeatures().getInt());
876 }
877 
878 void ASTStmtWriter::VisitCompoundAssignOperator(CompoundAssignOperator *E) {
879  VisitBinaryOperator(E);
880  Record.AddTypeRef(E->getComputationLHSType());
883 }
884 
885 void ASTStmtWriter::VisitConditionalOperator(ConditionalOperator *E) {
886  VisitExpr(E);
887  Record.AddStmt(E->getCond());
888  Record.AddStmt(E->getLHS());
889  Record.AddStmt(E->getRHS());
890  Record.AddSourceLocation(E->getQuestionLoc());
891  Record.AddSourceLocation(E->getColonLoc());
893 }
894 
895 void
896 ASTStmtWriter::VisitBinaryConditionalOperator(BinaryConditionalOperator *E) {
897  VisitExpr(E);
898  Record.AddStmt(E->getOpaqueValue());
899  Record.AddStmt(E->getCommon());
900  Record.AddStmt(E->getCond());
901  Record.AddStmt(E->getTrueExpr());
902  Record.AddStmt(E->getFalseExpr());
903  Record.AddSourceLocation(E->getQuestionLoc());
904  Record.AddSourceLocation(E->getColonLoc());
906 }
907 
908 void ASTStmtWriter::VisitImplicitCastExpr(ImplicitCastExpr *E) {
909  VisitCastExpr(E);
910  Record.push_back(E->isPartOfExplicitCast());
911 
912  if (E->path_size() == 0)
913  AbbrevToUse = Writer.getExprImplicitCastAbbrev();
914 
916 }
917 
918 void ASTStmtWriter::VisitExplicitCastExpr(ExplicitCastExpr *E) {
919  VisitCastExpr(E);
921 }
922 
923 void ASTStmtWriter::VisitCStyleCastExpr(CStyleCastExpr *E) {
924  VisitExplicitCastExpr(E);
925  Record.AddSourceLocation(E->getLParenLoc());
926  Record.AddSourceLocation(E->getRParenLoc());
928 }
929 
930 void ASTStmtWriter::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
931  VisitExpr(E);
932  Record.AddSourceLocation(E->getLParenLoc());
934  Record.AddStmt(E->getInitializer());
935  Record.push_back(E->isFileScope());
937 }
938 
939 void ASTStmtWriter::VisitExtVectorElementExpr(ExtVectorElementExpr *E) {
940  VisitExpr(E);
941  Record.AddStmt(E->getBase());
942  Record.AddIdentifierRef(&E->getAccessor());
943  Record.AddSourceLocation(E->getAccessorLoc());
945 }
946 
947 void ASTStmtWriter::VisitInitListExpr(InitListExpr *E) {
948  VisitExpr(E);
949  // NOTE: only add the (possibly null) syntactic form.
950  // No need to serialize the isSemanticForm flag and the semantic form.
951  Record.AddStmt(E->getSyntacticForm());
952  Record.AddSourceLocation(E->getLBraceLoc());
953  Record.AddSourceLocation(E->getRBraceLoc());
954  bool isArrayFiller = E->ArrayFillerOrUnionFieldInit.is<Expr*>();
955  Record.push_back(isArrayFiller);
956  if (isArrayFiller)
957  Record.AddStmt(E->getArrayFiller());
958  else
960  Record.push_back(E->hadArrayRangeDesignator());
961  Record.push_back(E->getNumInits());
962  if (isArrayFiller) {
963  // ArrayFiller may have filled "holes" due to designated initializer.
964  // Replace them by 0 to indicate that the filler goes in that place.
965  Expr *filler = E->getArrayFiller();
966  for (unsigned I = 0, N = E->getNumInits(); I != N; ++I)
967  Record.AddStmt(E->getInit(I) != filler ? E->getInit(I) : nullptr);
968  } else {
969  for (unsigned I = 0, N = E->getNumInits(); I != N; ++I)
970  Record.AddStmt(E->getInit(I));
971  }
973 }
974 
975 void ASTStmtWriter::VisitDesignatedInitExpr(DesignatedInitExpr *E) {
976  VisitExpr(E);
977  Record.push_back(E->getNumSubExprs());
978  for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
979  Record.AddStmt(E->getSubExpr(I));
981  Record.push_back(E->usesGNUSyntax());
982  for (const DesignatedInitExpr::Designator &D : E->designators()) {
983  if (D.isFieldDesignator()) {
984  if (FieldDecl *Field = D.getField()) {
986  Record.AddDeclRef(Field);
987  } else {
989  Record.AddIdentifierRef(D.getFieldName());
990  }
991  Record.AddSourceLocation(D.getDotLoc());
992  Record.AddSourceLocation(D.getFieldLoc());
993  } else if (D.isArrayDesignator()) {
995  Record.push_back(D.getFirstExprIndex());
996  Record.AddSourceLocation(D.getLBracketLoc());
997  Record.AddSourceLocation(D.getRBracketLoc());
998  } else {
999  assert(D.isArrayRangeDesignator() && "Unknown designator");
1001  Record.push_back(D.getFirstExprIndex());
1002  Record.AddSourceLocation(D.getLBracketLoc());
1003  Record.AddSourceLocation(D.getEllipsisLoc());
1004  Record.AddSourceLocation(D.getRBracketLoc());
1005  }
1006  }
1008 }
1009 
1010 void ASTStmtWriter::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) {
1011  VisitExpr(E);
1012  Record.AddStmt(E->getBase());
1013  Record.AddStmt(E->getUpdater());
1015 }
1016 
1017 void ASTStmtWriter::VisitNoInitExpr(NoInitExpr *E) {
1018  VisitExpr(E);
1020 }
1021 
1022 void ASTStmtWriter::VisitArrayInitLoopExpr(ArrayInitLoopExpr *E) {
1023  VisitExpr(E);
1024  Record.AddStmt(E->SubExprs[0]);
1025  Record.AddStmt(E->SubExprs[1]);
1027 }
1028 
1029 void ASTStmtWriter::VisitArrayInitIndexExpr(ArrayInitIndexExpr *E) {
1030  VisitExpr(E);
1032 }
1033 
1034 void ASTStmtWriter::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) {
1035  VisitExpr(E);
1037 }
1038 
1039 void ASTStmtWriter::VisitVAArgExpr(VAArgExpr *E) {
1040  VisitExpr(E);
1041  Record.AddStmt(E->getSubExpr());
1043  Record.AddSourceLocation(E->getBuiltinLoc());
1044  Record.AddSourceLocation(E->getRParenLoc());
1045  Record.push_back(E->isMicrosoftABI());
1047 }
1048 
1049 void ASTStmtWriter::VisitSourceLocExpr(SourceLocExpr *E) {
1050  VisitExpr(E);
1051  Record.AddDeclRef(cast_or_null<Decl>(E->getParentContext()));
1052  Record.AddSourceLocation(E->getBeginLoc());
1053  Record.AddSourceLocation(E->getEndLoc());
1054  Record.push_back(E->getIdentKind());
1056 }
1057 
1058 void ASTStmtWriter::VisitAddrLabelExpr(AddrLabelExpr *E) {
1059  VisitExpr(E);
1060  Record.AddSourceLocation(E->getAmpAmpLoc());
1061  Record.AddSourceLocation(E->getLabelLoc());
1062  Record.AddDeclRef(E->getLabel());
1064 }
1065 
1066 void ASTStmtWriter::VisitStmtExpr(StmtExpr *E) {
1067  VisitExpr(E);
1068  Record.AddStmt(E->getSubStmt());
1069  Record.AddSourceLocation(E->getLParenLoc());
1070  Record.AddSourceLocation(E->getRParenLoc());
1071  Code = serialization::EXPR_STMT;
1072 }
1073 
1074 void ASTStmtWriter::VisitChooseExpr(ChooseExpr *E) {
1075  VisitExpr(E);
1076  Record.AddStmt(E->getCond());
1077  Record.AddStmt(E->getLHS());
1078  Record.AddStmt(E->getRHS());
1079  Record.AddSourceLocation(E->getBuiltinLoc());
1080  Record.AddSourceLocation(E->getRParenLoc());
1081  Record.push_back(E->isConditionDependent() ? false : E->isConditionTrue());
1083 }
1084 
1085 void ASTStmtWriter::VisitGNUNullExpr(GNUNullExpr *E) {
1086  VisitExpr(E);
1087  Record.AddSourceLocation(E->getTokenLocation());
1089 }
1090 
1091 void ASTStmtWriter::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
1092  VisitExpr(E);
1093  Record.push_back(E->getNumSubExprs());
1094  for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
1095  Record.AddStmt(E->getExpr(I));
1096  Record.AddSourceLocation(E->getBuiltinLoc());
1097  Record.AddSourceLocation(E->getRParenLoc());
1099 }
1100 
1101 void ASTStmtWriter::VisitConvertVectorExpr(ConvertVectorExpr *E) {
1102  VisitExpr(E);
1103  Record.AddSourceLocation(E->getBuiltinLoc());
1104  Record.AddSourceLocation(E->getRParenLoc());
1105  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1106  Record.AddStmt(E->getSrcExpr());
1108 }
1109 
1110 void ASTStmtWriter::VisitBlockExpr(BlockExpr *E) {
1111  VisitExpr(E);
1112  Record.AddDeclRef(E->getBlockDecl());
1114 }
1115 
1116 void ASTStmtWriter::VisitGenericSelectionExpr(GenericSelectionExpr *E) {
1117  VisitExpr(E);
1118 
1119  Record.push_back(E->getNumAssocs());
1120  Record.push_back(E->ResultIndex);
1121  Record.AddSourceLocation(E->getGenericLoc());
1122  Record.AddSourceLocation(E->getDefaultLoc());
1123  Record.AddSourceLocation(E->getRParenLoc());
1124 
1125  Stmt **Stmts = E->getTrailingObjects<Stmt *>();
1126  // Add 1 to account for the controlling expression which is the first
1127  // expression in the trailing array of Stmt *. This is not needed for
1128  // the trailing array of TypeSourceInfo *.
1129  for (unsigned I = 0, N = E->getNumAssocs() + 1; I < N; ++I)
1130  Record.AddStmt(Stmts[I]);
1131 
1132  TypeSourceInfo **TSIs = E->getTrailingObjects<TypeSourceInfo *>();
1133  for (unsigned I = 0, N = E->getNumAssocs(); I < N; ++I)
1134  Record.AddTypeSourceInfo(TSIs[I]);
1135 
1137 }
1138 
1139 void ASTStmtWriter::VisitPseudoObjectExpr(PseudoObjectExpr *E) {
1140  VisitExpr(E);
1141  Record.push_back(E->getNumSemanticExprs());
1142 
1143  // Push the result index. Currently, this needs to exactly match
1144  // the encoding used internally for ResultIndex.
1145  unsigned result = E->getResultExprIndex();
1146  result = (result == PseudoObjectExpr::NoResult ? 0 : result + 1);
1147  Record.push_back(result);
1148 
1149  Record.AddStmt(E->getSyntacticForm());
1151  i = E->semantics_begin(), e = E->semantics_end(); i != e; ++i) {
1152  Record.AddStmt(*i);
1153  }
1155 }
1156 
1157 void ASTStmtWriter::VisitAtomicExpr(AtomicExpr *E) {
1158  VisitExpr(E);
1159  Record.push_back(E->getOp());
1160  for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
1161  Record.AddStmt(E->getSubExprs()[I]);
1162  Record.AddSourceLocation(E->getBuiltinLoc());
1163  Record.AddSourceLocation(E->getRParenLoc());
1165 }
1166 
1167 //===----------------------------------------------------------------------===//
1168 // Objective-C Expressions and Statements.
1169 //===----------------------------------------------------------------------===//
1170 
1171 void ASTStmtWriter::VisitObjCStringLiteral(ObjCStringLiteral *E) {
1172  VisitExpr(E);
1173  Record.AddStmt(E->getString());
1174  Record.AddSourceLocation(E->getAtLoc());
1176 }
1177 
1178 void ASTStmtWriter::VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
1179  VisitExpr(E);
1180  Record.AddStmt(E->getSubExpr());
1181  Record.AddDeclRef(E->getBoxingMethod());
1182  Record.AddSourceRange(E->getSourceRange());
1184 }
1185 
1186 void ASTStmtWriter::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
1187  VisitExpr(E);
1188  Record.push_back(E->getNumElements());
1189  for (unsigned i = 0; i < E->getNumElements(); i++)
1190  Record.AddStmt(E->getElement(i));
1192  Record.AddSourceRange(E->getSourceRange());
1194 }
1195 
1196 void ASTStmtWriter::VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *E) {
1197  VisitExpr(E);
1198  Record.push_back(E->getNumElements());
1199  Record.push_back(E->HasPackExpansions);
1200  for (unsigned i = 0; i < E->getNumElements(); i++) {
1201  ObjCDictionaryElement Element = E->getKeyValueElement(i);
1202  Record.AddStmt(Element.Key);
1203  Record.AddStmt(Element.Value);
1204  if (E->HasPackExpansions) {
1205  Record.AddSourceLocation(Element.EllipsisLoc);
1206  unsigned NumExpansions = 0;
1207  if (Element.NumExpansions)
1208  NumExpansions = *Element.NumExpansions + 1;
1209  Record.push_back(NumExpansions);
1210  }
1211  }
1212 
1213  Record.AddDeclRef(E->getDictWithObjectsMethod());
1214  Record.AddSourceRange(E->getSourceRange());
1216 }
1217 
1218 void ASTStmtWriter::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
1219  VisitExpr(E);
1221  Record.AddSourceLocation(E->getAtLoc());
1222  Record.AddSourceLocation(E->getRParenLoc());
1224 }
1225 
1226 void ASTStmtWriter::VisitObjCSelectorExpr(ObjCSelectorExpr *E) {
1227  VisitExpr(E);
1228  Record.AddSelectorRef(E->getSelector());
1229  Record.AddSourceLocation(E->getAtLoc());
1230  Record.AddSourceLocation(E->getRParenLoc());
1232 }
1233 
1234 void ASTStmtWriter::VisitObjCProtocolExpr(ObjCProtocolExpr *E) {
1235  VisitExpr(E);
1236  Record.AddDeclRef(E->getProtocol());
1237  Record.AddSourceLocation(E->getAtLoc());
1238  Record.AddSourceLocation(E->ProtoLoc);
1239  Record.AddSourceLocation(E->getRParenLoc());
1241 }
1242 
1243 void ASTStmtWriter::VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) {
1244  VisitExpr(E);
1245  Record.AddDeclRef(E->getDecl());
1246  Record.AddSourceLocation(E->getLocation());
1247  Record.AddSourceLocation(E->getOpLoc());
1248  Record.AddStmt(E->getBase());
1249  Record.push_back(E->isArrow());
1250  Record.push_back(E->isFreeIvar());
1252 }
1253 
1254 void ASTStmtWriter::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
1255  VisitExpr(E);
1256  Record.push_back(E->SetterAndMethodRefFlags.getInt());
1257  Record.push_back(E->isImplicitProperty());
1258  if (E->isImplicitProperty()) {
1261  } else {
1262  Record.AddDeclRef(E->getExplicitProperty());
1263  }
1264  Record.AddSourceLocation(E->getLocation());
1266  if (E->isObjectReceiver()) {
1267  Record.push_back(0);
1268  Record.AddStmt(E->getBase());
1269  } else if (E->isSuperReceiver()) {
1270  Record.push_back(1);
1271  Record.AddTypeRef(E->getSuperReceiverType());
1272  } else {
1273  Record.push_back(2);
1274  Record.AddDeclRef(E->getClassReceiver());
1275  }
1276 
1278 }
1279 
1280 void ASTStmtWriter::VisitObjCSubscriptRefExpr(ObjCSubscriptRefExpr *E) {
1281  VisitExpr(E);
1282  Record.AddSourceLocation(E->getRBracket());
1283  Record.AddStmt(E->getBaseExpr());
1284  Record.AddStmt(E->getKeyExpr());
1285  Record.AddDeclRef(E->getAtIndexMethodDecl());
1286  Record.AddDeclRef(E->setAtIndexMethodDecl());
1287 
1289 }
1290 
1291 void ASTStmtWriter::VisitObjCMessageExpr(ObjCMessageExpr *E) {
1292  VisitExpr(E);
1293  Record.push_back(E->getNumArgs());
1294  Record.push_back(E->getNumStoredSelLocs());
1295  Record.push_back(E->SelLocsKind);
1296  Record.push_back(E->isDelegateInitCall());
1297  Record.push_back(E->IsImplicit);
1298  Record.push_back((unsigned)E->getReceiverKind()); // FIXME: stable encoding
1299  switch (E->getReceiverKind()) {
1301  Record.AddStmt(E->getInstanceReceiver());
1302  break;
1303 
1306  break;
1307 
1310  Record.AddTypeRef(E->getSuperType());
1311  Record.AddSourceLocation(E->getSuperLoc());
1312  break;
1313  }
1314 
1315  if (E->getMethodDecl()) {
1316  Record.push_back(1);
1317  Record.AddDeclRef(E->getMethodDecl());
1318  } else {
1319  Record.push_back(0);
1320  Record.AddSelectorRef(E->getSelector());
1321  }
1322 
1323  Record.AddSourceLocation(E->getLeftLoc());
1324  Record.AddSourceLocation(E->getRightLoc());
1325 
1326  for (CallExpr::arg_iterator Arg = E->arg_begin(), ArgEnd = E->arg_end();
1327  Arg != ArgEnd; ++Arg)
1328  Record.AddStmt(*Arg);
1329 
1330  SourceLocation *Locs = E->getStoredSelLocs();
1331  for (unsigned i = 0, e = E->getNumStoredSelLocs(); i != e; ++i)
1332  Record.AddSourceLocation(Locs[i]);
1333 
1335 }
1336 
1337 void ASTStmtWriter::VisitObjCForCollectionStmt(ObjCForCollectionStmt *S) {
1338  VisitStmt(S);
1339  Record.AddStmt(S->getElement());
1340  Record.AddStmt(S->getCollection());
1341  Record.AddStmt(S->getBody());
1342  Record.AddSourceLocation(S->getForLoc());
1343  Record.AddSourceLocation(S->getRParenLoc());
1345 }
1346 
1347 void ASTStmtWriter::VisitObjCAtCatchStmt(ObjCAtCatchStmt *S) {
1348  VisitStmt(S);
1349  Record.AddStmt(S->getCatchBody());
1350  Record.AddDeclRef(S->getCatchParamDecl());
1351  Record.AddSourceLocation(S->getAtCatchLoc());
1352  Record.AddSourceLocation(S->getRParenLoc());
1354 }
1355 
1356 void ASTStmtWriter::VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S) {
1357  VisitStmt(S);
1358  Record.AddStmt(S->getFinallyBody());
1359  Record.AddSourceLocation(S->getAtFinallyLoc());
1361 }
1362 
1363 void ASTStmtWriter::VisitObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S) {
1364  VisitStmt(S); // FIXME: no test coverage.
1365  Record.AddStmt(S->getSubStmt());
1366  Record.AddSourceLocation(S->getAtLoc());
1368 }
1369 
1370 void ASTStmtWriter::VisitObjCAtTryStmt(ObjCAtTryStmt *S) {
1371  VisitStmt(S);
1372  Record.push_back(S->getNumCatchStmts());
1373  Record.push_back(S->getFinallyStmt() != nullptr);
1374  Record.AddStmt(S->getTryBody());
1375  for (unsigned I = 0, N = S->getNumCatchStmts(); I != N; ++I)
1376  Record.AddStmt(S->getCatchStmt(I));
1377  if (S->getFinallyStmt())
1378  Record.AddStmt(S->getFinallyStmt());
1379  Record.AddSourceLocation(S->getAtTryLoc());
1381 }
1382 
1383 void ASTStmtWriter::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
1384  VisitStmt(S); // FIXME: no test coverage.
1385  Record.AddStmt(S->getSynchExpr());
1386  Record.AddStmt(S->getSynchBody());
1389 }
1390 
1391 void ASTStmtWriter::VisitObjCAtThrowStmt(ObjCAtThrowStmt *S) {
1392  VisitStmt(S); // FIXME: no test coverage.
1393  Record.AddStmt(S->getThrowExpr());
1394  Record.AddSourceLocation(S->getThrowLoc());
1396 }
1397 
1398 void ASTStmtWriter::VisitObjCBoolLiteralExpr(ObjCBoolLiteralExpr *E) {
1399  VisitExpr(E);
1400  Record.push_back(E->getValue());
1401  Record.AddSourceLocation(E->getLocation());
1403 }
1404 
1405 void ASTStmtWriter::VisitObjCAvailabilityCheckExpr(ObjCAvailabilityCheckExpr *E) {
1406  VisitExpr(E);
1407  Record.AddSourceRange(E->getSourceRange());
1408  Record.AddVersionTuple(E->getVersion());
1410 }
1411 
1412 //===----------------------------------------------------------------------===//
1413 // C++ Expressions and Statements.
1414 //===----------------------------------------------------------------------===//
1415 
1416 void ASTStmtWriter::VisitCXXCatchStmt(CXXCatchStmt *S) {
1417  VisitStmt(S);
1418  Record.AddSourceLocation(S->getCatchLoc());
1419  Record.AddDeclRef(S->getExceptionDecl());
1420  Record.AddStmt(S->getHandlerBlock());
1422 }
1423 
1424 void ASTStmtWriter::VisitCXXTryStmt(CXXTryStmt *S) {
1425  VisitStmt(S);
1426  Record.push_back(S->getNumHandlers());
1427  Record.AddSourceLocation(S->getTryLoc());
1428  Record.AddStmt(S->getTryBlock());
1429  for (unsigned i = 0, e = S->getNumHandlers(); i != e; ++i)
1430  Record.AddStmt(S->getHandler(i));
1432 }
1433 
1434 void ASTStmtWriter::VisitCXXForRangeStmt(CXXForRangeStmt *S) {
1435  VisitStmt(S);
1436  Record.AddSourceLocation(S->getForLoc());
1437  Record.AddSourceLocation(S->getCoawaitLoc());
1438  Record.AddSourceLocation(S->getColonLoc());
1439  Record.AddSourceLocation(S->getRParenLoc());
1440  Record.AddStmt(S->getInit());
1441  Record.AddStmt(S->getRangeStmt());
1442  Record.AddStmt(S->getBeginStmt());
1443  Record.AddStmt(S->getEndStmt());
1444  Record.AddStmt(S->getCond());
1445  Record.AddStmt(S->getInc());
1446  Record.AddStmt(S->getLoopVarStmt());
1447  Record.AddStmt(S->getBody());
1449 }
1450 
1451 void ASTStmtWriter::VisitMSDependentExistsStmt(MSDependentExistsStmt *S) {
1452  VisitStmt(S);
1453  Record.AddSourceLocation(S->getKeywordLoc());
1454  Record.push_back(S->isIfExists());
1456  Record.AddDeclarationNameInfo(S->getNameInfo());
1457  Record.AddStmt(S->getSubStmt());
1459 }
1460 
1461 void ASTStmtWriter::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
1462  VisitCallExpr(E);
1463  Record.push_back(E->getOperator());
1464  Record.push_back(E->getFPFeatures().getInt());
1465  Record.AddSourceRange(E->Range);
1467 }
1468 
1469 void ASTStmtWriter::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) {
1470  VisitCallExpr(E);
1472 }
1473 
1474 void ASTStmtWriter::VisitCXXRewrittenBinaryOperator(
1476  VisitExpr(E);
1477  Record.push_back(E->isReversed());
1478  Record.AddStmt(E->getSemanticForm());
1480 }
1481 
1482 void ASTStmtWriter::VisitCXXConstructExpr(CXXConstructExpr *E) {
1483  VisitExpr(E);
1484 
1485  Record.push_back(E->getNumArgs());
1486  Record.push_back(E->isElidable());
1487  Record.push_back(E->hadMultipleCandidates());
1488  Record.push_back(E->isListInitialization());
1491  Record.push_back(E->getConstructionKind()); // FIXME: stable encoding
1492  Record.AddSourceLocation(E->getLocation());
1493  Record.AddDeclRef(E->getConstructor());
1494  Record.AddSourceRange(E->getParenOrBraceRange());
1495 
1496  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1497  Record.AddStmt(E->getArg(I));
1498 
1500 }
1501 
1502 void ASTStmtWriter::VisitCXXInheritedCtorInitExpr(CXXInheritedCtorInitExpr *E) {
1503  VisitExpr(E);
1504  Record.AddDeclRef(E->getConstructor());
1505  Record.AddSourceLocation(E->getLocation());
1506  Record.push_back(E->constructsVBase());
1507  Record.push_back(E->inheritedFromVBase());
1509 }
1510 
1511 void ASTStmtWriter::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
1512  VisitCXXConstructExpr(E);
1513  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1515 }
1516 
1517 void ASTStmtWriter::VisitLambdaExpr(LambdaExpr *E) {
1518  VisitExpr(E);
1519  Record.push_back(E->NumCaptures);
1520  Record.AddSourceRange(E->IntroducerRange);
1521  Record.push_back(E->CaptureDefault); // FIXME: stable encoding
1522  Record.AddSourceLocation(E->CaptureDefaultLoc);
1523  Record.push_back(E->ExplicitParams);
1524  Record.push_back(E->ExplicitResultType);
1525  Record.AddSourceLocation(E->ClosingBrace);
1526 
1527  // Add capture initializers.
1529  CEnd = E->capture_init_end();
1530  C != CEnd; ++C) {
1531  Record.AddStmt(*C);
1532  }
1533 
1535 }
1536 
1537 void ASTStmtWriter::VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E) {
1538  VisitExpr(E);
1539  Record.AddStmt(E->getSubExpr());
1541 }
1542 
1543 void ASTStmtWriter::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) {
1544  VisitExplicitCastExpr(E);
1546  Record.AddSourceRange(E->getAngleBrackets());
1547 }
1548 
1549 void ASTStmtWriter::VisitCXXStaticCastExpr(CXXStaticCastExpr *E) {
1550  VisitCXXNamedCastExpr(E);
1552 }
1553 
1554 void ASTStmtWriter::VisitCXXDynamicCastExpr(CXXDynamicCastExpr *E) {
1555  VisitCXXNamedCastExpr(E);
1557 }
1558 
1559 void ASTStmtWriter::VisitCXXReinterpretCastExpr(CXXReinterpretCastExpr *E) {
1560  VisitCXXNamedCastExpr(E);
1562 }
1563 
1564 void ASTStmtWriter::VisitCXXConstCastExpr(CXXConstCastExpr *E) {
1565  VisitCXXNamedCastExpr(E);
1567 }
1568 
1569 void ASTStmtWriter::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E) {
1570  VisitExplicitCastExpr(E);
1571  Record.AddSourceLocation(E->getLParenLoc());
1572  Record.AddSourceLocation(E->getRParenLoc());
1574 }
1575 
1576 void ASTStmtWriter::VisitBuiltinBitCastExpr(BuiltinBitCastExpr *E) {
1577  VisitExplicitCastExpr(E);
1578  Record.AddSourceLocation(E->getBeginLoc());
1579  Record.AddSourceLocation(E->getEndLoc());
1580 }
1581 
1582 void ASTStmtWriter::VisitUserDefinedLiteral(UserDefinedLiteral *E) {
1583  VisitCallExpr(E);
1584  Record.AddSourceLocation(E->UDSuffixLoc);
1586 }
1587 
1588 void ASTStmtWriter::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) {
1589  VisitExpr(E);
1590  Record.push_back(E->getValue());
1591  Record.AddSourceLocation(E->getLocation());
1593 }
1594 
1595 void ASTStmtWriter::VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E) {
1596  VisitExpr(E);
1597  Record.AddSourceLocation(E->getLocation());
1599 }
1600 
1601 void ASTStmtWriter::VisitCXXTypeidExpr(CXXTypeidExpr *E) {
1602  VisitExpr(E);
1603  Record.AddSourceRange(E->getSourceRange());
1604  if (E->isTypeOperand()) {
1607  } else {
1608  Record.AddStmt(E->getExprOperand());
1610  }
1611 }
1612 
1613 void ASTStmtWriter::VisitCXXThisExpr(CXXThisExpr *E) {
1614  VisitExpr(E);
1615  Record.AddSourceLocation(E->getLocation());
1616  Record.push_back(E->isImplicit());
1618 }
1619 
1620 void ASTStmtWriter::VisitCXXThrowExpr(CXXThrowExpr *E) {
1621  VisitExpr(E);
1622  Record.AddSourceLocation(E->getThrowLoc());
1623  Record.AddStmt(E->getSubExpr());
1624  Record.push_back(E->isThrownVariableInScope());
1626 }
1627 
1628 void ASTStmtWriter::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
1629  VisitExpr(E);
1630  Record.AddDeclRef(E->getParam());
1631  Record.AddDeclRef(cast_or_null<Decl>(E->getUsedContext()));
1632  Record.AddSourceLocation(E->getUsedLocation());
1634 }
1635 
1636 void ASTStmtWriter::VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E) {
1637  VisitExpr(E);
1638  Record.AddDeclRef(E->getField());
1639  Record.AddDeclRef(cast_or_null<Decl>(E->getUsedContext()));
1640  Record.AddSourceLocation(E->getExprLoc());
1642 }
1643 
1644 void ASTStmtWriter::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
1645  VisitExpr(E);
1646  Record.AddCXXTemporary(E->getTemporary());
1647  Record.AddStmt(E->getSubExpr());
1649 }
1650 
1651 void ASTStmtWriter::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
1652  VisitExpr(E);
1653  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1654  Record.AddSourceLocation(E->getRParenLoc());
1656 }
1657 
1658 void ASTStmtWriter::VisitCXXNewExpr(CXXNewExpr *E) {
1659  VisitExpr(E);
1660 
1661  Record.push_back(E->isArray());
1662  Record.push_back(E->hasInitializer());
1663  Record.push_back(E->getNumPlacementArgs());
1664  Record.push_back(E->isParenTypeId());
1665 
1666  Record.push_back(E->isGlobalNew());
1667  Record.push_back(E->passAlignment());
1669  Record.push_back(E->CXXNewExprBits.StoredInitializationStyle);
1670 
1671  Record.AddDeclRef(E->getOperatorNew());
1672  Record.AddDeclRef(E->getOperatorDelete());
1674  if (E->isParenTypeId())
1675  Record.AddSourceRange(E->getTypeIdParens());
1676  Record.AddSourceRange(E->getSourceRange());
1677  Record.AddSourceRange(E->getDirectInitRange());
1678 
1679  for (CXXNewExpr::arg_iterator I = E->raw_arg_begin(), N = E->raw_arg_end();
1680  I != N; ++I)
1681  Record.AddStmt(*I);
1682 
1684 }
1685 
1686 void ASTStmtWriter::VisitCXXDeleteExpr(CXXDeleteExpr *E) {
1687  VisitExpr(E);
1688  Record.push_back(E->isGlobalDelete());
1689  Record.push_back(E->isArrayForm());
1690  Record.push_back(E->isArrayFormAsWritten());
1692  Record.AddDeclRef(E->getOperatorDelete());
1693  Record.AddStmt(E->getArgument());
1694  Record.AddSourceLocation(E->getBeginLoc());
1695 
1697 }
1698 
1699 void ASTStmtWriter::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
1700  VisitExpr(E);
1701 
1702  Record.AddStmt(E->getBase());
1703  Record.push_back(E->isArrow());
1704  Record.AddSourceLocation(E->getOperatorLoc());
1706  Record.AddTypeSourceInfo(E->getScopeTypeInfo());
1707  Record.AddSourceLocation(E->getColonColonLoc());
1708  Record.AddSourceLocation(E->getTildeLoc());
1709 
1710  // PseudoDestructorTypeStorage.
1712  if (E->getDestroyedTypeIdentifier())
1714  else
1716 
1718 }
1719 
1720 void ASTStmtWriter::VisitExprWithCleanups(ExprWithCleanups *E) {
1721  VisitExpr(E);
1722  Record.push_back(E->getNumObjects());
1723  for (unsigned i = 0, e = E->getNumObjects(); i != e; ++i)
1724  Record.AddDeclRef(E->getObject(i));
1725 
1726  Record.push_back(E->cleanupsHaveSideEffects());
1727  Record.AddStmt(E->getSubExpr());
1729 }
1730 
1731 void ASTStmtWriter::VisitCXXDependentScopeMemberExpr(
1733  VisitExpr(E);
1734 
1735  // Don't emit anything here (or if you do you will have to update
1736  // the corresponding deserialization function).
1737 
1738  Record.push_back(E->hasTemplateKWAndArgsInfo());
1739  Record.push_back(E->getNumTemplateArgs());
1740  Record.push_back(E->hasFirstQualifierFoundInScope());
1741 
1742  if (E->hasTemplateKWAndArgsInfo()) {
1743  const ASTTemplateKWAndArgsInfo &ArgInfo =
1744  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
1745  AddTemplateKWAndArgsInfo(ArgInfo,
1746  E->getTrailingObjects<TemplateArgumentLoc>());
1747  }
1748 
1749  Record.push_back(E->isArrow());
1750  Record.AddSourceLocation(E->getOperatorLoc());
1751  Record.AddTypeRef(E->getBaseType());
1753  if (!E->isImplicitAccess())
1754  Record.AddStmt(E->getBase());
1755  else
1756  Record.AddStmt(nullptr);
1757 
1758  if (E->hasFirstQualifierFoundInScope())
1760 
1761  Record.AddDeclarationNameInfo(E->MemberNameInfo);
1763 }
1764 
1765 void
1766 ASTStmtWriter::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) {
1767  VisitExpr(E);
1768 
1769  // Don't emit anything here, HasTemplateKWAndArgsInfo must be
1770  // emitted first.
1771 
1772  Record.push_back(E->DependentScopeDeclRefExprBits.HasTemplateKWAndArgsInfo);
1773  if (E->DependentScopeDeclRefExprBits.HasTemplateKWAndArgsInfo) {
1774  const ASTTemplateKWAndArgsInfo &ArgInfo =
1775  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
1776  Record.push_back(ArgInfo.NumTemplateArgs);
1777  AddTemplateKWAndArgsInfo(ArgInfo,
1778  E->getTrailingObjects<TemplateArgumentLoc>());
1779  }
1780 
1782  Record.AddDeclarationNameInfo(E->NameInfo);
1784 }
1785 
1786 void
1787 ASTStmtWriter::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E) {
1788  VisitExpr(E);
1789  Record.push_back(E->arg_size());
1791  ArgI = E->arg_begin(), ArgE = E->arg_end(); ArgI != ArgE; ++ArgI)
1792  Record.AddStmt(*ArgI);
1793  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1794  Record.AddSourceLocation(E->getLParenLoc());
1795  Record.AddSourceLocation(E->getRParenLoc());
1797 }
1798 
1799 void ASTStmtWriter::VisitOverloadExpr(OverloadExpr *E) {
1800  VisitExpr(E);
1801 
1802  Record.push_back(E->getNumDecls());
1803  Record.push_back(E->hasTemplateKWAndArgsInfo());
1804  if (E->hasTemplateKWAndArgsInfo()) {
1805  const ASTTemplateKWAndArgsInfo &ArgInfo =
1807  Record.push_back(ArgInfo.NumTemplateArgs);
1809  }
1810 
1811  for (OverloadExpr::decls_iterator OvI = E->decls_begin(),
1812  OvE = E->decls_end();
1813  OvI != OvE; ++OvI) {
1814  Record.AddDeclRef(OvI.getDecl());
1815  Record.push_back(OvI.getAccess());
1816  }
1817 
1818  Record.AddDeclarationNameInfo(E->getNameInfo());
1820 }
1821 
1822 void ASTStmtWriter::VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
1823  VisitOverloadExpr(E);
1824  Record.push_back(E->isArrow());
1825  Record.push_back(E->hasUnresolvedUsing());
1826  Record.AddStmt(!E->isImplicitAccess() ? E->getBase() : nullptr);
1827  Record.AddTypeRef(E->getBaseType());
1828  Record.AddSourceLocation(E->getOperatorLoc());
1830 }
1831 
1832 void ASTStmtWriter::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) {
1833  VisitOverloadExpr(E);
1834  Record.push_back(E->requiresADL());
1835  Record.push_back(E->isOverloaded());
1836  Record.AddDeclRef(E->getNamingClass());
1838 }
1839 
1840 void ASTStmtWriter::VisitTypeTraitExpr(TypeTraitExpr *E) {
1841  VisitExpr(E);
1842  Record.push_back(E->TypeTraitExprBits.NumArgs);
1843  Record.push_back(E->TypeTraitExprBits.Kind); // FIXME: Stable encoding
1844  Record.push_back(E->TypeTraitExprBits.Value);
1845  Record.AddSourceRange(E->getSourceRange());
1846  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1847  Record.AddTypeSourceInfo(E->getArg(I));
1849 }
1850 
1851 void ASTStmtWriter::VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E) {
1852  VisitExpr(E);
1853  Record.push_back(E->getTrait());
1854  Record.push_back(E->getValue());
1855  Record.AddSourceRange(E->getSourceRange());
1857  Record.AddStmt(E->getDimensionExpression());
1859 }
1860 
1861 void ASTStmtWriter::VisitExpressionTraitExpr(ExpressionTraitExpr *E) {
1862  VisitExpr(E);
1863  Record.push_back(E->getTrait());
1864  Record.push_back(E->getValue());
1865  Record.AddSourceRange(E->getSourceRange());
1866  Record.AddStmt(E->getQueriedExpression());
1868 }
1869 
1870 void ASTStmtWriter::VisitCXXNoexceptExpr(CXXNoexceptExpr *E) {
1871  VisitExpr(E);
1872  Record.push_back(E->getValue());
1873  Record.AddSourceRange(E->getSourceRange());
1874  Record.AddStmt(E->getOperand());
1876 }
1877 
1878 void ASTStmtWriter::VisitPackExpansionExpr(PackExpansionExpr *E) {
1879  VisitExpr(E);
1880  Record.AddSourceLocation(E->getEllipsisLoc());
1881  Record.push_back(E->NumExpansions);
1882  Record.AddStmt(E->getPattern());
1884 }
1885 
1886 void ASTStmtWriter::VisitSizeOfPackExpr(SizeOfPackExpr *E) {
1887  VisitExpr(E);
1888  Record.push_back(E->isPartiallySubstituted() ? E->getPartialArguments().size()
1889  : 0);
1890  Record.AddSourceLocation(E->OperatorLoc);
1891  Record.AddSourceLocation(E->PackLoc);
1892  Record.AddSourceLocation(E->RParenLoc);
1893  Record.AddDeclRef(E->Pack);
1894  if (E->isPartiallySubstituted()) {
1895  for (const auto &TA : E->getPartialArguments())
1896  Record.AddTemplateArgument(TA);
1897  } else if (!E->isValueDependent()) {
1898  Record.push_back(E->getPackLength());
1899  }
1901 }
1902 
1903 void ASTStmtWriter::VisitSubstNonTypeTemplateParmExpr(
1905  VisitExpr(E);
1906  Record.AddDeclRef(E->getParameter());
1907  Record.AddSourceLocation(E->getNameLoc());
1908  Record.AddStmt(E->getReplacement());
1910 }
1911 
1912 void ASTStmtWriter::VisitSubstNonTypeTemplateParmPackExpr(
1914  VisitExpr(E);
1915  Record.AddDeclRef(E->getParameterPack());
1916  Record.AddTemplateArgument(E->getArgumentPack());
1919 }
1920 
1921 void ASTStmtWriter::VisitFunctionParmPackExpr(FunctionParmPackExpr *E) {
1922  VisitExpr(E);
1923  Record.push_back(E->getNumExpansions());
1924  Record.AddDeclRef(E->getParameterPack());
1926  for (FunctionParmPackExpr::iterator I = E->begin(), End = E->end();
1927  I != End; ++I)
1928  Record.AddDeclRef(*I);
1930 }
1931 
1932 void ASTStmtWriter::VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E) {
1933  VisitExpr(E);
1934  Record.push_back(static_cast<bool>(E->getLifetimeExtendedTemporaryDecl()));
1937  else
1938  Record.AddStmt(E->getSubExpr());
1940 }
1941 
1942 void ASTStmtWriter::VisitCXXFoldExpr(CXXFoldExpr *E) {
1943  VisitExpr(E);
1944  Record.AddSourceLocation(E->LParenLoc);
1945  Record.AddSourceLocation(E->EllipsisLoc);
1946  Record.AddSourceLocation(E->RParenLoc);
1947  Record.push_back(E->NumExpansions);
1948  Record.AddStmt(E->SubExprs[0]);
1949  Record.AddStmt(E->SubExprs[1]);
1950  Record.push_back(E->Opcode);
1952 }
1953 
1954 void ASTStmtWriter::VisitOpaqueValueExpr(OpaqueValueExpr *E) {
1955  VisitExpr(E);
1956  Record.AddStmt(E->getSourceExpr());
1957  Record.AddSourceLocation(E->getLocation());
1958  Record.push_back(E->isUnique());
1960 }
1961 
1962 void ASTStmtWriter::VisitTypoExpr(TypoExpr *E) {
1963  VisitExpr(E);
1964  // TODO: Figure out sane writer behavior for a TypoExpr, if necessary
1965  llvm_unreachable("Cannot write TypoExpr nodes");
1966 }
1967 
1968 //===----------------------------------------------------------------------===//
1969 // CUDA Expressions and Statements.
1970 //===----------------------------------------------------------------------===//
1971 
1972 void ASTStmtWriter::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E) {
1973  VisitCallExpr(E);
1974  Record.AddStmt(E->getConfig());
1976 }
1977 
1978 //===----------------------------------------------------------------------===//
1979 // OpenCL Expressions and Statements.
1980 //===----------------------------------------------------------------------===//
1981 void ASTStmtWriter::VisitAsTypeExpr(AsTypeExpr *E) {
1982  VisitExpr(E);
1983  Record.AddSourceLocation(E->getBuiltinLoc());
1984  Record.AddSourceLocation(E->getRParenLoc());
1985  Record.AddStmt(E->getSrcExpr());
1987 }
1988 
1989 //===----------------------------------------------------------------------===//
1990 // Microsoft Expressions and Statements.
1991 //===----------------------------------------------------------------------===//
1992 void ASTStmtWriter::VisitMSPropertyRefExpr(MSPropertyRefExpr *E) {
1993  VisitExpr(E);
1994  Record.push_back(E->isArrow());
1995  Record.AddStmt(E->getBaseExpr());
1997  Record.AddSourceLocation(E->getMemberLoc());
1998  Record.AddDeclRef(E->getPropertyDecl());
2000 }
2001 
2002 void ASTStmtWriter::VisitMSPropertySubscriptExpr(MSPropertySubscriptExpr *E) {
2003  VisitExpr(E);
2004  Record.AddStmt(E->getBase());
2005  Record.AddStmt(E->getIdx());
2006  Record.AddSourceLocation(E->getRBracketLoc());
2008 }
2009 
2010 void ASTStmtWriter::VisitCXXUuidofExpr(CXXUuidofExpr *E) {
2011  VisitExpr(E);
2012  Record.AddSourceRange(E->getSourceRange());
2013  Record.AddString(E->getUuidStr());
2014  if (E->isTypeOperand()) {
2017  } else {
2018  Record.AddStmt(E->getExprOperand());
2020  }
2021 }
2022 
2023 void ASTStmtWriter::VisitSEHExceptStmt(SEHExceptStmt *S) {
2024  VisitStmt(S);
2025  Record.AddSourceLocation(S->getExceptLoc());
2026  Record.AddStmt(S->getFilterExpr());
2027  Record.AddStmt(S->getBlock());
2029 }
2030 
2031 void ASTStmtWriter::VisitSEHFinallyStmt(SEHFinallyStmt *S) {
2032  VisitStmt(S);
2033  Record.AddSourceLocation(S->getFinallyLoc());
2034  Record.AddStmt(S->getBlock());
2036 }
2037 
2038 void ASTStmtWriter::VisitSEHTryStmt(SEHTryStmt *S) {
2039  VisitStmt(S);
2040  Record.push_back(S->getIsCXXTry());
2041  Record.AddSourceLocation(S->getTryLoc());
2042  Record.AddStmt(S->getTryBlock());
2043  Record.AddStmt(S->getHandler());
2045 }
2046 
2047 void ASTStmtWriter::VisitSEHLeaveStmt(SEHLeaveStmt *S) {
2048  VisitStmt(S);
2049  Record.AddSourceLocation(S->getLeaveLoc());
2051 }
2052 
2053 //===----------------------------------------------------------------------===//
2054 // OpenMP Directives.
2055 //===----------------------------------------------------------------------===//
2056 void ASTStmtWriter::VisitOMPExecutableDirective(OMPExecutableDirective *E) {
2057  Record.AddSourceLocation(E->getBeginLoc());
2058  Record.AddSourceLocation(E->getEndLoc());
2059  for (unsigned i = 0; i < E->getNumClauses(); ++i) {
2060  Record.writeOMPClause(E->getClause(i));
2061  }
2062  if (E->hasAssociatedStmt())
2063  Record.AddStmt(E->getAssociatedStmt());
2064 }
2065 
2066 void ASTStmtWriter::VisitOMPLoopDirective(OMPLoopDirective *D) {
2067  VisitStmt(D);
2068  Record.push_back(D->getNumClauses());
2069  Record.push_back(D->getCollapsedNumber());
2070  VisitOMPExecutableDirective(D);
2071  Record.AddStmt(D->getIterationVariable());
2072  Record.AddStmt(D->getLastIteration());
2073  Record.AddStmt(D->getCalcLastIteration());
2074  Record.AddStmt(D->getPreCond());
2075  Record.AddStmt(D->getCond());
2076  Record.AddStmt(D->getInit());
2077  Record.AddStmt(D->getInc());
2078  Record.AddStmt(D->getPreInits());
2082  Record.AddStmt(D->getIsLastIterVariable());
2083  Record.AddStmt(D->getLowerBoundVariable());
2084  Record.AddStmt(D->getUpperBoundVariable());
2085  Record.AddStmt(D->getStrideVariable());
2086  Record.AddStmt(D->getEnsureUpperBound());
2087  Record.AddStmt(D->getNextLowerBound());
2088  Record.AddStmt(D->getNextUpperBound());
2089  Record.AddStmt(D->getNumIterations());
2090  }
2092  Record.AddStmt(D->getPrevLowerBoundVariable());
2093  Record.AddStmt(D->getPrevUpperBoundVariable());
2094  Record.AddStmt(D->getDistInc());
2095  Record.AddStmt(D->getPrevEnsureUpperBound());
2098  Record.AddStmt(D->getCombinedEnsureUpperBound());
2099  Record.AddStmt(D->getCombinedInit());
2100  Record.AddStmt(D->getCombinedCond());
2101  Record.AddStmt(D->getCombinedNextLowerBound());
2102  Record.AddStmt(D->getCombinedNextUpperBound());
2103  Record.AddStmt(D->getCombinedDistCond());
2104  Record.AddStmt(D->getCombinedParForInDistCond());
2105  }
2106  for (auto I : D->counters()) {
2107  Record.AddStmt(I);
2108  }
2109  for (auto I : D->private_counters()) {
2110  Record.AddStmt(I);
2111  }
2112  for (auto I : D->inits()) {
2113  Record.AddStmt(I);
2114  }
2115  for (auto I : D->updates()) {
2116  Record.AddStmt(I);
2117  }
2118  for (auto I : D->finals()) {
2119  Record.AddStmt(I);
2120  }
2121  for (Stmt *S : D->dependent_counters())
2122  Record.AddStmt(S);
2123  for (Stmt *S : D->dependent_inits())
2124  Record.AddStmt(S);
2125  for (Stmt *S : D->finals_conditions())
2126  Record.AddStmt(S);
2127 }
2128 
2129 void ASTStmtWriter::VisitOMPParallelDirective(OMPParallelDirective *D) {
2130  VisitStmt(D);
2131  Record.push_back(D->getNumClauses());
2132  VisitOMPExecutableDirective(D);
2133  Record.push_back(D->hasCancel() ? 1 : 0);
2135 }
2136 
2137 void ASTStmtWriter::VisitOMPSimdDirective(OMPSimdDirective *D) {
2138  VisitOMPLoopDirective(D);
2140 }
2141 
2142 void ASTStmtWriter::VisitOMPForDirective(OMPForDirective *D) {
2143  VisitOMPLoopDirective(D);
2144  Record.push_back(D->hasCancel() ? 1 : 0);
2146 }
2147 
2148 void ASTStmtWriter::VisitOMPForSimdDirective(OMPForSimdDirective *D) {
2149  VisitOMPLoopDirective(D);
2151 }
2152 
2153 void ASTStmtWriter::VisitOMPSectionsDirective(OMPSectionsDirective *D) {
2154  VisitStmt(D);
2155  Record.push_back(D->getNumClauses());
2156  VisitOMPExecutableDirective(D);
2157  Record.push_back(D->hasCancel() ? 1 : 0);
2159 }
2160 
2161 void ASTStmtWriter::VisitOMPSectionDirective(OMPSectionDirective *D) {
2162  VisitStmt(D);
2163  VisitOMPExecutableDirective(D);
2164  Record.push_back(D->hasCancel() ? 1 : 0);
2166 }
2167 
2168 void ASTStmtWriter::VisitOMPSingleDirective(OMPSingleDirective *D) {
2169  VisitStmt(D);
2170  Record.push_back(D->getNumClauses());
2171  VisitOMPExecutableDirective(D);
2173 }
2174 
2175 void ASTStmtWriter::VisitOMPMasterDirective(OMPMasterDirective *D) {
2176  VisitStmt(D);
2177  VisitOMPExecutableDirective(D);
2179 }
2180 
2181 void ASTStmtWriter::VisitOMPCriticalDirective(OMPCriticalDirective *D) {
2182  VisitStmt(D);
2183  Record.push_back(D->getNumClauses());
2184  VisitOMPExecutableDirective(D);
2187 }
2188 
2189 void ASTStmtWriter::VisitOMPParallelForDirective(OMPParallelForDirective *D) {
2190  VisitOMPLoopDirective(D);
2191  Record.push_back(D->hasCancel() ? 1 : 0);
2193 }
2194 
2195 void ASTStmtWriter::VisitOMPParallelForSimdDirective(
2197  VisitOMPLoopDirective(D);
2199 }
2200 
2201 void ASTStmtWriter::VisitOMPParallelMasterDirective(
2203  VisitStmt(D);
2204  Record.push_back(D->getNumClauses());
2205  VisitOMPExecutableDirective(D);
2207 }
2208 
2209 void ASTStmtWriter::VisitOMPParallelSectionsDirective(
2211  VisitStmt(D);
2212  Record.push_back(D->getNumClauses());
2213  VisitOMPExecutableDirective(D);
2214  Record.push_back(D->hasCancel() ? 1 : 0);
2216 }
2217 
2218 void ASTStmtWriter::VisitOMPTaskDirective(OMPTaskDirective *D) {
2219  VisitStmt(D);
2220  Record.push_back(D->getNumClauses());
2221  VisitOMPExecutableDirective(D);
2222  Record.push_back(D->hasCancel() ? 1 : 0);
2224 }
2225 
2226 void ASTStmtWriter::VisitOMPAtomicDirective(OMPAtomicDirective *D) {
2227  VisitStmt(D);
2228  Record.push_back(D->getNumClauses());
2229  VisitOMPExecutableDirective(D);
2230  Record.AddStmt(D->getX());
2231  Record.AddStmt(D->getV());
2232  Record.AddStmt(D->getExpr());
2233  Record.AddStmt(D->getUpdateExpr());
2234  Record.push_back(D->isXLHSInRHSPart() ? 1 : 0);
2235  Record.push_back(D->isPostfixUpdate() ? 1 : 0);
2237 }
2238 
2239 void ASTStmtWriter::VisitOMPTargetDirective(OMPTargetDirective *D) {
2240  VisitStmt(D);
2241  Record.push_back(D->getNumClauses());
2242  VisitOMPExecutableDirective(D);
2244 }
2245 
2246 void ASTStmtWriter::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) {
2247  VisitStmt(D);
2248  Record.push_back(D->getNumClauses());
2249  VisitOMPExecutableDirective(D);
2251 }
2252 
2253 void ASTStmtWriter::VisitOMPTargetEnterDataDirective(
2255  VisitStmt(D);
2256  Record.push_back(D->getNumClauses());
2257  VisitOMPExecutableDirective(D);
2259 }
2260 
2261 void ASTStmtWriter::VisitOMPTargetExitDataDirective(
2263  VisitStmt(D);
2264  Record.push_back(D->getNumClauses());
2265  VisitOMPExecutableDirective(D);
2267 }
2268 
2269 void ASTStmtWriter::VisitOMPTargetParallelDirective(
2271  VisitStmt(D);
2272  Record.push_back(D->getNumClauses());
2273  VisitOMPExecutableDirective(D);
2275 }
2276 
2277 void ASTStmtWriter::VisitOMPTargetParallelForDirective(
2279  VisitOMPLoopDirective(D);
2280  Record.push_back(D->hasCancel() ? 1 : 0);
2282 }
2283 
2284 void ASTStmtWriter::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) {
2285  VisitStmt(D);
2286  VisitOMPExecutableDirective(D);
2288 }
2289 
2290 void ASTStmtWriter::VisitOMPBarrierDirective(OMPBarrierDirective *D) {
2291  VisitStmt(D);
2292  VisitOMPExecutableDirective(D);
2294 }
2295 
2296 void ASTStmtWriter::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) {
2297  VisitStmt(D);
2298  VisitOMPExecutableDirective(D);
2300 }
2301 
2302 void ASTStmtWriter::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) {
2303  VisitStmt(D);
2304  Record.push_back(D->getNumClauses());
2305  VisitOMPExecutableDirective(D);
2306  Record.AddStmt(D->getReductionRef());
2308 }
2309 
2310 void ASTStmtWriter::VisitOMPFlushDirective(OMPFlushDirective *D) {
2311  VisitStmt(D);
2312  Record.push_back(D->getNumClauses());
2313  VisitOMPExecutableDirective(D);
2315 }
2316 
2317 void ASTStmtWriter::VisitOMPOrderedDirective(OMPOrderedDirective *D) {
2318  VisitStmt(D);
2319  Record.push_back(D->getNumClauses());
2320  VisitOMPExecutableDirective(D);
2322 }
2323 
2324 void ASTStmtWriter::VisitOMPTeamsDirective(OMPTeamsDirective *D) {
2325  VisitStmt(D);
2326  Record.push_back(D->getNumClauses());
2327  VisitOMPExecutableDirective(D);
2329 }
2330 
2331 void ASTStmtWriter::VisitOMPCancellationPointDirective(
2333  VisitStmt(D);
2334  VisitOMPExecutableDirective(D);
2335  Record.push_back(uint64_t(D->getCancelRegion()));
2337 }
2338 
2339 void ASTStmtWriter::VisitOMPCancelDirective(OMPCancelDirective *D) {
2340  VisitStmt(D);
2341  Record.push_back(D->getNumClauses());
2342  VisitOMPExecutableDirective(D);
2343  Record.push_back(uint64_t(D->getCancelRegion()));
2345 }
2346 
2347 void ASTStmtWriter::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) {
2348  VisitOMPLoopDirective(D);
2350 }
2351 
2352 void ASTStmtWriter::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) {
2353  VisitOMPLoopDirective(D);
2355 }
2356 
2357 void ASTStmtWriter::VisitOMPMasterTaskLoopDirective(
2359  VisitOMPLoopDirective(D);
2361 }
2362 
2363 void ASTStmtWriter::VisitOMPMasterTaskLoopSimdDirective(
2365  VisitOMPLoopDirective(D);
2367 }
2368 
2369 void ASTStmtWriter::VisitOMPParallelMasterTaskLoopDirective(
2371  VisitOMPLoopDirective(D);
2373 }
2374 
2375 void ASTStmtWriter::VisitOMPParallelMasterTaskLoopSimdDirective(
2377  VisitOMPLoopDirective(D);
2379 }
2380 
2381 void ASTStmtWriter::VisitOMPDistributeDirective(OMPDistributeDirective *D) {
2382  VisitOMPLoopDirective(D);
2384 }
2385 
2386 void ASTStmtWriter::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) {
2387  VisitStmt(D);
2388  Record.push_back(D->getNumClauses());
2389  VisitOMPExecutableDirective(D);
2391 }
2392 
2393 void ASTStmtWriter::VisitOMPDistributeParallelForDirective(
2395  VisitOMPLoopDirective(D);
2396  Record.push_back(D->hasCancel() ? 1 : 0);
2398 }
2399 
2400 void ASTStmtWriter::VisitOMPDistributeParallelForSimdDirective(
2402  VisitOMPLoopDirective(D);
2404 }
2405 
2406 void ASTStmtWriter::VisitOMPDistributeSimdDirective(
2408  VisitOMPLoopDirective(D);
2410 }
2411 
2412 void ASTStmtWriter::VisitOMPTargetParallelForSimdDirective(
2414  VisitOMPLoopDirective(D);
2416 }
2417 
2418 void ASTStmtWriter::VisitOMPTargetSimdDirective(OMPTargetSimdDirective *D) {
2419  VisitOMPLoopDirective(D);
2421 }
2422 
2423 void ASTStmtWriter::VisitOMPTeamsDistributeDirective(
2425  VisitOMPLoopDirective(D);
2427 }
2428 
2429 void ASTStmtWriter::VisitOMPTeamsDistributeSimdDirective(
2431  VisitOMPLoopDirective(D);
2433 }
2434 
2435 void ASTStmtWriter::VisitOMPTeamsDistributeParallelForSimdDirective(
2437  VisitOMPLoopDirective(D);
2439 }
2440 
2441 void ASTStmtWriter::VisitOMPTeamsDistributeParallelForDirective(
2443  VisitOMPLoopDirective(D);
2444  Record.push_back(D->hasCancel() ? 1 : 0);
2446 }
2447 
2448 void ASTStmtWriter::VisitOMPTargetTeamsDirective(OMPTargetTeamsDirective *D) {
2449  VisitStmt(D);
2450  Record.push_back(D->getNumClauses());
2451  VisitOMPExecutableDirective(D);
2453 }
2454 
2455 void ASTStmtWriter::VisitOMPTargetTeamsDistributeDirective(
2457  VisitOMPLoopDirective(D);
2459 }
2460 
2461 void ASTStmtWriter::VisitOMPTargetTeamsDistributeParallelForDirective(
2463  VisitOMPLoopDirective(D);
2464  Record.push_back(D->hasCancel() ? 1 : 0);
2466 }
2467 
2468 void ASTStmtWriter::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
2470  VisitOMPLoopDirective(D);
2471  Code = serialization::
2473 }
2474 
2475 void ASTStmtWriter::VisitOMPTargetTeamsDistributeSimdDirective(
2477  VisitOMPLoopDirective(D);
2479 }
2480 
2481 //===----------------------------------------------------------------------===//
2482 // ASTWriter Implementation
2483 //===----------------------------------------------------------------------===//
2484 
2486  assert(SwitchCaseIDs.find(S) == SwitchCaseIDs.end() &&
2487  "SwitchCase recorded twice");
2488  unsigned NextID = SwitchCaseIDs.size();
2489  SwitchCaseIDs[S] = NextID;
2490  return NextID;
2491 }
2492 
2494  assert(SwitchCaseIDs.find(S) != SwitchCaseIDs.end() &&
2495  "SwitchCase hasn't been seen yet");
2496  return SwitchCaseIDs[S];
2497 }
2498 
2500  SwitchCaseIDs.clear();
2501 }
2502 
2503 /// Write the given substatement or subexpression to the
2504 /// bitstream.
2505 void ASTWriter::WriteSubStmt(Stmt *S) {
2506  RecordData Record;
2507  ASTStmtWriter Writer(*this, Record);
2508  ++NumStatements;
2509 
2510  if (!S) {
2511  Stream.EmitRecord(serialization::STMT_NULL_PTR, Record);
2512  return;
2513  }
2514 
2515  llvm::DenseMap<Stmt *, uint64_t>::iterator I = SubStmtEntries.find(S);
2516  if (I != SubStmtEntries.end()) {
2517  Record.push_back(I->second);
2518  Stream.EmitRecord(serialization::STMT_REF_PTR, Record);
2519  return;
2520  }
2521 
2522 #ifndef NDEBUG
2523  assert(!ParentStmts.count(S) && "There is a Stmt cycle!");
2524 
2525  struct ParentStmtInserterRAII {
2526  Stmt *S;
2527  llvm::DenseSet<Stmt *> &ParentStmts;
2528 
2529  ParentStmtInserterRAII(Stmt *S, llvm::DenseSet<Stmt *> &ParentStmts)
2530  : S(S), ParentStmts(ParentStmts) {
2531  ParentStmts.insert(S);
2532  }
2533  ~ParentStmtInserterRAII() {
2534  ParentStmts.erase(S);
2535  }
2536  };
2537 
2538  ParentStmtInserterRAII ParentStmtInserter(S, ParentStmts);
2539 #endif
2540 
2541  Writer.Visit(S);
2542 
2543  uint64_t Offset = Writer.Emit();
2544  SubStmtEntries[S] = Offset;
2545 }
2546 
2547 /// Flush all of the statements that have been added to the
2548 /// queue via AddStmt().
2549 void ASTRecordWriter::FlushStmts() {
2550  // We expect to be the only consumer of the two temporary statement maps,
2551  // assert that they are empty.
2552  assert(Writer->SubStmtEntries.empty() && "unexpected entries in sub-stmt map");
2553  assert(Writer->ParentStmts.empty() && "unexpected entries in parent stmt map");
2554 
2555  for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) {
2556  Writer->WriteSubStmt(StmtsToEmit[I]);
2557 
2558  assert(N == StmtsToEmit.size() && "record modified while being written!");
2559 
2560  // Note that we are at the end of a full expression. Any
2561  // expression records that follow this one are part of a different
2562  // expression.
2563  Writer->Stream.EmitRecord(serialization::STMT_STOP, ArrayRef<uint32_t>());
2564 
2565  Writer->SubStmtEntries.clear();
2566  Writer->ParentStmts.clear();
2567  }
2568 
2569  StmtsToEmit.clear();
2570 }
2571 
2572 void ASTRecordWriter::FlushSubStmts() {
2573  // For a nested statement, write out the substatements in reverse order (so
2574  // that a simple stack machine can be used when loading), and don't emit a
2575  // STMT_STOP after each one.
2576  for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) {
2577  Writer->WriteSubStmt(StmtsToEmit[N - I - 1]);
2578  assert(N == StmtsToEmit.size() && "record modified while being written!");
2579  }
2580 
2581  StmtsToEmit.clear();
2582 }
SourceLocation getRParenLoc() const
Definition: Stmt.h:2387
Expr * getInc()
Definition: Stmt.h:2443
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:614
unsigned getNumSemanticExprs() const
Definition: Expr.h:5779
A PredefinedExpr record.
Definition: ASTBitCodes.h:1512
const Expr * getSubExpr() const
Definition: Expr.h:963
A call to an overloaded operator written using operator syntax.
Definition: ExprCXX.h:78
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
Definition: ExprObjC.h:1577
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:410
The receiver is the instance of the superclass object.
Definition: ExprObjC.h:1107
Represents a single C99 designator.
Definition: Expr.h:4714
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: Expr.h:1348
SourceLocation getRBracLoc() const
Definition: Stmt.h:1440
Defines the clang::ASTContext interface.
A CompoundLiteralExpr record.
Definition: ASTBitCodes.h:1572
This represents &#39;#pragma omp distribute simd&#39; composite directive.
Definition: StmtOpenMP.h:3757
const BlockDecl * getBlockDecl() const
Definition: Expr.h:5593
Expr * getNextUpperBound() const
Definition: StmtOpenMP.h:994
IdentifierInfo * getInputIdentifier(unsigned i) const
Definition: Stmt.h:2994
This represents &#39;#pragma omp master&#39; directive.
Definition: StmtOpenMP.h:1591
ConstantExprBitfields ConstantExprBits
Definition: Stmt.h:980
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition: ExprCXX.h:1036
SourceLocation getRParenLoc() const
Definition: Stmt.h:2901
The null pointer literal (C++11 [lex.nullptr])
Definition: ExprCXX.h:683
unsigned getNumDecls() const
Gets the number of declarations in the unresolved set.
Definition: ExprCXX.h:2947
This represents &#39;#pragma omp task&#39; directive.
Definition: StmtOpenMP.h:1986
This represents a GCC inline-assembly statement extension.
Definition: Stmt.h:2878
Represents a &#39;co_await&#39; expression while the type of the promise is dependent.
Definition: ExprCXX.h:4735
SourceLocation getForLoc() const
Definition: StmtCXX.h:201
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
Definition: Expr.h:1284
bool getValue() const
Definition: ExprObjC.h:97
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:1101
Expr * getLHS() const
Definition: Expr.h:3780
Expr * getUpperBoundVariable() const
Definition: StmtOpenMP.h:962
unsigned getNumInputs() const
Definition: Stmt.h:2790
SourceLocation getOpLoc() const
Definition: ExprObjC.h:1528
Expr * getSyntacticForm()
Return the syntactic form of this expression, i.e.
Definition: Expr.h:5759
SourceLocation getRParenLoc() const
Definition: Expr.h:2789
ObjCDictionaryElement getKeyValueElement(unsigned Index) const
Definition: ExprObjC.h:360
CompoundStmt * getBlock() const
Definition: Stmt.h:3269
An IndirectGotoStmt record.
Definition: ASTBitCodes.h:1485
SourceLocation getForLoc() const
Definition: Stmt.h:2456
SourceLocation getUsedLocation() const
Retrieve the location where this default argument was actually used.
Definition: ExprCXX.h:1248
uint64_t getValue() const
Definition: ExprCXX.h:2760
StringKind getKind() const
Definition: Expr.h:1826
An AddrLabelExpr record.
Definition: ASTBitCodes.h:1602
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Definition: Expr.h:2919
NameKind
The kind of the name stored in this DeclarationName.
Expr * getCond() const
Definition: Expr.h:4175
ObjCMethodDecl * getAtIndexMethodDecl() const
Definition: ExprObjC.h:896
Selector getSelector() const
Definition: ExprObjC.cpp:337
SourceRange getSourceRange() const
Definition: ExprCXX.h:3982
void AddToken(const Token &Tok, RecordDataImpl &Record)
Emit a token.
Definition: ASTWriter.cpp:4180
SourceLocation getEllipsisLoc() const
Get the location of the ... in a case statement of the form LHS ... RHS.
Definition: Stmt.h:1575
SourceLocation getLParen() const
Get the location of the left parentheses &#39;(&#39;.
Definition: Expr.h:2018
const Expr * getSubExpr() const
Definition: ExprCXX.h:1162
Expr * getCond()
Definition: Stmt.h:2275
Expr * getExpr(unsigned Index)
getExpr - Return the Expr at the specified index.
Definition: Expr.h:4039
A CXXStaticCastExpr record.
Definition: ASTBitCodes.h:1730
ArrayRef< Expr * > dependent_counters()
Definition: StmtOpenMP.h:1134
unsigned getNumSubExprs() const
getNumSubExprs - Return the size of the SubExprs array.
Definition: Expr.h:4033
bool isSuperReceiver() const
Definition: ExprObjC.h:776
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2627
ArrayRef< ParmVarDecl * > getLocalParameters() const
Definition: ExprConcepts.h:507
VarDecl * getParameterPack() const
Get the parameter pack which this expression refers to.
Definition: ExprCXX.h:4366
SourceLocation TemplateKWLoc
The source location of the template keyword; this is used as part of the representation of qualified ...
Definition: TemplateBase.h:661
An AttributedStmt record.
Definition: ASTBitCodes.h:1464
CompoundStmt * getSubStmt()
Definition: Expr.h:3970
A CXXReinterpretCastExpr record.
Definition: ASTBitCodes.h:1736
const Expr * getInit(unsigned Init) const
Definition: Expr.h:4451
const DeclContext * getParentContext() const
If the SourceLocExpr has been resolved return the subexpression representing the resolved value...
Definition: Expr.h:4335
unsigned getNumAsmToks()
Definition: Stmt.h:3131
An ObjCBoolLiteralExpr record.
Definition: ASTBitCodes.h:1695
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:1172
Expr *const * semantics_iterator
Definition: Expr.h:5781
ObjCProtocolDecl * getProtocol() const
Definition: ExprObjC.h:519
Represents a &#39;co_return&#39; statement in the C++ Coroutines TS.
Definition: StmtCXX.h:456
Stmt - This represents one statement.
Definition: Stmt.h:66
Expr * getLowerBoundVariable() const
Definition: StmtOpenMP.h:954
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition: Expr.h:2689
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:1834
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
Definition: Expr.h:2302
SourceLocation getRParenLoc() const
Definition: Expr.h:4020
SourceLocation getLocation() const
Definition: Expr.h:1638
ObjCMethodDecl * setAtIndexMethodDecl() const
Definition: ExprObjC.h:900
void AddNestedNameSpecifierLoc(NestedNameSpecifierLoc NNS)
Emit a nested name specifier with source-location information.
Definition: ASTWriter.cpp:5418
unsigned getNumOutputs() const
Definition: Stmt.h:2768
This represents &#39;#pragma omp for simd&#39; directive.
Definition: StmtOpenMP.h:1337
Expr * getBase() const
Definition: Expr.h:2913
const StringLiteral * getAsmString() const
Definition: Stmt.h:2906
TypeSourceInfo * getTypeSourceInfo() const
Definition: Expr.h:3113
An ImplicitValueInitExpr record.
Definition: ASTBitCodes.h:1596
iterator end()
Definition: DeclGroup.h:105
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:88
This represents &#39;#pragma omp teams distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:4171
An ImplicitCastExpr record.
Definition: ASTBitCodes.h:1566
Stmt * getHandlerBlock() const
Definition: StmtCXX.h:51
SourceLocation getBeginLoc() const
Returns starting location of directive kind.
Definition: StmtOpenMP.h:225
llvm::APFloat getValue() const
Definition: Expr.h:1597
ObjCMethodDecl * getImplicitPropertySetter() const
Definition: ExprObjC.h:717
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Definition: Expr.h:5082
FunctionDecl * getOperatorNew() const
Definition: ExprCXX.h:2218
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:3037
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:4262
Defines the C++ template declaration subclasses.
Opcode getOpcode() const
Definition: Expr.h:3469
This represents &#39;#pragma omp parallel master&#39; directive.
Definition: StmtOpenMP.h:1863
unsigned getNumSubExprs() const
Retrieve the total number of subexpressions in this designated initializer expression, including the actual initialized value and any expressions that occur within array and array-range designators.
Definition: Expr.h:4889
SourceLocation getIdentLoc() const
Definition: Stmt.h:1746
Represents an attribute applied to a statement.
Definition: Stmt.h:1776
ParenExpr - This represents a parethesized expression, e.g.
Definition: Expr.h:1994
NamedDecl * getDecl() const
A CXXOperatorCallExpr record.
Definition: ASTBitCodes.h:1712
bool hasQualifier() const
Determines whether this member expression actually had a C++ nested-name-specifier prior to the name ...
Definition: Expr.h:2933
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:90
This represents &#39;#pragma omp target teams distribute&#39; combined directive.
Definition: StmtOpenMP.h:4310
A CXXTemporaryObjectExpr record.
Definition: ASTBitCodes.h:1727
Represents Objective-C&#39;s @throw statement.
Definition: StmtObjC.h:332
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called...
Definition: ExprCXX.h:1533
SourceLocation getLocation() const
Definition: ExprCXX.h:697
const RecordDecl * getCapturedRecordDecl() const
Retrieve the record declaration for captured variables.
Definition: Stmt.h:3494
SourceLocation getRParenLoc() const
Definition: Expr.h:2442
SourceLocation getKeywordLoc() const
Definition: ExprCXX.h:4766
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1422
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: Stmt.h:1251
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:845
TypeSourceInfo * getTypeInfoAsWritten() const
getTypeInfoAsWritten - Returns the type source info for the type that this expression is casting to...
Definition: Expr.h:3355
FPOptions getFPFeatures() const
Definition: Expr.h:3611
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:3311
SourceLocation getLParenLoc() const
Definition: Expr.h:3397
A constant expression context.
Definition: ASTBitCodes.h:1509
Expr * getCombinedParForInDistCond() const
Definition: StmtOpenMP.h:1082
A container of type source information.
Definition: Type.h:6227
This represents &#39;#pragma omp parallel for&#39; directive.
Definition: StmtOpenMP.h:1715
MS property subscript expression.
Definition: ExprCXX.h:937
IdentKind getIdentKind() const
Definition: Expr.h:1951
SourceLocation getGotoLoc() const
Definition: Stmt.h:2536
SourceLocation getRParenLoc() const
Definition: ExprCXX.h:2077
This represents &#39;#pragma omp target teams distribute parallel for&#39; combined directive.
Definition: StmtOpenMP.h:4379
Expr * getCombinedEnsureUpperBound() const
Definition: StmtOpenMP.h:1046
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
Definition: ExprCXX.h:4419
float __ovld __cnfn distance(float p0, float p1)
Returns the distance between p0 and p1.
SourceLocation getAccessorLoc() const
Definition: Expr.h:5543
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
Definition: Expr.h:4105
unsigned getDeclRefExprAbbrev() const
Definition: ASTWriter.h:684
const Expr * getSubExpr() const
Definition: Expr.h:1674
SourceLocation getAtLoc() const
Definition: ExprObjC.h:66
SourceLocation getCoawaitLoc() const
Definition: StmtCXX.h:202
Expr * getIndexExpr(unsigned Idx)
Definition: Expr.h:2330
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:1971
This represents &#39;#pragma omp target exit data&#39; directive.
Definition: StmtOpenMP.h:2690
Stmt * getSubStmt()
Definition: Stmt.h:1667
const VarDecl * getNRVOCandidate() const
Retrieve the variable that might be used for the named return value optimization. ...
Definition: Stmt.h:2678
SourceLocation getLParenLoc() const
Definition: Stmt.h:2458
bool hasTemplateKWAndArgsInfo() const
Definition: Expr.h:1294
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:2873
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC &#39;id&#39; type.
Definition: ExprObjC.h:1492
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:3077
ArrayRef< Expr * > dependent_inits()
Definition: StmtOpenMP.h:1140
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprCXX.h:833
SourceLocation getOperatorLoc() const
Retrieve the location of the &#39;.&#39; or &#39;->&#39; operator.
Definition: ExprCXX.h:2545
SourceLocation getAtLoc() const
Definition: ExprObjC.h:470
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
Definition: ExprCXX.h:2676
SourceRange getSourceRange() const
Definition: ExprCXX.h:2343
ObjCInterfaceDecl * getClassReceiver() const
Definition: ExprObjC.h:771
Expr * getCombinedUpperBoundVariable() const
Definition: StmtOpenMP.h:1040
SourceLocation getColonLoc() const
Definition: Expr.h:3722
bool isArrow() const
Definition: ExprObjC.h:1520
SourceLocation getLeftLoc() const
Definition: ExprObjC.h:1416
Expr * getCalcLastIteration() const
Definition: StmtOpenMP.h:922
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition: ExprCXX.h:715
Stmt * getThen()
Definition: Stmt.h:1921
SourceLocation getIfLoc() const
Definition: Stmt.h:1993
unsigned getNumPlacementArgs() const
Definition: ExprCXX.h:2236
TypeSourceInfo * getArgumentTypeInfo() const
Definition: Expr.h:2412
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
Definition: ExprCXX.h:3105
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range that covers this offsetof node.
Definition: Expr.h:2248
capture_iterator capture_begin()
Retrieve an iterator pointing to the first capture.
Definition: Stmt.h:3519
A CXXConstructExpr record.
Definition: ASTBitCodes.h:1721
unsigned getNumExpressions() const
Definition: Expr.h:2345
SourceLocation getLocation() const
Retrieve the location of the literal.
Definition: Expr.h:1472
raw_arg_iterator raw_arg_begin()
Definition: ExprCXX.h:2328
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will call.
Definition: ExprCXX.h:1648
A C++ throw-expression (C++ [except.throw]).
Definition: ExprCXX.h:1140
Expr * getExprOperand() const
Definition: ExprCXX.h:821
Represents an expression – generally a full-expression – that introduces cleanups to be run at the ...
Definition: ExprCXX.h:3306
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:160
SourceLocation getRParenLoc() const
Definition: Expr.h:5487
SourceLocation getLocation() const
Retrieve the location of the literal.
Definition: Expr.h:1511
void AddString(StringRef Str)
Emit a string.
iterator begin() const
Definition: ExprCXX.h:4374
bool isXLHSInRHSPart() const
Return true if helper update expression has form &#39;OpaqueValueExpr(x) binop OpaqueValueExpr(expr)&#39; and...
Definition: StmtOpenMP.h:2486
void AddSourceRange(SourceRange Range)
Emit a source range.
A ShuffleVectorExpr record.
Definition: ASTBitCodes.h:1617
SourceLocation getBuiltinLoc() const
Definition: Expr.h:4182
ObjCPropertyDecl * getExplicitProperty() const
Definition: ExprObjC.h:707
A C++ static_cast expression (C++ [expr.static.cast]).
Definition: ExprCXX.h:409
void AddTypeSourceInfo(TypeSourceInfo *TInfo)
Emits a reference to a declarator info.
Definition: ASTWriter.cpp:5204
Expr * getExprOperand() const
Definition: ExprCXX.h:1046
const Stmt * getSubStmt() const
Definition: StmtObjC.h:379
SourceLocation getRParenLoc() const
Retrieve the location of the closing parenthesis.
Definition: ExprCXX.h:386
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:1732
Represents a C99 designated initializer expression.
Definition: Expr.h:4639
SourceLocation getAtLoc() const
Definition: ExprObjC.h:523
An OffsetOfExpr record.
Definition: ASTBitCodes.h:1542
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition: Decl.h:272
TypeSourceInfo * getEncodedTypeSourceInfo() const
Definition: ExprObjC.h:430
Expr * getSemanticForm()
Get an equivalent semantic form for this expression.
Definition: ExprCXX.h:293
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:2379
An ObjCAtThrowStmt record.
Definition: ASTBitCodes.h:1689
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:2227
SourceLocation getRParenLoc() const
Definition: Expr.h:5940
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(), or __builtin_FILE().
Definition: Expr.h:4295
void AddTypeRef(QualType T)
Emit a reference to a type.
An element in an Objective-C dictionary literal.
Definition: ExprObjC.h:261
A DesignatedInitExpr record.
Definition: ASTBitCodes.h:1581
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
Definition: ExprConcepts.h:470
This represents &#39;#pragma omp parallel&#39; directive.
Definition: StmtOpenMP.h:357
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition: Expr.h:3999
bool cleanupsHaveSideEffects() const
Definition: ExprCXX.h:3344
QualType getComputationResultType() const
Definition: Expr.h:3680
SourceLocation getRParen() const
Get the location of the right parentheses &#39;)&#39;.
Definition: Expr.h:2022
DeclStmt * getConditionVariableDeclStmt()
If this SwitchStmt has a condition variable, return the faux DeclStmt associated with the creation of...
Definition: Stmt.h:2160
bool isFileScope() const
Definition: Expr.h:3107
SourceLocation getAmpAmpLoc() const
Definition: Expr.h:3924
Expr * getEnsureUpperBound() const
Definition: StmtOpenMP.h:978
NameKind getNameKind() const
Determine what kind of name this is.
SourceLocation getEndLoc() const
Definition: Stmt.h:1248
Represents a member of a struct/union/class.
Definition: Decl.h:2729
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:4937
NonTypeTemplateParmDecl * getParameter() const
Definition: ExprCXX.h:4243
const DeclarationNameInfo & getNameInfo() const
Gets the full name info.
Definition: ExprCXX.h:2950
StringLiteral * getString()
Definition: ExprObjC.h:62
unsigned getArrayExprIndex() const
For an array element node, returns the index into the array of expressions.
Definition: Expr.h:2221
Expr * getInc() const
Definition: StmtOpenMP.h:938
SourceLocation getLabelLoc() const
Definition: Expr.h:3926
SourceLocation getRBraceLoc() const
Definition: Expr.h:4552
SourceLocation getOperatorLoc() const
Definition: Expr.h:2439
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Definition: Expr.h:4210
ArrayRef< Expr * > updates()
Definition: StmtOpenMP.h:1122
SourceLocation getRParenLoc() const
Definition: Expr.h:3400
The iterator over UnresolvedSets.
Definition: UnresolvedSet.h:32
This represents &#39;#pragma omp target simd&#39; directive.
Definition: StmtOpenMP.h:3895
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
Definition: Expr.h:1133
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:5518
const DeclGroupRef getDeclGroup() const
Definition: Stmt.h:1243
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:2197
Expr * getSubExpr()
Definition: Expr.h:3202
This represents &#39;#pragma omp barrier&#39; directive.
Definition: StmtOpenMP.h:2101
SourceLocation getQuestionLoc() const
Definition: Expr.h:3721
void AddTemplateParameterList(const TemplateParameterList *TemplateParams)
Emit a template parameter list.
Definition: ASTWriter.cpp:5472
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp, [NSNumber numberWithInt:42]];.
Definition: ExprObjC.h:188
unsigned getCharByteWidth() const
Definition: Expr.h:1824
This is a common base class for loop directives (&#39;omp simd&#39;, &#39;omp for&#39;, &#39;omp for simd&#39; etc...
Definition: StmtOpenMP.h:420
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition: ExprCXX.h:4269
This represents &#39;#pragma omp critical&#39; directive.
Definition: StmtOpenMP.h:1640
OpenMPDirectiveKind getCancelRegion() const
Get cancellation region for the current cancellation point.
Definition: StmtOpenMP.h:2991
bool hadArrayRangeDesignator() const
Definition: Expr.h:4573
SourceLocation getCatchLoc() const
Definition: StmtCXX.h:48
Selector getSelector() const
Definition: ExprObjC.h:467
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
IndirectGotoStmt - This represents an indirect goto.
Definition: Stmt.h:2520
Describes an C or C++ initializer list.
Definition: Expr.h:4403
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition: ExprCXX.h:764
This represents &#39;#pragma omp distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:3606
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:4100
Expr * getKeyExpr() const
Definition: ExprObjC.h:893
ASTWriter::RecordDataImpl & getRecordData() const
Extract the underlying record storage.
unsigned getNumExpansions() const
Get the number of parameters in this parameter pack.
Definition: ExprCXX.h:4378
unsigned getLength() const
Definition: Expr.h:1823
ForStmt - This represents a &#39;for (init;cond;inc)&#39; stmt.
Definition: Stmt.h:2410
ArrayRef< Expr * > finals()
Definition: StmtOpenMP.h:1128
Expr * getIsLastIterVariable() const
Definition: StmtOpenMP.h:946
FunctionDecl * getOperatorDelete() const
Definition: ExprCXX.h:2399
Expr * getBaseExpr() const
Definition: ExprObjC.h:890
TemplateArgument getArgumentPack() const
Retrieve the template argument pack containing the substituted template arguments.
Definition: ExprCXX.cpp:1626
bool isElidable() const
Whether this construction is elidable.
Definition: ExprCXX.h:1500
Expr * getOperand() const
Definition: ExprCXX.h:3978
unsigned getIntegerLiteralAbbrev() const
Definition: ASTWriter.h:686
const Expr * getThrowExpr() const
Definition: StmtObjC.h:344
bool isGlobalNew() const
Definition: ExprCXX.h:2259
SourceLocation getParameterPackLocation() const
Retrieve the location of the parameter pack name.
Definition: ExprCXX.h:4300
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:1749
Expr * getX()
Get &#39;x&#39; part of the associated expression/statement.
Definition: StmtOpenMP.h:2470
SourceLocation getLBracLoc() const
Definition: Stmt.h:1439
A reference to a previously [de]serialized Stmt record.
Definition: ASTBitCodes.h:1446
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
Definition: ExprCXX.h:1963
SourceLocation getRParenLoc() const
Definition: StmtCXX.h:204
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
Definition: Expr.h:414
path_iterator path_begin()
Definition: Expr.h:3222
SourceLocation getIsaMemberLoc() const
getMemberLoc - Return the location of the "member", in X->F, it is the location of &#39;F&#39;...
Definition: ExprObjC.h:1525
Stmt * getBody()
Definition: Stmt.h:2444
semantics_iterator semantics_end()
Definition: Expr.h:5789
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:914
LifetimeExtendedTemporaryDecl * getLifetimeExtendedTemporaryDecl()
Definition: ExprCXX.h:4459
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3434
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:3672
bool constructsVBase() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
Definition: ExprCXX.h:1652
Stmt * getInit()
Definition: Stmt.h:2423
Expr * getOutputExpr(unsigned i)
Definition: Stmt.cpp:440
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:3040
unsigned getCharacterLiteralAbbrev() const
Definition: ASTWriter.h:685
SourceLocation getThrowLoc() const
Definition: ExprCXX.h:1165
unsigned getResultExprIndex() const
Return the index of the result-bearing expression into the semantics expressions, or PseudoObjectExpr...
Definition: Expr.h:5764
const StringLiteral * getInputConstraintLiteral(unsigned i) const
Definition: Stmt.h:3007
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:3020
ConceptDecl * getNamedConcept() const
Definition: ASTConcept.h:154
labels_range labels()
Definition: Stmt.h:3050
This represents &#39;#pragma omp cancellation point&#39; directive.
Definition: StmtOpenMP.h:2946
ObjCStringLiteral, used for Objective-C string literals i.e.
Definition: ExprObjC.h:50
SourceLocation getEqualOrColonLoc() const
Retrieve the location of the &#39;=&#39; that precedes the initializer value itself, if present.
Definition: Expr.h:4864
const CallExpr * getConfig() const
Definition: ExprCXX.h:247
bool isArrow() const
Definition: ExprCXX.h:921
FPOptions getFPFeatures() const
Definition: ExprCXX.h:152
CaseStmt - Represent a case statement.
Definition: Stmt.h:1500
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
Definition: Expr.h:5978
Expr * getCond()
Definition: Stmt.h:2442
IdentKind getIdentKind() const
Definition: Expr.h:4316
SourceLocation getContinueLoc() const
Definition: Stmt.h:2578
This represents &#39;#pragma omp teams&#39; directive.
Definition: StmtOpenMP.h:2888
unsigned getInt() const
Used to serialize this.
Definition: LangOptions.h:402
Expr * getInit() const
Definition: StmtOpenMP.h:934
SourceLocation getEndLoc() const
Definition: Expr.h:4340
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:3150
FieldDecl * getField()
Get the field whose initializer will be used.
Definition: ExprCXX.h:1303
Helper class for OffsetOfExpr.
Definition: Expr.h:2163
A marker record that indicates that we are at the end of an expression.
Definition: ASTBitCodes.h:1440
This represents &#39;#pragma omp teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:4029
Represents binding an expression to a temporary.
Definition: ExprCXX.h:1373
StringLiteral * getClobberStringLiteral(unsigned i)
Definition: Stmt.h:3087
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
Definition: ExprCXX.h:4664
Expr * Key
The key for the dictionary element.
Definition: ExprObjC.h:263
SourceLocation getBuiltinLoc() const
Definition: Expr.h:4273
CXXTemporary * getTemporary()
Definition: ExprCXX.h:1392
bool isOpenMPWorksharingDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a worksharing directive.
ObjCMethodDecl * getArrayWithObjectsMethod() const
Definition: ExprObjC.h:239
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition: ExprCXX.h:1818
CXXRecordDecl * getNamingClass()
Gets the &#39;naming class&#39; (in the sense of C++0x [class.access.base]p5) of the lookup.
Definition: ExprCXX.h:3113
NestedNameSpecifierLoc getQualifierLoc() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name, with source-location information.
Definition: Expr.h:1266
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:176
SourceLocation getTryLoc() const
Definition: Stmt.h:3308
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3511
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "for" statement, if any.
Definition: Stmt.cpp:931
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
Definition: Expr.h:2080
SourceLocation getNameLoc() const
Definition: ExprCXX.h:4235
TypeSourceInfo * getTypeSourceInfo() const
Definition: ExprCXX.h:2073
Stmt * getBody()
Definition: Stmt.h:2115
void AddAPInt(const llvm::APInt &Value)
Emit an integral value.
SourceLocation getLocation() const
Definition: ExprObjC.h:103
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1202
Stmt * getInit()
Definition: Stmt.h:1977
bool isExact() const
Definition: Expr.h:1630
bool isTypeOperand() const
Definition: ExprCXX.h:1029
SourceLocation getTokenLocation() const
getTokenLocation - The location of the __null token.
Definition: Expr.h:4224
llvm::APFloatBase::Semantics getRawSemantics() const
Get a raw enumeration value representing the floating-point semantics of this literal (32-bit IEEE...
Definition: Expr.h:1607
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:1097
ObjCMethodDecl * getDictWithObjectsMethod() const
Definition: ExprObjC.h:374
arg_iterator arg_end()
Definition: Expr.h:2747
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:2197
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
Definition: TemplateBase.h:650
NestedNameSpecifierLoc getQualifierLoc() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name...
Definition: Expr.h:2938
void AddAPValue(const APValue &Value)
Emit an APvalue.
Definition: ASTWriter.cpp:5047
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:3825
ArrayRef< Expr * > private_counters()
Definition: StmtOpenMP.h:1110
OpenMP 4.0 [2.4, Array Sections].
Definition: ExprOpenMP.h:44
ConditionalOperator - The ?: ternary operator.
Definition: Expr.h:3732
StmtBitfields StmtBits
Definition: Stmt.h:962
TypeSourceInfo * getTypeSourceInfo() const
Definition: ExprCXX.h:1779
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
Definition: ExprCXX.h:1524
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:1332
unsigned NumTemplateArgs
The number of template arguments in TemplateArgs.
Definition: TemplateBase.h:664
SourceLocation getRBracket() const
Definition: ExprObjC.h:881
bool isMicrosoftABI() const
Returns whether this is really a Win64 ABI va_arg expression.
Definition: Expr.h:4267
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1520
void AddDeclarationNameLoc(const DeclarationNameLoc &DNLoc, DeclarationName Name)
Definition: ASTWriter.cpp:5373
Expr ** getSubExprs()
Definition: Expr.h:5916
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:2193
void AddCXXTemporary(const CXXTemporary *Temp)
Emit a CXXTemporary.
Definition: ASTWriter.cpp:5159
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
Definition: ExprCXX.h:1494
QualType getComputationLHSType() const
Definition: Expr.h:3677
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprObjC.h:216
SourceLocation getRParenLoc() const
Definition: ExprObjC.h:471
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
Definition: Expr.h:2372
SourceLocation getTryLoc() const
Definition: StmtCXX.h:94
bool isConstexpr() const
Definition: Stmt.h:2007
Expr * getCombinedLowerBoundVariable() const
Definition: StmtOpenMP.h:1034
SourceLocation getLocation() const
Definition: ExprCXX.h:1496
SourceLocation getRBracketLoc() const
Definition: ExprCXX.h:975
SourceLocation getLocation() const
Definition: Expr.h:1255
unsigned getSwitchCaseID(SwitchCase *S)
Retrieve the ID for the given switch-case statement.
InitListExpr * getUpdater() const
Definition: Expr.h:4995
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition: Expr.h:978
Represents a call to the builtin function __builtin_va_arg.
Definition: Expr.h:4244
SourceLocation getLabelLoc() const
Definition: Stmt.h:2499
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:1827
static unsigned getNumSubExprs(AtomicOp Op)
Determine the number of arguments the specified atomic builtin should have.
Definition: Expr.cpp:4640
unsigned getValue() const
Definition: Expr.h:1564
This represents &#39;#pragma omp distribute&#39; directive.
Definition: StmtOpenMP.h:3480
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition: Expr.h:5665
SourceLocation getDestroyedTypeLoc() const
Retrieve the starting location of the type being destroyed.
Definition: ExprCXX.h:2587
ObjCMethodDecl * getBoxingMethod() const
Definition: ExprObjC.h:145
SourceLocation getFinallyLoc() const
Definition: Stmt.h:3266
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type...
Definition: ExprCXX.h:2053
ADLCallKind getADLCallKind() const
Definition: Expr.h:2667
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:3769
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1779
llvm::MutableArrayRef< Designator > designators()
Definition: Expr.h:4842
DeclAccessPair getFoundDecl() const
Retrieves the declaration found by lookup.
Definition: Expr.h:2923
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:4236
This represents one expression.
Definition: Expr.h:108
SourceLocation getElseLoc() const
Definition: Stmt.h:1996
DeclStmt * getEndStmt()
Definition: StmtCXX.h:165
SourceLocation End
IdentifierInfo * getFieldName() const
For a field or identifier offsetof node, returns the name of the field.
Definition: Expr.cpp:1596
CXXBaseSpecifier * getBase() const
For a base class node, returns the base specifier.
Definition: Expr.h:2237
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:3182
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:1531
SourceLocation getWhileLoc() const
Definition: Stmt.h:2327
This represents &#39;#pragma omp master taskloop&#39; directive.
Definition: StmtOpenMP.h:3204
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:4168
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:3060
Represents a C++ functional cast expression that builds a temporary object.
Definition: ExprCXX.h:1750
A C++ const_cast expression (C++ [expr.const.cast]).
Definition: ExprCXX.h:527
SourceLocation getLocation() const
Definition: ExprCXX.h:1112
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:5579
Field designator where only the field name is known.
Definition: ASTBitCodes.h:1880
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:2663
unsigned getNumInits() const
Definition: Expr.h:4433
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1321
This represents &#39;#pragma omp target teams distribute parallel for simd&#39; combined directive.
Definition: StmtOpenMP.h:4463
raw_arg_iterator raw_arg_end()
Definition: ExprCXX.h:2329
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:2287
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
Definition: ExprObjC.h:304
const CompoundStmt * getSynchBody() const
Definition: StmtObjC.h:297
SourceLocation getLParenLoc() const
Definition: Expr.h:5188
Expr * getRHS()
Definition: Stmt.h:1601
bool hasQualifier() const
Determine whether this declaration reference was preceded by a C++ nested-name-specifier, e.g., N::foo.
Definition: Expr.h:1262
Represents Objective-C&#39;s @synchronized statement.
Definition: StmtObjC.h:277
ObjCSelectorExpr used for @selector in Objective-C.
Definition: ExprObjC.h:454
A CXXStdInitializerListExpr record.
Definition: ASTBitCodes.h:1748
TypeSourceInfo * getTypeSourceInfo() const
Definition: Expr.h:2309
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:4091
SourceLocation getRBracketLoc() const
Definition: ExprOpenMP.h:111
CXXTryStmt - A C++ try block, including all handlers.
Definition: StmtCXX.h:68
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Definition: Expr.h:5642
An ArraySubscriptExpr record.
Definition: ASTBitCodes.h:1548
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:1377
IdentifierInfo & getAccessor() const
Definition: Expr.h:5540
This represents &#39;#pragma omp target teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:4536
ArrayTypeTrait getTrait() const
Definition: ExprCXX.h:2754
decls_iterator decls_begin() const
Definition: ExprCXX.h:2936
unsigned size() const
Definition: Stmt.h:1360
unsigned getNumClauses() const
Get number of clauses.
Definition: StmtOpenMP.h:241
An ArrayInitLoopExpr record.
Definition: ASTBitCodes.h:1590
Expr * getDistInc() const
Definition: StmtOpenMP.h:1022
A PseudoObjectExpr record.
Definition: ASTBitCodes.h:1629
SourceRange getAngleBrackets() const LLVM_READONLY
Definition: ExprCXX.h:390
Expr * getNextLowerBound() const
Definition: StmtOpenMP.h:986
Kind getKind() const
Determine what kind of offsetof node this is.
Definition: Expr.h:2217
QualType getType() const
Definition: Expr.h:137
Expr * getPrevEnsureUpperBound() const
Definition: StmtOpenMP.h:1028
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:3541
This represents &#39;#pragma omp for&#39; directive.
Definition: StmtOpenMP.h:1259
An ObjCIndirectCopyRestoreExpr record.
Definition: ASTBitCodes.h:1671
Expr * getElement(unsigned Index)
getElement - Return the Element at the specified index.
Definition: ExprObjC.h:230
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:273
SourceLocation getSwitchLoc() const
Definition: Stmt.h:2176
LabelDecl * getLabel() const
Definition: Stmt.h:2494
bool hasInitializer() const
Whether this new-expression has any initializer at all.
Definition: ExprCXX.h:2262
const Stmt * getTryBody() const
Retrieve the @try body.
Definition: StmtObjC.h:208
Represents a folding of a pack over an operator.
Definition: ExprCXX.h:4529
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
Definition: Stmt.h:2636
This represents &#39;#pragma omp target teams&#39; directive.
Definition: StmtOpenMP.h:4251
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
Definition: Expr.h:5671
An expression that sends a message to the given Objective-C object or class.
Definition: ExprObjC.h:950
void AddDeclRef(const Decl *D)
Emit a reference to a declaration.
This represents a Microsoft inline-assembly statement extension.
Definition: Stmt.h:3101
SourceLocation getDoLoc() const
Definition: Stmt.h:2383
SwitchCase * getSwitchCaseList()
Definition: Stmt.h:2172
SourceLocation getAtLoc() const
Definition: StmtObjC.h:388
ObjCMethodDecl * getImplicitPropertyGetter() const
Definition: ExprObjC.h:712
A DesignatedInitUpdateExpr record.
Definition: ASTBitCodes.h:1584
SourceLocation getRBracketLoc() const
Definition: Expr.h:2516
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:2046
Expr * getInputExpr(unsigned i)
Definition: Stmt.cpp:742
Expr * getOutputExpr(unsigned i)
Definition: Stmt.cpp:738
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:5136
SourceLocation getMemberLoc() const
getMemberLoc - Return the location of the "member", in X->F, it is the location of &#39;F&#39;...
Definition: Expr.h:3025
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
Definition: ExprObjC.h:1234
bool usesGNUSyntax() const
Determines whether this designated initializer used the deprecated GNU syntax for designated initiali...
Definition: Expr.h:4873
AtomicOp getOp() const
Definition: Expr.h:5913
A member reference to an MSPropertyDecl.
Definition: ExprCXX.h:863
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition: ExprCXX.h:4209
const OffsetOfNode & getComponent(unsigned Idx) const
Definition: Expr.h:2316
This represents &#39;#pragma omp cancel&#39; directive.
Definition: StmtOpenMP.h:3005
Expr * getTrueExpr() const
getTrueExpr - Return the subexpression which will be evaluated if the condition evaluates to true; th...
Definition: Expr.h:3860
Expr * getCond()
Definition: Stmt.h:1909
ValueDecl * getDecl()
Definition: Expr.h:1247
An ObjCAvailabilityCheckExpr record.
Definition: ASTBitCodes.h:1698
SourceLocation getLocation() const
Definition: Expr.h:1955
SourceLocation getRParenLoc() const
Definition: Expr.h:4276
SourceLocation getForLoc() const
Definition: StmtObjC.h:52
const Expr * getSubExpr() const
Definition: Expr.h:2010
ObjCBridgeCastKind getBridgeKind() const
Determine which kind of bridge is being performed via this cast.
Definition: ExprObjC.h:1665
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprCXX.h:1061
const Expr * getSubExpr() const
Definition: ExprCXX.h:1396
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr.cast]), which uses the syntax (Type)expr.
Definition: Expr.h:3371
const DeclContext * getUsedContext() const
Definition: ExprCXX.h:1244
Expr * getLHS()
An array access can be written A[4] or 4[A] (both are equivalent).
Definition: Expr.h:2497
bool getValue() const
Definition: ExprCXX.h:657
bool hadMultipleCandidates() const
Returns true if this expression refers to a function that was resolved from an overloaded set having ...
Definition: Expr.h:1360
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Definition: ASTConcept.h:158
void writeOMPClause(OMPClause *C)
Definition: ASTWriter.cpp:6037
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1...
Definition: Expr.h:1662
This represents &#39;#pragma omp flush&#39; directive.
Definition: StmtOpenMP.h:2267
An ObjCForCollectionStmt record.
Definition: ASTBitCodes.h:1674
ArrayRef< concepts::Requirement * > getRequirements() const
Definition: ExprConcepts.h:513
This represents &#39;#pragma omp parallel for simd&#39; directive.
Definition: StmtOpenMP.h:1796
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
Definition: Expr.h:421
DoStmt - This represents a &#39;do/while&#39; stmt.
Definition: Stmt.h:2354
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
Definition: Stmt.h:2719
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:1506
void push_back(uint64_t N)
Minimal vector-like interface.
This represents &#39;#pragma omp parallel master taskloop&#39; directive.
Definition: StmtOpenMP.h:3340
Expr * getLastIteration() const
Definition: StmtOpenMP.h:918
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:2489
Expr * getArgument()
Definition: ExprCXX.h:2401
This represents &#39;#pragma omp target enter data&#39; directive.
Definition: StmtOpenMP.h:2631
Expr * getStrideVariable() const
Definition: StmtOpenMP.h:970
This represents &#39;#pragma omp master taskloop simd&#39; directive.
Definition: StmtOpenMP.h:3272
SourceLocation getEndLoc() const LLVM_READONLY
Definition: ExprConcepts.h:538
bool getValue() const
Definition: ExprCXX.h:3984
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Definition: ExprCXX.h:445
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
Definition: Expr.h:1075
Expr * getBase() const
Definition: Expr.h:4992
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition: Expr.h:4067
unsigned getNumArgs() const
Return the number of actual arguments in this message, not counting the receiver. ...
Definition: ExprObjC.h:1382
Expr * getCombinedDistCond() const
Definition: StmtOpenMP.h:1076
const Stmt * getPreInits() const
Definition: StmtOpenMP.h:942
#define false
Definition: stdbool.h:17
SourceLocation getLParenLoc() const
Definition: Expr.h:3110
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr...
Definition: ExprCXX.h:2844
A field in a dependent type, known only by its name.
Definition: Expr.h:2172
This captures a statement into a function.
Definition: Stmt.h:3376
Represents a call to an inherited base class constructor from an inheriting constructor.
Definition: ExprCXX.h:1613
ExpressionTrait getTrait() const
Definition: ExprCXX.h:2822
unsigned path_size() const
Definition: Expr.h:3221
Token * getAsmToks()
Definition: Stmt.h:3132
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition: Expr.h:5715
bool isImplicitProperty() const
Definition: ExprObjC.h:704
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on a template...
Definition: Expr.h:200
bool inheritedFromVBase() const
Determine whether the inherited constructor is inherited from a virtual base of the object we constru...
Definition: ExprCXX.h:1662
StringLiteral * getFunctionName()
Definition: Expr.h:1958
unsigned getNumExprs() const
Return the number of expressions in this paren list.
Definition: Expr.h:5169
This represents &#39;#pragma omp single&#39; directive.
Definition: StmtOpenMP.h:1535
Encodes a location in the source.
body_range body()
Definition: Stmt.h:1365
Expr * getRetValue()
Definition: Stmt.h:2669
StringRef getOutputConstraint(unsigned i) const
Definition: Stmt.h:3142
SourceLocation getOperatorLoc() const
Definition: Expr.h:3466
const Stmt * getCatchBody() const
Definition: StmtObjC.h:93
unsigned getNumHandlers() const
Definition: StmtCXX.h:106
Expr * getSubExpr() const
Definition: Expr.h:2076
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:5668
bool hasUnresolvedUsing() const
Determine whether the lookup results contain an unresolved using declaration.
Definition: ExprCXX.h:3861
CastKind getCastKind() const
Definition: Expr.h:3196
Expr * getSubExpr(unsigned Idx) const
Definition: Expr.h:4891
SourceLocation getOperatorLoc() const
Retrieve the location of the cast operator keyword, e.g., static_cast.
Definition: ExprCXX.h:383
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
Definition: ExprCXX.h:2100
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c dictionary literal.
Definition: ExprObjC.h:358
OMPClause * getClause(unsigned i) const
Returns specified clause.
Definition: StmtOpenMP.h:247
Expr * getLHS()
Definition: Stmt.h:1589
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit...
Definition: ExprCXX.h:564
Represents a C++2a __builtin_bit_cast(T, v) expression.
Definition: ExprCXX.h:4812
SourceLocation getEllipsisLoc() const
Retrieve the location of the ellipsis that describes this pack expansion.
Definition: ExprCXX.h:4051
Expr * getExpr()
Get &#39;expr&#39; part of the associated expression/statement.
Definition: StmtOpenMP.h:2496
Represents a call to a member function that may be written either with member call syntax (e...
Definition: ExprCXX.h:171
SourceLocation getExceptLoc() const
Definition: Stmt.h:3225
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprObjC.h:380
Stmt * getElse()
Definition: Stmt.h:1930
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
Definition: Stmt.h:1225
DeclarationNameInfo getDirectiveName() const
Return name of the directive.
Definition: StmtOpenMP.h:1699
SourceLocation getLBraceLoc() const
Definition: Stmt.h:3124
A CXXFunctionalCastExpr record.
Definition: ASTBitCodes.h:1742
Expr * getCond()
Definition: Stmt.h:2103
SourceLocation getStrTokenLoc(unsigned TokNum) const
Get one of the string literal token.
Definition: Expr.h:1858
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:2089
SourceLocation getColonLoc() const
Definition: ExprOpenMP.h:108
SourceLocation RAngleLoc
The source location of the right angle bracket (&#39;>&#39;).
Definition: TemplateBase.h:655
SourceLocation getRParenLoc() const
Definition: Expr.h:3979
An ObjCEncodeExpr record.
Definition: ASTBitCodes.h:1644
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:1301
This represents &#39;#pragma omp taskwait&#39; directive.
Definition: StmtOpenMP.h:2147
SourceLocation getAtLoc() const
Definition: ExprObjC.h:423
SourceRange getSourceRange() const
Definition: ExprObjC.h:1717
bool isPascal() const
Definition: Expr.h:1835
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load, __atomic_store, and __atomic_compare_exchange_*, for the similarly-named C++11 instructions, and __c11 variants for <stdatomic.h>, and corresponding __opencl_atomic_* for OpenCL 2.0.
Definition: Expr.h:5849
UnaryExprOrTypeTrait getKind() const
Definition: Expr.h:2403
bool isArray() const
Definition: ExprCXX.h:2223
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:503
bool isValueDependent() const
isValueDependent - Determines whether this expression is value-dependent (C++ [temp.dep.constexpr]).
Definition: Expr.h:158
SourceLocation getLParenLoc() const
Definition: Expr.h:3977
SourceLocation getGotoLoc() const
Definition: Stmt.h:2497
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:1668
const StringLiteral * getOutputConstraintLiteral(unsigned i) const
Definition: Stmt.h:2979
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:3274
Stmt * getCapturedStmt()
Retrieve the statement being captured.
Definition: Stmt.h:3477
void AddAttributes(ArrayRef< const Attr *> Attrs)
Emit a list of attributes.
Definition: ASTWriter.cpp:4174
SourceLocation getAtCatchLoc() const
Definition: StmtObjC.h:105
CharacterKind getKind() const
Definition: Expr.h:1557
This represents &#39;#pragma omp target&#39; directive.
Definition: StmtOpenMP.h:2514
Expr * getInputExpr(unsigned i)
Definition: Stmt.cpp:451
void AddSourceLocation(SourceLocation Loc)
Emit a source location.
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:2042
Expr * getV()
Get &#39;v&#39; part of the associated expression/statement.
Definition: StmtOpenMP.h:2491
bool isParenTypeId() const
Definition: ExprCXX.h:2253
SourceLocation getEndLoc() const
Definition: Stmt.h:3126
NullStmtBitfields NullStmtBits
Definition: Stmt.h:963
Expr * getSubExpr()
Definition: ExprObjC.h:142
An expression trait intrinsic.
Definition: ExprCXX.h:2785
ArrayRef< Expr * > exprs()
Definition: Expr.h:5184
const ObjCMethodDecl * getMethodDecl() const
Definition: ExprObjC.h:1356
An AtomicExpr record.
Definition: ASTBitCodes.h:1632
A static requirement that can be used in a requires-expression to check properties of types and expre...
Definition: ExprConcepts.h:145
VarDecl * getConditionVariable()
Retrieve the variable declared in this "switch" statement, if any.
Definition: Stmt.cpp:994
DeclStmt * getConditionVariableDeclStmt()
If this WhileStmt has a condition variable, return the faux DeclStmt associated with the creation of ...
Definition: Stmt.h:2315
This represents &#39;#pragma omp ordered&#39; directive.
Definition: StmtOpenMP.h:2323
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition: Expr.h:3954
void AddAPFloat(const llvm::APFloat &Value)
Emit a floating-point value.
Definition: ASTWriter.cpp:5035
This represents &#39;#pragma omp target update&#39; directive.
Definition: StmtOpenMP.h:3547
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:124
bool isArgumentType() const
Definition: Expr.h:2408
SourceLocation getKeywordLoc() const
Definition: Stmt.h:1479
Expr * getArrayFiller()
If this initializer list initializes an array with more elements than there are initializers in the l...
Definition: Expr.h:4497
SourceLocation getStarLoc() const
Definition: Stmt.h:2538
bool passAlignment() const
Indicates whether the required alignment should be implicitly passed to the allocation function...
Definition: ExprCXX.h:2293
bool isPartOfExplicitCast() const
Definition: Expr.h:3293
FunctionDecl * getOperatorDelete() const
Definition: ExprCXX.h:2220
This represents &#39;#pragma omp parallel master taskloop simd&#39; directive.
Definition: StmtOpenMP.h:3411
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:687
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
Definition: Expr.cpp:224
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
Definition: Expr.h:1371
void AddDeclarationNameInfo(const DeclarationNameInfo &NameInfo)
Definition: ASTWriter.cpp:5404
void VisitStmt(Stmt *S)
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:3155
Expr * Value
The value of the dictionary element.
Definition: ExprObjC.h:266
const Expr * getInitializer() const
Definition: Expr.h:3103
ArrayRef< Expr * > finals_conditions()
Definition: StmtOpenMP.h:1146
Expr * getLHS() const
Definition: Expr.h:3474
void AddTemplateKWAndArgsInfo(const ASTTemplateKWAndArgsInfo &ArgInfo, const TemplateArgumentLoc *Args)
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:3654
SourceLocation getLocation() const LLVM_READONLY
Definition: ExprCXX.h:1664
A POD class for pairing a NamedDecl* with an access specifier.
Represents a C11 generic selection.
Definition: Expr.h:5234
ArrayRef< TemplateArgument > getPartialArguments() const
Get.
Definition: ExprCXX.h:4184
const Expr * getBase() const
Definition: Expr.h:5536
Expr * getInstanceReceiver()
Returns the object expression (receiver) for an instance message, or null for a message that is not a...
Definition: ExprObjC.h:1260
bool isReversed() const
Determine whether this expression was rewritten in reverse form.
Definition: ExprCXX.h:311
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition: Expr.h:3910
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers...
Definition: ExprObjC.h:1638
Represents a reference to a function parameter pack or init-capture pack that has been substituted bu...
Definition: ExprCXX.h:4337
Represents a template argument.
Definition: TemplateBase.h:50
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
Definition: Expr.h:3851
SourceLocation getMemberLoc() const
Definition: ExprCXX.h:922
TypeSourceInfo * getDestroyedTypeInfo() const
Retrieve the source location information for the type being destroyed.
Definition: ExprCXX.h:2572
arg_iterator arg_end()
Definition: ExprObjC.h:1473
Expr * getFalseExpr() const
getFalseExpr - Return the subexpression which will be evaluated if the condnition evaluates to false;...
Definition: Expr.h:3867
NullStmt - This is the null statement ";": C99 6.8.3p3.
Definition: Stmt.h:1297
bool isTypeOperand() const
Definition: ExprCXX.h:804
StringRef getInputConstraint(unsigned i) const
Definition: Stmt.h:3155
SourceLocation getLocation() const
Definition: ExprCXX.h:663
unsigned getNumAssocs() const
The number of association expressions.
Definition: Expr.h:5402
Dataflow Directional Tag Classes.
Expr * getPrevUpperBoundVariable() const
Definition: StmtOpenMP.h:1016
bool isVolatile() const
Definition: Stmt.h:2755
An InitListExpr record.
Definition: ASTBitCodes.h:1578
VarDecl * getConditionVariable()
Retrieve the variable declared in this "while" statement, if any.
Definition: Stmt.cpp:1050
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:1903
SourceLocation getLocation() const
Definition: ExprObjC.h:763
RequiresExprBodyDecl * getBody() const
Definition: ExprConcepts.h:511
A CXXBoolLiteralExpr record.
Definition: ASTBitCodes.h:1751
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
Definition: ExprCXX.h:2359
IdentifierInfo * getOutputIdentifier(unsigned i) const
Definition: Stmt.h:2968
bool isSimple() const
Definition: Stmt.h:2752
OverloadedOperatorKind getOperator() const
Returns the kind of overloaded operator that this expression refers to.
Definition: ExprCXX.h:107
NonTypeTemplateParmDecl * getParameterPack() const
Retrieve the non-type template parameter pack being substituted.
Definition: ExprCXX.h:4297
MSPropertyDecl * getPropertyDecl() const
Definition: ExprCXX.h:920
static void addSubstitutionDiagnostic(ASTRecordWriter &Record, const concepts::Requirement::SubstitutionDiagnostic *D)
const Stmt * getFinallyBody() const
Definition: StmtObjC.h:139
An ExtVectorElementExpr record.
Definition: ASTBitCodes.h:1575
ArrayRef< const Attr * > getAttrs() const
Definition: Stmt.h:1812
bool isImplicit() const
Definition: ExprCXX.h:1118
Expr * getCond() const
Definition: StmtOpenMP.h:930
This represents &#39;#pragma omp section&#39; directive.
Definition: StmtOpenMP.h:1472
This represents &#39;#pragma omp teams distribute&#39; directive.
Definition: StmtOpenMP.h:3961
QualType getSuperType() const
Retrieve the type referred to by &#39;super&#39;.
Definition: ExprObjC.h:1336
SourceLocation EllipsisLoc
The location of the ellipsis, if this is a pack expansion.
Definition: ExprObjC.h:269
TypeSourceInfo * getTypeSourceInfo() const
Retrieve the type source information for the type being constructed.
Definition: ExprCXX.h:3429
AccessSpecifier getAccess() const
Definition: DeclBase.h:473
A runtime availability query.
Definition: ExprObjC.h:1699
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:4446
VarDecl *const * iterator
Iterators over the parameters which the parameter pack expanded into.
Definition: ExprCXX.h:4373
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
Definition: ExprCXX.h:487
This represents &#39;#pragma omp simd&#39; directive.
Definition: StmtOpenMP.h:1194
Stmt * getHandler() const
Definition: Stmt.h:3317
Represents a &#39;co_yield&#39; expression.
Definition: ExprCXX.h:4786
SourceLocation getLBraceLoc() const
Definition: Expr.h:4550
SourceLocation getSemiLoc() const
Definition: Stmt.h:1308
An ObjCAutoreleasePoolStmt record.
Definition: ASTBitCodes.h:1692
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:2245
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition: ExprCXX.h:4015
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
Definition: ExprCXX.h:1513
bool isImplicit() const
Definition: ExprCXX.h:4725
A CXXDynamicCastExpr record.
Definition: ASTBitCodes.h:1733
const NestedNameSpecifierLoc & getNestedNameSpecifierLoc() const
Definition: ASTConcept.h:138
DependentScopeDeclRefExprBitfields DependentScopeDeclRefExprBits
Definition: Stmt.h:1012
const Expr * getSynchExpr() const
Definition: StmtObjC.h:305
Expr * getUpdateExpr()
Get helper expression of the form &#39;OpaqueValueExpr(x) binop OpaqueValueExpr(expr)&#39; or &#39;OpaqueValueExp...
Definition: StmtOpenMP.h:2477
SourceLocation getParameterPackLocation() const
Get the location of the parameter pack.
Definition: ExprCXX.h:4369
semantics_iterator semantics_begin()
Definition: Expr.h:5783
bool isIfExists() const
Determine whether this is an __if_exists statement.
Definition: StmtCXX.h:277
SourceLocation getBeginLoc() const
Definition: Expr.h:4339
NestedNameSpecifierLoc getQualifierLoc() const
Definition: ExprCXX.h:923
ExplicitCastExpr - An explicit cast written in the source code.
Definition: Expr.h:3337
This represents &#39;#pragma omp atomic&#39; directive.
Definition: StmtOpenMP.h:2379
child_range children()
Definition: ExprCXX.h:4684
Expr * getCombinedInit() const
Definition: StmtOpenMP.h:1052
SourceLocation getLParenLoc() const
Definition: ExprObjC.h:1662
DeclStmt * getConditionVariableDeclStmt()
If this IfStmt has a condition variable, return the faux DeclStmt associated with the creation of tha...
Definition: Stmt.h:1965
void AddVersionTuple(const VersionTuple &Version)
Emit a version tuple.
An ObjCAtFinallyStmt record.
Definition: ASTBitCodes.h:1680
SourceLocation getRParenLoc() const
Definition: ExprObjC.h:524
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition: ExprCXX.h:811
CXXNewExprBitfields CXXNewExprBits
Definition: Stmt.h:1009
RequiresExprBitfields RequiresExprBits
Definition: Stmt.h:1022
llvm::APInt getValue() const
Definition: Expr.h:1430
Represents a __leave statement.
Definition: Stmt.h:3337
unsigned getCollapsedNumber() const
Get number of collapsed loops.
Definition: StmtOpenMP.h:912
Expr * getCombinedNextLowerBound() const
Definition: StmtOpenMP.h:1064
ArrayRef< Expr * > counters()
Definition: StmtOpenMP.h:1104
LabelDecl * getLabel() const
Definition: Expr.h:3932
path_iterator path_end()
Definition: Expr.h:3223
iterator end() const
Definition: ExprCXX.h:4375
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition: ExprCXX.h:3958
SwitchStmt - This represents a &#39;switch&#39; stmt.
Definition: Stmt.h:2043
unsigned getByteLength() const
Definition: Expr.h:1822
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:1070
SourceLocation getBeginLoc() const
Definition: ExprCXX.h:2410
arg_iterator arg_begin()
Definition: ExprObjC.h:1471
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source location information.
Definition: ExprCXX.h:3207
SourceLocation getRParenLoc() const
Definition: StmtObjC.h:54
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:449
Expr * getBase() const
Definition: ExprObjC.h:1518
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:1064
SourceLocation getBuiltinLoc() const
Definition: Expr.h:4017
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition: Expr.h:2462
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c array literal.
Definition: ExprObjC.h:227
SourceLocation getLeaveLoc() const
Definition: Stmt.h:3347
Represents Objective-C&#39;s collection statement.
Definition: StmtObjC.h:23
An ObjCAtSynchronizedStmt record.
Definition: ASTBitCodes.h:1686
arg_iterator arg_begin()
Definition: Expr.h:2744
ArrayRef< Expr * > inits()
Definition: StmtOpenMP.h:1116
unsigned getNumObjects() const
Definition: ExprCXX.h:3337
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:407
SourceLocation getLocation() const
Retrieve the location of this expression.
Definition: Expr.h:1105
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:2175
Expr * getCond() const
getCond - Return the condition expression; this is defined in terms of the opaque value...
Definition: Expr.h:3855
Represents a call to a CUDA kernel function.
Definition: ExprCXX.h:224
SourceLocation getRParenLoc() const
Definition: Expr.h:4185
Represents a &#39;co_await&#39; expression.
Definition: ExprCXX.h:4699
bool isUnique() const
Definition: Expr.h:1141
TypeTraitExprBitfields TypeTraitExprBits
Definition: Stmt.h:1011
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:1413
Stmt * getInit()
Definition: Stmt.h:2124
A CXXMemberCallExpr record.
Definition: ASTBitCodes.h:1715
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
Definition: ExprCXX.h:2298
SourceRange getDirectInitRange() const
Definition: ExprCXX.h:2342
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:1002
Opcode getOpcode() const
Definition: Expr.h:2071
Expr * getArg(unsigned Arg)
Return the specified argument.
Definition: ExprCXX.h:1573
StringRef getBytes() const
Allow access to clients that need the byte representation, such as ASTWriterStmt::VisitStringLiteral(...
Definition: Expr.h:1802
Represents Objective-C&#39;s @finally statement.
Definition: StmtObjC.h:127
SourceLocation getDefaultLoc() const
Definition: Expr.h:5486
StringRef getAsmString() const
Definition: Stmt.h:3135
bool hasAssociatedStmt() const
Returns true if directive has associated statement.
Definition: StmtOpenMP.h:250
Expr * getPrevLowerBoundVariable() const
Definition: StmtOpenMP.h:1010
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:3001
SourceLocation getColonLoc() const
Definition: Stmt.h:1481
Represents a base class of a C++ class.
Definition: DeclCXX.h:145
unsigned getNumClobbers() const
Definition: Stmt.h:2800
bool isImplicit() const
Definition: StmtCXX.h:489
SourceLocation getRParenLoc() const
Definition: Stmt.h:2460
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:546
child_range children()
Definition: ExprCXX.h:4774
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof...
Definition: ExprCXX.h:4179
Represents an expression that might suspend coroutine execution; either a co_await or co_yield expres...
Definition: ExprCXX.h:4612
DeclStmt * getRangeStmt()
Definition: StmtCXX.h:161
A ConvertVectorExpr record.
Definition: ASTBitCodes.h:1620
unsigned arg_size() const
Retrieve the number of arguments.
Definition: ExprCXX.h:3447
Expr * getRHS() const
Definition: Expr.h:4179
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:2749
GotoStmt - This represents a direct goto.
Definition: Stmt.h:2481
A use of a default initializer in a constructor or in aggregate initialization.
Definition: ExprCXX.h:1279
Expr * getTarget()
Definition: Stmt.h:2540
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition: Expr.h:4091
const SwitchCase * getNextSwitchCase() const
Definition: Stmt.h:1475
CapturedDecl * getCapturedDecl()
Retrieve the outlined function declaration.
Definition: Stmt.cpp:1298
StringRef getUuidStr() const
Definition: ExprCXX.h:1057
bool isFreeIvar() const
Definition: ExprObjC.h:585
Expr * getCond()
Definition: Stmt.h:2372
QualType getSuperReceiverType() const
Definition: ExprObjC.h:767
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
VarDecl * getConditionVariable()
Retrieve the variable declared in this "if" statement, if any.
Definition: Stmt.cpp:887
ASTStmtWriter(ASTWriter &Writer, ASTWriter::RecordData &Record)
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition: Expr.h:2836
GNU array range designator.
Definition: ASTBitCodes.h:1890
SourceLocation getWhileLoc() const
Definition: Stmt.h:2385
An ArrayInitIndexExpr record.
Definition: ASTBitCodes.h:1593
A GCC-style AsmStmt record.
Definition: ASTBitCodes.h:1503
This represents &#39;#pragma omp target parallel&#39; directive.
Definition: StmtOpenMP.h:2748
ArrayRef< TemplateArgument > getTemplateArguments() const
Definition: ExprConcepts.h:94
ContinueStmt - This represents a continue.
Definition: Stmt.h:2569
Expr * getPromiseCall() const
Retrieve the promise call that results from this &#39;co_return&#39; statement.
Definition: StmtCXX.h:485
Represents a loop initializing the elements of an array.
Definition: Expr.h:5027
SourceLocation getColonLoc() const
Definition: StmtCXX.h:203
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition: Expr.h:4130
Expr * getFilterExpr() const
Definition: Stmt.h:3228
SourceLocation getAttrLoc() const
Definition: Stmt.h:1811
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Definition: Expr.h:3808
CXXCatchStmt - This represents a C++ catch block.
Definition: StmtCXX.h:28
An index into an array.
Definition: Expr.h:2168
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr.type.conv]).
Definition: ExprCXX.h:1688
SourceLocation getRParenLoc() const
Definition: Expr.h:5189
An object for streaming information to a record.
An ObjCAtCatchStmt record.
Definition: ASTBitCodes.h:1677
Expr * getRHS() const
Definition: Expr.h:3781
Expr * getCombinedCond() const
Definition: StmtOpenMP.h:1058
WhileStmt - This represents a &#39;while&#39; stmt.
Definition: Stmt.h:2226
Represents the specialization of a concept - evaluates to a prvalue of type bool. ...
Definition: ExprConcepts.h:40
SourceRange getParenOrBraceRange() const
Definition: ExprCXX.h:1590
CleanupObject getObject(unsigned i) const
Definition: ExprCXX.h:3339
Field designator where the field has been resolved to a declaration.
Definition: ASTBitCodes.h:1884
unsigned getNumConcatenated() const
getNumConcatenated - Get the number of string literal tokens that were concatenated in translation ph...
Definition: Expr.h:1853
SourceLocation getLParenLoc() const
Definition: ExprCXX.h:1719
bool containsUnexpandedParameterPack() const
Whether this expression contains an unexpanded parameter pack (for C++11 variadic templates)...
Definition: Expr.h:223
child_range children()
Definition: StmtCXX.h:429
SourceLocation getAtSynchronizedLoc() const
Definition: StmtObjC.h:294
A CXXInheritedCtorInitExpr record.
Definition: ASTBitCodes.h:1724
const DeclContext * getUsedContext() const
Definition: ExprCXX.h:1316
CompoundStmt * getTryBlock()
Definition: StmtCXX.h:99
Writes an AST file containing the contents of a translation unit.
Definition: ASTWriter.h:96
SourceLocation getBreakLoc() const
Definition: Stmt.h:2608
bool shouldCopy() const
shouldCopy - True if we should do the &#39;copy&#39; part of the copy-restore.
Definition: ExprObjC.h:1607
The receiver is a class.
Definition: ExprObjC.h:1098
Represents Objective-C&#39;s @try ... @catch ... @finally statement.
Definition: StmtObjC.h:165
capture_iterator capture_end() const
Retrieve an iterator pointing past the end of the sequence of captures.
Definition: Stmt.h:3524
void AddCXXBaseSpecifier(const CXXBaseSpecifier &Base)
Emit a C++ base specifier.
Definition: ASTWriter.cpp:5520
SourceLocation getTemplateKWLoc() const
Definition: ASTConcept.h:148
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
Definition: Stmt.cpp:263
bool isGlobalDelete() const
Definition: ExprCXX.h:2385
This represents &#39;#pragma omp taskloop simd&#39; directive.
Definition: StmtOpenMP.h:3137
void AddASTTemplateArgumentListInfo(const ASTTemplateArgumentListInfo *ASTTemplArgList)
Emits an AST template argument list info.
Definition: ASTWriter.cpp:5499
SourceLocation getBuiltinLoc() const
getBuiltinLoc - Return the location of the __builtin_convertvector token.
Definition: Expr.h:4102
unsigned getNumCatchStmts() const
Retrieve the number of @catch statements in this try-catch-finally block.
Definition: StmtObjC.h:214
Expr * getBase() const
Retrieve the base object of this member expressions, e.g., the x in x.m.
Definition: ExprCXX.h:3609
StringLiteral - This represents a string literal expression, e.g.
Definition: Expr.h:1711
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2546
SourceRange getTypeIdParens() const
Definition: ExprCXX.h:2254
Expr * getPattern()
Retrieve the pattern of the pack expansion.
Definition: ExprCXX.h:4044
Expr * getPreCond() const
Definition: StmtOpenMP.h:926
RetTy Visit(PTR(Stmt) S, ParamTys... P)
Definition: StmtVisitor.h:43
Expr * getLHS() const
Definition: Expr.h:4177
bool hasTemplateKWAndArgsInfo() const
Definition: ExprCXX.h:2888
Abstract class common to all of the C++ "named"/"keyword" casts.
Definition: ExprCXX.h:353
This represents &#39;#pragma omp sections&#39; directive.
Definition: StmtOpenMP.h:1403
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition: ExprObjC.h:85
bool isObjectReceiver() const
Definition: ExprObjC.h:775
unsigned getNumComponents() const
Definition: Expr.h:2326
This represents &#39;#pragma omp target data&#39; directive.
Definition: StmtOpenMP.h:2573
const ParmVarDecl * getParam() const
Definition: ExprCXX.h:1237
OpenMPDirectiveKind getCancelRegion() const
Get cancellation region for the current cancellation point.
Definition: StmtOpenMP.h:3055
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument for this lambda expression...
Definition: ExprCXX.h:1975
A rewritten comparison expression that was originally written using operator syntax.
Definition: ExprCXX.h:273
capture_range captures()
Definition: Stmt.h:3511
A reference to a declared variable, function, enum, etc.
Definition: Expr.h:1171
Expr * getRHS() const
Definition: Expr.h:3476
NestedNameSpecifierLoc getQualifierLoc() const
Fetches the nested-name qualifier with source-location information, if one was given.
Definition: ExprCXX.h:2965
BreakStmt - This represents a break.
Definition: Stmt.h:2599
SourceLocation getReceiverLocation() const
Definition: ExprObjC.h:765
const VarDecl * getCatchParamDecl() const
Definition: StmtObjC.h:97
unsigned getNumLabels() const
Definition: Stmt.h:3027
SourceLocation getLocation() const
Definition: Expr.h:1556
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
Definition: Expr.h:4515
bool isConditionDependent() const
Definition: Expr.h:4165
Stmt * getSubStmt()
Definition: Stmt.h:1753
SourceLocation getBridgeKeywordLoc() const
The location of the bridge keyword.
Definition: ExprObjC.h:1673
bool hadMultipleCandidates() const
Whether the referred constructor was resolved from an overloaded set having size greater than 1...
Definition: ExprCXX.h:1505
void AddTemplateArgumentLoc(const TemplateArgumentLoc &Arg)
Emits a template argument location.
Definition: ASTWriter.cpp:5191
DeclStmt * getLoopVarStmt()
Definition: StmtCXX.h:168
unsigned getNumArgs() const
Return the number of arguments to the constructor call.
Definition: ExprCXX.h:1570
const Expr * getBase() const
Definition: ExprObjC.h:756
A trivial tuple used to represent a source range.
This represents &#39;#pragma omp taskyield&#39; directive.
Definition: StmtOpenMP.h:2055
This represents &#39;#pragma omp distribute parallel for simd&#39; composite directive.
Definition: StmtOpenMP.h:3688
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition: ExprCXX.h:645
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: ExprCXX.h:4830
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type, member-designator).
Definition: Expr.h:2267
Expr * getQueriedExpression() const
Definition: ExprCXX.h:2824
This represents &#39;#pragma omp parallel sections&#39; directive.
Definition: StmtOpenMP.h:1914
SourceLocation getBuiltinLoc() const
Definition: Expr.h:5939
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
Definition: ExprCXX.h:1000
SourceLocation getRParenLoc() const
Definition: ExprCXX.h:1721
Expr * getCommon() const
getCommon - Return the common expression, written to the left of the condition.
Definition: Expr.h:3848
TypeSourceInfo * getWrittenTypeInfo() const
Definition: Expr.h:4270
DeclStmt * getBeginStmt()
Definition: StmtCXX.h:162
SourceLocation getRightLoc() const
Definition: ExprObjC.h:1417
The receiver is a superclass.
Definition: ExprObjC.h:1104
SourceLocation getGenericLoc() const
Definition: Expr.h:5483
SourceLocation LAngleLoc
The source location of the left angle bracket (&#39;<&#39;).
Definition: TemplateBase.h:652
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1459
SourceLocation getBegin() const
Expr * getSubExpr() const
Retrieve the temporary-generating subexpression whose value will be materialized into a glvalue...
Definition: ExprCXX.h:4436
TypeSourceInfo * getTypeSourceInfo() const
getTypeSourceInfo - Return the destination type.
Definition: Expr.h:4094
SourceLocation getRParenLoc() const
Return the location of the right parentheses.
Definition: Expr.h:2306
Represents Objective-C&#39;s @autoreleasepool Statement.
Definition: StmtObjC.h:368
bool isConditionTrue() const
isConditionTrue - Return whether the condition is true (i.e.
Definition: Expr.h:4158
decls_iterator decls_end() const
Definition: ExprCXX.h:2939
SourceLocation getKeywordLoc() const
Definition: ExprCXX.h:4657
bool caseStmtIsGNURange() const
True if this case statement is of the form case LHS ...
Definition: Stmt.h:1569
StmtCode
Record codes for each kind of statement or expression.
Definition: ASTBitCodes.h:1437
CompoundStmt * getTryBlock() const
Definition: Stmt.h:3313
Stmt * getSubStmt()
Definition: Stmt.h:1816
QualType getBaseType() const
Definition: ExprCXX.h:3857
InitListExpr * getSyntacticForm() const
Definition: Expr.h:4562
Expr * getBaseExpr() const
Definition: ExprCXX.h:919
Represents an implicitly-generated value initialization of an object of a given type.
Definition: Expr.h:5117
CompoundStmt * getBlock() const
Definition: Stmt.h:3232
SourceLocation getReturnLoc() const
Definition: Stmt.h:2692
CapturedRegionKind getCapturedRegionKind() const
Retrieve the captured region kind.
Definition: Stmt.cpp:1313
A GenericSelectionExpr record.
Definition: ASTBitCodes.h:1626
This represents &#39;#pragma omp target parallel for&#39; directive.
Definition: StmtOpenMP.h:2808
Expr * getLength()
Get length of array section.
Definition: ExprOpenMP.h:98
SourceLocation getOperatorLoc() const
Definition: Expr.h:3018
ConstructionKind getConstructionKind() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
Definition: ExprCXX.h:1542
SourceLocation getEndLoc() const LLVM_READONLY
Definition: ExprCXX.h:4831
TypeSourceInfo * getClassReceiverTypeInfo() const
Returns a type-source information of a class message send, or nullptr if the message is not a class m...
Definition: ExprObjC.h:1288
Expr * getBase()
An array section can be written only as Base[LowerBound:Length].
Definition: ExprOpenMP.h:81
Stmt * getSubStmt()
Definition: Stmt.h:1619
bool isOverloaded() const
True if this lookup is overloaded.
Definition: ExprCXX.h:3108
This represents &#39;#pragma omp taskloop&#39; directive.
Definition: StmtOpenMP.h:3071