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.AddSourceLocation(E->BeginLoc);
1774
1775 if (!E->hasStoredFPFeatures() && !static_cast<bool>(E->getADLCallKind()) &&
1776 !E->isCoroElideSafe() && !E->usesMemberSyntax())
1777 AbbrevToUse = Writer.getCXXOperatorCallExprAbbrev();
1778
1780}
1781
1782void ASTStmtWriter::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) {
1783 VisitCallExpr(E);
1784
1785 if (!E->hasStoredFPFeatures() && !static_cast<bool>(E->getADLCallKind()) &&
1786 !E->isCoroElideSafe() && !E->usesMemberSyntax())
1787 AbbrevToUse = Writer.getCXXMemberCallExprAbbrev();
1788
1790}
1791
1792void ASTStmtWriter::VisitCXXRewrittenBinaryOperator(
1794 VisitExpr(E);
1795 Record.push_back(E->isReversed());
1796 Record.AddStmt(E->getSemanticForm());
1798}
1799
1800void ASTStmtWriter::VisitCXXConstructExpr(CXXConstructExpr *E) {
1801 VisitExpr(E);
1802
1803 Record.push_back(E->getNumArgs());
1804 Record.push_back(E->isElidable());
1805 Record.push_back(E->hadMultipleCandidates());
1806 Record.push_back(E->isListInitialization());
1807 Record.push_back(E->isStdInitListInitialization());
1808 Record.push_back(E->requiresZeroInitialization());
1809 Record.push_back(
1810 llvm::to_underlying(E->getConstructionKind())); // FIXME: stable encoding
1811 Record.push_back(E->isImmediateEscalating());
1812 Record.AddSourceLocation(E->getLocation());
1813 Record.AddDeclRef(E->getConstructor());
1814 Record.AddSourceRange(E->getParenOrBraceRange());
1815
1816 for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1817 Record.AddStmt(E->getArg(I));
1818
1820}
1821
1822void ASTStmtWriter::VisitCXXInheritedCtorInitExpr(CXXInheritedCtorInitExpr *E) {
1823 VisitExpr(E);
1824 Record.AddDeclRef(E->getConstructor());
1825 Record.AddSourceLocation(E->getLocation());
1826 Record.push_back(E->constructsVBase());
1827 Record.push_back(E->inheritedFromVBase());
1829}
1830
1831void ASTStmtWriter::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
1832 VisitCXXConstructExpr(E);
1833 Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1835}
1836
1837void ASTStmtWriter::VisitLambdaExpr(LambdaExpr *E) {
1838 VisitExpr(E);
1839 Record.push_back(E->LambdaExprBits.NumCaptures);
1840 Record.AddSourceRange(E->IntroducerRange);
1841 Record.push_back(E->LambdaExprBits.CaptureDefault); // FIXME: stable encoding
1842 Record.AddSourceLocation(E->CaptureDefaultLoc);
1843 Record.push_back(E->LambdaExprBits.ExplicitParams);
1844 Record.push_back(E->LambdaExprBits.ExplicitResultType);
1845 Record.AddSourceLocation(E->ClosingBrace);
1846
1847 // Add capture initializers.
1849 CEnd = E->capture_init_end();
1850 C != CEnd; ++C) {
1851 Record.AddStmt(*C);
1852 }
1853
1854 // Don't serialize the body. It belongs to the call operator declaration.
1855 // LambdaExpr only stores a copy of the Stmt *.
1856
1858}
1859
1860void ASTStmtWriter::VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E) {
1861 VisitExpr(E);
1862 Record.AddStmt(E->getSubExpr());
1864}
1865
1866void ASTStmtWriter::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) {
1867 VisitExplicitCastExpr(E);
1868 Record.AddSourceRange(SourceRange(E->getOperatorLoc(), E->getRParenLoc()));
1869 CurrentPackingBits.addBit(E->getAngleBrackets().isValid());
1870 if (E->getAngleBrackets().isValid())
1871 Record.AddSourceRange(E->getAngleBrackets());
1872}
1873
1874void ASTStmtWriter::VisitCXXStaticCastExpr(CXXStaticCastExpr *E) {
1875 VisitCXXNamedCastExpr(E);
1877}
1878
1879void ASTStmtWriter::VisitCXXDynamicCastExpr(CXXDynamicCastExpr *E) {
1880 VisitCXXNamedCastExpr(E);
1882}
1883
1884void ASTStmtWriter::VisitCXXReinterpretCastExpr(CXXReinterpretCastExpr *E) {
1885 VisitCXXNamedCastExpr(E);
1887}
1888
1889void ASTStmtWriter::VisitCXXConstCastExpr(CXXConstCastExpr *E) {
1890 VisitCXXNamedCastExpr(E);
1892}
1893
1894void ASTStmtWriter::VisitCXXAddrspaceCastExpr(CXXAddrspaceCastExpr *E) {
1895 VisitCXXNamedCastExpr(E);
1897}
1898
1899void ASTStmtWriter::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E) {
1900 VisitExplicitCastExpr(E);
1901 Record.AddSourceLocation(E->getLParenLoc());
1902 Record.AddSourceLocation(E->getRParenLoc());
1904}
1905
1906void ASTStmtWriter::VisitBuiltinBitCastExpr(BuiltinBitCastExpr *E) {
1907 VisitExplicitCastExpr(E);
1908 Record.AddSourceLocation(E->getBeginLoc());
1909 Record.AddSourceLocation(E->getEndLoc());
1911}
1912
1913void ASTStmtWriter::VisitUserDefinedLiteral(UserDefinedLiteral *E) {
1914 VisitCallExpr(E);
1915 Record.AddSourceLocation(E->UDSuffixLoc);
1917}
1918
1919void ASTStmtWriter::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) {
1920 VisitExpr(E);
1921 Record.push_back(E->getValue());
1922 Record.AddSourceLocation(E->getLocation());
1924}
1925
1926void ASTStmtWriter::VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E) {
1927 VisitExpr(E);
1928 Record.AddSourceLocation(E->getLocation());
1930}
1931
1932void ASTStmtWriter::VisitCXXTypeidExpr(CXXTypeidExpr *E) {
1933 VisitExpr(E);
1934 Record.AddSourceRange(E->getSourceRange());
1935 if (E->isTypeOperand()) {
1936 Record.AddTypeSourceInfo(E->getTypeOperandSourceInfo());
1938 } else {
1939 Record.AddStmt(E->getExprOperand());
1941 }
1942}
1943
1944void ASTStmtWriter::VisitCXXThisExpr(CXXThisExpr *E) {
1945 VisitExpr(E);
1946 Record.AddSourceLocation(E->getLocation());
1947 Record.push_back(E->isImplicit());
1949
1951}
1952
1953void ASTStmtWriter::VisitCXXThrowExpr(CXXThrowExpr *E) {
1954 VisitExpr(E);
1955 Record.AddSourceLocation(E->getThrowLoc());
1956 Record.AddStmt(E->getSubExpr());
1957 Record.push_back(E->isThrownVariableInScope());
1959}
1960
1961void ASTStmtWriter::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
1962 VisitExpr(E);
1963 Record.AddDeclRef(E->getParam());
1964 Record.AddDeclRef(cast_or_null<Decl>(E->getUsedContext()));
1965 Record.AddSourceLocation(E->getUsedLocation());
1966 Record.push_back(E->hasRewrittenInit());
1967 if (E->hasRewrittenInit())
1968 Record.AddStmt(E->getRewrittenExpr());
1970}
1971
1972void ASTStmtWriter::VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E) {
1973 VisitExpr(E);
1974 Record.push_back(E->hasRewrittenInit());
1975 Record.AddDeclRef(E->getField());
1976 Record.AddDeclRef(cast_or_null<Decl>(E->getUsedContext()));
1977 Record.AddSourceLocation(E->getExprLoc());
1978 if (E->hasRewrittenInit())
1979 Record.AddStmt(E->getRewrittenExpr());
1981}
1982
1983void ASTStmtWriter::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
1984 VisitExpr(E);
1985 Record.AddCXXTemporary(E->getTemporary());
1986 Record.AddStmt(E->getSubExpr());
1988}
1989
1990void ASTStmtWriter::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
1991 VisitExpr(E);
1992 Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1993 Record.AddSourceLocation(E->getRParenLoc());
1995}
1996
1997void ASTStmtWriter::VisitCXXNewExpr(CXXNewExpr *E) {
1998 VisitExpr(E);
1999
2000 Record.push_back(E->isArray());
2001 Record.push_back(E->hasInitializer());
2002 Record.push_back(E->getNumPlacementArgs());
2003 Record.push_back(E->isParenTypeId());
2004
2005 Record.push_back(E->isGlobalNew());
2006 ImplicitAllocationParameters IAP = E->implicitAllocationParameters();
2007 Record.push_back(isAlignedAllocation(IAP.PassAlignment));
2008 Record.push_back(isTypeAwareAllocation(IAP.PassTypeIdentity));
2009 Record.push_back(E->doesUsualArrayDeleteWantSize());
2010 Record.push_back(E->CXXNewExprBits.HasInitializer);
2011 Record.push_back(E->CXXNewExprBits.StoredInitializationStyle);
2012
2013 Record.AddDeclRef(E->getOperatorNew());
2014 Record.AddDeclRef(E->getOperatorDelete());
2015 Record.AddTypeSourceInfo(E->getAllocatedTypeSourceInfo());
2016 if (E->isParenTypeId())
2017 Record.AddSourceRange(E->getTypeIdParens());
2018 Record.AddSourceRange(E->getSourceRange());
2019 Record.AddSourceRange(E->getDirectInitRange());
2020
2021 for (CXXNewExpr::arg_iterator I = E->raw_arg_begin(), N = E->raw_arg_end();
2022 I != N; ++I)
2023 Record.AddStmt(*I);
2024
2026}
2027
2028void ASTStmtWriter::VisitCXXDeleteExpr(CXXDeleteExpr *E) {
2029 VisitExpr(E);
2030 Record.push_back(E->isGlobalDelete());
2031 Record.push_back(E->isArrayForm());
2032 Record.push_back(E->isArrayFormAsWritten());
2033 Record.push_back(E->doesUsualArrayDeleteWantSize());
2034 Record.AddDeclRef(E->getOperatorDelete());
2035 Record.AddStmt(E->getArgument());
2036 Record.AddSourceLocation(E->getBeginLoc());
2037
2039}
2040
2041void ASTStmtWriter::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
2042 VisitExpr(E);
2043
2044 Record.AddStmt(E->getBase());
2045 Record.push_back(E->isArrow());
2046 Record.AddSourceLocation(E->getOperatorLoc());
2047 Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
2048 Record.AddTypeSourceInfo(E->getScopeTypeInfo());
2049 Record.AddSourceLocation(E->getColonColonLoc());
2050 Record.AddSourceLocation(E->getTildeLoc());
2051
2052 // PseudoDestructorTypeStorage.
2053 Record.AddIdentifierRef(E->getDestroyedTypeIdentifier());
2055 Record.AddSourceLocation(E->getDestroyedTypeLoc());
2056 else
2057 Record.AddTypeSourceInfo(E->getDestroyedTypeInfo());
2058
2060}
2061
2062void ASTStmtWriter::VisitExprWithCleanups(ExprWithCleanups *E) {
2063 VisitExpr(E);
2064 Record.push_back(E->getNumObjects());
2065 for (auto &Obj : E->getObjects()) {
2066 if (auto *BD = Obj.dyn_cast<BlockDecl *>()) {
2067 Record.push_back(serialization::COK_Block);
2068 Record.AddDeclRef(BD);
2069 } else if (auto *CLE = Obj.dyn_cast<CompoundLiteralExpr *>()) {
2070 Record.push_back(serialization::COK_CompoundLiteral);
2071 Record.AddStmt(CLE);
2072 }
2073 }
2074
2075 Record.push_back(E->cleanupsHaveSideEffects());
2076 Record.AddStmt(E->getSubExpr());
2078}
2079
2080void ASTStmtWriter::VisitCXXDependentScopeMemberExpr(
2082 VisitExpr(E);
2083
2084 // Don't emit anything here (or if you do you will have to update
2085 // the corresponding deserialization function).
2086 Record.push_back(E->getNumTemplateArgs());
2087 CurrentPackingBits.updateBits();
2088 CurrentPackingBits.addBit(E->hasTemplateKWAndArgsInfo());
2089 CurrentPackingBits.addBit(E->hasFirstQualifierFoundInScope());
2090
2091 if (E->hasTemplateKWAndArgsInfo()) {
2092 const ASTTemplateKWAndArgsInfo &ArgInfo =
2093 *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
2095 E->getTrailingObjects<TemplateArgumentLoc>());
2096 }
2097
2098 CurrentPackingBits.addBit(E->isArrow());
2099
2100 Record.AddTypeRef(E->getBaseType());
2101 Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
2102 CurrentPackingBits.addBit(!E->isImplicitAccess());
2103 if (!E->isImplicitAccess())
2104 Record.AddStmt(E->getBase());
2105
2106 Record.AddSourceLocation(E->getOperatorLoc());
2107
2108 if (E->hasFirstQualifierFoundInScope())
2109 Record.AddDeclRef(E->getFirstQualifierFoundInScope());
2110
2111 Record.AddDeclarationNameInfo(E->MemberNameInfo);
2113}
2114
2115void
2116ASTStmtWriter::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) {
2117 VisitExpr(E);
2118
2119 // Don't emit anything here, HasTemplateKWAndArgsInfo must be
2120 // emitted first.
2121 CurrentPackingBits.addBit(
2122 E->DependentScopeDeclRefExprBits.HasTemplateKWAndArgsInfo);
2123
2124 if (E->DependentScopeDeclRefExprBits.HasTemplateKWAndArgsInfo) {
2125 const ASTTemplateKWAndArgsInfo &ArgInfo =
2126 *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
2127 // 16 bits should be enought to store the number of args
2128 CurrentPackingBits.addBits(ArgInfo.NumTemplateArgs, /*Width=*/16);
2130 E->getTrailingObjects<TemplateArgumentLoc>());
2131 }
2132
2133 Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
2134 Record.AddDeclarationNameInfo(E->NameInfo);
2136}
2137
2138void
2139ASTStmtWriter::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E) {
2140 VisitExpr(E);
2141 Record.push_back(E->getNumArgs());
2143 ArgI = E->arg_begin(), ArgE = E->arg_end(); ArgI != ArgE; ++ArgI)
2144 Record.AddStmt(*ArgI);
2145 Record.AddTypeSourceInfo(E->getTypeSourceInfo());
2146 Record.AddSourceLocation(E->getLParenLoc());
2147 Record.AddSourceLocation(E->getRParenLoc());
2148 Record.push_back(E->isListInitialization());
2150}
2151
2152void ASTStmtWriter::VisitOverloadExpr(OverloadExpr *E) {
2153 VisitExpr(E);
2154
2155 Record.push_back(E->getNumDecls());
2156
2157 CurrentPackingBits.updateBits();
2158 CurrentPackingBits.addBit(E->hasTemplateKWAndArgsInfo());
2159 if (E->hasTemplateKWAndArgsInfo()) {
2160 const ASTTemplateKWAndArgsInfo &ArgInfo =
2162 Record.push_back(ArgInfo.NumTemplateArgs);
2164 }
2165
2167 OvE = E->decls_end();
2168 OvI != OvE; ++OvI) {
2169 Record.AddDeclRef(OvI.getDecl());
2170 Record.push_back(OvI.getAccess());
2171 }
2172
2173 Record.AddDeclarationNameInfo(E->getNameInfo());
2174 Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
2175}
2176
2177void ASTStmtWriter::VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
2178 VisitOverloadExpr(E);
2179 CurrentPackingBits.addBit(E->isArrow());
2180 CurrentPackingBits.addBit(E->hasUnresolvedUsing());
2181 CurrentPackingBits.addBit(!E->isImplicitAccess());
2182 if (!E->isImplicitAccess())
2183 Record.AddStmt(E->getBase());
2184
2185 Record.AddSourceLocation(E->getOperatorLoc());
2186
2187 Record.AddTypeRef(E->getBaseType());
2189}
2190
2191void ASTStmtWriter::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) {
2192 VisitOverloadExpr(E);
2193 CurrentPackingBits.addBit(E->requiresADL());
2194 Record.AddDeclRef(E->getNamingClass());
2196
2197 if (Writer.isWritingStdCXXNamedModules() && Writer.getChain()) {
2198 // Referencing all the possible declarations to make sure the change get
2199 // propagted.
2200 DeclarationName Name = E->getName();
2201 for (auto *Found :
2202 Record.getASTContext().getTranslationUnitDecl()->lookup(Name))
2203 if (Found->isFromASTFile())
2204 Writer.GetDeclRef(Found);
2205
2206 llvm::SmallVector<NamespaceDecl *> ExternalNSs;
2207 Writer.getChain()->ReadKnownNamespaces(ExternalNSs);
2208 for (auto *NS : ExternalNSs)
2209 for (auto *Found : NS->lookup(Name))
2210 Writer.GetDeclRef(Found);
2211 }
2212}
2213
2214void ASTStmtWriter::VisitTypeTraitExpr(TypeTraitExpr *E) {
2215 VisitExpr(E);
2216 Record.push_back(E->TypeTraitExprBits.IsBooleanTypeTrait);
2217 Record.push_back(E->TypeTraitExprBits.NumArgs);
2218 Record.push_back(E->TypeTraitExprBits.Kind); // FIXME: Stable encoding
2219
2220 if (E->TypeTraitExprBits.IsBooleanTypeTrait)
2221 Record.push_back(E->TypeTraitExprBits.Value);
2222 else
2223 Record.AddAPValue(E->getAPValue());
2224
2225 Record.AddSourceRange(E->getSourceRange());
2226 for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
2227 Record.AddTypeSourceInfo(E->getArg(I));
2229}
2230
2231void ASTStmtWriter::VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E) {
2232 VisitExpr(E);
2233 Record.push_back(E->getTrait());
2234 Record.push_back(E->getValue());
2235 Record.AddSourceRange(E->getSourceRange());
2236 Record.AddTypeSourceInfo(E->getQueriedTypeSourceInfo());
2237 Record.AddStmt(E->getDimensionExpression());
2239}
2240
2241void ASTStmtWriter::VisitExpressionTraitExpr(ExpressionTraitExpr *E) {
2242 VisitExpr(E);
2243 Record.push_back(E->getTrait());
2244 Record.push_back(E->getValue());
2245 Record.AddSourceRange(E->getSourceRange());
2246 Record.AddStmt(E->getQueriedExpression());
2248}
2249
2250void ASTStmtWriter::VisitCXXNoexceptExpr(CXXNoexceptExpr *E) {
2251 VisitExpr(E);
2252 Record.push_back(E->getValue());
2253 Record.AddSourceRange(E->getSourceRange());
2254 Record.AddStmt(E->getOperand());
2256}
2257
2258void ASTStmtWriter::VisitPackExpansionExpr(PackExpansionExpr *E) {
2259 VisitExpr(E);
2260 Record.AddSourceLocation(E->getEllipsisLoc());
2261 Record.push_back(E->NumExpansions);
2262 Record.AddStmt(E->getPattern());
2264}
2265
2266void ASTStmtWriter::VisitSizeOfPackExpr(SizeOfPackExpr *E) {
2267 VisitExpr(E);
2268 Record.push_back(E->isPartiallySubstituted() ? E->getPartialArguments().size()
2269 : 0);
2270 Record.AddSourceLocation(E->OperatorLoc);
2271 Record.AddSourceLocation(E->PackLoc);
2272 Record.AddSourceLocation(E->RParenLoc);
2273 Record.AddDeclRef(E->Pack);
2274 if (E->isPartiallySubstituted()) {
2275 for (const auto &TA : E->getPartialArguments())
2276 Record.AddTemplateArgument(TA);
2277 } else if (!E->isValueDependent()) {
2278 Record.push_back(E->getPackLength());
2279 }
2281}
2282
2283void ASTStmtWriter::VisitPackIndexingExpr(PackIndexingExpr *E) {
2284 VisitExpr(E);
2285 Record.push_back(E->PackIndexingExprBits.TransformedExpressions);
2286 Record.push_back(E->PackIndexingExprBits.FullySubstituted);
2287 Record.AddSourceLocation(E->getEllipsisLoc());
2288 Record.AddSourceLocation(E->getRSquareLoc());
2289 Record.AddStmt(E->getPackIdExpression());
2290 Record.AddStmt(E->getIndexExpr());
2291 for (Expr *Sub : E->getExpressions())
2292 Record.AddStmt(Sub);
2294}
2295
2296void ASTStmtWriter::VisitSubstNonTypeTemplateParmExpr(
2298 VisitExpr(E);
2299 Record.AddDeclRef(E->getAssociatedDecl());
2300 CurrentPackingBits.addBit(E->isReferenceParameter());
2301 CurrentPackingBits.addBits(E->getIndex(), /*Width=*/12);
2302 Record.writeUnsignedOrNone(E->getPackIndex());
2303 CurrentPackingBits.addBit(E->getFinal());
2304
2305 Record.AddSourceLocation(E->getNameLoc());
2306 Record.AddStmt(E->getReplacement());
2308}
2309
2310void ASTStmtWriter::VisitSubstNonTypeTemplateParmPackExpr(
2312 VisitExpr(E);
2313 Record.AddDeclRef(E->getAssociatedDecl());
2314 CurrentPackingBits.addBit(E->getFinal());
2315 Record.push_back(E->getIndex());
2316 Record.AddTemplateArgument(E->getArgumentPack());
2317 Record.AddSourceLocation(E->getParameterPackLocation());
2319}
2320
2321void ASTStmtWriter::VisitFunctionParmPackExpr(FunctionParmPackExpr *E) {
2322 VisitExpr(E);
2323 Record.push_back(E->getNumExpansions());
2324 Record.AddDeclRef(E->getParameterPack());
2325 Record.AddSourceLocation(E->getParameterPackLocation());
2326 for (FunctionParmPackExpr::iterator I = E->begin(), End = E->end();
2327 I != End; ++I)
2328 Record.AddDeclRef(*I);
2330}
2331
2332void ASTStmtWriter::VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E) {
2333 VisitExpr(E);
2334 Record.push_back(static_cast<bool>(E->getLifetimeExtendedTemporaryDecl()));
2336 Record.AddDeclRef(E->getLifetimeExtendedTemporaryDecl());
2337 else
2338 Record.AddStmt(E->getSubExpr());
2340}
2341
2342void ASTStmtWriter::VisitCXXFoldExpr(CXXFoldExpr *E) {
2343 VisitExpr(E);
2344 Record.AddSourceLocation(E->LParenLoc);
2345 Record.AddSourceLocation(E->EllipsisLoc);
2346 Record.AddSourceLocation(E->RParenLoc);
2347 Record.push_back(E->NumExpansions.toInternalRepresentation());
2348 Record.AddStmt(E->SubExprs[0]);
2349 Record.AddStmt(E->SubExprs[1]);
2350 Record.AddStmt(E->SubExprs[2]);
2351 Record.push_back(E->CXXFoldExprBits.Opcode);
2353}
2354
2355void ASTStmtWriter::VisitCXXParenListInitExpr(CXXParenListInitExpr *E) {
2356 VisitExpr(E);
2357 ArrayRef<Expr *> InitExprs = E->getInitExprs();
2358 Record.push_back(InitExprs.size());
2359 Record.push_back(E->getUserSpecifiedInitExprs().size());
2360 Record.AddSourceLocation(E->getInitLoc());
2361 Record.AddSourceLocation(E->getBeginLoc());
2362 Record.AddSourceLocation(E->getEndLoc());
2363 for (Expr *InitExpr : E->getInitExprs())
2364 Record.AddStmt(InitExpr);
2365 Expr *ArrayFiller = E->getArrayFiller();
2366 FieldDecl *UnionField = E->getInitializedFieldInUnion();
2367 bool HasArrayFillerOrUnionDecl = ArrayFiller || UnionField;
2368 Record.push_back(HasArrayFillerOrUnionDecl);
2369 if (HasArrayFillerOrUnionDecl) {
2370 Record.push_back(static_cast<bool>(ArrayFiller));
2371 if (ArrayFiller)
2372 Record.AddStmt(ArrayFiller);
2373 else
2374 Record.AddDeclRef(UnionField);
2375 }
2377}
2378
2379void ASTStmtWriter::VisitOpaqueValueExpr(OpaqueValueExpr *E) {
2380 VisitExpr(E);
2381 Record.AddStmt(E->getSourceExpr());
2382 Record.AddSourceLocation(E->getLocation());
2383 Record.push_back(E->isUnique());
2385}
2386
2387//===----------------------------------------------------------------------===//
2388// CUDA Expressions and Statements.
2389//===----------------------------------------------------------------------===//
2390
2391void ASTStmtWriter::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E) {
2392 VisitCallExpr(E);
2393 Record.AddStmt(E->getConfig());
2395}
2396
2397//===----------------------------------------------------------------------===//
2398// OpenCL Expressions and Statements.
2399//===----------------------------------------------------------------------===//
2400void ASTStmtWriter::VisitAsTypeExpr(AsTypeExpr *E) {
2401 VisitExpr(E);
2402 Record.AddSourceLocation(E->getBuiltinLoc());
2403 Record.AddSourceLocation(E->getRParenLoc());
2404 Record.AddStmt(E->getSrcExpr());
2406}
2407
2408//===----------------------------------------------------------------------===//
2409// Microsoft Expressions and Statements.
2410//===----------------------------------------------------------------------===//
2411void ASTStmtWriter::VisitMSPropertyRefExpr(MSPropertyRefExpr *E) {
2412 VisitExpr(E);
2413 Record.push_back(E->isArrow());
2414 Record.AddStmt(E->getBaseExpr());
2415 Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
2416 Record.AddSourceLocation(E->getMemberLoc());
2417 Record.AddDeclRef(E->getPropertyDecl());
2419}
2420
2421void ASTStmtWriter::VisitMSPropertySubscriptExpr(MSPropertySubscriptExpr *E) {
2422 VisitExpr(E);
2423 Record.AddStmt(E->getBase());
2424 Record.AddStmt(E->getIdx());
2425 Record.AddSourceLocation(E->getRBracketLoc());
2427}
2428
2429void ASTStmtWriter::VisitCXXUuidofExpr(CXXUuidofExpr *E) {
2430 VisitExpr(E);
2431 Record.AddSourceRange(E->getSourceRange());
2432 Record.AddDeclRef(E->getGuidDecl());
2433 if (E->isTypeOperand()) {
2434 Record.AddTypeSourceInfo(E->getTypeOperandSourceInfo());
2436 } else {
2437 Record.AddStmt(E->getExprOperand());
2439 }
2440}
2441
2442void ASTStmtWriter::VisitSEHExceptStmt(SEHExceptStmt *S) {
2443 VisitStmt(S);
2444 Record.AddSourceLocation(S->getExceptLoc());
2445 Record.AddStmt(S->getFilterExpr());
2446 Record.AddStmt(S->getBlock());
2448}
2449
2450void ASTStmtWriter::VisitSEHFinallyStmt(SEHFinallyStmt *S) {
2451 VisitStmt(S);
2452 Record.AddSourceLocation(S->getFinallyLoc());
2453 Record.AddStmt(S->getBlock());
2455}
2456
2457void ASTStmtWriter::VisitSEHTryStmt(SEHTryStmt *S) {
2458 VisitStmt(S);
2459 Record.push_back(S->getIsCXXTry());
2460 Record.AddSourceLocation(S->getTryLoc());
2461 Record.AddStmt(S->getTryBlock());
2462 Record.AddStmt(S->getHandler());
2464}
2465
2466void ASTStmtWriter::VisitSEHLeaveStmt(SEHLeaveStmt *S) {
2467 VisitStmt(S);
2468 Record.AddSourceLocation(S->getLeaveLoc());
2470}
2471
2472//===----------------------------------------------------------------------===//
2473// OpenMP Directives.
2474//===----------------------------------------------------------------------===//
2475
2476void ASTStmtWriter::VisitOMPCanonicalLoop(OMPCanonicalLoop *S) {
2477 VisitStmt(S);
2478 for (Stmt *SubStmt : S->SubStmts)
2479 Record.AddStmt(SubStmt);
2481}
2482
2483void ASTStmtWriter::VisitOMPExecutableDirective(OMPExecutableDirective *E) {
2484 Record.writeOMPChildren(E->Data);
2485 Record.AddSourceLocation(E->getBeginLoc());
2486 Record.AddSourceLocation(E->getEndLoc());
2487}
2488
2489void ASTStmtWriter::VisitOMPLoopBasedDirective(OMPLoopBasedDirective *D) {
2490 VisitStmt(D);
2491 Record.writeUInt32(D->getLoopsNumber());
2492 VisitOMPExecutableDirective(D);
2493}
2494
2495void ASTStmtWriter::VisitOMPLoopDirective(OMPLoopDirective *D) {
2496 VisitOMPLoopBasedDirective(D);
2497}
2498
2499void ASTStmtWriter::VisitOMPMetaDirective(OMPMetaDirective *D) {
2500 VisitStmt(D);
2501 Record.push_back(D->getNumClauses());
2502 VisitOMPExecutableDirective(D);
2504}
2505
2506void ASTStmtWriter::VisitOMPParallelDirective(OMPParallelDirective *D) {
2507 VisitStmt(D);
2508 VisitOMPExecutableDirective(D);
2509 Record.writeBool(D->hasCancel());
2511}
2512
2513void ASTStmtWriter::VisitOMPSimdDirective(OMPSimdDirective *D) {
2514 VisitOMPLoopDirective(D);
2516}
2517
2518void ASTStmtWriter::VisitOMPCanonicalLoopNestTransformationDirective(
2519 OMPCanonicalLoopNestTransformationDirective *D) {
2520 VisitOMPLoopBasedDirective(D);
2521 Record.writeUInt32(D->getNumGeneratedTopLevelLoops());
2522}
2523
2524void ASTStmtWriter::VisitOMPTileDirective(OMPTileDirective *D) {
2525 VisitOMPCanonicalLoopNestTransformationDirective(D);
2527}
2528
2529void ASTStmtWriter::VisitOMPStripeDirective(OMPStripeDirective *D) {
2530 VisitOMPCanonicalLoopNestTransformationDirective(D);
2532}
2533
2534void ASTStmtWriter::VisitOMPUnrollDirective(OMPUnrollDirective *D) {
2535 VisitOMPCanonicalLoopNestTransformationDirective(D);
2537}
2538
2539void ASTStmtWriter::VisitOMPReverseDirective(OMPReverseDirective *D) {
2540 VisitOMPCanonicalLoopNestTransformationDirective(D);
2542}
2543
2544void ASTStmtWriter::VisitOMPInterchangeDirective(OMPInterchangeDirective *D) {
2545 VisitOMPCanonicalLoopNestTransformationDirective(D);
2547}
2548
2549void ASTStmtWriter::VisitOMPCanonicalLoopSequenceTransformationDirective(
2550 OMPCanonicalLoopSequenceTransformationDirective *D) {
2551 VisitStmt(D);
2552 VisitOMPExecutableDirective(D);
2553 Record.writeUInt32(D->getNumGeneratedTopLevelLoops());
2554}
2555
2556void ASTStmtWriter::VisitOMPFuseDirective(OMPFuseDirective *D) {
2557 VisitOMPCanonicalLoopSequenceTransformationDirective(D);
2559}
2560
2561void ASTStmtWriter::VisitOMPForDirective(OMPForDirective *D) {
2562 VisitOMPLoopDirective(D);
2563 Record.writeBool(D->hasCancel());
2565}
2566
2567void ASTStmtWriter::VisitOMPForSimdDirective(OMPForSimdDirective *D) {
2568 VisitOMPLoopDirective(D);
2570}
2571
2572void ASTStmtWriter::VisitOMPSectionsDirective(OMPSectionsDirective *D) {
2573 VisitStmt(D);
2574 VisitOMPExecutableDirective(D);
2575 Record.writeBool(D->hasCancel());
2577}
2578
2579void ASTStmtWriter::VisitOMPSectionDirective(OMPSectionDirective *D) {
2580 VisitStmt(D);
2581 VisitOMPExecutableDirective(D);
2582 Record.writeBool(D->hasCancel());
2584}
2585
2586void ASTStmtWriter::VisitOMPScopeDirective(OMPScopeDirective *D) {
2587 VisitStmt(D);
2588 VisitOMPExecutableDirective(D);
2590}
2591
2592void ASTStmtWriter::VisitOMPSingleDirective(OMPSingleDirective *D) {
2593 VisitStmt(D);
2594 VisitOMPExecutableDirective(D);
2596}
2597
2598void ASTStmtWriter::VisitOMPMasterDirective(OMPMasterDirective *D) {
2599 VisitStmt(D);
2600 VisitOMPExecutableDirective(D);
2602}
2603
2604void ASTStmtWriter::VisitOMPCriticalDirective(OMPCriticalDirective *D) {
2605 VisitStmt(D);
2606 VisitOMPExecutableDirective(D);
2607 Record.AddDeclarationNameInfo(D->getDirectiveName());
2609}
2610
2611void ASTStmtWriter::VisitOMPParallelForDirective(OMPParallelForDirective *D) {
2612 VisitOMPLoopDirective(D);
2613 Record.writeBool(D->hasCancel());
2615}
2616
2617void ASTStmtWriter::VisitOMPParallelForSimdDirective(
2618 OMPParallelForSimdDirective *D) {
2619 VisitOMPLoopDirective(D);
2621}
2622
2623void ASTStmtWriter::VisitOMPParallelMasterDirective(
2624 OMPParallelMasterDirective *D) {
2625 VisitStmt(D);
2626 VisitOMPExecutableDirective(D);
2628}
2629
2630void ASTStmtWriter::VisitOMPParallelMaskedDirective(
2631 OMPParallelMaskedDirective *D) {
2632 VisitStmt(D);
2633 VisitOMPExecutableDirective(D);
2635}
2636
2637void ASTStmtWriter::VisitOMPParallelSectionsDirective(
2638 OMPParallelSectionsDirective *D) {
2639 VisitStmt(D);
2640 VisitOMPExecutableDirective(D);
2641 Record.writeBool(D->hasCancel());
2643}
2644
2645void ASTStmtWriter::VisitOMPTaskDirective(OMPTaskDirective *D) {
2646 VisitStmt(D);
2647 VisitOMPExecutableDirective(D);
2648 Record.writeBool(D->hasCancel());
2650}
2651
2652void ASTStmtWriter::VisitOMPAtomicDirective(OMPAtomicDirective *D) {
2653 VisitStmt(D);
2654 VisitOMPExecutableDirective(D);
2655 Record.writeBool(D->isXLHSInRHSPart());
2656 Record.writeBool(D->isPostfixUpdate());
2657 Record.writeBool(D->isFailOnly());
2659}
2660
2661void ASTStmtWriter::VisitOMPTargetDirective(OMPTargetDirective *D) {
2662 VisitStmt(D);
2663 VisitOMPExecutableDirective(D);
2665}
2666
2667void ASTStmtWriter::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) {
2668 VisitStmt(D);
2669 VisitOMPExecutableDirective(D);
2671}
2672
2673void ASTStmtWriter::VisitOMPTargetEnterDataDirective(
2674 OMPTargetEnterDataDirective *D) {
2675 VisitStmt(D);
2676 VisitOMPExecutableDirective(D);
2678}
2679
2680void ASTStmtWriter::VisitOMPTargetExitDataDirective(
2681 OMPTargetExitDataDirective *D) {
2682 VisitStmt(D);
2683 VisitOMPExecutableDirective(D);
2685}
2686
2687void ASTStmtWriter::VisitOMPTargetParallelDirective(
2688 OMPTargetParallelDirective *D) {
2689 VisitStmt(D);
2690 VisitOMPExecutableDirective(D);
2691 Record.writeBool(D->hasCancel());
2693}
2694
2695void ASTStmtWriter::VisitOMPTargetParallelForDirective(
2696 OMPTargetParallelForDirective *D) {
2697 VisitOMPLoopDirective(D);
2698 Record.writeBool(D->hasCancel());
2700}
2701
2702void ASTStmtWriter::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) {
2703 VisitStmt(D);
2704 VisitOMPExecutableDirective(D);
2706}
2707
2708void ASTStmtWriter::VisitOMPBarrierDirective(OMPBarrierDirective *D) {
2709 VisitStmt(D);
2710 VisitOMPExecutableDirective(D);
2712}
2713
2714void ASTStmtWriter::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) {
2715 VisitStmt(D);
2716 Record.push_back(D->getNumClauses());
2717 VisitOMPExecutableDirective(D);
2719}
2720
2721void ASTStmtWriter::VisitOMPAssumeDirective(OMPAssumeDirective *D) {
2722 VisitStmt(D);
2723 VisitOMPExecutableDirective(D);
2725}
2726
2727void ASTStmtWriter::VisitOMPErrorDirective(OMPErrorDirective *D) {
2728 VisitStmt(D);
2729 Record.push_back(D->getNumClauses());
2730 VisitOMPExecutableDirective(D);
2732}
2733
2734void ASTStmtWriter::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) {
2735 VisitStmt(D);
2736 VisitOMPExecutableDirective(D);
2738}
2739
2740void ASTStmtWriter::VisitOMPFlushDirective(OMPFlushDirective *D) {
2741 VisitStmt(D);
2742 VisitOMPExecutableDirective(D);
2744}
2745
2746void ASTStmtWriter::VisitOMPDepobjDirective(OMPDepobjDirective *D) {
2747 VisitStmt(D);
2748 VisitOMPExecutableDirective(D);
2750}
2751
2752void ASTStmtWriter::VisitOMPScanDirective(OMPScanDirective *D) {
2753 VisitStmt(D);
2754 VisitOMPExecutableDirective(D);
2756}
2757
2758void ASTStmtWriter::VisitOMPOrderedDirective(OMPOrderedDirective *D) {
2759 VisitStmt(D);
2760 VisitOMPExecutableDirective(D);
2762}
2763
2764void ASTStmtWriter::VisitOMPTeamsDirective(OMPTeamsDirective *D) {
2765 VisitStmt(D);
2766 VisitOMPExecutableDirective(D);
2768}
2769
2770void ASTStmtWriter::VisitOMPCancellationPointDirective(
2771 OMPCancellationPointDirective *D) {
2772 VisitStmt(D);
2773 VisitOMPExecutableDirective(D);
2774 Record.writeEnum(D->getCancelRegion());
2776}
2777
2778void ASTStmtWriter::VisitOMPCancelDirective(OMPCancelDirective *D) {
2779 VisitStmt(D);
2780 VisitOMPExecutableDirective(D);
2781 Record.writeEnum(D->getCancelRegion());
2783}
2784
2785void ASTStmtWriter::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) {
2786 VisitOMPLoopDirective(D);
2787 Record.writeBool(D->hasCancel());
2789}
2790
2791void ASTStmtWriter::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) {
2792 VisitOMPLoopDirective(D);
2794}
2795
2796void ASTStmtWriter::VisitOMPMasterTaskLoopDirective(
2797 OMPMasterTaskLoopDirective *D) {
2798 VisitOMPLoopDirective(D);
2799 Record.writeBool(D->hasCancel());
2801}
2802
2803void ASTStmtWriter::VisitOMPMaskedTaskLoopDirective(
2804 OMPMaskedTaskLoopDirective *D) {
2805 VisitOMPLoopDirective(D);
2806 Record.writeBool(D->hasCancel());
2808}
2809
2810void ASTStmtWriter::VisitOMPMasterTaskLoopSimdDirective(
2811 OMPMasterTaskLoopSimdDirective *D) {
2812 VisitOMPLoopDirective(D);
2814}
2815
2816void ASTStmtWriter::VisitOMPMaskedTaskLoopSimdDirective(
2817 OMPMaskedTaskLoopSimdDirective *D) {
2818 VisitOMPLoopDirective(D);
2820}
2821
2822void ASTStmtWriter::VisitOMPParallelMasterTaskLoopDirective(
2823 OMPParallelMasterTaskLoopDirective *D) {
2824 VisitOMPLoopDirective(D);
2825 Record.writeBool(D->hasCancel());
2827}
2828
2829void ASTStmtWriter::VisitOMPParallelMaskedTaskLoopDirective(
2830 OMPParallelMaskedTaskLoopDirective *D) {
2831 VisitOMPLoopDirective(D);
2832 Record.writeBool(D->hasCancel());
2834}
2835
2836void ASTStmtWriter::VisitOMPParallelMasterTaskLoopSimdDirective(
2837 OMPParallelMasterTaskLoopSimdDirective *D) {
2838 VisitOMPLoopDirective(D);
2840}
2841
2842void ASTStmtWriter::VisitOMPParallelMaskedTaskLoopSimdDirective(
2843 OMPParallelMaskedTaskLoopSimdDirective *D) {
2844 VisitOMPLoopDirective(D);
2846}
2847
2848void ASTStmtWriter::VisitOMPDistributeDirective(OMPDistributeDirective *D) {
2849 VisitOMPLoopDirective(D);
2851}
2852
2853void ASTStmtWriter::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) {
2854 VisitStmt(D);
2855 VisitOMPExecutableDirective(D);
2857}
2858
2859void ASTStmtWriter::VisitOMPDistributeParallelForDirective(
2860 OMPDistributeParallelForDirective *D) {
2861 VisitOMPLoopDirective(D);
2862 Record.writeBool(D->hasCancel());
2864}
2865
2866void ASTStmtWriter::VisitOMPDistributeParallelForSimdDirective(
2867 OMPDistributeParallelForSimdDirective *D) {
2868 VisitOMPLoopDirective(D);
2870}
2871
2872void ASTStmtWriter::VisitOMPDistributeSimdDirective(
2873 OMPDistributeSimdDirective *D) {
2874 VisitOMPLoopDirective(D);
2876}
2877
2878void ASTStmtWriter::VisitOMPTargetParallelForSimdDirective(
2879 OMPTargetParallelForSimdDirective *D) {
2880 VisitOMPLoopDirective(D);
2882}
2883
2884void ASTStmtWriter::VisitOMPTargetSimdDirective(OMPTargetSimdDirective *D) {
2885 VisitOMPLoopDirective(D);
2887}
2888
2889void ASTStmtWriter::VisitOMPTeamsDistributeDirective(
2890 OMPTeamsDistributeDirective *D) {
2891 VisitOMPLoopDirective(D);
2893}
2894
2895void ASTStmtWriter::VisitOMPTeamsDistributeSimdDirective(
2896 OMPTeamsDistributeSimdDirective *D) {
2897 VisitOMPLoopDirective(D);
2899}
2900
2901void ASTStmtWriter::VisitOMPTeamsDistributeParallelForSimdDirective(
2902 OMPTeamsDistributeParallelForSimdDirective *D) {
2903 VisitOMPLoopDirective(D);
2905}
2906
2907void ASTStmtWriter::VisitOMPTeamsDistributeParallelForDirective(
2908 OMPTeamsDistributeParallelForDirective *D) {
2909 VisitOMPLoopDirective(D);
2910 Record.writeBool(D->hasCancel());
2912}
2913
2914void ASTStmtWriter::VisitOMPTargetTeamsDirective(OMPTargetTeamsDirective *D) {
2915 VisitStmt(D);
2916 VisitOMPExecutableDirective(D);
2918}
2919
2920void ASTStmtWriter::VisitOMPTargetTeamsDistributeDirective(
2921 OMPTargetTeamsDistributeDirective *D) {
2922 VisitOMPLoopDirective(D);
2924}
2925
2926void ASTStmtWriter::VisitOMPTargetTeamsDistributeParallelForDirective(
2927 OMPTargetTeamsDistributeParallelForDirective *D) {
2928 VisitOMPLoopDirective(D);
2929 Record.writeBool(D->hasCancel());
2931}
2932
2933void ASTStmtWriter::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
2934 OMPTargetTeamsDistributeParallelForSimdDirective *D) {
2935 VisitOMPLoopDirective(D);
2936 Code = serialization::
2937 STMT_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE;
2938}
2939
2940void ASTStmtWriter::VisitOMPTargetTeamsDistributeSimdDirective(
2941 OMPTargetTeamsDistributeSimdDirective *D) {
2942 VisitOMPLoopDirective(D);
2944}
2945
2946void ASTStmtWriter::VisitOMPInteropDirective(OMPInteropDirective *D) {
2947 VisitStmt(D);
2948 VisitOMPExecutableDirective(D);
2950}
2951
2952void ASTStmtWriter::VisitOMPDispatchDirective(OMPDispatchDirective *D) {
2953 VisitStmt(D);
2954 VisitOMPExecutableDirective(D);
2955 Record.AddSourceLocation(D->getTargetCallLoc());
2957}
2958
2959void ASTStmtWriter::VisitOMPMaskedDirective(OMPMaskedDirective *D) {
2960 VisitStmt(D);
2961 VisitOMPExecutableDirective(D);
2963}
2964
2965void ASTStmtWriter::VisitOMPGenericLoopDirective(OMPGenericLoopDirective *D) {
2966 VisitOMPLoopDirective(D);
2968}
2969
2970void ASTStmtWriter::VisitOMPTeamsGenericLoopDirective(
2971 OMPTeamsGenericLoopDirective *D) {
2972 VisitOMPLoopDirective(D);
2974}
2975
2976void ASTStmtWriter::VisitOMPTargetTeamsGenericLoopDirective(
2977 OMPTargetTeamsGenericLoopDirective *D) {
2978 VisitOMPLoopDirective(D);
2979 Record.writeBool(D->canBeParallelFor());
2981}
2982
2983void ASTStmtWriter::VisitOMPParallelGenericLoopDirective(
2984 OMPParallelGenericLoopDirective *D) {
2985 VisitOMPLoopDirective(D);
2987}
2988
2989void ASTStmtWriter::VisitOMPTargetParallelGenericLoopDirective(
2990 OMPTargetParallelGenericLoopDirective *D) {
2991 VisitOMPLoopDirective(D);
2993}
2994
2995//===----------------------------------------------------------------------===//
2996// OpenACC Constructs/Directives.
2997//===----------------------------------------------------------------------===//
2998void ASTStmtWriter::VisitOpenACCConstructStmt(OpenACCConstructStmt *S) {
2999 Record.push_back(S->clauses().size());
3000 Record.writeEnum(S->Kind);
3001 Record.AddSourceRange(S->Range);
3002 Record.AddSourceLocation(S->DirectiveLoc);
3003 Record.writeOpenACCClauseList(S->clauses());
3004}
3005
3006void ASTStmtWriter::VisitOpenACCAssociatedStmtConstruct(
3008 VisitOpenACCConstructStmt(S);
3009 Record.AddStmt(S->getAssociatedStmt());
3010}
3011
3012void ASTStmtWriter::VisitOpenACCComputeConstruct(OpenACCComputeConstruct *S) {
3013 VisitStmt(S);
3014 VisitOpenACCAssociatedStmtConstruct(S);
3016}
3017
3018void ASTStmtWriter::VisitOpenACCLoopConstruct(OpenACCLoopConstruct *S) {
3019 VisitStmt(S);
3020 VisitOpenACCAssociatedStmtConstruct(S);
3021 Record.writeEnum(S->getParentComputeConstructKind());
3023}
3024
3025void ASTStmtWriter::VisitOpenACCCombinedConstruct(OpenACCCombinedConstruct *S) {
3026 VisitStmt(S);
3027 VisitOpenACCAssociatedStmtConstruct(S);
3029}
3030
3031void ASTStmtWriter::VisitOpenACCDataConstruct(OpenACCDataConstruct *S) {
3032 VisitStmt(S);
3033 VisitOpenACCAssociatedStmtConstruct(S);
3035}
3036
3037void ASTStmtWriter::VisitOpenACCEnterDataConstruct(
3038 OpenACCEnterDataConstruct *S) {
3039 VisitStmt(S);
3040 VisitOpenACCConstructStmt(S);
3042}
3043
3044void ASTStmtWriter::VisitOpenACCExitDataConstruct(OpenACCExitDataConstruct *S) {
3045 VisitStmt(S);
3046 VisitOpenACCConstructStmt(S);
3048}
3049
3050void ASTStmtWriter::VisitOpenACCInitConstruct(OpenACCInitConstruct *S) {
3051 VisitStmt(S);
3052 VisitOpenACCConstructStmt(S);
3054}
3055
3056void ASTStmtWriter::VisitOpenACCShutdownConstruct(OpenACCShutdownConstruct *S) {
3057 VisitStmt(S);
3058 VisitOpenACCConstructStmt(S);
3060}
3061
3062void ASTStmtWriter::VisitOpenACCSetConstruct(OpenACCSetConstruct *S) {
3063 VisitStmt(S);
3064 VisitOpenACCConstructStmt(S);
3066}
3067
3068void ASTStmtWriter::VisitOpenACCUpdateConstruct(OpenACCUpdateConstruct *S) {
3069 VisitStmt(S);
3070 VisitOpenACCConstructStmt(S);
3072}
3073
3074void ASTStmtWriter::VisitOpenACCHostDataConstruct(OpenACCHostDataConstruct *S) {
3075 VisitStmt(S);
3076 VisitOpenACCAssociatedStmtConstruct(S);
3078}
3079
3080void ASTStmtWriter::VisitOpenACCWaitConstruct(OpenACCWaitConstruct *S) {
3081 VisitStmt(S);
3082 Record.push_back(S->getExprs().size());
3083 VisitOpenACCConstructStmt(S);
3084 Record.AddSourceLocation(S->LParenLoc);
3085 Record.AddSourceLocation(S->RParenLoc);
3086 Record.AddSourceLocation(S->QueuesLoc);
3087
3088 for(Expr *E : S->getExprs())
3089 Record.AddStmt(E);
3090
3092}
3093
3094void ASTStmtWriter::VisitOpenACCAtomicConstruct(OpenACCAtomicConstruct *S) {
3095 VisitStmt(S);
3096 VisitOpenACCConstructStmt(S);
3097 Record.writeEnum(S->getAtomicKind());
3098 Record.AddStmt(S->getAssociatedStmt());
3099
3101}
3102
3103void ASTStmtWriter::VisitOpenACCCacheConstruct(OpenACCCacheConstruct *S) {
3104 VisitStmt(S);
3105 Record.push_back(S->getVarList().size());
3106 VisitOpenACCConstructStmt(S);
3107 Record.AddSourceRange(S->ParensLoc);
3108 Record.AddSourceLocation(S->ReadOnlyLoc);
3109
3110 for (Expr *E : S->getVarList())
3111 Record.AddStmt(E);
3113}
3114
3115//===----------------------------------------------------------------------===//
3116// HLSL Constructs/Directives.
3117//===----------------------------------------------------------------------===//
3118
3119void ASTStmtWriter::VisitHLSLOutArgExpr(HLSLOutArgExpr *S) {
3120 VisitExpr(S);
3121 Record.AddStmt(S->getOpaqueArgLValue());
3122 Record.AddStmt(S->getCastedTemporary());
3123 Record.AddStmt(S->getWritebackCast());
3124 Record.writeBool(S->isInOut());
3126}
3127
3128//===----------------------------------------------------------------------===//
3129// ASTWriter Implementation
3130//===----------------------------------------------------------------------===//
3131
3133 assert(!SwitchCaseIDs.contains(S) && "SwitchCase recorded twice");
3134 unsigned NextID = SwitchCaseIDs.size();
3135 SwitchCaseIDs[S] = NextID;
3136 return NextID;
3137}
3138
3140 assert(SwitchCaseIDs.contains(S) && "SwitchCase hasn't been seen yet");
3141 return SwitchCaseIDs[S];
3142}
3143
3145 SwitchCaseIDs.clear();
3146}
3147
3148/// Write the given substatement or subexpression to the
3149/// bitstream.
3150void ASTWriter::WriteSubStmt(ASTContext &Context, Stmt *S) {
3152 ASTStmtWriter Writer(Context, *this, Record);
3153 ++NumStatements;
3154
3155 if (!S) {
3156 Stream.EmitRecord(serialization::STMT_NULL_PTR, Record);
3157 return;
3158 }
3159
3160 llvm::DenseMap<Stmt *, uint64_t>::iterator I = SubStmtEntries.find(S);
3161 if (I != SubStmtEntries.end()) {
3162 Record.push_back(I->second);
3163 Stream.EmitRecord(serialization::STMT_REF_PTR, Record);
3164 return;
3165 }
3166
3167#ifndef NDEBUG
3168 assert(!ParentStmts.count(S) && "There is a Stmt cycle!");
3169
3170 struct ParentStmtInserterRAII {
3171 Stmt *S;
3172 llvm::DenseSet<Stmt *> &ParentStmts;
3173
3174 ParentStmtInserterRAII(Stmt *S, llvm::DenseSet<Stmt *> &ParentStmts)
3175 : S(S), ParentStmts(ParentStmts) {
3176 ParentStmts.insert(S);
3177 }
3178 ~ParentStmtInserterRAII() {
3179 ParentStmts.erase(S);
3180 }
3181 };
3182
3183 ParentStmtInserterRAII ParentStmtInserter(S, ParentStmts);
3184#endif
3185
3186 Writer.Visit(S);
3187
3188 uint64_t Offset = Writer.Emit();
3189 SubStmtEntries[S] = Offset;
3190}
3191
3192/// Flush all of the statements that have been added to the
3193/// queue via AddStmt().
3194void ASTRecordWriter::FlushStmts() {
3195 // We expect to be the only consumer of the two temporary statement maps,
3196 // assert that they are empty.
3197 assert(Writer->SubStmtEntries.empty() && "unexpected entries in sub-stmt map");
3198 assert(Writer->ParentStmts.empty() && "unexpected entries in parent stmt map");
3199
3200 for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) {
3201 Writer->WriteSubStmt(getASTContext(), StmtsToEmit[I]);
3202
3203 assert(N == StmtsToEmit.size() && "record modified while being written!");
3204
3205 // Note that we are at the end of a full expression. Any
3206 // expression records that follow this one are part of a different
3207 // expression.
3208 Writer->Stream.EmitRecord(serialization::STMT_STOP, ArrayRef<uint32_t>());
3209
3210 Writer->SubStmtEntries.clear();
3211 Writer->ParentStmts.clear();
3212 }
3213
3214 StmtsToEmit.clear();
3215}
3216
3217void ASTRecordWriter::FlushSubStmts() {
3218 // For a nested statement, write out the substatements in reverse order (so
3219 // that a simple stack machine can be used when loading), and don't emit a
3220 // STMT_STOP after each one.
3221 for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) {
3222 Writer->WriteSubStmt(getASTContext(), StmtsToEmit[N - I - 1]);
3223 assert(N == StmtsToEmit.size() && "record modified while being written!");
3224 }
3225
3226 StmtsToEmit.clear();
3227}
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:226
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:2997
uint64_t getValue() const
Definition ExprCXX.h:3045
ArrayTypeTrait getTrait() const
Definition ExprCXX.h:3037
Expr * getDimensionExpression() const
Definition ExprCXX.h:3047
TypeSourceInfo * getQueriedTypeSourceInfo() const
Definition ExprCXX.h:3043
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:3278
bool isVolatile() const
Definition Stmt.h:3314
SourceLocation getAsmLoc() const
Definition Stmt.h:3308
unsigned getNumClobbers() const
Definition Stmt.h:3369
unsigned getNumOutputs() const
Definition Stmt.h:3337
unsigned getNumInputs() const
Definition Stmt.h:3359
bool isSimple() const
Definition Stmt.h:3311
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:2204
Stmt * getSubStmt()
Definition Stmt.h:2240
SourceLocation getAttrLoc() const
Definition Stmt.h:2235
ArrayRef< const Attr * > getAttrs() const
Definition Stmt.h:2236
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:3136
Represents a C++2a __builtin_bit_cast(T, v) expression.
Definition ExprCXX.h:5473
SourceLocation getEndLoc() const LLVM_READONLY
Definition ExprCXX.h:5492
SourceLocation getBeginLoc() const LLVM_READONLY
Definition ExprCXX.h:5491
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:235
const CallExpr * getConfig() const
Definition ExprCXX.h:261
A C++ addrspace_cast expression (currently only enabled for OpenCL).
Definition ExprCXX.h:605
Represents binding an expression to a temporary.
Definition ExprCXX.h:1494
CXXTemporary * getTemporary()
Definition ExprCXX.h:1512
const Expr * getSubExpr() const
Definition ExprCXX.h:1516
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition ExprCXX.h:724
bool getValue() const
Definition ExprCXX.h:741
SourceLocation getLocation() const
Definition ExprCXX.h:747
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:567
Represents a call to a C++ constructor.
Definition ExprCXX.h:1549
SourceRange getParenOrBraceRange() const
Definition ExprCXX.h:1730
bool isElidable() const
Whether this construction is elidable.
Definition ExprCXX.h:1618
bool hadMultipleCandidates() const
Whether the referred constructor was resolved from an overloaded set having size greater than 1.
Definition ExprCXX.h:1623
Expr * getArg(unsigned Arg)
Return the specified argument.
Definition ExprCXX.h:1692
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
Definition ExprCXX.h:1642
bool isImmediateEscalating() const
Definition ExprCXX.h:1707
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called.
Definition ExprCXX.h:1651
SourceLocation getLocation() const
Definition ExprCXX.h:1614
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
Definition ExprCXX.h:1612
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
Definition ExprCXX.h:1631
unsigned getNumArgs() const
Return the number of arguments to the constructor call.
Definition ExprCXX.h:1689
CXXConstructionKind getConstructionKind() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
Definition ExprCXX.h:1660
A default argument (C++ [dcl.fct.default]).
Definition ExprCXX.h:1271
SourceLocation getUsedLocation() const
Retrieve the location where this default argument was actually used.
Definition ExprCXX.h:1345
const ParmVarDecl * getParam() const
Definition ExprCXX.h:1313
const DeclContext * getUsedContext() const
Definition ExprCXX.h:1341
bool hasRewrittenInit() const
Definition ExprCXX.h:1316
A use of a default initializer in a constructor or in aggregate initialization.
Definition ExprCXX.h:1378
const DeclContext * getUsedContext() const
Definition ExprCXX.h:1435
const Expr * getRewrittenExpr() const
Retrieve the initializing expression with evaluated immediate calls, if any.
Definition ExprCXX.h:1423
bool hasRewrittenInit() const
Definition ExprCXX.h:1407
FieldDecl * getField()
Get the field whose initializer will be used.
Definition ExprCXX.h:1412
Represents a delete expression for memory deallocation and destructor calls, e.g.
Definition ExprCXX.h:2627
FunctionDecl * getOperatorDelete() const
Definition ExprCXX.h:2666
bool isArrayForm() const
Definition ExprCXX.h:2653
SourceLocation getBeginLoc() const
Definition ExprCXX.h:2677
bool isGlobalDelete() const
Definition ExprCXX.h:2652
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
Definition ExprCXX.h:2662
bool isArrayFormAsWritten() const
Definition ExprCXX.h:2654
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition ExprCXX.h:3867
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '.
Definition ExprCXX.h:3966
SourceLocation getOperatorLoc() const
Retrieve the location of the '->' or '.' operator.
Definition ExprCXX.h:3969
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition ExprCXX.h:4061
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:3993
Expr * getBase() const
Retrieve the base object of this member expressions, e.g., the x in x.m.
Definition ExprCXX.h:3957
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the member name, with source location information.
Definition ExprCXX.h:3980
bool isImplicitAccess() const
True if this is an implicit access, i.e.
Definition ExprCXX.h:3949
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Definition ExprCXX.h:482
Represents a folding of a pack over an operator.
Definition ExprCXX.h:5029
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:1832
SourceLocation getLParenLoc() const
Definition ExprCXX.h:1869
SourceLocation getRParenLoc() const
Definition ExprCXX.h:1871
Represents a call to an inherited base class constructor from an inheriting constructor.
Definition ExprCXX.h:1752
bool constructsVBase() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
Definition ExprCXX.h:1793
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will call.
Definition ExprCXX.h:1789
SourceLocation getLocation() const LLVM_READONLY
Definition ExprCXX.h:1805
bool inheritedFromVBase() const
Determine whether the inherited constructor is inherited from a virtual base of the object we constru...
Definition ExprCXX.h:1803
Represents a call to a member function that may be written either with member call syntax (e....
Definition ExprCXX.h:180
Abstract class common to all of the C++ "named"/"keyword" casts.
Definition ExprCXX.h:376
SourceLocation getOperatorLoc() const
Retrieve the location of the cast operator keyword, e.g., static_cast.
Definition ExprCXX.h:407
SourceRange getAngleBrackets() const LLVM_READONLY
Definition ExprCXX.h:414
SourceLocation getRParenLoc() const
Retrieve the location of the closing parenthesis.
Definition ExprCXX.h:410
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Definition ExprCXX.h:2356
bool isArray() const
Definition ExprCXX.h:2465
SourceRange getDirectInitRange() const
Definition ExprCXX.h:2610
ExprIterator arg_iterator
Definition ExprCXX.h:2570
ImplicitAllocationParameters implicitAllocationParameters() const
Provides the full set of information about expected implicit parameters in this call.
Definition ExprCXX.h:2563
bool hasInitializer() const
Whether this new-expression has any initializer at all.
Definition ExprCXX.h:2525
FunctionDecl * getOperatorDelete() const
Definition ExprCXX.h:2462
unsigned getNumPlacementArgs() const
Definition ExprCXX.h:2495
TypeSourceInfo * getAllocatedTypeSourceInfo() const
Definition ExprCXX.h:2439
SourceRange getSourceRange() const
Definition ExprCXX.h:2611
SourceRange getTypeIdParens() const
Definition ExprCXX.h:2517
bool isParenTypeId() const
Definition ExprCXX.h:2516
raw_arg_iterator raw_arg_end()
Definition ExprCXX.h:2597
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
Definition ExprCXX.h:2557
raw_arg_iterator raw_arg_begin()
Definition ExprCXX.h:2596
FunctionDecl * getOperatorNew() const
Definition ExprCXX.h:2460
bool isGlobalNew() const
Definition ExprCXX.h:2522
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition ExprCXX.h:4306
bool getValue() const
Definition ExprCXX.h:4329
Expr * getOperand() const
Definition ExprCXX.h:4323
SourceRange getSourceRange() const
Definition ExprCXX.h:4327
The null pointer literal (C++11 [lex.nullptr])
Definition ExprCXX.h:769
SourceLocation getLocation() const
Definition ExprCXX.h:783
A call to an overloaded operator written using operator syntax.
Definition ExprCXX.h:85
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:5138
SourceLocation getEndLoc() const LLVM_READONLY
Definition ExprCXX.h:5194
SourceLocation getInitLoc() const LLVM_READONLY
Definition ExprCXX.h:5196
MutableArrayRef< Expr * > getInitExprs()
Definition ExprCXX.h:5178
ArrayRef< Expr * > getUserSpecifiedInitExprs()
Definition ExprCXX.h:5184
SourceLocation getBeginLoc() const LLVM_READONLY
Definition ExprCXX.h:5192
FieldDecl * getInitializedFieldInUnion()
Definition ExprCXX.h:5216
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition ExprCXX.h:2746
TypeSourceInfo * getDestroyedTypeInfo() const
Retrieve the source location information for the type being destroyed.
Definition ExprCXX.h:2840
bool isArrow() const
Determine whether this pseudo-destructor expression was written using an '->' (otherwise,...
Definition ExprCXX.h:2810
TypeSourceInfo * getScopeTypeInfo() const
Retrieve the scope type in a qualified pseudo-destructor expression.
Definition ExprCXX.h:2824
SourceLocation getTildeLoc() const
Retrieve the location of the '~'.
Definition ExprCXX.h:2831
NestedNameSpecifierLoc getQualifierLoc() const
Retrieves the nested-name-specifier that qualifies the type name, with source-location information.
Definition ExprCXX.h:2799
SourceLocation getDestroyedTypeLoc() const
Retrieve the starting location of the type being destroyed.
Definition ExprCXX.h:2855
SourceLocation getColonColonLoc() const
Retrieve the location of the '::' in a qualified pseudo-destructor expression.
Definition ExprCXX.h:2828
SourceLocation getOperatorLoc() const
Retrieve the location of the '.' or '->' operator.
Definition ExprCXX.h:2813
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:2847
Represents a C++26 reflect expression [expr.reflect].
Definition ExprCXX.h:5505
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
Definition ExprCXX.h:527
A rewritten comparison expression that was originally written using operator syntax.
Definition ExprCXX.h:287
Expr * getSemanticForm()
Get an equivalent semantic form for this expression.
Definition ExprCXX.h:305
bool isReversed() const
Determine whether this expression was rewritten in reverse form.
Definition ExprCXX.h:323
An expression "T()" which creates an rvalue of a non-class type T.
Definition ExprCXX.h:2197
TypeSourceInfo * getTypeSourceInfo() const
Definition ExprCXX.h:2216
SourceLocation getRParenLoc() const
Definition ExprCXX.h:2220
A C++ static_cast expression (C++ [expr.static.cast]).
Definition ExprCXX.h:437
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition ExprCXX.h:801
Represents a C++ functional cast expression that builds a temporary object.
Definition ExprCXX.h:1900
TypeSourceInfo * getTypeSourceInfo() const
Definition ExprCXX.h:1929
Represents the this expression in C++.
Definition ExprCXX.h:1155
bool isCapturedByCopyInLambdaWithExplicitObjectParameter() const
Definition ExprCXX.h:1181
bool isImplicit() const
Definition ExprCXX.h:1178
SourceLocation getLocation() const
Definition ExprCXX.h:1172
A C++ throw-expression (C++ [except.throw]).
Definition ExprCXX.h:1209
const Expr * getSubExpr() const
Definition ExprCXX.h:1229
SourceLocation getThrowLoc() const
Definition ExprCXX.h:1232
bool isThrownVariableInScope() const
Determines whether the variable thrown by this expression (if any!) is within the innermost try block...
Definition ExprCXX.h:1239
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:849
bool isTypeOperand() const
Definition ExprCXX.h:885
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition ExprCXX.h:892
Expr * getExprOperand() const
Definition ExprCXX.h:896
SourceRange getSourceRange() const LLVM_READONLY
Definition ExprCXX.h:903
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition ExprCXX.h:3741
SourceLocation getLParenLoc() const
Retrieve the location of the left parentheses ('(') that precedes the argument list.
Definition ExprCXX.h:3785
bool isListInitialization() const
Determine whether this expression models list-initialization.
Definition ExprCXX.h:3796
TypeSourceInfo * getTypeSourceInfo() const
Retrieve the type source information for the type being constructed.
Definition ExprCXX.h:3779
SourceLocation getRParenLoc() const
Retrieve the location of the right parentheses (')') that follows the argument list.
Definition ExprCXX.h:3790
unsigned getNumArgs() const
Retrieve the number of arguments.
Definition ExprCXX.h:3799
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
Definition ExprCXX.h:1069
Expr * getExprOperand() const
Definition ExprCXX.h:1110
MSGuidDecl * getGuidDecl() const
Definition ExprCXX.h:1115
bool isTypeOperand() const
Definition ExprCXX.h:1099
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition ExprCXX.h:1106
SourceRange getSourceRange() const LLVM_READONLY
Definition ExprCXX.h:1119
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:3938
capture_init_range capture_inits()
Definition Stmt.h:4106
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:4089
const RecordDecl * getCapturedRecordDecl() const
Retrieve the record declaration for captured variables.
Definition Stmt.h:4059
Stmt * getCapturedStmt()
Retrieve the statement being captured.
Definition Stmt.h:4042
capture_iterator capture_begin()
Retrieve an iterator pointing to the first capture.
Definition Stmt.h:4084
capture_range captures()
Definition Stmt.h:4076
CapturedRegionKind getCapturedRegionKind() const
Retrieve the captured region kind.
Definition Stmt.cpp:1508
CaseStmt - Represent a case statement.
Definition Stmt.h:1921
Stmt * getSubStmt()
Definition Stmt.h:2034
Expr * getLHS()
Definition Stmt.h:2004
bool caseStmtIsGNURange() const
True if this case statement is of the form case LHS ... RHS, which is a GNU extension.
Definition Stmt.h:1984
SourceLocation getEllipsisLoc() const
Get the location of the ... in a case statement of the form LHS ... RHS.
Definition Stmt.h:1990
Expr * getRHS()
Definition Stmt.h:2016
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:5366
bool isImplicit() const
Definition ExprCXX.h:5388
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:1741
unsigned size() const
Definition Stmt.h:1786
FPOptionsOverride getStoredFPFeatures() const
Get FPOptionsOverride from trailing storage.
Definition Stmt.h:1791
body_range body()
Definition Stmt.h:1804
SourceLocation getLBracLoc() const
Definition Stmt.h:1858
bool hasStoredFPFeatures() const
Definition Stmt.h:1788
SourceLocation getRBracLoc() const
Definition Stmt.h:1859
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:3120
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:5252
SourceLocation getKeywordLoc() const
Definition ExprCXX.h:5343
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
Definition ExprCXX.h:5306
Represents a 'co_yield' expression.
Definition ExprCXX.h:5447
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:1632
SourceLocation getEndLoc() const
Definition Stmt.h:1655
const DeclGroupRef getDeclGroup() const
Definition Stmt.h:1650
SourceLocation getBeginLoc() const LLVM_READONLY
Definition Stmt.h:1658
NameKind
The kind of the name stored in this DeclarationName.
Stmt * getSubStmt()
Definition Stmt.h:2082
DeferStmt - This represents a deferred statement.
Definition Stmt.h:3237
Stmt * getBody()
Definition Stmt.h:3256
SourceLocation getDeferLoc() const
Definition Stmt.h:3251
Represents a 'co_await' expression while the type of the promise is dependent.
Definition ExprCXX.h:5398
SourceLocation getKeywordLoc() const
Definition ExprCXX.h:5427
A qualified reference to a name whose declaration cannot yet be resolved.
Definition ExprCXX.h:3507
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source location information.
Definition ExprCXX.h:3555
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:2833
Stmt * getBody()
Definition Stmt.h:2858
Expr * getCond()
Definition Stmt.h:2851
SourceLocation getWhileLoc() const
Definition Stmt.h:2864
SourceLocation getDoLoc() const
Definition Stmt.h:2862
SourceLocation getRParenLoc() const
Definition Stmt.h:2866
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:3658
bool cleanupsHaveSideEffects() const
Definition ExprCXX.h:3693
ArrayRef< CleanupObject > getObjects() const
Definition ExprCXX.h:3682
unsigned getNumObjects() const
Definition ExprCXX.h:3686
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:3070
Expr * getQueriedExpression() const
Definition ExprCXX.h:3109
ExpressionTrait getTrait() const
Definition ExprCXX.h:3105
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:2889
Stmt * getInit()
Definition Stmt.h:2904
SourceLocation getRParenLoc() const
Definition Stmt.h:2949
Stmt * getBody()
Definition Stmt.h:2933
Expr * getInc()
Definition Stmt.h:2932
SourceLocation getForLoc() const
Definition Stmt.h:2945
Expr * getCond()
Definition Stmt.h:2931
SourceLocation getLParenLoc() const
Definition Stmt.h:2947
DeclStmt * getConditionVariableDeclStmt()
If this ForStmt has a condition variable, return the faux DeclStmt associated with the creation of th...
Definition Stmt.h:2919
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:4838
ValueDecl *const * iterator
Iterators over the parameters which the parameter pack expanded into.
Definition ExprCXX.h:4871
ValueDecl * getParameterPack() const
Get the parameter pack which this expression refers to.
Definition ExprCXX.h:4864
iterator end() const
Definition ExprCXX.h:4873
unsigned getNumExpansions() const
Get the number of parameters in this parameter pack.
Definition ExprCXX.h:4876
SourceLocation getParameterPackLocation() const
Get the location of the parameter pack.
Definition ExprCXX.h:4867
iterator begin() const
Definition ExprCXX.h:4872
This represents a GCC inline-assembly statement extension.
Definition Stmt.h:3447
unsigned getNumLabels() const
Definition Stmt.h:3597
SourceLocation getRParenLoc() const
Definition Stmt.h:3469
IdentifierInfo * getInputIdentifier(unsigned i) const
Definition Stmt.h:3562
const Expr * getOutputConstraintExpr(unsigned i) const
Definition Stmt.h:3549
IdentifierInfo * getLabelIdentifier(unsigned i) const
Definition Stmt.h:3601
const Expr * getInputConstraintExpr(unsigned i) const
Definition Stmt.h:3575
IdentifierInfo * getOutputIdentifier(unsigned i) const
Definition Stmt.h:3538
const Expr * getAsmStringExpr() const
Definition Stmt.h:3474
Expr * getOutputExpr(unsigned i)
Definition Stmt.cpp:582
Expr * getClobberExpr(unsigned i)
Definition Stmt.h:3654
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:2970
SourceLocation getLabelLoc() const
Definition Stmt.h:2988
SourceLocation getGotoLoc() const
Definition Stmt.h:2986
LabelDecl * getLabel() const
Definition Stmt.h:2983
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:2260
Stmt * getThen()
Definition Stmt.h:2349
SourceLocation getIfLoc() const
Definition Stmt.h:2426
IfStatementKind getStatementKind() const
Definition Stmt.h:2461
SourceLocation getElseLoc() const
Definition Stmt.h:2429
Stmt * getInit()
Definition Stmt.h:2410
SourceLocation getLParenLoc() const
Definition Stmt.h:2478
Expr * getCond()
Definition Stmt.h:2337
Stmt * getElse()
Definition Stmt.h:2358
DeclStmt * getConditionVariableDeclStmt()
If this IfStmt has a condition variable, return the faux DeclStmt associated with the creation of tha...
Definition Stmt.h:2393
SourceLocation getRParenLoc() const
Definition Stmt.h:2480
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:3009
SourceLocation getGotoLoc() const
Definition Stmt.h:3025
SourceLocation getStarLoc() const
Definition Stmt.h:3027
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:2147
LabelDecl * getDecl() const
Definition Stmt.h:2165
bool isSideEntry() const
Definition Stmt.h:2194
Stmt * getSubStmt()
Definition Stmt.h:2169
SourceLocation getIdentLoc() const
Definition Stmt.h:2162
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition ExprCXX.h:1969
Expr ** capture_init_iterator
Iterator that walks over the capture initialization arguments.
Definition ExprCXX.h:2076
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument for this lambda expression.
Definition ExprCXX.h:2107
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
Definition ExprCXX.h:2095
Base class for BreakStmt and ContinueStmt.
Definition Stmt.h:3058
SourceLocation getLabelLoc() const
Definition Stmt.h:3093
LabelDecl * getLabelDecl()
Definition Stmt.h:3096
SourceLocation getKwLoc() const
Definition Stmt.h:3083
bool hasLabelTarget() const
Definition Stmt.h:3091
This represents a Microsoft inline-assembly statement extension.
Definition Stmt.h:3666
Token * getAsmToks()
Definition Stmt.h:3697
Expr * getOutputExpr(unsigned i)
Definition Stmt.cpp:919
StringRef getAsmString() const
Definition Stmt.h:3700
SourceLocation getLBraceLoc() const
Definition Stmt.h:3689
SourceLocation getEndLoc() const
Definition Stmt.h:3691
StringRef getInputConstraint(unsigned i) const
Definition Stmt.h:3720
StringRef getOutputConstraint(unsigned i) const
Definition Stmt.h:3707
StringRef getClobber(unsigned i) const
Definition Stmt.h:3744
unsigned getNumAsmToks()
Definition Stmt.h:3696
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:937
NestedNameSpecifierLoc getQualifierLoc() const
Definition ExprCXX.h:993
bool isArrow() const
Definition ExprCXX.h:991
MSPropertyDecl * getPropertyDecl() const
Definition ExprCXX.h:990
Expr * getBaseExpr() const
Definition ExprCXX.h:989
SourceLocation getMemberLoc() const
Definition ExprCXX.h:992
MS property subscript expression.
Definition ExprCXX.h:1007
SourceLocation getRBracketLoc() const
Definition ExprCXX.h:1044
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition ExprCXX.h:4917
Expr * getSubExpr() const
Retrieve the temporary-generating subexpression whose value will be materialized into a glvalue.
Definition ExprCXX.h:4934
LifetimeExtendedTemporaryDecl * getLifetimeExtendedTemporaryDecl()
Definition ExprCXX.h:4957
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:1704
SourceLocation getSemiLoc() const
Definition Stmt.h:1715
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:3129
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
Definition ExprCXX.h:4279
const DeclarationNameInfo & getNameInfo() const
Gets the full name info.
Definition ExprCXX.h:3236
UnresolvedSetImpl::iterator decls_iterator
Definition ExprCXX.h:3220
decls_iterator decls_begin() const
Definition ExprCXX.h:3222
unsigned getNumDecls() const
Gets the number of declarations in the unresolved set.
Definition ExprCXX.h:3233
NestedNameSpecifierLoc getQualifierLoc() const
Fetches the nested-name qualifier with source-location information, if one was given.
Definition ExprCXX.h:3251
TemplateArgumentLoc * getTrailingTemplateArgumentLoc()
Return the optional template arguments.
Definition ExprCXX.h:4289
bool hasTemplateKWAndArgsInfo() const
Definition ExprCXX.h:3173
decls_iterator decls_end() const
Definition ExprCXX.h:3225
DeclarationName getName() const
Gets the name looked up.
Definition ExprCXX.h:3239
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition ExprCXX.h:4360
Expr * getPattern()
Retrieve the pattern of the pack expansion.
Definition ExprCXX.h:4389
SourceLocation getEllipsisLoc() const
Retrieve the location of the ellipsis that describes this pack expansion.
Definition ExprCXX.h:4396
SourceLocation getEllipsisLoc() const
Determine the location of the 'sizeof' keyword.
Definition ExprCXX.h:4610
Expr * getIndexExpr() const
Definition ExprCXX.h:4625
ArrayRef< Expr * > getExpressions() const
Return the trailing expressions, regardless of the expansion.
Definition ExprCXX.h:4643
SourceLocation getRSquareLoc() const
Determine the location of the right parenthesis.
Definition ExprCXX.h:4616
Expr * getPackIdExpression() const
Definition ExprCXX.h:4621
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:3161
SourceLocation getReturnLoc() const
Definition Stmt.h:3210
const VarDecl * getNRVOCandidate() const
Retrieve the variable that might be used for the named return value optimization.
Definition Stmt.h:3197
Expr * getRetValue()
Definition Stmt.h:3188
CompoundStmt * getBlock() const
Definition Stmt.h:3794
SourceLocation getExceptLoc() const
Definition Stmt.h:3787
Expr * getFilterExpr() const
Definition Stmt.h:3790
SourceLocation getFinallyLoc() const
Definition Stmt.h:3828
CompoundStmt * getBlock() const
Definition Stmt.h:3831
Represents a __leave statement.
Definition Stmt.h:3899
SourceLocation getLeaveLoc() const
Definition Stmt.h:3909
CompoundStmt * getTryBlock() const
Definition Stmt.h:3875
SourceLocation getTryLoc() const
Definition Stmt.h:3870
bool getIsCXXTry() const
Definition Stmt.h:3873
Stmt * getHandler() const
Definition Stmt.h:3879
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:4438
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof... expression, such as is produced f...
Definition ExprCXX.h:4523
ArrayRef< TemplateArgument > getPartialArguments() const
Get.
Definition ExprCXX.h:4528
unsigned getPackLength() const
Retrieve the length of the parameter pack.
Definition ExprCXX.h:4512
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:1393
StmtClass getStmtClass() const
Definition Stmt.h:1494
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:1382
CXXNewExprBitfields CXXNewExprBits
Definition Stmt.h:1380
ConstantExprBitfields ConstantExprBits
Definition Stmt.h:1345
RequiresExprBitfields RequiresExprBits
Definition Stmt.h:1394
CXXFoldExprBitfields CXXFoldExprBits
Definition Stmt.h:1397
PackIndexingExprBitfields PackIndexingExprBits
Definition Stmt.h:1398
NullStmtBitfields NullStmtBits
Definition Stmt.h:1328
DependentScopeDeclRefExprBitfields DependentScopeDeclRefExprBits
Definition Stmt.h:1383
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:4661
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern being substituted.
Definition ExprCXX.h:4706
UnsignedOrNone getPackIndex() const
Definition ExprCXX.h:4712
unsigned getIndex() const
Returns the index of the replaced parameter in the associated declaration.
Definition ExprCXX.h:4710
SourceLocation getNameLoc() const
Definition ExprCXX.h:4696
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition ExprCXX.h:4751
TemplateArgument getArgumentPack() const
Retrieve the template argument pack containing the substituted template arguments.
Definition ExprCXX.cpp:1797
SourceLocation getParameterPackLocation() const
Retrieve the location of the parameter pack name.
Definition ExprCXX.h:4799
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern being substituted.
Definition ExprCXX.h:4785
unsigned getIndex() const
Returns the index of the replaced parameter in the associated declaration.
Definition ExprCXX.h:4789
SourceLocation getKeywordLoc() const
Definition Stmt.h:1898
SourceLocation getColonLoc() const
Definition Stmt.h:1900
const SwitchCase * getNextSwitchCase() const
Definition Stmt.h:1894
SwitchStmt - This represents a 'switch' stmt.
Definition Stmt.h:2510
SourceLocation getSwitchLoc() const
Definition Stmt.h:2645
SourceLocation getLParenLoc() const
Definition Stmt.h:2647
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:2670
SourceLocation getRParenLoc() const
Definition Stmt.h:2649
Expr * getCond()
Definition Stmt.h:2573
Stmt * getBody()
Definition Stmt.h:2585
Stmt * getInit()
Definition Stmt.h:2590
SwitchCase * getSwitchCaseList()
Definition Stmt.h:2641
DeclStmt * getConditionVariableDeclStmt()
If this SwitchStmt has a condition variable, return the faux DeclStmt associated with the creation of...
Definition Stmt.h:2624
Location wrapper for a TemplateArgument.
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition ExprCXX.h:2897
TypeSourceInfo * getArg(unsigned I) const
Retrieve the Ith argument.
Definition ExprCXX.h:2962
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
Definition ExprCXX.h:2959
const APValue & getAPValue() const
Definition ExprCXX.h:2953
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:3387
CXXRecordDecl * getNamingClass()
Gets the 'naming class' (in the sense of C++0x [class.access.base]p5) of the lookup.
Definition ExprCXX.h:3461
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
Definition ExprCXX.h:3456
Represents a C++ member access expression for which lookup produced a set of overloaded functions.
Definition ExprCXX.h:4123
QualType getBaseType() const
Definition ExprCXX.h:4205
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '.
Definition ExprCXX.h:4215
SourceLocation getOperatorLoc() const
Retrieve the location of the '->' or '.' operator.
Definition ExprCXX.h:4218
bool hasUnresolvedUsing() const
Determine whether the lookup results contain an unresolved using declaration.
Definition ExprCXX.h:4209
Expr * getBase()
Retrieve the base object of this member expressions, e.g., the x in x.m.
Definition ExprCXX.h:4196
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:1645
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit....
Definition ExprCXX.h:641
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:2698
Expr * getCond()
Definition Stmt.h:2750
SourceLocation getWhileLoc() const
Definition Stmt.h:2803
SourceLocation getRParenLoc() const
Definition Stmt.h:2808
DeclStmt * getConditionVariableDeclStmt()
If this WhileStmt has a condition variable, return the faux DeclStmt associated with the creation of ...
Definition Stmt.h:2786
SourceLocation getLParenLoc() const
Definition Stmt.h:2806
Stmt * getBody()
Definition Stmt.h:2762
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:151
OpenACCComputeConstruct(OpenACCDirectiveKind K, SourceLocation Start, SourceLocation DirectiveLoc, SourceLocation End, ArrayRef< const OpenACCClause * > Clauses, Stmt *StructuredBlock)
bool isAlignedAllocation(AlignedAllocationMode Mode)
Definition ExprCXX.h:2266
bool isTypeAwareAllocation(TypeAwareAllocationMode Mode)
Definition ExprCXX.h:2254
@ VK_PRValue
A pr-value expression (in the C++11 taxonomy) produces a temporary value.
Definition Specifiers.h:135
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:2308
TypeAwareAllocationMode PassTypeIdentity
Definition ExprCXX.h:2307
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 unsigned toInternalRepresentation() const