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  if (HasElse)
156  Record.AddSourceLocation(S->getElseLoc());
157 
158  Code = serialization::STMT_IF;
159 }
160 
161 void ASTStmtWriter::VisitSwitchStmt(SwitchStmt *S) {
162  VisitStmt(S);
163 
164  bool HasInit = S->getInit() != nullptr;
165  bool HasVar = S->getConditionVariableDeclStmt() != nullptr;
166  Record.push_back(HasInit);
167  Record.push_back(HasVar);
168  Record.push_back(S->isAllEnumCasesCovered());
169 
170  Record.AddStmt(S->getCond());
171  Record.AddStmt(S->getBody());
172  if (HasInit)
173  Record.AddStmt(S->getInit());
174  if (HasVar)
175  Record.AddDeclRef(S->getConditionVariable());
176 
177  Record.AddSourceLocation(S->getSwitchLoc());
178 
179  for (SwitchCase *SC = S->getSwitchCaseList(); SC;
180  SC = SC->getNextSwitchCase())
181  Record.push_back(Writer.RecordSwitchCaseID(SC));
183 }
184 
185 void ASTStmtWriter::VisitWhileStmt(WhileStmt *S) {
186  VisitStmt(S);
187 
188  bool HasVar = S->getConditionVariableDeclStmt() != nullptr;
189  Record.push_back(HasVar);
190 
191  Record.AddStmt(S->getCond());
192  Record.AddStmt(S->getBody());
193  if (HasVar)
194  Record.AddDeclRef(S->getConditionVariable());
195 
196  Record.AddSourceLocation(S->getWhileLoc());
197  Record.AddSourceLocation(S->getLParenLoc());
198  Record.AddSourceLocation(S->getRParenLoc());
200 }
201 
202 void ASTStmtWriter::VisitDoStmt(DoStmt *S) {
203  VisitStmt(S);
204  Record.AddStmt(S->getCond());
205  Record.AddStmt(S->getBody());
206  Record.AddSourceLocation(S->getDoLoc());
207  Record.AddSourceLocation(S->getWhileLoc());
208  Record.AddSourceLocation(S->getRParenLoc());
209  Code = serialization::STMT_DO;
210 }
211 
212 void ASTStmtWriter::VisitForStmt(ForStmt *S) {
213  VisitStmt(S);
214  Record.AddStmt(S->getInit());
215  Record.AddStmt(S->getCond());
216  Record.AddDeclRef(S->getConditionVariable());
217  Record.AddStmt(S->getInc());
218  Record.AddStmt(S->getBody());
219  Record.AddSourceLocation(S->getForLoc());
220  Record.AddSourceLocation(S->getLParenLoc());
221  Record.AddSourceLocation(S->getRParenLoc());
223 }
224 
225 void ASTStmtWriter::VisitGotoStmt(GotoStmt *S) {
226  VisitStmt(S);
227  Record.AddDeclRef(S->getLabel());
228  Record.AddSourceLocation(S->getGotoLoc());
229  Record.AddSourceLocation(S->getLabelLoc());
231 }
232 
233 void ASTStmtWriter::VisitIndirectGotoStmt(IndirectGotoStmt *S) {
234  VisitStmt(S);
235  Record.AddSourceLocation(S->getGotoLoc());
236  Record.AddSourceLocation(S->getStarLoc());
237  Record.AddStmt(S->getTarget());
239 }
240 
241 void ASTStmtWriter::VisitContinueStmt(ContinueStmt *S) {
242  VisitStmt(S);
243  Record.AddSourceLocation(S->getContinueLoc());
245 }
246 
247 void ASTStmtWriter::VisitBreakStmt(BreakStmt *S) {
248  VisitStmt(S);
249  Record.AddSourceLocation(S->getBreakLoc());
251 }
252 
253 void ASTStmtWriter::VisitReturnStmt(ReturnStmt *S) {
254  VisitStmt(S);
255 
256  bool HasNRVOCandidate = S->getNRVOCandidate() != nullptr;
257  Record.push_back(HasNRVOCandidate);
258 
259  Record.AddStmt(S->getRetValue());
260  if (HasNRVOCandidate)
261  Record.AddDeclRef(S->getNRVOCandidate());
262 
263  Record.AddSourceLocation(S->getReturnLoc());
265 }
266 
267 void ASTStmtWriter::VisitDeclStmt(DeclStmt *S) {
268  VisitStmt(S);
269  Record.AddSourceLocation(S->getBeginLoc());
270  Record.AddSourceLocation(S->getEndLoc());
271  DeclGroupRef DG = S->getDeclGroup();
272  for (DeclGroupRef::iterator D = DG.begin(), DEnd = DG.end(); D != DEnd; ++D)
273  Record.AddDeclRef(*D);
275 }
276 
277 void ASTStmtWriter::VisitAsmStmt(AsmStmt *S) {
278  VisitStmt(S);
279  Record.push_back(S->getNumOutputs());
280  Record.push_back(S->getNumInputs());
281  Record.push_back(S->getNumClobbers());
282  Record.AddSourceLocation(S->getAsmLoc());
283  Record.push_back(S->isVolatile());
284  Record.push_back(S->isSimple());
285 }
286 
287 void ASTStmtWriter::VisitGCCAsmStmt(GCCAsmStmt *S) {
288  VisitAsmStmt(S);
289  Record.push_back(S->getNumLabels());
290  Record.AddSourceLocation(S->getRParenLoc());
291  Record.AddStmt(S->getAsmString());
292 
293  // Outputs
294  for (unsigned I = 0, N = S->getNumOutputs(); I != N; ++I) {
296  Record.AddStmt(S->getOutputConstraintLiteral(I));
297  Record.AddStmt(S->getOutputExpr(I));
298  }
299 
300  // Inputs
301  for (unsigned I = 0, N = S->getNumInputs(); I != N; ++I) {
302  Record.AddIdentifierRef(S->getInputIdentifier(I));
303  Record.AddStmt(S->getInputConstraintLiteral(I));
304  Record.AddStmt(S->getInputExpr(I));
305  }
306 
307  // Clobbers
308  for (unsigned I = 0, N = S->getNumClobbers(); I != N; ++I)
309  Record.AddStmt(S->getClobberStringLiteral(I));
310 
311  // Labels
312  for (auto *E : S->labels()) Record.AddStmt(E);
313 
315 }
316 
317 void ASTStmtWriter::VisitMSAsmStmt(MSAsmStmt *S) {
318  VisitAsmStmt(S);
319  Record.AddSourceLocation(S->getLBraceLoc());
320  Record.AddSourceLocation(S->getEndLoc());
321  Record.push_back(S->getNumAsmToks());
322  Record.AddString(S->getAsmString());
323 
324  // Tokens
325  for (unsigned I = 0, N = S->getNumAsmToks(); I != N; ++I) {
326  // FIXME: Move this to ASTRecordWriter?
327  Writer.AddToken(S->getAsmToks()[I], Record.getRecordData());
328  }
329 
330  // Clobbers
331  for (unsigned I = 0, N = S->getNumClobbers(); I != N; ++I) {
332  Record.AddString(S->getClobber(I));
333  }
334 
335  // Outputs
336  for (unsigned I = 0, N = S->getNumOutputs(); I != N; ++I) {
337  Record.AddStmt(S->getOutputExpr(I));
338  Record.AddString(S->getOutputConstraint(I));
339  }
340 
341  // Inputs
342  for (unsigned I = 0, N = S->getNumInputs(); I != N; ++I) {
343  Record.AddStmt(S->getInputExpr(I));
344  Record.AddString(S->getInputConstraint(I));
345  }
346 
348 }
349 
350 void ASTStmtWriter::VisitCoroutineBodyStmt(CoroutineBodyStmt *CoroStmt) {
351  VisitStmt(CoroStmt);
352  Record.push_back(CoroStmt->getParamMoves().size());
353  for (Stmt *S : CoroStmt->children())
354  Record.AddStmt(S);
356 }
357 
358 void ASTStmtWriter::VisitCoreturnStmt(CoreturnStmt *S) {
359  VisitStmt(S);
360  Record.AddSourceLocation(S->getKeywordLoc());
361  Record.AddStmt(S->getOperand());
362  Record.AddStmt(S->getPromiseCall());
363  Record.push_back(S->isImplicit());
365 }
366 
367 void ASTStmtWriter::VisitCoroutineSuspendExpr(CoroutineSuspendExpr *E) {
368  VisitExpr(E);
369  Record.AddSourceLocation(E->getKeywordLoc());
370  for (Stmt *S : E->children())
371  Record.AddStmt(S);
372  Record.AddStmt(E->getOpaqueValue());
373 }
374 
375 void ASTStmtWriter::VisitCoawaitExpr(CoawaitExpr *E) {
376  VisitCoroutineSuspendExpr(E);
377  Record.push_back(E->isImplicit());
379 }
380 
381 void ASTStmtWriter::VisitCoyieldExpr(CoyieldExpr *E) {
382  VisitCoroutineSuspendExpr(E);
384 }
385 
386 void ASTStmtWriter::VisitDependentCoawaitExpr(DependentCoawaitExpr *E) {
387  VisitExpr(E);
388  Record.AddSourceLocation(E->getKeywordLoc());
389  for (Stmt *S : E->children())
390  Record.AddStmt(S);
392 }
393 
394 static void
396  const ASTConstraintSatisfaction &Satisfaction) {
397  Record.push_back(Satisfaction.IsSatisfied);
398  if (!Satisfaction.IsSatisfied) {
399  Record.push_back(Satisfaction.NumRecords);
400  for (const auto &DetailRecord : Satisfaction) {
401  Record.AddStmt(const_cast<Expr *>(DetailRecord.first));
402  auto *E = DetailRecord.second.dyn_cast<Expr *>();
403  Record.push_back(E == nullptr);
404  if (E)
405  Record.AddStmt(E);
406  else {
407  auto *Diag = DetailRecord.second.get<std::pair<SourceLocation,
408  StringRef> *>();
409  Record.AddSourceLocation(Diag->first);
410  Record.AddString(Diag->second);
411  }
412  }
413  }
414 }
415 
416 static void
418  ASTRecordWriter &Record,
420  Record.AddString(D->SubstitutedEntity);
421  Record.AddSourceLocation(D->DiagLoc);
422  Record.AddString(D->DiagMessage);
423 }
424 
425 void ASTStmtWriter::VisitConceptSpecializationExpr(
427  VisitExpr(E);
429  Record.push_back(TemplateArgs.size());
431  Record.AddSourceLocation(E->getTemplateKWLoc());
433  Record.AddDeclRef(E->getNamedConcept());
434  Record.AddDeclRef(E->getFoundDecl());
436  for (const TemplateArgument &Arg : TemplateArgs)
437  Record.AddTemplateArgument(Arg);
438  if (!E->isValueDependent())
440 
442 }
443 
444 void ASTStmtWriter::VisitRequiresExpr(RequiresExpr *E) {
445  VisitExpr(E);
446  Record.push_back(E->getLocalParameters().size());
447  Record.push_back(E->getRequirements().size());
448  Record.AddSourceLocation(E->RequiresExprBits.RequiresKWLoc);
449  Record.push_back(E->RequiresExprBits.IsSatisfied);
450  Record.AddDeclRef(E->getBody());
451  for (ParmVarDecl *P : E->getLocalParameters())
452  Record.AddDeclRef(P);
453  for (concepts::Requirement *R : E->getRequirements()) {
454  if (auto *TypeReq = dyn_cast<concepts::TypeRequirement>(R)) {
456  Record.push_back(TypeReq->Status);
458  addSubstitutionDiagnostic(Record, TypeReq->getSubstitutionDiagnostic());
459  else
460  Record.AddTypeSourceInfo(TypeReq->getType());
461  } else if (auto *ExprReq = dyn_cast<concepts::ExprRequirement>(R)) {
462  Record.push_back(ExprReq->getKind());
463  Record.push_back(ExprReq->Status);
464  if (ExprReq->isExprSubstitutionFailure()) {
466  ExprReq->Value.get<concepts::Requirement::SubstitutionDiagnostic *>());
467  } else
468  Record.AddStmt(ExprReq->Value.get<Expr *>());
469  if (ExprReq->getKind() == concepts::Requirement::RK_Compound) {
470  Record.AddSourceLocation(ExprReq->NoexceptLoc);
471  const auto &RetReq = ExprReq->getReturnTypeRequirement();
472  if (RetReq.isSubstitutionFailure()) {
473  Record.push_back(2);
474  addSubstitutionDiagnostic(Record, RetReq.getSubstitutionDiagnostic());
475  } else if (RetReq.isTypeConstraint()) {
476  Record.push_back(1);
478  RetReq.getTypeConstraintTemplateParameterList());
479  if (ExprReq->Status >=
481  Record.AddStmt(
482  ExprReq->getReturnTypeRequirementSubstitutedConstraintExpr());
483  } else {
484  assert(RetReq.isEmpty());
485  Record.push_back(0);
486  }
487  }
488  } else {
489  auto *NestedReq = cast<concepts::NestedRequirement>(R);
491  Record.push_back(NestedReq->isSubstitutionFailure());
492  if (NestedReq->isSubstitutionFailure()){
494  NestedReq->getSubstitutionDiagnostic());
495  } else {
496  Record.AddStmt(NestedReq->Value.get<Expr *>());
497  if (!NestedReq->isDependent())
498  addConstraintSatisfaction(Record, *NestedReq->Satisfaction);
499  }
500  }
501  }
502  Record.AddSourceLocation(E->getEndLoc());
503 
505 }
506 
507 
508 void ASTStmtWriter::VisitCapturedStmt(CapturedStmt *S) {
509  VisitStmt(S);
510  // NumCaptures
511  Record.push_back(std::distance(S->capture_begin(), S->capture_end()));
512 
513  // CapturedDecl and captured region kind
514  Record.AddDeclRef(S->getCapturedDecl());
515  Record.push_back(S->getCapturedRegionKind());
516 
517  Record.AddDeclRef(S->getCapturedRecordDecl());
518 
519  // Capture inits
520  for (auto *I : S->capture_inits())
521  Record.AddStmt(I);
522 
523  // Body
524  Record.AddStmt(S->getCapturedStmt());
525 
526  // Captures
527  for (const auto &I : S->captures()) {
528  if (I.capturesThis() || I.capturesVariableArrayType())
529  Record.AddDeclRef(nullptr);
530  else
531  Record.AddDeclRef(I.getCapturedVar());
532  Record.push_back(I.getCaptureKind());
533  Record.AddSourceLocation(I.getLocation());
534  }
535 
537 }
538 
539 void ASTStmtWriter::VisitExpr(Expr *E) {
540  VisitStmt(E);
541  Record.AddTypeRef(E->getType());
542  Record.push_back(E->isTypeDependent());
543  Record.push_back(E->isValueDependent());
544  Record.push_back(E->isInstantiationDependent());
546  Record.push_back(E->containsErrors());
547  Record.push_back(E->getValueKind());
548  Record.push_back(E->getObjectKind());
549 }
550 
551 void ASTStmtWriter::VisitConstantExpr(ConstantExpr *E) {
552  VisitExpr(E);
553  Record.push_back(E->ConstantExprBits.ResultKind);
554 
555  Record.push_back(E->ConstantExprBits.APValueKind);
556  Record.push_back(E->ConstantExprBits.IsUnsigned);
557  Record.push_back(E->ConstantExprBits.BitWidth);
558  // HasCleanup not serialized since we can just query the APValue.
559  Record.push_back(E->ConstantExprBits.IsImmediateInvocation);
560 
561  switch (E->ConstantExprBits.ResultKind) {
563  break;
565  Record.push_back(E->Int64Result());
566  break;
568  Record.AddAPValue(E->APValueResult());
569  break;
570  default:
571  llvm_unreachable("unexpected ResultKind!");
572  }
573 
574  Record.AddStmt(E->getSubExpr());
576 }
577 
578 void ASTStmtWriter::VisitPredefinedExpr(PredefinedExpr *E) {
579  VisitExpr(E);
580 
581  bool HasFunctionName = E->getFunctionName() != nullptr;
582  Record.push_back(HasFunctionName);
583  Record.push_back(E->getIdentKind()); // FIXME: stable encoding
584  Record.AddSourceLocation(E->getLocation());
585  if (HasFunctionName)
586  Record.AddStmt(E->getFunctionName());
588 }
589 
590 void ASTStmtWriter::VisitDeclRefExpr(DeclRefExpr *E) {
591  VisitExpr(E);
592 
593  Record.push_back(E->hasQualifier());
594  Record.push_back(E->getDecl() != E->getFoundDecl());
595  Record.push_back(E->hasTemplateKWAndArgsInfo());
596  Record.push_back(E->hadMultipleCandidates());
598  Record.push_back(E->isNonOdrUse());
599 
600  if (E->hasTemplateKWAndArgsInfo()) {
601  unsigned NumTemplateArgs = E->getNumTemplateArgs();
602  Record.push_back(NumTemplateArgs);
603  }
604 
606 
607  if ((!E->hasTemplateKWAndArgsInfo()) && (!E->hasQualifier()) &&
608  (E->getDecl() == E->getFoundDecl()) &&
611  AbbrevToUse = Writer.getDeclRefExprAbbrev();
612  }
613 
614  if (E->hasQualifier())
616 
617  if (E->getDecl() != E->getFoundDecl())
618  Record.AddDeclRef(E->getFoundDecl());
619 
620  if (E->hasTemplateKWAndArgsInfo())
621  AddTemplateKWAndArgsInfo(*E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
622  E->getTrailingObjects<TemplateArgumentLoc>());
623 
624  Record.AddDeclRef(E->getDecl());
625  Record.AddSourceLocation(E->getLocation());
626  Record.AddDeclarationNameLoc(E->DNLoc, E->getDecl()->getDeclName());
628 }
629 
630 void ASTStmtWriter::VisitIntegerLiteral(IntegerLiteral *E) {
631  VisitExpr(E);
632  Record.AddSourceLocation(E->getLocation());
633  Record.AddAPInt(E->getValue());
634 
635  if (E->getValue().getBitWidth() == 32) {
636  AbbrevToUse = Writer.getIntegerLiteralAbbrev();
637  }
638 
640 }
641 
642 void ASTStmtWriter::VisitFixedPointLiteral(FixedPointLiteral *E) {
643  VisitExpr(E);
644  Record.AddSourceLocation(E->getLocation());
645  Record.push_back(E->getScale());
646  Record.AddAPInt(E->getValue());
648 }
649 
650 void ASTStmtWriter::VisitFloatingLiteral(FloatingLiteral *E) {
651  VisitExpr(E);
652  Record.push_back(E->getRawSemantics());
653  Record.push_back(E->isExact());
654  Record.AddAPFloat(E->getValue());
655  Record.AddSourceLocation(E->getLocation());
657 }
658 
659 void ASTStmtWriter::VisitImaginaryLiteral(ImaginaryLiteral *E) {
660  VisitExpr(E);
661  Record.AddStmt(E->getSubExpr());
663 }
664 
665 void ASTStmtWriter::VisitStringLiteral(StringLiteral *E) {
666  VisitExpr(E);
667 
668  // Store the various bits of data of StringLiteral.
669  Record.push_back(E->getNumConcatenated());
670  Record.push_back(E->getLength());
671  Record.push_back(E->getCharByteWidth());
672  Record.push_back(E->getKind());
673  Record.push_back(E->isPascal());
674 
675  // Store the trailing array of SourceLocation.
676  for (unsigned I = 0, N = E->getNumConcatenated(); I != N; ++I)
677  Record.AddSourceLocation(E->getStrTokenLoc(I));
678 
679  // Store the trailing array of char holding the string data.
680  StringRef StrData = E->getBytes();
681  for (unsigned I = 0, N = E->getByteLength(); I != N; ++I)
682  Record.push_back(StrData[I]);
683 
685 }
686 
687 void ASTStmtWriter::VisitCharacterLiteral(CharacterLiteral *E) {
688  VisitExpr(E);
689  Record.push_back(E->getValue());
690  Record.AddSourceLocation(E->getLocation());
691  Record.push_back(E->getKind());
692 
693  AbbrevToUse = Writer.getCharacterLiteralAbbrev();
694 
696 }
697 
698 void ASTStmtWriter::VisitParenExpr(ParenExpr *E) {
699  VisitExpr(E);
700  Record.AddSourceLocation(E->getLParen());
701  Record.AddSourceLocation(E->getRParen());
702  Record.AddStmt(E->getSubExpr());
704 }
705 
706 void ASTStmtWriter::VisitParenListExpr(ParenListExpr *E) {
707  VisitExpr(E);
708  Record.push_back(E->getNumExprs());
709  for (auto *SubStmt : E->exprs())
710  Record.AddStmt(SubStmt);
711  Record.AddSourceLocation(E->getLParenLoc());
712  Record.AddSourceLocation(E->getRParenLoc());
714 }
715 
716 void ASTStmtWriter::VisitUnaryOperator(UnaryOperator *E) {
717  VisitExpr(E);
718  bool HasFPFeatures = E->hasStoredFPFeatures();
719  // Write this first for easy access when deserializing, as they affect the
720  // size of the UnaryOperator.
721  Record.push_back(HasFPFeatures);
722  Record.AddStmt(E->getSubExpr());
723  Record.push_back(E->getOpcode()); // FIXME: stable encoding
724  Record.AddSourceLocation(E->getOperatorLoc());
725  Record.push_back(E->canOverflow());
726  if (HasFPFeatures)
729 }
730 
731 void ASTStmtWriter::VisitOffsetOfExpr(OffsetOfExpr *E) {
732  VisitExpr(E);
733  Record.push_back(E->getNumComponents());
734  Record.push_back(E->getNumExpressions());
735  Record.AddSourceLocation(E->getOperatorLoc());
736  Record.AddSourceLocation(E->getRParenLoc());
738  for (unsigned I = 0, N = E->getNumComponents(); I != N; ++I) {
739  const OffsetOfNode &ON = E->getComponent(I);
740  Record.push_back(ON.getKind()); // FIXME: Stable encoding
742  Record.AddSourceLocation(ON.getSourceRange().getEnd());
743  switch (ON.getKind()) {
744  case OffsetOfNode::Array:
745  Record.push_back(ON.getArrayExprIndex());
746  break;
747 
748  case OffsetOfNode::Field:
749  Record.AddDeclRef(ON.getField());
750  break;
751 
753  Record.AddIdentifierRef(ON.getFieldName());
754  break;
755 
756  case OffsetOfNode::Base:
757  Record.AddCXXBaseSpecifier(*ON.getBase());
758  break;
759  }
760  }
761  for (unsigned I = 0, N = E->getNumExpressions(); I != N; ++I)
762  Record.AddStmt(E->getIndexExpr(I));
764 }
765 
766 void ASTStmtWriter::VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *E) {
767  VisitExpr(E);
768  Record.push_back(E->getKind());
769  if (E->isArgumentType())
771  else {
772  Record.push_back(0);
773  Record.AddStmt(E->getArgumentExpr());
774  }
775  Record.AddSourceLocation(E->getOperatorLoc());
776  Record.AddSourceLocation(E->getRParenLoc());
778 }
779 
780 void ASTStmtWriter::VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
781  VisitExpr(E);
782  Record.AddStmt(E->getLHS());
783  Record.AddStmt(E->getRHS());
784  Record.AddSourceLocation(E->getRBracketLoc());
786 }
787 
788 void ASTStmtWriter::VisitMatrixSubscriptExpr(MatrixSubscriptExpr *E) {
789  VisitExpr(E);
790  Record.AddStmt(E->getBase());
791  Record.AddStmt(E->getRowIdx());
792  Record.AddStmt(E->getColumnIdx());
793  Record.AddSourceLocation(E->getRBracketLoc());
795 }
796 
797 void ASTStmtWriter::VisitOMPArraySectionExpr(OMPArraySectionExpr *E) {
798  VisitExpr(E);
799  Record.AddStmt(E->getBase());
800  Record.AddStmt(E->getLowerBound());
801  Record.AddStmt(E->getLength());
802  Record.AddStmt(E->getStride());
803  Record.AddSourceLocation(E->getColonLocFirst());
805  Record.AddSourceLocation(E->getRBracketLoc());
807 }
808 
809 void ASTStmtWriter::VisitOMPArrayShapingExpr(OMPArrayShapingExpr *E) {
810  VisitExpr(E);
811  Record.push_back(E->getDimensions().size());
812  Record.AddStmt(E->getBase());
813  for (Expr *Dim : E->getDimensions())
814  Record.AddStmt(Dim);
815  for (SourceRange SR : E->getBracketsRanges())
816  Record.AddSourceRange(SR);
817  Record.AddSourceLocation(E->getLParenLoc());
818  Record.AddSourceLocation(E->getRParenLoc());
820 }
821 
822 void ASTStmtWriter::VisitOMPIteratorExpr(OMPIteratorExpr *E) {
823  VisitExpr(E);
824  Record.push_back(E->numOfIterators());
825  Record.AddSourceLocation(E->getIteratorKwLoc());
826  Record.AddSourceLocation(E->getLParenLoc());
827  Record.AddSourceLocation(E->getRParenLoc());
828  for (unsigned I = 0, End = E->numOfIterators(); I < End; ++I) {
829  Record.AddDeclRef(E->getIteratorDecl(I));
830  Record.AddSourceLocation(E->getAssignLoc(I));
832  Record.AddStmt(Range.Begin);
833  Record.AddStmt(Range.End);
834  Record.AddStmt(Range.Step);
835  Record.AddSourceLocation(E->getColonLoc(I));
836  if (Range.Step)
837  Record.AddSourceLocation(E->getSecondColonLoc(I));
838  // Serialize helpers
839  OMPIteratorHelperData &HD = E->getHelper(I);
840  Record.AddDeclRef(HD.CounterVD);
841  Record.AddStmt(HD.Upper);
842  Record.AddStmt(HD.Update);
843  Record.AddStmt(HD.CounterUpdate);
844  }
846 }
847 
848 void ASTStmtWriter::VisitCallExpr(CallExpr *E) {
849  VisitExpr(E);
850  Record.push_back(E->getNumArgs());
851  Record.AddSourceLocation(E->getRParenLoc());
852  Record.AddStmt(E->getCallee());
853  for (CallExpr::arg_iterator Arg = E->arg_begin(), ArgEnd = E->arg_end();
854  Arg != ArgEnd; ++Arg)
855  Record.AddStmt(*Arg);
856  Record.push_back(static_cast<unsigned>(E->getADLCallKind()));
858 }
859 
860 void ASTStmtWriter::VisitRecoveryExpr(RecoveryExpr *E) {
861  VisitExpr(E);
862  Record.push_back(std::distance(E->children().begin(), E->children().end()));
863  Record.AddSourceLocation(E->getBeginLoc());
864  Record.AddSourceLocation(E->getEndLoc());
865  for (Stmt *Child : E->children())
866  Record.AddStmt(Child);
868 }
869 
870 void ASTStmtWriter::VisitMemberExpr(MemberExpr *E) {
871  VisitExpr(E);
872 
873  bool HasQualifier = E->hasQualifier();
874  bool HasFoundDecl =
875  E->hasQualifierOrFoundDecl() &&
876  (E->getFoundDecl().getDecl() != E->getMemberDecl() ||
877  E->getFoundDecl().getAccess() != E->getMemberDecl()->getAccess());
878  bool HasTemplateInfo = E->hasTemplateKWAndArgsInfo();
879  unsigned NumTemplateArgs = E->getNumTemplateArgs();
880 
881  // Write these first for easy access when deserializing, as they affect the
882  // size of the MemberExpr.
883  Record.push_back(HasQualifier);
884  Record.push_back(HasFoundDecl);
885  Record.push_back(HasTemplateInfo);
886  Record.push_back(NumTemplateArgs);
887 
888  Record.AddStmt(E->getBase());
889  Record.AddDeclRef(E->getMemberDecl());
890  Record.AddDeclarationNameLoc(E->MemberDNLoc,
891  E->getMemberDecl()->getDeclName());
892  Record.AddSourceLocation(E->getMemberLoc());
893  Record.push_back(E->isArrow());
894  Record.push_back(E->hadMultipleCandidates());
895  Record.push_back(E->isNonOdrUse());
896  Record.AddSourceLocation(E->getOperatorLoc());
897 
898  if (HasFoundDecl) {
899  DeclAccessPair FoundDecl = E->getFoundDecl();
900  Record.AddDeclRef(FoundDecl.getDecl());
901  Record.push_back(FoundDecl.getAccess());
902  }
903 
904  if (HasQualifier)
906 
907  if (HasTemplateInfo)
908  AddTemplateKWAndArgsInfo(*E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
909  E->getTrailingObjects<TemplateArgumentLoc>());
910 
912 }
913 
914 void ASTStmtWriter::VisitObjCIsaExpr(ObjCIsaExpr *E) {
915  VisitExpr(E);
916  Record.AddStmt(E->getBase());
917  Record.AddSourceLocation(E->getIsaMemberLoc());
918  Record.AddSourceLocation(E->getOpLoc());
919  Record.push_back(E->isArrow());
921 }
922 
923 void ASTStmtWriter::
924 VisitObjCIndirectCopyRestoreExpr(ObjCIndirectCopyRestoreExpr *E) {
925  VisitExpr(E);
926  Record.AddStmt(E->getSubExpr());
927  Record.push_back(E->shouldCopy());
929 }
930 
931 void ASTStmtWriter::VisitObjCBridgedCastExpr(ObjCBridgedCastExpr *E) {
932  VisitExplicitCastExpr(E);
933  Record.AddSourceLocation(E->getLParenLoc());
935  Record.push_back(E->getBridgeKind()); // FIXME: Stable encoding
937 }
938 
939 void ASTStmtWriter::VisitCastExpr(CastExpr *E) {
940  VisitExpr(E);
941  Record.push_back(E->path_size());
942  Record.AddStmt(E->getSubExpr());
943  Record.push_back(E->getCastKind()); // FIXME: stable encoding
944 
946  PI = E->path_begin(), PE = E->path_end(); PI != PE; ++PI)
947  Record.AddCXXBaseSpecifier(**PI);
948 }
949 
950 void ASTStmtWriter::VisitBinaryOperator(BinaryOperator *E) {
951  VisitExpr(E);
952  bool HasFPFeatures = E->hasStoredFPFeatures();
953  // Write this first for easy access when deserializing, as they affect the
954  // size of the UnaryOperator.
955  Record.push_back(HasFPFeatures);
956  Record.push_back(E->getOpcode()); // FIXME: stable encoding
957  Record.AddStmt(E->getLHS());
958  Record.AddStmt(E->getRHS());
959  Record.AddSourceLocation(E->getOperatorLoc());
960  if (HasFPFeatures)
963 }
964 
965 void ASTStmtWriter::VisitCompoundAssignOperator(CompoundAssignOperator *E) {
966  VisitBinaryOperator(E);
967  Record.AddTypeRef(E->getComputationLHSType());
970 }
971 
972 void ASTStmtWriter::VisitConditionalOperator(ConditionalOperator *E) {
973  VisitExpr(E);
974  Record.AddStmt(E->getCond());
975  Record.AddStmt(E->getLHS());
976  Record.AddStmt(E->getRHS());
977  Record.AddSourceLocation(E->getQuestionLoc());
978  Record.AddSourceLocation(E->getColonLoc());
980 }
981 
982 void
983 ASTStmtWriter::VisitBinaryConditionalOperator(BinaryConditionalOperator *E) {
984  VisitExpr(E);
985  Record.AddStmt(E->getOpaqueValue());
986  Record.AddStmt(E->getCommon());
987  Record.AddStmt(E->getCond());
988  Record.AddStmt(E->getTrueExpr());
989  Record.AddStmt(E->getFalseExpr());
990  Record.AddSourceLocation(E->getQuestionLoc());
991  Record.AddSourceLocation(E->getColonLoc());
993 }
994 
995 void ASTStmtWriter::VisitImplicitCastExpr(ImplicitCastExpr *E) {
996  VisitCastExpr(E);
997  Record.push_back(E->isPartOfExplicitCast());
998 
999  if (E->path_size() == 0)
1000  AbbrevToUse = Writer.getExprImplicitCastAbbrev();
1001 
1003 }
1004 
1005 void ASTStmtWriter::VisitExplicitCastExpr(ExplicitCastExpr *E) {
1006  VisitCastExpr(E);
1008 }
1009 
1010 void ASTStmtWriter::VisitCStyleCastExpr(CStyleCastExpr *E) {
1011  VisitExplicitCastExpr(E);
1012  Record.AddSourceLocation(E->getLParenLoc());
1013  Record.AddSourceLocation(E->getRParenLoc());
1015 }
1016 
1017 void ASTStmtWriter::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
1018  VisitExpr(E);
1019  Record.AddSourceLocation(E->getLParenLoc());
1020  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1021  Record.AddStmt(E->getInitializer());
1022  Record.push_back(E->isFileScope());
1024 }
1025 
1026 void ASTStmtWriter::VisitExtVectorElementExpr(ExtVectorElementExpr *E) {
1027  VisitExpr(E);
1028  Record.AddStmt(E->getBase());
1029  Record.AddIdentifierRef(&E->getAccessor());
1030  Record.AddSourceLocation(E->getAccessorLoc());
1032 }
1033 
1034 void ASTStmtWriter::VisitInitListExpr(InitListExpr *E) {
1035  VisitExpr(E);
1036  // NOTE: only add the (possibly null) syntactic form.
1037  // No need to serialize the isSemanticForm flag and the semantic form.
1038  Record.AddStmt(E->getSyntacticForm());
1039  Record.AddSourceLocation(E->getLBraceLoc());
1040  Record.AddSourceLocation(E->getRBraceLoc());
1041  bool isArrayFiller = E->ArrayFillerOrUnionFieldInit.is<Expr*>();
1042  Record.push_back(isArrayFiller);
1043  if (isArrayFiller)
1044  Record.AddStmt(E->getArrayFiller());
1045  else
1047  Record.push_back(E->hadArrayRangeDesignator());
1048  Record.push_back(E->getNumInits());
1049  if (isArrayFiller) {
1050  // ArrayFiller may have filled "holes" due to designated initializer.
1051  // Replace them by 0 to indicate that the filler goes in that place.
1052  Expr *filler = E->getArrayFiller();
1053  for (unsigned I = 0, N = E->getNumInits(); I != N; ++I)
1054  Record.AddStmt(E->getInit(I) != filler ? E->getInit(I) : nullptr);
1055  } else {
1056  for (unsigned I = 0, N = E->getNumInits(); I != N; ++I)
1057  Record.AddStmt(E->getInit(I));
1058  }
1060 }
1061 
1062 void ASTStmtWriter::VisitDesignatedInitExpr(DesignatedInitExpr *E) {
1063  VisitExpr(E);
1064  Record.push_back(E->getNumSubExprs());
1065  for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
1066  Record.AddStmt(E->getSubExpr(I));
1068  Record.push_back(E->usesGNUSyntax());
1069  for (const DesignatedInitExpr::Designator &D : E->designators()) {
1070  if (D.isFieldDesignator()) {
1071  if (FieldDecl *Field = D.getField()) {
1073  Record.AddDeclRef(Field);
1074  } else {
1076  Record.AddIdentifierRef(D.getFieldName());
1077  }
1078  Record.AddSourceLocation(D.getDotLoc());
1079  Record.AddSourceLocation(D.getFieldLoc());
1080  } else if (D.isArrayDesignator()) {
1082  Record.push_back(D.getFirstExprIndex());
1083  Record.AddSourceLocation(D.getLBracketLoc());
1084  Record.AddSourceLocation(D.getRBracketLoc());
1085  } else {
1086  assert(D.isArrayRangeDesignator() && "Unknown designator");
1088  Record.push_back(D.getFirstExprIndex());
1089  Record.AddSourceLocation(D.getLBracketLoc());
1090  Record.AddSourceLocation(D.getEllipsisLoc());
1091  Record.AddSourceLocation(D.getRBracketLoc());
1092  }
1093  }
1095 }
1096 
1097 void ASTStmtWriter::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) {
1098  VisitExpr(E);
1099  Record.AddStmt(E->getBase());
1100  Record.AddStmt(E->getUpdater());
1102 }
1103 
1104 void ASTStmtWriter::VisitNoInitExpr(NoInitExpr *E) {
1105  VisitExpr(E);
1107 }
1108 
1109 void ASTStmtWriter::VisitArrayInitLoopExpr(ArrayInitLoopExpr *E) {
1110  VisitExpr(E);
1111  Record.AddStmt(E->SubExprs[0]);
1112  Record.AddStmt(E->SubExprs[1]);
1114 }
1115 
1116 void ASTStmtWriter::VisitArrayInitIndexExpr(ArrayInitIndexExpr *E) {
1117  VisitExpr(E);
1119 }
1120 
1121 void ASTStmtWriter::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) {
1122  VisitExpr(E);
1124 }
1125 
1126 void ASTStmtWriter::VisitVAArgExpr(VAArgExpr *E) {
1127  VisitExpr(E);
1128  Record.AddStmt(E->getSubExpr());
1130  Record.AddSourceLocation(E->getBuiltinLoc());
1131  Record.AddSourceLocation(E->getRParenLoc());
1132  Record.push_back(E->isMicrosoftABI());
1134 }
1135 
1136 void ASTStmtWriter::VisitSourceLocExpr(SourceLocExpr *E) {
1137  VisitExpr(E);
1138  Record.AddDeclRef(cast_or_null<Decl>(E->getParentContext()));
1139  Record.AddSourceLocation(E->getBeginLoc());
1140  Record.AddSourceLocation(E->getEndLoc());
1141  Record.push_back(E->getIdentKind());
1143 }
1144 
1145 void ASTStmtWriter::VisitAddrLabelExpr(AddrLabelExpr *E) {
1146  VisitExpr(E);
1147  Record.AddSourceLocation(E->getAmpAmpLoc());
1148  Record.AddSourceLocation(E->getLabelLoc());
1149  Record.AddDeclRef(E->getLabel());
1151 }
1152 
1153 void ASTStmtWriter::VisitStmtExpr(StmtExpr *E) {
1154  VisitExpr(E);
1155  Record.AddStmt(E->getSubStmt());
1156  Record.AddSourceLocation(E->getLParenLoc());
1157  Record.AddSourceLocation(E->getRParenLoc());
1158  Record.push_back(E->getTemplateDepth());
1159  Code = serialization::EXPR_STMT;
1160 }
1161 
1162 void ASTStmtWriter::VisitChooseExpr(ChooseExpr *E) {
1163  VisitExpr(E);
1164  Record.AddStmt(E->getCond());
1165  Record.AddStmt(E->getLHS());
1166  Record.AddStmt(E->getRHS());
1167  Record.AddSourceLocation(E->getBuiltinLoc());
1168  Record.AddSourceLocation(E->getRParenLoc());
1169  Record.push_back(E->isConditionDependent() ? false : E->isConditionTrue());
1171 }
1172 
1173 void ASTStmtWriter::VisitGNUNullExpr(GNUNullExpr *E) {
1174  VisitExpr(E);
1175  Record.AddSourceLocation(E->getTokenLocation());
1177 }
1178 
1179 void ASTStmtWriter::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
1180  VisitExpr(E);
1181  Record.push_back(E->getNumSubExprs());
1182  for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
1183  Record.AddStmt(E->getExpr(I));
1184  Record.AddSourceLocation(E->getBuiltinLoc());
1185  Record.AddSourceLocation(E->getRParenLoc());
1187 }
1188 
1189 void ASTStmtWriter::VisitConvertVectorExpr(ConvertVectorExpr *E) {
1190  VisitExpr(E);
1191  Record.AddSourceLocation(E->getBuiltinLoc());
1192  Record.AddSourceLocation(E->getRParenLoc());
1193  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1194  Record.AddStmt(E->getSrcExpr());
1196 }
1197 
1198 void ASTStmtWriter::VisitBlockExpr(BlockExpr *E) {
1199  VisitExpr(E);
1200  Record.AddDeclRef(E->getBlockDecl());
1202 }
1203 
1204 void ASTStmtWriter::VisitGenericSelectionExpr(GenericSelectionExpr *E) {
1205  VisitExpr(E);
1206 
1207  Record.push_back(E->getNumAssocs());
1208  Record.push_back(E->ResultIndex);
1209  Record.AddSourceLocation(E->getGenericLoc());
1210  Record.AddSourceLocation(E->getDefaultLoc());
1211  Record.AddSourceLocation(E->getRParenLoc());
1212 
1213  Stmt **Stmts = E->getTrailingObjects<Stmt *>();
1214  // Add 1 to account for the controlling expression which is the first
1215  // expression in the trailing array of Stmt *. This is not needed for
1216  // the trailing array of TypeSourceInfo *.
1217  for (unsigned I = 0, N = E->getNumAssocs() + 1; I < N; ++I)
1218  Record.AddStmt(Stmts[I]);
1219 
1220  TypeSourceInfo **TSIs = E->getTrailingObjects<TypeSourceInfo *>();
1221  for (unsigned I = 0, N = E->getNumAssocs(); I < N; ++I)
1222  Record.AddTypeSourceInfo(TSIs[I]);
1223 
1225 }
1226 
1227 void ASTStmtWriter::VisitPseudoObjectExpr(PseudoObjectExpr *E) {
1228  VisitExpr(E);
1229  Record.push_back(E->getNumSemanticExprs());
1230 
1231  // Push the result index. Currently, this needs to exactly match
1232  // the encoding used internally for ResultIndex.
1233  unsigned result = E->getResultExprIndex();
1234  result = (result == PseudoObjectExpr::NoResult ? 0 : result + 1);
1235  Record.push_back(result);
1236 
1237  Record.AddStmt(E->getSyntacticForm());
1239  i = E->semantics_begin(), e = E->semantics_end(); i != e; ++i) {
1240  Record.AddStmt(*i);
1241  }
1243 }
1244 
1245 void ASTStmtWriter::VisitAtomicExpr(AtomicExpr *E) {
1246  VisitExpr(E);
1247  Record.push_back(E->getOp());
1248  for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
1249  Record.AddStmt(E->getSubExprs()[I]);
1250  Record.AddSourceLocation(E->getBuiltinLoc());
1251  Record.AddSourceLocation(E->getRParenLoc());
1253 }
1254 
1255 //===----------------------------------------------------------------------===//
1256 // Objective-C Expressions and Statements.
1257 //===----------------------------------------------------------------------===//
1258 
1259 void ASTStmtWriter::VisitObjCStringLiteral(ObjCStringLiteral *E) {
1260  VisitExpr(E);
1261  Record.AddStmt(E->getString());
1262  Record.AddSourceLocation(E->getAtLoc());
1264 }
1265 
1266 void ASTStmtWriter::VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
1267  VisitExpr(E);
1268  Record.AddStmt(E->getSubExpr());
1269  Record.AddDeclRef(E->getBoxingMethod());
1270  Record.AddSourceRange(E->getSourceRange());
1272 }
1273 
1274 void ASTStmtWriter::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
1275  VisitExpr(E);
1276  Record.push_back(E->getNumElements());
1277  for (unsigned i = 0; i < E->getNumElements(); i++)
1278  Record.AddStmt(E->getElement(i));
1280  Record.AddSourceRange(E->getSourceRange());
1282 }
1283 
1284 void ASTStmtWriter::VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *E) {
1285  VisitExpr(E);
1286  Record.push_back(E->getNumElements());
1287  Record.push_back(E->HasPackExpansions);
1288  for (unsigned i = 0; i < E->getNumElements(); i++) {
1289  ObjCDictionaryElement Element = E->getKeyValueElement(i);
1290  Record.AddStmt(Element.Key);
1291  Record.AddStmt(Element.Value);
1292  if (E->HasPackExpansions) {
1293  Record.AddSourceLocation(Element.EllipsisLoc);
1294  unsigned NumExpansions = 0;
1295  if (Element.NumExpansions)
1296  NumExpansions = *Element.NumExpansions + 1;
1297  Record.push_back(NumExpansions);
1298  }
1299  }
1300 
1301  Record.AddDeclRef(E->getDictWithObjectsMethod());
1302  Record.AddSourceRange(E->getSourceRange());
1304 }
1305 
1306 void ASTStmtWriter::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
1307  VisitExpr(E);
1309  Record.AddSourceLocation(E->getAtLoc());
1310  Record.AddSourceLocation(E->getRParenLoc());
1312 }
1313 
1314 void ASTStmtWriter::VisitObjCSelectorExpr(ObjCSelectorExpr *E) {
1315  VisitExpr(E);
1316  Record.AddSelectorRef(E->getSelector());
1317  Record.AddSourceLocation(E->getAtLoc());
1318  Record.AddSourceLocation(E->getRParenLoc());
1320 }
1321 
1322 void ASTStmtWriter::VisitObjCProtocolExpr(ObjCProtocolExpr *E) {
1323  VisitExpr(E);
1324  Record.AddDeclRef(E->getProtocol());
1325  Record.AddSourceLocation(E->getAtLoc());
1326  Record.AddSourceLocation(E->ProtoLoc);
1327  Record.AddSourceLocation(E->getRParenLoc());
1329 }
1330 
1331 void ASTStmtWriter::VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) {
1332  VisitExpr(E);
1333  Record.AddDeclRef(E->getDecl());
1334  Record.AddSourceLocation(E->getLocation());
1335  Record.AddSourceLocation(E->getOpLoc());
1336  Record.AddStmt(E->getBase());
1337  Record.push_back(E->isArrow());
1338  Record.push_back(E->isFreeIvar());
1340 }
1341 
1342 void ASTStmtWriter::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
1343  VisitExpr(E);
1344  Record.push_back(E->SetterAndMethodRefFlags.getInt());
1345  Record.push_back(E->isImplicitProperty());
1346  if (E->isImplicitProperty()) {
1349  } else {
1350  Record.AddDeclRef(E->getExplicitProperty());
1351  }
1352  Record.AddSourceLocation(E->getLocation());
1354  if (E->isObjectReceiver()) {
1355  Record.push_back(0);
1356  Record.AddStmt(E->getBase());
1357  } else if (E->isSuperReceiver()) {
1358  Record.push_back(1);
1359  Record.AddTypeRef(E->getSuperReceiverType());
1360  } else {
1361  Record.push_back(2);
1362  Record.AddDeclRef(E->getClassReceiver());
1363  }
1364 
1366 }
1367 
1368 void ASTStmtWriter::VisitObjCSubscriptRefExpr(ObjCSubscriptRefExpr *E) {
1369  VisitExpr(E);
1370  Record.AddSourceLocation(E->getRBracket());
1371  Record.AddStmt(E->getBaseExpr());
1372  Record.AddStmt(E->getKeyExpr());
1373  Record.AddDeclRef(E->getAtIndexMethodDecl());
1374  Record.AddDeclRef(E->setAtIndexMethodDecl());
1375 
1377 }
1378 
1379 void ASTStmtWriter::VisitObjCMessageExpr(ObjCMessageExpr *E) {
1380  VisitExpr(E);
1381  Record.push_back(E->getNumArgs());
1382  Record.push_back(E->getNumStoredSelLocs());
1383  Record.push_back(E->SelLocsKind);
1384  Record.push_back(E->isDelegateInitCall());
1385  Record.push_back(E->IsImplicit);
1386  Record.push_back((unsigned)E->getReceiverKind()); // FIXME: stable encoding
1387  switch (E->getReceiverKind()) {
1389  Record.AddStmt(E->getInstanceReceiver());
1390  break;
1391 
1394  break;
1395 
1398  Record.AddTypeRef(E->getSuperType());
1399  Record.AddSourceLocation(E->getSuperLoc());
1400  break;
1401  }
1402 
1403  if (E->getMethodDecl()) {
1404  Record.push_back(1);
1405  Record.AddDeclRef(E->getMethodDecl());
1406  } else {
1407  Record.push_back(0);
1408  Record.AddSelectorRef(E->getSelector());
1409  }
1410 
1411  Record.AddSourceLocation(E->getLeftLoc());
1412  Record.AddSourceLocation(E->getRightLoc());
1413 
1414  for (CallExpr::arg_iterator Arg = E->arg_begin(), ArgEnd = E->arg_end();
1415  Arg != ArgEnd; ++Arg)
1416  Record.AddStmt(*Arg);
1417 
1418  SourceLocation *Locs = E->getStoredSelLocs();
1419  for (unsigned i = 0, e = E->getNumStoredSelLocs(); i != e; ++i)
1420  Record.AddSourceLocation(Locs[i]);
1421 
1423 }
1424 
1425 void ASTStmtWriter::VisitObjCForCollectionStmt(ObjCForCollectionStmt *S) {
1426  VisitStmt(S);
1427  Record.AddStmt(S->getElement());
1428  Record.AddStmt(S->getCollection());
1429  Record.AddStmt(S->getBody());
1430  Record.AddSourceLocation(S->getForLoc());
1431  Record.AddSourceLocation(S->getRParenLoc());
1433 }
1434 
1435 void ASTStmtWriter::VisitObjCAtCatchStmt(ObjCAtCatchStmt *S) {
1436  VisitStmt(S);
1437  Record.AddStmt(S->getCatchBody());
1438  Record.AddDeclRef(S->getCatchParamDecl());
1439  Record.AddSourceLocation(S->getAtCatchLoc());
1440  Record.AddSourceLocation(S->getRParenLoc());
1442 }
1443 
1444 void ASTStmtWriter::VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S) {
1445  VisitStmt(S);
1446  Record.AddStmt(S->getFinallyBody());
1447  Record.AddSourceLocation(S->getAtFinallyLoc());
1449 }
1450 
1451 void ASTStmtWriter::VisitObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S) {
1452  VisitStmt(S); // FIXME: no test coverage.
1453  Record.AddStmt(S->getSubStmt());
1454  Record.AddSourceLocation(S->getAtLoc());
1456 }
1457 
1458 void ASTStmtWriter::VisitObjCAtTryStmt(ObjCAtTryStmt *S) {
1459  VisitStmt(S);
1460  Record.push_back(S->getNumCatchStmts());
1461  Record.push_back(S->getFinallyStmt() != nullptr);
1462  Record.AddStmt(S->getTryBody());
1463  for (unsigned I = 0, N = S->getNumCatchStmts(); I != N; ++I)
1464  Record.AddStmt(S->getCatchStmt(I));
1465  if (S->getFinallyStmt())
1466  Record.AddStmt(S->getFinallyStmt());
1467  Record.AddSourceLocation(S->getAtTryLoc());
1469 }
1470 
1471 void ASTStmtWriter::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
1472  VisitStmt(S); // FIXME: no test coverage.
1473  Record.AddStmt(S->getSynchExpr());
1474  Record.AddStmt(S->getSynchBody());
1477 }
1478 
1479 void ASTStmtWriter::VisitObjCAtThrowStmt(ObjCAtThrowStmt *S) {
1480  VisitStmt(S); // FIXME: no test coverage.
1481  Record.AddStmt(S->getThrowExpr());
1482  Record.AddSourceLocation(S->getThrowLoc());
1484 }
1485 
1486 void ASTStmtWriter::VisitObjCBoolLiteralExpr(ObjCBoolLiteralExpr *E) {
1487  VisitExpr(E);
1488  Record.push_back(E->getValue());
1489  Record.AddSourceLocation(E->getLocation());
1491 }
1492 
1493 void ASTStmtWriter::VisitObjCAvailabilityCheckExpr(ObjCAvailabilityCheckExpr *E) {
1494  VisitExpr(E);
1495  Record.AddSourceRange(E->getSourceRange());
1496  Record.AddVersionTuple(E->getVersion());
1498 }
1499 
1500 //===----------------------------------------------------------------------===//
1501 // C++ Expressions and Statements.
1502 //===----------------------------------------------------------------------===//
1503 
1504 void ASTStmtWriter::VisitCXXCatchStmt(CXXCatchStmt *S) {
1505  VisitStmt(S);
1506  Record.AddSourceLocation(S->getCatchLoc());
1507  Record.AddDeclRef(S->getExceptionDecl());
1508  Record.AddStmt(S->getHandlerBlock());
1510 }
1511 
1512 void ASTStmtWriter::VisitCXXTryStmt(CXXTryStmt *S) {
1513  VisitStmt(S);
1514  Record.push_back(S->getNumHandlers());
1515  Record.AddSourceLocation(S->getTryLoc());
1516  Record.AddStmt(S->getTryBlock());
1517  for (unsigned i = 0, e = S->getNumHandlers(); i != e; ++i)
1518  Record.AddStmt(S->getHandler(i));
1520 }
1521 
1522 void ASTStmtWriter::VisitCXXForRangeStmt(CXXForRangeStmt *S) {
1523  VisitStmt(S);
1524  Record.AddSourceLocation(S->getForLoc());
1525  Record.AddSourceLocation(S->getCoawaitLoc());
1526  Record.AddSourceLocation(S->getColonLoc());
1527  Record.AddSourceLocation(S->getRParenLoc());
1528  Record.AddStmt(S->getInit());
1529  Record.AddStmt(S->getRangeStmt());
1530  Record.AddStmt(S->getBeginStmt());
1531  Record.AddStmt(S->getEndStmt());
1532  Record.AddStmt(S->getCond());
1533  Record.AddStmt(S->getInc());
1534  Record.AddStmt(S->getLoopVarStmt());
1535  Record.AddStmt(S->getBody());
1537 }
1538 
1539 void ASTStmtWriter::VisitMSDependentExistsStmt(MSDependentExistsStmt *S) {
1540  VisitStmt(S);
1541  Record.AddSourceLocation(S->getKeywordLoc());
1542  Record.push_back(S->isIfExists());
1544  Record.AddDeclarationNameInfo(S->getNameInfo());
1545  Record.AddStmt(S->getSubStmt());
1547 }
1548 
1549 void ASTStmtWriter::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
1550  VisitCallExpr(E);
1551  Record.push_back(E->getOperator());
1552  Record.AddSourceRange(E->Range);
1553  Record.push_back(E->getFPFeatures().getAsOpaqueInt());
1555 }
1556 
1557 void ASTStmtWriter::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) {
1558  VisitCallExpr(E);
1560 }
1561 
1562 void ASTStmtWriter::VisitCXXRewrittenBinaryOperator(
1564  VisitExpr(E);
1565  Record.push_back(E->isReversed());
1566  Record.AddStmt(E->getSemanticForm());
1568 }
1569 
1570 void ASTStmtWriter::VisitCXXConstructExpr(CXXConstructExpr *E) {
1571  VisitExpr(E);
1572 
1573  Record.push_back(E->getNumArgs());
1574  Record.push_back(E->isElidable());
1575  Record.push_back(E->hadMultipleCandidates());
1576  Record.push_back(E->isListInitialization());
1579  Record.push_back(E->getConstructionKind()); // FIXME: stable encoding
1580  Record.AddSourceLocation(E->getLocation());
1581  Record.AddDeclRef(E->getConstructor());
1582  Record.AddSourceRange(E->getParenOrBraceRange());
1583 
1584  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1585  Record.AddStmt(E->getArg(I));
1586 
1588 }
1589 
1590 void ASTStmtWriter::VisitCXXInheritedCtorInitExpr(CXXInheritedCtorInitExpr *E) {
1591  VisitExpr(E);
1592  Record.AddDeclRef(E->getConstructor());
1593  Record.AddSourceLocation(E->getLocation());
1594  Record.push_back(E->constructsVBase());
1595  Record.push_back(E->inheritedFromVBase());
1597 }
1598 
1599 void ASTStmtWriter::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
1600  VisitCXXConstructExpr(E);
1601  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1603 }
1604 
1605 void ASTStmtWriter::VisitLambdaExpr(LambdaExpr *E) {
1606  VisitExpr(E);
1607  Record.push_back(E->LambdaExprBits.NumCaptures);
1608  Record.AddSourceRange(E->IntroducerRange);
1609  Record.push_back(E->LambdaExprBits.CaptureDefault); // FIXME: stable encoding
1610  Record.AddSourceLocation(E->CaptureDefaultLoc);
1611  Record.push_back(E->LambdaExprBits.ExplicitParams);
1612  Record.push_back(E->LambdaExprBits.ExplicitResultType);
1613  Record.AddSourceLocation(E->ClosingBrace);
1614 
1615  // Add capture initializers.
1617  CEnd = E->capture_init_end();
1618  C != CEnd; ++C) {
1619  Record.AddStmt(*C);
1620  }
1621 
1622  // Don't serialize the body. It belongs to the call operator declaration.
1623  // LambdaExpr only stores a copy of the Stmt *.
1624 
1626 }
1627 
1628 void ASTStmtWriter::VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E) {
1629  VisitExpr(E);
1630  Record.AddStmt(E->getSubExpr());
1632 }
1633 
1634 void ASTStmtWriter::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) {
1635  VisitExplicitCastExpr(E);
1637  Record.AddSourceRange(E->getAngleBrackets());
1638 }
1639 
1640 void ASTStmtWriter::VisitCXXStaticCastExpr(CXXStaticCastExpr *E) {
1641  VisitCXXNamedCastExpr(E);
1643 }
1644 
1645 void ASTStmtWriter::VisitCXXDynamicCastExpr(CXXDynamicCastExpr *E) {
1646  VisitCXXNamedCastExpr(E);
1648 }
1649 
1650 void ASTStmtWriter::VisitCXXReinterpretCastExpr(CXXReinterpretCastExpr *E) {
1651  VisitCXXNamedCastExpr(E);
1653 }
1654 
1655 void ASTStmtWriter::VisitCXXConstCastExpr(CXXConstCastExpr *E) {
1656  VisitCXXNamedCastExpr(E);
1658 }
1659 
1660 void ASTStmtWriter::VisitCXXAddrspaceCastExpr(CXXAddrspaceCastExpr *E) {
1661  VisitCXXNamedCastExpr(E);
1663 }
1664 
1665 void ASTStmtWriter::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E) {
1666  VisitExplicitCastExpr(E);
1667  Record.AddSourceLocation(E->getLParenLoc());
1668  Record.AddSourceLocation(E->getRParenLoc());
1670 }
1671 
1672 void ASTStmtWriter::VisitBuiltinBitCastExpr(BuiltinBitCastExpr *E) {
1673  VisitExplicitCastExpr(E);
1674  Record.AddSourceLocation(E->getBeginLoc());
1675  Record.AddSourceLocation(E->getEndLoc());
1677 }
1678 
1679 void ASTStmtWriter::VisitUserDefinedLiteral(UserDefinedLiteral *E) {
1680  VisitCallExpr(E);
1681  Record.AddSourceLocation(E->UDSuffixLoc);
1683 }
1684 
1685 void ASTStmtWriter::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) {
1686  VisitExpr(E);
1687  Record.push_back(E->getValue());
1688  Record.AddSourceLocation(E->getLocation());
1690 }
1691 
1692 void ASTStmtWriter::VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E) {
1693  VisitExpr(E);
1694  Record.AddSourceLocation(E->getLocation());
1696 }
1697 
1698 void ASTStmtWriter::VisitCXXTypeidExpr(CXXTypeidExpr *E) {
1699  VisitExpr(E);
1700  Record.AddSourceRange(E->getSourceRange());
1701  if (E->isTypeOperand()) {
1704  } else {
1705  Record.AddStmt(E->getExprOperand());
1707  }
1708 }
1709 
1710 void ASTStmtWriter::VisitCXXThisExpr(CXXThisExpr *E) {
1711  VisitExpr(E);
1712  Record.AddSourceLocation(E->getLocation());
1713  Record.push_back(E->isImplicit());
1715 }
1716 
1717 void ASTStmtWriter::VisitCXXThrowExpr(CXXThrowExpr *E) {
1718  VisitExpr(E);
1719  Record.AddSourceLocation(E->getThrowLoc());
1720  Record.AddStmt(E->getSubExpr());
1721  Record.push_back(E->isThrownVariableInScope());
1723 }
1724 
1725 void ASTStmtWriter::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
1726  VisitExpr(E);
1727  Record.AddDeclRef(E->getParam());
1728  Record.AddDeclRef(cast_or_null<Decl>(E->getUsedContext()));
1729  Record.AddSourceLocation(E->getUsedLocation());
1731 }
1732 
1733 void ASTStmtWriter::VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E) {
1734  VisitExpr(E);
1735  Record.AddDeclRef(E->getField());
1736  Record.AddDeclRef(cast_or_null<Decl>(E->getUsedContext()));
1737  Record.AddSourceLocation(E->getExprLoc());
1739 }
1740 
1741 void ASTStmtWriter::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
1742  VisitExpr(E);
1743  Record.AddCXXTemporary(E->getTemporary());
1744  Record.AddStmt(E->getSubExpr());
1746 }
1747 
1748 void ASTStmtWriter::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
1749  VisitExpr(E);
1750  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1751  Record.AddSourceLocation(E->getRParenLoc());
1753 }
1754 
1755 void ASTStmtWriter::VisitCXXNewExpr(CXXNewExpr *E) {
1756  VisitExpr(E);
1757 
1758  Record.push_back(E->isArray());
1759  Record.push_back(E->hasInitializer());
1760  Record.push_back(E->getNumPlacementArgs());
1761  Record.push_back(E->isParenTypeId());
1762 
1763  Record.push_back(E->isGlobalNew());
1764  Record.push_back(E->passAlignment());
1766  Record.push_back(E->CXXNewExprBits.StoredInitializationStyle);
1767 
1768  Record.AddDeclRef(E->getOperatorNew());
1769  Record.AddDeclRef(E->getOperatorDelete());
1771  if (E->isParenTypeId())
1772  Record.AddSourceRange(E->getTypeIdParens());
1773  Record.AddSourceRange(E->getSourceRange());
1774  Record.AddSourceRange(E->getDirectInitRange());
1775 
1776  for (CXXNewExpr::arg_iterator I = E->raw_arg_begin(), N = E->raw_arg_end();
1777  I != N; ++I)
1778  Record.AddStmt(*I);
1779 
1781 }
1782 
1783 void ASTStmtWriter::VisitCXXDeleteExpr(CXXDeleteExpr *E) {
1784  VisitExpr(E);
1785  Record.push_back(E->isGlobalDelete());
1786  Record.push_back(E->isArrayForm());
1787  Record.push_back(E->isArrayFormAsWritten());
1789  Record.AddDeclRef(E->getOperatorDelete());
1790  Record.AddStmt(E->getArgument());
1791  Record.AddSourceLocation(E->getBeginLoc());
1792 
1794 }
1795 
1796 void ASTStmtWriter::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
1797  VisitExpr(E);
1798 
1799  Record.AddStmt(E->getBase());
1800  Record.push_back(E->isArrow());
1801  Record.AddSourceLocation(E->getOperatorLoc());
1803  Record.AddTypeSourceInfo(E->getScopeTypeInfo());
1804  Record.AddSourceLocation(E->getColonColonLoc());
1805  Record.AddSourceLocation(E->getTildeLoc());
1806 
1807  // PseudoDestructorTypeStorage.
1809  if (E->getDestroyedTypeIdentifier())
1811  else
1813 
1815 }
1816 
1817 void ASTStmtWriter::VisitExprWithCleanups(ExprWithCleanups *E) {
1818  VisitExpr(E);
1819  Record.push_back(E->getNumObjects());
1820  for (auto &Obj : E->getObjects()) {
1821  if (auto *BD = Obj.dyn_cast<BlockDecl *>()) {
1823  Record.AddDeclRef(BD);
1824  } else if (auto *CLE = Obj.dyn_cast<CompoundLiteralExpr *>()) {
1826  Record.AddStmt(CLE);
1827  }
1828  }
1829 
1830  Record.push_back(E->cleanupsHaveSideEffects());
1831  Record.AddStmt(E->getSubExpr());
1833 }
1834 
1835 void ASTStmtWriter::VisitCXXDependentScopeMemberExpr(
1837  VisitExpr(E);
1838 
1839  // Don't emit anything here (or if you do you will have to update
1840  // the corresponding deserialization function).
1841 
1842  Record.push_back(E->hasTemplateKWAndArgsInfo());
1843  Record.push_back(E->getNumTemplateArgs());
1844  Record.push_back(E->hasFirstQualifierFoundInScope());
1845 
1846  if (E->hasTemplateKWAndArgsInfo()) {
1847  const ASTTemplateKWAndArgsInfo &ArgInfo =
1848  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
1849  AddTemplateKWAndArgsInfo(ArgInfo,
1850  E->getTrailingObjects<TemplateArgumentLoc>());
1851  }
1852 
1853  Record.push_back(E->isArrow());
1854  Record.AddSourceLocation(E->getOperatorLoc());
1855  Record.AddTypeRef(E->getBaseType());
1857  if (!E->isImplicitAccess())
1858  Record.AddStmt(E->getBase());
1859  else
1860  Record.AddStmt(nullptr);
1861 
1862  if (E->hasFirstQualifierFoundInScope())
1864 
1865  Record.AddDeclarationNameInfo(E->MemberNameInfo);
1867 }
1868 
1869 void
1870 ASTStmtWriter::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) {
1871  VisitExpr(E);
1872 
1873  // Don't emit anything here, HasTemplateKWAndArgsInfo must be
1874  // emitted first.
1875 
1876  Record.push_back(E->DependentScopeDeclRefExprBits.HasTemplateKWAndArgsInfo);
1877  if (E->DependentScopeDeclRefExprBits.HasTemplateKWAndArgsInfo) {
1878  const ASTTemplateKWAndArgsInfo &ArgInfo =
1879  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
1880  Record.push_back(ArgInfo.NumTemplateArgs);
1881  AddTemplateKWAndArgsInfo(ArgInfo,
1882  E->getTrailingObjects<TemplateArgumentLoc>());
1883  }
1884 
1886  Record.AddDeclarationNameInfo(E->NameInfo);
1888 }
1889 
1890 void
1891 ASTStmtWriter::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E) {
1892  VisitExpr(E);
1893  Record.push_back(E->arg_size());
1895  ArgI = E->arg_begin(), ArgE = E->arg_end(); ArgI != ArgE; ++ArgI)
1896  Record.AddStmt(*ArgI);
1897  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1898  Record.AddSourceLocation(E->getLParenLoc());
1899  Record.AddSourceLocation(E->getRParenLoc());
1901 }
1902 
1903 void ASTStmtWriter::VisitOverloadExpr(OverloadExpr *E) {
1904  VisitExpr(E);
1905 
1906  Record.push_back(E->getNumDecls());
1907  Record.push_back(E->hasTemplateKWAndArgsInfo());
1908  if (E->hasTemplateKWAndArgsInfo()) {
1909  const ASTTemplateKWAndArgsInfo &ArgInfo =
1911  Record.push_back(ArgInfo.NumTemplateArgs);
1913  }
1914 
1915  for (OverloadExpr::decls_iterator OvI = E->decls_begin(),
1916  OvE = E->decls_end();
1917  OvI != OvE; ++OvI) {
1918  Record.AddDeclRef(OvI.getDecl());
1919  Record.push_back(OvI.getAccess());
1920  }
1921 
1922  Record.AddDeclarationNameInfo(E->getNameInfo());
1924 }
1925 
1926 void ASTStmtWriter::VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
1927  VisitOverloadExpr(E);
1928  Record.push_back(E->isArrow());
1929  Record.push_back(E->hasUnresolvedUsing());
1930  Record.AddStmt(!E->isImplicitAccess() ? E->getBase() : nullptr);
1931  Record.AddTypeRef(E->getBaseType());
1932  Record.AddSourceLocation(E->getOperatorLoc());
1934 }
1935 
1936 void ASTStmtWriter::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) {
1937  VisitOverloadExpr(E);
1938  Record.push_back(E->requiresADL());
1939  Record.push_back(E->isOverloaded());
1940  Record.AddDeclRef(E->getNamingClass());
1942 }
1943 
1944 void ASTStmtWriter::VisitTypeTraitExpr(TypeTraitExpr *E) {
1945  VisitExpr(E);
1946  Record.push_back(E->TypeTraitExprBits.NumArgs);
1947  Record.push_back(E->TypeTraitExprBits.Kind); // FIXME: Stable encoding
1948  Record.push_back(E->TypeTraitExprBits.Value);
1949  Record.AddSourceRange(E->getSourceRange());
1950  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1951  Record.AddTypeSourceInfo(E->getArg(I));
1953 }
1954 
1955 void ASTStmtWriter::VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E) {
1956  VisitExpr(E);
1957  Record.push_back(E->getTrait());
1958  Record.push_back(E->getValue());
1959  Record.AddSourceRange(E->getSourceRange());
1961  Record.AddStmt(E->getDimensionExpression());
1963 }
1964 
1965 void ASTStmtWriter::VisitExpressionTraitExpr(ExpressionTraitExpr *E) {
1966  VisitExpr(E);
1967  Record.push_back(E->getTrait());
1968  Record.push_back(E->getValue());
1969  Record.AddSourceRange(E->getSourceRange());
1970  Record.AddStmt(E->getQueriedExpression());
1972 }
1973 
1974 void ASTStmtWriter::VisitCXXNoexceptExpr(CXXNoexceptExpr *E) {
1975  VisitExpr(E);
1976  Record.push_back(E->getValue());
1977  Record.AddSourceRange(E->getSourceRange());
1978  Record.AddStmt(E->getOperand());
1980 }
1981 
1982 void ASTStmtWriter::VisitPackExpansionExpr(PackExpansionExpr *E) {
1983  VisitExpr(E);
1984  Record.AddSourceLocation(E->getEllipsisLoc());
1985  Record.push_back(E->NumExpansions);
1986  Record.AddStmt(E->getPattern());
1988 }
1989 
1990 void ASTStmtWriter::VisitSizeOfPackExpr(SizeOfPackExpr *E) {
1991  VisitExpr(E);
1992  Record.push_back(E->isPartiallySubstituted() ? E->getPartialArguments().size()
1993  : 0);
1994  Record.AddSourceLocation(E->OperatorLoc);
1995  Record.AddSourceLocation(E->PackLoc);
1996  Record.AddSourceLocation(E->RParenLoc);
1997  Record.AddDeclRef(E->Pack);
1998  if (E->isPartiallySubstituted()) {
1999  for (const auto &TA : E->getPartialArguments())
2000  Record.AddTemplateArgument(TA);
2001  } else if (!E->isValueDependent()) {
2002  Record.push_back(E->getPackLength());
2003  }
2005 }
2006 
2007 void ASTStmtWriter::VisitSubstNonTypeTemplateParmExpr(
2009  VisitExpr(E);
2010  Record.AddDeclRef(E->getParameter());
2011  Record.AddSourceLocation(E->getNameLoc());
2012  Record.AddStmt(E->getReplacement());
2014 }
2015 
2016 void ASTStmtWriter::VisitSubstNonTypeTemplateParmPackExpr(
2018  VisitExpr(E);
2019  Record.AddDeclRef(E->getParameterPack());
2020  Record.AddTemplateArgument(E->getArgumentPack());
2023 }
2024 
2025 void ASTStmtWriter::VisitFunctionParmPackExpr(FunctionParmPackExpr *E) {
2026  VisitExpr(E);
2027  Record.push_back(E->getNumExpansions());
2028  Record.AddDeclRef(E->getParameterPack());
2030  for (FunctionParmPackExpr::iterator I = E->begin(), End = E->end();
2031  I != End; ++I)
2032  Record.AddDeclRef(*I);
2034 }
2035 
2036 void ASTStmtWriter::VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E) {
2037  VisitExpr(E);
2038  Record.push_back(static_cast<bool>(E->getLifetimeExtendedTemporaryDecl()));
2041  else
2042  Record.AddStmt(E->getSubExpr());
2044 }
2045 
2046 void ASTStmtWriter::VisitCXXFoldExpr(CXXFoldExpr *E) {
2047  VisitExpr(E);
2048  Record.AddSourceLocation(E->LParenLoc);
2049  Record.AddSourceLocation(E->EllipsisLoc);
2050  Record.AddSourceLocation(E->RParenLoc);
2051  Record.push_back(E->NumExpansions);
2052  Record.AddStmt(E->SubExprs[0]);
2053  Record.AddStmt(E->SubExprs[1]);
2054  Record.push_back(E->Opcode);
2056 }
2057 
2058 void ASTStmtWriter::VisitOpaqueValueExpr(OpaqueValueExpr *E) {
2059  VisitExpr(E);
2060  Record.AddStmt(E->getSourceExpr());
2061  Record.AddSourceLocation(E->getLocation());
2062  Record.push_back(E->isUnique());
2064 }
2065 
2066 void ASTStmtWriter::VisitTypoExpr(TypoExpr *E) {
2067  VisitExpr(E);
2068  // TODO: Figure out sane writer behavior for a TypoExpr, if necessary
2069  llvm_unreachable("Cannot write TypoExpr nodes");
2070 }
2071 
2072 //===----------------------------------------------------------------------===//
2073 // CUDA Expressions and Statements.
2074 //===----------------------------------------------------------------------===//
2075 
2076 void ASTStmtWriter::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E) {
2077  VisitCallExpr(E);
2078  Record.AddStmt(E->getConfig());
2080 }
2081 
2082 //===----------------------------------------------------------------------===//
2083 // OpenCL Expressions and Statements.
2084 //===----------------------------------------------------------------------===//
2085 void ASTStmtWriter::VisitAsTypeExpr(AsTypeExpr *E) {
2086  VisitExpr(E);
2087  Record.AddSourceLocation(E->getBuiltinLoc());
2088  Record.AddSourceLocation(E->getRParenLoc());
2089  Record.AddStmt(E->getSrcExpr());
2091 }
2092 
2093 //===----------------------------------------------------------------------===//
2094 // Microsoft Expressions and Statements.
2095 //===----------------------------------------------------------------------===//
2096 void ASTStmtWriter::VisitMSPropertyRefExpr(MSPropertyRefExpr *E) {
2097  VisitExpr(E);
2098  Record.push_back(E->isArrow());
2099  Record.AddStmt(E->getBaseExpr());
2101  Record.AddSourceLocation(E->getMemberLoc());
2102  Record.AddDeclRef(E->getPropertyDecl());
2104 }
2105 
2106 void ASTStmtWriter::VisitMSPropertySubscriptExpr(MSPropertySubscriptExpr *E) {
2107  VisitExpr(E);
2108  Record.AddStmt(E->getBase());
2109  Record.AddStmt(E->getIdx());
2110  Record.AddSourceLocation(E->getRBracketLoc());
2112 }
2113 
2114 void ASTStmtWriter::VisitCXXUuidofExpr(CXXUuidofExpr *E) {
2115  VisitExpr(E);
2116  Record.AddSourceRange(E->getSourceRange());
2117  Record.AddDeclRef(E->getGuidDecl());
2118  if (E->isTypeOperand()) {
2121  } else {
2122  Record.AddStmt(E->getExprOperand());
2124  }
2125 }
2126 
2127 void ASTStmtWriter::VisitSEHExceptStmt(SEHExceptStmt *S) {
2128  VisitStmt(S);
2129  Record.AddSourceLocation(S->getExceptLoc());
2130  Record.AddStmt(S->getFilterExpr());
2131  Record.AddStmt(S->getBlock());
2133 }
2134 
2135 void ASTStmtWriter::VisitSEHFinallyStmt(SEHFinallyStmt *S) {
2136  VisitStmt(S);
2137  Record.AddSourceLocation(S->getFinallyLoc());
2138  Record.AddStmt(S->getBlock());
2140 }
2141 
2142 void ASTStmtWriter::VisitSEHTryStmt(SEHTryStmt *S) {
2143  VisitStmt(S);
2144  Record.push_back(S->getIsCXXTry());
2145  Record.AddSourceLocation(S->getTryLoc());
2146  Record.AddStmt(S->getTryBlock());
2147  Record.AddStmt(S->getHandler());
2149 }
2150 
2151 void ASTStmtWriter::VisitSEHLeaveStmt(SEHLeaveStmt *S) {
2152  VisitStmt(S);
2153  Record.AddSourceLocation(S->getLeaveLoc());
2155 }
2156 
2157 //===----------------------------------------------------------------------===//
2158 // OpenMP Directives.
2159 //===----------------------------------------------------------------------===//
2160 void ASTStmtWriter::VisitOMPExecutableDirective(OMPExecutableDirective *E) {
2161  Record.AddSourceLocation(E->getBeginLoc());
2162  Record.AddSourceLocation(E->getEndLoc());
2163  for (unsigned i = 0; i < E->getNumClauses(); ++i) {
2164  Record.writeOMPClause(E->getClause(i));
2165  }
2166  if (E->hasAssociatedStmt())
2167  Record.AddStmt(E->getAssociatedStmt());
2168 }
2169 
2170 void ASTStmtWriter::VisitOMPLoopDirective(OMPLoopDirective *D) {
2171  VisitStmt(D);
2172  Record.push_back(D->getNumClauses());
2173  Record.push_back(D->getCollapsedNumber());
2174  VisitOMPExecutableDirective(D);
2175  Record.AddStmt(D->getIterationVariable());
2176  Record.AddStmt(D->getLastIteration());
2177  Record.AddStmt(D->getCalcLastIteration());
2178  Record.AddStmt(D->getPreCond());
2179  Record.AddStmt(D->getCond());
2180  Record.AddStmt(D->getInit());
2181  Record.AddStmt(D->getInc());
2182  Record.AddStmt(D->getPreInits());
2186  Record.AddStmt(D->getIsLastIterVariable());
2187  Record.AddStmt(D->getLowerBoundVariable());
2188  Record.AddStmt(D->getUpperBoundVariable());
2189  Record.AddStmt(D->getStrideVariable());
2190  Record.AddStmt(D->getEnsureUpperBound());
2191  Record.AddStmt(D->getNextLowerBound());
2192  Record.AddStmt(D->getNextUpperBound());
2193  Record.AddStmt(D->getNumIterations());
2194  }
2196  Record.AddStmt(D->getPrevLowerBoundVariable());
2197  Record.AddStmt(D->getPrevUpperBoundVariable());
2198  Record.AddStmt(D->getDistInc());
2199  Record.AddStmt(D->getPrevEnsureUpperBound());
2202  Record.AddStmt(D->getCombinedEnsureUpperBound());
2203  Record.AddStmt(D->getCombinedInit());
2204  Record.AddStmt(D->getCombinedCond());
2205  Record.AddStmt(D->getCombinedNextLowerBound());
2206  Record.AddStmt(D->getCombinedNextUpperBound());
2207  Record.AddStmt(D->getCombinedDistCond());
2208  Record.AddStmt(D->getCombinedParForInDistCond());
2209  }
2210  for (auto I : D->counters()) {
2211  Record.AddStmt(I);
2212  }
2213  for (auto I : D->private_counters()) {
2214  Record.AddStmt(I);
2215  }
2216  for (auto I : D->inits()) {
2217  Record.AddStmt(I);
2218  }
2219  for (auto I : D->updates()) {
2220  Record.AddStmt(I);
2221  }
2222  for (auto I : D->finals()) {
2223  Record.AddStmt(I);
2224  }
2225  for (Stmt *S : D->dependent_counters())
2226  Record.AddStmt(S);
2227  for (Stmt *S : D->dependent_inits())
2228  Record.AddStmt(S);
2229  for (Stmt *S : D->finals_conditions())
2230  Record.AddStmt(S);
2231 }
2232 
2233 void ASTStmtWriter::VisitOMPParallelDirective(OMPParallelDirective *D) {
2234  VisitStmt(D);
2235  Record.push_back(D->getNumClauses());
2236  VisitOMPExecutableDirective(D);
2237  Record.AddStmt(D->getTaskReductionRefExpr());
2238  Record.push_back(D->hasCancel() ? 1 : 0);
2240 }
2241 
2242 void ASTStmtWriter::VisitOMPSimdDirective(OMPSimdDirective *D) {
2243  VisitOMPLoopDirective(D);
2245 }
2246 
2247 void ASTStmtWriter::VisitOMPForDirective(OMPForDirective *D) {
2248  VisitOMPLoopDirective(D);
2249  Record.AddStmt(D->getTaskReductionRefExpr());
2250  Record.push_back(D->hasCancel() ? 1 : 0);
2252 }
2253 
2254 void ASTStmtWriter::VisitOMPForSimdDirective(OMPForSimdDirective *D) {
2255  VisitOMPLoopDirective(D);
2257 }
2258 
2259 void ASTStmtWriter::VisitOMPSectionsDirective(OMPSectionsDirective *D) {
2260  VisitStmt(D);
2261  Record.push_back(D->getNumClauses());
2262  VisitOMPExecutableDirective(D);
2263  Record.AddStmt(D->getTaskReductionRefExpr());
2264  Record.push_back(D->hasCancel() ? 1 : 0);
2266 }
2267 
2268 void ASTStmtWriter::VisitOMPSectionDirective(OMPSectionDirective *D) {
2269  VisitStmt(D);
2270  VisitOMPExecutableDirective(D);
2271  Record.push_back(D->hasCancel() ? 1 : 0);
2273 }
2274 
2275 void ASTStmtWriter::VisitOMPSingleDirective(OMPSingleDirective *D) {
2276  VisitStmt(D);
2277  Record.push_back(D->getNumClauses());
2278  VisitOMPExecutableDirective(D);
2280 }
2281 
2282 void ASTStmtWriter::VisitOMPMasterDirective(OMPMasterDirective *D) {
2283  VisitStmt(D);
2284  VisitOMPExecutableDirective(D);
2286 }
2287 
2288 void ASTStmtWriter::VisitOMPCriticalDirective(OMPCriticalDirective *D) {
2289  VisitStmt(D);
2290  Record.push_back(D->getNumClauses());
2291  VisitOMPExecutableDirective(D);
2294 }
2295 
2296 void ASTStmtWriter::VisitOMPParallelForDirective(OMPParallelForDirective *D) {
2297  VisitOMPLoopDirective(D);
2298  Record.AddStmt(D->getTaskReductionRefExpr());
2299  Record.push_back(D->hasCancel() ? 1 : 0);
2301 }
2302 
2303 void ASTStmtWriter::VisitOMPParallelForSimdDirective(
2305  VisitOMPLoopDirective(D);
2307 }
2308 
2309 void ASTStmtWriter::VisitOMPParallelMasterDirective(
2311  VisitStmt(D);
2312  Record.push_back(D->getNumClauses());
2313  VisitOMPExecutableDirective(D);
2314  Record.AddStmt(D->getTaskReductionRefExpr());
2316 }
2317 
2318 void ASTStmtWriter::VisitOMPParallelSectionsDirective(
2320  VisitStmt(D);
2321  Record.push_back(D->getNumClauses());
2322  VisitOMPExecutableDirective(D);
2323  Record.AddStmt(D->getTaskReductionRefExpr());
2324  Record.push_back(D->hasCancel() ? 1 : 0);
2326 }
2327 
2328 void ASTStmtWriter::VisitOMPTaskDirective(OMPTaskDirective *D) {
2329  VisitStmt(D);
2330  Record.push_back(D->getNumClauses());
2331  VisitOMPExecutableDirective(D);
2332  Record.push_back(D->hasCancel() ? 1 : 0);
2334 }
2335 
2336 void ASTStmtWriter::VisitOMPAtomicDirective(OMPAtomicDirective *D) {
2337  VisitStmt(D);
2338  Record.push_back(D->getNumClauses());
2339  VisitOMPExecutableDirective(D);
2340  Record.AddStmt(D->getX());
2341  Record.AddStmt(D->getV());
2342  Record.AddStmt(D->getExpr());
2343  Record.AddStmt(D->getUpdateExpr());
2344  Record.push_back(D->isXLHSInRHSPart() ? 1 : 0);
2345  Record.push_back(D->isPostfixUpdate() ? 1 : 0);
2347 }
2348 
2349 void ASTStmtWriter::VisitOMPTargetDirective(OMPTargetDirective *D) {
2350  VisitStmt(D);
2351  Record.push_back(D->getNumClauses());
2352  VisitOMPExecutableDirective(D);
2354 }
2355 
2356 void ASTStmtWriter::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) {
2357  VisitStmt(D);
2358  Record.push_back(D->getNumClauses());
2359  VisitOMPExecutableDirective(D);
2361 }
2362 
2363 void ASTStmtWriter::VisitOMPTargetEnterDataDirective(
2365  VisitStmt(D);
2366  Record.push_back(D->getNumClauses());
2367  VisitOMPExecutableDirective(D);
2369 }
2370 
2371 void ASTStmtWriter::VisitOMPTargetExitDataDirective(
2373  VisitStmt(D);
2374  Record.push_back(D->getNumClauses());
2375  VisitOMPExecutableDirective(D);
2377 }
2378 
2379 void ASTStmtWriter::VisitOMPTargetParallelDirective(
2381  VisitStmt(D);
2382  Record.push_back(D->getNumClauses());
2383  VisitOMPExecutableDirective(D);
2384  Record.AddStmt(D->getTaskReductionRefExpr());
2385  Record.writeBool(D->hasCancel());
2387 }
2388 
2389 void ASTStmtWriter::VisitOMPTargetParallelForDirective(
2391  VisitOMPLoopDirective(D);
2392  Record.AddStmt(D->getTaskReductionRefExpr());
2393  Record.push_back(D->hasCancel() ? 1 : 0);
2395 }
2396 
2397 void ASTStmtWriter::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) {
2398  VisitStmt(D);
2399  VisitOMPExecutableDirective(D);
2401 }
2402 
2403 void ASTStmtWriter::VisitOMPBarrierDirective(OMPBarrierDirective *D) {
2404  VisitStmt(D);
2405  VisitOMPExecutableDirective(D);
2407 }
2408 
2409 void ASTStmtWriter::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) {
2410  VisitStmt(D);
2411  VisitOMPExecutableDirective(D);
2413 }
2414 
2415 void ASTStmtWriter::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) {
2416  VisitStmt(D);
2417  Record.push_back(D->getNumClauses());
2418  VisitOMPExecutableDirective(D);
2419  Record.AddStmt(D->getReductionRef());
2421 }
2422 
2423 void ASTStmtWriter::VisitOMPFlushDirective(OMPFlushDirective *D) {
2424  VisitStmt(D);
2425  Record.push_back(D->getNumClauses());
2426  VisitOMPExecutableDirective(D);
2428 }
2429 
2430 void ASTStmtWriter::VisitOMPDepobjDirective(OMPDepobjDirective *D) {
2431  VisitStmt(D);
2432  Record.push_back(D->getNumClauses());
2433  VisitOMPExecutableDirective(D);
2435 }
2436 
2437 void ASTStmtWriter::VisitOMPScanDirective(OMPScanDirective *D) {
2438  VisitStmt(D);
2439  Record.push_back(D->getNumClauses());
2440  VisitOMPExecutableDirective(D);
2442 }
2443 
2444 void ASTStmtWriter::VisitOMPOrderedDirective(OMPOrderedDirective *D) {
2445  VisitStmt(D);
2446  Record.push_back(D->getNumClauses());
2447  VisitOMPExecutableDirective(D);
2449 }
2450 
2451 void ASTStmtWriter::VisitOMPTeamsDirective(OMPTeamsDirective *D) {
2452  VisitStmt(D);
2453  Record.push_back(D->getNumClauses());
2454  VisitOMPExecutableDirective(D);
2456 }
2457 
2458 void ASTStmtWriter::VisitOMPCancellationPointDirective(
2460  VisitStmt(D);
2461  VisitOMPExecutableDirective(D);
2462  Record.push_back(uint64_t(D->getCancelRegion()));
2464 }
2465 
2466 void ASTStmtWriter::VisitOMPCancelDirective(OMPCancelDirective *D) {
2467  VisitStmt(D);
2468  Record.push_back(D->getNumClauses());
2469  VisitOMPExecutableDirective(D);
2470  Record.push_back(uint64_t(D->getCancelRegion()));
2472 }
2473 
2474 void ASTStmtWriter::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) {
2475  VisitOMPLoopDirective(D);
2476  Record.push_back(D->hasCancel() ? 1 : 0);
2478 }
2479 
2480 void ASTStmtWriter::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) {
2481  VisitOMPLoopDirective(D);
2483 }
2484 
2485 void ASTStmtWriter::VisitOMPMasterTaskLoopDirective(
2487  VisitOMPLoopDirective(D);
2488  Record.push_back(D->hasCancel() ? 1 : 0);
2490 }
2491 
2492 void ASTStmtWriter::VisitOMPMasterTaskLoopSimdDirective(
2494  VisitOMPLoopDirective(D);
2496 }
2497 
2498 void ASTStmtWriter::VisitOMPParallelMasterTaskLoopDirective(
2500  VisitOMPLoopDirective(D);
2501  Record.push_back(D->hasCancel() ? 1 : 0);
2503 }
2504 
2505 void ASTStmtWriter::VisitOMPParallelMasterTaskLoopSimdDirective(
2507  VisitOMPLoopDirective(D);
2509 }
2510 
2511 void ASTStmtWriter::VisitOMPDistributeDirective(OMPDistributeDirective *D) {
2512  VisitOMPLoopDirective(D);
2514 }
2515 
2516 void ASTStmtWriter::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) {
2517  VisitStmt(D);
2518  Record.push_back(D->getNumClauses());
2519  VisitOMPExecutableDirective(D);
2521 }
2522 
2523 void ASTStmtWriter::VisitOMPDistributeParallelForDirective(
2525  VisitOMPLoopDirective(D);
2526  Record.AddStmt(D->getTaskReductionRefExpr());
2527  Record.push_back(D->hasCancel() ? 1 : 0);
2529 }
2530 
2531 void ASTStmtWriter::VisitOMPDistributeParallelForSimdDirective(
2533  VisitOMPLoopDirective(D);
2535 }
2536 
2537 void ASTStmtWriter::VisitOMPDistributeSimdDirective(
2539  VisitOMPLoopDirective(D);
2541 }
2542 
2543 void ASTStmtWriter::VisitOMPTargetParallelForSimdDirective(
2545  VisitOMPLoopDirective(D);
2547 }
2548 
2549 void ASTStmtWriter::VisitOMPTargetSimdDirective(OMPTargetSimdDirective *D) {
2550  VisitOMPLoopDirective(D);
2552 }
2553 
2554 void ASTStmtWriter::VisitOMPTeamsDistributeDirective(
2556  VisitOMPLoopDirective(D);
2558 }
2559 
2560 void ASTStmtWriter::VisitOMPTeamsDistributeSimdDirective(
2562  VisitOMPLoopDirective(D);
2564 }
2565 
2566 void ASTStmtWriter::VisitOMPTeamsDistributeParallelForSimdDirective(
2568  VisitOMPLoopDirective(D);
2570 }
2571 
2572 void ASTStmtWriter::VisitOMPTeamsDistributeParallelForDirective(
2574  VisitOMPLoopDirective(D);
2575  Record.AddStmt(D->getTaskReductionRefExpr());
2576  Record.push_back(D->hasCancel() ? 1 : 0);
2578 }
2579 
2580 void ASTStmtWriter::VisitOMPTargetTeamsDirective(OMPTargetTeamsDirective *D) {
2581  VisitStmt(D);
2582  Record.push_back(D->getNumClauses());
2583  VisitOMPExecutableDirective(D);
2585 }
2586 
2587 void ASTStmtWriter::VisitOMPTargetTeamsDistributeDirective(
2589  VisitOMPLoopDirective(D);
2591 }
2592 
2593 void ASTStmtWriter::VisitOMPTargetTeamsDistributeParallelForDirective(
2595  VisitOMPLoopDirective(D);
2596  Record.AddStmt(D->getTaskReductionRefExpr());
2597  Record.push_back(D->hasCancel() ? 1 : 0);
2599 }
2600 
2601 void ASTStmtWriter::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
2603  VisitOMPLoopDirective(D);
2604  Code = serialization::
2606 }
2607 
2608 void ASTStmtWriter::VisitOMPTargetTeamsDistributeSimdDirective(
2610  VisitOMPLoopDirective(D);
2612 }
2613 
2614 //===----------------------------------------------------------------------===//
2615 // ASTWriter Implementation
2616 //===----------------------------------------------------------------------===//
2617 
2619  assert(SwitchCaseIDs.find(S) == SwitchCaseIDs.end() &&
2620  "SwitchCase recorded twice");
2621  unsigned NextID = SwitchCaseIDs.size();
2622  SwitchCaseIDs[S] = NextID;
2623  return NextID;
2624 }
2625 
2627  assert(SwitchCaseIDs.find(S) != SwitchCaseIDs.end() &&
2628  "SwitchCase hasn't been seen yet");
2629  return SwitchCaseIDs[S];
2630 }
2631 
2633  SwitchCaseIDs.clear();
2634 }
2635 
2636 /// Write the given substatement or subexpression to the
2637 /// bitstream.
2638 void ASTWriter::WriteSubStmt(Stmt *S) {
2639  RecordData Record;
2640  ASTStmtWriter Writer(*this, Record);
2641  ++NumStatements;
2642 
2643  if (!S) {
2644  Stream.EmitRecord(serialization::STMT_NULL_PTR, Record);
2645  return;
2646  }
2647 
2648  llvm::DenseMap<Stmt *, uint64_t>::iterator I = SubStmtEntries.find(S);
2649  if (I != SubStmtEntries.end()) {
2650  Record.push_back(I->second);
2651  Stream.EmitRecord(serialization::STMT_REF_PTR, Record);
2652  return;
2653  }
2654 
2655 #ifndef NDEBUG
2656  assert(!ParentStmts.count(S) && "There is a Stmt cycle!");
2657 
2658  struct ParentStmtInserterRAII {
2659  Stmt *S;
2660  llvm::DenseSet<Stmt *> &ParentStmts;
2661 
2662  ParentStmtInserterRAII(Stmt *S, llvm::DenseSet<Stmt *> &ParentStmts)
2663  : S(S), ParentStmts(ParentStmts) {
2664  ParentStmts.insert(S);
2665  }
2666  ~ParentStmtInserterRAII() {
2667  ParentStmts.erase(S);
2668  }
2669  };
2670 
2671  ParentStmtInserterRAII ParentStmtInserter(S, ParentStmts);
2672 #endif
2673 
2674  Writer.Visit(S);
2675 
2676  uint64_t Offset = Writer.Emit();
2677  SubStmtEntries[S] = Offset;
2678 }
2679 
2680 /// Flush all of the statements that have been added to the
2681 /// queue via AddStmt().
2682 void ASTRecordWriter::FlushStmts() {
2683  // We expect to be the only consumer of the two temporary statement maps,
2684  // assert that they are empty.
2685  assert(Writer->SubStmtEntries.empty() && "unexpected entries in sub-stmt map");
2686  assert(Writer->ParentStmts.empty() && "unexpected entries in parent stmt map");
2687 
2688  for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) {
2689  Writer->WriteSubStmt(StmtsToEmit[I]);
2690 
2691  assert(N == StmtsToEmit.size() && "record modified while being written!");
2692 
2693  // Note that we are at the end of a full expression. Any
2694  // expression records that follow this one are part of a different
2695  // expression.
2696  Writer->Stream.EmitRecord(serialization::STMT_STOP, ArrayRef<uint32_t>());
2697 
2698  Writer->SubStmtEntries.clear();
2699  Writer->ParentStmts.clear();
2700  }
2701 
2702  StmtsToEmit.clear();
2703 }
2704 
2705 void ASTRecordWriter::FlushSubStmts() {
2706  // For a nested statement, write out the substatements in reverse order (so
2707  // that a simple stack machine can be used when loading), and don't emit a
2708  // STMT_STOP after each one.
2709  for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) {
2710  Writer->WriteSubStmt(StmtsToEmit[N - I - 1]);
2711  assert(N == StmtsToEmit.size() && "record modified while being written!");
2712  }
2713 
2714  StmtsToEmit.clear();
2715 }
SourceLocation getRParenLoc() const
Definition: Stmt.h:2428
Expr * getInc()
Definition: Stmt.h:2484
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:614
unsigned getNumSemanticExprs() const
Definition: Expr.h:5990
A PredefinedExpr record.
Definition: ASTBitCodes.h:1574
const Expr * getSubExpr() const
Definition: Expr.h:984
A call to an overloaded operator written using operator syntax.
Definition: ExprCXX.h:82
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
Definition: ExprObjC.h:1566
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:423
The receiver is the instance of the superclass object.
Definition: ExprObjC.h:1097
Represents a single C99 designator.
Definition: Expr.h:4933
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: Expr.h:1363
SourceLocation getRBracLoc() const
Definition: Stmt.h:1472
Defines the clang::ASTContext interface.
A CompoundLiteralExpr record.
Definition: ASTBitCodes.h:1637
This represents &#39;#pragma omp distribute simd&#39; composite directive.
Definition: StmtOpenMP.h:3975
const BlockDecl * getBlockDecl() const
Definition: Expr.h:5808
Expr * getNextUpperBound() const
Definition: StmtOpenMP.h:1007
IdentifierInfo * getInputIdentifier(unsigned i) const
Definition: Stmt.h:3035
This represents &#39;#pragma omp master&#39; directive.
Definition: StmtOpenMP.h:1628
ConstantExprBitfields ConstantExprBits
Definition: Stmt.h:1016
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition: ExprCXX.h:1059
SourceLocation getRParenLoc() const
Definition: Stmt.h:2942
The null pointer literal (C++11 [lex.nullptr])
Definition: ExprCXX.h:729
unsigned getNumDecls() const
Gets the number of declarations in the unresolved set.
Definition: ExprCXX.h:2937
This represents &#39;#pragma omp task&#39; directive.
Definition: StmtOpenMP.h:2062
This represents a GCC inline-assembly statement extension.
Definition: Stmt.h:2919
Represents a &#39;co_await&#39; expression while the type of the promise is dependent.
Definition: ExprCXX.h:4719
SourceLocation getForLoc() const
Definition: StmtCXX.h:201
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
Definition: Expr.h:1299
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:4016
Expr * getUpperBoundVariable() const
Definition: StmtOpenMP.h:975
unsigned getNumInputs() const
Definition: Stmt.h:2831
SourceLocation getOpLoc() const
Definition: ExprObjC.h:1517
Expr * getSyntacticForm()
Return the syntactic form of this expression, i.e.
Definition: Expr.h:5970
SourceLocation getRParenLoc() const
Definition: Expr.h:3009
ObjCDictionaryElement getKeyValueElement(unsigned Index) const
Definition: ExprObjC.h:362
CompoundStmt * getBlock() const
Definition: Stmt.h:3310
An IndirectGotoStmt record.
Definition: ASTBitCodes.h:1547
SourceLocation getForLoc() const
Definition: Stmt.h:2497
SourceLocation getUsedLocation() const
Retrieve the location where this default argument was actually used.
Definition: ExprCXX.h:1253
uint64_t getValue() const
Definition: ExprCXX.h:2752
StringKind getKind() const
Definition: Expr.h:1847
An AddrLabelExpr record.
Definition: ASTBitCodes.h:1667
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Definition: Expr.h:3145
NameKind
The kind of the name stored in this DeclarationName.
Expr * getCond() const
Definition: Expr.h:4401
ObjCMethodDecl * getAtIndexMethodDecl() const
Definition: ExprObjC.h:886
Selector getSelector() const
Definition: ExprObjC.cpp:306
SourceRange getSourceRange() const
Definition: ExprCXX.h:3971
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:4258
SourceLocation getEllipsisLoc() const
Get the location of the ... in a case statement of the form LHS ... RHS.
Definition: Stmt.h:1607
SourceLocation getLParen() const
Get the location of the left parentheses &#39;(&#39;.
Definition: Expr.h:2103
const Expr * getSubExpr() const
Definition: ExprCXX.h:1167
Expr * getCond()
Definition: Stmt.h:2311
Expr * getExpr(unsigned Index)
getExpr - Return the Expr at the specified index.
Definition: Expr.h:4274
A CXXStaticCastExpr record.
Definition: ASTBitCodes.h:1798
ArrayRef< Expr * > dependent_counters()
Definition: StmtOpenMP.h:1147
unsigned getNumSubExprs() const
getNumSubExprs - Return the size of the SubExprs array.
Definition: Expr.h:4268
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:2619
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:2948
ArrayRef< ParmVarDecl * > getLocalParameters() const
Definition: ExprConcepts.h:508
VarDecl * getParameterPack() const
Get the parameter pack which this expression refers to.
Definition: ExprCXX.h:4353
SourceLocation TemplateKWLoc
The source location of the template keyword; this is used as part of the representation of qualified ...
Definition: TemplateBase.h:663
An AttributedStmt record.
Definition: ASTBitCodes.h:1526
CompoundStmt * getSubStmt()
Definition: Expr.h:4203
A CXXReinterpretCastExpr record.
Definition: ASTBitCodes.h:1804
const Expr * getInit(unsigned Init) const
Definition: Expr.h:4675
const DeclContext * getParentContext() const
If the SourceLocExpr has been resolved return the subexpression representing the resolved value...
Definition: Expr.h:4559
unsigned getNumAsmToks()
Definition: Stmt.h:3172
An ObjCBoolLiteralExpr record.
Definition: ASTBitCodes.h:1763
SourceLocation getRParenLoc() const
Definition: StmtObjC.h:107
bool isThrownVariableInScope() const
Determines whether the variable thrown by this expression (if any!) is within the innermost try block...
Definition: ExprCXX.h:1177
Expr *const * semantics_iterator
Definition: Expr.h:5992
ObjCProtocolDecl * getProtocol() const
Definition: ExprObjC.h:521
Represents a &#39;co_return&#39; statement in the C++ Coroutines TS.
Definition: StmtCXX.h:456
Stmt - This represents one statement.
Definition: Stmt.h:68
Expr * getLowerBoundVariable() const
Definition: StmtOpenMP.h:967
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition: Expr.h:2909
Expr * getDimensionExpression() const
Definition: ExprCXX.h:2754
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:2379
IfStmt - This represents an if/then/else.
Definition: Stmt.h:1866
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
Definition: Expr.h:2447
SourceLocation getRParenLoc() const
Definition: Expr.h:4255
SourceLocation getLocation() const
Definition: Expr.h:1659
ObjCMethodDecl * setAtIndexMethodDecl() const
Definition: ExprObjC.h:890
void AddNestedNameSpecifierLoc(NestedNameSpecifierLoc NNS)
Emit a nested name specifier with source-location information.
Definition: ASTWriter.cpp:5510
unsigned getNumOutputs() const
Definition: Stmt.h:2809
This represents &#39;#pragma omp for simd&#39; directive.
Definition: StmtOpenMP.h:1361
ArrayRef< CleanupObject > getObjects() const
Definition: ExprCXX.h:3324
Expr * getBase() const
Definition: Expr.h:3139
const StringLiteral * getAsmString() const
Definition: Stmt.h:2947
TypeSourceInfo * getTypeSourceInfo() const
Definition: Expr.h:3336
An ImplicitValueInitExpr record.
Definition: ASTBitCodes.h:1661
iterator end()
Definition: DeclGroup.h:105
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:89
This represents &#39;#pragma omp teams distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:4389
An ImplicitCastExpr record.
Definition: ASTBitCodes.h:1631
Stmt * getHandlerBlock() const
Definition: StmtCXX.h:51
SourceLocation getBeginLoc() const
Returns starting location of directive kind.
Definition: StmtOpenMP.h:225
Expr * CounterUpdate
Updater for the internal counter: ++CounterVD;.
Definition: ExprOpenMP.h:245
llvm::APFloat getValue() const
Definition: Expr.h:1618
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:5300
FunctionDecl * getOperatorNew() const
Definition: ExprCXX.h:2211
unsigned getScale() const
Definition: Expr.h:1533
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:3027
A BuiltinBitCastExpr record.
Definition: ASTBitCodes.h:1816
DeclarationNameInfo getNameInfo() const
Retrieve the name of the entity we&#39;re testing for, along with location information.
Definition: StmtCXX.h:288
const Expr * getSubExpr() const
Definition: Expr.h:4486
Defines the C++ template declaration subclasses.
Opcode getOpcode() const
Definition: Expr.h:3688
This represents &#39;#pragma omp parallel master&#39; directive.
Definition: StmtOpenMP.h:1913
unsigned getNumSubExprs() const
Retrieve the total number of subexpressions in this designated initializer expression, including the actual initialized value and any expressions that occur within array and array-range designators.
Definition: Expr.h:5108
SourceLocation getIdentLoc() const
Definition: Stmt.h:1778
Represents an attribute applied to a statement.
Definition: Stmt.h:1808
Expr * getBase()
Fetches base expression of array shaping expression.
Definition: ExprOpenMP.h:214
ParenExpr - This represents a parethesized expression, e.g.
Definition: Expr.h:2080
NamedDecl * getDecl() const
A CXXOperatorCallExpr record.
Definition: ASTBitCodes.h:1780
bool hasQualifier() const
Determines whether this member expression actually had a C++ nested-name-specifier prior to the name ...
Definition: Expr.h:3159
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:4541
A CXXTemporaryObjectExpr record.
Definition: ASTBitCodes.h:1795
Represents Objective-C&#39;s @throw statement.
Definition: StmtObjC.h:332
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called...
Definition: ExprCXX.h:1537
SourceLocation getLocation() const
Definition: ExprCXX.h:743
const RecordDecl * getCapturedRecordDecl() const
Retrieve the record declaration for captured variables.
Definition: Stmt.h:3535
SourceLocation getRParenLoc() const
Definition: Expr.h:2592
SourceLocation getKeywordLoc() const
Definition: ExprCXX.h:4748
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1426
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: Stmt.h:1283
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:3565
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent...
Definition: ExprCXX.h:2707
bool getIsCXXTry() const
Definition: Stmt.h:3352
SourceLocation getLParenLoc() const
Definition: Expr.h:3607
A constant expression context.
Definition: ASTBitCodes.h:1571
Expr * getCombinedParForInDistCond() const
Definition: StmtOpenMP.h:1095
A container of type source information.
Definition: Type.h:6373
This represents &#39;#pragma omp parallel for&#39; directive.
Definition: StmtOpenMP.h:1752
MS property subscript expression.
Definition: ExprCXX.h:960
IdentKind getIdentKind() const
Definition: Expr.h:2011
SourceLocation getGotoLoc() const
Definition: Stmt.h:2577
SourceLocation getRParenLoc() const
Definition: ExprCXX.h:2070
This represents &#39;#pragma omp target teams distribute parallel for&#39; combined directive.
Definition: StmtOpenMP.h:4610
Expr * Update
Update expression for the originally specified iteration variable, calculated as VD = Begin + Counter...
Definition: ExprOpenMP.h:243
Expr * getCombinedEnsureUpperBound() const
Definition: StmtOpenMP.h:1059
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
Definition: ExprCXX.h:4406
float __ovld __cnfn distance(float p0, float p1)
Returns the distance between p0 and p1.
SourceLocation getAccessorLoc() const
Definition: Expr.h:5760
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
Definition: Expr.h:4336
unsigned getDeclRefExprAbbrev() const
Definition: ASTWriter.h:701
VarDecl * CounterVD
Internal normalized counter.
Definition: ExprOpenMP.h:237
const Expr * getSubExpr() const
Definition: Expr.h:1695
SourceLocation getAtLoc() const
Definition: ExprObjC.h:69
SourceLocation getCoawaitLoc() const
Definition: StmtCXX.h:202
Expr * getIndexExpr(unsigned Idx)
Definition: Expr.h:2475
SourceLocation getEndLoc() const
Returns ending location of directive.
Definition: StmtOpenMP.h:227
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:2047
This represents &#39;#pragma omp target exit data&#39; directive.
Definition: StmtOpenMP.h:2824
Stmt * getSubStmt()
Definition: Stmt.h:1699
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
Definition: StmtOpenMP.h:1960
const VarDecl * getNRVOCandidate() const
Retrieve the variable that might be used for the named return value optimization. ...
Definition: Stmt.h:2719
SourceLocation getLParenLoc() const
Definition: Stmt.h:2499
bool hasTemplateKWAndArgsInfo() const
Definition: Expr.h:1309
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:3042
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC &#39;id&#39; type.
Definition: ExprObjC.h:1482
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:3303
ArrayRef< Expr * > dependent_inits()
Definition: StmtOpenMP.h:1153
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprCXX.h:859
SourceLocation getOperatorLoc() const
Retrieve the location of the &#39;.&#39; or &#39;->&#39; operator.
Definition: ExprCXX.h:2537
SourceLocation getAtLoc() const
Definition: ExprObjC.h:471
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
Definition: ExprCXX.h:2668
SourceRange getSourceRange() const
Definition: ExprCXX.h:2336
ObjCInterfaceDecl * getClassReceiver() const
Definition: ExprObjC.h:767
Expr * getCombinedUpperBoundVariable() const
Definition: StmtOpenMP.h:1053
SourceLocation getColonLoc() const
Definition: Expr.h:3972
bool isArrow() const
Definition: ExprObjC.h:1509
SourceLocation getLeftLoc() const
Definition: ExprObjC.h:1406
Expr * getCalcLastIteration() const
Definition: StmtOpenMP.h:935
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition: ExprCXX.h:761
Stmt * getThen()
Definition: Stmt.h:1953
SourceLocation getIfLoc() const
Definition: Stmt.h:2025
unsigned getNumPlacementArgs() const
Definition: ExprCXX.h:2229
TypeSourceInfo * getArgumentTypeInfo() const
Definition: Expr.h:2562
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
Definition: ExprCXX.h:3095
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range that covers this offsetof node.
Definition: Expr.h:2393
capture_iterator capture_begin()
Retrieve an iterator pointing to the first capture.
Definition: Stmt.h:3560
A CXXConstructExpr record.
Definition: ASTBitCodes.h:1789
unsigned getNumExpressions() const
Definition: Expr.h:2490
SourceLocation getLocation() const
Retrieve the location of the literal.
Definition: Expr.h:1487
raw_arg_iterator raw_arg_begin()
Definition: ExprCXX.h:2321
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will call.
Definition: ExprCXX.h:1652
A C++ throw-expression (C++ [except.throw]).
Definition: ExprCXX.h:1147
Expr * getExprOperand() const
Definition: ExprCXX.h:852
Represents an expression – generally a full-expression – that introduces cleanups to be run at the ...
Definition: ExprCXX.h:3296
TypeSourceInfo * getArg(unsigned I) const
Retrieve the Ith argument.
Definition: ExprCXX.h:2671
Represents a parameter to a function.
Definition: Decl.h:1595
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprObjC.h:162
SourceLocation getRParenLoc() const
Definition: Expr.h:5705
SourceLocation getLocation() const
Retrieve the location of the literal.
Definition: Expr.h:1529
void AddString(StringRef Str)
Emit a string.
iterator begin() const
Definition: ExprCXX.h:4361
bool isXLHSInRHSPart() const
Return true if helper update expression has form &#39;OpaqueValueExpr(x) binop OpaqueValueExpr(expr)&#39; and...
Definition: StmtOpenMP.h:2620
void AddSourceRange(SourceRange Range)
Emit a source range.
A ShuffleVectorExpr record.
Definition: ASTBitCodes.h:1682
SourceLocation getBuiltinLoc() const
Definition: Expr.h:4408
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:420
void AddTypeSourceInfo(TypeSourceInfo *TInfo)
Emits a reference to a declarator info.
Definition: ASTWriter.cpp:5296
Expr * getExprOperand() const
Definition: ExprCXX.h:1063
const Stmt * getSubStmt() const
Definition: StmtObjC.h:379
SourceLocation getRParenLoc() const
Retrieve the location of the closing parenthesis.
Definition: ExprCXX.h:396
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:1764
Represents a C99 designated initializer expression.
Definition: Expr.h:4858
SourceLocation getAtLoc() const
Definition: ExprObjC.h:525
NamedDecl * getFoundDecl() const
Definition: ASTConcept.h:150
An OffsetOfExpr record.
Definition: ASTBitCodes.h:1604
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition: Decl.h:272
TypeSourceInfo * getEncodedTypeSourceInfo() const
Definition: ExprObjC.h:430
Expr * getSemanticForm()
Get an equivalent semantic form for this expression.
Definition: ExprCXX.h:302
TypeSourceInfo * getScopeTypeInfo() const
Retrieve the scope type in a qualified pseudo-destructor expression.
Definition: ExprCXX.h:2548
SourceLocation getKeywordLoc() const
Definition: StmtCXX.h:476
Stmt * getBody()
Definition: Stmt.h:2420
An ObjCAtThrowStmt record.
Definition: ASTBitCodes.h:1757
SourceLocation getTildeLoc() const
Retrieve the location of the &#39;~&#39;.
Definition: ExprCXX.h:2555
FieldDecl * getField() const
For a field offsetof node, returns the field.
Definition: Expr.h:2372
SourceLocation getRParenLoc() const
Definition: Expr.h:6151
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(), or __builtin_FILE().
Definition: Expr.h:4519
void AddTypeRef(QualType T)
Emit a reference to a type.
An element in an Objective-C dictionary literal.
Definition: ExprObjC.h:263
A DesignatedInitExpr record.
Definition: ASTBitCodes.h:1646
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
Definition: ExprConcepts.h:471
This represents &#39;#pragma omp parallel&#39; directive.
Definition: StmtOpenMP.h:357
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition: Expr.h:4234
bool cleanupsHaveSideEffects() const
Definition: ExprCXX.h:3336
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
Definition: StmtOpenMP.h:3886
QualType getComputationResultType() const
Definition: Expr.h:3928
SourceLocation getRParen() const
Get the location of the right parentheses &#39;)&#39;.
Definition: Expr.h:2107
DeclStmt * getConditionVariableDeclStmt()
If this SwitchStmt has a condition variable, return the faux DeclStmt associated with the creation of...
Definition: Stmt.h:2192
bool isFileScope() const
Definition: Expr.h:3330
Frontend produces RecoveryExprs on semantic errors that prevent creating other well-formed expression...
Definition: Expr.h:6246
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
Definition: StmtOpenMP.h:1492
SourceLocation getAmpAmpLoc() const
Definition: Expr.h:4156
Expr * getEnsureUpperBound() const
Definition: StmtOpenMP.h:991
NameKind getNameKind() const
Determine what kind of name this is.
SourceLocation getEndLoc() const
Definition: Stmt.h:1280
Represents a member of a struct/union/class.
Definition: Decl.h:2746
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:3840
Represents a place-holder for an object not to be initialized by anything.
Definition: Expr.h:5156
NonTypeTemplateParmDecl * getParameter() const
Definition: ExprCXX.h:4230
const DeclarationNameInfo & getNameInfo() const
Gets the full name info.
Definition: ExprCXX.h:2940
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:2366
Expr * getInc() const
Definition: StmtOpenMP.h:951
SourceLocation getLabelLoc() const
Definition: Expr.h:4158
SourceLocation getRBraceLoc() const
Definition: Expr.h:4771
SourceLocation getOperatorLoc() const
Definition: Expr.h:2589
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Definition: Expr.h:4436
ArrayRef< Expr * > updates()
Definition: StmtOpenMP.h:1135
SourceLocation getRParenLoc() const
Definition: Expr.h:3610
The iterator over UnresolvedSets.
Definition: UnresolvedSet.h:32
This represents &#39;#pragma omp target simd&#39; directive.
Definition: StmtOpenMP.h:4113
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
Definition: Expr.h:1152
Represents a C++ member access expression for which lookup produced a set of overloaded functions...
Definition: ExprCXX.h:3763
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:5736
const DeclGroupRef getDeclGroup() const
Definition: Stmt.h:1275
OpenMPDirectiveKind getDirectiveKind() const
Definition: StmtOpenMP.h:301
bool isAllEnumCasesCovered() const
Returns true if the SwitchStmt is a switch of an enum value and all cases have been explicitly covere...
Definition: Stmt.h:2229
Expr * getSubExpr()
Definition: Expr.h:3412
This represents &#39;#pragma omp barrier&#39; directive.
Definition: StmtOpenMP.h:2177
SourceLocation getQuestionLoc() const
Definition: Expr.h:3971
void AddTemplateParameterList(const TemplateParameterList *TemplateParams)
Emit a template parameter list.
Definition: ASTWriter.cpp:5564
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp, [NSNumber numberWithInt:42]];.
Definition: ExprObjC.h:190
unsigned getCharByteWidth() const
Definition: Expr.h:1845
This is a common base class for loop directives (&#39;omp simd&#39;, &#39;omp for&#39;, &#39;omp for simd&#39; etc...
Definition: StmtOpenMP.h:433
ArrayRef< SourceRange > getBracketsRanges() const
Fetches source ranges for the brackets os the array shaping expression.
Definition: ExprOpenMP.h:209
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition: ExprCXX.h:4256
This represents &#39;#pragma omp critical&#39; directive.
Definition: StmtOpenMP.h:1677
OpenMPDirectiveKind getCancelRegion() const
Get cancellation region for the current cancellation point.
Definition: StmtOpenMP.h:3160
bool hadArrayRangeDesignator() const
Definition: Expr.h:4792
SourceLocation getCatchLoc() const
Definition: StmtCXX.h:48
Selector getSelector() const
Definition: ExprObjC.h:468
void AddIdentifierRef(const IdentifierInfo *II)
Emit a reference to an identifier.
Represents Objective-C&#39;s @catch statement.
Definition: StmtObjC.h:77
SourceLocation getOpLoc() const
Definition: ExprObjC.h:597
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:3599
IndirectGotoStmt - This represents an indirect goto.
Definition: Stmt.h:2561
Describes an C or C++ initializer list.
Definition: Expr.h:4627
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition: ExprCXX.h:809
This represents &#39;#pragma omp distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:3811
bool isArrow() const
Definition: ExprObjC.h:584
ArrayRef< Stmt const * > getParamMoves() const
Definition: StmtCXX.h:417
This represents &#39;#pragma omp teams distribute parallel for simd&#39; composite directive.
Definition: StmtOpenMP.h:4318
Expr * getKeyExpr() const
Definition: ExprObjC.h:883
ASTWriter::RecordDataImpl & getRecordData() const
Extract the underlying record storage.
unsigned getNumExpansions() const
Get the number of parameters in this parameter pack.
Definition: ExprCXX.h:4365
unsigned getLength() const
Definition: Expr.h:1844
ForStmt - This represents a &#39;for (init;cond;inc)&#39; stmt.
Definition: Stmt.h:2451
ArrayRef< Expr * > finals()
Definition: StmtOpenMP.h:1141
Expr * getIsLastIterVariable() const
Definition: StmtOpenMP.h:959
FunctionDecl * getOperatorDelete() const
Definition: ExprCXX.h:2391
Expr * getBaseExpr() const
Definition: ExprObjC.h:880
TemplateArgument getArgumentPack() const
Retrieve the template argument pack containing the substituted template arguments.
Definition: ExprCXX.cpp:1543
bool isElidable() const
Whether this construction is elidable.
Definition: ExprCXX.h:1504
Expr * getOperand() const
Definition: ExprCXX.h:3967
unsigned getIntegerLiteralAbbrev() const
Definition: ASTWriter.h:703
const Expr * getThrowExpr() const
Definition: StmtObjC.h:344
bool isGlobalNew() const
Definition: ExprCXX.h:2252
SourceLocation getParameterPackLocation() const
Retrieve the location of the parameter pack name.
Definition: ExprCXX.h:4287
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
Definition: ExprCXX.h:2387
LabelDecl * getDecl() const
Definition: Stmt.h:1781
Expr * getX()
Get &#39;x&#39; part of the associated expression/statement.
Definition: StmtOpenMP.h:2604
ArrayRef< Expr * > getDimensions() const
Fetches the dimensions for array shaping expression.
Definition: ExprOpenMP.h:204
SourceLocation getLBracLoc() const
Definition: Stmt.h:1471
A reference to a previously [de]serialized Stmt record.
Definition: ASTBitCodes.h:1508
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
Definition: ExprCXX.h:1949
SourceLocation getRParenLoc() const
Definition: StmtCXX.h:204
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
Definition: Expr.h:429
path_iterator path_begin()
Definition: Expr.h:3432
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:2485
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:6000
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: ExprCXX.h:3705
Expr * getIterationVariable() const
Definition: StmtOpenMP.h:927
LifetimeExtendedTemporaryDecl * getLifetimeExtendedTemporaryDecl()
Definition: ExprCXX.h:4446
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3644
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:3890
bool constructsVBase() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
Definition: ExprCXX.h:1656
Stmt * getInit()
Definition: Stmt.h:2464
Expr * getOutputExpr(unsigned i)
Definition: Stmt.cpp:439
iterator begin()
Definition: DeclGroup.h:99
bool hadMultipleCandidates() const
Returns true if this member expression refers to a method that was resolved from an overloaded set ha...
Definition: Expr.h:3266
unsigned getCharacterLiteralAbbrev() const
Definition: ASTWriter.h:702
SourceLocation getThrowLoc() const
Definition: ExprCXX.h:1170
unsigned getResultExprIndex() const
Return the index of the result-bearing expression into the semantics expressions, or PseudoObjectExpr...
Definition: Expr.h:5975
const StringLiteral * getInputConstraintLiteral(unsigned i) const
Definition: Stmt.h:3048
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:3246
ConceptDecl * getNamedConcept() const
Definition: ASTConcept.h:154
labels_range labels()
Definition: Stmt.h:3091
This represents &#39;#pragma omp cancellation point&#39; directive.
Definition: StmtOpenMP.h:3115
ObjCStringLiteral, used for Objective-C string literals i.e.
Definition: ExprObjC.h:52
SourceLocation getEqualOrColonLoc() const
Retrieve the location of the &#39;=&#39; that precedes the initializer value itself, if present.
Definition: Expr.h:5083
const CallExpr * getConfig() const
Definition: ExprCXX.h:258
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
Definition: StmtOpenMP.h:3038
bool isArrow() const
Definition: ExprCXX.h:944
CaseStmt - Represent a case statement.
Definition: Stmt.h:1532
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
Definition: Expr.h:6189
Expr * getCond()
Definition: Stmt.h:2483
IdentKind getIdentKind() const
Definition: Expr.h:4540
SourceLocation getContinueLoc() const
Definition: Stmt.h:2619
This represents &#39;#pragma omp teams&#39; directive.
Definition: StmtOpenMP.h:3057
Expr * getInit() const
Definition: StmtOpenMP.h:947
SourceLocation getEndLoc() const
Definition: Expr.h:4564
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:3373
FieldDecl * getField()
Get the field whose initializer will be used.
Definition: ExprCXX.h:1308
Helper class for OffsetOfExpr.
Definition: Expr.h:2308
A marker record that indicates that we are at the end of an expression.
Definition: ASTBitCodes.h:1502
This represents &#39;#pragma omp teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:4247
Represents binding an expression to a temporary.
Definition: ExprCXX.h:1378
StringLiteral * getClobberStringLiteral(unsigned i)
Definition: Stmt.h:3128
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
Definition: ExprCXX.h:4648
Expr * Key
The key for the dictionary element.
Definition: ExprObjC.h:265
SourceLocation getBuiltinLoc() const
Definition: Expr.h:4497
CXXTemporary * getTemporary()
Definition: ExprCXX.h:1396
bool isOpenMPWorksharingDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a worksharing directive.
ObjCMethodDecl * getArrayWithObjectsMethod() const
Definition: ExprObjC.h:241
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition: ExprCXX.h:1822
CXXRecordDecl * getNamingClass()
Gets the &#39;naming class&#39; (in the sense of C++0x [class.access.base]p5) of the lookup.
Definition: ExprCXX.h:3103
NestedNameSpecifierLoc getQualifierLoc() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name, with source-location information.
Definition: Expr.h:1281
bool isTypeDependent() const
Determines whether the type of this expression depends on.
Definition: Expr.h:186
SourceLocation getTryLoc() const
Definition: Stmt.h:3349
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3503
FPOptionsOverride getStoredFPFeatures() const
Get FPFeatures from trailing storage.
Definition: Expr.h:3830
This represents &#39;#pragma omp scan&#39; directive.
Definition: StmtOpenMP.h:4848
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "for" statement, if any.
Definition: Stmt.cpp:930
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
Definition: Expr.h:2182
SourceLocation getNameLoc() const
Definition: ExprCXX.h:4222
TypeSourceInfo * getTypeSourceInfo() const
Definition: ExprCXX.h:2066
Stmt * getBody()
Definition: Stmt.h:2147
void AddAPInt(const llvm::APInt &Value)
Emit an integral value.
SourceLocation getLocation() const
Definition: ExprObjC.h:107
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1207
Stmt * getInit()
Definition: Stmt.h:2009
bool isExact() const
Definition: Expr.h:1651
bool isTypeOperand() const
Definition: ExprCXX.h:1052
SourceLocation getTokenLocation() const
getTokenLocation - The location of the __null token.
Definition: Expr.h:4450
llvm::APFloatBase::Semantics getRawSemantics() const
Get a raw enumeration value representing the floating-point semantics of this literal (32-bit IEEE...
Definition: Expr.h:1628
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:3637
Represents the this expression in C++.
Definition: ExprCXX.h:1108
ObjCMethodDecl * getDictWithObjectsMethod() const
Definition: ExprObjC.h:376
arg_iterator arg_end()
Definition: Expr.h:2967
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:3430
TypeSourceInfo * getAllocatedTypeSourceInfo() const
Definition: ExprCXX.h:2190
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
Definition: TemplateBase.h:652
NestedNameSpecifierLoc getQualifierLoc() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name...
Definition: Expr.h:3164
void AddAPValue(const APValue &Value)
Emit an APvalue.
Definition: ASTWriter.cpp:5139
TypeSourceInfo * getQueriedTypeSourceInfo() const
Definition: ExprCXX.h:2750
bool isArrayForm() const
Definition: ExprCXX.h:2378
unsigned RecordSwitchCaseID(SwitchCase *S)
Record an ID for the given switch-case statement.
const ObjCAtCatchStmt * getCatchStmt(unsigned I) const
Retrieve a @catch statement.
Definition: StmtObjC.h:217
This represents &#39;#pragma omp target parallel for simd&#39; directive.
Definition: StmtOpenMP.h:4043
ArrayRef< Expr * > private_counters()
Definition: StmtOpenMP.h:1123
OpenMP 5.0 [2.1.5, Array Sections].
Definition: ExprOpenMP.h:56
ConditionalOperator - The ?: ternary operator.
Definition: Expr.h:3982
TypeSourceInfo * getTypeSourceInfo() const
Definition: ExprCXX.h:1783
This represents &#39;#pragma omp depobj&#39; directive.
Definition: StmtOpenMP.h:2400
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
Definition: ExprCXX.h:1528
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition: ExprCXX.h:2471
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
Definition: ExprCXX.h:3923
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:1364
unsigned NumTemplateArgs
The number of template arguments in TemplateArgs.
Definition: TemplateBase.h:666
SourceLocation getRBracket() const
Definition: ExprObjC.h:871
bool isMicrosoftABI() const
Returns whether this is really a Win64 ABI va_arg expression.
Definition: Expr.h:4491
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1557
void AddDeclarationNameLoc(const DeclarationNameLoc &DNLoc, DeclarationName Name)
Definition: ASTWriter.cpp:5465
Expr ** getSubExprs()
Definition: Expr.h:6127
CompoundStmt * getSubStmt() const
Retrieve the compound statement that will be included in the program only if the existence of the sym...
Definition: StmtCXX.h:292
This represents &#39;#pragma omp taskgroup&#39; directive.
Definition: StmtOpenMP.h:2269
void AddCXXTemporary(const CXXTemporary *Temp)
Emit a CXXTemporary.
Definition: ASTWriter.cpp:5251
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
Definition: ExprCXX.h:1498
QualType getComputationLHSType() const
Definition: Expr.h:3925
bool hasStoredFPFeatures() const
Definition: Expr.h:3827
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:2517
SourceLocation getTryLoc() const
Definition: StmtCXX.h:94
bool isConstexpr() const
Definition: Stmt.h:2039
Expr * getCombinedLowerBoundVariable() const
Definition: StmtOpenMP.h:1047
SourceLocation getLocation() const
Definition: ExprCXX.h:1500
SourceLocation getRBracketLoc() const
Definition: ExprCXX.h:997
SourceLocation getLocation() const
Definition: Expr.h:1270
unsigned getSwitchCaseID(SwitchCase *S)
Retrieve the ID for the given switch-case statement.
InitListExpr * getUpdater() const
Definition: Expr.h:5215
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition: Expr.h:999
Represents a call to the builtin function __builtin_va_arg.
Definition: Expr.h:4470
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
Definition: StmtOpenMP.h:1825
SourceLocation getLabelLoc() const
Definition: Stmt.h:2540
bool isImplicitAccess() const
True if this is an implicit access, i.e.
Definition: ExprCXX.h:3593
SourceLocation getThrowLoc() const LLVM_READONLY
Definition: StmtObjC.h:348
unsigned Offset
Definition: Format.cpp:2020
static unsigned getNumSubExprs(AtomicOp Op)
Determine the number of arguments the specified atomic builtin should have.
Definition: Expr.cpp:4680
unsigned getValue() const
Definition: Expr.h:1585
This represents &#39;#pragma omp distribute&#39; directive.
Definition: StmtOpenMP.h:3685
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition: Expr.h:5876
SourceLocation getDestroyedTypeLoc() const
Retrieve the starting location of the type being destroyed.
Definition: ExprCXX.h:2579
ObjCMethodDecl * getBoxingMethod() const
Definition: ExprObjC.h:147
SourceLocation getFinallyLoc() const
Definition: Stmt.h:3307
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type...
Definition: ExprCXX.h:2047
ADLCallKind getADLCallKind() const
Definition: Expr.h:2887
const Stmt * getAssociatedStmt() const
Returns statement associated with the directive.
Definition: StmtOpenMP.h:253
SourceLocation getOperatorLoc() const
Retrieve the location of the &#39;->&#39; or &#39;.&#39; operator.
Definition: ExprCXX.h:3862
Expr * getCond() const
Definition: Expr.h:4005
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1829
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition: Decl.h:4064
llvm::MutableArrayRef< Designator > designators()
Definition: Expr.h:5061
DeclAccessPair getFoundDecl() const
Retrieves the declaration found by lookup.
Definition: Expr.h:3149
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:4467
This represents one expression.
Definition: Expr.h:110
SourceLocation getElseLoc() const
Definition: Stmt.h:2028
DeclStmt * getEndStmt()
Definition: StmtCXX.h:165
SourceLocation End
unsigned getTemplateDepth() const
Definition: Expr.h:4215
IdentifierInfo * getFieldName() const
For a field or identifier offsetof node, returns the name of the field.
Definition: Expr.cpp:1527
CXXBaseSpecifier * getBase() const
For a base class node, returns the base specifier.
Definition: Expr.h:2382
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:3859
StringRef getClobber(unsigned i) const
Definition: Stmt.h:3223
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
Definition: StmtOpenMP.h:419
bool isImplicitAccess() const
True if this is an implicit access, i.e., one in which the member being accessed was not written in t...
Definition: ExprCXX.cpp:1449
SourceLocation getWhileLoc() const
Definition: Stmt.h:2363
This represents &#39;#pragma omp master taskloop&#39; directive.
Definition: StmtOpenMP.h:3385
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
Definition: StmtOpenMP.h:2043
This file defines the classes used to store parsed information about declaration-specifiers and decla...
unsigned getPackLength() const
Retrieve the length of the parameter pack.
Definition: ExprCXX.h:4157
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:3286
Represents a C++ functional cast expression that builds a temporary object.
Definition: ExprCXX.h:1754
A C++ const_cast expression (C++ [expr.const.cast]).
Definition: ExprCXX.h:538
SourceLocation getLocation() const
Definition: ExprCXX.h:1119
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:5796
Field designator where only the field name is known.
Definition: ASTBitCodes.h:1961
VarDecl * getExceptionDecl() const
Definition: StmtCXX.h:49
IdentifierInfo * getDestroyedTypeIdentifier() const
In a dependent pseudo-destructor expression for which we do not have full type information on the des...
Definition: ExprCXX.h:2571
Expr * getCallee()
Definition: Expr.h:2883
unsigned getNumInits() const
Definition: Expr.h:4657
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1345
This represents &#39;#pragma omp target teams distribute parallel for simd&#39; combined directive.
Definition: StmtOpenMP.h:4707
raw_arg_iterator raw_arg_end()
Definition: ExprCXX.h:2322
bool isArrow() const
Determine whether this pseudo-destructor expression was written using an &#39;->&#39; (otherwise, it used a &#39;.
Definition: ExprCXX.h:2534
Stmt * getBody()
Definition: Stmt.h:2323
A CXXAddrspaceCastExpr record.
Definition: ASTBitCodes.h:1810
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
Definition: ExprObjC.h:306
const CompoundStmt * getSynchBody() const
Definition: StmtObjC.h:297
SourceLocation getLParenLoc() const
Definition: Expr.h:5408
Expr * getRHS()
Definition: Stmt.h:1633
bool hasQualifier() const
Determine whether this declaration reference was preceded by a C++ nested-name-specifier, e.g., N::foo.
Definition: Expr.h:1277
Represents Objective-C&#39;s @synchronized statement.
Definition: StmtObjC.h:277
ObjCSelectorExpr used for @selector in Objective-C.
Definition: ExprObjC.h:454
A CXXStdInitializerListExpr record.
Definition: ASTBitCodes.h:1822
TypeSourceInfo * getTypeSourceInfo() const
Definition: Expr.h:2454
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:4080
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:5857
An ArraySubscriptExpr record.
Definition: ASTBitCodes.h:1610
SourceLocation getAtTryLoc() const
Retrieve the location of the @ in the @try.
Definition: StmtObjC.h:204
bool refersToEnclosingVariableOrCapture() const
Does this DeclRefExpr refer to an enclosing local or a captured variable?
Definition: Expr.h:1392
IdentifierInfo & getAccessor() const
Definition: Expr.h:5757
This represents &#39;#pragma omp target teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:4780
ArrayTypeTrait getTrait() const
Definition: ExprCXX.h:2746
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
Definition: StmtOpenMP.h:4686
decls_iterator decls_begin() const
Definition: ExprCXX.h:2926
unsigned size() const
Definition: Stmt.h:1392
unsigned getNumClauses() const
Get number of clauses.
Definition: StmtOpenMP.h:241
An ArrayInitLoopExpr record.
Definition: ASTBitCodes.h:1655
Expr * getDistInc() const
Definition: StmtOpenMP.h:1035
A PseudoObjectExpr record.
Definition: ASTBitCodes.h:1694
SourceRange getAngleBrackets() const LLVM_READONLY
Definition: ExprCXX.h:400
Expr * getNextLowerBound() const
Definition: StmtOpenMP.h:999
Kind getKind() const
Determine what kind of offsetof node this is.
Definition: Expr.h:2362
QualType getType() const
Definition: Expr.h:142
SourceLocation getEndLoc() const
Definition: Expr.h:6269
Expr * getPrevEnsureUpperBound() const
Definition: StmtOpenMP.h:1041
SourceLocation getKeywordLoc() const
Retrieve the location of the __if_exists or __if_not_exists keyword.
Definition: StmtCXX.h:274
capture_init_range capture_inits()
Definition: Stmt.h:3582
This represents &#39;#pragma omp for&#39; directive.
Definition: StmtOpenMP.h:1272
An ObjCIndirectCopyRestoreExpr record.
Definition: ASTBitCodes.h:1739
Expr * getElement(unsigned Index)
getElement - Return the Element at the specified index.
Definition: ExprObjC.h:232
const DeclarationNameInfo & getConceptNameInfo() const
Definition: ASTConcept.h:142
Optional< unsigned > NumExpansions
The number of elements this pack expansion will expand to, if this is a pack expansion and is known...
Definition: ExprObjC.h:275
SourceLocation getSwitchLoc() const
Definition: Stmt.h:2208
LabelDecl * getLabel() const
Definition: Stmt.h:2535
bool hasInitializer() const
Whether this new-expression has any initializer at all.
Definition: ExprCXX.h:2255
const Stmt * getTryBody() const
Retrieve the @try body.
Definition: StmtObjC.h:208
Represents a folding of a pack over an operator.
Definition: ExprCXX.h:4516
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
Definition: Stmt.h:2677
This represents &#39;#pragma omp target teams&#39; directive.
Definition: StmtOpenMP.h:4482
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
Definition: Expr.h:5882
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:2366
This represents a Microsoft inline-assembly statement extension.
Definition: Stmt.h:3142
SourceLocation getDoLoc() const
Definition: Stmt.h:2424
SwitchCase * getSwitchCaseList()
Definition: Stmt.h:2204
SourceLocation getAtLoc() const
Definition: StmtObjC.h:388
ObjCMethodDecl * getImplicitPropertyGetter() const
Definition: ExprObjC.h:708
A DesignatedInitUpdateExpr record.
Definition: ASTBitCodes.h:1649
SourceLocation getRBracketLoc() const
Definition: Expr.h:2660
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:2131
Expr * getInputExpr(unsigned i)
Definition: Stmt.cpp:741
Expr * getOutputExpr(unsigned i)
Definition: Stmt.cpp:737
bool isOpenMPTaskLoopDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a taskloop directive.
void AddSelectorRef(Selector S)
Emit a Selector (which is a smart pointer reference).
Definition: ASTWriter.cpp:5228
IteratorRange getIteratorRange(unsigned I)
Gets the iterator range for the given iterator.
Definition: Expr.cpp:4896
SourceLocation getMemberLoc() const
getMemberLoc - Return the location of the "member", in X->F, it is the location of &#39;F&#39;...
Definition: Expr.h:3251
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:5092
AtomicOp getOp() const
Definition: Expr.h:6124
A member reference to an MSPropertyDecl.
Definition: ExprCXX.h:889
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition: ExprCXX.h:4198
const OffsetOfNode & getComponent(unsigned Idx) const
Definition: Expr.h:2461
This represents &#39;#pragma omp cancel&#39; directive.
Definition: StmtOpenMP.h:3174
Expr * getTrueExpr() const
getTrueExpr - Return the subexpression which will be evaluated if the condition evaluates to true; th...
Definition: Expr.h:4091
Expr * getCond()
Definition: Stmt.h:1941
ValueDecl * getDecl()
Definition: Expr.h:1262
An ObjCAvailabilityCheckExpr record.
Definition: ASTBitCodes.h:1766
SourceLocation getLocation() const
Definition: Expr.h:2015
SourceLocation getRParenLoc() const
Definition: Expr.h:4500
SourceLocation getForLoc() const
Definition: StmtObjC.h:52
const Expr * getSubExpr() const
Definition: Expr.h:2095
ObjCBridgeCastKind getBridgeKind() const
Determine which kind of bridge is being performed via this cast.
Definition: ExprObjC.h:1652
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprCXX.h:1072
const Expr * getSubExpr() const
Definition: ExprCXX.h:1400
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr.cast]), which uses the syntax (Type)expr.
Definition: Expr.h:3581
const DeclContext * getUsedContext() const
Definition: ExprCXX.h:1249
Expr * getLHS()
An array access can be written A[4] or 4[A] (both are equivalent).
Definition: Expr.h:2641
LambdaExprBitfields LambdaExprBits
Definition: Stmt.h:1061
bool getValue() const
Definition: ExprCXX.h:703
bool hadMultipleCandidates() const
Returns true if this expression refers to a function that was resolved from an overloaded set having ...
Definition: Expr.h:1375
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Definition: ASTConcept.h:158
void writeOMPClause(OMPClause *C)
Definition: ASTWriter.cpp:6129
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1...
Definition: Expr.h:1683
Expr * getStride()
Get stride of array section.
Definition: ExprOpenMP.h:108
This represents &#39;#pragma omp flush&#39; directive.
Definition: StmtOpenMP.h:2343
An ObjCForCollectionStmt record.
Definition: ASTBitCodes.h:1742
ArrayRef< concepts::Requirement * > getRequirements() const
Definition: ExprConcepts.h:514
This represents &#39;#pragma omp parallel for simd&#39; directive.
Definition: StmtOpenMP.h:1846
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
Definition: Expr.h:436
DoStmt - This represents a &#39;do/while&#39; stmt.
Definition: Stmt.h:2395
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
Definition: Stmt.h:2760
SourceLocation getOperatorLoc() const
Retrieve the location of the &#39;->&#39; or &#39;.&#39; operator.
Definition: ExprCXX.h:3613
SourceLocation getLParenLoc() const
Retrieve the location of the left parentheses (&#39;(&#39;) that precedes the argument list.
Definition: ExprCXX.h:3425
A MS-style AsmStmt record.
Definition: ASTBitCodes.h:1568
void push_back(uint64_t N)
Minimal vector-like interface.
This represents &#39;#pragma omp parallel master taskloop&#39; directive.
Definition: StmtOpenMP.h:3533
Expr * getLastIteration() const
Definition: StmtOpenMP.h:931
bool isPostfixUpdate() const
Return true if &#39;v&#39; expression must be updated to original value of &#39;x&#39;, false if &#39;v&#39; must be updated ...
Definition: StmtOpenMP.h:2623
Expr * getArgument()
Definition: ExprCXX.h:2393
This represents &#39;#pragma omp target enter data&#39; directive.
Definition: StmtOpenMP.h:2765
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
Definition: StmtOpenMP.h:2944
Expr * getStrideVariable() const
Definition: StmtOpenMP.h:983
This represents &#39;#pragma omp master taskloop simd&#39; directive.
Definition: StmtOpenMP.h:3465
SourceLocation getEndLoc() const LLVM_READONLY
Definition: ExprConcepts.h:539
bool getValue() const
Definition: ExprCXX.h:3973
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Definition: ExprCXX.h:456
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
Definition: Expr.h:1102
Expr * getBase() const
Definition: Expr.h:5212
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition: Expr.h:4302
unsigned getNumArgs() const
Return the number of actual arguments in this message, not counting the receiver. ...
Definition: ExprObjC.h:1372
Expr * getCombinedDistCond() const
Definition: StmtOpenMP.h:1089
const Stmt * getPreInits() const
Definition: StmtOpenMP.h:955
#define false
Definition: stdbool.h:17
SourceLocation getLParenLoc() const
Definition: Expr.h:3333
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr...
Definition: ExprCXX.h:2834
A field in a dependent type, known only by its name.
Definition: Expr.h:2317
This captures a statement into a function.
Definition: Stmt.h:3417
Represents a call to an inherited base class constructor from an inheriting constructor.
Definition: ExprCXX.h:1617
ExpressionTrait getTrait() const
Definition: ExprCXX.h:2812
unsigned path_size() const
Definition: Expr.h:3431
Token * getAsmToks()
Definition: Stmt.h:3173
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition: Expr.h:5926
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:215
bool inheritedFromVBase() const
Determine whether the inherited constructor is inherited from a virtual base of the object we constru...
Definition: ExprCXX.h:1666
StringLiteral * getFunctionName()
Definition: Expr.h:2018
unsigned getNumExprs() const
Return the number of expressions in this paren list.
Definition: Expr.h:5389
This represents &#39;#pragma omp single&#39; directive.
Definition: StmtOpenMP.h:1572
Encodes a location in the source.
SourceLocation getColonLocSecond() const
Definition: ExprOpenMP.h:121
body_range body()
Definition: Stmt.h:1397
Expr * getRetValue()
Definition: Stmt.h:2710
StringRef getOutputConstraint(unsigned i) const
Definition: Stmt.h:3183
Decl * getIteratorDecl(unsigned I)
Gets the iterator declaration for the given iterator.
Definition: Expr.cpp:4892
SourceLocation getOperatorLoc() const
Definition: Expr.h:3685
const Stmt * getCatchBody() const
Definition: StmtObjC.h:93
unsigned getNumHandlers() const
Definition: StmtCXX.h:106
Expr * getSubExpr() const
Definition: Expr.h:2178
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
Definition: StmtOpenMP.h:1341
NestedNameSpecifierLoc getQualifierLoc() const
Retrieves the nested-name-specifier that qualifies the type name, with source-location information...
Definition: ExprCXX.h:2523
This is a basic class for representing single OpenMP executable directive.
Definition: StmtOpenMP.h:33
SourceLocation getBuiltinLoc() const
getBuiltinLoc - Return the location of the __builtin_astype token.
Definition: Expr.h:5879
bool hasUnresolvedUsing() const
Determine whether the lookup results contain an unresolved using declaration.
Definition: ExprCXX.h:3853
CastKind getCastKind() const
Definition: Expr.h:3406
Expr * getSubExpr(unsigned Idx) const
Definition: Expr.h:5110
SourceLocation getOperatorLoc() const
Retrieve the location of the cast operator keyword, e.g., static_cast.
Definition: ExprCXX.h:393
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
Definition: ExprCXX.h:2093
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c dictionary literal.
Definition: ExprObjC.h:360
OMPClause * getClause(unsigned i) const
Returns specified clause.
Definition: StmtOpenMP.h:247
Expr * getLHS()
Definition: Stmt.h:1621
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit...
Definition: ExprCXX.h:610
Represents a C++2a __builtin_bit_cast(T, v) expression.
Definition: ExprCXX.h:4794
SourceLocation getEllipsisLoc() const
Retrieve the location of the ellipsis that describes this pack expansion.
Definition: ExprCXX.h:4040
Expr * getExpr()
Get &#39;expr&#39; part of the associated expression/statement.
Definition: StmtOpenMP.h:2630
Represents a call to a member function that may be written either with member call syntax (e...
Definition: ExprCXX.h:182
SourceLocation getExceptLoc() const
Definition: Stmt.h:3266
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprObjC.h:382
SourceLocation getLParenLoc() const
Definition: ExprOpenMP.h:192
Stmt * getElse()
Definition: Stmt.h:1962
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
Definition: Stmt.h:1257
SourceLocation getColonLocFirst() const
Definition: ExprOpenMP.h:118
DeclarationNameInfo getDirectiveName() const
Return name of the directive.
Definition: StmtOpenMP.h:1736
SourceLocation getLBraceLoc() const
Definition: Stmt.h:3165
A CXXFunctionalCastExpr record.
Definition: ASTBitCodes.h:1813
Expr * getCond()
Definition: Stmt.h:2135
SourceLocation getStrTokenLoc(unsigned TokNum) const
Get one of the string literal token.
Definition: Expr.h:1879
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:2191
SourceLocation RAngleLoc
The source location of the right angle bracket (&#39;>&#39;).
Definition: TemplateBase.h:657
SourceLocation getRParenLoc() const
Definition: Expr.h:4212
An ObjCEncodeExpr record.
Definition: ASTBitCodes.h:1712
SourceLocation getRParenLoc() const
Definition: ExprObjC.h:425
SourceLocation getSuperLoc() const
Retrieve the location of the &#39;super&#39; keyword for a class or instance message to &#39;super&#39;, otherwise an invalid source location.
Definition: ExprObjC.h:1291
This represents &#39;#pragma omp taskwait&#39; directive.
Definition: StmtOpenMP.h:2223
SourceLocation getAtLoc() const
Definition: ExprObjC.h:423
SourceRange getSourceRange() const
Definition: ExprObjC.h:1705
bool isPascal() const
Definition: Expr.h:1856
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:6060
UnaryExprOrTypeTrait getKind() const
Definition: Expr.h:2548
bool isArray() const
Definition: ExprCXX.h:2216
bool isOpenMPLoopBoundSharingDirective(OpenMPDirectiveKind Kind)
Checks if the specified directive kind is one of the composite or combined directives that need loop ...
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition: ExprObjC.h:504
bool isValueDependent() const
Determines whether the value of this expression depends on.
Definition: Expr.h:169
SourceLocation getLParenLoc() const
Definition: Expr.h:4210
SourceLocation getGotoLoc() const
Definition: Stmt.h:2538
SourceLocation getAtFinallyLoc() const
Definition: StmtObjC.h:148
AccessSpecifier getAccess() const
static void addConstraintSatisfaction(ASTRecordWriter &Record, const ASTConstraintSatisfaction &Satisfaction)
An ObjCIsa Expr record.
Definition: ASTBitCodes.h:1736
const StringLiteral * getOutputConstraintLiteral(unsigned i) const
Definition: Stmt.h:3020
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:3484
Stmt * getCapturedStmt()
Retrieve the statement being captured.
Definition: Stmt.h:3518
void AddAttributes(ArrayRef< const Attr *> Attrs)
Emit a list of attributes.
Definition: ASTWriter.cpp:4252
SourceLocation getAtCatchLoc() const
Definition: StmtObjC.h:105
CharacterKind getKind() const
Definition: Expr.h:1578
This represents &#39;#pragma omp target&#39; directive.
Definition: StmtOpenMP.h:2648
Expr * getInputExpr(unsigned i)
Definition: Stmt.cpp:450
void AddSourceLocation(SourceLocation Loc)
Emit a source location.
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:2118
Expr * getV()
Get &#39;v&#39; part of the associated expression/statement.
Definition: StmtOpenMP.h:2625
bool isParenTypeId() const
Definition: ExprCXX.h:2246
SourceLocation getEndLoc() const
Definition: Stmt.h:3167
NullStmtBitfields NullStmtBits
Definition: Stmt.h:999
Expr * getSubExpr()
Definition: ExprObjC.h:144
An expression trait intrinsic.
Definition: ExprCXX.h:2777
ArrayRef< Expr * > exprs()
Definition: Expr.h:5404
const ObjCMethodDecl * getMethodDecl() const
Definition: ExprObjC.h:1346
An AtomicExpr record.
Definition: ASTBitCodes.h:1697
A static requirement that can be used in a requires-expression to check properties of types and expre...
Definition: ExprConcepts.h:145
VarDecl * getConditionVariable()
Retrieve the variable declared in this "switch" statement, if any.
Definition: Stmt.cpp:993
DeclStmt * getConditionVariableDeclStmt()
If this WhileStmt has a condition variable, return the faux DeclStmt associated with the creation of ...
Definition: Stmt.h:2351
This represents &#39;#pragma omp ordered&#39; directive.
Definition: StmtOpenMP.h:2457
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition: Expr.h:4186
void AddAPFloat(const llvm::APFloat &Value)
Emit a floating-point value.
Definition: ASTWriter.cpp:5127
This represents &#39;#pragma omp target update&#39; directive.
Definition: StmtOpenMP.h:3752
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:128
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:3449
bool isArgumentType() const
Definition: Expr.h:2558
SourceLocation getKeywordLoc() const
Definition: Stmt.h:1511
MSGuidDecl * getGuidDecl() const
Definition: ExprCXX.h:1068
Expr * getArrayFiller()
If this initializer list initializes an array with more elements than there are initializers in the l...
Definition: Expr.h:4716
SourceLocation getStarLoc() const
Definition: Stmt.h:2579
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:2286
bool isPartOfExplicitCast() const
Definition: Expr.h:3503
FunctionDecl * getOperatorDelete() const
Definition: ExprCXX.h:2213
This represents &#39;#pragma omp parallel master taskloop simd&#39; directive.
Definition: StmtOpenMP.h:3616
Representation of a Microsoft __if_exists or __if_not_exists statement with a dependent name...
Definition: StmtCXX.h:252
unsigned getExprImplicitCastAbbrev() const
Definition: ASTWriter.h:704
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
Definition: Expr.cpp:226
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
Definition: Expr.h:1386
void AddDeclarationNameInfo(const DeclarationNameInfo &NameInfo)
Definition: ASTWriter.cpp:5496
void VisitStmt(Stmt *S)
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:3145
Expr * Value
The value of the dictionary element.
Definition: ExprObjC.h:268
const Expr * getInitializer() const
Definition: Expr.h:3326
ArrayRef< Expr * > finals_conditions()
Definition: StmtOpenMP.h:1159
Expr * getLHS() const
Definition: Expr.h:3693
void AddTemplateKWAndArgsInfo(const ASTTemplateKWAndArgsInfo &ArgInfo, const TemplateArgumentLoc *Args)
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:3891
SourceLocation getLocation() const LLVM_READONLY
Definition: ExprCXX.h:1668
A POD class for pairing a NamedDecl* with an access specifier.
Represents a C11 generic selection.
Definition: Expr.h:5454
ArrayRef< TemplateArgument > getPartialArguments() const
Get.
Definition: ExprCXX.h:4173
const Expr * getBase() const
Definition: Expr.h:5753
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:4141
SourceLocation getColonLoc(unsigned I) const
Gets the location of the first &#39;:&#39; in the range for the given iterator definition.
Definition: Expr.cpp:4919
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:4324
Represents a template argument.
Definition: TemplateBase.h:51
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
Definition: Expr.h:4082
SourceLocation getMemberLoc() const
Definition: ExprCXX.h:945
TypeSourceInfo * getDestroyedTypeInfo() const
Retrieve the source location information for the type being destroyed.
Definition: ExprCXX.h:2564
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:4098
NullStmt - This is the null statement ";": C99 6.8.3p3.
Definition: Stmt.h:1329
bool isTypeOperand() const
Definition: ExprCXX.h:841
StringRef getInputConstraint(unsigned i) const
Definition: Stmt.h:3196
SourceLocation getLocation() const
Definition: ExprCXX.h:709
unsigned getNumAssocs() const
The number of association expressions.
Definition: Expr.h:5620
Dataflow Directional Tag Classes.
Expr * getPrevUpperBoundVariable() const
Definition: StmtOpenMP.h:1029
bool isVolatile() const
Definition: Stmt.h:2796
An InitListExpr record.
Definition: ASTBitCodes.h:1643
VarDecl * getConditionVariable()
Retrieve the variable declared in this "while" statement, if any.
Definition: Stmt.cpp:1054
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:1924
SourceLocation getLocation() const
Definition: ExprObjC.h:759
RequiresExprBodyDecl * getBody() const
Definition: ExprConcepts.h:512
A CXXBoolLiteralExpr record.
Definition: ASTBitCodes.h:1825
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
Definition: ExprCXX.h:2352
IdentifierInfo * getOutputIdentifier(unsigned i) const
Definition: Stmt.h:3009
bool isSimple() const
Definition: Stmt.h:2793
OverloadedOperatorKind getOperator() const
Returns the kind of overloaded operator that this expression refers to.
Definition: ExprCXX.h:112
unsigned getAsOpaqueInt() const
Definition: LangOptions.h:498
NonTypeTemplateParmDecl * getParameterPack() const
Retrieve the non-type template parameter pack being substituted.
Definition: ExprCXX.h:4284
MSPropertyDecl * getPropertyDecl() const
Definition: ExprCXX.h:943
static void addSubstitutionDiagnostic(ASTRecordWriter &Record, const concepts::Requirement::SubstitutionDiagnostic *D)
const Stmt * getFinallyBody() const
Definition: StmtObjC.h:139
An ExtVectorElementExpr record.
Definition: ASTBitCodes.h:1640
ArrayRef< const Attr * > getAttrs() const
Definition: Stmt.h:1844
bool isImplicit() const
Definition: ExprCXX.h:1125
Expr * getCond() const
Definition: StmtOpenMP.h:943
This represents &#39;#pragma omp section&#39; directive.
Definition: StmtOpenMP.h:1509
This represents &#39;#pragma omp teams distribute&#39; directive.
Definition: StmtOpenMP.h:4179
QualType getSuperType() const
Retrieve the type referred to by &#39;super&#39;.
Definition: ExprObjC.h:1326
FPOptionsOverride getFPFeatures() const
Definition: ExprCXX.h:171
Expr * getTaskReductionRefExpr()
Returns special task reduction reference expression.
Definition: StmtOpenMP.h:4463
SourceLocation getBeginLoc() const
Definition: Expr.h:6268
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:3421
AccessSpecifier getAccess() const
Definition: DeclBase.h:478
A runtime availability query.
Definition: ExprObjC.h:1686
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:4690
VarDecl *const * iterator
Iterators over the parameters which the parameter pack expanded into.
Definition: ExprCXX.h:4360
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
Definition: ExprCXX.h:498
This represents &#39;#pragma omp simd&#39; directive.
Definition: StmtOpenMP.h:1207
Stmt * getHandler() const
Definition: Stmt.h:3358
Represents a &#39;co_yield&#39; expression.
Definition: ExprCXX.h:4768
SourceLocation getLBraceLoc() const
Definition: Expr.h:4769
SourceLocation getSemiLoc() const
Definition: Stmt.h:1340
An ObjCAutoreleasePoolStmt record.
Definition: ASTBitCodes.h:1760
Expr * getOperand() const
Retrieve the operand of the &#39;co_return&#39; statement.
Definition: StmtCXX.h:480
const Expr * getReductionRef() const
Returns reference to the task_reduction return variable.
Definition: StmtOpenMP.h:2321
A C++ addrspace_cast expression (currently only enabled for OpenCL).
Definition: ExprCXX.h:574
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition: ExprCXX.h:4004
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
Definition: ExprCXX.h:1517
bool isImplicit() const
Definition: ExprCXX.h:4709
A CXXDynamicCastExpr record.
Definition: ASTBitCodes.h:1801
const NestedNameSpecifierLoc & getNestedNameSpecifierLoc() const
Definition: ASTConcept.h:138
DependentScopeDeclRefExprBitfields DependentScopeDeclRefExprBits
Definition: Stmt.h:1051
const Expr * getSynchExpr() const
Definition: StmtObjC.h:305
Iterator range representation begin:end[:step].
Definition: ExprOpenMP.h:278
Expr * getUpdateExpr()
Get helper expression of the form &#39;OpaqueValueExpr(x) binop OpaqueValueExpr(expr)&#39; or &#39;OpaqueValueExp...
Definition: StmtOpenMP.h:2611
SourceLocation getParameterPackLocation() const
Get the location of the parameter pack.
Definition: ExprCXX.h:4356
semantics_iterator semantics_begin()
Definition: Expr.h:5994
bool isIfExists() const
Determine whether this is an __if_exists statement.
Definition: StmtCXX.h:277
SourceLocation getBeginLoc() const
Definition: Expr.h:4563
NestedNameSpecifierLoc getQualifierLoc() const
Definition: ExprCXX.h:946
ExplicitCastExpr - An explicit cast written in the source code.
Definition: Expr.h:3547
This represents &#39;#pragma omp atomic&#39; directive.
Definition: StmtOpenMP.h:2513
child_range children()
Definition: ExprCXX.h:4668
Expr * getCombinedInit() const
Definition: StmtOpenMP.h:1065
SourceLocation getLParenLoc() const
Definition: ExprObjC.h:1649
DeclStmt * getConditionVariableDeclStmt()
If this IfStmt has a condition variable, return the faux DeclStmt associated with the creation of tha...
Definition: Stmt.h:1997
void AddVersionTuple(const VersionTuple &Version)
Emit a version tuple.
An ObjCAtFinallyStmt record.
Definition: ASTBitCodes.h:1748
SourceLocation getRParenLoc() const
Definition: ExprObjC.h:526
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition: ExprCXX.h:848
CXXNewExprBitfields CXXNewExprBits
Definition: Stmt.h:1048
RequiresExprBitfields RequiresExprBits
Definition: Stmt.h:1062
llvm::APInt getValue() const
Definition: Expr.h:1445
Represents a __leave statement.
Definition: Stmt.h:3378
unsigned getCollapsedNumber() const
Get number of collapsed loops.
Definition: StmtOpenMP.h:925
Expr * getCombinedNextLowerBound() const
Definition: StmtOpenMP.h:1077
ArrayRef< Expr * > counters()
Definition: StmtOpenMP.h:1117
LabelDecl * getLabel() const
Definition: Expr.h:4164
path_iterator path_end()
Definition: Expr.h:3433
iterator end() const
Definition: ExprCXX.h:4362
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition: ExprCXX.h:3950
SwitchStmt - This represents a &#39;switch&#39; stmt.
Definition: Stmt.h:2075
unsigned getByteLength() const
Definition: Expr.h:1843
SourceLocation getColonColonLoc() const
Retrieve the location of the &#39;::&#39; in a qualified pseudo-destructor expression.
Definition: ExprCXX.h:2552
Expr * getCombinedNextUpperBound() const
Definition: StmtOpenMP.h:1083
SourceLocation getBeginLoc() const
Definition: ExprCXX.h:2402
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:3197
SourceLocation getRParenLoc() const
Definition: StmtObjC.h:54
child_range children()
Definition: Expr.h:6263
Represents the body of a coroutine.
Definition: StmtCXX.h:317
TemplateArgumentLoc * getTrailingTemplateArgumentLoc()
Return the optional template arguments.
Definition: ExprCXX.h:3933
Location wrapper for a TemplateArgument.
Definition: TemplateBase.h:451
Expr * getBase() const
Definition: ExprObjC.h:1507
bool isOpenMPDistributeDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a distribute directive.
Iterator for iterating over Stmt * arrays that contain only T *.
Definition: Stmt.h:1104
SourceLocation getBuiltinLoc() const
Definition: Expr.h:4252
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition: Expr.h:2612
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c array literal.
Definition: ExprObjC.h:229
SourceLocation getLeaveLoc() const
Definition: Stmt.h:3388
Represents Objective-C&#39;s collection statement.
Definition: StmtObjC.h:23
An ObjCAtSynchronizedStmt record.
Definition: ASTBitCodes.h:1754
arg_iterator arg_begin()
Definition: Expr.h:2964
ArrayRef< Expr * > inits()
Definition: StmtOpenMP.h:1129
unsigned getNumObjects() const
Definition: ExprCXX.h:3329
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:409
SourceLocation getLocation() const
Retrieve the location of this expression.
Definition: Expr.h:1124
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:2320
Expr * getCond() const
getCond - Return the condition expression; this is defined in terms of the opaque value...
Definition: Expr.h:4086
Represents a call to a CUDA kernel function.
Definition: ExprCXX.h:235
SourceLocation getRParenLoc() const
Definition: Expr.h:4411
Represents a &#39;co_await&#39; expression.
Definition: ExprCXX.h:4683
bool isUnique() const
Definition: Expr.h:1160
TypeTraitExprBitfields TypeTraitExprBits
Definition: Stmt.h:1050
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
Definition: ASTConcept.h:77
bool isDelegateInitCall() const
isDelegateInitCall - Answers whether this message send has been tagged as a "delegate init call"...
Definition: ExprObjC.h:1403
Stmt * getInit()
Definition: Stmt.h:2156
A CXXMemberCallExpr record.
Definition: ASTBitCodes.h:1783
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
Definition: ExprCXX.h:2291
SourceRange getDirectInitRange() const
Definition: ExprCXX.h:2335
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the member name, with source location information...
Definition: ExprCXX.h:3624
Expr * getNumIterations() const
Definition: StmtOpenMP.h:1015
Opcode getOpcode() const
Definition: Expr.h:2173
Expr * getArg(unsigned Arg)
Return the specified argument.
Definition: ExprCXX.h:1577
StringRef getBytes() const
Allow access to clients that need the byte representation, such as ASTWriterStmt::VisitStringLiteral(...
Definition: Expr.h:1823
Represents Objective-C&#39;s @finally statement.
Definition: StmtObjC.h:127
SourceLocation getRParenLoc() const
Definition: Stmt.h:2368
SourceLocation getDefaultLoc() const
Definition: Expr.h:5704
StringRef getAsmString() const
Definition: Stmt.h:3176
bool hasAssociatedStmt() const
Returns true if directive has associated statement.
Definition: StmtOpenMP.h:250
Expr * getPrevLowerBoundVariable() const
Definition: StmtOpenMP.h:1023
uint64_t EmitStmt(unsigned Code, unsigned Abbrev=0)
Emit the record to the stream, preceded by its substatements.
const Expr * getBase() const
Definition: ExprObjC.h:580
bool isArrow() const
Determine whether this member expression used the &#39;->&#39; operator; otherwise, it used the &#39;...
Definition: ExprCXX.h:3610
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: Expr.h:3227
SourceLocation getColonLoc() const
Definition: Stmt.h:1513
Represents a base class of a C++ class.
Definition: DeclCXX.h:146
unsigned getNumClobbers() const
Definition: Stmt.h:2841
bool isImplicit() const
Definition: StmtCXX.h:489
SourceLocation getRParenLoc() const
Definition: Stmt.h:2501
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:548
child_range children()
Definition: ExprCXX.h:4756
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof...
Definition: ExprCXX.h:4168
Represents an expression that might suspend coroutine execution; either a co_await or co_yield expres...
Definition: ExprCXX.h:4598
DeclStmt * getRangeStmt()
Definition: StmtCXX.h:161
A ConvertVectorExpr record.
Definition: ASTBitCodes.h:1685
unsigned arg_size() const
Retrieve the number of arguments.
Definition: ExprCXX.h:3439
Expr * getRHS() const
Definition: Expr.h:4405
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:3382
SourceLocation getAsmLoc() const
Definition: Stmt.h:2790
GotoStmt - This represents a direct goto.
Definition: Stmt.h:2522