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
1144}
1145
1146void ASTStmtWriter::VisitCompoundAssignOperator(CompoundAssignOperator *E) {
1147 VisitBinaryOperator(E);
1148 Record.AddTypeRef(E->getComputationLHSType());
1149 Record.AddTypeRef(E->getComputationResultType());
1150
1151 if (!E->hasStoredFPFeatures() && E->getValueKind() == VK_PRValue &&
1152 E->getObjectKind() == OK_Ordinary)
1153 AbbrevToUse = Writer.getCompoundAssignOperatorAbbrev();
1154
1156}
1157
1158void ASTStmtWriter::VisitConditionalOperator(ConditionalOperator *E) {
1159 VisitExpr(E);
1160 Record.AddStmt(E->getCond());
1161 Record.AddStmt(E->getLHS());
1162 Record.AddStmt(E->getRHS());
1163 Record.AddSourceLocation(E->getQuestionLoc());
1164 Record.AddSourceLocation(E->getColonLoc());
1166}
1167
1168void
1169ASTStmtWriter::VisitBinaryConditionalOperator(BinaryConditionalOperator *E) {
1170 VisitExpr(E);
1171 Record.AddStmt(E->getOpaqueValue());
1172 Record.AddStmt(E->getCommon());
1173 Record.AddStmt(E->getCond());
1174 Record.AddStmt(E->getTrueExpr());
1175 Record.AddStmt(E->getFalseExpr());
1176 Record.AddSourceLocation(E->getQuestionLoc());
1177 Record.AddSourceLocation(E->getColonLoc());
1179}
1180
1181void ASTStmtWriter::VisitImplicitCastExpr(ImplicitCastExpr *E) {
1182 VisitCastExpr(E);
1183 CurrentPackingBits.addBit(E->isPartOfExplicitCast());
1184
1185 if (E->path_size() == 0 && !E->hasStoredFPFeatures())
1186 AbbrevToUse = Writer.getExprImplicitCastAbbrev();
1187
1189}
1190
1191void ASTStmtWriter::VisitExplicitCastExpr(ExplicitCastExpr *E) {
1192 VisitCastExpr(E);
1193 Record.AddTypeSourceInfo(E->getTypeInfoAsWritten());
1194}
1195
1196void ASTStmtWriter::VisitCStyleCastExpr(CStyleCastExpr *E) {
1197 VisitExplicitCastExpr(E);
1198 Record.AddSourceLocation(E->getLParenLoc());
1199 Record.AddSourceLocation(E->getRParenLoc());
1201}
1202
1203void ASTStmtWriter::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
1204 VisitExpr(E);
1205 Record.AddSourceLocation(E->getLParenLoc());
1206 Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1207 Record.AddStmt(E->getInitializer());
1208 Record.push_back(E->isFileScope());
1210}
1211
1212void ASTStmtWriter::VisitExtVectorElementExpr(ExtVectorElementExpr *E) {
1213 VisitExpr(E);
1214 Record.AddStmt(E->getBase());
1215 Record.AddIdentifierRef(&E->getAccessor());
1216 Record.AddSourceLocation(E->getAccessorLoc());
1218}
1219
1220void ASTStmtWriter::VisitMatrixElementExpr(MatrixElementExpr *E) {
1221 VisitExpr(E);
1222 Record.AddStmt(E->getBase());
1223 Record.AddIdentifierRef(&E->getAccessor());
1224 Record.AddSourceLocation(E->getAccessorLoc());
1226}
1227
1228void ASTStmtWriter::VisitInitListExpr(InitListExpr *E) {
1229 VisitExpr(E);
1230 // NOTE: only add the (possibly null) syntactic form.
1231 // No need to serialize the isSemanticForm flag and the semantic form.
1232 Record.AddStmt(E->getSyntacticForm());
1233 Record.AddSourceLocation(E->getLBraceLoc());
1234 Record.AddSourceLocation(E->getRBraceLoc());
1235 bool isArrayFiller = isa<Expr *>(E->ArrayFillerOrUnionFieldInit);
1236 Record.push_back(isArrayFiller);
1237 if (isArrayFiller)
1238 Record.AddStmt(E->getArrayFiller());
1239 else
1240 Record.AddDeclRef(E->getInitializedFieldInUnion());
1241 Record.push_back(E->hadArrayRangeDesignator());
1242 Record.push_back(E->getNumInits());
1243 if (isArrayFiller) {
1244 // ArrayFiller may have filled "holes" due to designated initializer.
1245 // Replace them by 0 to indicate that the filler goes in that place.
1246 Expr *filler = E->getArrayFiller();
1247 for (unsigned I = 0, N = E->getNumInits(); I != N; ++I)
1248 Record.AddStmt(E->getInit(I) != filler ? E->getInit(I) : nullptr);
1249 } else {
1250 for (unsigned I = 0, N = E->getNumInits(); I != N; ++I)
1251 Record.AddStmt(E->getInit(I));
1252 }
1253 Record.writeBool(E->isExplicit());
1255}
1256
1257void ASTStmtWriter::VisitDesignatedInitExpr(DesignatedInitExpr *E) {
1258 VisitExpr(E);
1259 Record.push_back(E->getNumSubExprs());
1260 for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
1261 Record.AddStmt(E->getSubExpr(I));
1262 Record.AddSourceLocation(E->getEqualOrColonLoc());
1263 Record.push_back(E->usesGNUSyntax());
1264 for (const DesignatedInitExpr::Designator &D : E->designators()) {
1265 if (D.isFieldDesignator()) {
1266 if (FieldDecl *Field = D.getFieldDecl()) {
1267 Record.push_back(serialization::DESIG_FIELD_DECL);
1268 Record.AddDeclRef(Field);
1269 } else {
1270 Record.push_back(serialization::DESIG_FIELD_NAME);
1271 Record.AddIdentifierRef(D.getFieldName());
1272 }
1273 Record.AddSourceLocation(D.getDotLoc());
1274 Record.AddSourceLocation(D.getFieldLoc());
1275 } else if (D.isArrayDesignator()) {
1276 Record.push_back(serialization::DESIG_ARRAY);
1277 Record.push_back(D.getArrayIndex());
1278 Record.AddSourceLocation(D.getLBracketLoc());
1279 Record.AddSourceLocation(D.getRBracketLoc());
1280 } else {
1281 assert(D.isArrayRangeDesignator() && "Unknown designator");
1282 Record.push_back(serialization::DESIG_ARRAY_RANGE);
1283 Record.push_back(D.getArrayIndex());
1284 Record.AddSourceLocation(D.getLBracketLoc());
1285 Record.AddSourceLocation(D.getEllipsisLoc());
1286 Record.AddSourceLocation(D.getRBracketLoc());
1287 }
1288 }
1290}
1291
1292void ASTStmtWriter::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) {
1293 VisitExpr(E);
1294 Record.AddStmt(E->getBase());
1295 Record.AddStmt(E->getUpdater());
1297}
1298
1299void ASTStmtWriter::VisitNoInitExpr(NoInitExpr *E) {
1300 VisitExpr(E);
1302}
1303
1304void ASTStmtWriter::VisitArrayInitLoopExpr(ArrayInitLoopExpr *E) {
1305 VisitExpr(E);
1306 Record.AddStmt(E->SubExprs[0]);
1307 Record.AddStmt(E->SubExprs[1]);
1309}
1310
1311void ASTStmtWriter::VisitArrayInitIndexExpr(ArrayInitIndexExpr *E) {
1312 VisitExpr(E);
1314}
1315
1316void ASTStmtWriter::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) {
1317 VisitExpr(E);
1319}
1320
1321void ASTStmtWriter::VisitVAArgExpr(VAArgExpr *E) {
1322 VisitExpr(E);
1323 Record.AddStmt(E->getSubExpr());
1324 Record.AddTypeSourceInfo(E->getWrittenTypeInfo());
1325 Record.AddSourceLocation(E->getBuiltinLoc());
1326 Record.AddSourceLocation(E->getRParenLoc());
1327 Record.push_back(E->getVarargABI());
1329}
1330
1331void ASTStmtWriter::VisitSourceLocExpr(SourceLocExpr *E) {
1332 VisitExpr(E);
1333 Record.AddDeclRef(cast_or_null<Decl>(E->getParentContext()));
1334 Record.AddSourceLocation(E->getBeginLoc());
1335 Record.AddSourceLocation(E->getEndLoc());
1336 Record.push_back(llvm::to_underlying(E->getIdentKind()));
1338}
1339
1340void ASTStmtWriter::VisitEmbedExpr(EmbedExpr *E) {
1341 VisitExpr(E);
1342 Record.AddSourceLocation(E->getBeginLoc());
1343 Record.AddStmt(E->getDataStringLiteral());
1344 Record.writeUInt32(E->getStartingElementPos());
1345 Record.writeUInt32(E->getDataElementCount());
1347}
1348
1349void ASTStmtWriter::VisitAddrLabelExpr(AddrLabelExpr *E) {
1350 VisitExpr(E);
1351 Record.AddSourceLocation(E->getAmpAmpLoc());
1352 Record.AddSourceLocation(E->getLabelLoc());
1353 Record.AddDeclRef(E->getLabel());
1355}
1356
1357void ASTStmtWriter::VisitStmtExpr(StmtExpr *E) {
1358 VisitExpr(E);
1359 Record.AddStmt(E->getSubStmt());
1360 Record.AddSourceLocation(E->getLParenLoc());
1361 Record.AddSourceLocation(E->getRParenLoc());
1362 Record.push_back(E->getTemplateDepth());
1364}
1365
1366void ASTStmtWriter::VisitChooseExpr(ChooseExpr *E) {
1367 VisitExpr(E);
1368 Record.AddStmt(E->getCond());
1369 Record.AddStmt(E->getLHS());
1370 Record.AddStmt(E->getRHS());
1371 Record.AddSourceLocation(E->getBuiltinLoc());
1372 Record.AddSourceLocation(E->getRParenLoc());
1373 Record.push_back(E->isConditionDependent() ? false : E->isConditionTrue());
1375}
1376
1377void ASTStmtWriter::VisitGNUNullExpr(GNUNullExpr *E) {
1378 VisitExpr(E);
1379 Record.AddSourceLocation(E->getTokenLocation());
1381}
1382
1383void ASTStmtWriter::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
1384 VisitExpr(E);
1385 Record.push_back(E->getNumSubExprs());
1386 for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
1387 Record.AddStmt(E->getExpr(I));
1388 Record.AddSourceLocation(E->getBuiltinLoc());
1389 Record.AddSourceLocation(E->getRParenLoc());
1391}
1392
1393void ASTStmtWriter::VisitConvertVectorExpr(ConvertVectorExpr *E) {
1394 VisitExpr(E);
1395 bool HasFPFeatures = E->hasStoredFPFeatures();
1396 CurrentPackingBits.addBit(HasFPFeatures);
1397 Record.AddSourceLocation(E->getBuiltinLoc());
1398 Record.AddSourceLocation(E->getRParenLoc());
1399 Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1400 Record.AddStmt(E->getSrcExpr());
1402 if (HasFPFeatures)
1403 Record.push_back(E->getStoredFPFeatures().getAsOpaqueInt());
1404}
1405
1406void ASTStmtWriter::VisitBlockExpr(BlockExpr *E) {
1407 VisitExpr(E);
1408 Record.AddDeclRef(E->getBlockDecl());
1410}
1411
1412void ASTStmtWriter::VisitGenericSelectionExpr(GenericSelectionExpr *E) {
1413 VisitExpr(E);
1414
1415 Record.push_back(E->getNumAssocs());
1416 Record.push_back(E->isExprPredicate());
1417 Record.push_back(E->ResultIndex);
1418 Record.AddSourceLocation(E->getGenericLoc());
1419 Record.AddSourceLocation(E->getDefaultLoc());
1420 Record.AddSourceLocation(E->getRParenLoc());
1421
1422 // Either the trailing Stmt-s or the trailing TypeSourceInfo-s
1423 // will hold one more item than the number of associations
1424 // to account for the predicate (whether it is an expression
1425 // or a type).
1426 Stmt **Stmts = E->getTrailingObjects<Stmt *>();
1427 for (unsigned I = 0, N = E->numTrailingObjects(
1428 ASTConstraintSatisfaction::OverloadToken<Stmt *>());
1429 I < N; ++I)
1430 Record.AddStmt(Stmts[I]);
1431
1432 TypeSourceInfo **TSIs = E->getTrailingObjects<TypeSourceInfo *>();
1433 for (unsigned
1434 I = 0,
1435 N = E->numTrailingObjects(
1436 ASTConstraintSatisfaction::OverloadToken<TypeSourceInfo *>());
1437 I < N; ++I)
1438 Record.AddTypeSourceInfo(TSIs[I]);
1439
1441}
1442
1443void ASTStmtWriter::VisitPseudoObjectExpr(PseudoObjectExpr *E) {
1444 VisitExpr(E);
1445 Record.push_back(E->getNumSemanticExprs());
1446
1447 // Push the result index. Currently, this needs to exactly match
1448 // the encoding used internally for ResultIndex.
1449 unsigned result = E->getResultExprIndex();
1450 result = (result == PseudoObjectExpr::NoResult ? 0 : result + 1);
1451 Record.push_back(result);
1452
1453 Record.AddStmt(E->getSyntacticForm());
1455 i = E->semantics_begin(), e = E->semantics_end(); i != e; ++i) {
1456 Record.AddStmt(*i);
1457 }
1459}
1460
1461void ASTStmtWriter::VisitAtomicExpr(AtomicExpr *E) {
1462 VisitExpr(E);
1463 Record.push_back(E->getOp());
1464 for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
1465 Record.AddStmt(E->getSubExprs()[I]);
1466 Record.AddSourceLocation(E->getBuiltinLoc());
1467 Record.AddSourceLocation(E->getRParenLoc());
1469}
1470
1471//===----------------------------------------------------------------------===//
1472// Objective-C Expressions and Statements.
1473//===----------------------------------------------------------------------===//
1474
1475void ASTStmtWriter::VisitObjCObjectLiteral(ObjCObjectLiteral *E) {
1476 VisitExpr(E);
1477 Record.push_back(E->isExpressibleAsConstantInitializer());
1478}
1479
1480void ASTStmtWriter::VisitObjCStringLiteral(ObjCStringLiteral *E) {
1481 VisitObjCObjectLiteral(E);
1482 Record.AddStmt(E->getString());
1483 Record.AddSourceLocation(E->getAtLoc());
1485}
1486
1487void ASTStmtWriter::VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
1488 VisitObjCObjectLiteral(E);
1489 Record.AddStmt(E->getSubExpr());
1490 Record.AddDeclRef(E->getBoxingMethod());
1491 Record.AddSourceRange(E->getSourceRange());
1493}
1494
1495void ASTStmtWriter::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
1496 VisitObjCObjectLiteral(E);
1497 Record.push_back(E->getNumElements());
1498 for (unsigned i = 0; i < E->getNumElements(); i++)
1499 Record.AddStmt(E->getElement(i));
1500 Record.AddDeclRef(E->getArrayWithObjectsMethod());
1501 Record.AddSourceRange(E->getSourceRange());
1503}
1504
1505void ASTStmtWriter::VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *E) {
1506 VisitObjCObjectLiteral(E);
1507 Record.push_back(E->getNumElements());
1508 Record.push_back(E->HasPackExpansions);
1509 for (unsigned i = 0; i < E->getNumElements(); i++) {
1510 ObjCDictionaryElement Element = E->getKeyValueElement(i);
1511 Record.AddStmt(Element.Key);
1512 Record.AddStmt(Element.Value);
1513 if (E->HasPackExpansions) {
1514 Record.AddSourceLocation(Element.EllipsisLoc);
1515 unsigned NumExpansions = 0;
1516 if (Element.NumExpansions)
1517 NumExpansions = *Element.NumExpansions + 1;
1518 Record.push_back(NumExpansions);
1519 }
1520 }
1521
1522 Record.AddDeclRef(E->getDictWithObjectsMethod());
1523 Record.AddSourceRange(E->getSourceRange());
1525}
1526
1527void ASTStmtWriter::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
1528 VisitExpr(E);
1529 Record.AddTypeSourceInfo(E->getEncodedTypeSourceInfo());
1530 Record.AddSourceLocation(E->getAtLoc());
1531 Record.AddSourceLocation(E->getRParenLoc());
1533}
1534
1535void ASTStmtWriter::VisitObjCSelectorExpr(ObjCSelectorExpr *E) {
1536 VisitExpr(E);
1537 Record.AddSelectorRef(E->getSelector());
1538 Record.AddSourceLocation(E->getAtLoc());
1539 Record.AddSourceLocation(E->getSelectorNameLoc());
1540 Record.AddSourceLocation(E->getRParenLoc());
1542}
1543
1544void ASTStmtWriter::VisitObjCProtocolExpr(ObjCProtocolExpr *E) {
1545 VisitExpr(E);
1546 Record.AddDeclRef(E->getProtocol());
1547 Record.AddSourceLocation(E->getAtLoc());
1548 Record.AddSourceLocation(E->ProtoLoc);
1549 Record.AddSourceLocation(E->getRParenLoc());
1551}
1552
1553void ASTStmtWriter::VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) {
1554 VisitExpr(E);
1555 Record.AddDeclRef(E->getDecl());
1556 Record.AddSourceLocation(E->getLocation());
1557 Record.AddSourceLocation(E->getOpLoc());
1558 Record.AddStmt(E->getBase());
1559 Record.push_back(E->isArrow());
1560 Record.push_back(E->isFreeIvar());
1562}
1563
1564void ASTStmtWriter::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
1565 VisitExpr(E);
1566 Record.push_back(E->SetterAndMethodRefFlags.getInt());
1567 Record.push_back(E->isImplicitProperty());
1568 if (E->isImplicitProperty()) {
1569 Record.AddDeclRef(E->getImplicitPropertyGetter());
1570 Record.AddDeclRef(E->getImplicitPropertySetter());
1571 } else {
1572 Record.AddDeclRef(E->getExplicitProperty());
1573 }
1574 Record.AddSourceLocation(E->getLocation());
1575 Record.AddSourceLocation(E->getReceiverLocation());
1576 if (E->isObjectReceiver()) {
1577 Record.push_back(0);
1578 Record.AddStmt(E->getBase());
1579 } else if (E->isSuperReceiver()) {
1580 Record.push_back(1);
1581 Record.AddTypeRef(E->getSuperReceiverType());
1582 } else {
1583 Record.push_back(2);
1584 Record.AddDeclRef(E->getClassReceiver());
1585 }
1586
1588}
1589
1590void ASTStmtWriter::VisitObjCSubscriptRefExpr(ObjCSubscriptRefExpr *E) {
1591 VisitExpr(E);
1592 Record.AddSourceLocation(E->getRBracket());
1593 Record.AddStmt(E->getBaseExpr());
1594 Record.AddStmt(E->getKeyExpr());
1595 Record.AddDeclRef(E->getAtIndexMethodDecl());
1596 Record.AddDeclRef(E->setAtIndexMethodDecl());
1597
1599}
1600
1601void ASTStmtWriter::VisitObjCMessageExpr(ObjCMessageExpr *E) {
1602 VisitExpr(E);
1603 Record.push_back(E->getNumArgs());
1604 Record.push_back(E->getNumStoredSelLocs());
1605 Record.push_back(E->SelLocsKind);
1606 Record.push_back(E->isDelegateInitCall());
1607 Record.push_back(E->IsImplicit);
1608 Record.push_back((unsigned)E->getReceiverKind()); // FIXME: stable encoding
1609 switch (E->getReceiverKind()) {
1611 Record.AddStmt(E->getInstanceReceiver());
1612 break;
1613
1615 Record.AddTypeSourceInfo(E->getClassReceiverTypeInfo());
1616 break;
1617
1620 Record.AddTypeRef(E->getSuperType());
1621 Record.AddSourceLocation(E->getSuperLoc());
1622 break;
1623 }
1624
1625 if (E->getMethodDecl()) {
1626 Record.push_back(1);
1627 Record.AddDeclRef(E->getMethodDecl());
1628 } else {
1629 Record.push_back(0);
1630 Record.AddSelectorRef(E->getSelector());
1631 }
1632
1633 Record.AddSourceLocation(E->getLeftLoc());
1634 Record.AddSourceLocation(E->getRightLoc());
1635
1636 for (CallExpr::arg_iterator Arg = E->arg_begin(), ArgEnd = E->arg_end();
1637 Arg != ArgEnd; ++Arg)
1638 Record.AddStmt(*Arg);
1639
1640 SourceLocation *Locs = E->getStoredSelLocs();
1641 for (unsigned i = 0, e = E->getNumStoredSelLocs(); i != e; ++i)
1642 Record.AddSourceLocation(Locs[i]);
1643
1645}
1646
1647void ASTStmtWriter::VisitObjCForCollectionStmt(ObjCForCollectionStmt *S) {
1648 VisitStmt(S);
1649 Record.AddStmt(S->getElement());
1650 Record.AddStmt(S->getCollection());
1651 Record.AddStmt(S->getBody());
1652 Record.AddSourceLocation(S->getForLoc());
1653 Record.AddSourceLocation(S->getRParenLoc());
1655}
1656
1657void ASTStmtWriter::VisitObjCAtCatchStmt(ObjCAtCatchStmt *S) {
1658 VisitStmt(S);
1659 Record.AddStmt(S->getCatchBody());
1660 Record.AddDeclRef(S->getCatchParamDecl());
1661 Record.AddSourceLocation(S->getAtCatchLoc());
1662 Record.AddSourceLocation(S->getRParenLoc());
1664}
1665
1666void ASTStmtWriter::VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S) {
1667 VisitStmt(S);
1668 Record.AddStmt(S->getFinallyBody());
1669 Record.AddSourceLocation(S->getAtFinallyLoc());
1671}
1672
1673void ASTStmtWriter::VisitObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S) {
1674 VisitStmt(S); // FIXME: no test coverage.
1675 Record.AddStmt(S->getSubStmt());
1676 Record.AddSourceLocation(S->getAtLoc());
1678}
1679
1680void ASTStmtWriter::VisitObjCAtTryStmt(ObjCAtTryStmt *S) {
1681 VisitStmt(S);
1682 Record.push_back(S->getNumCatchStmts());
1683 Record.push_back(S->getFinallyStmt() != nullptr);
1684 Record.AddStmt(S->getTryBody());
1685 for (ObjCAtCatchStmt *C : S->catch_stmts())
1686 Record.AddStmt(C);
1687 if (S->getFinallyStmt())
1688 Record.AddStmt(S->getFinallyStmt());
1689 Record.AddSourceLocation(S->getAtTryLoc());
1691}
1692
1693void ASTStmtWriter::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
1694 VisitStmt(S); // FIXME: no test coverage.
1695 Record.AddStmt(S->getSynchExpr());
1696 Record.AddStmt(S->getSynchBody());
1697 Record.AddSourceLocation(S->getAtSynchronizedLoc());
1699}
1700
1701void ASTStmtWriter::VisitObjCAtThrowStmt(ObjCAtThrowStmt *S) {
1702 VisitStmt(S); // FIXME: no test coverage.
1703 Record.AddStmt(S->getThrowExpr());
1704 Record.AddSourceLocation(S->getThrowLoc());
1706}
1707
1708void ASTStmtWriter::VisitObjCBoolLiteralExpr(ObjCBoolLiteralExpr *E) {
1709 VisitExpr(E);
1710 Record.push_back(E->getValue());
1711 Record.AddSourceLocation(E->getLocation());
1713}
1714
1715void ASTStmtWriter::VisitObjCAvailabilityCheckExpr(ObjCAvailabilityCheckExpr *E) {
1716 VisitExpr(E);
1717 Record.AddSourceRange(E->getSourceRange());
1718 Record.AddVersionTuple(E->getVersion());
1720}
1721
1722//===----------------------------------------------------------------------===//
1723// C++ Expressions and Statements.
1724//===----------------------------------------------------------------------===//
1725
1726void ASTStmtWriter::VisitCXXCatchStmt(CXXCatchStmt *S) {
1727 VisitStmt(S);
1728 Record.AddSourceLocation(S->getCatchLoc());
1729 Record.AddDeclRef(S->getExceptionDecl());
1730 Record.AddStmt(S->getHandlerBlock());
1732}
1733
1734void ASTStmtWriter::VisitCXXTryStmt(CXXTryStmt *S) {
1735 VisitStmt(S);
1736 Record.push_back(S->getNumHandlers());
1737 Record.AddSourceLocation(S->getTryLoc());
1738 Record.AddStmt(S->getTryBlock());
1739 for (unsigned i = 0, e = S->getNumHandlers(); i != e; ++i)
1740 Record.AddStmt(S->getHandler(i));
1742}
1743
1744void ASTStmtWriter::VisitCXXForRangeStmt(CXXForRangeStmt *S) {
1745 VisitStmt(S);
1746 Record.AddSourceLocation(S->getForLoc());
1747 Record.AddSourceLocation(S->getCoawaitLoc());
1748 Record.AddSourceLocation(S->getColonLoc());
1749 Record.AddSourceLocation(S->getRParenLoc());
1750 Record.AddStmt(S->getInit());
1751 Record.AddStmt(S->getRangeStmt());
1752 Record.AddStmt(S->getBeginStmt());
1753 Record.AddStmt(S->getEndStmt());
1754 Record.AddStmt(S->getCond());
1755 Record.AddStmt(S->getInc());
1756 Record.AddStmt(S->getLoopVarStmt());
1757 Record.AddStmt(S->getBody());
1759}
1760
1761void ASTStmtWriter::VisitCXXExpansionStmtPattern(CXXExpansionStmtPattern *S) {
1762 VisitStmt(S);
1763 Record.push_back(static_cast<unsigned>(S->getKind()));
1764 Record.AddSourceLocation(S->getLParenLoc());
1765 Record.AddSourceLocation(S->getColonLoc());
1766 Record.AddSourceLocation(S->getRParenLoc());
1767 Record.AddDeclRef(S->getDecl());
1768 for (Stmt *SubStmt : S->children())
1769 Record.AddStmt(SubStmt);
1771}
1772
1773void ASTStmtWriter::VisitCXXExpansionStmtInstantiation(
1775 VisitStmt(S);
1776 Record.push_back(S->getInstantiations().size());
1777 Record.push_back(S->getPreambleStmts().size());
1778 Record.AddDeclRef(S->getParent());
1779 for (Stmt *St : S->getAllSubStmts())
1780 Record.AddStmt(St);
1781 Record.push_back(S->shouldApplyLifetimeExtensionToPreamble());
1783}
1784
1785void ASTStmtWriter::VisitCXXExpansionSelectExpr(CXXExpansionSelectExpr *E) {
1786 VisitExpr(E);
1787 Record.AddStmt(E->getRangeExpr());
1788 Record.AddStmt(E->getIndexExpr());
1790}
1791
1792void ASTStmtWriter::VisitMSDependentExistsStmt(MSDependentExistsStmt *S) {
1793 VisitStmt(S);
1794 Record.AddSourceLocation(S->getKeywordLoc());
1795 Record.push_back(S->isIfExists());
1796 Record.AddNestedNameSpecifierLoc(S->getQualifierLoc());
1797 Record.AddDeclarationNameInfo(S->getNameInfo());
1798 Record.AddStmt(S->getSubStmt());
1800}
1801
1802void ASTStmtWriter::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
1803 VisitCallExpr(E);
1804 Record.push_back(E->getOperator());
1805 Record.push_back(E->isReversed());
1806 Record.AddSourceLocation(E->BeginLoc);
1807
1808 if (!E->hasStoredFPFeatures() && !static_cast<bool>(E->getADLCallKind()) &&
1809 !E->isCoroElideSafe() && !E->usesMemberSyntax() && !E->isReversed())
1810 AbbrevToUse = Writer.getCXXOperatorCallExprAbbrev();
1811
1813}
1814
1815void ASTStmtWriter::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) {
1816 VisitCallExpr(E);
1817
1818 if (!E->hasStoredFPFeatures() && !static_cast<bool>(E->getADLCallKind()) &&
1819 !E->isCoroElideSafe() && !E->usesMemberSyntax())
1820 AbbrevToUse = Writer.getCXXMemberCallExprAbbrev();
1821
1823}
1824
1825void ASTStmtWriter::VisitCXXRewrittenBinaryOperator(
1827 VisitExpr(E);
1828 Record.push_back(E->isReversed());
1829 Record.AddStmt(E->getSemanticForm());
1831}
1832
1833void ASTStmtWriter::VisitCXXConstructExpr(CXXConstructExpr *E) {
1834 VisitExpr(E);
1835
1836 Record.push_back(E->getNumArgs());
1837 Record.push_back(E->isElidable());
1838 Record.push_back(E->hadMultipleCandidates());
1839 Record.push_back(E->isListInitialization());
1840 Record.push_back(E->isStdInitListInitialization());
1841 Record.push_back(E->requiresZeroInitialization());
1842 Record.push_back(
1843 llvm::to_underlying(E->getConstructionKind())); // FIXME: stable encoding
1844 Record.push_back(E->isImmediateEscalating());
1845 Record.AddSourceLocation(E->getLocation());
1846 Record.AddDeclRef(E->getConstructor());
1847 Record.AddSourceRange(E->getParenOrBraceRange());
1848
1849 for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1850 Record.AddStmt(E->getArg(I));
1851
1853}
1854
1855void ASTStmtWriter::VisitCXXInheritedCtorInitExpr(CXXInheritedCtorInitExpr *E) {
1856 VisitExpr(E);
1857 Record.AddDeclRef(E->getConstructor());
1858 Record.AddSourceLocation(E->getLocation());
1859 Record.push_back(E->constructsVBase());
1860 Record.push_back(E->inheritedFromVBase());
1862}
1863
1864void ASTStmtWriter::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
1865 VisitCXXConstructExpr(E);
1866 Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1868}
1869
1870void ASTStmtWriter::VisitLambdaExpr(LambdaExpr *E) {
1871 VisitExpr(E);
1872 Record.push_back(E->LambdaExprBits.NumCaptures);
1873 Record.AddSourceRange(E->IntroducerRange);
1874 Record.push_back(E->LambdaExprBits.CaptureDefault); // FIXME: stable encoding
1875 Record.AddSourceLocation(E->CaptureDefaultLoc);
1876 Record.push_back(E->LambdaExprBits.ExplicitParams);
1877 Record.push_back(E->LambdaExprBits.ExplicitResultType);
1878 Record.AddSourceLocation(E->ClosingBrace);
1879
1880 // Add capture initializers.
1882 CEnd = E->capture_init_end();
1883 C != CEnd; ++C) {
1884 Record.AddStmt(*C);
1885 }
1886
1887 // Don't serialize the body. It belongs to the call operator declaration.
1888 // LambdaExpr only stores a copy of the Stmt *.
1889
1891}
1892
1893void ASTStmtWriter::VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E) {
1894 VisitExpr(E);
1895 Record.AddStmt(E->getSubExpr());
1897}
1898
1899void ASTStmtWriter::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) {
1900 VisitExplicitCastExpr(E);
1901 Record.AddSourceRange(SourceRange(E->getOperatorLoc(), E->getRParenLoc()));
1902 CurrentPackingBits.addBit(E->getAngleBrackets().isValid());
1903 if (E->getAngleBrackets().isValid())
1904 Record.AddSourceRange(E->getAngleBrackets());
1905}
1906
1907void ASTStmtWriter::VisitCXXStaticCastExpr(CXXStaticCastExpr *E) {
1908 VisitCXXNamedCastExpr(E);
1910}
1911
1912void ASTStmtWriter::VisitCXXDynamicCastExpr(CXXDynamicCastExpr *E) {
1913 VisitCXXNamedCastExpr(E);
1915}
1916
1917void ASTStmtWriter::VisitCXXReinterpretCastExpr(CXXReinterpretCastExpr *E) {
1918 VisitCXXNamedCastExpr(E);
1920}
1921
1922void ASTStmtWriter::VisitCXXConstCastExpr(CXXConstCastExpr *E) {
1923 VisitCXXNamedCastExpr(E);
1925}
1926
1927void ASTStmtWriter::VisitCXXAddrspaceCastExpr(CXXAddrspaceCastExpr *E) {
1928 VisitCXXNamedCastExpr(E);
1930}
1931
1932void ASTStmtWriter::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E) {
1933 VisitExplicitCastExpr(E);
1934 Record.AddSourceLocation(E->getLParenLoc());
1935 Record.AddSourceLocation(E->getRParenLoc());
1937}
1938
1939void ASTStmtWriter::VisitBuiltinBitCastExpr(BuiltinBitCastExpr *E) {
1940 VisitExplicitCastExpr(E);
1941 Record.AddSourceLocation(E->getBeginLoc());
1942 Record.AddSourceLocation(E->getEndLoc());
1944}
1945
1946void ASTStmtWriter::VisitUserDefinedLiteral(UserDefinedLiteral *E) {
1947 VisitCallExpr(E);
1948 Record.AddSourceLocation(E->UDSuffixLoc);
1950}
1951
1952void ASTStmtWriter::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) {
1953 VisitExpr(E);
1954 Record.push_back(E->getValue());
1955 Record.AddSourceLocation(E->getLocation());
1957}
1958
1959void ASTStmtWriter::VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E) {
1960 VisitExpr(E);
1961 Record.AddSourceLocation(E->getLocation());
1963}
1964
1965void ASTStmtWriter::VisitCXXTypeidExpr(CXXTypeidExpr *E) {
1966 VisitExpr(E);
1967 Record.AddSourceRange(E->getSourceRange());
1968 if (E->isTypeOperand()) {
1969 Record.AddTypeSourceInfo(E->getTypeOperandSourceInfo());
1971 } else {
1972 Record.AddStmt(E->getExprOperand());
1974 }
1975}
1976
1977void ASTStmtWriter::VisitCXXThisExpr(CXXThisExpr *E) {
1978 VisitExpr(E);
1979 Record.AddSourceLocation(E->getLocation());
1980 Record.push_back(E->isImplicit());
1982
1984}
1985
1986void ASTStmtWriter::VisitCXXThrowExpr(CXXThrowExpr *E) {
1987 VisitExpr(E);
1988 Record.AddSourceLocation(E->getThrowLoc());
1989 Record.AddStmt(E->getSubExpr());
1990 Record.push_back(E->isThrownVariableInScope());
1992}
1993
1994void ASTStmtWriter::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
1995 VisitExpr(E);
1996 Record.AddDeclRef(E->getParam());
1997 Record.AddDeclRef(cast_or_null<Decl>(E->getUsedContext()));
1998 Record.AddSourceLocation(E->getUsedLocation());
1999 Record.push_back(E->hasRewrittenInit());
2000 if (E->hasRewrittenInit())
2001 Record.AddStmt(E->getRewrittenExpr());
2003}
2004
2005void ASTStmtWriter::VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E) {
2006 VisitExpr(E);
2007 Record.push_back(E->hasRewrittenInit());
2008 Record.AddDeclRef(E->getField());
2009 Record.AddDeclRef(cast_or_null<Decl>(E->getUsedContext()));
2010 Record.AddSourceLocation(E->getExprLoc());
2011 if (E->hasRewrittenInit())
2012 Record.AddStmt(E->getRewrittenExpr());
2014}
2015
2016void ASTStmtWriter::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
2017 VisitExpr(E);
2018 Record.AddCXXTemporary(E->getTemporary());
2019 Record.AddStmt(E->getSubExpr());
2021}
2022
2023void ASTStmtWriter::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
2024 VisitExpr(E);
2025 Record.AddTypeSourceInfo(E->getTypeSourceInfo());
2026 Record.AddSourceLocation(E->getRParenLoc());
2028}
2029
2030void ASTStmtWriter::VisitCXXNewExpr(CXXNewExpr *E) {
2031 VisitExpr(E);
2032
2033 Record.push_back(E->isArray());
2034 Record.push_back(E->hasInitializer());
2035 Record.push_back(E->getNumPlacementArgs());
2036 Record.push_back(E->isParenTypeId());
2037
2038 Record.push_back(E->isGlobalNew());
2039 ImplicitAllocationParameters IAP = E->implicitAllocationParameters();
2040 Record.push_back(isAlignedAllocation(IAP.PassAlignment));
2041 Record.push_back(isTypeAwareAllocation(IAP.PassTypeIdentity));
2042 Record.push_back(E->doesUsualArrayDeleteWantSize());
2043 Record.push_back(E->CXXNewExprBits.HasInitializer);
2044 Record.push_back(E->CXXNewExprBits.StoredInitializationStyle);
2045
2046 Record.AddDeclRef(E->getOperatorNew());
2047 Record.AddDeclRef(E->getOperatorDelete());
2048 Record.AddTypeSourceInfo(E->getAllocatedTypeSourceInfo());
2049 if (E->isParenTypeId())
2050 Record.AddSourceRange(E->getTypeIdParens());
2051 Record.AddSourceRange(E->getSourceRange());
2052 Record.AddSourceRange(E->getDirectInitRange());
2053
2054 for (CXXNewExpr::arg_iterator I = E->raw_arg_begin(), N = E->raw_arg_end();
2055 I != N; ++I)
2056 Record.AddStmt(*I);
2057
2059}
2060
2061void ASTStmtWriter::VisitCXXDeleteExpr(CXXDeleteExpr *E) {
2062 VisitExpr(E);
2063 Record.push_back(E->isGlobalDelete());
2064 Record.push_back(E->isArrayForm());
2065 Record.push_back(E->isArrayFormAsWritten());
2066 Record.push_back(E->doesUsualArrayDeleteWantSize());
2067 Record.AddDeclRef(E->getOperatorDelete());
2068 Record.AddStmt(E->getArgument());
2069 Record.AddSourceLocation(E->getBeginLoc());
2070
2072}
2073
2074void ASTStmtWriter::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
2075 VisitExpr(E);
2076
2077 Record.AddStmt(E->getBase());
2078 Record.push_back(E->isArrow());
2079 Record.AddSourceLocation(E->getOperatorLoc());
2080 Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
2081 Record.AddTypeSourceInfo(E->getScopeTypeInfo());
2082 Record.AddSourceLocation(E->getColonColonLoc());
2083 Record.AddSourceLocation(E->getTildeLoc());
2084
2085 // PseudoDestructorTypeStorage.
2086 Record.AddIdentifierRef(E->getDestroyedTypeIdentifier());
2088 Record.AddSourceLocation(E->getDestroyedTypeLoc());
2089 else
2090 Record.AddTypeSourceInfo(E->getDestroyedTypeInfo());
2091
2093}
2094
2095void ASTStmtWriter::VisitExprWithCleanups(ExprWithCleanups *E) {
2096 VisitExpr(E);
2097 Record.push_back(E->getNumObjects());
2098 for (auto &Obj : E->getObjects()) {
2099 if (auto *BD = Obj.dyn_cast<BlockDecl *>()) {
2100 Record.push_back(serialization::COK_Block);
2101 Record.AddDeclRef(BD);
2102 } else if (auto *CLE = Obj.dyn_cast<CompoundLiteralExpr *>()) {
2103 Record.push_back(serialization::COK_CompoundLiteral);
2104 Record.AddStmt(CLE);
2105 }
2106 }
2107
2108 Record.push_back(E->cleanupsHaveSideEffects());
2109 Record.AddStmt(E->getSubExpr());
2111}
2112
2113void ASTStmtWriter::VisitCXXDependentScopeMemberExpr(
2115 VisitExpr(E);
2116
2117 // Don't emit anything here (or if you do you will have to update
2118 // the corresponding deserialization function).
2119 Record.push_back(E->getNumTemplateArgs());
2120 CurrentPackingBits.updateBits();
2121 CurrentPackingBits.addBit(E->hasTemplateKWAndArgsInfo());
2122 CurrentPackingBits.addBit(E->hasFirstQualifierFoundInScope());
2123
2124 if (E->hasTemplateKWAndArgsInfo()) {
2125 const ASTTemplateKWAndArgsInfo &ArgInfo =
2126 *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
2128 E->getTrailingObjects<TemplateArgumentLoc>());
2129 }
2130
2131 CurrentPackingBits.addBit(E->isArrow());
2132
2133 Record.AddTypeRef(E->getBaseType());
2134 Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
2135 CurrentPackingBits.addBit(!E->isImplicitAccess());
2136 if (!E->isImplicitAccess())
2137 Record.AddStmt(E->getBase());
2138
2139 Record.AddSourceLocation(E->getOperatorLoc());
2140
2141 if (E->hasFirstQualifierFoundInScope())
2142 Record.AddDeclRef(E->getFirstQualifierFoundInScope());
2143
2144 Record.AddDeclarationNameInfo(E->MemberNameInfo);
2146}
2147
2148void
2149ASTStmtWriter::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) {
2150 VisitExpr(E);
2151
2152 // Don't emit anything here, HasTemplateKWAndArgsInfo must be
2153 // emitted first.
2154 CurrentPackingBits.addBit(
2155 E->DependentScopeDeclRefExprBits.HasTemplateKWAndArgsInfo);
2156
2157 if (E->DependentScopeDeclRefExprBits.HasTemplateKWAndArgsInfo) {
2158 const ASTTemplateKWAndArgsInfo &ArgInfo =
2159 *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
2160 // 16 bits should be enought to store the number of args
2161 CurrentPackingBits.addBits(ArgInfo.NumTemplateArgs, /*Width=*/16);
2163 E->getTrailingObjects<TemplateArgumentLoc>());
2164 }
2165
2166 Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
2167 Record.AddDeclarationNameInfo(E->NameInfo);
2169}
2170
2171void
2172ASTStmtWriter::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E) {
2173 VisitExpr(E);
2174 Record.push_back(E->getNumArgs());
2176 ArgI = E->arg_begin(), ArgE = E->arg_end(); ArgI != ArgE; ++ArgI)
2177 Record.AddStmt(*ArgI);
2178 Record.AddTypeSourceInfo(E->getTypeSourceInfo());
2179 Record.AddSourceLocation(E->getLParenLoc());
2180 Record.AddSourceLocation(E->getRParenLoc());
2181 Record.push_back(E->isListInitialization());
2183}
2184
2185void ASTStmtWriter::VisitOverloadExpr(OverloadExpr *E) {
2186 VisitExpr(E);
2187
2188 Record.push_back(E->getNumDecls());
2189
2190 CurrentPackingBits.updateBits();
2191 CurrentPackingBits.addBit(E->hasTemplateKWAndArgsInfo());
2192 if (E->hasTemplateKWAndArgsInfo()) {
2193 const ASTTemplateKWAndArgsInfo &ArgInfo =
2195 Record.push_back(ArgInfo.NumTemplateArgs);
2197 }
2198
2200 OvE = E->decls_end();
2201 OvI != OvE; ++OvI) {
2202 Record.AddDeclRef(OvI.getDecl());
2203 Record.push_back(OvI.getAccess());
2204 }
2205
2206 Record.AddDeclarationNameInfo(E->getNameInfo());
2207 Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
2208}
2209
2210void ASTStmtWriter::VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
2211 VisitOverloadExpr(E);
2212 CurrentPackingBits.addBit(E->isArrow());
2213 CurrentPackingBits.addBit(E->hasUnresolvedUsing());
2214 CurrentPackingBits.addBit(!E->isImplicitAccess());
2215 if (!E->isImplicitAccess())
2216 Record.AddStmt(E->getBase());
2217
2218 Record.AddSourceLocation(E->getOperatorLoc());
2219
2220 Record.AddTypeRef(E->getBaseType());
2222}
2223
2224void ASTStmtWriter::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) {
2225 VisitOverloadExpr(E);
2226 CurrentPackingBits.addBit(E->requiresADL());
2227 Record.AddDeclRef(E->getNamingClass());
2229
2230 if (Writer.isWritingStdCXXNamedModules() && Writer.getChain()) {
2231 // Referencing all the possible declarations to make sure the change get
2232 // propagted.
2233 DeclarationName Name = E->getName();
2234 for (auto *Found :
2235 Record.getASTContext().getTranslationUnitDecl()->lookup(Name))
2236 if (Found->isFromASTFile())
2237 Writer.GetDeclRef(Found);
2238
2239 llvm::SmallVector<NamespaceDecl *> ExternalNSs;
2240 Writer.getChain()->ReadKnownNamespaces(ExternalNSs);
2241 for (auto *NS : ExternalNSs)
2242 for (auto *Found : NS->lookup(Name))
2243 Writer.GetDeclRef(Found);
2244 }
2245}
2246
2247void ASTStmtWriter::VisitTypeTraitExpr(TypeTraitExpr *E) {
2248 VisitExpr(E);
2249 Record.push_back(E->TypeTraitExprBits.IsBooleanTypeTrait);
2250 Record.push_back(E->TypeTraitExprBits.NumArgs);
2251 Record.push_back(E->TypeTraitExprBits.Kind); // FIXME: Stable encoding
2252
2253 if (E->TypeTraitExprBits.IsBooleanTypeTrait)
2254 Record.push_back(E->TypeTraitExprBits.Value);
2255 else
2256 Record.AddAPValue(E->getAPValue());
2257
2258 Record.AddSourceRange(E->getSourceRange());
2259 for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
2260 Record.AddTypeSourceInfo(E->getArg(I));
2262}
2263
2264void ASTStmtWriter::VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E) {
2265 VisitExpr(E);
2266 Record.push_back(E->getTrait());
2267 Record.push_back(E->getValue());
2268 Record.AddSourceRange(E->getSourceRange());
2269 Record.AddTypeSourceInfo(E->getQueriedTypeSourceInfo());
2270 Record.AddStmt(E->getDimensionExpression());
2272}
2273
2274void ASTStmtWriter::VisitExpressionTraitExpr(ExpressionTraitExpr *E) {
2275 VisitExpr(E);
2276 Record.push_back(E->getTrait());
2277 Record.push_back(E->getValue());
2278 Record.AddSourceRange(E->getSourceRange());
2279 Record.AddStmt(E->getQueriedExpression());
2281}
2282
2283void ASTStmtWriter::VisitCXXNoexceptExpr(CXXNoexceptExpr *E) {
2284 VisitExpr(E);
2285 Record.push_back(E->getValue());
2286 Record.AddSourceRange(E->getSourceRange());
2287 Record.AddStmt(E->getOperand());
2289}
2290
2291void ASTStmtWriter::VisitPackExpansionExpr(PackExpansionExpr *E) {
2292 VisitExpr(E);
2293 Record.AddSourceLocation(E->getEllipsisLoc());
2294 Record.push_back(E->NumExpansions);
2295 Record.AddStmt(E->getPattern());
2297}
2298
2299void ASTStmtWriter::VisitSizeOfPackExpr(SizeOfPackExpr *E) {
2300 VisitExpr(E);
2301 Record.push_back(E->isPartiallySubstituted() ? E->getPartialArguments().size()
2302 : 0);
2303 Record.AddSourceLocation(E->OperatorLoc);
2304 Record.AddSourceLocation(E->PackLoc);
2305 Record.AddSourceLocation(E->RParenLoc);
2306 Record.AddDeclRef(E->Pack);
2307 if (E->isPartiallySubstituted()) {
2308 for (const auto &TA : E->getPartialArguments())
2309 Record.AddTemplateArgument(TA);
2310 } else if (!E->isValueDependent()) {
2311 Record.push_back(E->getPackLength());
2312 }
2314}
2315
2316void ASTStmtWriter::VisitPackIndexingExpr(PackIndexingExpr *E) {
2317 VisitExpr(E);
2318 Record.push_back(E->PackIndexingExprBits.TransformedExpressions);
2319 Record.push_back(E->PackIndexingExprBits.FullySubstituted);
2320 Record.AddSourceLocation(E->getEllipsisLoc());
2321 Record.AddSourceLocation(E->getRSquareLoc());
2322 Record.AddStmt(E->getPackIdExpression());
2323 Record.AddStmt(E->getIndexExpr());
2324 for (Expr *Sub : E->getExpressions())
2325 Record.AddStmt(Sub);
2327}
2328
2329void ASTStmtWriter::VisitSubstNonTypeTemplateParmExpr(
2331 VisitExpr(E);
2332 Record.AddDeclRef(E->getAssociatedDecl());
2333 CurrentPackingBits.addBit(E->getFinal());
2334 CurrentPackingBits.addBits(E->getIndex(), /*Width=*/12);
2335 Record.writeUnsignedOrNone(E->getPackIndex());
2336 Record.AddTypeRef(E->getParameterType());
2337
2338 Record.AddSourceLocation(E->getNameLoc());
2339 Record.AddStmt(E->getReplacement());
2341}
2342
2343void ASTStmtWriter::VisitSubstNonTypeTemplateParmPackExpr(
2345 VisitExpr(E);
2346 Record.AddDeclRef(E->getAssociatedDecl());
2347 CurrentPackingBits.addBit(E->getFinal());
2348 Record.push_back(E->getIndex());
2349 Record.AddTemplateArgument(E->getArgumentPack());
2350 Record.AddSourceLocation(E->getParameterPackLocation());
2352}
2353
2354void ASTStmtWriter::VisitFunctionParmPackExpr(FunctionParmPackExpr *E) {
2355 VisitExpr(E);
2356 Record.push_back(E->getNumExpansions());
2357 Record.AddDeclRef(E->getParameterPack());
2358 Record.AddSourceLocation(E->getParameterPackLocation());
2359 for (FunctionParmPackExpr::iterator I = E->begin(), End = E->end();
2360 I != End; ++I)
2361 Record.AddDeclRef(*I);
2363}
2364
2365void ASTStmtWriter::VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E) {
2366 VisitExpr(E);
2367 Record.push_back(static_cast<bool>(E->getLifetimeExtendedTemporaryDecl()));
2369 Record.AddDeclRef(E->getLifetimeExtendedTemporaryDecl());
2370 else
2371 Record.AddStmt(E->getSubExpr());
2373}
2374
2375void ASTStmtWriter::VisitCXXFoldExpr(CXXFoldExpr *E) {
2376 VisitExpr(E);
2377 Record.AddSourceLocation(E->LParenLoc);
2378 Record.AddSourceLocation(E->EllipsisLoc);
2379 Record.AddSourceLocation(E->RParenLoc);
2380 Record.push_back(E->NumExpansions.toInternalRepresentation());
2381 Record.AddStmt(E->SubExprs[0]);
2382 Record.AddStmt(E->SubExprs[1]);
2383 Record.AddStmt(E->SubExprs[2]);
2384 Record.push_back(E->CXXFoldExprBits.Opcode);
2386}
2387
2388void ASTStmtWriter::VisitCXXParenListInitExpr(CXXParenListInitExpr *E) {
2389 VisitExpr(E);
2390 ArrayRef<Expr *> InitExprs = E->getInitExprs();
2391 Record.push_back(InitExprs.size());
2392 Record.push_back(E->getUserSpecifiedInitExprs().size());
2393 Record.AddSourceLocation(E->getInitLoc());
2394 Record.AddSourceLocation(E->getBeginLoc());
2395 Record.AddSourceLocation(E->getEndLoc());
2396 for (Expr *InitExpr : E->getInitExprs())
2397 Record.AddStmt(InitExpr);
2398 Expr *ArrayFiller = E->getArrayFiller();
2399 FieldDecl *UnionField = E->getInitializedFieldInUnion();
2400 bool HasArrayFillerOrUnionDecl = ArrayFiller || UnionField;
2401 Record.push_back(HasArrayFillerOrUnionDecl);
2402 if (HasArrayFillerOrUnionDecl) {
2403 Record.push_back(static_cast<bool>(ArrayFiller));
2404 if (ArrayFiller)
2405 Record.AddStmt(ArrayFiller);
2406 else
2407 Record.AddDeclRef(UnionField);
2408 }
2410}
2411
2412void ASTStmtWriter::VisitOpaqueValueExpr(OpaqueValueExpr *E) {
2413 VisitExpr(E);
2414 Record.AddStmt(E->getSourceExpr());
2415 Record.AddSourceLocation(E->getLocation());
2416 Record.push_back(E->isUnique());
2418}
2419
2420//===----------------------------------------------------------------------===//
2421// CUDA Expressions and Statements.
2422//===----------------------------------------------------------------------===//
2423
2424void ASTStmtWriter::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E) {
2425 VisitCallExpr(E);
2426 Record.AddStmt(E->getConfig());
2428}
2429
2430//===----------------------------------------------------------------------===//
2431// OpenCL Expressions and Statements.
2432//===----------------------------------------------------------------------===//
2433void ASTStmtWriter::VisitAsTypeExpr(AsTypeExpr *E) {
2434 VisitExpr(E);
2435 Record.AddSourceLocation(E->getBuiltinLoc());
2436 Record.AddSourceLocation(E->getRParenLoc());
2437 Record.AddStmt(E->getSrcExpr());
2439}
2440
2441//===----------------------------------------------------------------------===//
2442// Microsoft Expressions and Statements.
2443//===----------------------------------------------------------------------===//
2444void ASTStmtWriter::VisitMSPropertyRefExpr(MSPropertyRefExpr *E) {
2445 VisitExpr(E);
2446 Record.push_back(E->isArrow());
2447 Record.AddStmt(E->getBaseExpr());
2448 Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
2449 Record.AddSourceLocation(E->getMemberLoc());
2450 Record.AddDeclRef(E->getPropertyDecl());
2452}
2453
2454void ASTStmtWriter::VisitMSPropertySubscriptExpr(MSPropertySubscriptExpr *E) {
2455 VisitExpr(E);
2456 Record.AddStmt(E->getBase());
2457 Record.AddStmt(E->getIdx());
2458 Record.AddSourceLocation(E->getRBracketLoc());
2460}
2461
2462void ASTStmtWriter::VisitCXXUuidofExpr(CXXUuidofExpr *E) {
2463 VisitExpr(E);
2464 Record.AddSourceRange(E->getSourceRange());
2465 Record.AddDeclRef(E->getGuidDecl());
2466 if (E->isTypeOperand()) {
2467 Record.AddTypeSourceInfo(E->getTypeOperandSourceInfo());
2469 } else {
2470 Record.AddStmt(E->getExprOperand());
2472 }
2473}
2474
2475void ASTStmtWriter::VisitSEHExceptStmt(SEHExceptStmt *S) {
2476 VisitStmt(S);
2477 Record.AddSourceLocation(S->getExceptLoc());
2478 Record.AddStmt(S->getFilterExpr());
2479 Record.AddStmt(S->getBlock());
2481}
2482
2483void ASTStmtWriter::VisitSEHFinallyStmt(SEHFinallyStmt *S) {
2484 VisitStmt(S);
2485 Record.AddSourceLocation(S->getFinallyLoc());
2486 Record.AddStmt(S->getBlock());
2488}
2489
2490void ASTStmtWriter::VisitSEHTryStmt(SEHTryStmt *S) {
2491 VisitStmt(S);
2492 Record.push_back(S->getIsCXXTry());
2493 Record.AddSourceLocation(S->getTryLoc());
2494 Record.AddStmt(S->getTryBlock());
2495 Record.AddStmt(S->getHandler());
2497}
2498
2499void ASTStmtWriter::VisitSEHLeaveStmt(SEHLeaveStmt *S) {
2500 VisitStmt(S);
2501 Record.AddSourceLocation(S->getLeaveLoc());
2503}
2504
2505//===----------------------------------------------------------------------===//
2506// OpenMP Directives.
2507//===----------------------------------------------------------------------===//
2508
2509void ASTStmtWriter::VisitOMPCanonicalLoop(OMPCanonicalLoop *S) {
2510 VisitStmt(S);
2511 for (Stmt *SubStmt : S->SubStmts)
2512 Record.AddStmt(SubStmt);
2514}
2515
2516void ASTStmtWriter::VisitOMPExecutableDirective(OMPExecutableDirective *E) {
2517 Record.writeOMPChildren(E->Data);
2518 Record.AddSourceLocation(E->getBeginLoc());
2519 Record.AddSourceLocation(E->getEndLoc());
2520}
2521
2522void ASTStmtWriter::VisitOMPLoopBasedDirective(OMPLoopBasedDirective *D) {
2523 VisitStmt(D);
2524 Record.writeUInt32(D->getLoopsNumber());
2525 VisitOMPExecutableDirective(D);
2526}
2527
2528void ASTStmtWriter::VisitOMPLoopDirective(OMPLoopDirective *D) {
2529 VisitOMPLoopBasedDirective(D);
2530}
2531
2532void ASTStmtWriter::VisitOMPMetaDirective(OMPMetaDirective *D) {
2533 VisitStmt(D);
2534 Record.push_back(D->getNumClauses());
2535 VisitOMPExecutableDirective(D);
2537}
2538
2539void ASTStmtWriter::VisitOMPParallelDirective(OMPParallelDirective *D) {
2540 VisitStmt(D);
2541 VisitOMPExecutableDirective(D);
2542 Record.writeBool(D->hasCancel());
2544}
2545
2546void ASTStmtWriter::VisitOMPSimdDirective(OMPSimdDirective *D) {
2547 VisitOMPLoopDirective(D);
2549}
2550
2551void ASTStmtWriter::VisitOMPCanonicalLoopNestTransformationDirective(
2552 OMPCanonicalLoopNestTransformationDirective *D) {
2553 VisitOMPLoopBasedDirective(D);
2554 Record.writeUInt32(D->getNumGeneratedTopLevelLoops());
2555}
2556
2557void ASTStmtWriter::VisitOMPTileDirective(OMPTileDirective *D) {
2558 VisitOMPCanonicalLoopNestTransformationDirective(D);
2560}
2561
2562void ASTStmtWriter::VisitOMPStripeDirective(OMPStripeDirective *D) {
2563 VisitOMPCanonicalLoopNestTransformationDirective(D);
2565}
2566
2567void ASTStmtWriter::VisitOMPUnrollDirective(OMPUnrollDirective *D) {
2568 VisitOMPCanonicalLoopNestTransformationDirective(D);
2570}
2571
2572void ASTStmtWriter::VisitOMPReverseDirective(OMPReverseDirective *D) {
2573 VisitOMPCanonicalLoopNestTransformationDirective(D);
2575}
2576
2577void ASTStmtWriter::VisitOMPInterchangeDirective(OMPInterchangeDirective *D) {
2578 VisitOMPCanonicalLoopNestTransformationDirective(D);
2580}
2581
2582void ASTStmtWriter::VisitOMPSplitDirective(OMPSplitDirective *D) {
2583 VisitOMPCanonicalLoopNestTransformationDirective(D);
2585}
2586
2587void ASTStmtWriter::VisitOMPCanonicalLoopSequenceTransformationDirective(
2588 OMPCanonicalLoopSequenceTransformationDirective *D) {
2589 VisitStmt(D);
2590 VisitOMPExecutableDirective(D);
2591 Record.writeUInt32(D->getNumGeneratedTopLevelLoops());
2592}
2593
2594void ASTStmtWriter::VisitOMPFuseDirective(OMPFuseDirective *D) {
2595 VisitOMPCanonicalLoopSequenceTransformationDirective(D);
2597}
2598
2599void ASTStmtWriter::VisitOMPForDirective(OMPForDirective *D) {
2600 VisitOMPLoopDirective(D);
2601 Record.writeBool(D->hasCancel());
2603}
2604
2605void ASTStmtWriter::VisitOMPForSimdDirective(OMPForSimdDirective *D) {
2606 VisitOMPLoopDirective(D);
2608}
2609
2610void ASTStmtWriter::VisitOMPSectionsDirective(OMPSectionsDirective *D) {
2611 VisitStmt(D);
2612 VisitOMPExecutableDirective(D);
2613 Record.writeBool(D->hasCancel());
2615}
2616
2617void ASTStmtWriter::VisitOMPSectionDirective(OMPSectionDirective *D) {
2618 VisitStmt(D);
2619 VisitOMPExecutableDirective(D);
2620 Record.writeBool(D->hasCancel());
2622}
2623
2624void ASTStmtWriter::VisitOMPScopeDirective(OMPScopeDirective *D) {
2625 VisitStmt(D);
2626 VisitOMPExecutableDirective(D);
2628}
2629
2630void ASTStmtWriter::VisitOMPSingleDirective(OMPSingleDirective *D) {
2631 VisitStmt(D);
2632 VisitOMPExecutableDirective(D);
2634}
2635
2636void ASTStmtWriter::VisitOMPMasterDirective(OMPMasterDirective *D) {
2637 VisitStmt(D);
2638 VisitOMPExecutableDirective(D);
2640}
2641
2642void ASTStmtWriter::VisitOMPCriticalDirective(OMPCriticalDirective *D) {
2643 VisitStmt(D);
2644 VisitOMPExecutableDirective(D);
2645 Record.AddDeclarationNameInfo(D->getDirectiveName());
2647}
2648
2649void ASTStmtWriter::VisitOMPParallelForDirective(OMPParallelForDirective *D) {
2650 VisitOMPLoopDirective(D);
2651 Record.writeBool(D->hasCancel());
2653}
2654
2655void ASTStmtWriter::VisitOMPParallelForSimdDirective(
2656 OMPParallelForSimdDirective *D) {
2657 VisitOMPLoopDirective(D);
2659}
2660
2661void ASTStmtWriter::VisitOMPParallelMasterDirective(
2662 OMPParallelMasterDirective *D) {
2663 VisitStmt(D);
2664 VisitOMPExecutableDirective(D);
2666}
2667
2668void ASTStmtWriter::VisitOMPParallelMaskedDirective(
2669 OMPParallelMaskedDirective *D) {
2670 VisitStmt(D);
2671 VisitOMPExecutableDirective(D);
2673}
2674
2675void ASTStmtWriter::VisitOMPParallelSectionsDirective(
2676 OMPParallelSectionsDirective *D) {
2677 VisitStmt(D);
2678 VisitOMPExecutableDirective(D);
2679 Record.writeBool(D->hasCancel());
2681}
2682
2683void ASTStmtWriter::VisitOMPTaskDirective(OMPTaskDirective *D) {
2684 VisitStmt(D);
2685 VisitOMPExecutableDirective(D);
2686 Record.writeBool(D->hasCancel());
2688}
2689
2690void ASTStmtWriter::VisitOMPAtomicDirective(OMPAtomicDirective *D) {
2691 VisitStmt(D);
2692 VisitOMPExecutableDirective(D);
2693 Record.writeBool(D->isXLHSInRHSPart());
2694 Record.writeBool(D->isPostfixUpdate());
2695 Record.writeBool(D->isFailOnly());
2697}
2698
2699void ASTStmtWriter::VisitOMPTargetDirective(OMPTargetDirective *D) {
2700 VisitStmt(D);
2701 VisitOMPExecutableDirective(D);
2703}
2704
2705void ASTStmtWriter::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) {
2706 VisitStmt(D);
2707 VisitOMPExecutableDirective(D);
2709}
2710
2711void ASTStmtWriter::VisitOMPTargetEnterDataDirective(
2712 OMPTargetEnterDataDirective *D) {
2713 VisitStmt(D);
2714 VisitOMPExecutableDirective(D);
2716}
2717
2718void ASTStmtWriter::VisitOMPTargetExitDataDirective(
2719 OMPTargetExitDataDirective *D) {
2720 VisitStmt(D);
2721 VisitOMPExecutableDirective(D);
2723}
2724
2725void ASTStmtWriter::VisitOMPTargetParallelDirective(
2726 OMPTargetParallelDirective *D) {
2727 VisitStmt(D);
2728 VisitOMPExecutableDirective(D);
2729 Record.writeBool(D->hasCancel());
2731}
2732
2733void ASTStmtWriter::VisitOMPTargetParallelForDirective(
2734 OMPTargetParallelForDirective *D) {
2735 VisitOMPLoopDirective(D);
2736 Record.writeBool(D->hasCancel());
2738}
2739
2740void ASTStmtWriter::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) {
2741 VisitStmt(D);
2742 VisitOMPExecutableDirective(D);
2744}
2745
2746void ASTStmtWriter::VisitOMPBarrierDirective(OMPBarrierDirective *D) {
2747 VisitStmt(D);
2748 VisitOMPExecutableDirective(D);
2750}
2751
2752void ASTStmtWriter::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) {
2753 VisitStmt(D);
2754 Record.push_back(D->getNumClauses());
2755 VisitOMPExecutableDirective(D);
2757}
2758
2759void ASTStmtWriter::VisitOMPAssumeDirective(OMPAssumeDirective *D) {
2760 VisitStmt(D);
2761 VisitOMPExecutableDirective(D);
2763}
2764
2765void ASTStmtWriter::VisitOMPErrorDirective(OMPErrorDirective *D) {
2766 VisitStmt(D);
2767 Record.push_back(D->getNumClauses());
2768 VisitOMPExecutableDirective(D);
2770}
2771
2772void ASTStmtWriter::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) {
2773 VisitStmt(D);
2774 VisitOMPExecutableDirective(D);
2776}
2777
2778void ASTStmtWriter::VisitOMPFlushDirective(OMPFlushDirective *D) {
2779 VisitStmt(D);
2780 VisitOMPExecutableDirective(D);
2782}
2783
2784void ASTStmtWriter::VisitOMPDepobjDirective(OMPDepobjDirective *D) {
2785 VisitStmt(D);
2786 VisitOMPExecutableDirective(D);
2788}
2789
2790void ASTStmtWriter::VisitOMPScanDirective(OMPScanDirective *D) {
2791 VisitStmt(D);
2792 VisitOMPExecutableDirective(D);
2794}
2795
2796void ASTStmtWriter::VisitOMPOrderedDirective(OMPOrderedDirective *D) {
2797 VisitStmt(D);
2798 VisitOMPExecutableDirective(D);
2800}
2801
2802void ASTStmtWriter::VisitOMPTeamsDirective(OMPTeamsDirective *D) {
2803 VisitStmt(D);
2804 VisitOMPExecutableDirective(D);
2806}
2807
2808void ASTStmtWriter::VisitOMPCancellationPointDirective(
2809 OMPCancellationPointDirective *D) {
2810 VisitStmt(D);
2811 VisitOMPExecutableDirective(D);
2812 Record.writeEnum(D->getCancelRegion());
2814}
2815
2816void ASTStmtWriter::VisitOMPCancelDirective(OMPCancelDirective *D) {
2817 VisitStmt(D);
2818 VisitOMPExecutableDirective(D);
2819 Record.writeEnum(D->getCancelRegion());
2821}
2822
2823void ASTStmtWriter::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) {
2824 VisitOMPLoopDirective(D);
2825 Record.writeBool(D->hasCancel());
2827}
2828
2829void ASTStmtWriter::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) {
2830 VisitOMPLoopDirective(D);
2832}
2833
2834void ASTStmtWriter::VisitOMPMasterTaskLoopDirective(
2835 OMPMasterTaskLoopDirective *D) {
2836 VisitOMPLoopDirective(D);
2837 Record.writeBool(D->hasCancel());
2839}
2840
2841void ASTStmtWriter::VisitOMPMaskedTaskLoopDirective(
2842 OMPMaskedTaskLoopDirective *D) {
2843 VisitOMPLoopDirective(D);
2844 Record.writeBool(D->hasCancel());
2846}
2847
2848void ASTStmtWriter::VisitOMPMasterTaskLoopSimdDirective(
2849 OMPMasterTaskLoopSimdDirective *D) {
2850 VisitOMPLoopDirective(D);
2852}
2853
2854void ASTStmtWriter::VisitOMPMaskedTaskLoopSimdDirective(
2855 OMPMaskedTaskLoopSimdDirective *D) {
2856 VisitOMPLoopDirective(D);
2858}
2859
2860void ASTStmtWriter::VisitOMPParallelMasterTaskLoopDirective(
2861 OMPParallelMasterTaskLoopDirective *D) {
2862 VisitOMPLoopDirective(D);
2863 Record.writeBool(D->hasCancel());
2865}
2866
2867void ASTStmtWriter::VisitOMPParallelMaskedTaskLoopDirective(
2868 OMPParallelMaskedTaskLoopDirective *D) {
2869 VisitOMPLoopDirective(D);
2870 Record.writeBool(D->hasCancel());
2872}
2873
2874void ASTStmtWriter::VisitOMPParallelMasterTaskLoopSimdDirective(
2875 OMPParallelMasterTaskLoopSimdDirective *D) {
2876 VisitOMPLoopDirective(D);
2878}
2879
2880void ASTStmtWriter::VisitOMPParallelMaskedTaskLoopSimdDirective(
2881 OMPParallelMaskedTaskLoopSimdDirective *D) {
2882 VisitOMPLoopDirective(D);
2884}
2885
2886void ASTStmtWriter::VisitOMPDistributeDirective(OMPDistributeDirective *D) {
2887 VisitOMPLoopDirective(D);
2889}
2890
2891void ASTStmtWriter::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) {
2892 VisitStmt(D);
2893 VisitOMPExecutableDirective(D);
2895}
2896
2897void ASTStmtWriter::VisitOMPDistributeParallelForDirective(
2898 OMPDistributeParallelForDirective *D) {
2899 VisitOMPLoopDirective(D);
2900 Record.writeBool(D->hasCancel());
2902}
2903
2904void ASTStmtWriter::VisitOMPDistributeParallelForSimdDirective(
2905 OMPDistributeParallelForSimdDirective *D) {
2906 VisitOMPLoopDirective(D);
2908}
2909
2910void ASTStmtWriter::VisitOMPDistributeSimdDirective(
2911 OMPDistributeSimdDirective *D) {
2912 VisitOMPLoopDirective(D);
2914}
2915
2916void ASTStmtWriter::VisitOMPTargetParallelForSimdDirective(
2917 OMPTargetParallelForSimdDirective *D) {
2918 VisitOMPLoopDirective(D);
2920}
2921
2922void ASTStmtWriter::VisitOMPTargetSimdDirective(OMPTargetSimdDirective *D) {
2923 VisitOMPLoopDirective(D);
2925}
2926
2927void ASTStmtWriter::VisitOMPTeamsDistributeDirective(
2928 OMPTeamsDistributeDirective *D) {
2929 VisitOMPLoopDirective(D);
2931}
2932
2933void ASTStmtWriter::VisitOMPTeamsDistributeSimdDirective(
2934 OMPTeamsDistributeSimdDirective *D) {
2935 VisitOMPLoopDirective(D);
2937}
2938
2939void ASTStmtWriter::VisitOMPTeamsDistributeParallelForSimdDirective(
2940 OMPTeamsDistributeParallelForSimdDirective *D) {
2941 VisitOMPLoopDirective(D);
2943}
2944
2945void ASTStmtWriter::VisitOMPTeamsDistributeParallelForDirective(
2946 OMPTeamsDistributeParallelForDirective *D) {
2947 VisitOMPLoopDirective(D);
2948 Record.writeBool(D->hasCancel());
2950}
2951
2952void ASTStmtWriter::VisitOMPTargetTeamsDirective(OMPTargetTeamsDirective *D) {
2953 VisitStmt(D);
2954 VisitOMPExecutableDirective(D);
2956}
2957
2958void ASTStmtWriter::VisitOMPTargetTeamsDistributeDirective(
2959 OMPTargetTeamsDistributeDirective *D) {
2960 VisitOMPLoopDirective(D);
2962}
2963
2964void ASTStmtWriter::VisitOMPTargetTeamsDistributeParallelForDirective(
2965 OMPTargetTeamsDistributeParallelForDirective *D) {
2966 VisitOMPLoopDirective(D);
2967 Record.writeBool(D->hasCancel());
2969}
2970
2971void ASTStmtWriter::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
2972 OMPTargetTeamsDistributeParallelForSimdDirective *D) {
2973 VisitOMPLoopDirective(D);
2974 Code = serialization::
2975 STMT_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE;
2976}
2977
2978void ASTStmtWriter::VisitOMPTargetTeamsDistributeSimdDirective(
2979 OMPTargetTeamsDistributeSimdDirective *D) {
2980 VisitOMPLoopDirective(D);
2982}
2983
2984void ASTStmtWriter::VisitOMPInteropDirective(OMPInteropDirective *D) {
2985 VisitStmt(D);
2986 VisitOMPExecutableDirective(D);
2988}
2989
2990void ASTStmtWriter::VisitOMPDispatchDirective(OMPDispatchDirective *D) {
2991 VisitStmt(D);
2992 VisitOMPExecutableDirective(D);
2993 Record.AddSourceLocation(D->getTargetCallLoc());
2995}
2996
2997void ASTStmtWriter::VisitOMPMaskedDirective(OMPMaskedDirective *D) {
2998 VisitStmt(D);
2999 VisitOMPExecutableDirective(D);
3001}
3002
3003void ASTStmtWriter::VisitOMPGenericLoopDirective(OMPGenericLoopDirective *D) {
3004 VisitOMPLoopDirective(D);
3006}
3007
3008void ASTStmtWriter::VisitOMPTeamsGenericLoopDirective(
3009 OMPTeamsGenericLoopDirective *D) {
3010 VisitOMPLoopDirective(D);
3012}
3013
3014void ASTStmtWriter::VisitOMPTargetTeamsGenericLoopDirective(
3015 OMPTargetTeamsGenericLoopDirective *D) {
3016 VisitOMPLoopDirective(D);
3017 Record.writeBool(D->canBeParallelFor());
3019}
3020
3021void ASTStmtWriter::VisitOMPParallelGenericLoopDirective(
3022 OMPParallelGenericLoopDirective *D) {
3023 VisitOMPLoopDirective(D);
3025}
3026
3027void ASTStmtWriter::VisitOMPTargetParallelGenericLoopDirective(
3028 OMPTargetParallelGenericLoopDirective *D) {
3029 VisitOMPLoopDirective(D);
3031}
3032
3033//===----------------------------------------------------------------------===//
3034// OpenACC Constructs/Directives.
3035//===----------------------------------------------------------------------===//
3036void ASTStmtWriter::VisitOpenACCConstructStmt(OpenACCConstructStmt *S) {
3037 Record.push_back(S->clauses().size());
3038 Record.writeEnum(S->Kind);
3039 Record.AddSourceRange(S->Range);
3040 Record.AddSourceLocation(S->DirectiveLoc);
3041 Record.writeOpenACCClauseList(S->clauses());
3042}
3043
3044void ASTStmtWriter::VisitOpenACCAssociatedStmtConstruct(
3046 VisitOpenACCConstructStmt(S);
3047 Record.AddStmt(S->getAssociatedStmt());
3048}
3049
3050void ASTStmtWriter::VisitOpenACCComputeConstruct(OpenACCComputeConstruct *S) {
3051 VisitStmt(S);
3052 VisitOpenACCAssociatedStmtConstruct(S);
3054}
3055
3056void ASTStmtWriter::VisitOpenACCLoopConstruct(OpenACCLoopConstruct *S) {
3057 VisitStmt(S);
3058 VisitOpenACCAssociatedStmtConstruct(S);
3059 Record.writeEnum(S->getParentComputeConstructKind());
3061}
3062
3063void ASTStmtWriter::VisitOpenACCCombinedConstruct(OpenACCCombinedConstruct *S) {
3064 VisitStmt(S);
3065 VisitOpenACCAssociatedStmtConstruct(S);
3067}
3068
3069void ASTStmtWriter::VisitOpenACCDataConstruct(OpenACCDataConstruct *S) {
3070 VisitStmt(S);
3071 VisitOpenACCAssociatedStmtConstruct(S);
3073}
3074
3075void ASTStmtWriter::VisitOpenACCEnterDataConstruct(
3076 OpenACCEnterDataConstruct *S) {
3077 VisitStmt(S);
3078 VisitOpenACCConstructStmt(S);
3080}
3081
3082void ASTStmtWriter::VisitOpenACCExitDataConstruct(OpenACCExitDataConstruct *S) {
3083 VisitStmt(S);
3084 VisitOpenACCConstructStmt(S);
3086}
3087
3088void ASTStmtWriter::VisitOpenACCInitConstruct(OpenACCInitConstruct *S) {
3089 VisitStmt(S);
3090 VisitOpenACCConstructStmt(S);
3092}
3093
3094void ASTStmtWriter::VisitOpenACCShutdownConstruct(OpenACCShutdownConstruct *S) {
3095 VisitStmt(S);
3096 VisitOpenACCConstructStmt(S);
3098}
3099
3100void ASTStmtWriter::VisitOpenACCSetConstruct(OpenACCSetConstruct *S) {
3101 VisitStmt(S);
3102 VisitOpenACCConstructStmt(S);
3104}
3105
3106void ASTStmtWriter::VisitOpenACCUpdateConstruct(OpenACCUpdateConstruct *S) {
3107 VisitStmt(S);
3108 VisitOpenACCConstructStmt(S);
3110}
3111
3112void ASTStmtWriter::VisitOpenACCHostDataConstruct(OpenACCHostDataConstruct *S) {
3113 VisitStmt(S);
3114 VisitOpenACCAssociatedStmtConstruct(S);
3116}
3117
3118void ASTStmtWriter::VisitOpenACCWaitConstruct(OpenACCWaitConstruct *S) {
3119 VisitStmt(S);
3120 Record.push_back(S->getExprs().size());
3121 VisitOpenACCConstructStmt(S);
3122 Record.AddSourceLocation(S->LParenLoc);
3123 Record.AddSourceLocation(S->RParenLoc);
3124 Record.AddSourceLocation(S->QueuesLoc);
3125
3126 for(Expr *E : S->getExprs())
3127 Record.AddStmt(E);
3128
3130}
3131
3132void ASTStmtWriter::VisitOpenACCAtomicConstruct(OpenACCAtomicConstruct *S) {
3133 VisitStmt(S);
3134 VisitOpenACCConstructStmt(S);
3135 Record.writeEnum(S->getAtomicKind());
3136 Record.AddStmt(S->getAssociatedStmt());
3137
3139}
3140
3141void ASTStmtWriter::VisitOpenACCCacheConstruct(OpenACCCacheConstruct *S) {
3142 VisitStmt(S);
3143 Record.push_back(S->getVarList().size());
3144 VisitOpenACCConstructStmt(S);
3145 Record.AddSourceRange(S->ParensLoc);
3146 Record.AddSourceLocation(S->ReadOnlyLoc);
3147
3148 for (Expr *E : S->getVarList())
3149 Record.AddStmt(E);
3151}
3152
3153//===----------------------------------------------------------------------===//
3154// HLSL Constructs/Directives.
3155//===----------------------------------------------------------------------===//
3156
3157void ASTStmtWriter::VisitHLSLOutArgExpr(HLSLOutArgExpr *S) {
3158 VisitExpr(S);
3159 Record.AddStmt(S->getOpaqueArgLValue());
3160 Record.AddStmt(S->getCastedTemporary());
3161 Record.AddStmt(S->getWritebackCast());
3162 Record.writeBool(S->isInOut());
3164}
3165
3166//===----------------------------------------------------------------------===//
3167// ASTWriter Implementation
3168//===----------------------------------------------------------------------===//
3169
3171 assert(!SwitchCaseIDs.contains(S) && "SwitchCase recorded twice");
3172 unsigned NextID = SwitchCaseIDs.size();
3173 SwitchCaseIDs[S] = NextID;
3174 return NextID;
3175}
3176
3178 assert(SwitchCaseIDs.contains(S) && "SwitchCase hasn't been seen yet");
3179 return SwitchCaseIDs[S];
3180}
3181
3183 SwitchCaseIDs.clear();
3184}
3185
3186/// Write the given substatement or subexpression to the
3187/// bitstream.
3188void ASTWriter::WriteSubStmt(ASTContext &Context, Stmt *S) {
3190 ASTStmtWriter Writer(Context, *this, Record);
3191 ++NumStatements;
3192
3193 if (!S) {
3194 Stream.EmitRecord(serialization::STMT_NULL_PTR, Record);
3195 return;
3196 }
3197
3198 llvm::DenseMap<Stmt *, uint64_t>::iterator I = SubStmtEntries.find(S);
3199 if (I != SubStmtEntries.end()) {
3200 Record.push_back(I->second);
3201 Stream.EmitRecord(serialization::STMT_REF_PTR, Record);
3202 return;
3203 }
3204
3205#ifndef NDEBUG
3206 assert(!ParentStmts.count(S) && "There is a Stmt cycle!");
3207
3208 struct ParentStmtInserterRAII {
3209 Stmt *S;
3210 llvm::DenseSet<Stmt *> &ParentStmts;
3211
3212 ParentStmtInserterRAII(Stmt *S, llvm::DenseSet<Stmt *> &ParentStmts)
3213 : S(S), ParentStmts(ParentStmts) {
3214 ParentStmts.insert(S);
3215 }
3216 ~ParentStmtInserterRAII() {
3217 ParentStmts.erase(S);
3218 }
3219 };
3220
3221 ParentStmtInserterRAII ParentStmtInserter(S, ParentStmts);
3222#endif
3223
3224 Writer.Visit(S);
3225
3226 uint64_t Offset = Writer.Emit();
3227 SubStmtEntries[S] = Offset;
3228}
3229
3230/// Flush all of the statements that have been added to the
3231/// queue via AddStmt().
3232void ASTRecordWriter::FlushStmts() {
3233 // We expect to be the only consumer of the two temporary statement maps,
3234 // assert that they are empty.
3235 assert(Writer->SubStmtEntries.empty() && "unexpected entries in sub-stmt map");
3236 assert(Writer->ParentStmts.empty() && "unexpected entries in parent stmt map");
3237
3238 for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) {
3239 Writer->WriteSubStmt(getASTContext(), StmtsToEmit[I]);
3240
3241 assert(N == StmtsToEmit.size() && "record modified while being written!");
3242
3243 // Note that we are at the end of a full expression. Any
3244 // expression records that follow this one are part of a different
3245 // expression.
3246 Writer->Stream.EmitRecord(serialization::STMT_STOP, ArrayRef<uint32_t>());
3247
3248 Writer->SubStmtEntries.clear();
3249 Writer->ParentStmts.clear();
3250 }
3251
3252 StmtsToEmit.clear();
3253}
3254
3255void ASTRecordWriter::FlushSubStmts() {
3256 // For a nested statement, write out the substatements in reverse order (so
3257 // that a simple stack machine can be used when loading), and don't emit a
3258 // STMT_STOP after each one.
3259 for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) {
3260 Writer->WriteSubStmt(getASTContext(), StmtsToEmit[N - I - 1]);
3261 assert(N == StmtsToEmit.size() && "record modified while being written!");
3262 }
3263
3264 StmtsToEmit.clear();
3265}
This file provides AST data structures related to concepts.
Defines the clang::ASTContext interface.
static void addConstraintSatisfaction(ASTRecordWriter &Record, const ASTConstraintSatisfaction &Satisfaction)
static void addSubstitutionDiagnostic(ASTRecordWriter &Record, const concepts::Requirement::SubstitutionDiagnostic *D)
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines the C++ template declaration subclasses.
static DiagnosticBuilder Diag(DiagnosticsEngine *Diags, const LangOptions &Features, FullSourceLoc TokLoc, const char *TokBegin, const char *TokRangeBegin, const char *TokRangeEnd, unsigned DiagID)
Produce a diagnostic highlighting some portion of a literal.
llvm::MachO::Record Record
Definition MachO.h:31
C Language Family Type Representation.
OpenMPDirectiveKind getCancelRegion() const
Get cancellation region for the current cancellation point.
OpenMPDirectiveKind getCancelRegion() const
Get cancellation region for the current cancellation point.
SourceLocation getTargetCallLoc() const
Return location of target-call.
bool hasCancel() const
Return true if current directive has inner cancel directive.
bool hasCancel() const
Return true if current directive has inner cancel directive.
bool hasCancel() const
Return true if current directive has inner cancel directive.
bool hasCancel() const
Return true if current directive has inner cancel directive.
bool hasCancel() const
Return true if current directive has inner cancel directive.
bool hasCancel() const
Return true if current directive has inner cancel directive.
bool hasCancel() const
Return true if current directive has inner cancel directive.
bool hasCancel() const
Return true if current directive has inner cancel directive.
bool canBeParallelFor() const
Return true if current loop directive's associated loop can be a parallel for.
bool hasCancel() const
Return true if current directive has inner cancel directive.
bool hasCancel() const
Return true if current directive has inner cancel directive.
const Stmt * getAssociatedStmt() const
OpenACCAtomicKind getAtomicKind() const
ArrayRef< Expr * > getVarList() const
OpenACCDirectiveKind getParentComputeConstructKind() const
unsigned getBitWidth() const
llvm::APInt getValue() const
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition ASTContext.h: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:4387
SourceLocation getQuestionLoc() const
Definition Expr.h:4386
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition Expr.h:4556
SourceLocation getAmpAmpLoc() const
Definition Expr.h:4571
SourceLocation getLabelLoc() const
Definition Expr.h:4573
LabelDecl * getLabel() const
Definition Expr.h:4579
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Definition Expr.h:6033
Represents a loop initializing the elements of an array.
Definition Expr.h:5980
This class represents BOTH the OpenMP Array Section and OpenACC 'subarray', with a boolean differenti...
Definition Expr.h:7231
SourceLocation getRBracketLoc() const
Definition Expr.h:7346
Expr * getBase()
Get base of the array section.
Definition Expr.h:7309
Expr * getLength()
Get length of array section.
Definition Expr.h:7319
bool isOMPArraySection() const
Definition Expr.h:7305
Expr * getStride()
Get stride of array section.
Definition Expr.h:7323
SourceLocation getColonLocSecond() const
Definition Expr.h:7341
Expr * getLowerBound()
Get lower bound of array section.
Definition Expr.h:7313
SourceLocation getColonLocFirst() const
Definition Expr.h:7340
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition Expr.h:2727
SourceLocation getRBracketLoc() const
Definition Expr.h:2775
Expr * getLHS()
An array access can be written A[4] or 4[A] (both are equivalent).
Definition Expr.h:2756
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
Definition ExprCXX.h:2999
uint64_t getValue() const
Definition ExprCXX.h:3047
ArrayTypeTrait getTrait() const
Definition ExprCXX.h:3039
Expr * getDimensionExpression() const
Definition ExprCXX.h:3049
TypeSourceInfo * getQueriedTypeSourceInfo() const
Definition ExprCXX.h:3045
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Definition Expr.h:6745
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition Expr.h:6764
SourceLocation getBuiltinLoc() const
getBuiltinLoc - Return the location of the __builtin_astype token.
Definition Expr.h:6767
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
Definition Expr.h:6770
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
Definition Stmt.h:3286
bool isVolatile() const
Definition Stmt.h:3322
SourceLocation getAsmLoc() const
Definition Stmt.h:3316
unsigned getNumClobbers() const
Definition Stmt.h:3377
unsigned getNumOutputs() const
Definition Stmt.h:3345
unsigned getNumInputs() const
Definition Stmt.h:3367
bool isSimple() const
Definition Stmt.h:3319
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Definition Expr.h:6940
Expr ** getSubExprs()
Definition Expr.h:7015
SourceLocation getRParenLoc() const
Definition Expr.h:7069
static unsigned getNumSubExprs(AtomicOp Op)
Determine the number of arguments the specified atomic builtin should have.
Definition Expr.cpp:5281
AtomicOp getOp() const
Definition Expr.h:7003
SourceLocation getBuiltinLoc() const
Definition Expr.h:7068
Represents an attribute applied to a statement.
Definition Stmt.h:2212
Stmt * getSubStmt()
Definition Stmt.h:2248
SourceLocation getAttrLoc() const
Definition Stmt.h:2243
ArrayRef< const Attr * > getAttrs() const
Definition Stmt.h:2244
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Definition Expr.h:4459
Expr * getFalseExpr() const
getFalseExpr - Return the subexpression which will be evaluated if the condition evaluates to false; ...
Definition Expr.h:4513
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
Definition Expr.h:4497
Expr * getCond() const
getCond - Return the condition expression; this is defined in terms of the opaque value.
Definition Expr.h:4501
Expr * getTrueExpr() const
getTrueExpr - Return the subexpression which will be evaluated if the condition evaluates to true; th...
Definition Expr.h:4506
Expr * getCommon() const
getCommon - Return the common expression, written to the left of the condition.
Definition Expr.h:4494
A builtin binary operation expression such as "x + y" or "x <= y".
Definition Expr.h:4044
Expr * getLHS() const
Definition Expr.h:4094
SourceLocation getOperatorLoc() const
Definition Expr.h:4086
bool hasStoredFPFeatures() const
Definition Expr.h:4229
Expr * getRHS() const
Definition Expr.h:4096
FPOptionsOverride getStoredFPFeatures() const
Get FPFeatures from trailing storage.
Definition Expr.h:4241
Opcode getOpcode() const
Definition Expr.h:4089
bool hasExcludedOverflowPattern() const
Definition Expr.h:4236
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:6684
const BlockDecl * getBlockDecl() const
Definition Expr.h:6696
BreakStmt - This represents a break.
Definition Stmt.h:3144
Represents a C++2a __builtin_bit_cast(T, v) expression.
Definition ExprCXX.h:5475
SourceLocation getEndLoc() const LLVM_READONLY
Definition ExprCXX.h:5494
SourceLocation getBeginLoc() const LLVM_READONLY
Definition ExprCXX.h:5493
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr....
Definition Expr.h:3975
SourceLocation getRParenLoc() const
Definition Expr.h:4010
SourceLocation getLParenLoc() const
Definition Expr.h:4007
Represents a call to a CUDA kernel function.
Definition ExprCXX.h:237
const CallExpr * getConfig() const
Definition ExprCXX.h:263
A C++ addrspace_cast expression (currently only enabled for OpenCL).
Definition ExprCXX.h:607
Represents binding an expression to a temporary.
Definition ExprCXX.h:1496
CXXTemporary * getTemporary()
Definition ExprCXX.h:1514
const Expr * getSubExpr() const
Definition ExprCXX.h:1518
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition ExprCXX.h:726
bool getValue() const
Definition ExprCXX.h:743
SourceLocation getLocation() const
Definition ExprCXX.h:749
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:569
Represents a call to a C++ constructor.
Definition ExprCXX.h:1551
SourceRange getParenOrBraceRange() const
Definition ExprCXX.h:1732
bool isElidable() const
Whether this construction is elidable.
Definition ExprCXX.h:1620
bool hadMultipleCandidates() const
Whether the referred constructor was resolved from an overloaded set having size greater than 1.
Definition ExprCXX.h:1625
Expr * getArg(unsigned Arg)
Return the specified argument.
Definition ExprCXX.h:1694
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
Definition ExprCXX.h:1644
bool isImmediateEscalating() const
Definition ExprCXX.h:1709
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called.
Definition ExprCXX.h:1653
SourceLocation getLocation() const
Definition ExprCXX.h:1616
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
Definition ExprCXX.h:1614
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
Definition ExprCXX.h:1633
unsigned getNumArgs() const
Return the number of arguments to the constructor call.
Definition ExprCXX.h:1691
CXXConstructionKind getConstructionKind() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
Definition ExprCXX.h:1662
A default argument (C++ [dcl.fct.default]).
Definition ExprCXX.h:1273
SourceLocation getUsedLocation() const
Retrieve the location where this default argument was actually used.
Definition ExprCXX.h:1347
const ParmVarDecl * getParam() const
Definition ExprCXX.h:1315
const DeclContext * getUsedContext() const
Definition ExprCXX.h:1343
bool hasRewrittenInit() const
Definition ExprCXX.h:1318
A use of a default initializer in a constructor or in aggregate initialization.
Definition ExprCXX.h:1380
const DeclContext * getUsedContext() const
Definition ExprCXX.h:1437
const Expr * getRewrittenExpr() const
Retrieve the initializing expression with evaluated immediate calls, if any.
Definition ExprCXX.h:1425
bool hasRewrittenInit() const
Definition ExprCXX.h:1409
FieldDecl * getField()
Get the field whose initializer will be used.
Definition ExprCXX.h:1414
Represents a delete expression for memory deallocation and destructor calls, e.g.
Definition ExprCXX.h:2629
FunctionDecl * getOperatorDelete() const
Definition ExprCXX.h:2668
bool isArrayForm() const
Definition ExprCXX.h:2655
SourceLocation getBeginLoc() const
Definition ExprCXX.h:2679
bool isGlobalDelete() const
Definition ExprCXX.h:2654
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
Definition ExprCXX.h:2664
bool isArrayFormAsWritten() const
Definition ExprCXX.h:2656
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition ExprCXX.h:3869
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '.
Definition ExprCXX.h:3968
SourceLocation getOperatorLoc() const
Retrieve the location of the '->' or '.' operator.
Definition ExprCXX.h:3971
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition ExprCXX.h:4063
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:3995
Expr * getBase() const
Retrieve the base object of this member expressions, e.g., the x in x.m.
Definition ExprCXX.h:3959
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the member name, with source location information.
Definition ExprCXX.h:3982
bool isImplicitAccess() const
True if this is an implicit access, i.e.
Definition ExprCXX.h:3951
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Definition ExprCXX.h:484
Helper that selects an expression from an InitListExpr depending on the current expansion index.
Definition ExprCXX.h:5557
InitListExpr * getRangeExpr()
Definition ExprCXX.h:5567
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:5031
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:1834
SourceLocation getLParenLoc() const
Definition ExprCXX.h:1871
SourceLocation getRParenLoc() const
Definition ExprCXX.h:1873
Represents a call to an inherited base class constructor from an inheriting constructor.
Definition ExprCXX.h:1754
bool constructsVBase() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
Definition ExprCXX.h:1795
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will call.
Definition ExprCXX.h:1791
SourceLocation getLocation() const LLVM_READONLY
Definition ExprCXX.h:1807
bool inheritedFromVBase() const
Determine whether the inherited constructor is inherited from a virtual base of the object we constru...
Definition ExprCXX.h:1805
Represents a call to a member function that may be written either with member call syntax (e....
Definition ExprCXX.h:182
Abstract class common to all of the C++ "named"/"keyword" casts.
Definition ExprCXX.h:378
SourceLocation getOperatorLoc() const
Retrieve the location of the cast operator keyword, e.g., static_cast.
Definition ExprCXX.h:409
SourceRange getAngleBrackets() const LLVM_READONLY
Definition ExprCXX.h:416
SourceLocation getRParenLoc() const
Retrieve the location of the closing parenthesis.
Definition ExprCXX.h:412
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Definition ExprCXX.h:2358
bool isArray() const
Definition ExprCXX.h:2467
SourceRange getDirectInitRange() const
Definition ExprCXX.h:2612
ExprIterator arg_iterator
Definition ExprCXX.h:2572
ImplicitAllocationParameters implicitAllocationParameters() const
Provides the full set of information about expected implicit parameters in this call.
Definition ExprCXX.h:2565
bool hasInitializer() const
Whether this new-expression has any initializer at all.
Definition ExprCXX.h:2527
FunctionDecl * getOperatorDelete() const
Definition ExprCXX.h:2464
unsigned getNumPlacementArgs() const
Definition ExprCXX.h:2497
TypeSourceInfo * getAllocatedTypeSourceInfo() const
Definition ExprCXX.h:2441
SourceRange getSourceRange() const
Definition ExprCXX.h:2613
SourceRange getTypeIdParens() const
Definition ExprCXX.h:2519
bool isParenTypeId() const
Definition ExprCXX.h:2518
raw_arg_iterator raw_arg_end()
Definition ExprCXX.h:2599
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
Definition ExprCXX.h:2559
raw_arg_iterator raw_arg_begin()
Definition ExprCXX.h:2598
FunctionDecl * getOperatorNew() const
Definition ExprCXX.h:2462
bool isGlobalNew() const
Definition ExprCXX.h:2524
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition ExprCXX.h:4308
bool getValue() const
Definition ExprCXX.h:4331
Expr * getOperand() const
Definition ExprCXX.h:4325
SourceRange getSourceRange() const
Definition ExprCXX.h:4329
The null pointer literal (C++11 [lex.nullptr])
Definition ExprCXX.h:771
SourceLocation getLocation() const
Definition ExprCXX.h:785
A call to an overloaded operator written using operator syntax.
Definition ExprCXX.h:84
bool isReversed() const
Whether this is a C++20 rewritten reversed operator.
Definition ExprCXX.h:145
OverloadedOperatorKind getOperator() const
Returns the kind of overloaded operator that this expression refers to.
Definition ExprCXX.h:114
Represents a list-initialization with parenthesis.
Definition ExprCXX.h:5140
SourceLocation getEndLoc() const LLVM_READONLY
Definition ExprCXX.h:5196
SourceLocation getInitLoc() const LLVM_READONLY
Definition ExprCXX.h:5198
MutableArrayRef< Expr * > getInitExprs()
Definition ExprCXX.h:5180
SourceLocation getBeginLoc() const LLVM_READONLY
Definition ExprCXX.h:5194
MutableArrayRef< Expr * > getUserSpecifiedInitExprs()
Definition ExprCXX.h:5186
FieldDecl * getInitializedFieldInUnion()
Definition ExprCXX.h:5218
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition ExprCXX.h:2748
TypeSourceInfo * getDestroyedTypeInfo() const
Retrieve the source location information for the type being destroyed.
Definition ExprCXX.h:2842
bool isArrow() const
Determine whether this pseudo-destructor expression was written using an '->' (otherwise,...
Definition ExprCXX.h:2812
TypeSourceInfo * getScopeTypeInfo() const
Retrieve the scope type in a qualified pseudo-destructor expression.
Definition ExprCXX.h:2826
SourceLocation getTildeLoc() const
Retrieve the location of the '~'.
Definition ExprCXX.h:2833
NestedNameSpecifierLoc getQualifierLoc() const
Retrieves the nested-name-specifier that qualifies the type name, with source-location information.
Definition ExprCXX.h:2801
SourceLocation getDestroyedTypeLoc() const
Retrieve the starting location of the type being destroyed.
Definition ExprCXX.h:2857
SourceLocation getColonColonLoc() const
Retrieve the location of the '::' in a qualified pseudo-destructor expression.
Definition ExprCXX.h:2830
SourceLocation getOperatorLoc() const
Retrieve the location of the '.' or '->' operator.
Definition ExprCXX.h:2815
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:2849
Represents a C++26 reflect expression [expr.reflect].
Definition ExprCXX.h:5507
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
Definition ExprCXX.h:529
A rewritten comparison expression that was originally written using operator syntax.
Definition ExprCXX.h:289
Expr * getSemanticForm()
Get an equivalent semantic form for this expression.
Definition ExprCXX.h:307
bool isReversed() const
Determine whether this expression was rewritten in reverse form.
Definition ExprCXX.h:325
An expression "T()" which creates an rvalue of a non-class type T.
Definition ExprCXX.h:2199
TypeSourceInfo * getTypeSourceInfo() const
Definition ExprCXX.h:2218
SourceLocation getRParenLoc() const
Definition ExprCXX.h:2222
A C++ static_cast expression (C++ [expr.static.cast]).
Definition ExprCXX.h:439
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition ExprCXX.h:803
Represents a C++ functional cast expression that builds a temporary object.
Definition ExprCXX.h:1902
TypeSourceInfo * getTypeSourceInfo() const
Definition ExprCXX.h:1931
Represents the this expression in C++.
Definition ExprCXX.h:1157
bool isCapturedByCopyInLambdaWithExplicitObjectParameter() const
Definition ExprCXX.h:1183
bool isImplicit() const
Definition ExprCXX.h:1180
SourceLocation getLocation() const
Definition ExprCXX.h:1174
A C++ throw-expression (C++ [except.throw]).
Definition ExprCXX.h:1211
const Expr * getSubExpr() const
Definition ExprCXX.h:1231
SourceLocation getThrowLoc() const
Definition ExprCXX.h:1234
bool isThrownVariableInScope() const
Determines whether the variable thrown by this expression (if any!) is within the innermost try block...
Definition ExprCXX.h:1241
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:851
bool isTypeOperand() const
Definition ExprCXX.h:887
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition ExprCXX.h:894
Expr * getExprOperand() const
Definition ExprCXX.h:898
SourceRange getSourceRange() const LLVM_READONLY
Definition ExprCXX.h:905
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition ExprCXX.h:3743
SourceLocation getLParenLoc() const
Retrieve the location of the left parentheses ('(') that precedes the argument list.
Definition ExprCXX.h:3787
bool isListInitialization() const
Determine whether this expression models list-initialization.
Definition ExprCXX.h:3798
TypeSourceInfo * getTypeSourceInfo() const
Retrieve the type source information for the type being constructed.
Definition ExprCXX.h:3781
SourceLocation getRParenLoc() const
Retrieve the location of the right parentheses (')') that follows the argument list.
Definition ExprCXX.h:3792
unsigned getNumArgs() const
Retrieve the number of arguments.
Definition ExprCXX.h:3801
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
Definition ExprCXX.h:1071
Expr * getExprOperand() const
Definition ExprCXX.h:1112
MSGuidDecl * getGuidDecl() const
Definition ExprCXX.h:1117
bool isTypeOperand() const
Definition ExprCXX.h:1101
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition ExprCXX.h:1108
SourceRange getSourceRange() const LLVM_READONLY
Definition ExprCXX.h:1121
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition Expr.h:2949
bool hasStoredFPFeatures() const
Definition Expr.h:3108
bool usesMemberSyntax() const
Definition Expr.h:3110
ExprIterator arg_iterator
Definition Expr.h:3196
arg_iterator arg_begin()
Definition Expr.h:3206
arg_iterator arg_end()
Definition Expr.h:3209
ADLCallKind getADLCallKind() const
Definition Expr.h:3100
Expr * getCallee()
Definition Expr.h:3096
FPOptionsOverride getFPFeatures() const
Definition Expr.h:3248
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition Expr.h:3140
bool isCoroElideSafe() const
Definition Expr.h:3123
SourceLocation getRParenLoc() const
Definition Expr.h:3280
This captures a statement into a function.
Definition Stmt.h:3946
capture_init_range capture_inits()
Definition Stmt.h:4114
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:4097
const RecordDecl * getCapturedRecordDecl() const
Retrieve the record declaration for captured variables.
Definition Stmt.h:4067
Stmt * getCapturedStmt()
Retrieve the statement being captured.
Definition Stmt.h:4050
capture_iterator capture_begin()
Retrieve an iterator pointing to the first capture.
Definition Stmt.h:4092
capture_range captures()
Definition Stmt.h:4084
CapturedRegionKind getCapturedRegionKind() const
Retrieve the captured region kind.
Definition Stmt.cpp:1508
CaseStmt - Represent a case statement.
Definition Stmt.h:1929
Stmt * getSubStmt()
Definition Stmt.h:2042
Expr * getLHS()
Definition Stmt.h:2012
bool caseStmtIsGNURange() const
True if this case statement is of the form case LHS ... RHS, which is a GNU extension.
Definition Stmt.h:1992
SourceLocation getEllipsisLoc() const
Get the location of the ... in a case statement of the form LHS ... RHS.
Definition Stmt.h:1998
Expr * getRHS()
Definition Stmt.h:2024
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition Expr.h:3682
path_iterator path_begin()
Definition Expr.h:3752
unsigned path_size() const
Definition Expr.h:3751
CastKind getCastKind() const
Definition Expr.h:3726
bool hasStoredFPFeatures() const
Definition Expr.h:3781
path_iterator path_end()
Definition Expr.h:3753
CXXBaseSpecifier ** path_iterator
Definition Expr.h:3748
FPOptionsOverride getFPFeatures() const
Definition Expr.h:3802
Expr * getSubExpr()
Definition Expr.h:3732
SourceLocation getLocation() const
Definition Expr.h:1627
unsigned getValue() const
Definition Expr.h:1635
CharacterLiteralKind getKind() const
Definition Expr.h:1628
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition Expr.h:4854
SourceLocation getBuiltinLoc() const
Definition Expr.h:4901
Expr * getLHS() const
Definition Expr.h:4896
bool isConditionDependent() const
Definition Expr.h:4884
bool isConditionTrue() const
isConditionTrue - Return whether the condition is true (i.e.
Definition Expr.h:4877
Expr * getRHS() const
Definition Expr.h:4898
SourceLocation getRParenLoc() const
Definition Expr.h:4904
Expr * getCond() const
Definition Expr.h:4894
Represents a 'co_await' expression.
Definition ExprCXX.h:5368
bool isImplicit() const
Definition ExprCXX.h:5390
CompoundAssignOperator - For compound assignments (e.g.
Definition Expr.h:4306
QualType getComputationLHSType() const
Definition Expr.h:4340
QualType getComputationResultType() const
Definition Expr.h:4343
CompoundLiteralExpr - [C99 6.5.2.5].
Definition Expr.h:3611
SourceLocation getLParenLoc() const
Definition Expr.h:3646
bool isFileScope() const
Definition Expr.h:3643
const Expr * getInitializer() const
Definition Expr.h:3639
TypeSourceInfo * getTypeSourceInfo() const
Definition Expr.h:3649
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition Stmt.h:1749
unsigned size() const
Definition Stmt.h:1794
FPOptionsOverride getStoredFPFeatures() const
Get FPOptionsOverride from trailing storage.
Definition Stmt.h:1799
body_range body()
Definition Stmt.h:1812
SourceLocation getLBracLoc() const
Definition Stmt.h:1866
bool hasStoredFPFeatures() const
Definition Stmt.h:1796
SourceLocation getRBracLoc() const
Definition Stmt.h:1867
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:4397
Expr * getLHS() const
Definition Expr.h:4431
Expr * getCond() const
getCond - Return the expression representing the condition for the ?
Definition Expr.h:4420
Expr * getRHS() const
Definition Expr.h:4432
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition Expr.h:1088
ConstantResultStorageKind getResultStorageKind() const
Definition Expr.h:1157
ContinueStmt - This represents a continue.
Definition Stmt.h:3128
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition Expr.h:4725
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
Definition Expr.h:4829
SourceLocation getBuiltinLoc() const
getBuiltinLoc - Return the location of the __builtin_convertvector token.
Definition Expr.h:4826
FPOptionsOverride getStoredFPFeatures() const
Get FPFeatures from trailing storage.
Definition Expr.h:4788
TypeSourceInfo * getTypeSourceInfo() const
getTypeSourceInfo - Return the destination type.
Definition Expr.h:4818
bool hasStoredFPFeatures() const
Is FPFeatures in Trailing Storage?
Definition Expr.h:4783
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition Expr.h:4815
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:5254
SourceLocation getKeywordLoc() const
Definition ExprCXX.h:5345
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
Definition ExprCXX.h:5308
Represents a 'co_yield' expression.
Definition ExprCXX.h:5449
NamedDecl * getDecl() const
AccessSpecifier getAccess() const
iterator begin()
Definition DeclGroup.h:95
A reference to a declared variable, function, enum, etc.
Definition Expr.h:1276
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition Expr.h:1451
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
Definition Expr.h:1387
bool refersToEnclosingVariableOrCapture() const
Does this DeclRefExpr refer to an enclosing local or a captured variable?
Definition Expr.h:1480
bool hasTemplateKWAndArgsInfo() const
Definition Expr.h:1397
bool hasQualifier() const
Determine whether this declaration reference was preceded by a C++ nested-name-specifier,...
Definition Expr.h:1365
NestedNameSpecifierLoc getQualifierLoc() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name,...
Definition Expr.h:1369
ValueDecl * getDecl()
Definition Expr.h:1344
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
Definition Expr.h:1474
bool hadMultipleCandidates() const
Returns true if this expression refers to a function that was resolved from an overloaded set having ...
Definition Expr.h:1463
SourceLocation getLocation() const
Definition Expr.h:1352
bool isImmediateEscalating() const
Definition Expr.h:1484
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
Definition Stmt.h:1640
SourceLocation getEndLoc() const
Definition Stmt.h:1663
const DeclGroupRef getDeclGroup() const
Definition Stmt.h:1658
SourceLocation getBeginLoc() const LLVM_READONLY
Definition Stmt.h:1666
NameKind
The kind of the name stored in this DeclarationName.
Stmt * getSubStmt()
Definition Stmt.h:2090
DeferStmt - This represents a deferred statement.
Definition Stmt.h:3245
Stmt * getBody()
Definition Stmt.h:3264
SourceLocation getDeferLoc() const
Definition Stmt.h:3259
Represents a 'co_await' expression while the type of the promise is dependent.
Definition ExprCXX.h:5400
SourceLocation getKeywordLoc() const
Definition ExprCXX.h:5429
A qualified reference to a name whose declaration cannot yet be resolved.
Definition ExprCXX.h:3509
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source location information.
Definition ExprCXX.h:3557
Represents a C99 designated initializer expression.
Definition Expr.h:5563
Expr * getSubExpr(unsigned Idx) const
Definition Expr.h:5845
bool usesGNUSyntax() const
Determines whether this designated initializer used the deprecated GNU syntax for designated initiali...
Definition Expr.h:5827
MutableArrayRef< Designator > designators()
Definition Expr.h:5796
SourceLocation getEqualOrColonLoc() const
Retrieve the location of the '=' that precedes the initializer value itself, if present.
Definition Expr.h:5818
unsigned getNumSubExprs() const
Retrieve the total number of subexpressions in this designated initializer expression,...
Definition Expr.h:5843
InitListExpr * getUpdater() const
Definition Expr.h:5948
DoStmt - This represents a 'do/while' stmt.
Definition Stmt.h:2841
Stmt * getBody()
Definition Stmt.h:2866
Expr * getCond()
Definition Stmt.h:2859
SourceLocation getWhileLoc() const
Definition Stmt.h:2872
SourceLocation getDoLoc() const
Definition Stmt.h:2870
SourceLocation getRParenLoc() const
Definition Stmt.h:2874
IdentifierInfo & getAccessor() const
Definition Expr.h:6597
const Expr * getBase() const
Definition Expr.h:6593
SourceLocation getAccessorLoc() const
Definition Expr.h:6600
Represents a reference to emded data.
Definition Expr.h:5141
unsigned getStartingElementPos() const
Definition Expr.h:5162
StringLiteral * getDataStringLiteral() const
Definition Expr.h:5158
SourceLocation getBeginLoc() const
Definition Expr.h:5155
size_t getDataElementCount() const
Definition Expr.h:5163
ExplicitCastExpr - An explicit cast written in the source code.
Definition Expr.h:3934
TypeSourceInfo * getTypeInfoAsWritten() const
getTypeInfoAsWritten - Returns the type source info for the type that this expression is casting to.
Definition Expr.h:3956
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition ExprCXX.h:3660
bool cleanupsHaveSideEffects() const
Definition ExprCXX.h:3695
ArrayRef< CleanupObject > getObjects() const
Definition ExprCXX.h:3684
unsigned getNumObjects() const
Definition ExprCXX.h:3688
This represents one expression.
Definition Expr.h:112
bool isValueDependent() const
Determines whether the value of this expression depends on.
Definition Expr.h:177
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
Definition Expr.h:447
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
Definition Expr.h:454
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
Definition Expr.cpp:283
QualType getType() const
Definition Expr.h:144
ExprDependence getDependence() const
Definition Expr.h:164
An expression trait intrinsic.
Definition ExprCXX.h:3072
Expr * getQueriedExpression() const
Definition ExprCXX.h:3111
ExpressionTrait getTrait() const
Definition ExprCXX.h:3107
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition Expr.h:6622
storage_type getAsOpaqueInt() const
SourceLocation getLocation() const
Retrieve the location of the literal.
Definition Expr.h:1587
unsigned getScale() const
Definition Expr.h:1591
llvm::APInt getValue() const
Returns an internal integer representation of the literal.
Definition Expr.h:1581
SourceLocation getLocation() const
Definition Expr.h:1713
llvm::APFloatBase::Semantics getRawSemantics() const
Get a raw enumeration value representing the floating-point semantics of this literal (32-bit IEEE,...
Definition Expr.h:1682
llvm::APFloat getValue() const
Definition Expr.h:1672
bool isExact() const
Definition Expr.h:1705
ForStmt - This represents a 'for (init;cond;inc)' stmt.
Definition Stmt.h:2897
Stmt * getInit()
Definition Stmt.h:2912
SourceLocation getRParenLoc() const
Definition Stmt.h:2957
Stmt * getBody()
Definition Stmt.h:2941
Expr * getInc()
Definition Stmt.h:2940
SourceLocation getForLoc() const
Definition Stmt.h:2953
Expr * getCond()
Definition Stmt.h:2939
SourceLocation getLParenLoc() const
Definition Stmt.h:2955
DeclStmt * getConditionVariableDeclStmt()
If this ForStmt has a condition variable, return the faux DeclStmt associated with the creation of th...
Definition Stmt.h:2927
const Expr * getSubExpr() const
Definition Expr.h:1068
Represents a reference to a function parameter pack, init-capture pack, or binding pack that has been...
Definition ExprCXX.h:4840
ValueDecl *const * iterator
Iterators over the parameters which the parameter pack expanded into.
Definition ExprCXX.h:4873
ValueDecl * getParameterPack() const
Get the parameter pack which this expression refers to.
Definition ExprCXX.h:4866
iterator end() const
Definition ExprCXX.h:4875
unsigned getNumExpansions() const
Get the number of parameters in this parameter pack.
Definition ExprCXX.h:4878
SourceLocation getParameterPackLocation() const
Get the location of the parameter pack.
Definition ExprCXX.h:4869
iterator begin() const
Definition ExprCXX.h:4874
This represents a GCC inline-assembly statement extension.
Definition Stmt.h:3455
unsigned getNumLabels() const
Definition Stmt.h:3605
SourceLocation getRParenLoc() const
Definition Stmt.h:3477
IdentifierInfo * getInputIdentifier(unsigned i) const
Definition Stmt.h:3570
const Expr * getOutputConstraintExpr(unsigned i) const
Definition Stmt.h:3557
IdentifierInfo * getLabelIdentifier(unsigned i) const
Definition Stmt.h:3609
const Expr * getInputConstraintExpr(unsigned i) const
Definition Stmt.h:3583
IdentifierInfo * getOutputIdentifier(unsigned i) const
Definition Stmt.h:3546
const Expr * getAsmStringExpr() const
Definition Stmt.h:3482
Expr * getOutputExpr(unsigned i)
Definition Stmt.cpp:582
Expr * getClobberExpr(unsigned i)
Definition Stmt.h:3662
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:4929
SourceLocation getTokenLocation() const
getTokenLocation - The location of the __null token.
Definition Expr.h:4943
Represents a C11 generic selection.
Definition Expr.h:6194
unsigned getNumAssocs() const
The number of association expressions.
Definition Expr.h:6436
bool isExprPredicate() const
Whether this generic selection uses an expression as its controlling argument.
Definition Expr.h:6452
SourceLocation getGenericLoc() const
Definition Expr.h:6549
SourceLocation getRParenLoc() const
Definition Expr.h:6553
SourceLocation getDefaultLoc() const
Definition Expr.h:6552
GotoStmt - This represents a direct goto.
Definition Stmt.h:2978
SourceLocation getLabelLoc() const
Definition Stmt.h:2996
SourceLocation getGotoLoc() const
Definition Stmt.h:2994
LabelDecl * getLabel() const
Definition Stmt.h:2991
This class represents temporary values used to represent inout and out arguments in HLSL.
Definition Expr.h:7409
const OpaqueValueExpr * getCastedTemporary() const
Definition Expr.h:7460
const OpaqueValueExpr * getOpaqueArgLValue() const
Definition Expr.h:7441
bool isInOut() const
returns true if the parameter is inout and false if the parameter is out.
Definition Expr.h:7468
const Expr * getWritebackCast() const
Definition Expr.h:7455
IfStmt - This represents an if/then/else.
Definition Stmt.h:2268
Stmt * getThen()
Definition Stmt.h:2357
SourceLocation getIfLoc() const
Definition Stmt.h:2434
IfStatementKind getStatementKind() const
Definition Stmt.h:2469
SourceLocation getElseLoc() const
Definition Stmt.h:2437
Stmt * getInit()
Definition Stmt.h:2418
SourceLocation getLParenLoc() const
Definition Stmt.h:2486
Expr * getCond()
Definition Stmt.h:2345
Stmt * getElse()
Definition Stmt.h:2366
DeclStmt * getConditionVariableDeclStmt()
If this IfStmt has a condition variable, return the faux DeclStmt associated with the creation of tha...
Definition Stmt.h:2401
SourceLocation getRParenLoc() const
Definition Stmt.h:2488
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1....
Definition Expr.h:1737
const Expr * getSubExpr() const
Definition Expr.h:1749
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition Expr.h:3859
bool isPartOfExplicitCast() const
Definition Expr.h:3890
Represents an implicitly-generated value initialization of an object of a given type.
Definition Expr.h:6069
IndirectGotoStmt - This represents an indirect goto.
Definition Stmt.h:3017
SourceLocation getGotoLoc() const
Definition Stmt.h:3033
SourceLocation getStarLoc() const
Definition Stmt.h:3035
Describes an C or C++ initializer list.
Definition Expr.h:5314
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
Definition Expr.h:5441
unsigned getNumInits() const
Definition Expr.h:5347
SourceLocation getLBraceLoc() const
Definition Expr.h:5472
InitListExpr * getSyntacticForm() const
Definition Expr.h:5484
bool hadArrayRangeDesignator() const
Definition Expr.h:5495
Expr * getArrayFiller()
If this initializer list initializes an array with more elements than there are initializers in the l...
Definition Expr.h:5417
bool isExplicit() const
Definition Expr.h:5457
SourceLocation getRBraceLoc() const
Definition Expr.h:5474
const Expr * getInit(unsigned Init) const
Definition Expr.h:5369
SourceLocation getLocation() const
Retrieve the location of the literal.
Definition Expr.h:1542
LabelStmt - Represents a label, which has a substatement.
Definition Stmt.h:2155
LabelDecl * getDecl() const
Definition Stmt.h:2173
bool isSideEntry() const
Definition Stmt.h:2202
Stmt * getSubStmt()
Definition Stmt.h:2177
SourceLocation getIdentLoc() const
Definition Stmt.h:2170
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition ExprCXX.h:1971
Expr ** capture_init_iterator
Iterator that walks over the capture initialization arguments.
Definition ExprCXX.h:2078
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument for this lambda expression.
Definition ExprCXX.h:2109
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
Definition ExprCXX.h:2097
Base class for BreakStmt and ContinueStmt.
Definition Stmt.h:3066
SourceLocation getLabelLoc() const
Definition Stmt.h:3101
LabelDecl * getLabelDecl()
Definition Stmt.h:3104
SourceLocation getKwLoc() const
Definition Stmt.h:3091
bool hasLabelTarget() const
Definition Stmt.h:3099
This represents a Microsoft inline-assembly statement extension.
Definition Stmt.h:3674
Token * getAsmToks()
Definition Stmt.h:3705
Expr * getOutputExpr(unsigned i)
Definition Stmt.cpp:919
StringRef getAsmString() const
Definition Stmt.h:3708
SourceLocation getLBraceLoc() const
Definition Stmt.h:3697
SourceLocation getEndLoc() const
Definition Stmt.h:3699
StringRef getInputConstraint(unsigned i) const
Definition Stmt.h:3728
StringRef getOutputConstraint(unsigned i) const
Definition Stmt.h:3715
StringRef getClobber(unsigned i) const
Definition Stmt.h:3752
unsigned getNumAsmToks()
Definition Stmt.h:3704
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:939
NestedNameSpecifierLoc getQualifierLoc() const
Definition ExprCXX.h:995
bool isArrow() const
Definition ExprCXX.h:993
MSPropertyDecl * getPropertyDecl() const
Definition ExprCXX.h:992
Expr * getBaseExpr() const
Definition ExprCXX.h:991
SourceLocation getMemberLoc() const
Definition ExprCXX.h:994
MS property subscript expression.
Definition ExprCXX.h:1009
SourceLocation getRBracketLoc() const
Definition ExprCXX.h:1046
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition ExprCXX.h:4919
Expr * getSubExpr() const
Retrieve the temporary-generating subexpression whose value will be materialized into a glvalue.
Definition ExprCXX.h:4936
LifetimeExtendedTemporaryDecl * getLifetimeExtendedTemporaryDecl()
Definition ExprCXX.h:4959
MatrixSingleSubscriptExpr - Matrix single subscript expression for the MatrixType extension when you ...
Definition Expr.h:2801
SourceLocation getRBracketLoc() const
Definition Expr.h:2845
MatrixSubscriptExpr - Matrix subscript expression for the MatrixType extension.
Definition Expr.h:2871
SourceLocation getRBracketLoc() const
Definition Expr.h:2923
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition Expr.h:3370
SourceLocation getMemberLoc() const
getMemberLoc - Return the location of the "member", in X->F, it is the location of 'F'.
Definition Expr.h:3559
SourceLocation getOperatorLoc() const
Definition Expr.h:3552
NestedNameSpecifierLoc getQualifierLoc() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name,...
Definition Expr.h:3472
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Definition Expr.h:3453
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
Definition Expr.h:3594
bool hasQualifier() const
Determines whether this member expression actually had a C++ nested-name-specifier prior to the name ...
Definition Expr.h:3467
Expr * getBase() const
Definition Expr.h:3447
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition Expr.h:3535
bool hadMultipleCandidates() const
Returns true if this member expression refers to a method that was resolved from an overloaded set ha...
Definition Expr.h:3574
bool isArrow() const
Definition Expr.h:3554
DeclAccessPair getFoundDecl() const
Retrieves the declaration found by lookup.
Definition Expr.h:3457
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition Decl.h:340
Represents a place-holder for an object not to be initialized by anything.
Definition Expr.h:5889
NullStmt - This is the null statement ";": C99 6.8.3p3.
Definition Stmt.h:1712
SourceLocation getSemiLoc() const
Definition Stmt.h:1723
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:5603
SourceLocation getColonLoc(unsigned I) const
Gets the location of the first ':' in the range for the given iterator definition.
Definition Expr.cpp:5597
SourceLocation getRParenLoc() const
Definition ExprOpenMP.h:245
IteratorRange getIteratorRange(unsigned I)
Gets the iterator range for the given iterator.
Definition Expr.cpp:5574
OMPIteratorHelperData & getHelper(unsigned I)
Fetches helper data for the specified iteration space.
Definition Expr.cpp:5613
SourceLocation getAssignLoc(unsigned I) const
Gets the location of '=' for the given iterator definition.
Definition Expr.cpp:5591
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:5570
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp,...
Definition ExprObjC.h:220
Expr * getElement(unsigned Index)
getElement - Return the Element at the specified index.
Definition ExprObjC.h:265
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c array literal.
Definition ExprObjC.h:257
SourceRange getSourceRange() const LLVM_READONLY
Definition ExprObjC.h:248
ObjCMethodDecl * getArrayWithObjectsMethod() const
Definition ExprObjC.h:274
Represents Objective-C's @catch statement.
Definition StmtObjC.h:77
const VarDecl * getCatchParamDecl() const
Definition StmtObjC.h:97
const Stmt * getCatchBody() const
Definition StmtObjC.h:93
SourceLocation getAtCatchLoc() const
Definition StmtObjC.h:105
SourceLocation getRParenLoc() const
Definition StmtObjC.h:107
Represents Objective-C's @finally statement.
Definition StmtObjC.h:127
const Stmt * getFinallyBody() const
Definition StmtObjC.h:139
SourceLocation getAtFinallyLoc() const
Definition StmtObjC.h:148
Represents Objective-C's @synchronized statement.
Definition StmtObjC.h:303
const Expr * getSynchExpr() const
Definition StmtObjC.h:331
const CompoundStmt * getSynchBody() const
Definition StmtObjC.h:323
SourceLocation getAtSynchronizedLoc() const
Definition StmtObjC.h:320
Represents Objective-C's @throw statement.
Definition StmtObjC.h:358
const Expr * getThrowExpr() const
Definition StmtObjC.h:370
SourceLocation getThrowLoc() const LLVM_READONLY
Definition StmtObjC.h:374
Represents Objective-C's @try ... @catch ... @finally statement.
Definition StmtObjC.h:167
const ObjCAtFinallyStmt * getFinallyStmt() const
Retrieve the @finally statement, if any.
Definition StmtObjC.h:241
unsigned getNumCatchStmts() const
Retrieve the number of @catch statements in this try-catch-finally block.
Definition StmtObjC.h:220
const Stmt * getTryBody() const
Retrieve the @try body.
Definition StmtObjC.h:214
SourceLocation getAtTryLoc() const
Retrieve the location of the @ in the @try.
Definition StmtObjC.h:210
catch_range catch_stmts()
Definition StmtObjC.h:282
Represents Objective-C's @autoreleasepool Statement.
Definition StmtObjC.h:394
SourceLocation getAtLoc() const
Definition StmtObjC.h:414
const Stmt * getSubStmt() const
Definition StmtObjC.h:405
A runtime availability query.
Definition ExprObjC.h:1736
SourceRange getSourceRange() const
Definition ExprObjC.h:1755
VersionTuple getVersion() const
Definition ExprObjC.h:1759
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition ExprObjC.h:119
SourceLocation getLocation() const
Definition ExprObjC.h:138
ObjCBoxedExpr - used for generalized expression boxing.
Definition ExprObjC.h:159
SourceRange getSourceRange() const LLVM_READONLY
Definition ExprObjC.h:190
ObjCMethodDecl * getBoxingMethod() const
Definition ExprObjC.h:181
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers,...
Definition ExprObjC.h:1676
SourceLocation getLParenLoc() const
Definition ExprObjC.h:1699
SourceLocation getBridgeKeywordLoc() const
The location of the bridge keyword.
Definition ExprObjC.h:1710
ObjCBridgeCastKind getBridgeKind() const
Determine which kind of bridge is being performed via this cast.
Definition ExprObjC.h:1702
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
Definition ExprObjC.h:342
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c dictionary literal.
Definition ExprObjC.h:392
ObjCMethodDecl * getDictWithObjectsMethod() const
Definition ExprObjC.h:409
ObjCDictionaryElement getKeyValueElement(unsigned Index) const
Definition ExprObjC.h:394
SourceRange getSourceRange() const LLVM_READONLY
Definition ExprObjC.h:415
ObjCEncodeExpr, used for @encode in Objective-C.
Definition ExprObjC.h:441
TypeSourceInfo * getEncodedTypeSourceInfo() const
Definition ExprObjC.h:462
SourceLocation getRParenLoc() const
Definition ExprObjC.h:457
SourceLocation getAtLoc() const
Definition ExprObjC.h:455
Represents Objective-C's collection statement.
Definition StmtObjC.h:23
SourceLocation getForLoc() const
Definition StmtObjC.h:52
SourceLocation getRParenLoc() const
Definition StmtObjC.h:54
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
Definition ExprObjC.h:1615
bool shouldCopy() const
shouldCopy - True if we should do the 'copy' part of the copy-restore.
Definition ExprObjC.h:1643
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC 'id' type.
Definition ExprObjC.h:1531
SourceLocation getIsaMemberLoc() const
getMemberLoc - Return the location of the "member", in X->F, it is the location of 'F'.
Definition ExprObjC.h:1563
SourceLocation getOpLoc() const
Definition ExprObjC.h:1566
Expr * getBase() const
Definition ExprObjC.h:1556
bool isArrow() const
Definition ExprObjC.h:1558
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition ExprObjC.h:582
SourceLocation getLocation() const
Definition ExprObjC.h:625
SourceLocation getOpLoc() const
Definition ExprObjC.h:633
ObjCIvarDecl * getDecl()
Definition ExprObjC.h:612
bool isArrow() const
Definition ExprObjC.h:620
bool isFreeIvar() const
Definition ExprObjC.h:621
const Expr * getBase() const
Definition ExprObjC.h:616
An expression that sends a message to the given Objective-C object or class.
Definition ExprObjC.h:973
bool isDelegateInitCall() const
isDelegateInitCall - Answers whether this message send has been tagged as a "delegate init call",...
Definition ExprObjC.h:1454
SourceLocation getLeftLoc() const
Definition ExprObjC.h:1457
Expr * getInstanceReceiver()
Returns the object expression (receiver) for an instance message, or null for a message that is not a...
Definition ExprObjC.h:1301
SourceLocation getSuperLoc() const
Retrieve the location of the 'super' keyword for a class or instance message to 'super',...
Definition ExprObjC.h:1342
Selector getSelector() const
Definition ExprObjC.cpp:301
@ SuperInstance
The receiver is the instance of the superclass object.
Definition ExprObjC.h:987
@ Instance
The receiver is an object instance.
Definition ExprObjC.h:981
@ SuperClass
The receiver is a superclass.
Definition ExprObjC.h:984
@ Class
The receiver is a class.
Definition ExprObjC.h:978
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:1329
QualType getSuperType() const
Retrieve the type referred to by 'super'.
Definition ExprObjC.h:1377
const ObjCMethodDecl * getMethodDecl() const
Definition ExprObjC.h:1397
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
Definition ExprObjC.h:1262
arg_iterator arg_begin()
Definition ExprObjC.h:1510
SourceLocation getRightLoc() const
Definition ExprObjC.h:1458
unsigned getNumArgs() const
Return the number of actual arguments in this message, not counting the receiver.
Definition ExprObjC.h:1423
arg_iterator arg_end()
Definition ExprObjC.h:1512
Base class for Objective-C object literals ("...", @42, @[],}).
Definition ExprObjC.h:51
bool isExpressibleAsConstantInitializer() const
Definition ExprObjC.h:68
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition ExprObjC.h:650
ObjCPropertyDecl * getExplicitProperty() const
Definition ExprObjC.h:739
ObjCMethodDecl * getImplicitPropertyGetter() const
Definition ExprObjC.h:744
SourceLocation getReceiverLocation() const
Definition ExprObjC.h:793
const Expr * getBase() const
Definition ExprObjC.h:788
bool isObjectReceiver() const
Definition ExprObjC.h:803
QualType getSuperReceiverType() const
Definition ExprObjC.h:795
bool isImplicitProperty() const
Definition ExprObjC.h:736
ObjCMethodDecl * getImplicitPropertySetter() const
Definition ExprObjC.h:749
ObjCInterfaceDecl * getClassReceiver() const
Definition ExprObjC.h:799
SourceLocation getLocation() const
Definition ExprObjC.h:791
bool isSuperReceiver() const
Definition ExprObjC.h:804
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition ExprObjC.h:538
ObjCProtocolDecl * getProtocol() const
Definition ExprObjC.h:555
SourceLocation getRParenLoc() const
Definition ExprObjC.h:560
SourceLocation getAtLoc() const
Definition ExprObjC.h:559
ObjCSelectorExpr used for @selector in Objective-C.
Definition ExprObjC.h:486
SourceLocation getSelectorNameLoc() const
Definition ExprObjC.h:504
SourceLocation getRParenLoc() const
Definition ExprObjC.h:505
Selector getSelector() const
Definition ExprObjC.h:500
SourceLocation getAtLoc() const
Definition ExprObjC.h:503
ObjCStringLiteral, used for Objective-C string literals i.e.
Definition ExprObjC.h:84
SourceLocation getAtLoc() const
Definition ExprObjC.h:100
StringLiteral * getString()
Definition ExprObjC.h:96
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition ExprObjC.h:872
Expr * getKeyExpr() const
Definition ExprObjC.h:914
Expr * getBaseExpr() const
Definition ExprObjC.h:911
ObjCMethodDecl * getAtIndexMethodDecl() const
Definition ExprObjC.h:917
SourceLocation getRBracket() const
Definition ExprObjC.h:902
ObjCMethodDecl * setAtIndexMethodDecl() const
Definition ExprObjC.h:921
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type,...
Definition Expr.h:2533
Expr * getIndexExpr(unsigned Idx)
Definition Expr.h:2592
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
Definition Expr.h:2566
const OffsetOfNode & getComponent(unsigned Idx) const
Definition Expr.h:2580
TypeSourceInfo * getTypeSourceInfo() const
Definition Expr.h:2573
unsigned getNumExpressions() const
Definition Expr.h:2604
SourceLocation getRParenLoc() const
Return the location of the right parentheses.
Definition Expr.h:2570
unsigned getNumComponents() const
Definition Expr.h:2588
const IdentifierInfo * getFieldName() const
For a field or identifier offsetof node, returns the name of the field.
Definition Expr.cpp:1696
unsigned getArrayExprIndex() const
For an array element node, returns the index into the array of expressions.
Definition Expr.h:2485
FieldDecl * getField() const
For a field offsetof node, returns the field.
Definition Expr.h:2491
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range that covers this offsetof node.
Definition Expr.h:2512
@ Array
An index into an array.
Definition Expr.h:2432
@ Identifier
A field in a dependent type, known only by its name.
Definition Expr.h:2436
@ Field
A field.
Definition Expr.h:2434
@ Base
An implicit indirection through a C++ base class, when the field found is in a base class.
Definition Expr.h:2439
Kind getKind() const
Determine what kind of offsetof node this is.
Definition Expr.h:2481
CXXBaseSpecifier * getBase() const
For a base class node, returns the base specifier.
Definition Expr.h:2501
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
Definition Expr.h:1184
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
Definition Expr.h:1234
SourceLocation getLocation() const
Retrieve the location of this expression.
Definition Expr.h:1206
bool isUnique() const
Definition Expr.h:1242
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:2096
SourceLocation getLocation() const
Definition Expr.h:2113
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:3131
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
Definition ExprCXX.h:4281
const DeclarationNameInfo & getNameInfo() const
Gets the full name info.
Definition ExprCXX.h:3238
UnresolvedSetImpl::iterator decls_iterator
Definition ExprCXX.h:3222
decls_iterator decls_begin() const
Definition ExprCXX.h:3224
unsigned getNumDecls() const
Gets the number of declarations in the unresolved set.
Definition ExprCXX.h:3235
NestedNameSpecifierLoc getQualifierLoc() const
Fetches the nested-name qualifier with source-location information, if one was given.
Definition ExprCXX.h:3253
TemplateArgumentLoc * getTrailingTemplateArgumentLoc()
Return the optional template arguments.
Definition ExprCXX.h:4291
bool hasTemplateKWAndArgsInfo() const
Definition ExprCXX.h:3175
decls_iterator decls_end() const
Definition ExprCXX.h:3227
DeclarationName getName() const
Gets the name looked up.
Definition ExprCXX.h:3241
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition ExprCXX.h:4362
Expr * getPattern()
Retrieve the pattern of the pack expansion.
Definition ExprCXX.h:4391
SourceLocation getEllipsisLoc() const
Retrieve the location of the ellipsis that describes this pack expansion.
Definition ExprCXX.h:4398
SourceLocation getEllipsisLoc() const
Determine the location of the 'sizeof' keyword.
Definition ExprCXX.h:4612
Expr * getIndexExpr() const
Definition ExprCXX.h:4627
ArrayRef< Expr * > getExpressions() const
Return the trailing expressions, regardless of the expansion.
Definition ExprCXX.h:4645
SourceLocation getRSquareLoc() const
Determine the location of the right parenthesis.
Definition ExprCXX.h:4618
Expr * getPackIdExpression() const
Definition ExprCXX.h:4623
ParenExpr - This represents a parenthesized expression, e.g.
Definition Expr.h:2188
SourceLocation getLParen() const
Get the location of the left parentheses '('.
Definition Expr.h:2213
const Expr * getSubExpr() const
Definition Expr.h:2205
bool isProducedByFoldExpansion() const
Definition Expr.h:2230
SourceLocation getRParen() const
Get the location of the right parentheses ')'.
Definition Expr.h:2217
ArrayRef< Expr * > exprs() const
Definition Expr.h:6139
unsigned getNumExprs() const
Return the number of expressions in this paren list.
Definition Expr.h:6122
SourceLocation getLParenLoc() const
Definition Expr.h:6141
SourceLocation getRParenLoc() const
Definition Expr.h:6142
[C99 6.4.2.2] - A predefined identifier such as func.
Definition Expr.h:2011
bool isTransparent() const
Definition Expr.h:2050
PredefinedIdentKind getIdentKind() const
Definition Expr.h:2046
SourceLocation getLocation() const
Definition Expr.h:2052
StringLiteral * getFunctionName()
Definition Expr.h:2055
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition Expr.h:6816
semantics_iterator semantics_end()
Definition Expr.h:6881
unsigned getResultExprIndex() const
Return the index of the result-bearing expression into the semantics expressions, or PseudoObjectExpr...
Definition Expr.h:6858
semantics_iterator semantics_begin()
Definition Expr.h:6877
Expr *const * semantics_iterator
Definition Expr.h:6875
unsigned getNumSemanticExprs() const
Definition Expr.h:6873
Expr * getSyntacticForm()
Return the syntactic form of this expression, i.e.
Definition Expr.h:6853
Frontend produces RecoveryExprs on semantic errors that prevent creating other well-formed expression...
Definition Expr.h:7515
SourceLocation getEndLoc() const
Definition Expr.h:7534
child_range children()
Definition Expr.h:7528
SourceLocation getBeginLoc() const
Definition Expr.h:7533
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:3169
SourceLocation getReturnLoc() const
Definition Stmt.h:3218
const VarDecl * getNRVOCandidate() const
Retrieve the variable that might be used for the named return value optimization.
Definition Stmt.h:3205
Expr * getRetValue()
Definition Stmt.h:3196
CompoundStmt * getBlock() const
Definition Stmt.h:3802
SourceLocation getExceptLoc() const
Definition Stmt.h:3795
Expr * getFilterExpr() const
Definition Stmt.h:3798
SourceLocation getFinallyLoc() const
Definition Stmt.h:3836
CompoundStmt * getBlock() const
Definition Stmt.h:3839
Represents a __leave statement.
Definition Stmt.h:3907
SourceLocation getLeaveLoc() const
Definition Stmt.h:3917
CompoundStmt * getTryBlock() const
Definition Stmt.h:3883
SourceLocation getTryLoc() const
Definition Stmt.h:3878
bool getIsCXXTry() const
Definition Stmt.h:3881
Stmt * getHandler() const
Definition Stmt.h:3887
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:2161
SourceLocation getLParenLocation() const
Definition Expr.h:2162
TypeSourceInfo * getTypeSourceInfo()
Definition Expr.h:2149
SourceLocation getRParenLocation() const
Definition Expr.h:2163
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition Expr.h:4649
SourceLocation getBuiltinLoc() const
Definition Expr.h:4666
unsigned getNumSubExprs() const
getNumSubExprs - Return the size of the SubExprs array.
Definition Expr.h:4682
SourceLocation getRParenLoc() const
Definition Expr.h:4669
Expr * getExpr(unsigned Index)
getExpr - Return the Expr at the specified index.
Definition Expr.h:4688
Represents an expression that computes the length of a parameter pack.
Definition ExprCXX.h:4440
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof... expression, such as is produced f...
Definition ExprCXX.h:4525
ArrayRef< TemplateArgument > getPartialArguments() const
Get.
Definition ExprCXX.h:4530
unsigned getPackLength() const
Retrieve the length of the parameter pack.
Definition ExprCXX.h:4514
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(),...
Definition Expr.h:5032
SourceLocation getBeginLoc() const
Definition Expr.h:5077
const DeclContext * getParentContext() const
If the SourceLocExpr has been resolved return the subexpression representing the resolved value.
Definition Expr.h:5073
SourceLocation getEndLoc() const
Definition Expr.h:5078
SourceLocIdentKind getIdentKind() const
Definition Expr.h:5052
SourceLocation getEnd() const
SourceLocation getBegin() const
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition Expr.h:4601
CompoundStmt * getSubStmt()
Definition Expr.h:4618
unsigned getTemplateDepth() const
Definition Expr.h:4630
SourceLocation getRParenLoc() const
Definition Expr.h:4627
SourceLocation getLParenLoc() const
Definition Expr.h:4625
StmtVisitor - This class implements a simple visitor for Stmt subclasses.
Stmt - This represents one statement.
Definition Stmt.h:85
LambdaExprBitfields LambdaExprBits
Definition Stmt.h:1401
StmtClass getStmtClass() const
Definition Stmt.h:1502
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:1390
CXXNewExprBitfields CXXNewExprBits
Definition Stmt.h:1388
ConstantExprBitfields ConstantExprBits
Definition Stmt.h:1353
RequiresExprBitfields RequiresExprBits
Definition Stmt.h:1402
CXXFoldExprBitfields CXXFoldExprBits
Definition Stmt.h:1405
PackIndexingExprBitfields PackIndexingExprBits
Definition Stmt.h:1406
NullStmtBitfields NullStmtBits
Definition Stmt.h:1336
DependentScopeDeclRefExprBitfields DependentScopeDeclRefExprBits
Definition Stmt.h:1391
StringLiteral - This represents a string literal expression, e.g.
Definition Expr.h:1805
SourceLocation getStrTokenLoc(unsigned TokNum) const
Get one of the string literal token.
Definition Expr.h:1951
bool isPascal() const
Definition Expr.h:1928
unsigned getLength() const
Definition Expr.h:1915
StringLiteralKind getKind() const
Definition Expr.h:1918
StringRef getBytes() const
Allow access to clients that need the byte representation, such as ASTWriterStmt::VisitStringLiteral(...
Definition Expr.h:1881
unsigned getByteLength() const
Definition Expr.h:1914
unsigned getNumConcatenated() const
getNumConcatenated - Get the number of string literal tokens that were concatenated in translation ph...
Definition Expr.h:1946
unsigned getCharByteWidth() const
Definition Expr.h:1916
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition ExprCXX.h:4663
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern being substituted.
Definition ExprCXX.h:4708
UnsignedOrNone getPackIndex() const
Definition ExprCXX.h:4716
QualType getParameterType() const
Determine the substituted type of the template parameter.
Definition ExprCXX.h:4727
unsigned getIndex() const
Returns the index of the replaced parameter in the associated declaration.
Definition ExprCXX.h:4714
SourceLocation getNameLoc() const
Definition ExprCXX.h:4698
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition ExprCXX.h:4753
TemplateArgument getArgumentPack() const
Retrieve the template argument pack containing the substituted template arguments.
Definition ExprCXX.cpp:1791
SourceLocation getParameterPackLocation() const
Retrieve the location of the parameter pack name.
Definition ExprCXX.h:4801
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern being substituted.
Definition ExprCXX.h:4787
unsigned getIndex() const
Returns the index of the replaced parameter in the associated declaration.
Definition ExprCXX.h:4791
SourceLocation getKeywordLoc() const
Definition Stmt.h:1906
SourceLocation getColonLoc() const
Definition Stmt.h:1908
const SwitchCase * getNextSwitchCase() const
Definition Stmt.h:1902
SwitchStmt - This represents a 'switch' stmt.
Definition Stmt.h:2518
SourceLocation getSwitchLoc() const
Definition Stmt.h:2653
SourceLocation getLParenLoc() const
Definition Stmt.h:2655
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:2678
SourceLocation getRParenLoc() const
Definition Stmt.h:2657
Expr * getCond()
Definition Stmt.h:2581
Stmt * getBody()
Definition Stmt.h:2593
Stmt * getInit()
Definition Stmt.h:2598
SwitchCase * getSwitchCaseList()
Definition Stmt.h:2649
DeclStmt * getConditionVariableDeclStmt()
If this SwitchStmt has a condition variable, return the faux DeclStmt associated with the creation of...
Definition Stmt.h:2632
Location wrapper for a TemplateArgument.
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition ExprCXX.h:2899
TypeSourceInfo * getArg(unsigned I) const
Retrieve the Ith argument.
Definition ExprCXX.h:2964
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
Definition ExprCXX.h:2961
const APValue & getAPValue() const
Definition ExprCXX.h:2955
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition Expr.h:2631
SourceLocation getRParenLoc() const
Definition Expr.h:2707
SourceLocation getOperatorLoc() const
Definition Expr.h:2704
TypeSourceInfo * getArgumentTypeInfo() const
Definition Expr.h:2677
UnaryExprOrTypeTrait getKind() const
Definition Expr.h:2663
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition Expr.h:2250
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
Definition Expr.h:2295
Expr * getSubExpr() const
Definition Expr.h:2291
Opcode getOpcode() const
Definition Expr.h:2286
bool hasStoredFPFeatures() const
Is FPFeatures in Trailing Storage?
Definition Expr.h:2387
FPOptionsOverride getStoredFPFeatures() const
Get FPFeatures from trailing storage.
Definition Expr.h:2390
bool canOverflow() const
Returns true if the unary operator can cause an overflow.
Definition Expr.h:2304
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition ExprCXX.h:3389
CXXRecordDecl * getNamingClass()
Gets the 'naming class' (in the sense of C++0x [class.access.base]p5) of the lookup.
Definition ExprCXX.h:3463
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
Definition ExprCXX.h:3458
Represents a C++ member access expression for which lookup produced a set of overloaded functions.
Definition ExprCXX.h:4125
QualType getBaseType() const
Definition ExprCXX.h:4207
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '.
Definition ExprCXX.h:4217
SourceLocation getOperatorLoc() const
Retrieve the location of the '->' or '.' operator.
Definition ExprCXX.h:4220
bool hasUnresolvedUsing() const
Determine whether the lookup results contain an unresolved using declaration.
Definition ExprCXX.h:4211
Expr * getBase()
Retrieve the base object of this member expressions, e.g., the x in x.m.
Definition ExprCXX.h:4198
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:1651
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit....
Definition ExprCXX.h:643
Represents a call to the builtin function __builtin_va_arg.
Definition Expr.h:4963
TypeSourceInfo * getWrittenTypeInfo() const
Definition Expr.h:4996
SourceLocation getBuiltinLoc() const
Definition Expr.h:4999
SourceLocation getRParenLoc() const
Definition Expr.h:5002
VarArgKind getVarargABI() const
Definition Expr.h:4987
const Expr * getSubExpr() const
Definition Expr.h:4983
WhileStmt - This represents a 'while' stmt.
Definition Stmt.h:2706
Expr * getCond()
Definition Stmt.h:2758
SourceLocation getWhileLoc() const
Definition Stmt.h:2811
SourceLocation getRParenLoc() const
Definition Stmt.h:2816
DeclStmt * getConditionVariableDeclStmt()
If this WhileStmt has a condition variable, return the faux DeclStmt associated with the creation of ...
Definition Stmt.h:2794
SourceLocation getLParenLoc() const
Definition Stmt.h:2814
Stmt * getBody()
Definition Stmt.h:2770
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.
The JSON file list parser is used to communicate input to InstallAPI.
bool isa(CodeGen::Address addr)
Definition Address.h:330
@ OK_Ordinary
An ordinary object is located at an address in memory.
Definition Specifiers.h:152
OpenACCComputeConstruct(OpenACCDirectiveKind K, SourceLocation Start, SourceLocation DirectiveLoc, SourceLocation End, ArrayRef< const OpenACCClause * > Clauses, Stmt *StructuredBlock)
bool isAlignedAllocation(AlignedAllocationMode Mode)
Definition ExprCXX.h:2268
bool isTypeAwareAllocation(TypeAwareAllocationMode Mode)
Definition ExprCXX.h:2256
@ 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:2310
TypeAwareAllocationMode PassTypeIdentity
Definition ExprCXX.h:2309
Expr * CounterUpdate
Updater for the internal counter: ++CounterVD;.
Definition ExprOpenMP.h:121
Expr * Upper
Normalized upper bound.
Definition ExprOpenMP.h:116
Expr * Update
Update expression for the originally specified iteration variable, calculated as VD = Begin + Counter...
Definition ExprOpenMP.h:119
VarDecl * CounterVD
Internal normalized counter.
Definition ExprOpenMP.h:113
Expr * Value
The value of the dictionary element.
Definition ExprObjC.h:300
SourceLocation EllipsisLoc
The location of the ellipsis, if this is a pack expansion.
Definition ExprObjC.h:303
UnsignedOrNone NumExpansions
The number of elements this pack expansion will expand to, if this is a pack expansion and is known.
Definition ExprObjC.h:307
Expr * Key
The key for the dictionary element.
Definition ExprObjC.h:297
constexpr underlying_type toInternalRepresentation() const