clang 23.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/AST/TypeBase.h"
24#include "llvm/Bitstream/BitstreamWriter.h"
25using namespace clang;
26
27//===----------------------------------------------------------------------===//
28// Statement/expression serialization
29//===----------------------------------------------------------------------===//
30
31namespace clang {
32
33 class ASTStmtWriter : public StmtVisitor<ASTStmtWriter, void> {
34 ASTWriter &Writer;
35 ASTRecordWriter Record;
36
38 unsigned AbbrevToUse;
39
40 /// A helper that can help us to write a packed bit across function
41 /// calls. For example, we may write separate bits in separate functions:
42 ///
43 /// void VisitA(A* a) {
44 /// Record.push_back(a->isSomething());
45 /// }
46 ///
47 /// void Visitb(B *b) {
48 /// VisitA(b);
49 /// Record.push_back(b->isAnother());
50 /// }
51 ///
52 /// In such cases, it'll be better if we can pack these 2 bits. We achieve
53 /// this by writing a zero value in `VisitA` and recorded that first and add
54 /// the new bit to the recorded value.
55 class PakedBitsWriter {
56 public:
57 PakedBitsWriter(ASTRecordWriter &Record) : RecordRef(Record) {}
58 ~PakedBitsWriter() { assert(!CurrentIndex); }
59
60 void addBit(bool Value) {
61 assert(CurrentIndex && "Writing Bits without recording first!");
62 PackingBits.addBit(Value);
63 }
64 void addBits(uint32_t Value, uint32_t BitsWidth) {
65 assert(CurrentIndex && "Writing Bits without recording first!");
66 PackingBits.addBits(Value, BitsWidth);
67 }
68
69 void writeBits() {
70 if (!CurrentIndex)
71 return;
72
73 RecordRef[*CurrentIndex] = (uint32_t)PackingBits;
74 CurrentIndex = std::nullopt;
75 PackingBits.reset(0);
76 }
77
78 void updateBits() {
79 writeBits();
80
81 CurrentIndex = RecordRef.size();
82 RecordRef.push_back(0);
83 }
84
85 private:
86 BitsPacker PackingBits;
87 ASTRecordWriter &RecordRef;
88 std::optional<unsigned> CurrentIndex;
89 };
90
91 PakedBitsWriter CurrentPackingBits;
92
93 public:
96 : Writer(Writer), Record(Context, Writer, Record),
97 Code(serialization::STMT_NULL_PTR), AbbrevToUse(0),
98 CurrentPackingBits(this->Record) {}
99
100 ASTStmtWriter(const ASTStmtWriter&) = delete;
102
103 uint64_t Emit() {
104 CurrentPackingBits.writeBits();
105 assert(Code != serialization::STMT_NULL_PTR &&
106 "unhandled sub-statement writing AST file");
107 return Record.EmitStmt(Code, AbbrevToUse);
108 }
109
111 const TemplateArgumentLoc *Args);
112
113 void VisitStmt(Stmt *S);
114#define STMT(Type, Base) \
115 void Visit##Type(Type *);
116#include "clang/AST/StmtNodes.inc"
117 };
118}
119
121 const ASTTemplateKWAndArgsInfo &ArgInfo, const TemplateArgumentLoc *Args) {
122 Record.AddSourceLocation(ArgInfo.TemplateKWLoc);
123 Record.AddSourceLocation(ArgInfo.LAngleLoc);
124 Record.AddSourceLocation(ArgInfo.RAngleLoc);
125 for (unsigned i = 0; i != ArgInfo.NumTemplateArgs; ++i)
126 Record.AddTemplateArgumentLoc(Args[i]);
127}
128
131
132void ASTStmtWriter::VisitNullStmt(NullStmt *S) {
133 VisitStmt(S);
134 Record.AddSourceLocation(S->getSemiLoc());
135 Record.push_back(S->NullStmtBits.HasLeadingEmptyMacro);
137}
138
139void ASTStmtWriter::VisitCompoundStmt(CompoundStmt *S) {
140 VisitStmt(S);
141
142 Record.push_back(S->size());
143 Record.push_back(S->hasStoredFPFeatures());
144
145 for (auto *CS : S->body())
146 Record.AddStmt(CS);
147 if (S->hasStoredFPFeatures())
148 Record.push_back(S->getStoredFPFeatures().getAsOpaqueInt());
149 Record.AddSourceLocation(S->getLBracLoc());
150 Record.AddSourceLocation(S->getRBracLoc());
151
152 if (!S->hasStoredFPFeatures())
153 AbbrevToUse = Writer.getCompoundStmtAbbrev();
154
156}
157
158void ASTStmtWriter::VisitSwitchCase(SwitchCase *S) {
159 VisitStmt(S);
160 Record.push_back(Writer.getSwitchCaseID(S));
161 Record.AddSourceLocation(S->getKeywordLoc());
162 Record.AddSourceLocation(S->getColonLoc());
163}
164
165void ASTStmtWriter::VisitCaseStmt(CaseStmt *S) {
166 VisitSwitchCase(S);
167 Record.push_back(S->caseStmtIsGNURange());
168 Record.AddStmt(S->getLHS());
169 Record.AddStmt(S->getSubStmt());
170 if (S->caseStmtIsGNURange()) {
171 Record.AddStmt(S->getRHS());
172 Record.AddSourceLocation(S->getEllipsisLoc());
173 }
175}
176
177void ASTStmtWriter::VisitDefaultStmt(DefaultStmt *S) {
178 VisitSwitchCase(S);
179 Record.AddStmt(S->getSubStmt());
181}
182
183void ASTStmtWriter::VisitLabelStmt(LabelStmt *S) {
184 VisitStmt(S);
185 Record.push_back(S->isSideEntry());
186 Record.AddDeclRef(S->getDecl());
187 Record.AddStmt(S->getSubStmt());
188 Record.AddSourceLocation(S->getIdentLoc());
190}
191
192void ASTStmtWriter::VisitAttributedStmt(AttributedStmt *S) {
193 VisitStmt(S);
194 Record.push_back(S->getAttrs().size());
195 Record.AddAttributes(S->getAttrs());
196 Record.AddStmt(S->getSubStmt());
197 Record.AddSourceLocation(S->getAttrLoc());
199}
200
201void ASTStmtWriter::VisitIfStmt(IfStmt *S) {
202 VisitStmt(S);
203
204 bool HasElse = S->getElse() != nullptr;
205 bool HasVar = S->getConditionVariableDeclStmt() != nullptr;
206 bool HasInit = S->getInit() != nullptr;
207
208 CurrentPackingBits.updateBits();
209
210 CurrentPackingBits.addBit(HasElse);
211 CurrentPackingBits.addBit(HasVar);
212 CurrentPackingBits.addBit(HasInit);
213 Record.push_back(static_cast<uint64_t>(S->getStatementKind()));
214 Record.AddStmt(S->getCond());
215 Record.AddStmt(S->getThen());
216 if (HasElse)
217 Record.AddStmt(S->getElse());
218 if (HasVar)
219 Record.AddStmt(S->getConditionVariableDeclStmt());
220 if (HasInit)
221 Record.AddStmt(S->getInit());
222
223 Record.AddSourceLocation(S->getIfLoc());
224 Record.AddSourceLocation(S->getLParenLoc());
225 Record.AddSourceLocation(S->getRParenLoc());
226 if (HasElse)
227 Record.AddSourceLocation(S->getElseLoc());
228
230}
231
232void ASTStmtWriter::VisitSwitchStmt(SwitchStmt *S) {
233 VisitStmt(S);
234
235 bool HasInit = S->getInit() != nullptr;
236 bool HasVar = S->getConditionVariableDeclStmt() != nullptr;
237 Record.push_back(HasInit);
238 Record.push_back(HasVar);
239 Record.push_back(S->isAllEnumCasesCovered());
240
241 Record.AddStmt(S->getCond());
242 Record.AddStmt(S->getBody());
243 if (HasInit)
244 Record.AddStmt(S->getInit());
245 if (HasVar)
246 Record.AddStmt(S->getConditionVariableDeclStmt());
247
248 Record.AddSourceLocation(S->getSwitchLoc());
249 Record.AddSourceLocation(S->getLParenLoc());
250 Record.AddSourceLocation(S->getRParenLoc());
251
252 for (SwitchCase *SC = S->getSwitchCaseList(); SC;
253 SC = SC->getNextSwitchCase())
254 Record.push_back(Writer.RecordSwitchCaseID(SC));
256}
257
258void ASTStmtWriter::VisitWhileStmt(WhileStmt *S) {
259 VisitStmt(S);
260
261 bool HasVar = S->getConditionVariableDeclStmt() != nullptr;
262 Record.push_back(HasVar);
263
264 Record.AddStmt(S->getCond());
265 Record.AddStmt(S->getBody());
266 if (HasVar)
267 Record.AddStmt(S->getConditionVariableDeclStmt());
268
269 Record.AddSourceLocation(S->getWhileLoc());
270 Record.AddSourceLocation(S->getLParenLoc());
271 Record.AddSourceLocation(S->getRParenLoc());
273}
274
275void ASTStmtWriter::VisitDoStmt(DoStmt *S) {
276 VisitStmt(S);
277 Record.AddStmt(S->getCond());
278 Record.AddStmt(S->getBody());
279 Record.AddSourceLocation(S->getDoLoc());
280 Record.AddSourceLocation(S->getWhileLoc());
281 Record.AddSourceLocation(S->getRParenLoc());
283}
284
285void ASTStmtWriter::VisitForStmt(ForStmt *S) {
286 VisitStmt(S);
287 Record.AddStmt(S->getInit());
288 Record.AddStmt(S->getCond());
289 Record.AddStmt(S->getConditionVariableDeclStmt());
290 Record.AddStmt(S->getInc());
291 Record.AddStmt(S->getBody());
292 Record.AddSourceLocation(S->getForLoc());
293 Record.AddSourceLocation(S->getLParenLoc());
294 Record.AddSourceLocation(S->getRParenLoc());
296}
297
298void ASTStmtWriter::VisitGotoStmt(GotoStmt *S) {
299 VisitStmt(S);
300 Record.AddDeclRef(S->getLabel());
301 Record.AddSourceLocation(S->getGotoLoc());
302 Record.AddSourceLocation(S->getLabelLoc());
304}
305
306void ASTStmtWriter::VisitIndirectGotoStmt(IndirectGotoStmt *S) {
307 VisitStmt(S);
308 Record.AddSourceLocation(S->getGotoLoc());
309 Record.AddSourceLocation(S->getStarLoc());
310 Record.AddStmt(S->getTarget());
312}
313
314void ASTStmtWriter::VisitLoopControlStmt(LoopControlStmt *S) {
315 VisitStmt(S);
316 Record.AddSourceLocation(S->getKwLoc());
317 Record.push_back(S->hasLabelTarget());
318 if (S->hasLabelTarget()) {
319 Record.AddDeclRef(S->getLabelDecl());
320 Record.AddSourceLocation(S->getLabelLoc());
321 }
322}
323
324void ASTStmtWriter::VisitContinueStmt(ContinueStmt *S) {
325 VisitLoopControlStmt(S);
327}
328
329void ASTStmtWriter::VisitBreakStmt(BreakStmt *S) {
330 VisitLoopControlStmt(S);
332}
333
334void ASTStmtWriter::VisitDeferStmt(DeferStmt *S) {
335 VisitStmt(S);
336 Record.AddSourceLocation(S->getDeferLoc());
337 Record.AddStmt(S->getBody());
339}
340
341void ASTStmtWriter::VisitReturnStmt(ReturnStmt *S) {
342 VisitStmt(S);
343
344 bool HasNRVOCandidate = S->getNRVOCandidate() != nullptr;
345 Record.push_back(HasNRVOCandidate);
346
347 Record.AddStmt(S->getRetValue());
348 if (HasNRVOCandidate)
349 Record.AddDeclRef(S->getNRVOCandidate());
350
351 Record.AddSourceLocation(S->getReturnLoc());
353}
354
355void ASTStmtWriter::VisitDeclStmt(DeclStmt *S) {
356 VisitStmt(S);
357 Record.AddSourceLocation(S->getBeginLoc());
358 Record.AddSourceLocation(S->getEndLoc());
359 DeclGroupRef DG = S->getDeclGroup();
360 for (DeclGroupRef::iterator D = DG.begin(), DEnd = DG.end(); D != DEnd; ++D)
361 Record.AddDeclRef(*D);
363}
364
365void ASTStmtWriter::VisitAsmStmt(AsmStmt *S) {
366 VisitStmt(S);
367 Record.push_back(S->getNumOutputs());
368 Record.push_back(S->getNumInputs());
369 Record.push_back(S->getNumClobbers());
370 Record.AddSourceLocation(S->getAsmLoc());
371 Record.push_back(S->isVolatile());
372 Record.push_back(S->isSimple());
373}
374
375void ASTStmtWriter::VisitGCCAsmStmt(GCCAsmStmt *S) {
376 VisitAsmStmt(S);
377 Record.push_back(S->getNumLabels());
378 Record.AddSourceLocation(S->getRParenLoc());
379 Record.AddStmt(S->getAsmStringExpr());
380
381 // Outputs
382 for (unsigned I = 0, N = S->getNumOutputs(); I != N; ++I) {
383 Record.AddIdentifierRef(S->getOutputIdentifier(I));
384 Record.AddStmt(S->getOutputConstraintExpr(I));
385 Record.AddStmt(S->getOutputExpr(I));
386 }
387
388 // Inputs
389 for (unsigned I = 0, N = S->getNumInputs(); I != N; ++I) {
390 Record.AddIdentifierRef(S->getInputIdentifier(I));
391 Record.AddStmt(S->getInputConstraintExpr(I));
392 Record.AddStmt(S->getInputExpr(I));
393 }
394
395 // Clobbers
396 for (unsigned I = 0, N = S->getNumClobbers(); I != N; ++I)
397 Record.AddStmt(S->getClobberExpr(I));
398
399 // Labels
400 for (unsigned I = 0, N = S->getNumLabels(); I != N; ++I) {
401 Record.AddIdentifierRef(S->getLabelIdentifier(I));
402 Record.AddStmt(S->getLabelExpr(I));
403 }
404
406}
407
408void ASTStmtWriter::VisitMSAsmStmt(MSAsmStmt *S) {
409 VisitAsmStmt(S);
410 Record.AddSourceLocation(S->getLBraceLoc());
411 Record.AddSourceLocation(S->getEndLoc());
412 Record.push_back(S->getNumAsmToks());
413 Record.AddString(S->getAsmString());
414
415 // Tokens
416 for (unsigned I = 0, N = S->getNumAsmToks(); I != N; ++I) {
417 // FIXME: Move this to ASTRecordWriter?
418 Writer.AddToken(S->getAsmToks()[I], Record.getRecordData());
419 }
420
421 // Clobbers
422 for (unsigned I = 0, N = S->getNumClobbers(); I != N; ++I) {
423 Record.AddString(S->getClobber(I));
424 }
425
426 // Outputs
427 for (unsigned I = 0, N = S->getNumOutputs(); I != N; ++I) {
428 Record.AddStmt(S->getOutputExpr(I));
429 Record.AddString(S->getOutputConstraint(I));
430 }
431
432 // Inputs
433 for (unsigned I = 0, N = S->getNumInputs(); I != N; ++I) {
434 Record.AddStmt(S->getInputExpr(I));
435 Record.AddString(S->getInputConstraint(I));
436 }
437
439}
440
441void ASTStmtWriter::VisitCoroutineBodyStmt(CoroutineBodyStmt *CoroStmt) {
442 VisitStmt(CoroStmt);
443 Record.push_back(CoroStmt->getParamMoves().size());
444 for (Stmt *S : CoroStmt->children())
445 Record.AddStmt(S);
447}
448
449void ASTStmtWriter::VisitCoreturnStmt(CoreturnStmt *S) {
450 VisitStmt(S);
451 Record.AddSourceLocation(S->getKeywordLoc());
452 Record.AddStmt(S->getOperand());
453 Record.AddStmt(S->getPromiseCall());
454 Record.push_back(S->isImplicit());
456}
457
458void ASTStmtWriter::VisitCoroutineSuspendExpr(CoroutineSuspendExpr *E) {
459 VisitExpr(E);
460 Record.AddSourceLocation(E->getKeywordLoc());
461 for (Stmt *S : E->children())
462 Record.AddStmt(S);
463 Record.AddStmt(E->getOpaqueValue());
464}
465
466void ASTStmtWriter::VisitCoawaitExpr(CoawaitExpr *E) {
467 VisitCoroutineSuspendExpr(E);
468 Record.push_back(E->isImplicit());
470}
471
472void ASTStmtWriter::VisitCoyieldExpr(CoyieldExpr *E) {
473 VisitCoroutineSuspendExpr(E);
475}
476
477void ASTStmtWriter::VisitCXXReflectExpr(CXXReflectExpr *E) {
478 // TODO(Reflection): Implement this.
479 assert(false && "not implemented yet");
480}
481
482void ASTStmtWriter::VisitDependentCoawaitExpr(DependentCoawaitExpr *E) {
483 VisitExpr(E);
484 Record.AddSourceLocation(E->getKeywordLoc());
485 for (Stmt *S : E->children())
486 Record.AddStmt(S);
488}
489
490static void
492 const ASTConstraintSatisfaction &Satisfaction) {
493 Record.push_back(Satisfaction.IsSatisfied);
494 Record.push_back(Satisfaction.ContainsErrors);
495 if (!Satisfaction.IsSatisfied) {
496 Record.push_back(Satisfaction.NumRecords);
497 for (const auto &DetailRecord : Satisfaction) {
498 if (auto *Diag = dyn_cast<const ConstraintSubstitutionDiagnostic *>(
499 DetailRecord)) {
500 Record.push_back(/*Kind=*/0);
501 Record.AddSourceLocation(Diag->first);
502 Record.AddString(Diag->second);
503 continue;
504 }
505 if (auto *E = dyn_cast<const Expr *>(DetailRecord)) {
506 Record.push_back(/*Kind=*/1);
507 Record.AddStmt(const_cast<Expr *>(E));
508 } else {
509 Record.push_back(/*Kind=*/2);
510 auto *CR = cast<const ConceptReference *>(DetailRecord);
511 Record.AddConceptReference(CR);
512 }
513 }
514 }
515}
516
517static void
521 Record.AddString(D->SubstitutedEntity);
522 Record.AddSourceLocation(D->DiagLoc);
523 Record.AddString(D->DiagMessage);
524}
525
526void ASTStmtWriter::VisitConceptSpecializationExpr(
528 VisitExpr(E);
529 Record.AddDeclRef(E->getSpecializationDecl());
530 const ConceptReference *CR = E->getConceptReference();
531 Record.push_back(CR != nullptr);
532 if (CR)
533 Record.AddConceptReference(CR);
534 if (!E->isValueDependent())
536
538}
539
540void ASTStmtWriter::VisitRequiresExpr(RequiresExpr *E) {
541 VisitExpr(E);
542 Record.push_back(E->getLocalParameters().size());
543 Record.push_back(E->getRequirements().size());
544 Record.AddSourceLocation(E->RequiresExprBits.RequiresKWLoc);
545 Record.push_back(E->RequiresExprBits.IsSatisfied);
546 Record.AddDeclRef(E->getBody());
547 for (ParmVarDecl *P : E->getLocalParameters())
548 Record.AddDeclRef(P);
549 for (concepts::Requirement *R : E->getRequirements()) {
550 if (auto *TypeReq = dyn_cast<concepts::TypeRequirement>(R)) {
551 Record.push_back(concepts::Requirement::RK_Type);
552 Record.push_back(TypeReq->Status);
554 addSubstitutionDiagnostic(Record, TypeReq->getSubstitutionDiagnostic());
555 else
556 Record.AddTypeSourceInfo(TypeReq->getType());
557 } else if (auto *ExprReq = dyn_cast<concepts::ExprRequirement>(R)) {
558 Record.push_back(ExprReq->getKind());
559 Record.push_back(ExprReq->Status);
560 if (ExprReq->isExprSubstitutionFailure()) {
563 ExprReq->Value));
564 } else
565 Record.AddStmt(cast<Expr *>(ExprReq->Value));
566 if (ExprReq->getKind() == concepts::Requirement::RK_Compound) {
567 Record.AddSourceLocation(ExprReq->NoexceptLoc);
568 const auto &RetReq = ExprReq->getReturnTypeRequirement();
569 if (RetReq.isSubstitutionFailure()) {
570 Record.push_back(2);
571 addSubstitutionDiagnostic(Record, RetReq.getSubstitutionDiagnostic());
572 } else if (RetReq.isTypeConstraint()) {
573 Record.push_back(1);
574 Record.AddTemplateParameterList(
575 RetReq.getTypeConstraintTemplateParameterList());
576 if (ExprReq->Status >=
578 Record.AddStmt(
579 ExprReq->getReturnTypeRequirementSubstitutedConstraintExpr());
580 } else {
581 assert(RetReq.isEmpty());
582 Record.push_back(0);
583 }
584 }
585 } else {
586 auto *NestedReq = cast<concepts::NestedRequirement>(R);
587 Record.push_back(concepts::Requirement::RK_Nested);
588 Record.push_back(NestedReq->hasInvalidConstraint());
589 if (NestedReq->hasInvalidConstraint()) {
590 Record.AddString(NestedReq->getInvalidConstraintEntity());
591 addConstraintSatisfaction(Record, *NestedReq->Satisfaction);
592 } else {
593 Record.AddStmt(NestedReq->getConstraintExpr());
594 if (!NestedReq->isDependent())
595 addConstraintSatisfaction(Record, *NestedReq->Satisfaction);
596 }
597 }
598 }
599 Record.AddSourceLocation(E->getLParenLoc());
600 Record.AddSourceLocation(E->getRParenLoc());
601 Record.AddSourceLocation(E->getEndLoc());
602
604}
605
606
607void ASTStmtWriter::VisitCapturedStmt(CapturedStmt *S) {
608 VisitStmt(S);
609 // NumCaptures
610 Record.push_back(std::distance(S->capture_begin(), S->capture_end()));
611
612 // CapturedDecl and captured region kind
613 Record.AddDeclRef(S->getCapturedDecl());
614 Record.push_back(S->getCapturedRegionKind());
615
616 Record.AddDeclRef(S->getCapturedRecordDecl());
617
618 // Capture inits
619 for (auto *I : S->capture_inits())
620 Record.AddStmt(I);
621
622 // Body
623 Record.AddStmt(S->getCapturedStmt());
624
625 // Captures
626 for (const auto &I : S->captures()) {
627 if (I.capturesThis() || I.capturesVariableArrayType())
628 Record.AddDeclRef(nullptr);
629 else
630 Record.AddDeclRef(I.getCapturedVar());
631 Record.push_back(I.getCaptureKind());
632 Record.AddSourceLocation(I.getLocation());
633 }
634
636}
637
638void ASTStmtWriter::VisitSYCLKernelCallStmt(SYCLKernelCallStmt *S) {
639 VisitStmt(S);
640 Record.AddStmt(S->getOriginalStmt());
641 Record.AddStmt(S->getKernelLaunchStmt());
642 Record.AddDeclRef(S->getOutlinedFunctionDecl());
643
645}
646
647void ASTStmtWriter::VisitExpr(Expr *E) {
648 VisitStmt(E);
649
650 CurrentPackingBits.updateBits();
651 CurrentPackingBits.addBits(E->getDependence(), /*BitsWidth=*/5);
652 CurrentPackingBits.addBits(E->getValueKind(), /*BitsWidth=*/2);
653 CurrentPackingBits.addBits(E->getObjectKind(), /*BitsWidth=*/3);
654
655 Record.AddTypeRef(E->getType());
656}
657
658void ASTStmtWriter::VisitConstantExpr(ConstantExpr *E) {
659 VisitExpr(E);
660 Record.push_back(E->ConstantExprBits.ResultKind);
661
662 Record.push_back(E->ConstantExprBits.APValueKind);
663 Record.push_back(E->ConstantExprBits.IsUnsigned);
664 Record.push_back(E->ConstantExprBits.BitWidth);
665 // HasCleanup not serialized since we can just query the APValue.
666 Record.push_back(E->ConstantExprBits.IsImmediateInvocation);
667
668 switch (E->getResultStorageKind()) {
670 break;
672 Record.push_back(E->Int64Result());
673 break;
675 Record.AddAPValue(E->APValueResult());
676 break;
677 }
678
679 Record.AddStmt(E->getSubExpr());
681}
682
683void ASTStmtWriter::VisitOpenACCAsteriskSizeExpr(OpenACCAsteriskSizeExpr *E) {
684 VisitExpr(E);
685 Record.AddSourceLocation(E->getLocation());
687}
688
689void ASTStmtWriter::VisitSYCLUniqueStableNameExpr(SYCLUniqueStableNameExpr *E) {
690 VisitExpr(E);
691
692 Record.AddSourceLocation(E->getLocation());
693 Record.AddSourceLocation(E->getLParenLocation());
694 Record.AddSourceLocation(E->getRParenLocation());
695 Record.AddTypeSourceInfo(E->getTypeSourceInfo());
696
698}
699
700void ASTStmtWriter::VisitUnresolvedSYCLKernelCallStmt(
702 VisitStmt(S);
703
704 Record.AddStmt(S->getOriginalStmt());
705 Record.AddStmt(S->getKernelLaunchIdExpr());
706
708}
709
710void ASTStmtWriter::VisitPredefinedExpr(PredefinedExpr *E) {
711 VisitExpr(E);
712
713 bool HasFunctionName = E->getFunctionName() != nullptr;
714 Record.push_back(HasFunctionName);
715 Record.push_back(
716 llvm::to_underlying(E->getIdentKind())); // FIXME: stable encoding
717 Record.push_back(E->isTransparent());
718 Record.AddSourceLocation(E->getLocation());
719 if (HasFunctionName)
720 Record.AddStmt(E->getFunctionName());
722}
723
724void ASTStmtWriter::VisitDeclRefExpr(DeclRefExpr *E) {
725 VisitExpr(E);
726
727 CurrentPackingBits.updateBits();
728
729 CurrentPackingBits.addBit(E->hadMultipleCandidates());
730 CurrentPackingBits.addBit(E->refersToEnclosingVariableOrCapture());
731 CurrentPackingBits.addBits(E->isNonOdrUse(), /*Width=*/2);
732 CurrentPackingBits.addBit(E->isImmediateEscalating());
733 CurrentPackingBits.addBit(E->getDecl() != E->getFoundDecl());
734 CurrentPackingBits.addBit(E->hasQualifier());
735 CurrentPackingBits.addBit(E->hasTemplateKWAndArgsInfo());
736
737 if (E->hasTemplateKWAndArgsInfo()) {
738 unsigned NumTemplateArgs = E->getNumTemplateArgs();
739 Record.push_back(NumTemplateArgs);
740 }
741
742 DeclarationName::NameKind nk = (E->getDecl()->getDeclName().getNameKind());
743
744 if ((!E->hasTemplateKWAndArgsInfo()) && (!E->hasQualifier()) &&
745 (E->getDecl() == E->getFoundDecl()) &&
747 AbbrevToUse = Writer.getDeclRefExprAbbrev();
748 }
749
750 if (E->hasQualifier())
751 Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
752
753 if (E->getDecl() != E->getFoundDecl())
754 Record.AddDeclRef(E->getFoundDecl());
755
757 AddTemplateKWAndArgsInfo(*E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
758 E->getTrailingObjects<TemplateArgumentLoc>());
759
760 Record.AddDeclRef(E->getDecl());
761 Record.AddSourceLocation(E->getLocation());
762 Record.AddDeclarationNameLoc(E->DNLoc, E->getDecl()->getDeclName());
764}
765
766void ASTStmtWriter::VisitIntegerLiteral(IntegerLiteral *E) {
767 VisitExpr(E);
768 Record.AddSourceLocation(E->getLocation());
769 Record.AddAPInt(E->getValue());
770
771 if (E->getBitWidth() == 32) {
772 AbbrevToUse = Writer.getIntegerLiteralAbbrev();
773 }
774
776}
777
778void ASTStmtWriter::VisitFixedPointLiteral(FixedPointLiteral *E) {
779 VisitExpr(E);
780 Record.AddSourceLocation(E->getLocation());
781 Record.push_back(E->getScale());
782 Record.AddAPInt(E->getValue());
784}
785
786void ASTStmtWriter::VisitFloatingLiteral(FloatingLiteral *E) {
787 VisitExpr(E);
788 Record.push_back(E->getRawSemantics());
789 Record.push_back(E->isExact());
790 Record.AddAPFloat(E->getValue());
791 Record.AddSourceLocation(E->getLocation());
793}
794
795void ASTStmtWriter::VisitImaginaryLiteral(ImaginaryLiteral *E) {
796 VisitExpr(E);
797 Record.AddStmt(E->getSubExpr());
799}
800
801void ASTStmtWriter::VisitStringLiteral(StringLiteral *E) {
802 VisitExpr(E);
803
804 // Store the various bits of data of StringLiteral.
805 Record.push_back(E->getNumConcatenated());
806 Record.push_back(E->getLength());
807 Record.push_back(E->getCharByteWidth());
808 Record.push_back(llvm::to_underlying(E->getKind()));
809 Record.push_back(E->isPascal());
810
811 // Store the trailing array of SourceLocation.
812 for (unsigned I = 0, N = E->getNumConcatenated(); I != N; ++I)
813 Record.AddSourceLocation(E->getStrTokenLoc(I));
814
815 // Store the trailing array of char holding the string data.
816 StringRef StrData = E->getBytes();
817 for (unsigned I = 0, N = E->getByteLength(); I != N; ++I)
818 Record.push_back(StrData[I]);
819
821}
822
823void ASTStmtWriter::VisitCharacterLiteral(CharacterLiteral *E) {
824 VisitExpr(E);
825 Record.push_back(E->getValue());
826 Record.AddSourceLocation(E->getLocation());
827 Record.push_back(llvm::to_underlying(E->getKind()));
828
829 AbbrevToUse = Writer.getCharacterLiteralAbbrev();
830
832}
833
834void ASTStmtWriter::VisitParenExpr(ParenExpr *E) {
835 VisitExpr(E);
836 Record.push_back(E->isProducedByFoldExpansion());
837 Record.AddSourceLocation(E->getLParen());
838 Record.AddSourceLocation(E->getRParen());
839 Record.AddStmt(E->getSubExpr());
841}
842
843void ASTStmtWriter::VisitParenListExpr(ParenListExpr *E) {
844 VisitExpr(E);
845 Record.push_back(E->getNumExprs());
846 for (auto *SubStmt : E->exprs())
847 Record.AddStmt(SubStmt);
848 Record.AddSourceLocation(E->getLParenLoc());
849 Record.AddSourceLocation(E->getRParenLoc());
851}
852
853void ASTStmtWriter::VisitUnaryOperator(UnaryOperator *E) {
854 VisitExpr(E);
855 bool HasFPFeatures = E->hasStoredFPFeatures();
856 // Write this first for easy access when deserializing, as they affect the
857 // size of the UnaryOperator.
858 CurrentPackingBits.addBit(HasFPFeatures);
859 Record.AddStmt(E->getSubExpr());
860 CurrentPackingBits.addBits(E->getOpcode(),
861 /*Width=*/5); // FIXME: stable encoding
862 Record.AddSourceLocation(E->getOperatorLoc());
863 CurrentPackingBits.addBit(E->canOverflow());
864
865 if (HasFPFeatures)
866 Record.push_back(E->getStoredFPFeatures().getAsOpaqueInt());
868}
869
870void ASTStmtWriter::VisitOffsetOfExpr(OffsetOfExpr *E) {
871 VisitExpr(E);
872 Record.push_back(E->getNumComponents());
873 Record.push_back(E->getNumExpressions());
874 Record.AddSourceLocation(E->getOperatorLoc());
875 Record.AddSourceLocation(E->getRParenLoc());
876 Record.AddTypeSourceInfo(E->getTypeSourceInfo());
877 for (unsigned I = 0, N = E->getNumComponents(); I != N; ++I) {
878 const OffsetOfNode &ON = E->getComponent(I);
879 Record.push_back(ON.getKind()); // FIXME: Stable encoding
880 Record.AddSourceLocation(ON.getSourceRange().getBegin());
881 Record.AddSourceLocation(ON.getSourceRange().getEnd());
882 switch (ON.getKind()) {
884 Record.push_back(ON.getArrayExprIndex());
885 break;
886
888 Record.AddDeclRef(ON.getField());
889 break;
890
892 Record.AddIdentifierRef(ON.getFieldName());
893 break;
894
896 Record.AddCXXBaseSpecifier(*ON.getBase());
897 break;
898 }
899 }
900 for (unsigned I = 0, N = E->getNumExpressions(); I != N; ++I)
901 Record.AddStmt(E->getIndexExpr(I));
903}
904
905void ASTStmtWriter::VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *E) {
906 VisitExpr(E);
907 Record.push_back(E->getKind());
908 if (E->isArgumentType())
909 Record.AddTypeSourceInfo(E->getArgumentTypeInfo());
910 else {
911 Record.push_back(0);
912 Record.AddStmt(E->getArgumentExpr());
913 }
914 Record.AddSourceLocation(E->getOperatorLoc());
915 Record.AddSourceLocation(E->getRParenLoc());
917}
918
919void ASTStmtWriter::VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
920 VisitExpr(E);
921 Record.AddStmt(E->getLHS());
922 Record.AddStmt(E->getRHS());
923 Record.AddSourceLocation(E->getRBracketLoc());
925}
926
927void ASTStmtWriter::VisitMatrixSingleSubscriptExpr(
929 VisitExpr(E);
930 Record.AddStmt(E->getBase());
931 Record.AddStmt(E->getRowIdx());
932 Record.AddSourceLocation(E->getRBracketLoc());
934}
935
936void ASTStmtWriter::VisitMatrixSubscriptExpr(MatrixSubscriptExpr *E) {
937 VisitExpr(E);
938 Record.AddStmt(E->getBase());
939 Record.AddStmt(E->getRowIdx());
940 Record.AddStmt(E->getColumnIdx());
941 Record.AddSourceLocation(E->getRBracketLoc());
943}
944
945void ASTStmtWriter::VisitArraySectionExpr(ArraySectionExpr *E) {
946 VisitExpr(E);
947 Record.writeEnum(E->ASType);
948 Record.AddStmt(E->getBase());
949 Record.AddStmt(E->getLowerBound());
950 Record.AddStmt(E->getLength());
951 if (E->isOMPArraySection())
952 Record.AddStmt(E->getStride());
953 Record.AddSourceLocation(E->getColonLocFirst());
954
955 if (E->isOMPArraySection())
956 Record.AddSourceLocation(E->getColonLocSecond());
957
958 Record.AddSourceLocation(E->getRBracketLoc());
960}
961
962void ASTStmtWriter::VisitOMPArrayShapingExpr(OMPArrayShapingExpr *E) {
963 VisitExpr(E);
964 Record.push_back(E->getDimensions().size());
965 Record.AddStmt(E->getBase());
966 for (Expr *Dim : E->getDimensions())
967 Record.AddStmt(Dim);
968 for (SourceRange SR : E->getBracketsRanges())
969 Record.AddSourceRange(SR);
970 Record.AddSourceLocation(E->getLParenLoc());
971 Record.AddSourceLocation(E->getRParenLoc());
973}
974
975void ASTStmtWriter::VisitOMPIteratorExpr(OMPIteratorExpr *E) {
976 VisitExpr(E);
977 Record.push_back(E->numOfIterators());
978 Record.AddSourceLocation(E->getIteratorKwLoc());
979 Record.AddSourceLocation(E->getLParenLoc());
980 Record.AddSourceLocation(E->getRParenLoc());
981 for (unsigned I = 0, End = E->numOfIterators(); I < End; ++I) {
982 Record.AddDeclRef(E->getIteratorDecl(I));
983 Record.AddSourceLocation(E->getAssignLoc(I));
984 OMPIteratorExpr::IteratorRange Range = E->getIteratorRange(I);
985 Record.AddStmt(Range.Begin);
986 Record.AddStmt(Range.End);
987 Record.AddStmt(Range.Step);
988 Record.AddSourceLocation(E->getColonLoc(I));
989 if (Range.Step)
990 Record.AddSourceLocation(E->getSecondColonLoc(I));
991 // Serialize helpers
992 OMPIteratorHelperData &HD = E->getHelper(I);
993 Record.AddDeclRef(HD.CounterVD);
994 Record.AddStmt(HD.Upper);
995 Record.AddStmt(HD.Update);
996 Record.AddStmt(HD.CounterUpdate);
997 }
999}
1000
1001void ASTStmtWriter::VisitCallExpr(CallExpr *E) {
1002 VisitExpr(E);
1003
1004 Record.push_back(E->getNumArgs());
1005 CurrentPackingBits.updateBits();
1006 CurrentPackingBits.addBit(static_cast<bool>(E->getADLCallKind()));
1007 CurrentPackingBits.addBit(E->hasStoredFPFeatures());
1008 CurrentPackingBits.addBit(E->isCoroElideSafe());
1009 CurrentPackingBits.addBit(E->usesMemberSyntax());
1010
1011 Record.AddSourceLocation(E->getRParenLoc());
1012 Record.AddStmt(E->getCallee());
1013 for (CallExpr::arg_iterator Arg = E->arg_begin(), ArgEnd = E->arg_end();
1014 Arg != ArgEnd; ++Arg)
1015 Record.AddStmt(*Arg);
1016
1017 if (E->hasStoredFPFeatures())
1018 Record.push_back(E->getFPFeatures().getAsOpaqueInt());
1019
1020 if (!E->hasStoredFPFeatures() && !static_cast<bool>(E->getADLCallKind()) &&
1021 !E->isCoroElideSafe() && !E->usesMemberSyntax() &&
1022 E->getStmtClass() == Stmt::CallExprClass)
1023 AbbrevToUse = Writer.getCallExprAbbrev();
1024
1026}
1027
1028void ASTStmtWriter::VisitRecoveryExpr(RecoveryExpr *E) {
1029 VisitExpr(E);
1030 Record.push_back(std::distance(E->children().begin(), E->children().end()));
1031 Record.AddSourceLocation(E->getBeginLoc());
1032 Record.AddSourceLocation(E->getEndLoc());
1033 for (Stmt *Child : E->children())
1034 Record.AddStmt(Child);
1036}
1037
1038void ASTStmtWriter::VisitMemberExpr(MemberExpr *E) {
1039 VisitExpr(E);
1040
1041 bool HasQualifier = E->hasQualifier();
1042 bool HasFoundDecl = E->hasFoundDecl();
1043 bool HasTemplateInfo = E->hasTemplateKWAndArgsInfo();
1044 unsigned NumTemplateArgs = E->getNumTemplateArgs();
1045
1046 // Write these first for easy access when deserializing, as they affect the
1047 // size of the MemberExpr.
1048 CurrentPackingBits.updateBits();
1049 CurrentPackingBits.addBit(HasQualifier);
1050 CurrentPackingBits.addBit(HasFoundDecl);
1051 CurrentPackingBits.addBit(HasTemplateInfo);
1052 Record.push_back(NumTemplateArgs);
1053
1054 Record.AddStmt(E->getBase());
1055 Record.AddDeclRef(E->getMemberDecl());
1056 Record.AddDeclarationNameLoc(E->MemberDNLoc,
1057 E->getMemberDecl()->getDeclName());
1058 Record.AddSourceLocation(E->getMemberLoc());
1059 CurrentPackingBits.addBit(E->isArrow());
1060 CurrentPackingBits.addBit(E->hadMultipleCandidates());
1061 CurrentPackingBits.addBits(E->isNonOdrUse(), /*Width=*/2);
1062 Record.AddSourceLocation(E->getOperatorLoc());
1063
1064 if (HasQualifier)
1065 Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
1066
1067 if (HasFoundDecl) {
1068 DeclAccessPair FoundDecl = E->getFoundDecl();
1069 Record.AddDeclRef(FoundDecl.getDecl());
1070 CurrentPackingBits.addBits(FoundDecl.getAccess(), /*BitWidth=*/2);
1071 }
1072
1073 if (HasTemplateInfo)
1074 AddTemplateKWAndArgsInfo(*E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
1075 E->getTrailingObjects<TemplateArgumentLoc>());
1076
1078}
1079
1080void ASTStmtWriter::VisitObjCIsaExpr(ObjCIsaExpr *E) {
1081 VisitExpr(E);
1082 Record.AddStmt(E->getBase());
1083 Record.AddSourceLocation(E->getIsaMemberLoc());
1084 Record.AddSourceLocation(E->getOpLoc());
1085 Record.push_back(E->isArrow());
1087}
1088
1089void ASTStmtWriter::
1090VisitObjCIndirectCopyRestoreExpr(ObjCIndirectCopyRestoreExpr *E) {
1091 VisitExpr(E);
1092 Record.AddStmt(E->getSubExpr());
1093 Record.push_back(E->shouldCopy());
1095}
1096
1097void ASTStmtWriter::VisitObjCBridgedCastExpr(ObjCBridgedCastExpr *E) {
1098 VisitExplicitCastExpr(E);
1099 Record.AddSourceLocation(E->getLParenLoc());
1100 Record.AddSourceLocation(E->getBridgeKeywordLoc());
1101 Record.push_back(E->getBridgeKind()); // FIXME: Stable encoding
1103}
1104
1105void ASTStmtWriter::VisitCastExpr(CastExpr *E) {
1106 VisitExpr(E);
1107
1108 Record.push_back(E->path_size());
1109 CurrentPackingBits.updateBits();
1110 // 7 bits should be enough to store the casting kinds.
1111 CurrentPackingBits.addBits(E->getCastKind(), /*Width=*/7);
1112 CurrentPackingBits.addBit(E->hasStoredFPFeatures());
1113 Record.AddStmt(E->getSubExpr());
1114
1116 PI = E->path_begin(), PE = E->path_end(); PI != PE; ++PI)
1117 Record.AddCXXBaseSpecifier(**PI);
1118
1119 if (E->hasStoredFPFeatures())
1120 Record.push_back(E->getFPFeatures().getAsOpaqueInt());
1121}
1122
1123void ASTStmtWriter::VisitBinaryOperator(BinaryOperator *E) {
1124 VisitExpr(E);
1125
1126 // Write this first for easy access when deserializing, as they affect the
1127 // size of the UnaryOperator.
1128 CurrentPackingBits.updateBits();
1129 CurrentPackingBits.addBits(E->getOpcode(), /*Width=*/6);
1130 bool HasFPFeatures = E->hasStoredFPFeatures();
1131 CurrentPackingBits.addBit(HasFPFeatures);
1132 CurrentPackingBits.addBit(E->hasExcludedOverflowPattern());
1133 Record.AddStmt(E->getLHS());
1134 Record.AddStmt(E->getRHS());
1135 Record.AddSourceLocation(E->getOperatorLoc());
1136 if (HasFPFeatures)
1137 Record.push_back(E->getStoredFPFeatures().getAsOpaqueInt());
1138
1139 if (!HasFPFeatures && E->getValueKind() == VK_PRValue &&
1140 E->getObjectKind() == OK_Ordinary)
1141 AbbrevToUse = Writer.getBinaryOperatorAbbrev();
1142
1144}
1145
1146void ASTStmtWriter::VisitCompoundAssignOperator(CompoundAssignOperator *E) {
1147 VisitBinaryOperator(E);
1148 Record.AddTypeRef(E->getComputationLHSType());
1149 Record.AddTypeRef(E->getComputationResultType());
1150
1151 if (!E->hasStoredFPFeatures() && E->getValueKind() == VK_PRValue &&
1152 E->getObjectKind() == OK_Ordinary)
1153 AbbrevToUse = Writer.getCompoundAssignOperatorAbbrev();
1154
1156}
1157
1158void ASTStmtWriter::VisitConditionalOperator(ConditionalOperator *E) {
1159 VisitExpr(E);
1160 Record.AddStmt(E->getCond());
1161 Record.AddStmt(E->getLHS());
1162 Record.AddStmt(E->getRHS());
1163 Record.AddSourceLocation(E->getQuestionLoc());
1164 Record.AddSourceLocation(E->getColonLoc());
1166}
1167
1168void
1169ASTStmtWriter::VisitBinaryConditionalOperator(BinaryConditionalOperator *E) {
1170 VisitExpr(E);
1171 Record.AddStmt(E->getOpaqueValue());
1172 Record.AddStmt(E->getCommon());
1173 Record.AddStmt(E->getCond());
1174 Record.AddStmt(E->getTrueExpr());
1175 Record.AddStmt(E->getFalseExpr());
1176 Record.AddSourceLocation(E->getQuestionLoc());
1177 Record.AddSourceLocation(E->getColonLoc());
1179}
1180
1181void ASTStmtWriter::VisitImplicitCastExpr(ImplicitCastExpr *E) {
1182 VisitCastExpr(E);
1183 CurrentPackingBits.addBit(E->isPartOfExplicitCast());
1184
1185 if (E->path_size() == 0 && !E->hasStoredFPFeatures())
1186 AbbrevToUse = Writer.getExprImplicitCastAbbrev();
1187
1189}
1190
1191void ASTStmtWriter::VisitExplicitCastExpr(ExplicitCastExpr *E) {
1192 VisitCastExpr(E);
1193 Record.AddTypeSourceInfo(E->getTypeInfoAsWritten());
1194}
1195
1196void ASTStmtWriter::VisitCStyleCastExpr(CStyleCastExpr *E) {
1197 VisitExplicitCastExpr(E);
1198 Record.AddSourceLocation(E->getLParenLoc());
1199 Record.AddSourceLocation(E->getRParenLoc());
1201}
1202
1203void ASTStmtWriter::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
1204 VisitExpr(E);
1205 Record.AddSourceLocation(E->getLParenLoc());
1206 Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1207 Record.AddStmt(E->getInitializer());
1208 Record.push_back(E->isFileScope());
1210}
1211
1212void ASTStmtWriter::VisitExtVectorElementExpr(ExtVectorElementExpr *E) {
1213 VisitExpr(E);
1214 Record.AddStmt(E->getBase());
1215 Record.AddIdentifierRef(&E->getAccessor());
1216 Record.AddSourceLocation(E->getAccessorLoc());
1218}
1219
1220void ASTStmtWriter::VisitMatrixElementExpr(MatrixElementExpr *E) {
1221 VisitExpr(E);
1222 Record.AddStmt(E->getBase());
1223 Record.AddIdentifierRef(&E->getAccessor());
1224 Record.AddSourceLocation(E->getAccessorLoc());
1226}
1227
1228void ASTStmtWriter::VisitInitListExpr(InitListExpr *E) {
1229 VisitExpr(E);
1230 // NOTE: only add the (possibly null) syntactic form.
1231 // No need to serialize the isSemanticForm flag and the semantic form.
1232 Record.AddStmt(E->getSyntacticForm());
1233 Record.AddSourceLocation(E->getLBraceLoc());
1234 Record.AddSourceLocation(E->getRBraceLoc());
1235 bool isArrayFiller = isa<Expr *>(E->ArrayFillerOrUnionFieldInit);
1236 Record.push_back(isArrayFiller);
1237 if (isArrayFiller)
1238 Record.AddStmt(E->getArrayFiller());
1239 else
1240 Record.AddDeclRef(E->getInitializedFieldInUnion());
1241 Record.push_back(E->hadArrayRangeDesignator());
1242 Record.push_back(E->getNumInits());
1243 if (isArrayFiller) {
1244 // ArrayFiller may have filled "holes" due to designated initializer.
1245 // Replace them by 0 to indicate that the filler goes in that place.
1246 Expr *filler = E->getArrayFiller();
1247 for (unsigned I = 0, N = E->getNumInits(); I != N; ++I)
1248 Record.AddStmt(E->getInit(I) != filler ? E->getInit(I) : nullptr);
1249 } else {
1250 for (unsigned I = 0, N = E->getNumInits(); I != N; ++I)
1251 Record.AddStmt(E->getInit(I));
1252 }
1254}
1255
1256void ASTStmtWriter::VisitDesignatedInitExpr(DesignatedInitExpr *E) {
1257 VisitExpr(E);
1258 Record.push_back(E->getNumSubExprs());
1259 for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
1260 Record.AddStmt(E->getSubExpr(I));
1261 Record.AddSourceLocation(E->getEqualOrColonLoc());
1262 Record.push_back(E->usesGNUSyntax());
1263 for (const DesignatedInitExpr::Designator &D : E->designators()) {
1264 if (D.isFieldDesignator()) {
1265 if (FieldDecl *Field = D.getFieldDecl()) {
1266 Record.push_back(serialization::DESIG_FIELD_DECL);
1267 Record.AddDeclRef(Field);
1268 } else {
1269 Record.push_back(serialization::DESIG_FIELD_NAME);
1270 Record.AddIdentifierRef(D.getFieldName());
1271 }
1272 Record.AddSourceLocation(D.getDotLoc());
1273 Record.AddSourceLocation(D.getFieldLoc());
1274 } else if (D.isArrayDesignator()) {
1275 Record.push_back(serialization::DESIG_ARRAY);
1276 Record.push_back(D.getArrayIndex());
1277 Record.AddSourceLocation(D.getLBracketLoc());
1278 Record.AddSourceLocation(D.getRBracketLoc());
1279 } else {
1280 assert(D.isArrayRangeDesignator() && "Unknown designator");
1281 Record.push_back(serialization::DESIG_ARRAY_RANGE);
1282 Record.push_back(D.getArrayIndex());
1283 Record.AddSourceLocation(D.getLBracketLoc());
1284 Record.AddSourceLocation(D.getEllipsisLoc());
1285 Record.AddSourceLocation(D.getRBracketLoc());
1286 }
1287 }
1289}
1290
1291void ASTStmtWriter::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) {
1292 VisitExpr(E);
1293 Record.AddStmt(E->getBase());
1294 Record.AddStmt(E->getUpdater());
1296}
1297
1298void ASTStmtWriter::VisitNoInitExpr(NoInitExpr *E) {
1299 VisitExpr(E);
1301}
1302
1303void ASTStmtWriter::VisitArrayInitLoopExpr(ArrayInitLoopExpr *E) {
1304 VisitExpr(E);
1305 Record.AddStmt(E->SubExprs[0]);
1306 Record.AddStmt(E->SubExprs[1]);
1308}
1309
1310void ASTStmtWriter::VisitArrayInitIndexExpr(ArrayInitIndexExpr *E) {
1311 VisitExpr(E);
1313}
1314
1315void ASTStmtWriter::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) {
1316 VisitExpr(E);
1318}
1319
1320void ASTStmtWriter::VisitVAArgExpr(VAArgExpr *E) {
1321 VisitExpr(E);
1322 Record.AddStmt(E->getSubExpr());
1323 Record.AddTypeSourceInfo(E->getWrittenTypeInfo());
1324 Record.AddSourceLocation(E->getBuiltinLoc());
1325 Record.AddSourceLocation(E->getRParenLoc());
1326 Record.push_back(E->isMicrosoftABI());
1328}
1329
1330void ASTStmtWriter::VisitSourceLocExpr(SourceLocExpr *E) {
1331 VisitExpr(E);
1332 Record.AddDeclRef(cast_or_null<Decl>(E->getParentContext()));
1333 Record.AddSourceLocation(E->getBeginLoc());
1334 Record.AddSourceLocation(E->getEndLoc());
1335 Record.push_back(llvm::to_underlying(E->getIdentKind()));
1337}
1338
1339void ASTStmtWriter::VisitEmbedExpr(EmbedExpr *E) {
1340 VisitExpr(E);
1341 Record.AddSourceLocation(E->getBeginLoc());
1342 Record.AddSourceLocation(E->getEndLoc());
1343 Record.AddStmt(E->getDataStringLiteral());
1344 Record.writeUInt32(E->getStartingElementPos());
1345 Record.writeUInt32(E->getDataElementCount());
1347}
1348
1349void ASTStmtWriter::VisitAddrLabelExpr(AddrLabelExpr *E) {
1350 VisitExpr(E);
1351 Record.AddSourceLocation(E->getAmpAmpLoc());
1352 Record.AddSourceLocation(E->getLabelLoc());
1353 Record.AddDeclRef(E->getLabel());
1355}
1356
1357void ASTStmtWriter::VisitStmtExpr(StmtExpr *E) {
1358 VisitExpr(E);
1359 Record.AddStmt(E->getSubStmt());
1360 Record.AddSourceLocation(E->getLParenLoc());
1361 Record.AddSourceLocation(E->getRParenLoc());
1362 Record.push_back(E->getTemplateDepth());
1364}
1365
1366void ASTStmtWriter::VisitChooseExpr(ChooseExpr *E) {
1367 VisitExpr(E);
1368 Record.AddStmt(E->getCond());
1369 Record.AddStmt(E->getLHS());
1370 Record.AddStmt(E->getRHS());
1371 Record.AddSourceLocation(E->getBuiltinLoc());
1372 Record.AddSourceLocation(E->getRParenLoc());
1373 Record.push_back(E->isConditionDependent() ? false : E->isConditionTrue());
1375}
1376
1377void ASTStmtWriter::VisitGNUNullExpr(GNUNullExpr *E) {
1378 VisitExpr(E);
1379 Record.AddSourceLocation(E->getTokenLocation());
1381}
1382
1383void ASTStmtWriter::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
1384 VisitExpr(E);
1385 Record.push_back(E->getNumSubExprs());
1386 for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
1387 Record.AddStmt(E->getExpr(I));
1388 Record.AddSourceLocation(E->getBuiltinLoc());
1389 Record.AddSourceLocation(E->getRParenLoc());
1391}
1392
1393void ASTStmtWriter::VisitConvertVectorExpr(ConvertVectorExpr *E) {
1394 VisitExpr(E);
1395 bool HasFPFeatures = E->hasStoredFPFeatures();
1396 CurrentPackingBits.addBit(HasFPFeatures);
1397 Record.AddSourceLocation(E->getBuiltinLoc());
1398 Record.AddSourceLocation(E->getRParenLoc());
1399 Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1400 Record.AddStmt(E->getSrcExpr());
1402 if (HasFPFeatures)
1403 Record.push_back(E->getStoredFPFeatures().getAsOpaqueInt());
1404}
1405
1406void ASTStmtWriter::VisitBlockExpr(BlockExpr *E) {
1407 VisitExpr(E);
1408 Record.AddDeclRef(E->getBlockDecl());
1410}
1411
1412void ASTStmtWriter::VisitGenericSelectionExpr(GenericSelectionExpr *E) {
1413 VisitExpr(E);
1414
1415 Record.push_back(E->getNumAssocs());
1416 Record.push_back(E->isExprPredicate());
1417 Record.push_back(E->ResultIndex);
1418 Record.AddSourceLocation(E->getGenericLoc());
1419 Record.AddSourceLocation(E->getDefaultLoc());
1420 Record.AddSourceLocation(E->getRParenLoc());
1421
1422 // Either the trailing Stmt-s or the trailing TypeSourceInfo-s
1423 // will hold one more item than the number of associations
1424 // to account for the predicate (whether it is an expression
1425 // or a type).
1426 Stmt **Stmts = E->getTrailingObjects<Stmt *>();
1427 for (unsigned I = 0, N = E->numTrailingObjects(
1428 ASTConstraintSatisfaction::OverloadToken<Stmt *>());
1429 I < N; ++I)
1430 Record.AddStmt(Stmts[I]);
1431
1432 TypeSourceInfo **TSIs = E->getTrailingObjects<TypeSourceInfo *>();
1433 for (unsigned
1434 I = 0,
1435 N = E->numTrailingObjects(
1436 ASTConstraintSatisfaction::OverloadToken<TypeSourceInfo *>());
1437 I < N; ++I)
1438 Record.AddTypeSourceInfo(TSIs[I]);
1439
1441}
1442
1443void ASTStmtWriter::VisitPseudoObjectExpr(PseudoObjectExpr *E) {
1444 VisitExpr(E);
1445 Record.push_back(E->getNumSemanticExprs());
1446
1447 // Push the result index. Currently, this needs to exactly match
1448 // the encoding used internally for ResultIndex.
1449 unsigned result = E->getResultExprIndex();
1450 result = (result == PseudoObjectExpr::NoResult ? 0 : result + 1);
1451 Record.push_back(result);
1452
1453 Record.AddStmt(E->getSyntacticForm());
1455 i = E->semantics_begin(), e = E->semantics_end(); i != e; ++i) {
1456 Record.AddStmt(*i);
1457 }
1459}
1460
1461void ASTStmtWriter::VisitAtomicExpr(AtomicExpr *E) {
1462 VisitExpr(E);
1463 Record.push_back(E->getOp());
1464 for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
1465 Record.AddStmt(E->getSubExprs()[I]);
1466 Record.AddSourceLocation(E->getBuiltinLoc());
1467 Record.AddSourceLocation(E->getRParenLoc());
1469}
1470
1471//===----------------------------------------------------------------------===//
1472// Objective-C Expressions and Statements.
1473//===----------------------------------------------------------------------===//
1474
1475void ASTStmtWriter::VisitObjCObjectLiteral(ObjCObjectLiteral *E) {
1476 VisitExpr(E);
1477 Record.push_back(E->isExpressibleAsConstantInitializer());
1478}
1479
1480void ASTStmtWriter::VisitObjCStringLiteral(ObjCStringLiteral *E) {
1481 VisitObjCObjectLiteral(E);
1482 Record.AddStmt(E->getString());
1483 Record.AddSourceLocation(E->getAtLoc());
1485}
1486
1487void ASTStmtWriter::VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
1488 VisitObjCObjectLiteral(E);
1489 Record.AddStmt(E->getSubExpr());
1490 Record.AddDeclRef(E->getBoxingMethod());
1491 Record.AddSourceRange(E->getSourceRange());
1493}
1494
1495void ASTStmtWriter::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
1496 VisitObjCObjectLiteral(E);
1497 Record.push_back(E->getNumElements());
1498 for (unsigned i = 0; i < E->getNumElements(); i++)
1499 Record.AddStmt(E->getElement(i));
1500 Record.AddDeclRef(E->getArrayWithObjectsMethod());
1501 Record.AddSourceRange(E->getSourceRange());
1503}
1504
1505void ASTStmtWriter::VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *E) {
1506 VisitObjCObjectLiteral(E);
1507 Record.push_back(E->getNumElements());
1508 Record.push_back(E->HasPackExpansions);
1509 for (unsigned i = 0; i < E->getNumElements(); i++) {
1510 ObjCDictionaryElement Element = E->getKeyValueElement(i);
1511 Record.AddStmt(Element.Key);
1512 Record.AddStmt(Element.Value);
1513 if (E->HasPackExpansions) {
1514 Record.AddSourceLocation(Element.EllipsisLoc);
1515 unsigned NumExpansions = 0;
1516 if (Element.NumExpansions)
1517 NumExpansions = *Element.NumExpansions + 1;
1518 Record.push_back(NumExpansions);
1519 }
1520 }
1521
1522 Record.AddDeclRef(E->getDictWithObjectsMethod());
1523 Record.AddSourceRange(E->getSourceRange());
1525}
1526
1527void ASTStmtWriter::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
1528 VisitExpr(E);
1529 Record.AddTypeSourceInfo(E->getEncodedTypeSourceInfo());
1530 Record.AddSourceLocation(E->getAtLoc());
1531 Record.AddSourceLocation(E->getRParenLoc());
1533}
1534
1535void ASTStmtWriter::VisitObjCSelectorExpr(ObjCSelectorExpr *E) {
1536 VisitExpr(E);
1537 Record.AddSelectorRef(E->getSelector());
1538 Record.AddSourceLocation(E->getAtLoc());
1539 Record.AddSourceLocation(E->getRParenLoc());
1541}
1542
1543void ASTStmtWriter::VisitObjCProtocolExpr(ObjCProtocolExpr *E) {
1544 VisitExpr(E);
1545 Record.AddDeclRef(E->getProtocol());
1546 Record.AddSourceLocation(E->getAtLoc());
1547 Record.AddSourceLocation(E->ProtoLoc);
1548 Record.AddSourceLocation(E->getRParenLoc());
1550}
1551
1552void ASTStmtWriter::VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) {
1553 VisitExpr(E);
1554 Record.AddDeclRef(E->getDecl());
1555 Record.AddSourceLocation(E->getLocation());
1556 Record.AddSourceLocation(E->getOpLoc());
1557 Record.AddStmt(E->getBase());
1558 Record.push_back(E->isArrow());
1559 Record.push_back(E->isFreeIvar());
1561}
1562
1563void ASTStmtWriter::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
1564 VisitExpr(E);
1565 Record.push_back(E->SetterAndMethodRefFlags.getInt());
1566 Record.push_back(E->isImplicitProperty());
1567 if (E->isImplicitProperty()) {
1568 Record.AddDeclRef(E->getImplicitPropertyGetter());
1569 Record.AddDeclRef(E->getImplicitPropertySetter());
1570 } else {
1571 Record.AddDeclRef(E->getExplicitProperty());
1572 }
1573 Record.AddSourceLocation(E->getLocation());
1574 Record.AddSourceLocation(E->getReceiverLocation());
1575 if (E->isObjectReceiver()) {
1576 Record.push_back(0);
1577 Record.AddStmt(E->getBase());
1578 } else if (E->isSuperReceiver()) {
1579 Record.push_back(1);
1580 Record.AddTypeRef(E->getSuperReceiverType());
1581 } else {
1582 Record.push_back(2);
1583 Record.AddDeclRef(E->getClassReceiver());
1584 }
1585
1587}
1588
1589void ASTStmtWriter::VisitObjCSubscriptRefExpr(ObjCSubscriptRefExpr *E) {
1590 VisitExpr(E);
1591 Record.AddSourceLocation(E->getRBracket());
1592 Record.AddStmt(E->getBaseExpr());
1593 Record.AddStmt(E->getKeyExpr());
1594 Record.AddDeclRef(E->getAtIndexMethodDecl());
1595 Record.AddDeclRef(E->setAtIndexMethodDecl());
1596
1598}
1599
1600void ASTStmtWriter::VisitObjCMessageExpr(ObjCMessageExpr *E) {
1601 VisitExpr(E);
1602 Record.push_back(E->getNumArgs());
1603 Record.push_back(E->getNumStoredSelLocs());
1604 Record.push_back(E->SelLocsKind);
1605 Record.push_back(E->isDelegateInitCall());
1606 Record.push_back(E->IsImplicit);
1607 Record.push_back((unsigned)E->getReceiverKind()); // FIXME: stable encoding
1608 switch (E->getReceiverKind()) {
1610 Record.AddStmt(E->getInstanceReceiver());
1611 break;
1612
1614 Record.AddTypeSourceInfo(E->getClassReceiverTypeInfo());
1615 break;
1616
1619 Record.AddTypeRef(E->getSuperType());
1620 Record.AddSourceLocation(E->getSuperLoc());
1621 break;
1622 }
1623
1624 if (E->getMethodDecl()) {
1625 Record.push_back(1);
1626 Record.AddDeclRef(E->getMethodDecl());
1627 } else {
1628 Record.push_back(0);
1629 Record.AddSelectorRef(E->getSelector());
1630 }
1631
1632 Record.AddSourceLocation(E->getLeftLoc());
1633 Record.AddSourceLocation(E->getRightLoc());
1634
1635 for (CallExpr::arg_iterator Arg = E->arg_begin(), ArgEnd = E->arg_end();
1636 Arg != ArgEnd; ++Arg)
1637 Record.AddStmt(*Arg);
1638
1639 SourceLocation *Locs = E->getStoredSelLocs();
1640 for (unsigned i = 0, e = E->getNumStoredSelLocs(); i != e; ++i)
1641 Record.AddSourceLocation(Locs[i]);
1642
1644}
1645
1646void ASTStmtWriter::VisitObjCForCollectionStmt(ObjCForCollectionStmt *S) {
1647 VisitStmt(S);
1648 Record.AddStmt(S->getElement());
1649 Record.AddStmt(S->getCollection());
1650 Record.AddStmt(S->getBody());
1651 Record.AddSourceLocation(S->getForLoc());
1652 Record.AddSourceLocation(S->getRParenLoc());
1654}
1655
1656void ASTStmtWriter::VisitObjCAtCatchStmt(ObjCAtCatchStmt *S) {
1657 VisitStmt(S);
1658 Record.AddStmt(S->getCatchBody());
1659 Record.AddDeclRef(S->getCatchParamDecl());
1660 Record.AddSourceLocation(S->getAtCatchLoc());
1661 Record.AddSourceLocation(S->getRParenLoc());
1663}
1664
1665void ASTStmtWriter::VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S) {
1666 VisitStmt(S);
1667 Record.AddStmt(S->getFinallyBody());
1668 Record.AddSourceLocation(S->getAtFinallyLoc());
1670}
1671
1672void ASTStmtWriter::VisitObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S) {
1673 VisitStmt(S); // FIXME: no test coverage.
1674 Record.AddStmt(S->getSubStmt());
1675 Record.AddSourceLocation(S->getAtLoc());
1677}
1678
1679void ASTStmtWriter::VisitObjCAtTryStmt(ObjCAtTryStmt *S) {
1680 VisitStmt(S);
1681 Record.push_back(S->getNumCatchStmts());
1682 Record.push_back(S->getFinallyStmt() != nullptr);
1683 Record.AddStmt(S->getTryBody());
1684 for (ObjCAtCatchStmt *C : S->catch_stmts())
1685 Record.AddStmt(C);
1686 if (S->getFinallyStmt())
1687 Record.AddStmt(S->getFinallyStmt());
1688 Record.AddSourceLocation(S->getAtTryLoc());
1690}
1691
1692void ASTStmtWriter::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
1693 VisitStmt(S); // FIXME: no test coverage.
1694 Record.AddStmt(S->getSynchExpr());
1695 Record.AddStmt(S->getSynchBody());
1696 Record.AddSourceLocation(S->getAtSynchronizedLoc());
1698}
1699
1700void ASTStmtWriter::VisitObjCAtThrowStmt(ObjCAtThrowStmt *S) {
1701 VisitStmt(S); // FIXME: no test coverage.
1702 Record.AddStmt(S->getThrowExpr());
1703 Record.AddSourceLocation(S->getThrowLoc());
1705}
1706
1707void ASTStmtWriter::VisitObjCBoolLiteralExpr(ObjCBoolLiteralExpr *E) {
1708 VisitExpr(E);
1709 Record.push_back(E->getValue());
1710 Record.AddSourceLocation(E->getLocation());
1712}
1713
1714void ASTStmtWriter::VisitObjCAvailabilityCheckExpr(ObjCAvailabilityCheckExpr *E) {
1715 VisitExpr(E);
1716 Record.AddSourceRange(E->getSourceRange());
1717 Record.AddVersionTuple(E->getVersion());
1719}
1720
1721//===----------------------------------------------------------------------===//
1722// C++ Expressions and Statements.
1723//===----------------------------------------------------------------------===//
1724
1725void ASTStmtWriter::VisitCXXCatchStmt(CXXCatchStmt *S) {
1726 VisitStmt(S);
1727 Record.AddSourceLocation(S->getCatchLoc());
1728 Record.AddDeclRef(S->getExceptionDecl());
1729 Record.AddStmt(S->getHandlerBlock());
1731}
1732
1733void ASTStmtWriter::VisitCXXTryStmt(CXXTryStmt *S) {
1734 VisitStmt(S);
1735 Record.push_back(S->getNumHandlers());
1736 Record.AddSourceLocation(S->getTryLoc());
1737 Record.AddStmt(S->getTryBlock());
1738 for (unsigned i = 0, e = S->getNumHandlers(); i != e; ++i)
1739 Record.AddStmt(S->getHandler(i));
1741}
1742
1743void ASTStmtWriter::VisitCXXForRangeStmt(CXXForRangeStmt *S) {
1744 VisitStmt(S);
1745 Record.AddSourceLocation(S->getForLoc());
1746 Record.AddSourceLocation(S->getCoawaitLoc());
1747 Record.AddSourceLocation(S->getColonLoc());
1748 Record.AddSourceLocation(S->getRParenLoc());
1749 Record.AddStmt(S->getInit());
1750 Record.AddStmt(S->getRangeStmt());
1751 Record.AddStmt(S->getBeginStmt());
1752 Record.AddStmt(S->getEndStmt());
1753 Record.AddStmt(S->getCond());
1754 Record.AddStmt(S->getInc());
1755 Record.AddStmt(S->getLoopVarStmt());
1756 Record.AddStmt(S->getBody());
1758}
1759
1760void ASTStmtWriter::VisitMSDependentExistsStmt(MSDependentExistsStmt *S) {
1761 VisitStmt(S);
1762 Record.AddSourceLocation(S->getKeywordLoc());
1763 Record.push_back(S->isIfExists());
1764 Record.AddNestedNameSpecifierLoc(S->getQualifierLoc());
1765 Record.AddDeclarationNameInfo(S->getNameInfo());
1766 Record.AddStmt(S->getSubStmt());
1768}
1769
1770void ASTStmtWriter::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
1771 VisitCallExpr(E);
1772 Record.push_back(E->getOperator());
1773 Record.push_back(E->isReversed());
1774 Record.AddSourceLocation(E->BeginLoc);
1775
1776 if (!E->hasStoredFPFeatures() && !static_cast<bool>(E->getADLCallKind()) &&
1777 !E->isCoroElideSafe() && !E->usesMemberSyntax() && !E->isReversed())
1778 AbbrevToUse = Writer.getCXXOperatorCallExprAbbrev();
1779
1781}
1782
1783void ASTStmtWriter::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) {
1784 VisitCallExpr(E);
1785
1786 if (!E->hasStoredFPFeatures() && !static_cast<bool>(E->getADLCallKind()) &&
1787 !E->isCoroElideSafe() && !E->usesMemberSyntax())
1788 AbbrevToUse = Writer.getCXXMemberCallExprAbbrev();
1789
1791}
1792
1793void ASTStmtWriter::VisitCXXRewrittenBinaryOperator(
1795 VisitExpr(E);
1796 Record.push_back(E->isReversed());
1797 Record.AddStmt(E->getSemanticForm());
1799}
1800
1801void ASTStmtWriter::VisitCXXConstructExpr(CXXConstructExpr *E) {
1802 VisitExpr(E);
1803
1804 Record.push_back(E->getNumArgs());
1805 Record.push_back(E->isElidable());
1806 Record.push_back(E->hadMultipleCandidates());
1807 Record.push_back(E->isListInitialization());
1808 Record.push_back(E->isStdInitListInitialization());
1809 Record.push_back(E->requiresZeroInitialization());
1810 Record.push_back(
1811 llvm::to_underlying(E->getConstructionKind())); // FIXME: stable encoding
1812 Record.push_back(E->isImmediateEscalating());
1813 Record.AddSourceLocation(E->getLocation());
1814 Record.AddDeclRef(E->getConstructor());
1815 Record.AddSourceRange(E->getParenOrBraceRange());
1816
1817 for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1818 Record.AddStmt(E->getArg(I));
1819
1821}
1822
1823void ASTStmtWriter::VisitCXXInheritedCtorInitExpr(CXXInheritedCtorInitExpr *E) {
1824 VisitExpr(E);
1825 Record.AddDeclRef(E->getConstructor());
1826 Record.AddSourceLocation(E->getLocation());
1827 Record.push_back(E->constructsVBase());
1828 Record.push_back(E->inheritedFromVBase());
1830}
1831
1832void ASTStmtWriter::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
1833 VisitCXXConstructExpr(E);
1834 Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1836}
1837
1838void ASTStmtWriter::VisitLambdaExpr(LambdaExpr *E) {
1839 VisitExpr(E);
1840 Record.push_back(E->LambdaExprBits.NumCaptures);
1841 Record.AddSourceRange(E->IntroducerRange);
1842 Record.push_back(E->LambdaExprBits.CaptureDefault); // FIXME: stable encoding
1843 Record.AddSourceLocation(E->CaptureDefaultLoc);
1844 Record.push_back(E->LambdaExprBits.ExplicitParams);
1845 Record.push_back(E->LambdaExprBits.ExplicitResultType);
1846 Record.AddSourceLocation(E->ClosingBrace);
1847
1848 // Add capture initializers.
1850 CEnd = E->capture_init_end();
1851 C != CEnd; ++C) {
1852 Record.AddStmt(*C);
1853 }
1854
1855 // Don't serialize the body. It belongs to the call operator declaration.
1856 // LambdaExpr only stores a copy of the Stmt *.
1857
1859}
1860
1861void ASTStmtWriter::VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E) {
1862 VisitExpr(E);
1863 Record.AddStmt(E->getSubExpr());
1865}
1866
1867void ASTStmtWriter::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) {
1868 VisitExplicitCastExpr(E);
1869 Record.AddSourceRange(SourceRange(E->getOperatorLoc(), E->getRParenLoc()));
1870 CurrentPackingBits.addBit(E->getAngleBrackets().isValid());
1871 if (E->getAngleBrackets().isValid())
1872 Record.AddSourceRange(E->getAngleBrackets());
1873}
1874
1875void ASTStmtWriter::VisitCXXStaticCastExpr(CXXStaticCastExpr *E) {
1876 VisitCXXNamedCastExpr(E);
1878}
1879
1880void ASTStmtWriter::VisitCXXDynamicCastExpr(CXXDynamicCastExpr *E) {
1881 VisitCXXNamedCastExpr(E);
1883}
1884
1885void ASTStmtWriter::VisitCXXReinterpretCastExpr(CXXReinterpretCastExpr *E) {
1886 VisitCXXNamedCastExpr(E);
1888}
1889
1890void ASTStmtWriter::VisitCXXConstCastExpr(CXXConstCastExpr *E) {
1891 VisitCXXNamedCastExpr(E);
1893}
1894
1895void ASTStmtWriter::VisitCXXAddrspaceCastExpr(CXXAddrspaceCastExpr *E) {
1896 VisitCXXNamedCastExpr(E);
1898}
1899
1900void ASTStmtWriter::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E) {
1901 VisitExplicitCastExpr(E);
1902 Record.AddSourceLocation(E->getLParenLoc());
1903 Record.AddSourceLocation(E->getRParenLoc());
1905}
1906
1907void ASTStmtWriter::VisitBuiltinBitCastExpr(BuiltinBitCastExpr *E) {
1908 VisitExplicitCastExpr(E);
1909 Record.AddSourceLocation(E->getBeginLoc());
1910 Record.AddSourceLocation(E->getEndLoc());
1912}
1913
1914void ASTStmtWriter::VisitUserDefinedLiteral(UserDefinedLiteral *E) {
1915 VisitCallExpr(E);
1916 Record.AddSourceLocation(E->UDSuffixLoc);
1918}
1919
1920void ASTStmtWriter::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) {
1921 VisitExpr(E);
1922 Record.push_back(E->getValue());
1923 Record.AddSourceLocation(E->getLocation());
1925}
1926
1927void ASTStmtWriter::VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E) {
1928 VisitExpr(E);
1929 Record.AddSourceLocation(E->getLocation());
1931}
1932
1933void ASTStmtWriter::VisitCXXTypeidExpr(CXXTypeidExpr *E) {
1934 VisitExpr(E);
1935 Record.AddSourceRange(E->getSourceRange());
1936 if (E->isTypeOperand()) {
1937 Record.AddTypeSourceInfo(E->getTypeOperandSourceInfo());
1939 } else {
1940 Record.AddStmt(E->getExprOperand());
1942 }
1943}
1944
1945void ASTStmtWriter::VisitCXXThisExpr(CXXThisExpr *E) {
1946 VisitExpr(E);
1947 Record.AddSourceLocation(E->getLocation());
1948 Record.push_back(E->isImplicit());
1950
1952}
1953
1954void ASTStmtWriter::VisitCXXThrowExpr(CXXThrowExpr *E) {
1955 VisitExpr(E);
1956 Record.AddSourceLocation(E->getThrowLoc());
1957 Record.AddStmt(E->getSubExpr());
1958 Record.push_back(E->isThrownVariableInScope());
1960}
1961
1962void ASTStmtWriter::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
1963 VisitExpr(E);
1964 Record.AddDeclRef(E->getParam());
1965 Record.AddDeclRef(cast_or_null<Decl>(E->getUsedContext()));
1966 Record.AddSourceLocation(E->getUsedLocation());
1967 Record.push_back(E->hasRewrittenInit());
1968 if (E->hasRewrittenInit())
1969 Record.AddStmt(E->getRewrittenExpr());
1971}
1972
1973void ASTStmtWriter::VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E) {
1974 VisitExpr(E);
1975 Record.push_back(E->hasRewrittenInit());
1976 Record.AddDeclRef(E->getField());
1977 Record.AddDeclRef(cast_or_null<Decl>(E->getUsedContext()));
1978 Record.AddSourceLocation(E->getExprLoc());
1979 if (E->hasRewrittenInit())
1980 Record.AddStmt(E->getRewrittenExpr());
1982}
1983
1984void ASTStmtWriter::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
1985 VisitExpr(E);
1986 Record.AddCXXTemporary(E->getTemporary());
1987 Record.AddStmt(E->getSubExpr());
1989}
1990
1991void ASTStmtWriter::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
1992 VisitExpr(E);
1993 Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1994 Record.AddSourceLocation(E->getRParenLoc());
1996}
1997
1998void ASTStmtWriter::VisitCXXNewExpr(CXXNewExpr *E) {
1999 VisitExpr(E);
2000
2001 Record.push_back(E->isArray());
2002 Record.push_back(E->hasInitializer());
2003 Record.push_back(E->getNumPlacementArgs());
2004 Record.push_back(E->isParenTypeId());
2005
2006 Record.push_back(E->isGlobalNew());
2007 ImplicitAllocationParameters IAP = E->implicitAllocationParameters();
2008 Record.push_back(isAlignedAllocation(IAP.PassAlignment));
2009 Record.push_back(isTypeAwareAllocation(IAP.PassTypeIdentity));
2010 Record.push_back(E->doesUsualArrayDeleteWantSize());
2011 Record.push_back(E->CXXNewExprBits.HasInitializer);
2012 Record.push_back(E->CXXNewExprBits.StoredInitializationStyle);
2013
2014 Record.AddDeclRef(E->getOperatorNew());
2015 Record.AddDeclRef(E->getOperatorDelete());
2016 Record.AddTypeSourceInfo(E->getAllocatedTypeSourceInfo());
2017 if (E->isParenTypeId())
2018 Record.AddSourceRange(E->getTypeIdParens());
2019 Record.AddSourceRange(E->getSourceRange());
2020 Record.AddSourceRange(E->getDirectInitRange());
2021
2022 for (CXXNewExpr::arg_iterator I = E->raw_arg_begin(), N = E->raw_arg_end();
2023 I != N; ++I)
2024 Record.AddStmt(*I);
2025
2027}
2028
2029void ASTStmtWriter::VisitCXXDeleteExpr(CXXDeleteExpr *E) {
2030 VisitExpr(E);
2031 Record.push_back(E->isGlobalDelete());
2032 Record.push_back(E->isArrayForm());
2033 Record.push_back(E->isArrayFormAsWritten());
2034 Record.push_back(E->doesUsualArrayDeleteWantSize());
2035 Record.AddDeclRef(E->getOperatorDelete());
2036 Record.AddStmt(E->getArgument());
2037 Record.AddSourceLocation(E->getBeginLoc());
2038
2040}
2041
2042void ASTStmtWriter::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
2043 VisitExpr(E);
2044
2045 Record.AddStmt(E->getBase());
2046 Record.push_back(E->isArrow());
2047 Record.AddSourceLocation(E->getOperatorLoc());
2048 Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
2049 Record.AddTypeSourceInfo(E->getScopeTypeInfo());
2050 Record.AddSourceLocation(E->getColonColonLoc());
2051 Record.AddSourceLocation(E->getTildeLoc());
2052
2053 // PseudoDestructorTypeStorage.
2054 Record.AddIdentifierRef(E->getDestroyedTypeIdentifier());
2056 Record.AddSourceLocation(E->getDestroyedTypeLoc());
2057 else
2058 Record.AddTypeSourceInfo(E->getDestroyedTypeInfo());
2059
2061}
2062
2063void ASTStmtWriter::VisitExprWithCleanups(ExprWithCleanups *E) {
2064 VisitExpr(E);
2065 Record.push_back(E->getNumObjects());
2066 for (auto &Obj : E->getObjects()) {
2067 if (auto *BD = Obj.dyn_cast<BlockDecl *>()) {
2068 Record.push_back(serialization::COK_Block);
2069 Record.AddDeclRef(BD);
2070 } else if (auto *CLE = Obj.dyn_cast<CompoundLiteralExpr *>()) {
2071 Record.push_back(serialization::COK_CompoundLiteral);
2072 Record.AddStmt(CLE);
2073 }
2074 }
2075
2076 Record.push_back(E->cleanupsHaveSideEffects());
2077 Record.AddStmt(E->getSubExpr());
2079}
2080
2081void ASTStmtWriter::VisitCXXDependentScopeMemberExpr(
2083 VisitExpr(E);
2084
2085 // Don't emit anything here (or if you do you will have to update
2086 // the corresponding deserialization function).
2087 Record.push_back(E->getNumTemplateArgs());
2088 CurrentPackingBits.updateBits();
2089 CurrentPackingBits.addBit(E->hasTemplateKWAndArgsInfo());
2090 CurrentPackingBits.addBit(E->hasFirstQualifierFoundInScope());
2091
2092 if (E->hasTemplateKWAndArgsInfo()) {
2093 const ASTTemplateKWAndArgsInfo &ArgInfo =
2094 *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
2096 E->getTrailingObjects<TemplateArgumentLoc>());
2097 }
2098
2099 CurrentPackingBits.addBit(E->isArrow());
2100
2101 Record.AddTypeRef(E->getBaseType());
2102 Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
2103 CurrentPackingBits.addBit(!E->isImplicitAccess());
2104 if (!E->isImplicitAccess())
2105 Record.AddStmt(E->getBase());
2106
2107 Record.AddSourceLocation(E->getOperatorLoc());
2108
2109 if (E->hasFirstQualifierFoundInScope())
2110 Record.AddDeclRef(E->getFirstQualifierFoundInScope());
2111
2112 Record.AddDeclarationNameInfo(E->MemberNameInfo);
2114}
2115
2116void
2117ASTStmtWriter::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) {
2118 VisitExpr(E);
2119
2120 // Don't emit anything here, HasTemplateKWAndArgsInfo must be
2121 // emitted first.
2122 CurrentPackingBits.addBit(
2123 E->DependentScopeDeclRefExprBits.HasTemplateKWAndArgsInfo);
2124
2125 if (E->DependentScopeDeclRefExprBits.HasTemplateKWAndArgsInfo) {
2126 const ASTTemplateKWAndArgsInfo &ArgInfo =
2127 *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
2128 // 16 bits should be enought to store the number of args
2129 CurrentPackingBits.addBits(ArgInfo.NumTemplateArgs, /*Width=*/16);
2131 E->getTrailingObjects<TemplateArgumentLoc>());
2132 }
2133
2134 Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
2135 Record.AddDeclarationNameInfo(E->NameInfo);
2137}
2138
2139void
2140ASTStmtWriter::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E) {
2141 VisitExpr(E);
2142 Record.push_back(E->getNumArgs());
2144 ArgI = E->arg_begin(), ArgE = E->arg_end(); ArgI != ArgE; ++ArgI)
2145 Record.AddStmt(*ArgI);
2146 Record.AddTypeSourceInfo(E->getTypeSourceInfo());
2147 Record.AddSourceLocation(E->getLParenLoc());
2148 Record.AddSourceLocation(E->getRParenLoc());
2149 Record.push_back(E->isListInitialization());
2151}
2152
2153void ASTStmtWriter::VisitOverloadExpr(OverloadExpr *E) {
2154 VisitExpr(E);
2155
2156 Record.push_back(E->getNumDecls());
2157
2158 CurrentPackingBits.updateBits();
2159 CurrentPackingBits.addBit(E->hasTemplateKWAndArgsInfo());
2160 if (E->hasTemplateKWAndArgsInfo()) {
2161 const ASTTemplateKWAndArgsInfo &ArgInfo =
2163 Record.push_back(ArgInfo.NumTemplateArgs);
2165 }
2166
2168 OvE = E->decls_end();
2169 OvI != OvE; ++OvI) {
2170 Record.AddDeclRef(OvI.getDecl());
2171 Record.push_back(OvI.getAccess());
2172 }
2173
2174 Record.AddDeclarationNameInfo(E->getNameInfo());
2175 Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
2176}
2177
2178void ASTStmtWriter::VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
2179 VisitOverloadExpr(E);
2180 CurrentPackingBits.addBit(E->isArrow());
2181 CurrentPackingBits.addBit(E->hasUnresolvedUsing());
2182 CurrentPackingBits.addBit(!E->isImplicitAccess());
2183 if (!E->isImplicitAccess())
2184 Record.AddStmt(E->getBase());
2185
2186 Record.AddSourceLocation(E->getOperatorLoc());
2187
2188 Record.AddTypeRef(E->getBaseType());
2190}
2191
2192void ASTStmtWriter::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) {
2193 VisitOverloadExpr(E);
2194 CurrentPackingBits.addBit(E->requiresADL());
2195 Record.AddDeclRef(E->getNamingClass());
2197
2198 if (Writer.isWritingStdCXXNamedModules() && Writer.getChain()) {
2199 // Referencing all the possible declarations to make sure the change get
2200 // propagted.
2201 DeclarationName Name = E->getName();
2202 for (auto *Found :
2203 Record.getASTContext().getTranslationUnitDecl()->lookup(Name))
2204 if (Found->isFromASTFile())
2205 Writer.GetDeclRef(Found);
2206
2207 llvm::SmallVector<NamespaceDecl *> ExternalNSs;
2208 Writer.getChain()->ReadKnownNamespaces(ExternalNSs);
2209 for (auto *NS : ExternalNSs)
2210 for (auto *Found : NS->lookup(Name))
2211 Writer.GetDeclRef(Found);
2212 }
2213}
2214
2215void ASTStmtWriter::VisitTypeTraitExpr(TypeTraitExpr *E) {
2216 VisitExpr(E);
2217 Record.push_back(E->TypeTraitExprBits.IsBooleanTypeTrait);
2218 Record.push_back(E->TypeTraitExprBits.NumArgs);
2219 Record.push_back(E->TypeTraitExprBits.Kind); // FIXME: Stable encoding
2220
2221 if (E->TypeTraitExprBits.IsBooleanTypeTrait)
2222 Record.push_back(E->TypeTraitExprBits.Value);
2223 else
2224 Record.AddAPValue(E->getAPValue());
2225
2226 Record.AddSourceRange(E->getSourceRange());
2227 for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
2228 Record.AddTypeSourceInfo(E->getArg(I));
2230}
2231
2232void ASTStmtWriter::VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E) {
2233 VisitExpr(E);
2234 Record.push_back(E->getTrait());
2235 Record.push_back(E->getValue());
2236 Record.AddSourceRange(E->getSourceRange());
2237 Record.AddTypeSourceInfo(E->getQueriedTypeSourceInfo());
2238 Record.AddStmt(E->getDimensionExpression());
2240}
2241
2242void ASTStmtWriter::VisitExpressionTraitExpr(ExpressionTraitExpr *E) {
2243 VisitExpr(E);
2244 Record.push_back(E->getTrait());
2245 Record.push_back(E->getValue());
2246 Record.AddSourceRange(E->getSourceRange());
2247 Record.AddStmt(E->getQueriedExpression());
2249}
2250
2251void ASTStmtWriter::VisitCXXNoexceptExpr(CXXNoexceptExpr *E) {
2252 VisitExpr(E);
2253 Record.push_back(E->getValue());
2254 Record.AddSourceRange(E->getSourceRange());
2255 Record.AddStmt(E->getOperand());
2257}
2258
2259void ASTStmtWriter::VisitPackExpansionExpr(PackExpansionExpr *E) {
2260 VisitExpr(E);
2261 Record.AddSourceLocation(E->getEllipsisLoc());
2262 Record.push_back(E->NumExpansions);
2263 Record.AddStmt(E->getPattern());
2265}
2266
2267void ASTStmtWriter::VisitSizeOfPackExpr(SizeOfPackExpr *E) {
2268 VisitExpr(E);
2269 Record.push_back(E->isPartiallySubstituted() ? E->getPartialArguments().size()
2270 : 0);
2271 Record.AddSourceLocation(E->OperatorLoc);
2272 Record.AddSourceLocation(E->PackLoc);
2273 Record.AddSourceLocation(E->RParenLoc);
2274 Record.AddDeclRef(E->Pack);
2275 if (E->isPartiallySubstituted()) {
2276 for (const auto &TA : E->getPartialArguments())
2277 Record.AddTemplateArgument(TA);
2278 } else if (!E->isValueDependent()) {
2279 Record.push_back(E->getPackLength());
2280 }
2282}
2283
2284void ASTStmtWriter::VisitPackIndexingExpr(PackIndexingExpr *E) {
2285 VisitExpr(E);
2286 Record.push_back(E->PackIndexingExprBits.TransformedExpressions);
2287 Record.push_back(E->PackIndexingExprBits.FullySubstituted);
2288 Record.AddSourceLocation(E->getEllipsisLoc());
2289 Record.AddSourceLocation(E->getRSquareLoc());
2290 Record.AddStmt(E->getPackIdExpression());
2291 Record.AddStmt(E->getIndexExpr());
2292 for (Expr *Sub : E->getExpressions())
2293 Record.AddStmt(Sub);
2295}
2296
2297void ASTStmtWriter::VisitSubstNonTypeTemplateParmExpr(
2299 VisitExpr(E);
2300 Record.AddDeclRef(E->getAssociatedDecl());
2301 CurrentPackingBits.addBit(E->isReferenceParameter());
2302 CurrentPackingBits.addBits(E->getIndex(), /*Width=*/12);
2303 Record.writeUnsignedOrNone(E->getPackIndex());
2304 CurrentPackingBits.addBit(E->getFinal());
2305
2306 Record.AddSourceLocation(E->getNameLoc());
2307 Record.AddStmt(E->getReplacement());
2309}
2310
2311void ASTStmtWriter::VisitSubstNonTypeTemplateParmPackExpr(
2313 VisitExpr(E);
2314 Record.AddDeclRef(E->getAssociatedDecl());
2315 CurrentPackingBits.addBit(E->getFinal());
2316 Record.push_back(E->getIndex());
2317 Record.AddTemplateArgument(E->getArgumentPack());
2318 Record.AddSourceLocation(E->getParameterPackLocation());
2320}
2321
2322void ASTStmtWriter::VisitFunctionParmPackExpr(FunctionParmPackExpr *E) {
2323 VisitExpr(E);
2324 Record.push_back(E->getNumExpansions());
2325 Record.AddDeclRef(E->getParameterPack());
2326 Record.AddSourceLocation(E->getParameterPackLocation());
2327 for (FunctionParmPackExpr::iterator I = E->begin(), End = E->end();
2328 I != End; ++I)
2329 Record.AddDeclRef(*I);
2331}
2332
2333void ASTStmtWriter::VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E) {
2334 VisitExpr(E);
2335 Record.push_back(static_cast<bool>(E->getLifetimeExtendedTemporaryDecl()));
2337 Record.AddDeclRef(E->getLifetimeExtendedTemporaryDecl());
2338 else
2339 Record.AddStmt(E->getSubExpr());
2341}
2342
2343void ASTStmtWriter::VisitCXXFoldExpr(CXXFoldExpr *E) {
2344 VisitExpr(E);
2345 Record.AddSourceLocation(E->LParenLoc);
2346 Record.AddSourceLocation(E->EllipsisLoc);
2347 Record.AddSourceLocation(E->RParenLoc);
2348 Record.push_back(E->NumExpansions.toInternalRepresentation());
2349 Record.AddStmt(E->SubExprs[0]);
2350 Record.AddStmt(E->SubExprs[1]);
2351 Record.AddStmt(E->SubExprs[2]);
2352 Record.push_back(E->CXXFoldExprBits.Opcode);
2354}
2355
2356void ASTStmtWriter::VisitCXXParenListInitExpr(CXXParenListInitExpr *E) {
2357 VisitExpr(E);
2358 ArrayRef<Expr *> InitExprs = E->getInitExprs();
2359 Record.push_back(InitExprs.size());
2360 Record.push_back(E->getUserSpecifiedInitExprs().size());
2361 Record.AddSourceLocation(E->getInitLoc());
2362 Record.AddSourceLocation(E->getBeginLoc());
2363 Record.AddSourceLocation(E->getEndLoc());
2364 for (Expr *InitExpr : E->getInitExprs())
2365 Record.AddStmt(InitExpr);
2366 Expr *ArrayFiller = E->getArrayFiller();
2367 FieldDecl *UnionField = E->getInitializedFieldInUnion();
2368 bool HasArrayFillerOrUnionDecl = ArrayFiller || UnionField;
2369 Record.push_back(HasArrayFillerOrUnionDecl);
2370 if (HasArrayFillerOrUnionDecl) {
2371 Record.push_back(static_cast<bool>(ArrayFiller));
2372 if (ArrayFiller)
2373 Record.AddStmt(ArrayFiller);
2374 else
2375 Record.AddDeclRef(UnionField);
2376 }
2378}
2379
2380void ASTStmtWriter::VisitOpaqueValueExpr(OpaqueValueExpr *E) {
2381 VisitExpr(E);
2382 Record.AddStmt(E->getSourceExpr());
2383 Record.AddSourceLocation(E->getLocation());
2384 Record.push_back(E->isUnique());
2386}
2387
2388//===----------------------------------------------------------------------===//
2389// CUDA Expressions and Statements.
2390//===----------------------------------------------------------------------===//
2391
2392void ASTStmtWriter::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E) {
2393 VisitCallExpr(E);
2394 Record.AddStmt(E->getConfig());
2396}
2397
2398//===----------------------------------------------------------------------===//
2399// OpenCL Expressions and Statements.
2400//===----------------------------------------------------------------------===//
2401void ASTStmtWriter::VisitAsTypeExpr(AsTypeExpr *E) {
2402 VisitExpr(E);
2403 Record.AddSourceLocation(E->getBuiltinLoc());
2404 Record.AddSourceLocation(E->getRParenLoc());
2405 Record.AddStmt(E->getSrcExpr());
2407}
2408
2409//===----------------------------------------------------------------------===//
2410// Microsoft Expressions and Statements.
2411//===----------------------------------------------------------------------===//
2412void ASTStmtWriter::VisitMSPropertyRefExpr(MSPropertyRefExpr *E) {
2413 VisitExpr(E);
2414 Record.push_back(E->isArrow());
2415 Record.AddStmt(E->getBaseExpr());
2416 Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
2417 Record.AddSourceLocation(E->getMemberLoc());
2418 Record.AddDeclRef(E->getPropertyDecl());
2420}
2421
2422void ASTStmtWriter::VisitMSPropertySubscriptExpr(MSPropertySubscriptExpr *E) {
2423 VisitExpr(E);
2424 Record.AddStmt(E->getBase());
2425 Record.AddStmt(E->getIdx());
2426 Record.AddSourceLocation(E->getRBracketLoc());
2428}
2429
2430void ASTStmtWriter::VisitCXXUuidofExpr(CXXUuidofExpr *E) {
2431 VisitExpr(E);
2432 Record.AddSourceRange(E->getSourceRange());
2433 Record.AddDeclRef(E->getGuidDecl());
2434 if (E->isTypeOperand()) {
2435 Record.AddTypeSourceInfo(E->getTypeOperandSourceInfo());
2437 } else {
2438 Record.AddStmt(E->getExprOperand());
2440 }
2441}
2442
2443void ASTStmtWriter::VisitSEHExceptStmt(SEHExceptStmt *S) {
2444 VisitStmt(S);
2445 Record.AddSourceLocation(S->getExceptLoc());
2446 Record.AddStmt(S->getFilterExpr());
2447 Record.AddStmt(S->getBlock());
2449}
2450
2451void ASTStmtWriter::VisitSEHFinallyStmt(SEHFinallyStmt *S) {
2452 VisitStmt(S);
2453 Record.AddSourceLocation(S->getFinallyLoc());
2454 Record.AddStmt(S->getBlock());
2456}
2457
2458void ASTStmtWriter::VisitSEHTryStmt(SEHTryStmt *S) {
2459 VisitStmt(S);
2460 Record.push_back(S->getIsCXXTry());
2461 Record.AddSourceLocation(S->getTryLoc());
2462 Record.AddStmt(S->getTryBlock());
2463 Record.AddStmt(S->getHandler());
2465}
2466
2467void ASTStmtWriter::VisitSEHLeaveStmt(SEHLeaveStmt *S) {
2468 VisitStmt(S);
2469 Record.AddSourceLocation(S->getLeaveLoc());
2471}
2472
2473//===----------------------------------------------------------------------===//
2474// OpenMP Directives.
2475//===----------------------------------------------------------------------===//
2476
2477void ASTStmtWriter::VisitOMPCanonicalLoop(OMPCanonicalLoop *S) {
2478 VisitStmt(S);
2479 for (Stmt *SubStmt : S->SubStmts)
2480 Record.AddStmt(SubStmt);
2482}
2483
2484void ASTStmtWriter::VisitOMPExecutableDirective(OMPExecutableDirective *E) {
2485 Record.writeOMPChildren(E->Data);
2486 Record.AddSourceLocation(E->getBeginLoc());
2487 Record.AddSourceLocation(E->getEndLoc());
2488}
2489
2490void ASTStmtWriter::VisitOMPLoopBasedDirective(OMPLoopBasedDirective *D) {
2491 VisitStmt(D);
2492 Record.writeUInt32(D->getLoopsNumber());
2493 VisitOMPExecutableDirective(D);
2494}
2495
2496void ASTStmtWriter::VisitOMPLoopDirective(OMPLoopDirective *D) {
2497 VisitOMPLoopBasedDirective(D);
2498}
2499
2500void ASTStmtWriter::VisitOMPMetaDirective(OMPMetaDirective *D) {
2501 VisitStmt(D);
2502 Record.push_back(D->getNumClauses());
2503 VisitOMPExecutableDirective(D);
2505}
2506
2507void ASTStmtWriter::VisitOMPParallelDirective(OMPParallelDirective *D) {
2508 VisitStmt(D);
2509 VisitOMPExecutableDirective(D);
2510 Record.writeBool(D->hasCancel());
2512}
2513
2514void ASTStmtWriter::VisitOMPSimdDirective(OMPSimdDirective *D) {
2515 VisitOMPLoopDirective(D);
2517}
2518
2519void ASTStmtWriter::VisitOMPCanonicalLoopNestTransformationDirective(
2520 OMPCanonicalLoopNestTransformationDirective *D) {
2521 VisitOMPLoopBasedDirective(D);
2522 Record.writeUInt32(D->getNumGeneratedTopLevelLoops());
2523}
2524
2525void ASTStmtWriter::VisitOMPTileDirective(OMPTileDirective *D) {
2526 VisitOMPCanonicalLoopNestTransformationDirective(D);
2528}
2529
2530void ASTStmtWriter::VisitOMPStripeDirective(OMPStripeDirective *D) {
2531 VisitOMPCanonicalLoopNestTransformationDirective(D);
2533}
2534
2535void ASTStmtWriter::VisitOMPUnrollDirective(OMPUnrollDirective *D) {
2536 VisitOMPCanonicalLoopNestTransformationDirective(D);
2538}
2539
2540void ASTStmtWriter::VisitOMPReverseDirective(OMPReverseDirective *D) {
2541 VisitOMPCanonicalLoopNestTransformationDirective(D);
2543}
2544
2545void ASTStmtWriter::VisitOMPInterchangeDirective(OMPInterchangeDirective *D) {
2546 VisitOMPCanonicalLoopNestTransformationDirective(D);
2548}
2549
2550void ASTStmtWriter::VisitOMPSplitDirective(OMPSplitDirective *D) {
2551 VisitOMPCanonicalLoopNestTransformationDirective(D);
2553}
2554
2555void ASTStmtWriter::VisitOMPCanonicalLoopSequenceTransformationDirective(
2556 OMPCanonicalLoopSequenceTransformationDirective *D) {
2557 VisitStmt(D);
2558 VisitOMPExecutableDirective(D);
2559 Record.writeUInt32(D->getNumGeneratedTopLevelLoops());
2560}
2561
2562void ASTStmtWriter::VisitOMPFuseDirective(OMPFuseDirective *D) {
2563 VisitOMPCanonicalLoopSequenceTransformationDirective(D);
2565}
2566
2567void ASTStmtWriter::VisitOMPForDirective(OMPForDirective *D) {
2568 VisitOMPLoopDirective(D);
2569 Record.writeBool(D->hasCancel());
2571}
2572
2573void ASTStmtWriter::VisitOMPForSimdDirective(OMPForSimdDirective *D) {
2574 VisitOMPLoopDirective(D);
2576}
2577
2578void ASTStmtWriter::VisitOMPSectionsDirective(OMPSectionsDirective *D) {
2579 VisitStmt(D);
2580 VisitOMPExecutableDirective(D);
2581 Record.writeBool(D->hasCancel());
2583}
2584
2585void ASTStmtWriter::VisitOMPSectionDirective(OMPSectionDirective *D) {
2586 VisitStmt(D);
2587 VisitOMPExecutableDirective(D);
2588 Record.writeBool(D->hasCancel());
2590}
2591
2592void ASTStmtWriter::VisitOMPScopeDirective(OMPScopeDirective *D) {
2593 VisitStmt(D);
2594 VisitOMPExecutableDirective(D);
2596}
2597
2598void ASTStmtWriter::VisitOMPSingleDirective(OMPSingleDirective *D) {
2599 VisitStmt(D);
2600 VisitOMPExecutableDirective(D);
2602}
2603
2604void ASTStmtWriter::VisitOMPMasterDirective(OMPMasterDirective *D) {
2605 VisitStmt(D);
2606 VisitOMPExecutableDirective(D);
2608}
2609
2610void ASTStmtWriter::VisitOMPCriticalDirective(OMPCriticalDirective *D) {
2611 VisitStmt(D);
2612 VisitOMPExecutableDirective(D);
2613 Record.AddDeclarationNameInfo(D->getDirectiveName());
2615}
2616
2617void ASTStmtWriter::VisitOMPParallelForDirective(OMPParallelForDirective *D) {
2618 VisitOMPLoopDirective(D);
2619 Record.writeBool(D->hasCancel());
2621}
2622
2623void ASTStmtWriter::VisitOMPParallelForSimdDirective(
2624 OMPParallelForSimdDirective *D) {
2625 VisitOMPLoopDirective(D);
2627}
2628
2629void ASTStmtWriter::VisitOMPParallelMasterDirective(
2630 OMPParallelMasterDirective *D) {
2631 VisitStmt(D);
2632 VisitOMPExecutableDirective(D);
2634}
2635
2636void ASTStmtWriter::VisitOMPParallelMaskedDirective(
2637 OMPParallelMaskedDirective *D) {
2638 VisitStmt(D);
2639 VisitOMPExecutableDirective(D);
2641}
2642
2643void ASTStmtWriter::VisitOMPParallelSectionsDirective(
2644 OMPParallelSectionsDirective *D) {
2645 VisitStmt(D);
2646 VisitOMPExecutableDirective(D);
2647 Record.writeBool(D->hasCancel());
2649}
2650
2651void ASTStmtWriter::VisitOMPTaskDirective(OMPTaskDirective *D) {
2652 VisitStmt(D);
2653 VisitOMPExecutableDirective(D);
2654 Record.writeBool(D->hasCancel());
2656}
2657
2658void ASTStmtWriter::VisitOMPAtomicDirective(OMPAtomicDirective *D) {
2659 VisitStmt(D);
2660 VisitOMPExecutableDirective(D);
2661 Record.writeBool(D->isXLHSInRHSPart());
2662 Record.writeBool(D->isPostfixUpdate());
2663 Record.writeBool(D->isFailOnly());
2665}
2666
2667void ASTStmtWriter::VisitOMPTargetDirective(OMPTargetDirective *D) {
2668 VisitStmt(D);
2669 VisitOMPExecutableDirective(D);
2671}
2672
2673void ASTStmtWriter::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) {
2674 VisitStmt(D);
2675 VisitOMPExecutableDirective(D);
2677}
2678
2679void ASTStmtWriter::VisitOMPTargetEnterDataDirective(
2680 OMPTargetEnterDataDirective *D) {
2681 VisitStmt(D);
2682 VisitOMPExecutableDirective(D);
2684}
2685
2686void ASTStmtWriter::VisitOMPTargetExitDataDirective(
2687 OMPTargetExitDataDirective *D) {
2688 VisitStmt(D);
2689 VisitOMPExecutableDirective(D);
2691}
2692
2693void ASTStmtWriter::VisitOMPTargetParallelDirective(
2694 OMPTargetParallelDirective *D) {
2695 VisitStmt(D);
2696 VisitOMPExecutableDirective(D);
2697 Record.writeBool(D->hasCancel());
2699}
2700
2701void ASTStmtWriter::VisitOMPTargetParallelForDirective(
2702 OMPTargetParallelForDirective *D) {
2703 VisitOMPLoopDirective(D);
2704 Record.writeBool(D->hasCancel());
2706}
2707
2708void ASTStmtWriter::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) {
2709 VisitStmt(D);
2710 VisitOMPExecutableDirective(D);
2712}
2713
2714void ASTStmtWriter::VisitOMPBarrierDirective(OMPBarrierDirective *D) {
2715 VisitStmt(D);
2716 VisitOMPExecutableDirective(D);
2718}
2719
2720void ASTStmtWriter::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) {
2721 VisitStmt(D);
2722 Record.push_back(D->getNumClauses());
2723 VisitOMPExecutableDirective(D);
2725}
2726
2727void ASTStmtWriter::VisitOMPAssumeDirective(OMPAssumeDirective *D) {
2728 VisitStmt(D);
2729 VisitOMPExecutableDirective(D);
2731}
2732
2733void ASTStmtWriter::VisitOMPErrorDirective(OMPErrorDirective *D) {
2734 VisitStmt(D);
2735 Record.push_back(D->getNumClauses());
2736 VisitOMPExecutableDirective(D);
2738}
2739
2740void ASTStmtWriter::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) {
2741 VisitStmt(D);
2742 VisitOMPExecutableDirective(D);
2744}
2745
2746void ASTStmtWriter::VisitOMPFlushDirective(OMPFlushDirective *D) {
2747 VisitStmt(D);
2748 VisitOMPExecutableDirective(D);
2750}
2751
2752void ASTStmtWriter::VisitOMPDepobjDirective(OMPDepobjDirective *D) {
2753 VisitStmt(D);
2754 VisitOMPExecutableDirective(D);
2756}
2757
2758void ASTStmtWriter::VisitOMPScanDirective(OMPScanDirective *D) {
2759 VisitStmt(D);
2760 VisitOMPExecutableDirective(D);
2762}
2763
2764void ASTStmtWriter::VisitOMPOrderedDirective(OMPOrderedDirective *D) {
2765 VisitStmt(D);
2766 VisitOMPExecutableDirective(D);
2768}
2769
2770void ASTStmtWriter::VisitOMPTeamsDirective(OMPTeamsDirective *D) {
2771 VisitStmt(D);
2772 VisitOMPExecutableDirective(D);
2774}
2775
2776void ASTStmtWriter::VisitOMPCancellationPointDirective(
2777 OMPCancellationPointDirective *D) {
2778 VisitStmt(D);
2779 VisitOMPExecutableDirective(D);
2780 Record.writeEnum(D->getCancelRegion());
2782}
2783
2784void ASTStmtWriter::VisitOMPCancelDirective(OMPCancelDirective *D) {
2785 VisitStmt(D);
2786 VisitOMPExecutableDirective(D);
2787 Record.writeEnum(D->getCancelRegion());
2789}
2790
2791void ASTStmtWriter::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) {
2792 VisitOMPLoopDirective(D);
2793 Record.writeBool(D->hasCancel());
2795}
2796
2797void ASTStmtWriter::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) {
2798 VisitOMPLoopDirective(D);
2800}
2801
2802void ASTStmtWriter::VisitOMPMasterTaskLoopDirective(
2803 OMPMasterTaskLoopDirective *D) {
2804 VisitOMPLoopDirective(D);
2805 Record.writeBool(D->hasCancel());
2807}
2808
2809void ASTStmtWriter::VisitOMPMaskedTaskLoopDirective(
2810 OMPMaskedTaskLoopDirective *D) {
2811 VisitOMPLoopDirective(D);
2812 Record.writeBool(D->hasCancel());
2814}
2815
2816void ASTStmtWriter::VisitOMPMasterTaskLoopSimdDirective(
2817 OMPMasterTaskLoopSimdDirective *D) {
2818 VisitOMPLoopDirective(D);
2820}
2821
2822void ASTStmtWriter::VisitOMPMaskedTaskLoopSimdDirective(
2823 OMPMaskedTaskLoopSimdDirective *D) {
2824 VisitOMPLoopDirective(D);
2826}
2827
2828void ASTStmtWriter::VisitOMPParallelMasterTaskLoopDirective(
2829 OMPParallelMasterTaskLoopDirective *D) {
2830 VisitOMPLoopDirective(D);
2831 Record.writeBool(D->hasCancel());
2833}
2834
2835void ASTStmtWriter::VisitOMPParallelMaskedTaskLoopDirective(
2836 OMPParallelMaskedTaskLoopDirective *D) {
2837 VisitOMPLoopDirective(D);
2838 Record.writeBool(D->hasCancel());
2840}
2841
2842void ASTStmtWriter::VisitOMPParallelMasterTaskLoopSimdDirective(
2843 OMPParallelMasterTaskLoopSimdDirective *D) {
2844 VisitOMPLoopDirective(D);
2846}
2847
2848void ASTStmtWriter::VisitOMPParallelMaskedTaskLoopSimdDirective(
2849 OMPParallelMaskedTaskLoopSimdDirective *D) {
2850 VisitOMPLoopDirective(D);
2852}
2853
2854void ASTStmtWriter::VisitOMPDistributeDirective(OMPDistributeDirective *D) {
2855 VisitOMPLoopDirective(D);
2857}
2858
2859void ASTStmtWriter::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) {
2860 VisitStmt(D);
2861 VisitOMPExecutableDirective(D);
2863}
2864
2865void ASTStmtWriter::VisitOMPDistributeParallelForDirective(
2866 OMPDistributeParallelForDirective *D) {
2867 VisitOMPLoopDirective(D);
2868 Record.writeBool(D->hasCancel());
2870}
2871
2872void ASTStmtWriter::VisitOMPDistributeParallelForSimdDirective(
2873 OMPDistributeParallelForSimdDirective *D) {
2874 VisitOMPLoopDirective(D);
2876}
2877
2878void ASTStmtWriter::VisitOMPDistributeSimdDirective(
2879 OMPDistributeSimdDirective *D) {
2880 VisitOMPLoopDirective(D);
2882}
2883
2884void ASTStmtWriter::VisitOMPTargetParallelForSimdDirective(
2885 OMPTargetParallelForSimdDirective *D) {
2886 VisitOMPLoopDirective(D);
2888}
2889
2890void ASTStmtWriter::VisitOMPTargetSimdDirective(OMPTargetSimdDirective *D) {
2891 VisitOMPLoopDirective(D);
2893}
2894
2895void ASTStmtWriter::VisitOMPTeamsDistributeDirective(
2896 OMPTeamsDistributeDirective *D) {
2897 VisitOMPLoopDirective(D);
2899}
2900
2901void ASTStmtWriter::VisitOMPTeamsDistributeSimdDirective(
2902 OMPTeamsDistributeSimdDirective *D) {
2903 VisitOMPLoopDirective(D);
2905}
2906
2907void ASTStmtWriter::VisitOMPTeamsDistributeParallelForSimdDirective(
2908 OMPTeamsDistributeParallelForSimdDirective *D) {
2909 VisitOMPLoopDirective(D);
2911}
2912
2913void ASTStmtWriter::VisitOMPTeamsDistributeParallelForDirective(
2914 OMPTeamsDistributeParallelForDirective *D) {
2915 VisitOMPLoopDirective(D);
2916 Record.writeBool(D->hasCancel());
2918}
2919
2920void ASTStmtWriter::VisitOMPTargetTeamsDirective(OMPTargetTeamsDirective *D) {
2921 VisitStmt(D);
2922 VisitOMPExecutableDirective(D);
2924}
2925
2926void ASTStmtWriter::VisitOMPTargetTeamsDistributeDirective(
2927 OMPTargetTeamsDistributeDirective *D) {
2928 VisitOMPLoopDirective(D);
2930}
2931
2932void ASTStmtWriter::VisitOMPTargetTeamsDistributeParallelForDirective(
2933 OMPTargetTeamsDistributeParallelForDirective *D) {
2934 VisitOMPLoopDirective(D);
2935 Record.writeBool(D->hasCancel());
2937}
2938
2939void ASTStmtWriter::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
2940 OMPTargetTeamsDistributeParallelForSimdDirective *D) {
2941 VisitOMPLoopDirective(D);
2942 Code = serialization::
2943 STMT_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE;
2944}
2945
2946void ASTStmtWriter::VisitOMPTargetTeamsDistributeSimdDirective(
2947 OMPTargetTeamsDistributeSimdDirective *D) {
2948 VisitOMPLoopDirective(D);
2950}
2951
2952void ASTStmtWriter::VisitOMPInteropDirective(OMPInteropDirective *D) {
2953 VisitStmt(D);
2954 VisitOMPExecutableDirective(D);
2956}
2957
2958void ASTStmtWriter::VisitOMPDispatchDirective(OMPDispatchDirective *D) {
2959 VisitStmt(D);
2960 VisitOMPExecutableDirective(D);
2961 Record.AddSourceLocation(D->getTargetCallLoc());
2963}
2964
2965void ASTStmtWriter::VisitOMPMaskedDirective(OMPMaskedDirective *D) {
2966 VisitStmt(D);
2967 VisitOMPExecutableDirective(D);
2969}
2970
2971void ASTStmtWriter::VisitOMPGenericLoopDirective(OMPGenericLoopDirective *D) {
2972 VisitOMPLoopDirective(D);
2974}
2975
2976void ASTStmtWriter::VisitOMPTeamsGenericLoopDirective(
2977 OMPTeamsGenericLoopDirective *D) {
2978 VisitOMPLoopDirective(D);
2980}
2981
2982void ASTStmtWriter::VisitOMPTargetTeamsGenericLoopDirective(
2983 OMPTargetTeamsGenericLoopDirective *D) {
2984 VisitOMPLoopDirective(D);
2985 Record.writeBool(D->canBeParallelFor());
2987}
2988
2989void ASTStmtWriter::VisitOMPParallelGenericLoopDirective(
2990 OMPParallelGenericLoopDirective *D) {
2991 VisitOMPLoopDirective(D);
2993}
2994
2995void ASTStmtWriter::VisitOMPTargetParallelGenericLoopDirective(
2996 OMPTargetParallelGenericLoopDirective *D) {
2997 VisitOMPLoopDirective(D);
2999}
3000
3001//===----------------------------------------------------------------------===//
3002// OpenACC Constructs/Directives.
3003//===----------------------------------------------------------------------===//
3004void ASTStmtWriter::VisitOpenACCConstructStmt(OpenACCConstructStmt *S) {
3005 Record.push_back(S->clauses().size());
3006 Record.writeEnum(S->Kind);
3007 Record.AddSourceRange(S->Range);
3008 Record.AddSourceLocation(S->DirectiveLoc);
3009 Record.writeOpenACCClauseList(S->clauses());
3010}
3011
3012void ASTStmtWriter::VisitOpenACCAssociatedStmtConstruct(
3014 VisitOpenACCConstructStmt(S);
3015 Record.AddStmt(S->getAssociatedStmt());
3016}
3017
3018void ASTStmtWriter::VisitOpenACCComputeConstruct(OpenACCComputeConstruct *S) {
3019 VisitStmt(S);
3020 VisitOpenACCAssociatedStmtConstruct(S);
3022}
3023
3024void ASTStmtWriter::VisitOpenACCLoopConstruct(OpenACCLoopConstruct *S) {
3025 VisitStmt(S);
3026 VisitOpenACCAssociatedStmtConstruct(S);
3027 Record.writeEnum(S->getParentComputeConstructKind());
3029}
3030
3031void ASTStmtWriter::VisitOpenACCCombinedConstruct(OpenACCCombinedConstruct *S) {
3032 VisitStmt(S);
3033 VisitOpenACCAssociatedStmtConstruct(S);
3035}
3036
3037void ASTStmtWriter::VisitOpenACCDataConstruct(OpenACCDataConstruct *S) {
3038 VisitStmt(S);
3039 VisitOpenACCAssociatedStmtConstruct(S);
3041}
3042
3043void ASTStmtWriter::VisitOpenACCEnterDataConstruct(
3044 OpenACCEnterDataConstruct *S) {
3045 VisitStmt(S);
3046 VisitOpenACCConstructStmt(S);
3048}
3049
3050void ASTStmtWriter::VisitOpenACCExitDataConstruct(OpenACCExitDataConstruct *S) {
3051 VisitStmt(S);
3052 VisitOpenACCConstructStmt(S);
3054}
3055
3056void ASTStmtWriter::VisitOpenACCInitConstruct(OpenACCInitConstruct *S) {
3057 VisitStmt(S);
3058 VisitOpenACCConstructStmt(S);
3060}
3061
3062void ASTStmtWriter::VisitOpenACCShutdownConstruct(OpenACCShutdownConstruct *S) {
3063 VisitStmt(S);
3064 VisitOpenACCConstructStmt(S);
3066}
3067
3068void ASTStmtWriter::VisitOpenACCSetConstruct(OpenACCSetConstruct *S) {
3069 VisitStmt(S);
3070 VisitOpenACCConstructStmt(S);
3072}
3073
3074void ASTStmtWriter::VisitOpenACCUpdateConstruct(OpenACCUpdateConstruct *S) {
3075 VisitStmt(S);
3076 VisitOpenACCConstructStmt(S);
3078}
3079
3080void ASTStmtWriter::VisitOpenACCHostDataConstruct(OpenACCHostDataConstruct *S) {
3081 VisitStmt(S);
3082 VisitOpenACCAssociatedStmtConstruct(S);
3084}
3085
3086void ASTStmtWriter::VisitOpenACCWaitConstruct(OpenACCWaitConstruct *S) {
3087 VisitStmt(S);
3088 Record.push_back(S->getExprs().size());
3089 VisitOpenACCConstructStmt(S);
3090 Record.AddSourceLocation(S->LParenLoc);
3091 Record.AddSourceLocation(S->RParenLoc);
3092 Record.AddSourceLocation(S->QueuesLoc);
3093
3094 for(Expr *E : S->getExprs())
3095 Record.AddStmt(E);
3096
3098}
3099
3100void ASTStmtWriter::VisitOpenACCAtomicConstruct(OpenACCAtomicConstruct *S) {
3101 VisitStmt(S);
3102 VisitOpenACCConstructStmt(S);
3103 Record.writeEnum(S->getAtomicKind());
3104 Record.AddStmt(S->getAssociatedStmt());
3105
3107}
3108
3109void ASTStmtWriter::VisitOpenACCCacheConstruct(OpenACCCacheConstruct *S) {
3110 VisitStmt(S);
3111 Record.push_back(S->getVarList().size());
3112 VisitOpenACCConstructStmt(S);
3113 Record.AddSourceRange(S->ParensLoc);
3114 Record.AddSourceLocation(S->ReadOnlyLoc);
3115
3116 for (Expr *E : S->getVarList())
3117 Record.AddStmt(E);
3119}
3120
3121//===----------------------------------------------------------------------===//
3122// HLSL Constructs/Directives.
3123//===----------------------------------------------------------------------===//
3124
3125void ASTStmtWriter::VisitHLSLOutArgExpr(HLSLOutArgExpr *S) {
3126 VisitExpr(S);
3127 Record.AddStmt(S->getOpaqueArgLValue());
3128 Record.AddStmt(S->getCastedTemporary());
3129 Record.AddStmt(S->getWritebackCast());
3130 Record.writeBool(S->isInOut());
3132}
3133
3134//===----------------------------------------------------------------------===//
3135// ASTWriter Implementation
3136//===----------------------------------------------------------------------===//
3137
3139 assert(!SwitchCaseIDs.contains(S) && "SwitchCase recorded twice");
3140 unsigned NextID = SwitchCaseIDs.size();
3141 SwitchCaseIDs[S] = NextID;
3142 return NextID;
3143}
3144
3146 assert(SwitchCaseIDs.contains(S) && "SwitchCase hasn't been seen yet");
3147 return SwitchCaseIDs[S];
3148}
3149
3151 SwitchCaseIDs.clear();
3152}
3153
3154/// Write the given substatement or subexpression to the
3155/// bitstream.
3156void ASTWriter::WriteSubStmt(ASTContext &Context, Stmt *S) {
3158 ASTStmtWriter Writer(Context, *this, Record);
3159 ++NumStatements;
3160
3161 if (!S) {
3162 Stream.EmitRecord(serialization::STMT_NULL_PTR, Record);
3163 return;
3164 }
3165
3166 llvm::DenseMap<Stmt *, uint64_t>::iterator I = SubStmtEntries.find(S);
3167 if (I != SubStmtEntries.end()) {
3168 Record.push_back(I->second);
3169 Stream.EmitRecord(serialization::STMT_REF_PTR, Record);
3170 return;
3171 }
3172
3173#ifndef NDEBUG
3174 assert(!ParentStmts.count(S) && "There is a Stmt cycle!");
3175
3176 struct ParentStmtInserterRAII {
3177 Stmt *S;
3178 llvm::DenseSet<Stmt *> &ParentStmts;
3179
3180 ParentStmtInserterRAII(Stmt *S, llvm::DenseSet<Stmt *> &ParentStmts)
3181 : S(S), ParentStmts(ParentStmts) {
3182 ParentStmts.insert(S);
3183 }
3184 ~ParentStmtInserterRAII() {
3185 ParentStmts.erase(S);
3186 }
3187 };
3188
3189 ParentStmtInserterRAII ParentStmtInserter(S, ParentStmts);
3190#endif
3191
3192 Writer.Visit(S);
3193
3194 uint64_t Offset = Writer.Emit();
3195 SubStmtEntries[S] = Offset;
3196}
3197
3198/// Flush all of the statements that have been added to the
3199/// queue via AddStmt().
3200void ASTRecordWriter::FlushStmts() {
3201 // We expect to be the only consumer of the two temporary statement maps,
3202 // assert that they are empty.
3203 assert(Writer->SubStmtEntries.empty() && "unexpected entries in sub-stmt map");
3204 assert(Writer->ParentStmts.empty() && "unexpected entries in parent stmt map");
3205
3206 for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) {
3207 Writer->WriteSubStmt(getASTContext(), StmtsToEmit[I]);
3208
3209 assert(N == StmtsToEmit.size() && "record modified while being written!");
3210
3211 // Note that we are at the end of a full expression. Any
3212 // expression records that follow this one are part of a different
3213 // expression.
3214 Writer->Stream.EmitRecord(serialization::STMT_STOP, ArrayRef<uint32_t>());
3215
3216 Writer->SubStmtEntries.clear();
3217 Writer->ParentStmts.clear();
3218 }
3219
3220 StmtsToEmit.clear();
3221}
3222
3223void ASTRecordWriter::FlushSubStmts() {
3224 // For a nested statement, write out the substatements in reverse order (so
3225 // that a simple stack machine can be used when loading), and don't emit a
3226 // STMT_STOP after each one.
3227 for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) {
3228 Writer->WriteSubStmt(getASTContext(), StmtsToEmit[N - I - 1]);
3229 assert(N == StmtsToEmit.size() && "record modified while being written!");
3230 }
3231
3232 StmtsToEmit.clear();
3233}
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
C Language Family Type Representation.
OpenMPDirectiveKind getCancelRegion() const
Get cancellation region for the current cancellation point.
OpenMPDirectiveKind getCancelRegion() const
Get cancellation region for the current cancellation point.
SourceLocation getTargetCallLoc() const
Return location of target-call.
bool hasCancel() const
Return true if current directive has inner cancel directive.
bool hasCancel() const
Return true if current directive has inner cancel directive.
bool hasCancel() const
Return true if current directive has inner cancel directive.
bool hasCancel() const
Return true if current directive has inner cancel directive.
bool hasCancel() const
Return true if current directive has inner cancel directive.
bool hasCancel() const
Return true if current directive has inner cancel directive.
bool hasCancel() const
Return true if current directive has inner cancel directive.
bool hasCancel() const
Return true if current directive has inner cancel directive.
bool canBeParallelFor() const
Return true if current loop directive's associated loop can be a parallel for.
bool hasCancel() const
Return true if current directive has inner cancel directive.
bool hasCancel() const
Return true if current directive has inner cancel directive.
const Stmt * getAssociatedStmt() const
OpenACCAtomicKind getAtomicKind() const
ArrayRef< Expr * > getVarList() const
OpenACCDirectiveKind getParentComputeConstructKind() const
unsigned getBitWidth() const
llvm::APInt getValue() const
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition ASTContext.h:227
An object for streaming information to a record.
void push_back(uint64_t N)
Minimal vector-like interface.
void AddTemplateKWAndArgsInfo(const ASTTemplateKWAndArgsInfo &ArgInfo, const TemplateArgumentLoc *Args)
ASTStmtWriter(const ASTStmtWriter &)=delete
ASTStmtWriter & operator=(const ASTStmtWriter &)=delete
ASTStmtWriter(ASTContext &Context, ASTWriter &Writer, ASTWriter::RecordData &Record)
Writes an AST file containing the contents of a translation unit.
Definition ASTWriter.h:97
unsigned getSwitchCaseID(SwitchCase *S)
Retrieve the ID for the given switch-case statement.
unsigned RecordSwitchCaseID(SwitchCase *S)
Record an ID for the given switch-case statement.
unsigned getCompoundStmtAbbrev() const
Definition ASTWriter.h:915
SmallVector< uint64_t, 64 > RecordData
Definition ASTWriter.h:102
SourceLocation getColonLoc() const
Definition Expr.h:4384
SourceLocation getQuestionLoc() const
Definition Expr.h:4383
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition Expr.h:4553
SourceLocation getAmpAmpLoc() const
Definition Expr.h:4568
SourceLocation getLabelLoc() const
Definition Expr.h:4570
LabelDecl * getLabel() const
Definition Expr.h:4576
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Definition Expr.h:6024
Represents a loop initializing the elements of an array.
Definition Expr.h:5971
This class represents BOTH the OpenMP Array Section and OpenACC 'subarray', with a boolean differenti...
Definition Expr.h:7218
SourceLocation getRBracketLoc() const
Definition Expr.h:7333
Expr * getBase()
Get base of the array section.
Definition Expr.h:7296
Expr * getLength()
Get length of array section.
Definition Expr.h:7306
bool isOMPArraySection() const
Definition Expr.h:7292
Expr * getStride()
Get stride of array section.
Definition Expr.h:7310
SourceLocation getColonLocSecond() const
Definition Expr.h:7328
Expr * getLowerBound()
Get lower bound of array section.
Definition Expr.h:7300
SourceLocation getColonLocFirst() const
Definition Expr.h:7327
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition Expr.h:2724
SourceLocation getRBracketLoc() const
Definition Expr.h:2772
Expr * getLHS()
An array access can be written A[4] or 4[A] (both are equivalent).
Definition Expr.h:2753
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
Definition ExprCXX.h:3000
uint64_t getValue() const
Definition ExprCXX.h:3048
ArrayTypeTrait getTrait() const
Definition ExprCXX.h:3040
Expr * getDimensionExpression() const
Definition ExprCXX.h:3050
TypeSourceInfo * getQueriedTypeSourceInfo() const
Definition ExprCXX.h:3046
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Definition Expr.h:6732
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition Expr.h:6751
SourceLocation getBuiltinLoc() const
getBuiltinLoc - Return the location of the __builtin_astype token.
Definition Expr.h:6754
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
Definition Expr.h:6757
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
Definition Stmt.h:3283
bool isVolatile() const
Definition Stmt.h:3319
SourceLocation getAsmLoc() const
Definition Stmt.h:3313
unsigned getNumClobbers() const
Definition Stmt.h:3374
unsigned getNumOutputs() const
Definition Stmt.h:3342
unsigned getNumInputs() const
Definition Stmt.h:3364
bool isSimple() const
Definition Stmt.h:3316
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Definition Expr.h:6927
Expr ** getSubExprs()
Definition Expr.h:7002
SourceLocation getRParenLoc() const
Definition Expr.h:7056
static unsigned getNumSubExprs(AtomicOp Op)
Determine the number of arguments the specified atomic builtin should have.
Definition Expr.cpp:5268
AtomicOp getOp() const
Definition Expr.h:6990
SourceLocation getBuiltinLoc() const
Definition Expr.h:7055
Represents an attribute applied to a statement.
Definition Stmt.h:2209
Stmt * getSubStmt()
Definition Stmt.h:2245
SourceLocation getAttrLoc() const
Definition Stmt.h:2240
ArrayRef< const Attr * > getAttrs() const
Definition Stmt.h:2241
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Definition Expr.h:4456
Expr * getFalseExpr() const
getFalseExpr - Return the subexpression which will be evaluated if the condition evaluates to false; ...
Definition Expr.h:4510
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
Definition Expr.h:4494
Expr * getCond() const
getCond - Return the condition expression; this is defined in terms of the opaque value.
Definition Expr.h:4498
Expr * getTrueExpr() const
getTrueExpr - Return the subexpression which will be evaluated if the condition evaluates to true; th...
Definition Expr.h:4503
Expr * getCommon() const
getCommon - Return the common expression, written to the left of the condition.
Definition Expr.h:4491
A builtin binary operation expression such as "x + y" or "x <= y".
Definition Expr.h:4041
Expr * getLHS() const
Definition Expr.h:4091
SourceLocation getOperatorLoc() const
Definition Expr.h:4083
bool hasStoredFPFeatures() const
Definition Expr.h:4226
Expr * getRHS() const
Definition Expr.h:4093
FPOptionsOverride getStoredFPFeatures() const
Get FPFeatures from trailing storage.
Definition Expr.h:4238
Opcode getOpcode() const
Definition Expr.h:4086
bool hasExcludedOverflowPattern() const
Definition Expr.h:4233
A simple helper class to pack several bits in order into (a) 32 bit integer(s).
Definition ASTWriter.h:1086
void addBit(bool Value)
Definition ASTWriter.h:1106
void addBits(uint32_t Value, uint32_t BitsWidth)
Definition ASTWriter.h:1107
void reset(uint32_t Value)
Definition ASTWriter.h:1101
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition Expr.h:6671
const BlockDecl * getBlockDecl() const
Definition Expr.h:6683
BreakStmt - This represents a break.
Definition Stmt.h:3141
Represents a C++2a __builtin_bit_cast(T, v) expression.
Definition ExprCXX.h:5476
SourceLocation getEndLoc() const LLVM_READONLY
Definition ExprCXX.h:5495
SourceLocation getBeginLoc() const LLVM_READONLY
Definition ExprCXX.h:5494
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr....
Definition Expr.h:3972
SourceLocation getRParenLoc() const
Definition Expr.h:4007
SourceLocation getLParenLoc() const
Definition Expr.h:4004
Represents a call to a CUDA kernel function.
Definition ExprCXX.h:238
const CallExpr * getConfig() const
Definition ExprCXX.h:264
A C++ addrspace_cast expression (currently only enabled for OpenCL).
Definition ExprCXX.h:608
Represents binding an expression to a temporary.
Definition ExprCXX.h:1497
CXXTemporary * getTemporary()
Definition ExprCXX.h:1515
const Expr * getSubExpr() const
Definition ExprCXX.h:1519
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition ExprCXX.h:727
bool getValue() const
Definition ExprCXX.h:744
SourceLocation getLocation() const
Definition ExprCXX.h:750
CXXCatchStmt - This represents a C++ catch block.
Definition StmtCXX.h:28
SourceLocation getCatchLoc() const
Definition StmtCXX.h:48
Stmt * getHandlerBlock() const
Definition StmtCXX.h:51
VarDecl * getExceptionDecl() const
Definition StmtCXX.h:49
A C++ const_cast expression (C++ [expr.const.cast]).
Definition ExprCXX.h:570
Represents a call to a C++ constructor.
Definition ExprCXX.h:1552
SourceRange getParenOrBraceRange() const
Definition ExprCXX.h:1733
bool isElidable() const
Whether this construction is elidable.
Definition ExprCXX.h:1621
bool hadMultipleCandidates() const
Whether the referred constructor was resolved from an overloaded set having size greater than 1.
Definition ExprCXX.h:1626
Expr * getArg(unsigned Arg)
Return the specified argument.
Definition ExprCXX.h:1695
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
Definition ExprCXX.h:1645
bool isImmediateEscalating() const
Definition ExprCXX.h:1710
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called.
Definition ExprCXX.h:1654
SourceLocation getLocation() const
Definition ExprCXX.h:1617
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
Definition ExprCXX.h:1615
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
Definition ExprCXX.h:1634
unsigned getNumArgs() const
Return the number of arguments to the constructor call.
Definition ExprCXX.h:1692
CXXConstructionKind getConstructionKind() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
Definition ExprCXX.h:1663
A default argument (C++ [dcl.fct.default]).
Definition ExprCXX.h:1274
SourceLocation getUsedLocation() const
Retrieve the location where this default argument was actually used.
Definition ExprCXX.h:1348
const ParmVarDecl * getParam() const
Definition ExprCXX.h:1316
const DeclContext * getUsedContext() const
Definition ExprCXX.h:1344
bool hasRewrittenInit() const
Definition ExprCXX.h:1319
A use of a default initializer in a constructor or in aggregate initialization.
Definition ExprCXX.h:1381
const DeclContext * getUsedContext() const
Definition ExprCXX.h:1438
const Expr * getRewrittenExpr() const
Retrieve the initializing expression with evaluated immediate calls, if any.
Definition ExprCXX.h:1426
bool hasRewrittenInit() const
Definition ExprCXX.h:1410
FieldDecl * getField()
Get the field whose initializer will be used.
Definition ExprCXX.h:1415
Represents a delete expression for memory deallocation and destructor calls, e.g.
Definition ExprCXX.h:2630
FunctionDecl * getOperatorDelete() const
Definition ExprCXX.h:2669
bool isArrayForm() const
Definition ExprCXX.h:2656
SourceLocation getBeginLoc() const
Definition ExprCXX.h:2680
bool isGlobalDelete() const
Definition ExprCXX.h:2655
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
Definition ExprCXX.h:2665
bool isArrayFormAsWritten() const
Definition ExprCXX.h:2657
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition ExprCXX.h:3870
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '.
Definition ExprCXX.h:3969
SourceLocation getOperatorLoc() const
Retrieve the location of the '->' or '.' operator.
Definition ExprCXX.h:3972
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition ExprCXX.h:4064
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:3996
Expr * getBase() const
Retrieve the base object of this member expressions, e.g., the x in x.m.
Definition ExprCXX.h:3960
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the member name, with source location information.
Definition ExprCXX.h:3983
bool isImplicitAccess() const
True if this is an implicit access, i.e.
Definition ExprCXX.h:3952
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Definition ExprCXX.h:485
Represents a folding of a pack over an operator.
Definition ExprCXX.h:5032
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
Definition StmtCXX.h:135
DeclStmt * getBeginStmt()
Definition StmtCXX.h:163
DeclStmt * getLoopVarStmt()
Definition StmtCXX.h:169
DeclStmt * getEndStmt()
Definition StmtCXX.h:166
SourceLocation getForLoc() const
Definition StmtCXX.h:202
DeclStmt * getRangeStmt()
Definition StmtCXX.h:162
SourceLocation getRParenLoc() const
Definition StmtCXX.h:205
SourceLocation getColonLoc() const
Definition StmtCXX.h:204
SourceLocation getCoawaitLoc() const
Definition StmtCXX.h:203
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr....
Definition ExprCXX.h:1835
SourceLocation getLParenLoc() const
Definition ExprCXX.h:1872
SourceLocation getRParenLoc() const
Definition ExprCXX.h:1874
Represents a call to an inherited base class constructor from an inheriting constructor.
Definition ExprCXX.h:1755
bool constructsVBase() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
Definition ExprCXX.h:1796
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will call.
Definition ExprCXX.h:1792
SourceLocation getLocation() const LLVM_READONLY
Definition ExprCXX.h:1808
bool inheritedFromVBase() const
Determine whether the inherited constructor is inherited from a virtual base of the object we constru...
Definition ExprCXX.h:1806
Represents a call to a member function that may be written either with member call syntax (e....
Definition ExprCXX.h:183
Abstract class common to all of the C++ "named"/"keyword" casts.
Definition ExprCXX.h:379
SourceLocation getOperatorLoc() const
Retrieve the location of the cast operator keyword, e.g., static_cast.
Definition ExprCXX.h:410
SourceRange getAngleBrackets() const LLVM_READONLY
Definition ExprCXX.h:417
SourceLocation getRParenLoc() const
Retrieve the location of the closing parenthesis.
Definition ExprCXX.h:413
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Definition ExprCXX.h:2359
bool isArray() const
Definition ExprCXX.h:2468
SourceRange getDirectInitRange() const
Definition ExprCXX.h:2613
ExprIterator arg_iterator
Definition ExprCXX.h:2573
ImplicitAllocationParameters implicitAllocationParameters() const
Provides the full set of information about expected implicit parameters in this call.
Definition ExprCXX.h:2566
bool hasInitializer() const
Whether this new-expression has any initializer at all.
Definition ExprCXX.h:2528
FunctionDecl * getOperatorDelete() const
Definition ExprCXX.h:2465
unsigned getNumPlacementArgs() const
Definition ExprCXX.h:2498
TypeSourceInfo * getAllocatedTypeSourceInfo() const
Definition ExprCXX.h:2442
SourceRange getSourceRange() const
Definition ExprCXX.h:2614
SourceRange getTypeIdParens() const
Definition ExprCXX.h:2520
bool isParenTypeId() const
Definition ExprCXX.h:2519
raw_arg_iterator raw_arg_end()
Definition ExprCXX.h:2600
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
Definition ExprCXX.h:2560
raw_arg_iterator raw_arg_begin()
Definition ExprCXX.h:2599
FunctionDecl * getOperatorNew() const
Definition ExprCXX.h:2463
bool isGlobalNew() const
Definition ExprCXX.h:2525
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition ExprCXX.h:4309
bool getValue() const
Definition ExprCXX.h:4332
Expr * getOperand() const
Definition ExprCXX.h:4326
SourceRange getSourceRange() const
Definition ExprCXX.h:4330
The null pointer literal (C++11 [lex.nullptr])
Definition ExprCXX.h:772
SourceLocation getLocation() const
Definition ExprCXX.h:786
A call to an overloaded operator written using operator syntax.
Definition ExprCXX.h:85
bool isReversed() const
Whether this is a C++20 rewritten reversed operator.
Definition ExprCXX.h:146
OverloadedOperatorKind getOperator() const
Returns the kind of overloaded operator that this expression refers to.
Definition ExprCXX.h:115
Represents a list-initialization with parenthesis.
Definition ExprCXX.h:5141
SourceLocation getEndLoc() const LLVM_READONLY
Definition ExprCXX.h:5197
SourceLocation getInitLoc() const LLVM_READONLY
Definition ExprCXX.h:5199
MutableArrayRef< Expr * > getInitExprs()
Definition ExprCXX.h:5181
ArrayRef< Expr * > getUserSpecifiedInitExprs()
Definition ExprCXX.h:5187
SourceLocation getBeginLoc() const LLVM_READONLY
Definition ExprCXX.h:5195
FieldDecl * getInitializedFieldInUnion()
Definition ExprCXX.h:5219
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition ExprCXX.h:2749
TypeSourceInfo * getDestroyedTypeInfo() const
Retrieve the source location information for the type being destroyed.
Definition ExprCXX.h:2843
bool isArrow() const
Determine whether this pseudo-destructor expression was written using an '->' (otherwise,...
Definition ExprCXX.h:2813
TypeSourceInfo * getScopeTypeInfo() const
Retrieve the scope type in a qualified pseudo-destructor expression.
Definition ExprCXX.h:2827
SourceLocation getTildeLoc() const
Retrieve the location of the '~'.
Definition ExprCXX.h:2834
NestedNameSpecifierLoc getQualifierLoc() const
Retrieves the nested-name-specifier that qualifies the type name, with source-location information.
Definition ExprCXX.h:2802
SourceLocation getDestroyedTypeLoc() const
Retrieve the starting location of the type being destroyed.
Definition ExprCXX.h:2858
SourceLocation getColonColonLoc() const
Retrieve the location of the '::' in a qualified pseudo-destructor expression.
Definition ExprCXX.h:2831
SourceLocation getOperatorLoc() const
Retrieve the location of the '.' or '->' operator.
Definition ExprCXX.h:2816
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:2850
Represents a C++26 reflect expression [expr.reflect].
Definition ExprCXX.h:5508
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
Definition ExprCXX.h:530
A rewritten comparison expression that was originally written using operator syntax.
Definition ExprCXX.h:290
Expr * getSemanticForm()
Get an equivalent semantic form for this expression.
Definition ExprCXX.h:308
bool isReversed() const
Determine whether this expression was rewritten in reverse form.
Definition ExprCXX.h:326
An expression "T()" which creates an rvalue of a non-class type T.
Definition ExprCXX.h:2200
TypeSourceInfo * getTypeSourceInfo() const
Definition ExprCXX.h:2219
SourceLocation getRParenLoc() const
Definition ExprCXX.h:2223
A C++ static_cast expression (C++ [expr.static.cast]).
Definition ExprCXX.h:440
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition ExprCXX.h:804
Represents a C++ functional cast expression that builds a temporary object.
Definition ExprCXX.h:1903
TypeSourceInfo * getTypeSourceInfo() const
Definition ExprCXX.h:1932
Represents the this expression in C++.
Definition ExprCXX.h:1158
bool isCapturedByCopyInLambdaWithExplicitObjectParameter() const
Definition ExprCXX.h:1184
bool isImplicit() const
Definition ExprCXX.h:1181
SourceLocation getLocation() const
Definition ExprCXX.h:1175
A C++ throw-expression (C++ [except.throw]).
Definition ExprCXX.h:1212
const Expr * getSubExpr() const
Definition ExprCXX.h:1232
SourceLocation getThrowLoc() const
Definition ExprCXX.h:1235
bool isThrownVariableInScope() const
Determines whether the variable thrown by this expression (if any!) is within the innermost try block...
Definition ExprCXX.h:1242
CXXTryStmt - A C++ try block, including all handlers.
Definition StmtCXX.h:69
SourceLocation getTryLoc() const
Definition StmtCXX.h:95
CXXCatchStmt * getHandler(unsigned i)
Definition StmtCXX.h:108
unsigned getNumHandlers() const
Definition StmtCXX.h:107
CompoundStmt * getTryBlock()
Definition StmtCXX.h:100
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition ExprCXX.h:852
bool isTypeOperand() const
Definition ExprCXX.h:888
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition ExprCXX.h:895
Expr * getExprOperand() const
Definition ExprCXX.h:899
SourceRange getSourceRange() const LLVM_READONLY
Definition ExprCXX.h:906
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition ExprCXX.h:3744
SourceLocation getLParenLoc() const
Retrieve the location of the left parentheses ('(') that precedes the argument list.
Definition ExprCXX.h:3788
bool isListInitialization() const
Determine whether this expression models list-initialization.
Definition ExprCXX.h:3799
TypeSourceInfo * getTypeSourceInfo() const
Retrieve the type source information for the type being constructed.
Definition ExprCXX.h:3782
SourceLocation getRParenLoc() const
Retrieve the location of the right parentheses (')') that follows the argument list.
Definition ExprCXX.h:3793
unsigned getNumArgs() const
Retrieve the number of arguments.
Definition ExprCXX.h:3802
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
Definition ExprCXX.h:1072
Expr * getExprOperand() const
Definition ExprCXX.h:1113
MSGuidDecl * getGuidDecl() const
Definition ExprCXX.h:1118
bool isTypeOperand() const
Definition ExprCXX.h:1102
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition ExprCXX.h:1109
SourceRange getSourceRange() const LLVM_READONLY
Definition ExprCXX.h:1122
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition Expr.h:2946
bool hasStoredFPFeatures() const
Definition Expr.h:3105
bool usesMemberSyntax() const
Definition Expr.h:3107
ExprIterator arg_iterator
Definition Expr.h:3193
arg_iterator arg_begin()
Definition Expr.h:3203
arg_iterator arg_end()
Definition Expr.h:3206
ADLCallKind getADLCallKind() const
Definition Expr.h:3097
Expr * getCallee()
Definition Expr.h:3093
FPOptionsOverride getFPFeatures() const
Definition Expr.h:3245
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition Expr.h:3137
bool isCoroElideSafe() const
Definition Expr.h:3120
SourceLocation getRParenLoc() const
Definition Expr.h:3277
This captures a statement into a function.
Definition Stmt.h:3943
capture_init_range capture_inits()
Definition Stmt.h:4111
CapturedDecl * getCapturedDecl()
Retrieve the outlined function declaration.
Definition Stmt.cpp:1493
capture_iterator capture_end() const
Retrieve an iterator pointing past the end of the sequence of captures.
Definition Stmt.h:4094
const RecordDecl * getCapturedRecordDecl() const
Retrieve the record declaration for captured variables.
Definition Stmt.h:4064
Stmt * getCapturedStmt()
Retrieve the statement being captured.
Definition Stmt.h:4047
capture_iterator capture_begin()
Retrieve an iterator pointing to the first capture.
Definition Stmt.h:4089
capture_range captures()
Definition Stmt.h:4081
CapturedRegionKind getCapturedRegionKind() const
Retrieve the captured region kind.
Definition Stmt.cpp:1508
CaseStmt - Represent a case statement.
Definition Stmt.h:1926
Stmt * getSubStmt()
Definition Stmt.h:2039
Expr * getLHS()
Definition Stmt.h:2009
bool caseStmtIsGNURange() const
True if this case statement is of the form case LHS ... RHS, which is a GNU extension.
Definition Stmt.h:1989
SourceLocation getEllipsisLoc() const
Get the location of the ... in a case statement of the form LHS ... RHS.
Definition Stmt.h:1995
Expr * getRHS()
Definition Stmt.h:2021
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition Expr.h:3679
path_iterator path_begin()
Definition Expr.h:3749
unsigned path_size() const
Definition Expr.h:3748
CastKind getCastKind() const
Definition Expr.h:3723
bool hasStoredFPFeatures() const
Definition Expr.h:3778
path_iterator path_end()
Definition Expr.h:3750
CXXBaseSpecifier ** path_iterator
Definition Expr.h:3745
FPOptionsOverride getFPFeatures() const
Definition Expr.h:3799
Expr * getSubExpr()
Definition Expr.h:3729
SourceLocation getLocation() const
Definition Expr.h:1624
unsigned getValue() const
Definition Expr.h:1632
CharacterLiteralKind getKind() const
Definition Expr.h:1625
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition Expr.h:4851
SourceLocation getBuiltinLoc() const
Definition Expr.h:4898
Expr * getLHS() const
Definition Expr.h:4893
bool isConditionDependent() const
Definition Expr.h:4881
bool isConditionTrue() const
isConditionTrue - Return whether the condition is true (i.e.
Definition Expr.h:4874
Expr * getRHS() const
Definition Expr.h:4895
SourceLocation getRParenLoc() const
Definition Expr.h:4901
Expr * getCond() const
Definition Expr.h:4891
Represents a 'co_await' expression.
Definition ExprCXX.h:5369
bool isImplicit() const
Definition ExprCXX.h:5391
CompoundAssignOperator - For compound assignments (e.g.
Definition Expr.h:4303
QualType getComputationLHSType() const
Definition Expr.h:4337
QualType getComputationResultType() const
Definition Expr.h:4340
CompoundLiteralExpr - [C99 6.5.2.5].
Definition Expr.h:3608
SourceLocation getLParenLoc() const
Definition Expr.h:3643
bool isFileScope() const
Definition Expr.h:3640
const Expr * getInitializer() const
Definition Expr.h:3636
TypeSourceInfo * getTypeSourceInfo() const
Definition Expr.h:3646
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition Stmt.h:1746
unsigned size() const
Definition Stmt.h:1791
FPOptionsOverride getStoredFPFeatures() const
Get FPOptionsOverride from trailing storage.
Definition Stmt.h:1796
body_range body()
Definition Stmt.h:1809
SourceLocation getLBracLoc() const
Definition Stmt.h:1863
bool hasStoredFPFeatures() const
Definition Stmt.h:1793
SourceLocation getRBracLoc() const
Definition Stmt.h:1864
Represents the specialization of a concept - evaluates to a prvalue of type bool.
ConceptReference * getConceptReference() const
const ImplicitConceptSpecializationDecl * getSpecializationDecl() const
const ASTConstraintSatisfaction & getSatisfaction() const
Get elaborated satisfaction info about the template arguments' satisfaction of the named concept.
ConditionalOperator - The ?
Definition Expr.h:4394
Expr * getLHS() const
Definition Expr.h:4428
Expr * getCond() const
getCond - Return the expression representing the condition for the ?
Definition Expr.h:4417
Expr * getRHS() const
Definition Expr.h:4429
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition Expr.h:1085
ConstantResultStorageKind getResultStorageKind() const
Definition Expr.h:1154
ContinueStmt - This represents a continue.
Definition Stmt.h:3125
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition Expr.h:4722
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
Definition Expr.h:4826
SourceLocation getBuiltinLoc() const
getBuiltinLoc - Return the location of the __builtin_convertvector token.
Definition Expr.h:4823
FPOptionsOverride getStoredFPFeatures() const
Get FPFeatures from trailing storage.
Definition Expr.h:4785
TypeSourceInfo * getTypeSourceInfo() const
getTypeSourceInfo - Return the destination type.
Definition Expr.h:4815
bool hasStoredFPFeatures() const
Is FPFeatures in Trailing Storage?
Definition Expr.h:4780
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition Expr.h:4812
Represents a 'co_return' statement in the C++ Coroutines TS.
Definition StmtCXX.h:473
Expr * getOperand() const
Retrieve the operand of the 'co_return' statement.
Definition StmtCXX.h:497
Expr * getPromiseCall() const
Retrieve the promise call that results from this 'co_return' statement.
Definition StmtCXX.h:502
bool isImplicit() const
Definition StmtCXX.h:506
SourceLocation getKeywordLoc() const
Definition StmtCXX.h:493
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:5255
SourceLocation getKeywordLoc() const
Definition ExprCXX.h:5346
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
Definition ExprCXX.h:5309
Represents a 'co_yield' expression.
Definition ExprCXX.h:5450
NamedDecl * getDecl() const
AccessSpecifier getAccess() const
iterator begin()
Definition DeclGroup.h:95
A reference to a declared variable, function, enum, etc.
Definition Expr.h:1273
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition Expr.h:1448
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
Definition Expr.h:1384
bool refersToEnclosingVariableOrCapture() const
Does this DeclRefExpr refer to an enclosing local or a captured variable?
Definition Expr.h:1477
bool hasTemplateKWAndArgsInfo() const
Definition Expr.h:1394
bool hasQualifier() const
Determine whether this declaration reference was preceded by a C++ nested-name-specifier,...
Definition Expr.h:1362
NestedNameSpecifierLoc getQualifierLoc() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name,...
Definition Expr.h:1366
ValueDecl * getDecl()
Definition Expr.h:1341
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
Definition Expr.h:1471
bool hadMultipleCandidates() const
Returns true if this expression refers to a function that was resolved from an overloaded set having ...
Definition Expr.h:1460
SourceLocation getLocation() const
Definition Expr.h:1349
bool isImmediateEscalating() const
Definition Expr.h:1481
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
Definition Stmt.h:1637
SourceLocation getEndLoc() const
Definition Stmt.h:1660
const DeclGroupRef getDeclGroup() const
Definition Stmt.h:1655
SourceLocation getBeginLoc() const LLVM_READONLY
Definition Stmt.h:1663
NameKind
The kind of the name stored in this DeclarationName.
Stmt * getSubStmt()
Definition Stmt.h:2087
DeferStmt - This represents a deferred statement.
Definition Stmt.h:3242
Stmt * getBody()
Definition Stmt.h:3261
SourceLocation getDeferLoc() const
Definition Stmt.h:3256
Represents a 'co_await' expression while the type of the promise is dependent.
Definition ExprCXX.h:5401
SourceLocation getKeywordLoc() const
Definition ExprCXX.h:5430
A qualified reference to a name whose declaration cannot yet be resolved.
Definition ExprCXX.h:3510
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source location information.
Definition ExprCXX.h:3558
Represents a C99 designated initializer expression.
Definition Expr.h:5554
Expr * getSubExpr(unsigned Idx) const
Definition Expr.h:5836
bool usesGNUSyntax() const
Determines whether this designated initializer used the deprecated GNU syntax for designated initiali...
Definition Expr.h:5818
MutableArrayRef< Designator > designators()
Definition Expr.h:5787
SourceLocation getEqualOrColonLoc() const
Retrieve the location of the '=' that precedes the initializer value itself, if present.
Definition Expr.h:5809
unsigned getNumSubExprs() const
Retrieve the total number of subexpressions in this designated initializer expression,...
Definition Expr.h:5834
InitListExpr * getUpdater() const
Definition Expr.h:5939
DoStmt - This represents a 'do/while' stmt.
Definition Stmt.h:2838
Stmt * getBody()
Definition Stmt.h:2863
Expr * getCond()
Definition Stmt.h:2856
SourceLocation getWhileLoc() const
Definition Stmt.h:2869
SourceLocation getDoLoc() const
Definition Stmt.h:2867
SourceLocation getRParenLoc() const
Definition Stmt.h:2871
IdentifierInfo & getAccessor() const
Definition Expr.h:6584
const Expr * getBase() const
Definition Expr.h:6580
SourceLocation getAccessorLoc() const
Definition Expr.h:6587
Represents a reference to emded data.
Definition Expr.h:5129
unsigned getStartingElementPos() const
Definition Expr.h:5150
SourceLocation getEndLoc() const
Definition Expr.h:5144
StringLiteral * getDataStringLiteral() const
Definition Expr.h:5146
SourceLocation getBeginLoc() const
Definition Expr.h:5143
size_t getDataElementCount() const
Definition Expr.h:5151
ExplicitCastExpr - An explicit cast written in the source code.
Definition Expr.h:3931
TypeSourceInfo * getTypeInfoAsWritten() const
getTypeInfoAsWritten - Returns the type source info for the type that this expression is casting to.
Definition Expr.h:3953
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition ExprCXX.h:3661
bool cleanupsHaveSideEffects() const
Definition ExprCXX.h:3696
ArrayRef< CleanupObject > getObjects() const
Definition ExprCXX.h:3685
unsigned getNumObjects() const
Definition ExprCXX.h:3689
This represents one expression.
Definition Expr.h:112
bool isValueDependent() const
Determines whether the value of this expression depends on.
Definition Expr.h:177
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
Definition Expr.h:447
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
Definition Expr.h:454
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:144
ExprDependence getDependence() const
Definition Expr.h:164
An expression trait intrinsic.
Definition ExprCXX.h:3073
Expr * getQueriedExpression() const
Definition ExprCXX.h:3112
ExpressionTrait getTrait() const
Definition ExprCXX.h:3108
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition Expr.h:6609
storage_type getAsOpaqueInt() const
SourceLocation getLocation() const
Retrieve the location of the literal.
Definition Expr.h:1584
unsigned getScale() const
Definition Expr.h:1588
llvm::APInt getValue() const
Returns an internal integer representation of the literal.
Definition Expr.h:1578
SourceLocation getLocation() const
Definition Expr.h:1710
llvm::APFloatBase::Semantics getRawSemantics() const
Get a raw enumeration value representing the floating-point semantics of this literal (32-bit IEEE,...
Definition Expr.h:1679
llvm::APFloat getValue() const
Definition Expr.h:1669
bool isExact() const
Definition Expr.h:1702
ForStmt - This represents a 'for (init;cond;inc)' stmt.
Definition Stmt.h:2894
Stmt * getInit()
Definition Stmt.h:2909
SourceLocation getRParenLoc() const
Definition Stmt.h:2954
Stmt * getBody()
Definition Stmt.h:2938
Expr * getInc()
Definition Stmt.h:2937
SourceLocation getForLoc() const
Definition Stmt.h:2950
Expr * getCond()
Definition Stmt.h:2936
SourceLocation getLParenLoc() const
Definition Stmt.h:2952
DeclStmt * getConditionVariableDeclStmt()
If this ForStmt has a condition variable, return the faux DeclStmt associated with the creation of th...
Definition Stmt.h:2924
const Expr * getSubExpr() const
Definition Expr.h:1065
Represents a reference to a function parameter pack, init-capture pack, or binding pack that has been...
Definition ExprCXX.h:4841
ValueDecl *const * iterator
Iterators over the parameters which the parameter pack expanded into.
Definition ExprCXX.h:4874
ValueDecl * getParameterPack() const
Get the parameter pack which this expression refers to.
Definition ExprCXX.h:4867
iterator end() const
Definition ExprCXX.h:4876
unsigned getNumExpansions() const
Get the number of parameters in this parameter pack.
Definition ExprCXX.h:4879
SourceLocation getParameterPackLocation() const
Get the location of the parameter pack.
Definition ExprCXX.h:4870
iterator begin() const
Definition ExprCXX.h:4875
This represents a GCC inline-assembly statement extension.
Definition Stmt.h:3452
unsigned getNumLabels() const
Definition Stmt.h:3602
SourceLocation getRParenLoc() const
Definition Stmt.h:3474
IdentifierInfo * getInputIdentifier(unsigned i) const
Definition Stmt.h:3567
const Expr * getOutputConstraintExpr(unsigned i) const
Definition Stmt.h:3554
IdentifierInfo * getLabelIdentifier(unsigned i) const
Definition Stmt.h:3606
const Expr * getInputConstraintExpr(unsigned i) const
Definition Stmt.h:3580
IdentifierInfo * getOutputIdentifier(unsigned i) const
Definition Stmt.h:3543
const Expr * getAsmStringExpr() const
Definition Stmt.h:3479
Expr * getOutputExpr(unsigned i)
Definition Stmt.cpp:582
Expr * getClobberExpr(unsigned i)
Definition Stmt.h:3659
Expr * getInputExpr(unsigned i)
Definition Stmt.cpp:593
AddrLabelExpr * getLabelExpr(unsigned i) const
Definition Stmt.cpp:601
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Definition Expr.h:4926
SourceLocation getTokenLocation() const
getTokenLocation - The location of the __null token.
Definition Expr.h:4940
Represents a C11 generic selection.
Definition Expr.h:6181
unsigned getNumAssocs() const
The number of association expressions.
Definition Expr.h:6423
bool isExprPredicate() const
Whether this generic selection uses an expression as its controlling argument.
Definition Expr.h:6439
SourceLocation getGenericLoc() const
Definition Expr.h:6536
SourceLocation getRParenLoc() const
Definition Expr.h:6540
SourceLocation getDefaultLoc() const
Definition Expr.h:6539
GotoStmt - This represents a direct goto.
Definition Stmt.h:2975
SourceLocation getLabelLoc() const
Definition Stmt.h:2993
SourceLocation getGotoLoc() const
Definition Stmt.h:2991
LabelDecl * getLabel() const
Definition Stmt.h:2988
This class represents temporary values used to represent inout and out arguments in HLSL.
Definition Expr.h:7396
const OpaqueValueExpr * getCastedTemporary() const
Definition Expr.h:7447
const OpaqueValueExpr * getOpaqueArgLValue() const
Definition Expr.h:7428
bool isInOut() const
returns true if the parameter is inout and false if the parameter is out.
Definition Expr.h:7455
const Expr * getWritebackCast() const
Definition Expr.h:7442
IfStmt - This represents an if/then/else.
Definition Stmt.h:2265
Stmt * getThen()
Definition Stmt.h:2354
SourceLocation getIfLoc() const
Definition Stmt.h:2431
IfStatementKind getStatementKind() const
Definition Stmt.h:2466
SourceLocation getElseLoc() const
Definition Stmt.h:2434
Stmt * getInit()
Definition Stmt.h:2415
SourceLocation getLParenLoc() const
Definition Stmt.h:2483
Expr * getCond()
Definition Stmt.h:2342
Stmt * getElse()
Definition Stmt.h:2363
DeclStmt * getConditionVariableDeclStmt()
If this IfStmt has a condition variable, return the faux DeclStmt associated with the creation of tha...
Definition Stmt.h:2398
SourceLocation getRParenLoc() const
Definition Stmt.h:2485
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1....
Definition Expr.h:1734
const Expr * getSubExpr() const
Definition Expr.h:1746
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition Expr.h:3856
bool isPartOfExplicitCast() const
Definition Expr.h:3887
Represents an implicitly-generated value initialization of an object of a given type.
Definition Expr.h:6060
IndirectGotoStmt - This represents an indirect goto.
Definition Stmt.h:3014
SourceLocation getGotoLoc() const
Definition Stmt.h:3030
SourceLocation getStarLoc() const
Definition Stmt.h:3032
Describes an C or C++ initializer list.
Definition Expr.h:5302
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
Definition Expr.h:5428
unsigned getNumInits() const
Definition Expr.h:5332
SourceLocation getLBraceLoc() const
Definition Expr.h:5463
InitListExpr * getSyntacticForm() const
Definition Expr.h:5475
bool hadArrayRangeDesignator() const
Definition Expr.h:5486
Expr * getArrayFiller()
If this initializer list initializes an array with more elements than there are initializers in the l...
Definition Expr.h:5404
SourceLocation getRBraceLoc() const
Definition Expr.h:5465
const Expr * getInit(unsigned Init) const
Definition Expr.h:5356
SourceLocation getLocation() const
Retrieve the location of the literal.
Definition Expr.h:1539
LabelStmt - Represents a label, which has a substatement.
Definition Stmt.h:2152
LabelDecl * getDecl() const
Definition Stmt.h:2170
bool isSideEntry() const
Definition Stmt.h:2199
Stmt * getSubStmt()
Definition Stmt.h:2174
SourceLocation getIdentLoc() const
Definition Stmt.h:2167
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition ExprCXX.h:1972
Expr ** capture_init_iterator
Iterator that walks over the capture initialization arguments.
Definition ExprCXX.h:2079
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument for this lambda expression.
Definition ExprCXX.h:2110
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
Definition ExprCXX.h:2098
Base class for BreakStmt and ContinueStmt.
Definition Stmt.h:3063
SourceLocation getLabelLoc() const
Definition Stmt.h:3098
LabelDecl * getLabelDecl()
Definition Stmt.h:3101
SourceLocation getKwLoc() const
Definition Stmt.h:3088
bool hasLabelTarget() const
Definition Stmt.h:3096
This represents a Microsoft inline-assembly statement extension.
Definition Stmt.h:3671
Token * getAsmToks()
Definition Stmt.h:3702
Expr * getOutputExpr(unsigned i)
Definition Stmt.cpp:919
StringRef getAsmString() const
Definition Stmt.h:3705
SourceLocation getLBraceLoc() const
Definition Stmt.h:3694
SourceLocation getEndLoc() const
Definition Stmt.h:3696
StringRef getInputConstraint(unsigned i) const
Definition Stmt.h:3725
StringRef getOutputConstraint(unsigned i) const
Definition Stmt.h:3712
StringRef getClobber(unsigned i) const
Definition Stmt.h:3749
unsigned getNumAsmToks()
Definition Stmt.h:3701
Expr * getInputExpr(unsigned i)
Definition Stmt.cpp:923
Representation of a Microsoft __if_exists or __if_not_exists statement with a dependent name.
Definition StmtCXX.h:253
bool isIfExists() const
Determine whether this is an __if_exists statement.
Definition StmtCXX.h:278
DeclarationNameInfo getNameInfo() const
Retrieve the name of the entity we're testing for, along with location information.
Definition StmtCXX.h:289
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies this name, if any.
Definition StmtCXX.h:285
CompoundStmt * getSubStmt() const
Retrieve the compound statement that will be included in the program only if the existence of the sym...
Definition StmtCXX.h:293
SourceLocation getKeywordLoc() const
Retrieve the location of the __if_exists or __if_not_exists keyword.
Definition StmtCXX.h:275
A member reference to an MSPropertyDecl.
Definition ExprCXX.h:940
NestedNameSpecifierLoc getQualifierLoc() const
Definition ExprCXX.h:996
bool isArrow() const
Definition ExprCXX.h:994
MSPropertyDecl * getPropertyDecl() const
Definition ExprCXX.h:993
Expr * getBaseExpr() const
Definition ExprCXX.h:992
SourceLocation getMemberLoc() const
Definition ExprCXX.h:995
MS property subscript expression.
Definition ExprCXX.h:1010
SourceLocation getRBracketLoc() const
Definition ExprCXX.h:1047
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition ExprCXX.h:4920
Expr * getSubExpr() const
Retrieve the temporary-generating subexpression whose value will be materialized into a glvalue.
Definition ExprCXX.h:4937
LifetimeExtendedTemporaryDecl * getLifetimeExtendedTemporaryDecl()
Definition ExprCXX.h:4960
MatrixSingleSubscriptExpr - Matrix single subscript expression for the MatrixType extension when you ...
Definition Expr.h:2798
SourceLocation getRBracketLoc() const
Definition Expr.h:2842
MatrixSubscriptExpr - Matrix subscript expression for the MatrixType extension.
Definition Expr.h:2868
SourceLocation getRBracketLoc() const
Definition Expr.h:2920
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition Expr.h:3367
SourceLocation getMemberLoc() const
getMemberLoc - Return the location of the "member", in X->F, it is the location of 'F'.
Definition Expr.h:3556
SourceLocation getOperatorLoc() const
Definition Expr.h:3549
NestedNameSpecifierLoc getQualifierLoc() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name,...
Definition Expr.h:3469
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Definition Expr.h:3450
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
Definition Expr.h:3591
bool hasQualifier() const
Determines whether this member expression actually had a C++ nested-name-specifier prior to the name ...
Definition Expr.h:3464
Expr * getBase() const
Definition Expr.h:3444
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition Expr.h:3532
bool hadMultipleCandidates() const
Returns true if this member expression refers to a method that was resolved from an overloaded set ha...
Definition Expr.h:3571
bool isArrow() const
Definition Expr.h:3551
DeclAccessPair getFoundDecl() const
Retrieves the declaration found by lookup.
Definition Expr.h:3454
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition Decl.h:340
Represents a place-holder for an object not to be initialized by anything.
Definition Expr.h:5880
NullStmt - This is the null statement ";": C99 6.8.3p3.
Definition Stmt.h:1709
SourceLocation getSemiLoc() const
Definition Stmt.h:1720
An explicit cast in C or a C-style cast in C++, which uses the syntax ([s1][s2]......
Definition ExprOpenMP.h:24
Expr * getBase()
Fetches base expression of array shaping expression.
Definition ExprOpenMP.h:90
SourceLocation getLParenLoc() const
Definition ExprOpenMP.h:68
ArrayRef< Expr * > getDimensions() const
Fetches the dimensions for array shaping expression.
Definition ExprOpenMP.h:80
SourceLocation getRParenLoc() const
Definition ExprOpenMP.h:71
ArrayRef< SourceRange > getBracketsRanges() const
Fetches source ranges for the brackets os the array shaping expression.
Definition ExprOpenMP.h:85
OpenMP 5.0 [2.1.6 Iterators] Iterators are identifiers that expand to multiple values in the clause o...
Definition ExprOpenMP.h:151
SourceLocation getLParenLoc() const
Definition ExprOpenMP.h:242
SourceLocation getSecondColonLoc(unsigned I) const
Gets the location of the second ':' (if any) in the range for the given iteratori definition.
Definition Expr.cpp:5582
SourceLocation getColonLoc(unsigned I) const
Gets the location of the first ':' in the range for the given iterator definition.
Definition Expr.cpp:5576
SourceLocation getRParenLoc() const
Definition ExprOpenMP.h:245
IteratorRange getIteratorRange(unsigned I)
Gets the iterator range for the given iterator.
Definition Expr.cpp:5553
OMPIteratorHelperData & getHelper(unsigned I)
Fetches helper data for the specified iteration space.
Definition Expr.cpp:5592
SourceLocation getAssignLoc(unsigned I) const
Gets the location of '=' for the given iterator definition.
Definition Expr.cpp:5570
SourceLocation getIteratorKwLoc() const
Definition ExprOpenMP.h:248
unsigned numOfIterators() const
Returns number of iterator definitions.
Definition ExprOpenMP.h:275
Decl * getIteratorDecl(unsigned I)
Gets the iterator declaration for the given iterator.
Definition Expr.cpp:5549
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp,...
Definition ExprObjC.h:220
Expr * getElement(unsigned Index)
getElement - Return the Element at the specified index.
Definition ExprObjC.h:265
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c array literal.
Definition ExprObjC.h:257
SourceRange getSourceRange() const LLVM_READONLY
Definition ExprObjC.h:248
ObjCMethodDecl * getArrayWithObjectsMethod() const
Definition ExprObjC.h:274
Represents Objective-C's @catch statement.
Definition StmtObjC.h:77
const VarDecl * getCatchParamDecl() const
Definition StmtObjC.h:97
const Stmt * getCatchBody() const
Definition StmtObjC.h:93
SourceLocation getAtCatchLoc() const
Definition StmtObjC.h:105
SourceLocation getRParenLoc() const
Definition StmtObjC.h:107
Represents Objective-C's @finally statement.
Definition StmtObjC.h:127
const Stmt * getFinallyBody() const
Definition StmtObjC.h:139
SourceLocation getAtFinallyLoc() const
Definition StmtObjC.h:148
Represents Objective-C's @synchronized statement.
Definition StmtObjC.h:303
const Expr * getSynchExpr() const
Definition StmtObjC.h:331
const CompoundStmt * getSynchBody() const
Definition StmtObjC.h:323
SourceLocation getAtSynchronizedLoc() const
Definition StmtObjC.h:320
Represents Objective-C's @throw statement.
Definition StmtObjC.h:358
const Expr * getThrowExpr() const
Definition StmtObjC.h:370
SourceLocation getThrowLoc() const LLVM_READONLY
Definition StmtObjC.h:374
Represents Objective-C's @try ... @catch ... @finally statement.
Definition StmtObjC.h:167
const ObjCAtFinallyStmt * getFinallyStmt() const
Retrieve the @finally statement, if any.
Definition StmtObjC.h:241
unsigned getNumCatchStmts() const
Retrieve the number of @catch statements in this try-catch-finally block.
Definition StmtObjC.h:220
const Stmt * getTryBody() const
Retrieve the @try body.
Definition StmtObjC.h:214
SourceLocation getAtTryLoc() const
Retrieve the location of the @ in the @try.
Definition StmtObjC.h:210
catch_range catch_stmts()
Definition StmtObjC.h:282
Represents Objective-C's @autoreleasepool Statement.
Definition StmtObjC.h:394
SourceLocation getAtLoc() const
Definition StmtObjC.h:414
const Stmt * getSubStmt() const
Definition StmtObjC.h:405
A runtime availability query.
Definition ExprObjC.h:1734
SourceRange getSourceRange() const
Definition ExprObjC.h:1753
VersionTuple getVersion() const
Definition ExprObjC.h:1757
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition ExprObjC.h:119
SourceLocation getLocation() const
Definition ExprObjC.h:138
ObjCBoxedExpr - used for generalized expression boxing.
Definition ExprObjC.h:159
SourceRange getSourceRange() const LLVM_READONLY
Definition ExprObjC.h:190
ObjCMethodDecl * getBoxingMethod() const
Definition ExprObjC.h:181
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers,...
Definition ExprObjC.h:1674
SourceLocation getLParenLoc() const
Definition ExprObjC.h:1697
SourceLocation getBridgeKeywordLoc() const
The location of the bridge keyword.
Definition ExprObjC.h:1708
ObjCBridgeCastKind getBridgeKind() const
Determine which kind of bridge is being performed via this cast.
Definition ExprObjC.h:1700
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
Definition ExprObjC.h:342
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c dictionary literal.
Definition ExprObjC.h:392
ObjCMethodDecl * getDictWithObjectsMethod() const
Definition ExprObjC.h:409
ObjCDictionaryElement getKeyValueElement(unsigned Index) const
Definition ExprObjC.h:394
SourceRange getSourceRange() const LLVM_READONLY
Definition ExprObjC.h:415
ObjCEncodeExpr, used for @encode in Objective-C.
Definition ExprObjC.h:441
TypeSourceInfo * getEncodedTypeSourceInfo() const
Definition ExprObjC.h:462
SourceLocation getRParenLoc() const
Definition ExprObjC.h:457
SourceLocation getAtLoc() const
Definition ExprObjC.h:455
Represents Objective-C's collection statement.
Definition StmtObjC.h:23
SourceLocation getForLoc() const
Definition StmtObjC.h:52
SourceLocation getRParenLoc() const
Definition StmtObjC.h:54
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
Definition ExprObjC.h:1613
bool shouldCopy() const
shouldCopy - True if we should do the 'copy' part of the copy-restore.
Definition ExprObjC.h:1641
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC 'id' type.
Definition ExprObjC.h:1529
SourceLocation getIsaMemberLoc() const
getMemberLoc - Return the location of the "member", in X->F, it is the location of 'F'.
Definition ExprObjC.h:1561
SourceLocation getOpLoc() const
Definition ExprObjC.h:1564
Expr * getBase() const
Definition ExprObjC.h:1554
bool isArrow() const
Definition ExprObjC.h:1556
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition ExprObjC.h:580
SourceLocation getLocation() const
Definition ExprObjC.h:623
SourceLocation getOpLoc() const
Definition ExprObjC.h:631
ObjCIvarDecl * getDecl()
Definition ExprObjC.h:610
bool isArrow() const
Definition ExprObjC.h:618
bool isFreeIvar() const
Definition ExprObjC.h:619
const Expr * getBase() const
Definition ExprObjC.h:614
An expression that sends a message to the given Objective-C object or class.
Definition ExprObjC.h:971
bool isDelegateInitCall() const
isDelegateInitCall - Answers whether this message send has been tagged as a "delegate init call",...
Definition ExprObjC.h:1452
SourceLocation getLeftLoc() const
Definition ExprObjC.h:1455
Expr * getInstanceReceiver()
Returns the object expression (receiver) for an instance message, or null for a message that is not a...
Definition ExprObjC.h:1299
SourceLocation getSuperLoc() const
Retrieve the location of the 'super' keyword for a class or instance message to 'super',...
Definition ExprObjC.h:1340
Selector getSelector() const
Definition ExprObjC.cpp:301
@ SuperInstance
The receiver is the instance of the superclass object.
Definition ExprObjC.h:985
@ Instance
The receiver is an object instance.
Definition ExprObjC.h:979
@ SuperClass
The receiver is a superclass.
Definition ExprObjC.h:982
@ Class
The receiver is a class.
Definition ExprObjC.h:976
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:1327
QualType getSuperType() const
Retrieve the type referred to by 'super'.
Definition ExprObjC.h:1375
const ObjCMethodDecl * getMethodDecl() const
Definition ExprObjC.h:1395
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
Definition ExprObjC.h:1260
arg_iterator arg_begin()
Definition ExprObjC.h:1508
SourceLocation getRightLoc() const
Definition ExprObjC.h:1456
unsigned getNumArgs() const
Return the number of actual arguments in this message, not counting the receiver.
Definition ExprObjC.h:1421
arg_iterator arg_end()
Definition ExprObjC.h:1510
Base class for Objective-C object literals ("...", @42, @[],}).
Definition ExprObjC.h:51
bool isExpressibleAsConstantInitializer() const
Definition ExprObjC.h:68
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition ExprObjC.h:648
ObjCPropertyDecl * getExplicitProperty() const
Definition ExprObjC.h:737
ObjCMethodDecl * getImplicitPropertyGetter() const
Definition ExprObjC.h:742
SourceLocation getReceiverLocation() const
Definition ExprObjC.h:791
const Expr * getBase() const
Definition ExprObjC.h:786
bool isObjectReceiver() const
Definition ExprObjC.h:801
QualType getSuperReceiverType() const
Definition ExprObjC.h:793
bool isImplicitProperty() const
Definition ExprObjC.h:734
ObjCMethodDecl * getImplicitPropertySetter() const
Definition ExprObjC.h:747
ObjCInterfaceDecl * getClassReceiver() const
Definition ExprObjC.h:797
SourceLocation getLocation() const
Definition ExprObjC.h:789
bool isSuperReceiver() const
Definition ExprObjC.h:802
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition ExprObjC.h:536
ObjCProtocolDecl * getProtocol() const
Definition ExprObjC.h:553
SourceLocation getRParenLoc() const
Definition ExprObjC.h:558
SourceLocation getAtLoc() const
Definition ExprObjC.h:557
ObjCSelectorExpr used for @selector in Objective-C.
Definition ExprObjC.h:486
SourceLocation getRParenLoc() const
Definition ExprObjC.h:504
Selector getSelector() const
Definition ExprObjC.h:500
SourceLocation getAtLoc() const
Definition ExprObjC.h:503
ObjCStringLiteral, used for Objective-C string literals i.e.
Definition ExprObjC.h:84
SourceLocation getAtLoc() const
Definition ExprObjC.h:100
StringLiteral * getString()
Definition ExprObjC.h:96
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition ExprObjC.h:870
Expr * getKeyExpr() const
Definition ExprObjC.h:912
Expr * getBaseExpr() const
Definition ExprObjC.h:909
ObjCMethodDecl * getAtIndexMethodDecl() const
Definition ExprObjC.h:915
SourceLocation getRBracket() const
Definition ExprObjC.h:900
ObjCMethodDecl * setAtIndexMethodDecl() const
Definition ExprObjC.h:919
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type,...
Definition Expr.h:2530
Expr * getIndexExpr(unsigned Idx)
Definition Expr.h:2589
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
Definition Expr.h:2563
const OffsetOfNode & getComponent(unsigned Idx) const
Definition Expr.h:2577
TypeSourceInfo * getTypeSourceInfo() const
Definition Expr.h:2570
unsigned getNumExpressions() const
Definition Expr.h:2601
SourceLocation getRParenLoc() const
Return the location of the right parentheses.
Definition Expr.h:2567
unsigned getNumComponents() const
Definition Expr.h:2585
unsigned getArrayExprIndex() const
For an array element node, returns the index into the array of expressions.
Definition Expr.h:2482
FieldDecl * getField() const
For a field offsetof node, returns the field.
Definition Expr.h:2488
IdentifierInfo * getFieldName() const
For a field or identifier offsetof node, returns the name of the field.
Definition Expr.cpp:1688
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range that covers this offsetof node.
Definition Expr.h:2509
@ Array
An index into an array.
Definition Expr.h:2429
@ Identifier
A field in a dependent type, known only by its name.
Definition Expr.h:2433
@ Field
A field.
Definition Expr.h:2431
@ Base
An implicit indirection through a C++ base class, when the field found is in a base class.
Definition Expr.h:2436
Kind getKind() const
Determine what kind of offsetof node this is.
Definition Expr.h:2478
CXXBaseSpecifier * getBase() const
For a base class node, returns the base specifier.
Definition Expr.h:2498
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
Definition Expr.h:1181
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
Definition Expr.h:1231
SourceLocation getLocation() const
Retrieve the location of this expression.
Definition Expr.h:1203
bool isUnique() const
Definition Expr.h:1239
This is a base class for any OpenACC statement-level constructs that have an associated statement.
Definition StmtOpenACC.h:81
This expression type represents an asterisk in an OpenACC Size-Expr, used in the 'tile' and 'gang' cl...
Definition Expr.h:2093
SourceLocation getLocation() const
Definition Expr.h:2110
This is the base class for an OpenACC statement-level construct, other construct types are expected t...
Definition StmtOpenACC.h:26
ArrayRef< const OpenACCClause * > clauses() const
Definition StmtOpenACC.h:67
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr.
Definition ExprCXX.h:3132
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
Definition ExprCXX.h:4282
const DeclarationNameInfo & getNameInfo() const
Gets the full name info.
Definition ExprCXX.h:3239
UnresolvedSetImpl::iterator decls_iterator
Definition ExprCXX.h:3223
decls_iterator decls_begin() const
Definition ExprCXX.h:3225
unsigned getNumDecls() const
Gets the number of declarations in the unresolved set.
Definition ExprCXX.h:3236
NestedNameSpecifierLoc getQualifierLoc() const
Fetches the nested-name qualifier with source-location information, if one was given.
Definition ExprCXX.h:3254
TemplateArgumentLoc * getTrailingTemplateArgumentLoc()
Return the optional template arguments.
Definition ExprCXX.h:4292
bool hasTemplateKWAndArgsInfo() const
Definition ExprCXX.h:3176
decls_iterator decls_end() const
Definition ExprCXX.h:3228
DeclarationName getName() const
Gets the name looked up.
Definition ExprCXX.h:3242
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition ExprCXX.h:4363
Expr * getPattern()
Retrieve the pattern of the pack expansion.
Definition ExprCXX.h:4392
SourceLocation getEllipsisLoc() const
Retrieve the location of the ellipsis that describes this pack expansion.
Definition ExprCXX.h:4399
SourceLocation getEllipsisLoc() const
Determine the location of the 'sizeof' keyword.
Definition ExprCXX.h:4613
Expr * getIndexExpr() const
Definition ExprCXX.h:4628
ArrayRef< Expr * > getExpressions() const
Return the trailing expressions, regardless of the expansion.
Definition ExprCXX.h:4646
SourceLocation getRSquareLoc() const
Determine the location of the right parenthesis.
Definition ExprCXX.h:4619
Expr * getPackIdExpression() const
Definition ExprCXX.h:4624
ParenExpr - This represents a parenthesized expression, e.g.
Definition Expr.h:2185
SourceLocation getLParen() const
Get the location of the left parentheses '('.
Definition Expr.h:2210
const Expr * getSubExpr() const
Definition Expr.h:2202
bool isProducedByFoldExpansion() const
Definition Expr.h:2227
SourceLocation getRParen() const
Get the location of the right parentheses ')'.
Definition Expr.h:2214
ArrayRef< Expr * > exprs()
Definition Expr.h:6126
unsigned getNumExprs() const
Return the number of expressions in this paren list.
Definition Expr.h:6113
SourceLocation getLParenLoc() const
Definition Expr.h:6128
SourceLocation getRParenLoc() const
Definition Expr.h:6129
[C99 6.4.2.2] - A predefined identifier such as func.
Definition Expr.h:2008
bool isTransparent() const
Definition Expr.h:2047
PredefinedIdentKind getIdentKind() const
Definition Expr.h:2043
SourceLocation getLocation() const
Definition Expr.h:2049
StringLiteral * getFunctionName()
Definition Expr.h:2052
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition Expr.h:6803
semantics_iterator semantics_end()
Definition Expr.h:6868
unsigned getResultExprIndex() const
Return the index of the result-bearing expression into the semantics expressions, or PseudoObjectExpr...
Definition Expr.h:6845
semantics_iterator semantics_begin()
Definition Expr.h:6864
Expr *const * semantics_iterator
Definition Expr.h:6862
unsigned getNumSemanticExprs() const
Definition Expr.h:6860
Expr * getSyntacticForm()
Return the syntactic form of this expression, i.e.
Definition Expr.h:6840
Frontend produces RecoveryExprs on semantic errors that prevent creating other well-formed expression...
Definition Expr.h:7502
SourceLocation getEndLoc() const
Definition Expr.h:7521
child_range children()
Definition Expr.h:7515
SourceLocation getBeginLoc() const
Definition Expr.h:7520
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
SourceLocation getLParenLoc() const
SourceLocation getRParenLoc() const
SourceLocation getEndLoc() const LLVM_READONLY
RequiresExprBodyDecl * getBody() const
ArrayRef< concepts::Requirement * > getRequirements() const
ArrayRef< ParmVarDecl * > getLocalParameters() const
ReturnStmt - This represents a return, optionally of an expression: return; return 4;.
Definition Stmt.h:3166
SourceLocation getReturnLoc() const
Definition Stmt.h:3215
const VarDecl * getNRVOCandidate() const
Retrieve the variable that might be used for the named return value optimization.
Definition Stmt.h:3202
Expr * getRetValue()
Definition Stmt.h:3193
CompoundStmt * getBlock() const
Definition Stmt.h:3799
SourceLocation getExceptLoc() const
Definition Stmt.h:3792
Expr * getFilterExpr() const
Definition Stmt.h:3795
SourceLocation getFinallyLoc() const
Definition Stmt.h:3833
CompoundStmt * getBlock() const
Definition Stmt.h:3836
Represents a __leave statement.
Definition Stmt.h:3904
SourceLocation getLeaveLoc() const
Definition Stmt.h:3914
CompoundStmt * getTryBlock() const
Definition Stmt.h:3880
SourceLocation getTryLoc() const
Definition Stmt.h:3875
bool getIsCXXTry() const
Definition Stmt.h:3878
Stmt * getHandler() const
Definition Stmt.h:3884
SYCLKernelCallStmt represents the transformation that is applied to the body of a function declared w...
Definition StmtSYCL.h:36
CompoundStmt * getOriginalStmt()
Definition StmtSYCL.h:54
OutlinedFunctionDecl * getOutlinedFunctionDecl()
Definition StmtSYCL.h:66
SourceLocation getLocation() const
Definition Expr.h:2158
SourceLocation getLParenLocation() const
Definition Expr.h:2159
TypeSourceInfo * getTypeSourceInfo()
Definition Expr.h:2146
SourceLocation getRParenLocation() const
Definition Expr.h:2160
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition Expr.h:4646
SourceLocation getBuiltinLoc() const
Definition Expr.h:4663
unsigned getNumSubExprs() const
getNumSubExprs - Return the size of the SubExprs array.
Definition Expr.h:4679
SourceLocation getRParenLoc() const
Definition Expr.h:4666
Expr * getExpr(unsigned Index)
getExpr - Return the Expr at the specified index.
Definition Expr.h:4685
Represents an expression that computes the length of a parameter pack.
Definition ExprCXX.h:4441
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof... expression, such as is produced f...
Definition ExprCXX.h:4526
ArrayRef< TemplateArgument > getPartialArguments() const
Get.
Definition ExprCXX.h:4531
unsigned getPackLength() const
Retrieve the length of the parameter pack.
Definition ExprCXX.h:4515
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(),...
Definition Expr.h:5020
SourceLocation getBeginLoc() const
Definition Expr.h:5065
const DeclContext * getParentContext() const
If the SourceLocExpr has been resolved return the subexpression representing the resolved value.
Definition Expr.h:5061
SourceLocation getEndLoc() const
Definition Expr.h:5066
SourceLocIdentKind getIdentKind() const
Definition Expr.h:5040
SourceLocation getEnd() const
SourceLocation getBegin() const
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition Expr.h:4598
CompoundStmt * getSubStmt()
Definition Expr.h:4615
unsigned getTemplateDepth() const
Definition Expr.h:4627
SourceLocation getRParenLoc() const
Definition Expr.h:4624
SourceLocation getLParenLoc() const
Definition Expr.h:4622
StmtVisitor - This class implements a simple visitor for Stmt subclasses.
Stmt - This represents one statement.
Definition Stmt.h:86
LambdaExprBitfields LambdaExprBits
Definition Stmt.h:1398
StmtClass getStmtClass() const
Definition Stmt.h:1499
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
Definition Stmt.cpp:343
TypeTraitExprBitfields TypeTraitExprBits
Definition Stmt.h:1387
CXXNewExprBitfields CXXNewExprBits
Definition Stmt.h:1385
ConstantExprBitfields ConstantExprBits
Definition Stmt.h:1350
RequiresExprBitfields RequiresExprBits
Definition Stmt.h:1399
CXXFoldExprBitfields CXXFoldExprBits
Definition Stmt.h:1402
PackIndexingExprBitfields PackIndexingExprBits
Definition Stmt.h:1403
NullStmtBitfields NullStmtBits
Definition Stmt.h:1333
DependentScopeDeclRefExprBitfields DependentScopeDeclRefExprBits
Definition Stmt.h:1388
StringLiteral - This represents a string literal expression, e.g.
Definition Expr.h:1802
SourceLocation getStrTokenLoc(unsigned TokNum) const
Get one of the string literal token.
Definition Expr.h:1948
bool isPascal() const
Definition Expr.h:1925
unsigned getLength() const
Definition Expr.h:1912
StringLiteralKind getKind() const
Definition Expr.h:1915
StringRef getBytes() const
Allow access to clients that need the byte representation, such as ASTWriterStmt::VisitStringLiteral(...
Definition Expr.h:1878
unsigned getByteLength() const
Definition Expr.h:1911
unsigned getNumConcatenated() const
getNumConcatenated - Get the number of string literal tokens that were concatenated in translation ph...
Definition Expr.h:1943
unsigned getCharByteWidth() const
Definition Expr.h:1913
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition ExprCXX.h:4664
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern being substituted.
Definition ExprCXX.h:4709
UnsignedOrNone getPackIndex() const
Definition ExprCXX.h:4715
unsigned getIndex() const
Returns the index of the replaced parameter in the associated declaration.
Definition ExprCXX.h:4713
SourceLocation getNameLoc() const
Definition ExprCXX.h:4699
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition ExprCXX.h:4754
TemplateArgument getArgumentPack() const
Retrieve the template argument pack containing the substituted template arguments.
Definition ExprCXX.cpp:1799
SourceLocation getParameterPackLocation() const
Retrieve the location of the parameter pack name.
Definition ExprCXX.h:4802
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern being substituted.
Definition ExprCXX.h:4788
unsigned getIndex() const
Returns the index of the replaced parameter in the associated declaration.
Definition ExprCXX.h:4792
SourceLocation getKeywordLoc() const
Definition Stmt.h:1903
SourceLocation getColonLoc() const
Definition Stmt.h:1905
const SwitchCase * getNextSwitchCase() const
Definition Stmt.h:1899
SwitchStmt - This represents a 'switch' stmt.
Definition Stmt.h:2515
SourceLocation getSwitchLoc() const
Definition Stmt.h:2650
SourceLocation getLParenLoc() const
Definition Stmt.h:2652
bool isAllEnumCasesCovered() const
Returns true if the SwitchStmt is a switch of an enum value and all cases have been explicitly covere...
Definition Stmt.h:2675
SourceLocation getRParenLoc() const
Definition Stmt.h:2654
Expr * getCond()
Definition Stmt.h:2578
Stmt * getBody()
Definition Stmt.h:2590
Stmt * getInit()
Definition Stmt.h:2595
SwitchCase * getSwitchCaseList()
Definition Stmt.h:2646
DeclStmt * getConditionVariableDeclStmt()
If this SwitchStmt has a condition variable, return the faux DeclStmt associated with the creation of...
Definition Stmt.h:2629
Location wrapper for a TemplateArgument.
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition ExprCXX.h:2900
TypeSourceInfo * getArg(unsigned I) const
Retrieve the Ith argument.
Definition ExprCXX.h:2965
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
Definition ExprCXX.h:2962
const APValue & getAPValue() const
Definition ExprCXX.h:2956
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition Expr.h:2628
SourceLocation getRParenLoc() const
Definition Expr.h:2704
SourceLocation getOperatorLoc() const
Definition Expr.h:2701
TypeSourceInfo * getArgumentTypeInfo() const
Definition Expr.h:2674
UnaryExprOrTypeTrait getKind() const
Definition Expr.h:2660
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition Expr.h:2247
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
Definition Expr.h:2292
Expr * getSubExpr() const
Definition Expr.h:2288
Opcode getOpcode() const
Definition Expr.h:2283
bool hasStoredFPFeatures() const
Is FPFeatures in Trailing Storage?
Definition Expr.h:2384
FPOptionsOverride getStoredFPFeatures() const
Get FPFeatures from trailing storage.
Definition Expr.h:2387
bool canOverflow() const
Returns true if the unary operator can cause an overflow.
Definition Expr.h:2301
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition ExprCXX.h:3390
CXXRecordDecl * getNamingClass()
Gets the 'naming class' (in the sense of C++0x [class.access.base]p5) of the lookup.
Definition ExprCXX.h:3464
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
Definition ExprCXX.h:3459
Represents a C++ member access expression for which lookup produced a set of overloaded functions.
Definition ExprCXX.h:4126
QualType getBaseType() const
Definition ExprCXX.h:4208
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '.
Definition ExprCXX.h:4218
SourceLocation getOperatorLoc() const
Retrieve the location of the '->' or '.' operator.
Definition ExprCXX.h:4221
bool hasUnresolvedUsing() const
Determine whether the lookup results contain an unresolved using declaration.
Definition ExprCXX.h:4212
Expr * getBase()
Retrieve the base object of this member expressions, e.g., the x in x.m.
Definition ExprCXX.h:4199
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:1647
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit....
Definition ExprCXX.h:644
Represents a call to the builtin function __builtin_va_arg.
Definition Expr.h:4960
TypeSourceInfo * getWrittenTypeInfo() const
Definition Expr.h:4984
SourceLocation getBuiltinLoc() const
Definition Expr.h:4987
SourceLocation getRParenLoc() const
Definition Expr.h:4990
bool isMicrosoftABI() const
Returns whether this is really a Win64 ABI va_arg expression.
Definition Expr.h:4981
const Expr * getSubExpr() const
Definition Expr.h:4976
WhileStmt - This represents a 'while' stmt.
Definition Stmt.h:2703
Expr * getCond()
Definition Stmt.h:2755
SourceLocation getWhileLoc() const
Definition Stmt.h:2808
SourceLocation getRParenLoc() const
Definition Stmt.h:2813
DeclStmt * getConditionVariableDeclStmt()
If this WhileStmt has a condition variable, return the faux DeclStmt associated with the creation of ...
Definition Stmt.h:2791
SourceLocation getLParenLoc() const
Definition Stmt.h:2811
Stmt * getBody()
Definition Stmt.h:2767
StmtCode
Record codes for each kind of statement or expression.
@ EXPR_DESIGNATED_INIT
A DesignatedInitExpr record.
@ EXPR_COMPOUND_LITERAL
A CompoundLiteralExpr record.
@ STMT_OMP_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE
@ EXPR_OBJC_IVAR_REF_EXPR
An ObjCIvarRefExpr record.
@ EXPR_MEMBER
A MemberExpr record.
@ EXPR_CXX_TEMPORARY_OBJECT
A CXXTemporaryObjectExpr record.
@ EXPR_COMPOUND_ASSIGN_OPERATOR
A CompoundAssignOperator record.
@ EXPR_CXX_STATIC_CAST
A CXXStaticCastExpr record.
@ EXPR_OBJC_STRING_LITERAL
An ObjCStringLiteral record.
@ EXPR_VA_ARG
A VAArgExpr record.
@ EXPR_OBJC_ISA
An ObjCIsa Expr record.
@ EXPR_CXX_OPERATOR_CALL
A CXXOperatorCallExpr record.
@ STMT_OBJC_AT_TRY
An ObjCAtTryStmt record.
@ STMT_DO
A DoStmt record.
@ STMT_OBJC_CATCH
An ObjCAtCatchStmt record.
@ STMT_IF
An IfStmt record.
@ EXPR_STRING_LITERAL
A StringLiteral record.
@ EXPR_OBJC_AVAILABILITY_CHECK
An ObjCAvailabilityCheckExpr record.
@ STMT_OMP_PARALLEL_MASKED_TASKLOOP_DIRECTIVE
@ EXPR_PSEUDO_OBJECT
A PseudoObjectExpr record.
@ STMT_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE
@ EXPR_IMPLICIT_CAST
An ImplicitCastExpr record.
@ STMT_CAPTURED
A CapturedStmt record.
@ STMT_OMP_TARGET_PARALLEL_FOR_SIMD_DIRECTIVE
@ STMT_GCCASM
A GCC-style AsmStmt record.
@ EXPR_IMAGINARY_LITERAL
An ImaginaryLiteral record.
@ STMT_WHILE
A WhileStmt record.
@ EXPR_CONVERT_VECTOR
A ConvertVectorExpr record.
@ EXPR_OBJC_SUBSCRIPT_REF_EXPR
An ObjCSubscriptRefExpr record.
@ EXPR_STMT
A StmtExpr record.
@ EXPR_CXX_REINTERPRET_CAST
A CXXReinterpretCastExpr record.
@ EXPR_DESIGNATED_INIT_UPDATE
A DesignatedInitUpdateExpr record.
@ STMT_OBJC_AT_SYNCHRONIZED
An ObjCAtSynchronizedStmt record.
@ STMT_OMP_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE
@ EXPR_BUILTIN_BIT_CAST
A BuiltinBitCastExpr record.
@ STMT_OMP_TARGET_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE
@ STMT_SYCLKERNELCALL
A SYCLKernelCallStmt record.
@ EXPR_CHARACTER_LITERAL
A CharacterLiteral record.
@ EXPR_OBJC_ENCODE
An ObjCEncodeExpr record.
@ EXPR_CSTYLE_CAST
A CStyleCastExpr record.
@ EXPR_OBJC_BOOL_LITERAL
An ObjCBoolLiteralExpr record.
@ EXPR_EXT_VECTOR_ELEMENT
An ExtVectorElementExpr record.
@ EXPR_ATOMIC
An AtomicExpr record.
@ EXPR_OFFSETOF
An OffsetOfExpr record.
@ STMT_RETURN
A ReturnStmt record.
@ STMT_OBJC_FOR_COLLECTION
An ObjCForCollectionStmt record.
@ STMT_OMP_TARGET_TEAMS_DISTRIBUTE_DIRECTIVE
@ EXPR_ARRAY_INIT_LOOP
An ArrayInitLoopExpr record.
@ STMT_OMP_PARALLEL_MASTER_TASKLOOP_DIRECTIVE
@ STMT_OMP_PARALLEL_MASKED_TASKLOOP_SIMD_DIRECTIVE
@ STMT_CONTINUE
A ContinueStmt record.
@ EXPR_PREDEFINED
A PredefinedExpr record.
@ EXPR_CXX_BOOL_LITERAL
A CXXBoolLiteralExpr record.
@ EXPR_PAREN_LIST
A ParenListExpr record.
@ EXPR_CXX_PAREN_LIST_INIT
A CXXParenListInitExpr record.
@ STMT_COMPOUND
A CompoundStmt record.
@ STMT_FOR
A ForStmt record.
@ STMT_ATTRIBUTED
An AttributedStmt record.
@ STMT_UNRESOLVED_SYCL_KERNEL_CALL
An UnresolvedSYCLKernelCallStmt record.
@ STMT_OMP_TARGET_TEAMS_GENERIC_LOOP_DIRECTIVE
@ EXPR_CXX_REWRITTEN_BINARY_OPERATOR
A CXXRewrittenBinaryOperator record.
@ STMT_GOTO
A GotoStmt record.
@ EXPR_NO_INIT
An NoInitExpr record.
@ EXPR_OBJC_PROTOCOL_EXPR
An ObjCProtocolExpr record.
@ EXPR_ARRAY_INIT_INDEX
An ArrayInitIndexExpr record.
@ EXPR_CXX_CONSTRUCT
A CXXConstructExpr record.
@ STMT_OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE
@ STMT_OMP_PARALLEL_MASTER_TASKLOOP_SIMD_DIRECTIVE
@ STMT_OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE
@ EXPR_CXX_DYNAMIC_CAST
A CXXDynamicCastExpr record.
@ STMT_CXX_TRY
A CXXTryStmt record.
@ EXPR_GENERIC_SELECTION
A GenericSelectionExpr record.
@ EXPR_OBJC_INDIRECT_COPY_RESTORE
An ObjCIndirectCopyRestoreExpr record.
@ EXPR_CXX_INHERITED_CTOR_INIT
A CXXInheritedCtorInitExpr record.
@ EXPR_CALL
A CallExpr record.
@ EXPR_GNU_NULL
A GNUNullExpr record.
@ EXPR_OBJC_PROPERTY_REF_EXPR
An ObjCPropertyRefExpr record.
@ EXPR_CXX_CONST_CAST
A CXXConstCastExpr record.
@ STMT_REF_PTR
A reference to a previously [de]serialized Stmt record.
@ EXPR_OBJC_MESSAGE_EXPR
An ObjCMessageExpr record.
@ STMT_CASE
A CaseStmt record.
@ EXPR_CONSTANT
A constant expression context.
@ STMT_STOP
A marker record that indicates that we are at the end of an expression.
@ STMT_MSASM
A MS-style AsmStmt record.
@ EXPR_CONDITIONAL_OPERATOR
A ConditionOperator record.
@ EXPR_BINARY_OPERATOR
A BinaryOperator record.
@ EXPR_CXX_STD_INITIALIZER_LIST
A CXXStdInitializerListExpr record.
@ EXPR_SHUFFLE_VECTOR
A ShuffleVectorExpr record.
@ STMT_OBJC_FINALLY
An ObjCAtFinallyStmt record.
@ EXPR_OBJC_SELECTOR_EXPR
An ObjCSelectorExpr record.
@ EXPR_FLOATING_LITERAL
A FloatingLiteral record.
@ STMT_NULL_PTR
A NULL expression.
@ STMT_DEFAULT
A DefaultStmt record.
@ EXPR_CHOOSE
A ChooseExpr record.
@ STMT_NULL
A NullStmt record.
@ EXPR_DECL_REF
A DeclRefExpr record.
@ EXPR_INIT_LIST
An InitListExpr record.
@ EXPR_IMPLICIT_VALUE_INIT
An ImplicitValueInitExpr record.
@ STMT_OBJC_AUTORELEASE_POOL
An ObjCAutoreleasePoolStmt record.
@ EXPR_RECOVERY
A RecoveryExpr record.
@ EXPR_PAREN
A ParenExpr record.
@ STMT_OMP_TARGET_PARALLEL_GENERIC_LOOP_DIRECTIVE
@ STMT_LABEL
A LabelStmt record.
@ EXPR_CXX_FUNCTIONAL_CAST
A CXXFunctionalCastExpr record.
@ EXPR_USER_DEFINED_LITERAL
A UserDefinedLiteral record.
@ EXPR_INTEGER_LITERAL
An IntegerLiteral record.
@ EXPR_SOURCE_LOC
A SourceLocExpr record.
@ EXPR_CXX_MEMBER_CALL
A CXXMemberCallExpr record.
@ STMT_SWITCH
A SwitchStmt record.
@ STMT_DECL
A DeclStmt record.
@ EXPR_SIZEOF_ALIGN_OF
A SizefAlignOfExpr record.
@ STMT_BREAK
A BreakStmt record.
@ STMT_OBJC_AT_THROW
An ObjCAtThrowStmt record.
@ EXPR_ADDR_LABEL
An AddrLabelExpr record.
@ EXPR_MATRIX_ELEMENT
A MatrixElementExpr record.
@ STMT_CXX_FOR_RANGE
A CXXForRangeStmt record.
@ EXPR_CXX_ADDRSPACE_CAST
A CXXAddrspaceCastExpr record.
@ EXPR_ARRAY_SUBSCRIPT
An ArraySubscriptExpr record.
@ EXPR_UNARY_OPERATOR
A UnaryOperator record.
@ STMT_CXX_CATCH
A CXXCatchStmt record.
@ EXPR_BUILTIN_PP_EMBED
A EmbedExpr record.
@ STMT_INDIRECT_GOTO
An IndirectGotoStmt record.
@ DESIG_ARRAY_RANGE
GNU array range designator.
@ DESIG_FIELD_NAME
Field designator where only the field name is known.
@ DESIG_FIELD_DECL
Field designator where the field has been resolved to a declaration.
@ DESIG_ARRAY
Array designator.
The JSON file list parser is used to communicate input to InstallAPI.
bool isa(CodeGen::Address addr)
Definition Address.h:330
@ OK_Ordinary
An ordinary object is located at an address in memory.
Definition Specifiers.h:152
OpenACCComputeConstruct(OpenACCDirectiveKind K, SourceLocation Start, SourceLocation DirectiveLoc, SourceLocation End, ArrayRef< const OpenACCClause * > Clauses, Stmt *StructuredBlock)
bool isAlignedAllocation(AlignedAllocationMode Mode)
Definition ExprCXX.h:2269
bool isTypeAwareAllocation(TypeAwareAllocationMode Mode)
Definition ExprCXX.h:2257
@ VK_PRValue
A pr-value expression (in the C++11 taxonomy) produces a temporary value.
Definition Specifiers.h:136
U cast(CodeGen::Address addr)
Definition Address.h:327
unsigned long uint64_t
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
Definition ASTConcept.h:91
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
SourceLocation LAngleLoc
The source location of the left angle bracket ('<').
unsigned NumTemplateArgs
The number of template arguments in TemplateArgs.
SourceLocation RAngleLoc
The source location of the right angle bracket ('>').
SourceLocation TemplateKWLoc
The source location of the template keyword; this is used as part of the representation of qualified ...
AlignedAllocationMode PassAlignment
Definition ExprCXX.h:2311
TypeAwareAllocationMode PassTypeIdentity
Definition ExprCXX.h:2310
Expr * CounterUpdate
Updater for the internal counter: ++CounterVD;.
Definition ExprOpenMP.h:121
Expr * Upper
Normalized upper bound.
Definition ExprOpenMP.h:116
Expr * Update
Update expression for the originally specified iteration variable, calculated as VD = Begin + Counter...
Definition ExprOpenMP.h:119
VarDecl * CounterVD
Internal normalized counter.
Definition ExprOpenMP.h:113
Expr * Value
The value of the dictionary element.
Definition ExprObjC.h:300
SourceLocation EllipsisLoc
The location of the ellipsis, if this is a pack expansion.
Definition ExprObjC.h:303
UnsignedOrNone NumExpansions
The number of elements this pack expansion will expand to, if this is a pack expansion and is known.
Definition ExprObjC.h:307
Expr * Key
The key for the dictionary element.
Definition ExprObjC.h:297
constexpr underlying_type toInternalRepresentation() const