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