clang  19.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/ASTConcept.h"
15 #include "clang/AST/ASTContext.h"
16 #include "clang/AST/DeclCXX.h"
17 #include "clang/AST/DeclObjC.h"
18 #include "clang/AST/DeclTemplate.h"
19 #include "clang/AST/ExprOpenMP.h"
20 #include "clang/AST/StmtVisitor.h"
21 #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;
35 
37  unsigned AbbrevToUse;
38 
39  /// A helper that can help us to write a packed bit across function
40  /// calls. For example, we may write seperate bits in seperate functions:
41  ///
42  /// void VisitA(A* a) {
43  /// Record.push_back(a->isSomething());
44  /// }
45  ///
46  /// void Visitb(B *b) {
47  /// VisitA(b);
48  /// Record.push_back(b->isAnother());
49  /// }
50  ///
51  /// In such cases, it'll be better if we can pack these 2 bits. We achieve
52  /// this by writing a zero value in `VisitA` and recorded that first and add
53  /// the new bit to the recorded value.
54  class PakedBitsWriter {
55  public:
56  PakedBitsWriter(ASTRecordWriter &Record) : RecordRef(Record) {}
57  ~PakedBitsWriter() { assert(!CurrentIndex); }
58 
59  void addBit(bool Value) {
60  assert(CurrentIndex && "Writing Bits without recording first!");
61  PackingBits.addBit(Value);
62  }
63  void addBits(uint32_t Value, uint32_t BitsWidth) {
64  assert(CurrentIndex && "Writing Bits without recording first!");
65  PackingBits.addBits(Value, BitsWidth);
66  }
67 
68  void writeBits() {
69  if (!CurrentIndex)
70  return;
71 
72  RecordRef[*CurrentIndex] = (uint32_t)PackingBits;
73  CurrentIndex = std::nullopt;
74  PackingBits.reset(0);
75  }
76 
77  void updateBits() {
78  writeBits();
79 
80  CurrentIndex = RecordRef.size();
81  RecordRef.push_back(0);
82  }
83 
84  private:
85  BitsPacker PackingBits;
86  ASTRecordWriter &RecordRef;
87  std::optional<unsigned> CurrentIndex;
88  };
89 
90  PakedBitsWriter CurrentPackingBits;
91 
92  public:
94  : Writer(Writer), Record(Writer, Record),
95  Code(serialization::STMT_NULL_PTR), AbbrevToUse(0),
96  CurrentPackingBits(this->Record) {}
97 
98  ASTStmtWriter(const ASTStmtWriter&) = delete;
100 
102  CurrentPackingBits.writeBits();
103  assert(Code != serialization::STMT_NULL_PTR &&
104  "unhandled sub-statement writing AST file");
105  return Record.EmitStmt(Code, AbbrevToUse);
106  }
107 
109  const TemplateArgumentLoc *Args);
110 
111  void VisitStmt(Stmt *S);
112 #define STMT(Type, Base) \
113  void Visit##Type(Type *);
114 #include "clang/AST/StmtNodes.inc"
115  };
116 }
117 
119  const ASTTemplateKWAndArgsInfo &ArgInfo, const TemplateArgumentLoc *Args) {
120  Record.AddSourceLocation(ArgInfo.TemplateKWLoc);
121  Record.AddSourceLocation(ArgInfo.LAngleLoc);
122  Record.AddSourceLocation(ArgInfo.RAngleLoc);
123  for (unsigned i = 0; i != ArgInfo.NumTemplateArgs; ++i)
124  Record.AddTemplateArgumentLoc(Args[i]);
125 }
126 
128 }
129 
130 void ASTStmtWriter::VisitNullStmt(NullStmt *S) {
131  VisitStmt(S);
132  Record.AddSourceLocation(S->getSemiLoc());
133  Record.push_back(S->NullStmtBits.HasLeadingEmptyMacro);
135 }
136 
137 void ASTStmtWriter::VisitCompoundStmt(CompoundStmt *S) {
138  VisitStmt(S);
139 
140  Record.push_back(S->size());
141  Record.push_back(S->hasStoredFPFeatures());
142 
143  for (auto *CS : S->body())
144  Record.AddStmt(CS);
145  if (S->hasStoredFPFeatures())
146  Record.push_back(S->getStoredFPFeatures().getAsOpaqueInt());
147  Record.AddSourceLocation(S->getLBracLoc());
148  Record.AddSourceLocation(S->getRBracLoc());
149 
150  if (!S->hasStoredFPFeatures())
151  AbbrevToUse = Writer.getCompoundStmtAbbrev();
152 
154 }
155 
156 void ASTStmtWriter::VisitSwitchCase(SwitchCase *S) {
157  VisitStmt(S);
158  Record.push_back(Writer.getSwitchCaseID(S));
159  Record.AddSourceLocation(S->getKeywordLoc());
160  Record.AddSourceLocation(S->getColonLoc());
161 }
162 
163 void ASTStmtWriter::VisitCaseStmt(CaseStmt *S) {
164  VisitSwitchCase(S);
165  Record.push_back(S->caseStmtIsGNURange());
166  Record.AddStmt(S->getLHS());
167  Record.AddStmt(S->getSubStmt());
168  if (S->caseStmtIsGNURange()) {
169  Record.AddStmt(S->getRHS());
170  Record.AddSourceLocation(S->getEllipsisLoc());
171  }
173 }
174 
175 void ASTStmtWriter::VisitDefaultStmt(DefaultStmt *S) {
176  VisitSwitchCase(S);
177  Record.AddStmt(S->getSubStmt());
179 }
180 
181 void ASTStmtWriter::VisitLabelStmt(LabelStmt *S) {
182  VisitStmt(S);
183  Record.push_back(S->isSideEntry());
184  Record.AddDeclRef(S->getDecl());
185  Record.AddStmt(S->getSubStmt());
186  Record.AddSourceLocation(S->getIdentLoc());
188 }
189 
190 void ASTStmtWriter::VisitAttributedStmt(AttributedStmt *S) {
191  VisitStmt(S);
192  Record.push_back(S->getAttrs().size());
193  Record.AddAttributes(S->getAttrs());
194  Record.AddStmt(S->getSubStmt());
195  Record.AddSourceLocation(S->getAttrLoc());
197 }
198 
199 void ASTStmtWriter::VisitIfStmt(IfStmt *S) {
200  VisitStmt(S);
201 
202  bool HasElse = S->getElse() != nullptr;
203  bool HasVar = S->getConditionVariableDeclStmt() != nullptr;
204  bool HasInit = S->getInit() != nullptr;
205 
206  CurrentPackingBits.updateBits();
207 
208  CurrentPackingBits.addBit(HasElse);
209  CurrentPackingBits.addBit(HasVar);
210  CurrentPackingBits.addBit(HasInit);
211  Record.push_back(static_cast<uint64_t>(S->getStatementKind()));
212  Record.AddStmt(S->getCond());
213  Record.AddStmt(S->getThen());
214  if (HasElse)
215  Record.AddStmt(S->getElse());
216  if (HasVar)
217  Record.AddStmt(S->getConditionVariableDeclStmt());
218  if (HasInit)
219  Record.AddStmt(S->getInit());
220 
221  Record.AddSourceLocation(S->getIfLoc());
222  Record.AddSourceLocation(S->getLParenLoc());
223  Record.AddSourceLocation(S->getRParenLoc());
224  if (HasElse)
225  Record.AddSourceLocation(S->getElseLoc());
226 
227  Code = serialization::STMT_IF;
228 }
229 
230 void ASTStmtWriter::VisitSwitchStmt(SwitchStmt *S) {
231  VisitStmt(S);
232 
233  bool HasInit = S->getInit() != nullptr;
234  bool HasVar = S->getConditionVariableDeclStmt() != nullptr;
235  Record.push_back(HasInit);
236  Record.push_back(HasVar);
237  Record.push_back(S->isAllEnumCasesCovered());
238 
239  Record.AddStmt(S->getCond());
240  Record.AddStmt(S->getBody());
241  if (HasInit)
242  Record.AddStmt(S->getInit());
243  if (HasVar)
244  Record.AddStmt(S->getConditionVariableDeclStmt());
245 
246  Record.AddSourceLocation(S->getSwitchLoc());
247  Record.AddSourceLocation(S->getLParenLoc());
248  Record.AddSourceLocation(S->getRParenLoc());
249 
250  for (SwitchCase *SC = S->getSwitchCaseList(); SC;
251  SC = SC->getNextSwitchCase())
252  Record.push_back(Writer.RecordSwitchCaseID(SC));
254 }
255 
256 void ASTStmtWriter::VisitWhileStmt(WhileStmt *S) {
257  VisitStmt(S);
258 
259  bool HasVar = S->getConditionVariableDeclStmt() != nullptr;
260  Record.push_back(HasVar);
261 
262  Record.AddStmt(S->getCond());
263  Record.AddStmt(S->getBody());
264  if (HasVar)
265  Record.AddStmt(S->getConditionVariableDeclStmt());
266 
267  Record.AddSourceLocation(S->getWhileLoc());
268  Record.AddSourceLocation(S->getLParenLoc());
269  Record.AddSourceLocation(S->getRParenLoc());
271 }
272 
273 void ASTStmtWriter::VisitDoStmt(DoStmt *S) {
274  VisitStmt(S);
275  Record.AddStmt(S->getCond());
276  Record.AddStmt(S->getBody());
277  Record.AddSourceLocation(S->getDoLoc());
278  Record.AddSourceLocation(S->getWhileLoc());
279  Record.AddSourceLocation(S->getRParenLoc());
280  Code = serialization::STMT_DO;
281 }
282 
283 void ASTStmtWriter::VisitForStmt(ForStmt *S) {
284  VisitStmt(S);
285  Record.AddStmt(S->getInit());
286  Record.AddStmt(S->getCond());
287  Record.AddStmt(S->getConditionVariableDeclStmt());
288  Record.AddStmt(S->getInc());
289  Record.AddStmt(S->getBody());
290  Record.AddSourceLocation(S->getForLoc());
291  Record.AddSourceLocation(S->getLParenLoc());
292  Record.AddSourceLocation(S->getRParenLoc());
294 }
295 
296 void ASTStmtWriter::VisitGotoStmt(GotoStmt *S) {
297  VisitStmt(S);
298  Record.AddDeclRef(S->getLabel());
299  Record.AddSourceLocation(S->getGotoLoc());
300  Record.AddSourceLocation(S->getLabelLoc());
302 }
303 
304 void ASTStmtWriter::VisitIndirectGotoStmt(IndirectGotoStmt *S) {
305  VisitStmt(S);
306  Record.AddSourceLocation(S->getGotoLoc());
307  Record.AddSourceLocation(S->getStarLoc());
308  Record.AddStmt(S->getTarget());
310 }
311 
312 void ASTStmtWriter::VisitContinueStmt(ContinueStmt *S) {
313  VisitStmt(S);
314  Record.AddSourceLocation(S->getContinueLoc());
316 }
317 
318 void ASTStmtWriter::VisitBreakStmt(BreakStmt *S) {
319  VisitStmt(S);
320  Record.AddSourceLocation(S->getBreakLoc());
322 }
323 
324 void ASTStmtWriter::VisitReturnStmt(ReturnStmt *S) {
325  VisitStmt(S);
326 
327  bool HasNRVOCandidate = S->getNRVOCandidate() != nullptr;
328  Record.push_back(HasNRVOCandidate);
329 
330  Record.AddStmt(S->getRetValue());
331  if (HasNRVOCandidate)
332  Record.AddDeclRef(S->getNRVOCandidate());
333 
334  Record.AddSourceLocation(S->getReturnLoc());
336 }
337 
338 void ASTStmtWriter::VisitDeclStmt(DeclStmt *S) {
339  VisitStmt(S);
340  Record.AddSourceLocation(S->getBeginLoc());
341  Record.AddSourceLocation(S->getEndLoc());
342  DeclGroupRef DG = S->getDeclGroup();
343  for (DeclGroupRef::iterator D = DG.begin(), DEnd = DG.end(); D != DEnd; ++D)
344  Record.AddDeclRef(*D);
346 }
347 
348 void ASTStmtWriter::VisitAsmStmt(AsmStmt *S) {
349  VisitStmt(S);
350  Record.push_back(S->getNumOutputs());
351  Record.push_back(S->getNumInputs());
352  Record.push_back(S->getNumClobbers());
353  Record.AddSourceLocation(S->getAsmLoc());
354  Record.push_back(S->isVolatile());
355  Record.push_back(S->isSimple());
356 }
357 
358 void ASTStmtWriter::VisitGCCAsmStmt(GCCAsmStmt *S) {
359  VisitAsmStmt(S);
360  Record.push_back(S->getNumLabels());
361  Record.AddSourceLocation(S->getRParenLoc());
362  Record.AddStmt(S->getAsmString());
363 
364  // Outputs
365  for (unsigned I = 0, N = S->getNumOutputs(); I != N; ++I) {
366  Record.AddIdentifierRef(S->getOutputIdentifier(I));
367  Record.AddStmt(S->getOutputConstraintLiteral(I));
368  Record.AddStmt(S->getOutputExpr(I));
369  }
370 
371  // Inputs
372  for (unsigned I = 0, N = S->getNumInputs(); I != N; ++I) {
373  Record.AddIdentifierRef(S->getInputIdentifier(I));
374  Record.AddStmt(S->getInputConstraintLiteral(I));
375  Record.AddStmt(S->getInputExpr(I));
376  }
377 
378  // Clobbers
379  for (unsigned I = 0, N = S->getNumClobbers(); I != N; ++I)
380  Record.AddStmt(S->getClobberStringLiteral(I));
381 
382  // Labels
383  for (unsigned I = 0, N = S->getNumLabels(); I != N; ++I) {
384  Record.AddIdentifierRef(S->getLabelIdentifier(I));
385  Record.AddStmt(S->getLabelExpr(I));
386  }
387 
389 }
390 
391 void ASTStmtWriter::VisitMSAsmStmt(MSAsmStmt *S) {
392  VisitAsmStmt(S);
393  Record.AddSourceLocation(S->getLBraceLoc());
394  Record.AddSourceLocation(S->getEndLoc());
395  Record.push_back(S->getNumAsmToks());
396  Record.AddString(S->getAsmString());
397 
398  // Tokens
399  for (unsigned I = 0, N = S->getNumAsmToks(); I != N; ++I) {
400  // FIXME: Move this to ASTRecordWriter?
401  Writer.AddToken(S->getAsmToks()[I], Record.getRecordData());
402  }
403 
404  // Clobbers
405  for (unsigned I = 0, N = S->getNumClobbers(); I != N; ++I) {
406  Record.AddString(S->getClobber(I));
407  }
408 
409  // Outputs
410  for (unsigned I = 0, N = S->getNumOutputs(); I != N; ++I) {
411  Record.AddStmt(S->getOutputExpr(I));
412  Record.AddString(S->getOutputConstraint(I));
413  }
414 
415  // Inputs
416  for (unsigned I = 0, N = S->getNumInputs(); I != N; ++I) {
417  Record.AddStmt(S->getInputExpr(I));
418  Record.AddString(S->getInputConstraint(I));
419  }
420 
422 }
423 
424 void ASTStmtWriter::VisitCoroutineBodyStmt(CoroutineBodyStmt *CoroStmt) {
425  VisitStmt(CoroStmt);
426  Record.push_back(CoroStmt->getParamMoves().size());
427  for (Stmt *S : CoroStmt->children())
428  Record.AddStmt(S);
430 }
431 
432 void ASTStmtWriter::VisitCoreturnStmt(CoreturnStmt *S) {
433  VisitStmt(S);
434  Record.AddSourceLocation(S->getKeywordLoc());
435  Record.AddStmt(S->getOperand());
436  Record.AddStmt(S->getPromiseCall());
437  Record.push_back(S->isImplicit());
439 }
440 
441 void ASTStmtWriter::VisitCoroutineSuspendExpr(CoroutineSuspendExpr *E) {
442  VisitExpr(E);
443  Record.AddSourceLocation(E->getKeywordLoc());
444  for (Stmt *S : E->children())
445  Record.AddStmt(S);
446  Record.AddStmt(E->getOpaqueValue());
447 }
448 
449 void ASTStmtWriter::VisitCoawaitExpr(CoawaitExpr *E) {
450  VisitCoroutineSuspendExpr(E);
451  Record.push_back(E->isImplicit());
453 }
454 
455 void ASTStmtWriter::VisitCoyieldExpr(CoyieldExpr *E) {
456  VisitCoroutineSuspendExpr(E);
458 }
459 
460 void ASTStmtWriter::VisitDependentCoawaitExpr(DependentCoawaitExpr *E) {
461  VisitExpr(E);
462  Record.AddSourceLocation(E->getKeywordLoc());
463  for (Stmt *S : E->children())
464  Record.AddStmt(S);
466 }
467 
468 static void
470  const ASTConstraintSatisfaction &Satisfaction) {
471  Record.push_back(Satisfaction.IsSatisfied);
472  Record.push_back(Satisfaction.ContainsErrors);
473  if (!Satisfaction.IsSatisfied) {
474  Record.push_back(Satisfaction.NumRecords);
475  for (const auto &DetailRecord : Satisfaction) {
476  Record.writeStmtRef(DetailRecord.first);
477  auto *E = DetailRecord.second.dyn_cast<Expr *>();
478  Record.push_back(E == nullptr);
479  if (E)
480  Record.AddStmt(E);
481  else {
482  auto *Diag = DetailRecord.second.get<std::pair<SourceLocation,
483  StringRef> *>();
484  Record.AddSourceLocation(Diag->first);
485  Record.AddString(Diag->second);
486  }
487  }
488  }
489 }
490 
491 static void
495  Record.AddString(D->SubstitutedEntity);
496  Record.AddSourceLocation(D->DiagLoc);
497  Record.AddString(D->DiagMessage);
498 }
499 
500 void ASTStmtWriter::VisitConceptSpecializationExpr(
502  VisitExpr(E);
503  Record.AddDeclRef(E->getSpecializationDecl());
504  const ConceptReference *CR = E->getConceptReference();
505  Record.push_back(CR != nullptr);
506  if (CR)
507  Record.AddConceptReference(CR);
508  if (!E->isValueDependent())
510 
512 }
513 
514 void ASTStmtWriter::VisitRequiresExpr(RequiresExpr *E) {
515  VisitExpr(E);
516  Record.push_back(E->getLocalParameters().size());
517  Record.push_back(E->getRequirements().size());
518  Record.AddSourceLocation(E->RequiresExprBits.RequiresKWLoc);
519  Record.push_back(E->RequiresExprBits.IsSatisfied);
520  Record.AddDeclRef(E->getBody());
521  for (ParmVarDecl *P : E->getLocalParameters())
522  Record.AddDeclRef(P);
523  for (concepts::Requirement *R : E->getRequirements()) {
524  if (auto *TypeReq = dyn_cast<concepts::TypeRequirement>(R)) {
526  Record.push_back(TypeReq->Status);
528  addSubstitutionDiagnostic(Record, TypeReq->getSubstitutionDiagnostic());
529  else
530  Record.AddTypeSourceInfo(TypeReq->getType());
531  } else if (auto *ExprReq = dyn_cast<concepts::ExprRequirement>(R)) {
532  Record.push_back(ExprReq->getKind());
533  Record.push_back(ExprReq->Status);
534  if (ExprReq->isExprSubstitutionFailure()) {
536  ExprReq->Value.get<concepts::Requirement::SubstitutionDiagnostic *>());
537  } else
538  Record.AddStmt(ExprReq->Value.get<Expr *>());
539  if (ExprReq->getKind() == concepts::Requirement::RK_Compound) {
540  Record.AddSourceLocation(ExprReq->NoexceptLoc);
541  const auto &RetReq = ExprReq->getReturnTypeRequirement();
542  if (RetReq.isSubstitutionFailure()) {
543  Record.push_back(2);
544  addSubstitutionDiagnostic(Record, RetReq.getSubstitutionDiagnostic());
545  } else if (RetReq.isTypeConstraint()) {
546  Record.push_back(1);
547  Record.AddTemplateParameterList(
548  RetReq.getTypeConstraintTemplateParameterList());
549  if (ExprReq->Status >=
551  Record.AddStmt(
552  ExprReq->getReturnTypeRequirementSubstitutedConstraintExpr());
553  } else {
554  assert(RetReq.isEmpty());
555  Record.push_back(0);
556  }
557  }
558  } else {
559  auto *NestedReq = cast<concepts::NestedRequirement>(R);
561  Record.push_back(NestedReq->hasInvalidConstraint());
562  if (NestedReq->hasInvalidConstraint()) {
563  Record.AddString(NestedReq->getInvalidConstraintEntity());
564  addConstraintSatisfaction(Record, *NestedReq->Satisfaction);
565  } else {
566  Record.AddStmt(NestedReq->getConstraintExpr());
567  if (!NestedReq->isDependent())
568  addConstraintSatisfaction(Record, *NestedReq->Satisfaction);
569  }
570  }
571  }
572  Record.AddSourceLocation(E->getLParenLoc());
573  Record.AddSourceLocation(E->getRParenLoc());
574  Record.AddSourceLocation(E->getEndLoc());
575 
577 }
578 
579 
580 void ASTStmtWriter::VisitCapturedStmt(CapturedStmt *S) {
581  VisitStmt(S);
582  // NumCaptures
583  Record.push_back(std::distance(S->capture_begin(), S->capture_end()));
584 
585  // CapturedDecl and captured region kind
586  Record.AddDeclRef(S->getCapturedDecl());
587  Record.push_back(S->getCapturedRegionKind());
588 
589  Record.AddDeclRef(S->getCapturedRecordDecl());
590 
591  // Capture inits
592  for (auto *I : S->capture_inits())
593  Record.AddStmt(I);
594 
595  // Body
596  Record.AddStmt(S->getCapturedStmt());
597 
598  // Captures
599  for (const auto &I : S->captures()) {
600  if (I.capturesThis() || I.capturesVariableArrayType())
601  Record.AddDeclRef(nullptr);
602  else
603  Record.AddDeclRef(I.getCapturedVar());
604  Record.push_back(I.getCaptureKind());
605  Record.AddSourceLocation(I.getLocation());
606  }
607 
609 }
610 
611 void ASTStmtWriter::VisitExpr(Expr *E) {
612  VisitStmt(E);
613 
614  CurrentPackingBits.updateBits();
615  CurrentPackingBits.addBits(E->getDependence(), /*BitsWidth=*/5);
616  CurrentPackingBits.addBits(E->getValueKind(), /*BitsWidth=*/2);
617  CurrentPackingBits.addBits(E->getObjectKind(), /*BitsWidth=*/3);
618 
619  Record.AddTypeRef(E->getType());
620 }
621 
622 void ASTStmtWriter::VisitConstantExpr(ConstantExpr *E) {
623  VisitExpr(E);
624  Record.push_back(E->ConstantExprBits.ResultKind);
625 
626  Record.push_back(E->ConstantExprBits.APValueKind);
627  Record.push_back(E->ConstantExprBits.IsUnsigned);
628  Record.push_back(E->ConstantExprBits.BitWidth);
629  // HasCleanup not serialized since we can just query the APValue.
630  Record.push_back(E->ConstantExprBits.IsImmediateInvocation);
631 
632  switch (E->getResultStorageKind()) {
634  break;
636  Record.push_back(E->Int64Result());
637  break;
639  Record.AddAPValue(E->APValueResult());
640  break;
641  }
642 
643  Record.AddStmt(E->getSubExpr());
645 }
646 
647 void ASTStmtWriter::VisitSYCLUniqueStableNameExpr(SYCLUniqueStableNameExpr *E) {
648  VisitExpr(E);
649 
650  Record.AddSourceLocation(E->getLocation());
651  Record.AddSourceLocation(E->getLParenLocation());
652  Record.AddSourceLocation(E->getRParenLocation());
653  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
654 
656 }
657 
658 void ASTStmtWriter::VisitSYCLUniqueStableIdExpr(SYCLUniqueStableIdExpr *E) {
659  VisitExpr(E);
660 
661  Record.AddSourceLocation(E->getLocation());
662  Record.AddSourceLocation(E->getLParenLocation());
663  Record.AddSourceLocation(E->getRParenLocation());
664  Record.AddStmt(E->getExpr());
665 
667 }
668 
669 void ASTStmtWriter::VisitPredefinedExpr(PredefinedExpr *E) {
670  VisitExpr(E);
671 
672  bool HasFunctionName = E->getFunctionName() != nullptr;
673  Record.push_back(HasFunctionName);
674  Record.push_back(
675  llvm::to_underlying(E->getIdentKind())); // FIXME: stable encoding
676  Record.push_back(E->isTransparent());
677  Record.AddSourceLocation(E->getLocation());
678  if (HasFunctionName)
679  Record.AddStmt(E->getFunctionName());
681 }
682 
683 void ASTStmtWriter::VisitDeclRefExpr(DeclRefExpr *E) {
684  VisitExpr(E);
685 
686  CurrentPackingBits.updateBits();
687 
688  CurrentPackingBits.addBit(E->hadMultipleCandidates());
689  CurrentPackingBits.addBit(E->refersToEnclosingVariableOrCapture());
690  CurrentPackingBits.addBits(E->isNonOdrUse(), /*Width=*/2);
691  CurrentPackingBits.addBit(E->isImmediateEscalating());
692  CurrentPackingBits.addBit(E->getDecl() != E->getFoundDecl());
693  CurrentPackingBits.addBit(E->hasQualifier());
694  CurrentPackingBits.addBit(E->hasTemplateKWAndArgsInfo());
695 
696  if (E->hasTemplateKWAndArgsInfo()) {
697  unsigned NumTemplateArgs = E->getNumTemplateArgs();
698  Record.push_back(NumTemplateArgs);
699  }
700 
702 
703  if ((!E->hasTemplateKWAndArgsInfo()) && (!E->hasQualifier()) &&
704  (E->getDecl() == E->getFoundDecl()) &&
706  AbbrevToUse = Writer.getDeclRefExprAbbrev();
707  }
708 
709  if (E->hasQualifier())
710  Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
711 
712  if (E->getDecl() != E->getFoundDecl())
713  Record.AddDeclRef(E->getFoundDecl());
714 
715  if (E->hasTemplateKWAndArgsInfo())
716  AddTemplateKWAndArgsInfo(*E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
717  E->getTrailingObjects<TemplateArgumentLoc>());
718 
719  Record.AddDeclRef(E->getDecl());
720  Record.AddSourceLocation(E->getLocation());
721  Record.AddDeclarationNameLoc(E->DNLoc, E->getDecl()->getDeclName());
723 }
724 
725 void ASTStmtWriter::VisitIntegerLiteral(IntegerLiteral *E) {
726  VisitExpr(E);
727  Record.AddSourceLocation(E->getLocation());
728  Record.AddAPInt(E->getValue());
729 
730  if (E->getValue().getBitWidth() == 32) {
731  AbbrevToUse = Writer.getIntegerLiteralAbbrev();
732  }
733 
735 }
736 
737 void ASTStmtWriter::VisitFixedPointLiteral(FixedPointLiteral *E) {
738  VisitExpr(E);
739  Record.AddSourceLocation(E->getLocation());
740  Record.push_back(E->getScale());
741  Record.AddAPInt(E->getValue());
743 }
744 
745 void ASTStmtWriter::VisitFloatingLiteral(FloatingLiteral *E) {
746  VisitExpr(E);
747  Record.push_back(E->getRawSemantics());
748  Record.push_back(E->isExact());
749  Record.AddAPFloat(E->getValue());
750  Record.AddSourceLocation(E->getLocation());
752 }
753 
754 void ASTStmtWriter::VisitImaginaryLiteral(ImaginaryLiteral *E) {
755  VisitExpr(E);
756  Record.AddStmt(E->getSubExpr());
758 }
759 
760 void ASTStmtWriter::VisitStringLiteral(StringLiteral *E) {
761  VisitExpr(E);
762 
763  // Store the various bits of data of StringLiteral.
764  Record.push_back(E->getNumConcatenated());
765  Record.push_back(E->getLength());
766  Record.push_back(E->getCharByteWidth());
767  Record.push_back(llvm::to_underlying(E->getKind()));
768  Record.push_back(E->isPascal());
769 
770  // Store the trailing array of SourceLocation.
771  for (unsigned I = 0, N = E->getNumConcatenated(); I != N; ++I)
772  Record.AddSourceLocation(E->getStrTokenLoc(I));
773 
774  // Store the trailing array of char holding the string data.
775  StringRef StrData = E->getBytes();
776  for (unsigned I = 0, N = E->getByteLength(); I != N; ++I)
777  Record.push_back(StrData[I]);
778 
780 }
781 
782 void ASTStmtWriter::VisitCharacterLiteral(CharacterLiteral *E) {
783  VisitExpr(E);
784  Record.push_back(E->getValue());
785  Record.AddSourceLocation(E->getLocation());
786  Record.push_back(llvm::to_underlying(E->getKind()));
787 
788  AbbrevToUse = Writer.getCharacterLiteralAbbrev();
789 
791 }
792 
793 void ASTStmtWriter::VisitParenExpr(ParenExpr *E) {
794  VisitExpr(E);
795  Record.AddSourceLocation(E->getLParen());
796  Record.AddSourceLocation(E->getRParen());
797  Record.AddStmt(E->getSubExpr());
799 }
800 
801 void ASTStmtWriter::VisitParenListExpr(ParenListExpr *E) {
802  VisitExpr(E);
803  Record.push_back(E->getNumExprs());
804  for (auto *SubStmt : E->exprs())
805  Record.AddStmt(SubStmt);
806  Record.AddSourceLocation(E->getLParenLoc());
807  Record.AddSourceLocation(E->getRParenLoc());
809 }
810 
811 void ASTStmtWriter::VisitUnaryOperator(UnaryOperator *E) {
812  VisitExpr(E);
813  bool HasFPFeatures = E->hasStoredFPFeatures();
814  // Write this first for easy access when deserializing, as they affect the
815  // size of the UnaryOperator.
816  CurrentPackingBits.addBit(HasFPFeatures);
817  Record.AddStmt(E->getSubExpr());
818  CurrentPackingBits.addBits(E->getOpcode(),
819  /*Width=*/5); // FIXME: stable encoding
820  Record.AddSourceLocation(E->getOperatorLoc());
821  CurrentPackingBits.addBit(E->canOverflow());
822 
823  if (HasFPFeatures)
824  Record.push_back(E->getStoredFPFeatures().getAsOpaqueInt());
826 }
827 
828 void ASTStmtWriter::VisitOffsetOfExpr(OffsetOfExpr *E) {
829  VisitExpr(E);
830  Record.push_back(E->getNumComponents());
831  Record.push_back(E->getNumExpressions());
832  Record.AddSourceLocation(E->getOperatorLoc());
833  Record.AddSourceLocation(E->getRParenLoc());
834  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
835  for (unsigned I = 0, N = E->getNumComponents(); I != N; ++I) {
836  const OffsetOfNode &ON = E->getComponent(I);
837  Record.push_back(ON.getKind()); // FIXME: Stable encoding
838  Record.AddSourceLocation(ON.getSourceRange().getBegin());
839  Record.AddSourceLocation(ON.getSourceRange().getEnd());
840  switch (ON.getKind()) {
841  case OffsetOfNode::Array:
842  Record.push_back(ON.getArrayExprIndex());
843  break;
844 
845  case OffsetOfNode::Field:
846  Record.AddDeclRef(ON.getField());
847  break;
848 
850  Record.AddIdentifierRef(ON.getFieldName());
851  break;
852 
853  case OffsetOfNode::Base:
854  Record.AddCXXBaseSpecifier(*ON.getBase());
855  break;
856  }
857  }
858  for (unsigned I = 0, N = E->getNumExpressions(); I != N; ++I)
859  Record.AddStmt(E->getIndexExpr(I));
861 }
862 
863 void ASTStmtWriter::VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *E) {
864  VisitExpr(E);
865  Record.push_back(E->getKind());
866  if (E->isArgumentType())
867  Record.AddTypeSourceInfo(E->getArgumentTypeInfo());
868  else {
869  Record.push_back(0);
870  Record.AddStmt(E->getArgumentExpr());
871  }
872  Record.AddSourceLocation(E->getOperatorLoc());
873  Record.AddSourceLocation(E->getRParenLoc());
875 }
876 
877 void ASTStmtWriter::VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
878  VisitExpr(E);
879  Record.AddStmt(E->getLHS());
880  Record.AddStmt(E->getRHS());
881  Record.AddSourceLocation(E->getRBracketLoc());
883 }
884 
885 void ASTStmtWriter::VisitMatrixSubscriptExpr(MatrixSubscriptExpr *E) {
886  VisitExpr(E);
887  Record.AddStmt(E->getBase());
888  Record.AddStmt(E->getRowIdx());
889  Record.AddStmt(E->getColumnIdx());
890  Record.AddSourceLocation(E->getRBracketLoc());
892 }
893 
894 void ASTStmtWriter::VisitArraySectionExpr(ArraySectionExpr *E) {
895  VisitExpr(E);
896  Record.writeEnum(E->ASType);
897  Record.AddStmt(E->getBase());
898  Record.AddStmt(E->getLowerBound());
899  Record.AddStmt(E->getLength());
900  if (E->isOMPArraySection())
901  Record.AddStmt(E->getStride());
902  Record.AddSourceLocation(E->getColonLocFirst());
903 
904  if (E->isOMPArraySection())
905  Record.AddSourceLocation(E->getColonLocSecond());
906 
907  Record.AddSourceLocation(E->getRBracketLoc());
909 }
910 
911 void ASTStmtWriter::VisitOMPArrayShapingExpr(OMPArrayShapingExpr *E) {
912  VisitExpr(E);
913  Record.push_back(E->getDimensions().size());
914  Record.AddStmt(E->getBase());
915  for (Expr *Dim : E->getDimensions())
916  Record.AddStmt(Dim);
917  for (SourceRange SR : E->getBracketsRanges())
918  Record.AddSourceRange(SR);
919  Record.AddSourceLocation(E->getLParenLoc());
920  Record.AddSourceLocation(E->getRParenLoc());
922 }
923 
924 void ASTStmtWriter::VisitOMPIteratorExpr(OMPIteratorExpr *E) {
925  VisitExpr(E);
926  Record.push_back(E->numOfIterators());
927  Record.AddSourceLocation(E->getIteratorKwLoc());
928  Record.AddSourceLocation(E->getLParenLoc());
929  Record.AddSourceLocation(E->getRParenLoc());
930  for (unsigned I = 0, End = E->numOfIterators(); I < End; ++I) {
931  Record.AddDeclRef(E->getIteratorDecl(I));
932  Record.AddSourceLocation(E->getAssignLoc(I));
934  Record.AddStmt(Range.Begin);
935  Record.AddStmt(Range.End);
936  Record.AddStmt(Range.Step);
937  Record.AddSourceLocation(E->getColonLoc(I));
938  if (Range.Step)
939  Record.AddSourceLocation(E->getSecondColonLoc(I));
940  // Serialize helpers
941  OMPIteratorHelperData &HD = E->getHelper(I);
942  Record.AddDeclRef(HD.CounterVD);
943  Record.AddStmt(HD.Upper);
944  Record.AddStmt(HD.Update);
945  Record.AddStmt(HD.CounterUpdate);
946  }
948 }
949 
950 void ASTStmtWriter::VisitCallExpr(CallExpr *E) {
951  VisitExpr(E);
952 
953  Record.push_back(E->getNumArgs());
954  CurrentPackingBits.updateBits();
955  CurrentPackingBits.addBit(static_cast<bool>(E->getADLCallKind()));
956  CurrentPackingBits.addBit(E->hasStoredFPFeatures());
957 
958  Record.AddSourceLocation(E->getRParenLoc());
959  Record.AddStmt(E->getCallee());
960  for (CallExpr::arg_iterator Arg = E->arg_begin(), ArgEnd = E->arg_end();
961  Arg != ArgEnd; ++Arg)
962  Record.AddStmt(*Arg);
963 
964  if (E->hasStoredFPFeatures())
965  Record.push_back(E->getFPFeatures().getAsOpaqueInt());
966 
967  if (!E->hasStoredFPFeatures() && !static_cast<bool>(E->getADLCallKind()) &&
968  E->getStmtClass() == Stmt::CallExprClass)
969  AbbrevToUse = Writer.getCallExprAbbrev();
970 
972 }
973 
974 void ASTStmtWriter::VisitRecoveryExpr(RecoveryExpr *E) {
975  VisitExpr(E);
976  Record.push_back(std::distance(E->children().begin(), E->children().end()));
977  Record.AddSourceLocation(E->getBeginLoc());
978  Record.AddSourceLocation(E->getEndLoc());
979  for (Stmt *Child : E->children())
980  Record.AddStmt(Child);
982 }
983 
984 void ASTStmtWriter::VisitMemberExpr(MemberExpr *E) {
985  VisitExpr(E);
986 
987  bool HasQualifier = E->hasQualifier();
988  bool HasFoundDecl = E->hasFoundDecl();
989  bool HasTemplateInfo = E->hasTemplateKWAndArgsInfo();
990  unsigned NumTemplateArgs = E->getNumTemplateArgs();
991 
992  // Write these first for easy access when deserializing, as they affect the
993  // size of the MemberExpr.
994  CurrentPackingBits.updateBits();
995  CurrentPackingBits.addBit(HasQualifier);
996  CurrentPackingBits.addBit(HasFoundDecl);
997  CurrentPackingBits.addBit(HasTemplateInfo);
998  Record.push_back(NumTemplateArgs);
999 
1000  Record.AddStmt(E->getBase());
1001  Record.AddDeclRef(E->getMemberDecl());
1002  Record.AddDeclarationNameLoc(E->MemberDNLoc,
1003  E->getMemberDecl()->getDeclName());
1004  Record.AddSourceLocation(E->getMemberLoc());
1005  CurrentPackingBits.addBit(E->isArrow());
1006  CurrentPackingBits.addBit(E->hadMultipleCandidates());
1007  CurrentPackingBits.addBits(E->isNonOdrUse(), /*Width=*/2);
1008  Record.AddSourceLocation(E->getOperatorLoc());
1009 
1010  if (HasQualifier)
1011  Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
1012 
1013  if (HasFoundDecl) {
1014  DeclAccessPair FoundDecl = E->getFoundDecl();
1015  Record.AddDeclRef(FoundDecl.getDecl());
1016  CurrentPackingBits.addBits(FoundDecl.getAccess(), /*BitWidth=*/2);
1017  }
1018 
1019  if (HasTemplateInfo)
1020  AddTemplateKWAndArgsInfo(*E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
1021  E->getTrailingObjects<TemplateArgumentLoc>());
1022 
1024 }
1025 
1026 void ASTStmtWriter::VisitObjCIsaExpr(ObjCIsaExpr *E) {
1027  VisitExpr(E);
1028  Record.AddStmt(E->getBase());
1029  Record.AddSourceLocation(E->getIsaMemberLoc());
1030  Record.AddSourceLocation(E->getOpLoc());
1031  Record.push_back(E->isArrow());
1033 }
1034 
1035 void ASTStmtWriter::
1036 VisitObjCIndirectCopyRestoreExpr(ObjCIndirectCopyRestoreExpr *E) {
1037  VisitExpr(E);
1038  Record.AddStmt(E->getSubExpr());
1039  Record.push_back(E->shouldCopy());
1041 }
1042 
1043 void ASTStmtWriter::VisitObjCBridgedCastExpr(ObjCBridgedCastExpr *E) {
1044  VisitExplicitCastExpr(E);
1045  Record.AddSourceLocation(E->getLParenLoc());
1046  Record.AddSourceLocation(E->getBridgeKeywordLoc());
1047  Record.push_back(E->getBridgeKind()); // FIXME: Stable encoding
1049 }
1050 
1051 void ASTStmtWriter::VisitCastExpr(CastExpr *E) {
1052  VisitExpr(E);
1053 
1054  Record.push_back(E->path_size());
1055  CurrentPackingBits.updateBits();
1056  // 7 bits should be enough to store the casting kinds.
1057  CurrentPackingBits.addBits(E->getCastKind(), /*Width=*/7);
1058  CurrentPackingBits.addBit(E->hasStoredFPFeatures());
1059  Record.AddStmt(E->getSubExpr());
1060 
1062  PI = E->path_begin(), PE = E->path_end(); PI != PE; ++PI)
1063  Record.AddCXXBaseSpecifier(**PI);
1064 
1065  if (E->hasStoredFPFeatures())
1066  Record.push_back(E->getFPFeatures().getAsOpaqueInt());
1067 }
1068 
1069 void ASTStmtWriter::VisitBinaryOperator(BinaryOperator *E) {
1070  VisitExpr(E);
1071 
1072  // Write this first for easy access when deserializing, as they affect the
1073  // size of the UnaryOperator.
1074  CurrentPackingBits.updateBits();
1075  CurrentPackingBits.addBits(E->getOpcode(), /*Width=*/6);
1076  bool HasFPFeatures = E->hasStoredFPFeatures();
1077  CurrentPackingBits.addBit(HasFPFeatures);
1078  Record.AddStmt(E->getLHS());
1079  Record.AddStmt(E->getRHS());
1080  Record.AddSourceLocation(E->getOperatorLoc());
1081  if (HasFPFeatures)
1082  Record.push_back(E->getStoredFPFeatures().getAsOpaqueInt());
1083 
1084  if (!HasFPFeatures && E->getValueKind() == VK_PRValue &&
1085  E->getObjectKind() == OK_Ordinary)
1086  AbbrevToUse = Writer.getBinaryOperatorAbbrev();
1087 
1089 }
1090 
1091 void ASTStmtWriter::VisitCompoundAssignOperator(CompoundAssignOperator *E) {
1092  VisitBinaryOperator(E);
1093  Record.AddTypeRef(E->getComputationLHSType());
1094  Record.AddTypeRef(E->getComputationResultType());
1095 
1096  if (!E->hasStoredFPFeatures() && E->getValueKind() == VK_PRValue &&
1097  E->getObjectKind() == OK_Ordinary)
1098  AbbrevToUse = Writer.getCompoundAssignOperatorAbbrev();
1099 
1101 }
1102 
1103 void ASTStmtWriter::VisitConditionalOperator(ConditionalOperator *E) {
1104  VisitExpr(E);
1105  Record.AddStmt(E->getCond());
1106  Record.AddStmt(E->getLHS());
1107  Record.AddStmt(E->getRHS());
1108  Record.AddSourceLocation(E->getQuestionLoc());
1109  Record.AddSourceLocation(E->getColonLoc());
1111 }
1112 
1113 void
1114 ASTStmtWriter::VisitBinaryConditionalOperator(BinaryConditionalOperator *E) {
1115  VisitExpr(E);
1116  Record.AddStmt(E->getOpaqueValue());
1117  Record.AddStmt(E->getCommon());
1118  Record.AddStmt(E->getCond());
1119  Record.AddStmt(E->getTrueExpr());
1120  Record.AddStmt(E->getFalseExpr());
1121  Record.AddSourceLocation(E->getQuestionLoc());
1122  Record.AddSourceLocation(E->getColonLoc());
1124 }
1125 
1126 void ASTStmtWriter::VisitImplicitCastExpr(ImplicitCastExpr *E) {
1127  VisitCastExpr(E);
1128  CurrentPackingBits.addBit(E->isPartOfExplicitCast());
1129 
1130  if (E->path_size() == 0 && !E->hasStoredFPFeatures())
1131  AbbrevToUse = Writer.getExprImplicitCastAbbrev();
1132 
1134 }
1135 
1136 void ASTStmtWriter::VisitExplicitCastExpr(ExplicitCastExpr *E) {
1137  VisitCastExpr(E);
1138  Record.AddTypeSourceInfo(E->getTypeInfoAsWritten());
1139 }
1140 
1141 void ASTStmtWriter::VisitCStyleCastExpr(CStyleCastExpr *E) {
1142  VisitExplicitCastExpr(E);
1143  Record.AddSourceLocation(E->getLParenLoc());
1144  Record.AddSourceLocation(E->getRParenLoc());
1146 }
1147 
1148 void ASTStmtWriter::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
1149  VisitExpr(E);
1150  Record.AddSourceLocation(E->getLParenLoc());
1151  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1152  Record.AddStmt(E->getInitializer());
1153  Record.push_back(E->isFileScope());
1155 }
1156 
1157 void ASTStmtWriter::VisitExtVectorElementExpr(ExtVectorElementExpr *E) {
1158  VisitExpr(E);
1159  Record.AddStmt(E->getBase());
1160  Record.AddIdentifierRef(&E->getAccessor());
1161  Record.AddSourceLocation(E->getAccessorLoc());
1163 }
1164 
1165 void ASTStmtWriter::VisitInitListExpr(InitListExpr *E) {
1166  VisitExpr(E);
1167  // NOTE: only add the (possibly null) syntactic form.
1168  // No need to serialize the isSemanticForm flag and the semantic form.
1169  Record.AddStmt(E->getSyntacticForm());
1170  Record.AddSourceLocation(E->getLBraceLoc());
1171  Record.AddSourceLocation(E->getRBraceLoc());
1172  bool isArrayFiller = E->ArrayFillerOrUnionFieldInit.is<Expr*>();
1173  Record.push_back(isArrayFiller);
1174  if (isArrayFiller)
1175  Record.AddStmt(E->getArrayFiller());
1176  else
1177  Record.AddDeclRef(E->getInitializedFieldInUnion());
1178  Record.push_back(E->hadArrayRangeDesignator());
1179  Record.push_back(E->getNumInits());
1180  if (isArrayFiller) {
1181  // ArrayFiller may have filled "holes" due to designated initializer.
1182  // Replace them by 0 to indicate that the filler goes in that place.
1183  Expr *filler = E->getArrayFiller();
1184  for (unsigned I = 0, N = E->getNumInits(); I != N; ++I)
1185  Record.AddStmt(E->getInit(I) != filler ? E->getInit(I) : nullptr);
1186  } else {
1187  for (unsigned I = 0, N = E->getNumInits(); I != N; ++I)
1188  Record.AddStmt(E->getInit(I));
1189  }
1191 }
1192 
1193 void ASTStmtWriter::VisitDesignatedInitExpr(DesignatedInitExpr *E) {
1194  VisitExpr(E);
1195  Record.push_back(E->getNumSubExprs());
1196  for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
1197  Record.AddStmt(E->getSubExpr(I));
1198  Record.AddSourceLocation(E->getEqualOrColonLoc());
1199  Record.push_back(E->usesGNUSyntax());
1200  for (const DesignatedInitExpr::Designator &D : E->designators()) {
1201  if (D.isFieldDesignator()) {
1202  if (FieldDecl *Field = D.getFieldDecl()) {
1204  Record.AddDeclRef(Field);
1205  } else {
1207  Record.AddIdentifierRef(D.getFieldName());
1208  }
1209  Record.AddSourceLocation(D.getDotLoc());
1210  Record.AddSourceLocation(D.getFieldLoc());
1211  } else if (D.isArrayDesignator()) {
1213  Record.push_back(D.getArrayIndex());
1214  Record.AddSourceLocation(D.getLBracketLoc());
1215  Record.AddSourceLocation(D.getRBracketLoc());
1216  } else {
1217  assert(D.isArrayRangeDesignator() && "Unknown designator");
1219  Record.push_back(D.getArrayIndex());
1220  Record.AddSourceLocation(D.getLBracketLoc());
1221  Record.AddSourceLocation(D.getEllipsisLoc());
1222  Record.AddSourceLocation(D.getRBracketLoc());
1223  }
1224  }
1226 }
1227 
1228 void ASTStmtWriter::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) {
1229  VisitExpr(E);
1230  Record.AddStmt(E->getBase());
1231  Record.AddStmt(E->getUpdater());
1233 }
1234 
1235 void ASTStmtWriter::VisitNoInitExpr(NoInitExpr *E) {
1236  VisitExpr(E);
1238 }
1239 
1240 void ASTStmtWriter::VisitArrayInitLoopExpr(ArrayInitLoopExpr *E) {
1241  VisitExpr(E);
1242  Record.AddStmt(E->SubExprs[0]);
1243  Record.AddStmt(E->SubExprs[1]);
1245 }
1246 
1247 void ASTStmtWriter::VisitArrayInitIndexExpr(ArrayInitIndexExpr *E) {
1248  VisitExpr(E);
1250 }
1251 
1252 void ASTStmtWriter::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) {
1253  VisitExpr(E);
1255 }
1256 
1257 void ASTStmtWriter::VisitVAArgExpr(VAArgExpr *E) {
1258  VisitExpr(E);
1259  Record.AddStmt(E->getSubExpr());
1260  Record.AddTypeSourceInfo(E->getWrittenTypeInfo());
1261  Record.AddSourceLocation(E->getBuiltinLoc());
1262  Record.AddSourceLocation(E->getRParenLoc());
1263  Record.push_back(E->isMicrosoftABI());
1265 }
1266 
1267 void ASTStmtWriter::VisitSourceLocExpr(SourceLocExpr *E) {
1268  VisitExpr(E);
1269  Record.AddDeclRef(cast_or_null<Decl>(E->getParentContext()));
1270  Record.AddSourceLocation(E->getBeginLoc());
1271  Record.AddSourceLocation(E->getEndLoc());
1272  Record.push_back(llvm::to_underlying(E->getIdentKind()));
1274 }
1275 
1276 void ASTStmtWriter::VisitAddrLabelExpr(AddrLabelExpr *E) {
1277  VisitExpr(E);
1278  Record.AddSourceLocation(E->getAmpAmpLoc());
1279  Record.AddSourceLocation(E->getLabelLoc());
1280  Record.AddDeclRef(E->getLabel());
1282 }
1283 
1284 void ASTStmtWriter::VisitStmtExpr(StmtExpr *E) {
1285  VisitExpr(E);
1286  Record.AddStmt(E->getSubStmt());
1287  Record.AddSourceLocation(E->getLParenLoc());
1288  Record.AddSourceLocation(E->getRParenLoc());
1289  Record.push_back(E->getTemplateDepth());
1290  Code = serialization::EXPR_STMT;
1291 }
1292 
1293 void ASTStmtWriter::VisitChooseExpr(ChooseExpr *E) {
1294  VisitExpr(E);
1295  Record.AddStmt(E->getCond());
1296  Record.AddStmt(E->getLHS());
1297  Record.AddStmt(E->getRHS());
1298  Record.AddSourceLocation(E->getBuiltinLoc());
1299  Record.AddSourceLocation(E->getRParenLoc());
1300  Record.push_back(E->isConditionDependent() ? false : E->isConditionTrue());
1302 }
1303 
1304 void ASTStmtWriter::VisitGNUNullExpr(GNUNullExpr *E) {
1305  VisitExpr(E);
1306  Record.AddSourceLocation(E->getTokenLocation());
1308 }
1309 
1310 void ASTStmtWriter::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
1311  VisitExpr(E);
1312  Record.push_back(E->getNumSubExprs());
1313  for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
1314  Record.AddStmt(E->getExpr(I));
1315  Record.AddSourceLocation(E->getBuiltinLoc());
1316  Record.AddSourceLocation(E->getRParenLoc());
1318 }
1319 
1320 void ASTStmtWriter::VisitConvertVectorExpr(ConvertVectorExpr *E) {
1321  VisitExpr(E);
1322  Record.AddSourceLocation(E->getBuiltinLoc());
1323  Record.AddSourceLocation(E->getRParenLoc());
1324  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1325  Record.AddStmt(E->getSrcExpr());
1327 }
1328 
1329 void ASTStmtWriter::VisitBlockExpr(BlockExpr *E) {
1330  VisitExpr(E);
1331  Record.AddDeclRef(E->getBlockDecl());
1333 }
1334 
1335 void ASTStmtWriter::VisitGenericSelectionExpr(GenericSelectionExpr *E) {
1336  VisitExpr(E);
1337 
1338  Record.push_back(E->getNumAssocs());
1339  Record.push_back(E->isExprPredicate());
1340  Record.push_back(E->ResultIndex);
1341  Record.AddSourceLocation(E->getGenericLoc());
1342  Record.AddSourceLocation(E->getDefaultLoc());
1343  Record.AddSourceLocation(E->getRParenLoc());
1344 
1345  Stmt **Stmts = E->getTrailingObjects<Stmt *>();
1346  // Add 1 to account for the controlling expression which is the first
1347  // expression in the trailing array of Stmt *. This is not needed for
1348  // the trailing array of TypeSourceInfo *.
1349  for (unsigned I = 0, N = E->getNumAssocs() + 1; I < N; ++I)
1350  Record.AddStmt(Stmts[I]);
1351 
1352  TypeSourceInfo **TSIs = E->getTrailingObjects<TypeSourceInfo *>();
1353  for (unsigned I = 0, N = E->getNumAssocs(); I < N; ++I)
1354  Record.AddTypeSourceInfo(TSIs[I]);
1355 
1357 }
1358 
1359 void ASTStmtWriter::VisitPseudoObjectExpr(PseudoObjectExpr *E) {
1360  VisitExpr(E);
1361  Record.push_back(E->getNumSemanticExprs());
1362 
1363  // Push the result index. Currently, this needs to exactly match
1364  // the encoding used internally for ResultIndex.
1365  unsigned result = E->getResultExprIndex();
1366  result = (result == PseudoObjectExpr::NoResult ? 0 : result + 1);
1367  Record.push_back(result);
1368 
1369  Record.AddStmt(E->getSyntacticForm());
1371  i = E->semantics_begin(), e = E->semantics_end(); i != e; ++i) {
1372  Record.AddStmt(*i);
1373  }
1375 }
1376 
1377 void ASTStmtWriter::VisitAtomicExpr(AtomicExpr *E) {
1378  VisitExpr(E);
1379  Record.push_back(E->getOp());
1380  for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
1381  Record.AddStmt(E->getSubExprs()[I]);
1382  Record.AddSourceLocation(E->getBuiltinLoc());
1383  Record.AddSourceLocation(E->getRParenLoc());
1385 }
1386 
1387 //===----------------------------------------------------------------------===//
1388 // Objective-C Expressions and Statements.
1389 //===----------------------------------------------------------------------===//
1390 
1391 void ASTStmtWriter::VisitObjCStringLiteral(ObjCStringLiteral *E) {
1392  VisitExpr(E);
1393  Record.AddStmt(E->getString());
1394  Record.AddSourceLocation(E->getAtLoc());
1396 }
1397 
1398 void ASTStmtWriter::VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
1399  VisitExpr(E);
1400  Record.AddStmt(E->getSubExpr());
1401  Record.AddDeclRef(E->getBoxingMethod());
1402  Record.AddSourceRange(E->getSourceRange());
1404 }
1405 
1406 void ASTStmtWriter::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
1407  VisitExpr(E);
1408  Record.push_back(E->getNumElements());
1409  for (unsigned i = 0; i < E->getNumElements(); i++)
1410  Record.AddStmt(E->getElement(i));
1411  Record.AddDeclRef(E->getArrayWithObjectsMethod());
1412  Record.AddSourceRange(E->getSourceRange());
1414 }
1415 
1416 void ASTStmtWriter::VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *E) {
1417  VisitExpr(E);
1418  Record.push_back(E->getNumElements());
1419  Record.push_back(E->HasPackExpansions);
1420  for (unsigned i = 0; i < E->getNumElements(); i++) {
1421  ObjCDictionaryElement Element = E->getKeyValueElement(i);
1422  Record.AddStmt(Element.Key);
1423  Record.AddStmt(Element.Value);
1424  if (E->HasPackExpansions) {
1425  Record.AddSourceLocation(Element.EllipsisLoc);
1426  unsigned NumExpansions = 0;
1427  if (Element.NumExpansions)
1428  NumExpansions = *Element.NumExpansions + 1;
1429  Record.push_back(NumExpansions);
1430  }
1431  }
1432 
1433  Record.AddDeclRef(E->getDictWithObjectsMethod());
1434  Record.AddSourceRange(E->getSourceRange());
1436 }
1437 
1438 void ASTStmtWriter::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
1439  VisitExpr(E);
1440  Record.AddTypeSourceInfo(E->getEncodedTypeSourceInfo());
1441  Record.AddSourceLocation(E->getAtLoc());
1442  Record.AddSourceLocation(E->getRParenLoc());
1444 }
1445 
1446 void ASTStmtWriter::VisitObjCSelectorExpr(ObjCSelectorExpr *E) {
1447  VisitExpr(E);
1448  Record.AddSelectorRef(E->getSelector());
1449  Record.AddSourceLocation(E->getAtLoc());
1450  Record.AddSourceLocation(E->getRParenLoc());
1452 }
1453 
1454 void ASTStmtWriter::VisitObjCProtocolExpr(ObjCProtocolExpr *E) {
1455  VisitExpr(E);
1456  Record.AddDeclRef(E->getProtocol());
1457  Record.AddSourceLocation(E->getAtLoc());
1458  Record.AddSourceLocation(E->ProtoLoc);
1459  Record.AddSourceLocation(E->getRParenLoc());
1461 }
1462 
1463 void ASTStmtWriter::VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) {
1464  VisitExpr(E);
1465  Record.AddDeclRef(E->getDecl());
1466  Record.AddSourceLocation(E->getLocation());
1467  Record.AddSourceLocation(E->getOpLoc());
1468  Record.AddStmt(E->getBase());
1469  Record.push_back(E->isArrow());
1470  Record.push_back(E->isFreeIvar());
1472 }
1473 
1474 void ASTStmtWriter::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
1475  VisitExpr(E);
1476  Record.push_back(E->SetterAndMethodRefFlags.getInt());
1477  Record.push_back(E->isImplicitProperty());
1478  if (E->isImplicitProperty()) {
1479  Record.AddDeclRef(E->getImplicitPropertyGetter());
1480  Record.AddDeclRef(E->getImplicitPropertySetter());
1481  } else {
1482  Record.AddDeclRef(E->getExplicitProperty());
1483  }
1484  Record.AddSourceLocation(E->getLocation());
1485  Record.AddSourceLocation(E->getReceiverLocation());
1486  if (E->isObjectReceiver()) {
1487  Record.push_back(0);
1488  Record.AddStmt(E->getBase());
1489  } else if (E->isSuperReceiver()) {
1490  Record.push_back(1);
1491  Record.AddTypeRef(E->getSuperReceiverType());
1492  } else {
1493  Record.push_back(2);
1494  Record.AddDeclRef(E->getClassReceiver());
1495  }
1496 
1498 }
1499 
1500 void ASTStmtWriter::VisitObjCSubscriptRefExpr(ObjCSubscriptRefExpr *E) {
1501  VisitExpr(E);
1502  Record.AddSourceLocation(E->getRBracket());
1503  Record.AddStmt(E->getBaseExpr());
1504  Record.AddStmt(E->getKeyExpr());
1505  Record.AddDeclRef(E->getAtIndexMethodDecl());
1506  Record.AddDeclRef(E->setAtIndexMethodDecl());
1507 
1509 }
1510 
1511 void ASTStmtWriter::VisitObjCMessageExpr(ObjCMessageExpr *E) {
1512  VisitExpr(E);
1513  Record.push_back(E->getNumArgs());
1514  Record.push_back(E->getNumStoredSelLocs());
1515  Record.push_back(E->SelLocsKind);
1516  Record.push_back(E->isDelegateInitCall());
1517  Record.push_back(E->IsImplicit);
1518  Record.push_back((unsigned)E->getReceiverKind()); // FIXME: stable encoding
1519  switch (E->getReceiverKind()) {
1521  Record.AddStmt(E->getInstanceReceiver());
1522  break;
1523 
1525  Record.AddTypeSourceInfo(E->getClassReceiverTypeInfo());
1526  break;
1527 
1530  Record.AddTypeRef(E->getSuperType());
1531  Record.AddSourceLocation(E->getSuperLoc());
1532  break;
1533  }
1534 
1535  if (E->getMethodDecl()) {
1536  Record.push_back(1);
1537  Record.AddDeclRef(E->getMethodDecl());
1538  } else {
1539  Record.push_back(0);
1540  Record.AddSelectorRef(E->getSelector());
1541  }
1542 
1543  Record.AddSourceLocation(E->getLeftLoc());
1544  Record.AddSourceLocation(E->getRightLoc());
1545 
1546  for (CallExpr::arg_iterator Arg = E->arg_begin(), ArgEnd = E->arg_end();
1547  Arg != ArgEnd; ++Arg)
1548  Record.AddStmt(*Arg);
1549 
1550  SourceLocation *Locs = E->getStoredSelLocs();
1551  for (unsigned i = 0, e = E->getNumStoredSelLocs(); i != e; ++i)
1552  Record.AddSourceLocation(Locs[i]);
1553 
1555 }
1556 
1557 void ASTStmtWriter::VisitObjCForCollectionStmt(ObjCForCollectionStmt *S) {
1558  VisitStmt(S);
1559  Record.AddStmt(S->getElement());
1560  Record.AddStmt(S->getCollection());
1561  Record.AddStmt(S->getBody());
1562  Record.AddSourceLocation(S->getForLoc());
1563  Record.AddSourceLocation(S->getRParenLoc());
1565 }
1566 
1567 void ASTStmtWriter::VisitObjCAtCatchStmt(ObjCAtCatchStmt *S) {
1568  VisitStmt(S);
1569  Record.AddStmt(S->getCatchBody());
1570  Record.AddDeclRef(S->getCatchParamDecl());
1571  Record.AddSourceLocation(S->getAtCatchLoc());
1572  Record.AddSourceLocation(S->getRParenLoc());
1574 }
1575 
1576 void ASTStmtWriter::VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S) {
1577  VisitStmt(S);
1578  Record.AddStmt(S->getFinallyBody());
1579  Record.AddSourceLocation(S->getAtFinallyLoc());
1581 }
1582 
1583 void ASTStmtWriter::VisitObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S) {
1584  VisitStmt(S); // FIXME: no test coverage.
1585  Record.AddStmt(S->getSubStmt());
1586  Record.AddSourceLocation(S->getAtLoc());
1588 }
1589 
1590 void ASTStmtWriter::VisitObjCAtTryStmt(ObjCAtTryStmt *S) {
1591  VisitStmt(S);
1592  Record.push_back(S->getNumCatchStmts());
1593  Record.push_back(S->getFinallyStmt() != nullptr);
1594  Record.AddStmt(S->getTryBody());
1595  for (ObjCAtCatchStmt *C : S->catch_stmts())
1596  Record.AddStmt(C);
1597  if (S->getFinallyStmt())
1598  Record.AddStmt(S->getFinallyStmt());
1599  Record.AddSourceLocation(S->getAtTryLoc());
1601 }
1602 
1603 void ASTStmtWriter::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
1604  VisitStmt(S); // FIXME: no test coverage.
1605  Record.AddStmt(S->getSynchExpr());
1606  Record.AddStmt(S->getSynchBody());
1607  Record.AddSourceLocation(S->getAtSynchronizedLoc());
1609 }
1610 
1611 void ASTStmtWriter::VisitObjCAtThrowStmt(ObjCAtThrowStmt *S) {
1612  VisitStmt(S); // FIXME: no test coverage.
1613  Record.AddStmt(S->getThrowExpr());
1614  Record.AddSourceLocation(S->getThrowLoc());
1616 }
1617 
1618 void ASTStmtWriter::VisitObjCBoolLiteralExpr(ObjCBoolLiteralExpr *E) {
1619  VisitExpr(E);
1620  Record.push_back(E->getValue());
1621  Record.AddSourceLocation(E->getLocation());
1623 }
1624 
1625 void ASTStmtWriter::VisitObjCAvailabilityCheckExpr(ObjCAvailabilityCheckExpr *E) {
1626  VisitExpr(E);
1627  Record.AddSourceRange(E->getSourceRange());
1628  Record.AddVersionTuple(E->getVersion());
1630 }
1631 
1632 //===----------------------------------------------------------------------===//
1633 // C++ Expressions and Statements.
1634 //===----------------------------------------------------------------------===//
1635 
1636 void ASTStmtWriter::VisitCXXCatchStmt(CXXCatchStmt *S) {
1637  VisitStmt(S);
1638  Record.AddSourceLocation(S->getCatchLoc());
1639  Record.AddDeclRef(S->getExceptionDecl());
1640  Record.AddStmt(S->getHandlerBlock());
1642 }
1643 
1644 void ASTStmtWriter::VisitCXXTryStmt(CXXTryStmt *S) {
1645  VisitStmt(S);
1646  Record.push_back(S->getNumHandlers());
1647  Record.AddSourceLocation(S->getTryLoc());
1648  Record.AddStmt(S->getTryBlock());
1649  for (unsigned i = 0, e = S->getNumHandlers(); i != e; ++i)
1650  Record.AddStmt(S->getHandler(i));
1652 }
1653 
1654 void ASTStmtWriter::VisitCXXForRangeStmt(CXXForRangeStmt *S) {
1655  VisitStmt(S);
1656  Record.AddSourceLocation(S->getForLoc());
1657  Record.AddSourceLocation(S->getCoawaitLoc());
1658  Record.AddSourceLocation(S->getColonLoc());
1659  Record.AddSourceLocation(S->getRParenLoc());
1660  Record.AddStmt(S->getInit());
1661  Record.AddStmt(S->getRangeStmt());
1662  Record.AddStmt(S->getBeginStmt());
1663  Record.AddStmt(S->getEndStmt());
1664  Record.AddStmt(S->getCond());
1665  Record.AddStmt(S->getInc());
1666  Record.AddStmt(S->getLoopVarStmt());
1667  Record.AddStmt(S->getBody());
1669 }
1670 
1671 void ASTStmtWriter::VisitMSDependentExistsStmt(MSDependentExistsStmt *S) {
1672  VisitStmt(S);
1673  Record.AddSourceLocation(S->getKeywordLoc());
1674  Record.push_back(S->isIfExists());
1675  Record.AddNestedNameSpecifierLoc(S->getQualifierLoc());
1676  Record.AddDeclarationNameInfo(S->getNameInfo());
1677  Record.AddStmt(S->getSubStmt());
1679 }
1680 
1681 void ASTStmtWriter::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
1682  VisitCallExpr(E);
1683  Record.push_back(E->getOperator());
1684  Record.AddSourceRange(E->Range);
1685 
1686  if (!E->hasStoredFPFeatures() && !static_cast<bool>(E->getADLCallKind()))
1687  AbbrevToUse = Writer.getCXXOperatorCallExprAbbrev();
1688 
1690 }
1691 
1692 void ASTStmtWriter::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) {
1693  VisitCallExpr(E);
1694 
1695  if (!E->hasStoredFPFeatures() && !static_cast<bool>(E->getADLCallKind()))
1696  AbbrevToUse = Writer.getCXXMemberCallExprAbbrev();
1697 
1699 }
1700 
1701 void ASTStmtWriter::VisitCXXRewrittenBinaryOperator(
1703  VisitExpr(E);
1704  Record.push_back(E->isReversed());
1705  Record.AddStmt(E->getSemanticForm());
1707 }
1708 
1709 void ASTStmtWriter::VisitCXXConstructExpr(CXXConstructExpr *E) {
1710  VisitExpr(E);
1711 
1712  Record.push_back(E->getNumArgs());
1713  Record.push_back(E->isElidable());
1714  Record.push_back(E->hadMultipleCandidates());
1715  Record.push_back(E->isListInitialization());
1716  Record.push_back(E->isStdInitListInitialization());
1717  Record.push_back(E->requiresZeroInitialization());
1718  Record.push_back(
1719  llvm::to_underlying(E->getConstructionKind())); // FIXME: stable encoding
1720  Record.push_back(E->isImmediateEscalating());
1721  Record.AddSourceLocation(E->getLocation());
1722  Record.AddDeclRef(E->getConstructor());
1723  Record.AddSourceRange(E->getParenOrBraceRange());
1724 
1725  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1726  Record.AddStmt(E->getArg(I));
1727 
1729 }
1730 
1731 void ASTStmtWriter::VisitCXXInheritedCtorInitExpr(CXXInheritedCtorInitExpr *E) {
1732  VisitExpr(E);
1733  Record.AddDeclRef(E->getConstructor());
1734  Record.AddSourceLocation(E->getLocation());
1735  Record.push_back(E->constructsVBase());
1736  Record.push_back(E->inheritedFromVBase());
1738 }
1739 
1740 void ASTStmtWriter::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
1741  VisitCXXConstructExpr(E);
1742  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1744 }
1745 
1746 void ASTStmtWriter::VisitLambdaExpr(LambdaExpr *E) {
1747  VisitExpr(E);
1748  Record.push_back(E->LambdaExprBits.NumCaptures);
1749  Record.AddSourceRange(E->IntroducerRange);
1750  Record.push_back(E->LambdaExprBits.CaptureDefault); // FIXME: stable encoding
1751  Record.AddSourceLocation(E->CaptureDefaultLoc);
1752  Record.push_back(E->LambdaExprBits.ExplicitParams);
1753  Record.push_back(E->LambdaExprBits.ExplicitResultType);
1754  Record.AddSourceLocation(E->ClosingBrace);
1755 
1756  // Add capture initializers.
1758  CEnd = E->capture_init_end();
1759  C != CEnd; ++C) {
1760  Record.AddStmt(*C);
1761  }
1762 
1763  // Don't serialize the body. It belongs to the call operator declaration.
1764  // LambdaExpr only stores a copy of the Stmt *.
1765 
1767 }
1768 
1769 void ASTStmtWriter::VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E) {
1770  VisitExpr(E);
1771  Record.AddStmt(E->getSubExpr());
1773 }
1774 
1775 void ASTStmtWriter::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) {
1776  VisitExplicitCastExpr(E);
1777  Record.AddSourceRange(SourceRange(E->getOperatorLoc(), E->getRParenLoc()));
1778  CurrentPackingBits.addBit(E->getAngleBrackets().isValid());
1779  if (E->getAngleBrackets().isValid())
1780  Record.AddSourceRange(E->getAngleBrackets());
1781 }
1782 
1783 void ASTStmtWriter::VisitCXXStaticCastExpr(CXXStaticCastExpr *E) {
1784  VisitCXXNamedCastExpr(E);
1786 }
1787 
1788 void ASTStmtWriter::VisitCXXDynamicCastExpr(CXXDynamicCastExpr *E) {
1789  VisitCXXNamedCastExpr(E);
1791 }
1792 
1793 void ASTStmtWriter::VisitCXXReinterpretCastExpr(CXXReinterpretCastExpr *E) {
1794  VisitCXXNamedCastExpr(E);
1796 }
1797 
1798 void ASTStmtWriter::VisitCXXConstCastExpr(CXXConstCastExpr *E) {
1799  VisitCXXNamedCastExpr(E);
1801 }
1802 
1803 void ASTStmtWriter::VisitCXXAddrspaceCastExpr(CXXAddrspaceCastExpr *E) {
1804  VisitCXXNamedCastExpr(E);
1806 }
1807 
1808 void ASTStmtWriter::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E) {
1809  VisitExplicitCastExpr(E);
1810  Record.AddSourceLocation(E->getLParenLoc());
1811  Record.AddSourceLocation(E->getRParenLoc());
1813 }
1814 
1815 void ASTStmtWriter::VisitBuiltinBitCastExpr(BuiltinBitCastExpr *E) {
1816  VisitExplicitCastExpr(E);
1817  Record.AddSourceLocation(E->getBeginLoc());
1818  Record.AddSourceLocation(E->getEndLoc());
1820 }
1821 
1822 void ASTStmtWriter::VisitSYCLBuiltinNumFieldsExpr(SYCLBuiltinNumFieldsExpr *E) {
1823  Record.AddSourceLocation(E->getLocation());
1824  Record.AddTypeRef(E->getSourceType());
1826 }
1827 
1828 void ASTStmtWriter::VisitSYCLBuiltinFieldTypeExpr(SYCLBuiltinFieldTypeExpr *E) {
1829  Record.AddSourceLocation(E->getLocation());
1830  Record.AddTypeRef(E->getSourceType());
1831  Record.AddStmt(E->getIndex());
1833 }
1834 
1835 void ASTStmtWriter::VisitSYCLBuiltinNumBasesExpr(SYCLBuiltinNumBasesExpr *E) {
1836  Record.AddSourceLocation(E->getLocation());
1837  Record.AddTypeRef(E->getSourceType());
1839 }
1840 
1841 void ASTStmtWriter::VisitSYCLBuiltinBaseTypeExpr(SYCLBuiltinBaseTypeExpr *E) {
1842  Record.AddSourceLocation(E->getLocation());
1843  Record.AddTypeRef(E->getSourceType());
1844  Record.AddStmt(E->getIndex());
1846 }
1847 
1848 void ASTStmtWriter::VisitUserDefinedLiteral(UserDefinedLiteral *E) {
1849  VisitCallExpr(E);
1850  Record.AddSourceLocation(E->UDSuffixLoc);
1852 }
1853 
1854 void ASTStmtWriter::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) {
1855  VisitExpr(E);
1856  Record.push_back(E->getValue());
1857  Record.AddSourceLocation(E->getLocation());
1859 }
1860 
1861 void ASTStmtWriter::VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E) {
1862  VisitExpr(E);
1863  Record.AddSourceLocation(E->getLocation());
1865 }
1866 
1867 void ASTStmtWriter::VisitCXXTypeidExpr(CXXTypeidExpr *E) {
1868  VisitExpr(E);
1869  Record.AddSourceRange(E->getSourceRange());
1870  if (E->isTypeOperand()) {
1871  Record.AddTypeSourceInfo(E->getTypeOperandSourceInfo());
1873  } else {
1874  Record.AddStmt(E->getExprOperand());
1876  }
1877 }
1878 
1879 void ASTStmtWriter::VisitCXXThisExpr(CXXThisExpr *E) {
1880  VisitExpr(E);
1881  Record.AddSourceLocation(E->getLocation());
1882  Record.push_back(E->isImplicit());
1884 
1886 }
1887 
1888 void ASTStmtWriter::VisitCXXThrowExpr(CXXThrowExpr *E) {
1889  VisitExpr(E);
1890  Record.AddSourceLocation(E->getThrowLoc());
1891  Record.AddStmt(E->getSubExpr());
1892  Record.push_back(E->isThrownVariableInScope());
1894 }
1895 
1896 void ASTStmtWriter::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
1897  VisitExpr(E);
1898  Record.AddDeclRef(E->getParam());
1899  Record.AddDeclRef(cast_or_null<Decl>(E->getUsedContext()));
1900  Record.AddSourceLocation(E->getUsedLocation());
1901  Record.push_back(E->hasRewrittenInit());
1902  if (E->hasRewrittenInit())
1903  Record.AddStmt(E->getRewrittenExpr());
1905 }
1906 
1907 void ASTStmtWriter::VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E) {
1908  VisitExpr(E);
1909  Record.push_back(E->hasRewrittenInit());
1910  Record.AddDeclRef(E->getField());
1911  Record.AddDeclRef(cast_or_null<Decl>(E->getUsedContext()));
1912  Record.AddSourceLocation(E->getExprLoc());
1913  if (E->hasRewrittenInit())
1914  Record.AddStmt(E->getRewrittenExpr());
1916 }
1917 
1918 void ASTStmtWriter::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
1919  VisitExpr(E);
1920  Record.AddCXXTemporary(E->getTemporary());
1921  Record.AddStmt(E->getSubExpr());
1923 }
1924 
1925 void ASTStmtWriter::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
1926  VisitExpr(E);
1927  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1928  Record.AddSourceLocation(E->getRParenLoc());
1930 }
1931 
1932 void ASTStmtWriter::VisitCXXNewExpr(CXXNewExpr *E) {
1933  VisitExpr(E);
1934 
1935  Record.push_back(E->isArray());
1936  Record.push_back(E->hasInitializer());
1937  Record.push_back(E->getNumPlacementArgs());
1938  Record.push_back(E->isParenTypeId());
1939 
1940  Record.push_back(E->isGlobalNew());
1941  Record.push_back(E->passAlignment());
1942  Record.push_back(E->doesUsualArrayDeleteWantSize());
1943  Record.push_back(E->CXXNewExprBits.HasInitializer);
1944  Record.push_back(E->CXXNewExprBits.StoredInitializationStyle);
1945 
1946  Record.AddDeclRef(E->getOperatorNew());
1947  Record.AddDeclRef(E->getOperatorDelete());
1948  Record.AddTypeSourceInfo(E->getAllocatedTypeSourceInfo());
1949  if (E->isParenTypeId())
1950  Record.AddSourceRange(E->getTypeIdParens());
1951  Record.AddSourceRange(E->getSourceRange());
1952  Record.AddSourceRange(E->getDirectInitRange());
1953 
1954  for (CXXNewExpr::arg_iterator I = E->raw_arg_begin(), N = E->raw_arg_end();
1955  I != N; ++I)
1956  Record.AddStmt(*I);
1957 
1959 }
1960 
1961 void ASTStmtWriter::VisitCXXDeleteExpr(CXXDeleteExpr *E) {
1962  VisitExpr(E);
1963  Record.push_back(E->isGlobalDelete());
1964  Record.push_back(E->isArrayForm());
1965  Record.push_back(E->isArrayFormAsWritten());
1966  Record.push_back(E->doesUsualArrayDeleteWantSize());
1967  Record.AddDeclRef(E->getOperatorDelete());
1968  Record.AddStmt(E->getArgument());
1969  Record.AddSourceLocation(E->getBeginLoc());
1970 
1972 }
1973 
1974 void ASTStmtWriter::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
1975  VisitExpr(E);
1976 
1977  Record.AddStmt(E->getBase());
1978  Record.push_back(E->isArrow());
1979  Record.AddSourceLocation(E->getOperatorLoc());
1980  Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
1981  Record.AddTypeSourceInfo(E->getScopeTypeInfo());
1982  Record.AddSourceLocation(E->getColonColonLoc());
1983  Record.AddSourceLocation(E->getTildeLoc());
1984 
1985  // PseudoDestructorTypeStorage.
1986  Record.AddIdentifierRef(E->getDestroyedTypeIdentifier());
1987  if (E->getDestroyedTypeIdentifier())
1988  Record.AddSourceLocation(E->getDestroyedTypeLoc());
1989  else
1990  Record.AddTypeSourceInfo(E->getDestroyedTypeInfo());
1991 
1993 }
1994 
1995 void ASTStmtWriter::VisitExprWithCleanups(ExprWithCleanups *E) {
1996  VisitExpr(E);
1997  Record.push_back(E->getNumObjects());
1998  for (auto &Obj : E->getObjects()) {
1999  if (auto *BD = Obj.dyn_cast<BlockDecl *>()) {
2000  Record.push_back(serialization::COK_Block);
2001  Record.AddDeclRef(BD);
2002  } else if (auto *CLE = Obj.dyn_cast<CompoundLiteralExpr *>()) {
2004  Record.AddStmt(CLE);
2005  }
2006  }
2007 
2008  Record.push_back(E->cleanupsHaveSideEffects());
2009  Record.AddStmt(E->getSubExpr());
2011 }
2012 
2013 void ASTStmtWriter::VisitCXXDependentScopeMemberExpr(
2015  VisitExpr(E);
2016 
2017  // Don't emit anything here (or if you do you will have to update
2018  // the corresponding deserialization function).
2019  Record.push_back(E->getNumTemplateArgs());
2020  CurrentPackingBits.updateBits();
2021  CurrentPackingBits.addBit(E->hasTemplateKWAndArgsInfo());
2022  CurrentPackingBits.addBit(E->hasFirstQualifierFoundInScope());
2023 
2024  if (E->hasTemplateKWAndArgsInfo()) {
2025  const ASTTemplateKWAndArgsInfo &ArgInfo =
2026  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
2027  AddTemplateKWAndArgsInfo(ArgInfo,
2028  E->getTrailingObjects<TemplateArgumentLoc>());
2029  }
2030 
2031  CurrentPackingBits.addBit(E->isArrow());
2032 
2033  Record.AddTypeRef(E->getBaseType());
2034  Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
2035  CurrentPackingBits.addBit(!E->isImplicitAccess());
2036  if (!E->isImplicitAccess())
2037  Record.AddStmt(E->getBase());
2038 
2039  Record.AddSourceLocation(E->getOperatorLoc());
2040 
2041  if (E->hasFirstQualifierFoundInScope())
2042  Record.AddDeclRef(E->getFirstQualifierFoundInScope());
2043 
2044  Record.AddDeclarationNameInfo(E->MemberNameInfo);
2046 }
2047 
2048 void
2049 ASTStmtWriter::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) {
2050  VisitExpr(E);
2051 
2052  // Don't emit anything here, HasTemplateKWAndArgsInfo must be
2053  // emitted first.
2054  CurrentPackingBits.addBit(
2055  E->DependentScopeDeclRefExprBits.HasTemplateKWAndArgsInfo);
2056 
2057  if (E->DependentScopeDeclRefExprBits.HasTemplateKWAndArgsInfo) {
2058  const ASTTemplateKWAndArgsInfo &ArgInfo =
2059  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
2060  // 16 bits should be enought to store the number of args
2061  CurrentPackingBits.addBits(ArgInfo.NumTemplateArgs, /*Width=*/16);
2062  AddTemplateKWAndArgsInfo(ArgInfo,
2063  E->getTrailingObjects<TemplateArgumentLoc>());
2064  }
2065 
2066  Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
2067  Record.AddDeclarationNameInfo(E->NameInfo);
2069 }
2070 
2071 void
2072 ASTStmtWriter::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E) {
2073  VisitExpr(E);
2074  Record.push_back(E->getNumArgs());
2076  ArgI = E->arg_begin(), ArgE = E->arg_end(); ArgI != ArgE; ++ArgI)
2077  Record.AddStmt(*ArgI);
2078  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
2079  Record.AddSourceLocation(E->getLParenLoc());
2080  Record.AddSourceLocation(E->getRParenLoc());
2081  Record.push_back(E->isListInitialization());
2083 }
2084 
2085 void ASTStmtWriter::VisitOverloadExpr(OverloadExpr *E) {
2086  VisitExpr(E);
2087 
2088  Record.push_back(E->getNumDecls());
2089 
2090  CurrentPackingBits.updateBits();
2091  CurrentPackingBits.addBit(E->hasTemplateKWAndArgsInfo());
2092  if (E->hasTemplateKWAndArgsInfo()) {
2093  const ASTTemplateKWAndArgsInfo &ArgInfo =
2095  Record.push_back(ArgInfo.NumTemplateArgs);
2097  }
2098 
2099  for (OverloadExpr::decls_iterator OvI = E->decls_begin(),
2100  OvE = E->decls_end();
2101  OvI != OvE; ++OvI) {
2102  Record.AddDeclRef(OvI.getDecl());
2103  Record.push_back(OvI.getAccess());
2104  }
2105 
2106  Record.AddDeclarationNameInfo(E->getNameInfo());
2107  Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
2108 }
2109 
2110 void ASTStmtWriter::VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
2111  VisitOverloadExpr(E);
2112  CurrentPackingBits.addBit(E->isArrow());
2113  CurrentPackingBits.addBit(E->hasUnresolvedUsing());
2114  CurrentPackingBits.addBit(!E->isImplicitAccess());
2115  if (!E->isImplicitAccess())
2116  Record.AddStmt(E->getBase());
2117 
2118  Record.AddSourceLocation(E->getOperatorLoc());
2119 
2120  Record.AddTypeRef(E->getBaseType());
2122 }
2123 
2124 void ASTStmtWriter::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) {
2125  VisitOverloadExpr(E);
2126  CurrentPackingBits.addBit(E->requiresADL());
2127  Record.AddDeclRef(E->getNamingClass());
2129 }
2130 
2131 void ASTStmtWriter::VisitTypeTraitExpr(TypeTraitExpr *E) {
2132  VisitExpr(E);
2133  Record.push_back(E->TypeTraitExprBits.NumArgs);
2134  Record.push_back(E->TypeTraitExprBits.Kind); // FIXME: Stable encoding
2135  Record.push_back(E->TypeTraitExprBits.Value);
2136  Record.AddSourceRange(E->getSourceRange());
2137  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
2138  Record.AddTypeSourceInfo(E->getArg(I));
2140 }
2141 
2142 void ASTStmtWriter::VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E) {
2143  VisitExpr(E);
2144  Record.push_back(E->getTrait());
2145  Record.push_back(E->getValue());
2146  Record.AddSourceRange(E->getSourceRange());
2147  Record.AddTypeSourceInfo(E->getQueriedTypeSourceInfo());
2148  Record.AddStmt(E->getDimensionExpression());
2150 }
2151 
2152 void ASTStmtWriter::VisitExpressionTraitExpr(ExpressionTraitExpr *E) {
2153  VisitExpr(E);
2154  Record.push_back(E->getTrait());
2155  Record.push_back(E->getValue());
2156  Record.AddSourceRange(E->getSourceRange());
2157  Record.AddStmt(E->getQueriedExpression());
2159 }
2160 
2161 void ASTStmtWriter::VisitCXXNoexceptExpr(CXXNoexceptExpr *E) {
2162  VisitExpr(E);
2163  Record.push_back(E->getValue());
2164  Record.AddSourceRange(E->getSourceRange());
2165  Record.AddStmt(E->getOperand());
2167 }
2168 
2169 void ASTStmtWriter::VisitPackExpansionExpr(PackExpansionExpr *E) {
2170  VisitExpr(E);
2171  Record.AddSourceLocation(E->getEllipsisLoc());
2172  Record.push_back(E->NumExpansions);
2173  Record.AddStmt(E->getPattern());
2175 }
2176 
2177 void ASTStmtWriter::VisitSizeOfPackExpr(SizeOfPackExpr *E) {
2178  VisitExpr(E);
2179  Record.push_back(E->isPartiallySubstituted() ? E->getPartialArguments().size()
2180  : 0);
2181  Record.AddSourceLocation(E->OperatorLoc);
2182  Record.AddSourceLocation(E->PackLoc);
2183  Record.AddSourceLocation(E->RParenLoc);
2184  Record.AddDeclRef(E->Pack);
2185  if (E->isPartiallySubstituted()) {
2186  for (const auto &TA : E->getPartialArguments())
2187  Record.AddTemplateArgument(TA);
2188  } else if (!E->isValueDependent()) {
2189  Record.push_back(E->getPackLength());
2190  }
2192 }
2193 
2194 void ASTStmtWriter::VisitPackIndexingExpr(PackIndexingExpr *E) {
2195  VisitExpr(E);
2196  Record.push_back(E->TransformedExpressions);
2197  Record.push_back(E->ExpandedToEmptyPack);
2198  Record.AddSourceLocation(E->getEllipsisLoc());
2199  Record.AddSourceLocation(E->getRSquareLoc());
2200  Record.AddStmt(E->getPackIdExpression());
2201  Record.AddStmt(E->getIndexExpr());
2202  for (Expr *Sub : E->getExpressions())
2203  Record.AddStmt(Sub);
2205 }
2206 
2207 void ASTStmtWriter::VisitSubstNonTypeTemplateParmExpr(
2209  VisitExpr(E);
2210  Record.AddDeclRef(E->getAssociatedDecl());
2211  CurrentPackingBits.addBit(E->isReferenceParameter());
2212  CurrentPackingBits.addBits(E->getIndex(), /*Width=*/12);
2213  CurrentPackingBits.addBit((bool)E->getPackIndex());
2214  if (auto PackIndex = E->getPackIndex())
2215  Record.push_back(*PackIndex + 1);
2216 
2217  Record.AddSourceLocation(E->getNameLoc());
2218  Record.AddStmt(E->getReplacement());
2220 }
2221 
2222 void ASTStmtWriter::VisitSubstNonTypeTemplateParmPackExpr(
2224  VisitExpr(E);
2225  Record.AddDeclRef(E->getAssociatedDecl());
2226  Record.push_back(E->getIndex());
2227  Record.AddTemplateArgument(E->getArgumentPack());
2228  Record.AddSourceLocation(E->getParameterPackLocation());
2230 }
2231 
2232 void ASTStmtWriter::VisitFunctionParmPackExpr(FunctionParmPackExpr *E) {
2233  VisitExpr(E);
2234  Record.push_back(E->getNumExpansions());
2235  Record.AddDeclRef(E->getParameterPack());
2236  Record.AddSourceLocation(E->getParameterPackLocation());
2237  for (FunctionParmPackExpr::iterator I = E->begin(), End = E->end();
2238  I != End; ++I)
2239  Record.AddDeclRef(*I);
2241 }
2242 
2243 void ASTStmtWriter::VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E) {
2244  VisitExpr(E);
2245  Record.push_back(static_cast<bool>(E->getLifetimeExtendedTemporaryDecl()));
2247  Record.AddDeclRef(E->getLifetimeExtendedTemporaryDecl());
2248  else
2249  Record.AddStmt(E->getSubExpr());
2251 }
2252 
2253 void ASTStmtWriter::VisitCXXFoldExpr(CXXFoldExpr *E) {
2254  VisitExpr(E);
2255  Record.AddSourceLocation(E->LParenLoc);
2256  Record.AddSourceLocation(E->EllipsisLoc);
2257  Record.AddSourceLocation(E->RParenLoc);
2258  Record.push_back(E->NumExpansions);
2259  Record.AddStmt(E->SubExprs[0]);
2260  Record.AddStmt(E->SubExprs[1]);
2261  Record.AddStmt(E->SubExprs[2]);
2262  Record.push_back(E->Opcode);
2264 }
2265 
2266 void ASTStmtWriter::VisitCXXParenListInitExpr(CXXParenListInitExpr *E) {
2267  VisitExpr(E);
2268  ArrayRef<Expr *> InitExprs = E->getInitExprs();
2269  Record.push_back(InitExprs.size());
2270  Record.push_back(E->getUserSpecifiedInitExprs().size());
2271  Record.AddSourceLocation(E->getInitLoc());
2272  Record.AddSourceLocation(E->getBeginLoc());
2273  Record.AddSourceLocation(E->getEndLoc());
2274  for (Expr *InitExpr : E->getInitExprs())
2275  Record.AddStmt(InitExpr);
2276  Expr *ArrayFiller = E->getArrayFiller();
2277  FieldDecl *UnionField = E->getInitializedFieldInUnion();
2278  bool HasArrayFillerOrUnionDecl = ArrayFiller || UnionField;
2279  Record.push_back(HasArrayFillerOrUnionDecl);
2280  if (HasArrayFillerOrUnionDecl) {
2281  Record.push_back(static_cast<bool>(ArrayFiller));
2282  if (ArrayFiller)
2283  Record.AddStmt(ArrayFiller);
2284  else
2285  Record.AddDeclRef(UnionField);
2286  }
2288 }
2289 
2290 void ASTStmtWriter::VisitOpaqueValueExpr(OpaqueValueExpr *E) {
2291  VisitExpr(E);
2292  Record.AddStmt(E->getSourceExpr());
2293  Record.AddSourceLocation(E->getLocation());
2294  Record.push_back(E->isUnique());
2296 }
2297 
2298 void ASTStmtWriter::VisitTypoExpr(TypoExpr *E) {
2299  VisitExpr(E);
2300  // TODO: Figure out sane writer behavior for a TypoExpr, if necessary
2301  llvm_unreachable("Cannot write TypoExpr nodes");
2302 }
2303 
2304 //===----------------------------------------------------------------------===//
2305 // CUDA Expressions and Statements.
2306 //===----------------------------------------------------------------------===//
2307 
2308 void ASTStmtWriter::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E) {
2309  VisitCallExpr(E);
2310  Record.AddStmt(E->getConfig());
2312 }
2313 
2314 //===----------------------------------------------------------------------===//
2315 // OpenCL Expressions and Statements.
2316 //===----------------------------------------------------------------------===//
2317 void ASTStmtWriter::VisitAsTypeExpr(AsTypeExpr *E) {
2318  VisitExpr(E);
2319  Record.AddSourceLocation(E->getBuiltinLoc());
2320  Record.AddSourceLocation(E->getRParenLoc());
2321  Record.AddStmt(E->getSrcExpr());
2323 }
2324 
2325 //===----------------------------------------------------------------------===//
2326 // Microsoft Expressions and Statements.
2327 //===----------------------------------------------------------------------===//
2328 void ASTStmtWriter::VisitMSPropertyRefExpr(MSPropertyRefExpr *E) {
2329  VisitExpr(E);
2330  Record.push_back(E->isArrow());
2331  Record.AddStmt(E->getBaseExpr());
2332  Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
2333  Record.AddSourceLocation(E->getMemberLoc());
2334  Record.AddDeclRef(E->getPropertyDecl());
2336 }
2337 
2338 void ASTStmtWriter::VisitMSPropertySubscriptExpr(MSPropertySubscriptExpr *E) {
2339  VisitExpr(E);
2340  Record.AddStmt(E->getBase());
2341  Record.AddStmt(E->getIdx());
2342  Record.AddSourceLocation(E->getRBracketLoc());
2344 }
2345 
2346 void ASTStmtWriter::VisitCXXUuidofExpr(CXXUuidofExpr *E) {
2347  VisitExpr(E);
2348  Record.AddSourceRange(E->getSourceRange());
2349  Record.AddDeclRef(E->getGuidDecl());
2350  if (E->isTypeOperand()) {
2351  Record.AddTypeSourceInfo(E->getTypeOperandSourceInfo());
2353  } else {
2354  Record.AddStmt(E->getExprOperand());
2356  }
2357 }
2358 
2359 void ASTStmtWriter::VisitSEHExceptStmt(SEHExceptStmt *S) {
2360  VisitStmt(S);
2361  Record.AddSourceLocation(S->getExceptLoc());
2362  Record.AddStmt(S->getFilterExpr());
2363  Record.AddStmt(S->getBlock());
2365 }
2366 
2367 void ASTStmtWriter::VisitSEHFinallyStmt(SEHFinallyStmt *S) {
2368  VisitStmt(S);
2369  Record.AddSourceLocation(S->getFinallyLoc());
2370  Record.AddStmt(S->getBlock());
2372 }
2373 
2374 void ASTStmtWriter::VisitSEHTryStmt(SEHTryStmt *S) {
2375  VisitStmt(S);
2376  Record.push_back(S->getIsCXXTry());
2377  Record.AddSourceLocation(S->getTryLoc());
2378  Record.AddStmt(S->getTryBlock());
2379  Record.AddStmt(S->getHandler());
2381 }
2382 
2383 void ASTStmtWriter::VisitSEHLeaveStmt(SEHLeaveStmt *S) {
2384  VisitStmt(S);
2385  Record.AddSourceLocation(S->getLeaveLoc());
2387 }
2388 
2389 //===----------------------------------------------------------------------===//
2390 // OpenMP Directives.
2391 //===----------------------------------------------------------------------===//
2392 
2393 void ASTStmtWriter::VisitOMPCanonicalLoop(OMPCanonicalLoop *S) {
2394  VisitStmt(S);
2395  for (Stmt *SubStmt : S->SubStmts)
2396  Record.AddStmt(SubStmt);
2398 }
2399 
2400 void ASTStmtWriter::VisitOMPExecutableDirective(OMPExecutableDirective *E) {
2401  Record.writeOMPChildren(E->Data);
2402  Record.AddSourceLocation(E->getBeginLoc());
2403  Record.AddSourceLocation(E->getEndLoc());
2404  Record.writeEnum(E->getMappedDirective());
2405 }
2406 
2407 void ASTStmtWriter::VisitOMPLoopBasedDirective(OMPLoopBasedDirective *D) {
2408  VisitStmt(D);
2409  Record.writeUInt32(D->getLoopsNumber());
2410  VisitOMPExecutableDirective(D);
2411 }
2412 
2413 void ASTStmtWriter::VisitOMPLoopDirective(OMPLoopDirective *D) {
2414  VisitOMPLoopBasedDirective(D);
2415 }
2416 
2417 void ASTStmtWriter::VisitOMPMetaDirective(OMPMetaDirective *D) {
2418  VisitStmt(D);
2419  Record.push_back(D->getNumClauses());
2420  VisitOMPExecutableDirective(D);
2422 }
2423 
2424 void ASTStmtWriter::VisitOMPParallelDirective(OMPParallelDirective *D) {
2425  VisitStmt(D);
2426  VisitOMPExecutableDirective(D);
2427  Record.writeBool(D->hasCancel());
2429 }
2430 
2431 void ASTStmtWriter::VisitOMPSimdDirective(OMPSimdDirective *D) {
2432  VisitOMPLoopDirective(D);
2434 }
2435 
2436 void ASTStmtWriter::VisitOMPLoopTransformationDirective(
2438  VisitOMPLoopBasedDirective(D);
2439  Record.writeUInt32(D->getNumGeneratedLoops());
2440 }
2441 
2442 void ASTStmtWriter::VisitOMPTileDirective(OMPTileDirective *D) {
2443  VisitOMPLoopTransformationDirective(D);
2445 }
2446 
2447 void ASTStmtWriter::VisitOMPUnrollDirective(OMPUnrollDirective *D) {
2448  VisitOMPLoopTransformationDirective(D);
2450 }
2451 
2452 void ASTStmtWriter::VisitOMPForDirective(OMPForDirective *D) {
2453  VisitOMPLoopDirective(D);
2454  Record.writeBool(D->hasCancel());
2456 }
2457 
2458 void ASTStmtWriter::VisitOMPForSimdDirective(OMPForSimdDirective *D) {
2459  VisitOMPLoopDirective(D);
2461 }
2462 
2463 void ASTStmtWriter::VisitOMPSectionsDirective(OMPSectionsDirective *D) {
2464  VisitStmt(D);
2465  VisitOMPExecutableDirective(D);
2466  Record.writeBool(D->hasCancel());
2468 }
2469 
2470 void ASTStmtWriter::VisitOMPSectionDirective(OMPSectionDirective *D) {
2471  VisitStmt(D);
2472  VisitOMPExecutableDirective(D);
2473  Record.writeBool(D->hasCancel());
2475 }
2476 
2477 void ASTStmtWriter::VisitOMPScopeDirective(OMPScopeDirective *D) {
2478  VisitStmt(D);
2479  VisitOMPExecutableDirective(D);
2481 }
2482 
2483 void ASTStmtWriter::VisitOMPSingleDirective(OMPSingleDirective *D) {
2484  VisitStmt(D);
2485  VisitOMPExecutableDirective(D);
2487 }
2488 
2489 void ASTStmtWriter::VisitOMPMasterDirective(OMPMasterDirective *D) {
2490  VisitStmt(D);
2491  VisitOMPExecutableDirective(D);
2493 }
2494 
2495 void ASTStmtWriter::VisitOMPCriticalDirective(OMPCriticalDirective *D) {
2496  VisitStmt(D);
2497  VisitOMPExecutableDirective(D);
2498  Record.AddDeclarationNameInfo(D->getDirectiveName());
2500 }
2501 
2502 void ASTStmtWriter::VisitOMPParallelForDirective(OMPParallelForDirective *D) {
2503  VisitOMPLoopDirective(D);
2504  Record.writeBool(D->hasCancel());
2506 }
2507 
2508 void ASTStmtWriter::VisitOMPParallelForSimdDirective(
2510  VisitOMPLoopDirective(D);
2512 }
2513 
2514 void ASTStmtWriter::VisitOMPParallelMasterDirective(
2516  VisitStmt(D);
2517  VisitOMPExecutableDirective(D);
2519 }
2520 
2521 void ASTStmtWriter::VisitOMPParallelMaskedDirective(
2523  VisitStmt(D);
2524  VisitOMPExecutableDirective(D);
2526 }
2527 
2528 void ASTStmtWriter::VisitOMPParallelSectionsDirective(
2530  VisitStmt(D);
2531  VisitOMPExecutableDirective(D);
2532  Record.writeBool(D->hasCancel());
2534 }
2535 
2536 void ASTStmtWriter::VisitOMPTaskDirective(OMPTaskDirective *D) {
2537  VisitStmt(D);
2538  VisitOMPExecutableDirective(D);
2539  Record.writeBool(D->hasCancel());
2541 }
2542 
2543 void ASTStmtWriter::VisitOMPAtomicDirective(OMPAtomicDirective *D) {
2544  VisitStmt(D);
2545  VisitOMPExecutableDirective(D);
2546  Record.writeBool(D->isXLHSInRHSPart());
2547  Record.writeBool(D->isPostfixUpdate());
2548  Record.writeBool(D->isFailOnly());
2550 }
2551 
2552 void ASTStmtWriter::VisitOMPTargetDirective(OMPTargetDirective *D) {
2553  VisitStmt(D);
2554  VisitOMPExecutableDirective(D);
2556 }
2557 
2558 void ASTStmtWriter::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) {
2559  VisitStmt(D);
2560  VisitOMPExecutableDirective(D);
2562 }
2563 
2564 void ASTStmtWriter::VisitOMPTargetEnterDataDirective(
2566  VisitStmt(D);
2567  VisitOMPExecutableDirective(D);
2569 }
2570 
2571 void ASTStmtWriter::VisitOMPTargetExitDataDirective(
2573  VisitStmt(D);
2574  VisitOMPExecutableDirective(D);
2576 }
2577 
2578 void ASTStmtWriter::VisitOMPTargetParallelDirective(
2580  VisitStmt(D);
2581  VisitOMPExecutableDirective(D);
2582  Record.writeBool(D->hasCancel());
2584 }
2585 
2586 void ASTStmtWriter::VisitOMPTargetParallelForDirective(
2588  VisitOMPLoopDirective(D);
2589  Record.writeBool(D->hasCancel());
2591 }
2592 
2593 void ASTStmtWriter::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) {
2594  VisitStmt(D);
2595  VisitOMPExecutableDirective(D);
2597 }
2598 
2599 void ASTStmtWriter::VisitOMPBarrierDirective(OMPBarrierDirective *D) {
2600  VisitStmt(D);
2601  VisitOMPExecutableDirective(D);
2603 }
2604 
2605 void ASTStmtWriter::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) {
2606  VisitStmt(D);
2607  Record.push_back(D->getNumClauses());
2608  VisitOMPExecutableDirective(D);
2610 }
2611 
2612 void ASTStmtWriter::VisitOMPErrorDirective(OMPErrorDirective *D) {
2613  VisitStmt(D);
2614  Record.push_back(D->getNumClauses());
2615  VisitOMPExecutableDirective(D);
2617 }
2618 
2619 void ASTStmtWriter::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) {
2620  VisitStmt(D);
2621  VisitOMPExecutableDirective(D);
2623 }
2624 
2625 void ASTStmtWriter::VisitOMPFlushDirective(OMPFlushDirective *D) {
2626  VisitStmt(D);
2627  VisitOMPExecutableDirective(D);
2629 }
2630 
2631 void ASTStmtWriter::VisitOMPDepobjDirective(OMPDepobjDirective *D) {
2632  VisitStmt(D);
2633  VisitOMPExecutableDirective(D);
2635 }
2636 
2637 void ASTStmtWriter::VisitOMPScanDirective(OMPScanDirective *D) {
2638  VisitStmt(D);
2639  VisitOMPExecutableDirective(D);
2641 }
2642 
2643 void ASTStmtWriter::VisitOMPOrderedDirective(OMPOrderedDirective *D) {
2644  VisitStmt(D);
2645  VisitOMPExecutableDirective(D);
2647 }
2648 
2649 void ASTStmtWriter::VisitOMPTeamsDirective(OMPTeamsDirective *D) {
2650  VisitStmt(D);
2651  VisitOMPExecutableDirective(D);
2653 }
2654 
2655 void ASTStmtWriter::VisitOMPCancellationPointDirective(
2657  VisitStmt(D);
2658  VisitOMPExecutableDirective(D);
2659  Record.writeEnum(D->getCancelRegion());
2661 }
2662 
2663 void ASTStmtWriter::VisitOMPCancelDirective(OMPCancelDirective *D) {
2664  VisitStmt(D);
2665  VisitOMPExecutableDirective(D);
2666  Record.writeEnum(D->getCancelRegion());
2668 }
2669 
2670 void ASTStmtWriter::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) {
2671  VisitOMPLoopDirective(D);
2672  Record.writeBool(D->hasCancel());
2674 }
2675 
2676 void ASTStmtWriter::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) {
2677  VisitOMPLoopDirective(D);
2679 }
2680 
2681 void ASTStmtWriter::VisitOMPMasterTaskLoopDirective(
2683  VisitOMPLoopDirective(D);
2684  Record.writeBool(D->hasCancel());
2686 }
2687 
2688 void ASTStmtWriter::VisitOMPMaskedTaskLoopDirective(
2690  VisitOMPLoopDirective(D);
2691  Record.writeBool(D->hasCancel());
2693 }
2694 
2695 void ASTStmtWriter::VisitOMPMasterTaskLoopSimdDirective(
2697  VisitOMPLoopDirective(D);
2699 }
2700 
2701 void ASTStmtWriter::VisitOMPMaskedTaskLoopSimdDirective(
2703  VisitOMPLoopDirective(D);
2705 }
2706 
2707 void ASTStmtWriter::VisitOMPParallelMasterTaskLoopDirective(
2709  VisitOMPLoopDirective(D);
2710  Record.writeBool(D->hasCancel());
2712 }
2713 
2714 void ASTStmtWriter::VisitOMPParallelMaskedTaskLoopDirective(
2716  VisitOMPLoopDirective(D);
2717  Record.writeBool(D->hasCancel());
2719 }
2720 
2721 void ASTStmtWriter::VisitOMPParallelMasterTaskLoopSimdDirective(
2723  VisitOMPLoopDirective(D);
2725 }
2726 
2727 void ASTStmtWriter::VisitOMPParallelMaskedTaskLoopSimdDirective(
2729  VisitOMPLoopDirective(D);
2731 }
2732 
2733 void ASTStmtWriter::VisitOMPDistributeDirective(OMPDistributeDirective *D) {
2734  VisitOMPLoopDirective(D);
2736 }
2737 
2738 void ASTStmtWriter::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) {
2739  VisitStmt(D);
2740  VisitOMPExecutableDirective(D);
2742 }
2743 
2744 void ASTStmtWriter::VisitOMPDistributeParallelForDirective(
2746  VisitOMPLoopDirective(D);
2747  Record.writeBool(D->hasCancel());
2749 }
2750 
2751 void ASTStmtWriter::VisitOMPDistributeParallelForSimdDirective(
2753  VisitOMPLoopDirective(D);
2755 }
2756 
2757 void ASTStmtWriter::VisitOMPDistributeSimdDirective(
2759  VisitOMPLoopDirective(D);
2761 }
2762 
2763 void ASTStmtWriter::VisitOMPTargetParallelForSimdDirective(
2765  VisitOMPLoopDirective(D);
2767 }
2768 
2769 void ASTStmtWriter::VisitOMPTargetSimdDirective(OMPTargetSimdDirective *D) {
2770  VisitOMPLoopDirective(D);
2772 }
2773 
2774 void ASTStmtWriter::VisitOMPTeamsDistributeDirective(
2776  VisitOMPLoopDirective(D);
2778 }
2779 
2780 void ASTStmtWriter::VisitOMPTeamsDistributeSimdDirective(
2782  VisitOMPLoopDirective(D);
2784 }
2785 
2786 void ASTStmtWriter::VisitOMPTeamsDistributeParallelForSimdDirective(
2788  VisitOMPLoopDirective(D);
2790 }
2791 
2792 void ASTStmtWriter::VisitOMPTeamsDistributeParallelForDirective(
2794  VisitOMPLoopDirective(D);
2795  Record.writeBool(D->hasCancel());
2797 }
2798 
2799 void ASTStmtWriter::VisitOMPTargetTeamsDirective(OMPTargetTeamsDirective *D) {
2800  VisitStmt(D);
2801  VisitOMPExecutableDirective(D);
2803 }
2804 
2805 void ASTStmtWriter::VisitOMPTargetTeamsDistributeDirective(
2807  VisitOMPLoopDirective(D);
2809 }
2810 
2811 void ASTStmtWriter::VisitOMPTargetTeamsDistributeParallelForDirective(
2813  VisitOMPLoopDirective(D);
2814  Record.writeBool(D->hasCancel());
2816 }
2817 
2818 void ASTStmtWriter::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
2820  VisitOMPLoopDirective(D);
2821  Code = serialization::
2823 }
2824 
2825 void ASTStmtWriter::VisitOMPTargetTeamsDistributeSimdDirective(
2827  VisitOMPLoopDirective(D);
2829 }
2830 
2831 void ASTStmtWriter::VisitOMPInteropDirective(OMPInteropDirective *D) {
2832  VisitStmt(D);
2833  VisitOMPExecutableDirective(D);
2835 }
2836 
2837 void ASTStmtWriter::VisitOMPDispatchDirective(OMPDispatchDirective *D) {
2838  VisitStmt(D);
2839  VisitOMPExecutableDirective(D);
2840  Record.AddSourceLocation(D->getTargetCallLoc());
2842 }
2843 
2844 void ASTStmtWriter::VisitOMPMaskedDirective(OMPMaskedDirective *D) {
2845  VisitStmt(D);
2846  VisitOMPExecutableDirective(D);
2848 }
2849 
2850 void ASTStmtWriter::VisitOMPGenericLoopDirective(OMPGenericLoopDirective *D) {
2851  VisitOMPLoopDirective(D);
2853 }
2854 
2855 void ASTStmtWriter::VisitOMPTeamsGenericLoopDirective(
2857  VisitOMPLoopDirective(D);
2859 }
2860 
2861 void ASTStmtWriter::VisitOMPTargetTeamsGenericLoopDirective(
2863  VisitOMPLoopDirective(D);
2864  Record.writeBool(D->canBeParallelFor());
2866 }
2867 
2868 void ASTStmtWriter::VisitOMPParallelGenericLoopDirective(
2870  VisitOMPLoopDirective(D);
2872 }
2873 
2874 void ASTStmtWriter::VisitOMPTargetParallelGenericLoopDirective(
2876  VisitOMPLoopDirective(D);
2878 }
2879 
2880 //===----------------------------------------------------------------------===//
2881 // OpenACC Constructs/Directives.
2882 //===----------------------------------------------------------------------===//
2883 void ASTStmtWriter::VisitOpenACCConstructStmt(OpenACCConstructStmt *S) {
2884  Record.push_back(S->clauses().size());
2885  Record.writeEnum(S->Kind);
2886  Record.AddSourceRange(S->Range);
2887  Record.writeOpenACCClauseList(S->clauses());
2888 }
2889 
2890 void ASTStmtWriter::VisitOpenACCAssociatedStmtConstruct(
2892  VisitOpenACCConstructStmt(S);
2893  Record.AddStmt(S->getAssociatedStmt());
2894 }
2895 
2896 void ASTStmtWriter::VisitOpenACCComputeConstruct(OpenACCComputeConstruct *S) {
2897  VisitStmt(S);
2898  VisitOpenACCAssociatedStmtConstruct(S);
2900 }
2901 
2902 //===----------------------------------------------------------------------===//
2903 // ASTWriter Implementation
2904 //===----------------------------------------------------------------------===//
2905 
2907  assert(!SwitchCaseIDs.contains(S) && "SwitchCase recorded twice");
2908  unsigned NextID = SwitchCaseIDs.size();
2909  SwitchCaseIDs[S] = NextID;
2910  return NextID;
2911 }
2912 
2914  assert(SwitchCaseIDs.contains(S) && "SwitchCase hasn't been seen yet");
2915  return SwitchCaseIDs[S];
2916 }
2917 
2919  SwitchCaseIDs.clear();
2920 }
2921 
2922 /// Write the given substatement or subexpression to the
2923 /// bitstream.
2924 void ASTWriter::WriteSubStmt(Stmt *S) {
2926  ASTStmtWriter Writer(*this, Record);
2927  ++NumStatements;
2928 
2929  if (!S) {
2930  Stream.EmitRecord(serialization::STMT_NULL_PTR, Record);
2931  return;
2932  }
2933 
2934  llvm::DenseMap<Stmt *, uint64_t>::iterator I = SubStmtEntries.find(S);
2935  if (I != SubStmtEntries.end()) {
2936  Record.push_back(I->second);
2937  Stream.EmitRecord(serialization::STMT_REF_PTR, Record);
2938  return;
2939  }
2940 
2941 #ifndef NDEBUG
2942  assert(!ParentStmts.count(S) && "There is a Stmt cycle!");
2943 
2944  struct ParentStmtInserterRAII {
2945  Stmt *S;
2946  llvm::DenseSet<Stmt *> &ParentStmts;
2947 
2948  ParentStmtInserterRAII(Stmt *S, llvm::DenseSet<Stmt *> &ParentStmts)
2949  : S(S), ParentStmts(ParentStmts) {
2950  ParentStmts.insert(S);
2951  }
2952  ~ParentStmtInserterRAII() {
2953  ParentStmts.erase(S);
2954  }
2955  };
2956 
2957  ParentStmtInserterRAII ParentStmtInserter(S, ParentStmts);
2958 #endif
2959 
2960  Writer.Visit(S);
2961 
2962  uint64_t Offset = Writer.Emit();
2963  SubStmtEntries[S] = Offset;
2964 }
2965 
2966 /// Flush all of the statements that have been added to the
2967 /// queue via AddStmt().
2968 void ASTRecordWriter::FlushStmts() {
2969  // We expect to be the only consumer of the two temporary statement maps,
2970  // assert that they are empty.
2971  assert(Writer->SubStmtEntries.empty() && "unexpected entries in sub-stmt map");
2972  assert(Writer->ParentStmts.empty() && "unexpected entries in parent stmt map");
2973 
2974  for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) {
2975  Writer->WriteSubStmt(StmtsToEmit[I]);
2976 
2977  assert(N == StmtsToEmit.size() && "record modified while being written!");
2978 
2979  // Note that we are at the end of a full expression. Any
2980  // expression records that follow this one are part of a different
2981  // expression.
2982  Writer->Stream.EmitRecord(serialization::STMT_STOP, ArrayRef<uint32_t>());
2983 
2984  Writer->SubStmtEntries.clear();
2985  Writer->ParentStmts.clear();
2986  }
2987 
2988  StmtsToEmit.clear();
2989 }
2990 
2991 void ASTRecordWriter::FlushSubStmts() {
2992  // For a nested statement, write out the substatements in reverse order (so
2993  // that a simple stack machine can be used when loading), and don't emit a
2994  // STMT_STOP after each one.
2995  for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) {
2996  Writer->WriteSubStmt(StmtsToEmit[N - I - 1]);
2997  assert(N == StmtsToEmit.size() && "record modified while being written!");
2998  }
2999 
3000  StmtsToEmit.clear();
3001 }
This file provides AST data structures related to concepts.
Defines the clang::ASTContext interface.
static void addConstraintSatisfaction(ASTRecordWriter &Record, const ASTConstraintSatisfaction &Satisfaction)
static void addSubstitutionDiagnostic(ASTRecordWriter &Record, const concepts::Requirement::SubstitutionDiagnostic *D)
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines the C++ template declaration subclasses.
unsigned Offset
Definition: Format.cpp:2978
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.
llvm::MachO::Record Record
Definition: MachO.h:31
SourceRange Range
Definition: SemaObjC.cpp:754
SourceLocation End
llvm::APInt getValue() const
An object for streaming information to a record.
void AddTemplateKWAndArgsInfo(const ASTTemplateKWAndArgsInfo &ArgInfo, const TemplateArgumentLoc *Args)
ASTStmtWriter & operator=(const ASTStmtWriter &)=delete
ASTStmtWriter(const ASTStmtWriter &)=delete
ASTStmtWriter(ASTWriter &Writer, ASTWriter::RecordData &Record)
void VisitStmt(Stmt *S)
Writes an AST file containing the contents of a translation unit.
Definition: ASTWriter.h:90
unsigned getBinaryOperatorAbbrev() const
Definition: ASTWriter.h:832
unsigned getExprImplicitCastAbbrev() const
Definition: ASTWriter.h:831
unsigned getSwitchCaseID(SwitchCase *S)
Retrieve the ID for the given switch-case statement.
unsigned getDeclRefExprAbbrev() const
Definition: ASTWriter.h:828
unsigned getCXXOperatorCallExprAbbrev()
Definition: ASTWriter.h:837
unsigned getCXXMemberCallExprAbbrev()
Definition: ASTWriter.h:838
unsigned getCompoundAssignOperatorAbbrev() const
Definition: ASTWriter.h:833
unsigned RecordSwitchCaseID(SwitchCase *S)
Record an ID for the given switch-case statement.
unsigned getCharacterLiteralAbbrev() const
Definition: ASTWriter.h:829
unsigned getCompoundStmtAbbrev() const
Definition: ASTWriter.h:840
void AddToken(const Token &Tok, RecordDataImpl &Record)
Emit a token.
Definition: ASTWriter.cpp:4683
SmallVector< uint64_t, 64 > RecordData
Definition: ASTWriter.h:95
unsigned getCallExprAbbrev() const
Definition: ASTWriter.h:836
unsigned getIntegerLiteralAbbrev() const
Definition: ASTWriter.h:830
SourceLocation getColonLoc() const
Definition: Expr.h:4221
SourceLocation getQuestionLoc() const
Definition: Expr.h:4220
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition: Expr.h:4390
SourceLocation getAmpAmpLoc() const
Definition: Expr.h:4405
LabelDecl * getLabel() const
Definition: Expr.h:4413
SourceLocation getLabelLoc() const
Definition: Expr.h:4407
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Definition: Expr.h:5605
Represents a loop initializing the elements of an array.
Definition: Expr.h:5552
This class represents BOTH the OpenMP Array Section and OpenACC 'subarray', with a boolean differenti...
Definition: Expr.h:6775
SourceLocation getRBracketLoc() const
Definition: Expr.h:6878
Expr * getBase()
Get base of the array section.
Definition: Expr.h:6841
bool isOMPArraySection() const
Definition: Expr.h:6837
Expr * getLowerBound()
Get lower bound of array section.
Definition: Expr.h:6845
Expr * getStride()
Get stride of array section.
Definition: Expr.h:6855
SourceLocation getColonLocSecond() const
Definition: Expr.h:6873
Expr * getLength()
Get length of array section.
Definition: Expr.h:6851
SourceLocation getColonLocFirst() const
Definition: Expr.h:6872
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition: Expr.h:2716
SourceLocation getRBracketLoc() const
Definition: Expr.h:2764
Expr * getLHS()
An array access can be written A[4] or 4[A] (both are equivalent).
Definition: Expr.h:2745
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
Definition: ExprCXX.h:2848
uint64_t getValue() const
Definition: ExprCXX.h:2894
TypeSourceInfo * getQueriedTypeSourceInfo() const
Definition: ExprCXX.h:2892
ArrayTypeTrait getTrait() const
Definition: ExprCXX.h:2888
Expr * getDimensionExpression() const
Definition: ExprCXX.h:2896
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Definition: Expr.h:6275
SourceLocation getBuiltinLoc() const
getBuiltinLoc - Return the location of the __builtin_astype token.
Definition: Expr.h:6297
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
Definition: Expr.h:6300
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition: Expr.h:6294
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
Definition: Stmt.h:3100
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Definition: Expr.h:6478
SourceLocation getRParenLoc() const
Definition: Expr.h:6583
static unsigned getNumSubExprs(AtomicOp Op)
Determine the number of arguments the specified atomic builtin should have.
Definition: Expr.cpp:5015
AtomicOp getOp() const
Definition: Expr.h:6542
Expr ** getSubExprs()
Definition: Expr.h:6555
SourceLocation getBuiltinLoc() const
Definition: Expr.h:6582
Represents an attribute applied to a statement.
Definition: Stmt.h:2080
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Definition: Expr.h:4293
Expr * getTrueExpr() const
getTrueExpr - Return the subexpression which will be evaluated if the condition evaluates to true; th...
Definition: Expr.h:4340
Expr * getFalseExpr() const
getFalseExpr - Return the subexpression which will be evaluated if the condnition evaluates to false;...
Definition: Expr.h:4347
Expr * getCommon() const
getCommon - Return the common expression, written to the left of the condition.
Definition: Expr.h:4328
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
Definition: Expr.h:4331
Expr * getCond() const
getCond - Return the condition expression; this is defined in terms of the opaque value.
Definition: Expr.h:4335
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3892
SourceLocation getOperatorLoc() const
Definition: Expr.h:3933
bool hasStoredFPFeatures() const
Definition: Expr.h:4076
FPOptionsOverride getStoredFPFeatures() const
Get FPFeatures from trailing storage.
Definition: Expr.h:4079
Opcode getOpcode() const
Definition: Expr.h:3936
Expr * getRHS() const
Definition: Expr.h:3943
Expr * getLHS() const
Definition: Expr.h:3941
A simple helper class to pack several bits in order into (a) 32 bit integer(s).
Definition: ASTWriter.h:988
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition: Decl.h:4497
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:6214
const BlockDecl * getBlockDecl() const
Definition: Expr.h:6226
BreakStmt - This represents a break.
Definition: Stmt.h:2980
Represents a C++2a __builtin_bit_cast(T, v) expression.
Definition: ExprCXX.h:5293
SourceLocation getEndLoc() const LLVM_READONLY
Definition: ExprCXX.h:5312
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: ExprCXX.h:5311
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr....
Definition: Expr.h:3823
SourceLocation getRParenLoc() const
Definition: Expr.h:3858
SourceLocation getLParenLoc() const
Definition: Expr.h:3855
Represents a call to a CUDA kernel function.
Definition: ExprCXX.h:231
const CallExpr * getConfig() const
Definition: ExprCXX.h:257
A C++ addrspace_cast expression (currently only enabled for OpenCL).
Definition: ExprCXX.h:601
Represents a base class of a C++ class.
Definition: DeclCXX.h:146
Represents binding an expression to a temporary.
Definition: ExprCXX.h:1487
const Expr * getSubExpr() const
Definition: ExprCXX.h:1509
CXXTemporary * getTemporary()
Definition: ExprCXX.h:1505
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition: ExprCXX.h:720
bool getValue() const
Definition: ExprCXX.h:737
SourceLocation getLocation() const
Definition: ExprCXX.h:743
CXXCatchStmt - This represents a C++ catch block.
Definition: StmtCXX.h:28
A C++ const_cast expression (C++ [expr.const.cast]).
Definition: ExprCXX.h:563
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1542
SourceRange getParenOrBraceRange() const
Definition: ExprCXX.h:1710
bool isElidable() const
Whether this construction is elidable.
Definition: ExprCXX.h:1611
bool hadMultipleCandidates() const
Whether the referred constructor was resolved from an overloaded set having size greater than 1.
Definition: ExprCXX.h:1616
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
Definition: ExprCXX.h:1635
bool isImmediateEscalating() const
Definition: ExprCXX.h:1700
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called.
Definition: ExprCXX.h:1644
SourceLocation getLocation() const
Definition: ExprCXX.h:1607
Expr * getArg(unsigned Arg)
Return the specified argument.
Definition: ExprCXX.h:1685
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
Definition: ExprCXX.h:1624
unsigned getNumArgs() const
Return the number of arguments to the constructor call.
Definition: ExprCXX.h:1682
CXXConstructionKind getConstructionKind() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
Definition: ExprCXX.h:1653
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
Definition: ExprCXX.h:1605
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1264
const ParmVarDecl * getParam() const
Definition: ExprCXX.h:1306
SourceLocation getUsedLocation() const
Retrieve the location where this default argument was actually used.
Definition: ExprCXX.h:1338
const DeclContext * getUsedContext() const
Definition: ExprCXX.h:1334
bool hasRewrittenInit() const
Definition: ExprCXX.h:1309
A use of a default initializer in a constructor or in aggregate initialization.
Definition: ExprCXX.h:1371
bool hasRewrittenInit() const
Definition: ExprCXX.h:1400
const Expr * getRewrittenExpr() const
Retrieve the initializing expression with evaluated immediate calls, if any.
Definition: ExprCXX.h:1416
const DeclContext * getUsedContext() const
Definition: ExprCXX.h:1428
FieldDecl * getField()
Get the field whose initializer will be used.
Definition: ExprCXX.h:1405
Represents a delete expression for memory deallocation and destructor calls, e.g.
Definition: ExprCXX.h:2493
Expr * getArgument()
Definition: ExprCXX.h:2534
bool isArrayForm() const
Definition: ExprCXX.h:2519
SourceLocation getBeginLoc() const
Definition: ExprCXX.h:2543
FunctionDecl * getOperatorDelete() const
Definition: ExprCXX.h:2532
bool isGlobalDelete() const
Definition: ExprCXX.h:2518
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
Definition: ExprCXX.h:2528
bool isArrayFormAsWritten() const
Definition: ExprCXX.h:2520
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3676
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '.
Definition: ExprCXX.h:3779
SourceLocation getOperatorLoc() const
Retrieve the location of the '->' or '.' operator.
Definition: ExprCXX.h:3782
Expr * getBase() const
Retrieve the base object of this member expressions, e.g., the x in x.m.
Definition: ExprCXX.h:3770
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: ExprCXX.h:3874
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the member name, with source location information.
Definition: ExprCXX.h:3793
bool isImplicitAccess() const
True if this is an implicit access, i.e.
Definition: ExprCXX.h:3762
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:3806
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Definition: ExprCXX.h:478
Represents a folding of a pack over an operator.
Definition: ExprCXX.h:4833
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
Definition: StmtCXX.h:135
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr....
Definition: ExprCXX.h:1813
SourceLocation getLParenLoc() const
Definition: ExprCXX.h:1850
SourceLocation getRParenLoc() const
Definition: ExprCXX.h:1852
Represents a call to an inherited base class constructor from an inheriting constructor.
Definition: ExprCXX.h:1733
bool constructsVBase() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
Definition: ExprCXX.h:1774
SourceLocation getLocation() const LLVM_READONLY
Definition: ExprCXX.h:1786
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will call.
Definition: ExprCXX.h:1770
bool inheritedFromVBase() const
Determine whether the inherited constructor is inherited from a virtual base of the object we constru...
Definition: ExprCXX.h:1784
Represents a call to a member function that may be written either with member call syntax (e....
Definition: ExprCXX.h:176
Abstract class common to all of the C++ "named"/"keyword" casts.
Definition: ExprCXX.h:372
SourceLocation getOperatorLoc() const
Retrieve the location of the cast operator keyword, e.g., static_cast.
Definition: ExprCXX.h:403
SourceRange getAngleBrackets() const LLVM_READONLY
Definition: ExprCXX.h:410
SourceLocation getRParenLoc() const
Retrieve the location of the closing parenthesis.
Definition: ExprCXX.h:406
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Definition: ExprCXX.h:2236
bool isArray() const
Definition: ExprCXX.h:2344
SourceRange getDirectInitRange() const
Definition: ExprCXX.h:2476
bool hasInitializer() const
Whether this new-expression has any initializer at all.
Definition: ExprCXX.h:2400
bool passAlignment() const
Indicates whether the required alignment should be implicitly passed to the allocation function.
Definition: ExprCXX.h:2427
unsigned getNumPlacementArgs() const
Definition: ExprCXX.h:2374
TypeSourceInfo * getAllocatedTypeSourceInfo() const
Definition: ExprCXX.h:2318
SourceRange getSourceRange() const
Definition: ExprCXX.h:2477
SourceRange getTypeIdParens() const
Definition: ExprCXX.h:2392
bool isParenTypeId() const
Definition: ExprCXX.h:2391
FunctionDecl * getOperatorDelete() const
Definition: ExprCXX.h:2341
raw_arg_iterator raw_arg_end()
Definition: ExprCXX.h:2463
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
Definition: ExprCXX.h:2432
raw_arg_iterator raw_arg_begin()
Definition: ExprCXX.h:2462
bool isGlobalNew() const
Definition: ExprCXX.h:2397
FunctionDecl * getOperatorNew() const
Definition: ExprCXX.h:2339
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition: ExprCXX.h:4119
bool getValue() const
Definition: ExprCXX.h:4142
Expr * getOperand() const
Definition: ExprCXX.h:4136
SourceRange getSourceRange() const
Definition: ExprCXX.h:4140
The null pointer literal (C++11 [lex.nullptr])
Definition: ExprCXX.h:765
SourceLocation getLocation() const
Definition: ExprCXX.h:779
A call to an overloaded operator written using operator syntax.
Definition: ExprCXX.h:81
OverloadedOperatorKind getOperator() const
Returns the kind of overloaded operator that this expression refers to.
Definition: ExprCXX.h:111
Represents a list-initialization with parenthesis.
Definition: ExprCXX.h:4955
FieldDecl * getInitializedFieldInUnion()
Definition: ExprCXX.h:5035
ArrayRef< Expr * > getUserSpecifiedInitExprs()
Definition: ExprCXX.h:5003
ArrayRef< Expr * > getInitExprs()
Definition: ExprCXX.h:4995
SourceLocation getEndLoc() const LLVM_READONLY
Definition: ExprCXX.h:5013
SourceLocation getInitLoc() const LLVM_READONLY
Definition: ExprCXX.h:5015
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: ExprCXX.h:5011
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition: ExprCXX.h:2612
bool isArrow() const
Determine whether this pseudo-destructor expression was written using an '->' (otherwise,...
Definition: ExprCXX.h:2676
SourceLocation getTildeLoc() const
Retrieve the location of the '~'.
Definition: ExprCXX.h:2697
TypeSourceInfo * getScopeTypeInfo() const
Retrieve the scope type in a qualified pseudo-destructor expression.
Definition: ExprCXX.h:2690
NestedNameSpecifierLoc getQualifierLoc() const
Retrieves the nested-name-specifier that qualifies the type name, with source-location information.
Definition: ExprCXX.h:2665
SourceLocation getDestroyedTypeLoc() const
Retrieve the starting location of the type being destroyed.
Definition: ExprCXX.h:2721
const IdentifierInfo * getDestroyedTypeIdentifier() const
In a dependent pseudo-destructor expression for which we do not have full type information on the des...
Definition: ExprCXX.h:2713
SourceLocation getColonColonLoc() const
Retrieve the location of the '::' in a qualified pseudo-destructor expression.
Definition: ExprCXX.h:2694
SourceLocation getOperatorLoc() const
Retrieve the location of the '.' or '->' operator.
Definition: ExprCXX.h:2679
TypeSourceInfo * getDestroyedTypeInfo() const
Retrieve the source location information for the type being destroyed.
Definition: ExprCXX.h:2706
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
Definition: ExprCXX.h:523
A rewritten comparison expression that was originally written using operator syntax.
Definition: ExprCXX.h:283
bool isReversed() const
Determine whether this expression was rewritten in reverse form.
Definition: ExprCXX.h:319
Expr * getSemanticForm()
Get an equivalent semantic form for this expression.
Definition: ExprCXX.h:301
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type.
Definition: ExprCXX.h:2177
TypeSourceInfo * getTypeSourceInfo() const
Definition: ExprCXX.h:2196
SourceLocation getRParenLoc() const
Definition: ExprCXX.h:2200
A C++ static_cast expression (C++ [expr.static.cast]).
Definition: ExprCXX.h:433
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition: ExprCXX.h:797
Represents a C++ functional cast expression that builds a temporary object.
Definition: ExprCXX.h:1881
TypeSourceInfo * getTypeSourceInfo() const
Definition: ExprCXX.h:1910
Represents the this expression in C++.
Definition: ExprCXX.h:1148
bool isCapturedByCopyInLambdaWithExplicitObjectParameter() const
Definition: ExprCXX.h:1174
bool isImplicit() const
Definition: ExprCXX.h:1171
SourceLocation getLocation() const
Definition: ExprCXX.h:1165
A C++ throw-expression (C++ [except.throw]).
Definition: ExprCXX.h:1202
const Expr * getSubExpr() const
Definition: ExprCXX.h:1222
SourceLocation getThrowLoc() const
Definition: ExprCXX.h:1225
bool isThrownVariableInScope() const
Determines whether the variable thrown by this expression (if any!) is within the innermost try block...
Definition: ExprCXX.h:1232
CXXTryStmt - A C++ try block, including all handlers.
Definition: StmtCXX.h:69
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition: ExprCXX.h:845
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition: ExprCXX.h:888
bool isTypeOperand() const
Definition: ExprCXX.h:881
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprCXX.h:899
Expr * getExprOperand() const
Definition: ExprCXX.h:892
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:3550
SourceLocation getLParenLoc() const
Retrieve the location of the left parentheses ('(') that precedes the argument list.
Definition: ExprCXX.h:3594
bool isListInitialization() const
Determine whether this expression models list-initialization.
Definition: ExprCXX.h:3605
TypeSourceInfo * getTypeSourceInfo() const
Retrieve the type source information for the type being constructed.
Definition: ExprCXX.h:3588
SourceLocation getRParenLoc() const
Retrieve the location of the right parentheses (')') that follows the argument list.
Definition: ExprCXX.h:3599
unsigned getNumArgs() const
Retrieve the number of arguments.
Definition: ExprCXX.h:3608
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
Definition: ExprCXX.h:1062
Expr * getExprOperand() const
Definition: ExprCXX.h:1103
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition: ExprCXX.h:1099
MSGuidDecl * getGuidDecl() const
Definition: ExprCXX.h:1108
bool isTypeOperand() const
Definition: ExprCXX.h:1092
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprCXX.h:1112
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2872
bool hasStoredFPFeatures() const
Definition: Expr.h:3034
arg_iterator arg_begin()
Definition: Expr.h:3116
arg_iterator arg_end()
Definition: Expr.h:3119
ADLCallKind getADLCallKind() const
Definition: Expr.h:3026
FPOptionsOverride getFPFeatures() const
Definition: Expr.h:3154
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition: Expr.h:3050
SourceLocation getRParenLoc() const
Definition: Expr.h:3182
Expr * getCallee()
Definition: Expr.h:3022
This captures a statement into a function.
Definition: Stmt.h:3757
CaseStmt - Represent a case statement.
Definition: Stmt.h:1801
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:3535
path_iterator path_begin()
Definition: Expr.h:3605
unsigned path_size() const
Definition: Expr.h:3604
CastKind getCastKind() const
Definition: Expr.h:3579
Expr * getSubExpr()
Definition: Expr.h:3585
bool hasStoredFPFeatures() const
Definition: Expr.h:3634
path_iterator path_end()
Definition: Expr.h:3606
FPOptionsOverride getFPFeatures() const
Definition: Expr.h:3650
SourceLocation getLocation() const
Definition: Expr.h:1602
unsigned getValue() const
Definition: Expr.h:1610
CharacterLiteralKind getKind() const
Definition: Expr.h:1603
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition: Expr.h:4610
Expr * getCond() const
Definition: Expr.h:4650
SourceLocation getBuiltinLoc() const
Definition: Expr.h:4657
bool isConditionDependent() const
Definition: Expr.h:4640
bool isConditionTrue() const
isConditionTrue - Return whether the condition is true (i.e.
Definition: Expr.h:4633
SourceLocation getRParenLoc() const
Definition: Expr.h:4660
Expr * getLHS() const
Definition: Expr.h:4652
Expr * getRHS() const
Definition: Expr.h:4654
Represents a 'co_await' expression.
Definition: ExprCXX.h:5186
bool isImplicit() const
Definition: ExprCXX.h:5208
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:4140
QualType getComputationLHSType() const
Definition: Expr.h:4174
QualType getComputationResultType() const
Definition: Expr.h:4177
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:3465
SourceLocation getLParenLoc() const
Definition: Expr.h:3495
TypeSourceInfo * getTypeSourceInfo() const
Definition: Expr.h:3498
bool isFileScope() const
Definition: Expr.h:3492
const Expr * getInitializer() const
Definition: Expr.h:3488
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:1606
A reference to a concept and its template args, as it appears in the code.
Definition: ASTConcept.h:128
Represents the specialization of a concept - evaluates to a prvalue of type bool.
Definition: ExprConcepts.h:42
ConceptReference * getConceptReference() const
Definition: ExprConcepts.h:85
const ASTConstraintSatisfaction & getSatisfaction() const
Get elaborated satisfaction info about the template arguments' satisfaction of the named concept.
Definition: ExprConcepts.h:133
const ImplicitConceptSpecializationDecl * getSpecializationDecl() const
Definition: ExprConcepts.h:116
ConditionalOperator - The ?: ternary operator.
Definition: Expr.h:4231
Expr * getLHS() const
Definition: Expr.h:4265
Expr * getCond() const
getCond - Return the expression representing the condition for the ?: operator.
Definition: Expr.h:4254
Expr * getRHS() const
Definition: Expr.h:4266
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition: Expr.h:1072
ConstantResultStorageKind getResultStorageKind() const
Definition: Expr.h:1141
ContinueStmt - This represents a continue.
Definition: Stmt.h:2950
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition: Expr.h:4551
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
Definition: Expr.h:4585
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition: Expr.h:4571
SourceLocation getBuiltinLoc() const
getBuiltinLoc - Return the location of the __builtin_convertvector token.
Definition: Expr.h:4582
TypeSourceInfo * getTypeSourceInfo() const
getTypeSourceInfo - Return the destination type.
Definition: Expr.h:4574
Represents a 'co_return' statement in the C++ Coroutines TS.
Definition: StmtCXX.h:473
Represents the body of a coroutine.
Definition: StmtCXX.h:320
ArrayRef< Stmt const * > getParamMoves() const
Definition: StmtCXX.h:423
child_range children()
Definition: StmtCXX.h:435
Represents an expression that might suspend coroutine execution; either a co_await or co_yield expres...
Definition: ExprCXX.h:5072
SourceLocation getKeywordLoc() const
Definition: ExprCXX.h:5163
child_range children()
Definition: ExprCXX.h:5171
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
Definition: ExprCXX.h:5126
Represents a 'co_yield' expression.
Definition: ExprCXX.h:5267
A POD class for pairing a NamedDecl* with an access specifier.
iterator begin()
Definition: DeclGroup.h:99
iterator end()
Definition: DeclGroup.h:105
A reference to a declared variable, function, enum, etc.
Definition: Expr.h:1260
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: Expr.h:1429
ValueDecl * getDecl()
Definition: Expr.h:1328
bool refersToEnclosingVariableOrCapture() const
Does this DeclRefExpr refer to an enclosing local or a captured variable?
Definition: Expr.h:1458
bool hasTemplateKWAndArgsInfo() const
Definition: Expr.h:1375
bool hasQualifier() const
Determine whether this declaration reference was preceded by a C++ nested-name-specifier,...
Definition: Expr.h:1343
NestedNameSpecifierLoc getQualifierLoc() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name,...
Definition: Expr.h:1347
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
Definition: Expr.h:1365
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
Definition: Expr.h:1452
bool hadMultipleCandidates() const
Returns true if this expression refers to a function that was resolved from an overloaded set having ...
Definition: Expr.h:1441
SourceLocation getLocation() const
Definition: Expr.h:1336
bool isImmediateEscalating() const
Definition: Expr.h:1462
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
Definition: Stmt.h:1497
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:86
AccessSpecifier getAccess() const
Definition: DeclBase.h:513
NameKind
The kind of the name stored in this DeclarationName.
NameKind getNameKind() const
Determine what kind of name this is.
Represents a 'co_await' expression while the type of the promise is dependent.
Definition: ExprCXX.h:5218
SourceLocation getKeywordLoc() const
Definition: ExprCXX.h:5247
child_range children()
Definition: ExprCXX.h:5255
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:3316
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source location information.
Definition: ExprCXX.h:3364
Represents a single C99 designator.
Definition: Expr.h:5176
Represents a C99 designated initializer expression.
Definition: Expr.h:5133
llvm::MutableArrayRef< Designator > designators()
Definition: Expr.h:5366
bool usesGNUSyntax() const
Determines whether this designated initializer used the deprecated GNU syntax for designated initiali...
Definition: Expr.h:5397
Expr * getSubExpr(unsigned Idx) const
Definition: Expr.h:5415
SourceLocation getEqualOrColonLoc() const
Retrieve the location of the '=' that precedes the initializer value itself, if present.
Definition: Expr.h:5388
unsigned getNumSubExprs() const
Retrieve the total number of subexpressions in this designated initializer expression,...
Definition: Expr.h:5413
Expr * getBase() const
Definition: Expr.h:5517
InitListExpr * getUpdater() const
Definition: Expr.h:5520
DoStmt - This represents a 'do/while' stmt.
Definition: Stmt.h:2725
ExplicitCastExpr - An explicit cast written in the source code.
Definition: Expr.h:3782
TypeSourceInfo * getTypeInfoAsWritten() const
getTypeInfoAsWritten - Returns the type source info for the type that this expression is casting to.
Definition: Expr.h:3804
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition: ExprCXX.h:3467
bool cleanupsHaveSideEffects() const
Definition: ExprCXX.h:3502
unsigned getNumObjects() const
Definition: ExprCXX.h:3495
ArrayRef< CleanupObject > getObjects() const
Definition: ExprCXX.h:3491
This represents one expression.
Definition: Expr.h:110
bool isValueDependent() const
Determines whether the value of this expression depends on.
Definition: Expr.h:175
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
Definition: Expr.h:437
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
Definition: Expr.h:444
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
Definition: Expr.cpp:277
QualType getType() const
Definition: Expr.h:142
ExprDependence getDependence() const
Definition: Expr.h:162
An expression trait intrinsic.
Definition: ExprCXX.h:2919
Expr * getQueriedExpression() const
Definition: ExprCXX.h:2958
ExpressionTrait getTrait() const
Definition: ExprCXX.h:2956
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:6154
const Expr * getBase() const
Definition: Expr.h:6171
IdentifierInfo & getAccessor() const
Definition: Expr.h:6175
SourceLocation getAccessorLoc() const
Definition: Expr.h:6178
storage_type getAsOpaqueInt() const
Definition: LangOptions.h:1014
Represents a member of a struct/union/class.
Definition: Decl.h:3060
SourceLocation getLocation() const
Retrieve the location of the literal.
Definition: Expr.h:1562
unsigned getScale() const
Definition: Expr.h:1566
SourceLocation getLocation() const
Definition: Expr.h:1688
llvm::APFloatBase::Semantics getRawSemantics() const
Get a raw enumeration value representing the floating-point semantics of this literal (32-bit IEEE,...
Definition: Expr.h:1657
llvm::APFloat getValue() const
Definition: Expr.h:1647
bool isExact() const
Definition: Expr.h:1680
ForStmt - This represents a 'for (init;cond;inc)' stmt.
Definition: Stmt.h:2781
const Expr * getSubExpr() const
Definition: Expr.h:1052
Represents a reference to a function parameter pack or init-capture pack that has been substituted bu...
Definition: ExprCXX.h:4641
VarDecl * getParameterPack() const
Get the parameter pack which this expression refers to.
Definition: ExprCXX.h:4668
iterator end() const
Definition: ExprCXX.h:4677
VarDecl *const * iterator
Iterators over the parameters which the parameter pack expanded into.
Definition: ExprCXX.h:4675
unsigned getNumExpansions() const
Get the number of parameters in this parameter pack.
Definition: ExprCXX.h:4680
SourceLocation getParameterPackLocation() const
Get the location of the parameter pack.
Definition: ExprCXX.h:4671
iterator begin() const
Definition: ExprCXX.h:4676
This represents a GCC inline-assembly statement extension.
Definition: Stmt.h:3259
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Definition: Expr.h:4685
SourceLocation getTokenLocation() const
getTokenLocation - The location of the __null token.
Definition: Expr.h:4699
Represents a C11 generic selection.
Definition: Expr.h:5766
unsigned getNumAssocs() const
The number of association expressions.
Definition: Expr.h:6006
bool isExprPredicate() const
Whether this generic selection uses an expression as its controlling argument.
Definition: Expr.h:6022
SourceLocation getGenericLoc() const
Definition: Expr.h:6119
SourceLocation getRParenLoc() const
Definition: Expr.h:6123
SourceLocation getDefaultLoc() const
Definition: Expr.h:6122
GotoStmt - This represents a direct goto.
Definition: Stmt.h:2862
IfStmt - This represents an if/then/else.
Definition: Stmt.h:2138
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1....
Definition: Expr.h:1712
const Expr * getSubExpr() const
Definition: Expr.h:1724
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:3707
bool isPartOfExplicitCast() const
Definition: Expr.h:3738
Represents an implicitly-generated value initialization of an object of a given type.
Definition: Expr.h:5641
IndirectGotoStmt - This represents an indirect goto.
Definition: Stmt.h:2901
Describes an C or C++ initializer list.
Definition: Expr.h:4888
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
Definition: Expr.h:5007
unsigned getNumInits() const
Definition: Expr.h:4918
const Expr * getInit(unsigned Init) const
Definition: Expr.h:4934
SourceLocation getLBraceLoc() const
Definition: Expr.h:5042
bool hadArrayRangeDesignator() const
Definition: Expr.h:5065
SourceLocation getRBraceLoc() const
Definition: Expr.h:5044
Expr * getArrayFiller()
If this initializer list initializes an array with more elements than there are initializers in the l...
Definition: Expr.h:4982
InitListExpr * getSyntacticForm() const
Definition: Expr.h:5054
SourceLocation getLocation() const
Retrieve the location of the literal.
Definition: Expr.h:1520
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:2031
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition: ExprCXX.h:1950
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument for this lambda expression.
Definition: ExprCXX.h:2088
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
Definition: ExprCXX.h:2076
This represents a Microsoft inline-assembly statement extension.
Definition: Stmt.h:3482
Representation of a Microsoft __if_exists or __if_not_exists statement with a dependent name.
Definition: StmtCXX.h:253
A member reference to an MSPropertyDecl.
Definition: ExprCXX.h:929
NestedNameSpecifierLoc getQualifierLoc() const
Definition: ExprCXX.h:986
MSPropertyDecl * getPropertyDecl() const
Definition: ExprCXX.h:983
bool isArrow() const
Definition: ExprCXX.h:984
Expr * getBaseExpr() const
Definition: ExprCXX.h:982
SourceLocation getMemberLoc() const
Definition: ExprCXX.h:985
MS property subscript expression.
Definition: ExprCXX.h:1000
SourceLocation getRBracketLoc() const
Definition: ExprCXX.h:1037
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition: ExprCXX.h:4721
LifetimeExtendedTemporaryDecl * getLifetimeExtendedTemporaryDecl()
Definition: ExprCXX.h:4761
Expr * getSubExpr() const
Retrieve the temporary-generating subexpression whose value will be materialized into a glvalue.
Definition: ExprCXX.h:4738
MatrixSubscriptExpr - Matrix subscript expression for the MatrixType extension.
Definition: Expr.h:2794
SourceLocation getRBracketLoc() const
Definition: Expr.h:2846
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition: Expr.h:3224
SourceLocation getMemberLoc() const
getMemberLoc - Return the location of the "member", in X->F, it is the location of 'F'.
Definition: Expr.h:3413
SourceLocation getOperatorLoc() const
Definition: Expr.h:3406
NestedNameSpecifierLoc getQualifierLoc() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name,...
Definition: Expr.h:3326
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:3448
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Definition: Expr.h:3307
bool hasQualifier() const
Determines whether this member expression actually had a C++ nested-name-specifier prior to the name ...
Definition: Expr.h:3321
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: Expr.h:3389
Expr * getBase() const
Definition: Expr.h:3301
bool hadMultipleCandidates() const
Returns true if this member expression refers to a method that was resolved from an overloaded set ha...
Definition: Expr.h:3428
bool isArrow() const
Definition: Expr.h:3408
DeclAccessPair getFoundDecl() const
Retrieves the declaration found by lookup.
Definition: Expr.h:3311
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition: Decl.h:315
Represents a place-holder for an object not to be initialized by anything.
Definition: Expr.h:5461
NullStmt - This is the null statement ";": C99 6.8.3p3.
Definition: Stmt.h:1569
An explicit cast in C or a C-style cast in C++, which uses the syntax ([s1][s2]......
Definition: ExprOpenMP.h:24
Expr * getBase()
Fetches base expression of array shaping expression.
Definition: ExprOpenMP.h:90
ArrayRef< SourceRange > getBracketsRanges() const
Fetches source ranges for the brackets os the array shaping expression.
Definition: ExprOpenMP.h:85
SourceLocation getLParenLoc() const
Definition: ExprOpenMP.h:68
ArrayRef< Expr * > getDimensions() const
Fetches the dimensions for array shaping expression.
Definition: ExprOpenMP.h:80
SourceLocation getRParenLoc() const
Definition: ExprOpenMP.h:71
This represents '#pragma omp atomic' directive.
Definition: StmtOpenMP.h:2963
bool isXLHSInRHSPart() const
Return true if helper update expression has form 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' and...
Definition: StmtOpenMP.h:3112
bool isFailOnly() const
Return true if 'v' is updated only when the condition is evaluated false (compare capture only).
Definition: StmtOpenMP.h:3118
bool isPostfixUpdate() const
Return true if 'v' expression must be updated to original value of 'x', false if 'v' must be updated ...
Definition: StmtOpenMP.h:3115
This represents '#pragma omp barrier' directive.
Definition: StmtOpenMP.h:2641
This represents '#pragma omp cancel' directive.
Definition: StmtOpenMP.h:3671
OpenMPDirectiveKind getCancelRegion() const
Get cancellation region for the current cancellation point.
Definition: StmtOpenMP.h:3715
This represents '#pragma omp cancellation point' directive.
Definition: StmtOpenMP.h:3613
OpenMPDirectiveKind getCancelRegion() const
Get cancellation region for the current cancellation point.
Definition: StmtOpenMP.h:3657
Representation of an OpenMP canonical loop.
Definition: StmtOpenMP.h:142
This represents '#pragma omp critical' directive.
Definition: StmtOpenMP.h:2092
DeclarationNameInfo getDirectiveName() const
Return name of the directive.
Definition: StmtOpenMP.h:2147
This represents '#pragma omp depobj' directive.
Definition: StmtOpenMP.h:2857
This represents '#pragma omp dispatch' directive.
Definition: StmtOpenMP.h:5827
SourceLocation getTargetCallLoc() const
Return location of target-call.
Definition: StmtOpenMP.h:5878
This represents '#pragma omp distribute' directive.
Definition: StmtOpenMP.h:4441
This represents '#pragma omp distribute parallel for' composite directive.
Definition: StmtOpenMP.h:4564
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:4644
This represents '#pragma omp distribute parallel for simd' composite directive.
Definition: StmtOpenMP.h:4660
This represents '#pragma omp distribute simd' composite directive.
Definition: StmtOpenMP.h:4725
This represents '#pragma omp error' directive.
Definition: StmtOpenMP.h:6311
This is a basic class for representing single OpenMP executable directive.
Definition: StmtOpenMP.h:266
SourceLocation getBeginLoc() const
Returns starting location of directive kind.
Definition: StmtOpenMP.h:502
unsigned getNumClauses() const
Get number of clauses.
Definition: StmtOpenMP.h:518
OMPChildren * Data
Data, associated with the directive.
Definition: StmtOpenMP.h:295
OpenMPDirectiveKind getMappedDirective() const
Definition: StmtOpenMP.h:615
SourceLocation getEndLoc() const
Returns ending location of directive.
Definition: StmtOpenMP.h:504
This represents '#pragma omp flush' directive.
Definition: StmtOpenMP.h:2805
This represents '#pragma omp for' directive.
Definition: StmtOpenMP.h:1649
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1724
This represents '#pragma omp for simd' directive.
Definition: StmtOpenMP.h:1740
This represents '#pragma omp loop' directive.
Definition: StmtOpenMP.h:5982
This represents '#pragma omp interop' directive.
Definition: StmtOpenMP.h:5774
OpenMP 5.0 [2.1.6 Iterators] Iterators are identifiers that expand to multiple values in the clause o...
Definition: ExprOpenMP.h:151
SourceLocation getLParenLoc() const
Definition: ExprOpenMP.h:242
SourceLocation getSecondColonLoc(unsigned I) const
Gets the location of the second ':' (if any) in the range for the given iteratori definition.
Definition: Expr.cpp:5298
SourceLocation getColonLoc(unsigned I) const
Gets the location of the first ':' in the range for the given iterator definition.
Definition: Expr.cpp:5292
SourceLocation getRParenLoc() const
Definition: ExprOpenMP.h:245
IteratorRange getIteratorRange(unsigned I)
Gets the iterator range for the given iterator.
Definition: Expr.cpp:5269
OMPIteratorHelperData & getHelper(unsigned I)
Fetches helper data for the specified iteration space.
Definition: Expr.cpp:5308
SourceLocation getAssignLoc(unsigned I) const
Gets the location of '=' for the given iterator definition.
Definition: Expr.cpp:5286
SourceLocation getIteratorKwLoc() const
Definition: ExprOpenMP.h:248
unsigned numOfIterators() const
Returns number of iterator definitions.
Definition: ExprOpenMP.h:275
Decl * getIteratorDecl(unsigned I)
Gets the iterator declaration for the given iterator.
Definition: Expr.cpp:5265
The base class for all loop-based directives, including loop transformation directives.
Definition: StmtOpenMP.h:698
unsigned getLoopsNumber() const
Get number of collapsed loops.
Definition: StmtOpenMP.h:892
This is a common base class for loop directives ('omp simd', 'omp for', 'omp for simd' etc....
Definition: StmtOpenMP.h:1018
The base class for all loop transformation directives.
Definition: StmtOpenMP.h:975
unsigned getNumGeneratedLoops() const
Return the number of loops generated by this loop transformation.
Definition: StmtOpenMP.h:997
This represents '#pragma omp masked' directive.
Definition: StmtOpenMP.h:5892
This represents '#pragma omp masked taskloop' directive.
Definition: StmtOpenMP.h:3946
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:4006
This represents '#pragma omp masked taskloop simd' directive.
Definition: StmtOpenMP.h:4087
This represents '#pragma omp master' directive.
Definition: StmtOpenMP.h:2044
This represents '#pragma omp master taskloop' directive.
Definition: StmtOpenMP.h:3870
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:3930
This represents '#pragma omp master taskloop simd' directive.
Definition: StmtOpenMP.h:4022
This represents '#pragma omp metadirective' directive.
Definition: StmtOpenMP.h:5943
This represents '#pragma omp ordered' directive.
Definition: StmtOpenMP.h:2909
This represents '#pragma omp parallel' directive.
Definition: StmtOpenMP.h:627
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:689
This represents '#pragma omp parallel for' directive.
Definition: StmtOpenMP.h:2163
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:2243
This represents '#pragma omp parallel for simd' directive.
Definition: StmtOpenMP.h:2260
This represents '#pragma omp parallel loop' directive.
Definition: StmtOpenMP.h:6184
This represents '#pragma omp parallel masked' directive.
Definition: StmtOpenMP.h:2388
This represents '#pragma omp parallel masked taskloop' directive.
Definition: StmtOpenMP.h:4231
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:4292
This represents '#pragma omp parallel masked taskloop simd' directive.
Definition: StmtOpenMP.h:4376
This represents '#pragma omp parallel master' directive.
Definition: StmtOpenMP.h:2325
This represents '#pragma omp parallel master taskloop' directive.
Definition: StmtOpenMP.h:4153
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:4214
This represents '#pragma omp parallel master taskloop simd' directive.
Definition: StmtOpenMP.h:4309
This represents '#pragma omp parallel sections' directive.
Definition: StmtOpenMP.h:2452
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:2518
This represents '#pragma omp scan' directive.
Definition: StmtOpenMP.h:5721
This represents '#pragma omp scope' directive.
Definition: StmtOpenMP.h:1941
This represents '#pragma omp section' directive.
Definition: StmtOpenMP.h:1880
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1927
This represents '#pragma omp sections' directive.
Definition: StmtOpenMP.h:1803
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1867
This represents '#pragma omp simd' directive.
Definition: StmtOpenMP.h:1585
This represents '#pragma omp single' directive.
Definition: StmtOpenMP.h:1993
This represents '#pragma omp target data' directive.
Definition: StmtOpenMP.h:3222
This represents '#pragma omp target' directive.
Definition: StmtOpenMP.h:3168
This represents '#pragma omp target enter data' directive.
Definition: StmtOpenMP.h:3276
This represents '#pragma omp target exit data' directive.
Definition: StmtOpenMP.h:3331
This represents '#pragma omp target parallel' directive.
Definition: StmtOpenMP.h:3385
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:3449
This represents '#pragma omp target parallel for' directive.
Definition: StmtOpenMP.h:3465
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:3545
This represents '#pragma omp target parallel for simd' directive.
Definition: StmtOpenMP.h:4791
This represents '#pragma omp target parallel loop' directive.
Definition: StmtOpenMP.h:6249
This represents '#pragma omp target simd' directive.
Definition: StmtOpenMP.h:4858
This represents '#pragma omp target teams' directive.
Definition: StmtOpenMP.h:5216
This represents '#pragma omp target teams distribute' combined directive.
Definition: StmtOpenMP.h:5272
This represents '#pragma omp target teams distribute parallel for' combined directive.
Definition: StmtOpenMP.h:5339
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:5419
This represents '#pragma omp target teams distribute parallel for simd' combined directive.
Definition: StmtOpenMP.h:5437
This represents '#pragma omp target teams distribute simd' combined directive.
Definition: StmtOpenMP.h:5507
This represents '#pragma omp target teams loop' directive.
Definition: StmtOpenMP.h:6109
bool canBeParallelFor() const
Return true if current loop directive's associated loop can be a parallel for.
Definition: StmtOpenMP.h:6169
This represents '#pragma omp target update' directive.
Definition: StmtOpenMP.h:4508
This represents '#pragma omp task' directive.
Definition: StmtOpenMP.h:2533
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:2582
This represents '#pragma omp taskloop' directive.
Definition: StmtOpenMP.h:3731
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:3788
This represents '#pragma omp taskloop simd' directive.
Definition: StmtOpenMP.h:3804
This represents '#pragma omp taskgroup' directive.
Definition: StmtOpenMP.h:2738
This represents '#pragma omp taskwait' directive.
Definition: StmtOpenMP.h:2687
This represents '#pragma omp taskyield' directive.
Definition: StmtOpenMP.h:2595
This represents '#pragma omp teams' directive.
Definition: StmtOpenMP.h:3560
This represents '#pragma omp teams distribute' directive.
Definition: StmtOpenMP.h:4923
This represents '#pragma omp teams distribute parallel for' composite directive.
Definition: StmtOpenMP.h:5123
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:5201
This represents '#pragma omp teams distribute parallel for simd' composite directive.
Definition: StmtOpenMP.h:5057
This represents '#pragma omp teams distribute simd' combined directive.
Definition: StmtOpenMP.h:4989
This represents '#pragma omp teams loop' directive.
Definition: StmtOpenMP.h:6044
This represents the '#pragma omp tile' loop transformation directive.
Definition: StmtOpenMP.h:5565
This represents the '#pragma omp unroll' loop transformation directive.
Definition: StmtOpenMP.h:5647
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp,...
Definition: ExprObjC.h:191
ObjCMethodDecl * getArrayWithObjectsMethod() const
Definition: ExprObjC.h:240
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c array literal.
Definition: ExprObjC.h:228
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprObjC.h:217
Expr * getElement(unsigned Index)
getElement - Return the Element at the specified index.
Definition: ExprObjC.h:231
Represents Objective-C's @catch statement.
Definition: StmtObjC.h:77
Represents Objective-C's @finally statement.
Definition: StmtObjC.h:127
Represents Objective-C's @synchronized statement.
Definition: StmtObjC.h:303
Represents Objective-C's @throw statement.
Definition: StmtObjC.h:358
Represents Objective-C's @try ... @catch ... @finally statement.
Definition: StmtObjC.h:167
Represents Objective-C's @autoreleasepool Statement.
Definition: StmtObjC.h:394
A runtime availability query.
Definition: ExprObjC.h:1696
SourceRange getSourceRange() const
Definition: ExprObjC.h:1715
VersionTuple getVersion() const
Definition: ExprObjC.h:1719
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition: ExprObjC.h:87
SourceLocation getLocation() const
Definition: ExprObjC.h:106
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:127
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprObjC.h:161
ObjCMethodDecl * getBoxingMethod() const
Definition: ExprObjC.h:146
Expr * getSubExpr()
Definition: ExprObjC.h:143
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers,...
Definition: ExprObjC.h:1636
SourceLocation getLParenLoc() const
Definition: ExprObjC.h:1659
SourceLocation getBridgeKeywordLoc() const
The location of the bridge keyword.
Definition: ExprObjC.h:1670
ObjCBridgeCastKind getBridgeKind() const
Determine which kind of bridge is being performed via this cast.
Definition: ExprObjC.h:1662
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
Definition: ExprObjC.h:309
ObjCMethodDecl * getDictWithObjectsMethod() const
Definition: ExprObjC.h:377
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c dictionary literal.
Definition: ExprObjC.h:360
ObjCDictionaryElement getKeyValueElement(unsigned Index) const
Definition: ExprObjC.h:362
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprObjC.h:383
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:410
TypeSourceInfo * getEncodedTypeSourceInfo() const
Definition: ExprObjC.h:431
SourceLocation getRParenLoc() const
Definition: ExprObjC.h:426
SourceLocation getAtLoc() const
Definition: ExprObjC.h:424
Represents Objective-C's collection statement.
Definition: StmtObjC.h:23
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
Definition: ExprObjC.h:1575
bool shouldCopy() const
shouldCopy - True if we should do the 'copy' part of the copy-restore.
Definition: ExprObjC.h:1603
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC 'id' type.
Definition: ExprObjC.h:1491
SourceLocation getIsaMemberLoc() const
getMemberLoc - Return the location of the "member", in X->F, it is the location of 'F'.
Definition: ExprObjC.h:1523
Expr * getBase() const
Definition: ExprObjC.h:1516
SourceLocation getOpLoc() const
Definition: ExprObjC.h:1526
bool isArrow() const
Definition: ExprObjC.h:1518
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:549
SourceLocation getLocation() const
Definition: ExprObjC.h:592
SourceLocation getOpLoc() const
Definition: ExprObjC.h:600
const Expr * getBase() const
Definition: ExprObjC.h:583
bool isArrow() const
Definition: ExprObjC.h:587
bool isFreeIvar() const
Definition: ExprObjC.h:588
ObjCIvarDecl * getDecl()
Definition: ExprObjC.h:579
An expression that sends a message to the given Objective-C object or class.
Definition: ExprObjC.h:945
bool isDelegateInitCall() const
isDelegateInitCall - Answers whether this message send has been tagged as a "delegate init call",...
Definition: ExprObjC.h:1413
SourceLocation getLeftLoc() const
Definition: ExprObjC.h:1416
SourceLocation getSuperLoc() const
Retrieve the location of the 'super' keyword for a class or instance message to 'super',...
Definition: ExprObjC.h:1301
Selector getSelector() const
Definition: ExprObjC.cpp:293
Expr * getInstanceReceiver()
Returns the object expression (receiver) for an instance message, or null for a message that is not a...
Definition: ExprObjC.h:1260
@ SuperInstance
The receiver is the instance of the superclass object.
Definition: ExprObjC.h:959
@ Instance
The receiver is an object instance.
Definition: ExprObjC.h:953
@ SuperClass
The receiver is a superclass.
Definition: ExprObjC.h:956
@ Class
The receiver is a class.
Definition: ExprObjC.h:950
QualType getSuperType() const
Retrieve the type referred to by 'super'.
Definition: ExprObjC.h:1336
const ObjCMethodDecl * getMethodDecl() const
Definition: ExprObjC.h:1356
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
Definition: ExprObjC.h:1234
TypeSourceInfo * getClassReceiverTypeInfo() const
Returns a type-source information of a class message send, or nullptr if the message is not a class m...
Definition: ExprObjC.h:1288
arg_iterator arg_begin()
Definition: ExprObjC.h:1470
SourceLocation getRightLoc() const
Definition: ExprObjC.h:1417
unsigned getNumArgs() const
Return the number of actual arguments in this message, not counting the receiver.
Definition: ExprObjC.h:1382
arg_iterator arg_end()
Definition: ExprObjC.h:1472
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:617
ObjCPropertyDecl * getExplicitProperty() const
Definition: ExprObjC.h:706
const Expr * getBase() const
Definition: ExprObjC.h:755
SourceLocation getReceiverLocation() const
Definition: ExprObjC.h:764
bool isObjectReceiver() const
Definition: ExprObjC.h:774
ObjCInterfaceDecl * getClassReceiver() const
Definition: ExprObjC.h:770
QualType getSuperReceiverType() const
Definition: ExprObjC.h:766
ObjCMethodDecl * getImplicitPropertySetter() const
Definition: ExprObjC.h:716
bool isImplicitProperty() const
Definition: ExprObjC.h:703
SourceLocation getLocation() const
Definition: ExprObjC.h:762
ObjCMethodDecl * getImplicitPropertyGetter() const
Definition: ExprObjC.h:711
bool isSuperReceiver() const
Definition: ExprObjC.h:775
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition: ExprObjC.h:505
ObjCProtocolDecl * getProtocol() const
Definition: ExprObjC.h:522
SourceLocation getRParenLoc() const
Definition: ExprObjC.h:527
SourceLocation getAtLoc() const
Definition: ExprObjC.h:526
ObjCSelectorExpr used for @selector in Objective-C.
Definition: ExprObjC.h:455
SourceLocation getRParenLoc() const
Definition: ExprObjC.h:473
Selector getSelector() const
Definition: ExprObjC.h:469
SourceLocation getAtLoc() const
Definition: ExprObjC.h:472
ObjCStringLiteral, used for Objective-C string literals i.e.
Definition: ExprObjC.h:51
SourceLocation getAtLoc() const
Definition: ExprObjC.h:68
StringLiteral * getString()
Definition: ExprObjC.h:64
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:844
ObjCMethodDecl * setAtIndexMethodDecl() const
Definition: ExprObjC.h:893
Expr * getBaseExpr() const
Definition: ExprObjC.h:883
Expr * getKeyExpr() const
Definition: ExprObjC.h:886
ObjCMethodDecl * getAtIndexMethodDecl() const
Definition: ExprObjC.h:889
SourceLocation getRBracket() const
Definition: ExprObjC.h:874
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type,...
Definition: Expr.h:2517
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
Definition: Expr.h:2550
TypeSourceInfo * getTypeSourceInfo() const
Definition: Expr.h:2557
const OffsetOfNode & getComponent(unsigned Idx) const
Definition: Expr.h:2564
unsigned getNumExpressions() const
Definition: Expr.h:2593
SourceLocation getRParenLoc() const
Return the location of the right parentheses.
Definition: Expr.h:2554
Expr * getIndexExpr(unsigned Idx)
Definition: Expr.h:2578
unsigned getNumComponents() const
Definition: Expr.h:2574
Helper class for OffsetOfExpr.
Definition: Expr.h:2411
unsigned getArrayExprIndex() const
For an array element node, returns the index into the array of expressions.
Definition: Expr.h:2469
IdentifierInfo * getFieldName() const
For a field or identifier offsetof node, returns the name of the field.
Definition: Expr.cpp:1747
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range that covers this offsetof node.
Definition: Expr.h:2496
FieldDecl * getField() const
For a field offsetof node, returns the field.
Definition: Expr.h:2475
CXXBaseSpecifier * getBase() const
For a base class node, returns the base specifier.
Definition: Expr.h:2485
@ Array
An index into an array.
Definition: Expr.h:2416
@ Identifier
A field in a dependent type, known only by its name.
Definition: Expr.h:2420
@ Field
A field.
Definition: Expr.h:2418
@ Base
An implicit indirection through a C++ base class, when the field found is in a base class.
Definition: Expr.h:2423
Kind getKind() const
Determine what kind of offsetof node this is.
Definition: Expr.h:2465
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
Definition: Expr.h:1168
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
Definition: Expr.h:1218
SourceLocation getLocation() const
Retrieve the location of this expression.
Definition: Expr.h:1190
bool isUnique() const
Definition: Expr.h:1226
This is a base class for any OpenACC statement-level constructs that have an associated statement.
Definition: StmtOpenACC.h:76
This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...
Definition: StmtOpenACC.h:124
This is the base class for an OpenACC statement-level construct, other construct types are expected t...
Definition: StmtOpenACC.h:25
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr.
Definition: ExprCXX.h:2978
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
Definition: ExprCXX.h:4092
decls_iterator decls_begin() const
Definition: ExprCXX.h:3070
unsigned getNumDecls() const
Gets the number of declarations in the unresolved set.
Definition: ExprCXX.h:3081
const DeclarationNameInfo & getNameInfo() const
Gets the full name info.
Definition: ExprCXX.h:3084
NestedNameSpecifierLoc getQualifierLoc() const
Fetches the nested-name qualifier with source-location information, if one was given.
Definition: ExprCXX.h:3099
TemplateArgumentLoc * getTrailingTemplateArgumentLoc()
Return the optional template arguments.
Definition: ExprCXX.h:4102
bool hasTemplateKWAndArgsInfo() const
Definition: ExprCXX.h:3022
decls_iterator decls_end() const
Definition: ExprCXX.h:3073
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition: ExprCXX.h:4173
SourceLocation getEllipsisLoc() const
Retrieve the location of the ellipsis that describes this pack expansion.
Definition: ExprCXX.h:4209
Expr * getPattern()
Retrieve the pattern of the pack expansion.
Definition: ExprCXX.h:4202
SourceLocation getEllipsisLoc() const
Determine the location of the 'sizeof' keyword.
Definition: ExprCXX.h:4426
Expr * getPackIdExpression() const
Definition: ExprCXX.h:4437
SourceLocation getRSquareLoc() const
Determine the location of the right parenthesis.
Definition: ExprCXX.h:4432
ArrayRef< Expr * > getExpressions() const
Return the trailing expressions, regardless of the expansion.
Definition: ExprCXX.h:4459
Expr * getIndexExpr() const
Definition: ExprCXX.h:4441
ParenExpr - This represents a parethesized expression, e.g.
Definition: Expr.h:2182
SourceLocation getLParen() const
Get the location of the left parentheses '('.
Definition: Expr.h:2205
const Expr * getSubExpr() const
Definition: Expr.h:2197
SourceLocation getRParen() const
Get the location of the right parentheses ')'.
Definition: Expr.h:2209
unsigned getNumExprs() const
Return the number of expressions in this paren list.
Definition: Expr.h:5694
SourceLocation getLParenLoc() const
Definition: Expr.h:5711
SourceLocation getRParenLoc() const
Definition: Expr.h:5712
ArrayRef< Expr * > exprs()
Definition: Expr.h:5709
Represents a parameter to a function.
Definition: Decl.h:1762
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:1986
bool isTransparent() const
Definition: Expr.h:2025
PredefinedIdentKind getIdentKind() const
Definition: Expr.h:2021
SourceLocation getLocation() const
Definition: Expr.h:2027
StringLiteral * getFunctionName()
Definition: Expr.h:2030
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition: Expr.h:6346
semantics_iterator semantics_end()
Definition: Expr.h:6418
unsigned getResultExprIndex() const
Return the index of the result-bearing expression into the semantics expressions, or PseudoObjectExpr...
Definition: Expr.h:6393
Expr * getSyntacticForm()
Return the syntactic form of this expression, i.e.
Definition: Expr.h:6388
semantics_iterator semantics_begin()
Definition: Expr.h:6412
Expr *const * semantics_iterator
Definition: Expr.h:6410
unsigned getNumSemanticExprs() const
Definition: Expr.h:6408
Frontend produces RecoveryExprs on semantic errors that prevent creating other well-formed expression...
Definition: Expr.h:6950
SourceLocation getEndLoc() const
Definition: Expr.h:6972
child_range children()
Definition: Expr.h:6966
SourceLocation getBeginLoc() const
Definition: Expr.h:6971
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
Definition: ExprConcepts.h:510
SourceLocation getLParenLoc() const
Definition: ExprConcepts.h:578
SourceLocation getRParenLoc() const
Definition: ExprConcepts.h:579
SourceLocation getEndLoc() const LLVM_READONLY
Definition: ExprConcepts.h:589
RequiresExprBodyDecl * getBody() const
Definition: ExprConcepts.h:554
ArrayRef< concepts::Requirement * > getRequirements() const
Definition: ExprConcepts.h:556
ArrayRef< ParmVarDecl * > getLocalParameters() const
Definition: ExprConcepts.h:550
ReturnStmt - This represents a return, optionally of an expression: return; return 4;.
Definition: Stmt.h:3019
Represents a __leave statement.
Definition: Stmt.h:3718
Represents a __builtin_base_type expression.
Definition: ExprCXX.h:5459
QualType getSourceType() const
Definition: ExprCXX.h:5477
const Expr * getIndex() const
Definition: ExprCXX.h:5479
SourceLocation getLocation() const
Definition: ExprCXX.h:5485
Represents a __builtin_field_type expression.
Definition: ExprCXX.h:5372
QualType getSourceType() const
Definition: ExprCXX.h:5390
SourceLocation getLocation() const
Definition: ExprCXX.h:5398
const Expr * getIndex() const
Definition: ExprCXX.h:5392
Represents a __builtin_num_bases expression.
Definition: ExprCXX.h:5413
SourceLocation getLocation() const
Definition: ExprCXX.h:5441
QualType getSourceType() const
Definition: ExprCXX.h:5429
Represents a __builtin_num_fields expression.
Definition: ExprCXX.h:5320
QualType getSourceType() const
Definition: ExprCXX.h:5337
SourceLocation getLocation() const
Definition: ExprCXX.h:5350
SourceLocation getLocation() const
Definition: Expr.h:2158
SourceLocation getLParenLocation() const
Definition: Expr.h:2159
SourceLocation getRParenLocation() const
Definition: Expr.h:2160
TypeSourceInfo * getTypeSourceInfo()
Definition: Expr.h:2091
SourceLocation getLocation() const
Definition: Expr.h:2103
SourceLocation getLParenLocation() const
Definition: Expr.h:2104
SourceLocation getRParenLocation() const
Definition: Expr.h:2105
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition: Expr.h:4483
SourceLocation getBuiltinLoc() const
Definition: Expr.h:4501
unsigned getNumSubExprs() const
getNumSubExprs - Return the size of the SubExprs array.
Definition: Expr.h:4517
SourceLocation getRParenLoc() const
Definition: Expr.h:4504
Expr * getExpr(unsigned Index)
getExpr - Return the Expr at the specified index.
Definition: Expr.h:4523
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:4251
ArrayRef< TemplateArgument > getPartialArguments() const
Get.
Definition: ExprCXX.h:4342
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof...
Definition: ExprCXX.h:4337
unsigned getPackLength() const
Retrieve the length of the parameter pack.
Definition: ExprCXX.h:4326
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(),...
Definition: Expr.h:4779
const DeclContext * getParentContext() const
If the SourceLocExpr has been resolved return the subexpression representing the resolved value.
Definition: Expr.h:4820
SourceLocation getBeginLoc() const
Definition: Expr.h:4824
SourceLocation getEndLoc() const
Definition: Expr.h:4825
SourceLocIdentKind getIdentKind() const
Definition: Expr.h:4799
Encodes a location in the source.
A trivial tuple used to represent a source range.
SourceLocation getEnd() const
SourceLocation getBegin() const
bool isValid() const
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition: Expr.h:4435
CompoundStmt * getSubStmt()
Definition: Expr.h:4452
unsigned getTemplateDepth() const
Definition: Expr.h:4464
SourceLocation getRParenLoc() const
Definition: Expr.h:4461
SourceLocation getLParenLoc() const
Definition: Expr.h:4459
StmtVisitor - This class implements a simple visitor for Stmt subclasses.
Definition: StmtVisitor.h:185
Stmt - This represents one statement.
Definition: Stmt.h:84
LambdaExprBitfields LambdaExprBits
Definition: Stmt.h:1263
StmtClass getStmtClass() const
Definition: Stmt.h:1358
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
Definition: Stmt.cpp:326
TypeTraitExprBitfields TypeTraitExprBits
Definition: Stmt.h:1252
CXXNewExprBitfields CXXNewExprBits
Definition: Stmt.h:1250
ConstantExprBitfields ConstantExprBits
Definition: Stmt.h:1218
RequiresExprBitfields RequiresExprBits
Definition: Stmt.h:1264
DependentScopeDeclRefExprBitfields DependentScopeDeclRefExprBits
Definition: Stmt.h:1253
StringLiteral - This represents a string literal expression, e.g.
Definition: Expr.h:1773
SourceLocation getStrTokenLoc(unsigned TokNum) const
Get one of the string literal token.
Definition: Expr.h:1926
bool isPascal() const
Definition: Expr.h:1903
unsigned getLength() const
Definition: Expr.h:1890
StringLiteralKind getKind() const
Definition: Expr.h:1893
StringRef getBytes() const
Allow access to clients that need the byte representation, such as ASTWriterStmt::VisitStringLiteral(...
Definition: Expr.h:1858
unsigned getByteLength() const
Definition: Expr.h:1889
unsigned getNumConcatenated() const
getNumConcatenated - Get the number of string literal tokens that were concatenated in translation ph...
Definition: Expr.h:1921
unsigned getCharByteWidth() const
Definition: Expr.h:1891
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition: ExprCXX.h:4477
std::optional< unsigned > getPackIndex() const
Definition: ExprCXX.h:4525
unsigned getIndex() const
Returns the index of the replaced parameter in the associated declaration.
Definition: ExprCXX.h:4523
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern being substituted.
Definition: ExprCXX.h:4519
SourceLocation getNameLoc() const
Definition: ExprCXX.h:4509
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition: ExprCXX.h:4562
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern being substituted.
Definition: ExprCXX.h:4592
TemplateArgument getArgumentPack() const
Retrieve the template argument pack containing the substituted template arguments.
Definition: ExprCXX.cpp:1729
SourceLocation getParameterPackLocation() const
Retrieve the location of the parameter pack name.
Definition: ExprCXX.h:4602
unsigned getIndex() const
Returns the index of the replaced parameter in the associated declaration.
Definition: ExprCXX.h:4596
SwitchStmt - This represents a 'switch' stmt.
Definition: Stmt.h:2388
Location wrapper for a TemplateArgument.
Definition: TemplateBase.h:524
A container of type source information.
Definition: Type.h:7342
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2763
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
Definition: ExprCXX.h:2810
TypeSourceInfo * getArg(unsigned I) const
Retrieve the Ith argument.
Definition: ExprCXX.h:2813
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
Definition: Expr.h:6626
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition: Expr.h:2620
SourceLocation getRParenLoc() const
Definition: Expr.h:2696
SourceLocation getOperatorLoc() const
Definition: Expr.h:2693
TypeSourceInfo * getArgumentTypeInfo() const
Definition: Expr.h:2666
bool isArgumentType() const
Definition: Expr.h:2662
UnaryExprOrTypeTrait getKind() const
Definition: Expr.h:2652
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition: Expr.h:2235
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
Definition: Expr.h:2284
Opcode getOpcode() const
Definition: Expr.h:2275
bool hasStoredFPFeatures() const
Is FPFeatures in Trailing Storage?
Definition: Expr.h:2376
Expr * getSubExpr() const
Definition: Expr.h:2280
FPOptionsOverride getStoredFPFeatures() const
Get FPFeatures from trailing storage.
Definition: Expr.h:2379
bool canOverflow() const
Returns true if the unary operator can cause an overflow.
Definition: Expr.h:2293
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:3197
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
Definition: ExprCXX.h:3265
CXXRecordDecl * getNamingClass()
Gets the 'naming class' (in the sense of C++0x [class.access.base]p5) of the lookup.
Definition: ExprCXX.h:3270
Represents a C++ member access expression for which lookup produced a set of overloaded functions.
Definition: ExprCXX.h:3936
QualType getBaseType() const
Definition: ExprCXX.h:4018
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '.
Definition: ExprCXX.h:4028
SourceLocation getOperatorLoc() const
Retrieve the location of the '->' or '.' operator.
Definition: ExprCXX.h:4031
bool hasUnresolvedUsing() const
Determine whether the lookup results contain an unresolved using declaration.
Definition: ExprCXX.h:4022
Expr * getBase()
Retrieve the base object of this member expressions, e.g., the x in x.m.
Definition: ExprCXX.h:4009
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:1579
The iterator over UnresolvedSets.
Definition: UnresolvedSet.h:35
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit....
Definition: ExprCXX.h:637
Represents a call to the builtin function __builtin_va_arg.
Definition: Expr.h:4719
SourceLocation getBuiltinLoc() const
Definition: Expr.h:4746
SourceLocation getRParenLoc() const
Definition: Expr.h:4749
bool isMicrosoftABI() const
Returns whether this is really a Win64 ABI va_arg expression.
Definition: Expr.h:4740
TypeSourceInfo * getWrittenTypeInfo() const
Definition: Expr.h:4743
const Expr * getSubExpr() const
Definition: Expr.h:4735
WhileStmt - This represents a 'while' stmt.
Definition: Stmt.h:2584
A static requirement that can be used in a requires-expression to check properties of types and expre...
Definition: ExprConcepts.h:168
StmtCode
Record codes for each kind of statement or expression.
Definition: ASTBitCodes.h:1469
@ EXPR_DESIGNATED_INIT
A DesignatedInitExpr record.
Definition: ASTBitCodes.h:1616
@ EXPR_COMPOUND_LITERAL
A CompoundLiteralExpr record.
Definition: ASTBitCodes.h:1607
@ STMT_OMP_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1909
@ EXPR_OBJC_IVAR_REF_EXPR
An ObjCIvarRefExpr record.
Definition: ASTBitCodes.h:1691
@ EXPR_MEMBER
A MemberExpr record.
Definition: ASTBitCodes.h:1589
@ EXPR_CXX_TEMPORARY_OBJECT
A CXXTemporaryObjectExpr record.
Definition: ASTBitCodes.h:1765
@ STMT_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1920
@ EXPR_COMPOUND_ASSIGN_OPERATOR
A CompoundAssignOperator record.
Definition: ASTBitCodes.h:1595
@ EXPR_CXX_STATIC_CAST
A CXXStaticCastExpr record.
Definition: ASTBitCodes.h:1768
@ EXPR_OBJC_STRING_LITERAL
An ObjCStringLiteral record.
Definition: ASTBitCodes.h:1675
@ EXPR_VA_ARG
A VAArgExpr record.
Definition: ASTBitCodes.h:1634
@ STMT_OMP_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1914
@ EXPR_OBJC_ISA
An ObjCIsa Expr record.
Definition: ASTBitCodes.h:1706
@ EXPR_CXX_OPERATOR_CALL
A CXXOperatorCallExpr record.
Definition: ASTBitCodes.h:1750
@ STMT_OBJC_AT_TRY
An ObjCAtTryStmt record.
Definition: ASTBitCodes.h:1721
@ STMT_DO
A DoStmt record.
Definition: ASTBitCodes.h:1508
@ STMT_OBJC_CATCH
An ObjCAtCatchStmt record.
Definition: ASTBitCodes.h:1715
@ STMT_IF
An IfStmt record.
Definition: ASTBitCodes.h:1499
@ EXPR_STRING_LITERAL
A StringLiteral record.
Definition: ASTBitCodes.h:1559
@ EXPR_OBJC_AVAILABILITY_CHECK
An ObjCAvailabilityCheckExpr record.
Definition: ASTBitCodes.h:1736
@ STMT_OMP_PARALLEL_MASKED_TASKLOOP_DIRECTIVE
Definition: ASTBitCodes.h:1904
@ EXPR_PSEUDO_OBJECT
A PseudoObjectExpr record.
Definition: ASTBitCodes.h:1664
@ STMT_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE
Definition: ASTBitCodes.h:1919
@ EXPR_IMPLICIT_CAST
An ImplicitCastExpr record.
Definition: ASTBitCodes.h:1601
@ STMT_CAPTURED
A CapturedStmt record.
Definition: ASTBitCodes.h:1532
@ STMT_OMP_TARGET_PARALLEL_FOR_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1911
@ STMT_GCCASM
A GCC-style AsmStmt record.
Definition: ASTBitCodes.h:1535
@ EXPR_IMAGINARY_LITERAL
An ImaginaryLiteral record.
Definition: ASTBitCodes.h:1556
@ STMT_WHILE
A WhileStmt record.
Definition: ASTBitCodes.h:1505
@ EXPR_CONVERT_VECTOR
A ConvertVectorExpr record.
Definition: ASTBitCodes.h:1655
@ EXPR_OBJC_SUBSCRIPT_REF_EXPR
An ObjCSubscriptRefExpr record.
Definition: ASTBitCodes.h:1697
@ EXPR_STMT
A StmtExpr record.
Definition: ASTBitCodes.h:1640
@ STMT_OMP_PARALLEL_GENERIC_LOOP_DIRECTIVE
Definition: ASTBitCodes.h:1929
@ EXPR_CXX_REINTERPRET_CAST
A CXXReinterpretCastExpr record.
Definition: ASTBitCodes.h:1774
@ EXPR_DESIGNATED_INIT_UPDATE
A DesignatedInitUpdateExpr record.
Definition: ASTBitCodes.h:1619
@ STMT_OBJC_AT_SYNCHRONIZED
An ObjCAtSynchronizedStmt record.
Definition: ASTBitCodes.h:1724
@ STMT_OMP_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE
Definition: ASTBitCodes.h:1908
@ EXPR_BUILTIN_BIT_CAST
A BuiltinBitCastExpr record.
Definition: ASTBitCodes.h:1786
@ STMT_OMP_TARGET_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1921
@ EXPR_CHARACTER_LITERAL
A CharacterLiteral record.
Definition: ASTBitCodes.h:1562
@ EXPR_OBJC_ENCODE
An ObjCEncodeExpr record.
Definition: ASTBitCodes.h:1682
@ EXPR_CSTYLE_CAST
A CStyleCastExpr record.
Definition: ASTBitCodes.h:1604
@ EXPR_OBJC_BOOL_LITERAL
An ObjCBoolLiteralExpr record.
Definition: ASTBitCodes.h:1733
@ EXPR_EXT_VECTOR_ELEMENT
An ExtVectorElementExpr record.
Definition: ASTBitCodes.h:1610
@ EXPR_ATOMIC
An AtomicExpr record.
Definition: ASTBitCodes.h:1667
@ EXPR_OFFSETOF
An OffsetOfExpr record.
Definition: ASTBitCodes.h:1574
@ STMT_RETURN
A ReturnStmt record.
Definition: ASTBitCodes.h:1526
@ STMT_OBJC_FOR_COLLECTION
An ObjCForCollectionStmt record.
Definition: ASTBitCodes.h:1712
@ STMT_OMP_TARGET_TEAMS_DISTRIBUTE_DIRECTIVE
Definition: ASTBitCodes.h:1918
@ EXPR_ARRAY_INIT_LOOP
An ArrayInitLoopExpr record.
Definition: ASTBitCodes.h:1625
@ STMT_OMP_PARALLEL_MASTER_TASKLOOP_DIRECTIVE
Definition: ASTBitCodes.h:1900
@ STMT_OMP_PARALLEL_MASKED_TASKLOOP_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1905
@ STMT_CONTINUE
A ContinueStmt record.
Definition: ASTBitCodes.h:1520
@ EXPR_PREDEFINED
A PredefinedExpr record.
Definition: ASTBitCodes.h:1544
@ EXPR_CXX_BOOL_LITERAL
A CXXBoolLiteralExpr record.
Definition: ASTBitCodes.h:1795
@ EXPR_PAREN_LIST
A ParenListExpr record.
Definition: ASTBitCodes.h:1568
@ EXPR_CXX_PAREN_LIST_INIT
A CXXParenListInitExpr record.
Definition: ASTBitCodes.h:1798
@ STMT_OMP_MASTER_TASKLOOP_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1899
@ STMT_COMPOUND
A CompoundStmt record.
Definition: ASTBitCodes.h:1484
@ STMT_FOR
A ForStmt record.
Definition: ASTBitCodes.h:1511
@ STMT_ATTRIBUTED
An AttributedStmt record.
Definition: ASTBitCodes.h:1496
@ STMT_OMP_TARGET_TEAMS_GENERIC_LOOP_DIRECTIVE
Definition: ASTBitCodes.h:1928
@ EXPR_CXX_REWRITTEN_BINARY_OPERATOR
A CXXRewrittenBinaryOperator record.
Definition: ASTBitCodes.h:1756
@ STMT_GOTO
A GotoStmt record.
Definition: ASTBitCodes.h:1514
@ EXPR_NO_INIT
An NoInitExpr record.
Definition: ASTBitCodes.h:1622
@ EXPR_OBJC_PROTOCOL_EXPR
An ObjCProtocolExpr record.
Definition: ASTBitCodes.h:1688
@ EXPR_ARRAY_INIT_INDEX
An ArrayInitIndexExpr record.
Definition: ASTBitCodes.h:1628
@ EXPR_CXX_CONSTRUCT
A CXXConstructExpr record.
Definition: ASTBitCodes.h:1759
@ STMT_OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE
Definition: ASTBitCodes.h:1916
@ STMT_OMP_PARALLEL_MASTER_TASKLOOP_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1901
@ STMT_OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1915
@ EXPR_CXX_DYNAMIC_CAST
A CXXDynamicCastExpr record.
Definition: ASTBitCodes.h:1771
@ STMT_CXX_TRY
A CXXTryStmt record.
Definition: ASTBitCodes.h:1744
@ EXPR_GENERIC_SELECTION
A GenericSelectionExpr record.
Definition: ASTBitCodes.h:1661
@ EXPR_OBJC_INDIRECT_COPY_RESTORE
An ObjCIndirectCopyRestoreExpr record.
Definition: ASTBitCodes.h:1709
@ EXPR_CXX_INHERITED_CTOR_INIT
A CXXInheritedCtorInitExpr record.
Definition: ASTBitCodes.h:1762
@ EXPR_CALL
A CallExpr record.
Definition: ASTBitCodes.h:1586
@ EXPR_GNU_NULL
A GNUNullExpr record.
Definition: ASTBitCodes.h:1646
@ EXPR_OBJC_PROPERTY_REF_EXPR
An ObjCPropertyRefExpr record.
Definition: ASTBitCodes.h:1694
@ STMT_OMP_TARGET_PARALLEL_FOR_DIRECTIVE
Definition: ASTBitCodes.h:1891
@ EXPR_CXX_CONST_CAST
A CXXConstCastExpr record.
Definition: ASTBitCodes.h:1777
@ STMT_REF_PTR
A reference to a previously [de]serialized Stmt record.
Definition: ASTBitCodes.h:1478
@ EXPR_OBJC_MESSAGE_EXPR
An ObjCMessageExpr record.
Definition: ASTBitCodes.h:1703
@ STMT_CASE
A CaseStmt record.
Definition: ASTBitCodes.h:1487
@ EXPR_CONSTANT
A constant expression context.
Definition: ASTBitCodes.h:1541
@ STMT_STOP
A marker record that indicates that we are at the end of an expression.
Definition: ASTBitCodes.h:1472
@ STMT_MSASM
A MS-style AsmStmt record.
Definition: ASTBitCodes.h:1538
@ EXPR_CONDITIONAL_OPERATOR
A ConditionOperator record.
Definition: ASTBitCodes.h:1598
@ EXPR_BINARY_OPERATOR
A BinaryOperator record.
Definition: ASTBitCodes.h:1592
@ EXPR_CXX_STD_INITIALIZER_LIST
A CXXStdInitializerListExpr record.
Definition: ASTBitCodes.h:1792
@ EXPR_SHUFFLE_VECTOR
A ShuffleVectorExpr record.
Definition: ASTBitCodes.h:1652
@ STMT_OBJC_FINALLY
An ObjCAtFinallyStmt record.
Definition: ASTBitCodes.h:1718
@ EXPR_OBJC_SELECTOR_EXPR
An ObjCSelectorExpr record.
Definition: ASTBitCodes.h:1685
@ EXPR_FLOATING_LITERAL
A FloatingLiteral record.
Definition: ASTBitCodes.h:1553
@ STMT_NULL_PTR
A NULL expression.
Definition: ASTBitCodes.h:1475
@ STMT_DEFAULT
A DefaultStmt record.
Definition: ASTBitCodes.h:1490
@ EXPR_CHOOSE
A ChooseExpr record.
Definition: ASTBitCodes.h:1643
@ STMT_NULL
A NullStmt record.
Definition: ASTBitCodes.h:1481
@ EXPR_BLOCK
BlockExpr.
Definition: ASTBitCodes.h:1658
@ EXPR_DECL_REF
A DeclRefExpr record.
Definition: ASTBitCodes.h:1547
@ EXPR_INIT_LIST
An InitListExpr record.
Definition: ASTBitCodes.h:1613
@ EXPR_IMPLICIT_VALUE_INIT
An ImplicitValueInitExpr record.
Definition: ASTBitCodes.h:1631
@ STMT_OBJC_AUTORELEASE_POOL
An ObjCAutoreleasePoolStmt record.
Definition: ASTBitCodes.h:1730
@ EXPR_RECOVERY
A RecoveryExpr record.
Definition: ASTBitCodes.h:1670
@ EXPR_PAREN
A ParenExpr record.
Definition: ASTBitCodes.h:1565
@ STMT_OMP_TARGET_PARALLEL_GENERIC_LOOP_DIRECTIVE
Definition: ASTBitCodes.h:1930
@ STMT_LABEL
A LabelStmt record.
Definition: ASTBitCodes.h:1493
@ EXPR_CXX_FUNCTIONAL_CAST
A CXXFunctionalCastExpr record.
Definition: ASTBitCodes.h:1783
@ EXPR_USER_DEFINED_LITERAL
A UserDefinedLiteral record.
Definition: ASTBitCodes.h:1789
@ EXPR_INTEGER_LITERAL
An IntegerLiteral record.
Definition: ASTBitCodes.h:1550
@ EXPR_SOURCE_LOC
A SourceLocExpr record.
Definition: ASTBitCodes.h:1649
@ EXPR_CXX_MEMBER_CALL
A CXXMemberCallExpr record.
Definition: ASTBitCodes.h:1753
@ STMT_SWITCH
A SwitchStmt record.
Definition: ASTBitCodes.h:1502
@ STMT_DECL
A DeclStmt record.
Definition: ASTBitCodes.h:1529
@ EXPR_SUBST_NON_TYPE_TEMPLATE_PARM_PACK
Definition: ASTBitCodes.h:1834
@ STMT_OMP_MASKED_TASKLOOP_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1903
@ EXPR_SIZEOF_ALIGN_OF
A SizefAlignOfExpr record.
Definition: ASTBitCodes.h:1577
@ STMT_BREAK
A BreakStmt record.
Definition: ASTBitCodes.h:1523
@ STMT_OBJC_AT_THROW
An ObjCAtThrowStmt record.
Definition: ASTBitCodes.h:1727
@ EXPR_ADDR_LABEL
An AddrLabelExpr record.
Definition: ASTBitCodes.h:1637
@ STMT_CXX_FOR_RANGE
A CXXForRangeStmt record.
Definition: ASTBitCodes.h:1747
@ EXPR_CXX_ADDRSPACE_CAST
A CXXAddrspaceCastExpr record.
Definition: ASTBitCodes.h:1780
@ EXPR_ARRAY_SUBSCRIPT
An ArraySubscriptExpr record.
Definition: ASTBitCodes.h:1580
@ EXPR_UNARY_OPERATOR
A UnaryOperator record.
Definition: ASTBitCodes.h:1571
@ STMT_CXX_CATCH
A CXXCatchStmt record.
Definition: ASTBitCodes.h:1741
@ STMT_INDIRECT_GOTO
An IndirectGotoStmt record.
Definition: ASTBitCodes.h:1517
@ DESIG_ARRAY_RANGE
GNU array range designator.
Definition: ASTBitCodes.h:1976
@ DESIG_FIELD_NAME
Field designator where only the field name is known.
Definition: ASTBitCodes.h:1966
@ DESIG_FIELD_DECL
Field designator where the field has been resolved to a declaration.
Definition: ASTBitCodes.h:1970
@ DESIG_ARRAY
Array designator.
Definition: ASTBitCodes.h:1973
The JSON file list parser is used to communicate input to InstallAPI.
@ OK_Ordinary
An ordinary object is located at an address in memory.
Definition: Specifiers.h:148
@ VK_PRValue
A pr-value expression (in the C++11 taxonomy) produces a temporary value.
Definition: Specifiers.h:132
unsigned long uint64_t
float __ovld __cnfn distance(float, float)
Returns the distance between p0 and p1.
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
Definition: ASTConcept.h:93
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
Definition: TemplateBase.h:728
SourceLocation LAngleLoc
The source location of the left angle bracket ('<').
Definition: TemplateBase.h:730
unsigned NumTemplateArgs
The number of template arguments in TemplateArgs.
Definition: TemplateBase.h:742
SourceLocation RAngleLoc
The source location of the right angle bracket ('>').
Definition: TemplateBase.h:733
SourceLocation TemplateKWLoc
The source location of the template keyword; this is used as part of the representation of qualified ...
Definition: TemplateBase.h:739
Iterator range representation begin:end[:step].
Definition: ExprOpenMP.h:154
Helper expressions and declaration for OMPIteratorExpr class for each iteration space.
Definition: ExprOpenMP.h:111
Expr * CounterUpdate
Updater for the internal counter: ++CounterVD;.
Definition: ExprOpenMP.h:121
Expr * Upper
Normalized upper bound.
Definition: ExprOpenMP.h:116
Expr * Update
Update expression for the originally specified iteration variable, calculated as VD = Begin + Counter...
Definition: ExprOpenMP.h:119
VarDecl * CounterVD
Internal normalized counter.
Definition: ExprOpenMP.h:113
An element in an Objective-C dictionary literal.
Definition: ExprObjC.h:262
Iterator for iterating over Stmt * arrays that contain only T *.
Definition: Stmt.h:1316