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