clang  3.8.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  friend class OMPClauseWriter;
33  ASTWriter &Writer;
34  ASTWriter::RecordData &Record;
35 
36  public:
38  unsigned AbbrevToUse;
39 
41  : Writer(Writer), Record(Record) { }
42 
43  void AddTemplateKWAndArgsInfo(const ASTTemplateKWAndArgsInfo &ArgInfo,
44  const TemplateArgumentLoc *Args);
45 
46  void VisitStmt(Stmt *S);
47 #define STMT(Type, Base) \
48  void Visit##Type(Type *);
49 #include "clang/AST/StmtNodes.inc"
50  };
51 }
52 
54  const ASTTemplateKWAndArgsInfo &ArgInfo, const TemplateArgumentLoc *Args) {
55  Writer.AddSourceLocation(ArgInfo.TemplateKWLoc, Record);
56  Writer.AddSourceLocation(ArgInfo.LAngleLoc, Record);
57  Writer.AddSourceLocation(ArgInfo.RAngleLoc, Record);
58  for (unsigned i = 0; i != ArgInfo.NumTemplateArgs; ++i)
59  Writer.AddTemplateArgumentLoc(Args[i], Record);
60 }
61 
63 }
64 
65 void ASTStmtWriter::VisitNullStmt(NullStmt *S) {
66  VisitStmt(S);
67  Writer.AddSourceLocation(S->getSemiLoc(), Record);
68  Record.push_back(S->HasLeadingEmptyMacro);
70 }
71 
72 void ASTStmtWriter::VisitCompoundStmt(CompoundStmt *S) {
73  VisitStmt(S);
74  Record.push_back(S->size());
75  for (auto *CS : S->body())
76  Writer.AddStmt(CS);
77  Writer.AddSourceLocation(S->getLBracLoc(), Record);
78  Writer.AddSourceLocation(S->getRBracLoc(), Record);
80 }
81 
82 void ASTStmtWriter::VisitSwitchCase(SwitchCase *S) {
83  VisitStmt(S);
84  Record.push_back(Writer.getSwitchCaseID(S));
85  Writer.AddSourceLocation(S->getKeywordLoc(), Record);
86  Writer.AddSourceLocation(S->getColonLoc(), Record);
87 }
88 
89 void ASTStmtWriter::VisitCaseStmt(CaseStmt *S) {
90  VisitSwitchCase(S);
91  Writer.AddStmt(S->getLHS());
92  Writer.AddStmt(S->getRHS());
93  Writer.AddStmt(S->getSubStmt());
94  Writer.AddSourceLocation(S->getEllipsisLoc(), Record);
96 }
97 
98 void ASTStmtWriter::VisitDefaultStmt(DefaultStmt *S) {
99  VisitSwitchCase(S);
100  Writer.AddStmt(S->getSubStmt());
102 }
103 
104 void ASTStmtWriter::VisitLabelStmt(LabelStmt *S) {
105  VisitStmt(S);
106  Writer.AddDeclRef(S->getDecl(), Record);
107  Writer.AddStmt(S->getSubStmt());
108  Writer.AddSourceLocation(S->getIdentLoc(), Record);
110 }
111 
112 void ASTStmtWriter::VisitAttributedStmt(AttributedStmt *S) {
113  VisitStmt(S);
114  Record.push_back(S->getAttrs().size());
115  Writer.WriteAttributes(S->getAttrs(), Record);
116  Writer.AddStmt(S->getSubStmt());
117  Writer.AddSourceLocation(S->getAttrLoc(), Record);
119 }
120 
121 void ASTStmtWriter::VisitIfStmt(IfStmt *S) {
122  VisitStmt(S);
123  Writer.AddDeclRef(S->getConditionVariable(), Record);
124  Writer.AddStmt(S->getCond());
125  Writer.AddStmt(S->getThen());
126  Writer.AddStmt(S->getElse());
127  Writer.AddSourceLocation(S->getIfLoc(), Record);
128  Writer.AddSourceLocation(S->getElseLoc(), Record);
130 }
131 
132 void ASTStmtWriter::VisitSwitchStmt(SwitchStmt *S) {
133  VisitStmt(S);
134  Writer.AddDeclRef(S->getConditionVariable(), Record);
135  Writer.AddStmt(S->getCond());
136  Writer.AddStmt(S->getBody());
137  Writer.AddSourceLocation(S->getSwitchLoc(), Record);
138  Record.push_back(S->isAllEnumCasesCovered());
139  for (SwitchCase *SC = S->getSwitchCaseList(); SC;
140  SC = SC->getNextSwitchCase())
141  Record.push_back(Writer.RecordSwitchCaseID(SC));
143 }
144 
145 void ASTStmtWriter::VisitWhileStmt(WhileStmt *S) {
146  VisitStmt(S);
147  Writer.AddDeclRef(S->getConditionVariable(), Record);
148  Writer.AddStmt(S->getCond());
149  Writer.AddStmt(S->getBody());
150  Writer.AddSourceLocation(S->getWhileLoc(), Record);
152 }
153 
154 void ASTStmtWriter::VisitDoStmt(DoStmt *S) {
155  VisitStmt(S);
156  Writer.AddStmt(S->getCond());
157  Writer.AddStmt(S->getBody());
158  Writer.AddSourceLocation(S->getDoLoc(), Record);
159  Writer.AddSourceLocation(S->getWhileLoc(), Record);
160  Writer.AddSourceLocation(S->getRParenLoc(), Record);
162 }
163 
164 void ASTStmtWriter::VisitForStmt(ForStmt *S) {
165  VisitStmt(S);
166  Writer.AddStmt(S->getInit());
167  Writer.AddStmt(S->getCond());
168  Writer.AddDeclRef(S->getConditionVariable(), Record);
169  Writer.AddStmt(S->getInc());
170  Writer.AddStmt(S->getBody());
171  Writer.AddSourceLocation(S->getForLoc(), Record);
172  Writer.AddSourceLocation(S->getLParenLoc(), Record);
173  Writer.AddSourceLocation(S->getRParenLoc(), Record);
175 }
176 
177 void ASTStmtWriter::VisitGotoStmt(GotoStmt *S) {
178  VisitStmt(S);
179  Writer.AddDeclRef(S->getLabel(), Record);
180  Writer.AddSourceLocation(S->getGotoLoc(), Record);
181  Writer.AddSourceLocation(S->getLabelLoc(), Record);
183 }
184 
185 void ASTStmtWriter::VisitIndirectGotoStmt(IndirectGotoStmt *S) {
186  VisitStmt(S);
187  Writer.AddSourceLocation(S->getGotoLoc(), Record);
188  Writer.AddSourceLocation(S->getStarLoc(), Record);
189  Writer.AddStmt(S->getTarget());
191 }
192 
193 void ASTStmtWriter::VisitContinueStmt(ContinueStmt *S) {
194  VisitStmt(S);
195  Writer.AddSourceLocation(S->getContinueLoc(), Record);
197 }
198 
199 void ASTStmtWriter::VisitBreakStmt(BreakStmt *S) {
200  VisitStmt(S);
201  Writer.AddSourceLocation(S->getBreakLoc(), Record);
203 }
204 
205 void ASTStmtWriter::VisitReturnStmt(ReturnStmt *S) {
206  VisitStmt(S);
207  Writer.AddStmt(S->getRetValue());
208  Writer.AddSourceLocation(S->getReturnLoc(), Record);
209  Writer.AddDeclRef(S->getNRVOCandidate(), Record);
211 }
212 
213 void ASTStmtWriter::VisitDeclStmt(DeclStmt *S) {
214  VisitStmt(S);
215  Writer.AddSourceLocation(S->getStartLoc(), Record);
216  Writer.AddSourceLocation(S->getEndLoc(), Record);
217  DeclGroupRef DG = S->getDeclGroup();
218  for (DeclGroupRef::iterator D = DG.begin(), DEnd = DG.end(); D != DEnd; ++D)
219  Writer.AddDeclRef(*D, Record);
221 }
222 
223 void ASTStmtWriter::VisitAsmStmt(AsmStmt *S) {
224  VisitStmt(S);
225  Record.push_back(S->getNumOutputs());
226  Record.push_back(S->getNumInputs());
227  Record.push_back(S->getNumClobbers());
228  Writer.AddSourceLocation(S->getAsmLoc(), Record);
229  Record.push_back(S->isVolatile());
230  Record.push_back(S->isSimple());
231 }
232 
233 void ASTStmtWriter::VisitGCCAsmStmt(GCCAsmStmt *S) {
234  VisitAsmStmt(S);
235  Writer.AddSourceLocation(S->getRParenLoc(), Record);
236  Writer.AddStmt(S->getAsmString());
237 
238  // Outputs
239  for (unsigned I = 0, N = S->getNumOutputs(); I != N; ++I) {
240  Writer.AddIdentifierRef(S->getOutputIdentifier(I), Record);
242  Writer.AddStmt(S->getOutputExpr(I));
243  }
244 
245  // Inputs
246  for (unsigned I = 0, N = S->getNumInputs(); I != N; ++I) {
247  Writer.AddIdentifierRef(S->getInputIdentifier(I), Record);
248  Writer.AddStmt(S->getInputConstraintLiteral(I));
249  Writer.AddStmt(S->getInputExpr(I));
250  }
251 
252  // Clobbers
253  for (unsigned I = 0, N = S->getNumClobbers(); I != N; ++I)
254  Writer.AddStmt(S->getClobberStringLiteral(I));
255 
257 }
258 
259 void ASTStmtWriter::VisitMSAsmStmt(MSAsmStmt *S) {
260  VisitAsmStmt(S);
261  Writer.AddSourceLocation(S->getLBraceLoc(), Record);
262  Writer.AddSourceLocation(S->getEndLoc(), Record);
263  Record.push_back(S->getNumAsmToks());
264  Writer.AddString(S->getAsmString(), Record);
265 
266  // Tokens
267  for (unsigned I = 0, N = S->getNumAsmToks(); I != N; ++I) {
268  Writer.AddToken(S->getAsmToks()[I], Record);
269  }
270 
271  // Clobbers
272  for (unsigned I = 0, N = S->getNumClobbers(); I != N; ++I) {
273  Writer.AddString(S->getClobber(I), Record);
274  }
275 
276  // Outputs
277  for (unsigned I = 0, N = S->getNumOutputs(); I != N; ++I) {
278  Writer.AddStmt(S->getOutputExpr(I));
279  Writer.AddString(S->getOutputConstraint(I), Record);
280  }
281 
282  // Inputs
283  for (unsigned I = 0, N = S->getNumInputs(); I != N; ++I) {
284  Writer.AddStmt(S->getInputExpr(I));
285  Writer.AddString(S->getInputConstraint(I), Record);
286  }
287 
289 }
290 
291 void ASTStmtWriter::VisitCoroutineBodyStmt(CoroutineBodyStmt *S) {
292  // FIXME: Implement coroutine serialization.
293  llvm_unreachable("unimplemented");
294 }
295 
296 void ASTStmtWriter::VisitCoreturnStmt(CoreturnStmt *S) {
297  // FIXME: Implement coroutine serialization.
298  llvm_unreachable("unimplemented");
299 }
300 
301 void ASTStmtWriter::VisitCoawaitExpr(CoawaitExpr *S) {
302  // FIXME: Implement coroutine serialization.
303  llvm_unreachable("unimplemented");
304 }
305 
306 void ASTStmtWriter::VisitCoyieldExpr(CoyieldExpr *S) {
307  // FIXME: Implement coroutine serialization.
308  llvm_unreachable("unimplemented");
309 }
310 
311 void ASTStmtWriter::VisitCapturedStmt(CapturedStmt *S) {
312  VisitStmt(S);
313  // NumCaptures
314  Record.push_back(std::distance(S->capture_begin(), S->capture_end()));
315 
316  // CapturedDecl and captured region kind
317  Writer.AddDeclRef(S->getCapturedDecl(), Record);
318  Record.push_back(S->getCapturedRegionKind());
319 
320  Writer.AddDeclRef(S->getCapturedRecordDecl(), Record);
321 
322  // Capture inits
323  for (auto *I : S->capture_inits())
324  Writer.AddStmt(I);
325 
326  // Body
327  Writer.AddStmt(S->getCapturedStmt());
328 
329  // Captures
330  for (const auto &I : S->captures()) {
331  if (I.capturesThis() || I.capturesVariableArrayType())
332  Writer.AddDeclRef(nullptr, Record);
333  else
334  Writer.AddDeclRef(I.getCapturedVar(), Record);
335  Record.push_back(I.getCaptureKind());
336  Writer.AddSourceLocation(I.getLocation(), Record);
337  }
338 
340 }
341 
342 void ASTStmtWriter::VisitExpr(Expr *E) {
343  VisitStmt(E);
344  Writer.AddTypeRef(E->getType(), Record);
345  Record.push_back(E->isTypeDependent());
346  Record.push_back(E->isValueDependent());
347  Record.push_back(E->isInstantiationDependent());
348  Record.push_back(E->containsUnexpandedParameterPack());
349  Record.push_back(E->getValueKind());
350  Record.push_back(E->getObjectKind());
351 }
352 
353 void ASTStmtWriter::VisitPredefinedExpr(PredefinedExpr *E) {
354  VisitExpr(E);
355  Writer.AddSourceLocation(E->getLocation(), Record);
356  Record.push_back(E->getIdentType()); // FIXME: stable encoding
357  Writer.AddStmt(E->getFunctionName());
359 }
360 
361 void ASTStmtWriter::VisitDeclRefExpr(DeclRefExpr *E) {
362  VisitExpr(E);
363 
364  Record.push_back(E->hasQualifier());
365  Record.push_back(E->getDecl() != E->getFoundDecl());
366  Record.push_back(E->hasTemplateKWAndArgsInfo());
367  Record.push_back(E->hadMultipleCandidates());
368  Record.push_back(E->refersToEnclosingVariableOrCapture());
369 
370  if (E->hasTemplateKWAndArgsInfo()) {
371  unsigned NumTemplateArgs = E->getNumTemplateArgs();
372  Record.push_back(NumTemplateArgs);
373  }
374 
376 
377  if ((!E->hasTemplateKWAndArgsInfo()) && (!E->hasQualifier()) &&
378  (E->getDecl() == E->getFoundDecl()) &&
381  }
382 
383  if (E->hasQualifier())
384  Writer.AddNestedNameSpecifierLoc(E->getQualifierLoc(), Record);
385 
386  if (E->getDecl() != E->getFoundDecl())
387  Writer.AddDeclRef(E->getFoundDecl(), Record);
388 
389  if (E->hasTemplateKWAndArgsInfo())
390  AddTemplateKWAndArgsInfo(*E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
391  E->getTrailingObjects<TemplateArgumentLoc>());
392 
393  Writer.AddDeclRef(E->getDecl(), Record);
394  Writer.AddSourceLocation(E->getLocation(), Record);
395  Writer.AddDeclarationNameLoc(E->DNLoc, E->getDecl()->getDeclName(), Record);
397 }
398 
399 void ASTStmtWriter::VisitIntegerLiteral(IntegerLiteral *E) {
400  VisitExpr(E);
401  Writer.AddSourceLocation(E->getLocation(), Record);
402  Writer.AddAPInt(E->getValue(), Record);
403 
404  if (E->getValue().getBitWidth() == 32) {
406  }
407 
409 }
410 
411 void ASTStmtWriter::VisitFloatingLiteral(FloatingLiteral *E) {
412  VisitExpr(E);
413  Record.push_back(E->getRawSemantics());
414  Record.push_back(E->isExact());
415  Writer.AddAPFloat(E->getValue(), Record);
416  Writer.AddSourceLocation(E->getLocation(), Record);
418 }
419 
420 void ASTStmtWriter::VisitImaginaryLiteral(ImaginaryLiteral *E) {
421  VisitExpr(E);
422  Writer.AddStmt(E->getSubExpr());
424 }
425 
426 void ASTStmtWriter::VisitStringLiteral(StringLiteral *E) {
427  VisitExpr(E);
428  Record.push_back(E->getByteLength());
429  Record.push_back(E->getNumConcatenated());
430  Record.push_back(E->getKind());
431  Record.push_back(E->isPascal());
432  // FIXME: String data should be stored as a blob at the end of the
433  // StringLiteral. However, we can't do so now because we have no
434  // provision for coping with abbreviations when we're jumping around
435  // the AST file during deserialization.
436  Record.append(E->getBytes().begin(), E->getBytes().end());
437  for (unsigned I = 0, N = E->getNumConcatenated(); I != N; ++I)
438  Writer.AddSourceLocation(E->getStrTokenLoc(I), Record);
440 }
441 
442 void ASTStmtWriter::VisitCharacterLiteral(CharacterLiteral *E) {
443  VisitExpr(E);
444  Record.push_back(E->getValue());
445  Writer.AddSourceLocation(E->getLocation(), Record);
446  Record.push_back(E->getKind());
447 
449 
451 }
452 
453 void ASTStmtWriter::VisitParenExpr(ParenExpr *E) {
454  VisitExpr(E);
455  Writer.AddSourceLocation(E->getLParen(), Record);
456  Writer.AddSourceLocation(E->getRParen(), Record);
457  Writer.AddStmt(E->getSubExpr());
459 }
460 
461 void ASTStmtWriter::VisitParenListExpr(ParenListExpr *E) {
462  VisitExpr(E);
463  Record.push_back(E->NumExprs);
464  for (unsigned i=0; i != E->NumExprs; ++i)
465  Writer.AddStmt(E->Exprs[i]);
466  Writer.AddSourceLocation(E->LParenLoc, Record);
467  Writer.AddSourceLocation(E->RParenLoc, Record);
469 }
470 
471 void ASTStmtWriter::VisitUnaryOperator(UnaryOperator *E) {
472  VisitExpr(E);
473  Writer.AddStmt(E->getSubExpr());
474  Record.push_back(E->getOpcode()); // FIXME: stable encoding
475  Writer.AddSourceLocation(E->getOperatorLoc(), Record);
477 }
478 
479 void ASTStmtWriter::VisitOffsetOfExpr(OffsetOfExpr *E) {
480  VisitExpr(E);
481  Record.push_back(E->getNumComponents());
482  Record.push_back(E->getNumExpressions());
483  Writer.AddSourceLocation(E->getOperatorLoc(), Record);
484  Writer.AddSourceLocation(E->getRParenLoc(), Record);
485  Writer.AddTypeSourceInfo(E->getTypeSourceInfo(), Record);
486  for (unsigned I = 0, N = E->getNumComponents(); I != N; ++I) {
487  const OffsetOfNode &ON = E->getComponent(I);
488  Record.push_back(ON.getKind()); // FIXME: Stable encoding
489  Writer.AddSourceLocation(ON.getSourceRange().getBegin(), Record);
490  Writer.AddSourceLocation(ON.getSourceRange().getEnd(), Record);
491  switch (ON.getKind()) {
492  case OffsetOfNode::Array:
493  Record.push_back(ON.getArrayExprIndex());
494  break;
495 
496  case OffsetOfNode::Field:
497  Writer.AddDeclRef(ON.getField(), Record);
498  break;
499 
501  Writer.AddIdentifierRef(ON.getFieldName(), Record);
502  break;
503 
504  case OffsetOfNode::Base:
505  Writer.AddCXXBaseSpecifier(*ON.getBase(), Record);
506  break;
507  }
508  }
509  for (unsigned I = 0, N = E->getNumExpressions(); I != N; ++I)
510  Writer.AddStmt(E->getIndexExpr(I));
512 }
513 
514 void ASTStmtWriter::VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *E) {
515  VisitExpr(E);
516  Record.push_back(E->getKind());
517  if (E->isArgumentType())
518  Writer.AddTypeSourceInfo(E->getArgumentTypeInfo(), Record);
519  else {
520  Record.push_back(0);
521  Writer.AddStmt(E->getArgumentExpr());
522  }
523  Writer.AddSourceLocation(E->getOperatorLoc(), Record);
524  Writer.AddSourceLocation(E->getRParenLoc(), Record);
526 }
527 
528 void ASTStmtWriter::VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
529  VisitExpr(E);
530  Writer.AddStmt(E->getLHS());
531  Writer.AddStmt(E->getRHS());
532  Writer.AddSourceLocation(E->getRBracketLoc(), Record);
534 }
535 
536 void ASTStmtWriter::VisitOMPArraySectionExpr(OMPArraySectionExpr *E) {
537  VisitExpr(E);
538  Writer.AddStmt(E->getBase());
539  Writer.AddStmt(E->getLowerBound());
540  Writer.AddStmt(E->getLength());
541  Writer.AddSourceLocation(E->getColonLoc(), Record);
542  Writer.AddSourceLocation(E->getRBracketLoc(), Record);
544 }
545 
546 void ASTStmtWriter::VisitCallExpr(CallExpr *E) {
547  VisitExpr(E);
548  Record.push_back(E->getNumArgs());
549  Writer.AddSourceLocation(E->getRParenLoc(), Record);
550  Writer.AddStmt(E->getCallee());
551  for (CallExpr::arg_iterator Arg = E->arg_begin(), ArgEnd = E->arg_end();
552  Arg != ArgEnd; ++Arg)
553  Writer.AddStmt(*Arg);
555 }
556 
557 void ASTStmtWriter::VisitMemberExpr(MemberExpr *E) {
558  // Don't call VisitExpr, we'll write everything here.
559 
560  Record.push_back(E->hasQualifier());
561  if (E->hasQualifier())
562  Writer.AddNestedNameSpecifierLoc(E->getQualifierLoc(), Record);
563 
564  Record.push_back(E->HasTemplateKWAndArgsInfo);
565  if (E->HasTemplateKWAndArgsInfo) {
566  Writer.AddSourceLocation(E->getTemplateKeywordLoc(), Record);
567  unsigned NumTemplateArgs = E->getNumTemplateArgs();
568  Record.push_back(NumTemplateArgs);
569  Writer.AddSourceLocation(E->getLAngleLoc(), Record);
570  Writer.AddSourceLocation(E->getRAngleLoc(), Record);
571  for (unsigned i=0; i != NumTemplateArgs; ++i)
572  Writer.AddTemplateArgumentLoc(E->getTemplateArgs()[i], Record);
573  }
574 
575  Record.push_back(E->hadMultipleCandidates());
576 
577  DeclAccessPair FoundDecl = E->getFoundDecl();
578  Writer.AddDeclRef(FoundDecl.getDecl(), Record);
579  Record.push_back(FoundDecl.getAccess());
580 
581  Writer.AddTypeRef(E->getType(), Record);
582  Record.push_back(E->getValueKind());
583  Record.push_back(E->getObjectKind());
584  Writer.AddStmt(E->getBase());
585  Writer.AddDeclRef(E->getMemberDecl(), Record);
586  Writer.AddSourceLocation(E->getMemberLoc(), Record);
587  Record.push_back(E->isArrow());
588  Writer.AddSourceLocation(E->getOperatorLoc(), Record);
589  Writer.AddDeclarationNameLoc(E->MemberDNLoc,
590  E->getMemberDecl()->getDeclName(), Record);
592 }
593 
594 void ASTStmtWriter::VisitObjCIsaExpr(ObjCIsaExpr *E) {
595  VisitExpr(E);
596  Writer.AddStmt(E->getBase());
597  Writer.AddSourceLocation(E->getIsaMemberLoc(), Record);
598  Writer.AddSourceLocation(E->getOpLoc(), Record);
599  Record.push_back(E->isArrow());
601 }
602 
603 void ASTStmtWriter::
604 VisitObjCIndirectCopyRestoreExpr(ObjCIndirectCopyRestoreExpr *E) {
605  VisitExpr(E);
606  Writer.AddStmt(E->getSubExpr());
607  Record.push_back(E->shouldCopy());
609 }
610 
611 void ASTStmtWriter::VisitObjCBridgedCastExpr(ObjCBridgedCastExpr *E) {
612  VisitExplicitCastExpr(E);
613  Writer.AddSourceLocation(E->getLParenLoc(), Record);
614  Writer.AddSourceLocation(E->getBridgeKeywordLoc(), Record);
615  Record.push_back(E->getBridgeKind()); // FIXME: Stable encoding
617 }
618 
619 void ASTStmtWriter::VisitCastExpr(CastExpr *E) {
620  VisitExpr(E);
621  Record.push_back(E->path_size());
622  Writer.AddStmt(E->getSubExpr());
623  Record.push_back(E->getCastKind()); // FIXME: stable encoding
624 
626  PI = E->path_begin(), PE = E->path_end(); PI != PE; ++PI)
627  Writer.AddCXXBaseSpecifier(**PI, Record);
628 }
629 
630 void ASTStmtWriter::VisitBinaryOperator(BinaryOperator *E) {
631  VisitExpr(E);
632  Writer.AddStmt(E->getLHS());
633  Writer.AddStmt(E->getRHS());
634  Record.push_back(E->getOpcode()); // FIXME: stable encoding
635  Writer.AddSourceLocation(E->getOperatorLoc(), Record);
636  Record.push_back(E->isFPContractable());
638 }
639 
640 void ASTStmtWriter::VisitCompoundAssignOperator(CompoundAssignOperator *E) {
641  VisitBinaryOperator(E);
642  Writer.AddTypeRef(E->getComputationLHSType(), Record);
643  Writer.AddTypeRef(E->getComputationResultType(), Record);
645 }
646 
647 void ASTStmtWriter::VisitConditionalOperator(ConditionalOperator *E) {
648  VisitExpr(E);
649  Writer.AddStmt(E->getCond());
650  Writer.AddStmt(E->getLHS());
651  Writer.AddStmt(E->getRHS());
652  Writer.AddSourceLocation(E->getQuestionLoc(), Record);
653  Writer.AddSourceLocation(E->getColonLoc(), Record);
655 }
656 
657 void
658 ASTStmtWriter::VisitBinaryConditionalOperator(BinaryConditionalOperator *E) {
659  VisitExpr(E);
660  Writer.AddStmt(E->getOpaqueValue());
661  Writer.AddStmt(E->getCommon());
662  Writer.AddStmt(E->getCond());
663  Writer.AddStmt(E->getTrueExpr());
664  Writer.AddStmt(E->getFalseExpr());
665  Writer.AddSourceLocation(E->getQuestionLoc(), Record);
666  Writer.AddSourceLocation(E->getColonLoc(), Record);
668 }
669 
670 void ASTStmtWriter::VisitImplicitCastExpr(ImplicitCastExpr *E) {
671  VisitCastExpr(E);
672 
673  if (E->path_size() == 0)
675 
677 }
678 
679 void ASTStmtWriter::VisitExplicitCastExpr(ExplicitCastExpr *E) {
680  VisitCastExpr(E);
681  Writer.AddTypeSourceInfo(E->getTypeInfoAsWritten(), Record);
682 }
683 
684 void ASTStmtWriter::VisitCStyleCastExpr(CStyleCastExpr *E) {
685  VisitExplicitCastExpr(E);
686  Writer.AddSourceLocation(E->getLParenLoc(), Record);
687  Writer.AddSourceLocation(E->getRParenLoc(), Record);
689 }
690 
691 void ASTStmtWriter::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
692  VisitExpr(E);
693  Writer.AddSourceLocation(E->getLParenLoc(), Record);
694  Writer.AddTypeSourceInfo(E->getTypeSourceInfo(), Record);
695  Writer.AddStmt(E->getInitializer());
696  Record.push_back(E->isFileScope());
698 }
699 
700 void ASTStmtWriter::VisitExtVectorElementExpr(ExtVectorElementExpr *E) {
701  VisitExpr(E);
702  Writer.AddStmt(E->getBase());
703  Writer.AddIdentifierRef(&E->getAccessor(), Record);
704  Writer.AddSourceLocation(E->getAccessorLoc(), Record);
706 }
707 
708 void ASTStmtWriter::VisitInitListExpr(InitListExpr *E) {
709  VisitExpr(E);
710  // NOTE: only add the (possibly null) syntactic form.
711  // No need to serialize the isSemanticForm flag and the semantic form.
712  Writer.AddStmt(E->getSyntacticForm());
713  Writer.AddSourceLocation(E->getLBraceLoc(), Record);
714  Writer.AddSourceLocation(E->getRBraceLoc(), Record);
715  bool isArrayFiller = E->ArrayFillerOrUnionFieldInit.is<Expr*>();
716  Record.push_back(isArrayFiller);
717  if (isArrayFiller)
718  Writer.AddStmt(E->getArrayFiller());
719  else
720  Writer.AddDeclRef(E->getInitializedFieldInUnion(), Record);
721  Record.push_back(E->hadArrayRangeDesignator());
722  Record.push_back(E->getNumInits());
723  if (isArrayFiller) {
724  // ArrayFiller may have filled "holes" due to designated initializer.
725  // Replace them by 0 to indicate that the filler goes in that place.
726  Expr *filler = E->getArrayFiller();
727  for (unsigned I = 0, N = E->getNumInits(); I != N; ++I)
728  Writer.AddStmt(E->getInit(I) != filler ? E->getInit(I) : nullptr);
729  } else {
730  for (unsigned I = 0, N = E->getNumInits(); I != N; ++I)
731  Writer.AddStmt(E->getInit(I));
732  }
734 }
735 
736 void ASTStmtWriter::VisitDesignatedInitExpr(DesignatedInitExpr *E) {
737  VisitExpr(E);
738  Record.push_back(E->getNumSubExprs());
739  for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
740  Writer.AddStmt(E->getSubExpr(I));
741  Writer.AddSourceLocation(E->getEqualOrColonLoc(), Record);
742  Record.push_back(E->usesGNUSyntax());
744  DEnd = E->designators_end();
745  D != DEnd; ++D) {
746  if (D->isFieldDesignator()) {
747  if (FieldDecl *Field = D->getField()) {
748  Record.push_back(serialization::DESIG_FIELD_DECL);
749  Writer.AddDeclRef(Field, Record);
750  } else {
751  Record.push_back(serialization::DESIG_FIELD_NAME);
752  Writer.AddIdentifierRef(D->getFieldName(), Record);
753  }
754  Writer.AddSourceLocation(D->getDotLoc(), Record);
755  Writer.AddSourceLocation(D->getFieldLoc(), Record);
756  } else if (D->isArrayDesignator()) {
757  Record.push_back(serialization::DESIG_ARRAY);
758  Record.push_back(D->getFirstExprIndex());
759  Writer.AddSourceLocation(D->getLBracketLoc(), Record);
760  Writer.AddSourceLocation(D->getRBracketLoc(), Record);
761  } else {
762  assert(D->isArrayRangeDesignator() && "Unknown designator");
763  Record.push_back(serialization::DESIG_ARRAY_RANGE);
764  Record.push_back(D->getFirstExprIndex());
765  Writer.AddSourceLocation(D->getLBracketLoc(), Record);
766  Writer.AddSourceLocation(D->getEllipsisLoc(), Record);
767  Writer.AddSourceLocation(D->getRBracketLoc(), Record);
768  }
769  }
771 }
772 
773 void ASTStmtWriter::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) {
774  VisitExpr(E);
775  Writer.AddStmt(E->getBase());
776  Writer.AddStmt(E->getUpdater());
778 }
779 
780 void ASTStmtWriter::VisitNoInitExpr(NoInitExpr *E) {
781  VisitExpr(E);
783 }
784 
785 void ASTStmtWriter::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) {
786  VisitExpr(E);
788 }
789 
790 void ASTStmtWriter::VisitVAArgExpr(VAArgExpr *E) {
791  VisitExpr(E);
792  Writer.AddStmt(E->getSubExpr());
793  Writer.AddTypeSourceInfo(E->getWrittenTypeInfo(), Record);
794  Writer.AddSourceLocation(E->getBuiltinLoc(), Record);
795  Writer.AddSourceLocation(E->getRParenLoc(), Record);
796  Record.push_back(E->isMicrosoftABI());
798 }
799 
800 void ASTStmtWriter::VisitAddrLabelExpr(AddrLabelExpr *E) {
801  VisitExpr(E);
802  Writer.AddSourceLocation(E->getAmpAmpLoc(), Record);
803  Writer.AddSourceLocation(E->getLabelLoc(), Record);
804  Writer.AddDeclRef(E->getLabel(), Record);
806 }
807 
808 void ASTStmtWriter::VisitStmtExpr(StmtExpr *E) {
809  VisitExpr(E);
810  Writer.AddStmt(E->getSubStmt());
811  Writer.AddSourceLocation(E->getLParenLoc(), Record);
812  Writer.AddSourceLocation(E->getRParenLoc(), Record);
814 }
815 
816 void ASTStmtWriter::VisitChooseExpr(ChooseExpr *E) {
817  VisitExpr(E);
818  Writer.AddStmt(E->getCond());
819  Writer.AddStmt(E->getLHS());
820  Writer.AddStmt(E->getRHS());
821  Writer.AddSourceLocation(E->getBuiltinLoc(), Record);
822  Writer.AddSourceLocation(E->getRParenLoc(), Record);
823  Record.push_back(E->isConditionDependent() ? false : E->isConditionTrue());
825 }
826 
827 void ASTStmtWriter::VisitGNUNullExpr(GNUNullExpr *E) {
828  VisitExpr(E);
829  Writer.AddSourceLocation(E->getTokenLocation(), Record);
831 }
832 
833 void ASTStmtWriter::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
834  VisitExpr(E);
835  Record.push_back(E->getNumSubExprs());
836  for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
837  Writer.AddStmt(E->getExpr(I));
838  Writer.AddSourceLocation(E->getBuiltinLoc(), Record);
839  Writer.AddSourceLocation(E->getRParenLoc(), Record);
841 }
842 
843 void ASTStmtWriter::VisitConvertVectorExpr(ConvertVectorExpr *E) {
844  VisitExpr(E);
845  Writer.AddSourceLocation(E->getBuiltinLoc(), Record);
846  Writer.AddSourceLocation(E->getRParenLoc(), Record);
847  Writer.AddTypeSourceInfo(E->getTypeSourceInfo(), Record);
848  Writer.AddStmt(E->getSrcExpr());
850 }
851 
852 void ASTStmtWriter::VisitBlockExpr(BlockExpr *E) {
853  VisitExpr(E);
854  Writer.AddDeclRef(E->getBlockDecl(), Record);
856 }
857 
858 void ASTStmtWriter::VisitGenericSelectionExpr(GenericSelectionExpr *E) {
859  VisitExpr(E);
860  Record.push_back(E->getNumAssocs());
861 
862  Writer.AddStmt(E->getControllingExpr());
863  for (unsigned I = 0, N = E->getNumAssocs(); I != N; ++I) {
864  Writer.AddTypeSourceInfo(E->getAssocTypeSourceInfo(I), Record);
865  Writer.AddStmt(E->getAssocExpr(I));
866  }
867  Record.push_back(E->isResultDependent() ? -1U : E->getResultIndex());
868 
869  Writer.AddSourceLocation(E->getGenericLoc(), Record);
870  Writer.AddSourceLocation(E->getDefaultLoc(), Record);
871  Writer.AddSourceLocation(E->getRParenLoc(), Record);
873 }
874 
875 void ASTStmtWriter::VisitPseudoObjectExpr(PseudoObjectExpr *E) {
876  VisitExpr(E);
877  Record.push_back(E->getNumSemanticExprs());
878 
879  // Push the result index. Currently, this needs to exactly match
880  // the encoding used internally for ResultIndex.
881  unsigned result = E->getResultExprIndex();
882  result = (result == PseudoObjectExpr::NoResult ? 0 : result + 1);
883  Record.push_back(result);
884 
885  Writer.AddStmt(E->getSyntacticForm());
887  i = E->semantics_begin(), e = E->semantics_end(); i != e; ++i) {
888  Writer.AddStmt(*i);
889  }
891 }
892 
893 void ASTStmtWriter::VisitAtomicExpr(AtomicExpr *E) {
894  VisitExpr(E);
895  Record.push_back(E->getOp());
896  for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
897  Writer.AddStmt(E->getSubExprs()[I]);
898  Writer.AddSourceLocation(E->getBuiltinLoc(), Record);
899  Writer.AddSourceLocation(E->getRParenLoc(), Record);
901 }
902 
903 //===----------------------------------------------------------------------===//
904 // Objective-C Expressions and Statements.
905 //===----------------------------------------------------------------------===//
906 
907 void ASTStmtWriter::VisitObjCStringLiteral(ObjCStringLiteral *E) {
908  VisitExpr(E);
909  Writer.AddStmt(E->getString());
910  Writer.AddSourceLocation(E->getAtLoc(), Record);
912 }
913 
914 void ASTStmtWriter::VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
915  VisitExpr(E);
916  Writer.AddStmt(E->getSubExpr());
917  Writer.AddDeclRef(E->getBoxingMethod(), Record);
918  Writer.AddSourceRange(E->getSourceRange(), Record);
920 }
921 
922 void ASTStmtWriter::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
923  VisitExpr(E);
924  Record.push_back(E->getNumElements());
925  for (unsigned i = 0; i < E->getNumElements(); i++)
926  Writer.AddStmt(E->getElement(i));
927  Writer.AddDeclRef(E->getArrayWithObjectsMethod(), Record);
928  Writer.AddSourceRange(E->getSourceRange(), Record);
930 }
931 
932 void ASTStmtWriter::VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *E) {
933  VisitExpr(E);
934  Record.push_back(E->getNumElements());
935  Record.push_back(E->HasPackExpansions);
936  for (unsigned i = 0; i < E->getNumElements(); i++) {
938  Writer.AddStmt(Element.Key);
939  Writer.AddStmt(Element.Value);
940  if (E->HasPackExpansions) {
941  Writer.AddSourceLocation(Element.EllipsisLoc, Record);
942  unsigned NumExpansions = 0;
943  if (Element.NumExpansions)
944  NumExpansions = *Element.NumExpansions + 1;
945  Record.push_back(NumExpansions);
946  }
947  }
948 
949  Writer.AddDeclRef(E->getDictWithObjectsMethod(), Record);
950  Writer.AddSourceRange(E->getSourceRange(), Record);
952 }
953 
954 void ASTStmtWriter::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
955  VisitExpr(E);
956  Writer.AddTypeSourceInfo(E->getEncodedTypeSourceInfo(), Record);
957  Writer.AddSourceLocation(E->getAtLoc(), Record);
958  Writer.AddSourceLocation(E->getRParenLoc(), Record);
960 }
961 
962 void ASTStmtWriter::VisitObjCSelectorExpr(ObjCSelectorExpr *E) {
963  VisitExpr(E);
964  Writer.AddSelectorRef(E->getSelector(), Record);
965  Writer.AddSourceLocation(E->getAtLoc(), Record);
966  Writer.AddSourceLocation(E->getRParenLoc(), Record);
968 }
969 
970 void ASTStmtWriter::VisitObjCProtocolExpr(ObjCProtocolExpr *E) {
971  VisitExpr(E);
972  Writer.AddDeclRef(E->getProtocol(), Record);
973  Writer.AddSourceLocation(E->getAtLoc(), Record);
974  Writer.AddSourceLocation(E->ProtoLoc, Record);
975  Writer.AddSourceLocation(E->getRParenLoc(), Record);
977 }
978 
979 void ASTStmtWriter::VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) {
980  VisitExpr(E);
981  Writer.AddDeclRef(E->getDecl(), Record);
982  Writer.AddSourceLocation(E->getLocation(), Record);
983  Writer.AddSourceLocation(E->getOpLoc(), Record);
984  Writer.AddStmt(E->getBase());
985  Record.push_back(E->isArrow());
986  Record.push_back(E->isFreeIvar());
988 }
989 
990 void ASTStmtWriter::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
991  VisitExpr(E);
992  Record.push_back(E->SetterAndMethodRefFlags.getInt());
993  Record.push_back(E->isImplicitProperty());
994  if (E->isImplicitProperty()) {
995  Writer.AddDeclRef(E->getImplicitPropertyGetter(), Record);
996  Writer.AddDeclRef(E->getImplicitPropertySetter(), Record);
997  } else {
998  Writer.AddDeclRef(E->getExplicitProperty(), Record);
999  }
1000  Writer.AddSourceLocation(E->getLocation(), Record);
1001  Writer.AddSourceLocation(E->getReceiverLocation(), Record);
1002  if (E->isObjectReceiver()) {
1003  Record.push_back(0);
1004  Writer.AddStmt(E->getBase());
1005  } else if (E->isSuperReceiver()) {
1006  Record.push_back(1);
1007  Writer.AddTypeRef(E->getSuperReceiverType(), Record);
1008  } else {
1009  Record.push_back(2);
1010  Writer.AddDeclRef(E->getClassReceiver(), Record);
1011  }
1012 
1014 }
1015 
1016 void ASTStmtWriter::VisitObjCSubscriptRefExpr(ObjCSubscriptRefExpr *E) {
1017  VisitExpr(E);
1018  Writer.AddSourceLocation(E->getRBracket(), Record);
1019  Writer.AddStmt(E->getBaseExpr());
1020  Writer.AddStmt(E->getKeyExpr());
1021  Writer.AddDeclRef(E->getAtIndexMethodDecl(), Record);
1022  Writer.AddDeclRef(E->setAtIndexMethodDecl(), Record);
1023 
1025 }
1026 
1027 void ASTStmtWriter::VisitObjCMessageExpr(ObjCMessageExpr *E) {
1028  VisitExpr(E);
1029  Record.push_back(E->getNumArgs());
1030  Record.push_back(E->getNumStoredSelLocs());
1031  Record.push_back(E->SelLocsKind);
1032  Record.push_back(E->isDelegateInitCall());
1033  Record.push_back(E->IsImplicit);
1034  Record.push_back((unsigned)E->getReceiverKind()); // FIXME: stable encoding
1035  switch (E->getReceiverKind()) {
1037  Writer.AddStmt(E->getInstanceReceiver());
1038  break;
1039 
1041  Writer.AddTypeSourceInfo(E->getClassReceiverTypeInfo(), Record);
1042  break;
1043 
1046  Writer.AddTypeRef(E->getSuperType(), Record);
1047  Writer.AddSourceLocation(E->getSuperLoc(), Record);
1048  break;
1049  }
1050 
1051  if (E->getMethodDecl()) {
1052  Record.push_back(1);
1053  Writer.AddDeclRef(E->getMethodDecl(), Record);
1054  } else {
1055  Record.push_back(0);
1056  Writer.AddSelectorRef(E->getSelector(), Record);
1057  }
1058 
1059  Writer.AddSourceLocation(E->getLeftLoc(), Record);
1060  Writer.AddSourceLocation(E->getRightLoc(), Record);
1061 
1062  for (CallExpr::arg_iterator Arg = E->arg_begin(), ArgEnd = E->arg_end();
1063  Arg != ArgEnd; ++Arg)
1064  Writer.AddStmt(*Arg);
1065 
1066  SourceLocation *Locs = E->getStoredSelLocs();
1067  for (unsigned i = 0, e = E->getNumStoredSelLocs(); i != e; ++i)
1068  Writer.AddSourceLocation(Locs[i], Record);
1069 
1071 }
1072 
1073 void ASTStmtWriter::VisitObjCForCollectionStmt(ObjCForCollectionStmt *S) {
1074  VisitStmt(S);
1075  Writer.AddStmt(S->getElement());
1076  Writer.AddStmt(S->getCollection());
1077  Writer.AddStmt(S->getBody());
1078  Writer.AddSourceLocation(S->getForLoc(), Record);
1079  Writer.AddSourceLocation(S->getRParenLoc(), Record);
1081 }
1082 
1083 void ASTStmtWriter::VisitObjCAtCatchStmt(ObjCAtCatchStmt *S) {
1084  Writer.AddStmt(S->getCatchBody());
1085  Writer.AddDeclRef(S->getCatchParamDecl(), Record);
1086  Writer.AddSourceLocation(S->getAtCatchLoc(), Record);
1087  Writer.AddSourceLocation(S->getRParenLoc(), Record);
1089 }
1090 
1091 void ASTStmtWriter::VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S) {
1092  Writer.AddStmt(S->getFinallyBody());
1093  Writer.AddSourceLocation(S->getAtFinallyLoc(), Record);
1095 }
1096 
1097 void ASTStmtWriter::VisitObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S) {
1098  Writer.AddStmt(S->getSubStmt());
1099  Writer.AddSourceLocation(S->getAtLoc(), Record);
1101 }
1102 
1103 void ASTStmtWriter::VisitObjCAtTryStmt(ObjCAtTryStmt *S) {
1104  Record.push_back(S->getNumCatchStmts());
1105  Record.push_back(S->getFinallyStmt() != nullptr);
1106  Writer.AddStmt(S->getTryBody());
1107  for (unsigned I = 0, N = S->getNumCatchStmts(); I != N; ++I)
1108  Writer.AddStmt(S->getCatchStmt(I));
1109  if (S->getFinallyStmt())
1110  Writer.AddStmt(S->getFinallyStmt());
1111  Writer.AddSourceLocation(S->getAtTryLoc(), Record);
1113 }
1114 
1115 void ASTStmtWriter::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
1116  Writer.AddStmt(S->getSynchExpr());
1117  Writer.AddStmt(S->getSynchBody());
1118  Writer.AddSourceLocation(S->getAtSynchronizedLoc(), Record);
1120 }
1121 
1122 void ASTStmtWriter::VisitObjCAtThrowStmt(ObjCAtThrowStmt *S) {
1123  Writer.AddStmt(S->getThrowExpr());
1124  Writer.AddSourceLocation(S->getThrowLoc(), Record);
1126 }
1127 
1128 void ASTStmtWriter::VisitObjCBoolLiteralExpr(ObjCBoolLiteralExpr *E) {
1129  VisitExpr(E);
1130  Record.push_back(E->getValue());
1131  Writer.AddSourceLocation(E->getLocation(), Record);
1133 }
1134 
1135 //===----------------------------------------------------------------------===//
1136 // C++ Expressions and Statements.
1137 //===----------------------------------------------------------------------===//
1138 
1139 void ASTStmtWriter::VisitCXXCatchStmt(CXXCatchStmt *S) {
1140  VisitStmt(S);
1141  Writer.AddSourceLocation(S->getCatchLoc(), Record);
1142  Writer.AddDeclRef(S->getExceptionDecl(), Record);
1143  Writer.AddStmt(S->getHandlerBlock());
1145 }
1146 
1147 void ASTStmtWriter::VisitCXXTryStmt(CXXTryStmt *S) {
1148  VisitStmt(S);
1149  Record.push_back(S->getNumHandlers());
1150  Writer.AddSourceLocation(S->getTryLoc(), Record);
1151  Writer.AddStmt(S->getTryBlock());
1152  for (unsigned i = 0, e = S->getNumHandlers(); i != e; ++i)
1153  Writer.AddStmt(S->getHandler(i));
1155 }
1156 
1157 void ASTStmtWriter::VisitCXXForRangeStmt(CXXForRangeStmt *S) {
1158  VisitStmt(S);
1159  Writer.AddSourceLocation(S->getForLoc(), Record);
1160  Writer.AddSourceLocation(S->getCoawaitLoc(), Record);
1161  Writer.AddSourceLocation(S->getColonLoc(), Record);
1162  Writer.AddSourceLocation(S->getRParenLoc(), Record);
1163  Writer.AddStmt(S->getRangeStmt());
1164  Writer.AddStmt(S->getBeginEndStmt());
1165  Writer.AddStmt(S->getCond());
1166  Writer.AddStmt(S->getInc());
1167  Writer.AddStmt(S->getLoopVarStmt());
1168  Writer.AddStmt(S->getBody());
1170 }
1171 
1172 void ASTStmtWriter::VisitMSDependentExistsStmt(MSDependentExistsStmt *S) {
1173  VisitStmt(S);
1174  Writer.AddSourceLocation(S->getKeywordLoc(), Record);
1175  Record.push_back(S->isIfExists());
1176  Writer.AddNestedNameSpecifierLoc(S->getQualifierLoc(), Record);
1177  Writer.AddDeclarationNameInfo(S->getNameInfo(), Record);
1178  Writer.AddStmt(S->getSubStmt());
1180 }
1181 
1182 void ASTStmtWriter::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
1183  VisitCallExpr(E);
1184  Record.push_back(E->getOperator());
1185  Writer.AddSourceRange(E->Range, Record);
1186  Record.push_back(E->isFPContractable());
1188 }
1189 
1190 void ASTStmtWriter::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) {
1191  VisitCallExpr(E);
1193 }
1194 
1195 void ASTStmtWriter::VisitCXXConstructExpr(CXXConstructExpr *E) {
1196  VisitExpr(E);
1197  Record.push_back(E->getNumArgs());
1198  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1199  Writer.AddStmt(E->getArg(I));
1200  Writer.AddDeclRef(E->getConstructor(), Record);
1201  Writer.AddSourceLocation(E->getLocation(), Record);
1202  Record.push_back(E->isElidable());
1203  Record.push_back(E->hadMultipleCandidates());
1204  Record.push_back(E->isListInitialization());
1205  Record.push_back(E->isStdInitListInitialization());
1206  Record.push_back(E->requiresZeroInitialization());
1207  Record.push_back(E->getConstructionKind()); // FIXME: stable encoding
1208  Writer.AddSourceRange(E->getParenOrBraceRange(), Record);
1210 }
1211 
1212 void ASTStmtWriter::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
1213  VisitCXXConstructExpr(E);
1214  Writer.AddTypeSourceInfo(E->getTypeSourceInfo(), Record);
1216 }
1217 
1218 void ASTStmtWriter::VisitLambdaExpr(LambdaExpr *E) {
1219  VisitExpr(E);
1220  Record.push_back(E->NumCaptures);
1221  unsigned NumArrayIndexVars = 0;
1222  if (E->HasArrayIndexVars)
1223  NumArrayIndexVars = E->getArrayIndexStarts()[E->NumCaptures];
1224  Record.push_back(NumArrayIndexVars);
1225  Writer.AddSourceRange(E->IntroducerRange, Record);
1226  Record.push_back(E->CaptureDefault); // FIXME: stable encoding
1227  Writer.AddSourceLocation(E->CaptureDefaultLoc, Record);
1228  Record.push_back(E->ExplicitParams);
1229  Record.push_back(E->ExplicitResultType);
1230  Writer.AddSourceLocation(E->ClosingBrace, Record);
1231 
1232  // Add capture initializers.
1234  CEnd = E->capture_init_end();
1235  C != CEnd; ++C) {
1236  Writer.AddStmt(*C);
1237  }
1238 
1239  // Add array index variables, if any.
1240  if (NumArrayIndexVars) {
1241  Record.append(E->getArrayIndexStarts(),
1242  E->getArrayIndexStarts() + E->NumCaptures + 1);
1243  VarDecl **ArrayIndexVars = E->getArrayIndexVars();
1244  for (unsigned I = 0; I != NumArrayIndexVars; ++I)
1245  Writer.AddDeclRef(ArrayIndexVars[I], Record);
1246  }
1247 
1249 }
1250 
1251 void ASTStmtWriter::VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E) {
1252  VisitExpr(E);
1253  Writer.AddStmt(E->getSubExpr());
1255 }
1256 
1257 void ASTStmtWriter::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) {
1258  VisitExplicitCastExpr(E);
1260  Record);
1261  Writer.AddSourceRange(E->getAngleBrackets(), Record);
1262 }
1263 
1264 void ASTStmtWriter::VisitCXXStaticCastExpr(CXXStaticCastExpr *E) {
1265  VisitCXXNamedCastExpr(E);
1267 }
1268 
1269 void ASTStmtWriter::VisitCXXDynamicCastExpr(CXXDynamicCastExpr *E) {
1270  VisitCXXNamedCastExpr(E);
1272 }
1273 
1274 void ASTStmtWriter::VisitCXXReinterpretCastExpr(CXXReinterpretCastExpr *E) {
1275  VisitCXXNamedCastExpr(E);
1277 }
1278 
1279 void ASTStmtWriter::VisitCXXConstCastExpr(CXXConstCastExpr *E) {
1280  VisitCXXNamedCastExpr(E);
1282 }
1283 
1284 void ASTStmtWriter::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E) {
1285  VisitExplicitCastExpr(E);
1286  Writer.AddSourceLocation(E->getLParenLoc(), Record);
1287  Writer.AddSourceLocation(E->getRParenLoc(), Record);
1289 }
1290 
1291 void ASTStmtWriter::VisitUserDefinedLiteral(UserDefinedLiteral *E) {
1292  VisitCallExpr(E);
1293  Writer.AddSourceLocation(E->UDSuffixLoc, Record);
1295 }
1296 
1297 void ASTStmtWriter::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) {
1298  VisitExpr(E);
1299  Record.push_back(E->getValue());
1300  Writer.AddSourceLocation(E->getLocation(), Record);
1302 }
1303 
1304 void ASTStmtWriter::VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E) {
1305  VisitExpr(E);
1306  Writer.AddSourceLocation(E->getLocation(), Record);
1308 }
1309 
1310 void ASTStmtWriter::VisitCXXTypeidExpr(CXXTypeidExpr *E) {
1311  VisitExpr(E);
1312  Writer.AddSourceRange(E->getSourceRange(), Record);
1313  if (E->isTypeOperand()) {
1314  Writer.AddTypeSourceInfo(E->getTypeOperandSourceInfo(), Record);
1316  } else {
1317  Writer.AddStmt(E->getExprOperand());
1319  }
1320 }
1321 
1322 void ASTStmtWriter::VisitCXXThisExpr(CXXThisExpr *E) {
1323  VisitExpr(E);
1324  Writer.AddSourceLocation(E->getLocation(), Record);
1325  Record.push_back(E->isImplicit());
1327 }
1328 
1329 void ASTStmtWriter::VisitCXXThrowExpr(CXXThrowExpr *E) {
1330  VisitExpr(E);
1331  Writer.AddSourceLocation(E->getThrowLoc(), Record);
1332  Writer.AddStmt(E->getSubExpr());
1333  Record.push_back(E->isThrownVariableInScope());
1335 }
1336 
1337 void ASTStmtWriter::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
1338  VisitExpr(E);
1339  Writer.AddDeclRef(E->getParam(), Record);
1340  Writer.AddSourceLocation(E->getUsedLocation(), Record);
1342 }
1343 
1344 void ASTStmtWriter::VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E) {
1345  VisitExpr(E);
1346  Writer.AddDeclRef(E->getField(), Record);
1347  Writer.AddSourceLocation(E->getExprLoc(), Record);
1349 }
1350 
1351 void ASTStmtWriter::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
1352  VisitExpr(E);
1353  Writer.AddCXXTemporary(E->getTemporary(), Record);
1354  Writer.AddStmt(E->getSubExpr());
1356 }
1357 
1358 void ASTStmtWriter::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
1359  VisitExpr(E);
1360  Writer.AddTypeSourceInfo(E->getTypeSourceInfo(), Record);
1361  Writer.AddSourceLocation(E->getRParenLoc(), Record);
1363 }
1364 
1365 void ASTStmtWriter::VisitCXXNewExpr(CXXNewExpr *E) {
1366  VisitExpr(E);
1367  Record.push_back(E->isGlobalNew());
1368  Record.push_back(E->isArray());
1369  Record.push_back(E->doesUsualArrayDeleteWantSize());
1370  Record.push_back(E->getNumPlacementArgs());
1371  Record.push_back(E->StoredInitializationStyle);
1372  Writer.AddDeclRef(E->getOperatorNew(), Record);
1373  Writer.AddDeclRef(E->getOperatorDelete(), Record);
1374  Writer.AddTypeSourceInfo(E->getAllocatedTypeSourceInfo(), Record);
1375  Writer.AddSourceRange(E->getTypeIdParens(), Record);
1376  Writer.AddSourceRange(E->getSourceRange(), Record);
1377  Writer.AddSourceRange(E->getDirectInitRange(), Record);
1378  for (CXXNewExpr::arg_iterator I = E->raw_arg_begin(), e = E->raw_arg_end();
1379  I != e; ++I)
1380  Writer.AddStmt(*I);
1381 
1383 }
1384 
1385 void ASTStmtWriter::VisitCXXDeleteExpr(CXXDeleteExpr *E) {
1386  VisitExpr(E);
1387  Record.push_back(E->isGlobalDelete());
1388  Record.push_back(E->isArrayForm());
1389  Record.push_back(E->isArrayFormAsWritten());
1390  Record.push_back(E->doesUsualArrayDeleteWantSize());
1391  Writer.AddDeclRef(E->getOperatorDelete(), Record);
1392  Writer.AddStmt(E->getArgument());
1393  Writer.AddSourceLocation(E->getSourceRange().getBegin(), Record);
1394 
1396 }
1397 
1398 void ASTStmtWriter::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
1399  VisitExpr(E);
1400 
1401  Writer.AddStmt(E->getBase());
1402  Record.push_back(E->isArrow());
1403  Writer.AddSourceLocation(E->getOperatorLoc(), Record);
1404  Writer.AddNestedNameSpecifierLoc(E->getQualifierLoc(), Record);
1405  Writer.AddTypeSourceInfo(E->getScopeTypeInfo(), Record);
1406  Writer.AddSourceLocation(E->getColonColonLoc(), Record);
1407  Writer.AddSourceLocation(E->getTildeLoc(), Record);
1408 
1409  // PseudoDestructorTypeStorage.
1410  Writer.AddIdentifierRef(E->getDestroyedTypeIdentifier(), Record);
1411  if (E->getDestroyedTypeIdentifier())
1412  Writer.AddSourceLocation(E->getDestroyedTypeLoc(), Record);
1413  else
1414  Writer.AddTypeSourceInfo(E->getDestroyedTypeInfo(), Record);
1415 
1417 }
1418 
1419 void ASTStmtWriter::VisitExprWithCleanups(ExprWithCleanups *E) {
1420  VisitExpr(E);
1421  Record.push_back(E->getNumObjects());
1422  for (unsigned i = 0, e = E->getNumObjects(); i != e; ++i)
1423  Writer.AddDeclRef(E->getObject(i), Record);
1424 
1425  Writer.AddStmt(E->getSubExpr());
1427 }
1428 
1429 void
1430 ASTStmtWriter::VisitCXXDependentScopeMemberExpr(CXXDependentScopeMemberExpr *E){
1431  VisitExpr(E);
1432 
1433  // Don't emit anything here, HasTemplateKWAndArgsInfo must be
1434  // emitted first.
1435 
1436  Record.push_back(E->HasTemplateKWAndArgsInfo);
1437  if (E->HasTemplateKWAndArgsInfo) {
1438  const ASTTemplateKWAndArgsInfo &ArgInfo =
1439  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
1440  Record.push_back(ArgInfo.NumTemplateArgs);
1441  AddTemplateKWAndArgsInfo(ArgInfo,
1442  E->getTrailingObjects<TemplateArgumentLoc>());
1443  }
1444 
1445  if (!E->isImplicitAccess())
1446  Writer.AddStmt(E->getBase());
1447  else
1448  Writer.AddStmt(nullptr);
1449  Writer.AddTypeRef(E->getBaseType(), Record);
1450  Record.push_back(E->isArrow());
1451  Writer.AddSourceLocation(E->getOperatorLoc(), Record);
1452  Writer.AddNestedNameSpecifierLoc(E->getQualifierLoc(), Record);
1453  Writer.AddDeclRef(E->getFirstQualifierFoundInScope(), Record);
1454  Writer.AddDeclarationNameInfo(E->MemberNameInfo, Record);
1456 }
1457 
1458 void
1459 ASTStmtWriter::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) {
1460  VisitExpr(E);
1461 
1462  // Don't emit anything here, HasTemplateKWAndArgsInfo must be
1463  // emitted first.
1464 
1465  Record.push_back(E->HasTemplateKWAndArgsInfo);
1466  if (E->HasTemplateKWAndArgsInfo) {
1467  const ASTTemplateKWAndArgsInfo &ArgInfo =
1468  *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
1469  Record.push_back(ArgInfo.NumTemplateArgs);
1470  AddTemplateKWAndArgsInfo(ArgInfo,
1471  E->getTrailingObjects<TemplateArgumentLoc>());
1472  }
1473 
1474  Writer.AddNestedNameSpecifierLoc(E->getQualifierLoc(), Record);
1475  Writer.AddDeclarationNameInfo(E->NameInfo, Record);
1477 }
1478 
1479 void
1480 ASTStmtWriter::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E) {
1481  VisitExpr(E);
1482  Record.push_back(E->arg_size());
1484  ArgI = E->arg_begin(), ArgE = E->arg_end(); ArgI != ArgE; ++ArgI)
1485  Writer.AddStmt(*ArgI);
1486  Writer.AddTypeSourceInfo(E->getTypeSourceInfo(), Record);
1487  Writer.AddSourceLocation(E->getLParenLoc(), Record);
1488  Writer.AddSourceLocation(E->getRParenLoc(), Record);
1490 }
1491 
1492 void ASTStmtWriter::VisitOverloadExpr(OverloadExpr *E) {
1493  VisitExpr(E);
1494 
1495  // Don't emit anything here, HasTemplateKWAndArgsInfo must be
1496  // emitted first.
1497 
1498  Record.push_back(E->HasTemplateKWAndArgsInfo);
1499  if (E->HasTemplateKWAndArgsInfo) {
1500  const ASTTemplateKWAndArgsInfo &ArgInfo =
1502  Record.push_back(ArgInfo.NumTemplateArgs);
1504  }
1505 
1506  Record.push_back(E->getNumDecls());
1508  OvI = E->decls_begin(), OvE = E->decls_end(); OvI != OvE; ++OvI) {
1509  Writer.AddDeclRef(OvI.getDecl(), Record);
1510  Record.push_back(OvI.getAccess());
1511  }
1512 
1513  Writer.AddDeclarationNameInfo(E->NameInfo, Record);
1514  Writer.AddNestedNameSpecifierLoc(E->getQualifierLoc(), Record);
1515 }
1516 
1517 void ASTStmtWriter::VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
1518  VisitOverloadExpr(E);
1519  Record.push_back(E->isArrow());
1520  Record.push_back(E->hasUnresolvedUsing());
1521  Writer.AddStmt(!E->isImplicitAccess() ? E->getBase() : nullptr);
1522  Writer.AddTypeRef(E->getBaseType(), Record);
1523  Writer.AddSourceLocation(E->getOperatorLoc(), Record);
1525 }
1526 
1527 void ASTStmtWriter::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) {
1528  VisitOverloadExpr(E);
1529  Record.push_back(E->requiresADL());
1530  Record.push_back(E->isOverloaded());
1531  Writer.AddDeclRef(E->getNamingClass(), Record);
1533 }
1534 
1535 void ASTStmtWriter::VisitTypeTraitExpr(TypeTraitExpr *E) {
1536  VisitExpr(E);
1537  Record.push_back(E->TypeTraitExprBits.NumArgs);
1538  Record.push_back(E->TypeTraitExprBits.Kind); // FIXME: Stable encoding
1539  Record.push_back(E->TypeTraitExprBits.Value);
1540  Writer.AddSourceRange(E->getSourceRange(), Record);
1541  for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1542  Writer.AddTypeSourceInfo(E->getArg(I), Record);
1544 }
1545 
1546 void ASTStmtWriter::VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E) {
1547  VisitExpr(E);
1548  Record.push_back(E->getTrait());
1549  Record.push_back(E->getValue());
1550  Writer.AddSourceRange(E->getSourceRange(), Record);
1551  Writer.AddTypeSourceInfo(E->getQueriedTypeSourceInfo(), Record);
1553 }
1554 
1555 void ASTStmtWriter::VisitExpressionTraitExpr(ExpressionTraitExpr *E) {
1556  VisitExpr(E);
1557  Record.push_back(E->getTrait());
1558  Record.push_back(E->getValue());
1559  Writer.AddSourceRange(E->getSourceRange(), Record);
1560  Writer.AddStmt(E->getQueriedExpression());
1562 }
1563 
1564 void ASTStmtWriter::VisitCXXNoexceptExpr(CXXNoexceptExpr *E) {
1565  VisitExpr(E);
1566  Record.push_back(E->getValue());
1567  Writer.AddSourceRange(E->getSourceRange(), Record);
1568  Writer.AddStmt(E->getOperand());
1570 }
1571 
1572 void ASTStmtWriter::VisitPackExpansionExpr(PackExpansionExpr *E) {
1573  VisitExpr(E);
1574  Writer.AddSourceLocation(E->getEllipsisLoc(), Record);
1575  Record.push_back(E->NumExpansions);
1576  Writer.AddStmt(E->getPattern());
1578 }
1579 
1580 void ASTStmtWriter::VisitSizeOfPackExpr(SizeOfPackExpr *E) {
1581  VisitExpr(E);
1582  Record.push_back(E->isPartiallySubstituted() ? E->getPartialArguments().size()
1583  : 0);
1584  Writer.AddSourceLocation(E->OperatorLoc, Record);
1585  Writer.AddSourceLocation(E->PackLoc, Record);
1586  Writer.AddSourceLocation(E->RParenLoc, Record);
1587  Writer.AddDeclRef(E->Pack, Record);
1588  if (E->isPartiallySubstituted()) {
1589  for (const auto &TA : E->getPartialArguments())
1590  Writer.AddTemplateArgument(TA, Record);
1591  } else if (!E->isValueDependent()) {
1592  Record.push_back(E->getPackLength());
1593  }
1595 }
1596 
1597 void ASTStmtWriter::VisitSubstNonTypeTemplateParmExpr(
1599  VisitExpr(E);
1600  Writer.AddDeclRef(E->getParameter(), Record);
1601  Writer.AddSourceLocation(E->getNameLoc(), Record);
1602  Writer.AddStmt(E->getReplacement());
1604 }
1605 
1606 void ASTStmtWriter::VisitSubstNonTypeTemplateParmPackExpr(
1608  VisitExpr(E);
1609  Writer.AddDeclRef(E->getParameterPack(), Record);
1610  Writer.AddTemplateArgument(E->getArgumentPack(), Record);
1611  Writer.AddSourceLocation(E->getParameterPackLocation(), Record);
1613 }
1614 
1615 void ASTStmtWriter::VisitFunctionParmPackExpr(FunctionParmPackExpr *E) {
1616  VisitExpr(E);
1617  Record.push_back(E->getNumExpansions());
1618  Writer.AddDeclRef(E->getParameterPack(), Record);
1619  Writer.AddSourceLocation(E->getParameterPackLocation(), Record);
1620  for (FunctionParmPackExpr::iterator I = E->begin(), End = E->end();
1621  I != End; ++I)
1622  Writer.AddDeclRef(*I, Record);
1624 }
1625 
1626 void ASTStmtWriter::VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E) {
1627  VisitExpr(E);
1628  Writer.AddStmt(E->getTemporary());
1629  Writer.AddDeclRef(E->getExtendingDecl(), Record);
1630  Record.push_back(E->getManglingNumber());
1632 }
1633 
1634 void ASTStmtWriter::VisitCXXFoldExpr(CXXFoldExpr *E) {
1635  VisitExpr(E);
1636  Writer.AddSourceLocation(E->LParenLoc, Record);
1637  Writer.AddSourceLocation(E->EllipsisLoc, Record);
1638  Writer.AddSourceLocation(E->RParenLoc, Record);
1639  Writer.AddStmt(E->SubExprs[0]);
1640  Writer.AddStmt(E->SubExprs[1]);
1641  Record.push_back(E->Opcode);
1643 }
1644 
1645 void ASTStmtWriter::VisitOpaqueValueExpr(OpaqueValueExpr *E) {
1646  VisitExpr(E);
1647  Writer.AddStmt(E->getSourceExpr());
1648  Writer.AddSourceLocation(E->getLocation(), Record);
1650 }
1651 
1652 void ASTStmtWriter::VisitTypoExpr(TypoExpr *E) {
1653  VisitExpr(E);
1654  // TODO: Figure out sane writer behavior for a TypoExpr, if necessary
1655  assert(false && "Cannot write TypoExpr nodes");
1656 }
1657 
1658 //===----------------------------------------------------------------------===//
1659 // CUDA Expressions and Statements.
1660 //===----------------------------------------------------------------------===//
1661 
1662 void ASTStmtWriter::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E) {
1663  VisitCallExpr(E);
1664  Writer.AddStmt(E->getConfig());
1666 }
1667 
1668 //===----------------------------------------------------------------------===//
1669 // OpenCL Expressions and Statements.
1670 //===----------------------------------------------------------------------===//
1671 void ASTStmtWriter::VisitAsTypeExpr(AsTypeExpr *E) {
1672  VisitExpr(E);
1673  Writer.AddSourceLocation(E->getBuiltinLoc(), Record);
1674  Writer.AddSourceLocation(E->getRParenLoc(), Record);
1675  Writer.AddStmt(E->getSrcExpr());
1677 }
1678 
1679 //===----------------------------------------------------------------------===//
1680 // Microsoft Expressions and Statements.
1681 //===----------------------------------------------------------------------===//
1682 void ASTStmtWriter::VisitMSPropertyRefExpr(MSPropertyRefExpr *E) {
1683  VisitExpr(E);
1684  Record.push_back(E->isArrow());
1685  Writer.AddStmt(E->getBaseExpr());
1686  Writer.AddNestedNameSpecifierLoc(E->getQualifierLoc(), Record);
1687  Writer.AddSourceLocation(E->getMemberLoc(), Record);
1688  Writer.AddDeclRef(E->getPropertyDecl(), Record);
1690 }
1691 
1692 void ASTStmtWriter::VisitMSPropertySubscriptExpr(MSPropertySubscriptExpr *E) {
1693  VisitExpr(E);
1694  Writer.AddStmt(E->getBase());
1695  Writer.AddStmt(E->getIdx());
1696  Writer.AddSourceLocation(E->getRBracketLoc(), Record);
1698 }
1699 
1700 void ASTStmtWriter::VisitCXXUuidofExpr(CXXUuidofExpr *E) {
1701  VisitExpr(E);
1702  Writer.AddSourceRange(E->getSourceRange(), Record);
1703  if (E->isTypeOperand()) {
1704  Writer.AddTypeSourceInfo(E->getTypeOperandSourceInfo(), Record);
1706  } else {
1707  Writer.AddStmt(E->getExprOperand());
1709  }
1710 }
1711 
1712 void ASTStmtWriter::VisitSEHExceptStmt(SEHExceptStmt *S) {
1713  VisitStmt(S);
1714  Writer.AddSourceLocation(S->getExceptLoc(), Record);
1715  Writer.AddStmt(S->getFilterExpr());
1716  Writer.AddStmt(S->getBlock());
1718 }
1719 
1720 void ASTStmtWriter::VisitSEHFinallyStmt(SEHFinallyStmt *S) {
1721  VisitStmt(S);
1722  Writer.AddSourceLocation(S->getFinallyLoc(), Record);
1723  Writer.AddStmt(S->getBlock());
1725 }
1726 
1727 void ASTStmtWriter::VisitSEHTryStmt(SEHTryStmt *S) {
1728  VisitStmt(S);
1729  Record.push_back(S->getIsCXXTry());
1730  Writer.AddSourceLocation(S->getTryLoc(), Record);
1731  Writer.AddStmt(S->getTryBlock());
1732  Writer.AddStmt(S->getHandler());
1734 }
1735 
1736 void ASTStmtWriter::VisitSEHLeaveStmt(SEHLeaveStmt *S) {
1737  VisitStmt(S);
1738  Writer.AddSourceLocation(S->getLeaveLoc(), Record);
1740 }
1741 
1742 //===----------------------------------------------------------------------===//
1743 // OpenMP Clauses.
1744 //===----------------------------------------------------------------------===//
1745 
1746 namespace clang {
1747 class OMPClauseWriter : public OMPClauseVisitor<OMPClauseWriter> {
1748  ASTStmtWriter *Writer;
1749  ASTWriter::RecordData &Record;
1750 public:
1752  : Writer(W), Record(Record) { }
1753 #define OPENMP_CLAUSE(Name, Class) \
1754  void Visit##Class(Class *S);
1755 #include "clang/Basic/OpenMPKinds.def"
1756  void writeClause(OMPClause *C);
1757 };
1758 }
1759 
1761  Record.push_back(C->getClauseKind());
1762  Visit(C);
1763  Writer->Writer.AddSourceLocation(C->getLocStart(), Record);
1764  Writer->Writer.AddSourceLocation(C->getLocEnd(), Record);
1765 }
1766 
1767 void OMPClauseWriter::VisitOMPIfClause(OMPIfClause *C) {
1768  Record.push_back(C->getNameModifier());
1769  Writer->Writer.AddSourceLocation(C->getNameModifierLoc(), Record);
1770  Writer->Writer.AddSourceLocation(C->getColonLoc(), Record);
1771  Writer->Writer.AddStmt(C->getCondition());
1772  Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
1773 }
1774 
1775 void OMPClauseWriter::VisitOMPFinalClause(OMPFinalClause *C) {
1776  Writer->Writer.AddStmt(C->getCondition());
1777  Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
1778 }
1779 
1780 void OMPClauseWriter::VisitOMPNumThreadsClause(OMPNumThreadsClause *C) {
1781  Writer->Writer.AddStmt(C->getNumThreads());
1782  Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
1783 }
1784 
1785 void OMPClauseWriter::VisitOMPSafelenClause(OMPSafelenClause *C) {
1786  Writer->Writer.AddStmt(C->getSafelen());
1787  Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
1788 }
1789 
1790 void OMPClauseWriter::VisitOMPSimdlenClause(OMPSimdlenClause *C) {
1791  Writer->Writer.AddStmt(C->getSimdlen());
1792  Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
1793 }
1794 
1795 void OMPClauseWriter::VisitOMPCollapseClause(OMPCollapseClause *C) {
1796  Writer->Writer.AddStmt(C->getNumForLoops());
1797  Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
1798 }
1799 
1800 void OMPClauseWriter::VisitOMPDefaultClause(OMPDefaultClause *C) {
1801  Record.push_back(C->getDefaultKind());
1802  Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
1803  Writer->Writer.AddSourceLocation(C->getDefaultKindKwLoc(), Record);
1804 }
1805 
1806 void OMPClauseWriter::VisitOMPProcBindClause(OMPProcBindClause *C) {
1807  Record.push_back(C->getProcBindKind());
1808  Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
1809  Writer->Writer.AddSourceLocation(C->getProcBindKindKwLoc(), Record);
1810 }
1811 
1812 void OMPClauseWriter::VisitOMPScheduleClause(OMPScheduleClause *C) {
1813  Record.push_back(C->getScheduleKind());
1814  Record.push_back(C->getFirstScheduleModifier());
1815  Record.push_back(C->getSecondScheduleModifier());
1816  Writer->Writer.AddStmt(C->getChunkSize());
1817  Writer->Writer.AddStmt(C->getHelperChunkSize());
1818  Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
1819  Writer->Writer.AddSourceLocation(C->getFirstScheduleModifierLoc(), Record);
1820  Writer->Writer.AddSourceLocation(C->getSecondScheduleModifierLoc(), Record);
1821  Writer->Writer.AddSourceLocation(C->getScheduleKindLoc(), Record);
1822  Writer->Writer.AddSourceLocation(C->getCommaLoc(), Record);
1823 }
1824 
1825 void OMPClauseWriter::VisitOMPOrderedClause(OMPOrderedClause *C) {
1826  Writer->Writer.AddStmt(C->getNumForLoops());
1827  Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
1828 }
1829 
1830 void OMPClauseWriter::VisitOMPNowaitClause(OMPNowaitClause *) {}
1831 
1832 void OMPClauseWriter::VisitOMPUntiedClause(OMPUntiedClause *) {}
1833 
1834 void OMPClauseWriter::VisitOMPMergeableClause(OMPMergeableClause *) {}
1835 
1836 void OMPClauseWriter::VisitOMPReadClause(OMPReadClause *) {}
1837 
1838 void OMPClauseWriter::VisitOMPWriteClause(OMPWriteClause *) {}
1839 
1840 void OMPClauseWriter::VisitOMPUpdateClause(OMPUpdateClause *) {}
1841 
1842 void OMPClauseWriter::VisitOMPCaptureClause(OMPCaptureClause *) {}
1843 
1844 void OMPClauseWriter::VisitOMPSeqCstClause(OMPSeqCstClause *) {}
1845 
1846 void OMPClauseWriter::VisitOMPThreadsClause(OMPThreadsClause *) {}
1847 
1848 void OMPClauseWriter::VisitOMPSIMDClause(OMPSIMDClause *) {}
1849 
1850 void OMPClauseWriter::VisitOMPNogroupClause(OMPNogroupClause *) {}
1851 
1852 void OMPClauseWriter::VisitOMPPrivateClause(OMPPrivateClause *C) {
1853  Record.push_back(C->varlist_size());
1854  Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
1855  for (auto *VE : C->varlists()) {
1856  Writer->Writer.AddStmt(VE);
1857  }
1858  for (auto *VE : C->private_copies()) {
1859  Writer->Writer.AddStmt(VE);
1860  }
1861 }
1862 
1863 void OMPClauseWriter::VisitOMPFirstprivateClause(OMPFirstprivateClause *C) {
1864  Record.push_back(C->varlist_size());
1865  Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
1866  for (auto *VE : C->varlists()) {
1867  Writer->Writer.AddStmt(VE);
1868  }
1869  for (auto *VE : C->private_copies()) {
1870  Writer->Writer.AddStmt(VE);
1871  }
1872  for (auto *VE : C->inits()) {
1873  Writer->Writer.AddStmt(VE);
1874  }
1875 }
1876 
1877 void OMPClauseWriter::VisitOMPLastprivateClause(OMPLastprivateClause *C) {
1878  Record.push_back(C->varlist_size());
1879  Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
1880  for (auto *VE : C->varlists())
1881  Writer->Writer.AddStmt(VE);
1882  for (auto *E : C->private_copies())
1883  Writer->Writer.AddStmt(E);
1884  for (auto *E : C->source_exprs())
1885  Writer->Writer.AddStmt(E);
1886  for (auto *E : C->destination_exprs())
1887  Writer->Writer.AddStmt(E);
1888  for (auto *E : C->assignment_ops())
1889  Writer->Writer.AddStmt(E);
1890 }
1891 
1892 void OMPClauseWriter::VisitOMPSharedClause(OMPSharedClause *C) {
1893  Record.push_back(C->varlist_size());
1894  Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
1895  for (auto *VE : C->varlists())
1896  Writer->Writer.AddStmt(VE);
1897 }
1898 
1899 void OMPClauseWriter::VisitOMPReductionClause(OMPReductionClause *C) {
1900  Record.push_back(C->varlist_size());
1901  Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
1902  Writer->Writer.AddSourceLocation(C->getColonLoc(), Record);
1903  Writer->Writer.AddNestedNameSpecifierLoc(C->getQualifierLoc(), Record);
1904  Writer->Writer.AddDeclarationNameInfo(C->getNameInfo(), Record);
1905  for (auto *VE : C->varlists())
1906  Writer->Writer.AddStmt(VE);
1907  for (auto *VE : C->privates())
1908  Writer->Writer.AddStmt(VE);
1909  for (auto *E : C->lhs_exprs())
1910  Writer->Writer.AddStmt(E);
1911  for (auto *E : C->rhs_exprs())
1912  Writer->Writer.AddStmt(E);
1913  for (auto *E : C->reduction_ops())
1914  Writer->Writer.AddStmt(E);
1915 }
1916 
1917 void OMPClauseWriter::VisitOMPLinearClause(OMPLinearClause *C) {
1918  Record.push_back(C->varlist_size());
1919  Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
1920  Writer->Writer.AddSourceLocation(C->getColonLoc(), Record);
1921  Record.push_back(C->getModifier());
1922  Writer->Writer.AddSourceLocation(C->getModifierLoc(), Record);
1923  for (auto *VE : C->varlists()) {
1924  Writer->Writer.AddStmt(VE);
1925  }
1926  for (auto *VE : C->privates()) {
1927  Writer->Writer.AddStmt(VE);
1928  }
1929  for (auto *VE : C->inits()) {
1930  Writer->Writer.AddStmt(VE);
1931  }
1932  for (auto *VE : C->updates()) {
1933  Writer->Writer.AddStmt(VE);
1934  }
1935  for (auto *VE : C->finals()) {
1936  Writer->Writer.AddStmt(VE);
1937  }
1938  Writer->Writer.AddStmt(C->getStep());
1939  Writer->Writer.AddStmt(C->getCalcStep());
1940 }
1941 
1942 void OMPClauseWriter::VisitOMPAlignedClause(OMPAlignedClause *C) {
1943  Record.push_back(C->varlist_size());
1944  Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
1945  Writer->Writer.AddSourceLocation(C->getColonLoc(), Record);
1946  for (auto *VE : C->varlists())
1947  Writer->Writer.AddStmt(VE);
1948  Writer->Writer.AddStmt(C->getAlignment());
1949 }
1950 
1951 void OMPClauseWriter::VisitOMPCopyinClause(OMPCopyinClause *C) {
1952  Record.push_back(C->varlist_size());
1953  Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
1954  for (auto *VE : C->varlists())
1955  Writer->Writer.AddStmt(VE);
1956  for (auto *E : C->source_exprs())
1957  Writer->Writer.AddStmt(E);
1958  for (auto *E : C->destination_exprs())
1959  Writer->Writer.AddStmt(E);
1960  for (auto *E : C->assignment_ops())
1961  Writer->Writer.AddStmt(E);
1962 }
1963 
1964 void OMPClauseWriter::VisitOMPCopyprivateClause(OMPCopyprivateClause *C) {
1965  Record.push_back(C->varlist_size());
1966  Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
1967  for (auto *VE : C->varlists())
1968  Writer->Writer.AddStmt(VE);
1969  for (auto *E : C->source_exprs())
1970  Writer->Writer.AddStmt(E);
1971  for (auto *E : C->destination_exprs())
1972  Writer->Writer.AddStmt(E);
1973  for (auto *E : C->assignment_ops())
1974  Writer->Writer.AddStmt(E);
1975 }
1976 
1977 void OMPClauseWriter::VisitOMPFlushClause(OMPFlushClause *C) {
1978  Record.push_back(C->varlist_size());
1979  Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
1980  for (auto *VE : C->varlists())
1981  Writer->Writer.AddStmt(VE);
1982 }
1983 
1984 void OMPClauseWriter::VisitOMPDependClause(OMPDependClause *C) {
1985  Record.push_back(C->varlist_size());
1986  Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
1987  Record.push_back(C->getDependencyKind());
1988  Writer->Writer.AddSourceLocation(C->getDependencyLoc(), Record);
1989  Writer->Writer.AddSourceLocation(C->getColonLoc(), Record);
1990  for (auto *VE : C->varlists())
1991  Writer->Writer.AddStmt(VE);
1992 }
1993 
1994 void OMPClauseWriter::VisitOMPDeviceClause(OMPDeviceClause *C) {
1995  Writer->Writer.AddStmt(C->getDevice());
1996  Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
1997 }
1998 
1999 void OMPClauseWriter::VisitOMPMapClause(OMPMapClause *C) {
2000  Record.push_back(C->varlist_size());
2001  Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
2002  Record.push_back(C->getMapTypeModifier());
2003  Record.push_back(C->getMapType());
2004  Writer->Writer.AddSourceLocation(C->getMapLoc(), Record);
2005  Writer->Writer.AddSourceLocation(C->getColonLoc(), Record);
2006  for (auto *VE : C->varlists())
2007  Writer->Writer.AddStmt(VE);
2008 }
2009 
2010 void OMPClauseWriter::VisitOMPNumTeamsClause(OMPNumTeamsClause *C) {
2011  Writer->Writer.AddStmt(C->getNumTeams());
2012  Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
2013 }
2014 
2015 void OMPClauseWriter::VisitOMPThreadLimitClause(OMPThreadLimitClause *C) {
2016  Writer->Writer.AddStmt(C->getThreadLimit());
2017  Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
2018 }
2019 
2020 void OMPClauseWriter::VisitOMPPriorityClause(OMPPriorityClause *C) {
2021  Writer->Writer.AddStmt(C->getPriority());
2022  Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
2023 }
2024 
2025 void OMPClauseWriter::VisitOMPGrainsizeClause(OMPGrainsizeClause *C) {
2026  Writer->Writer.AddStmt(C->getGrainsize());
2027  Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
2028 }
2029 
2030 void OMPClauseWriter::VisitOMPNumTasksClause(OMPNumTasksClause *C) {
2031  Writer->Writer.AddStmt(C->getNumTasks());
2032  Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
2033 }
2034 
2035 void OMPClauseWriter::VisitOMPHintClause(OMPHintClause *C) {
2036  Writer->Writer.AddStmt(C->getHint());
2037  Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
2038 }
2039 
2040 //===----------------------------------------------------------------------===//
2041 // OpenMP Directives.
2042 //===----------------------------------------------------------------------===//
2043 void ASTStmtWriter::VisitOMPExecutableDirective(OMPExecutableDirective *E) {
2044  Writer.AddSourceLocation(E->getLocStart(), Record);
2045  Writer.AddSourceLocation(E->getLocEnd(), Record);
2046  OMPClauseWriter ClauseWriter(this, Record);
2047  for (unsigned i = 0; i < E->getNumClauses(); ++i) {
2048  ClauseWriter.writeClause(E->getClause(i));
2049  }
2050  if (E->hasAssociatedStmt())
2051  Writer.AddStmt(E->getAssociatedStmt());
2052 }
2053 
2054 void ASTStmtWriter::VisitOMPLoopDirective(OMPLoopDirective *D) {
2055  VisitStmt(D);
2056  Record.push_back(D->getNumClauses());
2057  Record.push_back(D->getCollapsedNumber());
2058  VisitOMPExecutableDirective(D);
2059  Writer.AddStmt(D->getIterationVariable());
2060  Writer.AddStmt(D->getLastIteration());
2061  Writer.AddStmt(D->getCalcLastIteration());
2062  Writer.AddStmt(D->getPreCond());
2063  Writer.AddStmt(D->getCond());
2064  Writer.AddStmt(D->getInit());
2065  Writer.AddStmt(D->getInc());
2067  Writer.AddStmt(D->getIsLastIterVariable());
2068  Writer.AddStmt(D->getLowerBoundVariable());
2069  Writer.AddStmt(D->getUpperBoundVariable());
2070  Writer.AddStmt(D->getStrideVariable());
2071  Writer.AddStmt(D->getEnsureUpperBound());
2072  Writer.AddStmt(D->getNextLowerBound());
2073  Writer.AddStmt(D->getNextUpperBound());
2074  }
2075  for (auto I : D->counters()) {
2076  Writer.AddStmt(I);
2077  }
2078  for (auto I : D->private_counters()) {
2079  Writer.AddStmt(I);
2080  }
2081  for (auto I : D->inits()) {
2082  Writer.AddStmt(I);
2083  }
2084  for (auto I : D->updates()) {
2085  Writer.AddStmt(I);
2086  }
2087  for (auto I : D->finals()) {
2088  Writer.AddStmt(I);
2089  }
2090 }
2091 
2092 void ASTStmtWriter::VisitOMPParallelDirective(OMPParallelDirective *D) {
2093  VisitStmt(D);
2094  Record.push_back(D->getNumClauses());
2095  VisitOMPExecutableDirective(D);
2096  Record.push_back(D->hasCancel() ? 1 : 0);
2098 }
2099 
2100 void ASTStmtWriter::VisitOMPSimdDirective(OMPSimdDirective *D) {
2101  VisitOMPLoopDirective(D);
2103 }
2104 
2105 void ASTStmtWriter::VisitOMPForDirective(OMPForDirective *D) {
2106  VisitOMPLoopDirective(D);
2107  Record.push_back(D->hasCancel() ? 1 : 0);
2109 }
2110 
2111 void ASTStmtWriter::VisitOMPForSimdDirective(OMPForSimdDirective *D) {
2112  VisitOMPLoopDirective(D);
2114 }
2115 
2116 void ASTStmtWriter::VisitOMPSectionsDirective(OMPSectionsDirective *D) {
2117  VisitStmt(D);
2118  Record.push_back(D->getNumClauses());
2119  VisitOMPExecutableDirective(D);
2120  Record.push_back(D->hasCancel() ? 1 : 0);
2122 }
2123 
2124 void ASTStmtWriter::VisitOMPSectionDirective(OMPSectionDirective *D) {
2125  VisitStmt(D);
2126  VisitOMPExecutableDirective(D);
2127  Record.push_back(D->hasCancel() ? 1 : 0);
2129 }
2130 
2131 void ASTStmtWriter::VisitOMPSingleDirective(OMPSingleDirective *D) {
2132  VisitStmt(D);
2133  Record.push_back(D->getNumClauses());
2134  VisitOMPExecutableDirective(D);
2136 }
2137 
2138 void ASTStmtWriter::VisitOMPMasterDirective(OMPMasterDirective *D) {
2139  VisitStmt(D);
2140  VisitOMPExecutableDirective(D);
2142 }
2143 
2144 void ASTStmtWriter::VisitOMPCriticalDirective(OMPCriticalDirective *D) {
2145  VisitStmt(D);
2146  Record.push_back(D->getNumClauses());
2147  VisitOMPExecutableDirective(D);
2148  Writer.AddDeclarationNameInfo(D->getDirectiveName(), Record);
2150 }
2151 
2152 void ASTStmtWriter::VisitOMPParallelForDirective(OMPParallelForDirective *D) {
2153  VisitOMPLoopDirective(D);
2154  Record.push_back(D->hasCancel() ? 1 : 0);
2156 }
2157 
2158 void ASTStmtWriter::VisitOMPParallelForSimdDirective(
2160  VisitOMPLoopDirective(D);
2162 }
2163 
2164 void ASTStmtWriter::VisitOMPParallelSectionsDirective(
2166  VisitStmt(D);
2167  Record.push_back(D->getNumClauses());
2168  VisitOMPExecutableDirective(D);
2169  Record.push_back(D->hasCancel() ? 1 : 0);
2171 }
2172 
2173 void ASTStmtWriter::VisitOMPTaskDirective(OMPTaskDirective *D) {
2174  VisitStmt(D);
2175  Record.push_back(D->getNumClauses());
2176  VisitOMPExecutableDirective(D);
2177  Record.push_back(D->hasCancel() ? 1 : 0);
2179 }
2180 
2181 void ASTStmtWriter::VisitOMPAtomicDirective(OMPAtomicDirective *D) {
2182  VisitStmt(D);
2183  Record.push_back(D->getNumClauses());
2184  VisitOMPExecutableDirective(D);
2185  Writer.AddStmt(D->getX());
2186  Writer.AddStmt(D->getV());
2187  Writer.AddStmt(D->getExpr());
2188  Writer.AddStmt(D->getUpdateExpr());
2189  Record.push_back(D->isXLHSInRHSPart() ? 1 : 0);
2190  Record.push_back(D->isPostfixUpdate() ? 1 : 0);
2192 }
2193 
2194 void ASTStmtWriter::VisitOMPTargetDirective(OMPTargetDirective *D) {
2195  VisitStmt(D);
2196  Record.push_back(D->getNumClauses());
2197  VisitOMPExecutableDirective(D);
2199 }
2200 
2201 void ASTStmtWriter::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) {
2202  VisitStmt(D);
2203  Record.push_back(D->getNumClauses());
2204  VisitOMPExecutableDirective(D);
2206 }
2207 
2208 void ASTStmtWriter::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) {
2209  VisitStmt(D);
2210  VisitOMPExecutableDirective(D);
2212 }
2213 
2214 void ASTStmtWriter::VisitOMPBarrierDirective(OMPBarrierDirective *D) {
2215  VisitStmt(D);
2216  VisitOMPExecutableDirective(D);
2218 }
2219 
2220 void ASTStmtWriter::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) {
2221  VisitStmt(D);
2222  VisitOMPExecutableDirective(D);
2224 }
2225 
2226 void ASTStmtWriter::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) {
2227  VisitStmt(D);
2228  VisitOMPExecutableDirective(D);
2230 }
2231 
2232 void ASTStmtWriter::VisitOMPFlushDirective(OMPFlushDirective *D) {
2233  VisitStmt(D);
2234  Record.push_back(D->getNumClauses());
2235  VisitOMPExecutableDirective(D);
2237 }
2238 
2239 void ASTStmtWriter::VisitOMPOrderedDirective(OMPOrderedDirective *D) {
2240  VisitStmt(D);
2241  Record.push_back(D->getNumClauses());
2242  VisitOMPExecutableDirective(D);
2244 }
2245 
2246 void ASTStmtWriter::VisitOMPTeamsDirective(OMPTeamsDirective *D) {
2247  VisitStmt(D);
2248  Record.push_back(D->getNumClauses());
2249  VisitOMPExecutableDirective(D);
2251 }
2252 
2253 void ASTStmtWriter::VisitOMPCancellationPointDirective(
2255  VisitStmt(D);
2256  VisitOMPExecutableDirective(D);
2257  Record.push_back(D->getCancelRegion());
2259 }
2260 
2261 void ASTStmtWriter::VisitOMPCancelDirective(OMPCancelDirective *D) {
2262  VisitStmt(D);
2263  Record.push_back(D->getNumClauses());
2264  VisitOMPExecutableDirective(D);
2265  Record.push_back(D->getCancelRegion());
2267 }
2268 
2269 void ASTStmtWriter::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) {
2270  VisitOMPLoopDirective(D);
2272 }
2273 
2274 void ASTStmtWriter::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) {
2275  VisitOMPLoopDirective(D);
2277 }
2278 
2279 void ASTStmtWriter::VisitOMPDistributeDirective(OMPDistributeDirective *D) {
2280  VisitOMPLoopDirective(D);
2282 }
2283 
2284 //===----------------------------------------------------------------------===//
2285 // ASTWriter Implementation
2286 //===----------------------------------------------------------------------===//
2287 
2289  assert(SwitchCaseIDs.find(S) == SwitchCaseIDs.end() &&
2290  "SwitchCase recorded twice");
2291  unsigned NextID = SwitchCaseIDs.size();
2292  SwitchCaseIDs[S] = NextID;
2293  return NextID;
2294 }
2295 
2297  assert(SwitchCaseIDs.find(S) != SwitchCaseIDs.end() &&
2298  "SwitchCase hasn't been seen yet");
2299  return SwitchCaseIDs[S];
2300 }
2301 
2303  SwitchCaseIDs.clear();
2304 }
2305 
2306 /// \brief Write the given substatement or subexpression to the
2307 /// bitstream.
2308 void ASTWriter::WriteSubStmt(Stmt *S,
2309  llvm::DenseMap<Stmt *, uint64_t> &SubStmtEntries,
2310  llvm::DenseSet<Stmt *> &ParentStmts) {
2311  RecordData Record;
2312  ASTStmtWriter Writer(*this, Record);
2313  ++NumStatements;
2314 
2315  if (!S) {
2316  Stream.EmitRecord(serialization::STMT_NULL_PTR, Record);
2317  return;
2318  }
2319 
2320  llvm::DenseMap<Stmt *, uint64_t>::iterator I = SubStmtEntries.find(S);
2321  if (I != SubStmtEntries.end()) {
2322  Record.push_back(I->second);
2323  Stream.EmitRecord(serialization::STMT_REF_PTR, Record);
2324  return;
2325  }
2326 
2327 #ifndef NDEBUG
2328  assert(!ParentStmts.count(S) && "There is a Stmt cycle!");
2329 
2330  struct ParentStmtInserterRAII {
2331  Stmt *S;
2332  llvm::DenseSet<Stmt *> &ParentStmts;
2333 
2334  ParentStmtInserterRAII(Stmt *S, llvm::DenseSet<Stmt *> &ParentStmts)
2335  : S(S), ParentStmts(ParentStmts) {
2336  ParentStmts.insert(S);
2337  }
2338  ~ParentStmtInserterRAII() {
2339  ParentStmts.erase(S);
2340  }
2341  };
2342 
2343  ParentStmtInserterRAII ParentStmtInserter(S, ParentStmts);
2344 #endif
2345 
2346  // Redirect ASTWriter::AddStmt to collect sub-stmts.
2347  SmallVector<Stmt *, 16> SubStmts;
2348  CollectedStmts = &SubStmts;
2349 
2350  Writer.Code = serialization::STMT_NULL_PTR;
2351  Writer.AbbrevToUse = 0;
2352  Writer.Visit(S);
2353 
2354 #ifndef NDEBUG
2355  if (Writer.Code == serialization::STMT_NULL_PTR) {
2356  SourceManager &SrcMgr
2357  = DeclIDs.begin()->first->getASTContext().getSourceManager();
2358  S->dump(SrcMgr);
2359  llvm_unreachable("Unhandled sub-statement writing AST file");
2360  }
2361 #endif
2362 
2363  // Revert ASTWriter::AddStmt.
2364  CollectedStmts = &StmtsToEmit;
2365 
2366  // Write the sub-stmts in reverse order, last to first. When reading them back
2367  // we will read them in correct order by "pop"ing them from the Stmts stack.
2368  // This simplifies reading and allows to store a variable number of sub-stmts
2369  // without knowing it in advance.
2370  while (!SubStmts.empty())
2371  WriteSubStmt(SubStmts.pop_back_val(), SubStmtEntries, ParentStmts);
2372 
2373  Stream.EmitRecord(Writer.Code, Record, Writer.AbbrevToUse);
2374 
2375  SubStmtEntries[S] = Stream.GetCurrentBitNo();
2376 }
2377 
2378 /// \brief Flush all of the statements that have been added to the
2379 /// queue via AddStmt().
2381  RecordData Record;
2382 
2383  // We expect to be the only consumer of the two temporary statement maps,
2384  // assert that they are empty.
2385  assert(SubStmtEntries.empty() && "unexpected entries in sub-stmt map");
2386  assert(ParentStmts.empty() && "unexpected entries in parent stmt map");
2387 
2388  for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) {
2389  WriteSubStmt(StmtsToEmit[I], SubStmtEntries, ParentStmts);
2390 
2391  assert(N == StmtsToEmit.size() &&
2392  "Substatement written via AddStmt rather than WriteSubStmt!");
2393 
2394  // Note that we are at the end of a full expression. Any
2395  // expression records that follow this one are part of a different
2396  // expression.
2397  Stream.EmitRecord(serialization::STMT_STOP, Record);
2398 
2399  SubStmtEntries.clear();
2400  ParentStmts.clear();
2401  }
2402 
2403  StmtsToEmit.clear();
2404 }
void AddTemplateArgument(const TemplateArgument &Arg, RecordDataImpl &Record)
Emit a template argument.
Definition: ASTWriter.cpp:5302
SourceLocation getRParenLoc() const
Definition: Expr.h:3383
Expr * getInc()
Definition: Stmt.h:1165
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:539
A PredefinedExpr record.
Definition: ASTBitCodes.h:1215
A call to an overloaded operator written using operator syntax.
Definition: ExprCXX.h:54
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:4007
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Definition: Expr.h:2393
SourceRange getParenOrBraceRange() const
Definition: ExprCXX.h:1292
Defines the clang::ASTContext interface.
A CompoundLiteralExpr record.
Definition: ASTBitCodes.h:1255
unsigned getNumInits() const
Definition: Expr.h:3754
This represents '#pragma omp master' directive.
Definition: StmtOpenMP.h:1100
SourceLocation getEnd() const
const SwitchCase * getNextSwitchCase() const
Definition: Stmt.h:652
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: Expr.h:1106
const Expr * getBase() const
Definition: ExprObjC.h:509
ParmVarDecl *const * iterator
Iterators over the parameters which the parameter pack expanded into.
Definition: ExprCXX.h:3822
The null pointer literal (C++11 [lex.nullptr])
Definition: ExprCXX.h:489
CastKind getCastKind() const
Definition: Expr.h:2658
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
Definition: Expr.h:407
This represents '#pragma omp task' directive.
Definition: StmtOpenMP.h:1440
This represents a GCC inline-assembly statement extension.
Definition: Stmt.h:1543
serialization::StmtCode Code
IdentifierInfo * getFieldName() const
For a field or identifier offsetof node, returns the name of the field.
Definition: Expr.cpp:1357
TypeSourceInfo * getDestroyedTypeInfo() const
Retrieve the source location information for the type being destroyed.
Definition: ExprCXX.h:2142
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
Definition: Expr.h:1044
OpenMPScheduleClauseModifier getSecondScheduleModifier() const
Get the second modifier of the clause.
Definition: OpenMPClause.h:794
unsigned arg_size() const
Retrieve the number of arguments.
Definition: ExprCXX.h:2982
unsigned getNumOutputs() const
Definition: Stmt.h:1440
TypeSourceInfo * getTypeSourceInfo() const
Definition: Expr.h:2576
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:3454
bool isXLHSInRHSPart() const
Return true if helper update expression has form 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' and...
Definition: StmtOpenMP.h:1907
Expr * getSyntacticForm()
Return the syntactic form of this expression, i.e.
Definition: Expr.h:4736
bool isFPContractable() const
Definition: ExprCXX.h:110
void AddDeclarationNameInfo(const DeclarationNameInfo &NameInfo, RecordDataImpl &Record)
Definition: ASTWriter.cpp:5133
const DeclGroupRef getDeclGroup() const
Definition: Stmt.h:452
SourceLocation getLParenLoc() const
Returns the location of '('.
Definition: OpenMPClause.h:884
An IndirectGotoStmt record.
Definition: ASTBitCodes.h:1199
This represents clause 'copyin' in the '#pragma omp ...' directives.
bool isFileScope() const
Definition: Expr.h:2570
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:211
An AddrLabelExpr record.
Definition: ASTBitCodes.h:1271
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:2973
bool isResultDependent() const
Whether this generic selection is result-dependent.
Definition: Expr.h:4482
bool getValue() const
Definition: ExprCXX.h:467
bool isPascal() const
Definition: Expr.h:1548
SourceLocation getOperatorLoc() const
Retrieve the location of the '->' or '.' operator.
Definition: ExprCXX.h:3356
SourceLocation getThrowLoc() const
Definition: ExprCXX.h:923
void AddToken(const Token &Tok, RecordDataImpl &Record)
Emit a token.
Definition: ASTWriter.cpp:3951
SourceLocation getLParenLoc() const
Definition: Stmt.h:1180
SourceLocation getCommaLoc()
Get location of ','.
Definition: OpenMPClause.h:815
SourceLocation getLocation() const
Definition: ExprObjC.h:518
bool isElidable() const
Whether this construction is elidable.
Definition: ExprCXX.h:1218
Expr * getCond()
Definition: Stmt.h:1053
Expr * getExpr(unsigned Index)
getExpr - Return the Expr at the specified index.
Definition: Expr.h:3440
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:1357
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2191
An AttributedStmt record.
Definition: ASTBitCodes.h:1185
void AddAPInt(const llvm::APInt &Value, RecordDataImpl &Record)
Emit an integral value.
Definition: ASTWriter.cpp:4751
CompoundStmt * getSubStmt()
Definition: Expr.h:3374
A CXXReinterpretCastExpr record.
Definition: ASTBitCodes.h:1361
Expr * getSimdlen() const
Return safe iteration space distance.
Definition: OpenMPClause.h:436
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding the member name, if any.
Definition: Expr.h:2428
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the member name, with source location information...
Definition: ExprCXX.h:3137
unsigned getNumAsmToks()
Definition: Stmt.h:1753
A ObjCBoolLiteralExpr record.
Definition: ASTBitCodes.h:1337
private_copies_range private_copies()
CharacterKind getKind() const
Definition: Expr.h:1317
Expr *const * semantics_iterator
Definition: Expr.h:4758
Represents a 'co_return' statement in the C++ Coroutines TS.
Definition: StmtCXX.h:374
TypeSourceInfo * getScopeTypeInfo() const
Retrieve the scope type in a qualified pseudo-destructor expression.
Definition: ExprCXX.h:2126
CXXCatchStmt * getHandler(unsigned i)
Definition: StmtCXX.h:104
bool isArgumentType() const
Definition: Expr.h:1996
IfStmt - This represents an if/then/else.
Definition: Stmt.h:869
bool isGlobalDelete() const
Definition: ExprCXX.h:1960
This represents '#pragma omp for simd' directive.
Definition: StmtOpenMP.h:850
SourceLocation getLParenLoc() const
Returns the location of '('.
Definition: OpenMPClause.h:628
SourceLocation getForLoc() const
Definition: StmtObjC.h:53
OpenMPProcBindClauseKind getProcBindKind() const
Returns kind of the clause.
Definition: OpenMPClause.h:631
TypeSourceInfo * getTypeSourceInfo() const
Definition: Expr.h:1902
SourceLocation getLParenLoc() const
Returns the location of '('.
SourceRange getTypeIdParens() const
Definition: ExprCXX.h:1836
An ImplicitValueInitExpr record.
Definition: ASTBitCodes.h:1265
iterator end()
Definition: DeclGroup.h:108
unsigned getPackLength() const
Retrieve the length of the parameter pack.
Definition: ExprCXX.h:3632
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:77
SourceLocation getLParenLoc() const
Definition: Expr.h:3381
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:1251
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:2586
This represents 'if' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:152
Defines the C++ template declaration subclasses.
Represents an attribute applied to a statement.
Definition: Stmt.h:818
TypeSourceInfo * getArg(unsigned I) const
Retrieve the Ith argument.
Definition: ExprCXX.h:2239
ParenExpr - This represents a parethesized expression, e.g.
Definition: Expr.h:1605
SourceLocation getRParenLoc() const
Definition: ExprObjC.h:413
A CXXOperatorCallExpr record.
Definition: ASTBitCodes.h:1349
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:1814
SourceLocation getBuiltinLoc() const
getBuiltinLoc - Return the location of the __builtin_astype token.
Definition: Expr.h:4648
A CXXTemporaryObjectExpr record.
Definition: ASTBitCodes.h:1355
Represents Objective-C's @throw statement.
Definition: StmtObjC.h:313
unsigned getDeclRefExprAbbrev() const
Definition: ASTWriter.h:846
unsigned getResultIndex() const
The zero-based index of the result expression's generic association in the generic selection's associ...
Definition: Expr.h:4487
SourceLocation getLabelLoc() const
Definition: Expr.h:3333
void AddTypeSourceInfo(TypeSourceInfo *TInfo, RecordDataImpl &Record)
Emits a reference to a declarator info.
Definition: ASTWriter.cpp:4897
InitListExpr * getSyntacticForm() const
Definition: Expr.h:3860
SourceLocation getIfLoc() const
Definition: Stmt.h:912
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1149
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:760
SourceLocation getCoawaitLoc() const
Definition: StmtCXX.h:189
TypeSourceInfo * getTypeSourceInfo() const
Definition: ExprCXX.h:1702
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent...
Definition: ExprCXX.h:2275
SourceLocation getColonLoc() const
Returns the location of ':'.
This represents 'update' clause in the '#pragma omp atomic' directive.
const Stmt * getElse() const
Definition: Stmt.h:905
SourceLocation getOperatorLoc() const
Definition: Expr.h:2915
This represents '#pragma omp parallel for' directive.
Definition: StmtOpenMP.h:1221
MS property subscript expression.
Definition: ExprCXX.h:712
void AddTypeRef(QualType T, RecordDataImpl &Record)
Emit a reference to a type.
Definition: ASTWriter.cpp:4915
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "for" statement, if any.
Definition: Stmt.cpp:800
SourceLocation getLParenLoc() const
Returns the location of '('.
Definition: OpenMPClause.h:134
iterator begin() const
Definition: ExprCXX.h:3823
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:3864
Expr * getAlignment()
Returns alignment.
SourceLocation getEndLoc() const
Definition: Stmt.h:1748
CompoundStmt * getBlock() const
Definition: Stmt.h:1888
IdentType getIdentType() const
Definition: Expr.h:1173
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
Definition: ExprCXX.h:1968
bool isConditionTrue() const
isConditionTrue - Return whether the condition is true (i.e.
Definition: Expr.h:3553
Expr * getIndexExpr(unsigned Idx)
Definition: Expr.h:1923
bool hadArrayRangeDesignator() const
Definition: Expr.h:3871
ObjCDictionaryElement getKeyValueElement(unsigned Index) const
Definition: ExprObjC.h:309
Stmt * getSubStmt()
Definition: Stmt.h:748
bool isImplicit() const
Definition: ExprCXX.h:882
This represents 'read' clause in the '#pragma omp atomic' directive.
Definition: OpenMPClause.h:997
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprCXX.h:1909
Expr * getOperand() const
Definition: ExprCXX.h:3450
ArrayRef< TemplateArgument > getPartialArguments() const
Get.
Definition: ExprCXX.h:3648
VarDecl - An instance of this class is created to represent a variable declaration or definition...
Definition: Decl.h:699
SourceLocation getReturnLoc() const
Definition: Stmt.h:1363
This represents clause 'private' in the '#pragma omp ...' directives.
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:289
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:2540
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprCXX.h:626
const Expr * getCallee() const
Definition: Expr.h:2170
varlist_range varlists()
Definition: OpenMPClause.h:119
StringRef getInputConstraint(unsigned i) const
Definition: Stmt.h:1777
unsigned size() const
Definition: Stmt.h:564
SourceLocation getLocation() const
Retrieve the location of the literal.
Definition: Expr.h:1276
const TypeSourceInfo * getAssocTypeSourceInfo(unsigned i) const
Definition: Expr.h:4464
void AddCXXTemporary(const CXXTemporary *Temp, RecordDataImpl &Record)
Emit a CXXTemporary.
Definition: ASTWriter.cpp:4831
SourceLocation getDoLoc() const
Definition: Stmt.h:1105
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition: ExprCXX.h:517
SourceLocation getRParenLoc() const
Definition: Stmt.h:1565
Expr * getInc() const
Definition: StmtOpenMP.h:593
UnaryExprOrTypeTrait getKind() const
Definition: Expr.h:1991
CapturedRegionKind getCapturedRegionKind() const
Retrieve the captured region kind.
Definition: Stmt.cpp:1088
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:3265
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range that covers this offsetof node.
Definition: Expr.h:1841
capture_iterator capture_begin()
Retrieve an iterator pointing to the first capture.
Definition: Stmt.h:2126
A CXXConstructExpr record.
Definition: ASTBitCodes.h:1353
const ParmVarDecl * getParam() const
Definition: ExprCXX.h:981
SourceLocation getLParenLoc() const
Definition: ExprObjC.h:1543
raw_arg_iterator raw_arg_begin()
Definition: ExprCXX.h:1895
unsigned getValue() const
Definition: Expr.h:1324
A C++ throw-expression (C++ [except.throw]).
Definition: ExprCXX.h:900
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition: ExprCXX.h:2847
Expr * getNumForLoops() const
Return the number of associated for-loops.
Definition: OpenMPClause.h:887
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprObjC.h:119
QualType getBaseType() const
Definition: ExprCXX.h:3345
unsigned path_size() const
Definition: Expr.h:2677
SourceLocation getLocation() const
Definition: Expr.h:1015
bool isArrow() const
Definition: ExprObjC.h:1410
SourceLocation getEllipsisLoc() const
Definition: Stmt.h:697
SourceLocation getAtLoc() const
Definition: ExprObjC.h:371
void AddIdentifierRef(const IdentifierInfo *II, RecordDataImpl &Record)
Emit a reference to an identifier.
Definition: ASTWriter.cpp:4766
ArrayTypeTrait getTrait() const
Definition: ExprCXX.h:2318
This represents 'nogroup' clause in the '#pragma omp ...' directive.
bool getIsCXXTry() const
Definition: Stmt.h:1927
TypeSourceInfo * getTypeSourceInfo() const
Retrieve the type source information for the type being constructed.
Definition: ExprCXX.h:2969
A ShuffleVectorExpr record.
Definition: ASTBitCodes.h:1279
This represents 'safelen' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:347
SourceLocation getDestroyedTypeLoc() const
Retrieve the starting location of the type being destroyed.
Definition: ExprCXX.h:2157
A C++ static_cast expression (C++ [expr.static.cast]).
Definition: ExprCXX.h:238
OpenMPDirectiveKind getDirectiveKind() const
Definition: StmtOpenMP.h:202
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:777
SourceLocation getRParenLoc() const
Return the location of the right parentheses.
Definition: Expr.h:1899
Represents a C99 designated initializer expression.
Definition: Expr.h:3931
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:268
Expr * getNumThreads() const
Returns number of threads.
Definition: OpenMPClause.h:325
An OffsetOfExpr record.
Definition: ASTBitCodes.h:1235
Stmt * getBody()
Definition: Stmt.h:1101
An ObjCAtThrowStmt record.
Definition: ASTBitCodes.h:1333
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:275
SourceLocation getLParenLoc() const
Returns the location of '('.
Expr * getSubExpr(unsigned Idx) const
Definition: Expr.h:4211
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1284
An element in an Objective-C dictionary literal.
Definition: ExprObjC.h:212
A DesignatedInitExpr record.
Definition: ASTBitCodes.h:1261
This represents '#pragma omp parallel' directive.
Definition: StmtOpenMP.h:232
unsigned getNumInputs() const
Definition: Stmt.h:1462
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition: Expr.h:3400
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:789
unsigned getNumSemanticExprs() const
Definition: Expr.h:4756
unsigned getNumAssocs() const
Definition: Expr.h:4453
bool getValue() const
Definition: ExprCXX.h:3456
SourceLocation getAmpAmpLoc() const
Definition: Expr.h:3331
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
Definition: Decl.h:2209
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:3336
Represents a place-holder for an object not to be initialized by anything.
Definition: Expr.h:4253
unsigned getManglingNumber() const
Definition: ExprCXX.h:3928
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:1633
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
Definition: Expr.h:2464
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Definition: Expr.h:3602
ArrayRef< Expr * > updates()
Definition: StmtOpenMP.h:675
This represents clause 'map' in the '#pragma omp ...' directives.
The iterator over UnresolvedSets.
Definition: UnresolvedSet.h:28
TypeSourceInfo * getTypeSourceInfo() const
Definition: ExprCXX.h:1389
DeclarationNameInfo getNameInfo() const
Retrieve the name of the entity we're testing for, along with location information.
Definition: StmtCXX.h:271
Represents a C++ member access expression for which lookup produced a set of overloaded functions...
Definition: ExprCXX.h:3268
SourceLocation getAtLoc() const
Definition: ExprObjC.h:44
IdentifierInfo & getAccessor() const
Definition: Expr.h:4544
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:4522
SourceLocation getLBracLoc() const
Definition: Stmt.h:617
Expr * getSubExpr()
Definition: Expr.h:2662
SourceLocation getLBraceLoc() const
Definition: Stmt.h:1746
This represents '#pragma omp barrier' directive.
Definition: StmtOpenMP.h:1552
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1425
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
SourceLocation getLAngleLoc() const
Retrieve the location of the left angle bracket starting the explicit template argument list followin...
Definition: Expr.h:2435
This is a common base class for loop directives ('omp simd', 'omp for', 'omp for simd' etc...
Definition: StmtOpenMP.h:294
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:2442
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition: ExprCXX.h:3724
This represents '#pragma omp critical' directive.
Definition: StmtOpenMP.h:1147
OpenMPDirectiveKind getCancelRegion() const
Get cancellation region for the current cancellation point.
Definition: StmtOpenMP.h:2214
SourceLocation getRParenLoc() const
Definition: Expr.h:2266
Expr * getFilterExpr() const
Definition: Stmt.h:1848
bool isFPContractable() const
Definition: Expr.h:3042
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:2921
const VarDecl * getCatchParamDecl() const
Definition: StmtObjC.h:94
bool isOverloaded() const
True if this lookup is overloaded.
Definition: ExprCXX.h:2665
SourceLocation getWhileLoc() const
Definition: Stmt.h:1060
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:1371
This represents clause 'copyprivate' in the '#pragma omp ...' directives.
IndirectGotoStmt - This represents an indirect goto.
Definition: Stmt.h:1236
Describes an C or C++ initializer list.
Definition: Expr.h:3724
SourceLocation getFirstScheduleModifierLoc() const
Get the first modifier location.
Definition: OpenMPClause.h:805
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition: ExprCXX.h:559
SmallVector< uint64_t, 64 > RecordData
Definition: ASTWriter.h:87
ObjCMethodDecl * getBoxingMethod() const
Definition: ExprObjC.h:111
IdentifierInfo * getOutputIdentifier(unsigned i) const
Definition: Stmt.h:1633
const Stmt * getFinallyBody() const
Definition: StmtObjC.h:132
ForStmt - This represents a 'for (init;cond;inc)' stmt.
Definition: Stmt.h:1131
ArrayRef< Expr * > finals()
Definition: StmtOpenMP.h:681
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:2149
helper_expr_const_range private_copies() const
const ValueDecl * getExtendingDecl() const
Get the declaration which triggered the lifetime-extension of this temporary, if any.
Definition: ExprCXX.h:3921
SourceLocation getAtFinallyLoc() const
Definition: StmtObjC.h:141
Expr * getX()
Get 'x' part of the associated expression/statement.
Definition: StmtOpenMP.h:1891
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:1110
A reference to a previously [de]serialized Stmt record.
Definition: ASTBitCodes.h:1173
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:1595
Expr * getExprOperand() const
Definition: ExprCXX.h:614
path_iterator path_begin()
Definition: Expr.h:2678
Stmt * getBody()
Definition: Stmt.h:1166
SourceLocation getLParen() const
Get the location of the left parentheses '('.
Definition: Expr.h:1629
helper_expr_const_range source_exprs() const
OpenMPScheduleClauseKind getScheduleKind() const
Get kind of the clause.
Definition: OpenMPClause.h:786
const Expr * getSubExpr() const
Definition: Expr.h:3651
semantics_iterator semantics_end()
Definition: Expr.h:4766
SourceLocation getRParenLoc() const
Definition: Expr.h:3665
void AddSourceRange(SourceRange Range, RecordDataImpl &Record)
Emit a source range.
Definition: ASTWriter.cpp:4746
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:2875
SourceLocation getLocation() const
Definition: ExprCXX.h:473
Selector getSelector() const
Definition: ExprObjC.cpp:306
SourceLocation getRBraceLoc() const
Definition: Expr.h:3853
bool isValueDependent() const
isValueDependent - Determines whether this expression is value-dependent (C++ [temp.dep.constexpr]).
Definition: Expr.h:146
Stmt * getInit()
Definition: Stmt.h:1145
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:2662
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
Definition: StmtCXX.h:128
void AddSelectorRef(Selector, RecordDataImpl &Record)
Emit a Selector (which is a smart pointer reference).
Definition: ASTWriter.cpp:4808
SourceLocation getThrowLoc()
Definition: StmtObjC.h:329
This represents '#pragma omp cancellation point' directive.
Definition: StmtOpenMP.h:2107
This represents 'default' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:509
ObjCStringLiteral, used for Objective-C string literals i.e.
Definition: ExprObjC.h:29
Expr * getBaseExpr() const
Definition: ExprCXX.h:692
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
Definition: Expr.h:4918
const Stmt * getCatchBody() const
Definition: StmtObjC.h:90
This represents 'final' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:235
This represents 'mergeable' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:966
Expr * getCond()
Definition: Stmt.h:1164
SourceLocation getSecondScheduleModifierLoc() const
Get the second modifier location.
Definition: OpenMPClause.h:810
This represents '#pragma omp teams' directive.
Definition: StmtOpenMP.h:2050
Expr * getLHS() const
Definition: Expr.h:3193
bool isConditionDependent() const
Definition: Expr.h:3560
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:2610
This represents clause 'reduction' in the '#pragma omp ...' directives.
void AddTemplateArgumentLoc(const TemplateArgumentLoc &Arg, RecordDataImpl &Record)
Emits a template argument location.
Definition: ASTWriter.cpp:4882
FieldDecl * getField()
Get the field whose initializer will be used.
Definition: ExprCXX.h:1045
Helper class for OffsetOfExpr.
Definition: Expr.h:1756
A marker record that indicates that we are at the end of an expression.
Definition: ASTBitCodes.h:1169
Represents binding an expression to a temporary.
Definition: ExprCXX.h:1106
const ObjCAtCatchStmt * getCatchStmt(unsigned I) const
Retrieve a @catch statement.
Definition: StmtObjC.h:206
StringLiteral * getClobberStringLiteral(unsigned i)
Definition: Stmt.h:1707
Expr * Key
The key for the dictionary element.
Definition: ExprObjC.h:214
CXXTemporary * getTemporary()
Definition: ExprCXX.h:1126
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:1422
TypeSourceInfo * getTypeInfoAsWritten() const
getTypeInfoAsWritten - Returns the type source info for the type that this expression is casting to...
Definition: Expr.h:2796
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:834
const RecordDecl * getCapturedRecordDecl() const
Retrieve the record declaration for captured variables.
Definition: Stmt.h:2101
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3034
const Expr * getBase() const
Definition: ExprObjC.h:682
CleanupObject getObject(unsigned i) const
Definition: ExprCXX.h:2880
bool isArrow() const
Determine whether this pseudo-destructor expression was written using an '->' (otherwise, it used a '.
Definition: ExprCXX.h:2112
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:2508
SourceLocation getLocation() const
Definition: Expr.h:1175
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:994
SourceLocation getDefaultLoc() const
Definition: Expr.h:4456
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:954
ExpressionTrait getTrait() const
Definition: ExprCXX.h:2381
SourceLocation getSwitchLoc() const
Definition: Stmt.h:985
Represents the this expression in C++.
Definition: ExprCXX.h:860
bool hadMultipleCandidates() const
Whether the referred constructor was resolved from an overloaded set having size greater than 1...
Definition: ExprCXX.h:1223
Expr * getCond() const
Definition: StmtOpenMP.h:585
arg_iterator arg_end()
Definition: Expr.h:2230
MSPropertyDecl * getPropertyDecl() const
Definition: ExprCXX.h:693
ObjCIvarDecl * getDecl()
Definition: ExprObjC.h:505
OpenMPDefaultClauseKind getDefaultKind() const
Returns kind of the clause.
Definition: OpenMPClause.h:558
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
Definition: Expr.h:3503
SourceLocation getBuiltinLoc() const
Definition: Expr.h:3662
unsigned RecordSwitchCaseID(SwitchCase *S)
Record an ID for the given switch-case statement.
Expr * getRHS() const
Definition: Expr.h:3194
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:2486
OpenMPDependClauseKind getDependencyKind() const
Get dependency type.
ArrayRef< Expr * > private_counters()
Definition: StmtOpenMP.h:663
OpenMP 4.0 [2.4, Array Sections].
Definition: ExprOpenMP.h:45
FunctionDecl * getOperatorDelete() const
Definition: ExprCXX.h:1972
SourceLocation getColonColonLoc() const
Retrieve the location of the '::' in a qualified pseudo-destructor expression.
Definition: ExprCXX.h:2130
void AddNestedNameSpecifierLoc(NestedNameSpecifierLoc NNS, RecordDataImpl &Record)
Emit a nested name specifier with source-location information.
Definition: ASTWriter.cpp:5195
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:3148
unsigned getNumDecls() const
Gets the number of declarations in the unresolved set.
Definition: ExprCXX.h:2500
SourceLocation getTryLoc() const
Definition: StmtCXX.h:91
OpenMPDirectiveKind getCancelRegion() const
Get cancellation region for the current cancellation point.
Definition: StmtOpenMP.h:2151
Expr * getLHS() const
Definition: Expr.h:3572
llvm::APInt getValue() const
Definition: Expr.h:1234
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition: ExprCXX.h:2048
SourceLocation getMemberLoc() const
Definition: ExprCXX.h:695
SourceLocation getTokenLocation() const
getTokenLocation - The location of the __null token.
Definition: Expr.h:3616
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
Definition: ExprCXX.h:3403
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:539
SourceLocation getAsmLoc() const
Definition: Stmt.h:1421
This represents 'threads' clause in the '#pragma omp ...' directive.
StringRef getAsmString() const
Definition: Stmt.h:1757
Expr ** getSubExprs()
Definition: Expr.h:4887
This represents '#pragma omp taskgroup' directive.
Definition: StmtOpenMP.h:1640
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
Definition: ExprCXX.h:2236
SourceLocation getDefaultKindKwLoc() const
Returns location of clause kind.
Definition: OpenMPClause.h:561
unsigned getNumObjects() const
Definition: ExprCXX.h:2878
const Expr * getControllingExpr() const
Definition: Expr.h:4476
OMPClauseWriter(ASTStmtWriter *W, ASTWriter::RecordData &Record)
This represents clause 'aligned' in the '#pragma omp ...' directives.
unsigned getNumExpansions() const
Get the number of parameters in this parameter pack.
Definition: ExprCXX.h:3827
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprObjC.h:169
Expr * getQueriedExpression() const
Definition: ExprCXX.h:2383
NestedNameSpecifierLoc getQualifierLoc() const
Definition: ExprCXX.h:696
Stmt * getHandler() const
Definition: Stmt.h:1933
unsigned getCharacterLiteralAbbrev() const
Definition: ASTWriter.h:847
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
Definition: Expr.h:1960
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:1910
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:188
const SmallVectorImpl< AnnotatedLine * >::const_iterator End
Represents a call to the builtin function __builtin_va_arg.
Definition: Expr.h:3633
bool HasTemplateKWAndArgsInfo
Whether the name includes info for explicit template keyword and arguments.
Definition: ExprCXX.h:2419
Expr * getCond() const
Definition: Expr.h:3182
FunctionDecl * getOperatorDelete() const
Definition: ExprCXX.h:1810
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:3151
SourceLocation getOpLoc() const
Definition: ExprObjC.h:526
NameKind getNameKind() const
getNameKind - Determine what kind of name this is.
static unsigned getNumSubExprs(AtomicOp Op)
Determine the number of arguments the specified atomic builtin should have.
Definition: Expr.cpp:3967
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called...
Definition: ExprCXX.h:1239
This represents '#pragma omp distribute' directive.
Definition: StmtOpenMP.h:2361
This represents implicit clause 'depend' for the '#pragma omp task' directive.
const ObjCMethodDecl * getMethodDecl() const
Definition: ExprObjC.h:1251
designators_iterator designators_begin()
Definition: Expr.h:4137
LabelDecl * getDecl() const
Definition: Stmt.h:794
OMPClause * getClause(unsigned i) const
Returns specified clause.
Definition: StmtOpenMP.h:191
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type...
Definition: ExprCXX.h:1683
SourceLocation getLParenLoc() const
Returns the location of '('.
Definition: OpenMPClause.h:433
SourceLocation getColonLoc() const
Gets location of ':' symbol in clause.
IdentifierInfo * getInputIdentifier(unsigned i) const
Definition: Stmt.h:1661
This represents 'proc_bind' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:581
This represents 'capture' clause in the '#pragma omp atomic' directive.
Expr - This represents one expression.
Definition: Expr.h:104
SourceLocation getRParenLoc() const
Definition: Expr.h:2030
SourceLocation getMapLoc() const LLVM_READONLY
Fetches location of clause mapping kind.
SourceLocation getRParenLoc() const
Definition: Expr.h:4457
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:2518
This represents 'simdlen' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:402
decls_iterator decls_end() const
Definition: ExprCXX.h:2492
SourceLocation getScheduleKindLoc()
Get kind location.
Definition: OpenMPClause.h:802
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
Definition: ExprCXX.h:1227
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "while" statement, if any.
Definition: Stmt.cpp:860
SourceLocation getLocation() const
Retrieve the location of this expression.
Definition: Expr.h:867
TypeSourceInfo * getTypeSourceInfo() const
getTypeSourceInfo - Return the destination type.
Definition: Expr.h:3492
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1495
Expr * getCondition() const
Returns condition.
Definition: OpenMPClause.h:271
Represents a C++ functional cast expression that builds a temporary object.
Definition: ExprCXX.h:1374
unsigned getExprImplicitCastAbbrev() const
Definition: ASTWriter.h:849
SourceLocation getLBraceLoc() const
Definition: Expr.h:3851
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:970
SourceLocation getRParenLoc() const
Definition: StmtObjC.h:55
A C++ const_cast expression (C++ [expr.const.cast]).
Definition: ExprCXX.h:356
unsigned getNumExpressions() const
Definition: Expr.h:1938
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:4580
Field designator where only the field name is known.
Definition: ASTBitCodes.h:1468
Expr * getIterationVariable() const
Definition: StmtOpenMP.h:569
SourceLocation getGotoLoc() const
Definition: Stmt.h:1216
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source location information.
Definition: ExprCXX.h:2756
ObjCMethodDecl * getImplicitPropertyGetter() const
Definition: ExprObjC.h:638
raw_arg_iterator raw_arg_end()
Definition: ExprCXX.h:1896
SourceLocation getLocation() const
Definition: ExprCXX.h:1214
SourceLocation getEqualOrColonLoc() const
Retrieve the location of the '=' that precedes the initializer value itself, if present.
Definition: Expr.h:4188
Stmt * getBody()
Definition: Stmt.h:1056
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
Definition: ExprObjC.h:257
Expr * getRHS()
Definition: Stmt.h:703
ConstructionKind getConstructionKind() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
Definition: ExprCXX.h:1246
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:1303
A CXXStdInitializerListExpr record.
Definition: ASTBitCodes.h:1369
SourceLocation getLParenLoc() const
Returns the location of '('.
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:3555
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:4622
An ArraySubscriptExpr record.
Definition: ASTBitCodes.h:1239
OpenMPDirectiveKind getNameModifier() const
Return directive name modifier associated with the clause.
Definition: OpenMPClause.h:215
void AddString(StringRef Str, RecordDataImpl &Record)
Add a string to the given record.
Definition: ASTWriter.cpp:3964
This represents 'ordered' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:852
Selector getSelector() const
Definition: ExprObjC.h:409
A PseudoObjectExpr record.
Definition: ASTBitCodes.h:1287
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c array literal.
Definition: ExprObjC.h:184
NonTypeTemplateParmDecl * getParameterPack() const
Retrieve the non-type template parameter pack being substituted.
Definition: ExprCXX.h:3750
SourceRange getAngleBrackets() const LLVM_READONLY
Definition: ExprCXX.h:219
SourceLocation getEndLoc() const
Definition: Stmt.h:458
const SwitchCase * getSwitchCaseList() const
Definition: Stmt.h:974
void AddCXXBaseSpecifier(const CXXBaseSpecifier &Base, RecordDataImpl &Record)
Emit a C++ base specifier.
Definition: ASTWriter.cpp:5387
SourceLocation getQuestionLoc() const
Definition: Expr.h:3137
SourceLocation getLocation() const
Definition: ExprObjC.h:689
Expr * getSubExpr() const
Definition: Expr.h:1681
capture_init_range capture_inits()
Definition: Stmt.h:2148
This represents '#pragma omp for' directive.
Definition: StmtOpenMP.h:773
An ObjCIndirectCopyRestoreExpr record.
Definition: ASTBitCodes.h:1320
SourceLocation getLabelLoc() const
Definition: Stmt.h:1218
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:210
SourceLocation getLParenLoc() const
Returns the location of '('.
Definition: OpenMPClause.h:207
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:3898
Represents a folding of a pack over an operator.
Definition: ExprCXX.h:3967
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
Definition: Stmt.h:1344
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition: Expr.h:3489
Expr * getIsLastIterVariable() const
Definition: StmtOpenMP.h:597
An expression that sends a message to the given Objective-C object or class.
Definition: ExprObjC.h:860
unsigned getNumComponents() const
Definition: Expr.h:1919
This represents a Microsoft inline-assembly statement extension.
Definition: Stmt.h:1722
CXXBaseSpecifier * getBase() const
For a base class node, returns the base specifier.
Definition: Expr.h:1830
A DesignatedInitUpdateExpr record.
Definition: ASTBitCodes.h:1263
UnaryOperator - This represents the unary-expression's (except sizeof and alignof), the postinc/postdec operators from postfix-expression, and various extensions.
Definition: Expr.h:1654
Expr * getInputExpr(unsigned i)
Definition: Stmt.cpp:673
Expr * getOutputExpr(unsigned i)
Definition: Stmt.cpp:669
Expr * getCond() const
Definition: Expr.h:3570
A member reference to an MSPropertyDecl.
Definition: ExprCXX.h:647
Expr * getNextUpperBound() const
Definition: StmtOpenMP.h:639
DeclarationName getDeclName() const
getDeclName - Get the actual, stored name of the declaration, which may be a special name...
Definition: Decl.h:190
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition: ExprCXX.h:3669
Expr * getDevice()
Return device number.
This represents '#pragma omp cancel' directive.
Definition: StmtOpenMP.h:2165
SourceLocation getLParenLoc() const
Returns the location of '('.
This represents 'collapse' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:457
SourceLocation getKeywordLoc() const
Retrieve the location of the __if_exists or __if_not_exists keyword.
Definition: StmtCXX.h:257
This represents clause 'firstprivate' in the '#pragma omp ...' directives.
ValueDecl * getDecl()
Definition: Expr.h:1007
QualType getComputationLHSType() const
Definition: Expr.h:3093
SourceLocation getProcBindKindKwLoc() const
Returns location of clause kind.
Definition: OpenMPClause.h:634
SourceRange getSourceRange() const LLVM_READONLY
Definition: ExprCXX.h:827
unsigned getNumClauses() const
Get number of clauses.
Definition: StmtOpenMP.h:185
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:2812
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:1026
AtomicOp getOp() const
Definition: Expr.h:4884
Expr * getLHS()
An array access can be written A[4] or 4[A] (both are equivalent).
Definition: Expr.h:2082
SourceLocation getLParenLoc() const
Definition: Expr.h:2573
SourceLocation getSemiLoc() const
Definition: Stmt.h:517
APFloatSemantics getRawSemantics() const
Get a raw enumeration value representing the floating-point semantics of this literal (32-bit IEEE...
Definition: Expr.h:1364
helper_expr_const_range privates() const
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1...
Definition: Expr.h:1409
SourceLocation getAtLoc() const
Definition: StmtObjC.h:363
This represents '#pragma omp flush' directive.
Definition: StmtOpenMP.h:1691
An ObjCForCollectionStmt record.
Definition: ASTBitCodes.h:1323
helper_expr_const_range destination_exprs() const
SourceLocation getParameterPackLocation() const
Retrieve the location of the parameter pack name.
Definition: ExprCXX.h:3753
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:4209
This represents '#pragma omp parallel for simd' directive.
Definition: StmtOpenMP.h:1301
InitListExpr * getUpdater() const
Definition: Expr.h:4308
DoStmt - This represents a 'do/while' stmt.
Definition: Stmt.h:1080
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
Definition: Stmt.h:1392
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:934
SourceLocation getLParenLoc() const
Returns the location of '('.
Definition: OpenMPClause.h:322
SourceLocation getLocStart() const
Returns starting location of directive kind.
Definition: StmtOpenMP.h:169
QualType getComputationResultType() const
Definition: Expr.h:3096
A MS-style AsmStmt record.
Definition: ASTBitCodes.h:1213
unsigned getNumSubExprs() const
getNumSubExprs - Return the size of the SubExprs array.
Definition: Expr.h:3434
LabelDecl * getLabel() const
Definition: Stmt.h:1213
void AddSourceLocation(SourceLocation Loc, RecordDataImpl &Record)
Emit a source location.
Definition: ASTWriter.cpp:4742
decls_iterator decls_begin() const
Definition: ExprCXX.h:2491
Expr * getBase() const
Definition: ExprObjC.h:1408
SourceLocation getOperatorLoc() const
Definition: Expr.h:2027
Expr * getArgument()
Definition: ExprCXX.h:1974
SourceLocation getLParenLoc()
Get location of '('.
Definition: OpenMPClause.h:799
bool isArray() const
Definition: ExprCXX.h:1813
bool isArrayForm() const
Definition: ExprCXX.h:1961
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:274
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
Definition: Expr.h:840
SourceLocation getGotoLoc() const
Definition: Stmt.h:1251
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition: Expr.h:3465
const StringLiteral * getAsmString() const
Definition: Stmt.h:1570
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr...
Definition: ExprCXX.h:2402
A field in a dependent type, known only by its name.
Definition: Expr.h:1765
This captures a statement into a function.
Definition: Stmt.h:1984
Token * getAsmToks()
Definition: Stmt.h:1754
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition: Expr.h:4692
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:492
unsigned getResultExprIndex() const
Return the index of the result-bearing expression into the semantics expressions, or PseudoObjectExpr...
Definition: Expr.h:4741
This represents '#pragma omp single' directive.
Definition: StmtOpenMP.h:1045
Encodes a location in the source.
SourceLocation getLeaveLoc() const
Definition: Stmt.h:1959
body_range body()
Definition: Stmt.h:569
This represents 'hint' clause in the '#pragma omp ...' directive.
helper_expr_const_range reduction_ops() const
const TemplateArgument * iterator
Definition: Type.h:4070
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:892
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
Definition: Expr.h:1895
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:267
NonTypeTemplateParmDecl * getParameter() const
Definition: ExprCXX.h:3702
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
Definition: ExprCXX.h:1723
SourceLocation getOperatorLoc() const
Retrieve the location of the '.' or '->' operator.
Definition: ExprCXX.h:2115
Expr * getLHS()
Definition: Stmt.h:702
Expr * getLowerBoundVariable() const
Definition: StmtOpenMP.h:604
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit...
Definition: ExprCXX.h:393
Expr * getCondition() const
Returns condition.
Definition: OpenMPClause.h:213
helper_expr_const_range lhs_exprs() const
This represents 'schedule' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:653
Expr * getExpr()
Get 'expr' part of the associated expression/statement.
Definition: StmtOpenMP.h:1917
Represents a call to a member function that may be written either with member call syntax (e...
Definition: ExprCXX.h:124
unsigned getCollapsedNumber() const
Get number of collapsed loops.
Definition: StmtOpenMP.h:567
SourceLocation getKeywordLoc() const
Definition: Stmt.h:658
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:1127
SourceLocation getRParenLoc() const
Definition: ExprCXX.h:1706
bool isFreeIvar() const
Definition: ExprObjC.h:514
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
Definition: Stmt.h:431
CompoundStmt * getBlock() const
Definition: Stmt.h:1852
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: Expr.h:2473
This represents clause 'shared' in the '#pragma omp ...' directives.
const Expr * getCond() const
Definition: Stmt.h:972
TemplateArgument getArgumentPack() const
Retrieve the template argument pack containing the substituted template arguments.
Definition: ExprCXX.cpp:1402
SourceLocation getIdentLoc() const
Definition: Stmt.h:793
A CXXFunctionalCastExpr record.
Definition: ASTBitCodes.h:1365
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition: Expr.h:4645
SourceLocation getTryLoc() const
Definition: Stmt.h:1924
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
An ObjCEncodeExpr record.
Definition: ASTBitCodes.h:1302
SourceLocation getGenericLoc() const
Definition: Expr.h:4455
SourceLocation getAtLoc() const
Definition: ExprObjC.h:457
This represents '#pragma omp taskwait' directive.
Definition: StmtOpenMP.h:1596
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:1249
SourceLocation getStrTokenLoc(unsigned TokNum) const
Definition: Expr.h:1562
This is a basic class for representing single OpenMP clause.
Definition: OpenMPClause.h:32
bool getValue() const
Definition: ExprCXX.h:2385
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:4817
unsigned getIntegerLiteralAbbrev() const
Definition: ASTWriter.h:848
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition: ExprObjC.h:441
SourceLocation getContinueLoc() const
Definition: Stmt.h:1288
QualType getBaseType() const
Definition: ExprCXX.h:3120
StringLiteral * getFunctionName()
Definition: Expr.cpp:446
SourceLocation getOperatorLoc() const
Retrieve the location of the cast operator keyword, e.g., static_cast.
Definition: ExprCXX.h:212
An ObjCIsa Expr record.
Definition: ASTBitCodes.h:1318
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "switch" statement, if any.
Definition: Stmt.cpp:826
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:2712
capture_iterator capture_end() const
Retrieve an iterator pointing past the end of the sequence of captures.
Definition: Stmt.h:2131
Stmt * getCapturedStmt()
Retrieve the statement being captured.
Definition: Stmt.h:2084
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:3815
SourceLocation getLParenLoc() const
Returns the location of '('.
This represents '#pragma omp target' directive.
Definition: StmtOpenMP.h:1935
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:164
Expr * getUpperBoundVariable() const
Definition: StmtOpenMP.h:611
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:1005
Expr * getV()
Get 'v' part of the associated expression/statement.
Definition: StmtOpenMP.h:1912
void AddDeclRef(const Decl *D, RecordDataImpl &Record)
Emit a reference to a declaration.
Definition: ASTWriter.cpp:4955
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '...
Definition: ExprCXX.h:3353
StringRef getOutputConstraint(unsigned i) const
Definition: Stmt.h:1764
Expr * getSubExpr()
Definition: ExprObjC.h:108
An expression trait intrinsic.
Definition: ExprCXX.h:2347
StringRef getClobber(unsigned i) const
Definition: Stmt.h:1802
An AtomicExpr record.
Definition: ASTBitCodes.h:1289
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition: ExprCXX.h:604
SourceLocation getAtSynchronizedLoc() const
Definition: StmtObjC.h:279
uint64_t getValue() const
Definition: ExprCXX.h:2324
This represents '#pragma omp ordered' directive.
Definition: StmtOpenMP.h:1746
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition: Expr.h:3358
const Expr * getBase() const
Definition: Expr.h:4540
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:3809
const BlockDecl * getBlockDecl() const
Definition: Expr.h:4594
bool isObjectReceiver() const
Definition: ExprObjC.h:699
iterator end() const
Definition: ExprCXX.h:3824
SourceLocation getForLoc() const
Definition: StmtCXX.h:188
SourceLocation getRParenLoc() const
Definition: Expr.h:3580
Opcode getOpcode() const
Definition: Expr.h:1678
Representation of a Microsoft __if_exists or __if_not_exists statement with a dependent name...
Definition: StmtCXX.h:235
const OffsetOfNode & getComponent(unsigned Idx) const
Definition: Expr.h:1909
Expr * getPreCond() const
Definition: StmtOpenMP.h:581
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
SourceLocation getNameLoc() const
Definition: ExprCXX.h:3696
void VisitStmt(Stmt *S)
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
Definition: Expr.h:1685
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:2706
Expr * Value
The value of the dictionary element.
Definition: ExprObjC.h:217
SourceLocation getRBracketLoc() const
Definition: ExprCXX.h:747
SourceLocation getRBracketLoc() const
Definition: Expr.h:2111
void AddTemplateKWAndArgsInfo(const ASTTemplateKWAndArgsInfo &ArgInfo, const TemplateArgumentLoc *Args)
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:3070
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof...
Definition: ExprCXX.h:3643
A POD class for pairing a NamedDecl* with an access specifier.
Represents a C11 generic selection.
Definition: Expr.h:4426
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:2488
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition: Expr.h:3317
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:125
SourceLocation getEllipsisLoc() const
Retrieve the location of the ellipsis that describes this pack expansion.
Definition: ExprCXX.h:3519
Represents a reference to a function parameter pack that has been substituted but not yet expanded...
Definition: ExprCXX.h:3786
void AddDeclarationNameLoc(const DeclarationNameLoc &DNLoc, DeclarationName Name, RecordDataImpl &Record)
Definition: ASTWriter.cpp:5100
SourceLocation getLocation() const
Definition: Expr.h:1316
arg_iterator arg_end()
Definition: ExprObjC.h:1366
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "if" statement, if any.
Definition: Stmt.cpp:769
Expr * getCommon() const
getCommon - Return the common expression, written to the left of the condition.
Definition: Expr.h:3258
NullStmt - This is the null statement ";": C99 6.8.3p3.
Definition: Stmt.h:499
const Expr * getSubExpr() const
Definition: ExprCXX.h:920
bool isImplicitProperty() const
Definition: ExprObjC.h:630
void writeClause(OMPClause *C)
SourceLocation getLParenLoc() const
Definition: Expr.h:2838
This represents 'device' clause in the '#pragma omp ...' directive.
const Expr * getAssocExpr(unsigned i) const
Definition: Expr.h:4459
helper_expr_const_range rhs_exprs() const
An InitListExpr record.
Definition: ASTBitCodes.h:1259
bool hadMultipleCandidates() const
Returns true if this expression refers to a function that was resolved from an overloaded set having ...
Definition: Expr.h:1115
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:1146
unsigned getByteLength() const
Definition: Expr.h:1532
A CXXBoolLiteralExpr record.
Definition: ASTBitCodes.h:1371
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
Definition: ExprCXX.h:1927
SourceLocation getStarLoc() const
Definition: Stmt.h:1253
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition: ExprCXX.h:803
SourceLocation getOpLoc() const
Definition: ExprObjC.h:1418
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:1030
const Stmt * getBody() const
Definition: Stmt.h:973
An ExtVectorElementExpr record.
Definition: ASTBitCodes.h:1257
NestedNameSpecifierLoc getQualifierLoc() const
Retrieves the nested-name-specifier that qualifies the type name, with source-location information...
Definition: ExprCXX.h:2101
This represents '#pragma omp section' directive.
Definition: StmtOpenMP.h:983
bool isThrownVariableInScope() const
Determines whether the variable thrown by this expression (if any!) is within the innermost try block...
Definition: ExprCXX.h:930
NestedNameSpecifierLoc getQualifierLoc() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name...
Definition: Expr.h:2412
ExprIterator arg_iterator
Definition: ExprCXX.h:1870
SourceLocation getLParenLoc() const
Definition: ExprCXX.h:1343
SourceLocation EllipsisLoc
The location of the ellipsis, if this is a pack expansion.
Definition: ExprObjC.h:220
designators_iterator designators_end()
Definition: Expr.h:4138
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
Definition: ExprCXX.h:316
This represents '#pragma omp simd' directive.
Definition: StmtOpenMP.h:708
SourceLocation getTildeLoc() const
Retrieve the location of the '~'.
Definition: ExprCXX.h:2133
Represents a 'co_yield' expression.
Definition: ExprCXX.h:4130
An ObjCAutoreleasePoolStmt record.
Definition: ASTBitCodes.h:1335
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:1646
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition: ExprCXX.h:3483
unsigned getNumPlacementArgs() const
Definition: ExprCXX.h:1821
A CXXDynamicCastExpr record.
Definition: ASTBitCodes.h:1359
StringRef getBytes() const
Allow access to clients that need the byte representation, such as ASTWriterStmt::VisitStringLiteral(...
Definition: Expr.h:1508
SourceLocation getWhileLoc() const
Definition: Stmt.h:1107
This represents clause 'linear' in the '#pragma omp ...' directives.
DeclarationNameInfo getDirectiveName() const
Return name of the directive.
Definition: StmtOpenMP.h:1205
StringKind getKind() const
Definition: Expr.h:1540
bool isTypeOperand() const
Definition: ExprCXX.h:796
ObjCMethodDecl * getArrayWithObjectsMethod() const
Definition: ExprObjC.h:196
Expr * getEnsureUpperBound() const
Definition: StmtOpenMP.h:625
detail::InMemoryDirectory::const_iterator E
Expr * getUpdateExpr()
Get helper expression of the form 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' or 'OpaqueValueExp...
Definition: StmtOpenMP.h:1898
bool usesGNUSyntax() const
Determines whether this designated initializer used the deprecated GNU syntax for designated initiali...
Definition: Expr.h:4193
semantics_iterator semantics_begin()
Definition: Expr.h:4760
const Expr * getRetValue() const
Definition: Stmt.cpp:888
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition: Expr.h:2187
SourceLocation getLocation() const
Definition: ExprCXX.h:876
ExplicitCastExpr - An explicit cast written in the source code.
Definition: Expr.h:2778
unsigned getNumArgs() const
Definition: ExprCXX.h:1272
unsigned getNumConcatenated() const
getNumConcatenated - Get the number of string literal tokens that were concatenated in translation ph...
Definition: Expr.h:1560
This represents '#pragma omp atomic' directive.
Definition: StmtOpenMP.h:1801
SourceLocation getParameterPackLocation() const
Get the location of the parameter pack.
Definition: ExprCXX.h:3818
Expr * getBaseExpr() const
Definition: ExprObjC.h:807
CXXRecordDecl * getNamingClass() const
Gets the 'naming class' (in the sense of C++0x [class.access.base]p5) of the lookup.
Definition: ExprCXX.h:2670
An ObjCAtFinallyStmt record.
Definition: ASTBitCodes.h:1327
Expr * getCalcLastIteration() const
Definition: StmtOpenMP.h:577
ObjCMethodDecl * getDictWithObjectsMethod() const
Definition: ExprObjC.h:323
llvm::APFloat getValue() const
Definition: Expr.h:1354
Represents a __leave statement.
Definition: Stmt.h:1950
const Stmt * getThen() const
Definition: Stmt.h:903
ArrayRef< Expr * > counters()
Definition: StmtOpenMP.h:657
path_iterator path_end()
Definition: Expr.h:2679
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition: ExprCXX.h:3428
SourceLocation getMemberLoc() const
getMemberLoc - Return the location of the "member", in X->F, it is the location of 'F'...
Definition: Expr.h:2493
bool hasQualifier() const
Determine whether this declaration reference was preceded by a C++ nested-name-specifier, e.g., N::foo.
Definition: Expr.h:1022
SwitchStmt - This represents a 'switch' stmt.
Definition: Stmt.h:938
SourceLocation getAtCatchLoc() const
Definition: StmtObjC.h:102
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
Definition: Expr.h:4651
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:381
Represents the body of a coroutine.
Definition: StmtCXX.h:294
SourceLocation getLeftLoc() const
Definition: ExprObjC.h:1310
TemplateArgumentLoc * getTrailingTemplateArgumentLoc()
Return the optional template arguments.
Definition: ExprCXX.h:3415
Location wrapper for a TemplateArgument.
Definition: TemplateBase.h:421
Expr * getRHS() const
Definition: Expr.h:3574
Expr * getBase() const
Retrieve the base object of this member expressions, e.g., the x in x.m.
Definition: ExprCXX.h:3115
SourceLocation getOperatorLoc() const
Retrieve the location of the '->' or '.' operator.
Definition: ExprCXX.h:3127
FunctionDecl * getOperatorNew() const
Definition: ExprCXX.h:1808
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition: Expr.h:2049
DeclStmt * getBeginEndStmt()
Definition: StmtCXX.h:155
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:3261
An ObjCAtSynchronizedStmt record.
Definition: ASTBitCodes.h:1331
SourceLocation getBridgeKeywordLoc() const
The location of the bridge keyword.
Definition: ExprObjC.h:1554
arg_iterator arg_begin()
Definition: Expr.h:2229
ArrayRef< Expr * > inits()
Definition: StmtOpenMP.h:669
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:355
SourceLocation getLParenLoc() const
Returns the location of '('.
Definition: OpenMPClause.h:555
SourceLocation getBuiltinLoc() const
Definition: Expr.h:3577
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:1768
SourceLocation getLParenLoc() const
Returns the location of '('.
Definition: OpenMPClause.h:489
Represents a call to a CUDA kernel function.
Definition: ExprCXX.h:155
Represents a 'co_await' expression.
Definition: ExprCXX.h:4107
TypeSourceInfo * getWrittenTypeInfo() const
Definition: Expr.h:3659
A CXXMemberCallExpr record.
Definition: ASTBitCodes.h:1351
Expr * getArg(unsigned Arg)
Return the specified argument.
Definition: ExprCXX.h:1275
CXXConstructorDecl * getConstructor() const
Definition: ExprCXX.h:1211
Expr * getExprOperand() const
Definition: ExprCXX.h:813
bool isVolatile() const
Definition: Stmt.h:1427
Represents Objective-C's @finally statement.
Definition: StmtObjC.h:120
const Expr * getSubExpr() const
Definition: Expr.h:1421
SourceLocation getRParenLoc() const
Retrieve the location of the right parentheses (')') that follows the argument list.
Definition: ExprCXX.h:2978
QualType getSuperReceiverType() const
Definition: ExprObjC.h:692
ExprIterator arg_iterator
Definition: Expr.h:2219
SourceLocation getRParenLoc() const
Definition: ExprCXX.h:1345
SourceLocation getBuiltinLoc() const
getBuiltinLoc - Return the location of the __builtin_convertvector token.
Definition: Expr.h:3500
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:3339
SourceLocation getAccessorLoc() const
Definition: Expr.h:4547
Represents a base class of a C++ class.
Definition: DeclCXX.h:157
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:2566
SourceRange getDirectInitRange() const
Definition: ExprCXX.h:1907
SourceLocation getRParenLoc() const
Definition: Expr.h:2841
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:479
SourceLocation getForLoc() const
Definition: Stmt.h:1178
SourceLocation getLocation() const
Definition: ExprCXX.h:503
DeclStmt * getRangeStmt()
Definition: StmtCXX.h:154
A ConvertVectorExpr record.
Definition: ASTBitCodes.h:1281
bool hasAssociatedStmt() const
Returns true if directive has associated statement.
Definition: StmtOpenMP.h:194
Expr * getFalseExpr() const
getFalseExpr - Return the subexpression which will be evaluated if the condnition evaluates to false;...
Definition: Expr.h:3277
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:2927
GotoStmt - This represents a direct goto.
Definition: Stmt.h:1202
ArrayRef< const Attr * > getAttrs() const
Definition: Stmt.h:850
A use of a default initializer in a constructor or in aggregate initialization.
Definition: ExprCXX.h:1024
Expr * getTarget()
Definition: Stmt.h:1255
Expr * getBase() const
Definition: Expr.h:2387
SourceLocation getColonLoc() const
Definition: Stmt.h:660
SourceLocation getAttrLoc() const
Definition: Stmt.h:849
SourceLocation getLParenLoc() const
Returns the location of '('.
Definition: OpenMPClause.h:378
CapturedDecl * getCapturedDecl()
Retrieve the outlined function declaration.
Definition: Stmt.cpp:1074
Expr * getCond()
Definition: Stmt.h:1098
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:1674
ASTStmtWriter(ASTWriter &Writer, ASTWriter::RecordData &Record)
bool isArrayFormAsWritten() const
Definition: ExprCXX.h:1962
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition: Expr.h:2297
GNU array range designator.
Definition: ASTBitCodes.h:1475
OverloadedOperatorKind getOperator() const
Returns the kind of overloaded operator that this expression refers to.
Definition: ExprCXX.h:80
Expr * getNextLowerBound() const
Definition: StmtOpenMP.h:632
SourceLocation getFinallyLoc() const
Definition: Stmt.h:1885
const Expr * getSubExpr() const
Definition: Expr.h:1621
void AddStmt(Stmt *S)
Add the given statement or expression to the queue of statements to emit.
Definition: ASTWriter.h:798
A GCC-style AsmStmt record.
Definition: ASTBitCodes.h:1211
SourceLocation getBuiltinLoc() const
Definition: Expr.h:4900
SourceLocation getRParenLoc() const
Retrieve the location of the closing parenthesis.
Definition: ExprCXX.h:215
This represents 'nowait' clause in the '#pragma omp ...' directive.
Definition: OpenMPClause.h:903
void FlushStmts()
Flush all of the statements and expressions that have been added to the queue via AddStmt()...
ContinueStmt - This represents a continue.
Definition: Stmt.h:1280
SourceLocation getRParenLoc() const
Definition: Stmt.h:1182
This represents 'num_tasks' clause in the '#pragma omp ...' directive.
bool isGlobalNew() const
Definition: ExprCXX.h:1838
Opcode getOpcode() const
Definition: Expr.h:2918
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition: Expr.h:3525
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Definition: Expr.h:3218
SourceLocation getBreakLoc() const
Definition: Stmt.h:1318
CXXCatchStmt - This represents a C++ catch block.
Definition: StmtCXX.h:29
SourceLocation getBuiltinLoc() const
Definition: Expr.h:3418
An index into an array.
Definition: Expr.h:1761
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr.type.conv]).
Definition: ExprCXX.h:1315
bool hasQualifier() const
Determines whether this member expression actually had a C++ nested-name-specifier prior to the name ...
Definition: Expr.h:2407
An ObjCAtCatchStmt record.
Definition: ASTBitCodes.h:1325
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
Definition: ExprCXX.h:1866
WhileStmt - This represents a 'while' stmt.
Definition: Stmt.h:1025
Field designator where the field has been resolved to a declaration.
Definition: ASTBitCodes.h:1471
const Expr * getCond() const
Definition: Stmt.h:901
FieldDecl * getField() const
For a field offsetof node, returns the field.
Definition: Expr.h:1820
SourceLocation getElseLoc() const
Definition: Stmt.h:914
TypeSourceInfo * getQueriedTypeSourceInfo() const
Definition: ExprCXX.h:2322
helper_expr_const_range assignment_ops() const
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
The receiver is a class.
Definition: ExprObjC.h:1003
Represents Objective-C's @try ... @catch ... @finally statement.
Definition: StmtObjC.h:154
bool isSimple() const
Definition: Stmt.h:1424
This represents '#pragma omp taskloop simd' directive.
Definition: StmtOpenMP.h:2295
const Expr * getThrowExpr() const
Definition: StmtObjC.h:325
bool hasTemplateKWAndArgsInfo() const
Definition: Expr.h:1054
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:1452
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2134
Expr * getRHS() const
Definition: Expr.h:2923
bool isExact() const
Definition: Expr.h:1380
Expr * getPattern()
Retrieve the pattern of the pack expansion.
Definition: ExprCXX.h:3512
Expr * getHelperChunkSize()
Get helper chunk size.
Definition: OpenMPClause.h:826
bool isIfExists() const
Determine whether this is an __if_exists statement.
Definition: StmtCXX.h:260
SourceLocation getRBracLoc() const
Definition: Stmt.h:618
SourceLocation getColonLoc() const
Definition: StmtCXX.h:190
bool hasCancel() const
Return true if current directive has inner cancel directive.
Definition: StmtOpenMP.h:284
Abstract class common to all of the C++ "named"/"keyword" casts.
Definition: ExprCXX.h:187
bool isMicrosoftABI() const
Returns whether this is really a Win64 ABI va_arg expression.
Definition: Expr.h:3656
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
Definition: ExprCXX.h:1234
This represents '#pragma omp sections' directive.
Definition: StmtOpenMP.h:915
Expr * getBase() const
Definition: Expr.h:4305
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:1993
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument for this lambda expression...
Definition: ExprCXX.h:1607
VarDecl * getExceptionDecl() const
Definition: StmtCXX.h:50
capture_range captures()
Definition: Stmt.h:2118
A reference to a declared variable, function, enum, etc.
Definition: Expr.h:922
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
Definition: Expr.h:400
SourceLocation getLParenLoc() const
Returns the location of '('.
BreakStmt - This represents a break.
Definition: Stmt.h:1306
Expr * getLastIteration() const
Definition: StmtOpenMP.h:573
SourceLocation getColonLoc() const
Definition: ExprOpenMP.h:109
Expr * getChunkSize()
Get chunk size.
Definition: OpenMPClause.h:818
const Expr * getInit(unsigned Init) const
Definition: Expr.h:3763
const Expr * getSubExpr() const
Definition: ExprCXX.h:1130
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
Definition: Expr.h:3827
TypeSourceInfo * getAllocatedTypeSourceInfo() const
Definition: ExprCXX.h:1787
Stmt * getSubStmt()
Definition: Stmt.h:797
DeclStmt * getLoopVarStmt()
Definition: StmtCXX.h:160
unsigned getNumClobbers() const
Definition: Stmt.h:1472
Expr * getTrueExpr() const
getTrueExpr - Return the subexpression which will be evaluated if the condition evaluates to true; th...
Definition: Expr.h:3270
SourceLocation getRParenLoc() const
Definition: StmtCXX.h:191
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:1508
SourceLocation getRParenLoc() const
Definition: Expr.h:4901
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition: ExprCXX.h:455
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type, member-designator).
Definition: Expr.h:1860
CompoundStmt * getTryBlock() const
Definition: Stmt.h:1929
This represents '#pragma omp parallel sections' directive.
Definition: StmtOpenMP.h:1369
bool isArrow() const
Definition: ExprCXX.h:694
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
Definition: ExprCXX.h:768
SourceLocation getStartLoc() const
Definition: Stmt.h:456
const CallExpr * getConfig() const
Definition: ExprCXX.h:170
SourceLocation getLocation() const
Definition: Expr.h:1388
SourceLocation getLocEnd() const
Returns ending location of directive.
Definition: StmtOpenMP.h:171
bool isTypeOperand() const
Definition: ExprCXX.h:597
Expr * getInit() const
Definition: StmtOpenMP.h:589
The receiver is a superclass.
Definition: ExprObjC.h:1007
Stmt * getAssociatedStmt() const
Returns statement associated with the directive.
Definition: StmtOpenMP.h:197
SourceLocation getExceptLoc() const
Definition: Stmt.h:1845
SourceLocation getNameModifierLoc() const
Return the location of directive name modifier.
Definition: OpenMPClause.h:218
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:3124
unsigned varlist_size() const
Definition: OpenMPClause.h:116
StmtCode
Record codes for each kind of statement or expression.
Definition: ASTBitCodes.h:1166
This class handles loading and caching of source files into memory.
Stmt * getSubStmt()
Definition: Stmt.h:853
Represents an implicitly-generated value initialization of an object of a given type.
Definition: Expr.h:4328
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:1285
SourceLocation getRParenLoc() const
Definition: ExprObjC.h:373
SourceLocation getRParenLoc() const
Definition: Expr.h:3421
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:1810
helper_expr_const_range assignment_ops() const
SourceLocation getColonLoc() const
Definition: Expr.h:3138
Expr * getStrideVariable() const
Definition: StmtOpenMP.h:618
bool isArrow() const
Definition: ExprObjC.h:513
void AddAPFloat(const llvm::APFloat &Value, RecordDataImpl &Record)
Emit a floating-point value.
Definition: ASTWriter.cpp:4762
DeclAccessPair getFoundDecl() const
Retrieves the declaration found by lookup.
Definition: Expr.h:2397
bool hasUnresolvedUsing() const
Determine whether the lookup results contain an unresolved using declaration.
Definition: ExprCXX.h:3349
Expr * getBase()
An array section can be written only as Base[LowerBound:Length].
Definition: ExprOpenMP.h:82
TypeSourceInfo * getArgumentTypeInfo() const
Definition: Expr.h:2000
helper_expr_const_range source_exprs() const
Stmt * getSubStmt()
Definition: Stmt.h:704
This represents '#pragma omp taskloop' directive.
Definition: StmtOpenMP.h:2230