clang  12.0.0git
ASTWriterStmt.cpp
Go to the documentation of this file.
1 //===--- ASTWriterStmt.cpp - Statement and Expression Serialization -------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 ///
9 /// \file
10 /// Implements serialization for Statements and Expressions.
11 ///
12 //===----------------------------------------------------------------------===//
13 
14 #include "clang/AST/ExprOpenMP.h"
16 #include "clang/Sema/DeclSpec.h"
17 #include "clang/AST/ASTContext.h"
18 #include "clang/AST/DeclCXX.h"
19 #include "clang/AST/DeclObjC.h"
20 #include "clang/AST/DeclTemplate.h"
21 #include "clang/AST/StmtVisitor.h"
22 #include "clang/Lex/Token.h"
23 #include "llvm/Bitstream/BitstreamWriter.h"
24 using namespace clang;
25 
26 //===----------------------------------------------------------------------===//
27 // Statement/expression serialization
28 //===----------------------------------------------------------------------===//
29 
30 namespace clang {
31 
32  class ASTStmtWriter : public StmtVisitor<ASTStmtWriter, void> {
33  ASTWriter &Writer;
34  ASTRecordWriter Record;
35 
37  unsigned AbbrevToUse;
38 
39  public:
41  : Writer(Writer), Record(Writer, Record),
42  Code(serialization::STMT_NULL_PTR), AbbrevToUse(0) {}
43 
44  ASTStmtWriter(const ASTStmtWriter&) = delete;
45 
46  uint64_t Emit() {
47  assert(Code != serialization::STMT_NULL_PTR &&
48  "unhandled sub-statement writing AST file");
49  return Record.EmitStmt(Code, AbbrevToUse);
50  }
51 
53  const TemplateArgumentLoc *Args);
54 
55  void VisitStmt(Stmt *S);
56 #define STMT(Type, Base) \
57  void Visit##Type(Type *);
58 #include "clang/AST/StmtNodes.inc"
59  };
60 }
61 
63  const ASTTemplateKWAndArgsInfo &ArgInfo, const TemplateArgumentLoc *Args) {
64  Record.AddSourceLocation(ArgInfo.TemplateKWLoc);
65  Record.AddSourceLocation(ArgInfo.LAngleLoc);
66  Record.AddSourceLocation(ArgInfo.RAngleLoc);
67  for (unsigned i = 0; i != ArgInfo.NumTemplateArgs; ++i)
68  Record.AddTemplateArgumentLoc(Args[i]);
69 }
70 
72 }
73 
74 void ASTStmtWriter::VisitNullStmt(NullStmt *S) {
75  VisitStmt(S);
76  Record.AddSourceLocation(S->getSemiLoc());
77  Record.push_back(S->NullStmtBits.HasLeadingEmptyMacro);
79 }
80 
81 void ASTStmtWriter::VisitCompoundStmt(CompoundStmt *S) {
82  VisitStmt(S);
83  Record.push_back(S->size());
84  for (auto *CS : S->body())
85  Record.AddStmt(CS);
86  Record.AddSourceLocation(S->getLBracLoc());
87  Record.AddSourceLocation(S->getRBracLoc());
89 }
90 
91 void ASTStmtWriter::VisitSwitchCase(SwitchCase *S) {
92  VisitStmt(S);
93  Record.push_back(Writer.getSwitchCaseID(S));
94  Record.AddSourceLocation(S->getKeywordLoc());
95  Record.AddSourceLocation(S->getColonLoc());
96 }
97 
98 void ASTStmtWriter::VisitCaseStmt(CaseStmt *S) {
99  VisitSwitchCase(S);
100  Record.push_back(S->caseStmtIsGNURange());
101  Record.AddStmt(S->getLHS());
102  Record.AddStmt(S->getSubStmt());
103  if (S->caseStmtIsGNURange()) {
104  Record.AddStmt(S->getRHS());
105  Record.AddSourceLocation(S->getEllipsisLoc());
106  }
108 }
109 
110 void ASTStmtWriter::VisitDefaultStmt(DefaultStmt *S) {
111  VisitSwitchCase(S);
112  Record.AddStmt(S->getSubStmt());
114 }
115 
116 void ASTStmtWriter::VisitLabelStmt(LabelStmt *S) {
117  VisitStmt(S);
118  Record.AddDeclRef(S->getDecl());
119  Record.AddStmt(S->getSubStmt());
120  Record.AddSourceLocation(S->getIdentLoc());
122 }
123 
124 void ASTStmtWriter::VisitAttributedStmt(AttributedStmt *S) {
125  VisitStmt(S);
126  Record.push_back(S->getAttrs().size());
127  Record.AddAttributes(S->getAttrs());
128  Record.AddStmt(S->getSubStmt());
129  Record.AddSourceLocation(S->getAttrLoc());
131 }
132 
133 void ASTStmtWriter::VisitIfStmt(IfStmt *S) {
134  VisitStmt(S);
135 
136  bool HasElse = S->getElse() != nullptr;
137  bool HasVar = S->getConditionVariableDeclStmt() != nullptr;
138  bool HasInit = S->getInit() != nullptr;
139 
140  Record.push_back(S->isConstexpr());
141  Record.push_back(HasElse);
142  Record.push_back(HasVar);
143  Record.push_back(HasInit);
144 
145  Record.AddStmt(S->getCond());
146  Record.AddStmt(S->getThen());
147  if (HasElse)
148  Record.AddStmt(S->getElse());
149  if (HasVar)
150  Record.AddDeclRef(S->getConditionVariable());
151  if (HasInit)
152  Record.AddStmt(S->getInit());
153 
154  Record.AddSourceLocation(S->getIfLoc());
155  Record.AddSourceLocation(S->getLParenLoc());
156  Record.AddSourceLocation(S->getRParenLoc());
157  if (HasElse)
158  Record.AddSourceLocation(S->getElseLoc());
159 
160  Code = serialization::STMT_IF;
161 }
162 
163 void ASTStmtWriter::VisitSwitchStmt(SwitchStmt *S) {
164  VisitStmt(S);
165 
166  bool HasInit = S->getInit() != nullptr;
167  bool HasVar = S->getConditionVariableDeclStmt() != nullptr;
168  Record.push_back(HasInit);
169  Record.push_back(HasVar);
170  Record.push_back(S->isAllEnumCasesCovered());
171 
172  Record.AddStmt(S->getCond());
173  Record.AddStmt(S->getBody());
174  if (HasInit)
175  Record.AddStmt(S->getInit());
176  if (HasVar)
177  Record.AddDeclRef(S->getConditionVariable());
178 
179  Record.AddSourceLocation(S->getSwitchLoc());
180  Record.AddSourceLocation(S->getLParenLoc());
181  Record.AddSourceLocation(S->getRParenLoc());
182 
183  for (SwitchCase *SC = S->getSwitchCaseList(); SC;
184  SC = SC->getNextSwitchCase())
185  Record.push_back(Writer.RecordSwitchCaseID(SC));
187 }
188 
189 void ASTStmtWriter::VisitWhileStmt(WhileStmt *S) {
190  VisitStmt(S);
191 
192  bool HasVar = S->getConditionVariableDeclStmt() != nullptr;
193  Record.push_back(HasVar);
194 
195  Record.AddStmt(S->getCond());
196  Record.AddStmt(S->getBody());
197  if (HasVar)
198  Record.AddDeclRef(S->getConditionVariable());
199 
200  Record.AddSourceLocation(S->getWhileLoc());
201  Record.AddSourceLocation(S->getLParenLoc());
202  Record.AddSourceLocation(S->getRParenLoc());
204 }
205 
206 void ASTStmtWriter::VisitDoStmt(DoStmt *S) {
207  VisitStmt(S);
208  Record.AddStmt(S->getCond());
209  Record.AddStmt(S->getBody());
210  Record.AddSourceLocation(S->getDoLoc());
211  Record.AddSourceLocation(S->getWhileLoc());
212  Record.AddSourceLocation(S->getRParenLoc());
213  Code = serialization::STMT_DO;
214 }
215 
216 void ASTStmtWriter::VisitForStmt(ForStmt *S) {
217  VisitStmt(S);
218  Record.AddStmt(S->getInit());
219  Record.AddStmt(S->getCond());
220  Record.AddDeclRef(S->getConditionVariable());
221  Record.AddStmt(S->getInc());
222  Record.AddStmt(S->getBody());
223  Record.AddSourceLocation(S->getForLoc());
224  Record.AddSourceLocation(S->getLParenLoc());
225  Record.AddSourceLocation(S->getRParenLoc());
227 }
228 
229 void ASTStmtWriter::VisitGotoStmt(GotoStmt *S) {
230  VisitStmt(S);
231  Record.AddDeclRef(S->getLabel());
232  Record.AddSourceLocation(S->getGotoLoc());
233  Record.AddSourceLocation(S->getLabelLoc());
235 }
236 
237 void ASTStmtWriter::VisitIndirectGotoStmt(IndirectGotoStmt *S) {
238  VisitStmt(S);
239  Record.AddSourceLocation(S->getGotoLoc());
240  Record.AddSourceLocation(S->getStarLoc());
241  Record.AddStmt(S->getTarget());
243 }
244 
245 void ASTStmtWriter::VisitContinueStmt(ContinueStmt *S) {
246  VisitStmt(S);
247  Record.AddSourceLocation(S->getContinueLoc());
249 }
250 
251 void ASTStmtWriter::VisitBreakStmt(BreakStmt *S) {
252  VisitStmt(S);
253  Record.AddSourceLocation(S->getBreakLoc());
255 }
256 
257 void ASTStmtWriter::VisitReturnStmt(ReturnStmt *S) {
258  VisitStmt(S);
259 
260  bool HasNRVOCandidate = S->getNRVOCandidate() != nullptr;
261  Record.push_back(HasNRVOCandidate);
262 
263  Record.AddStmt(S->getRetValue());
264  if (HasNRVOCandidate)
265  Record.AddDeclRef(S->getNRVOCandidate());
266 
267  Record.AddSourceLocation(S->getReturnLoc());
269 }
270 
271 void ASTStmtWriter::VisitDeclStmt(DeclStmt *S) {
272  VisitStmt(S);
273  Record.AddSourceLocation(S->getBeginLoc());
274  Record.AddSourceLocation(S->getEndLoc());
275  DeclGroupRef DG = S->getDeclGroup();
276  for (DeclGroupRef::iterator D = DG.begin(), DEnd = DG.end(); D != DEnd; ++D)
277  Record.AddDeclRef(*D);
279 }
280 
281 void ASTStmtWriter::VisitAsmStmt(AsmStmt *S) {
282  VisitStmt(S);
283  Record.push_back(S->getNumOutputs());
284  Record.push_back(S->getNumInputs());
285  Record.push_back(S->getNumClobbers());
286  Record.AddSourceLocation(S->getAsmLoc());
287  Record.push_back(S->isVolatile());
288  Record.push_back(S->isSimple());
289 }
290 
291 void ASTStmtWriter::VisitGCCAsmStmt(GCCAsmStmt *S) {
292  VisitAsmStmt(S);
293  Record.push_back(S->getNumLabels());
294  Record.AddSourceLocation(S->getRParenLoc());
295  Record.AddStmt(S->getAsmString());
296 
297  // Outputs
298  for (unsigned I = 0, N = S->getNumOutputs(); I != N; ++I) {
300  Record.AddStmt(S->getOutputConstraintLiteral(I));
301  Record.AddStmt(S->getOutputExpr(I));
302  }
303 
304  // Inputs
305  for (unsigned I = 0, N = S->getNumInputs(); I != N; ++I) {
306  Record.AddIdentifierRef(S->getInputIdentifier(I));
307  Record.AddStmt(S->getInputConstraintLiteral(I));
308  Record.AddStmt(S->getInputExpr(I));
309  }
310 
311  // Clobbers
312  for (unsigned I = 0, N = S->getNumClobbers(); I != N; ++I)
313  Record.AddStmt(S->getClobberStringLiteral(I));
314 
315  // Labels
316  for (auto *E : S->labels()) Record.AddStmt(E);
317 
319 }
320 
321 void ASTStmtWriter::VisitMSAsmStmt(MSAsmStmt *S) {
322  VisitAsmStmt(S);
323  Record.AddSourceLocation(S->getLBraceLoc());
324  Record.AddSourceLocation(S->getEndLoc());
325  Record.push_back(S->getNumAsmToks());
326  Record.AddString(S->getAsmString());
327 
328  // Tokens
329  for (unsigned I = 0, N = S->getNumAsmToks(); I != N; ++I) {
330  // FIXME: Move this to ASTRecordWriter?
331  Writer.AddToken(S->getAsmToks()[I], Record.getRecordData());
332  }
333 
334  // Clobbers
335  for (unsigned I = 0, N = S->getNumClobbers(); I != N; ++I) {
336  Record.AddString(S->getClobber(I));
337  }
338 
339  // Outputs
340  for (unsigned I = 0, N = S->getNumOutputs(); I != N; ++I) {
341  Record.AddStmt(S->getOutputExpr(I));
342  Record.AddString(S->getOutputConstraint(I));
343  }
344 
345  // Inputs
346  for (unsigned I = 0, N = S->getNumInputs(); I != N; ++I) {
347  Record.AddStmt(S->getInputExpr(I));
348  Record.AddString(S->getInputConstraint(I));
349  }
350 
352 }
353 
354 void ASTStmtWriter::VisitCoroutineBodyStmt(CoroutineBodyStmt *CoroStmt) {
355  VisitStmt(CoroStmt);
356  Record.push_back(CoroStmt->getParamMoves().size());
357  for (Stmt *S : CoroStmt->children())
358  Record.AddStmt(S);
360 }
361 
362 void ASTStmtWriter::VisitCoreturnStmt(CoreturnStmt *S) {
363  VisitStmt(S);
364  Record.AddSourceLocation(S->getKeywordLoc());
365  Record.AddStmt(S->getOperand());
366  Record.AddStmt(S->getPromiseCall());
367  Record.push_back(S->isImplicit());
369 }
370 
371 void ASTStmtWriter::VisitCoroutineSuspendExpr(CoroutineSuspendExpr *E) {
372  VisitExpr(E);
373  Record.AddSourceLocation(E->getKeywordLoc());
374  for (Stmt *S : E->children())
375  Record.AddStmt(S);
376  Record.AddStmt(E->getOpaqueValue());
377 }
378 
379 void ASTStmtWriter::VisitCoawaitExpr(CoawaitExpr *E) {
380  VisitCoroutineSuspendExpr(E);
381  Record.push_back(E->isImplicit());
383 }
384 
385 void ASTStmtWriter::VisitCoyieldExpr(CoyieldExpr *E) {
386  VisitCoroutineSuspendExpr(E);
388 }
389 
390 void ASTStmtWriter::VisitDependentCoawaitExpr(DependentCoawaitExpr *E) {
391  VisitExpr(E);
392  Record.AddSourceLocation(E->getKeywordLoc());
393  for (Stmt *S : E->children())
394  Record.AddStmt(S);
396 }
397 
398 static void
400  const ASTConstraintSatisfaction &Satisfaction) {
401  Record.push_back(Satisfaction.IsSatisfied);
402  if (!Satisfaction.IsSatisfied) {
403  Record.push_back(Satisfaction.NumRecords);
404  for (const auto &DetailRecord : Satisfaction) {
405  Record.AddStmt(const_cast<Expr *>(DetailRecord.first));
406  auto *E = DetailRecord.second.dyn_cast<Expr *>();
407  Record.push_back(E == nullptr);
408  if (E)
409  Record.AddStmt(E);
410  else {
411  auto *Diag = DetailRecord.second.get<std::pair<SourceLocation,
412  StringRef> *>();
413  Record.AddSourceLocation(Diag->first);
414  Record.AddString(Diag->second);
415  }
416  }
417  }
418 }
419 
420 static void
422  ASTRecordWriter &Record,
424  Record.AddString(D->SubstitutedEntity);
425  Record.AddSourceLocation(D->DiagLoc);
426  Record.AddString(D->DiagMessage);
427 }
428 
429 void ASTStmtWriter::VisitConceptSpecializationExpr(
431  VisitExpr(E);
433  Record.push_back(TemplateArgs.size());
435  Record.AddSourceLocation(E->getTemplateKWLoc());
437  Record.AddDeclRef(E->getNamedConcept());
438  Record.AddDeclRef(E->getFoundDecl());
440  for (const TemplateArgument &Arg : TemplateArgs)
441  Record.AddTemplateArgument(Arg);
442  if (!E->isValueDependent())
444 
446 }
447 
448 void ASTStmtWriter::VisitRequiresExpr(RequiresExpr *E) {
449  VisitExpr(E);
450  Record.push_back(E->getLocalParameters().size());
451  Record.push_back(E->getRequirements().size());
452  Record.AddSourceLocation(E->RequiresExprBits.RequiresKWLoc);
453  Record.push_back(E->RequiresExprBits.IsSatisfied);
454  Record.AddDeclRef(E->getBody());
455  for (ParmVarDecl *P : E->getLocalParameters())
456  Record.AddDeclRef(P);
457  for (concepts::Requirement *R : E->getRequirements()) {
458  if (auto *TypeReq = dyn_cast<concepts::TypeRequirement>(R)) {
460  Record.push_back(TypeReq->Status);
462  addSubstitutionDiagnostic(Record, TypeReq->getSubstitutionDiagnostic());
463  else
464  Record.AddTypeSourceInfo(TypeReq->getType());
465  } else if (auto *ExprReq = dyn_cast<concepts::ExprRequirement>(R)) {
466  Record.push_back(ExprReq->getKind());
467  Record.push_back(ExprReq->Status);
468  if (ExprReq->isExprSubstitutionFailure()) {
470  ExprReq->Value.get<concepts::Requirement::SubstitutionDiagnostic *>());
471  } else
472  Record.AddStmt(ExprReq->Value.get<Expr *>());
473  if (ExprReq->getKind() == concepts::Requirement::RK_Compound) {
474  Record.AddSourceLocation(ExprReq->NoexceptLoc);
475  const auto &RetReq = ExprReq->getReturnTypeRequirement();
476  if (RetReq.isSubstitutionFailure()) {
477  Record.push_back(2);
478  addSubstitutionDiagnostic(Record, RetReq.getSubstitutionDiagnostic());
479  } else if (RetReq.isTypeConstraint()) {
480  Record.push_back(1);
482  RetReq.getTypeConstraintTemplateParameterList());
483  if (ExprReq->Status >=
485  Record.AddStmt(
486  ExprReq->getReturnTypeRequirementSubstitutedConstraintExpr());
487  } else {
488  assert(RetReq.isEmpty());
489  Record.push_back(0);
490  }
491  }
492  } else {
493  auto *NestedReq = cast<concepts::NestedRequirement>(R);
495  Record.push_back(NestedReq->isSubstitutionFailure());
496  if (NestedReq->isSubstitutionFailure()){
498  NestedReq->getSubstitutionDiagnostic());
499  } else {
500  Record.AddStmt(NestedReq->Value.get<Expr *>());
501  if (!NestedReq->isDependent())
502  addConstraintSatisfaction(Record, *NestedReq->Satisfaction);
503  }
504  }
505  }
506  Record.AddSourceLocation(E->getEndLoc());
507 
509 }
510 
511 
512 void ASTStmtWriter::VisitCapturedStmt(CapturedStmt *S) {
513  VisitStmt(S);
514  // NumCaptures
515  Record.push_back(std::distance(S->capture_begin(), S->capture_end()));
516 
517  // CapturedDecl and captured region kind
518  Record.AddDeclRef(S->getCapturedDecl());
519  Record.push_back(S->getCapturedRegionKind());
520 
521  Record.AddDeclRef(S->getCapturedRecordDecl());
522 
523  // Capture inits
524  for (auto *I : S->capture_inits())
525  Record.AddStmt(I);
526 
527  // Body
528  Record.AddStmt(S->getCapturedStmt());
529 
530  // Captures
531  for (const auto &I : S->captures()) {
532  if (I.capturesThis() || I.capturesVariableArrayType())
533  Record.AddDeclRef(nullptr);
534  else
535  Record.AddDeclRef(I.getCapturedVar());
536  Record.push_back(I.getCaptureKind());
537  Record.AddSourceLocation(I.getLocation());
538  }
539 
541 }
542 
543 void ASTStmtWriter::VisitExpr(Expr *E) {
544  VisitStmt(E);
545  Record.AddTypeRef(E->getType());
546  Record.push_back(E->isTypeDependent());
547  Record.push_back(E->isValueDependent());
548  Record.push_back(E->isInstantiationDependent());
550  Record.push_back(E->containsErrors());
551  Record.push_back(E->getValueKind());
552  Record.push_back(E->getObjectKind());
553 }
554 
555 void ASTStmtWriter::VisitConstantExpr(ConstantExpr *E) {
556  VisitExpr(E);
557  Record.push_back(E->ConstantExprBits.ResultKind);
558 
559  Record.push_back(E->ConstantExprBits.APValueKind);
560  Record.push_back(E->ConstantExprBits.IsUnsigned);
561  Record.push_back(E->ConstantExprBits.BitWidth);
562  // HasCleanup not serialized since we can just query the APValue.
563  Record.push_back(E->ConstantExprBits.IsImmediateInvocation);
564 
565  switch (E->ConstantExprBits.ResultKind) {
567  break;
569  Record.push_back(E->Int64Result());
570  break;
572  Record.AddAPValue(E->APValueResult());
573  break;
574  default:
575  llvm_unreachable("unexpected ResultKind!");
576  }
577 
578  Record.AddStmt(E->getSubExpr());
580 }
581 
582 void ASTStmtWriter::VisitPredefinedExpr(PredefinedExpr *E) {
583  VisitExpr(E);
584 
585  bool HasFunctionName = E->getFunctionName() != nullptr;
586  Record.push_back(HasFunctionName);
587  Record.push_back(E->getIdentKind()); // FIXME: stable encoding
588  Record.AddSourceLocation(E->getLocation());
589  if (HasFunctionName)
590  Record.AddStmt(E->getFunctionName());
592 }
593 
594 void ASTStmtWriter::VisitDeclRefExpr(DeclRefExpr *E) {
595  VisitExpr(E);
596 
597  Record.push_back(E->hasQualifier());
598  Record.push_back(E->getDecl() != E->getFoundDecl());
599  Record.push_back(E->hasTemplateKWAndArgsInfo());
600  Record.push_back(E->hadMultipleCandidates());
602  Record.push_back(E->isNonOdrUse());
603 
604  if (E->hasTemplateKWAndArgsInfo()) {
605  unsigned NumTemplateArgs = E->getNumTemplateArgs();
606  Record.push_back(NumTemplateArgs);
607  }
608 
610 
611  if ((!E->hasTemplateKWAndArgsInfo()) && (!E->hasQualifier()) &&
612  (E->getDecl() == E->getFoundDecl()) &&
615  AbbrevToUse = Writer.getDeclRefExprAbbrev();
616  }
617 
618  if (E->hasQualifier())
620 
621  if (E->getDecl() != E->getFoundDecl())
622  Record.AddDeclRef(E->getFoundDecl());
623 
624  if (E->hasTemplateKWAndArgsInfo())
625  AddTemplateKWAndArgsInfo(*E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
626  E->getTrailingObjects<TemplateArgumentLoc>());
627 
628  Record.AddDeclRef(E->getDecl());
629  Record.AddSourceLocation(E->getLocation());
630  Record.AddDeclarationNameLoc(E->DNLoc, E->getDecl()->getDeclName());
632 }
633 
634 void ASTStmtWriter::VisitIntegerLiteral(IntegerLiteral *E) {
635  VisitExpr(E);
636  Record.AddSourceLocation(E->getLocation());
637  Record.AddAPInt(E->getValue());
638 
639  if (E->getValue().getBitWidth() == 32) {
640  AbbrevToUse = Writer.getIntegerLiteralAbbrev();
641  }
642 
644 }
645 
646 void ASTStmtWriter::VisitFixedPointLiteral(FixedPointLiteral *E) {
647  VisitExpr(E);
648  Record.AddSourceLocation(E->getLocation());
649  Record.push_back(E->getScale());
650  Record.AddAPInt(E->getValue());
652 }
653 
654 void ASTStmtWriter::VisitFloatingLiteral(FloatingLiteral *E) {
655  VisitExpr(E);
656  Record.push_back(E->getRawSemantics());
657  Record.push_back(E->isExact());
658  Record.AddAPFloat(E->getValue());
659  Record.AddSourceLocation(E->getLocation());
661 }
662 
663 void ASTStmtWriter::VisitImaginaryLiteral(ImaginaryLiteral *E) {
664  VisitExpr(E);
665  Record.AddStmt(E->getSubExpr());
667 }
668 
669 void ASTStmtWriter::VisitStringLiteral(StringLiteral *E) {
670  VisitExpr(E);
671 
672  // Store the various bits of data of StringLiteral.
673  Record.push_back(E->getNumConcatenated());
674  Record.push_back(E->getLength());
675  Record.push_back(E->getCharByteWidth());
676  Record.push_back(E->getKind());
677  Record.push_back(E->isPascal());
678 
679  // Store the trailing array of SourceLocation.
680  for (unsigned I = 0, N = E->getNumConcatenated(); I != N; ++I)
681  Record.AddSourceLocation(E->getStrTokenLoc(I));
682 
683  // Store the trailing array of char holding the string data.
684  StringRef StrData = E->getBytes();
685  for (unsigned I = 0, N = E->getByteLength(); I != N; ++I)
686  Record.push_back(StrData[I]);
687 
689 }
690 
691 void ASTStmtWriter::VisitCharacterLiteral(CharacterLiteral *E) {
692  VisitExpr(E);
693  Record.push_back(E->getValue());
694  Record.AddSourceLocation(E->getLocation());
695  Record.push_back(E->getKind());
696 
697  AbbrevToUse = Writer.getCharacterLiteralAbbrev();
698 
700 }
701 
702 void ASTStmtWriter::VisitParenExpr(ParenExpr *E) {
703  VisitExpr(E);
704  Record.AddSourceLocation(E->getLParen());
705  Record.AddSourceLocation(E->getRParen());
706  Record.AddStmt(E->getSubExpr());
708 }
709 
710 void ASTStmtWriter::VisitParenListExpr(ParenListExpr *E) {
711  VisitExpr(E);
712  Record.push_back(E->getNumExprs());
713  for (auto *SubStmt : E->exprs())
714  Record.AddStmt(SubStmt);
715  Record.AddSourceLocation(E->getLParenLoc());
716  Record.AddSourceLocation(E->getRParenLoc());
718 }
719 
720 void ASTStmtWriter::VisitUnaryOperator(UnaryOperator *E) {
721  VisitExpr(E);
722  bool HasFPFeatures = E->hasStoredFPFeatures();
723  // Write this first for easy access when deserializing, as they affect the
724  // size of the UnaryOperator.
725  Record.push_back(HasFPFeatures);
726  Record.AddStmt(E->getSubExpr());
727  Record.push_back(E->getOpcode()); // FIXME: stable encoding
728  Record.AddSourceLocation(E->getOperatorLoc());
729  Record.push_back(E->canOverflow());
730  if (HasFPFeatures)
733 }
734 
735 void ASTStmtWriter::VisitOffsetOfExpr(OffsetOfExpr *E) {
736  VisitExpr(E);
737  Record.push_back(E->getNumComponents());
738  Record.push_back(E->getNumExpressions());
739  Record.AddSourceLocation(E->getOperatorLoc());
740  Record.AddSourceLocation(E->getRParenLoc());
742  for (unsigned I = 0, N = E->getNumComponents(); I != N; ++I) {
743  const OffsetOfNode &ON = E->getComponent(I);
744  Record.push_back(ON.getKind()); // FIXME: Stable encoding
746  Record.AddSourceLocation(ON.getSourceRange().getEnd());
747  switch (ON.getKind()) {
748  case OffsetOfNode::Array:
749  Record.push_back(ON.getArrayExprIndex());
750  break;
751 
752  case OffsetOfNode::Field:
753  Record.AddDeclRef(ON.getField());
754  break;
755 
757  Record.AddIdentifierRef(ON.getFieldName());
758  break;
759 
760  case OffsetOfNode::Base:
761  Record.AddCXXBaseSpecifier(*ON.getBase());
762  break;
763  }
764  }
765  for (unsigned I = 0, N = E->getNumExpressions(); I != N; ++I)
766  Record.AddStmt(E->getIndexExpr(I));
768 }
769 
770 void ASTStmtWriter::VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *E) {
771  VisitExpr(E);
772  Record.push_back(E->getKind());
773  if (E->isArgumentType())
775  else {
776  Record.push_back(0);
777  Record.AddStmt(E->getArgumentExpr());
778  }
779  Record.AddSourceLocation(E->getOperatorLoc());
780  Record.AddSourceLocation(E->getRParenLoc());
782 }
783 
784 void ASTStmtWriter::VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
785  VisitExpr(E);
786  Record.AddStmt(E->getLHS());
787  Record.AddStmt(E->getRHS());
788  Record.AddSourceLocation(E->getRBracketLoc());
790 }
791 
792 void ASTStmtWriter::VisitMatrixSubscriptExpr(MatrixSubscriptExpr *E) {
793  VisitExpr(E);
794  Record.AddStmt(E->getBase());
795  Record.AddStmt(E->getRowIdx());
796  Record.AddStmt(E->getColumnIdx());
797  Record.AddSourceLocation(E->getRBracketLoc());
799 }
800 
801 void ASTStmtWriter::VisitOMPArraySectionExpr(OMPArraySectionExpr *E) {
802  VisitExpr(E);
803  Record.AddStmt(E->getBase());
804  Record.AddStmt(E->getLowerBound());
805  Record.AddStmt(E->getLength());
806  Record.AddStmt(E->getStride());
807  Record.AddSourceLocation(E->getColonLocFirst());
809  Record.AddSourceLocation(E->getRBracketLoc());
811 }
812 
813 void ASTStmtWriter::VisitOMPArrayShapingExpr(OMPArrayShapingExpr *E) {
814  VisitExpr(E);
815  Record.push_back(E->getDimensions().size());
816  Record.AddStmt(E->getBase());
817  for (Expr *Dim : E->getDimensions())
818  Record.AddStmt(Dim);
819  for (SourceRange SR : E->getBracketsRanges())
820  Record.AddSourceRange(SR);
821  Record.AddSourceLocation(E->getLParenLoc());
822  Record.AddSourceLocation(E->getRParenLoc());
824 }
825 
826 void ASTStmtWriter::VisitOMPIteratorExpr(OMPIteratorExpr *E) {
827  VisitExpr(E);
828  Record.push_back(E->numOfIterators());
829  Record.AddSourceLocation(E->getIteratorKwLoc());
830  Record.AddSourceLocation(E->getLParenLoc());
831  Record.AddSourceLocation(E->getRParenLoc());
832  for (unsigned I = 0, End = E->numOfIterators(); I < End; ++I) {
833  Record.AddDeclRef(E->getIteratorDecl(I));
834  Record.AddSourceLocation(E->getAssignLoc(I));
836  Record.AddStmt(Range.Begin);
837  Record.AddStmt(Range.End);
838  Record.AddStmt(Range.Step);
839  Record.AddSourceLocation(E->getColonLoc(I));
840  if (Range.Step)
841  Record.AddSourceLocation(E->getSecondColonLoc(I));
842  // Serialize helpers
843  OMPIteratorHelperData &HD = E->getHelper(I);
844  Record.AddDeclRef(HD.CounterVD);
845  Record.AddStmt(HD.Upper);
846  Record.AddStmt(HD.Update);
847  Record.AddStmt(HD.CounterUpdate);
848  }
850 }
851 
852 void ASTStmtWriter::VisitCallExpr(CallExpr *E) {
853  VisitExpr(E);
854  Record.push_back(E->getNumArgs());
855  Record.push_back(E->hasStoredFPFeatures());
856  Record.AddSourceLocation(E->getRParenLoc());
857  Record.AddStmt(E->getCallee());
858  for (CallExpr::arg_iterator Arg = E->arg_begin(), ArgEnd = E->arg_end();
859  Arg != ArgEnd; ++Arg)
860  Record.AddStmt(*Arg);
861  Record.push_back(static_cast<unsigned>(E->getADLCallKind()));
862  if (E->hasStoredFPFeatures())
863  Record.push_back(E->getFPFeatures().getAsOpaqueInt());
865 }
866 
867 void ASTStmtWriter::VisitRecoveryExpr(RecoveryExpr *E) {
868  VisitExpr(E);
869  Record.push_back(std::distance(E->children().begin(), E->children().end()));
870  Record.AddSourceLocation(E->getBeginLoc());
871  Record.AddSourceLocation(E->getEndLoc());
872  for (Stmt *Child : E->children())
873  Record.AddStmt(Child);
875 }
876 
877 void ASTStmtWriter::VisitMemberExpr(MemberExpr *E) {
878  VisitExpr(E);
879 
880  bool HasQualifier = E->hasQualifier();
881  bool HasFoundDecl =
882  E->hasQualifierOrFoundDecl() &&
883  (E->getFoundDecl().getDecl() != E->getMemberDecl() ||
884  E->getFoundDecl().getAccess() != E->getMemberDecl()->getAccess());
885  bool HasTemplateInfo = E->hasTemplateKWAndArgsInfo();
886  unsigned NumTemplateArgs = E->getNumTemplateArgs();
887 
888  // Write these first for easy access when deserializing, as they affect the
889  // size of the MemberExpr.
890  Record.push_back(HasQualifier);
891  Record.push_back(HasFoundDecl);
892  Record.push_back(HasTemplateInfo);
893  Record.push_back(NumTemplateArgs);
894 
895  Record.AddStmt(E->getBase());
896  Record.AddDeclRef(E->getMemberDecl());
897  Record.AddDeclarationNameLoc(E->MemberDNLoc,
898  E->getMemberDecl()->getDeclName());
899  Record.AddSourceLocation(E->getMemberLoc());
900  Record.push_back(E->isArrow());
901  Record.push_back(E->hadMultipleCandidates());
902  Record.push_back(E->isNonOdrUse());
903  Record.AddSourceLocation(E->getOperatorLoc());
904 
905  if (HasFoundDecl) {
906  DeclAccessPair FoundDecl = E->getFoundDecl();
907  Record.AddDeclRef(FoundDecl.getDecl());
908  Record.push_back(FoundDecl.getAccess());
909  }
910 
911  if (HasQualifier)
913 
914  if (HasTemplateInfo)
915  AddTemplateKWAndArgsInfo(*E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
916  E->getTrailingObjects<TemplateArgumentLoc>());
917 
919 }
920 
921 void ASTStmtWriter::VisitObjCIsaExpr(ObjCIsaExpr *E) {
922  VisitExpr(E);
923  Record.AddStmt(E->getBase());
924  Record.AddSourceLocation(E->getIsaMemberLoc());
925  Record.AddSourceLocation(E->getOpLoc());
926  Record.push_back(E->isArrow());
928 }
929 
930 void ASTStmtWriter::
931 VisitObjCIndirectCopyRestoreExpr(ObjCIndirectCopyRestoreExpr *E) {
932  VisitExpr(E);
933  Record.AddStmt(E->getSubExpr());
934  Record.push_back(E->shouldCopy());
936 }
937 
938 void ASTStmtWriter::VisitObjCBridgedCastExpr(ObjCBridgedCastExpr *E) {
939  VisitExplicitCastExpr(E);
940  Record.AddSourceLocation(E->getLParenLoc());
942  Record.push_back(E->getBridgeKind()); // FIXME: Stable encoding
944 }
945 
946 void ASTStmtWriter::VisitCastExpr(CastExpr *E) {
947  VisitExpr(E);
948  Record.push_back(E->path_size());
949  Record.push_back(E->hasStoredFPFeatures());
950  Record.AddStmt(E->getSubExpr());
951  Record.push_back(E->getCastKind()); // FIXME: stable encoding
952 
954  PI = E->path_begin(), PE = E->path_end(); PI != PE; ++PI)
955  Record.AddCXXBaseSpecifier(**PI);
956 
957  if (E->hasStoredFPFeatures())
958  Record.push_back(E->getFPFeatures().getAsOpaqueInt());
959 }
960 
961 void ASTStmtWriter::VisitBinaryOperator(BinaryOperator *E) {
962  VisitExpr(E);
963  bool HasFPFeatures = E->hasStoredFPFeatures();
964  // Write this first for easy access when deserializing, as they affect the
965  // size of the UnaryOperator.
966  Record.push_back(HasFPFeatures);
967  Record.push_back(E->getOpcode()); // FIXME: stable encoding
968  Record.AddStmt(E->getLHS());
969  Record.AddStmt(E->getRHS());
970  Record.AddSourceLocation(E->getOperatorLoc());
971  if (HasFPFeatures)
974 }
975 
976 void ASTStmtWriter::VisitCompoundAssignOperator(CompoundAssignOperator *E) {
977  VisitBinaryOperator(E);
978  Record.AddTypeRef(E->getComputationLHSType());
981 }
982 
983 void ASTStmtWriter::VisitConditionalOperator(ConditionalOperator *E) {
984  VisitExpr(E);
985  Record.AddStmt(E->getCond());
986  Record.AddStmt(E->getLHS());
987  Record.AddStmt(E->getRHS());
988  Record.AddSourceLocation(E->getQuestionLoc());
989  Record.AddSourceLocation(E->getColonLoc());
991 }
992 
993 void
994 ASTStmtWriter::VisitBinaryConditionalOperator(BinaryConditionalOperator *E) {
995  VisitExpr(E);
996  Record.AddStmt(E->getOpaqueValue());
997  Record.AddStmt(E->getCommon());
998  Record.AddStmt(E->getCond());
999  Record.AddStmt(E->getTrueExpr());
1000  Record.AddStmt(E->getFalseExpr());
1001  Record.AddSourceLocation(E->getQuestionLoc());
1002  Record.AddSourceLocation(E->getColonLoc());
1004 }
1005 
1006 void ASTStmtWriter::VisitImplicitCastExpr(ImplicitCastExpr *E) {
1007  VisitCastExpr(E);
1008  Record.push_back(E->isPartOfExplicitCast());
1009 
1010  if (E->path_size() == 0 && !E->hasStoredFPFeatures())
1011  AbbrevToUse = Writer.getExprImplicitCastAbbrev();
1012 
1014 }
1015 
1016 void ASTStmtWriter::VisitExplicitCastExpr(ExplicitCastExpr *E) {
1017  VisitCastExpr(E);
1019 }
1020 
1021 void ASTStmtWriter::VisitCStyleCastExpr(CStyleCastExpr *E) {
1022  VisitExplicitCastExpr(E);
1023  Record.AddSourceLocation(E->getLParenLoc());
1024  Record.AddSourceLocation(E->getRParenLoc());
1026 }
1027 
1028 void ASTStmtWriter::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
1029  VisitExpr(E);
1030  Record.AddSourceLocation(E->getLParenLoc());
1031  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1032  Record.AddStmt(E->getInitializer());
1033  Record.push_back(E->isFileScope());
1035 }
1036 
1037 void ASTStmtWriter::VisitExtVectorElementExpr(ExtVectorElementExpr *E) {
1038  VisitExpr(E);
1039  Record.AddStmt(E->getBase());
1040  Record.AddIdentifierRef(&E->getAccessor());
1041  Record.AddSourceLocation(E->getAccessorLoc());
1043 }
1044 
1045 void ASTStmtWriter::VisitInitListExpr(InitListExpr *E) {
1046  VisitExpr(E);
1047  // NOTE: only add the (possibly null) syntactic form.
1048  // No need to serialize the isSemanticForm flag and the semantic form.
1049  Record.AddStmt(E->getSyntacticForm());
1050  Record.AddSourceLocation(E->getLBraceLoc());
1051  Record.AddSourceLocation(E->getRBraceLoc());
1052  bool isArrayFiller = E->ArrayFillerOrUnionFieldInit.is<Expr*>();
1053  Record.push_back(isArrayFiller);
1054  if (isArrayFiller)
1055  Record.AddStmt(E->getArrayFiller());
1056  else
1058  Record.push_back(E->hadArrayRangeDesignator());
1059  Record.push_back(E->getNumInits());
1060  if (isArrayFiller) {
1061  // ArrayFiller may have filled "holes" due to designated initializer.
1062  // Replace them by 0 to indicate that the filler goes in that place.
1063  Expr *filler = E->getArrayFiller();
1064  for (unsigned I = 0, N = E->getNumInits(); I != N; ++I)
1065  Record.AddStmt(E->getInit(I) != filler ? E->getInit(I) : nullptr);
1066  } else {
1067  for (unsigned I = 0, N = E->getNumInits(); I != N; ++I)
1068  Record.AddStmt(E->getInit(I));
1069  }
1071 }
1072 
1073 void ASTStmtWriter::VisitDesignatedInitExpr(DesignatedInitExpr *E) {
1074  VisitExpr(E);
1075  Record.push_back(E->getNumSubExprs());
1076  for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
1077  Record.AddStmt(E->getSubExpr(I));
1079  Record.push_back(E->usesGNUSyntax());
1080  for (const DesignatedInitExpr::Designator &D : E->designators()) {
1081  if (D.isFieldDesignator()) {
1082  if (FieldDecl *Field = D.getField()) {
1084  Record.AddDeclRef(Field);
1085  } else {
1087  Record.AddIdentifierRef(D.getFieldName());
1088  }
1089  Record.AddSourceLocation(D.getDotLoc());
1090  Record.AddSourceLocation(D.getFieldLoc());
1091  } else if (D.isArrayDesignator()) {
1093  Record.push_back(D.getFirstExprIndex());
1094  Record.AddSourceLocation(D.getLBracketLoc());
1095  Record.AddSourceLocation(D.getRBracketLoc());
1096  } else {
1097  assert(D.isArrayRangeDesignator() && "Unknown designator");
1099  Record.push_back(D.getFirstExprIndex());
1100  Record.AddSourceLocation(D.getLBracketLoc());
1101  Record.AddSourceLocation(D.getEllipsisLoc());
1102  Record.AddSourceLocation(D.getRBracketLoc());
1103  }
1104  }
1106 }
1107 
1108 void ASTStmtWriter::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) {
1109  VisitExpr(E);
1110  Record.AddStmt(E->getBase());
1111  Record.AddStmt(E->getUpdater());
1113 }
1114 
1115 void ASTStmtWriter::VisitNoInitExpr(NoInitExpr *E) {
1116  VisitExpr(E);
1118 }
1119 
1120 void ASTStmtWriter::VisitArrayInitLoopExpr(ArrayInitLoopExpr *E) {
1121  VisitExpr(E);
1122  Record.AddStmt(E->SubExprs[0]);
1123  Record.AddStmt(E->SubExprs[1]);
1125 }
1126 
1127 void ASTStmtWriter::VisitArrayInitIndexExpr(ArrayInitIndexExpr *E) {
1128  VisitExpr(E);
1130 }
1131 
1132 void ASTStmtWriter::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) {
1133  VisitExpr(E);
1135 }
1136 
1137 void ASTStmtWriter::VisitVAArgExpr(VAArgExpr *E) {
1138  VisitExpr(E);
1139  Record.AddStmt(E->getSubExpr());
1141  Record.AddSourceLocation(E->getBuiltinLoc());
1142  Record.AddSourceLocation(E->getRParenLoc());
1143  Record.push_back(E->isMicrosoftABI());
1145 }
1146 
1147 void ASTStmtWriter::VisitSourceLocExpr(SourceLocExpr *E) {
1148  VisitExpr(E);
1149  Record.AddDeclRef(cast_or_null<Decl>(E->getParentContext()));
1150  Record.AddSourceLocation(E->getBeginLoc());
1151  Record.AddSourceLocation(E->getEndLoc());
1152  Record.push_back(E->getIdentKind());
1154 }
1155 
1156 void ASTStmtWriter::VisitAddrLabelExpr(AddrLabelExpr *E) {
1157  VisitExpr(E);
1158  Record.AddSourceLocation(E->getAmpAmpLoc());
1159  Record.AddSourceLocation(E->getLabelLoc());
1160  Record.AddDeclRef(E->getLabel());
1162 }
1163 
1164 void ASTStmtWriter::VisitStmtExpr(StmtExpr *E) {
1165  VisitExpr(E);
1166  Record.AddStmt(E->getSubStmt());
1167  Record.AddSourceLocation(E->getLParenLoc());
1168  Record.AddSourceLocation(E->getRParenLoc());
1169  Record.push_back(E->getTemplateDepth());
1170  Code = serialization::EXPR_STMT;
1171 }
1172 
1173 void ASTStmtWriter::VisitChooseExpr(ChooseExpr *E) {
1174  VisitExpr(E);
1175  Record.AddStmt(E->getCond());
1176  Record.AddStmt(E->getLHS());
1177  Record.AddStmt(E->getRHS());
1178  Record.AddSourceLocation(E->getBuiltinLoc());
1179  Record.AddSourceLocation(E->getRParenLoc());
1180  Record.push_back(E->isConditionDependent() ? false : E->isConditionTrue());
1182 }
1183 
1184 void ASTStmtWriter::VisitGNUNullExpr(GNUNullExpr *E) {
1185  VisitExpr(E);
1186  Record.AddSourceLocation(E->getTokenLocation());
1188 }
1189 
1190 void ASTStmtWriter::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
1191  VisitExpr(E);
1192  Record.push_back(E->getNumSubExprs());
1193  for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
1194  Record.AddStmt(E->getExpr(I));
1195  Record.AddSourceLocation(E->getBuiltinLoc());
1196  Record.AddSourceLocation(E->getRParenLoc());
1198 }
1199 
1200 void ASTStmtWriter::VisitConvertVectorExpr(ConvertVectorExpr *E) {
1201  VisitExpr(E);
1202  Record.AddSourceLocation(E->getBuiltinLoc());
1203  Record.AddSourceLocation(E->getRParenLoc());
1204  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1205  Record.AddStmt(E->getSrcExpr());
1207 }
1208 
1209 void ASTStmtWriter::VisitBlockExpr(BlockExpr *E) {
1210  VisitExpr(E);
1211  Record.AddDeclRef(E->getBlockDecl());
1213 }
1214 
1215 void ASTStmtWriter::VisitGenericSelectionExpr(GenericSelectionExpr *E) {
1216  VisitExpr(E);
1217 
1218  Record.push_back(E->getNumAssocs());
1219  Record.push_back(E->ResultIndex);
1220  Record.AddSourceLocation(E->getGenericLoc());
1221  Record.AddSourceLocation(E->getDefaultLoc());
1222  Record.AddSourceLocation(E->getRParenLoc());
1223 
1224  Stmt **Stmts = E->getTrailingObjects<Stmt *>();
1225  // Add 1 to account for the controlling expression which is the first
1226  // expression in the trailing array of Stmt *. This is not needed for
1227  // the trailing array of TypeSourceInfo *.
1228  for (unsigned I = 0, N = E->getNumAssocs() + 1; I < N; ++I)
1229  Record.AddStmt(Stmts[I]);
1230 
1231  TypeSourceInfo **TSIs = E->getTrailingObjects<TypeSourceInfo *>();
1232  for (unsigned I = 0, N = E->getNumAssocs(); I < N; ++I)
1233  Record.AddTypeSourceInfo(TSIs[I]);
1234 
1236 }
1237 
1238 void ASTStmtWriter::VisitPseudoObjectExpr(PseudoObjectExpr *E) {
1239  VisitExpr(E);
1240  Record.push_back(E->getNumSemanticExprs());
1241 
1242  // Push the result index. Currently, this needs to exactly match
1243  // the encoding used internally for ResultIndex.
1244  unsigned result = E->getResultExprIndex();
1245  result = (result == PseudoObjectExpr::NoResult ? 0 : result + 1);
1246  Record.push_back(result);
1247 
1248  Record.AddStmt(E->getSyntacticForm());
1250  i = E->semantics_begin(), e = E->semantics_end(); i != e; ++i) {
1251  Record.AddStmt(*i);
1252  }
1254 }
1255 
1256 void ASTStmtWriter::VisitAtomicExpr(AtomicExpr *E) {
1257  VisitExpr(E);
1258  Record.push_back(E->getOp());
1259  for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
1260  Record.AddStmt(E->getSubExprs()[I]);
1261  Record.AddSourceLocation(E->getBuiltinLoc());
1262  Record.AddSourceLocation(E->getRParenLoc());
1264 }
1265 
1266 //===----------------------------------------------------------------------===//
1267 // Objective-C Expressions and Statements.
1268 //===----------------------------------------------------------------------===//
1269 
1270 void ASTStmtWriter::VisitObjCStringLiteral(ObjCStringLiteral *E) {
1271  VisitExpr(E);
1272  Record.AddStmt(E->getString());
1273  Record.AddSourceLocation(E->getAtLoc());
1275 }
1276 
1277 void ASTStmtWriter::VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
1278  VisitExpr(E);
1279  Record.AddStmt(E->getSubExpr());
1280  Record.AddDeclRef(E->getBoxingMethod());
1281  Record.AddSourceRange(E->getSourceRange());
1283 }
1284 
1285 void ASTStmtWriter::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
1286  VisitExpr(E);
1287  Record.push_back(E->getNumElements());
1288  for (unsigned i = 0; i < E->getNumElements(); i++)
1289  Record.AddStmt(E->getElement(i));
1291  Record.AddSourceRange(E->getSourceRange());
1293 }
1294 
1295 void ASTStmtWriter::VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *E) {
1296  VisitExpr(E);
1297  Record.push_back(E->getNumElements());
1298  Record.push_back(E->HasPackExpansions);
1299  for (unsigned i = 0; i < E->getNumElements(); i++) {
1300  ObjCDictionaryElement Element = E->getKeyValueElement(i);
1301  Record.AddStmt(Element.Key);
1302  Record.AddStmt(Element.Value);
1303  if (E->HasPackExpansions) {
1304  Record.AddSourceLocation(Element.EllipsisLoc);
1305  unsigned NumExpansions = 0;
1306  if (Element.NumExpansions)
1307  NumExpansions = *Element.NumExpansions + 1;
1308  Record.push_back(NumExpansions);
1309  }
1310  }
1311 
1312  Record.AddDeclRef(E->getDictWithObjectsMethod());
1313  Record.AddSourceRange(E->getSourceRange());
1315 }
1316 
1317 void ASTStmtWriter::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
1318  VisitExpr(E);
1320  Record.AddSourceLocation(E->getAtLoc());
1321  Record.AddSourceLocation(E->getRParenLoc());
1323 }
1324 
1325 void ASTStmtWriter::VisitObjCSelectorExpr(ObjCSelectorExpr *E) {
1326  VisitExpr(E);
1327  Record.AddSelectorRef(E->getSelector());
1328  Record.AddSourceLocation(E->getAtLoc());
1329  Record.AddSourceLocation(E->getRParenLoc());
1331 }
1332 
1333 void ASTStmtWriter::VisitObjCProtocolExpr(ObjCProtocolExpr *E) {
1334  VisitExpr(E);
1335  Record.AddDeclRef(E->getProtocol());
1336  Record.AddSourceLocation(E->getAtLoc());
1337  Record.AddSourceLocation(E->ProtoLoc);
1338  Record.AddSourceLocation(E->getRParenLoc());
1340 }
1341 
1342 void ASTStmtWriter::VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) {
1343  VisitExpr(E);
1344  Record.AddDeclRef(E->getDecl());
1345  Record.AddSourceLocation(E->getLocation());
1346  Record.AddSourceLocation(E->getOpLoc());
1347  Record.AddStmt(E->getBase());
1348  Record.push_back(E->isArrow());
1349  Record.push_back(E->isFreeIvar());
1351 }
1352 
1353 void ASTStmtWriter::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
1354  VisitExpr(E);
1355  Record.push_back(E->SetterAndMethodRefFlags.getInt());
1356  Record.push_back(E->isImplicitProperty());
1357  if (E->isImplicitProperty()) {
1360  } else {
1361  Record.AddDeclRef(E->getExplicitProperty());
1362  }
1363  Record.AddSourceLocation(E->getLocation());
1365  if (E->isObjectReceiver()) {
1366  Record.push_back(0);
1367  Record.AddStmt(E->getBase());
1368  } else if (E->isSuperReceiver()) {
1369  Record.push_back(1);
1370  Record.AddTypeRef(E->getSuperReceiverType());
1371  } else {
1372  Record.push_back(2);
1373  Record.AddDeclRef(E->getClassReceiver());
1374  }
1375 
1377 }
1378 
1379 void ASTStmtWriter::VisitObjCSubscriptRefExpr(ObjCSubscriptRefExpr *E) {
1380  VisitExpr(E);
1381  Record.AddSourceLocation(E->getRBracket());
1382  Record.AddStmt(E->getBaseExpr());
1383  Record.AddStmt(E->getKeyExpr());
1384  Record.AddDeclRef(E->getAtIndexMethodDecl());
1385  Record.AddDeclRef(E->setAtIndexMethodDecl());
1386 
1388 }
1389 
1390 void ASTStmtWriter::VisitObjCMessageExpr(ObjCMessageExpr *E) {
1391  VisitExpr(E);
1392  Record.push_back(E->getNumArgs());
1393  Record.push_back(E->getNumStoredSelLocs());
1394  Record.push_back(E->SelLocsKind);
1395  Record.push_back(E->isDelegateInitCall());
1396  Record.push_back(E->IsImplicit);
1397  Record.push_back((unsigned)E->getReceiverKind()); // FIXME: stable encoding
1398  switch (E->getReceiverKind()) {
1400  Record.AddStmt(E->getInstanceReceiver());
1401  break;
1402 
1405  break;
1406 
1409  Record.AddTypeRef(E->getSuperType());
1410  Record.AddSourceLocation(E->getSuperLoc());
1411  break;
1412  }
1413 
1414  if (E->getMethodDecl()) {
1415  Record.push_back(1);
1416  Record.AddDeclRef(E->getMethodDecl());
1417  } else {
1418  Record.push_back(0);
1419  Record.AddSelectorRef(E->getSelector());
1420  }
1421 
1422  Record.AddSourceLocation(E->getLeftLoc());
1423  Record.AddSourceLocation(E->getRightLoc());
1424 
1425  for (CallExpr::arg_iterator Arg = E->arg_begin(), ArgEnd = E->arg_end();
1426  Arg != ArgEnd; ++Arg)
1427  Record.AddStmt(*Arg);
1428 
1429  SourceLocation *Locs = E->getStoredSelLocs();
1430  for (unsigned i = 0, e = E->getNumStoredSelLocs(); i != e; ++i)
1431  Record.AddSourceLocation(Locs[i]);
1432 
1434 }
1435 
1436 void ASTStmtWriter::VisitObjCForCollectionStmt(ObjCForCollectionStmt *S) {
1437  VisitStmt(S);
1438  Record.AddStmt(S->getElement());
1439  Record.AddStmt(S->getCollection());
1440  Record.AddStmt(S->getBody());
1441  Record.AddSourceLocation(S->getForLoc());
1442  Record.AddSourceLocation(S->getRParenLoc());
1444 }
1445 
1446 void ASTStmtWriter::VisitObjCAtCatchStmt(ObjCAtCatchStmt *S) {
1447  VisitStmt(S);
1448  Record.AddStmt(S->getCatchBody());
1449  Record.AddDeclRef(S->getCatchParamDecl());
1450  Record.AddSourceLocation(S->getAtCatchLoc());
1451  Record.AddSourceLocation(S->getRParenLoc());
1453 }
1454 
1455 void ASTStmtWriter::VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S) {
1456  VisitStmt(S);
1457  Record.AddStmt(S->getFinallyBody());
1458  Record.AddSourceLocation(S->getAtFinallyLoc());
1460 }
1461 
1462 void ASTStmtWriter::VisitObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S) {
1463  VisitStmt(S); // FIXME: no test coverage.
1464  Record.AddStmt(S->getSubStmt());
1465  Record.AddSourceLocation(S->getAtLoc());
1467 }
1468 
1469 void ASTStmtWriter::VisitObjCAtTryStmt(ObjCAtTryStmt *S) {
1470  VisitStmt(S);
1471  Record.push_back(S->getNumCatchStmts());
1472  Record.push_back(S->getFinallyStmt() != nullptr);
1473  Record.AddStmt(S->getTryBody());
1474  for (unsigned I = 0, N = S->getNumCatchStmts(); I != N; ++I)
1475  Record.AddStmt(S->getCatchStmt(I));
1476  if (S->getFinallyStmt())
1477  Record.AddStmt(S->getFinallyStmt());
1478  Record.AddSourceLocation(S->getAtTryLoc());
1480 }
1481 
1482 void ASTStmtWriter::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
1483  VisitStmt(S); // FIXME: no test coverage.
1484  Record.AddStmt(S->getSynchExpr());
1485  Record.AddStmt(S->getSynchBody());
1488 }
1489 
1490 void ASTStmtWriter::VisitObjCAtThrowStmt(ObjCAtThrowStmt *S) {
1491  VisitStmt(S); // FIXME: no test coverage.
1492  Record.AddStmt(S->getThrowExpr());
1493  Record.AddSourceLocation(S->getThrowLoc());
1495 }
1496 
1497 void ASTStmtWriter::VisitObjCBoolLiteralExpr(ObjCBoolLiteralExpr *E) {
1498  VisitExpr(E);
1499  Record.push_back(E->getValue());
1500  Record.AddSourceLocation(E->getLocation());
1502 }
1503 
1504 void ASTStmtWriter::VisitObjCAvailabilityCheckExpr(ObjCAvailabilityCheckExpr *E) {
1505  VisitExpr(E);
1506  Record.AddSourceRange(E->getSourceRange());
1507  Record.AddVersionTuple(E->getVersion());
1509 }
1510 
1511 //===----------------------------------------------------------------------===//
1512 // C++ Expressions and Statements.
1513 //===----------------------------------------------------------------------===//
1514 
1515 void ASTStmtWriter::VisitCXXCatchStmt(CXXCatchStmt *S) {
1516  VisitStmt(S);
1517  Record.AddSourceLocation(S->getCatchLoc());
1518  Record.AddDeclRef(S->getExceptionDecl());
1519  Record.AddStmt(S->getHandlerBlock());
1521 }
1522 
1523 void ASTStmtWriter::VisitCXXTryStmt(CXXTryStmt *S) {
1524  VisitStmt(S);
1525  Record.push_back(S->getNumHandlers());
1526  Record.AddSourceLocation(S->getTryLoc());
1527  Record.AddStmt(S->getTryBlock());
1528  for (unsigned i = 0, e = S->getNumHandlers(); i != e; ++i)
1529  Record.AddStmt(S->getHandler(i));
1531 }
1532 
1533 void ASTStmtWriter::VisitCXXForRangeStmt(CXXForRangeStmt *S) {
1534  VisitStmt(S);
1535  Record.AddSourceLocation(S->getForLoc());
1536  Record.AddSourceLocation(S->getCoawaitLoc());
1537  Record.AddSourceLocation(S->getColonLoc());
1538  Record.AddSourceLocation(S->getRParenLoc());
1539  Record.AddStmt(S->getInit());
1540  Record.AddStmt(S->getRangeStmt());
1541  Record.AddStmt(S->getBeginStmt());
1542  Record.AddStmt(S->getEndStmt());
1543  Record.AddStmt(S->getCond());
1544  Record.AddStmt(S->getInc());
1545  Record.AddStmt(S->getLoopVarStmt());
1546  Record.AddStmt(S->getBody());
1548 }
1549 
1550 void ASTStmtWriter::VisitMSDependentExistsStmt(MSDependentExistsStmt *S) {
1551  VisitStmt(S);
1552  Record.AddSourceLocation(S->getKeywordLoc());
1553  Record.push_back(S->isIfExists());
1555  Record.AddDeclarationNameInfo(S->getNameInfo());
1556  Record.AddStmt(S->getSubStmt());
1558 }
1559 
1560 void ASTStmtWriter::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
1561  VisitCallExpr(E);
1562  Record.push_back(E->getOperator());
1563  Record.AddSourceRange(E->Range);
1565 }
1566 
1567 void ASTStmtWriter::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) {
1568  VisitCallExpr(E);
1570 }
1571 
1572 void ASTStmtWriter::VisitCXXRewrittenBinaryOperator(
1574  VisitExpr(E);
1575  Record.push_back(E->isReversed());
1576  Record.AddStmt(E->getSemanticForm());
1578 }
1579 
1580 void ASTStmtWriter::VisitCXXConstructExpr(CXXConstructExpr *E) {
1581  VisitExpr(E);
1582 
1583  Record.push_back(E->getNumArgs());
1584  Record.push_back(E->isElidable());
1585  Record.push_back(E->hadMultipleCandidates());
1586  Record.push_back(E->isListInitialization());
1589  Record.push_back(E->getConstructionKind()); // FIXME: stable encoding
1590  Record.AddSourceLocation(E->getLocation());
1591  Record.AddDeclRef(E->getConstructor());
1592  Record.AddSourceRange(E->getParenOrBraceRange());
1593 
1594  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1595  Record.AddStmt(E->getArg(I));
1596 
1598 }
1599 
1600 void ASTStmtWriter::VisitCXXInheritedCtorInitExpr(CXXInheritedCtorInitExpr *E) {
1601  VisitExpr(E);
1602  Record.AddDeclRef(E->getConstructor());
1603  Record.AddSourceLocation(E->getLocation());
1604  Record.push_back(E->constructsVBase());
1605  Record.push_back(E->inheritedFromVBase());
1607 }
1608 
1609 void ASTStmtWriter::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
1610  VisitCXXConstructExpr(E);
1611  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1613 }
1614 
1615 void ASTStmtWriter::VisitLambdaExpr(LambdaExpr *E) {
1616  VisitExpr(E);
1617  Record.push_back(E->LambdaExprBits.NumCaptures);
1618  Record.AddSourceRange(E->IntroducerRange);
1619  Record.push_back(E->LambdaExprBits.CaptureDefault); // FIXME: stable encoding
1620  Record.AddSourceLocation(E->CaptureDefaultLoc);
1621  Record.push_back(E->LambdaExprBits.ExplicitParams);
1622  Record.push_back(E->LambdaExprBits.ExplicitResultType);
1623  Record.AddSourceLocation(E->ClosingBrace);
1624 
1625  // Add capture initializers.
1627  CEnd = E->capture_init_end();
1628  C != CEnd; ++C) {
1629  Record.AddStmt(*C);
1630  }
1631 
1632  // Don't serialize the body. It belongs to the call operator declaration.
1633  // LambdaExpr only stores a copy of the Stmt *.
1634 
1636 }
1637 
1638 void ASTStmtWriter::VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E) {
1639  VisitExpr(E);
1640  Record.AddStmt(E->getSubExpr());
1642 }
1643 
1644 void ASTStmtWriter::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) {
1645  VisitExplicitCastExpr(E);
1647  Record.AddSourceRange(E->getAngleBrackets());
1648 }
1649 
1650 void ASTStmtWriter::VisitCXXStaticCastExpr(CXXStaticCastExpr *E) {
1651  VisitCXXNamedCastExpr(E);
1653 }
1654 
1655 void ASTStmtWriter::VisitCXXDynamicCastExpr(CXXDynamicCastExpr *E) {
1656  VisitCXXNamedCastExpr(E);
1658 }
1659 
1660 void ASTStmtWriter::VisitCXXReinterpretCastExpr(CXXReinterpretCastExpr *E) {
1661  VisitCXXNamedCastExpr(E);
1663 }
1664 
1665 void ASTStmtWriter::VisitCXXConstCastExpr(CXXConstCastExpr *E) {
1666  VisitCXXNamedCastExpr(E);
1668 }
1669 
1670 void ASTStmtWriter::VisitCXXAddrspaceCastExpr(CXXAddrspaceCastExpr *E) {
1671  VisitCXXNamedCastExpr(E);
1673 }
1674 
1675 void ASTStmtWriter::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E) {
1676  VisitExplicitCastExpr(E);
1677  Record.AddSourceLocation(E->getLParenLoc());
1678  Record.AddSourceLocation(E->getRParenLoc());
1680 }
1681 
1682 void ASTStmtWriter::VisitBuiltinBitCastExpr(BuiltinBitCastExpr *E) {
1683  VisitExplicitCastExpr(E);
1684  Record.AddSourceLocation(E->getBeginLoc());
1685  Record.AddSourceLocation(E->getEndLoc());
1687 }
1688 
1689 void ASTStmtWriter::VisitUserDefinedLiteral(UserDefinedLiteral *E) {
1690  VisitCallExpr(E);
1691  Record.AddSourceLocation(E->UDSuffixLoc);
1693 }
1694 
1695 void ASTStmtWriter::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) {
1696  VisitExpr(E);
1697  Record.push_back(E->getValue());
1698  Record.AddSourceLocation(E->getLocation());
1700 }
1701 
1702 void ASTStmtWriter::VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E) {
1703  VisitExpr(E);
1704  Record.AddSourceLocation(E->getLocation());
1706 }
1707 
1708 void ASTStmtWriter::VisitCXXTypeidExpr(CXXTypeidExpr *E) {
1709  VisitExpr(E);
1710  Record.AddSourceRange(E->getSourceRange());
1711  if (E->isTypeOperand()) {
1714  } else {
1715  Record.AddStmt(E->getExprOperand());
1717  }
1718 }
1719 
1720 void ASTStmtWriter::VisitCXXThisExpr(CXXThisExpr *E) {
1721  VisitExpr(E);
1722  Record.AddSourceLocation(E->getLocation());
1723  Record.push_back(E->isImplicit());
1725 }
1726 
1727 void ASTStmtWriter::VisitCXXThrowExpr(CXXThrowExpr *E) {
1728  VisitExpr(E);
1729  Record.AddSourceLocation(E->getThrowLoc());
1730  Record.AddStmt(E->getSubExpr());
1731  Record.push_back(E->isThrownVariableInScope());
1733 }
1734 
1735 void ASTStmtWriter::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
1736  VisitExpr(E);
1737  Record.AddDeclRef(E->getParam());
1738  Record.AddDeclRef(cast_or_null<Decl>(E->getUsedContext()));
1739  Record.AddSourceLocation(E->getUsedLocation());
1741 }
1742 
1743 void ASTStmtWriter::VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E) {
1744  VisitExpr(E);
1745  Record.AddDeclRef(E->getField());
1746  Record.AddDeclRef(cast_or_null<Decl>(E->getUsedContext()));
1747  Record.AddSourceLocation(E->getExprLoc());
1749 }
1750 
1751 void ASTStmtWriter::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
1752  VisitExpr(E);
1753  Record.AddCXXTemporary(E->getTemporary());
1754  Record.AddStmt(E->getSubExpr());
1756 }
1757 
1758 void ASTStmtWriter::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
1759  VisitExpr(E);
1760  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1761  Record.AddSourceLocation(E->getRParenLoc());
1763 }
1764 
1765 void ASTStmtWriter::VisitCXXNewExpr(CXXNewExpr *E) {
1766  VisitExpr(E);
1767 
1768  Record.push_back(E->isArray());
1769  Record.push_back(E->hasInitializer());
1770  Record.push_back(E->getNumPlacementArgs());
1771  Record.push_back(E->isParenTypeId());
1772 
1773  Record.push_back(E->isGlobalNew());
1774  Record.push_back(E->passAlignment());
1776  Record.push_back(E->CXXNewExprBits.StoredInitializationStyle);
1777 
1778  Record.AddDeclRef(E->getOperatorNew());
1779  Record.AddDeclRef(E->getOperatorDelete());
1781  if (E->isParenTypeId())
1782  Record.AddSourceRange(E->getTypeIdParens());
1783  Record.AddSourceRange(E->getSourceRange());
1784  Record.AddSourceRange(E->getDirectInitRange());
1785 
1786  for (CXXNewExpr::arg_iterator I = E->raw_arg_begin(), N = E->raw_arg_end();
1787  I != N; ++I)
1788  Record.AddStmt(*I);
1789 
1791 }
1792 
1793 void ASTStmtWriter::VisitCXXDeleteExpr(CXXDeleteExpr *E) {
1794  VisitExpr(E);
1795  Record.push_back(E->isGlobalDelete());
1796  Record.push_back(E->isArrayForm());
1797  Record.push_back(E->isArrayFormAsWritten());
1799  Record.AddDeclRef(E->getOperatorDelete());
1800  Record.AddStmt(E->getArgument());
1801  Record.AddSourceLocation(E->getBeginLoc());
1802 
1804 }
1805 
1806 void ASTStmtWriter::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
1807  VisitExpr(E);
1808 
1809  Record.AddStmt(E->getBase());
1810  Record.push_back(E->isArrow());
1811  Record.AddSourceLocation(E->getOperatorLoc());
1813  Record.AddTypeSourceInfo(E->getScopeTypeInfo());
1814  Record.AddSourceLocation(E->getColonColonLoc());
1815  Record.AddSourceLocation(E->getTildeLoc());
1816 
1817  // PseudoDestructorTypeStorage.
1819  if (E->getDestroyedTypeIdentifier())
1821  else
1823 
1825 }
1826 
1827 void ASTStmtWriter::VisitExprWithCleanups(ExprWithCleanups *E) {
1828  VisitExpr(E);
1829  Record.push_back(E->getNumObjects());
1830  for (auto &Obj : E->getObjects()) {
1831  if (auto *BD = Obj.dyn_cast<BlockDecl *>()) {
1833  Record.AddDeclRef(BD);
1834  } else if (auto *CLE = Obj.dyn_cast<CompoundLiteralExpr *>()) {
1836  Record.AddStmt(CLE);
1837  }
1838  }
1839 
1840  Record.push_back(E->cleanupsHaveSideEffects());
1841  Record.AddStmt(E->getSubExpr());
1843 }
1844 
1845 void ASTStmtWriter::VisitCXXDependentScopeMemberExpr(
1847  VisitExpr(E);
1848 
1849  // Don't emit anything here (or if you do you will have to update
1850  // the corresponding deserialization function).
1851 
1852  Record.push_back(E->hasTemplateKWAndArgsInfo());
1853  Record.push_back(E->getNumTemplateArgs());
1854  Record.push_back(E->hasFirstQualifierFoundInScope());
1855 
1856  if (E->hasTemplateKWAndArgsInfo()) {
1857  const ASTTemplateKWAndArgsInfo &ArgInfo =
1858  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
1859  AddTemplateKWAndArgsInfo(ArgInfo,
1860  E->getTrailingObjects<TemplateArgumentLoc>());
1861  }
1862 
1863  Record.push_back(E->isArrow());
1864  Record.AddSourceLocation(E->getOperatorLoc());
1865  Record.AddTypeRef(E->getBaseType());
1867  if (!E->isImplicitAccess())
1868  Record.AddStmt(E->getBase());
1869  else
1870  Record.AddStmt(nullptr);
1871 
1872  if (E->hasFirstQualifierFoundInScope())
1874 
1875  Record.AddDeclarationNameInfo(E->MemberNameInfo);
1877 }
1878 
1879 void
1880 ASTStmtWriter::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) {
1881  VisitExpr(E);
1882 
1883  // Don't emit anything here, HasTemplateKWAndArgsInfo must be
1884  // emitted first.
1885 
1886  Record.push_back(E->DependentScopeDeclRefExprBits.HasTemplateKWAndArgsInfo);
1887  if (E->DependentScopeDeclRefExprBits.HasTemplateKWAndArgsInfo) {
1888  const ASTTemplateKWAndArgsInfo &ArgInfo =
1889  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
1890  Record.push_back(ArgInfo.NumTemplateArgs);
1891  AddTemplateKWAndArgsInfo(ArgInfo,
1892  E->getTrailingObjects<TemplateArgumentLoc>());
1893  }
1894 
1896  Record.AddDeclarationNameInfo(E->NameInfo);
1898 }
1899 
1900 void
1901 ASTStmtWriter::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E) {
1902  VisitExpr(E);
1903  Record.push_back(E->getNumArgs());
1905  ArgI = E->arg_begin(), ArgE = E->arg_end(); ArgI != ArgE; ++ArgI)
1906  Record.AddStmt(*ArgI);
1907  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1908  Record.AddSourceLocation(E->getLParenLoc());
1909  Record.AddSourceLocation(E->getRParenLoc());
1911 }
1912 
1913 void ASTStmtWriter::VisitOverloadExpr(OverloadExpr *E) {
1914  VisitExpr(E);
1915 
1916  Record.push_back(E->getNumDecls());
1917  Record.push_back(E->hasTemplateKWAndArgsInfo());
1918  if (E->hasTemplateKWAndArgsInfo()) {
1919  const ASTTemplateKWAndArgsInfo &ArgInfo =
1921  Record.push_back(ArgInfo.NumTemplateArgs);
1923  }
1924 
1925  for (OverloadExpr::decls_iterator OvI = E->decls_begin(),
1926  OvE = E->decls_end();
1927  OvI != OvE; ++OvI) {
1928  Record.AddDeclRef(OvI.getDecl());
1929  Record.push_back(OvI.getAccess());
1930  }
1931 
1932  Record.AddDeclarationNameInfo(E->getNameInfo());
1934 }
1935 
1936 void ASTStmtWriter::VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
1937  VisitOverloadExpr(E);
1938  Record.push_back(E->isArrow());
1939  Record.push_back(E->hasUnresolvedUsing());
1940  Record.AddStmt(!E->isImplicitAccess() ? E->getBase() : nullptr);
1941  Record.AddTypeRef(E->getBaseType());
1942  Record.AddSourceLocation(E->getOperatorLoc());
1944 }
1945 
1946 void ASTStmtWriter::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) {
1947  VisitOverloadExpr(E);
1948  Record.push_back(E->requiresADL());
1949  Record.push_back(E->isOverloaded());
1950  Record.AddDeclRef(E->getNamingClass());
1952 }
1953 
1954 void ASTStmtWriter::VisitTypeTraitExpr(TypeTraitExpr *E) {
1955  VisitExpr(E);
1956  Record.push_back(E->TypeTraitExprBits.NumArgs);
1957  Record.push_back(E->TypeTraitExprBits.Kind); // FIXME: Stable encoding
1958  Record.push_back(E->TypeTraitExprBits.Value);
1959  Record.AddSourceRange(E->getSourceRange());
1960  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1961  Record.AddTypeSourceInfo(E->getArg(I));
1963 }
1964 
1965 void ASTStmtWriter::VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E) {
1966  VisitExpr(E);
1967  Record.push_back(E->getTrait());
1968  Record.push_back(E->getValue());
1969  Record.AddSourceRange(E->getSourceRange());
1971  Record.AddStmt(E->getDimensionExpression());
1973 }
1974 
1975 void ASTStmtWriter::VisitExpressionTraitExpr(ExpressionTraitExpr *E) {
1976  VisitExpr(E);
1977  Record.push_back(E->getTrait());
1978  Record.push_back(E->getValue());
1979  Record.AddSourceRange(E->getSourceRange());
1980  Record.AddStmt(E->getQueriedExpression());
1982 }
1983 
1984 void ASTStmtWriter::VisitCXXNoexceptExpr(CXXNoexceptExpr *E) {
1985  VisitExpr(E);
1986  Record.push_back(E->getValue());
1987  Record.AddSourceRange(E->getSourceRange());
1988  Record.AddStmt(E->getOperand());
1990 }
1991 
1992 void ASTStmtWriter::VisitPackExpansionExpr(PackExpansionExpr *E) {
1993  VisitExpr(E);
1994  Record.AddSourceLocation(E->getEllipsisLoc());
1995  Record.push_back(E->NumExpansions);
1996  Record.AddStmt(E->getPattern());
1998 }
1999 
2000 void ASTStmtWriter::VisitSizeOfPackExpr(SizeOfPackExpr *E) {
2001  VisitExpr(E);
2002  Record.push_back(E->isPartiallySubstituted() ? E->getPartialArguments().size()
2003  : 0);
2004  Record.AddSourceLocation(E->OperatorLoc);
2005  Record.AddSourceLocation(E->PackLoc);
2006  Record.AddSourceLocation(E->RParenLoc);
2007  Record.AddDeclRef(E->Pack);
2008  if (E->isPartiallySubstituted()) {
2009  for (const auto &TA : E->getPartialArguments())
2010  Record.AddTemplateArgument(TA);
2011  } else if (!E->isValueDependent()) {
2012  Record.push_back(E->getPackLength());
2013  }
2015 }
2016 
2017 void ASTStmtWriter::VisitSubstNonTypeTemplateParmExpr(
2019  VisitExpr(E);
2020  Record.AddDeclRef(E->getParameter());
2021  Record.push_back(E->isReferenceParameter());
2022  Record.AddSourceLocation(E->getNameLoc());
2023  Record.AddStmt(E->getReplacement());
2025 }
2026 
2027 void ASTStmtWriter::VisitSubstNonTypeTemplateParmPackExpr(
2029  VisitExpr(E);
2030  Record.AddDeclRef(E->getParameterPack());
2031  Record.AddTemplateArgument(E->getArgumentPack());
2034 }
2035 
2036 void ASTStmtWriter::VisitFunctionParmPackExpr(FunctionParmPackExpr *E) {
2037  VisitExpr(E);
2038  Record.push_back(E->getNumExpansions());
2039  Record.AddDeclRef(E->getParameterPack());
2041  for (FunctionParmPackExpr::iterator I = E->begin(), End = E->end();
2042  I != End; ++I)
2043  Record.AddDeclRef(*I);
2045 }
2046 
2047 void ASTStmtWriter::VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E) {
2048  VisitExpr(E);
2049  Record.push_back(static_cast<bool>(E->getLifetimeExtendedTemporaryDecl()));
2052  else
2053  Record.AddStmt(E->getSubExpr());
2055 }
2056 
2057 void ASTStmtWriter::VisitCXXFoldExpr(CXXFoldExpr *E) {
2058  VisitExpr(E);
2059  Record.AddSourceLocation(E->LParenLoc);
2060  Record.AddSourceLocation(E->EllipsisLoc);
2061  Record.AddSourceLocation(E->RParenLoc);
2062  Record.push_back(E->NumExpansions);
2063  Record.AddStmt(E->SubExprs[0]);
2064  Record.AddStmt(E->SubExprs[1]);
2065  Record.AddStmt(E->SubExprs[2]);
2066  Record.push_back(E->Opcode);
2068 }
2069 
2070 void ASTStmtWriter::VisitOpaqueValueExpr(OpaqueValueExpr *E) {
2071  VisitExpr(E);
2072  Record.AddStmt(E->getSourceExpr());
2073  Record.AddSourceLocation(E->getLocation());
2074  Record.push_back(E->isUnique());
2076 }
2077 
2078 void ASTStmtWriter::VisitTypoExpr(TypoExpr *E) {
2079  VisitExpr(E);
2080  // TODO: Figure out sane writer behavior for a TypoExpr, if necessary
2081  llvm_unreachable("Cannot write TypoExpr nodes");
2082 }
2083 
2084 //===----------------------------------------------------------------------===//
2085 // CUDA Expressions and Statements.
2086 //===----------------------------------------------------------------------===//
2087 
2088 void ASTStmtWriter::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E) {
2089  VisitCallExpr(E);
2090  Record.AddStmt(E->getConfig());
2092 }
2093 
2094 //===----------------------------------------------------------------------===//
2095 // OpenCL Expressions and Statements.
2096 //===----------------------------------------------------------------------===//
2097 void ASTStmtWriter::VisitAsTypeExpr(AsTypeExpr *E) {
2098  VisitExpr(E);
2099  Record.AddSourceLocation(E->getBuiltinLoc());
2100  Record.AddSourceLocation(E->getRParenLoc());
2101  Record.AddStmt(E->getSrcExpr());
2103 }
2104 
2105 //===----------------------------------------------------------------------===//
2106 // Microsoft Expressions and Statements.
2107 //===----------------------------------------------------------------------===//
2108 void ASTStmtWriter::VisitMSPropertyRefExpr(MSPropertyRefExpr *E) {
2109  VisitExpr(E);
2110  Record.push_back(E->isArrow());
2111  Record.AddStmt(E->getBaseExpr());
2113  Record.AddSourceLocation(E->getMemberLoc());
2114  Record.AddDeclRef(E->getPropertyDecl());
2116 }
2117 
2118 void ASTStmtWriter::VisitMSPropertySubscriptExpr(MSPropertySubscriptExpr *E) {
2119  VisitExpr(E);
2120  Record.AddStmt(E->getBase());
2121  Record.AddStmt(E->getIdx());
2122  Record.AddSourceLocation(E->getRBracketLoc());
2124 }
2125 
2126 void ASTStmtWriter::VisitCXXUuidofExpr(CXXUuidofExpr *E) {
2127  VisitExpr(E);
2128  Record.AddSourceRange(E->getSourceRange());
2129  Record.AddDeclRef(E->getGuidDecl());
2130  if (E->isTypeOperand()) {
2133  } else {
2134  Record.AddStmt(E->getExprOperand());
2136  }
2137 }
2138 
2139 void ASTStmtWriter::VisitSEHExceptStmt(SEHExceptStmt *S) {
2140  VisitStmt(S);
2141  Record.AddSourceLocation(S->getExceptLoc());
2142  Record.AddStmt(S->getFilterExpr());
2143  Record.AddStmt(S->getBlock());
2145 }
2146 
2147 void ASTStmtWriter::VisitSEHFinallyStmt(SEHFinallyStmt *S) {
2148  VisitStmt(S);
2149  Record.AddSourceLocation(S->getFinallyLoc());
2150  Record.AddStmt(S->getBlock());
2152 }
2153 
2154 void ASTStmtWriter::VisitSEHTryStmt(SEHTryStmt *S) {
2155  VisitStmt(S);
2156  Record.push_back(S->getIsCXXTry());
2157  Record.AddSourceLocation(S->getTryLoc());
2158  Record.AddStmt(S->getTryBlock());
2159  Record.AddStmt(S->getHandler());
2161 }
2162 
2163 void ASTStmtWriter::VisitSEHLeaveStmt(SEHLeaveStmt *S) {
2164  VisitStmt(S);
2165  Record.AddSourceLocation(S->getLeaveLoc());
2167 }
2168 
2169 //===----------------------------------------------------------------------===//
2170 // OpenMP Directives.
2171 //===----------------------------------------------------------------------===//
2172 
2173 void ASTStmtWriter::VisitOMPExecutableDirective(OMPExecutableDirective *E) {
2174  Record.writeOMPChildren(E->Data);
2175  Record.AddSourceLocation(E->getBeginLoc());
2176  Record.AddSourceLocation(E->getEndLoc());
2177 }
2178 
2179 void ASTStmtWriter::VisitOMPLoopDirective(OMPLoopDirective *D) {
2180  VisitStmt(D);
2181  Record.writeUInt32(D->getCollapsedNumber());
2182  VisitOMPExecutableDirective(D);
2183 }
2184 
2185 void ASTStmtWriter::VisitOMPParallelDirective(OMPParallelDirective *D) {
2186  VisitStmt(D);
2187  VisitOMPExecutableDirective(D);
2188  Record.writeBool(D->hasCancel());
2190 }
2191 
2192 void ASTStmtWriter::VisitOMPSimdDirective(OMPSimdDirective *D) {
2193  VisitOMPLoopDirective(D);
2195 }
2196 
2197 void ASTStmtWriter::VisitOMPForDirective(OMPForDirective *D) {
2198  VisitOMPLoopDirective(D);
2199  Record.writeBool(D->hasCancel());
2201 }
2202 
2203 void ASTStmtWriter::VisitOMPForSimdDirective(OMPForSimdDirective *D) {
2204  VisitOMPLoopDirective(D);
2206 }
2207 
2208 void ASTStmtWriter::VisitOMPSectionsDirective(OMPSectionsDirective *D) {
2209  VisitStmt(D);
2210  VisitOMPExecutableDirective(D);
2211  Record.writeBool(D->hasCancel());
2213 }
2214 
2215 void ASTStmtWriter::VisitOMPSectionDirective(OMPSectionDirective *D) {
2216  VisitStmt(D);
2217  VisitOMPExecutableDirective(D);
2218  Record.writeBool(D->hasCancel());
2220 }
2221 
2222 void ASTStmtWriter::VisitOMPSingleDirective(OMPSingleDirective *D) {
2223  VisitStmt(D);
2224  VisitOMPExecutableDirective(D);
2226 }
2227 
2228 void ASTStmtWriter::VisitOMPMasterDirective(OMPMasterDirective *D) {
2229  VisitStmt(D);
2230  VisitOMPExecutableDirective(D);
2232 }
2233 
2234 void ASTStmtWriter::VisitOMPCriticalDirective(OMPCriticalDirective *D) {
2235  VisitStmt(D);
2236  VisitOMPExecutableDirective(D);
2239 }
2240 
2241 void ASTStmtWriter::VisitOMPParallelForDirective(OMPParallelForDirective *D) {
2242  VisitOMPLoopDirective(D);
2243  Record.writeBool(D->hasCancel());
2245 }
2246 
2247 void ASTStmtWriter::VisitOMPParallelForSimdDirective(
2249  VisitOMPLoopDirective(D);
2251 }
2252 
2253 void ASTStmtWriter::VisitOMPParallelMasterDirective(
2255  VisitStmt(D);
2256  VisitOMPExecutableDirective(D);
2258 }
2259 
2260 void ASTStmtWriter::VisitOMPParallelSectionsDirective(
2262  VisitStmt(D);
2263  VisitOMPExecutableDirective(D);
2264  Record.writeBool(D->hasCancel());
2266 }
2267 
2268 void ASTStmtWriter::VisitOMPTaskDirective(OMPTaskDirective *D) {
2269  VisitStmt(D);
2270  VisitOMPExecutableDirective(D);
2271  Record.writeBool(D->hasCancel());
2273 }
2274 
2275 void ASTStmtWriter::VisitOMPAtomicDirective(OMPAtomicDirective *D) {
2276  VisitStmt(D);
2277  VisitOMPExecutableDirective(D);
2278  Record.writeBool(D->isXLHSInRHSPart());
2279  Record.writeBool(D->isPostfixUpdate());
2281 }
2282 
2283 void ASTStmtWriter::VisitOMPTargetDirective(OMPTargetDirective *D) {
2284  VisitStmt(D);
2285  VisitOMPExecutableDirective(D);
2287 }
2288 
2289 void ASTStmtWriter::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) {
2290  VisitStmt(D);
2291  VisitOMPExecutableDirective(D);
2293 }
2294 
2295 void ASTStmtWriter::VisitOMPTargetEnterDataDirective(
2297  VisitStmt(D);
2298  VisitOMPExecutableDirective(D);
2300 }
2301 
2302 void ASTStmtWriter::VisitOMPTargetExitDataDirective(
2304  VisitStmt(D);
2305  VisitOMPExecutableDirective(D);
2307 }
2308 
2309 void ASTStmtWriter::VisitOMPTargetParallelDirective(
2311  VisitStmt(D);
2312  VisitOMPExecutableDirective(D);
2313  Record.writeBool(D->hasCancel());
2315 }
2316 
2317 void ASTStmtWriter::VisitOMPTargetParallelForDirective(
2319  VisitOMPLoopDirective(D);
2320  Record.writeBool(D->hasCancel());
2322 }
2323 
2324 void ASTStmtWriter::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) {
2325  VisitStmt(D);
2326  VisitOMPExecutableDirective(D);
2328 }
2329 
2330 void ASTStmtWriter::VisitOMPBarrierDirective(OMPBarrierDirective *D) {
2331  VisitStmt(D);
2332  VisitOMPExecutableDirective(D);
2334 }
2335 
2336 void ASTStmtWriter::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) {
2337  VisitStmt(D);
2338  VisitOMPExecutableDirective(D);
2340 }
2341 
2342 void ASTStmtWriter::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) {
2343  VisitStmt(D);
2344  VisitOMPExecutableDirective(D);
2346 }
2347 
2348 void ASTStmtWriter::VisitOMPFlushDirective(OMPFlushDirective *D) {
2349  VisitStmt(D);
2350  VisitOMPExecutableDirective(D);
2352 }
2353 
2354 void ASTStmtWriter::VisitOMPDepobjDirective(OMPDepobjDirective *D) {
2355  VisitStmt(D);
2356  VisitOMPExecutableDirective(D);
2358 }
2359 
2360 void ASTStmtWriter::VisitOMPScanDirective(OMPScanDirective *D) {
2361  VisitStmt(D);
2362  VisitOMPExecutableDirective(D);
2364 }
2365 
2366 void ASTStmtWriter::VisitOMPOrderedDirective(OMPOrderedDirective *D) {
2367  VisitStmt(D);
2368  VisitOMPExecutableDirective(D);
2370 }
2371 
2372 void ASTStmtWriter::VisitOMPTeamsDirective(OMPTeamsDirective *D) {
2373  VisitStmt(D);
2374  VisitOMPExecutableDirective(D);
2376 }
2377 
2378 void ASTStmtWriter::VisitOMPCancellationPointDirective(
2380  VisitStmt(D);
2381  VisitOMPExecutableDirective(D);
2382  Record.writeEnum(D->getCancelRegion());
2384 }
2385 
2386 void ASTStmtWriter::VisitOMPCancelDirective(OMPCancelDirective *D) {
2387  VisitStmt(D);
2388  VisitOMPExecutableDirective(D);
2389  Record.writeEnum(D->getCancelRegion());
2391 }
2392 
2393 void ASTStmtWriter::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) {
2394  VisitOMPLoopDirective(D);
2395  Record.writeBool(D->hasCancel());
2397 }
2398 
2399 void ASTStmtWriter::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) {
2400  VisitOMPLoopDirective(D);
2402 }
2403 
2404 void ASTStmtWriter::VisitOMPMasterTaskLoopDirective(
2406  VisitOMPLoopDirective(D);
2407  Record.writeBool(D->hasCancel());
2409 }
2410 
2411 void ASTStmtWriter::VisitOMPMasterTaskLoopSimdDirective(
2413  VisitOMPLoopDirective(D);
2415 }
2416 
2417 void ASTStmtWriter::VisitOMPParallelMasterTaskLoopDirective(
2419  VisitOMPLoopDirective(D);
2420  Record.writeBool(D->hasCancel());
2422 }
2423 
2424 void ASTStmtWriter::VisitOMPParallelMasterTaskLoopSimdDirective(
2426  VisitOMPLoopDirective(D);
2428 }
2429 
2430 void ASTStmtWriter::VisitOMPDistributeDirective(OMPDistributeDirective *D) {
2431  VisitOMPLoopDirective(D);
2433 }
2434 
2435 void ASTStmtWriter::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) {
2436  VisitStmt(D);
2437  VisitOMPExecutableDirective(D);
2439 }
2440 
2441 void ASTStmtWriter::VisitOMPDistributeParallelForDirective(
2443  VisitOMPLoopDirective(D);
2444  Record.writeBool(D->hasCancel());
2446 }
2447 
2448 void ASTStmtWriter::VisitOMPDistributeParallelForSimdDirective(
2450  VisitOMPLoopDirective(D);
2452 }
2453 
2454 void ASTStmtWriter::VisitOMPDistributeSimdDirective(
2456  VisitOMPLoopDirective(D);
2458 }
2459 
2460 void ASTStmtWriter::VisitOMPTargetParallelForSimdDirective(
2462  VisitOMPLoopDirective(D);
2464 }
2465 
2466 void ASTStmtWriter::VisitOMPTargetSimdDirective(OMPTargetSimdDirective *D) {
2467  VisitOMPLoopDirective(D);
2469 }
2470 
2471 void ASTStmtWriter::VisitOMPTeamsDistributeDirective(
2473  VisitOMPLoopDirective(D);
2475 }
2476 
2477 void ASTStmtWriter::VisitOMPTeamsDistributeSimdDirective(
2479  VisitOMPLoopDirective(D);
2481 }
2482 
2483 void ASTStmtWriter::VisitOMPTeamsDistributeParallelForSimdDirective(
2485  VisitOMPLoopDirective(D);
2487 }
2488 
2489 void ASTStmtWriter::VisitOMPTeamsDistributeParallelForDirective(
2491  VisitOMPLoopDirective(D);
2492  Record.writeBool(D->hasCancel());
2494 }
2495 
2496 void ASTStmtWriter::VisitOMPTargetTeamsDirective(OMPTargetTeamsDirective *D) {
2497  VisitStmt(D);
2498  VisitOMPExecutableDirective(D);
2500 }
2501 
2502 void ASTStmtWriter::VisitOMPTargetTeamsDistributeDirective(
2504  VisitOMPLoopDirective(D);
2506 }
2507 
2508 void ASTStmtWriter::VisitOMPTargetTeamsDistributeParallelForDirective(
2510  VisitOMPLoopDirective(D);
2511  Record.writeBool(D->hasCancel());
2513 }
2514 
2515 void ASTStmtWriter::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
2517  VisitOMPLoopDirective(D);
2518  Code = serialization::
2520 }
2521 
2522 void ASTStmtWriter::VisitOMPTargetTeamsDistributeSimdDirective(
2524  VisitOMPLoopDirective(D);
2526 }
2527 
2528 //===----------------------------------------------------------------------===//
2529 // ASTWriter Implementation
2530 //===----------------------------------------------------------------------===//
2531 
2533  assert(SwitchCaseIDs.find(S) == SwitchCaseIDs.end() &&
2534  "SwitchCase recorded twice");
2535  unsigned NextID = SwitchCaseIDs.size();
2536  SwitchCaseIDs[S] = NextID;
2537  return NextID;
2538 }
2539 
2541  assert(SwitchCaseIDs.find(S) != SwitchCaseIDs.end() &&
2542  "SwitchCase hasn't been seen yet");
2543  return SwitchCaseIDs[S];
2544 }
2545 
2547  SwitchCaseIDs.clear();
2548 }
2549 
2550 /// Write the given substatement or subexpression to the
2551 /// bitstream.
2552 void ASTWriter::WriteSubStmt(Stmt *S) {
2553  RecordData Record;
2554  ASTStmtWriter Writer(*this, Record);
2555  ++NumStatements;
2556 
2557  if (!S) {
2558  Stream.EmitRecord(serialization::STMT_NULL_PTR, Record);
2559  return;
2560  }
2561 
2562  llvm::DenseMap<Stmt *, uint64_t>::iterator I = SubStmtEntries.find(S);
2563  if (I != SubStmtEntries.end()) {
2564  Record.push_back(I->second);
2565  Stream.EmitRecord(serialization::STMT_REF_PTR, Record);
2566  return;
2567  }
2568 
2569 #ifndef NDEBUG
2570  assert(!ParentStmts.count(S) && "There is a Stmt cycle!");
2571 
2572  struct ParentStmtInserterRAII {
2573  Stmt *S;
2574  llvm::DenseSet<Stmt *> &ParentStmts;
2575 
2576  ParentStmtInserterRAII(Stmt *S, llvm::DenseSet<Stmt *> &ParentStmts)
2577  : S(S), ParentStmts(ParentStmts) {
2578  ParentStmts.insert(S);
2579  }
2580  ~ParentStmtInserterRAII() {
2581  ParentStmts.erase(S);
2582  }
2583  };
2584 
2585  ParentStmtInserterRAII ParentStmtInserter(S, ParentStmts);
2586 #endif
2587 
2588  Writer.Visit(S);
2589 
2590  uint64_t Offset = Writer.Emit();
2591  SubStmtEntries[S] = Offset;
2592 }
2593 
2594 /// Flush all of the statements that have been added to the
2595 /// queue via AddStmt().
2596 void ASTRecordWriter::FlushStmts() {
2597  // We expect to be the only consumer of the two temporary statement maps,
2598  // assert that they are empty.
2599  assert(Writer->SubStmtEntries.empty() && "unexpected entries in sub-stmt map");
2600  assert(Writer->ParentStmts.empty() && "unexpected entries in parent stmt map");
2601 
2602  for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) {
2603  Writer->WriteSubStmt(StmtsToEmit[I]);
2604 
2605  assert(N == StmtsToEmit.size() && "record modified while being written!");
2606 
2607  // Note that we are at the end of a full expression. Any
2608  // expression records that follow this one are part of a different
2609  // expression.
2610  Writer->Stream.EmitRecord(serialization::STMT_STOP, ArrayRef<uint32_t>());
2611 
2612  Writer->SubStmtEntries.clear();
2613  Writer->ParentStmts.clear();
2614  }
2615 
2616  StmtsToEmit.clear();
2617 }
2618 
2619 void ASTRecordWriter::FlushSubStmts() {
2620  // For a nested statement, write out the substatements in reverse order (so
2621  // that a simple stack machine can be used when loading), and don't emit a
2622  // STMT_STOP after each one.
2623  for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) {
2624  Writer->WriteSubStmt(StmtsToEmit[N - I - 1]);
2625  assert(N == StmtsToEmit.size() && "record modified while being written!");
2626  }
2627 
2628  StmtsToEmit.clear();
2629 }
storage_type getAsOpaqueInt() const
Definition: LangOptions.h:550
SourceLocation getRParenLoc() const
Definition: Stmt.h:2478
Expr * getInc()
Definition: Stmt.h:2534
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:614
unsigned getNumSemanticExprs() const
Definition: Expr.h:6080
A PredefinedExpr record.
Definition: ASTBitCodes.h:1580
const Expr * getSubExpr() const
Definition: Expr.h:1007
A call to an overloaded operator written using operator syntax.
Definition: ExprCXX.h:82
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
Definition: ExprObjC.h:1566
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:436
The receiver is the instance of the superclass object.
Definition: ExprObjC.h:1097
Represents a single C99 designator.
Definition: Expr.h:5023
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: Expr.h:1386
SourceLocation getRBracLoc() const
Definition: Stmt.h:1506
Defines the clang::ASTContext interface.
A CompoundLiteralExpr record.
Definition: ASTBitCodes.h:1643
This represents &#39;#pragma omp distribute simd&#39; composite directive.
Definition: StmtOpenMP.h:3829
const BlockDecl * getBlockDecl() const
Definition: Expr.h:5898
IdentifierInfo * getInputIdentifier(unsigned i) const
Definition: Stmt.h:3085
This represents &#39;#pragma omp master&#39; directive.
Definition: StmtOpenMP.h:1582
ConstantExprBitfields ConstantExprBits
Definition: Stmt.h:1022
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition: ExprCXX.h:1083
SourceLocation getRParenLoc() const
Definition: Stmt.h:2992
The null pointer literal (C++11 [lex.nullptr])
Definition: ExprCXX.h:749
unsigned getNumDecls() const
Gets the number of declarations in the unresolved set.
Definition: ExprCXX.h:2970
This represents &#39;#pragma omp task&#39; directive.
Definition: StmtOpenMP.h:2008
This represents a GCC inline-assembly statement extension.
Definition: Stmt.h:2969
Represents a &#39;co_await&#39; expression while the type of the promise is dependent.
Definition: ExprCXX.h:4787
SourceLocation getForLoc() const
Definition: StmtCXX.h:201
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
Definition: Expr.h:1322
static DiagnosticBuilder Diag(DiagnosticsEngine *Diags, const LangOptions &Features, FullSourceLoc TokLoc, const char *TokBegin, const char *TokRangeBegin, const char *TokRangeEnd, unsigned DiagID)
Produce a diagnostic highlighting some portion of a literal.
The receiver is an object instance.
Definition: ExprObjC.h:1091
Expr * getLHS() const
Definition: Expr.h:4099
unsigned getNumInputs() const
Definition: Stmt.h:2881
SourceLocation getOpLoc() const
Definition: ExprObjC.h:1517
Expr * getSyntacticForm()
Return the syntactic form of this expression, i.e.
Definition: Expr.h:6060
SourceLocation getRParenLoc() const
Definition: Expr.h:3033
ObjCDictionaryElement getKeyValueElement(unsigned Index) const
Definition: ExprObjC.h:362
CompoundStmt * getBlock() const
Definition: Stmt.h:3360
An IndirectGotoStmt record.
Definition: ASTBitCodes.h:1553
SourceLocation getForLoc() const
Definition: Stmt.h:2547
SourceLocation getUsedLocation() const
Retrieve the location where this default argument was actually used.
Definition: ExprCXX.h:1277
uint64_t getValue() const
Definition: ExprCXX.h:2785
StringKind getKind() const
Definition: Expr.h:1870
An AddrLabelExpr record.
Definition: ASTBitCodes.h:1673
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Definition: Expr.h:3169
NameKind
The kind of the name stored in this DeclarationName.
Expr * getCond() const
Definition: Expr.h:4484
ObjCMethodDecl * getAtIndexMethodDecl() const
Definition: ExprObjC.h:886
Selector getSelector() const
Definition: ExprObjC.cpp:306
SourceRange getSourceRange() const
Definition: ExprCXX.h:4005
Helper expressions and declaration for OMPIteratorExpr class for each iteration space.
Definition: ExprOpenMP.h:235
void AddToken(const Token &Tok, RecordDataImpl &Record)
Emit a token.
Definition: ASTWriter.cpp:4257
SourceLocation getEllipsisLoc() const
Get the location of the ... in a case statement of the form LHS ... RHS.
Definition: Stmt.h:1641
SourceLocation getLParen() const
Get the location of the left parentheses &#39;(&#39;.
Definition: Expr.h:2065
const Expr * getSubExpr() const
Definition: ExprCXX.h:1191
FPOptionsOverride getFPFeatures() const
Definition: Expr.h:3005
Expr * getCond()
Definition: Stmt.h:2361
Expr * getExpr(unsigned Index)
getExpr - Return the Expr at the specified index.
Definition: Expr.h:4357
A CXXStaticCastExpr record.
Definition: ASTBitCodes.h:1804
unsigned getNumSubExprs() const
getNumSubExprs - Return the size of the SubExprs array.
Definition: Expr.h:4351
bool isSuperReceiver() const
Definition: ExprObjC.h:772
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2652
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:2840
ArrayRef< ParmVarDecl * > getLocalParameters() const
Definition: ExprConcepts.h:512
VarDecl * getParameterPack() const
Get the parameter pack which this expression refers to.
Definition: ExprCXX.h:4396
SourceLocation TemplateKWLoc
The source location of the template keyword; this is used as part of the representation of qualified ...
Definition: TemplateBase.h:669
An AttributedStmt record.
Definition: ASTBitCodes.h:1532
CompoundStmt * getSubStmt()
Definition: Expr.h:4286
A CXXReinterpretCastExpr record.
Definition: ASTBitCodes.h:1810
SourceLocation getRParenLoc() const
Definition: Stmt.h:2258
const Expr * getInit(unsigned Init) const
Definition: Expr.h:4758
const DeclContext * getParentContext() const
If the SourceLocExpr has been resolved return the subexpression representing the resolved value...
Definition: Expr.h:4642
unsigned getNumAsmToks()
Definition: Stmt.h:3222
An ObjCBoolLiteralExpr record.
Definition: ASTBitCodes.h:1769
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:1201
Expr *const * semantics_iterator
Definition: Expr.h:6082
ObjCProtocolDecl * getProtocol() const
Definition: ExprObjC.h:521
Represents a &#39;co_return&#39; statement in the C++ Coroutines TS.
Definition: StmtCXX.h:456
Stmt - This represents one statement.
Definition: Stmt.h:68
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition: Expr.h:2908
Expr * getDimensionExpression() const
Definition: ExprCXX.h:2787
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:2412
IfStmt - This represents an if/then/else.
Definition: Stmt.h:1900
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
Definition: Expr.h:2409
SourceLocation getRParenLoc() const
Definition: Expr.h:4338
SourceLocation getLocation() const
Definition: Expr.h:1682
ObjCMethodDecl * setAtIndexMethodDecl() const
Definition: ExprObjC.h:890
void AddNestedNameSpecifierLoc(NestedNameSpecifierLoc NNS)
Emit a nested name specifier with source-location information.
Definition: ASTWriter.cpp:5586
unsigned getNumOutputs() const
Definition: Stmt.h:2859
This represents &#39;#pragma omp for simd&#39; directive.
Definition: StmtOpenMP.h:1329
ArrayRef< CleanupObject > getObjects() const
Definition: ExprCXX.h:3357
Expr * getBase() const
Definition: Expr.h:3163
const StringLiteral * getAsmString() const
Definition: Stmt.h:2997
TypeSourceInfo * getTypeSourceInfo() const
Definition: Expr.h:3360
An ImplicitValueInitExpr record.
Definition: ASTBitCodes.h:1667
iterator end()
Definition: DeclGroup.h:105
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:89
This represents &#39;#pragma omp teams distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:4227
An ImplicitCastExpr record.
Definition: ASTBitCodes.h:1637
Stmt * getHandlerBlock() const
Definition: StmtCXX.h:51
SourceLocation getBeginLoc() const
Returns starting location of directive kind.
Definition: StmtOpenMP.h:251
Expr * CounterUpdate
Updater for the internal counter: ++CounterVD;.
Definition: ExprOpenMP.h:245
llvm::APFloat getValue() const
Definition: Expr.h:1641
ObjCMethodDecl * getImplicitPropertySetter() const
Definition: ExprObjC.h:713
void writeBool(bool Value)
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Definition: Expr.h:5390
FunctionDecl * getOperatorNew() const
Definition: ExprCXX.h:2244
unsigned getScale() const
Definition: Expr.h:1556
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:3060
A BuiltinBitCastExpr record.
Definition: ASTBitCodes.h:1822
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:4569
Defines the C++ template declaration subclasses.
Opcode getOpcode() const
Definition: Expr.h:3771
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:5198
SourceLocation getIdentLoc() const
Definition: Stmt.h:1812
Represents an attribute applied to a statement.
Definition: Stmt.h:1842
Expr * getBase()
Fetches base expression of array shaping expression.
Definition: ExprOpenMP.h:214
ParenExpr - This represents a parethesized expression, e.g.
Definition: Expr.h:2042
NamedDecl * getDecl() const
A CXXOperatorCallExpr record.
Definition: ASTBitCodes.h:1786
bool hasQualifier() const
Determines whether this member expression actually had a C++ nested-name-specifier prior to the name ...
Definition: Expr.h:3183
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:94
This represents &#39;#pragma omp target teams distribute&#39; combined directive.
Definition: StmtOpenMP.h:4377
A CXXTemporaryObjectExpr record.
Definition: ASTBitCodes.h:1801
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:1561
SourceLocation getLocation() const
Definition: ExprCXX.h:763
const RecordDecl * getCapturedRecordDecl() const
Retrieve the record declaration for captured variables.
Definition: Stmt.h:3585
SourceLocation getRParenLoc() const
Definition: Expr.h:2554
SourceLocation getKeywordLoc() const
Definition: ExprCXX.h:4816
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1450
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: Stmt.h:1317
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:841
TypeSourceInfo * getTypeInfoAsWritten() const
getTypeInfoAsWritten - Returns the type source info for the type that this expression is casting to...
Definition: Expr.h:3639
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent...
Definition: ExprCXX.h:2740
bool getIsCXXTry() const
Definition: Stmt.h:3402
SourceLocation getLParenLoc() const
Definition: Expr.h:3690
A constant expression context.
Definition: ASTBitCodes.h:1577
A container of type source information.
Definition: Type.h:6363
This represents &#39;#pragma omp parallel for&#39; directive.
Definition: StmtOpenMP.h:1701
MS property subscript expression.
Definition: ExprCXX.h:984
IdentKind getIdentKind() const
Definition: Expr.h:1995
SourceLocation getGotoLoc() const
Definition: Stmt.h:2627
SourceLocation getRParenLoc() const
Definition: ExprCXX.h:2103
This represents &#39;#pragma omp target teams distribute parallel for&#39; combined directive.
Definition: StmtOpenMP.h:4443
Expr * Update
Update expression for the originally specified iteration variable, calculated as VD = Begin + Counter...
Definition: ExprOpenMP.h:243
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
Definition: ExprCXX.h:4449
float __ovld __cnfn distance(float p0, float p1)
Returns the distance between p0 and p1.
SourceLocation getAccessorLoc() const
Definition: Expr.h:5850
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
Definition: Expr.h:4419
unsigned getDeclRefExprAbbrev() const
Definition: ASTWriter.h:701
VarDecl * CounterVD
Internal normalized counter.
Definition: ExprOpenMP.h:237
const Expr * getSubExpr() const
Definition: Expr.h:1718
SourceLocation getAtLoc() const
Definition: ExprObjC.h:69
SourceLocation getCoawaitLoc() const
Definition: StmtCXX.h:202
Expr * getIndexExpr(unsigned Idx)
Definition: Expr.h:2437
SourceLocation getEndLoc() const
Returns ending location of directive.
Definition: StmtOpenMP.h:253
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1993
This represents &#39;#pragma omp target exit data&#39; directive.
Definition: StmtOpenMP.h:2722
Stmt * getSubStmt()
Definition: Stmt.h:1733
const VarDecl * getNRVOCandidate() const
Retrieve the variable that might be used for the named return value optimization. ...
Definition: Stmt.h:2769
SourceLocation getLParenLoc() const
Definition: Stmt.h:2549
bool hasTemplateKWAndArgsInfo() const
Definition: Expr.h:1332
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:2936
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC &#39;id&#39; type.
Definition: ExprObjC.h:1482
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:3327
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprCXX.h:883
SourceLocation getOperatorLoc() const
Retrieve the location of the &#39;.&#39; or &#39;->&#39; operator.
Definition: ExprCXX.h:2570
SourceLocation getAtLoc() const
Definition: ExprObjC.h:471
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
Definition: ExprCXX.h:2701
SourceRange getSourceRange() const
Definition: ExprCXX.h:2369
ObjCInterfaceDecl * getClassReceiver() const
Definition: ExprObjC.h:767
SourceLocation getColonLoc() const
Definition: Expr.h:4055
bool isArrow() const
Definition: ExprObjC.h:1509
SourceLocation getLeftLoc() const
Definition: ExprObjC.h:1406
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition: ExprCXX.h:781
Stmt * getThen()
Definition: Stmt.h:1991
SourceLocation getIfLoc() const
Definition: Stmt.h:2063
unsigned getNumPlacementArgs() const
Definition: ExprCXX.h:2262
TypeSourceInfo * getArgumentTypeInfo() const
Definition: Expr.h:2524
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
Definition: ExprCXX.h:3128
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range that covers this offsetof node.
Definition: Expr.h:2355
capture_iterator capture_begin()
Retrieve an iterator pointing to the first capture.
Definition: Stmt.h:3610
A CXXConstructExpr record.
Definition: ASTBitCodes.h:1795
unsigned getNumExpressions() const
Definition: Expr.h:2452
SourceLocation getLocation() const
Retrieve the location of the literal.
Definition: Expr.h:1510
raw_arg_iterator raw_arg_begin()
Definition: ExprCXX.h:2354
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will call.
Definition: ExprCXX.h:1676
A C++ throw-expression (C++ [except.throw]).
Definition: ExprCXX.h:1171
Expr * getExprOperand() const
Definition: ExprCXX.h:876
Represents an expression – generally a full-expression – that introduces cleanups to be run at the ...
Definition: ExprCXX.h:3329
TypeSourceInfo * getArg(unsigned I) const
Retrieve the Ith argument.
Definition: ExprCXX.h:2704
Represents a parameter to a function.
Definition: Decl.h:1617
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprObjC.h:162
SourceLocation getRParenLoc() const
Definition: Expr.h:5795
SourceLocation getLocation() const
Retrieve the location of the literal.
Definition: Expr.h:1552
void AddString(StringRef Str)
Emit a string.
iterator begin() const
Definition: ExprCXX.h:4404
bool isXLHSInRHSPart() const
Return true if helper update expression has form &#39;OpaqueValueExpr(x) binop OpaqueValueExpr(expr)&#39; and...
Definition: StmtOpenMP.h:2531
void AddSourceRange(SourceRange Range)
Emit a source range.
A ShuffleVectorExpr record.
Definition: ASTBitCodes.h:1688
SourceLocation getBuiltinLoc() const
Definition: Expr.h:4491
ObjCPropertyDecl * getExplicitProperty() const
Definition: ExprObjC.h:703
SourceLocation getRParenLoc() const
Definition: ExprOpenMP.h:195
A C++ static_cast expression (C++ [expr.static.cast]).
Definition: ExprCXX.h:421
void AddTypeSourceInfo(TypeSourceInfo *TInfo)
Emits a reference to a declarator info.
Definition: ASTWriter.cpp:5372
Expr * getExprOperand() const
Definition: ExprCXX.h:1087
const Stmt * getSubStmt() const
Definition: StmtObjC.h:379
SourceLocation getRParenLoc() const
Retrieve the location of the closing parenthesis.
Definition: ExprCXX.h:397
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:1798
Represents a C99 designated initializer expression.
Definition: Expr.h:4948
SourceLocation getAtLoc() const
Definition: ExprObjC.h:525
NamedDecl * getFoundDecl() const
Definition: ASTConcept.h:150
An OffsetOfExpr record.
Definition: ASTBitCodes.h:1610
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition: Decl.h:287
TypeSourceInfo * getEncodedTypeSourceInfo() const
Definition: ExprObjC.h:430
Expr * getSemanticForm()
Get an equivalent semantic form for this expression.
Definition: ExprCXX.h:302
TypeSourceInfo * getScopeTypeInfo() const
Retrieve the scope type in a qualified pseudo-destructor expression.
Definition: ExprCXX.h:2581
SourceLocation getKeywordLoc() const
Definition: StmtCXX.h:476
Stmt * getBody()
Definition: Stmt.h:2470
An ObjCAtThrowStmt record.
Definition: ASTBitCodes.h:1763
SourceLocation getTildeLoc() const
Retrieve the location of the &#39;~&#39;.
Definition: ExprCXX.h:2588
FieldDecl * getField() const
For a field offsetof node, returns the field.
Definition: Expr.h:2334
SourceLocation getRParenLoc() const
Definition: Expr.h:6241
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(), or __builtin_FILE().
Definition: Expr.h:4602
void AddTypeRef(QualType T)
Emit a reference to a type.
An element in an Objective-C dictionary literal.
Definition: ExprObjC.h:263
A DesignatedInitExpr record.
Definition: ASTBitCodes.h:1652
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
Definition: ExprConcepts.h:475
This represents &#39;#pragma omp parallel&#39; directive.
Definition: StmtOpenMP.h:374
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition: Expr.h:4317
bool cleanupsHaveSideEffects() const
Definition: ExprCXX.h:3369
QualType getComputationResultType() const
Definition: Expr.h:4011
SourceLocation getRParen() const
Get the location of the right parentheses &#39;)&#39;.
Definition: Expr.h:2069
DeclStmt * getConditionVariableDeclStmt()
If this SwitchStmt has a condition variable, return the faux DeclStmt associated with the creation of...
Definition: Stmt.h:2238
bool isFileScope() const
Definition: Expr.h:3354
Frontend produces RecoveryExprs on semantic errors that prevent creating other well-formed expression...
Definition: Expr.h:6336
SourceLocation getAmpAmpLoc() const
Definition: Expr.h:4239
unsigned getNumArgs() const
Retrieve the number of arguments.
Definition: ExprCXX.h:3473
NameKind getNameKind() const
Determine what kind of name this is.
SourceLocation getEndLoc() const
Definition: Stmt.h:1314
Represents a member of a struct/union/class.
Definition: Decl.h:2776
An explicit cast in C or a C-style cast in C++, which uses the syntax ([s1][s2]...[sn])expr.
Definition: ExprOpenMP.h:146
Expr * getBase()
Retrieve the base object of this member expressions, e.g., the x in x.m.
Definition: ExprCXX.h:3874
Represents a place-holder for an object not to be initialized by anything.
Definition: Expr.h:5246
NonTypeTemplateParmDecl * getParameter() const
Definition: ExprCXX.h:4266
const DeclarationNameInfo & getNameInfo() const
Gets the full name info.
Definition: ExprCXX.h:2973
StringLiteral * getString()
Definition: ExprObjC.h:65
unsigned getArrayExprIndex() const
For an array element node, returns the index into the array of expressions.
Definition: Expr.h:2328
SourceLocation getLabelLoc() const
Definition: Expr.h:4241
SourceLocation getRBraceLoc() const
Definition: Expr.h:4861
SourceLocation getOperatorLoc() const
Definition: Expr.h:2551
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Definition: Expr.h:4519
SourceLocation getRParenLoc() const
Definition: Expr.h:3693
The iterator over UnresolvedSets.
Definition: UnresolvedSet.h:32
This represents &#39;#pragma omp target simd&#39; directive.
Definition: StmtOpenMP.h:3962
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
Definition: Expr.h:1175
Represents a C++ member access expression for which lookup produced a set of overloaded functions...
Definition: ExprCXX.h:3797
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:5826
const DeclGroupRef getDeclGroup() const
Definition: Stmt.h:1309
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:2279
Expr * getSubExpr()
Definition: Expr.h:3448
This represents &#39;#pragma omp barrier&#39; directive.
Definition: StmtOpenMP.h:2116
SourceLocation getQuestionLoc() const
Definition: Expr.h:4054
void AddTemplateParameterList(const TemplateParameterList *TemplateParams)
Emit a template parameter list.
Definition: ASTWriter.cpp:5640
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp, [NSNumber numberWithInt:42]];.
Definition: ExprObjC.h:190
unsigned getCharByteWidth() const
Definition: Expr.h:1868
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:446
ArrayRef< SourceRange > getBracketsRanges() const
Fetches source ranges for the brackets os the array shaping expression.
Definition: ExprOpenMP.h:209
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition: ExprCXX.h:4299
This represents &#39;#pragma omp critical&#39; directive.
Definition: StmtOpenMP.h:1630
OpenMPDirectiveKind getCancelRegion() const
Get cancellation region for the current cancellation point.
Definition: StmtOpenMP.h:3048
bool hadArrayRangeDesignator() const
Definition: Expr.h:4882
SourceLocation getCatchLoc() const
Definition: StmtCXX.h:48
Selector getSelector() const
Definition: ExprObjC.h:468
void AddIdentifierRef(const IdentifierInfo *II)
Emit a reference to an identifier.
Represents Objective-C&#39;s @catch statement.
Definition: StmtObjC.h:77
SourceLocation getOpLoc() const
Definition: ExprObjC.h:597
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:3464
IndirectGotoStmt - This represents an indirect goto.
Definition: Stmt.h:2611
Describes an C or C++ initializer list.
Definition: Expr.h:4710
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition: ExprCXX.h:829
This represents &#39;#pragma omp distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:3668
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:4160
Expr * getKeyExpr() const
Definition: ExprObjC.h:883
ASTWriter::RecordDataImpl & getRecordData() const
Extract the underlying record storage.
unsigned getNumExpansions() const
Get the number of parameters in this parameter pack.
Definition: ExprCXX.h:4408
SourceLocation getLParenLoc() const
Definition: Stmt.h:2256
unsigned getLength() const
Definition: Expr.h:1867
ForStmt - This represents a &#39;for (init;cond;inc)&#39; stmt.
Definition: Stmt.h:2501
FunctionDecl * getOperatorDelete() const
Definition: ExprCXX.h:2424
Expr * getBaseExpr() const
Definition: ExprObjC.h:880
TemplateArgument getArgumentPack() const
Retrieve the template argument pack containing the substituted template arguments.
Definition: ExprCXX.cpp:1587
bool isElidable() const
Whether this construction is elidable.
Definition: ExprCXX.h:1528
Expr * getOperand() const
Definition: ExprCXX.h:4001
unsigned getIntegerLiteralAbbrev() const
Definition: ASTWriter.h:703
const Expr * getThrowExpr() const
Definition: StmtObjC.h:344
bool isGlobalNew() const
Definition: ExprCXX.h:2285
SourceLocation getParameterPackLocation() const
Retrieve the location of the parameter pack name.
Definition: ExprCXX.h:4330
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
Definition: ExprCXX.h:2420
LabelDecl * getDecl() const
Definition: Stmt.h:1815
ArrayRef< Expr * > getDimensions() const
Fetches the dimensions for array shaping expression.
Definition: ExprOpenMP.h:204
SourceLocation getLBracLoc() const
Definition: Stmt.h:1505
A reference to a previously [de]serialized Stmt record.
Definition: ASTBitCodes.h:1514
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
Definition: ExprCXX.h:1982
SourceLocation getRParenLoc() const
Definition: StmtCXX.h:204
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
Definition: Expr.h:432
path_iterator path_begin()
Definition: Expr.h:3468
SourceLocation getIsaMemberLoc() const
getMemberLoc - Return the location of the "member", in X->F, it is the location of &#39;F&#39;...
Definition: ExprObjC.h:1514
Stmt * getBody()
Definition: Stmt.h:2535
OpenMP 5.0 [2.1.6 Iterators] Iterators are identifiers that expand to multiple values in the clause o...
Definition: ExprOpenMP.h:272
semantics_iterator semantics_end()
Definition: Expr.h:6090
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: ExprCXX.h:3739
LifetimeExtendedTemporaryDecl * getLifetimeExtendedTemporaryDecl()
Definition: ExprCXX.h:4489
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3727
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:3748
bool constructsVBase() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
Definition: ExprCXX.h:1680
Stmt * getInit()
Definition: Stmt.h:2514
Expr * getOutputExpr(unsigned i)
Definition: Stmt.cpp:500
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:3290
unsigned getCharacterLiteralAbbrev() const
Definition: ASTWriter.h:702
SourceLocation getThrowLoc() const
Definition: ExprCXX.h:1194
unsigned getResultExprIndex() const
Return the index of the result-bearing expression into the semantics expressions, or PseudoObjectExpr...
Definition: Expr.h:6065
const StringLiteral * getInputConstraintLiteral(unsigned i) const
Definition: Stmt.h:3098
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:3270
ConceptDecl * getNamedConcept() const
Definition: ASTConcept.h:154
labels_range labels()
Definition: Stmt.h:3141
This represents &#39;#pragma omp cancellation point&#39; directive.
Definition: StmtOpenMP.h:3004
ObjCStringLiteral, used for Objective-C string literals i.e.
Definition: ExprObjC.h:52
SourceLocation getEqualOrColonLoc() const
Retrieve the location of the &#39;=&#39; that precedes the initializer value itself, if present.
Definition: Expr.h:5173
const CallExpr * getConfig() const
Definition: ExprCXX.h:258
bool isArrow() const
Definition: ExprCXX.h:968
CaseStmt - Represent a case statement.
Definition: Stmt.h:1566
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
Definition: Expr.h:6279
Expr * getCond()
Definition: Stmt.h:2533
IdentKind getIdentKind() const
Definition: Expr.h:4623
SourceLocation getContinueLoc() const
Definition: Stmt.h:2669
This represents &#39;#pragma omp teams&#39; directive.
Definition: StmtOpenMP.h:2951
SourceLocation getEndLoc() const
Definition: Expr.h:4647
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:3397
FieldDecl * getField()
Get the field whose initializer will be used.
Definition: ExprCXX.h:1332
Helper class for OffsetOfExpr.
Definition: Expr.h:2270
A marker record that indicates that we are at the end of an expression.
Definition: ASTBitCodes.h:1508
This represents &#39;#pragma omp teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:4093
Represents binding an expression to a temporary.
Definition: ExprCXX.h:1402
StringLiteral * getClobberStringLiteral(unsigned i)
Definition: Stmt.h:3178
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
Definition: ExprCXX.h:4716
Expr * Key
The key for the dictionary element.
Definition: ExprObjC.h:265
SourceLocation getBuiltinLoc() const
Definition: Expr.h:4580
CXXTemporary * getTemporary()
Definition: ExprCXX.h:1420
ObjCMethodDecl * getArrayWithObjectsMethod() const
Definition: ExprObjC.h:241
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition: ExprCXX.h:1855
CXXRecordDecl * getNamingClass()
Gets the &#39;naming class&#39; (in the sense of C++0x [class.access.base]p5) of the lookup.
Definition: ExprCXX.h:3136
NestedNameSpecifierLoc getQualifierLoc() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name, with source-location information.
Definition: Expr.h:1304
bool isTypeDependent() const
Determines whether the type of this expression depends on.
Definition: Expr.h:185
SourceLocation getTryLoc() const
Definition: Stmt.h:3399
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3537
FPOptionsOverride getStoredFPFeatures() const
Get FPFeatures from trailing storage.
Definition: Expr.h:3913
This represents &#39;#pragma omp scan&#39; directive.
Definition: StmtOpenMP.h:4676
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "for" statement, if any.
Definition: Stmt.cpp:1011
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
Definition: Expr.h:2144
SourceLocation getNameLoc() const
Definition: ExprCXX.h:4258
TypeSourceInfo * getTypeSourceInfo() const
Definition: ExprCXX.h:2099
Stmt * getBody()
Definition: Stmt.h:2193
void AddAPInt(const llvm::APInt &Value)
Emit an integral value.
SourceLocation getLocation() const
Definition: ExprObjC.h:107
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1231
Stmt * getInit()
Definition: Stmt.h:2047
bool isExact() const
Definition: Expr.h:1674
bool isTypeOperand() const
Definition: ExprCXX.h:1076
SourceLocation getTokenLocation() const
getTokenLocation - The location of the __null token.
Definition: Expr.h:4533
llvm::APFloatBase::Semantics getRawSemantics() const
Get a raw enumeration value representing the floating-point semantics of this literal (32-bit IEEE...
Definition: Expr.h:1651
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:3671
Represents the this expression in C++.
Definition: ExprCXX.h:1132
ObjCMethodDecl * getDictWithObjectsMethod() const
Definition: ExprObjC.h:376
arg_iterator arg_end()
Definition: Expr.h:2966
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:3464
TypeSourceInfo * getAllocatedTypeSourceInfo() const
Definition: ExprCXX.h:2223
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
Definition: TemplateBase.h:658
NestedNameSpecifierLoc getQualifierLoc() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name...
Definition: Expr.h:3188
void AddAPValue(const APValue &Value)
Emit an APvalue.
Definition: ASTWriter.cpp:5132
TypeSourceInfo * getQueriedTypeSourceInfo() const
Definition: ExprCXX.h:2783
bool isArrayForm() const
Definition: ExprCXX.h:2411
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:3895
OpenMP 5.0 [2.1.5, Array Sections].
Definition: ExprOpenMP.h:56
SourceLocation getRParenLoc() const
Definition: Stmt.h:2094
ConditionalOperator - The ?: ternary operator.
Definition: Expr.h:4065
TypeSourceInfo * getTypeSourceInfo() const
Definition: ExprCXX.h:1816
This represents &#39;#pragma omp depobj&#39; directive.
Definition: StmtOpenMP.h:2327
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
Definition: ExprCXX.h:1552
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition: ExprCXX.h:2504
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
Definition: ExprCXX.h:3957
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:1398
unsigned NumTemplateArgs
The number of template arguments in TemplateArgs.
Definition: TemplateBase.h:672
SourceLocation getRBracket() const
Definition: ExprObjC.h:871
bool isMicrosoftABI() const
Returns whether this is really a Win64 ABI va_arg expression.
Definition: Expr.h:4574
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1516
void AddDeclarationNameLoc(const DeclarationNameLoc &DNLoc, DeclarationName Name)
Definition: ASTWriter.cpp:5541
Expr ** getSubExprs()
Definition: Expr.h:6217
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:2208
void AddCXXTemporary(const CXXTemporary *Temp)
Emit a CXXTemporary.
Definition: ASTWriter.cpp:5327
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
Definition: ExprCXX.h:1522
QualType getComputationLHSType() const
Definition: Expr.h:4008
bool hasStoredFPFeatures() const
Definition: Expr.h:3910
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprObjC.h:218
SourceLocation getRParenLoc() const
Definition: ExprObjC.h:472
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
Definition: Expr.h:2479
SourceLocation getTryLoc() const
Definition: StmtCXX.h:94
bool isConstexpr() const
Definition: Stmt.h:2077
SourceLocation getLocation() const
Definition: ExprCXX.h:1524
SourceLocation getRBracketLoc() const
Definition: ExprCXX.h:1021
SourceLocation getLocation() const
Definition: Expr.h:1293
unsigned getSwitchCaseID(SwitchCase *S)
Retrieve the ID for the given switch-case statement.
InitListExpr * getUpdater() const
Definition: Expr.h:5305
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition: Expr.h:1022
Represents a call to the builtin function __builtin_va_arg.
Definition: Expr.h:4553
SourceLocation getLabelLoc() const
Definition: Stmt.h:2590
bool isImplicitAccess() const
True if this is an implicit access, i.e.
Definition: ExprCXX.h:3627
SourceLocation getThrowLoc() const LLVM_READONLY
Definition: StmtObjC.h:348
unsigned Offset
Definition: Format.cpp:2064
static unsigned getNumSubExprs(AtomicOp Op)
Determine the number of arguments the specified atomic builtin should have.
Definition: Expr.cpp:4533
unsigned getValue() const
Definition: Expr.h:1608
This represents &#39;#pragma omp distribute&#39; directive.
Definition: StmtOpenMP.h:3546
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition: Expr.h:5966
SourceLocation getDestroyedTypeLoc() const
Retrieve the starting location of the type being destroyed.
Definition: ExprCXX.h:2612
ObjCMethodDecl * getBoxingMethod() const
Definition: ExprObjC.h:147
SourceLocation getFinallyLoc() const
Definition: Stmt.h:3357
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type...
Definition: ExprCXX.h:2080
ADLCallKind getADLCallKind() const
Definition: Expr.h:2884
SourceLocation getOperatorLoc() const
Retrieve the location of the &#39;->&#39; or &#39;.&#39; operator.
Definition: ExprCXX.h:3896
Expr * getCond() const
Definition: Expr.h:4088
OMPChildren * Data
Data, associated with the directive.
Definition: StmtOpenMP.h:54
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1781
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition: Decl.h:4094
llvm::MutableArrayRef< Designator > designators()
Definition: Expr.h:5151
DeclAccessPair getFoundDecl() const
Retrieves the declaration found by lookup.
Definition: Expr.h:3173
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:4306
SourceLocation getLParenLoc() const
Definition: Stmt.h:2092
This represents one expression.
Definition: Expr.h:109
SourceLocation getElseLoc() const
Definition: Stmt.h:2066
DeclStmt * getEndStmt()
Definition: StmtCXX.h:165
SourceLocation End
unsigned getTemplateDepth() const
Definition: Expr.h:4298
IdentifierInfo * getFieldName() const
For a field or identifier offsetof node, returns the name of the field.
Definition: Expr.cpp:1463
CXXBaseSpecifier * getBase() const
For a base class node, returns the base specifier.
Definition: Expr.h:2344
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:3893
StringRef getClobber(unsigned i) const
Definition: Stmt.h:3273
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:1484
SourceLocation getWhileLoc() const
Definition: Stmt.h:2413
This represents &#39;#pragma omp master taskloop&#39; directive.
Definition: StmtOpenMP.h:3261
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:4191
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:3310
Represents a C++ functional cast expression that builds a temporary object.
Definition: ExprCXX.h:1787
A C++ const_cast expression (C++ [expr.const.cast]).
Definition: ExprCXX.h:552
SourceLocation getLocation() const
Definition: ExprCXX.h:1143
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:5886
Field designator where only the field name is known.
Definition: ASTBitCodes.h:1967
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:2604
Expr * getCallee()
Definition: Expr.h:2880
unsigned getNumInits() const
Definition: Expr.h:4740
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1313
This represents &#39;#pragma omp target teams distribute parallel for simd&#39; combined directive.
Definition: StmtOpenMP.h:4541
raw_arg_iterator raw_arg_end()
Definition: ExprCXX.h:2355
bool isArrow() const
Determine whether this pseudo-destructor expression was written using an &#39;->&#39; (otherwise, it used a &#39;.
Definition: ExprCXX.h:2567
Stmt * getBody()
Definition: Stmt.h:2373
FPOptionsOverride getFPFeatures() const
Definition: Expr.h:3501
A CXXAddrspaceCastExpr record.
Definition: ASTBitCodes.h:1816
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
Definition: ExprObjC.h:306
const CompoundStmt * getSynchBody() const
Definition: StmtObjC.h:297
SourceLocation getLParenLoc() const
Definition: Expr.h:5498
Expr * getRHS()
Definition: Stmt.h:1667
bool hasQualifier() const
Determine whether this declaration reference was preceded by a C++ nested-name-specifier, e.g., N::foo.
Definition: Expr.h:1300
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:1828
TypeSourceInfo * getTypeSourceInfo() const
Definition: Expr.h:2416
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:4114
SourceLocation getRBracketLoc() const
Definition: ExprOpenMP.h:124
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:5947
An ArraySubscriptExpr record.
Definition: ASTBitCodes.h:1616
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:1415
IdentifierInfo & getAccessor() const
Definition: Expr.h:5847
This represents &#39;#pragma omp target teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:4612
ArrayTypeTrait getTrait() const
Definition: ExprCXX.h:2779
decls_iterator decls_begin() const
Definition: ExprCXX.h:2959
unsigned size() const
Definition: Stmt.h:1426
An ArrayInitLoopExpr record.
Definition: ASTBitCodes.h:1661
A PseudoObjectExpr record.
Definition: ASTBitCodes.h:1700
SourceRange getAngleBrackets() const LLVM_READONLY
Definition: ExprCXX.h:401
Kind getKind() const
Determine what kind of offsetof node this is.
Definition: Expr.h:2324
QualType getType() const
Definition: Expr.h:141
SourceLocation getEndLoc() const
Definition: Expr.h:6359
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:3632
This represents &#39;#pragma omp for&#39; directive.
Definition: StmtOpenMP.h:1239
An ObjCIndirectCopyRestoreExpr record.
Definition: ASTBitCodes.h:1745
Expr * getElement(unsigned Index)
getElement - Return the Element at the specified index.
Definition: ExprObjC.h:232
const DeclarationNameInfo & getConceptNameInfo() const
Definition: ASTConcept.h:142
Optional< unsigned > NumExpansions
The number of elements this pack expansion will expand to, if this is a pack expansion and is known...
Definition: ExprObjC.h:275
SourceLocation getSwitchLoc() const
Definition: Stmt.h:2254
bool hasStoredFPFeatures() const
Definition: Expr.h:3485
LabelDecl * getLabel() const
Definition: Stmt.h:2585
bool hasInitializer() const
Whether this new-expression has any initializer at all.
Definition: ExprCXX.h:2288
const Stmt * getTryBody() const
Retrieve the @try body.
Definition: StmtObjC.h:208
Represents a folding of a pack over an operator.
Definition: ExprCXX.h:4563
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
Definition: Stmt.h:2727
This represents &#39;#pragma omp target teams&#39; directive.
Definition: StmtOpenMP.h:4321
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
Definition: Expr.h:5972
An expression that sends a message to the given Objective-C object or class.
Definition: ExprObjC.h:940
void AddDeclRef(const Decl *D)
Emit a reference to a declaration.
SourceLocation getLParenLoc() const
Definition: Stmt.h:2416
This represents a Microsoft inline-assembly statement extension.
Definition: Stmt.h:3192
SourceLocation getDoLoc() const
Definition: Stmt.h:2474
SwitchCase * getSwitchCaseList()
Definition: Stmt.h:2250
SourceLocation getAtLoc() const
Definition: StmtObjC.h:388
ObjCMethodDecl * getImplicitPropertyGetter() const
Definition: ExprObjC.h:708
A DesignatedInitUpdateExpr record.
Definition: ASTBitCodes.h:1655
SourceLocation getRBracketLoc() const
Definition: Expr.h:2622
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:2093
Expr * getInputExpr(unsigned i)
Definition: Stmt.cpp:821
Expr * getOutputExpr(unsigned i)
Definition: Stmt.cpp:817
void AddSelectorRef(Selector S)
Emit a Selector (which is a smart pointer reference).
Definition: ASTWriter.cpp:5304
IteratorRange getIteratorRange(unsigned I)
Gets the iterator range for the given iterator.
Definition: Expr.cpp:4749
SourceLocation getMemberLoc() const
getMemberLoc - Return the location of the "member", in X->F, it is the location of &#39;F&#39;...
Definition: Expr.h:3275
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
Definition: ExprObjC.h:1224
bool usesGNUSyntax() const
Determines whether this designated initializer used the deprecated GNU syntax for designated initiali...
Definition: Expr.h:5182
AtomicOp getOp() const
Definition: Expr.h:6214
A member reference to an MSPropertyDecl.
Definition: ExprCXX.h:913
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition: ExprCXX.h:4232
const OffsetOfNode & getComponent(unsigned Idx) const
Definition: Expr.h:2423
This represents &#39;#pragma omp cancel&#39; directive.
Definition: StmtOpenMP.h:3062
Expr * getTrueExpr() const
getTrueExpr - Return the subexpression which will be evaluated if the condition evaluates to true; th...
Definition: Expr.h:4174
Expr * getCond()
Definition: Stmt.h:1979
ValueDecl * getDecl()
Definition: Expr.h:1285
An ObjCAvailabilityCheckExpr record.
Definition: ASTBitCodes.h:1772
SourceLocation getLocation() const
Definition: Expr.h:1999
SourceLocation getRParenLoc() const
Definition: Expr.h:4583
SourceLocation getForLoc() const
Definition: StmtObjC.h:52
const Expr * getSubExpr() const
Definition: Expr.h:2057
ObjCBridgeCastKind getBridgeKind() const
Determine which kind of bridge is being performed via this cast.
Definition: ExprObjC.h:1652
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprCXX.h:1096
const Expr * getSubExpr() const
Definition: ExprCXX.h:1424
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:3655
const DeclContext * getUsedContext() const
Definition: ExprCXX.h:1273
Expr * getLHS()
An array access can be written A[4] or 4[A] (both are equivalent).
Definition: Expr.h:2603
LambdaExprBitfields LambdaExprBits
Definition: Stmt.h:1067
bool getValue() const
Definition: ExprCXX.h:723
bool hadMultipleCandidates() const
Returns true if this expression refers to a function that was resolved from an overloaded set having ...
Definition: Expr.h:1398
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Definition: ASTConcept.h:158
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1...
Definition: Expr.h:1706
Expr * getStride()
Get stride of array section.
Definition: ExprOpenMP.h:108
This represents &#39;#pragma omp flush&#39; directive.
Definition: StmtOpenMP.h:2275
An ObjCForCollectionStmt record.
Definition: ASTBitCodes.h:1748
ArrayRef< concepts::Requirement * > getRequirements() const
Definition: ExprConcepts.h:518
void writeOMPChildren(OMPChildren *Data)
Writes data related to the OpenMP directives.
Definition: ASTWriter.cpp:6882
This represents &#39;#pragma omp parallel for simd&#39; directive.
Definition: StmtOpenMP.h:1798
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
Definition: Expr.h:439
DoStmt - This represents a &#39;do/while&#39; stmt.
Definition: Stmt.h:2445
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
Definition: Stmt.h:2810
SourceLocation getOperatorLoc() const
Retrieve the location of the &#39;->&#39; or &#39;.&#39; operator.
Definition: ExprCXX.h:3647
SourceLocation getLParenLoc() const
Retrieve the location of the left parentheses (&#39;(&#39;) that precedes the argument list.
Definition: ExprCXX.h:3459
A MS-style AsmStmt record.
Definition: ASTBitCodes.h:1574
void push_back(uint64_t N)
Minimal vector-like interface.
This represents &#39;#pragma omp parallel master taskloop&#39; directive.
Definition: StmtOpenMP.h:3403
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:2534
Expr * getArgument()
Definition: ExprCXX.h:2426
This represents &#39;#pragma omp target enter data&#39; directive.
Definition: StmtOpenMP.h:2667
This represents &#39;#pragma omp master taskloop simd&#39; directive.
Definition: StmtOpenMP.h:3337
SourceLocation getEndLoc() const LLVM_READONLY
Definition: ExprConcepts.h:543
bool getValue() const
Definition: ExprCXX.h:4007
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Definition: ExprCXX.h:467
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
Definition: Expr.h:1125
Expr * getBase() const
Definition: Expr.h:5302
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition: Expr.h:4385
unsigned getNumArgs() const
Return the number of actual arguments in this message, not counting the receiver. ...
Definition: ExprObjC.h:1372
#define false
Definition: stdbool.h:17
SourceLocation getLParenLoc() const
Definition: Expr.h:3357
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr...
Definition: ExprCXX.h:2867
A field in a dependent type, known only by its name.
Definition: Expr.h:2279
This captures a statement into a function.
Definition: Stmt.h:3467
Represents a call to an inherited base class constructor from an inheriting constructor.
Definition: ExprCXX.h:1641
ExpressionTrait getTrait() const
Definition: ExprCXX.h:2845
unsigned path_size() const
Definition: Expr.h:3467
Token * getAsmToks()
Definition: Stmt.h:3223
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition: Expr.h:6016
bool isImplicitProperty() const
Definition: ExprObjC.h:700
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on...
Definition: Expr.h:214
bool inheritedFromVBase() const
Determine whether the inherited constructor is inherited from a virtual base of the object we constru...
Definition: ExprCXX.h:1690
StringLiteral * getFunctionName()
Definition: Expr.h:2002
unsigned getNumExprs() const
Return the number of expressions in this paren list.
Definition: Expr.h:5479
This represents &#39;#pragma omp single&#39; directive.
Definition: StmtOpenMP.h:1531
Encodes a location in the source.
SourceLocation getColonLocSecond() const
Definition: ExprOpenMP.h:121
body_range body()
Definition: Stmt.h:1431
Expr * getRetValue()
Definition: Stmt.h:2760
StringRef getOutputConstraint(unsigned i) const
Definition: Stmt.h:3233
Decl * getIteratorDecl(unsigned I)
Gets the iterator declaration for the given iterator.
Definition: Expr.cpp:4745
SourceLocation getOperatorLoc() const
Definition: Expr.h:3768
const Stmt * getCatchBody() const
Definition: StmtObjC.h:93
unsigned getNumHandlers() const
Definition: StmtCXX.h:106
Expr * getSubExpr() const
Definition: Expr.h:2140
NestedNameSpecifierLoc getQualifierLoc() const
Retrieves the nested-name-specifier that qualifies the type name, with source-location information...
Definition: ExprCXX.h:2556
This is a basic class for representing single OpenMP executable directive.
Definition: StmtOpenMP.h:34
SourceLocation getBuiltinLoc() const
getBuiltinLoc - Return the location of the __builtin_astype token.
Definition: Expr.h:5969
bool hasUnresolvedUsing() const
Determine whether the lookup results contain an unresolved using declaration.
Definition: ExprCXX.h:3887
CastKind getCastKind() const
Definition: Expr.h:3442
Expr * getSubExpr(unsigned Idx) const
Definition: Expr.h:5200
SourceLocation getOperatorLoc() const
Retrieve the location of the cast operator keyword, e.g., static_cast.
Definition: ExprCXX.h:394
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
Definition: ExprCXX.h:2126
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c dictionary literal.
Definition: ExprObjC.h:360
Expr * getLHS()
Definition: Stmt.h:1655
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit...
Definition: ExprCXX.h:628
Represents a C++2a __builtin_bit_cast(T, v) expression.
Definition: ExprCXX.h:4862
SourceLocation getEllipsisLoc() const
Retrieve the location of the ellipsis that describes this pack expansion.
Definition: ExprCXX.h:4074
Represents a call to a member function that may be written either with member call syntax (e...
Definition: ExprCXX.h:177
SourceLocation getExceptLoc() const
Definition: Stmt.h:3316
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprObjC.h:382
SourceLocation getLParenLoc() const
Definition: ExprOpenMP.h:192
Stmt * getElse()
Definition: Stmt.h:2000
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
Definition: Stmt.h:1291
SourceLocation getColonLocFirst() const
Definition: ExprOpenMP.h:118
DeclarationNameInfo getDirectiveName() const
Return name of the directive.
Definition: StmtOpenMP.h:1685
SourceLocation getLBraceLoc() const
Definition: Stmt.h:3215
A CXXFunctionalCastExpr record.
Definition: ASTBitCodes.h:1819
Expr * getCond()
Definition: Stmt.h:2181
SourceLocation getStrTokenLoc(unsigned TokNum) const
Get one of the string literal token.
Definition: Expr.h:1902
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:2153
SourceLocation RAngleLoc
The source location of the right angle bracket (&#39;>&#39;).
Definition: TemplateBase.h:663
SourceLocation getRParenLoc() const
Definition: Expr.h:4295
An ObjCEncodeExpr record.
Definition: ASTBitCodes.h:1718
SourceLocation getRParenLoc() const
Definition: ExprObjC.h:425
SourceLocation getSuperLoc() const
Retrieve the location of the &#39;super&#39; keyword for a class or instance message to &#39;super&#39;, otherwise an invalid source location.
Definition: ExprObjC.h:1291
This represents &#39;#pragma omp taskwait&#39; directive.
Definition: StmtOpenMP.h:2162
SourceLocation getAtLoc() const
Definition: ExprObjC.h:423
SourceRange getSourceRange() const
Definition: ExprObjC.h:1705
bool isPascal() const
Definition: Expr.h:1879
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:6150
UnaryExprOrTypeTrait getKind() const
Definition: Expr.h:2510
bool isArray() const
Definition: ExprCXX.h:2249
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition: ExprObjC.h:504
bool isValueDependent() const
Determines whether the value of this expression depends on.
Definition: Expr.h:168
SourceLocation getLParenLoc() const
Definition: Expr.h:4293
SourceLocation getGotoLoc() const
Definition: Stmt.h:2588
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:1742
const StringLiteral * getOutputConstraintLiteral(unsigned i) const
Definition: Stmt.h:3070
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:3542
Stmt * getCapturedStmt()
Retrieve the statement being captured.
Definition: Stmt.h:3568
void AddAttributes(ArrayRef< const Attr *> Attrs)
Emit a list of attributes.
Definition: ASTWriter.cpp:4251
SourceLocation getAtCatchLoc() const
Definition: StmtObjC.h:105
CharacterKind getKind() const
Definition: Expr.h:1601
This represents &#39;#pragma omp target&#39; directive.
Definition: StmtOpenMP.h:2559
Expr * getInputExpr(unsigned i)
Definition: Stmt.cpp:511
void AddSourceLocation(SourceLocation Loc)
Emit a source location.
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:2057
bool isParenTypeId() const
Definition: ExprCXX.h:2279
SourceLocation getEndLoc() const
Definition: Stmt.h:3217
NullStmtBitfields NullStmtBits
Definition: Stmt.h:1005
Expr * getSubExpr()
Definition: ExprObjC.h:144
An expression trait intrinsic.
Definition: ExprCXX.h:2810
ArrayRef< Expr * > exprs()
Definition: Expr.h:5494
const ObjCMethodDecl * getMethodDecl() const
Definition: ExprObjC.h:1346
An AtomicExpr record.
Definition: ASTBitCodes.h:1703
A static requirement that can be used in a requires-expression to check properties of types and expre...
Definition: ExprConcepts.h:149
VarDecl * getConditionVariable()
Retrieve the variable declared in this "switch" statement, if any.
Definition: Stmt.cpp:1077
DeclStmt * getConditionVariableDeclStmt()
If this WhileStmt has a condition variable, return the faux DeclStmt associated with the creation of ...
Definition: Stmt.h:2401
This represents &#39;#pragma omp ordered&#39; directive.
Definition: StmtOpenMP.h:2379
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition: Expr.h:4269
void AddAPFloat(const llvm::APFloat &Value)
Emit a floating-point value.
Definition: ASTWriter.cpp:5120
This represents &#39;#pragma omp target update&#39; directive.
Definition: StmtOpenMP.h:3612
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:128
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:3321
bool isArgumentType() const
Definition: Expr.h:2520
SourceLocation getKeywordLoc() const
Definition: Stmt.h:1545
MSGuidDecl * getGuidDecl() const
Definition: ExprCXX.h:1092
Expr * getArrayFiller()
If this initializer list initializes an array with more elements than there are initializers in the l...
Definition: Expr.h:4806
SourceLocation getStarLoc() const
Definition: Stmt.h:2629
unsigned numOfIterators() const
Returns number of iterator definitions.
Definition: ExprOpenMP.h:399
bool passAlignment() const
Indicates whether the required alignment should be implicitly passed to the allocation function...
Definition: ExprCXX.h:2319
bool isPartOfExplicitCast() const
Definition: Expr.h:3575
FunctionDecl * getOperatorDelete() const
Definition: ExprCXX.h:2246
This represents &#39;#pragma omp parallel master taskloop simd&#39; directive.
Definition: StmtOpenMP.h:3481
Representation of a Microsoft __if_exists or __if_not_exists statement with a dependent name...
Definition: StmtCXX.h:252
unsigned getExprImplicitCastAbbrev() const
Definition: ASTWriter.h:704
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
Definition: Expr.cpp:227
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
Definition: Expr.h:1409
void AddDeclarationNameInfo(const DeclarationNameInfo &NameInfo)
Definition: ASTWriter.cpp:5572
void VisitStmt(Stmt *S)
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:3178
Expr * Value
The value of the dictionary element.
Definition: ExprObjC.h:268
const Expr * getInitializer() const
Definition: Expr.h:3350
Expr * getLHS() const
Definition: Expr.h:3776
void AddTemplateKWAndArgsInfo(const ASTTemplateKWAndArgsInfo &ArgInfo, const TemplateArgumentLoc *Args)
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:3974
SourceLocation getLocation() const LLVM_READONLY
Definition: ExprCXX.h:1692
A POD class for pairing a NamedDecl* with an access specifier.
Represents a C11 generic selection.
Definition: Expr.h:5544
ArrayRef< TemplateArgument > getPartialArguments() const
Get.
Definition: ExprCXX.h:4207
const Expr * getBase() const
Definition: Expr.h:5843
Expr * getInstanceReceiver()
Returns the object expression (receiver) for an instance message, or null for a message that is not a...
Definition: ExprObjC.h:1250
bool isReversed() const
Determine whether this expression was rewritten in reverse form.
Definition: ExprCXX.h:320
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition: Expr.h:4224
SourceLocation getColonLoc(unsigned I) const
Gets the location of the first &#39;:&#39; in the range for the given iterator definition.
Definition: Expr.cpp:4772
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers...
Definition: ExprObjC.h:1625
Represents a reference to a function parameter pack or init-capture pack that has been substituted bu...
Definition: ExprCXX.h:4367
Represents a template argument.
Definition: TemplateBase.h:62
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
Definition: Expr.h:4165
SourceLocation getMemberLoc() const
Definition: ExprCXX.h:969
TypeSourceInfo * getDestroyedTypeInfo() const
Retrieve the source location information for the type being destroyed.
Definition: ExprCXX.h:2597
arg_iterator arg_end()
Definition: ExprObjC.h:1463
Expr * getFalseExpr() const
getFalseExpr - Return the subexpression which will be evaluated if the condnition evaluates to false;...
Definition: Expr.h:4181
NullStmt - This is the null statement ";": C99 6.8.3p3.
Definition: Stmt.h:1363
bool isTypeOperand() const
Definition: ExprCXX.h:865
StringRef getInputConstraint(unsigned i) const
Definition: Stmt.h:3246
SourceLocation getLocation() const
Definition: ExprCXX.h:729
unsigned getNumAssocs() const
The number of association expressions.
Definition: Expr.h:5710
Dataflow Directional Tag Classes.
bool isVolatile() const
Definition: Stmt.h:2846
An InitListExpr record.
Definition: ASTBitCodes.h:1649
VarDecl * getConditionVariable()
Retrieve the variable declared in this "while" statement, if any.
Definition: Stmt.cpp:1138
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:1947
SourceLocation getLocation() const
Definition: ExprObjC.h:759
RequiresExprBodyDecl * getBody() const
Definition: ExprConcepts.h:516
A CXXBoolLiteralExpr record.
Definition: ASTBitCodes.h:1831
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
Definition: ExprCXX.h:2385
IdentifierInfo * getOutputIdentifier(unsigned i) const
Definition: Stmt.h:3059
bool isSimple() const
Definition: Stmt.h:2843
OverloadedOperatorKind getOperator() const
Returns the kind of overloaded operator that this expression refers to.
Definition: ExprCXX.h:112
NonTypeTemplateParmDecl * getParameterPack() const
Retrieve the non-type template parameter pack being substituted.
Definition: ExprCXX.h:4327
MSPropertyDecl * getPropertyDecl() const
Definition: ExprCXX.h:967
static void addSubstitutionDiagnostic(ASTRecordWriter &Record, const concepts::Requirement::SubstitutionDiagnostic *D)
const Stmt * getFinallyBody() const
Definition: StmtObjC.h:139
An ExtVectorElementExpr record.
Definition: ASTBitCodes.h:1646
ArrayRef< const Attr * > getAttrs() const
Definition: Stmt.h:1878
bool isImplicit() const
Definition: ExprCXX.h:1149
This represents &#39;#pragma omp section&#39; directive.
Definition: StmtOpenMP.h:1469
This represents &#39;#pragma omp teams distribute&#39; directive.
Definition: StmtOpenMP.h:4027
QualType getSuperType() const
Retrieve the type referred to by &#39;super&#39;.
Definition: ExprObjC.h:1326
SourceLocation getBeginLoc() const
Definition: Expr.h:6358
SourceLocation EllipsisLoc
The location of the ellipsis, if this is a pack expansion.
Definition: ExprObjC.h:271
TypeSourceInfo * getTypeSourceInfo() const
Retrieve the type source information for the type being constructed.
Definition: ExprCXX.h:3455
AccessSpecifier getAccess() const
Definition: DeclBase.h:478
A runtime availability query.
Definition: ExprObjC.h:1686
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:4524
VarDecl *const * iterator
Iterators over the parameters which the parameter pack expanded into.
Definition: ExprCXX.h:4403
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
Definition: ExprCXX.h:511
This represents &#39;#pragma omp simd&#39; directive.
Definition: StmtOpenMP.h:1176
Stmt * getHandler() const
Definition: Stmt.h:3408
Represents a &#39;co_yield&#39; expression.
Definition: ExprCXX.h:4836
SourceLocation getLBraceLoc() const
Definition: Expr.h:4859
SourceLocation getSemiLoc() const
Definition: Stmt.h:1374
An ObjCAutoreleasePoolStmt record.
Definition: ASTBitCodes.h:1766
Expr * getOperand() const
Retrieve the operand of the &#39;co_return&#39; statement.
Definition: StmtCXX.h:480
A C++ addrspace_cast expression (currently only enabled for OpenCL).
Definition: ExprCXX.h:590
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition: ExprCXX.h:4038
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
Definition: ExprCXX.h:1541
bool isImplicit() const
Definition: ExprCXX.h:4777
A CXXDynamicCastExpr record.
Definition: ASTBitCodes.h:1807
const NestedNameSpecifierLoc & getNestedNameSpecifierLoc() const
Definition: ASTConcept.h:138
DependentScopeDeclRefExprBitfields DependentScopeDeclRefExprBits
Definition: Stmt.h:1057
const Expr * getSynchExpr() const
Definition: StmtObjC.h:305
Iterator range representation begin:end[:step].
Definition: ExprOpenMP.h:278
SourceLocation getParameterPackLocation() const
Get the location of the parameter pack.
Definition: ExprCXX.h:4399
semantics_iterator semantics_begin()
Definition: Expr.h:6084
bool isIfExists() const
Determine whether this is an __if_exists statement.
Definition: StmtCXX.h:277
SourceLocation getBeginLoc() const
Definition: Expr.h:4646
NestedNameSpecifierLoc getQualifierLoc() const
Definition: ExprCXX.h:970
ExplicitCastExpr - An explicit cast written in the source code.
Definition: Expr.h:3619
This represents &#39;#pragma omp atomic&#39; directive.
Definition: StmtOpenMP.h:2433
child_range children()
Definition: ExprCXX.h:4736
SourceLocation getLParenLoc() const
Definition: ExprObjC.h:1649
DeclStmt * getConditionVariableDeclStmt()
If this IfStmt has a condition variable, return the faux DeclStmt associated with the creation of tha...
Definition: Stmt.h:2035
void AddVersionTuple(const VersionTuple &Version)
Emit a version tuple.
An ObjCAtFinallyStmt record.
Definition: ASTBitCodes.h:1754
SourceLocation getRParenLoc() const
Definition: ExprObjC.h:526
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition: ExprCXX.h:872
CXXNewExprBitfields CXXNewExprBits
Definition: Stmt.h:1054
RequiresExprBitfields RequiresExprBits
Definition: Stmt.h:1068
llvm::APInt getValue() const
Definition: Expr.h:1468
Represents a __leave statement.
Definition: Stmt.h:3428
unsigned getCollapsedNumber() const
Get number of collapsed loops.
Definition: StmtOpenMP.h:928
LabelDecl * getLabel() const
Definition: Expr.h:4247
path_iterator path_end()
Definition: Expr.h:3469
iterator end() const
Definition: ExprCXX.h:4405
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition: ExprCXX.h:3984
SwitchStmt - This represents a &#39;switch&#39; stmt.
Definition: Stmt.h:2117
unsigned getByteLength() const
Definition: Expr.h:1866
SourceLocation getColonColonLoc() const
Retrieve the location of the &#39;::&#39; in a qualified pseudo-destructor expression.
Definition: ExprCXX.h:2585
SourceLocation getBeginLoc() const
Definition: ExprCXX.h:2435
arg_iterator arg_begin()
Definition: ExprObjC.h:1461
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source location information.
Definition: ExprCXX.h:3230
SourceLocation getRParenLoc() const
Definition: StmtObjC.h:54
child_range children()
Definition: Expr.h:6353
Represents the body of a coroutine.
Definition: StmtCXX.h:317
TemplateArgumentLoc * getTrailingTemplateArgumentLoc()
Return the optional template arguments.
Definition: ExprCXX.h:3967
Location wrapper for a TemplateArgument.
Definition: TemplateBase.h:457
Expr * getBase() const
Definition: ExprObjC.h:1507
Iterator for iterating over Stmt * arrays that contain only T *.
Definition: Stmt.h:1118
SourceLocation getBuiltinLoc() const
Definition: Expr.h:4335
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition: Expr.h:2574
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c array literal.
Definition: ExprObjC.h:229
SourceLocation getLeaveLoc() const
Definition: Stmt.h:3438
Represents Objective-C&#39;s collection statement.
Definition: StmtObjC.h:23
An ObjCAtSynchronizedStmt record.
Definition: ASTBitCodes.h:1760
arg_iterator arg_begin()
Definition: Expr.h:2963
unsigned getNumObjects() const
Definition: ExprCXX.h:3362
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:409
SourceLocation getLocation() const
Retrieve the location of this expression.
Definition: Expr.h:1147
void writeUInt32(uint32_t Value)
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:2282
Expr * getCond() const
getCond - Return the condition expression; this is defined in terms of the opaque value...
Definition: Expr.h:4169
Represents a call to a CUDA kernel function.
Definition: ExprCXX.h:232
SourceLocation getRParenLoc() const
Definition: Expr.h:4494
Represents a &#39;co_await&#39; expression.
Definition: ExprCXX.h:4751
bool isUnique() const
Definition: Expr.h:1183
TypeTraitExprBitfields TypeTraitExprBits
Definition: Stmt.h:1056
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
Definition: ASTConcept.h:77
bool isDelegateInitCall() const
isDelegateInitCall - Answers whether this message send has been tagged as a "delegate init call"...
Definition: ExprObjC.h:1403
Stmt * getInit()
Definition: Stmt.h:2202
A CXXMemberCallExpr record.
Definition: ASTBitCodes.h:1789
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
Definition: ExprCXX.h:2324
SourceRange getDirectInitRange() const
Definition: ExprCXX.h:2368
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the member name, with source location information...
Definition: ExprCXX.h:3658
Opcode getOpcode() const
Definition: Expr.h:2135
Expr * getArg(unsigned Arg)
Return the specified argument.
Definition: ExprCXX.h:1601
StringRef getBytes() const
Allow access to clients that need the byte representation, such as ASTWriterStmt::VisitStringLiteral(...
Definition: Expr.h:1846
Represents Objective-C&#39;s @finally statement.
Definition: StmtObjC.h:127
SourceLocation getRParenLoc() const
Definition: Stmt.h:2418
SourceLocation getDefaultLoc() const
Definition: Expr.h:5794
StringRef getAsmString() const
Definition: Stmt.h:3226
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:3644
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: Expr.h:3251
SourceLocation getColonLoc() const
Definition: Stmt.h:1547
Represents a base class of a C++ class.
Definition: DeclCXX.h:146
unsigned getNumClobbers() const
Definition: Stmt.h:2891
bool isImplicit() const
Definition: StmtCXX.h:489
SourceLocation getRParenLoc() const
Definition: Stmt.h:2551
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:548
child_range children()
Definition: ExprCXX.h:4824
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof...
Definition: ExprCXX.h:4202
Represents an expression that might suspend coroutine execution; either a co_await or co_yield expres...
Definition: ExprCXX.h:4666
DeclStmt * getRangeStmt()
Definition: StmtCXX.h:161
A ConvertVectorExpr record.
Definition: ASTBitCodes.h:1691
Expr * getRHS() const
Definition: Expr.h:4488
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:3415
SourceLocation getAsmLoc() const
Definition: Stmt.h:2840
GotoStmt - This represents a direct goto.
Definition: Stmt.h:2572
A use of a default initializer in a constructor or in aggregate initialization.
Definition: ExprCXX.h:1308
Expr * getTarget()
Definition: Stmt.h:2631
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition: Expr.h:4405
const SwitchCase * getNextSwitchCase() const
Definition: Stmt.h:1541
CapturedDecl * getCapturedDecl()
Retrieve the outlined function declaration.
Definition: Stmt.cpp:1386
bool isFreeIvar() const
Definition: ExprObjC.h:585
Expr * getCond()
Definition: Stmt.h:2463
QualType getSuperReceiverType() const
Definition: ExprObjC.h:763
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:967
ASTStmtWriter(ASTWriter &Writer, ASTWriter::RecordData &Record)
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition: Expr.h:3086
GNU array range designator.
Definition: ASTBitCodes.h:1977
SourceLocation getWhileLoc() const
Definition: Stmt.h:2476
SourceLocation getRBracketLoc() const
Definition: Expr.h:2704
An ArrayInitIndexExpr record.
Definition: ASTBitCodes.h:1664
A GCC-style AsmStmt record.
Definition: ASTBitCodes.h:1571
This represents &#39;#pragma omp target parallel&#39; directive.
Definition: StmtOpenMP.h:2776
ArrayRef< TemplateArgument > getTemplateArguments() const
Definition: ExprConcepts.h:94
ContinueStmt - This represents a continue.
Definition: Stmt.h:2660
SourceLocation getLParenLoc() const
Definition: ExprOpenMP.h:366
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:5337
SourceLocation getColonLoc() const
Definition: StmtCXX.h:203
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition: Expr.h:4444
Expr * getFilterExpr() const
Definition: Stmt.h:3319
SourceLocation getAttrLoc() const
Definition: Stmt.h:1877
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Definition: Expr.h:4127
CXXCatchStmt - This represents a C++ catch block.
Definition: StmtCXX.h:28
An index into an array.
Definition: Expr.h:2275
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr.type.conv]).
Definition: ExprCXX.h:1716
SourceLocation getRParenLoc() const
Definition: Expr.h:5499
An object for streaming information to a record.
An ObjCAtCatchStmt record.
Definition: ASTBitCodes.h:1751
Expr * getRHS() const
Definition: Expr.h:4100
WhileStmt - This represents a &#39;while&#39; stmt.
Definition: Stmt.h:2308
Represents the specialization of a concept - evaluates to a prvalue of type bool. ...
Definition: ExprConcepts.h:40
SourceRange getParenOrBraceRange() const
Definition: ExprCXX.h:1618
Field designator where the field has been resolved to a declaration.
Definition: ASTBitCodes.h:1971
unsigned getNumConcatenated() const
getNumConcatenated - Get the number of string literal tokens that were concatenated in translation ph...
Definition: Expr.h:1897
OMPIteratorHelperData & getHelper(unsigned I)
Fetches helper data for the specified iteration space.
Definition: Expr.cpp:4788
SourceLocation getLParenLoc() const
Definition: ExprCXX.h:1756
bool containsUnexpandedParameterPack() const
Whether this expression contains an unexpanded parameter pack (for C++11 variadic templates)...
Definition: Expr.h:232
child_range children()
Definition: StmtCXX.h:429
SourceLocation getAtSynchronizedLoc() const
Definition: StmtObjC.h:294
A CXXInheritedCtorInitExpr record.
Definition: ASTBitCodes.h:1798
const DeclContext * getUsedContext() const
Definition: ExprCXX.h:1345
CompoundStmt * getTryBlock()
Definition: StmtCXX.h:99
Writes an AST file containing the contents of a translation unit.
Definition: ASTWriter.h:98
SourceLocation getBreakLoc() const
Definition: Stmt.h:2699
bool shouldCopy() const
shouldCopy - True if we should do the &#39;copy&#39; part of the copy-restore.
Definition: ExprObjC.h:1594
The receiver is a class.
Definition: ExprObjC.h:1088
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:3615
void AddCXXBaseSpecifier(const CXXBaseSpecifier &Base)
Emit a C++ base specifier.
Definition: ASTWriter.cpp:5688
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:324
bool isGlobalDelete() const
Definition: ExprCXX.h:2410
This represents &#39;#pragma omp taskloop simd&#39; directive.
Definition: StmtOpenMP.h:3195
void AddASTTemplateArgumentListInfo(const ASTTemplateArgumentListInfo *ASTTemplArgList)
Emits an AST template argument list info.
Definition: ASTWriter.cpp:5667
SourceLocation getBuiltinLoc() const
getBuiltinLoc - Return the location of the __builtin_convertvector token.
Definition: Expr.h:4416
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:3635
StringLiteral - This represents a string literal expression, e.g.
Definition: Expr.h:1755
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2730
SourceRange getTypeIdParens() const
Definition: ExprCXX.h:2280
Expr * getPattern()
Retrieve the pattern of the pack expansion.
Definition: ExprCXX.h:4067
MatrixSubscriptExpr - Matrix subscript expression for the MatrixType extension.
Definition: Expr.h:2652
RetTy Visit(PTR(Stmt) S, ParamTys... P)
Definition: StmtVisitor.h:43
Expr * getLHS() const
Definition: Expr.h:4486
bool hasTemplateKWAndArgsInfo() const
Definition: ExprCXX.h:2911
Abstract class common to all of the C++ "named"/"keyword" casts.
Definition: ExprCXX.h:363
This represents &#39;#pragma omp sections&#39; directive.
Definition: StmtOpenMP.h:1392
SourceLocation getIteratorKwLoc() const
Definition: ExprOpenMP.h:372
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition: ExprObjC.h:88
bool isObjectReceiver() const
Definition: ExprObjC.h:771
unsigned getNumComponents() const
Definition: Expr.h:2433
This represents &#39;#pragma omp target data&#39; directive.
Definition: StmtOpenMP.h:2613
const ParmVarDecl * getParam() const
Definition: ExprCXX.h:1266
OpenMPDirectiveKind getCancelRegion() const
Get cancellation region for the current cancellation point.
Definition: StmtOpenMP.h:3106
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument for this lambda expression...
Definition: ExprCXX.h:1994
A rewritten comparison expression that was originally written using operator syntax.
Definition: ExprCXX.h:284
capture_range captures()
Definition: Stmt.h:3602
A reference to a declared variable, function, enum, etc.
Definition: Expr.h:1213
SourceLocation getAssignLoc(unsigned I) const
Gets the location of &#39;=&#39; for the given iterator definition.
Definition: Expr.cpp:4766
Expr * getRHS() const
Definition: Expr.h:3778
bool containsErrors() const
Whether this expression contains subexpressions which had errors, e.g.
Definition: Expr.h:238
NestedNameSpecifierLoc getQualifierLoc() const
Fetches the nested-name qualifier with source-location information, if one was given.
Definition: ExprCXX.h:2988
BreakStmt - This represents a break.
Definition: Stmt.h:2690
Expr * Upper
Normalized upper bound.
Definition: ExprOpenMP.h:240
SourceLocation getReceiverLocation() const
Definition: ExprObjC.h:761
const VarDecl * getCatchParamDecl() const
Definition: StmtObjC.h:97
unsigned getNumLabels() const
Definition: Stmt.h:3118
SourceLocation getLocation() const
Definition: Expr.h:1600
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
Definition: Expr.h:4824
bool isConditionDependent() const
Definition: Expr.h:4474
Stmt * getSubStmt()
Definition: Stmt.h:1819
SourceLocation getBridgeKeywordLoc() const
The location of the bridge keyword.
Definition: ExprObjC.h:1660
bool hadMultipleCandidates() const
Whether the referred constructor was resolved from an overloaded set having size greater than 1...
Definition: