clang 24.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
1143 // When emitting reduced BMI, some necessary operators may be removed for ADL.
1144 // Here we tries to save such operators.
1145 if (Writer.isGeneratingReducedBMI() &&
1146 // Assign doesn't take part in ADL.
1147 E->getOpcode() != BO_Assign &&
1148 (E->getLHS()->isTypeDependent() || E->getRHS()->isTypeDependent())) {
1151
1152 // [module.global.frag] performs a synthetic lookup in which each
1153 // type-dependent operand has no associated namespaces or entities.
1154 DeclarationName Name =
1155 Record.getASTContext().DeclarationNames.getCXXOperatorName(Op);
1156
1157 auto PreserveAssociatedCandidates = [&](Expr *Operand) {
1158 const auto *RT = Operand->getType()->getAs<RecordType>();
1159 if (!RT)
1160 return;
1161
1162 // Find the associated namespace and perform a synthetic lookup in it.
1163 DeclContext *DC = RT->getDecl()->getDeclContext();
1164 while (DC && !DC->isFileContext())
1165 DC = DC->getParent();
1166 if (auto *NS = dyn_cast_or_null<NamespaceDecl>(DC))
1167 for (NamedDecl *D : NS->noload_lookup(Name))
1168 Writer.GetDeclRef(D);
1169 };
1170
1171 if (!E->getLHS()->isTypeDependent())
1172 PreserveAssociatedCandidates(E->getLHS());
1173 if (!E->getRHS()->isTypeDependent())
1174 PreserveAssociatedCandidates(E->getRHS());
1175
1176 for (NamedDecl *D :
1177 Record.getASTContext().getTranslationUnitDecl()->noload_lookup(Name))
1178 Writer.GetDeclRef(D);
1179 }
1180
1182}
1183
1184void ASTStmtWriter::VisitCompoundAssignOperator(CompoundAssignOperator *E) {
1185 VisitBinaryOperator(E);
1186 Record.AddTypeRef(E->getComputationLHSType());
1187 Record.AddTypeRef(E->getComputationResultType());
1188
1189 if (!E->hasStoredFPFeatures() && E->getValueKind() == VK_PRValue &&
1190 E->getObjectKind() == OK_Ordinary)
1191 AbbrevToUse = Writer.getCompoundAssignOperatorAbbrev();
1192
1194}
1195
1196void ASTStmtWriter::VisitConditionalOperator(ConditionalOperator *E) {
1197 VisitExpr(E);
1198 Record.AddStmt(E->getCond());
1199 Record.AddStmt(E->getLHS());
1200 Record.AddStmt(E->getRHS());
1201 Record.AddSourceLocation(E->getQuestionLoc());
1202 Record.AddSourceLocation(E->getColonLoc());
1204}
1205
1206void
1207ASTStmtWriter::VisitBinaryConditionalOperator(BinaryConditionalOperator *E) {
1208 VisitExpr(E);
1209 Record.AddStmt(E->getOpaqueValue());
1210 Record.AddStmt(E->getCommon());
1211 Record.AddStmt(E->getCond());
1212 Record.AddStmt(E->getTrueExpr());
1213 Record.AddStmt(E->getFalseExpr());
1214 Record.AddSourceLocation(E->getQuestionLoc());
1215 Record.AddSourceLocation(E->getColonLoc());
1217}
1218
1219void ASTStmtWriter::VisitImplicitCastExpr(ImplicitCastExpr *E) {
1220 VisitCastExpr(E);
1221 CurrentPackingBits.addBit(E->isPartOfExplicitCast());
1222
1223 if (E->path_size() == 0 && !E->hasStoredFPFeatures())
1224 AbbrevToUse = Writer.getExprImplicitCastAbbrev();
1225
1227}
1228
1229void ASTStmtWriter::VisitExplicitCastExpr(ExplicitCastExpr *E) {
1230 VisitCastExpr(E);
1231 Record.AddTypeSourceInfo(E->getTypeInfoAsWritten());
1232}
1233
1234void ASTStmtWriter::VisitCStyleCastExpr(CStyleCastExpr *E) {
1235 VisitExplicitCastExpr(E);
1236 Record.AddSourceLocation(E->getLParenLoc());
1237 Record.AddSourceLocation(E->getRParenLoc());
1239}
1240
1241void ASTStmtWriter::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
1242 VisitExpr(E);
1243 Record.AddSourceLocation(E->getLParenLoc());
1244 Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1245 Record.AddStmt(E->getInitializer());
1246 Record.push_back(E->isFileScope());
1248}
1249
1250void ASTStmtWriter::VisitExtVectorElementExpr(ExtVectorElementExpr *E) {
1251 VisitExpr(E);
1252 Record.AddStmt(E->getBase());
1253 Record.AddIdentifierRef(&E->getAccessor());
1254 Record.AddSourceLocation(E->getAccessorLoc());
1256}
1257
1258void ASTStmtWriter::VisitMatrixElementExpr(MatrixElementExpr *E) {
1259 VisitExpr(E);
1260 Record.AddStmt(E->getBase());
1261 Record.AddIdentifierRef(&E->getAccessor());
1262 Record.AddSourceLocation(E->getAccessorLoc());
1264}
1265
1266void ASTStmtWriter::VisitInitListExpr(InitListExpr *E) {
1267 VisitExpr(E);
1268 // NOTE: only add the (possibly null) syntactic form.
1269 // No need to serialize the isSemanticForm flag and the semantic form.
1270 Record.AddStmt(E->getSyntacticForm());
1271 Record.AddSourceLocation(E->getLBraceLoc());
1272 Record.AddSourceLocation(E->getRBraceLoc());
1273 bool isArrayFiller = isa<Expr *>(E->ArrayFillerOrUnionFieldInit);
1274 Record.push_back(isArrayFiller);
1275 if (isArrayFiller)
1276 Record.AddStmt(E->getArrayFiller());
1277 else
1278 Record.AddDeclRef(E->getInitializedFieldInUnion());
1279 Record.push_back(E->hadArrayRangeDesignator());
1280 Record.push_back(E->getNumInits());
1281 if (isArrayFiller) {
1282 // ArrayFiller may have filled "holes" due to designated initializer.
1283 // Replace them by 0 to indicate that the filler goes in that place.
1284 Expr *filler = E->getArrayFiller();
1285 for (unsigned I = 0, N = E->getNumInits(); I != N; ++I)
1286 Record.AddStmt(E->getInit(I) != filler ? E->getInit(I) : nullptr);
1287 } else {
1288 for (unsigned I = 0, N = E->getNumInits(); I != N; ++I)
1289 Record.AddStmt(E->getInit(I));
1290 }
1291 Record.writeBool(E->isExplicit());
1293}
1294
1295void ASTStmtWriter::VisitDesignatedInitExpr(DesignatedInitExpr *E) {
1296 VisitExpr(E);
1297 Record.push_back(E->getNumSubExprs());
1298 for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
1299 Record.AddStmt(E->getSubExpr(I));
1300 Record.AddSourceLocation(E->getEqualOrColonLoc());
1301 Record.push_back(E->usesGNUSyntax());
1302 for (const DesignatedInitExpr::Designator &D : E->designators()) {
1303 if (D.isFieldDesignator()) {
1304 if (FieldDecl *Field = D.getFieldDecl()) {
1305 Record.push_back(serialization::DESIG_FIELD_DECL);
1306 Record.AddDeclRef(Field);
1307 } else {
1308 Record.push_back(serialization::DESIG_FIELD_NAME);
1309 Record.AddIdentifierRef(D.getFieldName());
1310 }
1311 Record.AddSourceLocation(D.getDotLoc());
1312 Record.AddSourceLocation(D.getFieldLoc());
1313 } else if (D.isArrayDesignator()) {
1314 Record.push_back(serialization::DESIG_ARRAY);
1315 Record.push_back(D.getArrayIndex());
1316 Record.AddSourceLocation(D.getLBracketLoc());
1317 Record.AddSourceLocation(D.getRBracketLoc());
1318 } else {
1319 assert(D.isArrayRangeDesignator() && "Unknown designator");
1320 Record.push_back(serialization::DESIG_ARRAY_RANGE);
1321 Record.push_back(D.getArrayIndex());
1322 Record.AddSourceLocation(D.getLBracketLoc());
1323 Record.AddSourceLocation(D.getEllipsisLoc());
1324 Record.AddSourceLocation(D.getRBracketLoc());
1325 }
1326 }
1328}
1329
1330void ASTStmtWriter::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) {
1331 VisitExpr(E);
1332 Record.AddStmt(E->getBase());
1333 Record.AddStmt(E->getUpdater());
1335}
1336
1337void ASTStmtWriter::VisitNoInitExpr(NoInitExpr *E) {
1338 VisitExpr(E);
1340}
1341
1342void ASTStmtWriter::VisitArrayInitLoopExpr(ArrayInitLoopExpr *E) {
1343 VisitExpr(E);
1344 Record.AddStmt(E->SubExprs[0]);
1345 Record.AddStmt(E->SubExprs[1]);
1347}
1348
1349void ASTStmtWriter::VisitArrayInitIndexExpr(ArrayInitIndexExpr *E) {
1350 VisitExpr(E);
1352}
1353
1354void ASTStmtWriter::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) {
1355 VisitExpr(E);
1357}
1358
1359void ASTStmtWriter::VisitVAArgExpr(VAArgExpr *E) {
1360 VisitExpr(E);
1361 Record.AddStmt(E->getSubExpr());
1362 Record.AddTypeSourceInfo(E->getWrittenTypeInfo());
1363 Record.AddSourceLocation(E->getBuiltinLoc());
1364 Record.AddSourceLocation(E->getRParenLoc());
1365 Record.push_back(E->getVarargABI());
1367}
1368
1369void ASTStmtWriter::VisitSourceLocExpr(SourceLocExpr *E) {
1370 VisitExpr(E);
1371 Record.AddDeclRef(cast_or_null<Decl>(E->getParentContext()));
1372 Record.AddSourceLocation(E->getBeginLoc());
1373 Record.AddSourceLocation(E->getEndLoc());
1374 Record.push_back(llvm::to_underlying(E->getIdentKind()));
1376}
1377
1378void ASTStmtWriter::VisitEmbedExpr(EmbedExpr *E) {
1379 VisitExpr(E);
1380 Record.AddSourceLocation(E->getBeginLoc());
1381 Record.AddStmt(E->getDataStringLiteral());
1382 Record.writeUInt32(E->getStartingElementPos());
1383 Record.writeUInt32(E->getDataElementCount());
1385}
1386
1387void ASTStmtWriter::VisitAddrLabelExpr(AddrLabelExpr *E) {
1388 VisitExpr(E);
1389 Record.AddSourceLocation(E->getAmpAmpLoc());
1390 Record.AddSourceLocation(E->getLabelLoc());
1391 Record.AddDeclRef(E->getLabel());
1393}
1394
1395void ASTStmtWriter::VisitStmtExpr(StmtExpr *E) {
1396 VisitExpr(E);
1397 Record.AddStmt(E->getSubStmt());
1398 Record.AddSourceLocation(E->getLParenLoc());
1399 Record.AddSourceLocation(E->getRParenLoc());
1400 Record.push_back(E->getTemplateDepth());
1402}
1403
1404void ASTStmtWriter::VisitChooseExpr(ChooseExpr *E) {
1405 VisitExpr(E);
1406 Record.AddStmt(E->getCond());
1407 Record.AddStmt(E->getLHS());
1408 Record.AddStmt(E->getRHS());
1409 Record.AddSourceLocation(E->getBuiltinLoc());
1410 Record.AddSourceLocation(E->getRParenLoc());
1411 Record.push_back(E->isConditionDependent() ? false : E->isConditionTrue());
1413}
1414
1415void ASTStmtWriter::VisitGNUNullExpr(GNUNullExpr *E) {
1416 VisitExpr(E);
1417 Record.AddSourceLocation(E->getTokenLocation());
1419}
1420
1421void ASTStmtWriter::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
1422 VisitExpr(E);
1423 Record.push_back(E->getNumSubExprs());
1424 for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
1425 Record.AddStmt(E->getExpr(I));
1426 Record.AddSourceLocation(E->getBuiltinLoc());
1427 Record.AddSourceLocation(E->getRParenLoc());
1429}
1430
1431void ASTStmtWriter::VisitConvertVectorExpr(ConvertVectorExpr *E) {
1432 VisitExpr(E);
1433 bool HasFPFeatures = E->hasStoredFPFeatures();
1434 CurrentPackingBits.addBit(HasFPFeatures);
1435 Record.AddSourceLocation(E->getBuiltinLoc());
1436 Record.AddSourceLocation(E->getRParenLoc());
1437 Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1438 Record.AddStmt(E->getSrcExpr());
1440 if (HasFPFeatures)
1441 Record.push_back(E->getStoredFPFeatures().getAsOpaqueInt());
1442}
1443
1444void ASTStmtWriter::VisitBlockExpr(BlockExpr *E) {
1445 VisitExpr(E);
1446 Record.AddDeclRef(E->getBlockDecl());
1448}
1449
1450void ASTStmtWriter::VisitGenericSelectionExpr(GenericSelectionExpr *E) {
1451 VisitExpr(E);
1452
1453 Record.push_back(E->getNumAssocs());
1454 Record.push_back(E->isExprPredicate());
1455 Record.push_back(E->ResultIndex);
1456 Record.AddSourceLocation(E->getGenericLoc());
1457 Record.AddSourceLocation(E->getDefaultLoc());
1458 Record.AddSourceLocation(E->getRParenLoc());
1459
1460 // Either the trailing Stmt-s or the trailing TypeSourceInfo-s
1461 // will hold one more item than the number of associations
1462 // to account for the predicate (whether it is an expression
1463 // or a type).
1464 Stmt **Stmts = E->getTrailingObjects<Stmt *>();
1465 for (unsigned I = 0, N = E->numTrailingObjects(
1466 ASTConstraintSatisfaction::OverloadToken<Stmt *>());
1467 I < N; ++I)
1468 Record.AddStmt(Stmts[I]);
1469
1470 TypeSourceInfo **TSIs = E->getTrailingObjects<TypeSourceInfo *>();
1471 for (unsigned
1472 I = 0,
1473 N = E->numTrailingObjects(
1474 ASTConstraintSatisfaction::OverloadToken<TypeSourceInfo *>());
1475 I < N; ++I)
1476 Record.AddTypeSourceInfo(TSIs[I]);
1477
1479}
1480
1481void ASTStmtWriter::VisitPseudoObjectExpr(PseudoObjectExpr *E) {
1482 VisitExpr(E);
1483 Record.push_back(E->getNumSemanticExprs());
1484
1485 // Push the result index. Currently, this needs to exactly match
1486 // the encoding used internally for ResultIndex.
1487 unsigned result = E->getResultExprIndex();
1488 result = (result == PseudoObjectExpr::NoResult ? 0 : result + 1);
1489 Record.push_back(result);
1490
1491 Record.AddStmt(E->getSyntacticForm());
1493 i = E->semantics_begin(), e = E->semantics_end(); i != e; ++i) {
1494 Record.AddStmt(*i);
1495 }
1497}
1498
1499void ASTStmtWriter::VisitAtomicExpr(AtomicExpr *E) {
1500 VisitExpr(E);
1501 Record.push_back(E->getOp());
1502 for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
1503 Record.AddStmt(E->getSubExprs()[I]);
1504 Record.AddSourceLocation(E->getBuiltinLoc());
1505 Record.AddSourceLocation(E->getRParenLoc());
1507}
1508
1509//===----------------------------------------------------------------------===//
1510// Objective-C Expressions and Statements.
1511//===----------------------------------------------------------------------===//
1512
1513void ASTStmtWriter::VisitObjCObjectLiteral(ObjCObjectLiteral *E) {
1514 VisitExpr(E);
1515 Record.push_back(E->isExpressibleAsConstantInitializer());
1516}
1517
1518void ASTStmtWriter::VisitObjCStringLiteral(ObjCStringLiteral *E) {
1519 VisitObjCObjectLiteral(E);
1520 Record.AddStmt(E->getString());
1521 Record.AddSourceLocation(E->getAtLoc());
1523}
1524
1525void ASTStmtWriter::VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
1526 VisitObjCObjectLiteral(E);
1527 Record.AddStmt(E->getSubExpr());
1528 Record.AddDeclRef(E->getBoxingMethod());
1529 Record.AddSourceRange(E->getSourceRange());
1531}
1532
1533void ASTStmtWriter::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
1534 VisitObjCObjectLiteral(E);
1535 Record.push_back(E->getNumElements());
1536 for (unsigned i = 0; i < E->getNumElements(); i++)
1537 Record.AddStmt(E->getElement(i));
1538 Record.AddDeclRef(E->getArrayWithObjectsMethod());
1539 Record.AddSourceRange(E->getSourceRange());
1541}
1542
1543void ASTStmtWriter::VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *E) {
1544 VisitObjCObjectLiteral(E);
1545 Record.push_back(E->getNumElements());
1546 Record.push_back(E->HasPackExpansions);
1547 for (unsigned i = 0; i < E->getNumElements(); i++) {
1548 ObjCDictionaryElement Element = E->getKeyValueElement(i);
1549 Record.AddStmt(Element.Key);
1550 Record.AddStmt(Element.Value);
1551 if (E->HasPackExpansions) {
1552 Record.AddSourceLocation(Element.EllipsisLoc);
1553 unsigned NumExpansions = 0;
1554 if (Element.NumExpansions)
1555 NumExpansions = *Element.NumExpansions + 1;
1556 Record.push_back(NumExpansions);
1557 }
1558 }
1559
1560 Record.AddDeclRef(E->getDictWithObjectsMethod());
1561 Record.AddSourceRange(E->getSourceRange());
1563}
1564
1565void ASTStmtWriter::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
1566 VisitExpr(E);
1567 Record.AddTypeSourceInfo(E->getEncodedTypeSourceInfo());
1568 Record.AddSourceLocation(E->getAtLoc());
1569 Record.AddSourceLocation(E->getRParenLoc());
1571}
1572
1573void ASTStmtWriter::VisitObjCSelectorExpr(ObjCSelectorExpr *E) {
1574 VisitExpr(E);
1575 Record.AddSelectorRef(E->getSelector());
1576 Record.AddSourceLocation(E->getAtLoc());
1577 Record.AddSourceLocation(E->getSelectorNameLoc());
1578 Record.AddSourceLocation(E->getRParenLoc());
1580}
1581
1582void ASTStmtWriter::VisitObjCProtocolExpr(ObjCProtocolExpr *E) {
1583 VisitExpr(E);
1584 Record.AddDeclRef(E->getProtocol());
1585 Record.AddSourceLocation(E->getAtLoc());
1586 Record.AddSourceLocation(E->ProtoLoc);
1587 Record.AddSourceLocation(E->getRParenLoc());
1589}
1590
1591void ASTStmtWriter::VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) {
1592 VisitExpr(E);
1593 Record.AddDeclRef(E->getDecl());
1594 Record.AddSourceLocation(E->getLocation());
1595 Record.AddSourceLocation(E->getOpLoc());
1596 Record.AddStmt(E->getBase());
1597 Record.push_back(E->isArrow());
1598 Record.push_back(E->isFreeIvar());
1600}
1601
1602void ASTStmtWriter::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
1603 VisitExpr(E);
1604 Record.push_back(E->SetterAndMethodRefFlags.getInt());
1605 Record.push_back(E->isImplicitProperty());
1606 if (E->isImplicitProperty()) {
1607 Record.AddDeclRef(E->getImplicitPropertyGetter());
1608 Record.AddDeclRef(E->getImplicitPropertySetter());
1609 } else {
1610 Record.AddDeclRef(E->getExplicitProperty());
1611 }
1612 Record.AddSourceLocation(E->getLocation());
1613 Record.AddSourceLocation(E->getReceiverLocation());
1614 if (E->isObjectReceiver()) {
1615 Record.push_back(0);
1616 Record.AddStmt(E->getBase());
1617 } else if (E->isSuperReceiver()) {
1618 Record.push_back(1);
1619 Record.AddTypeRef(E->getSuperReceiverType());
1620 } else {
1621 Record.push_back(2);
1622 Record.AddDeclRef(E->getClassReceiver());
1623 }
1624
1626}
1627
1628void ASTStmtWriter::VisitObjCSubscriptRefExpr(ObjCSubscriptRefExpr *E) {
1629 VisitExpr(E);
1630 Record.AddSourceLocation(E->getRBracket());
1631 Record.AddStmt(E->getBaseExpr());
1632 Record.AddStmt(E->getKeyExpr());
1633 Record.AddDeclRef(E->getAtIndexMethodDecl());
1634 Record.AddDeclRef(E->setAtIndexMethodDecl());
1635
1637}
1638
1639void ASTStmtWriter::VisitObjCMessageExpr(ObjCMessageExpr *E) {
1640 VisitExpr(E);
1641 Record.push_back(E->getNumArgs());
1642 Record.push_back(E->getNumStoredSelLocs());
1643 Record.push_back(E->SelLocsKind);
1644 Record.push_back(E->isDelegateInitCall());
1645 Record.push_back(E->IsImplicit);
1646 Record.push_back((unsigned)E->getReceiverKind()); // FIXME: stable encoding
1647 switch (E->getReceiverKind()) {
1649 Record.AddStmt(E->getInstanceReceiver());
1650 break;
1651
1653 Record.AddTypeSourceInfo(E->getClassReceiverTypeInfo());
1654 break;
1655
1658 Record.AddTypeRef(E->getSuperType());
1659 Record.AddSourceLocation(E->getSuperLoc());
1660 break;
1661 }
1662
1663 if (E->getMethodDecl()) {
1664 Record.push_back(1);
1665 Record.AddDeclRef(E->getMethodDecl());
1666 } else {
1667 Record.push_back(0);
1668 Record.AddSelectorRef(E->getSelector());
1669 }
1670
1671 Record.AddSourceLocation(E->getLeftLoc());
1672 Record.AddSourceLocation(E->getRightLoc());
1673
1674 for (CallExpr::arg_iterator Arg = E->arg_begin(), ArgEnd = E->arg_end();
1675 Arg != ArgEnd; ++Arg)
1676 Record.AddStmt(*Arg);
1677
1678 SourceLocation *Locs = E->getStoredSelLocs();
1679 for (unsigned i = 0, e = E->getNumStoredSelLocs(); i != e; ++i)
1680 Record.AddSourceLocation(Locs[i]);
1681
1683}
1684
1685void ASTStmtWriter::VisitObjCForCollectionStmt(ObjCForCollectionStmt *S) {
1686 VisitStmt(S);
1687 Record.AddStmt(S->getElement());
1688 Record.AddStmt(S->getCollection());
1689 Record.AddStmt(S->getBody());
1690 Record.AddSourceLocation(S->getForLoc());
1691 Record.AddSourceLocation(S->getRParenLoc());
1693}
1694
1695void ASTStmtWriter::VisitObjCAtCatchStmt(ObjCAtCatchStmt *S) {
1696 VisitStmt(S);
1697 Record.AddStmt(S->getCatchBody());
1698 Record.AddDeclRef(S->getCatchParamDecl());
1699 Record.AddSourceLocation(S->getAtCatchLoc());
1700 Record.AddSourceLocation(S->getRParenLoc());
1702}
1703
1704void ASTStmtWriter::VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S) {
1705 VisitStmt(S);
1706 Record.AddStmt(S->getFinallyBody());
1707 Record.AddSourceLocation(S->getAtFinallyLoc());
1709}
1710
1711void ASTStmtWriter::VisitObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S) {
1712 VisitStmt(S); // FIXME: no test coverage.
1713 Record.AddStmt(S->getSubStmt());
1714 Record.AddSourceLocation(S->getAtLoc());
1716}
1717
1718void ASTStmtWriter::VisitObjCAtTryStmt(ObjCAtTryStmt *S) {
1719 VisitStmt(S);
1720 Record.push_back(S->getNumCatchStmts());
1721 Record.push_back(S->getFinallyStmt() != nullptr);
1722 Record.AddStmt(S->getTryBody());
1723 for (ObjCAtCatchStmt *C : S->catch_stmts())
1724 Record.AddStmt(C);
1725 if (S->getFinallyStmt())
1726 Record.AddStmt(S->getFinallyStmt());
1727 Record.AddSourceLocation(S->getAtTryLoc());
1729}
1730
1731void ASTStmtWriter::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
1732 VisitStmt(S); // FIXME: no test coverage.
1733 Record.AddStmt(S->getSynchExpr());
1734 Record.AddStmt(S->getSynchBody());
1735 Record.AddSourceLocation(S->getAtSynchronizedLoc());
1737}
1738
1739void ASTStmtWriter::VisitObjCAtThrowStmt(ObjCAtThrowStmt *S) {
1740 VisitStmt(S); // FIXME: no test coverage.
1741 Record.AddStmt(S->getThrowExpr());
1742 Record.AddSourceLocation(S->getThrowLoc());
1744}
1745
1746void ASTStmtWriter::VisitObjCBoolLiteralExpr(ObjCBoolLiteralExpr *E) {
1747 VisitExpr(E);
1748 Record.push_back(E->getValue());
1749 Record.AddSourceLocation(E->getLocation());
1751}
1752
1753void ASTStmtWriter::VisitObjCAvailabilityCheckExpr(ObjCAvailabilityCheckExpr *E) {
1754 VisitExpr(E);
1755 Record.AddSourceRange(E->getSourceRange());
1756 Record.AddVersionTuple(E->getVersion());
1758}
1759
1760//===----------------------------------------------------------------------===//
1761// C++ Expressions and Statements.
1762//===----------------------------------------------------------------------===//
1763
1764void ASTStmtWriter::VisitCXXCatchStmt(CXXCatchStmt *S) {
1765 VisitStmt(S);
1766 Record.AddSourceLocation(S->getCatchLoc());
1767 Record.AddDeclRef(S->getExceptionDecl());
1768 Record.AddStmt(S->getHandlerBlock());
1770}
1771
1772void ASTStmtWriter::VisitCXXTryStmt(CXXTryStmt *S) {
1773 VisitStmt(S);
1774 Record.push_back(S->getNumHandlers());
1775 Record.AddSourceLocation(S->getTryLoc());
1776 Record.AddStmt(S->getTryBlock());
1777 for (unsigned i = 0, e = S->getNumHandlers(); i != e; ++i)
1778 Record.AddStmt(S->getHandler(i));
1780}
1781
1782void ASTStmtWriter::VisitCXXForRangeStmt(CXXForRangeStmt *S) {
1783 VisitStmt(S);
1784 Record.AddSourceLocation(S->getForLoc());
1785 Record.AddSourceLocation(S->getCoawaitLoc());
1786 Record.AddSourceLocation(S->getColonLoc());
1787 Record.AddSourceLocation(S->getRParenLoc());
1788 Record.AddStmt(S->getInit());
1789 Record.AddStmt(S->getRangeStmt());
1790 Record.AddStmt(S->getBeginStmt());
1791 Record.AddStmt(S->getEndStmt());
1792 Record.AddStmt(S->getCond());
1793 Record.AddStmt(S->getInc());
1794 Record.AddStmt(S->getLoopVarStmt());
1795 Record.AddStmt(S->getBody());
1797}
1798
1799void ASTStmtWriter::VisitCXXExpansionStmtPattern(CXXExpansionStmtPattern *S) {
1800 VisitStmt(S);
1801 Record.push_back(static_cast<unsigned>(S->getKind()));
1802 Record.AddSourceLocation(S->getLParenLoc());
1803 Record.AddSourceLocation(S->getColonLoc());
1804 Record.AddSourceLocation(S->getRParenLoc());
1805 Record.AddDeclRef(S->getDecl());
1806 for (Stmt *SubStmt : S->children())
1807 Record.AddStmt(SubStmt);
1809}
1810
1811void ASTStmtWriter::VisitCXXExpansionStmtInstantiation(
1813 VisitStmt(S);
1814 Record.push_back(S->getInstantiations().size());
1815 Record.push_back(S->getPreambleStmts().size());
1816 Record.AddDeclRef(S->getParent());
1817 for (Stmt *St : S->getAllSubStmts())
1818 Record.AddStmt(St);
1819 Record.push_back(S->shouldApplyLifetimeExtensionToPreamble());
1821}
1822
1823void ASTStmtWriter::VisitCXXExpansionSelectExpr(CXXExpansionSelectExpr *E) {
1824 VisitExpr(E);
1825 Record.AddStmt(E->getRangeExpr());
1826 Record.AddStmt(E->getIndexExpr());
1828}
1829
1830void ASTStmtWriter::VisitMSDependentExistsStmt(MSDependentExistsStmt *S) {
1831 VisitStmt(S);
1832 Record.AddSourceLocation(S->getKeywordLoc());
1833 Record.push_back(S->isIfExists());
1834 Record.AddNestedNameSpecifierLoc(S->getQualifierLoc());
1835 Record.AddDeclarationNameInfo(S->getNameInfo());
1836 Record.AddStmt(S->getSubStmt());
1838}
1839
1840void ASTStmtWriter::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
1841 VisitCallExpr(E);
1842 Record.push_back(E->getOperator());
1843 Record.push_back(E->isReversed());
1844 Record.AddSourceLocation(E->BeginLoc);
1845
1846 if (!E->hasStoredFPFeatures() && !static_cast<bool>(E->getADLCallKind()) &&
1847 !E->isCoroElideSafe() && !E->usesMemberSyntax() && !E->isReversed())
1848 AbbrevToUse = Writer.getCXXOperatorCallExprAbbrev();
1849
1851}
1852
1853void ASTStmtWriter::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) {
1854 VisitCallExpr(E);
1855
1856 if (!E->hasStoredFPFeatures() && !static_cast<bool>(E->getADLCallKind()) &&
1857 !E->isCoroElideSafe() && !E->usesMemberSyntax())
1858 AbbrevToUse = Writer.getCXXMemberCallExprAbbrev();
1859
1861}
1862
1863void ASTStmtWriter::VisitCXXRewrittenBinaryOperator(
1865 VisitExpr(E);
1866 Record.push_back(E->isReversed());
1867 Record.AddStmt(E->getSemanticForm());
1869}
1870
1871void ASTStmtWriter::VisitCXXConstructExpr(CXXConstructExpr *E) {
1872 VisitExpr(E);
1873
1874 Record.push_back(E->getNumArgs());
1875 Record.push_back(E->isElidable());
1876 Record.push_back(E->hadMultipleCandidates());
1877 Record.push_back(E->isListInitialization());
1878 Record.push_back(E->isStdInitListInitialization());
1879 Record.push_back(E->requiresZeroInitialization());
1880 Record.push_back(
1881 llvm::to_underlying(E->getConstructionKind())); // FIXME: stable encoding
1882 Record.push_back(E->isImmediateEscalating());
1883 Record.AddSourceLocation(E->getLocation());
1884 Record.AddDeclRef(E->getConstructor());
1885 Record.AddSourceRange(E->getParenOrBraceRange());
1886
1887 for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1888 Record.AddStmt(E->getArg(I));
1889
1891}
1892
1893void ASTStmtWriter::VisitCXXInheritedCtorInitExpr(CXXInheritedCtorInitExpr *E) {
1894 VisitExpr(E);
1895 Record.AddDeclRef(E->getConstructor());
1896 Record.AddSourceLocation(E->getLocation());
1897 Record.push_back(E->constructsVBase());
1898 Record.push_back(E->inheritedFromVBase());
1900}
1901
1902void ASTStmtWriter::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
1903 VisitCXXConstructExpr(E);
1904 Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1906}
1907
1908void ASTStmtWriter::VisitLambdaExpr(LambdaExpr *E) {
1909 VisitExpr(E);
1910 Record.push_back(E->LambdaExprBits.NumCaptures);
1911 Record.AddSourceRange(E->IntroducerRange);
1912 Record.push_back(E->LambdaExprBits.CaptureDefault); // FIXME: stable encoding
1913 Record.AddSourceLocation(E->CaptureDefaultLoc);
1914 Record.push_back(E->LambdaExprBits.ExplicitParams);
1915 Record.push_back(E->LambdaExprBits.ExplicitResultType);
1916 Record.AddSourceLocation(E->ClosingBrace);
1917
1918 // Add capture initializers.
1920 CEnd = E->capture_init_end();
1921 C != CEnd; ++C) {
1922 Record.AddStmt(*C);
1923 }
1924
1925 // Don't serialize the body. It belongs to the call operator declaration.
1926 // LambdaExpr only stores a copy of the Stmt *.
1927
1929}
1930
1931void ASTStmtWriter::VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E) {
1932 VisitExpr(E);
1933 Record.AddStmt(E->getSubExpr());
1935}
1936
1937void ASTStmtWriter::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) {
1938 VisitExplicitCastExpr(E);
1939 Record.AddSourceRange(SourceRange(E->getOperatorLoc(), E->getRParenLoc()));
1940 CurrentPackingBits.addBit(E->getAngleBrackets().isValid());
1941 if (E->getAngleBrackets().isValid())
1942 Record.AddSourceRange(E->getAngleBrackets());
1943}
1944
1945void ASTStmtWriter::VisitCXXStaticCastExpr(CXXStaticCastExpr *E) {
1946 VisitCXXNamedCastExpr(E);
1948}
1949
1950void ASTStmtWriter::VisitCXXDynamicCastExpr(CXXDynamicCastExpr *E) {
1951 VisitCXXNamedCastExpr(E);
1953}
1954
1955void ASTStmtWriter::VisitCXXReinterpretCastExpr(CXXReinterpretCastExpr *E) {
1956 VisitCXXNamedCastExpr(E);
1958}
1959
1960void ASTStmtWriter::VisitCXXConstCastExpr(CXXConstCastExpr *E) {
1961 VisitCXXNamedCastExpr(E);
1963}
1964
1965void ASTStmtWriter::VisitCXXAddrspaceCastExpr(CXXAddrspaceCastExpr *E) {
1966 VisitCXXNamedCastExpr(E);
1968}
1969
1970void ASTStmtWriter::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E) {
1971 VisitExplicitCastExpr(E);
1972 Record.AddSourceLocation(E->getLParenLoc());
1973 Record.AddSourceLocation(E->getRParenLoc());
1975}
1976
1977void ASTStmtWriter::VisitBuiltinBitCastExpr(BuiltinBitCastExpr *E) {
1978 VisitExplicitCastExpr(E);
1979 Record.AddSourceLocation(E->getBeginLoc());
1980 Record.AddSourceLocation(E->getEndLoc());
1982}
1983
1984void ASTStmtWriter::VisitUserDefinedLiteral(UserDefinedLiteral *E) {
1985 VisitCallExpr(E);
1986 Record.AddSourceLocation(E->UDSuffixLoc);
1988}
1989
1990void ASTStmtWriter::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) {
1991 VisitExpr(E);
1992 Record.push_back(E->getValue());
1993 Record.AddSourceLocation(E->getLocation());
1995}
1996
1997void ASTStmtWriter::VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E) {
1998 VisitExpr(E);
1999 Record.AddSourceLocation(E->getLocation());
2001}
2002
2003void ASTStmtWriter::VisitCXXTypeidExpr(CXXTypeidExpr *E) {
2004 VisitExpr(E);
2005 Record.AddSourceRange(E->getSourceRange());
2006 if (E->isTypeOperand()) {
2007 Record.AddTypeSourceInfo(E->getTypeOperandSourceInfo());
2009 } else {
2010 Record.AddStmt(E->getExprOperand());
2012 }
2013}
2014
2015void ASTStmtWriter::VisitCXXThisExpr(CXXThisExpr *E) {
2016 VisitExpr(E);
2017 Record.AddSourceLocation(E->getLocation());
2018 Record.push_back(E->isImplicit());
2020
2022}
2023
2024void ASTStmtWriter::VisitCXXThrowExpr(CXXThrowExpr *E) {
2025 VisitExpr(E);
2026 Record.AddSourceLocation(E->getThrowLoc());
2027 Record.AddStmt(E->getSubExpr());
2028 Record.push_back(E->isThrownVariableInScope());
2030}
2031
2032void ASTStmtWriter::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
2033 VisitExpr(E);
2034 Record.AddDeclRef(E->getParam());
2035 Record.AddDeclRef(cast_or_null<Decl>(E->getUsedContext()));
2036 Record.AddSourceLocation(E->getUsedLocation());
2037 Record.push_back(E->hasRewrittenInit());
2038 if (E->hasRewrittenInit())
2039 Record.AddStmt(E->getRewrittenExpr());
2041}
2042
2043void ASTStmtWriter::VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E) {
2044 VisitExpr(E);
2045 Record.push_back(E->hasRewrittenInit());
2046 Record.AddDeclRef(E->getField());
2047 Record.AddDeclRef(cast_or_null<Decl>(E->getUsedContext()));
2048 Record.AddSourceLocation(E->getExprLoc());
2049 if (E->hasRewrittenInit())
2050 Record.AddStmt(E->getRewrittenExpr());
2052}
2053
2054void ASTStmtWriter::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
2055 VisitExpr(E);
2056 Record.AddCXXTemporary(E->getTemporary());
2057 Record.AddStmt(E->getSubExpr());
2059}
2060
2061void ASTStmtWriter::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
2062 VisitExpr(E);
2063 Record.AddTypeSourceInfo(E->getTypeSourceInfo());
2064 Record.AddSourceLocation(E->getRParenLoc());
2066}
2067
2068void ASTStmtWriter::VisitCXXNewExpr(CXXNewExpr *E) {
2069 VisitExpr(E);
2070
2071 Record.push_back(E->isArray());
2072 Record.push_back(E->hasInitializer());
2073 Record.push_back(E->getNumPlacementArgs());
2074 Record.push_back(E->isParenTypeId());
2075
2076 Record.push_back(E->isGlobalNew());
2077 ImplicitAllocationParameters IAP = E->implicitAllocationParameters();
2078 Record.push_back(isAlignedAllocation(IAP.PassAlignment));
2079 Record.push_back(isTypeAwareAllocation(IAP.PassTypeIdentity));
2080 Record.push_back(E->doesUsualArrayDeleteWantSize());
2081 Record.push_back(E->CXXNewExprBits.HasInitializer);
2082 Record.push_back(E->CXXNewExprBits.StoredInitializationStyle);
2083
2084 Record.AddDeclRef(E->getOperatorNew());
2085 Record.AddDeclRef(E->getOperatorDelete());
2086
2087 // Preserve the global candidates that the lookup at instantiation can find;
2088 // otherwise a reduced BMI can elide them because the dependent CXXNewExpr has
2089 // no direct reference to an allocation function.
2090 if (Writer.isGeneratingReducedBMI() && !E->getOperatorNew()) {
2091 auto PreserveGlobalCandidates = [&](OverloadedOperatorKind Kind) {
2092 DeclarationName Name =
2093 Record.getASTContext().DeclarationNames.getCXXOperatorName(Kind);
2094 for (NamedDecl *Found :
2095 Record.getASTContext().getTranslationUnitDecl()->noload_lookup(Name))
2096 if (!Found->isImplicit())
2097 Writer.GetDeclRef(Found);
2098 };
2099
2100 PreserveGlobalCandidates(E->isArray() ? OO_Array_New : OO_New);
2101 PreserveGlobalCandidates(E->isArray() ? OO_Array_Delete : OO_Delete);
2102 }
2103
2104 Record.AddTypeSourceInfo(E->getAllocatedTypeSourceInfo());
2105 if (E->isParenTypeId())
2106 Record.AddSourceRange(E->getTypeIdParens());
2107 Record.AddSourceRange(E->getSourceRange());
2108 Record.AddSourceRange(E->getDirectInitRange());
2109
2110 for (CXXNewExpr::arg_iterator I = E->raw_arg_begin(), N = E->raw_arg_end();
2111 I != N; ++I)
2112 Record.AddStmt(*I);
2113
2115}
2116
2117void ASTStmtWriter::VisitCXXDeleteExpr(CXXDeleteExpr *E) {
2118 VisitExpr(E);
2119 Record.push_back(E->isGlobalDelete());
2120 Record.push_back(E->isArrayForm());
2121 Record.push_back(E->isArrayFormAsWritten());
2122 Record.push_back(E->doesUsualArrayDeleteWantSize());
2123 Record.AddDeclRef(E->getOperatorDelete());
2124 Record.AddStmt(E->getArgument());
2125 Record.AddSourceLocation(E->getBeginLoc());
2126
2128}
2129
2130void ASTStmtWriter::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
2131 VisitExpr(E);
2132
2133 Record.AddStmt(E->getBase());
2134 Record.push_back(E->isArrow());
2135 Record.AddSourceLocation(E->getOperatorLoc());
2136 Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
2137 Record.AddTypeSourceInfo(E->getScopeTypeInfo());
2138 Record.AddSourceLocation(E->getColonColonLoc());
2139 Record.AddSourceLocation(E->getTildeLoc());
2140
2141 // PseudoDestructorTypeStorage.
2142 Record.AddIdentifierRef(E->getDestroyedTypeIdentifier());
2144 Record.AddSourceLocation(E->getDestroyedTypeLoc());
2145 else
2146 Record.AddTypeSourceInfo(E->getDestroyedTypeInfo());
2147
2149}
2150
2151void ASTStmtWriter::VisitExprWithCleanups(ExprWithCleanups *E) {
2152 VisitExpr(E);
2153 Record.push_back(E->getNumObjects());
2154 for (auto &Obj : E->getObjects()) {
2155 if (auto *BD = Obj.dyn_cast<BlockDecl *>()) {
2156 Record.push_back(serialization::COK_Block);
2157 Record.AddDeclRef(BD);
2158 } else if (auto *CLE = Obj.dyn_cast<CompoundLiteralExpr *>()) {
2159 Record.push_back(serialization::COK_CompoundLiteral);
2160 Record.AddStmt(CLE);
2161 }
2162 }
2163
2164 Record.push_back(E->cleanupsHaveSideEffects());
2165 Record.AddStmt(E->getSubExpr());
2167}
2168
2169void ASTStmtWriter::VisitDependentTemplateIdExpr(DependentTemplateIdExpr *E) {
2170 VisitExpr(E);
2171 Record.push_back(E->getNumTemplateArgs());
2172 AddTemplateKWAndArgsInfo(E->KWAndArgs, E->getTrailingObjects());
2173 Record.AddDeclarationNameInfo(E->getNameInfo());
2174 Record.AddTemplateName(E->getTemplateName());
2176}
2177
2178void ASTStmtWriter::VisitCXXDependentScopeMemberExpr(
2180 VisitExpr(E);
2181
2182 // Don't emit anything here (or if you do you will have to update
2183 // the corresponding deserialization function).
2184 Record.push_back(E->getNumTemplateArgs());
2185 CurrentPackingBits.updateBits();
2186 CurrentPackingBits.addBit(E->hasTemplateKWAndArgsInfo());
2187 CurrentPackingBits.addBit(E->hasFirstQualifierFoundInScope());
2188
2189 if (E->hasTemplateKWAndArgsInfo()) {
2190 const ASTTemplateKWAndArgsInfo &ArgInfo =
2191 *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
2193 E->getTrailingObjects<TemplateArgumentLoc>());
2194 }
2195
2196 CurrentPackingBits.addBit(E->isArrow());
2197
2198 Record.AddTypeRef(E->getBaseType());
2199 Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
2200 CurrentPackingBits.addBit(!E->isImplicitAccess());
2201 if (!E->isImplicitAccess())
2202 Record.AddStmt(E->getBase());
2203
2204 Record.AddSourceLocation(E->getOperatorLoc());
2205
2206 if (E->hasFirstQualifierFoundInScope())
2207 Record.AddDeclRef(E->getFirstQualifierFoundInScope());
2208
2209 Record.AddDeclarationNameInfo(E->MemberNameInfo);
2211}
2212
2213void
2214ASTStmtWriter::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) {
2215 VisitExpr(E);
2216
2217 // Don't emit anything here, HasTemplateKWAndArgsInfo must be
2218 // emitted first.
2219 CurrentPackingBits.addBit(
2220 E->DependentScopeDeclRefExprBits.HasTemplateKWAndArgsInfo);
2221
2222 if (E->DependentScopeDeclRefExprBits.HasTemplateKWAndArgsInfo) {
2223 const ASTTemplateKWAndArgsInfo &ArgInfo =
2224 *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
2225 // 16 bits should be enought to store the number of args
2226 CurrentPackingBits.addBits(ArgInfo.NumTemplateArgs, /*Width=*/16);
2228 E->getTrailingObjects<TemplateArgumentLoc>());
2229 }
2230
2231 Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
2232 Record.AddDeclarationNameInfo(E->NameInfo);
2234}
2235
2236void
2237ASTStmtWriter::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E) {
2238 VisitExpr(E);
2239 Record.push_back(E->getNumArgs());
2241 ArgI = E->arg_begin(), ArgE = E->arg_end(); ArgI != ArgE; ++ArgI)
2242 Record.AddStmt(*ArgI);
2243 Record.AddTypeSourceInfo(E->getTypeSourceInfo());
2244 Record.AddSourceLocation(E->getLParenLoc());
2245 Record.AddSourceLocation(E->getRParenLoc());
2246 Record.push_back(E->isListInitialization());
2248}
2249
2250void ASTStmtWriter::VisitOverloadExpr(OverloadExpr *E) {
2251 VisitExpr(E);
2252
2253 Record.push_back(E->getNumDecls());
2254
2255 CurrentPackingBits.updateBits();
2256 CurrentPackingBits.addBit(E->hasTemplateKWAndArgsInfo());
2257 if (E->hasTemplateKWAndArgsInfo()) {
2258 const ASTTemplateKWAndArgsInfo &ArgInfo =
2260 Record.push_back(ArgInfo.NumTemplateArgs);
2262 }
2263
2265 OvE = E->decls_end();
2266 OvI != OvE; ++OvI) {
2267 Record.AddDeclRef(OvI.getDecl());
2268 Record.push_back(OvI.getAccess());
2269 }
2270
2271 Record.AddDeclarationNameInfo(E->getNameInfo());
2272 Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
2273}
2274
2275void ASTStmtWriter::VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
2276 VisitOverloadExpr(E);
2277 CurrentPackingBits.addBit(E->isArrow());
2278 CurrentPackingBits.addBit(E->hasUnresolvedUsing());
2279 CurrentPackingBits.addBit(!E->isImplicitAccess());
2280 if (!E->isImplicitAccess())
2281 Record.AddStmt(E->getBase());
2282
2283 Record.AddSourceLocation(E->getOperatorLoc());
2284
2285 Record.AddTypeRef(E->getBaseType());
2287}
2288
2289void ASTStmtWriter::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) {
2290 VisitOverloadExpr(E);
2291 CurrentPackingBits.addBit(E->requiresADL());
2292 Record.AddDeclRef(E->getNamingClass());
2294
2295 if (Writer.isWritingStdCXXNamedModules() && Writer.getChain()) {
2296 // Referencing all the possible declarations to make sure the change get
2297 // propagted.
2298 DeclarationName Name = E->getName();
2299 for (auto *Found :
2300 Record.getASTContext().getTranslationUnitDecl()->lookup(Name))
2301 if (Found->isFromASTFile())
2302 Writer.GetDeclRef(Found);
2303
2304 llvm::SmallVector<NamespaceDecl *> ExternalNSs;
2305 Writer.getChain()->ReadKnownNamespaces(ExternalNSs);
2306 for (auto *NS : ExternalNSs)
2307 for (auto *Found : NS->lookup(Name))
2308 Writer.GetDeclRef(Found);
2309 }
2310}
2311
2312void ASTStmtWriter::VisitTypeTraitExpr(TypeTraitExpr *E) {
2313 VisitExpr(E);
2314 Record.push_back(E->TypeTraitExprBits.IsBooleanTypeTrait);
2315 Record.push_back(E->TypeTraitExprBits.IsComparisonResult);
2316 Record.push_back(E->TypeTraitExprBits.NumArgs);
2317 Record.push_back(E->TypeTraitExprBits.Kind); // FIXME: Stable encoding
2318
2319 if (E->TypeTraitExprBits.IsBooleanTypeTrait)
2320 Record.push_back(E->TypeTraitExprBits.Value);
2321 else if (E->isValueDependent())
2322 Record.AddAPValue(APValue());
2323 else
2324 Record.AddAPValue(E->getAPValue());
2325
2326 Record.AddSourceRange(E->getSourceRange());
2327 for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
2328 Record.AddTypeSourceInfo(E->getArg(I));
2330}
2331
2332void ASTStmtWriter::VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E) {
2333 VisitExpr(E);
2334 Record.push_back(E->getTrait());
2335 Record.push_back(E->getValue());
2336 Record.AddSourceRange(E->getSourceRange());
2337 Record.AddTypeSourceInfo(E->getQueriedTypeSourceInfo());
2338 Record.AddStmt(E->getDimensionExpression());
2340}
2341
2342void ASTStmtWriter::VisitExpressionTraitExpr(ExpressionTraitExpr *E) {
2343 VisitExpr(E);
2344 Record.push_back(E->getTrait());
2345 Record.push_back(E->getValue());
2346 Record.AddSourceRange(E->getSourceRange());
2347 Record.AddStmt(E->getQueriedExpression());
2349}
2350
2351void ASTStmtWriter::VisitCXXNoexceptExpr(CXXNoexceptExpr *E) {
2352 VisitExpr(E);
2353 Record.push_back(E->getValue());
2354 Record.AddSourceRange(E->getSourceRange());
2355 Record.AddStmt(E->getOperand());
2357}
2358
2359void ASTStmtWriter::VisitPackExpansionExpr(PackExpansionExpr *E) {
2360 VisitExpr(E);
2361 Record.AddSourceLocation(E->getEllipsisLoc());
2362 Record.push_back(E->NumExpansions);
2363 Record.AddStmt(E->getPattern());
2365}
2366
2367void ASTStmtWriter::VisitSizeOfPackExpr(SizeOfPackExpr *E) {
2368 VisitExpr(E);
2369 Record.push_back(E->isPartiallySubstituted() ? E->getPartialArguments().size()
2370 : 0);
2371 Record.AddSourceLocation(E->OperatorLoc);
2372 Record.AddSourceLocation(E->PackLoc);
2373 Record.AddSourceLocation(E->RParenLoc);
2374 Record.AddDeclRef(E->Pack);
2375 if (E->isPartiallySubstituted()) {
2376 for (const auto &TA : E->getPartialArguments())
2377 Record.AddTemplateArgument(TA);
2378 } else if (!E->isValueDependent()) {
2379 Record.push_back(E->getPackLength());
2380 }
2382}
2383
2384void ASTStmtWriter::VisitPackIndexingExpr(PackIndexingExpr *E) {
2385 VisitExpr(E);
2386 Record.push_back(E->PackIndexingExprBits.TransformedExpressions);
2387 Record.push_back(E->PackIndexingExprBits.FullySubstituted);
2388 Record.AddSourceLocation(E->getEllipsisLoc());
2389 Record.AddSourceLocation(E->getRSquareLoc());
2390 Record.AddStmt(E->getPackIdExpression());
2391 Record.AddStmt(E->getIndexExpr());
2392 for (Expr *Sub : E->getExpressions())
2393 Record.AddStmt(Sub);
2395}
2396
2397void ASTStmtWriter::VisitSubstNonTypeTemplateParmExpr(
2399 VisitExpr(E);
2400 Record.AddDeclRef(E->getAssociatedDecl());
2401 CurrentPackingBits.addBit(E->getFinal());
2402 CurrentPackingBits.addBits(E->getIndex(), /*Width=*/12);
2403 Record.writeUnsignedOrNone(E->getPackIndex());
2404 Record.AddTypeRef(E->getParameterType());
2405
2406 Record.AddSourceLocation(E->getNameLoc());
2407 Record.AddStmt(E->getReplacement());
2409}
2410
2411void ASTStmtWriter::VisitSubstNonTypeTemplateParmPackExpr(
2413 VisitExpr(E);
2414 Record.AddDeclRef(E->getAssociatedDecl());
2415 CurrentPackingBits.addBit(E->getFinal());
2416 Record.push_back(E->getIndex());
2417 Record.AddTemplateArgument(E->getArgumentPack());
2418 Record.AddSourceLocation(E->getParameterPackLocation());
2420}
2421
2422void ASTStmtWriter::VisitFunctionParmPackExpr(FunctionParmPackExpr *E) {
2423 VisitExpr(E);
2424 Record.push_back(E->getNumExpansions());
2425 Record.AddDeclRef(E->getParameterPack());
2426 Record.AddSourceLocation(E->getParameterPackLocation());
2427 for (FunctionParmPackExpr::iterator I = E->begin(), End = E->end();
2428 I != End; ++I)
2429 Record.AddDeclRef(*I);
2431}
2432
2433void ASTStmtWriter::VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E) {
2434 VisitExpr(E);
2435 Record.push_back(static_cast<bool>(E->getLifetimeExtendedTemporaryDecl()));
2437 Record.AddDeclRef(E->getLifetimeExtendedTemporaryDecl());
2438 else
2439 Record.AddStmt(E->getSubExpr());
2441}
2442
2443void ASTStmtWriter::VisitCXXFoldExpr(CXXFoldExpr *E) {
2444 VisitExpr(E);
2445 Record.AddSourceLocation(E->LParenLoc);
2446 Record.AddSourceLocation(E->EllipsisLoc);
2447 Record.AddSourceLocation(E->RParenLoc);
2448 Record.push_back(E->NumExpansions.toInternalRepresentation());
2449 Record.AddStmt(E->SubExprs[0]);
2450 Record.AddStmt(E->SubExprs[1]);
2451 Record.AddStmt(E->SubExprs[2]);
2452 Record.push_back(E->CXXFoldExprBits.Opcode);
2454}
2455
2456void ASTStmtWriter::VisitCXXParenListInitExpr(CXXParenListInitExpr *E) {
2457 VisitExpr(E);
2458 ArrayRef<Expr *> InitExprs = E->getInitExprs();
2459 Record.push_back(InitExprs.size());
2460 Record.push_back(E->getUserSpecifiedInitExprs().size());
2461 Record.AddSourceLocation(E->getInitLoc());
2462 Record.AddSourceLocation(E->getBeginLoc());
2463 Record.AddSourceLocation(E->getEndLoc());
2464 for (Expr *InitExpr : E->getInitExprs())
2465 Record.AddStmt(InitExpr);
2466 Expr *ArrayFiller = E->getArrayFiller();
2467 FieldDecl *UnionField = E->getInitializedFieldInUnion();
2468 bool HasArrayFillerOrUnionDecl = ArrayFiller || UnionField;
2469 Record.push_back(HasArrayFillerOrUnionDecl);
2470 if (HasArrayFillerOrUnionDecl) {
2471 Record.push_back(static_cast<bool>(ArrayFiller));
2472 if (ArrayFiller)
2473 Record.AddStmt(ArrayFiller);
2474 else
2475 Record.AddDeclRef(UnionField);
2476 }
2478}
2479
2480void ASTStmtWriter::VisitOpaqueValueExpr(OpaqueValueExpr *E) {
2481 VisitExpr(E);
2482 Record.AddStmt(E->getSourceExpr());
2483 Record.AddSourceLocation(E->getLocation());
2484 Record.push_back(E->isUnique());
2486}
2487
2488//===----------------------------------------------------------------------===//
2489// CUDA Expressions and Statements.
2490//===----------------------------------------------------------------------===//
2491
2492void ASTStmtWriter::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E) {
2493 VisitCallExpr(E);
2494 Record.AddStmt(E->getConfig());
2496}
2497
2498//===----------------------------------------------------------------------===//
2499// OpenCL Expressions and Statements.
2500//===----------------------------------------------------------------------===//
2501void ASTStmtWriter::VisitAsTypeExpr(AsTypeExpr *E) {
2502 VisitExpr(E);
2503 Record.AddSourceLocation(E->getBuiltinLoc());
2504 Record.AddSourceLocation(E->getRParenLoc());
2505 Record.AddStmt(E->getSrcExpr());
2507}
2508
2509//===----------------------------------------------------------------------===//
2510// Microsoft Expressions and Statements.
2511//===----------------------------------------------------------------------===//
2512void ASTStmtWriter::VisitMSPropertyRefExpr(MSPropertyRefExpr *E) {
2513 VisitExpr(E);
2514 Record.push_back(E->isArrow());
2515 Record.AddStmt(E->getBaseExpr());
2516 Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
2517 Record.AddSourceLocation(E->getMemberLoc());
2518 Record.AddDeclRef(E->getPropertyDecl());
2520}
2521
2522void ASTStmtWriter::VisitMSPropertySubscriptExpr(MSPropertySubscriptExpr *E) {
2523 VisitExpr(E);
2524 Record.AddStmt(E->getBase());
2525 Record.AddStmt(E->getIdx());
2526 Record.AddSourceLocation(E->getRBracketLoc());
2528}
2529
2530void ASTStmtWriter::VisitCXXUuidofExpr(CXXUuidofExpr *E) {
2531 VisitExpr(E);
2532 Record.AddSourceRange(E->getSourceRange());
2533 Record.AddDeclRef(E->getGuidDecl());
2534 if (E->isTypeOperand()) {
2535 Record.AddTypeSourceInfo(E->getTypeOperandSourceInfo());
2537 } else {
2538 Record.AddStmt(E->getExprOperand());
2540 }
2541}
2542
2543void ASTStmtWriter::VisitSEHExceptStmt(SEHExceptStmt *S) {
2544 VisitStmt(S);
2545 Record.AddSourceLocation(S->getExceptLoc());
2546 Record.AddStmt(S->getFilterExpr());
2547 Record.AddStmt(S->getBlock());
2549}
2550
2551void ASTStmtWriter::VisitSEHFinallyStmt(SEHFinallyStmt *S) {
2552 VisitStmt(S);
2553 Record.AddSourceLocation(S->getFinallyLoc());
2554 Record.AddStmt(S->getBlock());
2556}
2557
2558void ASTStmtWriter::VisitSEHTryStmt(SEHTryStmt *S) {
2559 VisitStmt(S);
2560 Record.push_back(S->getIsCXXTry());
2561 Record.AddSourceLocation(S->getTryLoc());
2562 Record.AddStmt(S->getTryBlock());
2563 Record.AddStmt(S->getHandler());
2565}
2566
2567void ASTStmtWriter::VisitSEHLeaveStmt(SEHLeaveStmt *S) {
2568 VisitStmt(S);
2569 Record.AddSourceLocation(S->getLeaveLoc());
2571}
2572
2573//===----------------------------------------------------------------------===//
2574// OpenMP Directives.
2575//===----------------------------------------------------------------------===//
2576
2577void ASTStmtWriter::VisitOMPCanonicalLoop(OMPCanonicalLoop *S) {
2578 VisitStmt(S);
2579 for (Stmt *SubStmt : S->SubStmts)
2580 Record.AddStmt(SubStmt);
2582}
2583
2584void ASTStmtWriter::VisitOMPExecutableDirective(OMPExecutableDirective *E) {
2585 Record.writeOMPChildren(E->Data);
2586 Record.AddSourceLocation(E->getBeginLoc());
2587 Record.AddSourceLocation(E->getEndLoc());
2588}
2589
2590void ASTStmtWriter::VisitOMPLoopBasedDirective(OMPLoopBasedDirective *D) {
2591 VisitStmt(D);
2592 Record.writeUInt32(D->getLoopsNumber());
2593 VisitOMPExecutableDirective(D);
2594}
2595
2596void ASTStmtWriter::VisitOMPLoopDirective(OMPLoopDirective *D) {
2597 VisitOMPLoopBasedDirective(D);
2598}
2599
2600void ASTStmtWriter::VisitOMPMetaDirective(OMPMetaDirective *D) {
2601 VisitStmt(D);
2602 Record.push_back(D->getNumClauses());
2603 VisitOMPExecutableDirective(D);
2605}
2606
2607void ASTStmtWriter::VisitOMPParallelDirective(OMPParallelDirective *D) {
2608 VisitStmt(D);
2609 VisitOMPExecutableDirective(D);
2610 Record.writeBool(D->hasCancel());
2612}
2613
2614void ASTStmtWriter::VisitOMPSimdDirective(OMPSimdDirective *D) {
2615 VisitOMPLoopDirective(D);
2617}
2618
2619void ASTStmtWriter::VisitOMPCanonicalLoopNestTransformationDirective(
2620 OMPCanonicalLoopNestTransformationDirective *D) {
2621 VisitOMPLoopBasedDirective(D);
2622 Record.writeUInt32(D->getNumGeneratedTopLevelLoops());
2623}
2624
2625void ASTStmtWriter::VisitOMPTileDirective(OMPTileDirective *D) {
2626 VisitOMPCanonicalLoopNestTransformationDirective(D);
2628}
2629
2630void ASTStmtWriter::VisitOMPStripeDirective(OMPStripeDirective *D) {
2631 VisitOMPCanonicalLoopNestTransformationDirective(D);
2633}
2634
2635void ASTStmtWriter::VisitOMPUnrollDirective(OMPUnrollDirective *D) {
2636 VisitOMPCanonicalLoopNestTransformationDirective(D);
2638}
2639
2640void ASTStmtWriter::VisitOMPReverseDirective(OMPReverseDirective *D) {
2641 VisitOMPCanonicalLoopNestTransformationDirective(D);
2643}
2644
2645void ASTStmtWriter::VisitOMPInterchangeDirective(OMPInterchangeDirective *D) {
2646 VisitOMPCanonicalLoopNestTransformationDirective(D);
2648}
2649
2650void ASTStmtWriter::VisitOMPSplitDirective(OMPSplitDirective *D) {
2651 VisitOMPCanonicalLoopNestTransformationDirective(D);
2653}
2654
2655void ASTStmtWriter::VisitOMPCanonicalLoopSequenceTransformationDirective(
2656 OMPCanonicalLoopSequenceTransformationDirective *D) {
2657 VisitStmt(D);
2658 VisitOMPExecutableDirective(D);
2659 Record.writeUInt32(D->getNumGeneratedTopLevelLoops());
2660}
2661
2662void ASTStmtWriter::VisitOMPFuseDirective(OMPFuseDirective *D) {
2663 VisitOMPCanonicalLoopSequenceTransformationDirective(D);
2665}
2666
2667void ASTStmtWriter::VisitOMPForDirective(OMPForDirective *D) {
2668 VisitOMPLoopDirective(D);
2669 Record.writeBool(D->hasCancel());
2671}
2672
2673void ASTStmtWriter::VisitOMPForSimdDirective(OMPForSimdDirective *D) {
2674 VisitOMPLoopDirective(D);
2676}
2677
2678void ASTStmtWriter::VisitOMPSectionsDirective(OMPSectionsDirective *D) {
2679 VisitStmt(D);
2680 VisitOMPExecutableDirective(D);
2681 Record.writeBool(D->hasCancel());
2683}
2684
2685void ASTStmtWriter::VisitOMPSectionDirective(OMPSectionDirective *D) {
2686 VisitStmt(D);
2687 VisitOMPExecutableDirective(D);
2688 Record.writeBool(D->hasCancel());
2690}
2691
2692void ASTStmtWriter::VisitOMPScopeDirective(OMPScopeDirective *D) {
2693 VisitStmt(D);
2694 VisitOMPExecutableDirective(D);
2696}
2697
2698void ASTStmtWriter::VisitOMPSingleDirective(OMPSingleDirective *D) {
2699 VisitStmt(D);
2700 VisitOMPExecutableDirective(D);
2702}
2703
2704void ASTStmtWriter::VisitOMPMasterDirective(OMPMasterDirective *D) {
2705 VisitStmt(D);
2706 VisitOMPExecutableDirective(D);
2708}
2709
2710void ASTStmtWriter::VisitOMPCriticalDirective(OMPCriticalDirective *D) {
2711 VisitStmt(D);
2712 VisitOMPExecutableDirective(D);
2713 Record.AddDeclarationNameInfo(D->getDirectiveName());
2715}
2716
2717void ASTStmtWriter::VisitOMPParallelForDirective(OMPParallelForDirective *D) {
2718 VisitOMPLoopDirective(D);
2719 Record.writeBool(D->hasCancel());
2721}
2722
2723void ASTStmtWriter::VisitOMPParallelForSimdDirective(
2724 OMPParallelForSimdDirective *D) {
2725 VisitOMPLoopDirective(D);
2727}
2728
2729void ASTStmtWriter::VisitOMPParallelMasterDirective(
2730 OMPParallelMasterDirective *D) {
2731 VisitStmt(D);
2732 VisitOMPExecutableDirective(D);
2734}
2735
2736void ASTStmtWriter::VisitOMPParallelMaskedDirective(
2737 OMPParallelMaskedDirective *D) {
2738 VisitStmt(D);
2739 VisitOMPExecutableDirective(D);
2741}
2742
2743void ASTStmtWriter::VisitOMPParallelSectionsDirective(
2744 OMPParallelSectionsDirective *D) {
2745 VisitStmt(D);
2746 VisitOMPExecutableDirective(D);
2747 Record.writeBool(D->hasCancel());
2749}
2750
2751void ASTStmtWriter::VisitOMPTaskDirective(OMPTaskDirective *D) {
2752 VisitStmt(D);
2753 VisitOMPExecutableDirective(D);
2754 Record.writeBool(D->hasCancel());
2756}
2757
2758void ASTStmtWriter::VisitOMPAtomicDirective(OMPAtomicDirective *D) {
2759 VisitStmt(D);
2760 VisitOMPExecutableDirective(D);
2761 Record.writeBool(D->isXLHSInRHSPart());
2762 Record.writeBool(D->isPostfixUpdate());
2763 Record.writeBool(D->isFailOnly());
2765}
2766
2767void ASTStmtWriter::VisitOMPTargetDirective(OMPTargetDirective *D) {
2768 VisitStmt(D);
2769 VisitOMPExecutableDirective(D);
2771}
2772
2773void ASTStmtWriter::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) {
2774 VisitStmt(D);
2775 VisitOMPExecutableDirective(D);
2777}
2778
2779void ASTStmtWriter::VisitOMPTargetEnterDataDirective(
2780 OMPTargetEnterDataDirective *D) {
2781 VisitStmt(D);
2782 VisitOMPExecutableDirective(D);
2784}
2785
2786void ASTStmtWriter::VisitOMPTargetExitDataDirective(
2787 OMPTargetExitDataDirective *D) {
2788 VisitStmt(D);
2789 VisitOMPExecutableDirective(D);
2791}
2792
2793void ASTStmtWriter::VisitOMPTargetParallelDirective(
2794 OMPTargetParallelDirective *D) {
2795 VisitStmt(D);
2796 VisitOMPExecutableDirective(D);
2797 Record.writeBool(D->hasCancel());
2799}
2800
2801void ASTStmtWriter::VisitOMPTargetParallelForDirective(
2802 OMPTargetParallelForDirective *D) {
2803 VisitOMPLoopDirective(D);
2804 Record.writeBool(D->hasCancel());
2806}
2807
2808void ASTStmtWriter::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) {
2809 VisitStmt(D);
2810 VisitOMPExecutableDirective(D);
2812}
2813
2814void ASTStmtWriter::VisitOMPBarrierDirective(OMPBarrierDirective *D) {
2815 VisitStmt(D);
2816 VisitOMPExecutableDirective(D);
2818}
2819
2820void ASTStmtWriter::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) {
2821 VisitStmt(D);
2822 Record.push_back(D->getNumClauses());
2823 VisitOMPExecutableDirective(D);
2825}
2826
2827void ASTStmtWriter::VisitOMPAssumeDirective(OMPAssumeDirective *D) {
2828 VisitStmt(D);
2829 VisitOMPExecutableDirective(D);
2831}
2832
2833void ASTStmtWriter::VisitOMPErrorDirective(OMPErrorDirective *D) {
2834 VisitStmt(D);
2835 Record.push_back(D->getNumClauses());
2836 VisitOMPExecutableDirective(D);
2838}
2839
2840void ASTStmtWriter::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) {
2841 VisitStmt(D);
2842 VisitOMPExecutableDirective(D);
2844}
2845
2846void ASTStmtWriter::VisitOMPFlushDirective(OMPFlushDirective *D) {
2847 VisitStmt(D);
2848 VisitOMPExecutableDirective(D);
2850}
2851
2852void ASTStmtWriter::VisitOMPDepobjDirective(OMPDepobjDirective *D) {
2853 VisitStmt(D);
2854 VisitOMPExecutableDirective(D);
2856}
2857
2858void ASTStmtWriter::VisitOMPScanDirective(OMPScanDirective *D) {
2859 VisitStmt(D);
2860 VisitOMPExecutableDirective(D);
2862}
2863
2864void ASTStmtWriter::VisitOMPOrderedStandaloneDirective(
2865 OMPOrderedStandaloneDirective *D) {
2866 VisitStmt(D);
2867 VisitOMPExecutableDirective(D);
2869}
2870
2871void ASTStmtWriter::VisitOMPOrderedBlockAssocDirective(
2872 OMPOrderedBlockAssocDirective *D) {
2873 VisitStmt(D);
2874 VisitOMPExecutableDirective(D);
2876}
2877
2878void ASTStmtWriter::VisitOMPTeamsDirective(OMPTeamsDirective *D) {
2879 VisitStmt(D);
2880 VisitOMPExecutableDirective(D);
2882}
2883
2884void ASTStmtWriter::VisitOMPCancellationPointDirective(
2885 OMPCancellationPointDirective *D) {
2886 VisitStmt(D);
2887 VisitOMPExecutableDirective(D);
2888 Record.writeEnum(D->getCancelRegion());
2890}
2891
2892void ASTStmtWriter::VisitOMPCancelDirective(OMPCancelDirective *D) {
2893 VisitStmt(D);
2894 VisitOMPExecutableDirective(D);
2895 Record.writeEnum(D->getCancelRegion());
2897}
2898
2899void ASTStmtWriter::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) {
2900 VisitOMPLoopDirective(D);
2901 Record.writeBool(D->hasCancel());
2903}
2904
2905void ASTStmtWriter::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) {
2906 VisitOMPLoopDirective(D);
2908}
2909
2910void ASTStmtWriter::VisitOMPMasterTaskLoopDirective(
2911 OMPMasterTaskLoopDirective *D) {
2912 VisitOMPLoopDirective(D);
2913 Record.writeBool(D->hasCancel());
2915}
2916
2917void ASTStmtWriter::VisitOMPMaskedTaskLoopDirective(
2918 OMPMaskedTaskLoopDirective *D) {
2919 VisitOMPLoopDirective(D);
2920 Record.writeBool(D->hasCancel());
2922}
2923
2924void ASTStmtWriter::VisitOMPMasterTaskLoopSimdDirective(
2925 OMPMasterTaskLoopSimdDirective *D) {
2926 VisitOMPLoopDirective(D);
2928}
2929
2930void ASTStmtWriter::VisitOMPMaskedTaskLoopSimdDirective(
2931 OMPMaskedTaskLoopSimdDirective *D) {
2932 VisitOMPLoopDirective(D);
2934}
2935
2936void ASTStmtWriter::VisitOMPParallelMasterTaskLoopDirective(
2937 OMPParallelMasterTaskLoopDirective *D) {
2938 VisitOMPLoopDirective(D);
2939 Record.writeBool(D->hasCancel());
2941}
2942
2943void ASTStmtWriter::VisitOMPParallelMaskedTaskLoopDirective(
2944 OMPParallelMaskedTaskLoopDirective *D) {
2945 VisitOMPLoopDirective(D);
2946 Record.writeBool(D->hasCancel());
2948}
2949
2950void ASTStmtWriter::VisitOMPParallelMasterTaskLoopSimdDirective(
2951 OMPParallelMasterTaskLoopSimdDirective *D) {
2952 VisitOMPLoopDirective(D);
2954}
2955
2956void ASTStmtWriter::VisitOMPParallelMaskedTaskLoopSimdDirective(
2957 OMPParallelMaskedTaskLoopSimdDirective *D) {
2958 VisitOMPLoopDirective(D);
2960}
2961
2962void ASTStmtWriter::VisitOMPDistributeDirective(OMPDistributeDirective *D) {
2963 VisitOMPLoopDirective(D);
2965}
2966
2967void ASTStmtWriter::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) {
2968 VisitStmt(D);
2969 VisitOMPExecutableDirective(D);
2971}
2972
2973void ASTStmtWriter::VisitOMPDistributeParallelForDirective(
2974 OMPDistributeParallelForDirective *D) {
2975 VisitOMPLoopDirective(D);
2976 Record.writeBool(D->hasCancel());
2978}
2979
2980void ASTStmtWriter::VisitOMPDistributeParallelForSimdDirective(
2981 OMPDistributeParallelForSimdDirective *D) {
2982 VisitOMPLoopDirective(D);
2984}
2985
2986void ASTStmtWriter::VisitOMPDistributeSimdDirective(
2987 OMPDistributeSimdDirective *D) {
2988 VisitOMPLoopDirective(D);
2990}
2991
2992void ASTStmtWriter::VisitOMPTargetParallelForSimdDirective(
2993 OMPTargetParallelForSimdDirective *D) {
2994 VisitOMPLoopDirective(D);
2996}
2997
2998void ASTStmtWriter::VisitOMPTargetSimdDirective(OMPTargetSimdDirective *D) {
2999 VisitOMPLoopDirective(D);
3001}
3002
3003void ASTStmtWriter::VisitOMPTeamsDistributeDirective(
3004 OMPTeamsDistributeDirective *D) {
3005 VisitOMPLoopDirective(D);
3007}
3008
3009void ASTStmtWriter::VisitOMPTeamsDistributeSimdDirective(
3010 OMPTeamsDistributeSimdDirective *D) {
3011 VisitOMPLoopDirective(D);
3013}
3014
3015void ASTStmtWriter::VisitOMPTeamsDistributeParallelForSimdDirective(
3016 OMPTeamsDistributeParallelForSimdDirective *D) {
3017 VisitOMPLoopDirective(D);
3019}
3020
3021void ASTStmtWriter::VisitOMPTeamsDistributeParallelForDirective(
3022 OMPTeamsDistributeParallelForDirective *D) {
3023 VisitOMPLoopDirective(D);
3024 Record.writeBool(D->hasCancel());
3026}
3027
3028void ASTStmtWriter::VisitOMPTargetTeamsDirective(OMPTargetTeamsDirective *D) {
3029 VisitStmt(D);
3030 VisitOMPExecutableDirective(D);
3032}
3033
3034void ASTStmtWriter::VisitOMPTargetTeamsDistributeDirective(
3035 OMPTargetTeamsDistributeDirective *D) {
3036 VisitOMPLoopDirective(D);
3038}
3039
3040void ASTStmtWriter::VisitOMPTargetTeamsDistributeParallelForDirective(
3041 OMPTargetTeamsDistributeParallelForDirective *D) {
3042 VisitOMPLoopDirective(D);
3043 Record.writeBool(D->hasCancel());
3045}
3046
3047void ASTStmtWriter::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
3048 OMPTargetTeamsDistributeParallelForSimdDirective *D) {
3049 VisitOMPLoopDirective(D);
3050 Code = serialization::
3051 STMT_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE;
3052}
3053
3054void ASTStmtWriter::VisitOMPTargetTeamsDistributeSimdDirective(
3055 OMPTargetTeamsDistributeSimdDirective *D) {
3056 VisitOMPLoopDirective(D);
3058}
3059
3060void ASTStmtWriter::VisitOMPInteropDirective(OMPInteropDirective *D) {
3061 VisitStmt(D);
3062 VisitOMPExecutableDirective(D);
3064}
3065
3066void ASTStmtWriter::VisitOMPDispatchDirective(OMPDispatchDirective *D) {
3067 VisitStmt(D);
3068 VisitOMPExecutableDirective(D);
3069 Record.AddSourceLocation(D->getTargetCallLoc());
3071}
3072
3073void ASTStmtWriter::VisitOMPMaskedDirective(OMPMaskedDirective *D) {
3074 VisitStmt(D);
3075 VisitOMPExecutableDirective(D);
3077}
3078
3079void ASTStmtWriter::VisitOMPGenericLoopDirective(OMPGenericLoopDirective *D) {
3080 VisitOMPLoopDirective(D);
3082}
3083
3084void ASTStmtWriter::VisitOMPTeamsGenericLoopDirective(
3085 OMPTeamsGenericLoopDirective *D) {
3086 VisitOMPLoopDirective(D);
3088}
3089
3090void ASTStmtWriter::VisitOMPTargetTeamsGenericLoopDirective(
3091 OMPTargetTeamsGenericLoopDirective *D) {
3092 VisitOMPLoopDirective(D);
3093 Record.writeBool(D->canBeParallelFor());
3095}
3096
3097void ASTStmtWriter::VisitOMPParallelGenericLoopDirective(
3098 OMPParallelGenericLoopDirective *D) {
3099 VisitOMPLoopDirective(D);
3101}
3102
3103void ASTStmtWriter::VisitOMPTargetParallelGenericLoopDirective(
3104 OMPTargetParallelGenericLoopDirective *D) {
3105 VisitOMPLoopDirective(D);
3107}
3108
3109//===----------------------------------------------------------------------===//
3110// OpenACC Constructs/Directives.
3111//===----------------------------------------------------------------------===//
3112void ASTStmtWriter::VisitOpenACCConstructStmt(OpenACCConstructStmt *S) {
3113 Record.push_back(S->clauses().size());
3114 Record.writeEnum(S->Kind);
3115 Record.AddSourceRange(S->Range);
3116 Record.AddSourceLocation(S->DirectiveLoc);
3117 Record.writeOpenACCClauseList(S->clauses());
3118}
3119
3120void ASTStmtWriter::VisitOpenACCAssociatedStmtConstruct(
3122 VisitOpenACCConstructStmt(S);
3123 Record.AddStmt(S->getAssociatedStmt());
3124}
3125
3126void ASTStmtWriter::VisitOpenACCComputeConstruct(OpenACCComputeConstruct *S) {
3127 VisitStmt(S);
3128 VisitOpenACCAssociatedStmtConstruct(S);
3130}
3131
3132void ASTStmtWriter::VisitOpenACCLoopConstruct(OpenACCLoopConstruct *S) {
3133 VisitStmt(S);
3134 VisitOpenACCAssociatedStmtConstruct(S);
3135 Record.writeEnum(S->getParentComputeConstructKind());
3137}
3138
3139void ASTStmtWriter::VisitOpenACCCombinedConstruct(OpenACCCombinedConstruct *S) {
3140 VisitStmt(S);
3141 VisitOpenACCAssociatedStmtConstruct(S);
3143}
3144
3145void ASTStmtWriter::VisitOpenACCDataConstruct(OpenACCDataConstruct *S) {
3146 VisitStmt(S);
3147 VisitOpenACCAssociatedStmtConstruct(S);
3149}
3150
3151void ASTStmtWriter::VisitOpenACCEnterDataConstruct(
3152 OpenACCEnterDataConstruct *S) {
3153 VisitStmt(S);
3154 VisitOpenACCConstructStmt(S);
3156}
3157
3158void ASTStmtWriter::VisitOpenACCExitDataConstruct(OpenACCExitDataConstruct *S) {
3159 VisitStmt(S);
3160 VisitOpenACCConstructStmt(S);
3162}
3163
3164void ASTStmtWriter::VisitOpenACCInitConstruct(OpenACCInitConstruct *S) {
3165 VisitStmt(S);
3166 VisitOpenACCConstructStmt(S);
3168}
3169
3170void ASTStmtWriter::VisitOpenACCShutdownConstruct(OpenACCShutdownConstruct *S) {
3171 VisitStmt(S);
3172 VisitOpenACCConstructStmt(S);
3174}
3175
3176void ASTStmtWriter::VisitOpenACCSetConstruct(OpenACCSetConstruct *S) {
3177 VisitStmt(S);
3178 VisitOpenACCConstructStmt(S);
3180}
3181
3182void ASTStmtWriter::VisitOpenACCUpdateConstruct(OpenACCUpdateConstruct *S) {
3183 VisitStmt(S);
3184 VisitOpenACCConstructStmt(S);
3186}
3187
3188void ASTStmtWriter::VisitOpenACCHostDataConstruct(OpenACCHostDataConstruct *S) {
3189 VisitStmt(S);
3190 VisitOpenACCAssociatedStmtConstruct(S);
3192}
3193
3194void ASTStmtWriter::VisitOpenACCWaitConstruct(OpenACCWaitConstruct *S) {
3195 VisitStmt(S);
3196 Record.push_back(S->getExprs().size());
3197 VisitOpenACCConstructStmt(S);
3198 Record.AddSourceLocation(S->LParenLoc);
3199 Record.AddSourceLocation(S->RParenLoc);
3200 Record.AddSourceLocation(S->QueuesLoc);
3201
3202 for(Expr *E : S->getExprs())
3203 Record.AddStmt(E);
3204
3206}
3207
3208void ASTStmtWriter::VisitOpenACCAtomicConstruct(OpenACCAtomicConstruct *S) {
3209 VisitStmt(S);
3210 VisitOpenACCConstructStmt(S);
3211 Record.writeEnum(S->getAtomicKind());
3212 Record.AddStmt(S->getAssociatedStmt());
3213
3215}
3216
3217void ASTStmtWriter::VisitOpenACCCacheConstruct(OpenACCCacheConstruct *S) {
3218 VisitStmt(S);
3219 Record.push_back(S->getVarList().size());
3220 VisitOpenACCConstructStmt(S);
3221 Record.AddSourceRange(S->ParensLoc);
3222 Record.AddSourceLocation(S->ReadOnlyLoc);
3223
3224 for (Expr *E : S->getVarList())
3225 Record.AddStmt(E);
3227}
3228
3229//===----------------------------------------------------------------------===//
3230// HLSL Constructs/Directives.
3231//===----------------------------------------------------------------------===//
3232
3233void ASTStmtWriter::VisitHLSLOutArgExpr(HLSLOutArgExpr *S) {
3234 VisitExpr(S);
3235 Record.AddStmt(S->getOpaqueArgLValue());
3236 Record.AddStmt(S->getCastedTemporary());
3237 Record.AddStmt(S->getWritebackCast());
3238 Record.writeBool(S->isInOut());
3240}
3241
3242//===----------------------------------------------------------------------===//
3243// ASTWriter Implementation
3244//===----------------------------------------------------------------------===//
3245
3247 assert(!SwitchCaseIDs.contains(S) && "SwitchCase recorded twice");
3248 unsigned NextID = SwitchCaseIDs.size();
3249 SwitchCaseIDs[S] = NextID;
3250 return NextID;
3251}
3252
3254 assert(SwitchCaseIDs.contains(S) && "SwitchCase hasn't been seen yet");
3255 return SwitchCaseIDs[S];
3256}
3257
3259 SwitchCaseIDs.clear();
3260}
3261
3262/// Write the given substatement or subexpression to the
3263/// bitstream.
3264void ASTWriter::WriteSubStmt(ASTContext &Context, Stmt *S) {
3266 ASTStmtWriter Writer(Context, *this, Record);
3267 ++NumStatements;
3268
3269 if (!S) {
3270 Stream.EmitRecord(serialization::STMT_NULL_PTR, Record);
3271 return;
3272 }
3273
3274 llvm::DenseMap<Stmt *, uint64_t>::iterator I = SubStmtEntries.find(S);
3275 if (I != SubStmtEntries.end()) {
3276 Record.push_back(I->second);
3277 Stream.EmitRecord(serialization::STMT_REF_PTR, Record);
3278 return;
3279 }
3280
3281#ifndef NDEBUG
3282 assert(!ParentStmts.count(S) && "There is a Stmt cycle!");
3283
3284 struct ParentStmtInserterRAII {
3285 Stmt *S;
3286 llvm::DenseSet<Stmt *> &ParentStmts;
3287
3288 ParentStmtInserterRAII(Stmt *S, llvm::DenseSet<Stmt *> &ParentStmts)
3289 : S(S), ParentStmts(ParentStmts) {
3290 ParentStmts.insert(S);
3291 }
3292 ~ParentStmtInserterRAII() {
3293 ParentStmts.erase(S);
3294 }
3295 };
3296
3297 ParentStmtInserterRAII ParentStmtInserter(S, ParentStmts);
3298#endif
3299
3300 Writer.Visit(S);
3301
3302 uint64_t Offset = Writer.Emit();
3303 SubStmtEntries[S] = Offset;
3304}
3305
3306/// Flush all of the statements that have been added to the
3307/// queue via AddStmt().
3308void ASTRecordWriter::FlushStmts() {
3309 // We expect to be the only consumer of the two temporary statement maps,
3310 // assert that they are empty.
3311 assert(Writer->SubStmtEntries.empty() && "unexpected entries in sub-stmt map");
3312 assert(Writer->ParentStmts.empty() && "unexpected entries in parent stmt map");
3313
3314 for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) {
3315 Writer->WriteSubStmt(getASTContext(), StmtsToEmit[I]);
3316
3317 assert(N == StmtsToEmit.size() && "record modified while being written!");
3318
3319 // Note that we are at the end of a full expression. Any
3320 // expression records that follow this one are part of a different
3321 // expression.
3322 Writer->Stream.EmitRecord(serialization::STMT_STOP, ArrayRef<uint32_t>());
3323
3324 Writer->SubStmtEntries.clear();
3325 Writer->ParentStmts.clear();
3326 }
3327
3328 StmtsToEmit.clear();
3329}
3330
3331void ASTRecordWriter::FlushSubStmts() {
3332 // For a nested statement, write out the substatements in reverse order (so
3333 // that a simple stack machine can be used when loading), and don't emit a
3334 // STMT_STOP after each one.
3335 for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) {
3336 Writer->WriteSubStmt(getASTContext(), StmtsToEmit[N - I - 1]);
3337 assert(N == StmtsToEmit.size() && "record modified while being written!");
3338 }
3339
3340 StmtsToEmit.clear();
3341}
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.
bool isFailOnly() const
Return true if 'v' is updated only when the condition is evaluated false (compare capture only).
bool isPostfixUpdate() const
Return true if 'v' expression must be updated to original value of 'x', false if 'v' must be updated ...
bool isXLHSInRHSPart() const
Return true if helper update expression has form 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' and...
OpenMPDirectiveKind getCancelRegion() const
Get cancellation region for the current cancellation point.
OpenMPDirectiveKind getCancelRegion() const
Get cancellation region for the current cancellation point.
DeclarationNameInfo getDirectiveName() const
Return name of the directive.
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.
unsigned getNumGeneratedTopLevelLoops() const
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 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.
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:223
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:4425
SourceLocation getQuestionLoc() const
Definition Expr.h:4424
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition Expr.h:4594
SourceLocation getAmpAmpLoc() const
Definition Expr.h:4609
SourceLocation getLabelLoc() const
Definition Expr.h:4611
LabelDecl * getLabel() const
Definition Expr.h:4617
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Definition Expr.h:6071
Represents a loop initializing the elements of an array.
Definition Expr.h:6018
This class represents BOTH the OpenMP Array Section and OpenACC 'subarray', with a boolean differenti...
Definition Expr.h:7269
SourceLocation getRBracketLoc() const
Definition Expr.h:7384
Expr * getBase()
Get base of the array section.
Definition Expr.h:7347
Expr * getLength()
Get length of array section.
Definition Expr.h:7357
bool isOMPArraySection() const
Definition Expr.h:7343
Expr * getStride()
Get stride of array section.
Definition Expr.h:7361
SourceLocation getColonLocSecond() const
Definition Expr.h:7379
Expr * getLowerBound()
Get lower bound of array section.
Definition Expr.h:7351
SourceLocation getColonLocFirst() const
Definition Expr.h:7378
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition Expr.h:2765
SourceLocation getRBracketLoc() const
Definition Expr.h:2813
Expr * getLHS()
An array access can be written A[4] or 4[A] (both are equivalent).
Definition Expr.h:2794
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
Definition ExprCXX.h:3010
uint64_t getValue() const
Definition ExprCXX.h:3058
ArrayTypeTrait getTrait() const
Definition ExprCXX.h:3050
Expr * getDimensionExpression() const
Definition ExprCXX.h:3060
TypeSourceInfo * getQueriedTypeSourceInfo() const
Definition ExprCXX.h:3056
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Definition Expr.h:6783
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition Expr.h:6802
SourceLocation getBuiltinLoc() const
getBuiltinLoc - Return the location of the __builtin_astype token.
Definition Expr.h:6805
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
Definition Expr.h:6808
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
Definition Stmt.h:3289
bool isVolatile() const
Definition Stmt.h:3325
SourceLocation getAsmLoc() const
Definition Stmt.h:3319
unsigned getNumClobbers() const
Definition Stmt.h:3380
unsigned getNumOutputs() const
Definition Stmt.h:3348
unsigned getNumInputs() const
Definition Stmt.h:3370
bool isSimple() const
Definition Stmt.h:3322
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Definition Expr.h:6978
Expr ** getSubExprs()
Definition Expr.h:7053
SourceLocation getRParenLoc() const
Definition Expr.h:7107
static unsigned getNumSubExprs(AtomicOp Op)
Determine the number of arguments the specified atomic builtin should have.
Definition Expr.cpp:5305
AtomicOp getOp() const
Definition Expr.h:7041
SourceLocation getBuiltinLoc() const
Definition Expr.h:7106
Represents an attribute applied to a statement.
Definition Stmt.h:2215
Stmt * getSubStmt()
Definition Stmt.h:2251
SourceLocation getAttrLoc() const
Definition Stmt.h:2246
ArrayRef< const Attr * > getAttrs() const
Definition Stmt.h:2247
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Definition Expr.h:4497
Expr * getFalseExpr() const
getFalseExpr - Return the subexpression which will be evaluated if the condition evaluates to false; ...
Definition Expr.h:4551
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
Definition Expr.h:4535
Expr * getCond() const
getCond - Return the condition expression; this is defined in terms of the opaque value.
Definition Expr.h:4539
Expr * getTrueExpr() const
getTrueExpr - Return the subexpression which will be evaluated if the condition evaluates to true; th...
Definition Expr.h:4544
Expr * getCommon() const
getCommon - Return the common expression, written to the left of the condition.
Definition Expr.h:4532
A builtin binary operation expression such as "x + y" or "x <= y".
Definition Expr.h:4082
Expr * getLHS() const
Definition Expr.h:4132
static OverloadedOperatorKind getOverloadedOperator(Opcode Opc)
Retrieve the overloaded operator kind that corresponds to the given binary opcode.
Definition Expr.cpp:2211
SourceLocation getOperatorLoc() const
Definition Expr.h:4124
bool hasStoredFPFeatures() const
Definition Expr.h:4267
Expr * getRHS() const
Definition Expr.h:4134
FPOptionsOverride getStoredFPFeatures() const
Get FPFeatures from trailing storage.
Definition Expr.h:4279
Opcode getOpcode() const
Definition Expr.h:4127
bool hasExcludedOverflowPattern() const
Definition Expr.h:4274
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:6722
const BlockDecl * getBlockDecl() const
Definition Expr.h:6734
BreakStmt - This represents a break.
Definition Stmt.h:3147
Represents a C++2a __builtin_bit_cast(T, v) expression.
Definition ExprCXX.h:5529
SourceLocation getEndLoc() const LLVM_READONLY
Definition ExprCXX.h:5548
SourceLocation getBeginLoc() const LLVM_READONLY
Definition ExprCXX.h:5547
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr....
Definition Expr.h:4013
SourceLocation getRParenLoc() const
Definition Expr.h:4048
SourceLocation getLParenLoc() const
Definition Expr.h:4045
Represents a call to a CUDA kernel function.
Definition ExprCXX.h:238
const CallExpr * getConfig() const
Definition ExprCXX.h:264
A C++ addrspace_cast expression (currently only enabled for OpenCL).
Definition ExprCXX.h:608
Represents binding an expression to a temporary.
Definition ExprCXX.h:1497
CXXTemporary * getTemporary()
Definition ExprCXX.h:1515
const Expr * getSubExpr() const
Definition ExprCXX.h:1519
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition ExprCXX.h:727
bool getValue() const
Definition ExprCXX.h:744
SourceLocation getLocation() const
Definition ExprCXX.h:750
CXXCatchStmt - This represents a C++ catch block.
Definition StmtCXX.h:29
SourceLocation getCatchLoc() const
Definition StmtCXX.h:49
Stmt * getHandlerBlock() const
Definition StmtCXX.h:52
VarDecl * getExceptionDecl() const
Definition StmtCXX.h:50
A C++ const_cast expression (C++ [expr.const.cast]).
Definition ExprCXX.h:570
Represents a call to a C++ constructor.
Definition ExprCXX.h:1552
SourceRange getParenOrBraceRange() const
Definition ExprCXX.h:1733
bool isElidable() const
Whether this construction is elidable.
Definition ExprCXX.h:1621
bool hadMultipleCandidates() const
Whether the referred constructor was resolved from an overloaded set having size greater than 1.
Definition ExprCXX.h:1626
Expr * getArg(unsigned Arg)
Return the specified argument.
Definition ExprCXX.h:1695
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
Definition ExprCXX.h:1645
bool isImmediateEscalating() const
Definition ExprCXX.h:1710
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called.
Definition ExprCXX.h:1654
SourceLocation getLocation() const
Definition ExprCXX.h:1617
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
Definition ExprCXX.h:1615
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
Definition ExprCXX.h:1634
unsigned getNumArgs() const
Return the number of arguments to the constructor call.
Definition ExprCXX.h:1692
CXXConstructionKind getConstructionKind() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
Definition ExprCXX.h:1663
A default argument (C++ [dcl.fct.default]).
Definition ExprCXX.h:1274
SourceLocation getUsedLocation() const
Retrieve the location where this default argument was actually used.
Definition ExprCXX.h:1348
const ParmVarDecl * getParam() const
Definition ExprCXX.h:1316
const DeclContext * getUsedContext() const
Definition ExprCXX.h:1344
bool hasRewrittenInit() const
Definition ExprCXX.h:1319
A use of a default initializer in a constructor or in aggregate initialization.
Definition ExprCXX.h:1381
const DeclContext * getUsedContext() const
Definition ExprCXX.h:1438
const Expr * getRewrittenExpr() const
Retrieve the initializing expression with evaluated immediate calls, if any.
Definition ExprCXX.h:1426
bool hasRewrittenInit() const
Definition ExprCXX.h:1410
FieldDecl * getField()
Get the field whose initializer will be used.
Definition ExprCXX.h:1415
Represents a delete expression for memory deallocation and destructor calls, e.g.
Definition ExprCXX.h:2630
FunctionDecl * getOperatorDelete() const
Definition ExprCXX.h:2669
bool isArrayForm() const
Definition ExprCXX.h:2656
SourceLocation getBeginLoc() const
Definition ExprCXX.h:2680
bool isGlobalDelete() const
Definition ExprCXX.h:2655
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
Definition ExprCXX.h:2665
bool isArrayFormAsWritten() const
Definition ExprCXX.h:2657
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition ExprCXX.h:3923
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '.
Definition ExprCXX.h:4022
SourceLocation getOperatorLoc() const
Retrieve the location of the '->' or '.' operator.
Definition ExprCXX.h:4025
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition ExprCXX.h:4117
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:4049
Expr * getBase() const
Retrieve the base object of this member expressions, e.g., the x in x.m.
Definition ExprCXX.h:4013
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the member name, with source location information.
Definition ExprCXX.h:4036
bool isImplicitAccess() const
True if this is an implicit access, i.e.
Definition ExprCXX.h:4005
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Definition ExprCXX.h:485
Helper that selects an expression from an InitListExpr depending on the current expansion index.
Definition ExprCXX.h:5611
InitListExpr * getRangeExpr()
Definition ExprCXX.h:5621
Represents the code generated for an expanded expansion statement.
Definition StmtCXX.h:1028
ArrayRef< Stmt * > getInstantiations() const
Definition StmtCXX.h:1069
bool shouldApplyLifetimeExtensionToPreamble() const
Definition StmtCXX.h:1077
CXXExpansionStmtDecl * getParent()
Definition StmtCXX.h:1088
ArrayRef< Stmt * > getPreambleStmts() const
Definition StmtCXX.h:1073
ArrayRef< Stmt * > getAllSubStmts() const
Definition StmtCXX.h:1057
CXXExpansionStmtPattern - Represents an unexpanded C++ expansion statement.
Definition StmtCXX.h:675
ExpansionStmtKind getKind() const
Definition StmtCXX.h:774
SourceLocation getRParenLoc() const
Definition StmtCXX.h:768
SourceLocation getColonLoc() const
Definition StmtCXX.h:767
CXXExpansionStmtDecl * getDecl()
Definition StmtCXX.h:791
SourceLocation getLParenLoc() const
Definition StmtCXX.h:766
Represents a folding of a pack over an operator.
Definition ExprCXX.h:5085
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
Definition StmtCXX.h:136
DeclStmt * getBeginStmt()
Definition StmtCXX.h:164
DeclStmt * getLoopVarStmt()
Definition StmtCXX.h:170
DeclStmt * getEndStmt()
Definition StmtCXX.h:167
SourceLocation getForLoc() const
Definition StmtCXX.h:203
DeclStmt * getRangeStmt()
Definition StmtCXX.h:163
SourceLocation getRParenLoc() const
Definition StmtCXX.h:206
SourceLocation getColonLoc() const
Definition StmtCXX.h:205
SourceLocation getCoawaitLoc() const
Definition StmtCXX.h:204
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr....
Definition ExprCXX.h:1835
SourceLocation getLParenLoc() const
Definition ExprCXX.h:1872
SourceLocation getRParenLoc() const
Definition ExprCXX.h:1874
Represents a call to an inherited base class constructor from an inheriting constructor.
Definition ExprCXX.h:1755
bool constructsVBase() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
Definition ExprCXX.h:1796
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will call.
Definition ExprCXX.h:1792
SourceLocation getLocation() const LLVM_READONLY
Definition ExprCXX.h:1808
bool inheritedFromVBase() const
Determine whether the inherited constructor is inherited from a virtual base of the object we constru...
Definition ExprCXX.h:1806
Represents a call to a member function that may be written either with member call syntax (e....
Definition ExprCXX.h:183
Abstract class common to all of the C++ "named"/"keyword" casts.
Definition ExprCXX.h:379
SourceLocation getOperatorLoc() const
Retrieve the location of the cast operator keyword, e.g., static_cast.
Definition ExprCXX.h:410
SourceRange getAngleBrackets() const LLVM_READONLY
Definition ExprCXX.h:417
SourceLocation getRParenLoc() const
Retrieve the location of the closing parenthesis.
Definition ExprCXX.h:413
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Definition ExprCXX.h:2359
bool isArray() const
Definition ExprCXX.h:2468
SourceRange getDirectInitRange() const
Definition ExprCXX.h:2613
ExprIterator arg_iterator
Definition ExprCXX.h:2573
ImplicitAllocationParameters implicitAllocationParameters() const
Provides the full set of information about expected implicit parameters in this call.
Definition ExprCXX.h:2566
bool hasInitializer() const
Whether this new-expression has any initializer at all.
Definition ExprCXX.h:2528
FunctionDecl * getOperatorDelete() const
Definition ExprCXX.h:2465
unsigned getNumPlacementArgs() const
Definition ExprCXX.h:2498
TypeSourceInfo * getAllocatedTypeSourceInfo() const
Definition ExprCXX.h:2442
SourceRange getSourceRange() const
Definition ExprCXX.h:2614
SourceRange getTypeIdParens() const
Definition ExprCXX.h:2520
bool isParenTypeId() const
Definition ExprCXX.h:2519
raw_arg_iterator raw_arg_end()
Definition ExprCXX.h:2600
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
Definition ExprCXX.h:2560
raw_arg_iterator raw_arg_begin()
Definition ExprCXX.h:2599
FunctionDecl * getOperatorNew() const
Definition ExprCXX.h:2463
bool isGlobalNew() const
Definition ExprCXX.h:2525
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition ExprCXX.h:4362
bool getValue() const
Definition ExprCXX.h:4385
Expr * getOperand() const
Definition ExprCXX.h:4379
SourceRange getSourceRange() const
Definition ExprCXX.h:4383
The null pointer literal (C++11 [lex.nullptr])
Definition ExprCXX.h:772
SourceLocation getLocation() const
Definition ExprCXX.h:786
A call to an overloaded operator written using operator syntax.
Definition ExprCXX.h:85
bool isReversed() const
Whether this is a C++20 rewritten reversed operator.
Definition ExprCXX.h:146
OverloadedOperatorKind getOperator() const
Returns the kind of overloaded operator that this expression refers to.
Definition ExprCXX.h:115
Represents a list-initialization with parenthesis.
Definition ExprCXX.h:5194
SourceLocation getEndLoc() const LLVM_READONLY
Definition ExprCXX.h:5250
SourceLocation getInitLoc() const LLVM_READONLY
Definition ExprCXX.h:5252
MutableArrayRef< Expr * > getInitExprs()
Definition ExprCXX.h:5234
SourceLocation getBeginLoc() const LLVM_READONLY
Definition ExprCXX.h:5248
MutableArrayRef< Expr * > getUserSpecifiedInitExprs()
Definition ExprCXX.h:5240
FieldDecl * getInitializedFieldInUnion()
Definition ExprCXX.h:5272
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition ExprCXX.h:2749
TypeSourceInfo * getDestroyedTypeInfo() const
Retrieve the source location information for the type being destroyed.
Definition ExprCXX.h:2843
bool isArrow() const
Determine whether this pseudo-destructor expression was written using an '->' (otherwise,...
Definition ExprCXX.h:2813
TypeSourceInfo * getScopeTypeInfo() const
Retrieve the scope type in a qualified pseudo-destructor expression.
Definition ExprCXX.h:2827
SourceLocation getTildeLoc() const
Retrieve the location of the '~'.
Definition ExprCXX.h:2834
NestedNameSpecifierLoc getQualifierLoc() const
Retrieves the nested-name-specifier that qualifies the type name, with source-location information.
Definition ExprCXX.h:2802
SourceLocation getDestroyedTypeLoc() const
Retrieve the starting location of the type being destroyed.
Definition ExprCXX.h:2858
SourceLocation getColonColonLoc() const
Retrieve the location of the '::' in a qualified pseudo-destructor expression.
Definition ExprCXX.h:2831
SourceLocation getOperatorLoc() const
Retrieve the location of the '.' or '->' operator.
Definition ExprCXX.h:2816
const IdentifierInfo * getDestroyedTypeIdentifier() const
In a dependent pseudo-destructor expression for which we do not have full type information on the des...
Definition ExprCXX.h:2850
Represents a C++26 reflect expression [expr.reflect].
Definition ExprCXX.h:5561
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
Definition ExprCXX.h:530
A rewritten comparison expression that was originally written using operator syntax.
Definition ExprCXX.h:290
Expr * getSemanticForm()
Get an equivalent semantic form for this expression.
Definition ExprCXX.h:308
bool isReversed() const
Determine whether this expression was rewritten in reverse form.
Definition ExprCXX.h:326
An expression "T()" which creates an rvalue of a non-class type T.
Definition ExprCXX.h:2200
TypeSourceInfo * getTypeSourceInfo() const
Definition ExprCXX.h:2219
SourceLocation getRParenLoc() const
Definition ExprCXX.h:2223
A C++ static_cast expression (C++ [expr.static.cast]).
Definition ExprCXX.h:440
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition ExprCXX.h:804
Represents a C++ functional cast expression that builds a temporary object.
Definition ExprCXX.h:1903
TypeSourceInfo * getTypeSourceInfo() const
Definition ExprCXX.h:1932
Represents the this expression in C++.
Definition ExprCXX.h:1158
bool isCapturedByCopyInLambdaWithExplicitObjectParameter() const
Definition ExprCXX.h:1184
bool isImplicit() const
Definition ExprCXX.h:1181
SourceLocation getLocation() const
Definition ExprCXX.h:1175
A C++ throw-expression (C++ [except.throw]).
Definition ExprCXX.h:1212
const Expr * getSubExpr() const
Definition ExprCXX.h:1232
SourceLocation getThrowLoc() const
Definition ExprCXX.h:1235
bool isThrownVariableInScope() const
Determines whether the variable thrown by this expression (if any!) is within the innermost try block...
Definition ExprCXX.h:1242
CXXTryStmt - A C++ try block, including all handlers.
Definition StmtCXX.h:70
SourceLocation getTryLoc() const
Definition StmtCXX.h:96
CXXCatchStmt * getHandler(unsigned i)
Definition StmtCXX.h:109
unsigned getNumHandlers() const
Definition StmtCXX.h:108
CompoundStmt * getTryBlock()
Definition StmtCXX.h:101
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition ExprCXX.h:852
bool isTypeOperand() const
Definition ExprCXX.h:888
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition ExprCXX.h:895
Expr * getExprOperand() const
Definition ExprCXX.h:899
SourceRange getSourceRange() const LLVM_READONLY
Definition ExprCXX.h:906
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition ExprCXX.h:3797
SourceLocation getLParenLoc() const
Retrieve the location of the left parentheses ('(') that precedes the argument list.
Definition ExprCXX.h:3841
bool isListInitialization() const
Determine whether this expression models list-initialization.
Definition ExprCXX.h:3852
TypeSourceInfo * getTypeSourceInfo() const
Retrieve the type source information for the type being constructed.
Definition ExprCXX.h:3835
SourceLocation getRParenLoc() const
Retrieve the location of the right parentheses (')') that follows the argument list.
Definition ExprCXX.h:3846
unsigned getNumArgs() const
Retrieve the number of arguments.
Definition ExprCXX.h:3855
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
Definition ExprCXX.h:1072
Expr * getExprOperand() const
Definition ExprCXX.h:1113
MSGuidDecl * getGuidDecl() const
Definition ExprCXX.h:1118
bool isTypeOperand() const
Definition ExprCXX.h:1102
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition ExprCXX.h:1109
SourceRange getSourceRange() const LLVM_READONLY
Definition ExprCXX.h:1122
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition Expr.h:2987
bool hasStoredFPFeatures() const
Definition Expr.h:3146
bool usesMemberSyntax() const
Definition Expr.h:3148
ExprIterator arg_iterator
Definition Expr.h:3234
arg_iterator arg_begin()
Definition Expr.h:3244
arg_iterator arg_end()
Definition Expr.h:3247
ADLCallKind getADLCallKind() const
Definition Expr.h:3138
Expr * getCallee()
Definition Expr.h:3134
FPOptionsOverride getFPFeatures() const
Definition Expr.h:3286
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition Expr.h:3178
bool isCoroElideSafe() const
Definition Expr.h:3161
SourceLocation getRParenLoc() const
Definition Expr.h:3318
This captures a statement into a function.
Definition Stmt.h:3949
capture_init_range capture_inits()
Definition Stmt.h:4117
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:4100
const RecordDecl * getCapturedRecordDecl() const
Retrieve the record declaration for captured variables.
Definition Stmt.h:4070
Stmt * getCapturedStmt()
Retrieve the statement being captured.
Definition Stmt.h:4053
capture_iterator capture_begin()
Retrieve an iterator pointing to the first capture.
Definition Stmt.h:4095
capture_range captures()
Definition Stmt.h:4087
CapturedRegionKind getCapturedRegionKind() const
Retrieve the captured region kind.
Definition Stmt.cpp:1508
CaseStmt - Represent a case statement.
Definition Stmt.h:1932
Stmt * getSubStmt()
Definition Stmt.h:2045
Expr * getLHS()
Definition Stmt.h:2015
bool caseStmtIsGNURange() const
True if this case statement is of the form case LHS ... RHS, which is a GNU extension.
Definition Stmt.h:1995
SourceLocation getEllipsisLoc() const
Get the location of the ... in a case statement of the form LHS ... RHS.
Definition Stmt.h:2001
Expr * getRHS()
Definition Stmt.h:2027
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition Expr.h:3720
path_iterator path_begin()
Definition Expr.h:3790
unsigned path_size() const
Definition Expr.h:3789
CastKind getCastKind() const
Definition Expr.h:3764
bool hasStoredFPFeatures() const
Definition Expr.h:3819
path_iterator path_end()
Definition Expr.h:3791
CXXBaseSpecifier ** path_iterator
Definition Expr.h:3786
FPOptionsOverride getFPFeatures() const
Definition Expr.h:3840
Expr * getSubExpr()
Definition Expr.h:3770
SourceLocation getLocation() const
Definition Expr.h:1641
unsigned getValue() const
Definition Expr.h:1649
CharacterLiteralKind getKind() const
Definition Expr.h:1642
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition Expr.h:4892
SourceLocation getBuiltinLoc() const
Definition Expr.h:4939
Expr * getLHS() const
Definition Expr.h:4934
bool isConditionDependent() const
Definition Expr.h:4922
bool isConditionTrue() const
isConditionTrue - Return whether the condition is true (i.e.
Definition Expr.h:4915
Expr * getRHS() const
Definition Expr.h:4936
SourceLocation getRParenLoc() const
Definition Expr.h:4942
Expr * getCond() const
Definition Expr.h:4932
Represents a 'co_await' expression.
Definition ExprCXX.h:5422
bool isImplicit() const
Definition ExprCXX.h:5444
CompoundAssignOperator - For compound assignments (e.g.
Definition Expr.h:4344
QualType getComputationLHSType() const
Definition Expr.h:4378
QualType getComputationResultType() const
Definition Expr.h:4381
CompoundLiteralExpr - [C99 6.5.2.5].
Definition Expr.h:3649
SourceLocation getLParenLoc() const
Definition Expr.h:3684
bool isFileScope() const
Definition Expr.h:3681
const Expr * getInitializer() const
Definition Expr.h:3677
TypeSourceInfo * getTypeSourceInfo() const
Definition Expr.h:3687
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition Stmt.h:1752
unsigned size() const
Definition Stmt.h:1797
FPOptionsOverride getStoredFPFeatures() const
Get FPOptionsOverride from trailing storage.
Definition Stmt.h:1802
body_range body()
Definition Stmt.h:1815
SourceLocation getLBracLoc() const
Definition Stmt.h:1869
bool hasStoredFPFeatures() const
Definition Stmt.h:1799
SourceLocation getRBracLoc() const
Definition Stmt.h:1870
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:4435
Expr * getLHS() const
Definition Expr.h:4469
Expr * getCond() const
getCond - Return the expression representing the condition for the ?
Definition Expr.h:4458
Expr * getRHS() const
Definition Expr.h:4470
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition Expr.h:1102
ConstantResultStorageKind getResultStorageKind() const
Definition Expr.h:1171
ContinueStmt - This represents a continue.
Definition Stmt.h:3131
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition Expr.h:4763
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
Definition Expr.h:4867
SourceLocation getBuiltinLoc() const
getBuiltinLoc - Return the location of the __builtin_convertvector token.
Definition Expr.h:4864
FPOptionsOverride getStoredFPFeatures() const
Get FPFeatures from trailing storage.
Definition Expr.h:4826
TypeSourceInfo * getTypeSourceInfo() const
getTypeSourceInfo - Return the destination type.
Definition Expr.h:4856
bool hasStoredFPFeatures() const
Is FPFeatures in Trailing Storage?
Definition Expr.h:4821
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition Expr.h:4853
Represents a 'co_return' statement in the C++ Coroutines TS.
Definition StmtCXX.h:474
Expr * getOperand() const
Retrieve the operand of the 'co_return' statement.
Definition StmtCXX.h:498
Expr * getPromiseCall() const
Retrieve the promise call that results from this 'co_return' statement.
Definition StmtCXX.h:503
bool isImplicit() const
Definition StmtCXX.h:507
SourceLocation getKeywordLoc() const
Definition StmtCXX.h:494
Represents the body of a coroutine.
Definition StmtCXX.h:321
child_range children()
Definition StmtCXX.h:436
ArrayRef< Stmt const * > getParamMoves() const
Definition StmtCXX.h:424
Represents an expression that might suspend coroutine execution; either a co_await or co_yield expres...
Definition ExprCXX.h:5308
SourceLocation getKeywordLoc() const
Definition ExprCXX.h:5399
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
Definition ExprCXX.h:5362
Represents a 'co_yield' expression.
Definition ExprCXX.h:5503
NamedDecl * getDecl() const
AccessSpecifier getAccess() const
DeclContext * getParent()
getParent - Returns the containing DeclContext.
Definition DeclBase.h:2126
bool isFileContext() const
Definition DeclBase.h:2197
iterator begin()
Definition DeclGroup.h:95
A reference to a declared variable, function, enum, etc.
Definition Expr.h:1290
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition Expr.h:1465
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
Definition Expr.h:1401
bool refersToEnclosingVariableOrCapture() const
Does this DeclRefExpr refer to an enclosing local or a captured variable?
Definition Expr.h:1494
bool hasTemplateKWAndArgsInfo() const
Definition Expr.h:1411
bool hasQualifier() const
Determine whether this declaration reference was preceded by a C++ nested-name-specifier,...
Definition Expr.h:1379
NestedNameSpecifierLoc getQualifierLoc() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name,...
Definition Expr.h:1383
ValueDecl * getDecl()
Definition Expr.h:1358
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
Definition Expr.h:1488
bool hadMultipleCandidates() const
Returns true if this expression refers to a function that was resolved from an overloaded set having ...
Definition Expr.h:1477
SourceLocation getLocation() const
Definition Expr.h:1366
bool isImmediateEscalating() const
Definition Expr.h:1498
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
Definition Stmt.h:1643
SourceLocation getEndLoc() const
Definition Stmt.h:1666
const DeclGroupRef getDeclGroup() const
Definition Stmt.h:1661
SourceLocation getBeginLoc() const LLVM_READONLY
Definition Stmt.h:1669
NameKind
The kind of the name stored in this DeclarationName.
Stmt * getSubStmt()
Definition Stmt.h:2093
DeferStmt - This represents a deferred statement.
Definition Stmt.h:3248
Stmt * getBody()
Definition Stmt.h:3267
SourceLocation getDeferLoc() const
Definition Stmt.h:3262
Represents a 'co_await' expression while the type of the promise is dependent.
Definition ExprCXX.h:5454
SourceLocation getKeywordLoc() const
Definition ExprCXX.h:5483
A qualified reference to a name whose declaration cannot yet be resolved.
Definition ExprCXX.h:3563
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source location information.
Definition ExprCXX.h:3611
A template-id naming a variable template or a concept through a template template parameter.
Definition ExprCXX.h:3479
const DeclarationNameInfo & getNameInfo() const
Definition ExprCXX.h:3503
TemplateName getTemplateName() const
Definition ExprCXX.h:3507
unsigned getNumTemplateArgs() const
Definition ExprCXX.h:3522
Represents a C99 designated initializer expression.
Definition Expr.h:5601
Expr * getSubExpr(unsigned Idx) const
Definition Expr.h:5883
bool usesGNUSyntax() const
Determines whether this designated initializer used the deprecated GNU syntax for designated initiali...
Definition Expr.h:5865
MutableArrayRef< Designator > designators()
Definition Expr.h:5834
SourceLocation getEqualOrColonLoc() const
Retrieve the location of the '=' that precedes the initializer value itself, if present.
Definition Expr.h:5856
unsigned getNumSubExprs() const
Retrieve the total number of subexpressions in this designated initializer expression,...
Definition Expr.h:5881
InitListExpr * getUpdater() const
Definition Expr.h:5986
DoStmt - This represents a 'do/while' stmt.
Definition Stmt.h:2844
Stmt * getBody()
Definition Stmt.h:2869
Expr * getCond()
Definition Stmt.h:2862
SourceLocation getWhileLoc() const
Definition Stmt.h:2875
SourceLocation getDoLoc() const
Definition Stmt.h:2873
SourceLocation getRParenLoc() const
Definition Stmt.h:2877
IdentifierInfo & getAccessor() const
Definition Expr.h:6635
const Expr * getBase() const
Definition Expr.h:6631
SourceLocation getAccessorLoc() const
Definition Expr.h:6638
Represents a reference to emded data.
Definition Expr.h:5179
unsigned getStartingElementPos() const
Definition Expr.h:5200
StringLiteral * getDataStringLiteral() const
Definition Expr.h:5196
SourceLocation getBeginLoc() const
Definition Expr.h:5193
size_t getDataElementCount() const
Definition Expr.h:5201
ExplicitCastExpr - An explicit cast written in the source code.
Definition Expr.h:3972
TypeSourceInfo * getTypeInfoAsWritten() const
getTypeInfoAsWritten - Returns the type source info for the type that this expression is casting to.
Definition Expr.h:3994
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition ExprCXX.h:3714
bool cleanupsHaveSideEffects() const
Definition ExprCXX.h:3749
ArrayRef< CleanupObject > getObjects() const
Definition ExprCXX.h:3738
unsigned getNumObjects() const
Definition ExprCXX.h:3742
This represents one expression.
Definition Expr.h:113
bool isValueDependent() const
Determines whether the value of this expression depends on.
Definition Expr.h:178
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
Definition Expr.h:448
bool isTypeDependent() const
Determines whether the type of this expression depends on.
Definition Expr.h:195
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
Definition Expr.h:455
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
Definition Expr.cpp:283
QualType getType() const
Definition Expr.h:145
ExprDependence getDependence() const
Definition Expr.h:165
An expression trait intrinsic.
Definition ExprCXX.h:3083
Expr * getQueriedExpression() const
Definition ExprCXX.h:3122
ExpressionTrait getTrait() const
Definition ExprCXX.h:3118
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition Expr.h:6660
storage_type getAsOpaqueInt() const
SourceLocation getLocation() const
Retrieve the location of the literal.
Definition Expr.h:1601
unsigned getScale() const
Definition Expr.h:1605
llvm::APInt getValue() const
Returns an internal integer representation of the literal.
Definition Expr.h:1595
SourceLocation getLocation() const
Definition Expr.h:1727
llvm::APFloatBase::Semantics getRawSemantics() const
Get a raw enumeration value representing the floating-point semantics of this literal (32-bit IEEE,...
Definition Expr.h:1696
llvm::APFloat getValue() const
Definition Expr.h:1686
bool isExact() const
Definition Expr.h:1719
ForStmt - This represents a 'for (init;cond;inc)' stmt.
Definition Stmt.h:2900
Stmt * getInit()
Definition Stmt.h:2915
SourceLocation getRParenLoc() const
Definition Stmt.h:2960
Stmt * getBody()
Definition Stmt.h:2944
Expr * getInc()
Definition Stmt.h:2943
SourceLocation getForLoc() const
Definition Stmt.h:2956
Expr * getCond()
Definition Stmt.h:2942
SourceLocation getLParenLoc() const
Definition Stmt.h:2958
DeclStmt * getConditionVariableDeclStmt()
If this ForStmt has a condition variable, return the faux DeclStmt associated with the creation of th...
Definition Stmt.h:2930
const Expr * getSubExpr() const
Definition Expr.h:1082
Represents a reference to a function parameter pack, init-capture pack, or binding pack that has been...
Definition ExprCXX.h:4894
ValueDecl *const * iterator
Iterators over the parameters which the parameter pack expanded into.
Definition ExprCXX.h:4927
ValueDecl * getParameterPack() const
Get the parameter pack which this expression refers to.
Definition ExprCXX.h:4920
iterator end() const
Definition ExprCXX.h:4929
unsigned getNumExpansions() const
Get the number of parameters in this parameter pack.
Definition ExprCXX.h:4932
SourceLocation getParameterPackLocation() const
Get the location of the parameter pack.
Definition ExprCXX.h:4923
iterator begin() const
Definition ExprCXX.h:4928
This represents a GCC inline-assembly statement extension.
Definition Stmt.h:3458
unsigned getNumLabels() const
Definition Stmt.h:3608
SourceLocation getRParenLoc() const
Definition Stmt.h:3480
IdentifierInfo * getInputIdentifier(unsigned i) const
Definition Stmt.h:3573
const Expr * getOutputConstraintExpr(unsigned i) const
Definition Stmt.h:3560
IdentifierInfo * getLabelIdentifier(unsigned i) const
Definition Stmt.h:3612
const Expr * getInputConstraintExpr(unsigned i) const
Definition Stmt.h:3586
IdentifierInfo * getOutputIdentifier(unsigned i) const
Definition Stmt.h:3549
const Expr * getAsmStringExpr() const
Definition Stmt.h:3485
Expr * getOutputExpr(unsigned i)
Definition Stmt.cpp:582
Expr * getClobberExpr(unsigned i)
Definition Stmt.h:3665
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:4967
SourceLocation getTokenLocation() const
getTokenLocation - The location of the __null token.
Definition Expr.h:4981
Represents a C11 generic selection.
Definition Expr.h:6232
unsigned getNumAssocs() const
The number of association expressions.
Definition Expr.h:6474
bool isExprPredicate() const
Whether this generic selection uses an expression as its controlling argument.
Definition Expr.h:6490
SourceLocation getGenericLoc() const
Definition Expr.h:6587
SourceLocation getRParenLoc() const
Definition Expr.h:6591
SourceLocation getDefaultLoc() const
Definition Expr.h:6590
GotoStmt - This represents a direct goto.
Definition Stmt.h:2981
SourceLocation getLabelLoc() const
Definition Stmt.h:2999
SourceLocation getGotoLoc() const
Definition Stmt.h:2997
LabelDecl * getLabel() const
Definition Stmt.h:2994
This class represents temporary values used to represent inout and out arguments in HLSL.
Definition Expr.h:7447
const OpaqueValueExpr * getCastedTemporary() const
Definition Expr.h:7498
const OpaqueValueExpr * getOpaqueArgLValue() const
Definition Expr.h:7479
bool isInOut() const
returns true if the parameter is inout and false if the parameter is out.
Definition Expr.h:7506
const Expr * getWritebackCast() const
Definition Expr.h:7493
IfStmt - This represents an if/then/else.
Definition Stmt.h:2271
Stmt * getThen()
Definition Stmt.h:2360
SourceLocation getIfLoc() const
Definition Stmt.h:2437
IfStatementKind getStatementKind() const
Definition Stmt.h:2472
SourceLocation getElseLoc() const
Definition Stmt.h:2440
Stmt * getInit()
Definition Stmt.h:2421
SourceLocation getLParenLoc() const
Definition Stmt.h:2489
Expr * getCond()
Definition Stmt.h:2348
Stmt * getElse()
Definition Stmt.h:2369
DeclStmt * getConditionVariableDeclStmt()
If this IfStmt has a condition variable, return the faux DeclStmt associated with the creation of tha...
Definition Stmt.h:2404
SourceLocation getRParenLoc() const
Definition Stmt.h:2491
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1....
Definition Expr.h:1751
const Expr * getSubExpr() const
Definition Expr.h:1763
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition Expr.h:3897
bool isPartOfExplicitCast() const
Definition Expr.h:3928
Represents an implicitly-generated value initialization of an object of a given type.
Definition Expr.h:6107
IndirectGotoStmt - This represents an indirect goto.
Definition Stmt.h:3020
SourceLocation getGotoLoc() const
Definition Stmt.h:3036
SourceLocation getStarLoc() const
Definition Stmt.h:3038
Describes an C or C++ initializer list.
Definition Expr.h:5352
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
Definition Expr.h:5479
unsigned getNumInits() const
Definition Expr.h:5385
SourceLocation getLBraceLoc() const
Definition Expr.h:5510
InitListExpr * getSyntacticForm() const
Definition Expr.h:5522
bool hadArrayRangeDesignator() const
Definition Expr.h:5533
Expr * getArrayFiller()
If this initializer list initializes an array with more elements than there are initializers in the l...
Definition Expr.h:5455
bool isExplicit() const
Definition Expr.h:5495
SourceLocation getRBraceLoc() const
Definition Expr.h:5512
const Expr * getInit(unsigned Init) const
Definition Expr.h:5407
SourceLocation getLocation() const
Retrieve the location of the literal.
Definition Expr.h:1556
LabelStmt - Represents a label, which has a substatement.
Definition Stmt.h:2158
LabelDecl * getDecl() const
Definition Stmt.h:2176
bool isSideEntry() const
Definition Stmt.h:2205
Stmt * getSubStmt()
Definition Stmt.h:2180
SourceLocation getIdentLoc() const
Definition Stmt.h:2173
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition ExprCXX.h:1972
Expr ** capture_init_iterator
Iterator that walks over the capture initialization arguments.
Definition ExprCXX.h:2079
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument for this lambda expression.
Definition ExprCXX.h:2110
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
Definition ExprCXX.h:2098
Base class for BreakStmt and ContinueStmt.
Definition Stmt.h:3069
SourceLocation getLabelLoc() const
Definition Stmt.h:3104
LabelDecl * getLabelDecl()
Definition Stmt.h:3107
SourceLocation getKwLoc() const
Definition Stmt.h:3094
bool hasLabelTarget() const
Definition Stmt.h:3102
This represents a Microsoft inline-assembly statement extension.
Definition Stmt.h:3677
Token * getAsmToks()
Definition Stmt.h:3708
Expr * getOutputExpr(unsigned i)
Definition Stmt.cpp:919
StringRef getAsmString() const
Definition Stmt.h:3711
SourceLocation getLBraceLoc() const
Definition Stmt.h:3700
SourceLocation getEndLoc() const
Definition Stmt.h:3702
StringRef getInputConstraint(unsigned i) const
Definition Stmt.h:3731
StringRef getOutputConstraint(unsigned i) const
Definition Stmt.h:3718
StringRef getClobber(unsigned i) const
Definition Stmt.h:3755
unsigned getNumAsmToks()
Definition Stmt.h:3707
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:254
bool isIfExists() const
Determine whether this is an __if_exists statement.
Definition StmtCXX.h:279
DeclarationNameInfo getNameInfo() const
Retrieve the name of the entity we're testing for, along with location information.
Definition StmtCXX.h:290
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies this name, if any.
Definition StmtCXX.h:286
CompoundStmt * getSubStmt() const
Retrieve the compound statement that will be included in the program only if the existence of the sym...
Definition StmtCXX.h:294
SourceLocation getKeywordLoc() const
Retrieve the location of the __if_exists or __if_not_exists keyword.
Definition StmtCXX.h:276
A member reference to an MSPropertyDecl.
Definition ExprCXX.h:940
NestedNameSpecifierLoc getQualifierLoc() const
Definition ExprCXX.h:996
bool isArrow() const
Definition ExprCXX.h:994
MSPropertyDecl * getPropertyDecl() const
Definition ExprCXX.h:993
Expr * getBaseExpr() const
Definition ExprCXX.h:992
SourceLocation getMemberLoc() const
Definition ExprCXX.h:995
MS property subscript expression.
Definition ExprCXX.h:1010
SourceLocation getRBracketLoc() const
Definition ExprCXX.h:1047
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition ExprCXX.h:4973
Expr * getSubExpr() const
Retrieve the temporary-generating subexpression whose value will be materialized into a glvalue.
Definition ExprCXX.h:4990
LifetimeExtendedTemporaryDecl * getLifetimeExtendedTemporaryDecl()
Definition ExprCXX.h:5013
MatrixSingleSubscriptExpr - Matrix single subscript expression for the MatrixType extension when you ...
Definition Expr.h:2839
SourceLocation getRBracketLoc() const
Definition Expr.h:2883
MatrixSubscriptExpr - Matrix subscript expression for the MatrixType extension.
Definition Expr.h:2909
SourceLocation getRBracketLoc() const
Definition Expr.h:2961
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition Expr.h:3408
SourceLocation getMemberLoc() const
getMemberLoc - Return the location of the "member", in X->F, it is the location of 'F'.
Definition Expr.h:3597
SourceLocation getOperatorLoc() const
Definition Expr.h:3590
NestedNameSpecifierLoc getQualifierLoc() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name,...
Definition Expr.h:3510
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Definition Expr.h:3491
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
Definition Expr.h:3632
bool hasQualifier() const
Determines whether this member expression actually had a C++ nested-name-specifier prior to the name ...
Definition Expr.h:3505
Expr * getBase() const
Definition Expr.h:3485
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition Expr.h:3573
bool hadMultipleCandidates() const
Returns true if this member expression refers to a method that was resolved from an overloaded set ha...
Definition Expr.h:3612
bool isArrow() const
Definition Expr.h:3592
DeclAccessPair getFoundDecl() const
Retrieves the declaration found by lookup.
Definition Expr.h:3495
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition Decl.h:341
Represents a place-holder for an object not to be initialized by anything.
Definition Expr.h:5927
NullStmt - This is the null statement ";": C99 6.8.3p3.
Definition Stmt.h:1715
SourceLocation getSemiLoc() const
Definition Stmt.h:1726
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:5627
SourceLocation getColonLoc(unsigned I) const
Gets the location of the first ':' in the range for the given iterator definition.
Definition Expr.cpp:5621
SourceLocation getRParenLoc() const
Definition ExprOpenMP.h:245
IteratorRange getIteratorRange(unsigned I)
Gets the iterator range for the given iterator.
Definition Expr.cpp:5598
OMPIteratorHelperData & getHelper(unsigned I)
Fetches helper data for the specified iteration space.
Definition Expr.cpp:5637
SourceLocation getAssignLoc(unsigned I) const
Gets the location of '=' for the given iterator definition.
Definition Expr.cpp:5615
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:5594
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp,...
Definition ExprObjC.h:219
Expr * getElement(unsigned Index)
getElement - Return the Element at the specified index.
Definition ExprObjC.h:264
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c array literal.
Definition ExprObjC.h:256
SourceRange getSourceRange() const LLVM_READONLY
Definition ExprObjC.h:247
ObjCMethodDecl * getArrayWithObjectsMethod() const
Definition ExprObjC.h:273
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:1735
SourceRange getSourceRange() const
Definition ExprObjC.h:1754
VersionTuple getVersion() const
Definition ExprObjC.h:1758
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition ExprObjC.h:118
SourceLocation getLocation() const
Definition ExprObjC.h:137
ObjCBoxedExpr - used for generalized expression boxing.
Definition ExprObjC.h:158
SourceRange getSourceRange() const LLVM_READONLY
Definition ExprObjC.h:189
ObjCMethodDecl * getBoxingMethod() const
Definition ExprObjC.h:180
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers,...
Definition ExprObjC.h:1675
SourceLocation getLParenLoc() const
Definition ExprObjC.h:1698
SourceLocation getBridgeKeywordLoc() const
The location of the bridge keyword.
Definition ExprObjC.h:1709
ObjCBridgeCastKind getBridgeKind() const
Determine which kind of bridge is being performed via this cast.
Definition ExprObjC.h:1701
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
Definition ExprObjC.h:341
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c dictionary literal.
Definition ExprObjC.h:391
ObjCMethodDecl * getDictWithObjectsMethod() const
Definition ExprObjC.h:408
ObjCDictionaryElement getKeyValueElement(unsigned Index) const
Definition ExprObjC.h:393
SourceRange getSourceRange() const LLVM_READONLY
Definition ExprObjC.h:414
ObjCEncodeExpr, used for @encode in Objective-C.
Definition ExprObjC.h:440
TypeSourceInfo * getEncodedTypeSourceInfo() const
Definition ExprObjC.h:461
SourceLocation getRParenLoc() const
Definition ExprObjC.h:456
SourceLocation getAtLoc() const
Definition ExprObjC.h:454
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:1614
bool shouldCopy() const
shouldCopy - True if we should do the 'copy' part of the copy-restore.
Definition ExprObjC.h:1642
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC 'id' type.
Definition ExprObjC.h:1530
SourceLocation getIsaMemberLoc() const
getMemberLoc - Return the location of the "member", in X->F, it is the location of 'F'.
Definition ExprObjC.h:1562
SourceLocation getOpLoc() const
Definition ExprObjC.h:1565
Expr * getBase() const
Definition ExprObjC.h:1555
bool isArrow() const
Definition ExprObjC.h:1557
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition ExprObjC.h:581
SourceLocation getLocation() const
Definition ExprObjC.h:624
SourceLocation getOpLoc() const
Definition ExprObjC.h:632
ObjCIvarDecl * getDecl()
Definition ExprObjC.h:611
bool isArrow() const
Definition ExprObjC.h:619
bool isFreeIvar() const
Definition ExprObjC.h:620
const Expr * getBase() const
Definition ExprObjC.h:615
An expression that sends a message to the given Objective-C object or class.
Definition ExprObjC.h:972
bool isDelegateInitCall() const
isDelegateInitCall - Answers whether this message send has been tagged as a "delegate init call",...
Definition ExprObjC.h:1453
SourceLocation getLeftLoc() const
Definition ExprObjC.h:1456
Expr * getInstanceReceiver()
Returns the object expression (receiver) for an instance message, or null for a message that is not a...
Definition ExprObjC.h:1300
SourceLocation getSuperLoc() const
Retrieve the location of the 'super' keyword for a class or instance message to 'super',...
Definition ExprObjC.h:1341
Selector getSelector() const
Definition ExprObjC.cpp:301
@ SuperInstance
The receiver is the instance of the superclass object.
Definition ExprObjC.h:986
@ Instance
The receiver is an object instance.
Definition ExprObjC.h:980
@ SuperClass
The receiver is a superclass.
Definition ExprObjC.h:983
@ Class
The receiver is a class.
Definition ExprObjC.h:977
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:1328
QualType getSuperType() const
Retrieve the type referred to by 'super'.
Definition ExprObjC.h:1376
const ObjCMethodDecl * getMethodDecl() const
Definition ExprObjC.h:1396
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
Definition ExprObjC.h:1261
arg_iterator arg_begin()
Definition ExprObjC.h:1509
SourceLocation getRightLoc() const
Definition ExprObjC.h:1457
unsigned getNumArgs() const
Return the number of actual arguments in this message, not counting the receiver.
Definition ExprObjC.h:1422
arg_iterator arg_end()
Definition ExprObjC.h:1511
Base class for Objective-C object literals ("...", @42, @[],}).
Definition ExprObjC.h:50
bool isExpressibleAsConstantInitializer() const
Definition ExprObjC.h:67
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition ExprObjC.h:649
ObjCPropertyDecl * getExplicitProperty() const
Definition ExprObjC.h:738
ObjCMethodDecl * getImplicitPropertyGetter() const
Definition ExprObjC.h:743
SourceLocation getReceiverLocation() const
Definition ExprObjC.h:792
const Expr * getBase() const
Definition ExprObjC.h:787
bool isObjectReceiver() const
Definition ExprObjC.h:802
QualType getSuperReceiverType() const
Definition ExprObjC.h:794
bool isImplicitProperty() const
Definition ExprObjC.h:735
ObjCMethodDecl * getImplicitPropertySetter() const
Definition ExprObjC.h:748
ObjCInterfaceDecl * getClassReceiver() const
Definition ExprObjC.h:798
SourceLocation getLocation() const
Definition ExprObjC.h:790
bool isSuperReceiver() const
Definition ExprObjC.h:803
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition ExprObjC.h:537
ObjCProtocolDecl * getProtocol() const
Definition ExprObjC.h:554
SourceLocation getRParenLoc() const
Definition ExprObjC.h:559
SourceLocation getAtLoc() const
Definition ExprObjC.h:558
ObjCSelectorExpr used for @selector in Objective-C.
Definition ExprObjC.h:485
SourceLocation getSelectorNameLoc() const
Definition ExprObjC.h:503
SourceLocation getRParenLoc() const
Definition ExprObjC.h:504
Selector getSelector() const
Definition ExprObjC.h:499
SourceLocation getAtLoc() const
Definition ExprObjC.h:502
ObjCStringLiteral, used for Objective-C string literals i.e.
Definition ExprObjC.h:83
SourceLocation getAtLoc() const
Definition ExprObjC.h:99
StringLiteral * getString()
Definition ExprObjC.h:95
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition ExprObjC.h:871
Expr * getKeyExpr() const
Definition ExprObjC.h:913
Expr * getBaseExpr() const
Definition ExprObjC.h:910
ObjCMethodDecl * getAtIndexMethodDecl() const
Definition ExprObjC.h:916
SourceLocation getRBracket() const
Definition ExprObjC.h:901
ObjCMethodDecl * setAtIndexMethodDecl() const
Definition ExprObjC.h:920
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type,...
Definition Expr.h:2571
Expr * getIndexExpr(unsigned Idx)
Definition Expr.h:2630
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
Definition Expr.h:2604
const OffsetOfNode & getComponent(unsigned Idx) const
Definition Expr.h:2618
TypeSourceInfo * getTypeSourceInfo() const
Definition Expr.h:2611
unsigned getNumExpressions() const
Definition Expr.h:2642
SourceLocation getRParenLoc() const
Return the location of the right parentheses.
Definition Expr.h:2608
unsigned getNumComponents() const
Definition Expr.h:2626
const IdentifierInfo * getFieldName() const
For a field or identifier offsetof node, returns the name of the field.
Definition Expr.cpp:1718
unsigned getArrayExprIndex() const
For an array element node, returns the index into the array of expressions.
Definition Expr.h:2523
FieldDecl * getField() const
For a field offsetof node, returns the field.
Definition Expr.h:2529
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range that covers this offsetof node.
Definition Expr.h:2550
@ Array
An index into an array.
Definition Expr.h:2470
@ Identifier
A field in a dependent type, known only by its name.
Definition Expr.h:2474
@ Field
A field.
Definition Expr.h:2472
@ Base
An implicit indirection through a C++ base class, when the field found is in a base class.
Definition Expr.h:2477
Kind getKind() const
Determine what kind of offsetof node this is.
Definition Expr.h:2519
CXXBaseSpecifier * getBase() const
For a base class node, returns the base specifier.
Definition Expr.h:2539
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
Definition Expr.h:1198
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
Definition Expr.h:1248
SourceLocation getLocation() const
Retrieve the location of this expression.
Definition Expr.h:1220
bool isUnique() const
Definition Expr.h:1256
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:2134
SourceLocation getLocation() const
Definition Expr.h:2151
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:3142
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
Definition ExprCXX.h:4335
const DeclarationNameInfo & getNameInfo() const
Gets the full name info.
Definition ExprCXX.h:3249
UnresolvedSetImpl::iterator decls_iterator
Definition ExprCXX.h:3233
decls_iterator decls_begin() const
Definition ExprCXX.h:3235
unsigned getNumDecls() const
Gets the number of declarations in the unresolved set.
Definition ExprCXX.h:3246
NestedNameSpecifierLoc getQualifierLoc() const
Fetches the nested-name qualifier with source-location information, if one was given.
Definition ExprCXX.h:3264
TemplateArgumentLoc * getTrailingTemplateArgumentLoc()
Return the optional template arguments.
Definition ExprCXX.h:4345
bool hasTemplateKWAndArgsInfo() const
Definition ExprCXX.h:3186
decls_iterator decls_end() const
Definition ExprCXX.h:3238
DeclarationName getName() const
Gets the name looked up.
Definition ExprCXX.h:3252
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition ExprCXX.h:4416
Expr * getPattern()
Retrieve the pattern of the pack expansion.
Definition ExprCXX.h:4445
SourceLocation getEllipsisLoc() const
Retrieve the location of the ellipsis that describes this pack expansion.
Definition ExprCXX.h:4452
SourceLocation getEllipsisLoc() const
Determine the location of the 'sizeof' keyword.
Definition ExprCXX.h:4666
Expr * getIndexExpr() const
Definition ExprCXX.h:4681
ArrayRef< Expr * > getExpressions() const
Return the trailing expressions, regardless of the expansion.
Definition ExprCXX.h:4699
SourceLocation getRSquareLoc() const
Determine the location of the right parenthesis.
Definition ExprCXX.h:4672
Expr * getPackIdExpression() const
Definition ExprCXX.h:4677
ParenExpr - This represents a parenthesized expression, e.g.
Definition Expr.h:2226
SourceLocation getLParen() const
Get the location of the left parentheses '('.
Definition Expr.h:2251
const Expr * getSubExpr() const
Definition Expr.h:2243
bool isProducedByFoldExpansion() const
Definition Expr.h:2268
SourceLocation getRParen() const
Get the location of the right parentheses ')'.
Definition Expr.h:2255
ArrayRef< Expr * > exprs() const
Definition Expr.h:6177
unsigned getNumExprs() const
Return the number of expressions in this paren list.
Definition Expr.h:6160
SourceLocation getLParenLoc() const
Definition Expr.h:6179
SourceLocation getRParenLoc() const
Definition Expr.h:6180
[C99 6.4.2.2] - A predefined identifier such as func.
Definition Expr.h:2049
bool isTransparent() const
Definition Expr.h:2088
PredefinedIdentKind getIdentKind() const
Definition Expr.h:2084
SourceLocation getLocation() const
Definition Expr.h:2090
StringLiteral * getFunctionName()
Definition Expr.h:2093
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition Expr.h:6854
semantics_iterator semantics_end()
Definition Expr.h:6919
unsigned getResultExprIndex() const
Return the index of the result-bearing expression into the semantics expressions, or PseudoObjectExpr...
Definition Expr.h:6896
semantics_iterator semantics_begin()
Definition Expr.h:6915
Expr *const * semantics_iterator
Definition Expr.h:6913
unsigned getNumSemanticExprs() const
Definition Expr.h:6911
Expr * getSyntacticForm()
Return the syntactic form of this expression, i.e.
Definition Expr.h:6891
Frontend produces RecoveryExprs on semantic errors that prevent creating other well-formed expression...
Definition Expr.h:7553
SourceLocation getEndLoc() const
Definition Expr.h:7572
child_range children()
Definition Expr.h:7566
SourceLocation getBeginLoc() const
Definition Expr.h:7571
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:3172
SourceLocation getReturnLoc() const
Definition Stmt.h:3221
const VarDecl * getNRVOCandidate() const
Retrieve the variable that might be used for the named return value optimization.
Definition Stmt.h:3208
Expr * getRetValue()
Definition Stmt.h:3199
CompoundStmt * getBlock() const
Definition Stmt.h:3805
SourceLocation getExceptLoc() const
Definition Stmt.h:3798
Expr * getFilterExpr() const
Definition Stmt.h:3801
SourceLocation getFinallyLoc() const
Definition Stmt.h:3839
CompoundStmt * getBlock() const
Definition Stmt.h:3842
Represents a __leave statement.
Definition Stmt.h:3910
SourceLocation getLeaveLoc() const
Definition Stmt.h:3920
CompoundStmt * getTryBlock() const
Definition Stmt.h:3886
SourceLocation getTryLoc() const
Definition Stmt.h:3881
bool getIsCXXTry() const
Definition Stmt.h:3884
Stmt * getHandler() const
Definition Stmt.h:3890
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:2199
SourceLocation getLParenLocation() const
Definition Expr.h:2200
TypeSourceInfo * getTypeSourceInfo()
Definition Expr.h:2187
SourceLocation getRParenLocation() const
Definition Expr.h:2201
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition Expr.h:4687
SourceLocation getBuiltinLoc() const
Definition Expr.h:4704
unsigned getNumSubExprs() const
getNumSubExprs - Return the size of the SubExprs array.
Definition Expr.h:4720
SourceLocation getRParenLoc() const
Definition Expr.h:4707
Expr * getExpr(unsigned Index)
getExpr - Return the Expr at the specified index.
Definition Expr.h:4726
Represents an expression that computes the length of a parameter pack.
Definition ExprCXX.h:4494
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof... expression, such as is produced f...
Definition ExprCXX.h:4579
ArrayRef< TemplateArgument > getPartialArguments() const
Get.
Definition ExprCXX.h:4584
unsigned getPackLength() const
Retrieve the length of the parameter pack.
Definition ExprCXX.h:4568
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(),...
Definition Expr.h:5070
SourceLocation getBeginLoc() const
Definition Expr.h:5115
const DeclContext * getParentContext() const
If the SourceLocExpr has been resolved return the subexpression representing the resolved value.
Definition Expr.h:5111
SourceLocation getEndLoc() const
Definition Expr.h:5116
SourceLocIdentKind getIdentKind() const
Definition Expr.h:5090
SourceLocation getEnd() const
SourceLocation getBegin() const
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition Expr.h:4639
CompoundStmt * getSubStmt()
Definition Expr.h:4656
unsigned getTemplateDepth() const
Definition Expr.h:4668
SourceLocation getRParenLoc() const
Definition Expr.h:4665
SourceLocation getLParenLoc() const
Definition Expr.h:4663
StmtVisitor - This class implements a simple visitor for Stmt subclasses.
Stmt - This represents one statement.
Definition Stmt.h:85
LambdaExprBitfields LambdaExprBits
Definition Stmt.h:1404
StmtClass getStmtClass() const
Definition Stmt.h:1505
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:1393
CXXNewExprBitfields CXXNewExprBits
Definition Stmt.h:1391
ConstantExprBitfields ConstantExprBits
Definition Stmt.h:1356
RequiresExprBitfields RequiresExprBits
Definition Stmt.h:1405
CXXFoldExprBitfields CXXFoldExprBits
Definition Stmt.h:1408
PackIndexingExprBitfields PackIndexingExprBits
Definition Stmt.h:1409
NullStmtBitfields NullStmtBits
Definition Stmt.h:1339
DependentScopeDeclRefExprBitfields DependentScopeDeclRefExprBits
Definition Stmt.h:1394
StringLiteral - This represents a string literal expression, e.g.
Definition Expr.h:1819
SourceLocation getStrTokenLoc(unsigned TokNum) const
Get one of the string literal token.
Definition Expr.h:1990
bool isPascal() const
Definition Expr.h:1958
unsigned getLength() const
Definition Expr.h:1944
StringLiteralKind getKind() const
Definition Expr.h:1948
StringRef getBytes() const
Allow access to clients that need the byte representation, such as ASTWriterStmt::VisitStringLiteral(...
Definition Expr.h:1895
unsigned getByteLength() const
Definition Expr.h:1942
unsigned getNumConcatenated() const
Get the number of string literal tokens that were concatenated in translation phase #6 to form this s...
Definition Expr.h:1985
unsigned getCharByteWidth() const
Definition Expr.h:1946
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition ExprCXX.h:4717
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern being substituted.
Definition ExprCXX.h:4762
UnsignedOrNone getPackIndex() const
Definition ExprCXX.h:4770
QualType getParameterType() const
Determine the substituted type of the template parameter.
Definition ExprCXX.h:4781
unsigned getIndex() const
Returns the index of the replaced parameter in the associated declaration.
Definition ExprCXX.h:4768
SourceLocation getNameLoc() const
Definition ExprCXX.h:4752
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition ExprCXX.h:4807
TemplateArgument getArgumentPack() const
Retrieve the template argument pack containing the substituted template arguments.
Definition ExprCXX.cpp:1817
SourceLocation getParameterPackLocation() const
Retrieve the location of the parameter pack name.
Definition ExprCXX.h:4855
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern being substituted.
Definition ExprCXX.h:4841
unsigned getIndex() const
Returns the index of the replaced parameter in the associated declaration.
Definition ExprCXX.h:4845
SourceLocation getKeywordLoc() const
Definition Stmt.h:1909
SourceLocation getColonLoc() const
Definition Stmt.h:1911
const SwitchCase * getNextSwitchCase() const
Definition Stmt.h:1905
SwitchStmt - This represents a 'switch' stmt.
Definition Stmt.h:2521
SourceLocation getSwitchLoc() const
Definition Stmt.h:2656
SourceLocation getLParenLoc() const
Definition Stmt.h:2658
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:2681
SourceLocation getRParenLoc() const
Definition Stmt.h:2660
Expr * getCond()
Definition Stmt.h:2584
Stmt * getBody()
Definition Stmt.h:2596
Stmt * getInit()
Definition Stmt.h:2601
SwitchCase * getSwitchCaseList()
Definition Stmt.h:2652
DeclStmt * getConditionVariableDeclStmt()
If this SwitchStmt has a condition variable, return the faux DeclStmt associated with the creation of...
Definition Stmt.h:2635
Location wrapper for a TemplateArgument.
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition ExprCXX.h:2900
TypeSourceInfo * getArg(unsigned I) const
Retrieve the Ith argument.
Definition ExprCXX.h:2975
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
Definition ExprCXX.h:2972
const APValue & getAPValue() const
Definition ExprCXX.h:2966
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition Expr.h:2669
SourceLocation getRParenLoc() const
Definition Expr.h:2745
SourceLocation getOperatorLoc() const
Definition Expr.h:2742
TypeSourceInfo * getArgumentTypeInfo() const
Definition Expr.h:2715
UnaryExprOrTypeTrait getKind() const
Definition Expr.h:2701
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition Expr.h:2288
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
Definition Expr.h:2333
Expr * getSubExpr() const
Definition Expr.h:2329
Opcode getOpcode() const
Definition Expr.h:2324
bool hasStoredFPFeatures() const
Is FPFeatures in Trailing Storage?
Definition Expr.h:2425
FPOptionsOverride getStoredFPFeatures() const
Get FPFeatures from trailing storage.
Definition Expr.h:2428
bool canOverflow() const
Returns true if the unary operator can cause an overflow.
Definition Expr.h:2342
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition ExprCXX.h:3372
CXXRecordDecl * getNamingClass()
Gets the 'naming class' (in the sense of C++0x [class.access.base]p5) of the lookup.
Definition ExprCXX.h:3446
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
Definition ExprCXX.h:3441
Represents a C++ member access expression for which lookup produced a set of overloaded functions.
Definition ExprCXX.h:4179
QualType getBaseType() const
Definition ExprCXX.h:4261
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '.
Definition ExprCXX.h:4271
SourceLocation getOperatorLoc() const
Retrieve the location of the '->' or '.' operator.
Definition ExprCXX.h:4274
bool hasUnresolvedUsing() const
Determine whether the lookup results contain an unresolved using declaration.
Definition ExprCXX.h:4265
Expr * getBase()
Retrieve the base object of this member expressions, e.g., the x in x.m.
Definition ExprCXX.h:4252
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:1677
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit....
Definition ExprCXX.h:644
Represents a call to the builtin function __builtin_va_arg.
Definition Expr.h:5001
TypeSourceInfo * getWrittenTypeInfo() const
Definition Expr.h:5034
SourceLocation getBuiltinLoc() const
Definition Expr.h:5037
SourceLocation getRParenLoc() const
Definition Expr.h:5040
VarArgKind getVarargABI() const
Definition Expr.h:5025
const Expr * getSubExpr() const
Definition Expr.h:5021
WhileStmt - This represents a 'while' stmt.
Definition Stmt.h:2709
Expr * getCond()
Definition Stmt.h:2761
SourceLocation getWhileLoc() const
Definition Stmt.h:2814
SourceLocation getRParenLoc() const
Definition Stmt.h:2819
DeclStmt * getConditionVariableDeclStmt()
If this WhileStmt has a condition variable, return the faux DeclStmt associated with the creation of ...
Definition Stmt.h:2797
SourceLocation getLParenLoc() const
Definition Stmt.h:2817
Stmt * getBody()
Definition Stmt.h:2773
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_CXX_EXPANSION_INSTANTIATION
A CXXExpansionInstantiationStmt.
@ 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_CXX_EXPANSION_PATTERN
A CXXExpansionPatternStmt.
@ 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.
Top level wrappers for InstallAPI frontend operations.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
bool isa(CodeGen::Address addr)
Definition Address.h:330
@ OK_Ordinary
An ordinary object is located at an address in memory.
Definition Specifiers.h:152
OpenACCComputeConstruct(OpenACCDirectiveKind K, SourceLocation Start, SourceLocation DirectiveLoc, SourceLocation End, ArrayRef< const OpenACCClause * > Clauses, Stmt *StructuredBlock)
bool isAlignedAllocation(AlignedAllocationMode Mode)
Definition ExprCXX.h:2269
bool isTypeAwareAllocation(TypeAwareAllocationMode Mode)
Definition ExprCXX.h:2257
@ VK_PRValue
A pr-value expression (in the C++11 taxonomy) produces a temporary value.
Definition Specifiers.h:136
U cast(CodeGen::Address addr)
Definition Address.h:327
unsigned long uint64_t
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
Definition ASTConcept.h:91
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
SourceLocation LAngleLoc
The source location of the left angle bracket ('<').
unsigned NumTemplateArgs
The number of template arguments in TemplateArgs.
SourceLocation RAngleLoc
The source location of the right angle bracket ('>').
SourceLocation TemplateKWLoc
The source location of the template keyword; this is used as part of the representation of qualified ...
AlignedAllocationMode PassAlignment
Definition ExprCXX.h:2311
TypeAwareAllocationMode PassTypeIdentity
Definition ExprCXX.h:2310
Expr * CounterUpdate
Updater for the internal counter: ++CounterVD;.
Definition ExprOpenMP.h:121
Expr * Upper
Normalized upper bound.
Definition ExprOpenMP.h:116
Expr * Update
Update expression for the originally specified iteration variable, calculated as VD = Begin + Counter...
Definition ExprOpenMP.h:119
VarDecl * CounterVD
Internal normalized counter.
Definition ExprOpenMP.h:113
Expr * Value
The value of the dictionary element.
Definition ExprObjC.h:299
SourceLocation EllipsisLoc
The location of the ellipsis, if this is a pack expansion.
Definition ExprObjC.h:302
UnsignedOrNone NumExpansions
The number of elements this pack expansion will expand to, if this is a pack expansion and is known.
Definition ExprObjC.h:306
Expr * Key
The key for the dictionary element.
Definition ExprObjC.h:296
constexpr underlying_type toInternalRepresentation() const