clang  7.0.0
ASTWriterStmt.cpp
Go to the documentation of this file.
1 //===--- ASTWriterStmt.cpp - Statement and Expression Serialization -------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 ///
10 /// \file
11 /// Implements serialization for Statements and Expressions.
12 ///
13 //===----------------------------------------------------------------------===//
14 
16 #include "clang/AST/ASTContext.h"
17 #include "clang/AST/DeclCXX.h"
18 #include "clang/AST/DeclObjC.h"
19 #include "clang/AST/DeclTemplate.h"
20 #include "clang/AST/StmtVisitor.h"
21 #include "clang/Lex/Token.h"
22 #include "llvm/Bitcode/BitstreamWriter.h"
23 using namespace clang;
24 
25 //===----------------------------------------------------------------------===//
26 // Statement/expression serialization
27 //===----------------------------------------------------------------------===//
28 
29 namespace clang {
30 
31  class ASTStmtWriter : public StmtVisitor<ASTStmtWriter, void> {
32  ASTWriter &Writer;
33  ASTRecordWriter Record;
34 
36  unsigned AbbrevToUse;
37 
38  public:
40  : Writer(Writer), Record(Writer, Record),
41  Code(serialization::STMT_NULL_PTR), AbbrevToUse(0) {}
42 
43  ASTStmtWriter(const ASTStmtWriter&) = delete;
44 
45  uint64_t Emit() {
46  assert(Code != serialization::STMT_NULL_PTR &&
47  "unhandled sub-statement writing AST file");
48  return Record.EmitStmt(Code, AbbrevToUse);
49  }
50 
52  const TemplateArgumentLoc *Args);
53 
54  void VisitStmt(Stmt *S);
55 #define STMT(Type, Base) \
56  void Visit##Type(Type *);
57 #include "clang/AST/StmtNodes.inc"
58  };
59 }
60 
62  const ASTTemplateKWAndArgsInfo &ArgInfo, const TemplateArgumentLoc *Args) {
63  Record.AddSourceLocation(ArgInfo.TemplateKWLoc);
64  Record.AddSourceLocation(ArgInfo.LAngleLoc);
65  Record.AddSourceLocation(ArgInfo.RAngleLoc);
66  for (unsigned i = 0; i != ArgInfo.NumTemplateArgs; ++i)
67  Record.AddTemplateArgumentLoc(Args[i]);
68 }
69 
71 }
72 
73 void ASTStmtWriter::VisitNullStmt(NullStmt *S) {
74  VisitStmt(S);
75  Record.AddSourceLocation(S->getSemiLoc());
76  Record.push_back(S->HasLeadingEmptyMacro);
78 }
79 
80 void ASTStmtWriter::VisitCompoundStmt(CompoundStmt *S) {
81  VisitStmt(S);
82  Record.push_back(S->size());
83  for (auto *CS : S->body())
84  Record.AddStmt(CS);
85  Record.AddSourceLocation(S->getLBracLoc());
86  Record.AddSourceLocation(S->getRBracLoc());
88 }
89 
90 void ASTStmtWriter::VisitSwitchCase(SwitchCase *S) {
91  VisitStmt(S);
92  Record.push_back(Writer.getSwitchCaseID(S));
93  Record.AddSourceLocation(S->getKeywordLoc());
94  Record.AddSourceLocation(S->getColonLoc());
95 }
96 
97 void ASTStmtWriter::VisitCaseStmt(CaseStmt *S) {
98  VisitSwitchCase(S);
99  Record.AddStmt(S->getLHS());
100  Record.AddStmt(S->getRHS());
101  Record.AddStmt(S->getSubStmt());
102  Record.AddSourceLocation(S->getEllipsisLoc());
104 }
105 
106 void ASTStmtWriter::VisitDefaultStmt(DefaultStmt *S) {
107  VisitSwitchCase(S);
108  Record.AddStmt(S->getSubStmt());
110 }
111 
112 void ASTStmtWriter::VisitLabelStmt(LabelStmt *S) {
113  VisitStmt(S);
114  Record.AddDeclRef(S->getDecl());
115  Record.AddStmt(S->getSubStmt());
116  Record.AddSourceLocation(S->getIdentLoc());
118 }
119 
120 void ASTStmtWriter::VisitAttributedStmt(AttributedStmt *S) {
121  VisitStmt(S);
122  Record.push_back(S->getAttrs().size());
123  Record.AddAttributes(S->getAttrs());
124  Record.AddStmt(S->getSubStmt());
125  Record.AddSourceLocation(S->getAttrLoc());
127 }
128 
129 void ASTStmtWriter::VisitIfStmt(IfStmt *S) {
130  VisitStmt(S);
131  Record.push_back(S->isConstexpr());
132  Record.AddStmt(S->getInit());
133  Record.AddDeclRef(S->getConditionVariable());
134  Record.AddStmt(S->getCond());
135  Record.AddStmt(S->getThen());
136  Record.AddStmt(S->getElse());
137  Record.AddSourceLocation(S->getIfLoc());
138  Record.AddSourceLocation(S->getElseLoc());
139  Code = serialization::STMT_IF;
140 }
141 
142 void ASTStmtWriter::VisitSwitchStmt(SwitchStmt *S) {
143  VisitStmt(S);
144  Record.AddStmt(S->getInit());
145  Record.AddDeclRef(S->getConditionVariable());
146  Record.AddStmt(S->getCond());
147  Record.AddStmt(S->getBody());
148  Record.AddSourceLocation(S->getSwitchLoc());
149  Record.push_back(S->isAllEnumCasesCovered());
150  for (SwitchCase *SC = S->getSwitchCaseList(); SC;
151  SC = SC->getNextSwitchCase())
152  Record.push_back(Writer.RecordSwitchCaseID(SC));
154 }
155 
156 void ASTStmtWriter::VisitWhileStmt(WhileStmt *S) {
157  VisitStmt(S);
158  Record.AddDeclRef(S->getConditionVariable());
159  Record.AddStmt(S->getCond());
160  Record.AddStmt(S->getBody());
161  Record.AddSourceLocation(S->getWhileLoc());
163 }
164 
165 void ASTStmtWriter::VisitDoStmt(DoStmt *S) {
166  VisitStmt(S);
167  Record.AddStmt(S->getCond());
168  Record.AddStmt(S->getBody());
169  Record.AddSourceLocation(S->getDoLoc());
170  Record.AddSourceLocation(S->getWhileLoc());
171  Record.AddSourceLocation(S->getRParenLoc());
172  Code = serialization::STMT_DO;
173 }
174 
175 void ASTStmtWriter::VisitForStmt(ForStmt *S) {
176  VisitStmt(S);
177  Record.AddStmt(S->getInit());
178  Record.AddStmt(S->getCond());
179  Record.AddDeclRef(S->getConditionVariable());
180  Record.AddStmt(S->getInc());
181  Record.AddStmt(S->getBody());
182  Record.AddSourceLocation(S->getForLoc());
183  Record.AddSourceLocation(S->getLParenLoc());
184  Record.AddSourceLocation(S->getRParenLoc());
186 }
187 
188 void ASTStmtWriter::VisitGotoStmt(GotoStmt *S) {
189  VisitStmt(S);
190  Record.AddDeclRef(S->getLabel());
191  Record.AddSourceLocation(S->getGotoLoc());
192  Record.AddSourceLocation(S->getLabelLoc());
194 }
195 
196 void ASTStmtWriter::VisitIndirectGotoStmt(IndirectGotoStmt *S) {
197  VisitStmt(S);
198  Record.AddSourceLocation(S->getGotoLoc());
199  Record.AddSourceLocation(S->getStarLoc());
200  Record.AddStmt(S->getTarget());
202 }
203 
204 void ASTStmtWriter::VisitContinueStmt(ContinueStmt *S) {
205  VisitStmt(S);
206  Record.AddSourceLocation(S->getContinueLoc());
208 }
209 
210 void ASTStmtWriter::VisitBreakStmt(BreakStmt *S) {
211  VisitStmt(S);
212  Record.AddSourceLocation(S->getBreakLoc());
214 }
215 
216 void ASTStmtWriter::VisitReturnStmt(ReturnStmt *S) {
217  VisitStmt(S);
218  Record.AddStmt(S->getRetValue());
219  Record.AddSourceLocation(S->getReturnLoc());
220  Record.AddDeclRef(S->getNRVOCandidate());
222 }
223 
224 void ASTStmtWriter::VisitDeclStmt(DeclStmt *S) {
225  VisitStmt(S);
226  Record.AddSourceLocation(S->getStartLoc());
227  Record.AddSourceLocation(S->getEndLoc());
228  DeclGroupRef DG = S->getDeclGroup();
229  for (DeclGroupRef::iterator D = DG.begin(), DEnd = DG.end(); D != DEnd; ++D)
230  Record.AddDeclRef(*D);
232 }
233 
234 void ASTStmtWriter::VisitAsmStmt(AsmStmt *S) {
235  VisitStmt(S);
236  Record.push_back(S->getNumOutputs());
237  Record.push_back(S->getNumInputs());
238  Record.push_back(S->getNumClobbers());
239  Record.AddSourceLocation(S->getAsmLoc());
240  Record.push_back(S->isVolatile());
241  Record.push_back(S->isSimple());
242 }
243 
244 void ASTStmtWriter::VisitGCCAsmStmt(GCCAsmStmt *S) {
245  VisitAsmStmt(S);
246  Record.AddSourceLocation(S->getRParenLoc());
247  Record.AddStmt(S->getAsmString());
248 
249  // Outputs
250  for (unsigned I = 0, N = S->getNumOutputs(); I != N; ++I) {
252  Record.AddStmt(S->getOutputConstraintLiteral(I));
253  Record.AddStmt(S->getOutputExpr(I));
254  }
255 
256  // Inputs
257  for (unsigned I = 0, N = S->getNumInputs(); I != N; ++I) {
258  Record.AddIdentifierRef(S->getInputIdentifier(I));
259  Record.AddStmt(S->getInputConstraintLiteral(I));
260  Record.AddStmt(S->getInputExpr(I));
261  }
262 
263  // Clobbers
264  for (unsigned I = 0, N = S->getNumClobbers(); I != N; ++I)
265  Record.AddStmt(S->getClobberStringLiteral(I));
266 
268 }
269 
270 void ASTStmtWriter::VisitMSAsmStmt(MSAsmStmt *S) {
271  VisitAsmStmt(S);
272  Record.AddSourceLocation(S->getLBraceLoc());
273  Record.AddSourceLocation(S->getEndLoc());
274  Record.push_back(S->getNumAsmToks());
275  Record.AddString(S->getAsmString());
276 
277  // Tokens
278  for (unsigned I = 0, N = S->getNumAsmToks(); I != N; ++I) {
279  // FIXME: Move this to ASTRecordWriter?
280  Writer.AddToken(S->getAsmToks()[I], Record.getRecordData());
281  }
282 
283  // Clobbers
284  for (unsigned I = 0, N = S->getNumClobbers(); I != N; ++I) {
285  Record.AddString(S->getClobber(I));
286  }
287 
288  // Outputs
289  for (unsigned I = 0, N = S->getNumOutputs(); I != N; ++I) {
290  Record.AddStmt(S->getOutputExpr(I));
291  Record.AddString(S->getOutputConstraint(I));
292  }
293 
294  // Inputs
295  for (unsigned I = 0, N = S->getNumInputs(); I != N; ++I) {
296  Record.AddStmt(S->getInputExpr(I));
297  Record.AddString(S->getInputConstraint(I));
298  }
299 
301 }
302 
303 void ASTStmtWriter::VisitCoroutineBodyStmt(CoroutineBodyStmt *CoroStmt) {
304  VisitStmt(CoroStmt);
305  Record.push_back(CoroStmt->getParamMoves().size());
306  for (Stmt *S : CoroStmt->children())
307  Record.AddStmt(S);
309 }
310 
311 void ASTStmtWriter::VisitCoreturnStmt(CoreturnStmt *S) {
312  VisitStmt(S);
313  Record.AddSourceLocation(S->getKeywordLoc());
314  Record.AddStmt(S->getOperand());
315  Record.AddStmt(S->getPromiseCall());
316  Record.push_back(S->isImplicit());
318 }
319 
320 void ASTStmtWriter::VisitCoroutineSuspendExpr(CoroutineSuspendExpr *E) {
321  VisitExpr(E);
322  Record.AddSourceLocation(E->getKeywordLoc());
323  for (Stmt *S : E->children())
324  Record.AddStmt(S);
325  Record.AddStmt(E->getOpaqueValue());
326 }
327 
328 void ASTStmtWriter::VisitCoawaitExpr(CoawaitExpr *E) {
329  VisitCoroutineSuspendExpr(E);
330  Record.push_back(E->isImplicit());
332 }
333 
334 void ASTStmtWriter::VisitCoyieldExpr(CoyieldExpr *E) {
335  VisitCoroutineSuspendExpr(E);
337 }
338 
339 void ASTStmtWriter::VisitDependentCoawaitExpr(DependentCoawaitExpr *E) {
340  VisitExpr(E);
341  Record.AddSourceLocation(E->getKeywordLoc());
342  for (Stmt *S : E->children())
343  Record.AddStmt(S);
345 }
346 
347 void ASTStmtWriter::VisitCapturedStmt(CapturedStmt *S) {
348  VisitStmt(S);
349  // NumCaptures
350  Record.push_back(std::distance(S->capture_begin(), S->capture_end()));
351 
352  // CapturedDecl and captured region kind
353  Record.AddDeclRef(S->getCapturedDecl());
354  Record.push_back(S->getCapturedRegionKind());
355 
356  Record.AddDeclRef(S->getCapturedRecordDecl());
357 
358  // Capture inits
359  for (auto *I : S->capture_inits())
360  Record.AddStmt(I);
361 
362  // Body
363  Record.AddStmt(S->getCapturedStmt());
364 
365  // Captures
366  for (const auto &I : S->captures()) {
367  if (I.capturesThis() || I.capturesVariableArrayType())
368  Record.AddDeclRef(nullptr);
369  else
370  Record.AddDeclRef(I.getCapturedVar());
371  Record.push_back(I.getCaptureKind());
372  Record.AddSourceLocation(I.getLocation());
373  }
374 
376 }
377 
378 void ASTStmtWriter::VisitExpr(Expr *E) {
379  VisitStmt(E);
380  Record.AddTypeRef(E->getType());
381  Record.push_back(E->isTypeDependent());
382  Record.push_back(E->isValueDependent());
383  Record.push_back(E->isInstantiationDependent());
385  Record.push_back(E->getValueKind());
386  Record.push_back(E->getObjectKind());
387 }
388 
389 void ASTStmtWriter::VisitPredefinedExpr(PredefinedExpr *E) {
390  VisitExpr(E);
391  Record.AddSourceLocation(E->getLocation());
392  Record.push_back(E->getIdentType()); // FIXME: stable encoding
393  Record.AddStmt(E->getFunctionName());
395 }
396 
397 void ASTStmtWriter::VisitDeclRefExpr(DeclRefExpr *E) {
398  VisitExpr(E);
399 
400  Record.push_back(E->hasQualifier());
401  Record.push_back(E->getDecl() != E->getFoundDecl());
402  Record.push_back(E->hasTemplateKWAndArgsInfo());
403  Record.push_back(E->hadMultipleCandidates());
405 
406  if (E->hasTemplateKWAndArgsInfo()) {
407  unsigned NumTemplateArgs = E->getNumTemplateArgs();
408  Record.push_back(NumTemplateArgs);
409  }
410 
412 
413  if ((!E->hasTemplateKWAndArgsInfo()) && (!E->hasQualifier()) &&
414  (E->getDecl() == E->getFoundDecl()) &&
416  AbbrevToUse = Writer.getDeclRefExprAbbrev();
417  }
418 
419  if (E->hasQualifier())
421 
422  if (E->getDecl() != E->getFoundDecl())
423  Record.AddDeclRef(E->getFoundDecl());
424 
425  if (E->hasTemplateKWAndArgsInfo())
426  AddTemplateKWAndArgsInfo(*E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
427  E->getTrailingObjects<TemplateArgumentLoc>());
428 
429  Record.AddDeclRef(E->getDecl());
430  Record.AddSourceLocation(E->getLocation());
431  Record.AddDeclarationNameLoc(E->DNLoc, E->getDecl()->getDeclName());
433 }
434 
435 void ASTStmtWriter::VisitIntegerLiteral(IntegerLiteral *E) {
436  VisitExpr(E);
437  Record.AddSourceLocation(E->getLocation());
438  Record.AddAPInt(E->getValue());
439 
440  if (E->getValue().getBitWidth() == 32) {
441  AbbrevToUse = Writer.getIntegerLiteralAbbrev();
442  }
443 
445 }
446 
447 void ASTStmtWriter::VisitFixedPointLiteral(FixedPointLiteral *E) {
448  VisitExpr(E);
449  Record.AddSourceLocation(E->getLocation());
450  Record.AddAPInt(E->getValue());
452 }
453 
454 void ASTStmtWriter::VisitFloatingLiteral(FloatingLiteral *E) {
455  VisitExpr(E);
456  Record.push_back(E->getRawSemantics());
457  Record.push_back(E->isExact());
458  Record.AddAPFloat(E->getValue());
459  Record.AddSourceLocation(E->getLocation());
461 }
462 
463 void ASTStmtWriter::VisitImaginaryLiteral(ImaginaryLiteral *E) {
464  VisitExpr(E);
465  Record.AddStmt(E->getSubExpr());
467 }
468 
469 void ASTStmtWriter::VisitStringLiteral(StringLiteral *E) {
470  VisitExpr(E);
471  Record.push_back(E->getByteLength());
472  Record.push_back(E->getNumConcatenated());
473  Record.push_back(E->getKind());
474  Record.push_back(E->isPascal());
475  // FIXME: String data should be stored as a blob at the end of the
476  // StringLiteral. However, we can't do so now because we have no
477  // provision for coping with abbreviations when we're jumping around
478  // the AST file during deserialization.
479  Record.append(E->getBytes().begin(), E->getBytes().end());
480  for (unsigned I = 0, N = E->getNumConcatenated(); I != N; ++I)
481  Record.AddSourceLocation(E->getStrTokenLoc(I));
483 }
484 
485 void ASTStmtWriter::VisitCharacterLiteral(CharacterLiteral *E) {
486  VisitExpr(E);
487  Record.push_back(E->getValue());
488  Record.AddSourceLocation(E->getLocation());
489  Record.push_back(E->getKind());
490 
491  AbbrevToUse = Writer.getCharacterLiteralAbbrev();
492 
494 }
495 
496 void ASTStmtWriter::VisitParenExpr(ParenExpr *E) {
497  VisitExpr(E);
498  Record.AddSourceLocation(E->getLParen());
499  Record.AddSourceLocation(E->getRParen());
500  Record.AddStmt(E->getSubExpr());
502 }
503 
504 void ASTStmtWriter::VisitParenListExpr(ParenListExpr *E) {
505  VisitExpr(E);
506  Record.push_back(E->NumExprs);
507  for (unsigned i=0; i != E->NumExprs; ++i)
508  Record.AddStmt(E->Exprs[i]);
509  Record.AddSourceLocation(E->LParenLoc);
510  Record.AddSourceLocation(E->RParenLoc);
512 }
513 
514 void ASTStmtWriter::VisitUnaryOperator(UnaryOperator *E) {
515  VisitExpr(E);
516  Record.AddStmt(E->getSubExpr());
517  Record.push_back(E->getOpcode()); // FIXME: stable encoding
518  Record.AddSourceLocation(E->getOperatorLoc());
519  Record.push_back(E->canOverflow());
521 }
522 
523 void ASTStmtWriter::VisitOffsetOfExpr(OffsetOfExpr *E) {
524  VisitExpr(E);
525  Record.push_back(E->getNumComponents());
526  Record.push_back(E->getNumExpressions());
527  Record.AddSourceLocation(E->getOperatorLoc());
528  Record.AddSourceLocation(E->getRParenLoc());
530  for (unsigned I = 0, N = E->getNumComponents(); I != N; ++I) {
531  const OffsetOfNode &ON = E->getComponent(I);
532  Record.push_back(ON.getKind()); // FIXME: Stable encoding
534  Record.AddSourceLocation(ON.getSourceRange().getEnd());
535  switch (ON.getKind()) {
536  case OffsetOfNode::Array:
537  Record.push_back(ON.getArrayExprIndex());
538  break;
539 
540  case OffsetOfNode::Field:
541  Record.AddDeclRef(ON.getField());
542  break;
543 
545  Record.AddIdentifierRef(ON.getFieldName());
546  break;
547 
548  case OffsetOfNode::Base:
549  Record.AddCXXBaseSpecifier(*ON.getBase());
550  break;
551  }
552  }
553  for (unsigned I = 0, N = E->getNumExpressions(); I != N; ++I)
554  Record.AddStmt(E->getIndexExpr(I));
556 }
557 
558 void ASTStmtWriter::VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *E) {
559  VisitExpr(E);
560  Record.push_back(E->getKind());
561  if (E->isArgumentType())
563  else {
564  Record.push_back(0);
565  Record.AddStmt(E->getArgumentExpr());
566  }
567  Record.AddSourceLocation(E->getOperatorLoc());
568  Record.AddSourceLocation(E->getRParenLoc());
570 }
571 
572 void ASTStmtWriter::VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
573  VisitExpr(E);
574  Record.AddStmt(E->getLHS());
575  Record.AddStmt(E->getRHS());
576  Record.AddSourceLocation(E->getRBracketLoc());
578 }
579 
580 void ASTStmtWriter::VisitOMPArraySectionExpr(OMPArraySectionExpr *E) {
581  VisitExpr(E);
582  Record.AddStmt(E->getBase());
583  Record.AddStmt(E->getLowerBound());
584  Record.AddStmt(E->getLength());
585  Record.AddSourceLocation(E->getColonLoc());
586  Record.AddSourceLocation(E->getRBracketLoc());
588 }
589 
590 void ASTStmtWriter::VisitCallExpr(CallExpr *E) {
591  VisitExpr(E);
592  Record.push_back(E->getNumArgs());
593  Record.AddSourceLocation(E->getRParenLoc());
594  Record.AddStmt(E->getCallee());
595  for (CallExpr::arg_iterator Arg = E->arg_begin(), ArgEnd = E->arg_end();
596  Arg != ArgEnd; ++Arg)
597  Record.AddStmt(*Arg);
599 }
600 
601 void ASTStmtWriter::VisitMemberExpr(MemberExpr *E) {
602  // Don't call VisitExpr, we'll write everything here.
603 
604  Record.push_back(E->hasQualifier());
605  if (E->hasQualifier())
607 
608  Record.push_back(E->HasTemplateKWAndArgsInfo);
609  if (E->HasTemplateKWAndArgsInfo) {
611  unsigned NumTemplateArgs = E->getNumTemplateArgs();
612  Record.push_back(NumTemplateArgs);
613  Record.AddSourceLocation(E->getLAngleLoc());
614  Record.AddSourceLocation(E->getRAngleLoc());
615  for (unsigned i=0; i != NumTemplateArgs; ++i)
616  Record.AddTemplateArgumentLoc(E->getTemplateArgs()[i]);
617  }
618 
619  Record.push_back(E->hadMultipleCandidates());
620 
621  DeclAccessPair FoundDecl = E->getFoundDecl();
622  Record.AddDeclRef(FoundDecl.getDecl());
623  Record.push_back(FoundDecl.getAccess());
624 
625  Record.AddTypeRef(E->getType());
626  Record.push_back(E->getValueKind());
627  Record.push_back(E->getObjectKind());
628  Record.AddStmt(E->getBase());
629  Record.AddDeclRef(E->getMemberDecl());
630  Record.AddSourceLocation(E->getMemberLoc());
631  Record.push_back(E->isArrow());
632  Record.AddSourceLocation(E->getOperatorLoc());
633  Record.AddDeclarationNameLoc(E->MemberDNLoc,
634  E->getMemberDecl()->getDeclName());
636 }
637 
638 void ASTStmtWriter::VisitObjCIsaExpr(ObjCIsaExpr *E) {
639  VisitExpr(E);
640  Record.AddStmt(E->getBase());
641  Record.AddSourceLocation(E->getIsaMemberLoc());
642  Record.AddSourceLocation(E->getOpLoc());
643  Record.push_back(E->isArrow());
645 }
646 
647 void ASTStmtWriter::
648 VisitObjCIndirectCopyRestoreExpr(ObjCIndirectCopyRestoreExpr *E) {
649  VisitExpr(E);
650  Record.AddStmt(E->getSubExpr());
651  Record.push_back(E->shouldCopy());
653 }
654 
655 void ASTStmtWriter::VisitObjCBridgedCastExpr(ObjCBridgedCastExpr *E) {
656  VisitExplicitCastExpr(E);
657  Record.AddSourceLocation(E->getLParenLoc());
659  Record.push_back(E->getBridgeKind()); // FIXME: Stable encoding
661 }
662 
663 void ASTStmtWriter::VisitCastExpr(CastExpr *E) {
664  VisitExpr(E);
665  Record.push_back(E->path_size());
666  Record.AddStmt(E->getSubExpr());
667  Record.push_back(E->getCastKind()); // FIXME: stable encoding
668 
670  PI = E->path_begin(), PE = E->path_end(); PI != PE; ++PI)
671  Record.AddCXXBaseSpecifier(**PI);
672 }
673 
674 void ASTStmtWriter::VisitBinaryOperator(BinaryOperator *E) {
675  VisitExpr(E);
676  Record.AddStmt(E->getLHS());
677  Record.AddStmt(E->getRHS());
678  Record.push_back(E->getOpcode()); // FIXME: stable encoding
679  Record.AddSourceLocation(E->getOperatorLoc());
680  Record.push_back(E->getFPFeatures().getInt());
682 }
683 
684 void ASTStmtWriter::VisitCompoundAssignOperator(CompoundAssignOperator *E) {
685  VisitBinaryOperator(E);
686  Record.AddTypeRef(E->getComputationLHSType());
689 }
690 
691 void ASTStmtWriter::VisitConditionalOperator(ConditionalOperator *E) {
692  VisitExpr(E);
693  Record.AddStmt(E->getCond());
694  Record.AddStmt(E->getLHS());
695  Record.AddStmt(E->getRHS());
696  Record.AddSourceLocation(E->getQuestionLoc());
697  Record.AddSourceLocation(E->getColonLoc());
699 }
700 
701 void
702 ASTStmtWriter::VisitBinaryConditionalOperator(BinaryConditionalOperator *E) {
703  VisitExpr(E);
704  Record.AddStmt(E->getOpaqueValue());
705  Record.AddStmt(E->getCommon());
706  Record.AddStmt(E->getCond());
707  Record.AddStmt(E->getTrueExpr());
708  Record.AddStmt(E->getFalseExpr());
709  Record.AddSourceLocation(E->getQuestionLoc());
710  Record.AddSourceLocation(E->getColonLoc());
712 }
713 
714 void ASTStmtWriter::VisitImplicitCastExpr(ImplicitCastExpr *E) {
715  VisitCastExpr(E);
716  Record.push_back(E->isPartOfExplicitCast());
717 
718  if (E->path_size() == 0)
719  AbbrevToUse = Writer.getExprImplicitCastAbbrev();
720 
722 }
723 
724 void ASTStmtWriter::VisitExplicitCastExpr(ExplicitCastExpr *E) {
725  VisitCastExpr(E);
727 }
728 
729 void ASTStmtWriter::VisitCStyleCastExpr(CStyleCastExpr *E) {
730  VisitExplicitCastExpr(E);
731  Record.AddSourceLocation(E->getLParenLoc());
732  Record.AddSourceLocation(E->getRParenLoc());
734 }
735 
736 void ASTStmtWriter::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
737  VisitExpr(E);
738  Record.AddSourceLocation(E->getLParenLoc());
740  Record.AddStmt(E->getInitializer());
741  Record.push_back(E->isFileScope());
743 }
744 
745 void ASTStmtWriter::VisitExtVectorElementExpr(ExtVectorElementExpr *E) {
746  VisitExpr(E);
747  Record.AddStmt(E->getBase());
748  Record.AddIdentifierRef(&E->getAccessor());
749  Record.AddSourceLocation(E->getAccessorLoc());
751 }
752 
753 void ASTStmtWriter::VisitInitListExpr(InitListExpr *E) {
754  VisitExpr(E);
755  // NOTE: only add the (possibly null) syntactic form.
756  // No need to serialize the isSemanticForm flag and the semantic form.
757  Record.AddStmt(E->getSyntacticForm());
758  Record.AddSourceLocation(E->getLBraceLoc());
759  Record.AddSourceLocation(E->getRBraceLoc());
760  bool isArrayFiller = E->ArrayFillerOrUnionFieldInit.is<Expr*>();
761  Record.push_back(isArrayFiller);
762  if (isArrayFiller)
763  Record.AddStmt(E->getArrayFiller());
764  else
766  Record.push_back(E->hadArrayRangeDesignator());
767  Record.push_back(E->getNumInits());
768  if (isArrayFiller) {
769  // ArrayFiller may have filled "holes" due to designated initializer.
770  // Replace them by 0 to indicate that the filler goes in that place.
771  Expr *filler = E->getArrayFiller();
772  for (unsigned I = 0, N = E->getNumInits(); I != N; ++I)
773  Record.AddStmt(E->getInit(I) != filler ? E->getInit(I) : nullptr);
774  } else {
775  for (unsigned I = 0, N = E->getNumInits(); I != N; ++I)
776  Record.AddStmt(E->getInit(I));
777  }
779 }
780 
781 void ASTStmtWriter::VisitDesignatedInitExpr(DesignatedInitExpr *E) {
782  VisitExpr(E);
783  Record.push_back(E->getNumSubExprs());
784  for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
785  Record.AddStmt(E->getSubExpr(I));
787  Record.push_back(E->usesGNUSyntax());
788  for (const DesignatedInitExpr::Designator &D : E->designators()) {
789  if (D.isFieldDesignator()) {
790  if (FieldDecl *Field = D.getField()) {
792  Record.AddDeclRef(Field);
793  } else {
795  Record.AddIdentifierRef(D.getFieldName());
796  }
797  Record.AddSourceLocation(D.getDotLoc());
798  Record.AddSourceLocation(D.getFieldLoc());
799  } else if (D.isArrayDesignator()) {
801  Record.push_back(D.getFirstExprIndex());
802  Record.AddSourceLocation(D.getLBracketLoc());
803  Record.AddSourceLocation(D.getRBracketLoc());
804  } else {
805  assert(D.isArrayRangeDesignator() && "Unknown designator");
807  Record.push_back(D.getFirstExprIndex());
808  Record.AddSourceLocation(D.getLBracketLoc());
809  Record.AddSourceLocation(D.getEllipsisLoc());
810  Record.AddSourceLocation(D.getRBracketLoc());
811  }
812  }
814 }
815 
816 void ASTStmtWriter::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) {
817  VisitExpr(E);
818  Record.AddStmt(E->getBase());
819  Record.AddStmt(E->getUpdater());
821 }
822 
823 void ASTStmtWriter::VisitNoInitExpr(NoInitExpr *E) {
824  VisitExpr(E);
826 }
827 
828 void ASTStmtWriter::VisitArrayInitLoopExpr(ArrayInitLoopExpr *E) {
829  VisitExpr(E);
830  Record.AddStmt(E->SubExprs[0]);
831  Record.AddStmt(E->SubExprs[1]);
833 }
834 
835 void ASTStmtWriter::VisitArrayInitIndexExpr(ArrayInitIndexExpr *E) {
836  VisitExpr(E);
838 }
839 
840 void ASTStmtWriter::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) {
841  VisitExpr(E);
843 }
844 
845 void ASTStmtWriter::VisitVAArgExpr(VAArgExpr *E) {
846  VisitExpr(E);
847  Record.AddStmt(E->getSubExpr());
849  Record.AddSourceLocation(E->getBuiltinLoc());
850  Record.AddSourceLocation(E->getRParenLoc());
851  Record.push_back(E->isMicrosoftABI());
853 }
854 
855 void ASTStmtWriter::VisitAddrLabelExpr(AddrLabelExpr *E) {
856  VisitExpr(E);
857  Record.AddSourceLocation(E->getAmpAmpLoc());
858  Record.AddSourceLocation(E->getLabelLoc());
859  Record.AddDeclRef(E->getLabel());
861 }
862 
863 void ASTStmtWriter::VisitStmtExpr(StmtExpr *E) {
864  VisitExpr(E);
865  Record.AddStmt(E->getSubStmt());
866  Record.AddSourceLocation(E->getLParenLoc());
867  Record.AddSourceLocation(E->getRParenLoc());
869 }
870 
871 void ASTStmtWriter::VisitChooseExpr(ChooseExpr *E) {
872  VisitExpr(E);
873  Record.AddStmt(E->getCond());
874  Record.AddStmt(E->getLHS());
875  Record.AddStmt(E->getRHS());
876  Record.AddSourceLocation(E->getBuiltinLoc());
877  Record.AddSourceLocation(E->getRParenLoc());
878  Record.push_back(E->isConditionDependent() ? false : E->isConditionTrue());
880 }
881 
882 void ASTStmtWriter::VisitGNUNullExpr(GNUNullExpr *E) {
883  VisitExpr(E);
884  Record.AddSourceLocation(E->getTokenLocation());
886 }
887 
888 void ASTStmtWriter::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
889  VisitExpr(E);
890  Record.push_back(E->getNumSubExprs());
891  for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
892  Record.AddStmt(E->getExpr(I));
893  Record.AddSourceLocation(E->getBuiltinLoc());
894  Record.AddSourceLocation(E->getRParenLoc());
896 }
897 
898 void ASTStmtWriter::VisitConvertVectorExpr(ConvertVectorExpr *E) {
899  VisitExpr(E);
900  Record.AddSourceLocation(E->getBuiltinLoc());
901  Record.AddSourceLocation(E->getRParenLoc());
903  Record.AddStmt(E->getSrcExpr());
905 }
906 
907 void ASTStmtWriter::VisitBlockExpr(BlockExpr *E) {
908  VisitExpr(E);
909  Record.AddDeclRef(E->getBlockDecl());
911 }
912 
913 void ASTStmtWriter::VisitGenericSelectionExpr(GenericSelectionExpr *E) {
914  VisitExpr(E);
915  Record.push_back(E->getNumAssocs());
916 
917  Record.AddStmt(E->getControllingExpr());
918  for (unsigned I = 0, N = E->getNumAssocs(); I != N; ++I) {
920  Record.AddStmt(E->getAssocExpr(I));
921  }
922  Record.push_back(E->isResultDependent() ? -1U : E->getResultIndex());
923 
924  Record.AddSourceLocation(E->getGenericLoc());
925  Record.AddSourceLocation(E->getDefaultLoc());
926  Record.AddSourceLocation(E->getRParenLoc());
928 }
929 
930 void ASTStmtWriter::VisitPseudoObjectExpr(PseudoObjectExpr *E) {
931  VisitExpr(E);
932  Record.push_back(E->getNumSemanticExprs());
933 
934  // Push the result index. Currently, this needs to exactly match
935  // the encoding used internally for ResultIndex.
936  unsigned result = E->getResultExprIndex();
937  result = (result == PseudoObjectExpr::NoResult ? 0 : result + 1);
938  Record.push_back(result);
939 
940  Record.AddStmt(E->getSyntacticForm());
942  i = E->semantics_begin(), e = E->semantics_end(); i != e; ++i) {
943  Record.AddStmt(*i);
944  }
946 }
947 
948 void ASTStmtWriter::VisitAtomicExpr(AtomicExpr *E) {
949  VisitExpr(E);
950  Record.push_back(E->getOp());
951  for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
952  Record.AddStmt(E->getSubExprs()[I]);
953  Record.AddSourceLocation(E->getBuiltinLoc());
954  Record.AddSourceLocation(E->getRParenLoc());
956 }
957 
958 //===----------------------------------------------------------------------===//
959 // Objective-C Expressions and Statements.
960 //===----------------------------------------------------------------------===//
961 
962 void ASTStmtWriter::VisitObjCStringLiteral(ObjCStringLiteral *E) {
963  VisitExpr(E);
964  Record.AddStmt(E->getString());
965  Record.AddSourceLocation(E->getAtLoc());
967 }
968 
969 void ASTStmtWriter::VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
970  VisitExpr(E);
971  Record.AddStmt(E->getSubExpr());
972  Record.AddDeclRef(E->getBoxingMethod());
973  Record.AddSourceRange(E->getSourceRange());
975 }
976 
977 void ASTStmtWriter::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
978  VisitExpr(E);
979  Record.push_back(E->getNumElements());
980  for (unsigned i = 0; i < E->getNumElements(); i++)
981  Record.AddStmt(E->getElement(i));
983  Record.AddSourceRange(E->getSourceRange());
985 }
986 
987 void ASTStmtWriter::VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *E) {
988  VisitExpr(E);
989  Record.push_back(E->getNumElements());
990  Record.push_back(E->HasPackExpansions);
991  for (unsigned i = 0; i < E->getNumElements(); i++) {
993  Record.AddStmt(Element.Key);
994  Record.AddStmt(Element.Value);
995  if (E->HasPackExpansions) {
996  Record.AddSourceLocation(Element.EllipsisLoc);
997  unsigned NumExpansions = 0;
998  if (Element.NumExpansions)
999  NumExpansions = *Element.NumExpansions + 1;
1000  Record.push_back(NumExpansions);
1001  }
1002  }
1003 
1004  Record.AddDeclRef(E->getDictWithObjectsMethod());
1005  Record.AddSourceRange(E->getSourceRange());
1007 }
1008 
1009 void ASTStmtWriter::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
1010  VisitExpr(E);
1012  Record.AddSourceLocation(E->getAtLoc());
1013  Record.AddSourceLocation(E->getRParenLoc());
1015 }
1016 
1017 void ASTStmtWriter::VisitObjCSelectorExpr(ObjCSelectorExpr *E) {
1018  VisitExpr(E);
1019  Record.AddSelectorRef(E->getSelector());
1020  Record.AddSourceLocation(E->getAtLoc());
1021  Record.AddSourceLocation(E->getRParenLoc());
1023 }
1024 
1025 void ASTStmtWriter::VisitObjCProtocolExpr(ObjCProtocolExpr *E) {
1026  VisitExpr(E);
1027  Record.AddDeclRef(E->getProtocol());
1028  Record.AddSourceLocation(E->getAtLoc());
1029  Record.AddSourceLocation(E->ProtoLoc);
1030  Record.AddSourceLocation(E->getRParenLoc());
1032 }
1033 
1034 void ASTStmtWriter::VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) {
1035  VisitExpr(E);
1036  Record.AddDeclRef(E->getDecl());
1037  Record.AddSourceLocation(E->getLocation());
1038  Record.AddSourceLocation(E->getOpLoc());
1039  Record.AddStmt(E->getBase());
1040  Record.push_back(E->isArrow());
1041  Record.push_back(E->isFreeIvar());
1043 }
1044 
1045 void ASTStmtWriter::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
1046  VisitExpr(E);
1047  Record.push_back(E->SetterAndMethodRefFlags.getInt());
1048  Record.push_back(E->isImplicitProperty());
1049  if (E->isImplicitProperty()) {
1052  } else {
1053  Record.AddDeclRef(E->getExplicitProperty());
1054  }
1055  Record.AddSourceLocation(E->getLocation());
1057  if (E->isObjectReceiver()) {
1058  Record.push_back(0);
1059  Record.AddStmt(E->getBase());
1060  } else if (E->isSuperReceiver()) {
1061  Record.push_back(1);
1062  Record.AddTypeRef(E->getSuperReceiverType());
1063  } else {
1064  Record.push_back(2);
1065  Record.AddDeclRef(E->getClassReceiver());
1066  }
1067 
1069 }
1070 
1071 void ASTStmtWriter::VisitObjCSubscriptRefExpr(ObjCSubscriptRefExpr *E) {
1072  VisitExpr(E);
1073  Record.AddSourceLocation(E->getRBracket());
1074  Record.AddStmt(E->getBaseExpr());
1075  Record.AddStmt(E->getKeyExpr());
1076  Record.AddDeclRef(E->getAtIndexMethodDecl());
1077  Record.AddDeclRef(E->setAtIndexMethodDecl());
1078 
1080 }
1081 
1082 void ASTStmtWriter::VisitObjCMessageExpr(ObjCMessageExpr *E) {
1083  VisitExpr(E);
1084  Record.push_back(E->getNumArgs());
1085  Record.push_back(E->getNumStoredSelLocs());
1086  Record.push_back(E->SelLocsKind);
1087  Record.push_back(E->isDelegateInitCall());
1088  Record.push_back(E->IsImplicit);
1089  Record.push_back((unsigned)E->getReceiverKind()); // FIXME: stable encoding
1090  switch (E->getReceiverKind()) {
1092  Record.AddStmt(E->getInstanceReceiver());
1093  break;
1094 
1097  break;
1098 
1101  Record.AddTypeRef(E->getSuperType());
1102  Record.AddSourceLocation(E->getSuperLoc());
1103  break;
1104  }
1105 
1106  if (E->getMethodDecl()) {
1107  Record.push_back(1);
1108  Record.AddDeclRef(E->getMethodDecl());
1109  } else {
1110  Record.push_back(0);
1111  Record.AddSelectorRef(E->getSelector());
1112  }
1113 
1114  Record.AddSourceLocation(E->getLeftLoc());
1115  Record.AddSourceLocation(E->getRightLoc());
1116 
1117  for (CallExpr::arg_iterator Arg = E->arg_begin(), ArgEnd = E->arg_end();
1118  Arg != ArgEnd; ++Arg)
1119  Record.AddStmt(*Arg);
1120 
1121  SourceLocation *Locs = E->getStoredSelLocs();
1122  for (unsigned i = 0, e = E->getNumStoredSelLocs(); i != e; ++i)
1123  Record.AddSourceLocation(Locs[i]);
1124 
1126 }
1127 
1128 void ASTStmtWriter::VisitObjCForCollectionStmt(ObjCForCollectionStmt *S) {
1129  VisitStmt(S);
1130  Record.AddStmt(S->getElement());
1131  Record.AddStmt(S->getCollection());
1132  Record.AddStmt(S->getBody());
1133  Record.AddSourceLocation(S->getForLoc());
1134  Record.AddSourceLocation(S->getRParenLoc());
1136 }
1137 
1138 void ASTStmtWriter::VisitObjCAtCatchStmt(ObjCAtCatchStmt *S) {
1139  Record.AddStmt(S->getCatchBody());
1140  Record.AddDeclRef(S->getCatchParamDecl());
1141  Record.AddSourceLocation(S->getAtCatchLoc());
1142  Record.AddSourceLocation(S->getRParenLoc());
1144 }
1145 
1146 void ASTStmtWriter::VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S) {
1147  Record.AddStmt(S->getFinallyBody());
1148  Record.AddSourceLocation(S->getAtFinallyLoc());
1150 }
1151 
1152 void ASTStmtWriter::VisitObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S) {
1153  Record.AddStmt(S->getSubStmt());
1154  Record.AddSourceLocation(S->getAtLoc());
1156 }
1157 
1158 void ASTStmtWriter::VisitObjCAtTryStmt(ObjCAtTryStmt *S) {
1159  Record.push_back(S->getNumCatchStmts());
1160  Record.push_back(S->getFinallyStmt() != nullptr);
1161  Record.AddStmt(S->getTryBody());
1162  for (unsigned I = 0, N = S->getNumCatchStmts(); I != N; ++I)
1163  Record.AddStmt(S->getCatchStmt(I));
1164  if (S->getFinallyStmt())
1165  Record.AddStmt(S->getFinallyStmt());
1166  Record.AddSourceLocation(S->getAtTryLoc());
1168 }
1169 
1170 void ASTStmtWriter::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
1171  Record.AddStmt(S->getSynchExpr());
1172  Record.AddStmt(S->getSynchBody());
1175 }
1176 
1177 void ASTStmtWriter::VisitObjCAtThrowStmt(ObjCAtThrowStmt *S) {
1178  Record.AddStmt(S->getThrowExpr());
1179  Record.AddSourceLocation(S->getThrowLoc());
1181 }
1182 
1183 void ASTStmtWriter::VisitObjCBoolLiteralExpr(ObjCBoolLiteralExpr *E) {
1184  VisitExpr(E);
1185  Record.push_back(E->getValue());
1186  Record.AddSourceLocation(E->getLocation());
1188 }
1189 
1190 void ASTStmtWriter::VisitObjCAvailabilityCheckExpr(ObjCAvailabilityCheckExpr *E) {
1191  VisitExpr(E);
1192  Record.AddSourceRange(E->getSourceRange());
1193  Record.AddVersionTuple(E->getVersion());
1195 }
1196 
1197 //===----------------------------------------------------------------------===//
1198 // C++ Expressions and Statements.
1199 //===----------------------------------------------------------------------===//
1200 
1201 void ASTStmtWriter::VisitCXXCatchStmt(CXXCatchStmt *S) {
1202  VisitStmt(S);
1203  Record.AddSourceLocation(S->getCatchLoc());
1204  Record.AddDeclRef(S->getExceptionDecl());
1205  Record.AddStmt(S->getHandlerBlock());
1207 }
1208 
1209 void ASTStmtWriter::VisitCXXTryStmt(CXXTryStmt *S) {
1210  VisitStmt(S);
1211  Record.push_back(S->getNumHandlers());
1212  Record.AddSourceLocation(S->getTryLoc());
1213  Record.AddStmt(S->getTryBlock());
1214  for (unsigned i = 0, e = S->getNumHandlers(); i != e; ++i)
1215  Record.AddStmt(S->getHandler(i));
1217 }
1218 
1219 void ASTStmtWriter::VisitCXXForRangeStmt(CXXForRangeStmt *S) {
1220  VisitStmt(S);
1221  Record.AddSourceLocation(S->getForLoc());
1222  Record.AddSourceLocation(S->getCoawaitLoc());
1223  Record.AddSourceLocation(S->getColonLoc());
1224  Record.AddSourceLocation(S->getRParenLoc());
1225  Record.AddStmt(S->getRangeStmt());
1226  Record.AddStmt(S->getBeginStmt());
1227  Record.AddStmt(S->getEndStmt());
1228  Record.AddStmt(S->getCond());
1229  Record.AddStmt(S->getInc());
1230  Record.AddStmt(S->getLoopVarStmt());
1231  Record.AddStmt(S->getBody());
1233 }
1234 
1235 void ASTStmtWriter::VisitMSDependentExistsStmt(MSDependentExistsStmt *S) {
1236  VisitStmt(S);
1237  Record.AddSourceLocation(S->getKeywordLoc());
1238  Record.push_back(S->isIfExists());
1240  Record.AddDeclarationNameInfo(S->getNameInfo());
1241  Record.AddStmt(S->getSubStmt());
1243 }
1244 
1245 void ASTStmtWriter::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
1246  VisitCallExpr(E);
1247  Record.push_back(E->getOperator());
1248  Record.AddSourceRange(E->Range);
1249  Record.push_back(E->getFPFeatures().getInt());
1251 }
1252 
1253 void ASTStmtWriter::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) {
1254  VisitCallExpr(E);
1256 }
1257 
1258 void ASTStmtWriter::VisitCXXConstructExpr(CXXConstructExpr *E) {
1259  VisitExpr(E);
1260  Record.push_back(E->getNumArgs());
1261  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1262  Record.AddStmt(E->getArg(I));
1263  Record.AddDeclRef(E->getConstructor());
1264  Record.AddSourceLocation(E->getLocation());
1265  Record.push_back(E->isElidable());
1266  Record.push_back(E->hadMultipleCandidates());
1267  Record.push_back(E->isListInitialization());
1270  Record.push_back(E->getConstructionKind()); // FIXME: stable encoding
1271  Record.AddSourceRange(E->getParenOrBraceRange());
1273 }
1274 
1275 void ASTStmtWriter::VisitCXXInheritedCtorInitExpr(CXXInheritedCtorInitExpr *E) {
1276  VisitExpr(E);
1277  Record.AddDeclRef(E->getConstructor());
1278  Record.AddSourceLocation(E->getLocation());
1279  Record.push_back(E->constructsVBase());
1280  Record.push_back(E->inheritedFromVBase());
1282 }
1283 
1284 void ASTStmtWriter::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
1285  VisitCXXConstructExpr(E);
1286  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1288 }
1289 
1290 void ASTStmtWriter::VisitLambdaExpr(LambdaExpr *E) {
1291  VisitExpr(E);
1292  Record.push_back(E->NumCaptures);
1293  Record.AddSourceRange(E->IntroducerRange);
1294  Record.push_back(E->CaptureDefault); // FIXME: stable encoding
1295  Record.AddSourceLocation(E->CaptureDefaultLoc);
1296  Record.push_back(E->ExplicitParams);
1297  Record.push_back(E->ExplicitResultType);
1298  Record.AddSourceLocation(E->ClosingBrace);
1299 
1300  // Add capture initializers.
1302  CEnd = E->capture_init_end();
1303  C != CEnd; ++C) {
1304  Record.AddStmt(*C);
1305  }
1306 
1308 }
1309 
1310 void ASTStmtWriter::VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E) {
1311  VisitExpr(E);
1312  Record.AddStmt(E->getSubExpr());
1314 }
1315 
1316 void ASTStmtWriter::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) {
1317  VisitExplicitCastExpr(E);
1319  Record.AddSourceRange(E->getAngleBrackets());
1320 }
1321 
1322 void ASTStmtWriter::VisitCXXStaticCastExpr(CXXStaticCastExpr *E) {
1323  VisitCXXNamedCastExpr(E);
1325 }
1326 
1327 void ASTStmtWriter::VisitCXXDynamicCastExpr(CXXDynamicCastExpr *E) {
1328  VisitCXXNamedCastExpr(E);
1330 }
1331 
1332 void ASTStmtWriter::VisitCXXReinterpretCastExpr(CXXReinterpretCastExpr *E) {
1333  VisitCXXNamedCastExpr(E);
1335 }
1336 
1337 void ASTStmtWriter::VisitCXXConstCastExpr(CXXConstCastExpr *E) {
1338  VisitCXXNamedCastExpr(E);
1340 }
1341 
1342 void ASTStmtWriter::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E) {
1343  VisitExplicitCastExpr(E);
1344  Record.AddSourceLocation(E->getLParenLoc());
1345  Record.AddSourceLocation(E->getRParenLoc());
1347 }
1348 
1349 void ASTStmtWriter::VisitUserDefinedLiteral(UserDefinedLiteral *E) {
1350  VisitCallExpr(E);
1351  Record.AddSourceLocation(E->UDSuffixLoc);
1353 }
1354 
1355 void ASTStmtWriter::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) {
1356  VisitExpr(E);
1357  Record.push_back(E->getValue());
1358  Record.AddSourceLocation(E->getLocation());
1360 }
1361 
1362 void ASTStmtWriter::VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E) {
1363  VisitExpr(E);
1364  Record.AddSourceLocation(E->getLocation());
1366 }
1367 
1368 void ASTStmtWriter::VisitCXXTypeidExpr(CXXTypeidExpr *E) {
1369  VisitExpr(E);
1370  Record.AddSourceRange(E->getSourceRange());
1371  if (E->isTypeOperand()) {
1374  } else {
1375  Record.AddStmt(E->getExprOperand());
1377  }
1378 }
1379 
1380 void ASTStmtWriter::VisitCXXThisExpr(CXXThisExpr *E) {
1381  VisitExpr(E);
1382  Record.AddSourceLocation(E->getLocation());
1383  Record.push_back(E->isImplicit());
1385 }
1386 
1387 void ASTStmtWriter::VisitCXXThrowExpr(CXXThrowExpr *E) {
1388  VisitExpr(E);
1389  Record.AddSourceLocation(E->getThrowLoc());
1390  Record.AddStmt(E->getSubExpr());
1391  Record.push_back(E->isThrownVariableInScope());
1393 }
1394 
1395 void ASTStmtWriter::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
1396  VisitExpr(E);
1397  Record.AddDeclRef(E->getParam());
1398  Record.AddSourceLocation(E->getUsedLocation());
1400 }
1401 
1402 void ASTStmtWriter::VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E) {
1403  VisitExpr(E);
1404  Record.AddDeclRef(E->getField());
1405  Record.AddSourceLocation(E->getExprLoc());
1407 }
1408 
1409 void ASTStmtWriter::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
1410  VisitExpr(E);
1411  Record.AddCXXTemporary(E->getTemporary());
1412  Record.AddStmt(E->getSubExpr());
1414 }
1415 
1416 void ASTStmtWriter::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
1417  VisitExpr(E);
1418  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1419  Record.AddSourceLocation(E->getRParenLoc());
1421 }
1422 
1423 void ASTStmtWriter::VisitCXXNewExpr(CXXNewExpr *E) {
1424  VisitExpr(E);
1425  Record.push_back(E->isGlobalNew());
1426  Record.push_back(E->isArray());
1427  Record.push_back(E->passAlignment());
1429  Record.push_back(E->getNumPlacementArgs());
1430  Record.push_back(E->StoredInitializationStyle);
1431  Record.AddDeclRef(E->getOperatorNew());
1432  Record.AddDeclRef(E->getOperatorDelete());
1434  Record.AddSourceRange(E->getTypeIdParens());
1435  Record.AddSourceRange(E->getSourceRange());
1436  Record.AddSourceRange(E->getDirectInitRange());
1437  for (CXXNewExpr::arg_iterator I = E->raw_arg_begin(), e = E->raw_arg_end();
1438  I != e; ++I)
1439  Record.AddStmt(*I);
1440 
1442 }
1443 
1444 void ASTStmtWriter::VisitCXXDeleteExpr(CXXDeleteExpr *E) {
1445  VisitExpr(E);
1446  Record.push_back(E->isGlobalDelete());
1447  Record.push_back(E->isArrayForm());
1448  Record.push_back(E->isArrayFormAsWritten());
1450  Record.AddDeclRef(E->getOperatorDelete());
1451  Record.AddStmt(E->getArgument());
1452  Record.AddSourceLocation(E->getSourceRange().getBegin());
1453 
1455 }
1456 
1457 void ASTStmtWriter::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
1458  VisitExpr(E);
1459 
1460  Record.AddStmt(E->getBase());
1461  Record.push_back(E->isArrow());
1462  Record.AddSourceLocation(E->getOperatorLoc());
1464  Record.AddTypeSourceInfo(E->getScopeTypeInfo());
1465  Record.AddSourceLocation(E->getColonColonLoc());
1466  Record.AddSourceLocation(E->getTildeLoc());
1467 
1468  // PseudoDestructorTypeStorage.
1470  if (E->getDestroyedTypeIdentifier())
1472  else
1474 
1476 }
1477 
1478 void ASTStmtWriter::VisitExprWithCleanups(ExprWithCleanups *E) {
1479  VisitExpr(E);
1480  Record.push_back(E->getNumObjects());
1481  for (unsigned i = 0, e = E->getNumObjects(); i != e; ++i)
1482  Record.AddDeclRef(E->getObject(i));
1483 
1484  Record.push_back(E->cleanupsHaveSideEffects());
1485  Record.AddStmt(E->getSubExpr());
1487 }
1488 
1489 void
1490 ASTStmtWriter::VisitCXXDependentScopeMemberExpr(CXXDependentScopeMemberExpr *E){
1491  VisitExpr(E);
1492 
1493  // Don't emit anything here, HasTemplateKWAndArgsInfo must be
1494  // emitted first.
1495 
1496  Record.push_back(E->HasTemplateKWAndArgsInfo);
1497  if (E->HasTemplateKWAndArgsInfo) {
1498  const ASTTemplateKWAndArgsInfo &ArgInfo =
1499  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
1500  Record.push_back(ArgInfo.NumTemplateArgs);
1501  AddTemplateKWAndArgsInfo(ArgInfo,
1502  E->getTrailingObjects<TemplateArgumentLoc>());
1503  }
1504 
1505  if (!E->isImplicitAccess())
1506  Record.AddStmt(E->getBase());
1507  else
1508  Record.AddStmt(nullptr);
1509  Record.AddTypeRef(E->getBaseType());
1510  Record.push_back(E->isArrow());
1511  Record.AddSourceLocation(E->getOperatorLoc());
1514  Record.AddDeclarationNameInfo(E->MemberNameInfo);
1516 }
1517 
1518 void
1519 ASTStmtWriter::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) {
1520  VisitExpr(E);
1521 
1522  // Don't emit anything here, HasTemplateKWAndArgsInfo must be
1523  // emitted first.
1524 
1525  Record.push_back(E->HasTemplateKWAndArgsInfo);
1526  if (E->HasTemplateKWAndArgsInfo) {
1527  const ASTTemplateKWAndArgsInfo &ArgInfo =
1528  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
1529  Record.push_back(ArgInfo.NumTemplateArgs);
1530  AddTemplateKWAndArgsInfo(ArgInfo,
1531  E->getTrailingObjects<TemplateArgumentLoc>());
1532  }
1533 
1535  Record.AddDeclarationNameInfo(E->NameInfo);
1537 }
1538 
1539 void
1540 ASTStmtWriter::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E) {
1541  VisitExpr(E);
1542  Record.push_back(E->arg_size());
1544  ArgI = E->arg_begin(), ArgE = E->arg_end(); ArgI != ArgE; ++ArgI)
1545  Record.AddStmt(*ArgI);
1546  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1547  Record.AddSourceLocation(E->getLParenLoc());
1548  Record.AddSourceLocation(E->getRParenLoc());
1550 }
1551 
1552 void ASTStmtWriter::VisitOverloadExpr(OverloadExpr *E) {
1553  VisitExpr(E);
1554 
1555  // Don't emit anything here, HasTemplateKWAndArgsInfo must be
1556  // emitted first.
1557 
1559  if (E->HasTemplateKWAndArgsInfo) {
1560  const ASTTemplateKWAndArgsInfo &ArgInfo =
1562  Record.push_back(ArgInfo.NumTemplateArgs);
1564  }
1565 
1566  Record.push_back(E->getNumDecls());
1568  OvI = E->decls_begin(), OvE = E->decls_end(); OvI != OvE; ++OvI) {
1569  Record.AddDeclRef(OvI.getDecl());
1570  Record.push_back(OvI.getAccess());
1571  }
1572 
1573  Record.AddDeclarationNameInfo(E->NameInfo);
1575 }
1576 
1577 void ASTStmtWriter::VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
1578  VisitOverloadExpr(E);
1579  Record.push_back(E->isArrow());
1580  Record.push_back(E->hasUnresolvedUsing());
1581  Record.AddStmt(!E->isImplicitAccess() ? E->getBase() : nullptr);
1582  Record.AddTypeRef(E->getBaseType());
1583  Record.AddSourceLocation(E->getOperatorLoc());
1585 }
1586 
1587 void ASTStmtWriter::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) {
1588  VisitOverloadExpr(E);
1589  Record.push_back(E->requiresADL());
1590  Record.push_back(E->isOverloaded());
1591  Record.AddDeclRef(E->getNamingClass());
1593 }
1594 
1595 void ASTStmtWriter::VisitTypeTraitExpr(TypeTraitExpr *E) {
1596  VisitExpr(E);
1597  Record.push_back(E->TypeTraitExprBits.NumArgs);
1598  Record.push_back(E->TypeTraitExprBits.Kind); // FIXME: Stable encoding
1599  Record.push_back(E->TypeTraitExprBits.Value);
1600  Record.AddSourceRange(E->getSourceRange());
1601  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1602  Record.AddTypeSourceInfo(E->getArg(I));
1604 }
1605 
1606 void ASTStmtWriter::VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E) {
1607  VisitExpr(E);
1608  Record.push_back(E->getTrait());
1609  Record.push_back(E->getValue());
1610  Record.AddSourceRange(E->getSourceRange());
1612  Record.AddStmt(E->getDimensionExpression());
1614 }
1615 
1616 void ASTStmtWriter::VisitExpressionTraitExpr(ExpressionTraitExpr *E) {
1617  VisitExpr(E);
1618  Record.push_back(E->getTrait());
1619  Record.push_back(E->getValue());
1620  Record.AddSourceRange(E->getSourceRange());
1621  Record.AddStmt(E->getQueriedExpression());
1623 }
1624 
1625 void ASTStmtWriter::VisitCXXNoexceptExpr(CXXNoexceptExpr *E) {
1626  VisitExpr(E);
1627  Record.push_back(E->getValue());
1628  Record.AddSourceRange(E->getSourceRange());
1629  Record.AddStmt(E->getOperand());
1631 }
1632 
1633 void ASTStmtWriter::VisitPackExpansionExpr(PackExpansionExpr *E) {
1634  VisitExpr(E);
1635  Record.AddSourceLocation(E->getEllipsisLoc());
1636  Record.push_back(E->NumExpansions);
1637  Record.AddStmt(E->getPattern());
1639 }
1640 
1641 void ASTStmtWriter::VisitSizeOfPackExpr(SizeOfPackExpr *E) {
1642  VisitExpr(E);
1643  Record.push_back(E->isPartiallySubstituted() ? E->getPartialArguments().size()
1644  : 0);
1645  Record.AddSourceLocation(E->OperatorLoc);
1646  Record.AddSourceLocation(E->PackLoc);
1647  Record.AddSourceLocation(E->RParenLoc);
1648  Record.AddDeclRef(E->Pack);
1649  if (E->isPartiallySubstituted()) {
1650  for (const auto &TA : E->getPartialArguments())
1651  Record.AddTemplateArgument(TA);
1652  } else if (!E->isValueDependent()) {
1653  Record.push_back(E->getPackLength());
1654  }
1656 }
1657 
1658 void ASTStmtWriter::VisitSubstNonTypeTemplateParmExpr(
1660  VisitExpr(E);
1661  Record.AddDeclRef(E->getParameter());
1662  Record.AddSourceLocation(E->getNameLoc());
1663  Record.AddStmt(E->getReplacement());
1665 }
1666 
1667 void ASTStmtWriter::VisitSubstNonTypeTemplateParmPackExpr(
1669  VisitExpr(E);
1670  Record.AddDeclRef(E->getParameterPack());
1671  Record.AddTemplateArgument(E->getArgumentPack());
1674 }
1675 
1676 void ASTStmtWriter::VisitFunctionParmPackExpr(FunctionParmPackExpr *E) {
1677  VisitExpr(E);
1678  Record.push_back(E->getNumExpansions());
1679  Record.AddDeclRef(E->getParameterPack());
1681  for (FunctionParmPackExpr::iterator I = E->begin(), End = E->end();
1682  I != End; ++I)
1683  Record.AddDeclRef(*I);
1685 }
1686 
1687 void ASTStmtWriter::VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E) {
1688  VisitExpr(E);
1689  Record.AddStmt(E->getTemporary());
1690  Record.AddDeclRef(E->getExtendingDecl());
1691  Record.push_back(E->getManglingNumber());
1693 }
1694 
1695 void ASTStmtWriter::VisitCXXFoldExpr(CXXFoldExpr *E) {
1696  VisitExpr(E);
1697  Record.AddSourceLocation(E->LParenLoc);
1698  Record.AddSourceLocation(E->EllipsisLoc);
1699  Record.AddSourceLocation(E->RParenLoc);
1700  Record.AddStmt(E->SubExprs[0]);
1701  Record.AddStmt(E->SubExprs[1]);
1702  Record.push_back(E->Opcode);
1704 }
1705 
1706 void ASTStmtWriter::VisitOpaqueValueExpr(OpaqueValueExpr *E) {
1707  VisitExpr(E);
1708  Record.AddStmt(E->getSourceExpr());
1709  Record.AddSourceLocation(E->getLocation());
1710  Record.push_back(E->isUnique());
1712 }
1713 
1714 void ASTStmtWriter::VisitTypoExpr(TypoExpr *E) {
1715  VisitExpr(E);
1716  // TODO: Figure out sane writer behavior for a TypoExpr, if necessary
1717  llvm_unreachable("Cannot write TypoExpr nodes");
1718 }
1719 
1720 //===----------------------------------------------------------------------===//
1721 // CUDA Expressions and Statements.
1722 //===----------------------------------------------------------------------===//
1723 
1724 void ASTStmtWriter::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E) {
1725  VisitCallExpr(E);
1726  Record.AddStmt(E->getConfig());
1728 }
1729 
1730 //===----------------------------------------------------------------------===//
1731 // OpenCL Expressions and Statements.
1732 //===----------------------------------------------------------------------===//
1733 void ASTStmtWriter::VisitAsTypeExpr(AsTypeExpr *E) {
1734  VisitExpr(E);
1735  Record.AddSourceLocation(E->getBuiltinLoc());
1736  Record.AddSourceLocation(E->getRParenLoc());
1737  Record.AddStmt(E->getSrcExpr());
1739 }
1740 
1741 //===----------------------------------------------------------------------===//
1742 // Microsoft Expressions and Statements.
1743 //===----------------------------------------------------------------------===//
1744 void ASTStmtWriter::VisitMSPropertyRefExpr(MSPropertyRefExpr *E) {
1745  VisitExpr(E);
1746  Record.push_back(E->isArrow());
1747  Record.AddStmt(E->getBaseExpr());
1749  Record.AddSourceLocation(E->getMemberLoc());
1750  Record.AddDeclRef(E->getPropertyDecl());
1752 }
1753 
1754 void ASTStmtWriter::VisitMSPropertySubscriptExpr(MSPropertySubscriptExpr *E) {
1755  VisitExpr(E);
1756  Record.AddStmt(E->getBase());
1757  Record.AddStmt(E->getIdx());
1758  Record.AddSourceLocation(E->getRBracketLoc());
1760 }
1761 
1762 void ASTStmtWriter::VisitCXXUuidofExpr(CXXUuidofExpr *E) {
1763  VisitExpr(E);
1764  Record.AddSourceRange(E->getSourceRange());
1765  Record.AddString(E->getUuidStr());
1766  if (E->isTypeOperand()) {
1769  } else {
1770  Record.AddStmt(E->getExprOperand());
1772  }
1773 }
1774 
1775 void ASTStmtWriter::VisitSEHExceptStmt(SEHExceptStmt *S) {
1776  VisitStmt(S);
1777  Record.AddSourceLocation(S->getExceptLoc());
1778  Record.AddStmt(S->getFilterExpr());
1779  Record.AddStmt(S->getBlock());
1781 }
1782 
1783 void ASTStmtWriter::VisitSEHFinallyStmt(SEHFinallyStmt *S) {
1784  VisitStmt(S);
1785  Record.AddSourceLocation(S->getFinallyLoc());
1786  Record.AddStmt(S->getBlock());
1788 }
1789 
1790 void ASTStmtWriter::VisitSEHTryStmt(SEHTryStmt *S) {
1791  VisitStmt(S);
1792  Record.push_back(S->getIsCXXTry());
1793  Record.AddSourceLocation(S->getTryLoc());
1794  Record.AddStmt(S->getTryBlock());
1795  Record.AddStmt(S->getHandler());
1797 }
1798 
1799 void ASTStmtWriter::VisitSEHLeaveStmt(SEHLeaveStmt *S) {
1800  VisitStmt(S);
1801  Record.AddSourceLocation(S->getLeaveLoc());
1803 }
1804 
1805 //===----------------------------------------------------------------------===//
1806 // OpenMP Clauses.
1807 //===----------------------------------------------------------------------===//
1808 
1809 namespace clang {
1810 class OMPClauseWriter : public OMPClauseVisitor<OMPClauseWriter> {
1811  ASTRecordWriter &Record;
1812 public:
1813  OMPClauseWriter(ASTRecordWriter &Record) : Record(Record) {}
1814 #define OPENMP_CLAUSE(Name, Class) \
1815  void Visit##Class(Class *S);
1816 #include "clang/Basic/OpenMPKinds.def"
1817  void writeClause(OMPClause *C);
1818  void VisitOMPClauseWithPreInit(OMPClauseWithPreInit *C);
1819  void VisitOMPClauseWithPostUpdate(OMPClauseWithPostUpdate *C);
1820 };
1821 }
1822 
1824  Record.push_back(C->getClauseKind());
1825  Visit(C);
1826  Record.AddSourceLocation(C->getLocStart());
1827  Record.AddSourceLocation(C->getLocEnd());
1828 }
1829 
1831  Record.push_back(C->getCaptureRegion());
1832  Record.AddStmt(C->getPreInitStmt());
1833 }
1834 
1836  VisitOMPClauseWithPreInit(C);
1837  Record.AddStmt(C->getPostUpdateExpr());
1838 }
1839 
1840 void OMPClauseWriter::VisitOMPIfClause(OMPIfClause *C) {
1841  VisitOMPClauseWithPreInit(C);
1842  Record.push_back(C->getNameModifier());
1843  Record.AddSourceLocation(C->getNameModifierLoc());
1844  Record.AddSourceLocation(C->getColonLoc());
1845  Record.AddStmt(C->getCondition());
1846  Record.AddSourceLocation(C->getLParenLoc());
1847 }
1848 
1849 void OMPClauseWriter::VisitOMPFinalClause(OMPFinalClause *C) {
1850  Record.AddStmt(C->getCondition());
1851  Record.AddSourceLocation(C->getLParenLoc());
1852 }
1853 
1854 void OMPClauseWriter::VisitOMPNumThreadsClause(OMPNumThreadsClause *C) {
1855  VisitOMPClauseWithPreInit(C);
1856  Record.AddStmt(C->getNumThreads());
1857  Record.AddSourceLocation(C->getLParenLoc());
1858 }
1859 
1860 void OMPClauseWriter::VisitOMPSafelenClause(OMPSafelenClause *C) {
1861  Record.AddStmt(C->getSafelen());
1862  Record.AddSourceLocation(C->getLParenLoc());
1863 }
1864 
1865 void OMPClauseWriter::VisitOMPSimdlenClause(OMPSimdlenClause *C) {
1866  Record.AddStmt(C->getSimdlen());
1867  Record.AddSourceLocation(C->getLParenLoc());
1868 }
1869 
1870 void OMPClauseWriter::VisitOMPCollapseClause(OMPCollapseClause *C) {
1871  Record.AddStmt(C->getNumForLoops());
1872  Record.AddSourceLocation(C->getLParenLoc());
1873 }
1874 
1875 void OMPClauseWriter::VisitOMPDefaultClause(OMPDefaultClause *C) {
1876  Record.push_back(C->getDefaultKind());
1877  Record.AddSourceLocation(C->getLParenLoc());
1878  Record.AddSourceLocation(C->getDefaultKindKwLoc());
1879 }
1880 
1881 void OMPClauseWriter::VisitOMPProcBindClause(OMPProcBindClause *C) {
1882  Record.push_back(C->getProcBindKind());
1883  Record.AddSourceLocation(C->getLParenLoc());
1884  Record.AddSourceLocation(C->getProcBindKindKwLoc());
1885 }
1886 
1887 void OMPClauseWriter::VisitOMPScheduleClause(OMPScheduleClause *C) {
1888  VisitOMPClauseWithPreInit(C);
1889  Record.push_back(C->getScheduleKind());
1890  Record.push_back(C->getFirstScheduleModifier());
1891  Record.push_back(C->getSecondScheduleModifier());
1892  Record.AddStmt(C->getChunkSize());
1893  Record.AddSourceLocation(C->getLParenLoc());
1894  Record.AddSourceLocation(C->getFirstScheduleModifierLoc());
1895  Record.AddSourceLocation(C->getSecondScheduleModifierLoc());
1896  Record.AddSourceLocation(C->getScheduleKindLoc());
1897  Record.AddSourceLocation(C->getCommaLoc());
1898 }
1899 
1900 void OMPClauseWriter::VisitOMPOrderedClause(OMPOrderedClause *C) {
1901  Record.push_back(C->getLoopNumIterations().size());
1902  Record.AddStmt(C->getNumForLoops());
1903  for (Expr *NumIter : C->getLoopNumIterations())
1904  Record.AddStmt(NumIter);
1905  for (unsigned I = 0, E = C->getLoopNumIterations().size(); I <E; ++I)
1906  Record.AddStmt(C->getLoopCunter(I));
1907  Record.AddSourceLocation(C->getLParenLoc());
1908 }
1909 
1910 void OMPClauseWriter::VisitOMPNowaitClause(OMPNowaitClause *) {}
1911 
1912 void OMPClauseWriter::VisitOMPUntiedClause(OMPUntiedClause *) {}
1913 
1914 void OMPClauseWriter::VisitOMPMergeableClause(OMPMergeableClause *) {}
1915 
1916 void OMPClauseWriter::VisitOMPReadClause(OMPReadClause *) {}
1917 
1918 void OMPClauseWriter::VisitOMPWriteClause(OMPWriteClause *) {}
1919 
1920 void OMPClauseWriter::VisitOMPUpdateClause(OMPUpdateClause *) {}
1921 
1922 void OMPClauseWriter::VisitOMPCaptureClause(OMPCaptureClause *) {}
1923 
1924 void OMPClauseWriter::VisitOMPSeqCstClause(OMPSeqCstClause *) {}
1925 
1926 void OMPClauseWriter::VisitOMPThreadsClause(OMPThreadsClause *) {}
1927 
1928 void OMPClauseWriter::VisitOMPSIMDClause(OMPSIMDClause *) {}
1929 
1930 void OMPClauseWriter::VisitOMPNogroupClause(OMPNogroupClause *) {}
1931 
1932 void OMPClauseWriter::VisitOMPPrivateClause(OMPPrivateClause *C) {
1933  Record.push_back(C->varlist_size());
1934  Record.AddSourceLocation(C->getLParenLoc());
1935  for (auto *VE : C->varlists()) {
1936  Record.AddStmt(VE);
1937  }
1938  for (auto *VE : C->private_copies()) {
1939  Record.AddStmt(VE);
1940  }
1941 }
1942 
1943 void OMPClauseWriter::VisitOMPFirstprivateClause(OMPFirstprivateClause *C) {
1944  Record.push_back(C->varlist_size());
1945  VisitOMPClauseWithPreInit(C);
1946  Record.AddSourceLocation(C->getLParenLoc());
1947  for (auto *VE : C->varlists()) {
1948  Record.AddStmt(VE);
1949  }
1950  for (auto *VE : C->private_copies()) {
1951  Record.AddStmt(VE);
1952  }
1953  for (auto *VE : C->inits()) {
1954  Record.AddStmt(VE);
1955  }
1956 }
1957 
1958 void OMPClauseWriter::VisitOMPLastprivateClause(OMPLastprivateClause *C) {
1959  Record.push_back(C->varlist_size());
1960  VisitOMPClauseWithPostUpdate(C);
1961  Record.AddSourceLocation(C->getLParenLoc());
1962  for (auto *VE : C->varlists())
1963  Record.AddStmt(VE);
1964  for (auto *E : C->private_copies())
1965  Record.AddStmt(E);
1966  for (auto *E : C->source_exprs())
1967  Record.AddStmt(E);
1968  for (auto *E : C->destination_exprs())
1969  Record.AddStmt(E);
1970  for (auto *E : C->assignment_ops())
1971  Record.AddStmt(E);
1972 }
1973 
1974 void OMPClauseWriter::VisitOMPSharedClause(OMPSharedClause *C) {
1975  Record.push_back(C->varlist_size());
1976  Record.AddSourceLocation(C->getLParenLoc());
1977  for (auto *VE : C->varlists())
1978  Record.AddStmt(VE);
1979 }
1980 
1981 void OMPClauseWriter::VisitOMPReductionClause(OMPReductionClause *C) {
1982  Record.push_back(C->varlist_size());
1983  VisitOMPClauseWithPostUpdate(C);
1984  Record.AddSourceLocation(C->getLParenLoc());
1985  Record.AddSourceLocation(C->getColonLoc());
1986  Record.AddNestedNameSpecifierLoc(C->getQualifierLoc());
1987  Record.AddDeclarationNameInfo(C->getNameInfo());
1988  for (auto *VE : C->varlists())
1989  Record.AddStmt(VE);
1990  for (auto *VE : C->privates())
1991  Record.AddStmt(VE);
1992  for (auto *E : C->lhs_exprs())
1993  Record.AddStmt(E);
1994  for (auto *E : C->rhs_exprs())
1995  Record.AddStmt(E);
1996  for (auto *E : C->reduction_ops())
1997  Record.AddStmt(E);
1998 }
1999 
2000 void OMPClauseWriter::VisitOMPTaskReductionClause(OMPTaskReductionClause *C) {
2001  Record.push_back(C->varlist_size());
2002  VisitOMPClauseWithPostUpdate(C);
2003  Record.AddSourceLocation(C->getLParenLoc());
2004  Record.AddSourceLocation(C->getColonLoc());
2005  Record.AddNestedNameSpecifierLoc(C->getQualifierLoc());
2006  Record.AddDeclarationNameInfo(C->getNameInfo());
2007  for (auto *VE : C->varlists())
2008  Record.AddStmt(VE);
2009  for (auto *VE : C->privates())
2010  Record.AddStmt(VE);
2011  for (auto *E : C->lhs_exprs())
2012  Record.AddStmt(E);
2013  for (auto *E : C->rhs_exprs())
2014  Record.AddStmt(E);
2015  for (auto *E : C->reduction_ops())
2016  Record.AddStmt(E);
2017 }
2018 
2019 void OMPClauseWriter::VisitOMPInReductionClause(OMPInReductionClause *C) {
2020  Record.push_back(C->varlist_size());
2021  VisitOMPClauseWithPostUpdate(C);
2022  Record.AddSourceLocation(C->getLParenLoc());
2023  Record.AddSourceLocation(C->getColonLoc());
2024  Record.AddNestedNameSpecifierLoc(C->getQualifierLoc());
2025  Record.AddDeclarationNameInfo(C->getNameInfo());
2026  for (auto *VE : C->varlists())
2027  Record.AddStmt(VE);
2028  for (auto *VE : C->privates())
2029  Record.AddStmt(VE);
2030  for (auto *E : C->lhs_exprs())
2031  Record.AddStmt(E);
2032  for (auto *E : C->rhs_exprs())
2033  Record.AddStmt(E);
2034  for (auto *E : C->reduction_ops())
2035  Record.AddStmt(E);
2036  for (auto *E : C->taskgroup_descriptors())
2037  Record.AddStmt(E);
2038 }
2039 
2040 void OMPClauseWriter::VisitOMPLinearClause(OMPLinearClause *C) {
2041  Record.push_back(C->varlist_size());
2042  VisitOMPClauseWithPostUpdate(C);
2043  Record.AddSourceLocation(C->getLParenLoc());
2044  Record.AddSourceLocation(C->getColonLoc());
2045  Record.push_back(C->getModifier());
2046  Record.AddSourceLocation(C->getModifierLoc());
2047  for (auto *VE : C->varlists()) {
2048  Record.AddStmt(VE);
2049  }
2050  for (auto *VE : C->privates()) {
2051  Record.AddStmt(VE);
2052  }
2053  for (auto *VE : C->inits()) {
2054  Record.AddStmt(VE);
2055  }
2056  for (auto *VE : C->updates()) {
2057  Record.AddStmt(VE);
2058  }
2059  for (auto *VE : C->finals()) {
2060  Record.AddStmt(VE);
2061  }
2062  Record.AddStmt(C->getStep());
2063  Record.AddStmt(C->getCalcStep());
2064 }
2065 
2066 void OMPClauseWriter::VisitOMPAlignedClause(OMPAlignedClause *C) {
2067  Record.push_back(C->varlist_size());
2068  Record.AddSourceLocation(C->getLParenLoc());
2069  Record.AddSourceLocation(C->getColonLoc());
2070  for (auto *VE : C->varlists())
2071  Record.AddStmt(VE);
2072  Record.AddStmt(C->getAlignment());
2073 }
2074 
2075 void OMPClauseWriter::VisitOMPCopyinClause(OMPCopyinClause *C) {
2076  Record.push_back(C->varlist_size());
2077  Record.AddSourceLocation(C->getLParenLoc());
2078  for (auto *VE : C->varlists())
2079  Record.AddStmt(VE);
2080  for (auto *E : C->source_exprs())
2081  Record.AddStmt(E);
2082  for (auto *E : C->destination_exprs())
2083  Record.AddStmt(E);
2084  for (auto *E : C->assignment_ops())
2085  Record.AddStmt(E);
2086 }
2087 
2088 void OMPClauseWriter::VisitOMPCopyprivateClause(OMPCopyprivateClause *C) {
2089  Record.push_back(C->varlist_size());
2090  Record.AddSourceLocation(C->getLParenLoc());
2091  for (auto *VE : C->varlists())
2092  Record.AddStmt(VE);
2093  for (auto *E : C->source_exprs())
2094  Record.AddStmt(E);
2095  for (auto *E : C->destination_exprs())
2096  Record.AddStmt(E);
2097  for (auto *E : C->assignment_ops())
2098  Record.AddStmt(E);
2099 }
2100 
2101 void OMPClauseWriter::VisitOMPFlushClause(OMPFlushClause *C) {
2102  Record.push_back(C->varlist_size());
2103  Record.AddSourceLocation(C->getLParenLoc());
2104  for (auto *VE : C->varlists())
2105  Record.AddStmt(VE);
2106 }
2107 
2108 void OMPClauseWriter::VisitOMPDependClause(OMPDependClause *C) {
2109  Record.push_back(C->varlist_size());
2110  Record.push_back(C->getNumLoops());
2111  Record.AddSourceLocation(C->getLParenLoc());
2112  Record.push_back(C->getDependencyKind());
2113  Record.AddSourceLocation(C->getDependencyLoc());
2114  Record.AddSourceLocation(C->getColonLoc());
2115  for (auto *VE : C->varlists())
2116  Record.AddStmt(VE);
2117  for (unsigned I = 0, E = C->getNumLoops(); I < E; ++I)
2118  Record.AddStmt(C->getLoopData(I));
2119 }
2120 
2121 void OMPClauseWriter::VisitOMPDeviceClause(OMPDeviceClause *C) {
2122  VisitOMPClauseWithPreInit(C);
2123  Record.AddStmt(C->getDevice());
2124  Record.AddSourceLocation(C->getLParenLoc());
2125 }
2126 
2127 void OMPClauseWriter::VisitOMPMapClause(OMPMapClause *C) {
2128  Record.push_back(C->varlist_size());
2129  Record.push_back(C->getUniqueDeclarationsNum());
2130  Record.push_back(C->getTotalComponentListNum());
2131  Record.push_back(C->getTotalComponentsNum());
2132  Record.AddSourceLocation(C->getLParenLoc());
2133  Record.push_back(C->getMapTypeModifier());
2134  Record.push_back(C->getMapType());
2135  Record.AddSourceLocation(C->getMapLoc());
2136  Record.AddSourceLocation(C->getColonLoc());
2137  for (auto *E : C->varlists())
2138  Record.AddStmt(E);
2139  for (auto *D : C->all_decls())
2140  Record.AddDeclRef(D);
2141  for (auto N : C->all_num_lists())
2142  Record.push_back(N);
2143  for (auto N : C->all_lists_sizes())
2144  Record.push_back(N);
2145  for (auto &M : C->all_components()) {
2146  Record.AddStmt(M.getAssociatedExpression());
2147  Record.AddDeclRef(M.getAssociatedDeclaration());
2148  }
2149 }
2150 
2151 void OMPClauseWriter::VisitOMPNumTeamsClause(OMPNumTeamsClause *C) {
2152  VisitOMPClauseWithPreInit(C);
2153  Record.AddStmt(C->getNumTeams());
2154  Record.AddSourceLocation(C->getLParenLoc());
2155 }
2156 
2157 void OMPClauseWriter::VisitOMPThreadLimitClause(OMPThreadLimitClause *C) {
2158  VisitOMPClauseWithPreInit(C);
2159  Record.AddStmt(C->getThreadLimit());
2160  Record.AddSourceLocation(C->getLParenLoc());
2161 }
2162 
2163 void OMPClauseWriter::VisitOMPPriorityClause(OMPPriorityClause *C) {
2164  Record.AddStmt(C->getPriority());
2165  Record.AddSourceLocation(C->getLParenLoc());
2166 }
2167 
2168 void OMPClauseWriter::VisitOMPGrainsizeClause(OMPGrainsizeClause *C) {
2169  Record.AddStmt(C->getGrainsize());
2170  Record.AddSourceLocation(C->getLParenLoc());
2171 }
2172 
2173 void OMPClauseWriter::VisitOMPNumTasksClause(OMPNumTasksClause *C) {
2174  Record.AddStmt(C->getNumTasks());
2175  Record.AddSourceLocation(C->getLParenLoc());
2176 }
2177 
2178 void OMPClauseWriter::VisitOMPHintClause(OMPHintClause *C) {
2179  Record.AddStmt(C->getHint());
2180  Record.AddSourceLocation(C->getLParenLoc());
2181 }
2182 
2183 void OMPClauseWriter::VisitOMPDistScheduleClause(OMPDistScheduleClause *C) {
2184  VisitOMPClauseWithPreInit(C);
2185  Record.push_back(C->getDistScheduleKind());
2186  Record.AddStmt(C->getChunkSize());
2187  Record.AddSourceLocation(C->getLParenLoc());
2188  Record.AddSourceLocation(C->getDistScheduleKindLoc());
2189  Record.AddSourceLocation(C->getCommaLoc());
2190 }
2191 
2192 void OMPClauseWriter::VisitOMPDefaultmapClause(OMPDefaultmapClause *C) {
2193  Record.push_back(C->getDefaultmapKind());
2194  Record.push_back(C->getDefaultmapModifier());
2195  Record.AddSourceLocation(C->getLParenLoc());
2196  Record.AddSourceLocation(C->getDefaultmapModifierLoc());
2197  Record.AddSourceLocation(C->getDefaultmapKindLoc());
2198 }
2199 
2200 void OMPClauseWriter::VisitOMPToClause(OMPToClause *C) {
2201  Record.push_back(C->varlist_size());
2202  Record.push_back(C->getUniqueDeclarationsNum());
2203  Record.push_back(C->getTotalComponentListNum());
2204  Record.push_back(C->getTotalComponentsNum());
2205  Record.AddSourceLocation(C->getLParenLoc());
2206  for (auto *E : C->varlists())
2207  Record.AddStmt(E);
2208  for (auto *D : C->all_decls())
2209  Record.AddDeclRef(D);
2210  for (auto N : C->all_num_lists())
2211  Record.push_back(N);
2212  for (auto N : C->all_lists_sizes())
2213  Record.push_back(N);
2214  for (auto &M : C->all_components()) {
2215  Record.AddStmt(M.getAssociatedExpression());
2216  Record.AddDeclRef(M.getAssociatedDeclaration());
2217  }
2218 }
2219 
2220 void OMPClauseWriter::VisitOMPFromClause(OMPFromClause *C) {
2221  Record.push_back(C->varlist_size());
2222  Record.push_back(C->getUniqueDeclarationsNum());
2223  Record.push_back(C->getTotalComponentListNum());
2224  Record.push_back(C->getTotalComponentsNum());
2225  Record.AddSourceLocation(C->getLParenLoc());
2226  for (auto *E : C->varlists())
2227  Record.AddStmt(E);
2228  for (auto *D : C->all_decls())
2229  Record.AddDeclRef(D);
2230  for (auto N : C->all_num_lists())
2231  Record.push_back(N);
2232  for (auto N : C->all_lists_sizes())
2233  Record.push_back(N);
2234  for (auto &M : C->all_components()) {
2235  Record.AddStmt(M.getAssociatedExpression());
2236  Record.AddDeclRef(M.getAssociatedDeclaration());
2237  }
2238 }
2239 
2240 void OMPClauseWriter::VisitOMPUseDevicePtrClause(OMPUseDevicePtrClause *C) {
2241  Record.push_back(C->varlist_size());
2242  Record.push_back(C->getUniqueDeclarationsNum());
2243  Record.push_back(C->getTotalComponentListNum());
2244  Record.push_back(C->getTotalComponentsNum());
2245  Record.AddSourceLocation(C->getLParenLoc());
2246  for (auto *E : C->varlists())
2247  Record.AddStmt(E);
2248  for (auto *VE : C->private_copies())
2249  Record.AddStmt(VE);
2250  for (auto *VE : C->inits())
2251  Record.AddStmt(VE);
2252  for (auto *D : C->all_decls())
2253  Record.AddDeclRef(D);
2254  for (auto N : C->all_num_lists())
2255  Record.push_back(N);
2256  for (auto N : C->all_lists_sizes())
2257  Record.push_back(N);
2258  for (auto &M : C->all_components()) {
2259  Record.AddStmt(M.getAssociatedExpression());
2260  Record.AddDeclRef(M.getAssociatedDeclaration());
2261  }
2262 }
2263 
2264 void OMPClauseWriter::VisitOMPIsDevicePtrClause(OMPIsDevicePtrClause *C) {
2265  Record.push_back(C->varlist_size());
2266  Record.push_back(C->getUniqueDeclarationsNum());
2267  Record.push_back(C->getTotalComponentListNum());
2268  Record.push_back(C->getTotalComponentsNum());
2269  Record.AddSourceLocation(C->getLParenLoc());
2270  for (auto *E : C->varlists())
2271  Record.AddStmt(E);
2272  for (auto *D : C->all_decls())
2273  Record.AddDeclRef(D);
2274  for (auto N : C->all_num_lists())
2275  Record.push_back(N);
2276  for (auto N : C->all_lists_sizes())
2277  Record.push_back(N);
2278  for (auto &M : C->all_components()) {
2279  Record.AddStmt(M.getAssociatedExpression());
2280  Record.AddDeclRef(M.getAssociatedDeclaration());
2281  }
2282 }
2283 
2284 //===----------------------------------------------------------------------===//
2285 // OpenMP Directives.
2286 //===----------------------------------------------------------------------===//
2287 void ASTStmtWriter::VisitOMPExecutableDirective(OMPExecutableDirective *E) {
2288  Record.AddSourceLocation(E->getLocStart());
2289  Record.AddSourceLocation(E->getLocEnd());
2290  OMPClauseWriter ClauseWriter(Record);
2291  for (unsigned i = 0; i < E->getNumClauses(); ++i) {
2292  ClauseWriter.writeClause(E->getClause(i));
2293  }
2294  if (E->hasAssociatedStmt())
2295  Record.AddStmt(E->getAssociatedStmt());
2296 }
2297 
2298 void ASTStmtWriter::VisitOMPLoopDirective(OMPLoopDirective *D) {
2299  VisitStmt(D);
2300  Record.push_back(D->getNumClauses());
2301  Record.push_back(D->getCollapsedNumber());
2302  VisitOMPExecutableDirective(D);
2303  Record.AddStmt(D->getIterationVariable());
2304  Record.AddStmt(D->getLastIteration());
2305  Record.AddStmt(D->getCalcLastIteration());
2306  Record.AddStmt(D->getPreCond());
2307  Record.AddStmt(D->getCond());
2308  Record.AddStmt(D->getInit());
2309  Record.AddStmt(D->getInc());
2310  Record.AddStmt(D->getPreInits());
2314  Record.AddStmt(D->getIsLastIterVariable());
2315  Record.AddStmt(D->getLowerBoundVariable());
2316  Record.AddStmt(D->getUpperBoundVariable());
2317  Record.AddStmt(D->getStrideVariable());
2318  Record.AddStmt(D->getEnsureUpperBound());
2319  Record.AddStmt(D->getNextLowerBound());
2320  Record.AddStmt(D->getNextUpperBound());
2321  Record.AddStmt(D->getNumIterations());
2322  }
2324  Record.AddStmt(D->getPrevLowerBoundVariable());
2325  Record.AddStmt(D->getPrevUpperBoundVariable());
2326  Record.AddStmt(D->getDistInc());
2327  Record.AddStmt(D->getPrevEnsureUpperBound());
2328  Record.AddStmt(D->getCombinedLowerBoundVariable());
2329  Record.AddStmt(D->getCombinedUpperBoundVariable());
2330  Record.AddStmt(D->getCombinedEnsureUpperBound());
2331  Record.AddStmt(D->getCombinedInit());
2332  Record.AddStmt(D->getCombinedCond());
2333  Record.AddStmt(D->getCombinedNextLowerBound());
2334  Record.AddStmt(D->getCombinedNextUpperBound());
2335  }
2336  for (auto I : D->counters()) {
2337  Record.AddStmt(I);
2338  }
2339  for (auto I : D->private_counters()) {
2340  Record.AddStmt(I);
2341  }
2342  for (auto I : D->inits()) {
2343  Record.AddStmt(I);
2344  }
2345  for (auto I : D->updates()) {
2346  Record.AddStmt(I);
2347  }
2348  for (auto I : D->finals()) {
2349  Record.AddStmt(I);
2350  }
2351 }
2352 
2353 void ASTStmtWriter::VisitOMPParallelDirective(OMPParallelDirective *D) {
2354  VisitStmt(D);
2355  Record.push_back(D->getNumClauses());
2356  VisitOMPExecutableDirective(D);
2357  Record.push_back(D->hasCancel() ? 1 : 0);
2359 }
2360 
2361 void ASTStmtWriter::VisitOMPSimdDirective(OMPSimdDirective *D) {
2362  VisitOMPLoopDirective(D);
2364 }
2365 
2366 void ASTStmtWriter::VisitOMPForDirective(OMPForDirective *D) {
2367  VisitOMPLoopDirective(D);
2368  Record.push_back(D->hasCancel() ? 1 : 0);
2370 }
2371 
2372 void ASTStmtWriter::VisitOMPForSimdDirective(OMPForSimdDirective *D) {
2373  VisitOMPLoopDirective(D);
2375 }
2376 
2377 void ASTStmtWriter::VisitOMPSectionsDirective(OMPSectionsDirective *D) {
2378  VisitStmt(D);
2379  Record.push_back(D->getNumClauses());
2380  VisitOMPExecutableDirective(D);
2381  Record.push_back(D->hasCancel() ? 1 : 0);
2383 }
2384 
2385 void ASTStmtWriter::VisitOMPSectionDirective(OMPSectionDirective *D) {
2386  VisitStmt(D);
2387  VisitOMPExecutableDirective(D);
2388  Record.push_back(D->hasCancel() ? 1 : 0);
2390 }
2391 
2392 void ASTStmtWriter::VisitOMPSingleDirective(OMPSingleDirective *D) {
2393  VisitStmt(D);
2394  Record.push_back(D->getNumClauses());
2395  VisitOMPExecutableDirective(D);
2397 }
2398 
2399 void ASTStmtWriter::VisitOMPMasterDirective(OMPMasterDirective *D) {
2400  VisitStmt(D);
2401  VisitOMPExecutableDirective(D);
2403 }
2404 
2405 void ASTStmtWriter::VisitOMPCriticalDirective(OMPCriticalDirective *D) {
2406  VisitStmt(D);
2407  Record.push_back(D->getNumClauses());
2408  VisitOMPExecutableDirective(D);
2409  Record.AddDeclarationNameInfo(D->getDirectiveName());
2411 }
2412 
2413 void ASTStmtWriter::VisitOMPParallelForDirective(OMPParallelForDirective *D) {
2414  VisitOMPLoopDirective(D);
2415  Record.push_back(D->hasCancel() ? 1 : 0);
2417 }
2418 
2419 void ASTStmtWriter::VisitOMPParallelForSimdDirective(
2421  VisitOMPLoopDirective(D);
2423 }
2424 
2425 void ASTStmtWriter::VisitOMPParallelSectionsDirective(
2427  VisitStmt(D);
2428  Record.push_back(D->getNumClauses());
2429  VisitOMPExecutableDirective(D);
2430  Record.push_back(D->hasCancel() ? 1 : 0);
2432 }
2433 
2434 void ASTStmtWriter::VisitOMPTaskDirective(OMPTaskDirective *D) {
2435  VisitStmt(D);
2436  Record.push_back(D->getNumClauses());
2437  VisitOMPExecutableDirective(D);
2438  Record.push_back(D->hasCancel() ? 1 : 0);
2440 }
2441 
2442 void ASTStmtWriter::VisitOMPAtomicDirective(OMPAtomicDirective *D) {
2443  VisitStmt(D);
2444  Record.push_back(D->getNumClauses());
2445  VisitOMPExecutableDirective(D);
2446  Record.AddStmt(D->getX());
2447  Record.AddStmt(D->getV());
2448  Record.AddStmt(D->getExpr());
2449  Record.AddStmt(D->getUpdateExpr());
2450  Record.push_back(D->isXLHSInRHSPart() ? 1 : 0);
2451  Record.push_back(D->isPostfixUpdate() ? 1 : 0);
2453 }
2454 
2455 void ASTStmtWriter::VisitOMPTargetDirective(OMPTargetDirective *D) {
2456  VisitStmt(D);
2457  Record.push_back(D->getNumClauses());
2458  VisitOMPExecutableDirective(D);
2460 }
2461 
2462 void ASTStmtWriter::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) {
2463  VisitStmt(D);
2464  Record.push_back(D->getNumClauses());
2465  VisitOMPExecutableDirective(D);
2467 }
2468 
2469 void ASTStmtWriter::VisitOMPTargetEnterDataDirective(
2471  VisitStmt(D);
2472  Record.push_back(D->getNumClauses());
2473  VisitOMPExecutableDirective(D);
2475 }
2476 
2477 void ASTStmtWriter::VisitOMPTargetExitDataDirective(
2479  VisitStmt(D);
2480  Record.push_back(D->getNumClauses());
2481  VisitOMPExecutableDirective(D);
2483 }
2484 
2485 void ASTStmtWriter::VisitOMPTargetParallelDirective(
2487  VisitStmt(D);
2488  Record.push_back(D->getNumClauses());
2489  VisitOMPExecutableDirective(D);
2491 }
2492 
2493 void ASTStmtWriter::VisitOMPTargetParallelForDirective(
2495  VisitOMPLoopDirective(D);
2496  Record.push_back(D->hasCancel() ? 1 : 0);
2498 }
2499 
2500 void ASTStmtWriter::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) {
2501  VisitStmt(D);
2502  VisitOMPExecutableDirective(D);
2504 }
2505 
2506 void ASTStmtWriter::VisitOMPBarrierDirective(OMPBarrierDirective *D) {
2507  VisitStmt(D);
2508  VisitOMPExecutableDirective(D);
2510 }
2511 
2512 void ASTStmtWriter::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) {
2513  VisitStmt(D);
2514  VisitOMPExecutableDirective(D);
2516 }
2517 
2518 void ASTStmtWriter::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) {
2519  VisitStmt(D);
2520  Record.push_back(D->getNumClauses());
2521  VisitOMPExecutableDirective(D);
2522  Record.AddStmt(D->getReductionRef());
2524 }
2525 
2526 void ASTStmtWriter::VisitOMPFlushDirective(OMPFlushDirective *D) {
2527  VisitStmt(D);
2528  Record.push_back(D->getNumClauses());
2529  VisitOMPExecutableDirective(D);
2531 }
2532 
2533 void ASTStmtWriter::VisitOMPOrderedDirective(OMPOrderedDirective *D) {
2534  VisitStmt(D);
2535  Record.push_back(D->getNumClauses());
2536  VisitOMPExecutableDirective(D);
2538 }
2539 
2540 void ASTStmtWriter::VisitOMPTeamsDirective(OMPTeamsDirective *D) {
2541  VisitStmt(D);
2542  Record.push_back(D->getNumClauses());
2543  VisitOMPExecutableDirective(D);
2545 }
2546 
2547 void ASTStmtWriter::VisitOMPCancellationPointDirective(
2549  VisitStmt(D);
2550  VisitOMPExecutableDirective(D);
2551  Record.push_back(D->getCancelRegion());
2553 }
2554 
2555 void ASTStmtWriter::VisitOMPCancelDirective(OMPCancelDirective *D) {
2556  VisitStmt(D);
2557  Record.push_back(D->getNumClauses());
2558  VisitOMPExecutableDirective(D);
2559  Record.push_back(D->getCancelRegion());
2561 }
2562 
2563 void ASTStmtWriter::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) {
2564  VisitOMPLoopDirective(D);
2566 }
2567 
2568 void ASTStmtWriter::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) {
2569  VisitOMPLoopDirective(D);
2571 }
2572 
2573 void ASTStmtWriter::VisitOMPDistributeDirective(OMPDistributeDirective *D) {
2574  VisitOMPLoopDirective(D);
2576 }
2577 
2578 void ASTStmtWriter::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) {
2579  VisitStmt(D);
2580  Record.push_back(D->getNumClauses());
2581  VisitOMPExecutableDirective(D);
2583 }
2584 
2585 void ASTStmtWriter::VisitOMPDistributeParallelForDirective(
2587  VisitOMPLoopDirective(D);
2588  Record.push_back(D->hasCancel() ? 1 : 0);
2590 }
2591 
2592 void ASTStmtWriter::VisitOMPDistributeParallelForSimdDirective(
2594  VisitOMPLoopDirective(D);
2596 }
2597 
2598 void ASTStmtWriter::VisitOMPDistributeSimdDirective(
2600  VisitOMPLoopDirective(D);
2602 }
2603 
2604 void ASTStmtWriter::VisitOMPTargetParallelForSimdDirective(
2606  VisitOMPLoopDirective(D);
2608 }
2609 
2610 void ASTStmtWriter::VisitOMPTargetSimdDirective(OMPTargetSimdDirective *D) {
2611  VisitOMPLoopDirective(D);
2613 }
2614 
2615 void ASTStmtWriter::VisitOMPTeamsDistributeDirective(
2617  VisitOMPLoopDirective(D);
2619 }
2620 
2621 void ASTStmtWriter::VisitOMPTeamsDistributeSimdDirective(
2623  VisitOMPLoopDirective(D);
2625 }
2626 
2627 void ASTStmtWriter::VisitOMPTeamsDistributeParallelForSimdDirective(
2629  VisitOMPLoopDirective(D);
2631 }
2632 
2633 void ASTStmtWriter::VisitOMPTeamsDistributeParallelForDirective(
2635  VisitOMPLoopDirective(D);
2636  Record.push_back(D->hasCancel() ? 1 : 0);
2638 }
2639 
2640 void ASTStmtWriter::VisitOMPTargetTeamsDirective(OMPTargetTeamsDirective *D) {
2641  VisitStmt(D);
2642  Record.push_back(D->getNumClauses());
2643  VisitOMPExecutableDirective(D);
2645 }
2646 
2647 void ASTStmtWriter::VisitOMPTargetTeamsDistributeDirective(
2649  VisitOMPLoopDirective(D);
2651 }
2652 
2653 void ASTStmtWriter::VisitOMPTargetTeamsDistributeParallelForDirective(
2655  VisitOMPLoopDirective(D);
2656  Record.push_back(D->hasCancel() ? 1 : 0);
2658 }
2659 
2660 void ASTStmtWriter::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
2662  VisitOMPLoopDirective(D);
2663  Code = serialization::
2665 }
2666 
2667 void ASTStmtWriter::VisitOMPTargetTeamsDistributeSimdDirective(
2669  VisitOMPLoopDirective(D);
2671 }
2672 
2673 //===----------------------------------------------------------------------===//
2674 // ASTWriter Implementation
2675 //===----------------------------------------------------------------------===//
2676 
2678  assert(SwitchCaseIDs.find(S) == SwitchCaseIDs.end() &&
2679  "SwitchCase recorded twice");
2680  unsigned NextID = SwitchCaseIDs.size();
2681  SwitchCaseIDs[S] = NextID;
2682  return NextID;
2683 }
2684 
2686  assert(SwitchCaseIDs.find(S) != SwitchCaseIDs.end() &&
2687  "SwitchCase hasn't been seen yet");
2688  return SwitchCaseIDs[S];
2689 }
2690 
2692  SwitchCaseIDs.clear();
2693 }
2694 
2695 /// Write the given substatement or subexpression to the
2696 /// bitstream.
2697 void ASTWriter::WriteSubStmt(Stmt *S) {
2698  RecordData Record;
2699  ASTStmtWriter Writer(*this, Record);
2700  ++NumStatements;
2701 
2702  if (!S) {
2703  Stream.EmitRecord(serialization::STMT_NULL_PTR, Record);
2704  return;
2705  }
2706 
2707  llvm::DenseMap<Stmt *, uint64_t>::iterator I = SubStmtEntries.find(S);
2708  if (I != SubStmtEntries.end()) {
2709  Record.push_back(I->second);
2710  Stream.EmitRecord(serialization::STMT_REF_PTR, Record);
2711  return;
2712  }
2713 
2714 #ifndef NDEBUG
2715  assert(!ParentStmts.count(S) && "There is a Stmt cycle!");
2716 
2717  struct ParentStmtInserterRAII {
2718  Stmt *S;
2719  llvm::DenseSet<Stmt *> &ParentStmts;
2720 
2721  ParentStmtInserterRAII(Stmt *S, llvm::DenseSet<Stmt *> &ParentStmts)
2722  : S(S), ParentStmts(ParentStmts) {
2723  ParentStmts.insert(S);
2724  }
2725  ~ParentStmtInserterRAII() {
2726  ParentStmts.erase(S);
2727  }
2728  };
2729 
2730  ParentStmtInserterRAII ParentStmtInserter(S, ParentStmts);
2731 #endif
2732 
2733  Writer.Visit(S);
2734 
2735  uint64_t Offset = Writer.Emit();
2736  SubStmtEntries[S] = Offset;
2737 }
2738 
2739 /// Flush all of the statements that have been added to the
2740 /// queue via AddStmt().
2741 void ASTRecordWriter::FlushStmts() {
2742  // We expect to be the only consumer of the two temporary statement maps,
2743  // assert that they are empty.
2744  assert(Writer->SubStmtEntries.empty() && "unexpected entries in sub-stmt map");
2745  assert(Writer->ParentStmts.empty() && "unexpected entries in parent stmt map");
2746 
2747  for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) {
2748  Writer->WriteSubStmt(StmtsToEmit[I]);
2749 
2750  assert(N == StmtsToEmit.size() && "record modified while being written!");
2751 
2752  // Note that we are at the end of a full expression. Any
2753  // expression records that follow this one are part of a different
2754  // expression.
2755  Writer->Stream.EmitRecord(serialization::STMT_STOP, ArrayRef<uint32_t>());
2756 
2757  Writer->SubStmtEntries.clear();
2758  Writer->ParentStmts.clear();
2759  }
2760 
2761  StmtsToEmit.clear();
2762 }
2763 
2764 void ASTRecordWriter::FlushSubStmts() {
2765  // For a nested statement, write out the substatements in reverse order (so
2766  // that a simple stack machine can be used when loading), and don't emit a
2767  // STMT_STOP after each one.
2768  for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) {
2769  Writer->WriteSubStmt(StmtsToEmit[N - I - 1]);
2770  assert(N == StmtsToEmit.size() && "record modified while being written!");
2771  }
2772 
2773  StmtsToEmit.clear();
2774 }
SourceLocation getRParenLoc() const
Definition: Stmt.h:1235
Expr * getInc()
Definition: Stmt.h:1290
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:595
unsigned getNumSemanticExprs() const
Definition: Expr.h:5241
A PredefinedExpr record.
Definition: ASTBitCodes.h:1617
A call to an overloaded operator written using operator syntax.
Definition: ExprCXX.h:78
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
Definition: ExprObjC.h:1543
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:330
The receiver is the instance of the superclass object.
Definition: ExprObjC.h:1082
Represents a single C99 designator.
Definition: Expr.h:4361
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: Expr.h:1160
SourceLocation getRBracLoc() const
Definition: Stmt.h:709
Defines the clang::ASTContext interface.
A CompoundLiteralExpr record.
Definition: ASTBitCodes.h:1677
This represents &#39;#pragma omp distribute simd&#39; composite directive.
Definition: StmtOpenMP.h:3216
const BlockDecl * getBlockDecl() const
Definition: Expr.h:5065
Expr * getNextUpperBound() const
Definition: StmtOpenMP.h:845
IdentifierInfo * getInputIdentifier(unsigned i) const
Definition: Stmt.h:1797
This represents &#39;#pragma omp master&#39; directive.
Definition: StmtOpenMP.h:1399
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition: ExprCXX.h:931
SourceLocation getRParenLoc() const
Definition: Stmt.h:1704
The null pointer literal (C++11 [lex.nullptr])
Definition: ExprCXX.h:593
unsigned getNumDecls() const
Gets the number of declarations in the unresolved set.
Definition: ExprCXX.h:2737
This represents &#39;#pragma omp task&#39; directive.
Definition: StmtOpenMP.h:1739
This represents a GCC inline-assembly statement extension.
Definition: Stmt.h:1683
Represents a &#39;co_await&#39; expression while the type of the promise is dependent.
Definition: ExprCXX.h:4455
SourceLocation getForLoc() const
Definition: StmtCXX.h:195
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
Definition: Expr.h:1098
bool getValue() const
Definition: ExprObjC.h:96
helper_expr_const_range reduction_ops() const
This represents &#39;thread_limit&#39; clause in the &#39;#pragma omp ...&#39; directive.
The receiver is an object instance.
Definition: ExprObjC.h:1076
Expr * getLHS() const
Definition: Expr.h:3474
const Stmt * getElse() const
Definition: Stmt.h:1014
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprCXX.h:3727
Expr * getUpperBoundVariable() const
Definition: StmtOpenMP.h:813
unsigned getNumInputs() const
Definition: Stmt.h:1599
SourceLocation getOpLoc() const
Definition: ExprObjC.h:1496
Expr * getSyntacticForm()
Return the syntactic form of this expression, i.e.
Definition: Expr.h:5221
SourceLocation getRParenLoc() const
Definition: Expr.h:2452
ObjCDictionaryElement getKeyValueElement(unsigned Index) const
Definition: ExprObjC.h:352
SourceLocation getLocEnd() const LLVM_READONLY
Returns the ending location of the clause.
Definition: OpenMPClause.h:71
CompoundStmt * getBlock() const
Definition: Stmt.h:2026
An IndirectGotoStmt record.
Definition: ASTBitCodes.h:1593
helper_expr_const_range lhs_exprs() const
const_all_decls_range all_decls() const
SourceLocation getForLoc() const
Definition: Stmt.h:1303
This represents clause &#39;copyin&#39; in the &#39;#pragma omp ...&#39; directives.
SourceLocation getUsedLocation() const
Retrieve the location where this default argument was actually used.
Definition: ExprCXX.h:1131
uint64_t getValue() const
Definition: ExprCXX.h:2558
StringKind getKind() const
Definition: Expr.h:1673
An AddrLabelExpr record.
Definition: ASTBitCodes.h:1707
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Definition: Expr.h:2596
NameKind
NameKind - The kind of name this object contains.
Expr * getCond() const
Definition: Expr.h:3881
ObjCMethodDecl * getAtIndexMethodDecl() const
Definition: ExprObjC.h:875
Selector getSelector() const
Definition: ExprObjC.cpp:312
void AddToken(const Token &Tok, RecordDataImpl &Record)
Emit a token.
Definition: ASTWriter.cpp:4495
SourceLocation getEllipsisLoc() const
Definition: Stmt.h:786
SourceLocation getLParen() const
Get the location of the left parentheses &#39;(&#39;.
Definition: Expr.h:1777
const Expr * getSubExpr() const
Definition: ExprCXX.h:1050
SourceLocation getCommaLoc()
Get location of &#39;,&#39;.
Definition: OpenMPClause.h:902
Expr * getCond()
Definition: Stmt.h:1176
Expr * getExpr(unsigned Index)
getExpr - Return the Expr at the specified index.
Definition: Expr.h:3743
A CXXStaticCastExpr record.
Definition: ASTBitCodes.h:1829
unsigned getNumSubExprs() const
getNumSubExprs - Return the size of the SubExprs array.
Definition: Expr.h:3737
unsigned getResultIndex() const
The zero-based index of the result expression&#39;s generic association in the generic selection&#39;s associ...
Definition: Expr.h:4949
bool isSuperReceiver() const
Definition: ExprObjC.h:757
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2421
SourceLocation TemplateKWLoc
The source location of the template keyword; this is used as part of the representation of qualified ...
Definition: TemplateBase.h:655
An AttributedStmt record.
Definition: ASTBitCodes.h:1572
CompoundStmt * getSubStmt()
Definition: Expr.h:3670
A CXXReinterpretCastExpr record.
Definition: ASTBitCodes.h:1835
const Expr * getInit(unsigned Init) const
Definition: Expr.h:4098
helper_expr_const_range rhs_exprs() const
unsigned getNumAsmToks()
Definition: Stmt.h:1890
An ObjCBoolLiteralExpr record.
Definition: ASTBitCodes.h:1797
private_copies_range private_copies()
SourceLocation getRParenLoc() const
Definition: StmtObjC.h:106
bool isThrownVariableInScope() const
Determines whether the variable thrown by this expression (if any!) is within the innermost try block...
Definition: ExprCXX.h:1060
Expr *const * semantics_iterator
Definition: Expr.h:5243
ObjCProtocolDecl * getProtocol() const
Definition: ExprObjC.h:504
Represents a &#39;co_return&#39; statement in the C++ Coroutines TS.
Definition: StmtCXX.h:442
Stmt - This represents one statement.
Definition: Stmt.h:66
Expr * getLowerBoundVariable() const
Definition: StmtOpenMP.h:805
This represents clause &#39;in_reduction&#39; in the &#39;#pragma omp task&#39; directives.
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition: Expr.h:2373
Expr * getDimensionExpression() const
Definition: ExprCXX.h:2560
const ObjCAtFinallyStmt * getFinallyStmt() const
Retrieve the @finally statement, if any.
Definition: StmtObjC.h:230
CXXCatchStmt * getHandler(unsigned i)
Definition: StmtCXX.h:108
bool isArrayFormAsWritten() const
Definition: ExprCXX.h:2187
IfStmt - This represents an if/then/else.
Definition: Stmt.h:974
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
Definition: Expr.h:2062
SourceLocation getRParenLoc() const
Definition: Expr.h:3722
SourceLocation getLocation() const
Definition: Expr.h:1509
Expr * getLoopData(unsigned NumLoop)
Get the loop data.
Class that handles pre-initialization statement for some clauses, like &#39;shedule&#39;, &#39;firstprivate&#39; etc...
Definition: OpenMPClause.h:101
ObjCMethodDecl * setAtIndexMethodDecl() const
Definition: ExprObjC.h:879
void AddNestedNameSpecifierLoc(NestedNameSpecifierLoc NNS)
Emit a nested name specifier with source-location information.
Definition: ASTWriter.cpp:5758
unsigned getNumOutputs() const
Definition: Stmt.h:1577
This represents &#39;#pragma omp for simd&#39; directive.
Definition: StmtOpenMP.h:1149
SourceLocation getLParenLoc() const
Returns the location of &#39;(&#39;.
Definition: OpenMPClause.h:534
Expr * getBase() const
Definition: Expr.h:2590
const StringLiteral * getAsmString() const
Definition: Stmt.h:1709
TypeSourceInfo * getTypeSourceInfo() const
Definition: Expr.h:2788
helper_expr_const_range rhs_exprs() const
An ImplicitValueInitExpr record.
Definition: ASTBitCodes.h:1701
iterator end()
Definition: DeclGroup.h:106
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:86
This represents &#39;grainsize&#39; clause in the &#39;#pragma omp ...&#39; directive.
This represents &#39;#pragma omp teams distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:3627
An ImplicitCastExpr record.
Definition: ASTBitCodes.h:1671
Stmt * getHandlerBlock() const
Definition: StmtCXX.h:54
llvm::APFloat getValue() const
Definition: Expr.h:1475
ObjCMethodDecl * getImplicitPropertySetter() const
Definition: ExprObjC.h:698
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Definition: Expr.h:4735
FunctionDecl * getOperatorNew() const
Definition: ExprCXX.h:2015
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:2824
This represents &#39;if&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:242
DeclarationNameInfo getNameInfo() const
Retrieve the name of the entity we&#39;re testing for, along with location information.
Definition: StmtCXX.h:280
const Expr * getSubExpr() const
Definition: Expr.h:3972
Defines the C++ template declaration subclasses.
Opcode getOpcode() const
Definition: Expr.h:3184
unsigned getNumSubExprs() const
Retrieve the total number of subexpressions in this designated initializer expression, including the actual initialized value and any expressions that occur within array and array-range designators.
Definition: Expr.h:4534
SourceLocation getIdentLoc() const
Definition: Stmt.h:891
Represents an attribute applied to a statement.
Definition: Stmt.h:918
ParenExpr - This represents a parethesized expression, e.g.
Definition: Expr.h:1751
NamedDecl * getDecl() const
A CXXOperatorCallExpr record.
Definition: ASTBitCodes.h:1814
helper_expr_const_range assignment_ops() const
bool hasQualifier() const
Determines whether this member expression actually had a C++ nested-name-specifier prior to the name ...
Definition: Expr.h:2610
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies this name, if any.
Definition: StmtCXX.h:276
Expr * getLowerBound()
Get lower bound of array section.
Definition: ExprOpenMP.h:91
This represents &#39;priority&#39; clause in the &#39;#pragma omp ...&#39; directive.
This represents &#39;#pragma omp target teams distribute&#39; combined directive.
Definition: StmtOpenMP.h:3764
helper_expr_const_range lhs_exprs() const
A CXXTemporaryObjectExpr record.
Definition: ASTBitCodes.h:1826
Represents Objective-C&#39;s @throw statement.
Definition: StmtObjC.h:323
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called...
Definition: ExprCXX.h:1382
SourceLocation getLocation() const
Definition: ExprCXX.h:610
const RecordDecl * getCapturedRecordDecl() const
Retrieve the record declaration for captured variables.
Definition: Stmt.h:2243
SourceLocation getRParenLoc() const
Definition: Expr.h:2204
SourceLocation getKeywordLoc() const
Definition: ExprCXX.h:4486
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1292
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:822
TypeSourceInfo * getTypeInfoAsWritten() const
getTypeInfoAsWritten - Returns the type source info for the type that this expression is casting to...
Definition: Expr.h:3057
FPOptions getFPFeatures() const
Definition: Expr.h:3317
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent...
Definition: ExprCXX.h:2507
bool getIsCXXTry() const
Definition: Stmt.h:2066
SourceLocation getLParenLoc() const
Definition: Expr.h:3104
Expr * getCondition() const
Returns condition.
Definition: OpenMPClause.h:367
This represents &#39;update&#39; clause in the &#39;#pragma omp atomic&#39; directive.
Expr * getCondition() const
Returns condition.
Definition: OpenMPClause.h:310
This represents &#39;#pragma omp parallel for&#39; directive.
Definition: StmtOpenMP.h:1520
MS property subscript expression.
Definition: ExprCXX.h:834
SourceLocation getGotoLoc() const
Definition: Stmt.h:1381
SourceLocation getRParenLoc() const
Definition: ExprCXX.h:1896
This represents &#39;#pragma omp target teams distribute parallel for&#39; combined directive.
Definition: StmtOpenMP.h:3832
Expr * getCombinedEnsureUpperBound() const
Definition: StmtOpenMP.h:897
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
Definition: ExprCXX.h:4150
float __ovld __cnfn distance(float p0, float p1)
Returns the distance between p0 and p1.
SourceLocation getAccessorLoc() const
Definition: Expr.h:5013
Expr * getAlignment()
Returns alignment.
Expr * getNumForLoops() const
Return the number of associated for-loops.
Definition: OpenMPClause.h:985
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
Definition: Expr.h:3809
SourceLocation getSecondScheduleModifierLoc() const
Get the second modifier location.
Definition: OpenMPClause.h:897
unsigned getDeclRefExprAbbrev() const
Definition: ASTWriter.h:692
const Expr * getSubExpr() const
Definition: Expr.h:1547
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "while" statement, if any.
Definition: Stmt.cpp:901
SourceLocation getAtLoc() const
Definition: ExprObjC.h:67
SourceLocation getCoawaitLoc() const
Definition: StmtCXX.h:196
Expr * getIndexExpr(unsigned Idx)
Definition: Expr.h:2090
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1724
This represents &#39;#pragma omp target exit data&#39; directive.
Definition: StmtOpenMP.h:2431
Stmt * getSubStmt()
Definition: Stmt.h:843
SourceLocation getDependencyLoc() const
Get dependency type location.
This represents &#39;read&#39; clause in the &#39;#pragma omp atomic&#39; directive.
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprCXX.h:2126
helper_expr_const_range assignment_ops() const
This represents clause &#39;private&#39; in the &#39;#pragma omp ...&#39; directives.
const VarDecl * getNRVOCandidate() const
Retrieve the variable that might be used for the named return value optimization. ...
Definition: Stmt.h:1503
SourceLocation getLParenLoc() const
Definition: Stmt.h:1305
bool hasTemplateKWAndArgsInfo() const
Definition: Expr.h:1108
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:2614
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC &#39;id&#39; type.
Definition: ExprObjC.h:1460
This represents &#39;num_threads&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:384
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:2752
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprCXX.h:742
SourceLocation getOperatorLoc() const
Retrieve the location of the &#39;.&#39; or &#39;->&#39; operator.
Definition: ExprCXX.h:2341
varlist_range varlists()
Definition: OpenMPClause.h:209
SourceLocation getAtLoc() const
Definition: ExprObjC.h:457
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
Definition: ExprCXX.h:2470
This represents &#39;defaultmap&#39; clause in the &#39;#pragma omp ...&#39; directive.
ObjCInterfaceDecl * getClassReceiver() const
Definition: ExprObjC.h:752
Expr * getCombinedUpperBoundVariable() const
Definition: StmtOpenMP.h:891
SourceLocation getColonLoc() const
Definition: Expr.h:3419
bool isArrow() const
Definition: ExprObjC.h:1488
SourceLocation getLeftLoc() const
Definition: ExprObjC.h:1384
SourceLocation getColonLoc() const
Return the location of &#39;:&#39;.
Definition: OpenMPClause.h:307
Expr * getCalcLastIteration() const
Definition: StmtOpenMP.h:773
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition: ExprCXX.h:624
SourceLocation getIfLoc() const
Definition: Stmt.h:1021
unsigned getNumPlacementArgs() const
Definition: ExprCXX.h:2029
TypeSourceInfo * getArgumentTypeInfo() const
Definition: Expr.h:2174
This represents implicit clause &#39;flush&#39; for the &#39;#pragma omp flush&#39; directive.
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
Definition: ExprCXX.h:2897
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range that covers this offsetof node.
Definition: Expr.h:2006
capture_iterator capture_begin()
Retrieve an iterator pointing to the first capture.
Definition: Stmt.h:2268
A CXXConstructExpr record.
Definition: ASTBitCodes.h:1820
unsigned getNumExpressions() const
Definition: Expr.h:2105
SourceLocation getLocation() const
Retrieve the location of the literal.
Definition: Expr.h:1346
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
raw_arg_iterator raw_arg_begin()
Definition: ExprCXX.h:2111
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will call.
Definition: ExprCXX.h:1490
A C++ throw-expression (C++ [except.throw]).
Definition: ExprCXX.h:1028
unsigned getTotalComponentsNum() const
Return the total number of components in all lists derived from the clause.
Expr * getExprOperand() const
Definition: ExprCXX.h:728
Represents an expression – generally a full-expression – that introduces cleanups to be run at the ...
Definition: ExprCXX.h:3092
TypeSourceInfo * getArg(unsigned I) const
Retrieve the Ith argument.
Definition: ExprCXX.h:2473
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprObjC.h:153
SourceLocation getRParenLoc() const
Definition: Expr.h:4911
SourceLocation getLocation() const
Retrieve the location of the literal.
Definition: Expr.h:1387
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "switch" statement, if any.
Definition: Stmt.cpp:867
SourceLocation getLParenLoc() const
Returns the location of &#39;(&#39;.
void AddString(StringRef Str)
Emit a string.
Definition: ASTWriter.h:944
iterator begin() const
Definition: ExprCXX.h:4107
bool isXLHSInRHSPart() const
Return true if helper update expression has form &#39;OpaqueValueExpr(x) binop OpaqueValueExpr(expr)&#39; and...
Definition: StmtOpenMP.h:2228
void AddSourceRange(SourceRange Range)
Emit a source range.
Definition: ASTWriter.h:851
Expr * getGrainsize() const
Return safe iteration space distance.
This represents &#39;nogroup&#39; clause in the &#39;#pragma omp ...&#39; directive.
A ShuffleVectorExpr record.
Definition: ASTBitCodes.h:1719
SourceLocation getBuiltinLoc() const
Definition: Expr.h:3888
This represents &#39;safelen&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:449
ObjCPropertyDecl * getExplicitProperty() const
Definition: ExprObjC.h:688
SourceLocation getLParenLoc() const
Returns the location of &#39;(&#39;.
Definition: OpenMPClause.h:722
A C++ static_cast expression (C++ [expr.static.cast]).
Definition: ExprCXX.h:306
void AddTypeSourceInfo(TypeSourceInfo *TInfo)
Emits a reference to a declarator info.
Definition: ASTWriter.cpp:5460
Expr * getExprOperand() const
Definition: ExprCXX.h:941
const Stmt * getSubStmt() const
Definition: StmtObjC.h:368
SourceLocation getRParenLoc() const
Retrieve the location of the closing parenthesis.
Definition: ExprCXX.h:281
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:875
Represents a C99 designated initializer expression.
Definition: Expr.h:4286
unsigned varlist_size() const
Definition: OpenMPClause.h:206
SourceLocation getAtLoc() const
Definition: ExprObjC.h:508
An OffsetOfExpr record.
Definition: ASTBitCodes.h:1647
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition: Decl.h:297
TypeSourceInfo * getEncodedTypeSourceInfo() const
Definition: ExprObjC.h:419
TypeSourceInfo * getScopeTypeInfo() const
Retrieve the scope type in a qualified pseudo-destructor expression.
Definition: ExprCXX.h:2352
SourceLocation getKeywordLoc() const
Definition: StmtCXX.h:462
SourceLocation getLParenLoc() const
Returns the location of &#39;(&#39;.
Stmt * getBody()
Definition: Stmt.h:1226
An ObjCAtThrowStmt record.
Definition: ASTBitCodes.h:1791
SourceLocation getTildeLoc() const
Retrieve the location of the &#39;~&#39;.
Definition: ExprCXX.h:2359
FieldDecl * getField() const
For a field offsetof node, returns the field.
Definition: Expr.h:1985
SourceLocation getRParenLoc() const
Definition: Expr.h:5404
void AddTypeRef(QualType T)
Emit a reference to a type.
Definition: ASTWriter.h:882
An element in an Objective-C dictionary literal.
Definition: ExprObjC.h:247
A DesignatedInitExpr record.
Definition: ASTBitCodes.h:1686
This represents &#39;#pragma omp parallel&#39; directive.
Definition: StmtOpenMP.h:278
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition: Expr.h:3701
bool cleanupsHaveSideEffects() const
Definition: ExprCXX.h:3135
QualType getComputationResultType() const
Definition: Expr.h:3377
SourceLocation getColonLoc() const
Gets location of &#39;:&#39; symbol in clause.
SourceLocation getRParen() const
Get the location of the right parentheses &#39;)&#39;.
Definition: Expr.h:1781
This represents &#39;simd&#39; clause in the &#39;#pragma omp ...&#39; directive.
bool isFileScope() const
Definition: Expr.h:2782
SourceLocation getAmpAmpLoc() const
Definition: Expr.h:3622
Expr * getEnsureUpperBound() const
Definition: StmtOpenMP.h:829
SourceLocation getEndLoc() const
Definition: Stmt.h:529
Represents a member of a struct/union/class.
Definition: Decl.h:2534
This represents clause &#39;lastprivate&#39; in the &#39;#pragma omp ...&#39; directives.
Expr * getBase()
Retrieve the base object of this member expressions, e.g., the x in x.m.
Definition: ExprCXX.h:3607
Represents a place-holder for an object not to be initialized by anything.
Definition: Expr.h:4584
NonTypeTemplateParmDecl * getParameter() const
Definition: ExprCXX.h:3982
SourceLocation getLParenLoc() const
Returns the location of &#39;(&#39;.
Definition: OpenMPClause.h:589
StringLiteral * getString()
Definition: ExprObjC.h:63
unsigned getArrayExprIndex() const
For an array element node, returns the index into the array of expressions.
Definition: Expr.h:1979
const Expr * getRetValue() const
Definition: Stmt.cpp:928
Expr * getInc() const
Definition: StmtOpenMP.h:789
SourceLocation getLabelLoc() const
Definition: Expr.h:3624
Expr * getChunkSize()
Get chunk size.
SourceLocation getRBraceLoc() const
Definition: Expr.h:4197
SourceLocation getOperatorLoc() const
Definition: Expr.h:2201
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Definition: Expr.h:3918
ArrayRef< Expr * > updates()
Definition: StmtOpenMP.h:957
This represents clause &#39;map&#39; in the &#39;#pragma omp ...&#39; directives.
SourceLocation getRParenLoc() const
Definition: Expr.h:3107
SourceLocation getDefaultKindKwLoc() const
Returns location of clause kind.
Definition: OpenMPClause.h:658
The iterator over UnresolvedSets.
Definition: UnresolvedSet.h:32
This represents clause &#39;to&#39; in the &#39;#pragma omp ...&#39; directives.
This represents &#39;#pragma omp target simd&#39; directive.
Definition: StmtOpenMP.h:3352
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
Definition: Expr.h:936
Represents a C++ member access expression for which lookup produced a set of overloaded functions...
Definition: ExprCXX.h:3539
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:4988
const DeclGroupRef getDeclGroup() const
Definition: Stmt.h:523
OpenMPDirectiveKind getDirectiveKind() const
Definition: StmtOpenMP.h:246
Expr * getSafelen() const
Return safe iteration space distance.
Definition: OpenMPClause.h:483
bool isAllEnumCasesCovered() const
Returns true if the SwitchStmt is a switch of an enum value and all cases have been explicitly covere...
Definition: Stmt.h:1126
Expr * getSubExpr()
Definition: Expr.h:2892
This represents &#39;#pragma omp barrier&#39; directive.
Definition: StmtOpenMP.h:1851
SourceLocation getQuestionLoc() const
Definition: Expr.h:3418
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp, [NSNumber numberWithInt:42]];.
Definition: ExprObjC.h:177
This is a common base class for loop directives (&#39;omp simd&#39;, &#39;omp for&#39;, &#39;omp for simd&#39; etc...
Definition: StmtOpenMP.h:340
Expr * getNumTeams()
Return NumTeams number.
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition: ExprCXX.h:4004
This represents &#39;#pragma omp critical&#39; directive.
Definition: StmtOpenMP.h:1446
OpenMPDirectiveKind getCancelRegion() const
Get cancellation region for the current cancellation point.
Definition: StmtOpenMP.h:2730
bool hadArrayRangeDesignator() const
Definition: Expr.h:4218
SourceLocation getCatchLoc() const
Definition: StmtCXX.h:51
Selector getSelector() const
Definition: ExprObjC.h:454
void AddIdentifierRef(const IdentifierInfo *II)
Emit a reference to an identifier.
Definition: ASTWriter.h:865
Represents Objective-C&#39;s @catch statement.
Definition: StmtObjC.h:76
SourceLocation getOpLoc() const
Definition: ExprObjC.h:582
This represents clause &#39;copyprivate&#39; in the &#39;#pragma omp ...&#39; directives.
IndirectGotoStmt - This represents an indirect goto.
Definition: Stmt.h:1365
Describes an C or C++ initializer list.
Definition: Expr.h:4050
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition: ExprCXX.h:671
This represents &#39;#pragma omp distribute parallel for&#39; composite directive.
Definition: StmtOpenMP.h:3067
bool isArrow() const
Definition: ExprObjC.h:567
ArrayRef< Stmt const * > getParamMoves() const
Definition: StmtCXX.h:407
This represents &#39;#pragma omp teams distribute parallel for simd&#39; composite directive.
Definition: StmtOpenMP.h:3556
Expr * getKeyExpr() const
Definition: ExprObjC.h:872
ASTWriter::RecordDataImpl & getRecordData() const
Extract the underlying record storage.
Definition: ASTWriter.h:790
unsigned getNumExpansions() const
Get the number of parameters in this parameter pack.
Definition: ExprCXX.h:4111
ForStmt - This represents a &#39;for (init;cond;inc)&#39; stmt.
Definition: Stmt.h:1256
ArrayRef< Expr * > finals()
Definition: StmtOpenMP.h:963
void append(InputIterator begin, InputIterator end)
Definition: ASTWriter.h:796
Expr * getIsLastIterVariable() const
Definition: StmtOpenMP.h:797
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
FunctionDecl * getOperatorDelete() const
Definition: ExprCXX.h:2197
Expr * getBaseExpr() const
Definition: ExprObjC.h:869
TemplateArgument getArgumentPack() const
Retrieve the template argument pack containing the substituted template arguments.
Definition: ExprCXX.cpp:1357
bool isElidable() const
Whether this construction is elidable.
Definition: ExprCXX.h:1361
Expr * getOperand() const
Definition: ExprCXX.h:3721
unsigned getIntegerLiteralAbbrev() const
Definition: ASTWriter.h:694
const Expr * getThrowExpr() const
Definition: StmtObjC.h:335
SourceLocation getDefaultmapKindLoc()
Get kind location.
bool isGlobalNew() const
Definition: ExprCXX.h:2047
SourceLocation getParameterPackLocation() const
Retrieve the location of the parameter pack name.
Definition: ExprCXX.h:4035
uint32_t Offset
Definition: CacheTokens.cpp:43
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
Definition: ExprCXX.h:2193
LabelDecl * getDecl() const
Definition: Stmt.h:892
Expr * getX()
Get &#39;x&#39; part of the associated expression/statement.
Definition: StmtOpenMP.h:2212
APFloatSemantics getRawSemantics() const
Get a raw enumeration value representing the floating-point semantics of this literal (32-bit IEEE...
Definition: Expr.h:1485
SourceLocation getLBracLoc() const
Definition: Stmt.h:708
A reference to a previously [de]serialized Stmt record.
Definition: ASTBitCodes.h:1554
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
Definition: ExprCXX.h:1794
SourceLocation getRParenLoc() const
Definition: StmtCXX.h:198
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
Definition: Expr.h:405
path_iterator path_begin()
Definition: Expr.h:2916
SourceLocation getIsaMemberLoc() const
getMemberLoc - Return the location of the "member", in X->F, it is the location of &#39;F&#39;...
Definition: ExprObjC.h:1493
const Stmt * getPreInitStmt() const
Get pre-initialization statement for the clause.
Definition: OpenMPClause.h:123
Stmt * getBody()
Definition: Stmt.h:1291
semantics_iterator semantics_end()
Definition: Expr.h:5251
Expr * getIterationVariable() const
Definition: StmtOpenMP.h:765
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3143
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:3131
SourceLocation getColonLoc() const
Gets location of &#39;:&#39; symbol in clause.
bool constructsVBase() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
Definition: ExprCXX.h:1494
const Expr * getAssocExpr(unsigned i) const
Definition: Expr.h:4913
Stmt * getInit()
Definition: Stmt.h:1270
Expr * getOutputExpr(unsigned i)
Definition: Stmt.cpp:421
SourceLocation getLocStart() const LLVM_READONLY
Returns starting location of directive kind.
Definition: StmtOpenMP.h:168
iterator begin()
Definition: DeclGroup.h:100
bool hadMultipleCandidates() const
Returns true if this member expression refers to a method that was resolved from an overloaded set ha...
Definition: Expr.h:2717
unsigned getCharacterLiteralAbbrev() const
Definition: ASTWriter.h:693
SourceLocation getThrowLoc() const
Definition: ExprCXX.h:1053
unsigned getResultExprIndex() const
Return the index of the result-bearing expression into the semantics expressions, or PseudoObjectExpr...
Definition: Expr.h:5226
const StringLiteral * getInputConstraintLiteral(unsigned i) const
Definition: Stmt.h:1810
CXXForRangeStmt - This represents C++0x [stmt.ranged]&#39;s ranged for statement, represented as &#39;for (ra...
Definition: StmtCXX.h:130
bool isArrow() const
Definition: Expr.h:2695
Class that handles post-update expression for some clauses, like &#39;lastprivate&#39;, &#39;reduction&#39; etc...
Definition: OpenMPClause.h:137
This represents &#39;#pragma omp cancellation point&#39; directive.
Definition: StmtOpenMP.h:2686
This represents &#39;default&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:608
ObjCStringLiteral, used for Objective-C string literals i.e.
Definition: ExprObjC.h:51
SourceLocation getEqualOrColonLoc() const
Retrieve the location of the &#39;=&#39; that precedes the initializer value itself, if present.
Definition: Expr.h:4513
const CallExpr * getConfig() const
Definition: ExprCXX.h:218
bool isArrow() const
Definition: ExprCXX.h:818
FPOptions getFPFeatures() const
Definition: ExprCXX.h:149
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
Definition: Expr.h:5444
This represents &#39;final&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:332
This represents &#39;mergeable&#39; clause in the &#39;#pragma omp ...&#39; directive.
Expr * getCond()
Definition: Stmt.h:1289
SourceLocation getContinueLoc() const
Definition: Stmt.h:1419
This represents &#39;#pragma omp teams&#39; directive.
Definition: StmtOpenMP.h:2629
unsigned getInt() const
Used to serialize this.
Definition: LangOptions.h:293
Expr * getInit() const
Definition: StmtOpenMP.h:785
OpenMPDependClauseKind getDependencyKind() const
Get dependency type.
const Expr * getControllingExpr() const
Definition: Expr.h:4938
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:2827
This represents clause &#39;reduction&#39; in the &#39;#pragma omp ...&#39; directives.
FieldDecl * getField()
Get the field whose initializer will be used.
Definition: ExprCXX.h:1184
Helper class for OffsetOfExpr.
Definition: Expr.h:1921
A marker record that indicates that we are at the end of an expression.
Definition: ASTBitCodes.h:1548
This represents &#39;#pragma omp teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:3486
Represents binding an expression to a temporary.
Definition: ExprCXX.h:1245
StringLiteral * getClobberStringLiteral(unsigned i)
Definition: Stmt.h:1844
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
Definition: ExprCXX.h:4386
Expr * Key
The key for the dictionary element.
Definition: ExprObjC.h:249
SourceLocation getBuiltinLoc() const
Definition: Expr.h:3983
CXXTemporary * getTemporary()
Definition: ExprCXX.h:1264
bool isOpenMPWorksharingDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a worksharing directive.
ObjCMethodDecl * getArrayWithObjectsMethod() const
Definition: ExprObjC.h:230
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition: ExprCXX.h:1649
SourceLocation getDefaultmapModifierLoc() const
Get the modifier location.
NestedNameSpecifierLoc getQualifierLoc() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name, with source-location information.
Definition: Expr.h:1080
bool isTypeDependent() const
isTypeDependent - Determines whether this expression is type-dependent (C++ [temp.dep.expr]), which means that its type could change from one template instantiation to the next.
Definition: Expr.h:167
helper_expr_const_range source_exprs() const
SourceLocation getTryLoc() const
Definition: Stmt.h:2063
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3300
This represents clause &#39;is_device_ptr&#39; in the &#39;#pragma omp ...&#39; directives.
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "for" statement, if any.
Definition: Stmt.cpp:839
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
Definition: Expr.h:1836
unsigned getUniqueDeclarationsNum() const
Return the number of unique base declarations in this clause.
SourceLocation getNameLoc() const
Definition: ExprCXX.h:3974
TypeSourceInfo * getTypeSourceInfo() const
Definition: ExprCXX.h:1892
NameKind getNameKind() const
getNameKind - Determine what kind of name this is.
SourceLocation getLocation() const
Definition: ExprObjC.h:104
helper_expr_const_range source_exprs() const
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1087
Stmt * getInit()
Definition: Stmt.h:1007
bool isExact() const
Definition: Expr.h:1501
bool isTypeOperand() const
Definition: ExprCXX.h:924
SourceLocation getTokenLocation() const
getTokenLocation - The location of the __null token.
Definition: Expr.h:3932
Iterator for iterating over Stmt * arrays that contain only Expr *.
Definition: Stmt.h:345
helper_expr_const_range privates() const
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:3420
private_copies_range private_copies()
This represents clause &#39;from&#39; in the &#39;#pragma omp ...&#39; directives.
Represents the this expression in C++.
Definition: ExprCXX.h:986
ObjCMethodDecl * getDictWithObjectsMethod() const
Definition: ExprObjC.h:366
arg_iterator arg_end()
Definition: Expr.h:2416
ObjCIvarDecl * getDecl()
Definition: ExprObjC.h:559
SourceLocation getLParenLoc() const
Returns the location of &#39;(&#39;.
Definition: OpenMPClause.h:225
SourceLocation getRParenLoc() const
Retrieve the location of the right parentheses (&#39;)&#39;) that follows the argument list.
Definition: ExprCXX.h:3234
TypeSourceInfo * getAllocatedTypeSourceInfo() const
Definition: ExprCXX.h:1994
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
Definition: TemplateBase.h:644
NestedNameSpecifierLoc getQualifierLoc() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name...
Definition: Expr.h:2615
TypeSourceInfo * getQueriedTypeSourceInfo() const
Definition: ExprCXX.h:2556
bool isArrayForm() const
Definition: ExprCXX.h:2186
unsigned RecordSwitchCaseID(SwitchCase *S)
Record an ID for the given switch-case statement.
const ObjCAtCatchStmt * getCatchStmt(unsigned I) const
Retrieve a @catch statement.
Definition: StmtObjC.h:212
SourceLocation getOperatorLoc() const LLVM_READONLY
Definition: Expr.h:2693
helper_expr_const_range reduction_ops() const
This represents &#39;#pragma omp target parallel for simd&#39; directive.
Definition: StmtOpenMP.h:3284
ArrayRef< Expr * > private_counters()
Definition: StmtOpenMP.h:945
OpenMP 4.0 [2.4, Array Sections].
Definition: ExprOpenMP.h:45
ConditionalOperator - The ?: ternary operator.
Definition: Expr.h:3429
const ValueDecl * getExtendingDecl() const
Get the declaration which triggered the lifetime-extension of this temporary, if any.
Definition: ExprCXX.h:4213
TypeSourceInfo * getTypeSourceInfo() const
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:1377
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition: ExprCXX.h:2275
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
Definition: ExprCXX.h:3677
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:616
OpenMPDefaultClauseKind getDefaultKind() const
Returns kind of the clause.
Definition: OpenMPClause.h:655
unsigned NumTemplateArgs
The number of template arguments in TemplateArgs.
Definition: TemplateBase.h:658
SourceLocation getRBracket() const
Definition: ExprObjC.h:858
bool isMicrosoftABI() const
Returns whether this is really a Win64 ABI va_arg expression.
Definition: Expr.h:3977
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1329
This represents &#39;threads&#39; clause in the &#39;#pragma omp ...&#39; directive.
void AddDeclarationNameLoc(const DeclarationNameLoc &DNLoc, DeclarationName Name)
Definition: ASTWriter.cpp:5667
Expr ** getSubExprs()
Definition: Expr.h:5380
CompoundStmt * getSubStmt() const
Retrieve the compound statement that will be included in the program only if the existence of the sym...
Definition: StmtCXX.h:284
This represents &#39;#pragma omp taskgroup&#39; directive.
Definition: StmtOpenMP.h:1939
helper_expr_const_range destination_exprs() const
Expr * getSimdlen() const
Return safe iteration space distance.
Definition: OpenMPClause.h:537
void AddCXXTemporary(const CXXTemporary *Temp)
Emit a CXXTemporary.
Definition: ASTWriter.cpp:5415
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
Definition: ExprCXX.h:1355
helper_expr_const_range source_exprs() const
QualType getComputationLHSType() const
Definition: Expr.h:3374
This represents clause &#39;aligned&#39; in the &#39;#pragma omp ...&#39; directives.
OpenMPClauseKind getClauseKind() const
Returns kind of OpenMP clause (private, shared, reduction, etc.).
Definition: OpenMPClause.h:81
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprObjC.h:207
SourceLocation getRParenLoc() const
Definition: ExprObjC.h:458
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
Definition: Expr.h:2134
SourceLocation getTryLoc() const
Definition: StmtCXX.h:95
bool isConstexpr() const
Definition: Stmt.h:1026
Expr * getCombinedLowerBoundVariable() const
Definition: StmtOpenMP.h:885
helper_expr_const_range private_copies() const
SourceLocation getLocation() const
Definition: ExprCXX.h:1357
SourceLocation getRBracketLoc() const
Definition: ExprCXX.h:874
This represents clause &#39;task_reduction&#39; in the &#39;#pragma omp taskgroup&#39; directives.
SourceLocation getLocation() const
Definition: Expr.h:1067
unsigned getSwitchCaseID(SwitchCase *S)
Retrieve the ID for the given switch-case statement.
InitListExpr * getUpdater() const
Definition: Expr.h:4646
SourceLocation getLParenLoc() const
Returns the location of &#39;(&#39;.
Represents a call to the builtin function __builtin_va_arg.
Definition: Expr.h:3954
bool HasTemplateKWAndArgsInfo
Whether the name includes info for explicit template keyword and arguments.
Definition: ExprCXX.h:2654
helper_expr_const_range destination_exprs() const
OpenMPProcBindClauseKind getProcBindKind() const
Returns kind of the clause.
Definition: OpenMPClause.h:725
SourceLocation getLabelLoc() const
Definition: Stmt.h:1346
unsigned getNumLoops() const
Get number of loops associated with the clause.
SourceLocation getThrowLoc() const LLVM_READONLY
Definition: StmtObjC.h:339
static unsigned getNumSubExprs(AtomicOp Op)
Determine the number of arguments the specified atomic builtin should have.
Definition: Expr.cpp:4098
unsigned getValue() const
Definition: Expr.h:1442
This represents &#39;#pragma omp distribute&#39; directive.
Definition: StmtOpenMP.h:2940
This represents implicit clause &#39;depend&#39; for the &#39;#pragma omp task&#39; directive.
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition: Expr.h:5125
SourceLocation getDestroyedTypeLoc() const
Retrieve the starting location of the type being destroyed.
Definition: ExprCXX.h:2383
ObjCMethodDecl * getBoxingMethod() const
Definition: ExprObjC.h:142
const_all_num_lists_range all_num_lists() const
SourceLocation getFinallyLoc() const
Definition: Stmt.h:2023
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type...
Definition: ExprCXX.h:1873
const Stmt * getAssociatedStmt() const
Returns statement associated with the directive.
Definition: StmtOpenMP.h:198
SourceLocation getOperatorLoc() const
Retrieve the location of the &#39;->&#39; or &#39;.&#39; operator.
Definition: ExprCXX.h:3627
Expr * getCond() const
Definition: Expr.h:3463
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1583
llvm::MutableArrayRef< Designator > designators()
Definition: Expr.h:4491
This represents &#39;proc_bind&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:677
This represents &#39;capture&#39; clause in the &#39;#pragma omp atomic&#39; directive.
DeclAccessPair getFoundDecl() const
Retrieves the declaration found by lookup.
Definition: Expr.h:2600
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:3690
Expr - This represents one expression.
Definition: Expr.h:106
SourceLocation getElseLoc() const
Definition: Stmt.h:1023
DeclStmt * getEndStmt()
Definition: StmtCXX.h:160
SourceLocation End
IdentifierInfo * getFieldName() const
For a field or identifier offsetof node, returns the name of the field.
Definition: Expr.cpp:1426
CXXBaseSpecifier * getBase() const
For a base class node, returns the base specifier.
Definition: Expr.h:1995
SourceLocation getMapLoc() const LLVM_READONLY
Fetches location of clause mapping kind.
bool isArrow() const
Determine whether this member expression used the &#39;->&#39; operator; otherwise, it used the &#39;...
Definition: ExprCXX.h:3624
StringRef getClobber(unsigned i) const
Definition: Stmt.h:1941
This represents &#39;simdlen&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:503
Expr * getNumTasks() const
Return safe iteration space distance.
SourceLocation getScheduleKindLoc()
Get kind location.
Definition: OpenMPClause.h:889
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:1257
SourceLocation getWhileLoc() const
Definition: Stmt.h:1183
unsigned getPackLength() const
Retrieve the length of the parameter pack.
Definition: ExprCXX.h:3907
Represents a C++ functional cast expression that builds a temporary object.
Definition: ExprCXX.h:1597
const Stmt * getThen() const
Definition: Stmt.h:1012
SourceLocation getLParenLoc() const
Returns the location of &#39;(&#39;.
A C++ const_cast expression (C++ [expr.const.cast]).
Definition: ExprCXX.h:439
const TypeSourceInfo * getAssocTypeSourceInfo(unsigned i) const
Definition: Expr.h:4923
SourceLocation getLocation() const
Definition: ExprCXX.h:1002
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:5051
Field designator where only the field name is known.
Definition: ASTBitCodes.h:1972
VarDecl * getExceptionDecl() const
Definition: StmtCXX.h:52
IdentifierInfo * getDestroyedTypeIdentifier() const
In a dependent pseudo-destructor expression for which we do not have full type information on the des...
Definition: ExprCXX.h:2375
unsigned getNumInits() const
Definition: Expr.h:4080
bool isImplicitAccess() const
True if this is an implicit access, i.e.
Definition: ExprCXX.cpp:1204
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1133
This represents &#39;#pragma omp target teams distribute parallel for simd&#39; combined directive.
Definition: StmtOpenMP.h:3916
const Expr * getCallee() const
Definition: Expr.h:2356
raw_arg_iterator raw_arg_end()
Definition: ExprCXX.h:2112
bool isArrow() const
Determine whether this pseudo-destructor expression was written using an &#39;->&#39; (otherwise, it used a &#39;.
Definition: ExprCXX.h:2338
Stmt * getBody()
Definition: Stmt.h:1179
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
Definition: ExprObjC.h:296
const CompoundStmt * getSynchBody() const
Definition: StmtObjC.h:290
Expr * getRHS()
Definition: Stmt.h:792
bool hasQualifier() const
Determine whether this declaration reference was preceded by a C++ nested-name-specifier, e.g., N::foo.
Definition: Expr.h:1076
Represents Objective-C&#39;s @synchronized statement.
Definition: StmtObjC.h:270
ObjCSelectorExpr used for @selector in Objective-C.
Definition: ExprObjC.h:441
A CXXStdInitializerListExpr record.
Definition: ASTBitCodes.h:1847
TypeSourceInfo * getTypeSourceInfo() const
Definition: Expr.h:2069
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:3830
SourceLocation getRBracketLoc() const
Definition: ExprOpenMP.h:114
CXXTryStmt - A C++ try block, including all handlers.
Definition: StmtCXX.h:67
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Definition: Expr.h:5102
OpenMPDistScheduleClauseKind getDistScheduleKind() const
Get kind of the clause.
An ArraySubscriptExpr record.
Definition: ASTBitCodes.h:1653
SourceLocation getAtTryLoc() const
Retrieve the location of the @ in the @try.
Definition: StmtObjC.h:199
OMPClauseWriter(ASTRecordWriter &Record)
bool refersToEnclosingVariableOrCapture() const
Does this DeclRefExpr refer to an enclosing local or a captured variable?
Definition: Expr.h:1185
IdentifierInfo & getAccessor() const
Definition: Expr.h:5010
This represents &#39;#pragma omp target teams distribute simd&#39; combined directive.
Definition: StmtOpenMP.h:3989
helper_expr_const_range rhs_exprs() const
ArrayTypeTrait getTrait() const
Definition: ExprCXX.h:2552
decls_iterator decls_begin() const
Definition: ExprCXX.h:2728
This represents &#39;ordered&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:927
unsigned size() const
Definition: Stmt.h:642
unsigned getNumClauses() const
Get number of clauses.
Definition: StmtOpenMP.h:186
An ArrayInitLoopExpr record.
Definition: ASTBitCodes.h:1695
Expr * getDistInc() const
Definition: StmtOpenMP.h:873
A PseudoObjectExpr record.
Definition: ASTBitCodes.h:1731
SourceRange getAngleBrackets() const LLVM_READONLY
Definition: ExprCXX.h:287
Expr * getNextLowerBound() const
Definition: StmtOpenMP.h:837
Kind getKind() const
Determine what kind of offsetof node this is.
Definition: Expr.h:1975
SourceLocation getLAngleLoc() const
Retrieve the location of the left angle bracket starting the explicit template argument list followin...
Definition: Expr.h:2638
QualType getType() const
Definition: Expr.h:128
SourceLocation getColonLoc() const
Get colon location.
Expr * getPrevEnsureUpperBound() const
Definition: StmtOpenMP.h:879
SourceLocation getKeywordLoc() const
Retrieve the location of the __if_exists or __if_not_exists keyword.
Definition: StmtCXX.h:266
capture_init_range capture_inits()
Definition: Stmt.h:2290
This represents &#39;#pragma omp for&#39; directive.
Definition: StmtOpenMP.h:1072
An ObjCIndirectCopyRestoreExpr record.
Definition: ASTBitCodes.h:1773
Expr * getElement(unsigned Index)
getElement - Return the Element at the specified index.
Definition: ExprObjC.h:221
Optional< unsigned > NumExpansions
The number of elements this pack expansion will expand to, if this is a pack expansion and is known...
Definition: ExprObjC.h:259
SourceLocation getSwitchLoc() const
Definition: Stmt.h:1105
LabelDecl * getLabel() const
Definition: Stmt.h:1341
const Stmt * getTryBody() const
Retrieve the @try body.
Definition: StmtObjC.h:203
Represents a folding of a pack over an operator.
Definition: ExprCXX.h:4262
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
Definition: Stmt.h:1476
This represents &#39;#pragma omp target teams&#39; directive.
Definition: StmtOpenMP.h:3705
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
Definition: Expr.h:5131
An expression that sends a message to the given Objective-C object or class.
Definition: ExprObjC.h:925
void AddDeclRef(const Decl *D)
Emit a reference to a declaration.
Definition: ASTWriter.h:904
This represents a Microsoft inline-assembly statement extension.
Definition: Stmt.h:1860
SourceLocation getDoLoc() const
Definition: Stmt.h:1230
SourceLocation getAtLoc() const
Definition: StmtObjC.h:379
ObjCMethodDecl * getImplicitPropertyGetter() const
Definition: ExprObjC.h:693
A DesignatedInitUpdateExpr record.
Definition: ASTBitCodes.h:1689
SourceLocation getRBracketLoc() const
Definition: Expr.h:2290
void AddStmt(Stmt *S)
Add the given statement or expression to the queue of statements to emit.
Definition: ASTWriter.h:837
SourceLocation getEnd() const
UnaryOperator - This represents the unary-expression&#39;s (except sizeof and alignof), the postinc/postdec operators from postfix-expression, and various extensions.
Definition: Expr.h:1805
Expr * getInputExpr(unsigned i)
Definition: Stmt.cpp:707
Expr * getOutputExpr(unsigned i)
Definition: Stmt.cpp:703
bool isOpenMPTaskLoopDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a taskloop directive.
void AddSelectorRef(Selector S)
Emit a Selector (which is a smart pointer reference).
Definition: ASTWriter.cpp:5392
SourceLocation getMemberLoc() const
getMemberLoc - Return the location of the "member", in X->F, it is the location of &#39;F&#39;...
Definition: Expr.h:2700
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
Definition: ExprObjC.h:1209
bool usesGNUSyntax() const
Determines whether this designated initializer used the deprecated GNU syntax for designated initiali...
Definition: Expr.h:4518
AtomicOp getOp() const
Definition: Expr.h:5377
A member reference to an MSPropertyDecl.
Definition: ExprCXX.h:763
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition: ExprCXX.h:3946
const OffsetOfNode & getComponent(unsigned Idx) const
Definition: Expr.h:2076
Expr * getDevice()
Return device number.
This represents &#39;#pragma omp cancel&#39; directive.
Definition: StmtOpenMP.h:2744
This represents &#39;collapse&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:557
Expr * getTrueExpr() const
getTrueExpr - Return the subexpression which will be evaluated if the condition evaluates to true; th...
Definition: Expr.h:3556
This represents clause &#39;firstprivate&#39; in the &#39;#pragma omp ...&#39; directives.
SourceLocation getCommaLoc()
Get location of &#39;,&#39;.
ValueDecl * getDecl()
Definition: Expr.h:1059
An ObjCAvailabilityCheckExpr record.
Definition: ASTBitCodes.h:1800
SourceLocation getLocation() const
Definition: Expr.h:1238
SourceLocation getRParenLoc() const
Definition: Expr.h:3986
SourceLocation getForLoc() const
Definition: StmtObjC.h:53
const Expr * getSubExpr() const
Definition: Expr.h:1767
ObjCBridgeCastKind getBridgeKind() const
Determine which kind of bridge is being performed via this cast.
Definition: ExprObjC.h:1634
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprCXX.h:958
ParmVarDecl *const * iterator
Iterators over the parameters which the parameter pack expanded into.
Definition: ExprCXX.h:4106
const Expr * getSubExpr() const
Definition: ExprCXX.h:1268
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr.cast]), which uses the syntax (Type)expr.
Definition: Expr.h:3073
Expr * getLHS()
An array access can be written A[4] or 4[A] (both are equivalent).
Definition: Expr.h:2259
bool getValue() const
Definition: ExprCXX.h:569
bool hadMultipleCandidates() const
Returns true if this expression refers to a function that was resolved from an overloaded set having ...
Definition: Expr.h:1173
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1...
Definition: Expr.h:1535
This represents &#39;#pragma omp flush&#39; directive.
Definition: StmtOpenMP.h:2012
An ObjCForCollectionStmt record.
Definition: ASTBitCodes.h:1776
This represents &#39;#pragma omp parallel for simd&#39; directive.
Definition: StmtOpenMP.h:1600
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
Definition: Expr.h:412
DoStmt - This represents a &#39;do/while&#39; stmt.
Definition: Stmt.h:1205
ArrayRef< Expr * > getLoopNumIterations() const
Get number of iterations for all the loops.
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
Definition: Stmt.h:1526
This represents &#39;seq_cst&#39; clause in the &#39;#pragma omp atomic&#39; directive.
SourceLocation getOperatorLoc() const
Retrieve the location of the &#39;->&#39; or &#39;.&#39; operator.
Definition: ExprCXX.h:3397
helper_expr_const_range assignment_ops() const
This represents &#39;untied&#39; clause in the &#39;#pragma omp ...&#39; directive.
SourceLocation getLParenLoc() const
Retrieve the location of the left parentheses (&#39;(&#39;) that precedes the argument list.
Definition: ExprCXX.h:3229
A MS-style AsmStmt record.
Definition: ASTBitCodes.h:1614
void push_back(uint64_t N)
Minimal vector-like interface.
Definition: ASTWriter.h:794
Expr * getLastIteration() const
Definition: StmtOpenMP.h:769
bool isPostfixUpdate() const
Return true if &#39;v&#39; expression must be updated to original value of &#39;x&#39;, false if &#39;v&#39; must be updated ...
Definition: StmtOpenMP.h:2231
Expr * getArgument()
Definition: ExprCXX.h:2199
This represents &#39;#pragma omp target enter data&#39; directive.
Definition: StmtOpenMP.h:2372
SourceLocation getLParenLoc()
Get location of &#39;(&#39;.
Definition: OpenMPClause.h:886
Expr * getStrideVariable() const
Definition: StmtOpenMP.h:821
SourceLocation getColonLoc() const
Returns the location of &#39;:&#39;.
This represents &#39;num_teams&#39; clause in the &#39;#pragma omp ...&#39; directive.
bool getValue() const
Definition: ExprCXX.h:3729
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Definition: ExprCXX.h:347
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
Definition: Expr.h:875
Expr * getBase() const
Definition: Expr.h:4643
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition: Expr.h:3771
unsigned getNumArgs() const
Return the number of actual arguments in this message, not counting the receiver. ...
Definition: ExprObjC.h:1350
const Stmt * getPreInits() const
Definition: StmtOpenMP.h:793
#define false
Definition: stdbool.h:33
SourceLocation getLParenLoc() const
Definition: Expr.h:2785
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr...
Definition: ExprCXX.h:2636
A field in a dependent type, known only by its name.
Definition: Expr.h:1930
This captures a statement into a function.
Definition: Stmt.h:2125
Represents a call to an inherited base class constructor from an inheriting constructor.
Definition: ExprCXX.h:1455
ExpressionTrait getTrait() const
Definition: ExprCXX.h:2618
unsigned path_size() const
Definition: Expr.h:2911
Token * getAsmToks()
Definition: Stmt.h:1891
SourceLocation getLParenLoc()
Get location of &#39;(&#39;.
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition: Expr.h:5177
bool isImplicitProperty() const
Definition: ExprObjC.h:685
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on a template...
Definition: Expr.h:191
helper_expr_const_range taskgroup_descriptors() const
unsigned getTotalComponentListNum() const
Return the number of lists derived from the clause expressions.
bool inheritedFromVBase() const
Determine whether the inherited constructor is inherited from a virtual base of the object we constru...
Definition: ExprCXX.h:1504
SourceLocation getRAngleLoc() const
Retrieve the location of the right angle bracket ending the explicit template argument list following...
Definition: Expr.h:2645
This represents &#39;#pragma omp single&#39; directive.
Definition: StmtOpenMP.h:1344
Encodes a location in the source.
body_range body()
Definition: Stmt.h:647
This represents &#39;hint&#39; clause in the &#39;#pragma omp ...&#39; directive.
StringRef getOutputConstraint(unsigned i) const
Definition: Stmt.h:1901
SourceLocation getOperatorLoc() const
Definition: Expr.h:3181
const Stmt * getCatchBody() const
Definition: StmtObjC.h:92
unsigned getNumHandlers() const
Definition: StmtCXX.h:107
Expr * getSubExpr() const
Definition: Expr.h:1832
NestedNameSpecifierLoc getQualifierLoc() const
Retrieves the nested-name-specifier that qualifies the type name, with source-location information...
Definition: ExprCXX.h:2327
This is a basic class for representing single OpenMP executable directive.
Definition: StmtOpenMP.h:33
SourceLocation getBuiltinLoc() const
getBuiltinLoc - Return the location of the __builtin_astype token.
Definition: Expr.h:5128
bool hasUnresolvedUsing() const
Determine whether the lookup results contain an unresolved using declaration.
Definition: ExprCXX.h:3620
CastKind getCastKind() const
Definition: Expr.h:2886
Expr * getSubExpr(unsigned Idx) const
Definition: Expr.h:4536
private_copies_range private_copies()
const SwitchCase * getSwitchCaseList() const
Definition: Stmt.h:1094
SourceLocation getOperatorLoc() const
Retrieve the location of the cast operator keyword, e.g., static_cast.
Definition: ExprCXX.h:278
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
Definition: ExprCXX.h:1915
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c dictionary literal.
Definition: ExprObjC.h:350
OMPClause * getClause(unsigned i) const
Returns specified clause.
Definition: StmtOpenMP.h:192
Expr * getLHS()
Definition: Stmt.h:791
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit...
Definition: ExprCXX.h:481
ArrayRef< const Attr * > getAttrs() const
Definition: Stmt.h:952
This represents &#39;schedule&#39; clause in the &#39;#pragma omp ...&#39; directive.
Definition: OpenMPClause.h:746
SourceLocation getEllipsisLoc() const
Retrieve the location of the ellipsis that describes this pack expansion.
Definition: ExprCXX.h:3792
Expr * getExpr()
Get &#39;expr&#39; part of the associated expression/statement.
Definition: StmtOpenMP.h:2238
Represents a call to a member function that may be written either with member call syntax (e...
Definition: ExprCXX.h:166
SourceLocation getExceptLoc() const
Definition: Stmt.h:1984
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprObjC.h:374
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
Definition: Stmt.h:503
SourceLocation getLParenLoc() const
Returns the location of &#39;(&#39;.
This represents clause &#39;shared&#39; in the &#39;#pragma omp ...&#39; directives.
SourceLocation getProcBindKindKwLoc() const
Returns location of clause kind.
Definition: OpenMPClause.h:728
DeclarationNameInfo getDirectiveName() const
Return name of the directive.
Definition: StmtOpenMP.h:1504
SourceLocation getLBraceLoc() const
Definition: Stmt.h:1883
A CXXFunctionalCastExpr record.
Definition: ASTBitCodes.h:1841
SourceLocation getStrTokenLoc(unsigned TokNum) const
Definition: Expr.h:1703
Expr * getPriority()
Return Priority number.
StmtVisitor - This class implements a simple visitor for Stmt subclasses.
Definition: StmtVisitor.h:186
bool canOverflow() const
Returns true if the unary operator can cause an overflow.
Definition: Expr.h:1845
SourceLocation getColonLoc() const
Definition: ExprOpenMP.h:111
SourceLocation RAngleLoc
The source location of the right angle bracket (&#39;>&#39;).
Definition: TemplateBase.h:649
SourceLocation getRParenLoc() const
Definition: Expr.h:3681
void AddTemplateArgument(const TemplateArgument &Arg)
Emit a template argument.
Definition: ASTWriter.cpp:5865
An ObjCEncodeExpr record.
Definition: ASTBitCodes.h:1746
SourceLocation getRParenLoc() const
Definition: ExprObjC.h:414
SourceLocation getSuperLoc() const
Retrieve the location of the &#39;super&#39; keyword for a class or instance message to &#39;super&#39;, otherwise an invalid source location.
Definition: ExprObjC.h:1269
This represents &#39;#pragma omp taskwait&#39; directive.
Definition: StmtOpenMP.h:1895
SourceLocation getAtLoc() const
Definition: ExprObjC.h:412
OpenMPMapClauseKind getMapType() const LLVM_READONLY
Fetches mapping kind for the clause.
SourceRange getSourceRange() const
Definition: ExprObjC.h:1690
bool isPascal() const
Definition: Expr.h:1681
This is a basic class for representing single OpenMP clause.
Definition: OpenMPClause.h:51
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load, __atomic_store, and __atomic_compare_exchange_*, for the similarly-named C++11 instructions, and __c11 variants for <stdatomic.h>, and corresponding __opencl_atomic_* for OpenCL 2.0.
Definition: Expr.h:5313
UnaryExprOrTypeTrait getKind() const
Definition: Expr.h:2165
bool isArray() const
Definition: ExprCXX.h:2020
bool isOpenMPLoopBoundSharingDirective(OpenMPDirectiveKind Kind)
Checks if the specified directive kind is one of the composite or combined directives that need loop ...
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition: ExprObjC.h:488
bool isValueDependent() const
isValueDependent - Determines whether this expression is value-dependent (C++ [temp.dep.constexpr]).
Definition: Expr.h:149
SourceLocation getLParenLoc() const
Definition: Expr.h:3679
SourceLocation getGotoLoc() const
Definition: Stmt.h:1344
SourceLocation getAtFinallyLoc() const
Definition: StmtObjC.h:147
AccessSpecifier getAccess() const
StringLiteral * getFunctionName()
Definition: Expr.cpp:469
SourceLocation getNameModifierLoc() const
Return the location of directive name modifier.
Definition: OpenMPClause.h:316
SourceLocation getLocStart() const LLVM_READONLY
Returns the starting location of the clause.
Definition: OpenMPClause.h:67
An ObjCIsa Expr record.
Definition: ASTBitCodes.h:1770
const StringLiteral * getOutputConstraintLiteral(unsigned i) const
Definition: Stmt.h:1782
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:2961
Stmt * getCapturedStmt()
Retrieve the statement being captured.
Definition: Stmt.h:2226
OpenMPMapClauseKind getMapTypeModifier() const LLVM_READONLY
Fetches the map type modifier for the clause.
void AddAttributes(ArrayRef< const Attr *> Attrs)
Emit a list of attributes.
Definition: ASTWriter.cpp:4484
SourceLocation getAtCatchLoc() const
Definition: StmtObjC.h:104
CharacterKind getKind() const
Definition: Expr.h:1433
This represents &#39;#pragma omp target&#39; directive.
Definition: StmtOpenMP.h:2256
Expr * getInputExpr(unsigned i)
Definition: Stmt.cpp:432
void AddSourceLocation(SourceLocation Loc)
Emit a source location.
Definition: ASTWriter.h:846
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1794
Expr * getNumForLoops() const
Return the number of associated for-loops.
Definition: OpenMPClause.h:592
Expr * getV()
Get &#39;v&#39; part of the associated expression/statement.
Definition: StmtOpenMP.h:2233
IdentType getIdentType() const
Definition: Expr.h:1236
SourceLocation getEndLoc() const
Definition: Stmt.h:1885
Expr * getSubExpr()
Definition: ExprObjC.h:139
An expression trait intrinsic.
Definition: ExprCXX.h:2579
const ObjCMethodDecl * getMethodDecl() const
Definition: ExprObjC.h:1324
An AtomicExpr record.
Definition: ASTBitCodes.h:1734
This represents &#39;#pragma omp ordered&#39; directive.
Definition: StmtOpenMP.h:2067
const_all_lists_sizes_range all_lists_sizes() const
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition: Expr.h:3654
void AddAPFloat(const llvm::APFloat &Value)
Emit a floating-point value.
Definition: ASTWriter.cpp:5346
This represents &#39;#pragma omp target update&#39; directive.
Definition: StmtOpenMP.h:3008
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:121
bool isArgumentType() const
Definition: Expr.h:2170
SourceLocation getKeywordLoc() const
Definition: Stmt.h:744
Expr * getArrayFiller()
If this initializer list initializes an array with more elements than there are initializers in the l...
Definition: Expr.h:4144
SourceLocation getStarLoc() const
Definition: Stmt.h:1383
SourceLocation getLParenLoc() const
Returns the location of &#39;(&#39;.
Definition: OpenMPClause.h:425
bool passAlignment() const
Indicates whether the required alignment should be implicitly passed to the allocation function...
Definition: ExprCXX.h:2074
bool isPartOfExplicitCast() const
Definition: Expr.h:2986
helper_expr_const_range lhs_exprs() const
FunctionDecl * getOperatorDelete() const
Definition: ExprCXX.h:2017
Representation of a Microsoft __if_exists or __if_not_exists statement with a dependent name...
Definition: StmtCXX.h:244
unsigned getExprImplicitCastAbbrev() const
Definition: ASTWriter.h:695
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
Definition: Expr.cpp:216
void AddDeclarationNameInfo(const DeclarationNameInfo &NameInfo)
Definition: ASTWriter.cpp:5698
void VisitStmt(Stmt *S)
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:2944
Expr * Value
The value of the dictionary element.
Definition: ExprObjC.h:252
const Expr * getInitializer() const
Definition: Expr.h:2778
OpenMPDirectiveKind getCaptureRegion() const
Get capture region for the stmt in the clause.
Definition: OpenMPClause.h:129
Expr * getLHS() const
Definition: Expr.h:3187
void AddTemplateKWAndArgsInfo(const ASTTemplateKWAndArgsInfo &ArgInfo, const TemplateArgumentLoc *Args)
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:3351
SourceLocation getLocation() const LLVM_READONLY
Definition: ExprCXX.h:1506
A POD class for pairing a NamedDecl* with an access specifier.
Represents a C11 generic selection.
Definition: Expr.h:4880
ArrayRef< TemplateArgument > getPartialArguments() const
Get.
Definition: ExprCXX.h:3923
void VisitOMPClauseWithPreInit(OMPClauseWithPreInit *C)
const Expr * getBase() const
Definition: Expr.h:5006
Expr * getInstanceReceiver()
Returns the object expression (receiver) for an instance message, or null for a message that is not a...
Definition: ExprObjC.h:1228
Expr * getLoopCunter(unsigned NumLoop)
Get loops counter for the specified loop.
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition: Expr.h:3608
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers...
Definition: ExprObjC.h:1602
Represents a reference to a function parameter pack that has been substituted but not yet expanded...
Definition: ExprCXX.h:4070
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
Definition: Expr.h:3547
void VisitOMPClauseWithPostUpdate(OMPClauseWithPostUpdate *C)
unsigned getManglingNumber() const
Definition: ExprCXX.h:4220
SourceLocation getMemberLoc() const
Definition: ExprCXX.h:819
TypeSourceInfo * getDestroyedTypeInfo() const
Retrieve the source location information for the type being destroyed.
Definition: ExprCXX.h:2368
arg_iterator arg_end()
Definition: ExprObjC.h:1441
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "if" statement, if any.
Definition: Stmt.cpp:804
Expr * getFalseExpr() const
getFalseExpr - Return the subexpression which will be evaluated if the condnition evaluates to false;...
Definition: Expr.h:3563
NullStmt - This is the null statement ";": C99 6.8.3p3.
Definition: Stmt.h:575
bool isTypeOperand() const
Definition: ExprCXX.h:711
StringRef getInputConstraint(unsigned i) const
Definition: Stmt.h:1914
SourceLocation getLocation() const
Definition: ExprCXX.h:577
unsigned getNumAssocs() const
Definition: Expr.h:4907
void writeClause(OMPClause *C)
Dataflow Directional Tag Classes.
Expr * getPrevUpperBoundVariable() const
Definition: StmtOpenMP.h:867
bool isResultDependent() const
Whether this generic selection is result-dependent.
Definition: Expr.h:4944
SourceLocation getColonLoc() const
Get colon location.
This represents &#39;device&#39; clause in the &#39;#pragma omp ...&#39; directive.
bool isVolatile() const
Definition: Stmt.h:1562
An InitListExpr record.
Definition: ASTBitCodes.h:1683
OpenMPDefaultmapClauseKind getDefaultmapKind() const
Get kind of the clause.
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
Definition: Expr.h:2667
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:1208
SourceLocation getLocation() const
Definition: ExprObjC.h:744
A CXXBoolLiteralExpr record.
Definition: ASTBitCodes.h:1850
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
Definition: ExprCXX.h:2145
IdentifierInfo * getOutputIdentifier(unsigned i) const
Definition: Stmt.h:1771
SourceLocation getStartLoc() const LLVM_READONLY
Definition: Stmt.h:527
bool isSimple() const
Definition: Stmt.h:1559
OverloadedOperatorKind getOperator() const
Returns the kind of overloaded operator that this expression refers to.
Definition: ExprCXX.h:106
helper_expr_const_range privates() const
NonTypeTemplateParmDecl * getParameterPack() const
Retrieve the non-type template parameter pack being substituted.
Definition: ExprCXX.h:4032
MSPropertyDecl * getPropertyDecl() const
Definition: ExprCXX.h:817
const Stmt * getFinallyBody() const
Definition: StmtObjC.h:136
An ExtVectorElementExpr record.
Definition: ASTBitCodes.h:1680
bool isImplicit() const
Definition: ExprCXX.h:1010
Expr * getCond() const
Definition: StmtOpenMP.h:781
This represents &#39;#pragma omp section&#39; directive.
Definition: StmtOpenMP.h:1282
This represents &#39;#pragma omp teams distribute&#39; directive.
Definition: StmtOpenMP.h:3418
QualType getSuperType() const
Retrieve the type referred to by &#39;super&#39;.
Definition: ExprObjC.h:1304
const_all_components_range all_components() const
SourceLocation EllipsisLoc
The location of the ellipsis, if this is a pack expansion.
Definition: ExprObjC.h:255
TypeSourceInfo * getTypeSourceInfo() const
Retrieve the type source information for the type being constructed.
Definition: ExprCXX.h:3225
A runtime availability query.
Definition: ExprObjC.h:1670
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:3899
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
Definition: ExprCXX.h:394
This represents &#39;#pragma omp simd&#39; directive.
Definition: StmtOpenMP.h:1007
Stmt * getHandler() const
Definition: Stmt.h:2072
Represents a &#39;co_yield&#39; expression.
Definition: ExprCXX.h:4504
SourceLocation getLBraceLoc() const
Definition: Expr.h:4195
SourceLocation getSemiLoc() const
Definition: Stmt.h:596
An ObjCAutoreleasePoolStmt record.
Definition: ASTBitCodes.h:1794
Expr * getOperand() const
Retrieve the operand of the &#39;co_return&#39; statement.
Definition: StmtCXX.h:466
const Expr * getReductionRef() const
Returns reference to the task_reduction return variable.
Definition: StmtOpenMP.h:1990
SourceLocation getLParenLoc()
Get location of &#39;(&#39;.
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition: ExprCXX.h:3756
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
Definition: ExprCXX.h:1370
bool isImplicit() const
Definition: ExprCXX.h:4445
A CXXDynamicCastExpr record.
Definition: ASTBitCodes.h:1832
This represents clause &#39;linear&#39; in the &#39;#pragma omp ...&#39; directives.
const Expr * getSynchExpr() const
Definition: StmtObjC.h:298
Expr * getUpdateExpr()
Get helper expression of the form &#39;OpaqueValueExpr(x) binop OpaqueValueExpr(expr)&#39; or &#39;OpaqueValueExp...
Definition: StmtOpenMP.h:2219
SourceLocation getParameterPackLocation() const
Get the location of the parameter pack.
Definition: ExprCXX.h:4102
semantics_iterator semantics_begin()
Definition: Expr.h:5245
bool isIfExists() const
Determine whether this is an __if_exists statement.
Definition: StmtCXX.h:269
NestedNameSpecifierLoc getQualifierLoc() const
Definition: ExprCXX.h:820
ExplicitCastExpr - An explicit cast written in the source code.
Definition: Expr.h:3039
OpenMPDefaultmapClauseModifier getDefaultmapModifier() const
Get the modifier of the clause.
This represents &#39;#pragma omp atomic&#39; directive.
Definition: StmtOpenMP.h:2122
child_range children()
Definition: ExprCXX.h:4408
Expr * getCombinedInit() const
Definition: StmtOpenMP.h:903
SourceLocation getLParenLoc() const
Returns the location of &#39;(&#39;.
SourceLocation getLParenLoc() const
Definition: ExprObjC.h:1631
void AddVersionTuple(const VersionTuple &Version)
Emit a version tuple.
Definition: ASTWriter.h:954
An ObjCAtFinallyStmt record.
Definition: ASTBitCodes.h:1782
SourceLocation getRParenLoc() const
Definition: ExprObjC.h:509
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition: ExprCXX.h:718
const Stmt * getBody() const
Definition: Stmt.h:1093
llvm::APInt getValue() const
Definition: Expr.h:1302
Represents a __leave statement.
Definition: Stmt.h:2088
CXXRecordDecl * getNamingClass() const
Gets the &#39;naming class&#39; (in the sense of C++0x [class.access.base]p5) of the lookup.
Definition: ExprCXX.h:2905
unsigned getCollapsedNumber() const
Get number of collapsed loops.
Definition: StmtOpenMP.h:763
Expr * getCombinedNextLowerBound() const
Definition: StmtOpenMP.h:915
ArrayRef< Expr * > counters()
Definition: StmtOpenMP.h:939
LabelDecl * getLabel() const
Definition: Expr.h:3632
path_iterator path_end()
Definition: Expr.h:2917
helper_expr_const_range privates() const
iterator end() const
Definition: ExprCXX.h:4108
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition: ExprCXX.h:3702
SwitchStmt - This represents a &#39;switch&#39; stmt.
Definition: Stmt.h:1054
unsigned getByteLength() const
Definition: Expr.h:1665
SourceLocation getColonColonLoc() const
Retrieve the location of the &#39;::&#39; in a qualified pseudo-destructor expression.
Definition: ExprCXX.h:2356
Expr * getCombinedNextUpperBound() const
Definition: StmtOpenMP.h:921
arg_iterator arg_begin()
Definition: ExprObjC.h:1439
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source location information.
Definition: ExprCXX.h:2998
SourceLocation getRParenLoc() const
Definition: StmtObjC.h:55
Represents the body of a coroutine.
Definition: StmtCXX.h:307
TemplateArgumentLoc * getTrailingTemplateArgumentLoc()
Return the optional template arguments.
Definition: ExprCXX.h:3689
Location wrapper for a TemplateArgument.
Definition: TemplateBase.h:450
Expr * getBase() const
Definition: ExprObjC.h:1486
bool isOpenMPDistributeDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a distribute directive.
SourceLocation getBuiltinLoc() const
Definition: Expr.h:3719
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition: Expr.h:2226
SourceLocation getLParenLoc() const
Returns the location of &#39;(&#39;.
Definition: OpenMPClause.h:652
OpenMPDirectiveKind getNameModifier() const
Return directive name modifier associated with the clause.
Definition: OpenMPClause.h:313
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c array literal.
Definition: ExprObjC.h:218
SourceLocation getLeaveLoc() const
Definition: Stmt.h:2098
Represents Objective-C&#39;s collection statement.
Definition: StmtObjC.h:24
An ObjCAtSynchronizedStmt record.
Definition: ASTBitCodes.h:1788
arg_iterator arg_begin()
Definition: Expr.h:2415
ArrayRef< Expr * > inits()
Definition: StmtOpenMP.h:951
unsigned getNumObjects() const
Definition: ExprCXX.h:3125
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:396
SourceLocation getLocation() const
Retrieve the location of this expression.
Definition: Expr.h:905
helper_expr_const_range destination_exprs() const
SourceLocation getLocation() const
Definition: ExprObjC.h:572
An implicit indirection through a C++ base class, when the field found is in a base class...
Definition: Expr.h:1933
Expr * getCond() const
getCond - Return the condition expression; this is defined in terms of the opaque value...
Definition: Expr.h:3551
Represents a call to a CUDA kernel function.
Definition: ExprCXX.h:205
SourceLocation getRParenLoc() const
Definition: Expr.h:3891
Represents a &#39;co_await&#39; expression.
Definition: ExprCXX.h:4419
bool isUnique() const
Definition: Expr.h:944
SourceLocation getLParenLoc() const
Returns the location of &#39;(&#39;.
Definition: OpenMPClause.h:364
TypeTraitExprBitfields TypeTraitExprBits
Definition: Stmt.h:312
bool isDelegateInitCall() const
isDelegateInitCall - Answers whether this message send has been tagged as a "delegate init call"...
Definition: ExprObjC.h:1381
Stmt * getInit()
Definition: Stmt.h:1089
A CXXMemberCallExpr record.
Definition: ASTBitCodes.h:1817
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
Definition: ExprCXX.h:2081
SourceLocation getColonLoc() const
Gets location of &#39;:&#39; symbol in clause.
SourceRange getDirectInitRange() const
Definition: ExprCXX.h:2124
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the member name, with source location information...
Definition: ExprCXX.h:3407
Expr * getNumIterations() const
Definition: StmtOpenMP.h:853
Opcode getOpcode() const
Definition: Expr.h:1829
Expr * getArg(unsigned Arg)
Return the specified argument.
Definition: ExprCXX.h:1418
StringRef getBytes() const
Allow access to clients that need the byte representation, such as ASTWriterStmt::VisitStringLiteral(...
Definition: Expr.h:1641
Represents Objective-C&#39;s @finally statement.
Definition: StmtObjC.h:124
SourceLocation getDefaultLoc() const
Definition: Expr.h:4910
StringRef getAsmString() const
Definition: Stmt.h:1894
SourceLocation getDistScheduleKindLoc()
Get kind location.
bool hasAssociatedStmt() const
Returns true if directive has associated statement.
Definition: StmtOpenMP.h:195
Expr * getPrevLowerBoundVariable() const
Definition: StmtOpenMP.h:861
uint64_t EmitStmt(unsigned Code, unsigned Abbrev=0)
Emit the record to the stream, preceded by its substatements.
Definition: ASTWriter.h:816
const Expr * getBase() const
Definition: ExprObjC.h:563
bool isArrow() const
Determine whether this member expression used the &#39;->&#39; operator; otherwise, it used the &#39;...
Definition: ExprCXX.h:3394
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: Expr.h:2676
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
SourceLocation getColonLoc() const
Definition: Stmt.h:746
Represents a base class of a C++ class.
Definition: DeclCXX.h:192
This represents &#39;write&#39; clause in the &#39;#pragma omp atomic&#39; directive.
unsigned getNumClobbers() const
Definition: Stmt.h:1609
bool isImplicit() const
Definition: StmtCXX.h:475
SourceLocation getRParenLoc() const
Definition: Stmt.h:1307
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:529
child_range children()
Definition: ExprCXX.h:4496
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof...
Definition: ExprCXX.h:3918
Represents an expression that might suspend coroutine execution; either a co_await or co_yield expres...
Definition: ExprCXX.h:4334
DeclStmt * getRangeStmt()
Definition: StmtCXX.h:156
A ConvertVectorExpr record.
Definition: ASTBitCodes.h:1722
unsigned arg_size() const
Retrieve the number of arguments.
Definition: ExprCXX.h:3243
SourceLocation getLParenLoc() const
Returns the location of &#39;(&#39;.
Expr * getRHS() const
Definition: Expr.h:3885
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:3183
SourceLocation getAsmLoc() const
Definition: Stmt.h:1556
GotoStmt - This represents a direct goto.
Definition: Stmt.h:1329
A use of a default initializer in a constructor or in aggregate initialization.
Definition: ExprCXX.h:1160
Expr * getTarget()
Definition: Stmt.h:1385
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition: Expr.h:3795
const SwitchCase * getNextSwitchCase() const
Definition: Stmt.h:738
SourceLocation getLParenLoc() const
Returns the location of &#39;(&#39;.
Definition: OpenMPClause.h:982
CapturedDecl * getCapturedDecl()
Retrieve the outlined function declaration.
Definition: Stmt.cpp:1100
StringRef getUuidStr() const
Definition: ExprCXX.h:952
bool isFreeIvar() const
Definition: ExprObjC.h:568
Expr * getCond()
Definition: Stmt.h:1223
QualType getSuperReceiverType() const
Definition: ExprObjC.h:748
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
ASTStmtWriter(ASTWriter &Writer, ASTWriter::RecordData &Record)
OpenMPScheduleClauseModifier getSecondScheduleModifier() const
Get the second modifier of the clause.
Definition: OpenMPClause.h:881
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition: Expr.h:2500
GNU array range designator.
Definition: ASTBitCodes.h:1982
SourceLocation getWhileLoc() const
Definition: Stmt.h:1232
An ArrayInitIndexExpr record.
Definition: ASTBitCodes.h:1698
A GCC-style AsmStmt record.
Definition: ASTBitCodes.h:1611
This represents &#39;#pragma omp target parallel&#39; directive.
Definition: StmtOpenMP.h:2489
This represents &#39;nowait&#39; clause in the &#39;#pragma omp ...&#39; directive.
ContinueStmt - This represents a continue.
Definition: Stmt.h:1410
OpenMPScheduleClauseModifier getFirstScheduleModifier() const
Get the first modifier of the clause.
Definition: OpenMPClause.h:876
Expr * getPromiseCall() const
Retrieve the promise call that results from this &#39;co_return&#39; statement.
Definition: StmtCXX.h:471
Represents a loop initializing the elements of an array.
Definition: Expr.h:4678
This represents &#39;num_tasks&#39; clause in the &#39;#pragma omp ...&#39; directive.
SourceLocation getColonLoc() const
Definition: StmtCXX.h:197
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition: Expr.h:3836
Expr * getFilterExpr() const
Definition: Stmt.h:1987
SourceLocation getAttrLoc() const
Definition: Stmt.h:951
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Definition: Expr.h:3504
CXXCatchStmt - This represents a C++ catch block.
Definition: StmtCXX.h:29
An index into an array.
Definition: Expr.h:1926
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr.type.conv]).
Definition: ExprCXX.h:1528
OpenMPScheduleClauseKind getScheduleKind() const
Get kind of the clause.
Definition: OpenMPClause.h:873
An object for streaming information to a record.
Definition: ASTWriter.h:746
An ObjCAtCatchStmt record.
Definition: ASTBitCodes.h:1779
Expr * getRHS() const
Definition: Expr.h:3475
Expr * getCombinedCond() const
Definition: StmtOpenMP.h:909
WhileStmt - This represents a &#39;while&#39; stmt.
Definition: Stmt.h:1147
SourceLocation getFirstScheduleModifierLoc() const
Get the first modifier location.
Definition: OpenMPClause.h:892
SourceRange getParenOrBraceRange() const
Definition: ExprCXX.h:1437
CleanupObject getObject(unsigned i) const
Definition: ExprCXX.h:3127
Field designator where the field has been resolved to a declaration.
Definition: ASTBitCodes.h:1976
helper_expr_const_range reduction_ops() const
unsigned getNumConcatenated() const
getNumConcatenated - Get the number of string literal tokens that were concatenated in translation ph...
Definition: Expr.h:1701
SourceLocation getLParenLoc() const
Definition: ExprCXX.h:1564
bool containsUnexpandedParameterPack() const
Whether this expression contains an unexpanded parameter pack (for C++11 variadic templates)...
Definition: Expr.h:214
child_range children()
Definition: StmtCXX.h:421
SourceLocation getAtSynchronizedLoc() const
Definition: StmtObjC.h:287
A CXXInheritedCtorInitExpr record.
Definition: ASTBitCodes.h:1823
Expr * getThreadLimit()
Return ThreadLimit number.
CompoundStmt * getTryBlock()
Definition: StmtCXX.h:100
Writes an AST file containing the contents of a translation unit.
Definition: ASTWriter.h:103
SourceLocation getBreakLoc() const
Definition: Stmt.h:1450
bool shouldCopy() const
shouldCopy - True if we should do the &#39;copy&#39; part of the copy-restore.
Definition: ExprObjC.h:1573
The receiver is a class.
Definition: ExprObjC.h:1073
Represents Objective-C&#39;s @try ... @catch ... @finally statement.
Definition: StmtObjC.h:160
capture_iterator capture_end() const
Retrieve an iterator pointing past the end of the sequence of captures.
Definition: Stmt.h:2273
void AddCXXBaseSpecifier(const CXXBaseSpecifier &Base)
Emit a C++ base specifier.
Definition: ASTWriter.cpp:5947
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
Definition: Stmt.cpp:266
bool isGlobalDelete() const
Definition: ExprCXX.h:2185
This represents &#39;#pragma omp taskloop simd&#39; directive.
Definition: StmtOpenMP.h:2874
void AddAPInt(const llvm::APInt &Value)
Emit an integral value.
Definition: ASTWriter.cpp:5335
SourceLocation getBuiltinLoc() const
getBuiltinLoc - Return the location of the __builtin_convertvector token.
Definition: Expr.h:3806
unsigned getNumCatchStmts() const
Retrieve the number of @catch statements in this try-catch-finally block.
Definition: StmtObjC.h:209
Expr * getBase() const
Retrieve the base object of this member expressions, e.g., the x in x.m.
Definition: ExprCXX.h:3385
StringLiteral - This represents a string literal expression, e.g.
Definition: Expr.h:1585
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2316
SourceRange getTypeIdParens() const
Definition: ExprCXX.h:2045
Expr * getPattern()
Retrieve the pattern of the pack expansion.
Definition: ExprCXX.h:3785
Expr * getPreCond() const
Definition: StmtOpenMP.h:777
This represents &#39;dist_schedule&#39; clause in the &#39;#pragma omp ...&#39; directive.
Expr * getLHS() const
Definition: Expr.h:3883
Abstract class common to all of the C++ "named"/"keyword" casts.
Definition: ExprCXX.h:248
This represents &#39;#pragma omp sections&#39; directive.
Definition: StmtOpenMP.h:1214
Expr * getHint() const
Returns number of threads.
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition: ExprObjC.h:84
bool isObjectReceiver() const
Definition: ExprObjC.h:756
unsigned getNumComponents() const
Definition: Expr.h:2086
This represents &#39;#pragma omp target data&#39; directive.
Definition: StmtOpenMP.h:2314
const ParmVarDecl * getParam() const
Definition: ExprCXX.h:1118
OpenMPDirectiveKind getCancelRegion() const
Get cancellation region for the current cancellation point.
Definition: StmtOpenMP.h:2793
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument for this lambda expression...
Definition: ExprCXX.h:1806
capture_range captures()
Definition: Stmt.h:2260
A reference to a declared variable, function, enum, etc.
Definition: Expr.h:974
Expr * getRHS() const
Definition: Expr.h:3189
NestedNameSpecifierLoc getQualifierLoc() const
Fetches the nested-name qualifier with source-location information, if one was given.
Definition: ExprCXX.h:2755
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
BreakStmt - This represents a break.
Definition: Stmt.h:1438
SourceLocation getReceiverLocation() const
Definition: ExprObjC.h:746
Expr * getChunkSize()
Get chunk size.
Definition: OpenMPClause.h:905
const VarDecl * getCatchParamDecl() const
Definition: StmtObjC.h:96
SourceLocation getLocation() const
Definition: Expr.h:1432
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
Definition: Expr.h:4162
bool isConditionDependent() const
Definition: Expr.h:3871
Expr * getNumThreads() const
Returns number of threads.
Definition: OpenMPClause.h:428
Stmt * getSubStmt()
Definition: Stmt.h:895
SourceLocation getBridgeKeywordLoc() const
The location of the bridge keyword.
Definition: ExprObjC.h:1642
bool hadMultipleCandidates() const
Whether the referred constructor was resolved from an overloaded set having size greater than 1...
Definition: ExprCXX.h:1366
void AddTemplateArgumentLoc(const TemplateArgumentLoc &Arg)
Emits a template argument location.
Definition: ASTWriter.cpp:5447
DeclStmt * getLoopVarStmt()
Definition: StmtCXX.h:163
ParmVarDecl * getParameterPack() const
Get the parameter pack which this expression refers to.
Definition: ExprCXX.h:4099
unsigned getNumArgs() const
Definition: ExprCXX.h:1415
const Expr * getBase() const
Definition: ExprObjC.h:737
const Expr * getCond() const
Definition: Stmt.h:1010
SourceLocation getLocEnd() const LLVM_READONLY
Returns ending location of directive.
Definition: StmtOpenMP.h:171
A trivial tuple used to represent a source range.
This represents &#39;#pragma omp taskyield&#39; directive.
Definition: StmtOpenMP.h:1807
This represents &#39;#pragma omp distribute parallel for simd&#39; composite directive.
Definition: StmtOpenMP.h:3147
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition: ExprCXX.h:556
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding the member name, if any.
Definition: Expr.h:2631
SourceLocation getLParenLoc() const
Returns the location of &#39;(&#39;.
Definition: OpenMPClause.h:480
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type, member-designator).
Definition: Expr.h:2027
Expr * getQueriedExpression() const
Definition: ExprCXX.h:2620
This represents &#39;#pragma omp parallel sections&#39; directive.
Definition: StmtOpenMP.h:1668
SourceLocation getBuiltinLoc() const
Definition: Expr.h:5403
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
Definition: ExprCXX.h:895
SourceLocation getRParenLoc() const
Definition: ExprCXX.h:1566
Expr * getCommon() const
getCommon - Return the common expression, written to the left of the condition.
Definition: Expr.h:3544
TypeSourceInfo * getWrittenTypeInfo() const
Definition: Expr.h:3980
DeclStmt * getBeginStmt()
Definition: StmtCXX.h:157
SourceLocation getRightLoc() const
Definition: ExprObjC.h:1385
const Expr * getCond() const
Definition: Stmt.h:1092
const Expr * getPostUpdateExpr() const
Get post-update expression for the clause.
Definition: OpenMPClause.h:153
The receiver is a superclass.
Definition: ExprObjC.h:1079
SourceLocation getLParenLoc() const
Returns the location of &#39;(&#39;.
Definition: OpenMPClause.h:304
SourceLocation getGenericLoc() const
Definition: Expr.h:4909
SourceLocation LAngleLoc
The source location of the left angle bracket (&#39;<&#39;).
Definition: TemplateBase.h:646
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1269
SourceLocation getBegin() const
TypeSourceInfo * getTypeSourceInfo() const
getTypeSourceInfo - Return the destination type.
Definition: Expr.h:3798
SourceLocation getRParenLoc() const
Return the location of the right parentheses.
Definition: Expr.h:2066
Represents Objective-C&#39;s @autoreleasepool Statement.
Definition: StmtObjC.h:357
bool isConditionTrue() const
isConditionTrue - Return whether the condition is true (i.e.
Definition: Expr.h:3864
decls_iterator decls_end() const
Definition: ExprCXX.h:2729
SourceLocation getKeywordLoc() const
Definition: ExprCXX.h:4379
StmtCode
Record codes for each kind of statement or expression.
Definition: ASTBitCodes.h:1545
CompoundStmt * getTryBlock() const
Definition: Stmt.h:2068
Stmt * getSubStmt()
Definition: Stmt.h:956
QualType getBaseType() const
Definition: ExprCXX.h:3616
InitListExpr * getSyntacticForm() const
Definition: Expr.h:4207
Expr * getBaseExpr() const
Definition: ExprCXX.h:816
Represents an implicitly-generated value initialization of an object of a given type.
Definition: Expr.h:4772
CompoundStmt * getBlock() const
Definition: Stmt.h:1991
SourceLocation getReturnLoc() const
Definition: Stmt.h:1495
CapturedRegionKind getCapturedRegionKind() const
Retrieve the captured region kind.
Definition: Stmt.cpp:1115
A GenericSelectionExpr record.
Definition: ASTBitCodes.h:1728
This represents &#39;#pragma omp target parallel for&#39; directive.
Definition: StmtOpenMP.h:2549
This represents clause &#39;use_device_ptr&#39; in the &#39;#pragma omp ...&#39; directives.
Expr * getLength()
Get length of array section.
Definition: ExprOpenMP.h:99
ConstructionKind getConstructionKind() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
Definition: ExprCXX.h:1389
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:1256
Expr * getBase()
An array section can be written only as Base[LowerBound:Length].
Definition: ExprOpenMP.h:82
Stmt * getSubStmt()
Definition: Stmt.h:793
bool isOverloaded() const
True if this lookup is overloaded.
Definition: ExprCXX.h:2900
This represents &#39;#pragma omp taskloop&#39; directive.
Definition: StmtOpenMP.h:2809