clang  3.9.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 /// \brief 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 
51  void AddTemplateKWAndArgsInfo(const ASTTemplateKWAndArgsInfo &ArgInfo,
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) {
253  Record.AddStmt(S->getOutputExpr(I));
254  }
255 
256  // Inputs
257  for (unsigned I = 0, N = S->getNumInputs(); I != N; ++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 *S) {
304  // FIXME: Implement coroutine serialization.
305  llvm_unreachable("unimplemented");
306 }
307 
308 void ASTStmtWriter::VisitCoreturnStmt(CoreturnStmt *S) {
309  // FIXME: Implement coroutine serialization.
310  llvm_unreachable("unimplemented");
311 }
312 
313 void ASTStmtWriter::VisitCoawaitExpr(CoawaitExpr *S) {
314  // FIXME: Implement coroutine serialization.
315  llvm_unreachable("unimplemented");
316 }
317 
318 void ASTStmtWriter::VisitCoyieldExpr(CoyieldExpr *S) {
319  // FIXME: Implement coroutine serialization.
320  llvm_unreachable("unimplemented");
321 }
322 
323 void ASTStmtWriter::VisitCapturedStmt(CapturedStmt *S) {
324  VisitStmt(S);
325  // NumCaptures
326  Record.push_back(std::distance(S->capture_begin(), S->capture_end()));
327 
328  // CapturedDecl and captured region kind
329  Record.AddDeclRef(S->getCapturedDecl());
330  Record.push_back(S->getCapturedRegionKind());
331 
332  Record.AddDeclRef(S->getCapturedRecordDecl());
333 
334  // Capture inits
335  for (auto *I : S->capture_inits())
336  Record.AddStmt(I);
337 
338  // Body
339  Record.AddStmt(S->getCapturedStmt());
340 
341  // Captures
342  for (const auto &I : S->captures()) {
343  if (I.capturesThis() || I.capturesVariableArrayType())
344  Record.AddDeclRef(nullptr);
345  else
346  Record.AddDeclRef(I.getCapturedVar());
347  Record.push_back(I.getCaptureKind());
348  Record.AddSourceLocation(I.getLocation());
349  }
350 
352 }
353 
354 void ASTStmtWriter::VisitExpr(Expr *E) {
355  VisitStmt(E);
356  Record.AddTypeRef(E->getType());
357  Record.push_back(E->isTypeDependent());
358  Record.push_back(E->isValueDependent());
359  Record.push_back(E->isInstantiationDependent());
361  Record.push_back(E->getValueKind());
362  Record.push_back(E->getObjectKind());
363 }
364 
365 void ASTStmtWriter::VisitPredefinedExpr(PredefinedExpr *E) {
366  VisitExpr(E);
367  Record.AddSourceLocation(E->getLocation());
368  Record.push_back(E->getIdentType()); // FIXME: stable encoding
369  Record.AddStmt(E->getFunctionName());
371 }
372 
373 void ASTStmtWriter::VisitDeclRefExpr(DeclRefExpr *E) {
374  VisitExpr(E);
375 
376  Record.push_back(E->hasQualifier());
377  Record.push_back(E->getDecl() != E->getFoundDecl());
378  Record.push_back(E->hasTemplateKWAndArgsInfo());
379  Record.push_back(E->hadMultipleCandidates());
381 
382  if (E->hasTemplateKWAndArgsInfo()) {
383  unsigned NumTemplateArgs = E->getNumTemplateArgs();
384  Record.push_back(NumTemplateArgs);
385  }
386 
388 
389  if ((!E->hasTemplateKWAndArgsInfo()) && (!E->hasQualifier()) &&
390  (E->getDecl() == E->getFoundDecl()) &&
392  AbbrevToUse = Writer.getDeclRefExprAbbrev();
393  }
394 
395  if (E->hasQualifier())
397 
398  if (E->getDecl() != E->getFoundDecl())
399  Record.AddDeclRef(E->getFoundDecl());
400 
401  if (E->hasTemplateKWAndArgsInfo())
402  AddTemplateKWAndArgsInfo(*E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
403  E->getTrailingObjects<TemplateArgumentLoc>());
404 
405  Record.AddDeclRef(E->getDecl());
406  Record.AddSourceLocation(E->getLocation());
407  Record.AddDeclarationNameLoc(E->DNLoc, E->getDecl()->getDeclName());
409 }
410 
411 void ASTStmtWriter::VisitIntegerLiteral(IntegerLiteral *E) {
412  VisitExpr(E);
413  Record.AddSourceLocation(E->getLocation());
414  Record.AddAPInt(E->getValue());
415 
416  if (E->getValue().getBitWidth() == 32) {
417  AbbrevToUse = Writer.getIntegerLiteralAbbrev();
418  }
419 
421 }
422 
423 void ASTStmtWriter::VisitFloatingLiteral(FloatingLiteral *E) {
424  VisitExpr(E);
425  Record.push_back(E->getRawSemantics());
426  Record.push_back(E->isExact());
427  Record.AddAPFloat(E->getValue());
428  Record.AddSourceLocation(E->getLocation());
430 }
431 
432 void ASTStmtWriter::VisitImaginaryLiteral(ImaginaryLiteral *E) {
433  VisitExpr(E);
434  Record.AddStmt(E->getSubExpr());
436 }
437 
438 void ASTStmtWriter::VisitStringLiteral(StringLiteral *E) {
439  VisitExpr(E);
440  Record.push_back(E->getByteLength());
441  Record.push_back(E->getNumConcatenated());
442  Record.push_back(E->getKind());
443  Record.push_back(E->isPascal());
444  // FIXME: String data should be stored as a blob at the end of the
445  // StringLiteral. However, we can't do so now because we have no
446  // provision for coping with abbreviations when we're jumping around
447  // the AST file during deserialization.
448  Record.append(E->getBytes().begin(), E->getBytes().end());
449  for (unsigned I = 0, N = E->getNumConcatenated(); I != N; ++I)
450  Record.AddSourceLocation(E->getStrTokenLoc(I));
452 }
453 
454 void ASTStmtWriter::VisitCharacterLiteral(CharacterLiteral *E) {
455  VisitExpr(E);
456  Record.push_back(E->getValue());
457  Record.AddSourceLocation(E->getLocation());
458  Record.push_back(E->getKind());
459 
460  AbbrevToUse = Writer.getCharacterLiteralAbbrev();
461 
463 }
464 
465 void ASTStmtWriter::VisitParenExpr(ParenExpr *E) {
466  VisitExpr(E);
467  Record.AddSourceLocation(E->getLParen());
468  Record.AddSourceLocation(E->getRParen());
469  Record.AddStmt(E->getSubExpr());
471 }
472 
473 void ASTStmtWriter::VisitParenListExpr(ParenListExpr *E) {
474  VisitExpr(E);
475  Record.push_back(E->NumExprs);
476  for (unsigned i=0; i != E->NumExprs; ++i)
477  Record.AddStmt(E->Exprs[i]);
478  Record.AddSourceLocation(E->LParenLoc);
479  Record.AddSourceLocation(E->RParenLoc);
481 }
482 
483 void ASTStmtWriter::VisitUnaryOperator(UnaryOperator *E) {
484  VisitExpr(E);
485  Record.AddStmt(E->getSubExpr());
486  Record.push_back(E->getOpcode()); // FIXME: stable encoding
487  Record.AddSourceLocation(E->getOperatorLoc());
489 }
490 
491 void ASTStmtWriter::VisitOffsetOfExpr(OffsetOfExpr *E) {
492  VisitExpr(E);
493  Record.push_back(E->getNumComponents());
494  Record.push_back(E->getNumExpressions());
495  Record.AddSourceLocation(E->getOperatorLoc());
496  Record.AddSourceLocation(E->getRParenLoc());
498  for (unsigned I = 0, N = E->getNumComponents(); I != N; ++I) {
499  const OffsetOfNode &ON = E->getComponent(I);
500  Record.push_back(ON.getKind()); // FIXME: Stable encoding
502  Record.AddSourceLocation(ON.getSourceRange().getEnd());
503  switch (ON.getKind()) {
504  case OffsetOfNode::Array:
505  Record.push_back(ON.getArrayExprIndex());
506  break;
507 
508  case OffsetOfNode::Field:
509  Record.AddDeclRef(ON.getField());
510  break;
511 
513  Record.AddIdentifierRef(ON.getFieldName());
514  break;
515 
516  case OffsetOfNode::Base:
517  Record.AddCXXBaseSpecifier(*ON.getBase());
518  break;
519  }
520  }
521  for (unsigned I = 0, N = E->getNumExpressions(); I != N; ++I)
522  Record.AddStmt(E->getIndexExpr(I));
524 }
525 
526 void ASTStmtWriter::VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *E) {
527  VisitExpr(E);
528  Record.push_back(E->getKind());
529  if (E->isArgumentType())
531  else {
532  Record.push_back(0);
533  Record.AddStmt(E->getArgumentExpr());
534  }
535  Record.AddSourceLocation(E->getOperatorLoc());
536  Record.AddSourceLocation(E->getRParenLoc());
538 }
539 
540 void ASTStmtWriter::VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
541  VisitExpr(E);
542  Record.AddStmt(E->getLHS());
543  Record.AddStmt(E->getRHS());
544  Record.AddSourceLocation(E->getRBracketLoc());
546 }
547 
548 void ASTStmtWriter::VisitOMPArraySectionExpr(OMPArraySectionExpr *E) {
549  VisitExpr(E);
550  Record.AddStmt(E->getBase());
551  Record.AddStmt(E->getLowerBound());
552  Record.AddStmt(E->getLength());
553  Record.AddSourceLocation(E->getColonLoc());
554  Record.AddSourceLocation(E->getRBracketLoc());
556 }
557 
558 void ASTStmtWriter::VisitCallExpr(CallExpr *E) {
559  VisitExpr(E);
560  Record.push_back(E->getNumArgs());
561  Record.AddSourceLocation(E->getRParenLoc());
562  Record.AddStmt(E->getCallee());
563  for (CallExpr::arg_iterator Arg = E->arg_begin(), ArgEnd = E->arg_end();
564  Arg != ArgEnd; ++Arg)
565  Record.AddStmt(*Arg);
567 }
568 
569 void ASTStmtWriter::VisitMemberExpr(MemberExpr *E) {
570  // Don't call VisitExpr, we'll write everything here.
571 
572  Record.push_back(E->hasQualifier());
573  if (E->hasQualifier())
575 
576  Record.push_back(E->HasTemplateKWAndArgsInfo);
577  if (E->HasTemplateKWAndArgsInfo) {
579  unsigned NumTemplateArgs = E->getNumTemplateArgs();
580  Record.push_back(NumTemplateArgs);
581  Record.AddSourceLocation(E->getLAngleLoc());
582  Record.AddSourceLocation(E->getRAngleLoc());
583  for (unsigned i=0; i != NumTemplateArgs; ++i)
584  Record.AddTemplateArgumentLoc(E->getTemplateArgs()[i]);
585  }
586 
587  Record.push_back(E->hadMultipleCandidates());
588 
589  DeclAccessPair FoundDecl = E->getFoundDecl();
590  Record.AddDeclRef(FoundDecl.getDecl());
591  Record.push_back(FoundDecl.getAccess());
592 
593  Record.AddTypeRef(E->getType());
594  Record.push_back(E->getValueKind());
595  Record.push_back(E->getObjectKind());
596  Record.AddStmt(E->getBase());
597  Record.AddDeclRef(E->getMemberDecl());
598  Record.AddSourceLocation(E->getMemberLoc());
599  Record.push_back(E->isArrow());
600  Record.AddSourceLocation(E->getOperatorLoc());
601  Record.AddDeclarationNameLoc(E->MemberDNLoc,
602  E->getMemberDecl()->getDeclName());
604 }
605 
606 void ASTStmtWriter::VisitObjCIsaExpr(ObjCIsaExpr *E) {
607  VisitExpr(E);
608  Record.AddStmt(E->getBase());
609  Record.AddSourceLocation(E->getIsaMemberLoc());
610  Record.AddSourceLocation(E->getOpLoc());
611  Record.push_back(E->isArrow());
613 }
614 
615 void ASTStmtWriter::
616 VisitObjCIndirectCopyRestoreExpr(ObjCIndirectCopyRestoreExpr *E) {
617  VisitExpr(E);
618  Record.AddStmt(E->getSubExpr());
619  Record.push_back(E->shouldCopy());
621 }
622 
623 void ASTStmtWriter::VisitObjCBridgedCastExpr(ObjCBridgedCastExpr *E) {
624  VisitExplicitCastExpr(E);
625  Record.AddSourceLocation(E->getLParenLoc());
627  Record.push_back(E->getBridgeKind()); // FIXME: Stable encoding
629 }
630 
631 void ASTStmtWriter::VisitCastExpr(CastExpr *E) {
632  VisitExpr(E);
633  Record.push_back(E->path_size());
634  Record.AddStmt(E->getSubExpr());
635  Record.push_back(E->getCastKind()); // FIXME: stable encoding
636 
638  PI = E->path_begin(), PE = E->path_end(); PI != PE; ++PI)
639  Record.AddCXXBaseSpecifier(**PI);
640 }
641 
642 void ASTStmtWriter::VisitBinaryOperator(BinaryOperator *E) {
643  VisitExpr(E);
644  Record.AddStmt(E->getLHS());
645  Record.AddStmt(E->getRHS());
646  Record.push_back(E->getOpcode()); // FIXME: stable encoding
647  Record.AddSourceLocation(E->getOperatorLoc());
648  Record.push_back(E->isFPContractable());
650 }
651 
652 void ASTStmtWriter::VisitCompoundAssignOperator(CompoundAssignOperator *E) {
653  VisitBinaryOperator(E);
654  Record.AddTypeRef(E->getComputationLHSType());
657 }
658 
659 void ASTStmtWriter::VisitConditionalOperator(ConditionalOperator *E) {
660  VisitExpr(E);
661  Record.AddStmt(E->getCond());
662  Record.AddStmt(E->getLHS());
663  Record.AddStmt(E->getRHS());
664  Record.AddSourceLocation(E->getQuestionLoc());
665  Record.AddSourceLocation(E->getColonLoc());
667 }
668 
669 void
670 ASTStmtWriter::VisitBinaryConditionalOperator(BinaryConditionalOperator *E) {
671  VisitExpr(E);
672  Record.AddStmt(E->getOpaqueValue());
673  Record.AddStmt(E->getCommon());
674  Record.AddStmt(E->getCond());
675  Record.AddStmt(E->getTrueExpr());
676  Record.AddStmt(E->getFalseExpr());
677  Record.AddSourceLocation(E->getQuestionLoc());
678  Record.AddSourceLocation(E->getColonLoc());
680 }
681 
682 void ASTStmtWriter::VisitImplicitCastExpr(ImplicitCastExpr *E) {
683  VisitCastExpr(E);
684 
685  if (E->path_size() == 0)
686  AbbrevToUse = Writer.getExprImplicitCastAbbrev();
687 
689 }
690 
691 void ASTStmtWriter::VisitExplicitCastExpr(ExplicitCastExpr *E) {
692  VisitCastExpr(E);
694 }
695 
696 void ASTStmtWriter::VisitCStyleCastExpr(CStyleCastExpr *E) {
697  VisitExplicitCastExpr(E);
698  Record.AddSourceLocation(E->getLParenLoc());
699  Record.AddSourceLocation(E->getRParenLoc());
701 }
702 
703 void ASTStmtWriter::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
704  VisitExpr(E);
705  Record.AddSourceLocation(E->getLParenLoc());
707  Record.AddStmt(E->getInitializer());
708  Record.push_back(E->isFileScope());
710 }
711 
712 void ASTStmtWriter::VisitExtVectorElementExpr(ExtVectorElementExpr *E) {
713  VisitExpr(E);
714  Record.AddStmt(E->getBase());
715  Record.AddIdentifierRef(&E->getAccessor());
716  Record.AddSourceLocation(E->getAccessorLoc());
718 }
719 
720 void ASTStmtWriter::VisitInitListExpr(InitListExpr *E) {
721  VisitExpr(E);
722  // NOTE: only add the (possibly null) syntactic form.
723  // No need to serialize the isSemanticForm flag and the semantic form.
724  Record.AddStmt(E->getSyntacticForm());
725  Record.AddSourceLocation(E->getLBraceLoc());
726  Record.AddSourceLocation(E->getRBraceLoc());
727  bool isArrayFiller = E->ArrayFillerOrUnionFieldInit.is<Expr*>();
728  Record.push_back(isArrayFiller);
729  if (isArrayFiller)
730  Record.AddStmt(E->getArrayFiller());
731  else
733  Record.push_back(E->hadArrayRangeDesignator());
734  Record.push_back(E->getNumInits());
735  if (isArrayFiller) {
736  // ArrayFiller may have filled "holes" due to designated initializer.
737  // Replace them by 0 to indicate that the filler goes in that place.
738  Expr *filler = E->getArrayFiller();
739  for (unsigned I = 0, N = E->getNumInits(); I != N; ++I)
740  Record.AddStmt(E->getInit(I) != filler ? E->getInit(I) : nullptr);
741  } else {
742  for (unsigned I = 0, N = E->getNumInits(); I != N; ++I)
743  Record.AddStmt(E->getInit(I));
744  }
746 }
747 
748 void ASTStmtWriter::VisitDesignatedInitExpr(DesignatedInitExpr *E) {
749  VisitExpr(E);
750  Record.push_back(E->getNumSubExprs());
751  for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
752  Record.AddStmt(E->getSubExpr(I));
754  Record.push_back(E->usesGNUSyntax());
755  for (const DesignatedInitExpr::Designator &D : E->designators()) {
756  if (D.isFieldDesignator()) {
757  if (FieldDecl *Field = D.getField()) {
759  Record.AddDeclRef(Field);
760  } else {
762  Record.AddIdentifierRef(D.getFieldName());
763  }
764  Record.AddSourceLocation(D.getDotLoc());
765  Record.AddSourceLocation(D.getFieldLoc());
766  } else if (D.isArrayDesignator()) {
768  Record.push_back(D.getFirstExprIndex());
769  Record.AddSourceLocation(D.getLBracketLoc());
770  Record.AddSourceLocation(D.getRBracketLoc());
771  } else {
772  assert(D.isArrayRangeDesignator() && "Unknown designator");
774  Record.push_back(D.getFirstExprIndex());
775  Record.AddSourceLocation(D.getLBracketLoc());
776  Record.AddSourceLocation(D.getEllipsisLoc());
777  Record.AddSourceLocation(D.getRBracketLoc());
778  }
779  }
781 }
782 
783 void ASTStmtWriter::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) {
784  VisitExpr(E);
785  Record.AddStmt(E->getBase());
786  Record.AddStmt(E->getUpdater());
788 }
789 
790 void ASTStmtWriter::VisitNoInitExpr(NoInitExpr *E) {
791  VisitExpr(E);
793 }
794 
795 void ASTStmtWriter::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) {
796  VisitExpr(E);
798 }
799 
800 void ASTStmtWriter::VisitVAArgExpr(VAArgExpr *E) {
801  VisitExpr(E);
802  Record.AddStmt(E->getSubExpr());
804  Record.AddSourceLocation(E->getBuiltinLoc());
805  Record.AddSourceLocation(E->getRParenLoc());
806  Record.push_back(E->isMicrosoftABI());
808 }
809 
810 void ASTStmtWriter::VisitAddrLabelExpr(AddrLabelExpr *E) {
811  VisitExpr(E);
812  Record.AddSourceLocation(E->getAmpAmpLoc());
813  Record.AddSourceLocation(E->getLabelLoc());
814  Record.AddDeclRef(E->getLabel());
816 }
817 
818 void ASTStmtWriter::VisitStmtExpr(StmtExpr *E) {
819  VisitExpr(E);
820  Record.AddStmt(E->getSubStmt());
821  Record.AddSourceLocation(E->getLParenLoc());
822  Record.AddSourceLocation(E->getRParenLoc());
824 }
825 
826 void ASTStmtWriter::VisitChooseExpr(ChooseExpr *E) {
827  VisitExpr(E);
828  Record.AddStmt(E->getCond());
829  Record.AddStmt(E->getLHS());
830  Record.AddStmt(E->getRHS());
831  Record.AddSourceLocation(E->getBuiltinLoc());
832  Record.AddSourceLocation(E->getRParenLoc());
833  Record.push_back(E->isConditionDependent() ? false : E->isConditionTrue());
835 }
836 
837 void ASTStmtWriter::VisitGNUNullExpr(GNUNullExpr *E) {
838  VisitExpr(E);
839  Record.AddSourceLocation(E->getTokenLocation());
841 }
842 
843 void ASTStmtWriter::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
844  VisitExpr(E);
845  Record.push_back(E->getNumSubExprs());
846  for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
847  Record.AddStmt(E->getExpr(I));
848  Record.AddSourceLocation(E->getBuiltinLoc());
849  Record.AddSourceLocation(E->getRParenLoc());
851 }
852 
853 void ASTStmtWriter::VisitConvertVectorExpr(ConvertVectorExpr *E) {
854  VisitExpr(E);
855  Record.AddSourceLocation(E->getBuiltinLoc());
856  Record.AddSourceLocation(E->getRParenLoc());
858  Record.AddStmt(E->getSrcExpr());
860 }
861 
862 void ASTStmtWriter::VisitBlockExpr(BlockExpr *E) {
863  VisitExpr(E);
864  Record.AddDeclRef(E->getBlockDecl());
866 }
867 
868 void ASTStmtWriter::VisitGenericSelectionExpr(GenericSelectionExpr *E) {
869  VisitExpr(E);
870  Record.push_back(E->getNumAssocs());
871 
872  Record.AddStmt(E->getControllingExpr());
873  for (unsigned I = 0, N = E->getNumAssocs(); I != N; ++I) {
875  Record.AddStmt(E->getAssocExpr(I));
876  }
877  Record.push_back(E->isResultDependent() ? -1U : E->getResultIndex());
878 
879  Record.AddSourceLocation(E->getGenericLoc());
880  Record.AddSourceLocation(E->getDefaultLoc());
881  Record.AddSourceLocation(E->getRParenLoc());
883 }
884 
885 void ASTStmtWriter::VisitPseudoObjectExpr(PseudoObjectExpr *E) {
886  VisitExpr(E);
887  Record.push_back(E->getNumSemanticExprs());
888 
889  // Push the result index. Currently, this needs to exactly match
890  // the encoding used internally for ResultIndex.
891  unsigned result = E->getResultExprIndex();
892  result = (result == PseudoObjectExpr::NoResult ? 0 : result + 1);
893  Record.push_back(result);
894 
895  Record.AddStmt(E->getSyntacticForm());
897  i = E->semantics_begin(), e = E->semantics_end(); i != e; ++i) {
898  Record.AddStmt(*i);
899  }
901 }
902 
903 void ASTStmtWriter::VisitAtomicExpr(AtomicExpr *E) {
904  VisitExpr(E);
905  Record.push_back(E->getOp());
906  for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
907  Record.AddStmt(E->getSubExprs()[I]);
908  Record.AddSourceLocation(E->getBuiltinLoc());
909  Record.AddSourceLocation(E->getRParenLoc());
911 }
912 
913 //===----------------------------------------------------------------------===//
914 // Objective-C Expressions and Statements.
915 //===----------------------------------------------------------------------===//
916 
917 void ASTStmtWriter::VisitObjCStringLiteral(ObjCStringLiteral *E) {
918  VisitExpr(E);
919  Record.AddStmt(E->getString());
920  Record.AddSourceLocation(E->getAtLoc());
922 }
923 
924 void ASTStmtWriter::VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
925  VisitExpr(E);
926  Record.AddStmt(E->getSubExpr());
927  Record.AddDeclRef(E->getBoxingMethod());
928  Record.AddSourceRange(E->getSourceRange());
930 }
931 
932 void ASTStmtWriter::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
933  VisitExpr(E);
934  Record.push_back(E->getNumElements());
935  for (unsigned i = 0; i < E->getNumElements(); i++)
936  Record.AddStmt(E->getElement(i));
938  Record.AddSourceRange(E->getSourceRange());
940 }
941 
942 void ASTStmtWriter::VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *E) {
943  VisitExpr(E);
944  Record.push_back(E->getNumElements());
945  Record.push_back(E->HasPackExpansions);
946  for (unsigned i = 0; i < E->getNumElements(); i++) {
948  Record.AddStmt(Element.Key);
949  Record.AddStmt(Element.Value);
950  if (E->HasPackExpansions) {
951  Record.AddSourceLocation(Element.EllipsisLoc);
952  unsigned NumExpansions = 0;
953  if (Element.NumExpansions)
954  NumExpansions = *Element.NumExpansions + 1;
955  Record.push_back(NumExpansions);
956  }
957  }
958 
960  Record.AddSourceRange(E->getSourceRange());
962 }
963 
964 void ASTStmtWriter::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
965  VisitExpr(E);
967  Record.AddSourceLocation(E->getAtLoc());
968  Record.AddSourceLocation(E->getRParenLoc());
970 }
971 
972 void ASTStmtWriter::VisitObjCSelectorExpr(ObjCSelectorExpr *E) {
973  VisitExpr(E);
974  Record.AddSelectorRef(E->getSelector());
975  Record.AddSourceLocation(E->getAtLoc());
976  Record.AddSourceLocation(E->getRParenLoc());
978 }
979 
980 void ASTStmtWriter::VisitObjCProtocolExpr(ObjCProtocolExpr *E) {
981  VisitExpr(E);
982  Record.AddDeclRef(E->getProtocol());
983  Record.AddSourceLocation(E->getAtLoc());
984  Record.AddSourceLocation(E->ProtoLoc);
985  Record.AddSourceLocation(E->getRParenLoc());
987 }
988 
989 void ASTStmtWriter::VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) {
990  VisitExpr(E);
991  Record.AddDeclRef(E->getDecl());
992  Record.AddSourceLocation(E->getLocation());
993  Record.AddSourceLocation(E->getOpLoc());
994  Record.AddStmt(E->getBase());
995  Record.push_back(E->isArrow());
996  Record.push_back(E->isFreeIvar());
998 }
999 
1000 void ASTStmtWriter::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
1001  VisitExpr(E);
1002  Record.push_back(E->SetterAndMethodRefFlags.getInt());
1003  Record.push_back(E->isImplicitProperty());
1004  if (E->isImplicitProperty()) {
1007  } else {
1008  Record.AddDeclRef(E->getExplicitProperty());
1009  }
1010  Record.AddSourceLocation(E->getLocation());
1012  if (E->isObjectReceiver()) {
1013  Record.push_back(0);
1014  Record.AddStmt(E->getBase());
1015  } else if (E->isSuperReceiver()) {
1016  Record.push_back(1);
1017  Record.AddTypeRef(E->getSuperReceiverType());
1018  } else {
1019  Record.push_back(2);
1020  Record.AddDeclRef(E->getClassReceiver());
1021  }
1022 
1024 }
1025 
1026 void ASTStmtWriter::VisitObjCSubscriptRefExpr(ObjCSubscriptRefExpr *E) {
1027  VisitExpr(E);
1028  Record.AddSourceLocation(E->getRBracket());
1029  Record.AddStmt(E->getBaseExpr());
1030  Record.AddStmt(E->getKeyExpr());
1031  Record.AddDeclRef(E->getAtIndexMethodDecl());
1032  Record.AddDeclRef(E->setAtIndexMethodDecl());
1033 
1035 }
1036 
1037 void ASTStmtWriter::VisitObjCMessageExpr(ObjCMessageExpr *E) {
1038  VisitExpr(E);
1039  Record.push_back(E->getNumArgs());
1040  Record.push_back(E->getNumStoredSelLocs());
1041  Record.push_back(E->SelLocsKind);
1042  Record.push_back(E->isDelegateInitCall());
1043  Record.push_back(E->IsImplicit);
1044  Record.push_back((unsigned)E->getReceiverKind()); // FIXME: stable encoding
1045  switch (E->getReceiverKind()) {
1047  Record.AddStmt(E->getInstanceReceiver());
1048  break;
1049 
1052  break;
1053 
1056  Record.AddTypeRef(E->getSuperType());
1057  Record.AddSourceLocation(E->getSuperLoc());
1058  break;
1059  }
1060 
1061  if (E->getMethodDecl()) {
1062  Record.push_back(1);
1063  Record.AddDeclRef(E->getMethodDecl());
1064  } else {
1065  Record.push_back(0);
1066  Record.AddSelectorRef(E->getSelector());
1067  }
1068 
1069  Record.AddSourceLocation(E->getLeftLoc());
1070  Record.AddSourceLocation(E->getRightLoc());
1071 
1072  for (CallExpr::arg_iterator Arg = E->arg_begin(), ArgEnd = E->arg_end();
1073  Arg != ArgEnd; ++Arg)
1074  Record.AddStmt(*Arg);
1075 
1076  SourceLocation *Locs = E->getStoredSelLocs();
1077  for (unsigned i = 0, e = E->getNumStoredSelLocs(); i != e; ++i)
1078  Record.AddSourceLocation(Locs[i]);
1079 
1081 }
1082 
1083 void ASTStmtWriter::VisitObjCForCollectionStmt(ObjCForCollectionStmt *S) {
1084  VisitStmt(S);
1085  Record.AddStmt(S->getElement());
1086  Record.AddStmt(S->getCollection());
1087  Record.AddStmt(S->getBody());
1088  Record.AddSourceLocation(S->getForLoc());
1089  Record.AddSourceLocation(S->getRParenLoc());
1091 }
1092 
1093 void ASTStmtWriter::VisitObjCAtCatchStmt(ObjCAtCatchStmt *S) {
1094  Record.AddStmt(S->getCatchBody());
1095  Record.AddDeclRef(S->getCatchParamDecl());
1096  Record.AddSourceLocation(S->getAtCatchLoc());
1097  Record.AddSourceLocation(S->getRParenLoc());
1099 }
1100 
1101 void ASTStmtWriter::VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S) {
1102  Record.AddStmt(S->getFinallyBody());
1103  Record.AddSourceLocation(S->getAtFinallyLoc());
1105 }
1106 
1107 void ASTStmtWriter::VisitObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S) {
1108  Record.AddStmt(S->getSubStmt());
1109  Record.AddSourceLocation(S->getAtLoc());
1111 }
1112 
1113 void ASTStmtWriter::VisitObjCAtTryStmt(ObjCAtTryStmt *S) {
1114  Record.push_back(S->getNumCatchStmts());
1115  Record.push_back(S->getFinallyStmt() != nullptr);
1116  Record.AddStmt(S->getTryBody());
1117  for (unsigned I = 0, N = S->getNumCatchStmts(); I != N; ++I)
1118  Record.AddStmt(S->getCatchStmt(I));
1119  if (S->getFinallyStmt())
1120  Record.AddStmt(S->getFinallyStmt());
1121  Record.AddSourceLocation(S->getAtTryLoc());
1123 }
1124 
1125 void ASTStmtWriter::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
1126  Record.AddStmt(S->getSynchExpr());
1127  Record.AddStmt(S->getSynchBody());
1130 }
1131 
1132 void ASTStmtWriter::VisitObjCAtThrowStmt(ObjCAtThrowStmt *S) {
1133  Record.AddStmt(S->getThrowExpr());
1134  Record.AddSourceLocation(S->getThrowLoc());
1136 }
1137 
1138 void ASTStmtWriter::VisitObjCBoolLiteralExpr(ObjCBoolLiteralExpr *E) {
1139  VisitExpr(E);
1140  Record.push_back(E->getValue());
1141  Record.AddSourceLocation(E->getLocation());
1143 }
1144 
1145 void ASTStmtWriter::VisitObjCAvailabilityCheckExpr(ObjCAvailabilityCheckExpr *E) {
1146  VisitExpr(E);
1147  Record.AddSourceRange(E->getSourceRange());
1148  Record.AddVersionTuple(E->getVersion());
1150 }
1151 
1152 //===----------------------------------------------------------------------===//
1153 // C++ Expressions and Statements.
1154 //===----------------------------------------------------------------------===//
1155 
1156 void ASTStmtWriter::VisitCXXCatchStmt(CXXCatchStmt *S) {
1157  VisitStmt(S);
1158  Record.AddSourceLocation(S->getCatchLoc());
1159  Record.AddDeclRef(S->getExceptionDecl());
1160  Record.AddStmt(S->getHandlerBlock());
1162 }
1163 
1164 void ASTStmtWriter::VisitCXXTryStmt(CXXTryStmt *S) {
1165  VisitStmt(S);
1166  Record.push_back(S->getNumHandlers());
1167  Record.AddSourceLocation(S->getTryLoc());
1168  Record.AddStmt(S->getTryBlock());
1169  for (unsigned i = 0, e = S->getNumHandlers(); i != e; ++i)
1170  Record.AddStmt(S->getHandler(i));
1172 }
1173 
1174 void ASTStmtWriter::VisitCXXForRangeStmt(CXXForRangeStmt *S) {
1175  VisitStmt(S);
1176  Record.AddSourceLocation(S->getForLoc());
1177  Record.AddSourceLocation(S->getCoawaitLoc());
1178  Record.AddSourceLocation(S->getColonLoc());
1179  Record.AddSourceLocation(S->getRParenLoc());
1180  Record.AddStmt(S->getRangeStmt());
1181  Record.AddStmt(S->getBeginStmt());
1182  Record.AddStmt(S->getEndStmt());
1183  Record.AddStmt(S->getCond());
1184  Record.AddStmt(S->getInc());
1185  Record.AddStmt(S->getLoopVarStmt());
1186  Record.AddStmt(S->getBody());
1188 }
1189 
1190 void ASTStmtWriter::VisitMSDependentExistsStmt(MSDependentExistsStmt *S) {
1191  VisitStmt(S);
1192  Record.AddSourceLocation(S->getKeywordLoc());
1193  Record.push_back(S->isIfExists());
1195  Record.AddDeclarationNameInfo(S->getNameInfo());
1196  Record.AddStmt(S->getSubStmt());
1198 }
1199 
1200 void ASTStmtWriter::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
1201  VisitCallExpr(E);
1202  Record.push_back(E->getOperator());
1203  Record.AddSourceRange(E->Range);
1204  Record.push_back(E->isFPContractable());
1206 }
1207 
1208 void ASTStmtWriter::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) {
1209  VisitCallExpr(E);
1211 }
1212 
1213 void ASTStmtWriter::VisitCXXConstructExpr(CXXConstructExpr *E) {
1214  VisitExpr(E);
1215  Record.push_back(E->getNumArgs());
1216  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1217  Record.AddStmt(E->getArg(I));
1218  Record.AddDeclRef(E->getConstructor());
1219  Record.AddSourceLocation(E->getLocation());
1220  Record.push_back(E->isElidable());
1221  Record.push_back(E->hadMultipleCandidates());
1222  Record.push_back(E->isListInitialization());
1225  Record.push_back(E->getConstructionKind()); // FIXME: stable encoding
1226  Record.AddSourceRange(E->getParenOrBraceRange());
1228 }
1229 
1230 void ASTStmtWriter::VisitCXXInheritedCtorInitExpr(CXXInheritedCtorInitExpr *E) {
1231  VisitExpr(E);
1232  Record.AddDeclRef(E->getConstructor());
1233  Record.AddSourceLocation(E->getLocation());
1234  Record.push_back(E->constructsVBase());
1235  Record.push_back(E->inheritedFromVBase());
1237 }
1238 
1239 void ASTStmtWriter::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
1240  VisitCXXConstructExpr(E);
1241  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1243 }
1244 
1245 void ASTStmtWriter::VisitLambdaExpr(LambdaExpr *E) {
1246  VisitExpr(E);
1247  Record.push_back(E->NumCaptures);
1248  unsigned NumArrayIndexVars = 0;
1249  if (E->HasArrayIndexVars)
1250  NumArrayIndexVars = E->getArrayIndexStarts()[E->NumCaptures];
1251  Record.push_back(NumArrayIndexVars);
1252  Record.AddSourceRange(E->IntroducerRange);
1253  Record.push_back(E->CaptureDefault); // FIXME: stable encoding
1254  Record.AddSourceLocation(E->CaptureDefaultLoc);
1255  Record.push_back(E->ExplicitParams);
1256  Record.push_back(E->ExplicitResultType);
1257  Record.AddSourceLocation(E->ClosingBrace);
1258 
1259  // Add capture initializers.
1261  CEnd = E->capture_init_end();
1262  C != CEnd; ++C) {
1263  Record.AddStmt(*C);
1264  }
1265 
1266  // Add array index variables, if any.
1267  if (NumArrayIndexVars) {
1268  Record.append(E->getArrayIndexStarts(),
1269  E->getArrayIndexStarts() + E->NumCaptures + 1);
1270  VarDecl **ArrayIndexVars = E->getArrayIndexVars();
1271  for (unsigned I = 0; I != NumArrayIndexVars; ++I)
1272  Record.AddDeclRef(ArrayIndexVars[I]);
1273  }
1274 
1276 }
1277 
1278 void ASTStmtWriter::VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E) {
1279  VisitExpr(E);
1280  Record.AddStmt(E->getSubExpr());
1282 }
1283 
1284 void ASTStmtWriter::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) {
1285  VisitExplicitCastExpr(E);
1287  Record.AddSourceRange(E->getAngleBrackets());
1288 }
1289 
1290 void ASTStmtWriter::VisitCXXStaticCastExpr(CXXStaticCastExpr *E) {
1291  VisitCXXNamedCastExpr(E);
1293 }
1294 
1295 void ASTStmtWriter::VisitCXXDynamicCastExpr(CXXDynamicCastExpr *E) {
1296  VisitCXXNamedCastExpr(E);
1298 }
1299 
1300 void ASTStmtWriter::VisitCXXReinterpretCastExpr(CXXReinterpretCastExpr *E) {
1301  VisitCXXNamedCastExpr(E);
1303 }
1304 
1305 void ASTStmtWriter::VisitCXXConstCastExpr(CXXConstCastExpr *E) {
1306  VisitCXXNamedCastExpr(E);
1308 }
1309 
1310 void ASTStmtWriter::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E) {
1311  VisitExplicitCastExpr(E);
1312  Record.AddSourceLocation(E->getLParenLoc());
1313  Record.AddSourceLocation(E->getRParenLoc());
1315 }
1316 
1317 void ASTStmtWriter::VisitUserDefinedLiteral(UserDefinedLiteral *E) {
1318  VisitCallExpr(E);
1319  Record.AddSourceLocation(E->UDSuffixLoc);
1321 }
1322 
1323 void ASTStmtWriter::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) {
1324  VisitExpr(E);
1325  Record.push_back(E->getValue());
1326  Record.AddSourceLocation(E->getLocation());
1328 }
1329 
1330 void ASTStmtWriter::VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E) {
1331  VisitExpr(E);
1332  Record.AddSourceLocation(E->getLocation());
1334 }
1335 
1336 void ASTStmtWriter::VisitCXXTypeidExpr(CXXTypeidExpr *E) {
1337  VisitExpr(E);
1338  Record.AddSourceRange(E->getSourceRange());
1339  if (E->isTypeOperand()) {
1342  } else {
1343  Record.AddStmt(E->getExprOperand());
1345  }
1346 }
1347 
1348 void ASTStmtWriter::VisitCXXThisExpr(CXXThisExpr *E) {
1349  VisitExpr(E);
1350  Record.AddSourceLocation(E->getLocation());
1351  Record.push_back(E->isImplicit());
1353 }
1354 
1355 void ASTStmtWriter::VisitCXXThrowExpr(CXXThrowExpr *E) {
1356  VisitExpr(E);
1357  Record.AddSourceLocation(E->getThrowLoc());
1358  Record.AddStmt(E->getSubExpr());
1359  Record.push_back(E->isThrownVariableInScope());
1361 }
1362 
1363 void ASTStmtWriter::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
1364  VisitExpr(E);
1365  Record.AddDeclRef(E->getParam());
1366  Record.AddSourceLocation(E->getUsedLocation());
1368 }
1369 
1370 void ASTStmtWriter::VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E) {
1371  VisitExpr(E);
1372  Record.AddDeclRef(E->getField());
1373  Record.AddSourceLocation(E->getExprLoc());
1375 }
1376 
1377 void ASTStmtWriter::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
1378  VisitExpr(E);
1379  Record.AddCXXTemporary(E->getTemporary());
1380  Record.AddStmt(E->getSubExpr());
1382 }
1383 
1384 void ASTStmtWriter::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
1385  VisitExpr(E);
1386  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1387  Record.AddSourceLocation(E->getRParenLoc());
1389 }
1390 
1391 void ASTStmtWriter::VisitCXXNewExpr(CXXNewExpr *E) {
1392  VisitExpr(E);
1393  Record.push_back(E->isGlobalNew());
1394  Record.push_back(E->isArray());
1396  Record.push_back(E->getNumPlacementArgs());
1397  Record.push_back(E->StoredInitializationStyle);
1398  Record.AddDeclRef(E->getOperatorNew());
1399  Record.AddDeclRef(E->getOperatorDelete());
1401  Record.AddSourceRange(E->getTypeIdParens());
1402  Record.AddSourceRange(E->getSourceRange());
1403  Record.AddSourceRange(E->getDirectInitRange());
1404  for (CXXNewExpr::arg_iterator I = E->raw_arg_begin(), e = E->raw_arg_end();
1405  I != e; ++I)
1406  Record.AddStmt(*I);
1407 
1409 }
1410 
1411 void ASTStmtWriter::VisitCXXDeleteExpr(CXXDeleteExpr *E) {
1412  VisitExpr(E);
1413  Record.push_back(E->isGlobalDelete());
1414  Record.push_back(E->isArrayForm());
1415  Record.push_back(E->isArrayFormAsWritten());
1417  Record.AddDeclRef(E->getOperatorDelete());
1418  Record.AddStmt(E->getArgument());
1419  Record.AddSourceLocation(E->getSourceRange().getBegin());
1420 
1422 }
1423 
1424 void ASTStmtWriter::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
1425  VisitExpr(E);
1426 
1427  Record.AddStmt(E->getBase());
1428  Record.push_back(E->isArrow());
1429  Record.AddSourceLocation(E->getOperatorLoc());
1431  Record.AddTypeSourceInfo(E->getScopeTypeInfo());
1432  Record.AddSourceLocation(E->getColonColonLoc());
1433  Record.AddSourceLocation(E->getTildeLoc());
1434 
1435  // PseudoDestructorTypeStorage.
1437  if (E->getDestroyedTypeIdentifier())
1439  else
1441 
1443 }
1444 
1445 void ASTStmtWriter::VisitExprWithCleanups(ExprWithCleanups *E) {
1446  VisitExpr(E);
1447  Record.push_back(E->getNumObjects());
1448  for (unsigned i = 0, e = E->getNumObjects(); i != e; ++i)
1449  Record.AddDeclRef(E->getObject(i));
1450 
1451  Record.push_back(E->cleanupsHaveSideEffects());
1452  Record.AddStmt(E->getSubExpr());
1454 }
1455 
1456 void
1457 ASTStmtWriter::VisitCXXDependentScopeMemberExpr(CXXDependentScopeMemberExpr *E){
1458  VisitExpr(E);
1459 
1460  // Don't emit anything here, HasTemplateKWAndArgsInfo must be
1461  // emitted first.
1462 
1463  Record.push_back(E->HasTemplateKWAndArgsInfo);
1464  if (E->HasTemplateKWAndArgsInfo) {
1465  const ASTTemplateKWAndArgsInfo &ArgInfo =
1466  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
1467  Record.push_back(ArgInfo.NumTemplateArgs);
1468  AddTemplateKWAndArgsInfo(ArgInfo,
1469  E->getTrailingObjects<TemplateArgumentLoc>());
1470  }
1471 
1472  if (!E->isImplicitAccess())
1473  Record.AddStmt(E->getBase());
1474  else
1475  Record.AddStmt(nullptr);
1476  Record.AddTypeRef(E->getBaseType());
1477  Record.push_back(E->isArrow());
1478  Record.AddSourceLocation(E->getOperatorLoc());
1481  Record.AddDeclarationNameInfo(E->MemberNameInfo);
1483 }
1484 
1485 void
1486 ASTStmtWriter::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) {
1487  VisitExpr(E);
1488 
1489  // Don't emit anything here, HasTemplateKWAndArgsInfo must be
1490  // emitted first.
1491 
1492  Record.push_back(E->HasTemplateKWAndArgsInfo);
1493  if (E->HasTemplateKWAndArgsInfo) {
1494  const ASTTemplateKWAndArgsInfo &ArgInfo =
1495  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
1496  Record.push_back(ArgInfo.NumTemplateArgs);
1497  AddTemplateKWAndArgsInfo(ArgInfo,
1498  E->getTrailingObjects<TemplateArgumentLoc>());
1499  }
1500 
1502  Record.AddDeclarationNameInfo(E->NameInfo);
1504 }
1505 
1506 void
1507 ASTStmtWriter::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E) {
1508  VisitExpr(E);
1509  Record.push_back(E->arg_size());
1511  ArgI = E->arg_begin(), ArgE = E->arg_end(); ArgI != ArgE; ++ArgI)
1512  Record.AddStmt(*ArgI);
1513  Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1514  Record.AddSourceLocation(E->getLParenLoc());
1515  Record.AddSourceLocation(E->getRParenLoc());
1517 }
1518 
1519 void ASTStmtWriter::VisitOverloadExpr(OverloadExpr *E) {
1520  VisitExpr(E);
1521 
1522  // Don't emit anything here, HasTemplateKWAndArgsInfo must be
1523  // emitted first.
1524 
1526  if (E->HasTemplateKWAndArgsInfo) {
1527  const ASTTemplateKWAndArgsInfo &ArgInfo =
1529  Record.push_back(ArgInfo.NumTemplateArgs);
1531  }
1532 
1533  Record.push_back(E->getNumDecls());
1535  OvI = E->decls_begin(), OvE = E->decls_end(); OvI != OvE; ++OvI) {
1536  Record.AddDeclRef(OvI.getDecl());
1537  Record.push_back(OvI.getAccess());
1538  }
1539 
1540  Record.AddDeclarationNameInfo(E->NameInfo);
1542 }
1543 
1544 void ASTStmtWriter::VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
1545  VisitOverloadExpr(E);
1546  Record.push_back(E->isArrow());
1547  Record.push_back(E->hasUnresolvedUsing());
1548  Record.AddStmt(!E->isImplicitAccess() ? E->getBase() : nullptr);
1549  Record.AddTypeRef(E->getBaseType());
1550  Record.AddSourceLocation(E->getOperatorLoc());
1552 }
1553 
1554 void ASTStmtWriter::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) {
1555  VisitOverloadExpr(E);
1556  Record.push_back(E->requiresADL());
1557  Record.push_back(E->isOverloaded());
1558  Record.AddDeclRef(E->getNamingClass());
1560 }
1561 
1562 void ASTStmtWriter::VisitTypeTraitExpr(TypeTraitExpr *E) {
1563  VisitExpr(E);
1564  Record.push_back(E->TypeTraitExprBits.NumArgs);
1565  Record.push_back(E->TypeTraitExprBits.Kind); // FIXME: Stable encoding
1566  Record.push_back(E->TypeTraitExprBits.Value);
1567  Record.AddSourceRange(E->getSourceRange());
1568  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1569  Record.AddTypeSourceInfo(E->getArg(I));
1571 }
1572 
1573 void ASTStmtWriter::VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E) {
1574  VisitExpr(E);
1575  Record.push_back(E->getTrait());
1576  Record.push_back(E->getValue());
1577  Record.AddSourceRange(E->getSourceRange());
1580 }
1581 
1582 void ASTStmtWriter::VisitExpressionTraitExpr(ExpressionTraitExpr *E) {
1583  VisitExpr(E);
1584  Record.push_back(E->getTrait());
1585  Record.push_back(E->getValue());
1586  Record.AddSourceRange(E->getSourceRange());
1587  Record.AddStmt(E->getQueriedExpression());
1589 }
1590 
1591 void ASTStmtWriter::VisitCXXNoexceptExpr(CXXNoexceptExpr *E) {
1592  VisitExpr(E);
1593  Record.push_back(E->getValue());
1594  Record.AddSourceRange(E->getSourceRange());
1595  Record.AddStmt(E->getOperand());
1597 }
1598 
1599 void ASTStmtWriter::VisitPackExpansionExpr(PackExpansionExpr *E) {
1600  VisitExpr(E);
1601  Record.AddSourceLocation(E->getEllipsisLoc());
1602  Record.push_back(E->NumExpansions);
1603  Record.AddStmt(E->getPattern());
1605 }
1606 
1607 void ASTStmtWriter::VisitSizeOfPackExpr(SizeOfPackExpr *E) {
1608  VisitExpr(E);
1609  Record.push_back(E->isPartiallySubstituted() ? E->getPartialArguments().size()
1610  : 0);
1611  Record.AddSourceLocation(E->OperatorLoc);
1612  Record.AddSourceLocation(E->PackLoc);
1613  Record.AddSourceLocation(E->RParenLoc);
1614  Record.AddDeclRef(E->Pack);
1615  if (E->isPartiallySubstituted()) {
1616  for (const auto &TA : E->getPartialArguments())
1617  Record.AddTemplateArgument(TA);
1618  } else if (!E->isValueDependent()) {
1619  Record.push_back(E->getPackLength());
1620  }
1622 }
1623 
1624 void ASTStmtWriter::VisitSubstNonTypeTemplateParmExpr(
1626  VisitExpr(E);
1627  Record.AddDeclRef(E->getParameter());
1628  Record.AddSourceLocation(E->getNameLoc());
1629  Record.AddStmt(E->getReplacement());
1631 }
1632 
1633 void ASTStmtWriter::VisitSubstNonTypeTemplateParmPackExpr(
1635  VisitExpr(E);
1636  Record.AddDeclRef(E->getParameterPack());
1637  Record.AddTemplateArgument(E->getArgumentPack());
1640 }
1641 
1642 void ASTStmtWriter::VisitFunctionParmPackExpr(FunctionParmPackExpr *E) {
1643  VisitExpr(E);
1644  Record.push_back(E->getNumExpansions());
1645  Record.AddDeclRef(E->getParameterPack());
1647  for (FunctionParmPackExpr::iterator I = E->begin(), End = E->end();
1648  I != End; ++I)
1649  Record.AddDeclRef(*I);
1651 }
1652 
1653 void ASTStmtWriter::VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E) {
1654  VisitExpr(E);
1655  Record.AddStmt(E->getTemporary());
1656  Record.AddDeclRef(E->getExtendingDecl());
1657  Record.push_back(E->getManglingNumber());
1659 }
1660 
1661 void ASTStmtWriter::VisitCXXFoldExpr(CXXFoldExpr *E) {
1662  VisitExpr(E);
1663  Record.AddSourceLocation(E->LParenLoc);
1664  Record.AddSourceLocation(E->EllipsisLoc);
1665  Record.AddSourceLocation(E->RParenLoc);
1666  Record.AddStmt(E->SubExprs[0]);
1667  Record.AddStmt(E->SubExprs[1]);
1668  Record.push_back(E->Opcode);
1670 }
1671 
1672 void ASTStmtWriter::VisitOpaqueValueExpr(OpaqueValueExpr *E) {
1673  VisitExpr(E);
1674  Record.AddStmt(E->getSourceExpr());
1675  Record.AddSourceLocation(E->getLocation());
1677 }
1678 
1679 void ASTStmtWriter::VisitTypoExpr(TypoExpr *E) {
1680  VisitExpr(E);
1681  // TODO: Figure out sane writer behavior for a TypoExpr, if necessary
1682  llvm_unreachable("Cannot write TypoExpr nodes");
1683 }
1684 
1685 //===----------------------------------------------------------------------===//
1686 // CUDA Expressions and Statements.
1687 //===----------------------------------------------------------------------===//
1688 
1689 void ASTStmtWriter::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E) {
1690  VisitCallExpr(E);
1691  Record.AddStmt(E->getConfig());
1693 }
1694 
1695 //===----------------------------------------------------------------------===//
1696 // OpenCL Expressions and Statements.
1697 //===----------------------------------------------------------------------===//
1698 void ASTStmtWriter::VisitAsTypeExpr(AsTypeExpr *E) {
1699  VisitExpr(E);
1700  Record.AddSourceLocation(E->getBuiltinLoc());
1701  Record.AddSourceLocation(E->getRParenLoc());
1702  Record.AddStmt(E->getSrcExpr());
1704 }
1705 
1706 //===----------------------------------------------------------------------===//
1707 // Microsoft Expressions and Statements.
1708 //===----------------------------------------------------------------------===//
1709 void ASTStmtWriter::VisitMSPropertyRefExpr(MSPropertyRefExpr *E) {
1710  VisitExpr(E);
1711  Record.push_back(E->isArrow());
1712  Record.AddStmt(E->getBaseExpr());
1714  Record.AddSourceLocation(E->getMemberLoc());
1715  Record.AddDeclRef(E->getPropertyDecl());
1717 }
1718 
1719 void ASTStmtWriter::VisitMSPropertySubscriptExpr(MSPropertySubscriptExpr *E) {
1720  VisitExpr(E);
1721  Record.AddStmt(E->getBase());
1722  Record.AddStmt(E->getIdx());
1723  Record.AddSourceLocation(E->getRBracketLoc());
1725 }
1726 
1727 void ASTStmtWriter::VisitCXXUuidofExpr(CXXUuidofExpr *E) {
1728  VisitExpr(E);
1729  Record.AddSourceRange(E->getSourceRange());
1730  Record.AddString(E->getUuidStr());
1731  if (E->isTypeOperand()) {
1734  } else {
1735  Record.AddStmt(E->getExprOperand());
1737  }
1738 }
1739 
1740 void ASTStmtWriter::VisitSEHExceptStmt(SEHExceptStmt *S) {
1741  VisitStmt(S);
1742  Record.AddSourceLocation(S->getExceptLoc());
1743  Record.AddStmt(S->getFilterExpr());
1744  Record.AddStmt(S->getBlock());
1746 }
1747 
1748 void ASTStmtWriter::VisitSEHFinallyStmt(SEHFinallyStmt *S) {
1749  VisitStmt(S);
1750  Record.AddSourceLocation(S->getFinallyLoc());
1751  Record.AddStmt(S->getBlock());
1753 }
1754 
1755 void ASTStmtWriter::VisitSEHTryStmt(SEHTryStmt *S) {
1756  VisitStmt(S);
1757  Record.push_back(S->getIsCXXTry());
1758  Record.AddSourceLocation(S->getTryLoc());
1759  Record.AddStmt(S->getTryBlock());
1760  Record.AddStmt(S->getHandler());
1762 }
1763 
1764 void ASTStmtWriter::VisitSEHLeaveStmt(SEHLeaveStmt *S) {
1765  VisitStmt(S);
1766  Record.AddSourceLocation(S->getLeaveLoc());
1768 }
1769 
1770 //===----------------------------------------------------------------------===//
1771 // OpenMP Clauses.
1772 //===----------------------------------------------------------------------===//
1773 
1774 namespace clang {
1775 class OMPClauseWriter : public OMPClauseVisitor<OMPClauseWriter> {
1776  ASTRecordWriter &Record;
1777 public:
1778  OMPClauseWriter(ASTRecordWriter &Record) : Record(Record) {}
1779 #define OPENMP_CLAUSE(Name, Class) \
1780  void Visit##Class(Class *S);
1781 #include "clang/Basic/OpenMPKinds.def"
1782  void writeClause(OMPClause *C);
1785 };
1786 }
1787 
1789  Record.push_back(C->getClauseKind());
1790  Visit(C);
1791  Record.AddSourceLocation(C->getLocStart());
1792  Record.AddSourceLocation(C->getLocEnd());
1793 }
1794 
1796  Record.AddStmt(C->getPreInitStmt());
1797 }
1798 
1801  Record.AddStmt(C->getPostUpdateExpr());
1802 }
1803 
1804 void OMPClauseWriter::VisitOMPIfClause(OMPIfClause *C) {
1805  Record.push_back(C->getNameModifier());
1807  Record.AddSourceLocation(C->getColonLoc());
1808  Record.AddStmt(C->getCondition());
1809  Record.AddSourceLocation(C->getLParenLoc());
1810 }
1811 
1812 void OMPClauseWriter::VisitOMPFinalClause(OMPFinalClause *C) {
1813  Record.AddStmt(C->getCondition());
1814  Record.AddSourceLocation(C->getLParenLoc());
1815 }
1816 
1817 void OMPClauseWriter::VisitOMPNumThreadsClause(OMPNumThreadsClause *C) {
1818  Record.AddStmt(C->getNumThreads());
1819  Record.AddSourceLocation(C->getLParenLoc());
1820 }
1821 
1822 void OMPClauseWriter::VisitOMPSafelenClause(OMPSafelenClause *C) {
1823  Record.AddStmt(C->getSafelen());
1824  Record.AddSourceLocation(C->getLParenLoc());
1825 }
1826 
1827 void OMPClauseWriter::VisitOMPSimdlenClause(OMPSimdlenClause *C) {
1828  Record.AddStmt(C->getSimdlen());
1829  Record.AddSourceLocation(C->getLParenLoc());
1830 }
1831 
1832 void OMPClauseWriter::VisitOMPCollapseClause(OMPCollapseClause *C) {
1833  Record.AddStmt(C->getNumForLoops());
1834  Record.AddSourceLocation(C->getLParenLoc());
1835 }
1836 
1837 void OMPClauseWriter::VisitOMPDefaultClause(OMPDefaultClause *C) {
1838  Record.push_back(C->getDefaultKind());
1839  Record.AddSourceLocation(C->getLParenLoc());
1841 }
1842 
1843 void OMPClauseWriter::VisitOMPProcBindClause(OMPProcBindClause *C) {
1844  Record.push_back(C->getProcBindKind());
1845  Record.AddSourceLocation(C->getLParenLoc());
1847 }
1848 
1849 void OMPClauseWriter::VisitOMPScheduleClause(OMPScheduleClause *C) {
1851  Record.push_back(C->getScheduleKind());
1852  Record.push_back(C->getFirstScheduleModifier());
1853  Record.push_back(C->getSecondScheduleModifier());
1854  Record.AddStmt(C->getChunkSize());
1855  Record.AddSourceLocation(C->getLParenLoc());
1859  Record.AddSourceLocation(C->getCommaLoc());
1860 }
1861 
1862 void OMPClauseWriter::VisitOMPOrderedClause(OMPOrderedClause *C) {
1863  Record.AddStmt(C->getNumForLoops());
1864  Record.AddSourceLocation(C->getLParenLoc());
1865 }
1866 
1867 void OMPClauseWriter::VisitOMPNowaitClause(OMPNowaitClause *) {}
1868 
1869 void OMPClauseWriter::VisitOMPUntiedClause(OMPUntiedClause *) {}
1870 
1871 void OMPClauseWriter::VisitOMPMergeableClause(OMPMergeableClause *) {}
1872 
1873 void OMPClauseWriter::VisitOMPReadClause(OMPReadClause *) {}
1874 
1875 void OMPClauseWriter::VisitOMPWriteClause(OMPWriteClause *) {}
1876 
1877 void OMPClauseWriter::VisitOMPUpdateClause(OMPUpdateClause *) {}
1878 
1879 void OMPClauseWriter::VisitOMPCaptureClause(OMPCaptureClause *) {}
1880 
1881 void OMPClauseWriter::VisitOMPSeqCstClause(OMPSeqCstClause *) {}
1882 
1883 void OMPClauseWriter::VisitOMPThreadsClause(OMPThreadsClause *) {}
1884 
1885 void OMPClauseWriter::VisitOMPSIMDClause(OMPSIMDClause *) {}
1886 
1887 void OMPClauseWriter::VisitOMPNogroupClause(OMPNogroupClause *) {}
1888 
1889 void OMPClauseWriter::VisitOMPPrivateClause(OMPPrivateClause *C) {
1890  Record.push_back(C->varlist_size());
1891  Record.AddSourceLocation(C->getLParenLoc());
1892  for (auto *VE : C->varlists()) {
1893  Record.AddStmt(VE);
1894  }
1895  for (auto *VE : C->private_copies()) {
1896  Record.AddStmt(VE);
1897  }
1898 }
1899 
1900 void OMPClauseWriter::VisitOMPFirstprivateClause(OMPFirstprivateClause *C) {
1901  Record.push_back(C->varlist_size());
1903  Record.AddSourceLocation(C->getLParenLoc());
1904  for (auto *VE : C->varlists()) {
1905  Record.AddStmt(VE);
1906  }
1907  for (auto *VE : C->private_copies()) {
1908  Record.AddStmt(VE);
1909  }
1910  for (auto *VE : C->inits()) {
1911  Record.AddStmt(VE);
1912  }
1913 }
1914 
1915 void OMPClauseWriter::VisitOMPLastprivateClause(OMPLastprivateClause *C) {
1916  Record.push_back(C->varlist_size());
1918  Record.AddSourceLocation(C->getLParenLoc());
1919  for (auto *VE : C->varlists())
1920  Record.AddStmt(VE);
1921  for (auto *E : C->private_copies())
1922  Record.AddStmt(E);
1923  for (auto *E : C->source_exprs())
1924  Record.AddStmt(E);
1925  for (auto *E : C->destination_exprs())
1926  Record.AddStmt(E);
1927  for (auto *E : C->assignment_ops())
1928  Record.AddStmt(E);
1929 }
1930 
1931 void OMPClauseWriter::VisitOMPSharedClause(OMPSharedClause *C) {
1932  Record.push_back(C->varlist_size());
1933  Record.AddSourceLocation(C->getLParenLoc());
1934  for (auto *VE : C->varlists())
1935  Record.AddStmt(VE);
1936 }
1937 
1938 void OMPClauseWriter::VisitOMPReductionClause(OMPReductionClause *C) {
1939  Record.push_back(C->varlist_size());
1941  Record.AddSourceLocation(C->getLParenLoc());
1942  Record.AddSourceLocation(C->getColonLoc());
1944  Record.AddDeclarationNameInfo(C->getNameInfo());
1945  for (auto *VE : C->varlists())
1946  Record.AddStmt(VE);
1947  for (auto *VE : C->privates())
1948  Record.AddStmt(VE);
1949  for (auto *E : C->lhs_exprs())
1950  Record.AddStmt(E);
1951  for (auto *E : C->rhs_exprs())
1952  Record.AddStmt(E);
1953  for (auto *E : C->reduction_ops())
1954  Record.AddStmt(E);
1955 }
1956 
1957 void OMPClauseWriter::VisitOMPLinearClause(OMPLinearClause *C) {
1958  Record.push_back(C->varlist_size());
1960  Record.AddSourceLocation(C->getLParenLoc());
1961  Record.AddSourceLocation(C->getColonLoc());
1962  Record.push_back(C->getModifier());
1963  Record.AddSourceLocation(C->getModifierLoc());
1964  for (auto *VE : C->varlists()) {
1965  Record.AddStmt(VE);
1966  }
1967  for (auto *VE : C->privates()) {
1968  Record.AddStmt(VE);
1969  }
1970  for (auto *VE : C->inits()) {
1971  Record.AddStmt(VE);
1972  }
1973  for (auto *VE : C->updates()) {
1974  Record.AddStmt(VE);
1975  }
1976  for (auto *VE : C->finals()) {
1977  Record.AddStmt(VE);
1978  }
1979  Record.AddStmt(C->getStep());
1980  Record.AddStmt(C->getCalcStep());
1981 }
1982 
1983 void OMPClauseWriter::VisitOMPAlignedClause(OMPAlignedClause *C) {
1984  Record.push_back(C->varlist_size());
1985  Record.AddSourceLocation(C->getLParenLoc());
1986  Record.AddSourceLocation(C->getColonLoc());
1987  for (auto *VE : C->varlists())
1988  Record.AddStmt(VE);
1989  Record.AddStmt(C->getAlignment());
1990 }
1991 
1992 void OMPClauseWriter::VisitOMPCopyinClause(OMPCopyinClause *C) {
1993  Record.push_back(C->varlist_size());
1994  Record.AddSourceLocation(C->getLParenLoc());
1995  for (auto *VE : C->varlists())
1996  Record.AddStmt(VE);
1997  for (auto *E : C->source_exprs())
1998  Record.AddStmt(E);
1999  for (auto *E : C->destination_exprs())
2000  Record.AddStmt(E);
2001  for (auto *E : C->assignment_ops())
2002  Record.AddStmt(E);
2003 }
2004 
2005 void OMPClauseWriter::VisitOMPCopyprivateClause(OMPCopyprivateClause *C) {
2006  Record.push_back(C->varlist_size());
2007  Record.AddSourceLocation(C->getLParenLoc());
2008  for (auto *VE : C->varlists())
2009  Record.AddStmt(VE);
2010  for (auto *E : C->source_exprs())
2011  Record.AddStmt(E);
2012  for (auto *E : C->destination_exprs())
2013  Record.AddStmt(E);
2014  for (auto *E : C->assignment_ops())
2015  Record.AddStmt(E);
2016 }
2017 
2018 void OMPClauseWriter::VisitOMPFlushClause(OMPFlushClause *C) {
2019  Record.push_back(C->varlist_size());
2020  Record.AddSourceLocation(C->getLParenLoc());
2021  for (auto *VE : C->varlists())
2022  Record.AddStmt(VE);
2023 }
2024 
2025 void OMPClauseWriter::VisitOMPDependClause(OMPDependClause *C) {
2026  Record.push_back(C->varlist_size());
2027  Record.AddSourceLocation(C->getLParenLoc());
2028  Record.push_back(C->getDependencyKind());
2029  Record.AddSourceLocation(C->getDependencyLoc());
2030  Record.AddSourceLocation(C->getColonLoc());
2031  for (auto *VE : C->varlists())
2032  Record.AddStmt(VE);
2033  Record.AddStmt(C->getCounterValue());
2034 }
2035 
2036 void OMPClauseWriter::VisitOMPDeviceClause(OMPDeviceClause *C) {
2037  Record.AddStmt(C->getDevice());
2038  Record.AddSourceLocation(C->getLParenLoc());
2039 }
2040 
2041 void OMPClauseWriter::VisitOMPMapClause(OMPMapClause *C) {
2042  Record.push_back(C->varlist_size());
2043  Record.push_back(C->getUniqueDeclarationsNum());
2044  Record.push_back(C->getTotalComponentListNum());
2045  Record.push_back(C->getTotalComponentsNum());
2046  Record.AddSourceLocation(C->getLParenLoc());
2047  Record.push_back(C->getMapTypeModifier());
2048  Record.push_back(C->getMapType());
2049  Record.AddSourceLocation(C->getMapLoc());
2050  Record.AddSourceLocation(C->getColonLoc());
2051  for (auto *E : C->varlists())
2052  Record.AddStmt(E);
2053  for (auto *D : C->all_decls())
2054  Record.AddDeclRef(D);
2055  for (auto N : C->all_num_lists())
2056  Record.push_back(N);
2057  for (auto N : C->all_lists_sizes())
2058  Record.push_back(N);
2059  for (auto &M : C->all_components()) {
2060  Record.AddStmt(M.getAssociatedExpression());
2061  Record.AddDeclRef(M.getAssociatedDeclaration());
2062  }
2063 }
2064 
2065 void OMPClauseWriter::VisitOMPNumTeamsClause(OMPNumTeamsClause *C) {
2066  Record.AddStmt(C->getNumTeams());
2067  Record.AddSourceLocation(C->getLParenLoc());
2068 }
2069 
2070 void OMPClauseWriter::VisitOMPThreadLimitClause(OMPThreadLimitClause *C) {
2071  Record.AddStmt(C->getThreadLimit());
2072  Record.AddSourceLocation(C->getLParenLoc());
2073 }
2074 
2075 void OMPClauseWriter::VisitOMPPriorityClause(OMPPriorityClause *C) {
2076  Record.AddStmt(C->getPriority());
2077  Record.AddSourceLocation(C->getLParenLoc());
2078 }
2079 
2080 void OMPClauseWriter::VisitOMPGrainsizeClause(OMPGrainsizeClause *C) {
2081  Record.AddStmt(C->getGrainsize());
2082  Record.AddSourceLocation(C->getLParenLoc());
2083 }
2084 
2085 void OMPClauseWriter::VisitOMPNumTasksClause(OMPNumTasksClause *C) {
2086  Record.AddStmt(C->getNumTasks());
2087  Record.AddSourceLocation(C->getLParenLoc());
2088 }
2089 
2090 void OMPClauseWriter::VisitOMPHintClause(OMPHintClause *C) {
2091  Record.AddStmt(C->getHint());
2092  Record.AddSourceLocation(C->getLParenLoc());
2093 }
2094 
2095 void OMPClauseWriter::VisitOMPDistScheduleClause(OMPDistScheduleClause *C) {
2097  Record.push_back(C->getDistScheduleKind());
2098  Record.AddStmt(C->getChunkSize());
2099  Record.AddSourceLocation(C->getLParenLoc());
2101  Record.AddSourceLocation(C->getCommaLoc());
2102 }
2103 
2104 void OMPClauseWriter::VisitOMPDefaultmapClause(OMPDefaultmapClause *C) {
2105  Record.push_back(C->getDefaultmapKind());
2106  Record.push_back(C->getDefaultmapModifier());
2107  Record.AddSourceLocation(C->getLParenLoc());
2110 }
2111 
2112 void OMPClauseWriter::VisitOMPToClause(OMPToClause *C) {
2113  Record.push_back(C->varlist_size());
2114  Record.push_back(C->getUniqueDeclarationsNum());
2115  Record.push_back(C->getTotalComponentListNum());
2116  Record.push_back(C->getTotalComponentsNum());
2117  Record.AddSourceLocation(C->getLParenLoc());
2118  for (auto *E : C->varlists())
2119  Record.AddStmt(E);
2120  for (auto *D : C->all_decls())
2121  Record.AddDeclRef(D);
2122  for (auto N : C->all_num_lists())
2123  Record.push_back(N);
2124  for (auto N : C->all_lists_sizes())
2125  Record.push_back(N);
2126  for (auto &M : C->all_components()) {
2127  Record.AddStmt(M.getAssociatedExpression());
2128  Record.AddDeclRef(M.getAssociatedDeclaration());
2129  }
2130 }
2131 
2132 void OMPClauseWriter::VisitOMPFromClause(OMPFromClause *C) {
2133  Record.push_back(C->varlist_size());
2134  Record.push_back(C->getUniqueDeclarationsNum());
2135  Record.push_back(C->getTotalComponentListNum());
2136  Record.push_back(C->getTotalComponentsNum());
2137  Record.AddSourceLocation(C->getLParenLoc());
2138  for (auto *E : C->varlists())
2139  Record.AddStmt(E);
2140  for (auto *D : C->all_decls())
2141  Record.AddDeclRef(D);
2142  for (auto N : C->all_num_lists())
2143  Record.push_back(N);
2144  for (auto N : C->all_lists_sizes())
2145  Record.push_back(N);
2146  for (auto &M : C->all_components()) {
2147  Record.AddStmt(M.getAssociatedExpression());
2148  Record.AddDeclRef(M.getAssociatedDeclaration());
2149  }
2150 }
2151 
2152 void OMPClauseWriter::VisitOMPUseDevicePtrClause(OMPUseDevicePtrClause *C) {
2153  Record.push_back(C->varlist_size());
2154  Record.AddSourceLocation(C->getLParenLoc());
2155  for (auto *VE : C->varlists()) {
2156  Record.AddStmt(VE);
2157  }
2158 }
2159 
2160 void OMPClauseWriter::VisitOMPIsDevicePtrClause(OMPIsDevicePtrClause *C) {
2161  Record.push_back(C->varlist_size());
2162  Record.AddSourceLocation(C->getLParenLoc());
2163  for (auto *VE : C->varlists()) {
2164  Record.AddStmt(VE);
2165  }
2166 }
2167 
2168 //===----------------------------------------------------------------------===//
2169 // OpenMP Directives.
2170 //===----------------------------------------------------------------------===//
2171 void ASTStmtWriter::VisitOMPExecutableDirective(OMPExecutableDirective *E) {
2172  Record.AddSourceLocation(E->getLocStart());
2173  Record.AddSourceLocation(E->getLocEnd());
2174  OMPClauseWriter ClauseWriter(Record);
2175  for (unsigned i = 0; i < E->getNumClauses(); ++i) {
2176  ClauseWriter.writeClause(E->getClause(i));
2177  }
2178  if (E->hasAssociatedStmt())
2179  Record.AddStmt(E->getAssociatedStmt());
2180 }
2181 
2182 void ASTStmtWriter::VisitOMPLoopDirective(OMPLoopDirective *D) {
2183  VisitStmt(D);
2184  Record.push_back(D->getNumClauses());
2185  Record.push_back(D->getCollapsedNumber());
2186  VisitOMPExecutableDirective(D);
2187  Record.AddStmt(D->getIterationVariable());
2188  Record.AddStmt(D->getLastIteration());
2189  Record.AddStmt(D->getCalcLastIteration());
2190  Record.AddStmt(D->getPreCond());
2191  Record.AddStmt(D->getCond());
2192  Record.AddStmt(D->getInit());
2193  Record.AddStmt(D->getInc());
2194  Record.AddStmt(D->getPreInits());
2198  Record.AddStmt(D->getIsLastIterVariable());
2199  Record.AddStmt(D->getLowerBoundVariable());
2200  Record.AddStmt(D->getUpperBoundVariable());
2201  Record.AddStmt(D->getStrideVariable());
2202  Record.AddStmt(D->getEnsureUpperBound());
2203  Record.AddStmt(D->getNextLowerBound());
2204  Record.AddStmt(D->getNextUpperBound());
2205  Record.AddStmt(D->getNumIterations());
2206  }
2208  Record.AddStmt(D->getPrevLowerBoundVariable());
2209  Record.AddStmt(D->getPrevUpperBoundVariable());
2210  }
2211  for (auto I : D->counters()) {
2212  Record.AddStmt(I);
2213  }
2214  for (auto I : D->private_counters()) {
2215  Record.AddStmt(I);
2216  }
2217  for (auto I : D->inits()) {
2218  Record.AddStmt(I);
2219  }
2220  for (auto I : D->updates()) {
2221  Record.AddStmt(I);
2222  }
2223  for (auto I : D->finals()) {
2224  Record.AddStmt(I);
2225  }
2226 }
2227 
2228 void ASTStmtWriter::VisitOMPParallelDirective(OMPParallelDirective *D) {
2229  VisitStmt(D);
2230  Record.push_back(D->getNumClauses());
2231  VisitOMPExecutableDirective(D);
2232  Record.push_back(D->hasCancel() ? 1 : 0);
2234 }
2235 
2236 void ASTStmtWriter::VisitOMPSimdDirective(OMPSimdDirective *D) {
2237  VisitOMPLoopDirective(D);
2239 }
2240 
2241 void ASTStmtWriter::VisitOMPForDirective(OMPForDirective *D) {
2242  VisitOMPLoopDirective(D);
2243  Record.push_back(D->hasCancel() ? 1 : 0);
2245 }
2246 
2247 void ASTStmtWriter::VisitOMPForSimdDirective(OMPForSimdDirective *D) {
2248  VisitOMPLoopDirective(D);
2250 }
2251 
2252 void ASTStmtWriter::VisitOMPSectionsDirective(OMPSectionsDirective *D) {
2253  VisitStmt(D);
2254  Record.push_back(D->getNumClauses());
2255  VisitOMPExecutableDirective(D);
2256  Record.push_back(D->hasCancel() ? 1 : 0);
2258 }
2259 
2260 void ASTStmtWriter::VisitOMPSectionDirective(OMPSectionDirective *D) {
2261  VisitStmt(D);
2262  VisitOMPExecutableDirective(D);
2263  Record.push_back(D->hasCancel() ? 1 : 0);
2265 }
2266 
2267 void ASTStmtWriter::VisitOMPSingleDirective(OMPSingleDirective *D) {
2268  VisitStmt(D);
2269  Record.push_back(D->getNumClauses());
2270  VisitOMPExecutableDirective(D);
2272 }
2273 
2274 void ASTStmtWriter::VisitOMPMasterDirective(OMPMasterDirective *D) {
2275  VisitStmt(D);
2276  VisitOMPExecutableDirective(D);
2278 }
2279 
2280 void ASTStmtWriter::VisitOMPCriticalDirective(OMPCriticalDirective *D) {
2281  VisitStmt(D);
2282  Record.push_back(D->getNumClauses());
2283  VisitOMPExecutableDirective(D);
2286 }
2287 
2288 void ASTStmtWriter::VisitOMPParallelForDirective(OMPParallelForDirective *D) {
2289  VisitOMPLoopDirective(D);
2290  Record.push_back(D->hasCancel() ? 1 : 0);
2292 }
2293 
2294 void ASTStmtWriter::VisitOMPParallelForSimdDirective(
2296  VisitOMPLoopDirective(D);
2298 }
2299 
2300 void ASTStmtWriter::VisitOMPParallelSectionsDirective(
2302  VisitStmt(D);
2303  Record.push_back(D->getNumClauses());
2304  VisitOMPExecutableDirective(D);
2305  Record.push_back(D->hasCancel() ? 1 : 0);
2307 }
2308 
2309 void ASTStmtWriter::VisitOMPTaskDirective(OMPTaskDirective *D) {
2310  VisitStmt(D);
2311  Record.push_back(D->getNumClauses());
2312  VisitOMPExecutableDirective(D);
2313  Record.push_back(D->hasCancel() ? 1 : 0);
2315 }
2316 
2317 void ASTStmtWriter::VisitOMPAtomicDirective(OMPAtomicDirective *D) {
2318  VisitStmt(D);
2319  Record.push_back(D->getNumClauses());
2320  VisitOMPExecutableDirective(D);
2321  Record.AddStmt(D->getX());
2322  Record.AddStmt(D->getV());
2323  Record.AddStmt(D->getExpr());
2324  Record.AddStmt(D->getUpdateExpr());
2325  Record.push_back(D->isXLHSInRHSPart() ? 1 : 0);
2326  Record.push_back(D->isPostfixUpdate() ? 1 : 0);
2328 }
2329 
2330 void ASTStmtWriter::VisitOMPTargetDirective(OMPTargetDirective *D) {
2331  VisitStmt(D);
2332  Record.push_back(D->getNumClauses());
2333  VisitOMPExecutableDirective(D);
2335 }
2336 
2337 void ASTStmtWriter::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) {
2338  VisitStmt(D);
2339  Record.push_back(D->getNumClauses());
2340  VisitOMPExecutableDirective(D);
2342 }
2343 
2344 void ASTStmtWriter::VisitOMPTargetEnterDataDirective(
2346  VisitStmt(D);
2347  Record.push_back(D->getNumClauses());
2348  VisitOMPExecutableDirective(D);
2350 }
2351 
2352 void ASTStmtWriter::VisitOMPTargetExitDataDirective(
2354  VisitStmt(D);
2355  Record.push_back(D->getNumClauses());
2356  VisitOMPExecutableDirective(D);
2358 }
2359 
2360 void ASTStmtWriter::VisitOMPTargetParallelDirective(
2362  VisitStmt(D);
2363  Record.push_back(D->getNumClauses());
2364  VisitOMPExecutableDirective(D);
2366 }
2367 
2368 void ASTStmtWriter::VisitOMPTargetParallelForDirective(
2370  VisitOMPLoopDirective(D);
2371  Record.push_back(D->hasCancel() ? 1 : 0);
2373 }
2374 
2375 void ASTStmtWriter::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) {
2376  VisitStmt(D);
2377  VisitOMPExecutableDirective(D);
2379 }
2380 
2381 void ASTStmtWriter::VisitOMPBarrierDirective(OMPBarrierDirective *D) {
2382  VisitStmt(D);
2383  VisitOMPExecutableDirective(D);
2385 }
2386 
2387 void ASTStmtWriter::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) {
2388  VisitStmt(D);
2389  VisitOMPExecutableDirective(D);
2391 }
2392 
2393 void ASTStmtWriter::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) {
2394  VisitStmt(D);
2395  VisitOMPExecutableDirective(D);
2397 }
2398 
2399 void ASTStmtWriter::VisitOMPFlushDirective(OMPFlushDirective *D) {
2400  VisitStmt(D);
2401  Record.push_back(D->getNumClauses());
2402  VisitOMPExecutableDirective(D);
2404 }
2405 
2406 void ASTStmtWriter::VisitOMPOrderedDirective(OMPOrderedDirective *D) {
2407  VisitStmt(D);
2408  Record.push_back(D->getNumClauses());
2409  VisitOMPExecutableDirective(D);
2411 }
2412 
2413 void ASTStmtWriter::VisitOMPTeamsDirective(OMPTeamsDirective *D) {
2414  VisitStmt(D);
2415  Record.push_back(D->getNumClauses());
2416  VisitOMPExecutableDirective(D);
2418 }
2419 
2420 void ASTStmtWriter::VisitOMPCancellationPointDirective(
2422  VisitStmt(D);
2423  VisitOMPExecutableDirective(D);
2424  Record.push_back(D->getCancelRegion());
2426 }
2427 
2428 void ASTStmtWriter::VisitOMPCancelDirective(OMPCancelDirective *D) {
2429  VisitStmt(D);
2430  Record.push_back(D->getNumClauses());
2431  VisitOMPExecutableDirective(D);
2432  Record.push_back(D->getCancelRegion());
2434 }
2435 
2436 void ASTStmtWriter::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) {
2437  VisitOMPLoopDirective(D);
2439 }
2440 
2441 void ASTStmtWriter::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) {
2442  VisitOMPLoopDirective(D);
2444 }
2445 
2446 void ASTStmtWriter::VisitOMPDistributeDirective(OMPDistributeDirective *D) {
2447  VisitOMPLoopDirective(D);
2449 }
2450 
2451 void ASTStmtWriter::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) {
2452  VisitStmt(D);
2453  Record.push_back(D->getNumClauses());
2454  VisitOMPExecutableDirective(D);
2456 }
2457 
2458 void ASTStmtWriter::VisitOMPDistributeParallelForDirective(
2460  VisitOMPLoopDirective(D);
2462 }
2463 
2464 void ASTStmtWriter::VisitOMPDistributeParallelForSimdDirective(
2466  VisitOMPLoopDirective(D);
2468 }
2469 
2470 void ASTStmtWriter::VisitOMPDistributeSimdDirective(
2472  VisitOMPLoopDirective(D);
2474 }
2475 
2476 void ASTStmtWriter::VisitOMPTargetParallelForSimdDirective(
2478  VisitOMPLoopDirective(D);
2480 }
2481 
2482 //===----------------------------------------------------------------------===//
2483 // ASTWriter Implementation
2484 //===----------------------------------------------------------------------===//
2485 
2487  assert(SwitchCaseIDs.find(S) == SwitchCaseIDs.end() &&
2488  "SwitchCase recorded twice");
2489  unsigned NextID = SwitchCaseIDs.size();
2490  SwitchCaseIDs[S] = NextID;
2491  return NextID;
2492 }
2493 
2495  assert(SwitchCaseIDs.find(S) != SwitchCaseIDs.end() &&
2496  "SwitchCase hasn't been seen yet");
2497  return SwitchCaseIDs[S];
2498 }
2499 
2501  SwitchCaseIDs.clear();
2502 }
2503 
2504 /// \brief Write the given substatement or subexpression to the
2505 /// bitstream.
2506 void ASTWriter::WriteSubStmt(Stmt *S) {
2507  RecordData Record;
2508  ASTStmtWriter Writer(*this, Record);
2509  ++NumStatements;
2510 
2511  if (!S) {
2512  Stream.EmitRecord(serialization::STMT_NULL_PTR, Record);
2513  return;
2514  }
2515 
2516  llvm::DenseMap<Stmt *, uint64_t>::iterator I = SubStmtEntries.find(S);
2517  if (I != SubStmtEntries.end()) {
2518  Record.push_back(I->second);
2519  Stream.EmitRecord(serialization::STMT_REF_PTR, Record);
2520  return;
2521  }
2522 
2523 #ifndef NDEBUG
2524  assert(!ParentStmts.count(S) && "There is a Stmt cycle!");
2525 
2526  struct ParentStmtInserterRAII {
2527  Stmt *S;
2528  llvm::DenseSet<Stmt *> &ParentStmts;
2529 
2530  ParentStmtInserterRAII(Stmt *S, llvm::DenseSet<Stmt *> &ParentStmts)
2531  : S(S), ParentStmts(ParentStmts) {
2532  ParentStmts.insert(S);
2533  }
2534  ~ParentStmtInserterRAII() {
2535  ParentStmts.erase(S);
2536  }
2537  };
2538 
2539  ParentStmtInserterRAII ParentStmtInserter(S, ParentStmts);
2540 #endif
2541 
2542  Writer.Visit(S);
2543 
2544  uint64_t Offset = Writer.Emit();
2545  SubStmtEntries[S] = Offset;
2546 }
2547 
2548 /// \brief Flush all of the statements that have been added to the
2549 /// queue via AddStmt().
2550 void ASTRecordWriter::FlushStmts() {
2551  // We expect to be the only consumer of the two temporary statement maps,
2552  // assert that they are empty.
2553  assert(Writer->SubStmtEntries.empty() && "unexpected entries in sub-stmt map");
2554  assert(Writer->ParentStmts.empty() && "unexpected entries in parent stmt map");
2555 
2556  for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) {
2557  Writer->WriteSubStmt(StmtsToEmit[I]);
2558 
2559  assert(N == StmtsToEmit.size() && "record modified while being written!");
2560 
2561  // Note that we are at the end of a full expression. Any
2562  // expression records that follow this one are part of a different
2563  // expression.
2564  Writer->Stream.EmitRecord(serialization::STMT_STOP, ArrayRef<uint32_t>());
2565 
2566  Writer->SubStmtEntries.clear();
2567  Writer->ParentStmts.clear();
2568  }
2569 
2570  StmtsToEmit.clear();
2571 }
2572 
2573 void ASTRecordWriter::FlushSubStmts() {
2574  // For a nested statement, write out the substatements in reverse order (so
2575  // that a simple stack machine can be used when loading), and don't emit a
2576  // STMT_STOP after each one.
2577  for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) {
2578  Writer->WriteSubStmt(StmtsToEmit[N - I - 1]);
2579  assert(N == StmtsToEmit.size() && "record modified while being written!");
2580  }
2581 
2582  StmtsToEmit.clear();
2583 }
SourceLocation getRParenLoc() const
Definition: Expr.h:3405
Expr * getInc()
Definition: Stmt.h:1187
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:539
A PredefinedExpr record.
Definition: ASTBitCodes.h:1231
A call to an overloaded operator written using operator syntax.
Definition: ExprCXX.h:52
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
Definition: ExprObjC.h:1464
The receiver is the instance of the superclass object.
Definition: ExprObjC.h:1009
Represents a single C99 designator.
Definition: Expr.h:4028
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Definition: Expr.h:2411
SourceRange getParenOrBraceRange() const
Definition: ExprCXX.h:1305
Defines the clang::ASTContext interface.
A CompoundLiteralExpr record.
Definition: ASTBitCodes.h:1271
This represents '#pragma omp distribute simd' composite directive.
Definition: StmtOpenMP.h:2966
unsigned getNumInits() const
Definition: Expr.h:3776
This represents '#pragma omp master' directive.
Definition: StmtOpenMP.h:1181
SourceLocation getEnd() const
const SwitchCase * getNextSwitchCase() const
Definition: Stmt.h:664
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: Expr.h:1116
const Expr * getBase() const
Definition: ExprObjC.h:509
ParmVarDecl *const * iterator
Iterators over the parameters which the parameter pack expanded into.
Definition: ExprCXX.h:3920
The null pointer literal (C++11 [lex.nullptr])
Definition: ExprCXX.h:505
CastKind getCastKind() const
Definition: Expr.h:2680
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
Definition: Expr.h:408
This represents '#pragma omp task' directive.
Definition: StmtOpenMP.h:1521
This represents a GCC inline-assembly statement extension.
Definition: Stmt.h:1565
IdentifierInfo * getFieldName() const
For a field or identifier offsetof node, returns the name of the field.
Definition: Expr.cpp:1356
TypeSourceInfo * getDestroyedTypeInfo() const
Retrieve the source location information for the type being destroyed.
Definition: ExprCXX.h:2223
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
Definition: Expr.h:1054
OpenMPScheduleClauseModifier getSecondScheduleModifier() const
Get the second modifier of the clause.
Definition: OpenMPClause.h:831
unsigned arg_size() const
Retrieve the number of arguments.
Definition: ExprCXX.h:3076
unsigned getNumOutputs() const
Definition: Stmt.h:1462
TypeSourceInfo * getTypeSourceInfo() const
Definition: Expr.h:2598
This represents 'thread_limit' clause in the '#pragma omp ...' directive.
The receiver is an object instance.
Definition: ExprObjC.h:1005
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprCXX.h:3552
bool isXLHSInRHSPart() const
Return true if helper update expression has form 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' and...
Definition: StmtOpenMP.h:1988
Expr * getSyntacticForm()
Return the syntactic form of this expression, i.e.
Definition: Expr.h:4723
bool isFPContractable() const
Definition: ExprCXX.h:107
const DeclGroupRef getDeclGroup() const
Definition: Stmt.h:464
SourceLocation getLParenLoc() const
Returns the location of '('.
Definition: OpenMPClause.h:910
An IndirectGotoStmt record.
Definition: ASTBitCodes.h:1215
This represents clause 'copyin' in the '#pragma omp ...' directives.
bool isFileScope() const
Definition: Expr.h:2592
const ObjCAtFinallyStmt * getFinallyStmt() const
Retrieve the @finally statement, if any.
Definition: StmtObjC.h:224
SourceLocation getColonLoc() const
Get colon location.
helper_expr_const_range source_exprs() const
bool containsUnexpandedParameterPack() const
Whether this expression contains an unexpanded parameter pack (for C++11 variadic templates)...
Definition: Expr.h:212
An AddrLabelExpr record.
Definition: ASTBitCodes.h:1287
NameKind
NameKind - The kind of name this object contains.
SourceLocation getLParenLoc() const
Retrieve the location of the left parentheses ('(') that precedes the argument list.
Definition: ExprCXX.h:3067
bool isResultDependent() const
Whether this generic selection is result-dependent.
Definition: Expr.h:4469
bool getValue() const
Definition: ExprCXX.h:483
Expr * getNumIterations() const
Definition: StmtOpenMP.h:698
bool isPascal() const
Definition: Expr.h:1562
SourceLocation getOperatorLoc() const
Retrieve the location of the '->' or '.' operator.
Definition: ExprCXX.h:3454
SourceLocation getThrowLoc() const
Definition: ExprCXX.h:936
void AddToken(const Token &Tok, RecordDataImpl &Record)
Emit a token.
Definition: ASTWriter.cpp:3987
SourceLocation getLParenLoc() const
Definition: Stmt.h:1202
SourceLocation getCommaLoc()
Get location of ','.
Definition: OpenMPClause.h:852
SourceLocation getLocation() const
Definition: ExprObjC.h:518
bool isElidable() const
Whether this construction is elidable.
Definition: ExprCXX.h:1231
Expr * getCond()
Definition: Stmt.h:1075
Expr * getExpr(unsigned Index)
getExpr - Return the Expr at the specified index.
Definition: Expr.h:3462
bool isDelegateInitCall() const
isDelegateInitCall - Answers whether this message send has been tagged as a "delegate init call"...
Definition: ExprObjC.h:1307
A CXXStaticCastExpr record.
Definition: ASTBitCodes.h:1377
OpenMPDistScheduleClauseKind getDistScheduleKind() const
Get kind of the clause.
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2272
An AttributedStmt record.
Definition: ASTBitCodes.h:1201
CompoundStmt * getSubStmt()
Definition: Expr.h:3396
A CXXReinterpretCastExpr record.
Definition: ASTBitCodes.h:1381
Expr * getSimdlen() const
Return safe iteration space distance.
Definition: OpenMPClause.h:481
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding the member name, if any.
Definition: Expr.h:2446
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the member name, with source location information...
Definition: ExprCXX.h:3231
unsigned getNumAsmToks()
Definition: Stmt.h:1775
An ObjCBoolLiteralExpr record.
Definition: ASTBitCodes.h:1353
private_copies_range private_copies()
CharacterKind getKind() const
Definition: Expr.h:1331
Expr *const * semantics_iterator
Definition: Expr.h:4745
Represents a 'co_return' statement in the C++ Coroutines TS.
Definition: StmtCXX.h:379
TypeSourceInfo * getScopeTypeInfo() const
Retrieve the scope type in a qualified pseudo-destructor expression.
Definition: ExprCXX.h:2207
CXXCatchStmt * getHandler(unsigned i)
Definition: StmtCXX.h:104
bool isArgumentType() const
Definition: Expr.h:2010
IfStmt - This represents an if/then/else.
Definition: Stmt.h:881
Class that handles pre-initialization statement for some clauses, like 'shedule', 'firstprivate' etc...
Definition: OpenMPClause.h:75
bool isGlobalDelete() const
Definition: ExprCXX.h:2041
void AddNestedNameSpecifierLoc(NestedNameSpecifierLoc NNS)
Emit a nested name specifier with source-location information.
Definition: ASTWriter.cpp:5212
This represents '#pragma omp for simd' directive.
Definition: StmtOpenMP.h:931
SourceLocation getLParenLoc() const
Returns the location of '('.
Definition: OpenMPClause.h:673
SourceLocation getForLoc() const
Definition: StmtObjC.h:53
OpenMPProcBindClauseKind getProcBindKind() const
Returns kind of the clause.
Definition: OpenMPClause.h:676
TypeSourceInfo * getTypeSourceInfo() const
Definition: Expr.h:1916
SourceLocation getLParenLoc() const
Returns the location of '('.
SourceRange getTypeIdParens() const
Definition: ExprCXX.h:1917
An ImplicitValueInitExpr record.
Definition: ASTBitCodes.h:1281
iterator end()
Definition: DeclGroup.h:108
unsigned getPackLength() const
Retrieve the length of the parameter pack.
Definition: ExprCXX.h:3730
SourceLocation getLParenLoc() const
Definition: Expr.h:3403
This represents 'grainsize' clause in the '#pragma omp ...' directive.
AccessSpecifier getAccess() const
ObjCMethodDecl * getAtIndexMethodDecl() const
Definition: ExprObjC.h:813
An ImplicitCastExpr record.
Definition: ASTBitCodes.h:1267
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:2671
This represents 'if' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:197
Defines the C++ template declaration subclasses.
Represents an attribute applied to a statement.
Definition: Stmt.h:830
TypeSourceInfo * getArg(unsigned I) const
Retrieve the Ith argument.
Definition: ExprCXX.h:2320
ParenExpr - This represents a parethesized expression, e.g.
Definition: Expr.h:1619
SourceLocation getRParenLoc() const
Definition: ExprObjC.h:413
A CXXOperatorCallExpr record.
Definition: ASTBitCodes.h:1367
Expr * getLowerBound()
Get lower bound of array section.
Definition: ExprOpenMP.h:91
This represents 'priority' clause in the '#pragma omp ...' directive.
unsigned getArrayExprIndex() const
For an array element node, returns the index into the array of expressions.
Definition: Expr.h:1828
SourceLocation getBuiltinLoc() const
getBuiltinLoc - Return the location of the __builtin_astype token.
Definition: Expr.h:4635
A CXXTemporaryObjectExpr record.
Definition: ASTBitCodes.h:1375
Represents Objective-C's @throw statement.
Definition: StmtObjC.h:313
unsigned getDeclRefExprAbbrev() const
Definition: ASTWriter.h:650
unsigned getResultIndex() const
The zero-based index of the result expression's generic association in the generic selection's associ...
Definition: Expr.h:4474
SourceLocation getLabelLoc() const
Definition: Expr.h:3355
InitListExpr * getSyntacticForm() const
Definition: Expr.h:3882
SourceLocation getIfLoc() const
Definition: Stmt.h:928
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1162
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:760
SourceLocation getCoawaitLoc() const
Definition: StmtCXX.h:194
TypeSourceInfo * getTypeSourceInfo() const
Definition: ExprCXX.h:1783
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent...
Definition: ExprCXX.h:2356
SourceLocation getColonLoc() const
Returns the location of ':'.
This represents 'update' clause in the '#pragma omp atomic' directive.
const Stmt * getElse() const
Definition: Stmt.h:921
SourceLocation getOperatorLoc() const
Definition: Expr.h:2937
This represents '#pragma omp parallel for' directive.
Definition: StmtOpenMP.h:1302
MS property subscript expression.
Definition: ExprCXX.h:728
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "for" statement, if any.
Definition: Stmt.cpp:809
SourceLocation getLParenLoc() const
Returns the location of '('.
Definition: OpenMPClause.h:179
iterator begin() const
Definition: ExprCXX.h:3921
SourceLocation getColonLoc() const
Get colon location.
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
Definition: ExprCXX.h:3962
float __ovld __cnfn distance(float p0, float p1)
Returns the distance between p0 and p1.
Expr * getAlignment()
Returns alignment.
SourceLocation getEndLoc() const
Definition: Stmt.h:1770
CompoundStmt * getBlock() const
Definition: Stmt.h:1910
IdentType getIdentType() const
Definition: Expr.h:1187
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
Definition: ExprCXX.h:2049
bool isConditionTrue() const
isConditionTrue - Return whether the condition is true (i.e.
Definition: Expr.h:3575
Expr * getIndexExpr(unsigned Idx)
Definition: Expr.h:1937
bool hadArrayRangeDesignator() const
Definition: Expr.h:3893
This represents '#pragma omp target exit data' directive.
Definition: StmtOpenMP.h:2191
ObjCDictionaryElement getKeyValueElement(unsigned Index) const
Definition: ExprObjC.h:309
Stmt * getSubStmt()
Definition: Stmt.h:760
bool isImplicit() const
Definition: ExprCXX.h:895
This represents 'read' clause in the '#pragma omp atomic' directive.
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprCXX.h:1990
Expr * getOperand() const
Definition: ExprCXX.h:3548
ArrayRef< TemplateArgument > getPartialArguments() const
Get.
Definition: ExprCXX.h:3746
VarDecl - An instance of this class is created to represent a variable declaration or definition...
Definition: Decl.h:768
SourceLocation getReturnLoc() const
Definition: Stmt.h:1385
This represents clause 'private' in the '#pragma omp ...' directives.
const Expr * getPostUpdateExpr() const
Get post-update expression for the clause.
Definition: OpenMPClause.h:111
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC 'id' type.
Definition: ExprObjC.h:1383
This represents 'num_threads' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:334
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:2562
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprCXX.h:642
const Expr * getCallee() const
Definition: Expr.h:2188
varlist_range varlists()
Definition: OpenMPClause.h:164
This represents 'defaultmap' clause in the '#pragma omp ...' directive.
OpenMPDefaultmapClauseModifier getDefaultmapModifier() const
Get the modifier of the clause.
StringRef getInputConstraint(unsigned i) const
Definition: Stmt.h:1799
unsigned size() const
Definition: Stmt.h:576
SourceLocation getLocation() const
Retrieve the location of the literal.
Definition: Expr.h:1290
const TypeSourceInfo * getAssocTypeSourceInfo(unsigned i) const
Definition: Expr.h:4451
SourceLocation getDoLoc() const
Definition: Stmt.h:1127
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition: ExprCXX.h:533
SourceLocation getRParenLoc() const
Definition: Stmt.h:1587
Expr * getInc() const
Definition: StmtOpenMP.h:634
UnaryExprOrTypeTrait getKind() const
Definition: Expr.h:2005
CapturedRegionKind getCapturedRegionKind() const
Retrieve the captured region kind.
Definition: Stmt.cpp:1098
This represents implicit clause 'flush' for the '#pragma omp flush' directive.
Expr * getCond() const
getCond - Return the condition expression; this is defined in terms of the opaque value...
Definition: Expr.h:3287
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range that covers this offsetof node.
Definition: Expr.h:1855
capture_iterator capture_begin()
Retrieve an iterator pointing to the first capture.
Definition: Stmt.h:2148
A CXXConstructExpr record.
Definition: ASTBitCodes.h:1371
const ParmVarDecl * getParam() const
Definition: ExprCXX.h:994
SourceLocation getLParenLoc() const
Definition: ExprObjC.h:1543
raw_arg_iterator raw_arg_begin()
Definition: ExprCXX.h:1976
unsigned getValue() const
Definition: Expr.h:1338
A C++ throw-expression (C++ [except.throw]).
Definition: ExprCXX.h:913
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition: ExprCXX.h:2936
Expr * getNumForLoops() const
Return the number of associated for-loops.
Definition: OpenMPClause.h:913
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprObjC.h:119
QualType getBaseType() const
Definition: ExprCXX.h:3443
unsigned path_size() const
Definition: Expr.h:2699
SourceLocation getLocation() const
Definition: Expr.h:1025
bool isArrow() const
Definition: ExprObjC.h:1410
SourceLocation getEllipsisLoc() const
Definition: Stmt.h:709
void AddString(StringRef Str)
Emit a string.
Definition: ASTWriter.h:891
void AddSourceRange(SourceRange Range)
Emit a source range.
Definition: ASTWriter.h:798
SourceLocation getAtLoc() const
Definition: ExprObjC.h:371
ArrayTypeTrait getTrait() const
Definition: ExprCXX.h:2399
This represents 'nogroup' clause in the '#pragma omp ...' directive.
bool getIsCXXTry() const
Definition: Stmt.h:1949
TypeSourceInfo * getTypeSourceInfo() const
Retrieve the type source information for the type being constructed.
Definition: ExprCXX.h:3063
Expr * getPrevUpperBoundVariable() const
Definition: StmtOpenMP.h:714
A ShuffleVectorExpr record.
Definition: ASTBitCodes.h:1295
This represents 'safelen' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:392
SourceLocation getDestroyedTypeLoc() const
Retrieve the starting location of the type being destroyed.
Definition: ExprCXX.h:2238
A C++ static_cast expression (C++ [expr.static.cast]).
Definition: ExprCXX.h:254
OpenMPDirectiveKind getDirectiveKind() const
Definition: StmtOpenMP.h:201
void AddTypeSourceInfo(TypeSourceInfo *TInfo)
Emits a reference to a declarator info.
Definition: ASTWriter.cpp:4920
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:789
SourceLocation getRParenLoc() const
Return the location of the right parentheses.
Definition: Expr.h:1913
Represents a C99 designated initializer expression.
Definition: Expr.h:3953
SourceLocation getIsaMemberLoc() const
getMemberLoc - Return the location of the "member", in X->F, it is the location of 'F'...
Definition: ExprObjC.h:1415
SourceLocation getLParenLoc() const
Returns the location of '('.
Definition: OpenMPClause.h:313
Expr * getNumThreads() const
Returns number of threads.
Definition: OpenMPClause.h:370
An OffsetOfExpr record.
Definition: ASTBitCodes.h:1251
Stmt * getBody()
Definition: Stmt.h:1123
unsigned getTotalComponentListNum() const
Return the number of lists derived from the clause expressions.
An ObjCAtThrowStmt record.
Definition: ASTBitCodes.h:1349
ObjCProtocolDecl * getProtocol() const
Definition: ExprObjC.h:453
CompoundStmt * getSubStmt() const
Retrieve the compound statement that will be included in the program only if the existence of the sym...
Definition: StmtCXX.h:280
SourceLocation getLParenLoc() const
Returns the location of '('.
Expr * getSubExpr(unsigned Idx) const
Definition: Expr.h:4198
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1365
void AddTypeRef(QualType T)
Emit a reference to a type.
Definition: ASTWriter.h:829
An element in an Objective-C dictionary literal.
Definition: ExprObjC.h:212
A DesignatedInitExpr record.
Definition: ASTBitCodes.h:1277
This represents '#pragma omp parallel' directive.
Definition: StmtOpenMP.h:231
unsigned getNumInputs() const
Definition: Stmt.h:1484
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition: Expr.h:3422
ObjCInterfaceDecl * getClassReceiver() const
Definition: ExprObjC.h:696
This represents 'simd' clause in the '#pragma omp ...' directive.
OpenMPScheduleClauseModifier getFirstScheduleModifier() const
Get the first modifier of the clause.
Definition: OpenMPClause.h:826
unsigned getNumSemanticExprs() const
Definition: Expr.h:4743
unsigned getNumAssocs() const
Definition: Expr.h:4440
bool getValue() const
Definition: ExprCXX.h:3554
SourceLocation getAmpAmpLoc() const
Definition: Expr.h:3353
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
Definition: Decl.h:2293
This represents clause 'lastprivate' in the '#pragma omp ...' directives.
Expr * getBase()
Retrieve the base object of this member expressions, e.g., the x in x.m.
Definition: ExprCXX.h:3434
Represents a place-holder for an object not to be initialized by anything.
Definition: Expr.h:4240
unsigned getManglingNumber() const
Definition: ExprCXX.h:4026
SourceLocation getLocStart() const
Returns the starting location of the clause.
Definition: OpenMPClause.h:46
StringLiteral * getString()
Definition: ExprObjC.h:40
SourceLocation getRParen() const
Get the location of the right parentheses ')'.
Definition: Expr.h:1647
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
Definition: Expr.h:2482
Expr * getChunkSize()
Get chunk size.
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Definition: Expr.h:3624
ArrayRef< Expr * > updates()
Definition: StmtOpenMP.h:751
This represents clause 'map' in the '#pragma omp ...' directives.
The iterator over UnresolvedSets.
Definition: UnresolvedSet.h:28
TypeSourceInfo * getTypeSourceInfo() const
Definition: ExprCXX.h:1470
This represents clause 'to' in the '#pragma omp ...' directives.
DeclarationNameInfo getNameInfo() const
Retrieve the name of the entity we're testing for, along with location information.
Definition: StmtCXX.h:276
Represents a C++ member access expression for which lookup produced a set of overloaded functions...
Definition: ExprCXX.h:3366
SourceLocation getAtLoc() const
Definition: ExprObjC.h:44
IdentifierInfo & getAccessor() const
Definition: Expr.h:4531
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:4509
SourceLocation getLBracLoc() const
Definition: Stmt.h:629
Expr * getSubExpr()
Definition: Expr.h:2684
SourceLocation getLBraceLoc() const
Definition: Stmt.h:1768
This represents '#pragma omp barrier' directive.
Definition: StmtOpenMP.h:1633
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1506
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp, [NSNumber numberWithInt:42]];.
Definition: ExprObjC.h:144
Expr * getCounterValue()
Get the loop counter value.
SourceLocation getLAngleLoc() const
Retrieve the location of the left angle bracket starting the explicit template argument list followin...
Definition: Expr.h:2453
This is a common base class for loop directives ('omp simd', 'omp for', 'omp for simd' etc...
Definition: StmtOpenMP.h:293
Expr * getNumTeams()
Return NumTeams number.
SourceLocation getRAngleLoc() const
Retrieve the location of the right angle bracket ending the explicit template argument list following...
Definition: Expr.h:2460
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition: ExprCXX.h:3822
This represents '#pragma omp critical' directive.
Definition: StmtOpenMP.h:1228
OpenMPDirectiveKind getCancelRegion() const
Get cancellation region for the current cancellation point.
Definition: StmtOpenMP.h:2553
SourceLocation getRParenLoc() const
Definition: Expr.h:2284
Expr * getFilterExpr() const
Definition: Stmt.h:1870
bool isFPContractable() const
Definition: Expr.h:3064
unsigned getTotalComponentsNum() const
Return the total number of components in all lists derived from the clause.
SourceLocation getSuperLoc() const
Retrieve the location of the 'super' keyword for a class or instance message to 'super', otherwise an invalid source location.
Definition: ExprObjC.h:1196
bool shouldCopy() const
shouldCopy - True if we should do the 'copy' part of the copy-restore.
Definition: ExprObjC.h:1494
Expr * getLHS() const
Definition: Expr.h:2943
void AddIdentifierRef(const IdentifierInfo *II)
Emit a reference to an identifier.
Definition: ASTWriter.h:812
const VarDecl * getCatchParamDecl() const
Definition: StmtObjC.h:94
bool isOverloaded() const
True if this lookup is overloaded.
Definition: ExprCXX.h:2750
SourceLocation getWhileLoc() const
Definition: Stmt.h:1082
Represents Objective-C's @catch statement.
Definition: StmtObjC.h:74
const CompoundStmt * getSynchBody() const
Definition: StmtObjC.h:282
const VarDecl * getNRVOCandidate() const
Retrieve the variable that might be used for the named return value optimization. ...
Definition: Stmt.h:1393
This represents clause 'copyprivate' in the '#pragma omp ...' directives.
IndirectGotoStmt - This represents an indirect goto.
Definition: Stmt.h:1258
Describes an C or C++ initializer list.
Definition: Expr.h:3746
SourceLocation getFirstScheduleModifierLoc() const
Get the first modifier location.
Definition: OpenMPClause.h:842
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition: ExprCXX.h:575
This represents '#pragma omp distribute parallel for' composite directive.
Definition: StmtOpenMP.h:2827
SmallVector< uint64_t, 64 > RecordData
Definition: ASTWriter.h:87
ObjCMethodDecl * getBoxingMethod() const
Definition: ExprObjC.h:111
IdentifierInfo * getOutputIdentifier(unsigned i) const
Definition: Stmt.h:1655
const Stmt * getFinallyBody() const
Definition: StmtObjC.h:132
ForStmt - This represents a 'for (init;cond;inc)' stmt.
Definition: Stmt.h:1153
ArrayRef< Expr * > finals()
Definition: StmtOpenMP.h:757
void append(InputIterator begin, InputIterator end)
Definition: ASTWriter.h:743
ObjCBridgeCastKind getBridgeKind() const
Determine which kind of bridge is being performed via this cast.
Definition: ExprObjC.h:1546
IdentifierInfo * getDestroyedTypeIdentifier() const
In a dependent pseudo-destructor expression for which we do not have full type information on the des...
Definition: ExprCXX.h:2230
helper_expr_const_range private_copies() const
SourceLocation getDefaultmapKindLoc()
Get kind location.
uint32_t Offset
Definition: CacheTokens.cpp:44
const ValueDecl * getExtendingDecl() const
Get the declaration which triggered the lifetime-extension of this temporary, if any.
Definition: ExprCXX.h:4019
SourceLocation getAtFinallyLoc() const
Definition: StmtObjC.h:141
Expr * getX()
Get 'x' part of the associated expression/statement.
Definition: StmtOpenMP.h:1972
QualType getSuperType() const
Retrieve the type referred to by 'super'.
Definition: ExprObjC.h:1231
bool isSuperReceiver() const
Definition: ExprObjC.h:700
SourceLocation getRParenLoc() const
Definition: Stmt.h:1132
A reference to a previously [de]serialized Stmt record.
Definition: ASTBitCodes.h:1189
Stmt * getHandlerBlock() const
Definition: StmtCXX.h:52
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
Definition: ExprCXX.h:1676
Expr * getExprOperand() const
Definition: ExprCXX.h:630
path_iterator path_begin()
Definition: Expr.h:2700
Stmt * getBody()
Definition: Stmt.h:1188
SourceLocation getLParen() const
Get the location of the left parentheses '('.
Definition: Expr.h:1643
helper_expr_const_range source_exprs() const
OpenMPScheduleClauseKind getScheduleKind() const
Get kind of the clause.
Definition: OpenMPClause.h:823
const Expr * getSubExpr() const
Definition: Expr.h:3673
semantics_iterator semantics_end()
Definition: Expr.h:4753
SourceLocation getRParenLoc() const
Definition: Expr.h:3687
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:2897
SourceLocation getLocation() const
Definition: ExprCXX.h:489
Selector getSelector() const
Definition: ExprObjC.cpp:306
SourceLocation getRBraceLoc() const
Definition: Expr.h:3875
bool isValueDependent() const
isValueDependent - Determines whether this expression is value-dependent (C++ [temp.dep.constexpr]).
Definition: Expr.h:147
Stmt * getInit()
Definition: Stmt.h:1167
Expr * getOutputExpr(unsigned i)
Definition: Stmt.cpp:397
iterator begin()
Definition: DeclGroup.h:102
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
Definition: ExprCXX.h:2747
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
Definition: StmtCXX.h:128
Class that handles post-update expression for some clauses, like 'lastprivate', 'reduction' etc...
Definition: OpenMPClause.h:97
This represents '#pragma omp cancellation point' directive.
Definition: StmtOpenMP.h:2446
This represents 'default' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:554
ObjCStringLiteral, used for Objective-C string literals i.e.
Definition: ExprObjC.h:29
Expr * getBaseExpr() const
Definition: ExprCXX.h:708
void AddAttributes(ArrayRef< const Attr * > Attrs)
Emit a list of attributes.
Definition: ASTWriter.cpp:3975
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
Definition: Expr.h:4898
const Stmt * getCatchBody() const
Definition: StmtObjC.h:90
This represents 'final' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:280
This represents 'mergeable' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:992
Expr * getCond()
Definition: Stmt.h:1186
SourceLocation getSecondScheduleModifierLoc() const
Get the second modifier location.
Definition: OpenMPClause.h:847
This represents '#pragma omp teams' directive.
Definition: StmtOpenMP.h:2389
Expr * getLHS() const
Definition: Expr.h:3215
bool isConditionDependent() const
Definition: Expr.h:3582
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:2632
This represents clause 'reduction' in the '#pragma omp ...' directives.
FieldDecl * getField()
Get the field whose initializer will be used.
Definition: ExprCXX.h:1058
Helper class for OffsetOfExpr.
Definition: Expr.h:1770
A marker record that indicates that we are at the end of an expression.
Definition: ASTBitCodes.h:1185
Represents binding an expression to a temporary.
Definition: ExprCXX.h:1119
const ObjCAtCatchStmt * getCatchStmt(unsigned I) const
Retrieve a @catch statement.
Definition: StmtObjC.h:206
StringLiteral * getClobberStringLiteral(unsigned i)
Definition: Stmt.h:1729
Expr * Key
The key for the dictionary element.
Definition: ExprObjC.h:214
CXXTemporary * getTemporary()
Definition: ExprCXX.h:1139
bool isOpenMPWorksharingDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a worksharing directive.
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition: ExprCXX.h:1503
TypeSourceInfo * getTypeInfoAsWritten() const
getTypeInfoAsWritten - Returns the type source info for the type that this expression is casting to...
Definition: Expr.h:2818
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:915
const RecordDecl * getCapturedRecordDecl() const
Retrieve the record declaration for captured variables.
Definition: Stmt.h:2123
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3128
This represents clause 'is_device_ptr' in the '#pragma omp ...' directives.
const Expr * getBase() const
Definition: ExprObjC.h:682
CleanupObject getObject(unsigned i) const
Definition: ExprCXX.h:2971
bool isArrow() const
Determine whether this pseudo-destructor expression was written using an '->' (otherwise, it used a '.
Definition: ExprCXX.h:2193
Expr * getHint() const
Returns number of threads.
bool hadMultipleCandidates() const
Returns true if this member expression refers to a method that was resolved from an overloaded set ha...
Definition: Expr.h:2530
SourceLocation getLocation() const
Definition: Expr.h:1189
ObjCMethodDecl * setAtIndexMethodDecl() const
Definition: ExprObjC.h:817
detail::InMemoryDirectory::const_iterator I
SourceLocation getUsedLocation() const
Retrieve the location where this default argument was actually used.
Definition: ExprCXX.h:1007
SourceLocation getDefaultLoc() const
Definition: Expr.h:4443
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:967
Stmt * getInit()
Definition: Stmt.h:914
ExpressionTrait getTrait() const
Definition: ExprCXX.h:2462
SourceLocation getSwitchLoc() const
Definition: Stmt.h:1007
This represents clause 'from' in the '#pragma omp ...' directives.
Represents the this expression in C++.
Definition: ExprCXX.h:873
bool hadMultipleCandidates() const
Whether the referred constructor was resolved from an overloaded set having size greater than 1...
Definition: ExprCXX.h:1236
Expr * getCond() const
Definition: StmtOpenMP.h:626
arg_iterator arg_end()
Definition: Expr.h:2248
MSPropertyDecl * getPropertyDecl() const
Definition: ExprCXX.h:709
ObjCIvarDecl * getDecl()
Definition: ExprObjC.h:505
OpenMPDefaultClauseKind getDefaultKind() const
Returns kind of the clause.
Definition: OpenMPClause.h:603
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
Definition: Expr.h:3525
SourceLocation getBuiltinLoc() const
Definition: Expr.h:3684
unsigned RecordSwitchCaseID(SwitchCase *S)
Record an ID for the given switch-case statement.
Expr * getRHS() const
Definition: Expr.h:3216
OpenMPClauseKind getClauseKind() const
Returns kind of OpenMP clause (private, shared, reduction, etc.).
Definition: OpenMPClause.h:56
SourceLocation getReceiverLocation() const
Definition: ExprObjC.h:691
SourceLocation getOperatorLoc() const LLVM_READONLY
Definition: Expr.h:2508
OpenMPDependClauseKind getDependencyKind() const
Get dependency type.
This represents '#pragma omp target parallel for simd' directive.
Definition: StmtOpenMP.h:3034
ArrayRef< Expr * > private_counters()
Definition: StmtOpenMP.h:739
OpenMP 4.0 [2.4, Array Sections].
Definition: ExprOpenMP.h:45
FunctionDecl * getOperatorDelete() const
Definition: ExprCXX.h:2053
SourceLocation getColonColonLoc() const
Retrieve the location of the '::' in a qualified pseudo-destructor expression.
Definition: ExprCXX.h:2211
SourceLocation getRParenLoc() const
Definition: ExprObjC.h:458
SourceLocation getLocEnd() const
Returns the ending location of the clause.
Definition: OpenMPClause.h:48
ConditionalOperator - The ?: ternary operator.
Definition: Expr.h:3170
unsigned getNumDecls() const
Gets the number of declarations in the unresolved set.
Definition: ExprCXX.h:2581
SourceLocation getTryLoc() const
Definition: StmtCXX.h:91
OpenMPDirectiveKind getCancelRegion() const
Get cancellation region for the current cancellation point.
Definition: StmtOpenMP.h:2490
Expr * getLHS() const
Definition: Expr.h:3594
llvm::APInt getValue() const
Definition: Expr.h:1248
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition: ExprCXX.h:2129
SourceLocation getMemberLoc() const
Definition: ExprCXX.h:711
SourceLocation getTokenLocation() const
getTokenLocation - The location of the __null token.
Definition: Expr.h:3638
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
Definition: ExprCXX.h:3501
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:551
SourceLocation getAsmLoc() const
Definition: Stmt.h:1443
This represents 'threads' clause in the '#pragma omp ...' directive.
void AddDeclarationNameLoc(const DeclarationNameLoc &DNLoc, DeclarationName Name)
Definition: ASTWriter.cpp:5122
StringRef getAsmString() const
Definition: Stmt.h:1779
Expr ** getSubExprs()
Definition: Expr.h:4864
This represents '#pragma omp taskgroup' directive.
Definition: StmtOpenMP.h:1721
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
Definition: ExprCXX.h:2317
void AddCXXTemporary(const CXXTemporary *Temp)
Emit a CXXTemporary.
Definition: ASTWriter.cpp:4875
SourceLocation getDefaultKindKwLoc() const
Returns location of clause kind.
Definition: OpenMPClause.h:606
unsigned getNumObjects() const
Definition: ExprCXX.h:2969
const Expr * getControllingExpr() const
Definition: Expr.h:4463
This represents clause 'aligned' in the '#pragma omp ...' directives.
unsigned getNumExpansions() const
Get the number of parameters in this parameter pack.
Definition: ExprCXX.h:3925
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprObjC.h:169
Expr * getQueriedExpression() const
Definition: ExprCXX.h:2464
NestedNameSpecifierLoc getQualifierLoc() const
Definition: ExprCXX.h:712
Stmt * getHandler() const
Definition: Stmt.h:1955
unsigned getCharacterLiteralAbbrev() const
Definition: ASTWriter.h:651
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
Definition: Expr.h:1974
TypeSourceInfo * getEncodedTypeSourceInfo() const
Definition: ExprObjC.h:378
NamedDecl * getDecl() const
bool isPostfixUpdate() const
Return true if 'v' expression must be updated to original value of 'x', false if 'v' must be updated ...
Definition: StmtOpenMP.h:1991
unsigned getSwitchCaseID(SwitchCase *S)
Retrieve the ID for the given switch-case statement.
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on a template...
Definition: Expr.h:189
const SmallVectorImpl< AnnotatedLine * >::const_iterator End
Represents a call to the builtin function __builtin_va_arg.
Definition: Expr.h:3655
bool HasTemplateKWAndArgsInfo
Whether the name includes info for explicit template keyword and arguments.
Definition: ExprCXX.h:2500
Expr * getCond() const
Definition: Expr.h:3204
FunctionDecl * getOperatorDelete() const
Definition: ExprCXX.h:1891
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:3245
SourceLocation getOpLoc() const
Definition: ExprObjC.h:526
NameKind getNameKind() const
getNameKind - Determine what kind of name this is.
SourceLocation getThrowLoc() const LLVM_READONLY
Definition: StmtObjC.h:329
static unsigned getNumSubExprs(AtomicOp Op)
Determine the number of arguments the specified atomic builtin should have.
Definition: Expr.cpp:3841
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called...
Definition: ExprCXX.h:1252
This represents '#pragma omp distribute' directive.
Definition: StmtOpenMP.h:2700
This represents implicit clause 'depend' for the '#pragma omp task' directive.
const ObjCMethodDecl * getMethodDecl() const
Definition: ExprObjC.h:1251
LabelDecl * getDecl() const
Definition: Stmt.h:806
OMPClause * getClause(unsigned i) const
Returns specified clause.
Definition: StmtOpenMP.h:190
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type...
Definition: ExprCXX.h:1764
SourceLocation getLParenLoc() const
Returns the location of '('.
Definition: OpenMPClause.h:478
SourceLocation getColonLoc() const
Gets location of ':' symbol in clause.
IdentifierInfo * getInputIdentifier(unsigned i) const
Definition: Stmt.h:1683
llvm::MutableArrayRef< Designator > designators()
Definition: Expr.h:4156
This represents 'proc_bind' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:626
This represents 'capture' clause in the '#pragma omp atomic' directive.
Expr - This represents one expression.
Definition: Expr.h:105
DeclStmt * getEndStmt()
Definition: StmtCXX.h:158
SourceLocation getRParenLoc() const
Definition: Expr.h:2044
SourceLocation getMapLoc() const LLVM_READONLY
Fetches location of clause mapping kind.
SourceLocation getRParenLoc() const
Definition: Expr.h:4444
helper_expr_const_range assignment_ops() const
NestedNameSpecifierLoc getQualifierLoc() const
Fetches the nested-name qualifier with source-location information, if one was given.
Definition: ExprCXX.h:2599
This represents 'simdlen' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:447
decls_iterator decls_end() const
Definition: ExprCXX.h:2573
SourceLocation getScheduleKindLoc()
Get kind location.
Definition: OpenMPClause.h:839
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
Definition: ExprCXX.h:1240
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "while" statement, if any.
Definition: Stmt.cpp:871
SourceLocation getLocation() const
Retrieve the location of this expression.
Definition: Expr.h:877
TypeSourceInfo * getTypeSourceInfo() const
getTypeSourceInfo - Return the destination type.
Definition: Expr.h:3514
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1576
Expr * getCondition() const
Returns condition.
Definition: OpenMPClause.h:316
Represents a C++ functional cast expression that builds a temporary object.
Definition: ExprCXX.h:1454
unsigned getExprImplicitCastAbbrev() const
Definition: ASTWriter.h:653
SourceLocation getLBraceLoc() const
Definition: Expr.h:3873
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1051
SourceLocation getRParenLoc() const
Definition: StmtObjC.h:55
A C++ const_cast expression (C++ [expr.const.cast]).
Definition: ExprCXX.h:372
unsigned getNumExpressions() const
Definition: Expr.h:1952
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:4567
Field designator where only the field name is known.
Definition: ASTBitCodes.h:1497
Expr * getIterationVariable() const
Definition: StmtOpenMP.h:610
SourceLocation getGotoLoc() const
Definition: Stmt.h:1238
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source location information.
Definition: ExprCXX.h:2841
ObjCMethodDecl * getImplicitPropertyGetter() const
Definition: ExprObjC.h:638
raw_arg_iterator raw_arg_end()
Definition: ExprCXX.h:1977
SourceLocation getLocation() const
Definition: ExprCXX.h:1227
SourceLocation getEqualOrColonLoc() const
Retrieve the location of the '=' that precedes the initializer value itself, if present.
Definition: Expr.h:4175
Stmt * getBody()
Definition: Stmt.h:1078
Expr * getPrevLowerBoundVariable() const
Definition: StmtOpenMP.h:706
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
Definition: ExprObjC.h:257
Expr * getRHS()
Definition: Stmt.h:715
ConstructionKind getConstructionKind() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
Definition: ExprCXX.h:1259
Represents Objective-C's @synchronized statement.
Definition: StmtObjC.h:262
ObjCSelectorExpr used for @selector in Objective-C.
Definition: ExprObjC.h:397
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:1239
A CXXStdInitializerListExpr record.
Definition: ASTBitCodes.h:1389
SourceLocation getLParenLoc() const
Returns the location of '('.
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:3653
CXXTryStmt - A C++ try block, including all handlers.
Definition: StmtCXX.h:65
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Definition: Expr.h:4609
An ArraySubscriptExpr record.
Definition: ASTBitCodes.h:1255
OpenMPDirectiveKind getNameModifier() const
Return directive name modifier associated with the clause.
Definition: OpenMPClause.h:260
OMPClauseWriter(ASTRecordWriter &Record)
This represents 'ordered' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:878
Selector getSelector() const
Definition: ExprObjC.h:409
A PseudoObjectExpr record.
Definition: ASTBitCodes.h:1303
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c array literal.
Definition: ExprObjC.h:184
const_all_components_range all_components() const
NonTypeTemplateParmDecl * getParameterPack() const
Retrieve the non-type template parameter pack being substituted.
Definition: ExprCXX.h:3848
SourceRange getAngleBrackets() const LLVM_READONLY
Definition: ExprCXX.h:235
SourceLocation getEndLoc() const
Definition: Stmt.h:470
const SwitchCase * getSwitchCaseList() const
Definition: Stmt.h:996
SourceLocation getQuestionLoc() const
Definition: Expr.h:3159
const_all_num_lists_range all_num_lists() const
SourceLocation getLocation() const
Definition: ExprObjC.h:689
Expr * getSubExpr() const
Definition: Expr.h:1695
capture_init_range capture_inits()
Definition: Stmt.h:2170
This represents '#pragma omp for' directive.
Definition: StmtOpenMP.h:854
An ObjCIndirectCopyRestoreExpr record.
Definition: ASTBitCodes.h:1336
SourceLocation getLabelLoc() const
Definition: Stmt.h:1240
Expr * getElement(unsigned Index)
getExpr - Return the Expr at the specified index.
Definition: ExprObjC.h:187
SourceLocation getColonLoc() const
Return the location of ':'.
Definition: OpenMPClause.h:255
SourceLocation getLParenLoc() const
Returns the location of '('.
Definition: OpenMPClause.h:252
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:224
Stmt * getTemporary() const
Definition: ExprCXX.h:3996
const Stmt * getPreInits() const
Definition: StmtOpenMP.h:638
Represents a folding of a pack over an operator.
Definition: ExprCXX.h:4065
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
Definition: Stmt.h:1366
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition: Expr.h:3511
Expr * getIsLastIterVariable() const
Definition: StmtOpenMP.h:642
An expression that sends a message to the given Objective-C object or class.
Definition: ExprObjC.h:860
void AddDeclRef(const Decl *D)
Emit a reference to a declaration.
Definition: ASTWriter.h:851
unsigned getNumComponents() const
Definition: Expr.h:1933
This represents a Microsoft inline-assembly statement extension.
Definition: Stmt.h:1744
CXXBaseSpecifier * getBase() const
For a base class node, returns the base specifier.
Definition: Expr.h:1844
A DesignatedInitUpdateExpr record.
Definition: ASTBitCodes.h:1279
void AddStmt(Stmt *S)
Add the given statement or expression to the queue of statements to emit.
Definition: ASTWriter.h:784
UnaryOperator - This represents the unary-expression's (except sizeof and alignof), the postinc/postdec operators from postfix-expression, and various extensions.
Definition: Expr.h:1668
Expr * getInputExpr(unsigned i)
Definition: Stmt.cpp:680
Expr * getOutputExpr(unsigned i)
Definition: Stmt.cpp:676
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:4852
StringRef getUuidStr() const
Definition: ExprCXX.h:841
Expr * getCond() const
Definition: Expr.h:3592
A member reference to an MSPropertyDecl.
Definition: ExprCXX.h:663
Expr * getNextUpperBound() const
Definition: StmtOpenMP.h:690
DeclarationName getDeclName() const
getDeclName - Get the actual, stored name of the declaration, which may be a special name...
Definition: Decl.h:258
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition: ExprCXX.h:3767
Expr * getDevice()
Return device number.
This represents '#pragma omp cancel' directive.
Definition: StmtOpenMP.h:2504
SourceLocation getLParenLoc() const
Returns the location of '('.
This represents 'collapse' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:502
SourceLocation getKeywordLoc() const
Retrieve the location of the __if_exists or __if_not_exists keyword.
Definition: StmtCXX.h:262
This represents clause 'firstprivate' in the '#pragma omp ...' directives.
SourceLocation getCommaLoc()
Get location of ','.
ValueDecl * getDecl()
Definition: Expr.h:1017
An ObjCAvailabilityCheckExpr record.
Definition: ASTBitCodes.h:1355
QualType getComputationLHSType() const
Definition: Expr.h:3115
SourceLocation getProcBindKindKwLoc() const
Returns location of clause kind.
Definition: OpenMPClause.h:679
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprCXX.h:845
unsigned getNumClauses() const
Get number of clauses.
Definition: StmtOpenMP.h:184
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:2834
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
NestedNameSpecifierLoc getQualifierLoc() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name, with source-location information.
Definition: Expr.h:1036
AtomicOp getOp() const
Definition: Expr.h:4861
Expr * getLHS()
An array access can be written A[4] or 4[A] (both are equivalent).
Definition: Expr.h:2096
SourceLocation getLParenLoc() const
Definition: Expr.h:2595
SourceLocation getSemiLoc() const
Definition: Stmt.h:529
APFloatSemantics getRawSemantics() const
Get a raw enumeration value representing the floating-point semantics of this literal (32-bit IEEE...
Definition: Expr.h:1378
helper_expr_const_range privates() const
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1...
Definition: Expr.h:1423
SourceLocation getAtLoc() const
Definition: StmtObjC.h:363
This represents '#pragma omp flush' directive.
Definition: StmtOpenMP.h:1772
An ObjCForCollectionStmt record.
Definition: ASTBitCodes.h:1339
helper_expr_const_range destination_exprs() const
SourceLocation getParameterPackLocation() const
Retrieve the location of the parameter pack name.
Definition: ExprCXX.h:3851
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:4196
This represents '#pragma omp parallel for simd' directive.
Definition: StmtOpenMP.h:1382
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will call.
Definition: ExprCXX.h:1358
InitListExpr * getUpdater() const
Definition: Expr.h:4295
DoStmt - This represents a 'do/while' stmt.
Definition: Stmt.h:1102
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
Definition: Stmt.h:1414
This represents 'seq_cst' clause in the '#pragma omp atomic' directive.
SourceLocation getRightLoc() const
Definition: ExprObjC.h:1311
This represents 'untied' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:960
SourceLocation getLParenLoc() const
Returns the location of '('.
Definition: OpenMPClause.h:367
SourceLocation getLocStart() const
Returns starting location of directive kind.
Definition: StmtOpenMP.h:168
QualType getComputationResultType() const
Definition: Expr.h:3118
A MS-style AsmStmt record.
Definition: ASTBitCodes.h:1229
unsigned getNumSubExprs() const
getNumSubExprs - Return the size of the SubExprs array.
Definition: Expr.h:3456
LabelDecl * getLabel() const
Definition: Stmt.h:1235
void push_back(uint64_t N)
Minimal vector-like interface.
Definition: ASTWriter.h:741
decls_iterator decls_begin() const
Definition: ExprCXX.h:2572
Expr * getBase() const
Definition: ExprObjC.h:1408
SourceLocation getOperatorLoc() const
Definition: Expr.h:2041
Expr * getArgument()
Definition: ExprCXX.h:2055
This represents '#pragma omp target enter data' directive.
Definition: StmtOpenMP.h:2132
SourceLocation getLParenLoc()
Get location of '('.
Definition: OpenMPClause.h:836
bool isArray() const
Definition: ExprCXX.h:1894
bool isArrayForm() const
Definition: ExprCXX.h:2042
This represents 'num_teams' clause in the '#pragma omp ...' directive.
SourceLocation getAtLoc() const
Definition: ExprObjC.h:412
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Definition: ExprCXX.h:290
bool cleanupsHaveSideEffects() const
Definition: ExprCXX.h:2978
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
Definition: Expr.h:848
SourceLocation getGotoLoc() const
Definition: Stmt.h:1273
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition: Expr.h:3487
const StringLiteral * getAsmString() const
Definition: Stmt.h:1592
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr...
Definition: ExprCXX.h:2483
A field in a dependent type, known only by its name.
Definition: Expr.h:1779
This captures a statement into a function.
Definition: Stmt.h:2006
Represents a call to an inherited base class constructor from an inheriting constructor.
Definition: ExprCXX.h:1325
Token * getAsmToks()
Definition: Stmt.h:1776
SourceLocation getLParenLoc()
Get location of '('.
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition: Expr.h:4679
bool getValue() const
Definition: ExprObjC.h:71
SourceLocation getRBracket() const
Definition: ExprObjC.h:795
Expr * getNumForLoops() const
Return the number of associated for-loops.
Definition: OpenMPClause.h:537
unsigned getResultExprIndex() const
Return the index of the result-bearing expression into the semantics expressions, or PseudoObjectExpr...
Definition: Expr.h:4728
This represents '#pragma omp single' directive.
Definition: StmtOpenMP.h:1126
Encodes a location in the source.
bool isConstexpr() const
Definition: Stmt.h:933
SourceLocation getLeaveLoc() const
Definition: Stmt.h:1981
body_range body()
Definition: Stmt.h:581
This represents 'hint' clause in the '#pragma omp ...' directive.
helper_expr_const_range reduction_ops() const
const TemplateArgument * iterator
Definition: Type.h:4233
SourceLocation getLParenLoc() const
Returns the location of '('.
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
Definition: Expr.h:902
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
Definition: Expr.h:1909
This is a basic class for representing single OpenMP executable directive.
Definition: StmtOpenMP.h:33
private_copies_range private_copies()
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies this name, if any.
Definition: StmtCXX.h:272
NonTypeTemplateParmDecl * getParameter() const
Definition: ExprCXX.h:3800
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
Definition: ExprCXX.h:1804
SourceLocation getOperatorLoc() const
Retrieve the location of the '.' or '->' operator.
Definition: ExprCXX.h:2196
Expr * getLHS()
Definition: Stmt.h:714
Expr * getLowerBoundVariable() const
Definition: StmtOpenMP.h:650
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit...
Definition: ExprCXX.h:409
Expr * getCondition() const
Returns condition.
Definition: OpenMPClause.h:258
helper_expr_const_range lhs_exprs() const
This represents 'schedule' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:698
Expr * getExpr()
Get 'expr' part of the associated expression/statement.
Definition: StmtOpenMP.h:1998
Represents a call to a member function that may be written either with member call syntax (e...
Definition: ExprCXX.h:121
unsigned getCollapsedNumber() const
Get number of collapsed loops.
Definition: StmtOpenMP.h:608
SourceLocation getKeywordLoc() const
Definition: Stmt.h:670
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprObjC.h:328
bool refersToEnclosingVariableOrCapture() const
Does this DeclRefExpr refer to an enclosing local or a captured variable?
Definition: Expr.h:1141
SourceLocation getRParenLoc() const
Definition: ExprCXX.h:1787
bool isFreeIvar() const
Definition: ExprObjC.h:514
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
Definition: Stmt.h:443
CompoundStmt * getBlock() const
Definition: Stmt.h:1874
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: Expr.h:2491
This represents clause 'shared' in the '#pragma omp ...' directives.
const Expr * getCond() const
Definition: Stmt.h:994
TemplateArgument getArgumentPack() const
Retrieve the template argument pack containing the substituted template arguments.
Definition: ExprCXX.cpp:1338
SourceLocation getIdentLoc() const
Definition: Stmt.h:805
const_all_lists_sizes_range all_lists_sizes() const
A CXXFunctionalCastExpr record.
Definition: ASTBitCodes.h:1385
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition: Expr.h:4632
SourceLocation getTryLoc() const
Definition: Stmt.h:1946
TypeSourceInfo * getClassReceiverTypeInfo() const
Returns a type-source information of a class message send, or NULL if the message is not a class mess...
Definition: ExprObjC.h:1183
Expr * getPriority()
Return Priority number.
StmtVisitor - This class implements a simple visitor for Stmt subclasses.
Definition: StmtVisitor.h:178
void AddTemplateArgument(const TemplateArgument &Arg)
Emit a template argument.
Definition: ASTWriter.cpp:5318
An ObjCEncodeExpr record.
Definition: ASTBitCodes.h:1318
SourceLocation getGenericLoc() const
Definition: Expr.h:4442
SourceLocation getAtLoc() const
Definition: ExprObjC.h:457
This represents '#pragma omp taskwait' directive.
Definition: StmtOpenMP.h:1677
OpenMPMapClauseKind getMapType() const LLVM_READONLY
Fetches mapping kind for the clause.
bool isImplicitAccess() const
True if this is an implicit access, i.e.
Definition: ExprCXX.cpp:1185
SourceLocation getStrTokenLoc(unsigned TokNum) const
Definition: Expr.h:1576
This is a basic class for representing single OpenMP clause.
Definition: OpenMPClause.h:32
bool getValue() const
Definition: ExprCXX.h:2466
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>.
Definition: Expr.h:4804
SourceLocation getDefaultmapModifierLoc() const
Get the modifier location.
unsigned getIntegerLiteralAbbrev() const
Definition: ASTWriter.h:652
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:441
SourceLocation getContinueLoc() const
Definition: Stmt.h:1310
QualType getBaseType() const
Definition: ExprCXX.h:3214
StringLiteral * getFunctionName()
Definition: Expr.cpp:446
SourceLocation getOperatorLoc() const
Retrieve the location of the cast operator keyword, e.g., static_cast.
Definition: ExprCXX.h:228
An ObjCIsa Expr record.
Definition: ASTBitCodes.h:1334
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "switch" statement, if any.
Definition: Stmt.cpp:837
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:2734
capture_iterator capture_end() const
Retrieve an iterator pointing past the end of the sequence of captures.
Definition: Stmt.h:2153
Stmt * getCapturedStmt()
Retrieve the statement being captured.
Definition: Stmt.h:2106
OpenMPMapClauseKind getMapTypeModifier() const LLVM_READONLY
Fetches the map type modifier for the clause.
ParmVarDecl * getParameterPack() const
Get the parameter pack which this expression refers to.
Definition: ExprCXX.h:3913
SourceLocation getLParenLoc() const
Returns the location of '('.
This represents '#pragma omp target' directive.
Definition: StmtOpenMP.h:2016
Expr * getInputExpr(unsigned i)
Definition: Stmt.cpp:408
SourceLocation getBegin() const
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:165
void AddSourceLocation(SourceLocation Loc)
Emit a source location.
Definition: ASTWriter.h:793
Expr * getUpperBoundVariable() const
Definition: StmtOpenMP.h:658
SourceLocation getDependencyLoc() const
Get dependency type location.
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:1027
Expr * getV()
Get 'v' part of the associated expression/statement.
Definition: StmtOpenMP.h:1993
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '...
Definition: ExprCXX.h:3451
StringRef getOutputConstraint(unsigned i) const
Definition: Stmt.h:1786
Expr * getSubExpr()
Definition: ExprObjC.h:108
An expression trait intrinsic.
Definition: ExprCXX.h:2428
StringRef getClobber(unsigned i) const
Definition: Stmt.h:1824
An AtomicExpr record.
Definition: ASTBitCodes.h:1305
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition: ExprCXX.h:620
SourceLocation getAtSynchronizedLoc() const
Definition: StmtObjC.h:279
uint64_t getValue() const
Definition: ExprCXX.h:2405
This represents '#pragma omp ordered' directive.
Definition: StmtOpenMP.h:1827
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition: Expr.h:3380
void AddAPFloat(const llvm::APFloat &Value)
Emit a floating-point value.
Definition: ASTWriter.cpp:4806
const Expr * getBase() const
Definition: Expr.h:4527
This represents '#pragma omp target update' directive.
Definition: StmtOpenMP.h:2768
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:94
Expr * getGrainsize() const
Return safe iteration space distance.
Expr * getArrayFiller()
If this initializer list initializes an array with more elements than there are initializers in the l...
Definition: Expr.h:3831
const BlockDecl * getBlockDecl() const
Definition: Expr.h:4581
bool isObjectReceiver() const
Definition: ExprObjC.h:699
iterator end() const
Definition: ExprCXX.h:3922
SourceLocation getForLoc() const
Definition: StmtCXX.h:193
SourceLocation getRParenLoc() const
Definition: Expr.h:3602
Opcode getOpcode() const
Definition: Expr.h:1692
Representation of a Microsoft __if_exists or __if_not_exists statement with a dependent name...
Definition: StmtCXX.h:240
const OffsetOfNode & getComponent(unsigned Idx) const
Definition: Expr.h:1923
Expr * getPreCond() const
Definition: StmtOpenMP.h:622
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
Definition: Expr.cpp:193
void AddDeclarationNameInfo(const DeclarationNameInfo &NameInfo)
Definition: ASTWriter.cpp:5152
SourceLocation getNameLoc() const
Definition: ExprCXX.h:3794
void VisitStmt(Stmt *S)
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
Definition: Expr.h:1699
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:2791
Expr * Value
The value of the dictionary element.
Definition: ExprObjC.h:217
SourceLocation getRBracketLoc() const
Definition: ExprCXX.h:763
SourceLocation getRBracketLoc() const
Definition: Expr.h:2125
SourceRange getSourceRange() const
Definition: ExprObjC.h:1596
void AddTemplateKWAndArgsInfo(const ASTTemplateKWAndArgsInfo &ArgInfo, const TemplateArgumentLoc *Args)
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:3092
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof...
Definition: ExprCXX.h:3741
SourceLocation getLocation() const LLVM_READONLY
Definition: ExprCXX.h:1374
A POD class for pairing a NamedDecl* with an access specifier.
Represents a C11 generic selection.
Definition: Expr.h:4413
void VisitOMPClauseWithPreInit(OMPClauseWithPreInit *C)
Expr * getInstanceReceiver()
Returns the object expression (receiver) for an instance message, or null for a message that is not a...
Definition: ExprObjC.h:1155
bool isArrow() const
Definition: Expr.h:2510
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition: Expr.h:3339
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers...
Definition: ExprObjC.h:1519
QualType getType() const
Definition: Expr.h:126
SourceLocation getEllipsisLoc() const
Retrieve the location of the ellipsis that describes this pack expansion.
Definition: ExprCXX.h:3617
Represents a reference to a function parameter pack that has been substituted but not yet expanded...
Definition: ExprCXX.h:3884
SourceLocation getLocation() const
Definition: Expr.h:1330
void VisitOMPClauseWithPostUpdate(OMPClauseWithPostUpdate *C)
arg_iterator arg_end()
Definition: ExprObjC.h:1366
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "if" statement, if any.
Definition: Stmt.cpp:778
Expr * getCommon() const
getCommon - Return the common expression, written to the left of the condition.
Definition: Expr.h:3280
NullStmt - This is the null statement ";": C99 6.8.3p3.
Definition: Stmt.h:511
const_all_decls_range all_decls() const
const Expr * getSubExpr() const
Definition: ExprCXX.h:933
bool isImplicitProperty() const
Definition: ExprObjC.h:630
void writeClause(OMPClause *C)
SourceLocation getLParenLoc() const
Definition: Expr.h:2860
This represents 'device' clause in the '#pragma omp ...' directive.
const Expr * getAssocExpr(unsigned i) const
Definition: Expr.h:4446
helper_expr_const_range rhs_exprs() const
An InitListExpr record.
Definition: ASTBitCodes.h:1275
bool hadMultipleCandidates() const
Returns true if this expression refers to a function that was resolved from an overloaded set having ...
Definition: Expr.h:1129
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:1160
unsigned getByteLength() const
Definition: Expr.h:1546
A CXXBoolLiteralExpr record.
Definition: ASTBitCodes.h:1391
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
Definition: ExprCXX.h:2008
SourceLocation getStarLoc() const
Definition: Stmt.h:1275
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition: ExprCXX.h:820
SourceLocation getOpLoc() const
Definition: ExprObjC.h:1418
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1111
const Stmt * getBody() const
Definition: Stmt.h:995
An ExtVectorElementExpr record.
Definition: ASTBitCodes.h:1273
NestedNameSpecifierLoc getQualifierLoc() const
Retrieves the nested-name-specifier that qualifies the type name, with source-location information...
Definition: ExprCXX.h:2182
This represents '#pragma omp section' directive.
Definition: StmtOpenMP.h:1064
bool isThrownVariableInScope() const
Determines whether the variable thrown by this expression (if any!) is within the innermost try block...
Definition: ExprCXX.h:943
NestedNameSpecifierLoc getQualifierLoc() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name...
Definition: Expr.h:2430
ExprIterator arg_iterator
Definition: ExprCXX.h:1951
SourceLocation getLParenLoc() const
Definition: ExprCXX.h:1423
SourceLocation EllipsisLoc
The location of the ellipsis, if this is a pack expansion.
Definition: ExprObjC.h:220
A runtime availability query.
Definition: ExprObjC.h:1579
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
Definition: ExprCXX.h:332
This represents '#pragma omp simd' directive.
Definition: StmtOpenMP.h:789
SourceLocation getTildeLoc() const
Retrieve the location of the '~'.
Definition: ExprCXX.h:2214
Represents a 'co_yield' expression.
Definition: ExprCXX.h:4228
An ObjCAutoreleasePoolStmt record.
Definition: ASTBitCodes.h:1351
const Expr * getSynchExpr() const
Definition: StmtObjC.h:290
unsigned getNumHandlers() const
Definition: StmtCXX.h:103
Expr * getNumTasks() const
Return safe iteration space distance.
const StringLiteral * getOutputConstraintLiteral(unsigned i) const
Definition: Stmt.h:1668
SourceLocation getLParenLoc()
Get location of '('.
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition: ExprCXX.h:3581
unsigned getUniqueDeclarationsNum() const
Return the number of unique base declarations in this clause.
unsigned getNumPlacementArgs() const
Definition: ExprCXX.h:1902
A CXXDynamicCastExpr record.
Definition: ASTBitCodes.h:1379
StringRef getBytes() const
Allow access to clients that need the byte representation, such as ASTWriterStmt::VisitStringLiteral(...
Definition: Expr.h:1522
SourceLocation getWhileLoc() const
Definition: Stmt.h:1129
This represents clause 'linear' in the '#pragma omp ...' directives.
DeclarationNameInfo getDirectiveName() const
Return name of the directive.
Definition: StmtOpenMP.h:1286
StringKind getKind() const
Definition: Expr.h:1554
bool isTypeOperand() const
Definition: ExprCXX.h:813
ObjCMethodDecl * getArrayWithObjectsMethod() const
Definition: ExprObjC.h:196
Expr * getEnsureUpperBound() const
Definition: StmtOpenMP.h:674
detail::InMemoryDirectory::const_iterator E
Expr * getUpdateExpr()
Get helper expression of the form 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' or 'OpaqueValueExp...
Definition: StmtOpenMP.h:1979
bool usesGNUSyntax() const
Determines whether this designated initializer used the deprecated GNU syntax for designated initiali...
Definition: Expr.h:4180
semantics_iterator semantics_begin()
Definition: Expr.h:4747
const Expr * getRetValue() const
Definition: Stmt.cpp:899
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition: Expr.h:2205
SourceLocation getLocation() const
Definition: ExprCXX.h:889
ExplicitCastExpr - An explicit cast written in the source code.
Definition: Expr.h:2800
unsigned getNumArgs() const
Definition: ExprCXX.h:1285
unsigned getNumConcatenated() const
getNumConcatenated - Get the number of string literal tokens that were concatenated in translation ph...
Definition: Expr.h:1574
This represents '#pragma omp atomic' directive.
Definition: StmtOpenMP.h:1882
SourceLocation getParameterPackLocation() const
Get the location of the parameter pack.
Definition: ExprCXX.h:3916
Expr * getBaseExpr() const
Definition: ExprObjC.h:807
void AddVersionTuple(const VersionTuple &Version)
Emit a version tuple.
Definition: ASTWriter.h:901
CXXRecordDecl * getNamingClass() const
Gets the 'naming class' (in the sense of C++0x [class.access.base]p5) of the lookup.
Definition: ExprCXX.h:2755
An ObjCAtFinallyStmt record.
Definition: ASTBitCodes.h:1343
Expr * getCalcLastIteration() const
Definition: StmtOpenMP.h:618
ObjCMethodDecl * getDictWithObjectsMethod() const
Definition: ExprObjC.h:323
llvm::APFloat getValue() const
Definition: Expr.h:1368
Represents a __leave statement.
Definition: Stmt.h:1972
const Stmt * getThen() const
Definition: Stmt.h:919
ArrayRef< Expr * > counters()
Definition: StmtOpenMP.h:733
path_iterator path_end()
Definition: Expr.h:2701
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition: ExprCXX.h:3526
SourceLocation getMemberLoc() const
getMemberLoc - Return the location of the "member", in X->F, it is the location of 'F'...
Definition: Expr.h:2515
bool hasQualifier() const
Determine whether this declaration reference was preceded by a C++ nested-name-specifier, e.g., N::foo.
Definition: Expr.h:1032
SwitchStmt - This represents a 'switch' stmt.
Definition: Stmt.h:957
SourceLocation getAtCatchLoc() const
Definition: StmtObjC.h:102
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
Definition: Expr.h:4638
arg_iterator arg_begin()
Definition: ExprObjC.h:1365
SourceLocation getRParenLoc() const
Definition: StmtObjC.h:104
Expr * getSafelen() const
Return safe iteration space distance.
Definition: OpenMPClause.h:426
Represents the body of a coroutine.
Definition: StmtCXX.h:299
SourceLocation getLeftLoc() const
Definition: ExprObjC.h:1310
TemplateArgumentLoc * getTrailingTemplateArgumentLoc()
Return the optional template arguments.
Definition: ExprCXX.h:3513
Location wrapper for a TemplateArgument.
Definition: TemplateBase.h:427
bool isOpenMPDistributeDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a distribute directive.
Expr * getRHS() const
Definition: Expr.h:3596
Expr * getBase() const
Retrieve the base object of this member expressions, e.g., the x in x.m.
Definition: ExprCXX.h:3209
SourceLocation getOperatorLoc() const
Retrieve the location of the '->' or '.' operator.
Definition: ExprCXX.h:3221
FunctionDecl * getOperatorNew() const
Definition: ExprCXX.h:1889
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition: Expr.h:2063
const Stmt * getSubStmt() const
Definition: StmtObjC.h:356
Represents Objective-C's collection statement.
Definition: StmtObjC.h:24
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
Definition: Expr.h:3283
An ObjCAtSynchronizedStmt record.
Definition: ASTBitCodes.h:1347
SourceLocation getBridgeKeywordLoc() const
The location of the bridge keyword.
Definition: ExprObjC.h:1554
ASTWriter::RecordDataImpl & getRecordData() const
Extract the underlying record storage.
Definition: ASTWriter.h:737
arg_iterator arg_begin()
Definition: Expr.h:2247
ArrayRef< Expr * > inits()
Definition: StmtOpenMP.h:745
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:355
SourceLocation getLParenLoc() const
Returns the location of '('.
Definition: OpenMPClause.h:600
SourceLocation getBuiltinLoc() const
Definition: Expr.h:3599
SourceLocation getAtTryLoc() const
Retrieve the location of the @ in the @try.
Definition: StmtObjC.h:193
An implicit indirection through a C++ base class, when the field found is in a base class...
Definition: Expr.h:1782
SourceLocation getLParenLoc() const
Returns the location of '('.
Definition: OpenMPClause.h:534
Represents a call to a CUDA kernel function.
Definition: ExprCXX.h:160
Represents a 'co_await' expression.
Definition: ExprCXX.h:4205
TypeSourceInfo * getWrittenTypeInfo() const
Definition: Expr.h:3681
Stmt * getInit()
Definition: Stmt.h:991
A CXXMemberCallExpr record.
Definition: ASTBitCodes.h:1369
Expr * getArg(unsigned Arg)
Return the specified argument.
Definition: ExprCXX.h:1288
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
Definition: ExprCXX.h:1225
Expr * getExprOperand() const
Definition: ExprCXX.h:830
bool isVolatile() const
Definition: Stmt.h:1449
Represents Objective-C's @finally statement.
Definition: StmtObjC.h:120
const Expr * getSubExpr() const
Definition: Expr.h:1435
SourceLocation getRParenLoc() const
Retrieve the location of the right parentheses (')') that follows the argument list.
Definition: ExprCXX.h:3072
SourceLocation getDistScheduleKindLoc()
Get kind location.
QualType getSuperReceiverType() const
Definition: ExprObjC.h:692
ExprIterator arg_iterator
Definition: Expr.h:2237
SourceLocation getRParenLoc() const
Definition: ExprCXX.h:1425
SourceLocation getBuiltinLoc() const
getBuiltinLoc - Return the location of the __builtin_convertvector token.
Definition: Expr.h:3522
uint64_t EmitStmt(unsigned Code, unsigned Abbrev=0)
Emit the record to the stream, preceded by its substatements.
Definition: ASTWriter.h:763
bool inheritedFromVBase() const
Determine whether the inherited constructor is inherited from a virtual base of the object we constru...
Definition: ExprCXX.h:1372
Expr * getKeyExpr() const
Definition: ExprObjC.h:810
unsigned getNumArgs() const
Return the number of actual arguments in this message, not counting the receiver. ...
Definition: ExprObjC.h:1277
LabelDecl * getLabel() const
Definition: Expr.h:3361
SourceLocation getAccessorLoc() const
Definition: Expr.h:4534
Represents a base class of a C++ class.
Definition: DeclCXX.h:159
This represents 'write' clause in the '#pragma omp atomic' directive.
ObjCPropertyDecl * getExplicitProperty() const
Definition: ExprObjC.h:633
unsigned getNumCatchStmts() const
Retrieve the number of @catch statements in this try-catch-finally block.
Definition: StmtObjC.h:203
const Expr * getInitializer() const
Definition: Expr.h:2588
SourceRange getDirectInitRange() const
Definition: ExprCXX.h:1988
SourceLocation getRParenLoc() const
Definition: Expr.h:2863
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:479
SourceLocation getForLoc() const
Definition: Stmt.h:1200
SourceLocation getLocation() const
Definition: ExprCXX.h:519
DeclStmt * getRangeStmt()
Definition: StmtCXX.h:154
A ConvertVectorExpr record.
Definition: ASTBitCodes.h:1297
bool hasAssociatedStmt() const
Returns true if directive has associated statement.
Definition: StmtOpenMP.h:193
Expr * getFalseExpr() const
getFalseExpr - Return the subexpression which will be evaluated if the condnition evaluates to false;...
Definition: Expr.h:3299
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:3021
GotoStmt - This represents a direct goto.
Definition: Stmt.h:1224
ArrayRef< const Attr * > getAttrs() const
Definition: Stmt.h:862
A use of a default initializer in a constructor or in aggregate initialization.
Definition: ExprCXX.h:1037
Expr * getTarget()
Definition: Stmt.h:1277
Expr * getBase() const
Definition: Expr.h:2405
SourceLocation getColonLoc() const
Definition: Stmt.h:672
SourceLocation getAttrLoc() const
Definition: Stmt.h:861
SourceLocation getLParenLoc() const
Returns the location of '('.
Definition: OpenMPClause.h:423
CapturedDecl * getCapturedDecl()
Retrieve the outlined function declaration.
Definition: Stmt.cpp:1084
Expr * getCond()
Definition: Stmt.h:1120
helper_expr_const_range destination_exprs() const
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
const StringLiteral * getInputConstraintLiteral(unsigned i) const
Definition: Stmt.h:1696
ASTStmtWriter(ASTWriter &Writer, ASTWriter::RecordData &Record)
bool isArrayFormAsWritten() const
Definition: ExprCXX.h:2043
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition: Expr.h:2315
GNU array range designator.
Definition: ASTBitCodes.h:1504
OverloadedOperatorKind getOperator() const
Returns the kind of overloaded operator that this expression refers to.
Definition: ExprCXX.h:77
Expr * getNextLowerBound() const
Definition: StmtOpenMP.h:682
SourceLocation getFinallyLoc() const
Definition: Stmt.h:1907
const Expr * getSubExpr() const
Definition: Expr.h:1635
A GCC-style AsmStmt record.
Definition: ASTBitCodes.h:1227
SourceLocation getBuiltinLoc() const
Definition: Expr.h:4880
This represents '#pragma omp target parallel' directive.
Definition: StmtOpenMP.h:2249
SourceLocation getRParenLoc() const
Retrieve the location of the closing parenthesis.
Definition: ExprCXX.h:231
This represents 'nowait' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:929
ContinueStmt - This represents a continue.
Definition: Stmt.h:1302
SourceLocation getRParenLoc() const
Definition: Stmt.h:1204
This represents 'num_tasks' clause in the '#pragma omp ...' directive.
bool isGlobalNew() const
Definition: ExprCXX.h:1919
Opcode getOpcode() const
Definition: Expr.h:2940
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition: Expr.h:3547
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Definition: Expr.h:3240
SourceLocation getBreakLoc() const
Definition: Stmt.h:1340
CXXCatchStmt - This represents a C++ catch block.
Definition: StmtCXX.h:29
SourceLocation getBuiltinLoc() const
Definition: Expr.h:3440
An index into an array.
Definition: Expr.h:1775
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr.type.conv]).
Definition: ExprCXX.h:1395
An object for streaming information to a record.
Definition: ASTWriter.h:693
bool hasQualifier() const
Determines whether this member expression actually had a C++ nested-name-specifier prior to the name ...
Definition: Expr.h:2425
An ObjCAtCatchStmt record.
Definition: ASTBitCodes.h:1341
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
Definition: ExprCXX.h:1947
WhileStmt - This represents a 'while' stmt.
Definition: Stmt.h:1047
Field designator where the field has been resolved to a declaration.
Definition: ASTBitCodes.h:1500
const Expr * getCond() const
Definition: Stmt.h:917
FieldDecl * getField() const
For a field offsetof node, returns the field.
Definition: Expr.h:1834
SourceLocation getElseLoc() const
Definition: Stmt.h:930
TypeSourceInfo * getQueriedTypeSourceInfo() const
Definition: ExprCXX.h:2403
helper_expr_const_range assignment_ops() const
A CXXInheritedCtorInitExpr record.
Definition: ASTBitCodes.h:1373
Expr * getThreadLimit()
Return ThreadLimit number.
CompoundStmt * getTryBlock()
Definition: StmtCXX.h:96
Writes an AST file containing the contents of a translation unit.
Definition: ASTWriter.h:84
OpenMPDefaultmapClauseKind getDefaultmapKind() const
Get kind of the clause.
The receiver is a class.
Definition: ExprObjC.h:1003
Represents Objective-C's @try ... @catch ... @finally statement.
Definition: StmtObjC.h:154
void AddCXXBaseSpecifier(const CXXBaseSpecifier &Base)
Emit a C++ base specifier.
Definition: ASTWriter.cpp:5399
bool isSimple() const
Definition: Stmt.h:1446
This represents '#pragma omp taskloop simd' directive.
Definition: StmtOpenMP.h:2634
const Expr * getThrowExpr() const
Definition: StmtObjC.h:325
bool hasTemplateKWAndArgsInfo() const
Definition: Expr.h:1064
void AddAPInt(const llvm::APInt &Value)
Emit an integral value.
Definition: ASTWriter.cpp:4795
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:2374
SourceLocation getRBracketLoc() const
Definition: ExprOpenMP.h:112
SourceLocation getLocation() const
Definition: ExprObjC.h:77
StringLiteral - This represents a string literal expression, e.g.
Definition: Expr.h:1466
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2148
Expr * getRHS() const
Definition: Expr.h:2945
bool isExact() const
Definition: Expr.h:1394
Expr * getPattern()
Retrieve the pattern of the pack expansion.
Definition: ExprCXX.h:3610
This represents 'dist_schedule' clause in the '#pragma omp ...' directive.
bool isIfExists() const
Determine whether this is an __if_exists statement.
Definition: StmtCXX.h:265
bool constructsVBase() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
Definition: ExprCXX.h:1362
SourceLocation getRBracLoc() const
Definition: Stmt.h:630
SourceLocation getColonLoc() const
Definition: StmtCXX.h:195
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:283
Abstract class common to all of the C++ "named"/"keyword" casts.
Definition: ExprCXX.h:203
bool isMicrosoftABI() const
Returns whether this is really a Win64 ABI va_arg expression.
Definition: Expr.h:3678
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
Definition: ExprCXX.h:1247
This represents '#pragma omp sections' directive.
Definition: StmtOpenMP.h:996
Expr * getBase() const
Definition: Expr.h:4292
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition: ExprObjC.h:60
const Stmt * getTryBody() const
Retrieve the @try body.
Definition: StmtObjC.h:197
This represents '#pragma omp target data' directive.
Definition: StmtOpenMP.h:2074
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument for this lambda expression...
Definition: ExprCXX.h:1688
VarDecl * getExceptionDecl() const
Definition: StmtCXX.h:50
capture_range captures()
Definition: Stmt.h:2140
A reference to a declared variable, function, enum, etc.
Definition: Expr.h:932
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
Definition: Expr.h:401
SourceLocation getLParenLoc() const
Returns the location of '('.
BreakStmt - This represents a break.
Definition: Stmt.h:1328
Expr * getLastIteration() const
Definition: StmtOpenMP.h:614
SourceLocation getColonLoc() const
Definition: ExprOpenMP.h:109
Expr * getChunkSize()
Get chunk size.
Definition: OpenMPClause.h:855
const Stmt * getPreInitStmt() const
Get pre-initialization statement for the clause.
Definition: OpenMPClause.h:88
const Expr * getInit(unsigned Init) const
Definition: Expr.h:3785
const Expr * getSubExpr() const
Definition: ExprCXX.h:1143
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
Definition: Expr.h:3849
TypeSourceInfo * getAllocatedTypeSourceInfo() const
Definition: ExprCXX.h:1868
Stmt * getSubStmt()
Definition: Stmt.h:809
void AddTemplateArgumentLoc(const TemplateArgumentLoc &Arg)
Emits a template argument location.
Definition: ASTWriter.cpp:4907
DeclStmt * getLoopVarStmt()
Definition: StmtCXX.h:161
unsigned getNumClobbers() const
Definition: Stmt.h:1494
Expr * getTrueExpr() const
getTrueExpr - Return the subexpression which will be evaluated if the condition evaluates to true; th...
Definition: Expr.h:3292
SourceLocation getRParenLoc() const
Definition: StmtCXX.h:196
A trivial tuple used to represent a source range.
helper_expr_const_range destination_exprs() const
This represents '#pragma omp taskyield' directive.
Definition: StmtOpenMP.h:1589
This represents '#pragma omp distribute parallel for simd' composite directive.
Definition: StmtOpenMP.h:2897
SourceLocation getRParenLoc() const
Definition: Expr.h:4881
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition: ExprCXX.h:471
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type, member-designator).
Definition: Expr.h:1874
CompoundStmt * getTryBlock() const
Definition: Stmt.h:1951
This represents '#pragma omp parallel sections' directive.
Definition: StmtOpenMP.h:1450
bool isArrow() const
Definition: ExprCXX.h:710
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
Definition: ExprCXX.h:784
SourceLocation getStartLoc() const
Definition: Stmt.h:468
const CallExpr * getConfig() const
Definition: ExprCXX.h:173
SourceLocation getLocation() const
Definition: Expr.h:1402
DeclStmt * getBeginStmt()
Definition: StmtCXX.h:155
SourceLocation getLocEnd() const
Returns ending location of directive.
Definition: StmtOpenMP.h:170
bool isTypeOperand() const
Definition: ExprCXX.h:613
Expr * getInit() const
Definition: StmtOpenMP.h:630
The receiver is a superclass.
Definition: ExprObjC.h:1007
Stmt * getAssociatedStmt() const
Returns statement associated with the directive.
Definition: StmtOpenMP.h:196
SourceLocation getExceptLoc() const
Definition: Stmt.h:1867
SourceLocation getNameModifierLoc() const
Return the location of directive name modifier.
Definition: OpenMPClause.h:263
SourceLocation getCatchLoc() const
Definition: StmtCXX.h:49
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
Definition: ExprObjC.h:1136
Represents Objective-C's @autoreleasepool Statement.
Definition: StmtObjC.h:345
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '...
Definition: ExprCXX.h:3218
unsigned varlist_size() const
Definition: OpenMPClause.h:161
StmtCode
Record codes for each kind of statement or expression.
Definition: ASTBitCodes.h:1182
Stmt * getSubStmt()
Definition: Stmt.h:865
Represents an implicitly-generated value initialization of an object of a given type.
Definition: Expr.h:4315
ObjCMethodDecl * getImplicitPropertySetter() const
Definition: ExprObjC.h:643
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c dictionary literal.
Definition: ExprObjC.h:307
A GenericSelectionExpr record.
Definition: ASTBitCodes.h:1301
This represents '#pragma omp target parallel for' directive.
Definition: StmtOpenMP.h:2309
SourceLocation getRParenLoc() const
Definition: ExprObjC.h:373
This represents clause 'use_device_ptr' in the '#pragma omp ...' directives.
SourceLocation getRParenLoc() const
Definition: Expr.h:3443
Expr * getLength()
Get length of array section.
Definition: ExprOpenMP.h:99
Kind getKind() const
Determine what kind of offsetof node this is.
Definition: Expr.h:1824
helper_expr_const_range assignment_ops() const
SourceLocation getColonLoc() const
Definition: Expr.h:3160
Expr * getStrideVariable() const
Definition: StmtOpenMP.h:666
bool isArrow() const
Definition: ExprObjC.h:513
DeclAccessPair getFoundDecl() const
Retrieves the declaration found by lookup.
Definition: Expr.h:2415
bool hasUnresolvedUsing() const
Determine whether the lookup results contain an unresolved using declaration.
Definition: ExprCXX.h:3447
Expr * getBase()
An array section can be written only as Base[LowerBound:Length].
Definition: ExprOpenMP.h:82
TypeSourceInfo * getArgumentTypeInfo() const
Definition: Expr.h:2014
helper_expr_const_range source_exprs() const
Stmt * getSubStmt()
Definition: Stmt.h:716
This represents '#pragma omp taskloop' directive.
Definition: StmtOpenMP.h:2569