clang 22.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"
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 separate bits in separate 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:
95 : Writer(Writer), Record(Context, Writer, Record),
96 Code(serialization::STMT_NULL_PTR), AbbrevToUse(0),
97 CurrentPackingBits(this->Record) {}
98
99 ASTStmtWriter(const ASTStmtWriter&) = delete;
101
102 uint64_t Emit() {
103 CurrentPackingBits.writeBits();
104 assert(Code != serialization::STMT_NULL_PTR &&
105 "unhandled sub-statement writing AST file");
106 return Record.EmitStmt(Code, AbbrevToUse);
107 }
108
110 const TemplateArgumentLoc *Args);
111
112 void VisitStmt(Stmt *S);
113#define STMT(Type, Base) \
114 void Visit##Type(Type *);
115#include "clang/AST/StmtNodes.inc"
116 };
117}
118
120 const ASTTemplateKWAndArgsInfo &ArgInfo, const TemplateArgumentLoc *Args) {
121 Record.AddSourceLocation(ArgInfo.TemplateKWLoc);
122 Record.AddSourceLocation(ArgInfo.LAngleLoc);
123 Record.AddSourceLocation(ArgInfo.RAngleLoc);
124 for (unsigned i = 0; i != ArgInfo.NumTemplateArgs; ++i)
125 Record.AddTemplateArgumentLoc(Args[i]);
126}
127
129}
130
131void ASTStmtWriter::VisitNullStmt(NullStmt *S) {
132 VisitStmt(S);
133 Record.AddSourceLocation(S->getSemiLoc());
134 Record.push_back(S->NullStmtBits.HasLeadingEmptyMacro);
136}
137
138void ASTStmtWriter::VisitCompoundStmt(CompoundStmt *S) {
139 VisitStmt(S);
140
141 Record.push_back(S->size());
142 Record.push_back(S->hasStoredFPFeatures());
143
144 for (auto *CS : S->body())
145 Record.AddStmt(CS);
146 if (S->hasStoredFPFeatures())
147 Record.push_back(S->getStoredFPFeatures().getAsOpaqueInt());
148 Record.AddSourceLocation(S->getLBracLoc());
149 Record.AddSourceLocation(S->getRBracLoc());
150
151 if (!S->hasStoredFPFeatures())
152 AbbrevToUse = Writer.getCompoundStmtAbbrev();
153
155}
156
157void ASTStmtWriter::VisitSwitchCase(SwitchCase *S) {
158 VisitStmt(S);
159 Record.push_back(Writer.getSwitchCaseID(S));
160 Record.AddSourceLocation(S->getKeywordLoc());
161 Record.AddSourceLocation(S->getColonLoc());
162}
163
164void ASTStmtWriter::VisitCaseStmt(CaseStmt *S) {
165 VisitSwitchCase(S);
166 Record.push_back(S->caseStmtIsGNURange());
167 Record.AddStmt(S->getLHS());
168 Record.AddStmt(S->getSubStmt());
169 if (S->caseStmtIsGNURange()) {
170 Record.AddStmt(S->getRHS());
171 Record.AddSourceLocation(S->getEllipsisLoc());
172 }
174}
175
176void ASTStmtWriter::VisitDefaultStmt(DefaultStmt *S) {
177 VisitSwitchCase(S);
178 Record.AddStmt(S->getSubStmt());
180}
181
182void ASTStmtWriter::VisitLabelStmt(LabelStmt *S) {
183 VisitStmt(S);
184 Record.push_back(S->isSideEntry());
185 Record.AddDeclRef(S->getDecl());
186 Record.AddStmt(S->getSubStmt());
187 Record.AddSourceLocation(S->getIdentLoc());
189}
190
191void ASTStmtWriter::VisitAttributedStmt(AttributedStmt *S) {
192 VisitStmt(S);
193 Record.push_back(S->getAttrs().size());
194 Record.AddAttributes(S->getAttrs());
195 Record.AddStmt(S->getSubStmt());
196 Record.AddSourceLocation(S->getAttrLoc());
198}
199
200void ASTStmtWriter::VisitIfStmt(IfStmt *S) {
201 VisitStmt(S);
202
203 bool HasElse = S->getElse() != nullptr;
204 bool HasVar = S->getConditionVariableDeclStmt() != nullptr;
205 bool HasInit = S->getInit() != nullptr;
206
207 CurrentPackingBits.updateBits();
208
209 CurrentPackingBits.addBit(HasElse);
210 CurrentPackingBits.addBit(HasVar);
211 CurrentPackingBits.addBit(HasInit);
212 Record.push_back(static_cast<uint64_t>(S->getStatementKind()));
213 Record.AddStmt(S->getCond());
214 Record.AddStmt(S->getThen());
215 if (HasElse)
216 Record.AddStmt(S->getElse());
217 if (HasVar)
218 Record.AddStmt(S->getConditionVariableDeclStmt());
219 if (HasInit)
220 Record.AddStmt(S->getInit());
221
222 Record.AddSourceLocation(S->getIfLoc());
223 Record.AddSourceLocation(S->getLParenLoc());
224 Record.AddSourceLocation(S->getRParenLoc());
225 if (HasElse)
226 Record.AddSourceLocation(S->getElseLoc());
227
229}
230
231void ASTStmtWriter::VisitSwitchStmt(SwitchStmt *S) {
232 VisitStmt(S);
233
234 bool HasInit = S->getInit() != nullptr;
235 bool HasVar = S->getConditionVariableDeclStmt() != nullptr;
236 Record.push_back(HasInit);
237 Record.push_back(HasVar);
238 Record.push_back(S->isAllEnumCasesCovered());
239
240 Record.AddStmt(S->getCond());
241 Record.AddStmt(S->getBody());
242 if (HasInit)
243 Record.AddStmt(S->getInit());
244 if (HasVar)
245 Record.AddStmt(S->getConditionVariableDeclStmt());
246
247 Record.AddSourceLocation(S->getSwitchLoc());
248 Record.AddSourceLocation(S->getLParenLoc());
249 Record.AddSourceLocation(S->getRParenLoc());
250
251 for (SwitchCase *SC = S->getSwitchCaseList(); SC;
252 SC = SC->getNextSwitchCase())
253 Record.push_back(Writer.RecordSwitchCaseID(SC));
255}
256
257void ASTStmtWriter::VisitWhileStmt(WhileStmt *S) {
258 VisitStmt(S);
259
260 bool HasVar = S->getConditionVariableDeclStmt() != nullptr;
261 Record.push_back(HasVar);
262
263 Record.AddStmt(S->getCond());
264 Record.AddStmt(S->getBody());
265 if (HasVar)
266 Record.AddStmt(S->getConditionVariableDeclStmt());
267
268 Record.AddSourceLocation(S->getWhileLoc());
269 Record.AddSourceLocation(S->getLParenLoc());
270 Record.AddSourceLocation(S->getRParenLoc());
272}
273
274void ASTStmtWriter::VisitDoStmt(DoStmt *S) {
275 VisitStmt(S);
276 Record.AddStmt(S->getCond());
277 Record.AddStmt(S->getBody());
278 Record.AddSourceLocation(S->getDoLoc());
279 Record.AddSourceLocation(S->getWhileLoc());
280 Record.AddSourceLocation(S->getRParenLoc());
282}
283
284void ASTStmtWriter::VisitForStmt(ForStmt *S) {
285 VisitStmt(S);
286 Record.AddStmt(S->getInit());
287 Record.AddStmt(S->getCond());
288 Record.AddStmt(S->getConditionVariableDeclStmt());
289 Record.AddStmt(S->getInc());
290 Record.AddStmt(S->getBody());
291 Record.AddSourceLocation(S->getForLoc());
292 Record.AddSourceLocation(S->getLParenLoc());
293 Record.AddSourceLocation(S->getRParenLoc());
295}
296
297void ASTStmtWriter::VisitGotoStmt(GotoStmt *S) {
298 VisitStmt(S);
299 Record.AddDeclRef(S->getLabel());
300 Record.AddSourceLocation(S->getGotoLoc());
301 Record.AddSourceLocation(S->getLabelLoc());
303}
304
305void ASTStmtWriter::VisitIndirectGotoStmt(IndirectGotoStmt *S) {
306 VisitStmt(S);
307 Record.AddSourceLocation(S->getGotoLoc());
308 Record.AddSourceLocation(S->getStarLoc());
309 Record.AddStmt(S->getTarget());
311}
312
313void ASTStmtWriter::VisitLoopControlStmt(LoopControlStmt *S) {
314 VisitStmt(S);
315 Record.AddSourceLocation(S->getKwLoc());
316 Record.push_back(S->hasLabelTarget());
317 if (S->hasLabelTarget()) {
318 Record.AddDeclRef(S->getLabelDecl());
319 Record.AddSourceLocation(S->getLabelLoc());
320 }
321}
322
323void ASTStmtWriter::VisitContinueStmt(ContinueStmt *S) {
324 VisitLoopControlStmt(S);
326}
327
328void ASTStmtWriter::VisitBreakStmt(BreakStmt *S) {
329 VisitLoopControlStmt(S);
331}
332
333void ASTStmtWriter::VisitReturnStmt(ReturnStmt *S) {
334 VisitStmt(S);
335
336 bool HasNRVOCandidate = S->getNRVOCandidate() != nullptr;
337 Record.push_back(HasNRVOCandidate);
338
339 Record.AddStmt(S->getRetValue());
340 if (HasNRVOCandidate)
341 Record.AddDeclRef(S->getNRVOCandidate());
342
343 Record.AddSourceLocation(S->getReturnLoc());
345}
346
347void ASTStmtWriter::VisitDeclStmt(DeclStmt *S) {
348 VisitStmt(S);
349 Record.AddSourceLocation(S->getBeginLoc());
350 Record.AddSourceLocation(S->getEndLoc());
351 DeclGroupRef DG = S->getDeclGroup();
352 for (DeclGroupRef::iterator D = DG.begin(), DEnd = DG.end(); D != DEnd; ++D)
353 Record.AddDeclRef(*D);
355}
356
357void ASTStmtWriter::VisitAsmStmt(AsmStmt *S) {
358 VisitStmt(S);
359 Record.push_back(S->getNumOutputs());
360 Record.push_back(S->getNumInputs());
361 Record.push_back(S->getNumClobbers());
362 Record.AddSourceLocation(S->getAsmLoc());
363 Record.push_back(S->isVolatile());
364 Record.push_back(S->isSimple());
365}
366
367void ASTStmtWriter::VisitGCCAsmStmt(GCCAsmStmt *S) {
368 VisitAsmStmt(S);
369 Record.push_back(S->getNumLabels());
370 Record.AddSourceLocation(S->getRParenLoc());
371 Record.AddStmt(S->getAsmStringExpr());
372
373 // Outputs
374 for (unsigned I = 0, N = S->getNumOutputs(); I != N; ++I) {
375 Record.AddIdentifierRef(S->getOutputIdentifier(I));
376 Record.AddStmt(S->getOutputConstraintExpr(I));
377 Record.AddStmt(S->getOutputExpr(I));
378 }
379
380 // Inputs
381 for (unsigned I = 0, N = S->getNumInputs(); I != N; ++I) {
382 Record.AddIdentifierRef(S->getInputIdentifier(I));
383 Record.AddStmt(S->getInputConstraintExpr(I));
384 Record.AddStmt(S->getInputExpr(I));
385 }
386
387 // Clobbers
388 for (unsigned I = 0, N = S->getNumClobbers(); I != N; ++I)
389 Record.AddStmt(S->getClobberExpr(I));
390
391 // Labels
392 for (unsigned I = 0, N = S->getNumLabels(); I != N; ++I) {
393 Record.AddIdentifierRef(S->getLabelIdentifier(I));
394 Record.AddStmt(S->getLabelExpr(I));
395 }
396
398}
399
400void ASTStmtWriter::VisitMSAsmStmt(MSAsmStmt *S) {
401 VisitAsmStmt(S);
402 Record.AddSourceLocation(S->getLBraceLoc());
403 Record.AddSourceLocation(S->getEndLoc());
404 Record.push_back(S->getNumAsmToks());
405 Record.AddString(S->getAsmString());
406
407 // Tokens
408 for (unsigned I = 0, N = S->getNumAsmToks(); I != N; ++I) {
409 // FIXME: Move this to ASTRecordWriter?
410 Writer.AddToken(S->getAsmToks()[I], Record.getRecordData());
411 }
412
413 // Clobbers
414 for (unsigned I = 0, N = S->getNumClobbers(); I != N; ++I) {
415 Record.AddString(S->getClobber(I));
416 }
417
418 // Outputs
419 for (unsigned I = 0, N = S->getNumOutputs(); I != N; ++I) {
420 Record.AddStmt(S->getOutputExpr(I));
421 Record.AddString(S->getOutputConstraint(I));
422 }
423
424 // Inputs
425 for (unsigned I = 0, N = S->getNumInputs(); I != N; ++I) {
426 Record.AddStmt(S->getInputExpr(I));
427 Record.AddString(S->getInputConstraint(I));
428 }
429
431}
432
433void ASTStmtWriter::VisitCoroutineBodyStmt(CoroutineBodyStmt *CoroStmt) {
434 VisitStmt(CoroStmt);
435 Record.push_back(CoroStmt->getParamMoves().size());
436 for (Stmt *S : CoroStmt->children())
437 Record.AddStmt(S);
439}
440
441void ASTStmtWriter::VisitCoreturnStmt(CoreturnStmt *S) {
442 VisitStmt(S);
443 Record.AddSourceLocation(S->getKeywordLoc());
444 Record.AddStmt(S->getOperand());
445 Record.AddStmt(S->getPromiseCall());
446 Record.push_back(S->isImplicit());
448}
449
450void ASTStmtWriter::VisitCoroutineSuspendExpr(CoroutineSuspendExpr *E) {
451 VisitExpr(E);
452 Record.AddSourceLocation(E->getKeywordLoc());
453 for (Stmt *S : E->children())
454 Record.AddStmt(S);
455 Record.AddStmt(E->getOpaqueValue());
456}
457
458void ASTStmtWriter::VisitCoawaitExpr(CoawaitExpr *E) {
459 VisitCoroutineSuspendExpr(E);
460 Record.push_back(E->isImplicit());
462}
463
464void ASTStmtWriter::VisitCoyieldExpr(CoyieldExpr *E) {
465 VisitCoroutineSuspendExpr(E);
467}
468
469void ASTStmtWriter::VisitDependentCoawaitExpr(DependentCoawaitExpr *E) {
470 VisitExpr(E);
471 Record.AddSourceLocation(E->getKeywordLoc());
472 for (Stmt *S : E->children())
473 Record.AddStmt(S);
475}
476
477static void
479 const ASTConstraintSatisfaction &Satisfaction) {
480 Record.push_back(Satisfaction.IsSatisfied);
481 Record.push_back(Satisfaction.ContainsErrors);
482 if (!Satisfaction.IsSatisfied) {
483 Record.push_back(Satisfaction.NumRecords);
484 for (const auto &DetailRecord : Satisfaction) {
485 auto *E = dyn_cast<Expr *>(DetailRecord);
486 Record.push_back(/* IsDiagnostic */ E == nullptr);
487 if (E)
488 Record.AddStmt(E);
489 else {
490 auto *Diag = cast<std::pair<SourceLocation, StringRef> *>(DetailRecord);
491 Record.AddSourceLocation(Diag->first);
492 Record.AddString(Diag->second);
493 }
494 }
495 }
496}
497
498static void
502 Record.AddString(D->SubstitutedEntity);
503 Record.AddSourceLocation(D->DiagLoc);
504 Record.AddString(D->DiagMessage);
505}
506
507void ASTStmtWriter::VisitConceptSpecializationExpr(
509 VisitExpr(E);
510 Record.AddDeclRef(E->getSpecializationDecl());
511 const ConceptReference *CR = E->getConceptReference();
512 Record.push_back(CR != nullptr);
513 if (CR)
514 Record.AddConceptReference(CR);
515 if (!E->isValueDependent())
516 addConstraintSatisfaction(Record, E->getSatisfaction());
517
519}
520
521void ASTStmtWriter::VisitRequiresExpr(RequiresExpr *E) {
522 VisitExpr(E);
523 Record.push_back(E->getLocalParameters().size());
524 Record.push_back(E->getRequirements().size());
525 Record.AddSourceLocation(E->RequiresExprBits.RequiresKWLoc);
526 Record.push_back(E->RequiresExprBits.IsSatisfied);
527 Record.AddDeclRef(E->getBody());
528 for (ParmVarDecl *P : E->getLocalParameters())
529 Record.AddDeclRef(P);
530 for (concepts::Requirement *R : E->getRequirements()) {
531 if (auto *TypeReq = dyn_cast<concepts::TypeRequirement>(R)) {
533 Record.push_back(TypeReq->Status);
535 addSubstitutionDiagnostic(Record, TypeReq->getSubstitutionDiagnostic());
536 else
537 Record.AddTypeSourceInfo(TypeReq->getType());
538 } else if (auto *ExprReq = dyn_cast<concepts::ExprRequirement>(R)) {
539 Record.push_back(ExprReq->getKind());
540 Record.push_back(ExprReq->Status);
541 if (ExprReq->isExprSubstitutionFailure()) {
543 Record, cast<concepts::Requirement::SubstitutionDiagnostic *>(
544 ExprReq->Value));
545 } else
546 Record.AddStmt(cast<Expr *>(ExprReq->Value));
547 if (ExprReq->getKind() == concepts::Requirement::RK_Compound) {
548 Record.AddSourceLocation(ExprReq->NoexceptLoc);
549 const auto &RetReq = ExprReq->getReturnTypeRequirement();
550 if (RetReq.isSubstitutionFailure()) {
551 Record.push_back(2);
552 addSubstitutionDiagnostic(Record, RetReq.getSubstitutionDiagnostic());
553 } else if (RetReq.isTypeConstraint()) {
554 Record.push_back(1);
555 Record.AddTemplateParameterList(
556 RetReq.getTypeConstraintTemplateParameterList());
557 if (ExprReq->Status >=
559 Record.AddStmt(
560 ExprReq->getReturnTypeRequirementSubstitutedConstraintExpr());
561 } else {
562 assert(RetReq.isEmpty());
563 Record.push_back(0);
564 }
565 }
566 } else {
567 auto *NestedReq = cast<concepts::NestedRequirement>(R);
569 Record.push_back(NestedReq->hasInvalidConstraint());
570 if (NestedReq->hasInvalidConstraint()) {
571 Record.AddString(NestedReq->getInvalidConstraintEntity());
572 addConstraintSatisfaction(Record, *NestedReq->Satisfaction);
573 } else {
574 Record.AddStmt(NestedReq->getConstraintExpr());
575 if (!NestedReq->isDependent())
576 addConstraintSatisfaction(Record, *NestedReq->Satisfaction);
577 }
578 }
579 }
580 Record.AddSourceLocation(E->getLParenLoc());
581 Record.AddSourceLocation(E->getRParenLoc());
582 Record.AddSourceLocation(E->getEndLoc());
583
585}
586
587
588void ASTStmtWriter::VisitCapturedStmt(CapturedStmt *S) {
589 VisitStmt(S);
590 // NumCaptures
591 Record.push_back(std::distance(S->capture_begin(), S->capture_end()));
592
593 // CapturedDecl and captured region kind
594 Record.AddDeclRef(S->getCapturedDecl());
595 Record.push_back(S->getCapturedRegionKind());
596
597 Record.AddDeclRef(S->getCapturedRecordDecl());
598
599 // Capture inits
600 for (auto *I : S->capture_inits())
601 Record.AddStmt(I);
602
603 // Body
604 Record.AddStmt(S->getCapturedStmt());
605
606 // Captures
607 for (const auto &I : S->captures()) {
608 if (I.capturesThis() || I.capturesVariableArrayType())
609 Record.AddDeclRef(nullptr);
610 else
611 Record.AddDeclRef(I.getCapturedVar());
612 Record.push_back(I.getCaptureKind());
613 Record.AddSourceLocation(I.getLocation());
614 }
615
617}
618
619void ASTStmtWriter::VisitSYCLKernelCallStmt(SYCLKernelCallStmt *S) {
620 VisitStmt(S);
621 Record.AddStmt(S->getOriginalStmt());
622 Record.AddDeclRef(S->getOutlinedFunctionDecl());
623
625}
626
627void ASTStmtWriter::VisitExpr(Expr *E) {
628 VisitStmt(E);
629
630 CurrentPackingBits.updateBits();
631 CurrentPackingBits.addBits(E->getDependence(), /*BitsWidth=*/5);
632 CurrentPackingBits.addBits(E->getValueKind(), /*BitsWidth=*/2);
633 CurrentPackingBits.addBits(E->getObjectKind(), /*BitsWidth=*/3);
634
635 Record.AddTypeRef(E->getType());
636}
637
638void ASTStmtWriter::VisitConstantExpr(ConstantExpr *E) {
639 VisitExpr(E);
640 Record.push_back(E->ConstantExprBits.ResultKind);
641
642 Record.push_back(E->ConstantExprBits.APValueKind);
643 Record.push_back(E->ConstantExprBits.IsUnsigned);
644 Record.push_back(E->ConstantExprBits.BitWidth);
645 // HasCleanup not serialized since we can just query the APValue.
646 Record.push_back(E->ConstantExprBits.IsImmediateInvocation);
647
648 switch (E->getResultStorageKind()) {
650 break;
652 Record.push_back(E->Int64Result());
653 break;
655 Record.AddAPValue(E->APValueResult());
656 break;
657 }
658
659 Record.AddStmt(E->getSubExpr());
661}
662
663void ASTStmtWriter::VisitOpenACCAsteriskSizeExpr(OpenACCAsteriskSizeExpr *E) {
664 VisitExpr(E);
665 Record.AddSourceLocation(E->getLocation());
667}
668
669void ASTStmtWriter::VisitSYCLUniqueStableNameExpr(SYCLUniqueStableNameExpr *E) {
670 VisitExpr(E);
671
672 Record.AddSourceLocation(E->getLocation());
673 Record.AddSourceLocation(E->getLParenLocation());
674 Record.AddSourceLocation(E->getRParenLocation());
675 Record.AddTypeSourceInfo(E->getTypeSourceInfo());
676
678}
679
680void ASTStmtWriter::VisitPredefinedExpr(PredefinedExpr *E) {
681 VisitExpr(E);
682
683 bool HasFunctionName = E->getFunctionName() != nullptr;
684 Record.push_back(HasFunctionName);
685 Record.push_back(
686 llvm::to_underlying(E->getIdentKind())); // FIXME: stable encoding
687 Record.push_back(E->isTransparent());
688 Record.AddSourceLocation(E->getLocation());
689 if (HasFunctionName)
690 Record.AddStmt(E->getFunctionName());
692}
693
694void ASTStmtWriter::VisitDeclRefExpr(DeclRefExpr *E) {
695 VisitExpr(E);
696
697 CurrentPackingBits.updateBits();
698
699 CurrentPackingBits.addBit(E->hadMultipleCandidates());
700 CurrentPackingBits.addBit(E->refersToEnclosingVariableOrCapture());
701 CurrentPackingBits.addBits(E->isNonOdrUse(), /*Width=*/2);
702 CurrentPackingBits.addBit(E->isImmediateEscalating());
703 CurrentPackingBits.addBit(E->getDecl() != E->getFoundDecl());
704 CurrentPackingBits.addBit(E->hasQualifier());
705 CurrentPackingBits.addBit(E->hasTemplateKWAndArgsInfo());
706
707 if (E->hasTemplateKWAndArgsInfo()) {
708 unsigned NumTemplateArgs = E->getNumTemplateArgs();
709 Record.push_back(NumTemplateArgs);
710 }
711
712 DeclarationName::NameKind nk = (E->getDecl()->getDeclName().getNameKind());
713
714 if ((!E->hasTemplateKWAndArgsInfo()) && (!E->hasQualifier()) &&
715 (E->getDecl() == E->getFoundDecl()) &&
717 AbbrevToUse = Writer.getDeclRefExprAbbrev();
718 }
719
720 if (E->hasQualifier())
721 Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
722
723 if (E->getDecl() != E->getFoundDecl())
724 Record.AddDeclRef(E->getFoundDecl());
725
726 if (E->hasTemplateKWAndArgsInfo())
728 E->getTrailingObjects<TemplateArgumentLoc>());
729
730 Record.AddDeclRef(E->getDecl());
731 Record.AddSourceLocation(E->getLocation());
732 Record.AddDeclarationNameLoc(E->DNLoc, E->getDecl()->getDeclName());
734}
735
736void ASTStmtWriter::VisitIntegerLiteral(IntegerLiteral *E) {
737 VisitExpr(E);
738 Record.AddSourceLocation(E->getLocation());
739 Record.AddAPInt(E->getValue());
740
741 if (E->getBitWidth() == 32) {
742 AbbrevToUse = Writer.getIntegerLiteralAbbrev();
743 }
744
746}
747
748void ASTStmtWriter::VisitFixedPointLiteral(FixedPointLiteral *E) {
749 VisitExpr(E);
750 Record.AddSourceLocation(E->getLocation());
751 Record.push_back(E->getScale());
752 Record.AddAPInt(E->getValue());
754}
755
756void ASTStmtWriter::VisitFloatingLiteral(FloatingLiteral *E) {
757 VisitExpr(E);
758 Record.push_back(E->getRawSemantics());
759 Record.push_back(E->isExact());
760 Record.AddAPFloat(E->getValue());
761 Record.AddSourceLocation(E->getLocation());
763}
764
765void ASTStmtWriter::VisitImaginaryLiteral(ImaginaryLiteral *E) {
766 VisitExpr(E);
767 Record.AddStmt(E->getSubExpr());
769}
770
771void ASTStmtWriter::VisitStringLiteral(StringLiteral *E) {
772 VisitExpr(E);
773
774 // Store the various bits of data of StringLiteral.
775 Record.push_back(E->getNumConcatenated());
776 Record.push_back(E->getLength());
777 Record.push_back(E->getCharByteWidth());
778 Record.push_back(llvm::to_underlying(E->getKind()));
779 Record.push_back(E->isPascal());
780
781 // Store the trailing array of SourceLocation.
782 for (unsigned I = 0, N = E->getNumConcatenated(); I != N; ++I)
783 Record.AddSourceLocation(E->getStrTokenLoc(I));
784
785 // Store the trailing array of char holding the string data.
786 StringRef StrData = E->getBytes();
787 for (unsigned I = 0, N = E->getByteLength(); I != N; ++I)
788 Record.push_back(StrData[I]);
789
791}
792
793void ASTStmtWriter::VisitCharacterLiteral(CharacterLiteral *E) {
794 VisitExpr(E);
795 Record.push_back(E->getValue());
796 Record.AddSourceLocation(E->getLocation());
797 Record.push_back(llvm::to_underlying(E->getKind()));
798
799 AbbrevToUse = Writer.getCharacterLiteralAbbrev();
800
802}
803
804void ASTStmtWriter::VisitParenExpr(ParenExpr *E) {
805 VisitExpr(E);
806 Record.push_back(E->isProducedByFoldExpansion());
807 Record.AddSourceLocation(E->getLParen());
808 Record.AddSourceLocation(E->getRParen());
809 Record.AddStmt(E->getSubExpr());
811}
812
813void ASTStmtWriter::VisitParenListExpr(ParenListExpr *E) {
814 VisitExpr(E);
815 Record.push_back(E->getNumExprs());
816 for (auto *SubStmt : E->exprs())
817 Record.AddStmt(SubStmt);
818 Record.AddSourceLocation(E->getLParenLoc());
819 Record.AddSourceLocation(E->getRParenLoc());
821}
822
823void ASTStmtWriter::VisitUnaryOperator(UnaryOperator *E) {
824 VisitExpr(E);
825 bool HasFPFeatures = E->hasStoredFPFeatures();
826 // Write this first for easy access when deserializing, as they affect the
827 // size of the UnaryOperator.
828 CurrentPackingBits.addBit(HasFPFeatures);
829 Record.AddStmt(E->getSubExpr());
830 CurrentPackingBits.addBits(E->getOpcode(),
831 /*Width=*/5); // FIXME: stable encoding
832 Record.AddSourceLocation(E->getOperatorLoc());
833 CurrentPackingBits.addBit(E->canOverflow());
834
835 if (HasFPFeatures)
836 Record.push_back(E->getStoredFPFeatures().getAsOpaqueInt());
838}
839
840void ASTStmtWriter::VisitOffsetOfExpr(OffsetOfExpr *E) {
841 VisitExpr(E);
842 Record.push_back(E->getNumComponents());
843 Record.push_back(E->getNumExpressions());
844 Record.AddSourceLocation(E->getOperatorLoc());
845 Record.AddSourceLocation(E->getRParenLoc());
846 Record.AddTypeSourceInfo(E->getTypeSourceInfo());
847 for (unsigned I = 0, N = E->getNumComponents(); I != N; ++I) {
848 const OffsetOfNode &ON = E->getComponent(I);
849 Record.push_back(ON.getKind()); // FIXME: Stable encoding
850 Record.AddSourceLocation(ON.getSourceRange().getBegin());
851 Record.AddSourceLocation(ON.getSourceRange().getEnd());
852 switch (ON.getKind()) {
854 Record.push_back(ON.getArrayExprIndex());
855 break;
856
858 Record.AddDeclRef(ON.getField());
859 break;
860
862 Record.AddIdentifierRef(ON.getFieldName());
863 break;
864
866 Record.AddCXXBaseSpecifier(*ON.getBase());
867 break;
868 }
869 }
870 for (unsigned I = 0, N = E->getNumExpressions(); I != N; ++I)
871 Record.AddStmt(E->getIndexExpr(I));
873}
874
875void ASTStmtWriter::VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *E) {
876 VisitExpr(E);
877 Record.push_back(E->getKind());
878 if (E->isArgumentType())
879 Record.AddTypeSourceInfo(E->getArgumentTypeInfo());
880 else {
881 Record.push_back(0);
882 Record.AddStmt(E->getArgumentExpr());
883 }
884 Record.AddSourceLocation(E->getOperatorLoc());
885 Record.AddSourceLocation(E->getRParenLoc());
887}
888
889void ASTStmtWriter::VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
890 VisitExpr(E);
891 Record.AddStmt(E->getLHS());
892 Record.AddStmt(E->getRHS());
893 Record.AddSourceLocation(E->getRBracketLoc());
895}
896
897void ASTStmtWriter::VisitMatrixSubscriptExpr(MatrixSubscriptExpr *E) {
898 VisitExpr(E);
899 Record.AddStmt(E->getBase());
900 Record.AddStmt(E->getRowIdx());
901 Record.AddStmt(E->getColumnIdx());
902 Record.AddSourceLocation(E->getRBracketLoc());
904}
905
906void ASTStmtWriter::VisitArraySectionExpr(ArraySectionExpr *E) {
907 VisitExpr(E);
908 Record.writeEnum(E->ASType);
909 Record.AddStmt(E->getBase());
910 Record.AddStmt(E->getLowerBound());
911 Record.AddStmt(E->getLength());
912 if (E->isOMPArraySection())
913 Record.AddStmt(E->getStride());
914 Record.AddSourceLocation(E->getColonLocFirst());
915
916 if (E->isOMPArraySection())
917 Record.AddSourceLocation(E->getColonLocSecond());
918
919 Record.AddSourceLocation(E->getRBracketLoc());
921}
922
923void ASTStmtWriter::VisitOMPArrayShapingExpr(OMPArrayShapingExpr *E) {
924 VisitExpr(E);
925 Record.push_back(E->getDimensions().size());
926 Record.AddStmt(E->getBase());
927 for (Expr *Dim : E->getDimensions())
928 Record.AddStmt(Dim);
929 for (SourceRange SR : E->getBracketsRanges())
930 Record.AddSourceRange(SR);
931 Record.AddSourceLocation(E->getLParenLoc());
932 Record.AddSourceLocation(E->getRParenLoc());
934}
935
936void ASTStmtWriter::VisitOMPIteratorExpr(OMPIteratorExpr *E) {
937 VisitExpr(E);
938 Record.push_back(E->numOfIterators());
939 Record.AddSourceLocation(E->getIteratorKwLoc());
940 Record.AddSourceLocation(E->getLParenLoc());
941 Record.AddSourceLocation(E->getRParenLoc());
942 for (unsigned I = 0, End = E->numOfIterators(); I < End; ++I) {
943 Record.AddDeclRef(E->getIteratorDecl(I));
944 Record.AddSourceLocation(E->getAssignLoc(I));
945 OMPIteratorExpr::IteratorRange Range = E->getIteratorRange(I);
946 Record.AddStmt(Range.Begin);
947 Record.AddStmt(Range.End);
948 Record.AddStmt(Range.Step);
949 Record.AddSourceLocation(E->getColonLoc(I));
950 if (Range.Step)
951 Record.AddSourceLocation(E->getSecondColonLoc(I));
952 // Serialize helpers
953 OMPIteratorHelperData &HD = E->getHelper(I);
954 Record.AddDeclRef(HD.CounterVD);
955 Record.AddStmt(HD.Upper);
956 Record.AddStmt(HD.Update);
957 Record.AddStmt(HD.CounterUpdate);
958 }
960}
961
962void ASTStmtWriter::VisitCallExpr(CallExpr *E) {
963 VisitExpr(E);
964
965 Record.push_back(E->getNumArgs());
966 CurrentPackingBits.updateBits();
967 CurrentPackingBits.addBit(static_cast<bool>(E->getADLCallKind()));
968 CurrentPackingBits.addBit(E->hasStoredFPFeatures());
969 CurrentPackingBits.addBit(E->isCoroElideSafe());
970 CurrentPackingBits.addBit(E->usesMemberSyntax());
971
972 Record.AddSourceLocation(E->getRParenLoc());
973 Record.AddStmt(E->getCallee());
974 for (CallExpr::arg_iterator Arg = E->arg_begin(), ArgEnd = E->arg_end();
975 Arg != ArgEnd; ++Arg)
976 Record.AddStmt(*Arg);
977
978 if (E->hasStoredFPFeatures())
979 Record.push_back(E->getFPFeatures().getAsOpaqueInt());
980
981 if (!E->hasStoredFPFeatures() && !static_cast<bool>(E->getADLCallKind()) &&
982 !E->usesMemberSyntax() && E->getStmtClass() == Stmt::CallExprClass)
983 AbbrevToUse = Writer.getCallExprAbbrev();
984
986}
987
988void ASTStmtWriter::VisitRecoveryExpr(RecoveryExpr *E) {
989 VisitExpr(E);
990 Record.push_back(std::distance(E->children().begin(), E->children().end()));
991 Record.AddSourceLocation(E->getBeginLoc());
992 Record.AddSourceLocation(E->getEndLoc());
993 for (Stmt *Child : E->children())
994 Record.AddStmt(Child);
996}
997
998void ASTStmtWriter::VisitMemberExpr(MemberExpr *E) {
999 VisitExpr(E);
1000
1001 bool HasQualifier = E->hasQualifier();
1002 bool HasFoundDecl = E->hasFoundDecl();
1003 bool HasTemplateInfo = E->hasTemplateKWAndArgsInfo();
1004 unsigned NumTemplateArgs = E->getNumTemplateArgs();
1005
1006 // Write these first for easy access when deserializing, as they affect the
1007 // size of the MemberExpr.
1008 CurrentPackingBits.updateBits();
1009 CurrentPackingBits.addBit(HasQualifier);
1010 CurrentPackingBits.addBit(HasFoundDecl);
1011 CurrentPackingBits.addBit(HasTemplateInfo);
1012 Record.push_back(NumTemplateArgs);
1013
1014 Record.AddStmt(E->getBase());
1015 Record.AddDeclRef(E->getMemberDecl());
1016 Record.AddDeclarationNameLoc(E->MemberDNLoc,
1017 E->getMemberDecl()->getDeclName());
1018 Record.AddSourceLocation(E->getMemberLoc());
1019 CurrentPackingBits.addBit(E->isArrow());
1020 CurrentPackingBits.addBit(E->hadMultipleCandidates());
1021 CurrentPackingBits.addBits(E->isNonOdrUse(), /*Width=*/2);
1022 Record.AddSourceLocation(E->getOperatorLoc());
1023
1024 if (HasQualifier)
1025 Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
1026
1027 if (HasFoundDecl) {
1028 DeclAccessPair FoundDecl = E->getFoundDecl();
1029 Record.AddDeclRef(FoundDecl.getDecl());
1030 CurrentPackingBits.addBits(FoundDecl.getAccess(), /*BitWidth=*/2);
1031 }
1032
1033 if (HasTemplateInfo)
1034 AddTemplateKWAndArgsInfo(*E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
1035 E->getTrailingObjects<TemplateArgumentLoc>());
1036
1038}
1039
1040void ASTStmtWriter::VisitObjCIsaExpr(ObjCIsaExpr *E) {
1041 VisitExpr(E);
1042 Record.AddStmt(E->getBase());
1043 Record.AddSourceLocation(E->getIsaMemberLoc());
1044 Record.AddSourceLocation(E->getOpLoc());
1045 Record.push_back(E->isArrow());
1047}
1048
1049void ASTStmtWriter::
1050VisitObjCIndirectCopyRestoreExpr(ObjCIndirectCopyRestoreExpr *E) {
1051 VisitExpr(E);
1052 Record.AddStmt(E->getSubExpr());
1053 Record.push_back(E->shouldCopy());
1055}
1056
1057void ASTStmtWriter::VisitObjCBridgedCastExpr(ObjCBridgedCastExpr *E) {
1058 VisitExplicitCastExpr(E);
1059 Record.AddSourceLocation(E->getLParenLoc());
1060 Record.AddSourceLocation(E->getBridgeKeywordLoc());
1061 Record.push_back(E->getBridgeKind()); // FIXME: Stable encoding
1063}
1064
1065void ASTStmtWriter::VisitCastExpr(CastExpr *E) {
1066 VisitExpr(E);
1067
1068 Record.push_back(E->path_size());
1069 CurrentPackingBits.updateBits();
1070 // 7 bits should be enough to store the casting kinds.
1071 CurrentPackingBits.addBits(E->getCastKind(), /*Width=*/7);
1072 CurrentPackingBits.addBit(E->hasStoredFPFeatures());
1073 Record.AddStmt(E->getSubExpr());
1074
1076 PI = E->path_begin(), PE = E->path_end(); PI != PE; ++PI)
1077 Record.AddCXXBaseSpecifier(**PI);
1078
1079 if (E->hasStoredFPFeatures())
1080 Record.push_back(E->getFPFeatures().getAsOpaqueInt());
1081}
1082
1083void ASTStmtWriter::VisitBinaryOperator(BinaryOperator *E) {
1084 VisitExpr(E);
1085
1086 // Write this first for easy access when deserializing, as they affect the
1087 // size of the UnaryOperator.
1088 CurrentPackingBits.updateBits();
1089 CurrentPackingBits.addBits(E->getOpcode(), /*Width=*/6);
1090 bool HasFPFeatures = E->hasStoredFPFeatures();
1091 CurrentPackingBits.addBit(HasFPFeatures);
1092 CurrentPackingBits.addBit(E->hasExcludedOverflowPattern());
1093 Record.AddStmt(E->getLHS());
1094 Record.AddStmt(E->getRHS());
1095 Record.AddSourceLocation(E->getOperatorLoc());
1096 if (HasFPFeatures)
1097 Record.push_back(E->getStoredFPFeatures().getAsOpaqueInt());
1098
1099 if (!HasFPFeatures && E->getValueKind() == VK_PRValue &&
1101 AbbrevToUse = Writer.getBinaryOperatorAbbrev();
1102
1104}
1105
1106void ASTStmtWriter::VisitCompoundAssignOperator(CompoundAssignOperator *E) {
1107 VisitBinaryOperator(E);
1108 Record.AddTypeRef(E->getComputationLHSType());
1109 Record.AddTypeRef(E->getComputationResultType());
1110
1111 if (!E->hasStoredFPFeatures() && E->getValueKind() == VK_PRValue &&
1113 AbbrevToUse = Writer.getCompoundAssignOperatorAbbrev();
1114
1116}
1117
1118void ASTStmtWriter::VisitConditionalOperator(ConditionalOperator *E) {
1119 VisitExpr(E);
1120 Record.AddStmt(E->getCond());
1121 Record.AddStmt(E->getLHS());
1122 Record.AddStmt(E->getRHS());
1123 Record.AddSourceLocation(E->getQuestionLoc());
1124 Record.AddSourceLocation(E->getColonLoc());
1126}
1127
1128void
1129ASTStmtWriter::VisitBinaryConditionalOperator(BinaryConditionalOperator *E) {
1130 VisitExpr(E);
1131 Record.AddStmt(E->getOpaqueValue());
1132 Record.AddStmt(E->getCommon());
1133 Record.AddStmt(E->getCond());
1134 Record.AddStmt(E->getTrueExpr());
1135 Record.AddStmt(E->getFalseExpr());
1136 Record.AddSourceLocation(E->getQuestionLoc());
1137 Record.AddSourceLocation(E->getColonLoc());
1139}
1140
1141void ASTStmtWriter::VisitImplicitCastExpr(ImplicitCastExpr *E) {
1142 VisitCastExpr(E);
1143 CurrentPackingBits.addBit(E->isPartOfExplicitCast());
1144
1145 if (E->path_size() == 0 && !E->hasStoredFPFeatures())
1146 AbbrevToUse = Writer.getExprImplicitCastAbbrev();
1147
1149}
1150
1151void ASTStmtWriter::VisitExplicitCastExpr(ExplicitCastExpr *E) {
1152 VisitCastExpr(E);
1153 Record.AddTypeSourceInfo(E->getTypeInfoAsWritten());
1154}
1155
1156void ASTStmtWriter::VisitCStyleCastExpr(CStyleCastExpr *E) {
1157 VisitExplicitCastExpr(E);
1158 Record.AddSourceLocation(E->getLParenLoc());
1159 Record.AddSourceLocation(E->getRParenLoc());
1161}
1162
1163void ASTStmtWriter::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
1164 VisitExpr(E);
1165 Record.AddSourceLocation(E->getLParenLoc());
1166 Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1167 Record.AddStmt(E->getInitializer());
1168 Record.push_back(E->isFileScope());
1170}
1171
1172void ASTStmtWriter::VisitExtVectorElementExpr(ExtVectorElementExpr *E) {
1173 VisitExpr(E);
1174 Record.AddStmt(E->getBase());
1175 Record.AddIdentifierRef(&E->getAccessor());
1176 Record.AddSourceLocation(E->getAccessorLoc());
1178}
1179
1180void ASTStmtWriter::VisitInitListExpr(InitListExpr *E) {
1181 VisitExpr(E);
1182 // NOTE: only add the (possibly null) syntactic form.
1183 // No need to serialize the isSemanticForm flag and the semantic form.
1184 Record.AddStmt(E->getSyntacticForm());
1185 Record.AddSourceLocation(E->getLBraceLoc());
1186 Record.AddSourceLocation(E->getRBraceLoc());
1187 bool isArrayFiller = isa<Expr *>(E->ArrayFillerOrUnionFieldInit);
1188 Record.push_back(isArrayFiller);
1189 if (isArrayFiller)
1190 Record.AddStmt(E->getArrayFiller());
1191 else
1192 Record.AddDeclRef(E->getInitializedFieldInUnion());
1193 Record.push_back(E->hadArrayRangeDesignator());
1194 Record.push_back(E->getNumInits());
1195 if (isArrayFiller) {
1196 // ArrayFiller may have filled "holes" due to designated initializer.
1197 // Replace them by 0 to indicate that the filler goes in that place.
1198 Expr *filler = E->getArrayFiller();
1199 for (unsigned I = 0, N = E->getNumInits(); I != N; ++I)
1200 Record.AddStmt(E->getInit(I) != filler ? E->getInit(I) : nullptr);
1201 } else {
1202 for (unsigned I = 0, N = E->getNumInits(); I != N; ++I)
1203 Record.AddStmt(E->getInit(I));
1204 }
1206}
1207
1208void ASTStmtWriter::VisitDesignatedInitExpr(DesignatedInitExpr *E) {
1209 VisitExpr(E);
1210 Record.push_back(E->getNumSubExprs());
1211 for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
1212 Record.AddStmt(E->getSubExpr(I));
1213 Record.AddSourceLocation(E->getEqualOrColonLoc());
1214 Record.push_back(E->usesGNUSyntax());
1215 for (const DesignatedInitExpr::Designator &D : E->designators()) {
1216 if (D.isFieldDesignator()) {
1217 if (FieldDecl *Field = D.getFieldDecl()) {
1219 Record.AddDeclRef(Field);
1220 } else {
1222 Record.AddIdentifierRef(D.getFieldName());
1223 }
1224 Record.AddSourceLocation(D.getDotLoc());
1225 Record.AddSourceLocation(D.getFieldLoc());
1226 } else if (D.isArrayDesignator()) {
1228 Record.push_back(D.getArrayIndex());
1229 Record.AddSourceLocation(D.getLBracketLoc());
1230 Record.AddSourceLocation(D.getRBracketLoc());
1231 } else {
1232 assert(D.isArrayRangeDesignator() && "Unknown designator");
1234 Record.push_back(D.getArrayIndex());
1235 Record.AddSourceLocation(D.getLBracketLoc());
1236 Record.AddSourceLocation(D.getEllipsisLoc());
1237 Record.AddSourceLocation(D.getRBracketLoc());
1238 }
1239 }
1241}
1242
1243void ASTStmtWriter::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) {
1244 VisitExpr(E);
1245 Record.AddStmt(E->getBase());
1246 Record.AddStmt(E->getUpdater());
1248}
1249
1250void ASTStmtWriter::VisitNoInitExpr(NoInitExpr *E) {
1251 VisitExpr(E);
1253}
1254
1255void ASTStmtWriter::VisitArrayInitLoopExpr(ArrayInitLoopExpr *E) {
1256 VisitExpr(E);
1257 Record.AddStmt(E->SubExprs[0]);
1258 Record.AddStmt(E->SubExprs[1]);
1260}
1261
1262void ASTStmtWriter::VisitArrayInitIndexExpr(ArrayInitIndexExpr *E) {
1263 VisitExpr(E);
1265}
1266
1267void ASTStmtWriter::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) {
1268 VisitExpr(E);
1270}
1271
1272void ASTStmtWriter::VisitVAArgExpr(VAArgExpr *E) {
1273 VisitExpr(E);
1274 Record.AddStmt(E->getSubExpr());
1275 Record.AddTypeSourceInfo(E->getWrittenTypeInfo());
1276 Record.AddSourceLocation(E->getBuiltinLoc());
1277 Record.AddSourceLocation(E->getRParenLoc());
1278 Record.push_back(E->isMicrosoftABI());
1280}
1281
1282void ASTStmtWriter::VisitSourceLocExpr(SourceLocExpr *E) {
1283 VisitExpr(E);
1284 Record.AddDeclRef(cast_or_null<Decl>(E->getParentContext()));
1285 Record.AddSourceLocation(E->getBeginLoc());
1286 Record.AddSourceLocation(E->getEndLoc());
1287 Record.push_back(llvm::to_underlying(E->getIdentKind()));
1289}
1290
1291void ASTStmtWriter::VisitEmbedExpr(EmbedExpr *E) {
1292 VisitExpr(E);
1293 Record.AddSourceLocation(E->getBeginLoc());
1294 Record.AddSourceLocation(E->getEndLoc());
1295 Record.AddStmt(E->getDataStringLiteral());
1296 Record.writeUInt32(E->getStartingElementPos());
1297 Record.writeUInt32(E->getDataElementCount());
1299}
1300
1301void ASTStmtWriter::VisitAddrLabelExpr(AddrLabelExpr *E) {
1302 VisitExpr(E);
1303 Record.AddSourceLocation(E->getAmpAmpLoc());
1304 Record.AddSourceLocation(E->getLabelLoc());
1305 Record.AddDeclRef(E->getLabel());
1307}
1308
1309void ASTStmtWriter::VisitStmtExpr(StmtExpr *E) {
1310 VisitExpr(E);
1311 Record.AddStmt(E->getSubStmt());
1312 Record.AddSourceLocation(E->getLParenLoc());
1313 Record.AddSourceLocation(E->getRParenLoc());
1314 Record.push_back(E->getTemplateDepth());
1316}
1317
1318void ASTStmtWriter::VisitChooseExpr(ChooseExpr *E) {
1319 VisitExpr(E);
1320 Record.AddStmt(E->getCond());
1321 Record.AddStmt(E->getLHS());
1322 Record.AddStmt(E->getRHS());
1323 Record.AddSourceLocation(E->getBuiltinLoc());
1324 Record.AddSourceLocation(E->getRParenLoc());
1325 Record.push_back(E->isConditionDependent() ? false : E->isConditionTrue());
1327}
1328
1329void ASTStmtWriter::VisitGNUNullExpr(GNUNullExpr *E) {
1330 VisitExpr(E);
1331 Record.AddSourceLocation(E->getTokenLocation());
1333}
1334
1335void ASTStmtWriter::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
1336 VisitExpr(E);
1337 Record.push_back(E->getNumSubExprs());
1338 for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
1339 Record.AddStmt(E->getExpr(I));
1340 Record.AddSourceLocation(E->getBuiltinLoc());
1341 Record.AddSourceLocation(E->getRParenLoc());
1343}
1344
1345void ASTStmtWriter::VisitConvertVectorExpr(ConvertVectorExpr *E) {
1346 VisitExpr(E);
1347 bool HasFPFeatures = E->hasStoredFPFeatures();
1348 CurrentPackingBits.addBit(HasFPFeatures);
1349 Record.AddSourceLocation(E->getBuiltinLoc());
1350 Record.AddSourceLocation(E->getRParenLoc());
1351 Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1352 Record.AddStmt(E->getSrcExpr());
1354 if (HasFPFeatures)
1355 Record.push_back(E->getStoredFPFeatures().getAsOpaqueInt());
1356}
1357
1358void ASTStmtWriter::VisitBlockExpr(BlockExpr *E) {
1359 VisitExpr(E);
1360 Record.AddDeclRef(E->getBlockDecl());
1362}
1363
1364void ASTStmtWriter::VisitGenericSelectionExpr(GenericSelectionExpr *E) {
1365 VisitExpr(E);
1366
1367 Record.push_back(E->getNumAssocs());
1368 Record.push_back(E->isExprPredicate());
1369 Record.push_back(E->ResultIndex);
1370 Record.AddSourceLocation(E->getGenericLoc());
1371 Record.AddSourceLocation(E->getDefaultLoc());
1372 Record.AddSourceLocation(E->getRParenLoc());
1373
1374 Stmt **Stmts = E->getTrailingObjects<Stmt *>();
1375 // Add 1 to account for the controlling expression which is the first
1376 // expression in the trailing array of Stmt *. This is not needed for
1377 // the trailing array of TypeSourceInfo *.
1378 for (unsigned I = 0, N = E->getNumAssocs() + 1; I < N; ++I)
1379 Record.AddStmt(Stmts[I]);
1380
1381 TypeSourceInfo **TSIs = E->getTrailingObjects<TypeSourceInfo *>();
1382 for (unsigned I = 0, N = E->getNumAssocs(); I < N; ++I)
1383 Record.AddTypeSourceInfo(TSIs[I]);
1384
1386}
1387
1388void ASTStmtWriter::VisitPseudoObjectExpr(PseudoObjectExpr *E) {
1389 VisitExpr(E);
1390 Record.push_back(E->getNumSemanticExprs());
1391
1392 // Push the result index. Currently, this needs to exactly match
1393 // the encoding used internally for ResultIndex.
1394 unsigned result = E->getResultExprIndex();
1395 result = (result == PseudoObjectExpr::NoResult ? 0 : result + 1);
1396 Record.push_back(result);
1397
1398 Record.AddStmt(E->getSyntacticForm());
1400 i = E->semantics_begin(), e = E->semantics_end(); i != e; ++i) {
1401 Record.AddStmt(*i);
1402 }
1404}
1405
1406void ASTStmtWriter::VisitAtomicExpr(AtomicExpr *E) {
1407 VisitExpr(E);
1408 Record.push_back(E->getOp());
1409 for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I)
1410 Record.AddStmt(E->getSubExprs()[I]);
1411 Record.AddSourceLocation(E->getBuiltinLoc());
1412 Record.AddSourceLocation(E->getRParenLoc());
1414}
1415
1416//===----------------------------------------------------------------------===//
1417// Objective-C Expressions and Statements.
1418//===----------------------------------------------------------------------===//
1419
1420void ASTStmtWriter::VisitObjCStringLiteral(ObjCStringLiteral *E) {
1421 VisitExpr(E);
1422 Record.AddStmt(E->getString());
1423 Record.AddSourceLocation(E->getAtLoc());
1425}
1426
1427void ASTStmtWriter::VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
1428 VisitExpr(E);
1429 Record.AddStmt(E->getSubExpr());
1430 Record.AddDeclRef(E->getBoxingMethod());
1431 Record.AddSourceRange(E->getSourceRange());
1433}
1434
1435void ASTStmtWriter::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
1436 VisitExpr(E);
1437 Record.push_back(E->getNumElements());
1438 for (unsigned i = 0; i < E->getNumElements(); i++)
1439 Record.AddStmt(E->getElement(i));
1440 Record.AddDeclRef(E->getArrayWithObjectsMethod());
1441 Record.AddSourceRange(E->getSourceRange());
1443}
1444
1445void ASTStmtWriter::VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *E) {
1446 VisitExpr(E);
1447 Record.push_back(E->getNumElements());
1448 Record.push_back(E->HasPackExpansions);
1449 for (unsigned i = 0; i < E->getNumElements(); i++) {
1450 ObjCDictionaryElement Element = E->getKeyValueElement(i);
1451 Record.AddStmt(Element.Key);
1452 Record.AddStmt(Element.Value);
1453 if (E->HasPackExpansions) {
1454 Record.AddSourceLocation(Element.EllipsisLoc);
1455 unsigned NumExpansions = 0;
1456 if (Element.NumExpansions)
1457 NumExpansions = *Element.NumExpansions + 1;
1458 Record.push_back(NumExpansions);
1459 }
1460 }
1461
1462 Record.AddDeclRef(E->getDictWithObjectsMethod());
1463 Record.AddSourceRange(E->getSourceRange());
1465}
1466
1467void ASTStmtWriter::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
1468 VisitExpr(E);
1469 Record.AddTypeSourceInfo(E->getEncodedTypeSourceInfo());
1470 Record.AddSourceLocation(E->getAtLoc());
1471 Record.AddSourceLocation(E->getRParenLoc());
1473}
1474
1475void ASTStmtWriter::VisitObjCSelectorExpr(ObjCSelectorExpr *E) {
1476 VisitExpr(E);
1477 Record.AddSelectorRef(E->getSelector());
1478 Record.AddSourceLocation(E->getAtLoc());
1479 Record.AddSourceLocation(E->getRParenLoc());
1481}
1482
1483void ASTStmtWriter::VisitObjCProtocolExpr(ObjCProtocolExpr *E) {
1484 VisitExpr(E);
1485 Record.AddDeclRef(E->getProtocol());
1486 Record.AddSourceLocation(E->getAtLoc());
1487 Record.AddSourceLocation(E->ProtoLoc);
1488 Record.AddSourceLocation(E->getRParenLoc());
1490}
1491
1492void ASTStmtWriter::VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) {
1493 VisitExpr(E);
1494 Record.AddDeclRef(E->getDecl());
1495 Record.AddSourceLocation(E->getLocation());
1496 Record.AddSourceLocation(E->getOpLoc());
1497 Record.AddStmt(E->getBase());
1498 Record.push_back(E->isArrow());
1499 Record.push_back(E->isFreeIvar());
1501}
1502
1503void ASTStmtWriter::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
1504 VisitExpr(E);
1505 Record.push_back(E->SetterAndMethodRefFlags.getInt());
1506 Record.push_back(E->isImplicitProperty());
1507 if (E->isImplicitProperty()) {
1508 Record.AddDeclRef(E->getImplicitPropertyGetter());
1509 Record.AddDeclRef(E->getImplicitPropertySetter());
1510 } else {
1511 Record.AddDeclRef(E->getExplicitProperty());
1512 }
1513 Record.AddSourceLocation(E->getLocation());
1514 Record.AddSourceLocation(E->getReceiverLocation());
1515 if (E->isObjectReceiver()) {
1516 Record.push_back(0);
1517 Record.AddStmt(E->getBase());
1518 } else if (E->isSuperReceiver()) {
1519 Record.push_back(1);
1520 Record.AddTypeRef(E->getSuperReceiverType());
1521 } else {
1522 Record.push_back(2);
1523 Record.AddDeclRef(E->getClassReceiver());
1524 }
1525
1527}
1528
1529void ASTStmtWriter::VisitObjCSubscriptRefExpr(ObjCSubscriptRefExpr *E) {
1530 VisitExpr(E);
1531 Record.AddSourceLocation(E->getRBracket());
1532 Record.AddStmt(E->getBaseExpr());
1533 Record.AddStmt(E->getKeyExpr());
1534 Record.AddDeclRef(E->getAtIndexMethodDecl());
1535 Record.AddDeclRef(E->setAtIndexMethodDecl());
1536
1538}
1539
1540void ASTStmtWriter::VisitObjCMessageExpr(ObjCMessageExpr *E) {
1541 VisitExpr(E);
1542 Record.push_back(E->getNumArgs());
1543 Record.push_back(E->getNumStoredSelLocs());
1544 Record.push_back(E->SelLocsKind);
1545 Record.push_back(E->isDelegateInitCall());
1546 Record.push_back(E->IsImplicit);
1547 Record.push_back((unsigned)E->getReceiverKind()); // FIXME: stable encoding
1548 switch (E->getReceiverKind()) {
1550 Record.AddStmt(E->getInstanceReceiver());
1551 break;
1552
1554 Record.AddTypeSourceInfo(E->getClassReceiverTypeInfo());
1555 break;
1556
1559 Record.AddTypeRef(E->getSuperType());
1560 Record.AddSourceLocation(E->getSuperLoc());
1561 break;
1562 }
1563
1564 if (E->getMethodDecl()) {
1565 Record.push_back(1);
1566 Record.AddDeclRef(E->getMethodDecl());
1567 } else {
1568 Record.push_back(0);
1569 Record.AddSelectorRef(E->getSelector());
1570 }
1571
1572 Record.AddSourceLocation(E->getLeftLoc());
1573 Record.AddSourceLocation(E->getRightLoc());
1574
1575 for (CallExpr::arg_iterator Arg = E->arg_begin(), ArgEnd = E->arg_end();
1576 Arg != ArgEnd; ++Arg)
1577 Record.AddStmt(*Arg);
1578
1579 SourceLocation *Locs = E->getStoredSelLocs();
1580 for (unsigned i = 0, e = E->getNumStoredSelLocs(); i != e; ++i)
1581 Record.AddSourceLocation(Locs[i]);
1582
1584}
1585
1586void ASTStmtWriter::VisitObjCForCollectionStmt(ObjCForCollectionStmt *S) {
1587 VisitStmt(S);
1588 Record.AddStmt(S->getElement());
1589 Record.AddStmt(S->getCollection());
1590 Record.AddStmt(S->getBody());
1591 Record.AddSourceLocation(S->getForLoc());
1592 Record.AddSourceLocation(S->getRParenLoc());
1594}
1595
1596void ASTStmtWriter::VisitObjCAtCatchStmt(ObjCAtCatchStmt *S) {
1597 VisitStmt(S);
1598 Record.AddStmt(S->getCatchBody());
1599 Record.AddDeclRef(S->getCatchParamDecl());
1600 Record.AddSourceLocation(S->getAtCatchLoc());
1601 Record.AddSourceLocation(S->getRParenLoc());
1603}
1604
1605void ASTStmtWriter::VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S) {
1606 VisitStmt(S);
1607 Record.AddStmt(S->getFinallyBody());
1608 Record.AddSourceLocation(S->getAtFinallyLoc());
1610}
1611
1612void ASTStmtWriter::VisitObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S) {
1613 VisitStmt(S); // FIXME: no test coverage.
1614 Record.AddStmt(S->getSubStmt());
1615 Record.AddSourceLocation(S->getAtLoc());
1617}
1618
1619void ASTStmtWriter::VisitObjCAtTryStmt(ObjCAtTryStmt *S) {
1620 VisitStmt(S);
1621 Record.push_back(S->getNumCatchStmts());
1622 Record.push_back(S->getFinallyStmt() != nullptr);
1623 Record.AddStmt(S->getTryBody());
1624 for (ObjCAtCatchStmt *C : S->catch_stmts())
1625 Record.AddStmt(C);
1626 if (S->getFinallyStmt())
1627 Record.AddStmt(S->getFinallyStmt());
1628 Record.AddSourceLocation(S->getAtTryLoc());
1630}
1631
1632void ASTStmtWriter::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
1633 VisitStmt(S); // FIXME: no test coverage.
1634 Record.AddStmt(S->getSynchExpr());
1635 Record.AddStmt(S->getSynchBody());
1636 Record.AddSourceLocation(S->getAtSynchronizedLoc());
1638}
1639
1640void ASTStmtWriter::VisitObjCAtThrowStmt(ObjCAtThrowStmt *S) {
1641 VisitStmt(S); // FIXME: no test coverage.
1642 Record.AddStmt(S->getThrowExpr());
1643 Record.AddSourceLocation(S->getThrowLoc());
1645}
1646
1647void ASTStmtWriter::VisitObjCBoolLiteralExpr(ObjCBoolLiteralExpr *E) {
1648 VisitExpr(E);
1649 Record.push_back(E->getValue());
1650 Record.AddSourceLocation(E->getLocation());
1652}
1653
1654void ASTStmtWriter::VisitObjCAvailabilityCheckExpr(ObjCAvailabilityCheckExpr *E) {
1655 VisitExpr(E);
1656 Record.AddSourceRange(E->getSourceRange());
1657 Record.AddVersionTuple(E->getVersion());
1659}
1660
1661//===----------------------------------------------------------------------===//
1662// C++ Expressions and Statements.
1663//===----------------------------------------------------------------------===//
1664
1665void ASTStmtWriter::VisitCXXCatchStmt(CXXCatchStmt *S) {
1666 VisitStmt(S);
1667 Record.AddSourceLocation(S->getCatchLoc());
1668 Record.AddDeclRef(S->getExceptionDecl());
1669 Record.AddStmt(S->getHandlerBlock());
1671}
1672
1673void ASTStmtWriter::VisitCXXTryStmt(CXXTryStmt *S) {
1674 VisitStmt(S);
1675 Record.push_back(S->getNumHandlers());
1676 Record.AddSourceLocation(S->getTryLoc());
1677 Record.AddStmt(S->getTryBlock());
1678 for (unsigned i = 0, e = S->getNumHandlers(); i != e; ++i)
1679 Record.AddStmt(S->getHandler(i));
1681}
1682
1683void ASTStmtWriter::VisitCXXForRangeStmt(CXXForRangeStmt *S) {
1684 VisitStmt(S);
1685 Record.AddSourceLocation(S->getForLoc());
1686 Record.AddSourceLocation(S->getCoawaitLoc());
1687 Record.AddSourceLocation(S->getColonLoc());
1688 Record.AddSourceLocation(S->getRParenLoc());
1689 Record.AddStmt(S->getInit());
1690 Record.AddStmt(S->getRangeStmt());
1691 Record.AddStmt(S->getBeginStmt());
1692 Record.AddStmt(S->getEndStmt());
1693 Record.AddStmt(S->getCond());
1694 Record.AddStmt(S->getInc());
1695 Record.AddStmt(S->getLoopVarStmt());
1696 Record.AddStmt(S->getBody());
1698}
1699
1700void ASTStmtWriter::VisitMSDependentExistsStmt(MSDependentExistsStmt *S) {
1701 VisitStmt(S);
1702 Record.AddSourceLocation(S->getKeywordLoc());
1703 Record.push_back(S->isIfExists());
1704 Record.AddNestedNameSpecifierLoc(S->getQualifierLoc());
1705 Record.AddDeclarationNameInfo(S->getNameInfo());
1706 Record.AddStmt(S->getSubStmt());
1708}
1709
1710void ASTStmtWriter::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
1711 VisitCallExpr(E);
1712 Record.push_back(E->getOperator());
1713 Record.AddSourceLocation(E->BeginLoc);
1714
1715 if (!E->hasStoredFPFeatures() && !static_cast<bool>(E->getADLCallKind()))
1716 AbbrevToUse = Writer.getCXXOperatorCallExprAbbrev();
1717
1719}
1720
1721void ASTStmtWriter::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) {
1722 VisitCallExpr(E);
1723
1724 if (!E->hasStoredFPFeatures() && !static_cast<bool>(E->getADLCallKind()))
1725 AbbrevToUse = Writer.getCXXMemberCallExprAbbrev();
1726
1728}
1729
1730void ASTStmtWriter::VisitCXXRewrittenBinaryOperator(
1732 VisitExpr(E);
1733 Record.push_back(E->isReversed());
1734 Record.AddStmt(E->getSemanticForm());
1736}
1737
1738void ASTStmtWriter::VisitCXXConstructExpr(CXXConstructExpr *E) {
1739 VisitExpr(E);
1740
1741 Record.push_back(E->getNumArgs());
1742 Record.push_back(E->isElidable());
1743 Record.push_back(E->hadMultipleCandidates());
1744 Record.push_back(E->isListInitialization());
1745 Record.push_back(E->isStdInitListInitialization());
1746 Record.push_back(E->requiresZeroInitialization());
1747 Record.push_back(
1748 llvm::to_underlying(E->getConstructionKind())); // FIXME: stable encoding
1749 Record.push_back(E->isImmediateEscalating());
1750 Record.AddSourceLocation(E->getLocation());
1751 Record.AddDeclRef(E->getConstructor());
1752 Record.AddSourceRange(E->getParenOrBraceRange());
1753
1754 for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
1755 Record.AddStmt(E->getArg(I));
1756
1758}
1759
1760void ASTStmtWriter::VisitCXXInheritedCtorInitExpr(CXXInheritedCtorInitExpr *E) {
1761 VisitExpr(E);
1762 Record.AddDeclRef(E->getConstructor());
1763 Record.AddSourceLocation(E->getLocation());
1764 Record.push_back(E->constructsVBase());
1765 Record.push_back(E->inheritedFromVBase());
1767}
1768
1769void ASTStmtWriter::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
1770 VisitCXXConstructExpr(E);
1771 Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1773}
1774
1775void ASTStmtWriter::VisitLambdaExpr(LambdaExpr *E) {
1776 VisitExpr(E);
1777 Record.push_back(E->LambdaExprBits.NumCaptures);
1778 Record.AddSourceRange(E->IntroducerRange);
1779 Record.push_back(E->LambdaExprBits.CaptureDefault); // FIXME: stable encoding
1780 Record.AddSourceLocation(E->CaptureDefaultLoc);
1781 Record.push_back(E->LambdaExprBits.ExplicitParams);
1782 Record.push_back(E->LambdaExprBits.ExplicitResultType);
1783 Record.AddSourceLocation(E->ClosingBrace);
1784
1785 // Add capture initializers.
1786 for (LambdaExpr::capture_init_iterator C = E->capture_init_begin(),
1787 CEnd = E->capture_init_end();
1788 C != CEnd; ++C) {
1789 Record.AddStmt(*C);
1790 }
1791
1792 // Don't serialize the body. It belongs to the call operator declaration.
1793 // LambdaExpr only stores a copy of the Stmt *.
1794
1796}
1797
1798void ASTStmtWriter::VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E) {
1799 VisitExpr(E);
1800 Record.AddStmt(E->getSubExpr());
1802}
1803
1804void ASTStmtWriter::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) {
1805 VisitExplicitCastExpr(E);
1806 Record.AddSourceRange(SourceRange(E->getOperatorLoc(), E->getRParenLoc()));
1807 CurrentPackingBits.addBit(E->getAngleBrackets().isValid());
1808 if (E->getAngleBrackets().isValid())
1809 Record.AddSourceRange(E->getAngleBrackets());
1810}
1811
1812void ASTStmtWriter::VisitCXXStaticCastExpr(CXXStaticCastExpr *E) {
1813 VisitCXXNamedCastExpr(E);
1815}
1816
1817void ASTStmtWriter::VisitCXXDynamicCastExpr(CXXDynamicCastExpr *E) {
1818 VisitCXXNamedCastExpr(E);
1820}
1821
1822void ASTStmtWriter::VisitCXXReinterpretCastExpr(CXXReinterpretCastExpr *E) {
1823 VisitCXXNamedCastExpr(E);
1825}
1826
1827void ASTStmtWriter::VisitCXXConstCastExpr(CXXConstCastExpr *E) {
1828 VisitCXXNamedCastExpr(E);
1830}
1831
1832void ASTStmtWriter::VisitCXXAddrspaceCastExpr(CXXAddrspaceCastExpr *E) {
1833 VisitCXXNamedCastExpr(E);
1835}
1836
1837void ASTStmtWriter::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E) {
1838 VisitExplicitCastExpr(E);
1839 Record.AddSourceLocation(E->getLParenLoc());
1840 Record.AddSourceLocation(E->getRParenLoc());
1842}
1843
1844void ASTStmtWriter::VisitBuiltinBitCastExpr(BuiltinBitCastExpr *E) {
1845 VisitExplicitCastExpr(E);
1846 Record.AddSourceLocation(E->getBeginLoc());
1847 Record.AddSourceLocation(E->getEndLoc());
1849}
1850
1851void ASTStmtWriter::VisitUserDefinedLiteral(UserDefinedLiteral *E) {
1852 VisitCallExpr(E);
1853 Record.AddSourceLocation(E->UDSuffixLoc);
1855}
1856
1857void ASTStmtWriter::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) {
1858 VisitExpr(E);
1859 Record.push_back(E->getValue());
1860 Record.AddSourceLocation(E->getLocation());
1862}
1863
1864void ASTStmtWriter::VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E) {
1865 VisitExpr(E);
1866 Record.AddSourceLocation(E->getLocation());
1868}
1869
1870void ASTStmtWriter::VisitCXXTypeidExpr(CXXTypeidExpr *E) {
1871 VisitExpr(E);
1872 Record.AddSourceRange(E->getSourceRange());
1873 if (E->isTypeOperand()) {
1874 Record.AddTypeSourceInfo(E->getTypeOperandSourceInfo());
1876 } else {
1877 Record.AddStmt(E->getExprOperand());
1879 }
1880}
1881
1882void ASTStmtWriter::VisitCXXThisExpr(CXXThisExpr *E) {
1883 VisitExpr(E);
1884 Record.AddSourceLocation(E->getLocation());
1885 Record.push_back(E->isImplicit());
1886 Record.push_back(E->isCapturedByCopyInLambdaWithExplicitObjectParameter());
1887
1889}
1890
1891void ASTStmtWriter::VisitCXXThrowExpr(CXXThrowExpr *E) {
1892 VisitExpr(E);
1893 Record.AddSourceLocation(E->getThrowLoc());
1894 Record.AddStmt(E->getSubExpr());
1895 Record.push_back(E->isThrownVariableInScope());
1897}
1898
1899void ASTStmtWriter::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
1900 VisitExpr(E);
1901 Record.AddDeclRef(E->getParam());
1902 Record.AddDeclRef(cast_or_null<Decl>(E->getUsedContext()));
1903 Record.AddSourceLocation(E->getUsedLocation());
1904 Record.push_back(E->hasRewrittenInit());
1905 if (E->hasRewrittenInit())
1906 Record.AddStmt(E->getRewrittenExpr());
1908}
1909
1910void ASTStmtWriter::VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E) {
1911 VisitExpr(E);
1912 Record.push_back(E->hasRewrittenInit());
1913 Record.AddDeclRef(E->getField());
1914 Record.AddDeclRef(cast_or_null<Decl>(E->getUsedContext()));
1915 Record.AddSourceLocation(E->getExprLoc());
1916 if (E->hasRewrittenInit())
1917 Record.AddStmt(E->getRewrittenExpr());
1919}
1920
1921void ASTStmtWriter::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
1922 VisitExpr(E);
1923 Record.AddCXXTemporary(E->getTemporary());
1924 Record.AddStmt(E->getSubExpr());
1926}
1927
1928void ASTStmtWriter::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
1929 VisitExpr(E);
1930 Record.AddTypeSourceInfo(E->getTypeSourceInfo());
1931 Record.AddSourceLocation(E->getRParenLoc());
1933}
1934
1935void ASTStmtWriter::VisitCXXNewExpr(CXXNewExpr *E) {
1936 VisitExpr(E);
1937
1938 Record.push_back(E->isArray());
1939 Record.push_back(E->hasInitializer());
1940 Record.push_back(E->getNumPlacementArgs());
1941 Record.push_back(E->isParenTypeId());
1942
1943 Record.push_back(E->isGlobalNew());
1944 ImplicitAllocationParameters IAP = E->implicitAllocationParameters();
1947 Record.push_back(E->doesUsualArrayDeleteWantSize());
1948 Record.push_back(E->CXXNewExprBits.HasInitializer);
1949 Record.push_back(E->CXXNewExprBits.StoredInitializationStyle);
1950
1951 Record.AddDeclRef(E->getOperatorNew());
1952 Record.AddDeclRef(E->getOperatorDelete());
1953 Record.AddTypeSourceInfo(E->getAllocatedTypeSourceInfo());
1954 if (E->isParenTypeId())
1955 Record.AddSourceRange(E->getTypeIdParens());
1956 Record.AddSourceRange(E->getSourceRange());
1957 Record.AddSourceRange(E->getDirectInitRange());
1958
1959 for (CXXNewExpr::arg_iterator I = E->raw_arg_begin(), N = E->raw_arg_end();
1960 I != N; ++I)
1961 Record.AddStmt(*I);
1962
1964}
1965
1966void ASTStmtWriter::VisitCXXDeleteExpr(CXXDeleteExpr *E) {
1967 VisitExpr(E);
1968 Record.push_back(E->isGlobalDelete());
1969 Record.push_back(E->isArrayForm());
1970 Record.push_back(E->isArrayFormAsWritten());
1971 Record.push_back(E->doesUsualArrayDeleteWantSize());
1972 Record.AddDeclRef(E->getOperatorDelete());
1973 Record.AddStmt(E->getArgument());
1974 Record.AddSourceLocation(E->getBeginLoc());
1975
1977}
1978
1979void ASTStmtWriter::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
1980 VisitExpr(E);
1981
1982 Record.AddStmt(E->getBase());
1983 Record.push_back(E->isArrow());
1984 Record.AddSourceLocation(E->getOperatorLoc());
1985 Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
1986 Record.AddTypeSourceInfo(E->getScopeTypeInfo());
1987 Record.AddSourceLocation(E->getColonColonLoc());
1988 Record.AddSourceLocation(E->getTildeLoc());
1989
1990 // PseudoDestructorTypeStorage.
1991 Record.AddIdentifierRef(E->getDestroyedTypeIdentifier());
1992 if (E->getDestroyedTypeIdentifier())
1993 Record.AddSourceLocation(E->getDestroyedTypeLoc());
1994 else
1995 Record.AddTypeSourceInfo(E->getDestroyedTypeInfo());
1996
1998}
1999
2000void ASTStmtWriter::VisitExprWithCleanups(ExprWithCleanups *E) {
2001 VisitExpr(E);
2002 Record.push_back(E->getNumObjects());
2003 for (auto &Obj : E->getObjects()) {
2004 if (auto *BD = Obj.dyn_cast<BlockDecl *>()) {
2006 Record.AddDeclRef(BD);
2007 } else if (auto *CLE = Obj.dyn_cast<CompoundLiteralExpr *>()) {
2009 Record.AddStmt(CLE);
2010 }
2011 }
2012
2013 Record.push_back(E->cleanupsHaveSideEffects());
2014 Record.AddStmt(E->getSubExpr());
2016}
2017
2018void ASTStmtWriter::VisitCXXDependentScopeMemberExpr(
2020 VisitExpr(E);
2021
2022 // Don't emit anything here (or if you do you will have to update
2023 // the corresponding deserialization function).
2024 Record.push_back(E->getNumTemplateArgs());
2025 CurrentPackingBits.updateBits();
2026 CurrentPackingBits.addBit(E->hasTemplateKWAndArgsInfo());
2027 CurrentPackingBits.addBit(E->hasFirstQualifierFoundInScope());
2028
2029 if (E->hasTemplateKWAndArgsInfo()) {
2030 const ASTTemplateKWAndArgsInfo &ArgInfo =
2031 *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
2033 E->getTrailingObjects<TemplateArgumentLoc>());
2034 }
2035
2036 CurrentPackingBits.addBit(E->isArrow());
2037
2038 Record.AddTypeRef(E->getBaseType());
2039 Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
2040 CurrentPackingBits.addBit(!E->isImplicitAccess());
2041 if (!E->isImplicitAccess())
2042 Record.AddStmt(E->getBase());
2043
2044 Record.AddSourceLocation(E->getOperatorLoc());
2045
2046 if (E->hasFirstQualifierFoundInScope())
2047 Record.AddDeclRef(E->getFirstQualifierFoundInScope());
2048
2049 Record.AddDeclarationNameInfo(E->MemberNameInfo);
2051}
2052
2053void
2054ASTStmtWriter::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) {
2055 VisitExpr(E);
2056
2057 // Don't emit anything here, HasTemplateKWAndArgsInfo must be
2058 // emitted first.
2059 CurrentPackingBits.addBit(
2060 E->DependentScopeDeclRefExprBits.HasTemplateKWAndArgsInfo);
2061
2062 if (E->DependentScopeDeclRefExprBits.HasTemplateKWAndArgsInfo) {
2063 const ASTTemplateKWAndArgsInfo &ArgInfo =
2064 *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
2065 // 16 bits should be enought to store the number of args
2066 CurrentPackingBits.addBits(ArgInfo.NumTemplateArgs, /*Width=*/16);
2068 E->getTrailingObjects<TemplateArgumentLoc>());
2069 }
2070
2071 Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
2072 Record.AddDeclarationNameInfo(E->NameInfo);
2074}
2075
2076void
2077ASTStmtWriter::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E) {
2078 VisitExpr(E);
2079 Record.push_back(E->getNumArgs());
2081 ArgI = E->arg_begin(), ArgE = E->arg_end(); ArgI != ArgE; ++ArgI)
2082 Record.AddStmt(*ArgI);
2083 Record.AddTypeSourceInfo(E->getTypeSourceInfo());
2084 Record.AddSourceLocation(E->getLParenLoc());
2085 Record.AddSourceLocation(E->getRParenLoc());
2086 Record.push_back(E->isListInitialization());
2088}
2089
2090void ASTStmtWriter::VisitOverloadExpr(OverloadExpr *E) {
2091 VisitExpr(E);
2092
2093 Record.push_back(E->getNumDecls());
2094
2095 CurrentPackingBits.updateBits();
2096 CurrentPackingBits.addBit(E->hasTemplateKWAndArgsInfo());
2097 if (E->hasTemplateKWAndArgsInfo()) {
2098 const ASTTemplateKWAndArgsInfo &ArgInfo =
2099 *E->getTrailingASTTemplateKWAndArgsInfo();
2100 Record.push_back(ArgInfo.NumTemplateArgs);
2101 AddTemplateKWAndArgsInfo(ArgInfo, E->getTrailingTemplateArgumentLoc());
2102 }
2103
2104 for (OverloadExpr::decls_iterator OvI = E->decls_begin(),
2105 OvE = E->decls_end();
2106 OvI != OvE; ++OvI) {
2107 Record.AddDeclRef(OvI.getDecl());
2108 Record.push_back(OvI.getAccess());
2109 }
2110
2111 Record.AddDeclarationNameInfo(E->getNameInfo());
2112 Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
2113}
2114
2115void ASTStmtWriter::VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
2116 VisitOverloadExpr(E);
2117 CurrentPackingBits.addBit(E->isArrow());
2118 CurrentPackingBits.addBit(E->hasUnresolvedUsing());
2119 CurrentPackingBits.addBit(!E->isImplicitAccess());
2120 if (!E->isImplicitAccess())
2121 Record.AddStmt(E->getBase());
2122
2123 Record.AddSourceLocation(E->getOperatorLoc());
2124
2125 Record.AddTypeRef(E->getBaseType());
2127}
2128
2129void ASTStmtWriter::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) {
2130 VisitOverloadExpr(E);
2131 CurrentPackingBits.addBit(E->requiresADL());
2132 Record.AddDeclRef(E->getNamingClass());
2134
2135 if (Writer.isWritingStdCXXNamedModules() && Writer.getChain()) {
2136 // Referencing all the possible declarations to make sure the change get
2137 // propagted.
2138 DeclarationName Name = E->getName();
2139 for (auto *Found :
2140 Record.getASTContext().getTranslationUnitDecl()->lookup(Name))
2141 if (Found->isFromASTFile())
2142 Writer.GetDeclRef(Found);
2143
2145 Writer.getChain()->ReadKnownNamespaces(ExternalNSs);
2146 for (auto *NS : ExternalNSs)
2147 for (auto *Found : NS->lookup(Name))
2148 Writer.GetDeclRef(Found);
2149 }
2150}
2151
2152void ASTStmtWriter::VisitTypeTraitExpr(TypeTraitExpr *E) {
2153 VisitExpr(E);
2154 Record.push_back(E->TypeTraitExprBits.IsBooleanTypeTrait);
2155 Record.push_back(E->TypeTraitExprBits.NumArgs);
2156 Record.push_back(E->TypeTraitExprBits.Kind); // FIXME: Stable encoding
2157
2158 if (E->TypeTraitExprBits.IsBooleanTypeTrait)
2159 Record.push_back(E->TypeTraitExprBits.Value);
2160 else
2161 Record.AddAPValue(E->getAPValue());
2162
2163 Record.AddSourceRange(E->getSourceRange());
2164 for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
2165 Record.AddTypeSourceInfo(E->getArg(I));
2167}
2168
2169void ASTStmtWriter::VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E) {
2170 VisitExpr(E);
2171 Record.push_back(E->getTrait());
2172 Record.push_back(E->getValue());
2173 Record.AddSourceRange(E->getSourceRange());
2174 Record.AddTypeSourceInfo(E->getQueriedTypeSourceInfo());
2175 Record.AddStmt(E->getDimensionExpression());
2177}
2178
2179void ASTStmtWriter::VisitExpressionTraitExpr(ExpressionTraitExpr *E) {
2180 VisitExpr(E);
2181 Record.push_back(E->getTrait());
2182 Record.push_back(E->getValue());
2183 Record.AddSourceRange(E->getSourceRange());
2184 Record.AddStmt(E->getQueriedExpression());
2186}
2187
2188void ASTStmtWriter::VisitCXXNoexceptExpr(CXXNoexceptExpr *E) {
2189 VisitExpr(E);
2190 Record.push_back(E->getValue());
2191 Record.AddSourceRange(E->getSourceRange());
2192 Record.AddStmt(E->getOperand());
2194}
2195
2196void ASTStmtWriter::VisitPackExpansionExpr(PackExpansionExpr *E) {
2197 VisitExpr(E);
2198 Record.AddSourceLocation(E->getEllipsisLoc());
2199 Record.push_back(E->NumExpansions);
2200 Record.AddStmt(E->getPattern());
2202}
2203
2204void ASTStmtWriter::VisitSizeOfPackExpr(SizeOfPackExpr *E) {
2205 VisitExpr(E);
2206 Record.push_back(E->isPartiallySubstituted() ? E->getPartialArguments().size()
2207 : 0);
2208 Record.AddSourceLocation(E->OperatorLoc);
2209 Record.AddSourceLocation(E->PackLoc);
2210 Record.AddSourceLocation(E->RParenLoc);
2211 Record.AddDeclRef(E->Pack);
2212 if (E->isPartiallySubstituted()) {
2213 for (const auto &TA : E->getPartialArguments())
2214 Record.AddTemplateArgument(TA);
2215 } else if (!E->isValueDependent()) {
2216 Record.push_back(E->getPackLength());
2217 }
2219}
2220
2221void ASTStmtWriter::VisitPackIndexingExpr(PackIndexingExpr *E) {
2222 VisitExpr(E);
2223 Record.push_back(E->PackIndexingExprBits.TransformedExpressions);
2224 Record.push_back(E->PackIndexingExprBits.FullySubstituted);
2225 Record.AddSourceLocation(E->getEllipsisLoc());
2226 Record.AddSourceLocation(E->getRSquareLoc());
2227 Record.AddStmt(E->getPackIdExpression());
2228 Record.AddStmt(E->getIndexExpr());
2229 for (Expr *Sub : E->getExpressions())
2230 Record.AddStmt(Sub);
2232}
2233
2234void ASTStmtWriter::VisitSubstNonTypeTemplateParmExpr(
2236 VisitExpr(E);
2237 Record.AddDeclRef(E->getAssociatedDecl());
2238 CurrentPackingBits.addBit(E->isReferenceParameter());
2239 CurrentPackingBits.addBits(E->getIndex(), /*Width=*/12);
2240 Record.writeUnsignedOrNone(E->getPackIndex());
2241 CurrentPackingBits.addBit(E->getFinal());
2242
2243 Record.AddSourceLocation(E->getNameLoc());
2244 Record.AddStmt(E->getReplacement());
2246}
2247
2248void ASTStmtWriter::VisitSubstNonTypeTemplateParmPackExpr(
2250 VisitExpr(E);
2251 Record.AddDeclRef(E->getAssociatedDecl());
2252 CurrentPackingBits.addBit(E->getFinal());
2253 Record.push_back(E->getIndex());
2254 Record.AddTemplateArgument(E->getArgumentPack());
2255 Record.AddSourceLocation(E->getParameterPackLocation());
2257}
2258
2259void ASTStmtWriter::VisitFunctionParmPackExpr(FunctionParmPackExpr *E) {
2260 VisitExpr(E);
2261 Record.push_back(E->getNumExpansions());
2262 Record.AddDeclRef(E->getParameterPack());
2263 Record.AddSourceLocation(E->getParameterPackLocation());
2264 for (FunctionParmPackExpr::iterator I = E->begin(), End = E->end();
2265 I != End; ++I)
2266 Record.AddDeclRef(*I);
2268}
2269
2270void ASTStmtWriter::VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E) {
2271 VisitExpr(E);
2272 Record.push_back(static_cast<bool>(E->getLifetimeExtendedTemporaryDecl()));
2273 if (E->getLifetimeExtendedTemporaryDecl())
2274 Record.AddDeclRef(E->getLifetimeExtendedTemporaryDecl());
2275 else
2276 Record.AddStmt(E->getSubExpr());
2278}
2279
2280void ASTStmtWriter::VisitCXXFoldExpr(CXXFoldExpr *E) {
2281 VisitExpr(E);
2282 Record.AddSourceLocation(E->LParenLoc);
2283 Record.AddSourceLocation(E->EllipsisLoc);
2284 Record.AddSourceLocation(E->RParenLoc);
2285 Record.push_back(E->NumExpansions.toInternalRepresentation());
2286 Record.AddStmt(E->SubExprs[0]);
2287 Record.AddStmt(E->SubExprs[1]);
2288 Record.AddStmt(E->SubExprs[2]);
2289 Record.push_back(E->CXXFoldExprBits.Opcode);
2291}
2292
2293void ASTStmtWriter::VisitCXXParenListInitExpr(CXXParenListInitExpr *E) {
2294 VisitExpr(E);
2295 ArrayRef<Expr *> InitExprs = E->getInitExprs();
2296 Record.push_back(InitExprs.size());
2297 Record.push_back(E->getUserSpecifiedInitExprs().size());
2298 Record.AddSourceLocation(E->getInitLoc());
2299 Record.AddSourceLocation(E->getBeginLoc());
2300 Record.AddSourceLocation(E->getEndLoc());
2301 for (Expr *InitExpr : E->getInitExprs())
2302 Record.AddStmt(InitExpr);
2303 Expr *ArrayFiller = E->getArrayFiller();
2304 FieldDecl *UnionField = E->getInitializedFieldInUnion();
2305 bool HasArrayFillerOrUnionDecl = ArrayFiller || UnionField;
2306 Record.push_back(HasArrayFillerOrUnionDecl);
2307 if (HasArrayFillerOrUnionDecl) {
2308 Record.push_back(static_cast<bool>(ArrayFiller));
2309 if (ArrayFiller)
2310 Record.AddStmt(ArrayFiller);
2311 else
2312 Record.AddDeclRef(UnionField);
2313 }
2315}
2316
2317void ASTStmtWriter::VisitOpaqueValueExpr(OpaqueValueExpr *E) {
2318 VisitExpr(E);
2319 Record.AddStmt(E->getSourceExpr());
2320 Record.AddSourceLocation(E->getLocation());
2321 Record.push_back(E->isUnique());
2323}
2324
2325//===----------------------------------------------------------------------===//
2326// CUDA Expressions and Statements.
2327//===----------------------------------------------------------------------===//
2328
2329void ASTStmtWriter::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E) {
2330 VisitCallExpr(E);
2331 Record.AddStmt(E->getConfig());
2333}
2334
2335//===----------------------------------------------------------------------===//
2336// OpenCL Expressions and Statements.
2337//===----------------------------------------------------------------------===//
2338void ASTStmtWriter::VisitAsTypeExpr(AsTypeExpr *E) {
2339 VisitExpr(E);
2340 Record.AddSourceLocation(E->getBuiltinLoc());
2341 Record.AddSourceLocation(E->getRParenLoc());
2342 Record.AddStmt(E->getSrcExpr());
2344}
2345
2346//===----------------------------------------------------------------------===//
2347// Microsoft Expressions and Statements.
2348//===----------------------------------------------------------------------===//
2349void ASTStmtWriter::VisitMSPropertyRefExpr(MSPropertyRefExpr *E) {
2350 VisitExpr(E);
2351 Record.push_back(E->isArrow());
2352 Record.AddStmt(E->getBaseExpr());
2353 Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
2354 Record.AddSourceLocation(E->getMemberLoc());
2355 Record.AddDeclRef(E->getPropertyDecl());
2357}
2358
2359void ASTStmtWriter::VisitMSPropertySubscriptExpr(MSPropertySubscriptExpr *E) {
2360 VisitExpr(E);
2361 Record.AddStmt(E->getBase());
2362 Record.AddStmt(E->getIdx());
2363 Record.AddSourceLocation(E->getRBracketLoc());
2365}
2366
2367void ASTStmtWriter::VisitCXXUuidofExpr(CXXUuidofExpr *E) {
2368 VisitExpr(E);
2369 Record.AddSourceRange(E->getSourceRange());
2370 Record.AddDeclRef(E->getGuidDecl());
2371 if (E->isTypeOperand()) {
2372 Record.AddTypeSourceInfo(E->getTypeOperandSourceInfo());
2374 } else {
2375 Record.AddStmt(E->getExprOperand());
2377 }
2378}
2379
2380void ASTStmtWriter::VisitSEHExceptStmt(SEHExceptStmt *S) {
2381 VisitStmt(S);
2382 Record.AddSourceLocation(S->getExceptLoc());
2383 Record.AddStmt(S->getFilterExpr());
2384 Record.AddStmt(S->getBlock());
2386}
2387
2388void ASTStmtWriter::VisitSEHFinallyStmt(SEHFinallyStmt *S) {
2389 VisitStmt(S);
2390 Record.AddSourceLocation(S->getFinallyLoc());
2391 Record.AddStmt(S->getBlock());
2393}
2394
2395void ASTStmtWriter::VisitSEHTryStmt(SEHTryStmt *S) {
2396 VisitStmt(S);
2397 Record.push_back(S->getIsCXXTry());
2398 Record.AddSourceLocation(S->getTryLoc());
2399 Record.AddStmt(S->getTryBlock());
2400 Record.AddStmt(S->getHandler());
2402}
2403
2404void ASTStmtWriter::VisitSEHLeaveStmt(SEHLeaveStmt *S) {
2405 VisitStmt(S);
2406 Record.AddSourceLocation(S->getLeaveLoc());
2408}
2409
2410//===----------------------------------------------------------------------===//
2411// OpenMP Directives.
2412//===----------------------------------------------------------------------===//
2413
2414void ASTStmtWriter::VisitOMPCanonicalLoop(OMPCanonicalLoop *S) {
2415 VisitStmt(S);
2416 for (Stmt *SubStmt : S->SubStmts)
2417 Record.AddStmt(SubStmt);
2419}
2420
2421void ASTStmtWriter::VisitOMPExecutableDirective(OMPExecutableDirective *E) {
2422 Record.writeOMPChildren(E->Data);
2423 Record.AddSourceLocation(E->getBeginLoc());
2424 Record.AddSourceLocation(E->getEndLoc());
2425}
2426
2427void ASTStmtWriter::VisitOMPLoopBasedDirective(OMPLoopBasedDirective *D) {
2428 VisitStmt(D);
2429 Record.writeUInt32(D->getLoopsNumber());
2430 VisitOMPExecutableDirective(D);
2431}
2432
2433void ASTStmtWriter::VisitOMPLoopDirective(OMPLoopDirective *D) {
2434 VisitOMPLoopBasedDirective(D);
2435}
2436
2437void ASTStmtWriter::VisitOMPMetaDirective(OMPMetaDirective *D) {
2438 VisitStmt(D);
2439 Record.push_back(D->getNumClauses());
2440 VisitOMPExecutableDirective(D);
2442}
2443
2444void ASTStmtWriter::VisitOMPParallelDirective(OMPParallelDirective *D) {
2445 VisitStmt(D);
2446 VisitOMPExecutableDirective(D);
2447 Record.writeBool(D->hasCancel());
2449}
2450
2451void ASTStmtWriter::VisitOMPSimdDirective(OMPSimdDirective *D) {
2452 VisitOMPLoopDirective(D);
2454}
2455
2456void ASTStmtWriter::VisitOMPLoopTransformationDirective(
2458 VisitOMPLoopBasedDirective(D);
2459 Record.writeUInt32(D->getNumGeneratedLoops());
2460}
2461
2462void ASTStmtWriter::VisitOMPTileDirective(OMPTileDirective *D) {
2463 VisitOMPLoopTransformationDirective(D);
2465}
2466
2467void ASTStmtWriter::VisitOMPStripeDirective(OMPStripeDirective *D) {
2468 VisitOMPLoopTransformationDirective(D);
2470}
2471
2472void ASTStmtWriter::VisitOMPUnrollDirective(OMPUnrollDirective *D) {
2473 VisitOMPLoopTransformationDirective(D);
2475}
2476
2477void ASTStmtWriter::VisitOMPReverseDirective(OMPReverseDirective *D) {
2478 VisitOMPLoopTransformationDirective(D);
2480}
2481
2482void ASTStmtWriter::VisitOMPInterchangeDirective(OMPInterchangeDirective *D) {
2483 VisitOMPLoopTransformationDirective(D);
2485}
2486
2487void ASTStmtWriter::VisitOMPForDirective(OMPForDirective *D) {
2488 VisitOMPLoopDirective(D);
2489 Record.writeBool(D->hasCancel());
2491}
2492
2493void ASTStmtWriter::VisitOMPForSimdDirective(OMPForSimdDirective *D) {
2494 VisitOMPLoopDirective(D);
2496}
2497
2498void ASTStmtWriter::VisitOMPSectionsDirective(OMPSectionsDirective *D) {
2499 VisitStmt(D);
2500 VisitOMPExecutableDirective(D);
2501 Record.writeBool(D->hasCancel());
2503}
2504
2505void ASTStmtWriter::VisitOMPSectionDirective(OMPSectionDirective *D) {
2506 VisitStmt(D);
2507 VisitOMPExecutableDirective(D);
2508 Record.writeBool(D->hasCancel());
2510}
2511
2512void ASTStmtWriter::VisitOMPScopeDirective(OMPScopeDirective *D) {
2513 VisitStmt(D);
2514 VisitOMPExecutableDirective(D);
2516}
2517
2518void ASTStmtWriter::VisitOMPSingleDirective(OMPSingleDirective *D) {
2519 VisitStmt(D);
2520 VisitOMPExecutableDirective(D);
2522}
2523
2524void ASTStmtWriter::VisitOMPMasterDirective(OMPMasterDirective *D) {
2525 VisitStmt(D);
2526 VisitOMPExecutableDirective(D);
2528}
2529
2530void ASTStmtWriter::VisitOMPCriticalDirective(OMPCriticalDirective *D) {
2531 VisitStmt(D);
2532 VisitOMPExecutableDirective(D);
2533 Record.AddDeclarationNameInfo(D->getDirectiveName());
2535}
2536
2537void ASTStmtWriter::VisitOMPParallelForDirective(OMPParallelForDirective *D) {
2538 VisitOMPLoopDirective(D);
2539 Record.writeBool(D->hasCancel());
2541}
2542
2543void ASTStmtWriter::VisitOMPParallelForSimdDirective(
2545 VisitOMPLoopDirective(D);
2547}
2548
2549void ASTStmtWriter::VisitOMPParallelMasterDirective(
2551 VisitStmt(D);
2552 VisitOMPExecutableDirective(D);
2554}
2555
2556void ASTStmtWriter::VisitOMPParallelMaskedDirective(
2558 VisitStmt(D);
2559 VisitOMPExecutableDirective(D);
2561}
2562
2563void ASTStmtWriter::VisitOMPParallelSectionsDirective(
2565 VisitStmt(D);
2566 VisitOMPExecutableDirective(D);
2567 Record.writeBool(D->hasCancel());
2569}
2570
2571void ASTStmtWriter::VisitOMPTaskDirective(OMPTaskDirective *D) {
2572 VisitStmt(D);
2573 VisitOMPExecutableDirective(D);
2574 Record.writeBool(D->hasCancel());
2576}
2577
2578void ASTStmtWriter::VisitOMPAtomicDirective(OMPAtomicDirective *D) {
2579 VisitStmt(D);
2580 VisitOMPExecutableDirective(D);
2581 Record.writeBool(D->isXLHSInRHSPart());
2582 Record.writeBool(D->isPostfixUpdate());
2583 Record.writeBool(D->isFailOnly());
2585}
2586
2587void ASTStmtWriter::VisitOMPTargetDirective(OMPTargetDirective *D) {
2588 VisitStmt(D);
2589 VisitOMPExecutableDirective(D);
2591}
2592
2593void ASTStmtWriter::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) {
2594 VisitStmt(D);
2595 VisitOMPExecutableDirective(D);
2597}
2598
2599void ASTStmtWriter::VisitOMPTargetEnterDataDirective(
2601 VisitStmt(D);
2602 VisitOMPExecutableDirective(D);
2604}
2605
2606void ASTStmtWriter::VisitOMPTargetExitDataDirective(
2608 VisitStmt(D);
2609 VisitOMPExecutableDirective(D);
2611}
2612
2613void ASTStmtWriter::VisitOMPTargetParallelDirective(
2615 VisitStmt(D);
2616 VisitOMPExecutableDirective(D);
2617 Record.writeBool(D->hasCancel());
2619}
2620
2621void ASTStmtWriter::VisitOMPTargetParallelForDirective(
2623 VisitOMPLoopDirective(D);
2624 Record.writeBool(D->hasCancel());
2626}
2627
2628void ASTStmtWriter::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) {
2629 VisitStmt(D);
2630 VisitOMPExecutableDirective(D);
2632}
2633
2634void ASTStmtWriter::VisitOMPBarrierDirective(OMPBarrierDirective *D) {
2635 VisitStmt(D);
2636 VisitOMPExecutableDirective(D);
2638}
2639
2640void ASTStmtWriter::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) {
2641 VisitStmt(D);
2642 Record.push_back(D->getNumClauses());
2643 VisitOMPExecutableDirective(D);
2645}
2646
2647void ASTStmtWriter::VisitOMPAssumeDirective(OMPAssumeDirective *D) {
2648 VisitStmt(D);
2649 VisitOMPExecutableDirective(D);
2651}
2652
2653void ASTStmtWriter::VisitOMPErrorDirective(OMPErrorDirective *D) {
2654 VisitStmt(D);
2655 Record.push_back(D->getNumClauses());
2656 VisitOMPExecutableDirective(D);
2658}
2659
2660void ASTStmtWriter::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) {
2661 VisitStmt(D);
2662 VisitOMPExecutableDirective(D);
2664}
2665
2666void ASTStmtWriter::VisitOMPFlushDirective(OMPFlushDirective *D) {
2667 VisitStmt(D);
2668 VisitOMPExecutableDirective(D);
2670}
2671
2672void ASTStmtWriter::VisitOMPDepobjDirective(OMPDepobjDirective *D) {
2673 VisitStmt(D);
2674 VisitOMPExecutableDirective(D);
2676}
2677
2678void ASTStmtWriter::VisitOMPScanDirective(OMPScanDirective *D) {
2679 VisitStmt(D);
2680 VisitOMPExecutableDirective(D);
2682}
2683
2684void ASTStmtWriter::VisitOMPOrderedDirective(OMPOrderedDirective *D) {
2685 VisitStmt(D);
2686 VisitOMPExecutableDirective(D);
2688}
2689
2690void ASTStmtWriter::VisitOMPTeamsDirective(OMPTeamsDirective *D) {
2691 VisitStmt(D);
2692 VisitOMPExecutableDirective(D);
2694}
2695
2696void ASTStmtWriter::VisitOMPCancellationPointDirective(
2698 VisitStmt(D);
2699 VisitOMPExecutableDirective(D);
2700 Record.writeEnum(D->getCancelRegion());
2702}
2703
2704void ASTStmtWriter::VisitOMPCancelDirective(OMPCancelDirective *D) {
2705 VisitStmt(D);
2706 VisitOMPExecutableDirective(D);
2707 Record.writeEnum(D->getCancelRegion());
2709}
2710
2711void ASTStmtWriter::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) {
2712 VisitOMPLoopDirective(D);
2713 Record.writeBool(D->hasCancel());
2715}
2716
2717void ASTStmtWriter::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) {
2718 VisitOMPLoopDirective(D);
2720}
2721
2722void ASTStmtWriter::VisitOMPMasterTaskLoopDirective(
2724 VisitOMPLoopDirective(D);
2725 Record.writeBool(D->hasCancel());
2727}
2728
2729void ASTStmtWriter::VisitOMPMaskedTaskLoopDirective(
2731 VisitOMPLoopDirective(D);
2732 Record.writeBool(D->hasCancel());
2734}
2735
2736void ASTStmtWriter::VisitOMPMasterTaskLoopSimdDirective(
2738 VisitOMPLoopDirective(D);
2740}
2741
2742void ASTStmtWriter::VisitOMPMaskedTaskLoopSimdDirective(
2744 VisitOMPLoopDirective(D);
2746}
2747
2748void ASTStmtWriter::VisitOMPParallelMasterTaskLoopDirective(
2750 VisitOMPLoopDirective(D);
2751 Record.writeBool(D->hasCancel());
2753}
2754
2755void ASTStmtWriter::VisitOMPParallelMaskedTaskLoopDirective(
2757 VisitOMPLoopDirective(D);
2758 Record.writeBool(D->hasCancel());
2760}
2761
2762void ASTStmtWriter::VisitOMPParallelMasterTaskLoopSimdDirective(
2764 VisitOMPLoopDirective(D);
2766}
2767
2768void ASTStmtWriter::VisitOMPParallelMaskedTaskLoopSimdDirective(
2770 VisitOMPLoopDirective(D);
2772}
2773
2774void ASTStmtWriter::VisitOMPDistributeDirective(OMPDistributeDirective *D) {
2775 VisitOMPLoopDirective(D);
2777}
2778
2779void ASTStmtWriter::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) {
2780 VisitStmt(D);
2781 VisitOMPExecutableDirective(D);
2783}
2784
2785void ASTStmtWriter::VisitOMPDistributeParallelForDirective(
2787 VisitOMPLoopDirective(D);
2788 Record.writeBool(D->hasCancel());
2790}
2791
2792void ASTStmtWriter::VisitOMPDistributeParallelForSimdDirective(
2794 VisitOMPLoopDirective(D);
2796}
2797
2798void ASTStmtWriter::VisitOMPDistributeSimdDirective(
2800 VisitOMPLoopDirective(D);
2802}
2803
2804void ASTStmtWriter::VisitOMPTargetParallelForSimdDirective(
2806 VisitOMPLoopDirective(D);
2808}
2809
2810void ASTStmtWriter::VisitOMPTargetSimdDirective(OMPTargetSimdDirective *D) {
2811 VisitOMPLoopDirective(D);
2813}
2814
2815void ASTStmtWriter::VisitOMPTeamsDistributeDirective(
2817 VisitOMPLoopDirective(D);
2819}
2820
2821void ASTStmtWriter::VisitOMPTeamsDistributeSimdDirective(
2823 VisitOMPLoopDirective(D);
2825}
2826
2827void ASTStmtWriter::VisitOMPTeamsDistributeParallelForSimdDirective(
2829 VisitOMPLoopDirective(D);
2831}
2832
2833void ASTStmtWriter::VisitOMPTeamsDistributeParallelForDirective(
2835 VisitOMPLoopDirective(D);
2836 Record.writeBool(D->hasCancel());
2838}
2839
2840void ASTStmtWriter::VisitOMPTargetTeamsDirective(OMPTargetTeamsDirective *D) {
2841 VisitStmt(D);
2842 VisitOMPExecutableDirective(D);
2844}
2845
2846void ASTStmtWriter::VisitOMPTargetTeamsDistributeDirective(
2848 VisitOMPLoopDirective(D);
2850}
2851
2852void ASTStmtWriter::VisitOMPTargetTeamsDistributeParallelForDirective(
2854 VisitOMPLoopDirective(D);
2855 Record.writeBool(D->hasCancel());
2857}
2858
2859void ASTStmtWriter::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
2861 VisitOMPLoopDirective(D);
2862 Code = serialization::
2864}
2865
2866void ASTStmtWriter::VisitOMPTargetTeamsDistributeSimdDirective(
2868 VisitOMPLoopDirective(D);
2870}
2871
2872void ASTStmtWriter::VisitOMPInteropDirective(OMPInteropDirective *D) {
2873 VisitStmt(D);
2874 VisitOMPExecutableDirective(D);
2876}
2877
2878void ASTStmtWriter::VisitOMPDispatchDirective(OMPDispatchDirective *D) {
2879 VisitStmt(D);
2880 VisitOMPExecutableDirective(D);
2881 Record.AddSourceLocation(D->getTargetCallLoc());
2883}
2884
2885void ASTStmtWriter::VisitOMPMaskedDirective(OMPMaskedDirective *D) {
2886 VisitStmt(D);
2887 VisitOMPExecutableDirective(D);
2889}
2890
2891void ASTStmtWriter::VisitOMPGenericLoopDirective(OMPGenericLoopDirective *D) {
2892 VisitOMPLoopDirective(D);
2894}
2895
2896void ASTStmtWriter::VisitOMPTeamsGenericLoopDirective(
2898 VisitOMPLoopDirective(D);
2900}
2901
2902void ASTStmtWriter::VisitOMPTargetTeamsGenericLoopDirective(
2904 VisitOMPLoopDirective(D);
2905 Record.writeBool(D->canBeParallelFor());
2907}
2908
2909void ASTStmtWriter::VisitOMPParallelGenericLoopDirective(
2911 VisitOMPLoopDirective(D);
2913}
2914
2915void ASTStmtWriter::VisitOMPTargetParallelGenericLoopDirective(
2917 VisitOMPLoopDirective(D);
2919}
2920
2921//===----------------------------------------------------------------------===//
2922// OpenACC Constructs/Directives.
2923//===----------------------------------------------------------------------===//
2924void ASTStmtWriter::VisitOpenACCConstructStmt(OpenACCConstructStmt *S) {
2925 Record.push_back(S->clauses().size());
2926 Record.writeEnum(S->Kind);
2927 Record.AddSourceRange(S->Range);
2928 Record.AddSourceLocation(S->DirectiveLoc);
2929 Record.writeOpenACCClauseList(S->clauses());
2930}
2931
2932void ASTStmtWriter::VisitOpenACCAssociatedStmtConstruct(
2934 VisitOpenACCConstructStmt(S);
2935 Record.AddStmt(S->getAssociatedStmt());
2936}
2937
2938void ASTStmtWriter::VisitOpenACCComputeConstruct(OpenACCComputeConstruct *S) {
2939 VisitStmt(S);
2940 VisitOpenACCAssociatedStmtConstruct(S);
2942}
2943
2944void ASTStmtWriter::VisitOpenACCLoopConstruct(OpenACCLoopConstruct *S) {
2945 VisitStmt(S);
2946 VisitOpenACCAssociatedStmtConstruct(S);
2947 Record.writeEnum(S->getParentComputeConstructKind());
2949}
2950
2951void ASTStmtWriter::VisitOpenACCCombinedConstruct(OpenACCCombinedConstruct *S) {
2952 VisitStmt(S);
2953 VisitOpenACCAssociatedStmtConstruct(S);
2955}
2956
2957void ASTStmtWriter::VisitOpenACCDataConstruct(OpenACCDataConstruct *S) {
2958 VisitStmt(S);
2959 VisitOpenACCAssociatedStmtConstruct(S);
2961}
2962
2963void ASTStmtWriter::VisitOpenACCEnterDataConstruct(
2965 VisitStmt(S);
2966 VisitOpenACCConstructStmt(S);
2968}
2969
2970void ASTStmtWriter::VisitOpenACCExitDataConstruct(OpenACCExitDataConstruct *S) {
2971 VisitStmt(S);
2972 VisitOpenACCConstructStmt(S);
2974}
2975
2976void ASTStmtWriter::VisitOpenACCInitConstruct(OpenACCInitConstruct *S) {
2977 VisitStmt(S);
2978 VisitOpenACCConstructStmt(S);
2980}
2981
2982void ASTStmtWriter::VisitOpenACCShutdownConstruct(OpenACCShutdownConstruct *S) {
2983 VisitStmt(S);
2984 VisitOpenACCConstructStmt(S);
2986}
2987
2988void ASTStmtWriter::VisitOpenACCSetConstruct(OpenACCSetConstruct *S) {
2989 VisitStmt(S);
2990 VisitOpenACCConstructStmt(S);
2992}
2993
2994void ASTStmtWriter::VisitOpenACCUpdateConstruct(OpenACCUpdateConstruct *S) {
2995 VisitStmt(S);
2996 VisitOpenACCConstructStmt(S);
2998}
2999
3000void ASTStmtWriter::VisitOpenACCHostDataConstruct(OpenACCHostDataConstruct *S) {
3001 VisitStmt(S);
3002 VisitOpenACCAssociatedStmtConstruct(S);
3004}
3005
3006void ASTStmtWriter::VisitOpenACCWaitConstruct(OpenACCWaitConstruct *S) {
3007 VisitStmt(S);
3008 Record.push_back(S->getExprs().size());
3009 VisitOpenACCConstructStmt(S);
3010 Record.AddSourceLocation(S->LParenLoc);
3011 Record.AddSourceLocation(S->RParenLoc);
3012 Record.AddSourceLocation(S->QueuesLoc);
3013
3014 for(Expr *E : S->getExprs())
3015 Record.AddStmt(E);
3016
3018}
3019
3020void ASTStmtWriter::VisitOpenACCAtomicConstruct(OpenACCAtomicConstruct *S) {
3021 VisitStmt(S);
3022 VisitOpenACCConstructStmt(S);
3023 Record.writeEnum(S->getAtomicKind());
3024 Record.AddStmt(S->getAssociatedStmt());
3025
3027}
3028
3029void ASTStmtWriter::VisitOpenACCCacheConstruct(OpenACCCacheConstruct *S) {
3030 VisitStmt(S);
3031 Record.push_back(S->getVarList().size());
3032 VisitOpenACCConstructStmt(S);
3033 Record.AddSourceRange(S->ParensLoc);
3034 Record.AddSourceLocation(S->ReadOnlyLoc);
3035
3036 for (Expr *E : S->getVarList())
3037 Record.AddStmt(E);
3039}
3040
3041//===----------------------------------------------------------------------===//
3042// HLSL Constructs/Directives.
3043//===----------------------------------------------------------------------===//
3044
3045void ASTStmtWriter::VisitHLSLOutArgExpr(HLSLOutArgExpr *S) {
3046 VisitExpr(S);
3047 Record.AddStmt(S->getOpaqueArgLValue());
3048 Record.AddStmt(S->getCastedTemporary());
3049 Record.AddStmt(S->getWritebackCast());
3050 Record.writeBool(S->isInOut());
3052}
3053
3054//===----------------------------------------------------------------------===//
3055// ASTWriter Implementation
3056//===----------------------------------------------------------------------===//
3057
3059 assert(!SwitchCaseIDs.contains(S) && "SwitchCase recorded twice");
3060 unsigned NextID = SwitchCaseIDs.size();
3061 SwitchCaseIDs[S] = NextID;
3062 return NextID;
3063}
3064
3066 assert(SwitchCaseIDs.contains(S) && "SwitchCase hasn't been seen yet");
3067 return SwitchCaseIDs[S];
3068}
3069
3071 SwitchCaseIDs.clear();
3072}
3073
3074/// Write the given substatement or subexpression to the
3075/// bitstream.
3076void ASTWriter::WriteSubStmt(ASTContext &Context, Stmt *S) {
3078 ASTStmtWriter Writer(Context, *this, Record);
3079 ++NumStatements;
3080
3081 if (!S) {
3082 Stream.EmitRecord(serialization::STMT_NULL_PTR, Record);
3083 return;
3084 }
3085
3086 llvm::DenseMap<Stmt *, uint64_t>::iterator I = SubStmtEntries.find(S);
3087 if (I != SubStmtEntries.end()) {
3088 Record.push_back(I->second);
3089 Stream.EmitRecord(serialization::STMT_REF_PTR, Record);
3090 return;
3091 }
3092
3093#ifndef NDEBUG
3094 assert(!ParentStmts.count(S) && "There is a Stmt cycle!");
3095
3096 struct ParentStmtInserterRAII {
3097 Stmt *S;
3098 llvm::DenseSet<Stmt *> &ParentStmts;
3099
3100 ParentStmtInserterRAII(Stmt *S, llvm::DenseSet<Stmt *> &ParentStmts)
3101 : S(S), ParentStmts(ParentStmts) {
3102 ParentStmts.insert(S);
3103 }
3104 ~ParentStmtInserterRAII() {
3105 ParentStmts.erase(S);
3106 }
3107 };
3108
3109 ParentStmtInserterRAII ParentStmtInserter(S, ParentStmts);
3110#endif
3111
3112 Writer.Visit(S);
3113
3114 uint64_t Offset = Writer.Emit();
3115 SubStmtEntries[S] = Offset;
3116}
3117
3118/// Flush all of the statements that have been added to the
3119/// queue via AddStmt().
3120void ASTRecordWriter::FlushStmts() {
3121 // We expect to be the only consumer of the two temporary statement maps,
3122 // assert that they are empty.
3123 assert(Writer->SubStmtEntries.empty() && "unexpected entries in sub-stmt map");
3124 assert(Writer->ParentStmts.empty() && "unexpected entries in parent stmt map");
3125
3126 for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) {
3127 Writer->WriteSubStmt(getASTContext(), StmtsToEmit[I]);
3128
3129 assert(N == StmtsToEmit.size() && "record modified while being written!");
3130
3131 // Note that we are at the end of a full expression. Any
3132 // expression records that follow this one are part of a different
3133 // expression.
3134 Writer->Stream.EmitRecord(serialization::STMT_STOP, ArrayRef<uint32_t>());
3135
3136 Writer->SubStmtEntries.clear();
3137 Writer->ParentStmts.clear();
3138 }
3139
3140 StmtsToEmit.clear();
3141}
3142
3143void ASTRecordWriter::FlushSubStmts() {
3144 // For a nested statement, write out the substatements in reverse order (so
3145 // that a simple stack machine can be used when loading), and don't emit a
3146 // STMT_STOP after each one.
3147 for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) {
3148 Writer->WriteSubStmt(getASTContext(), StmtsToEmit[N - I - 1]);
3149 assert(N == StmtsToEmit.size() && "record modified while being written!");
3150 }
3151
3152 StmtsToEmit.clear();
3153}
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)
const Decl * D
Expr * E
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
SourceRange Range
Definition: SemaObjC.cpp:753
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:188
void ReadKnownNamespaces(SmallVectorImpl< NamespaceDecl * > &Namespaces) override
Load the set of namespaces that are known to the external source, which will be used during typo corr...
Definition: ASTReader.cpp:9399
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(ASTContext &Context, ASTWriter &Writer, ASTWriter::RecordData &Record)
void VisitStmt(Stmt *S)
Writes an AST file containing the contents of a translation unit.
Definition: ASTWriter.h:97
unsigned getBinaryOperatorAbbrev() const
Definition: ASTWriter.h:888
bool isWritingStdCXXNamedModules() const
Definition: ASTWriter.h:903
unsigned getExprImplicitCastAbbrev() const
Definition: ASTWriter.h:887
unsigned getSwitchCaseID(SwitchCase *S)
Retrieve the ID for the given switch-case statement.
unsigned getDeclRefExprAbbrev() const
Definition: ASTWriter.h:884
unsigned getCXXOperatorCallExprAbbrev()
Definition: ASTWriter.h:893
LocalDeclID GetDeclRef(const Decl *D)
Force a declaration to be emitted and get its local ID to the module file been writing.
Definition: ASTWriter.cpp:6913
unsigned getCXXMemberCallExprAbbrev()
Definition: ASTWriter.h:894
ASTReader * getChain() const
Definition: ASTWriter.h:899
unsigned getCompoundAssignOperatorAbbrev() const
Definition: ASTWriter.h:889
unsigned RecordSwitchCaseID(SwitchCase *S)
Record an ID for the given switch-case statement.
unsigned getCharacterLiteralAbbrev() const
Definition: ASTWriter.h:885
unsigned getCompoundStmtAbbrev() const
Definition: ASTWriter.h:896
void AddToken(const Token &Tok, RecordDataImpl &Record)
Emit a token.
Definition: ASTWriter.cpp:5279
SmallVector< uint64_t, 64 > RecordData
Definition: ASTWriter.h:102
unsigned getCallExprAbbrev() const
Definition: ASTWriter.h:892
unsigned getIntegerLiteralAbbrev() const
Definition: ASTWriter.h:886
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition: Expr.h:4486
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Definition: Expr.h:5957
Represents a loop initializing the elements of an array.
Definition: Expr.h:5904
This class represents BOTH the OpenMP Array Section and OpenACC 'subarray', with a boolean differenti...
Definition: Expr.h:7092
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition: Expr.h:2723
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
Definition: ExprCXX.h:2990
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Definition: Expr.h:6621
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
Definition: Stmt.h:3236
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Definition: Expr.h:6816
Represents an attribute applied to a statement.
Definition: Stmt.h:2203
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Definition: Expr.h:4389
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3974
A simple helper class to pack several bits in order into (a) 32 bit integer(s).
Definition: ASTWriter.h:1063
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition: Decl.h:4634
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:6560
BreakStmt - This represents a break.
Definition: Stmt.h:3135
Represents a C++2a __builtin_bit_cast(T, v) expression.
Definition: ExprCXX.h:5470
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr....
Definition: Expr.h:3905
Represents a call to a CUDA kernel function.
Definition: ExprCXX.h:234
A C++ addrspace_cast expression (currently only enabled for OpenCL).
Definition: ExprCXX.h:604
Represents a base class of a C++ class.
Definition: DeclCXX.h:146
Represents binding an expression to a temporary.
Definition: ExprCXX.h:1494
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition: ExprCXX.h:723
CXXCatchStmt - This represents a C++ catch block.
Definition: StmtCXX.h:28
A C++ const_cast expression (C++ [expr.const.cast]).
Definition: ExprCXX.h:566
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1549
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1271
A use of a default initializer in a constructor or in aggregate initialization.
Definition: ExprCXX.h:1378
Represents a delete expression for memory deallocation and destructor calls, e.g.
Definition: ExprCXX.h:2620
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3864
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Definition: ExprCXX.h:481
Represents a folding of a pack over an operator.
Definition: ExprCXX.h:5026
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:1833
Represents a call to an inherited base class constructor from an inheriting constructor.
Definition: ExprCXX.h:1753
Represents a call to a member function that may be written either with member call syntax (e....
Definition: ExprCXX.h:179
Abstract class common to all of the C++ "named"/"keyword" casts.
Definition: ExprCXX.h:375
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Definition: ExprCXX.h:2349
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition: ExprCXX.h:4303
The null pointer literal (C++11 [lex.nullptr])
Definition: ExprCXX.h:768
A call to an overloaded operator written using operator syntax.
Definition: ExprCXX.h:84
Represents a list-initialization with parenthesis.
Definition: ExprCXX.h:5135
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition: ExprCXX.h:2739
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
Definition: ExprCXX.h:526
A rewritten comparison expression that was originally written using operator syntax.
Definition: ExprCXX.h:286
An expression "T()" which creates an rvalue of a non-class type T.
Definition: ExprCXX.h:2198
A C++ static_cast expression (C++ [expr.static.cast]).
Definition: ExprCXX.h:436
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition: ExprCXX.h:800
Represents a C++ functional cast expression that builds a temporary object.
Definition: ExprCXX.h:1901
Represents the this expression in C++.
Definition: ExprCXX.h:1155
A C++ throw-expression (C++ [except.throw]).
Definition: ExprCXX.h:1209
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:848
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:3738
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
Definition: ExprCXX.h:1069
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2879
This captures a statement into a function.
Definition: Stmt.h:3886
CaseStmt - Represent a case statement.
Definition: Stmt.h:1920
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:3612
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition: Expr.h:4784
Represents a 'co_await' expression.
Definition: ExprCXX.h:5363
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:4236
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:3541
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:1720
A reference to a concept and its template args, as it appears in the code.
Definition: ASTConcept.h:126
Represents the specialization of a concept - evaluates to a prvalue of type bool.
Definition: ExprConcepts.h:42
ConditionalOperator - The ?: ternary operator.
Definition: Expr.h:4327
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition: Expr.h:1084
ContinueStmt - This represents a continue.
Definition: Stmt.h:3119
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition: Expr.h:4655
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:5249
Represents a 'co_yield' expression.
Definition: ExprCXX.h:5444
A POD class for pairing a NamedDecl* with an access specifier.
iterator begin()
Definition: DeclGroup.h:95
iterator end()
Definition: DeclGroup.h:101
A reference to a declared variable, function, enum, etc.
Definition: Expr.h:1272
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
Definition: Stmt.h:1611
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:86
AccessSpecifier getAccess() const
Definition: DeclBase.h:507
The name of a declaration.
NameKind
The kind of the name stored in this DeclarationName.
Represents a 'co_await' expression while the type of the promise is dependent.
Definition: ExprCXX.h:5395
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:3504
Represents a single C99 designator.
Definition: Expr.h:5530
Represents a C99 designated initializer expression.
Definition: Expr.h:5487
DoStmt - This represents a 'do/while' stmt.
Definition: Stmt.h:2832
Represents a reference to #emded data.
Definition: Expr.h:5062
ExplicitCastExpr - An explicit cast written in the source code.
Definition: Expr.h:3864
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition: ExprCXX.h:3655
This represents one expression.
Definition: Expr.h:112
bool isValueDependent() const
Determines whether the value of this expression depends on.
Definition: Expr.h:177
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
Definition: Expr.h:444
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
Definition: Expr.h:451
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
Definition: Expr.cpp:273
QualType getType() const
Definition: Expr.h:144
ExprDependence getDependence() const
Definition: Expr.h:164
An expression trait intrinsic.
Definition: ExprCXX.h:3063
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:6500
Represents a member of a struct/union/class.
Definition: Decl.h:3157
ForStmt - This represents a 'for (init;cond;inc)' stmt.
Definition: Stmt.h:2888
Represents a reference to a function parameter pack, init-capture pack, or binding pack that has been...
Definition: ExprCXX.h:4835
ValueDecl *const * iterator
Iterators over the parameters which the parameter pack expanded into.
Definition: ExprCXX.h:4868
This represents a GCC inline-assembly statement extension.
Definition: Stmt.h:3395
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Definition: Expr.h:4859
Represents a C11 generic selection.
Definition: Expr.h:6114
GotoStmt - This represents a direct goto.
Definition: Stmt.h:2969
This class represents temporary values used to represent inout and out arguments in HLSL.
Definition: Expr.h:7258
IfStmt - This represents an if/then/else.
Definition: Stmt.h:2259
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1....
Definition: Expr.h:1733
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:3789
Represents an implicitly-generated value initialization of an object of a given type.
Definition: Expr.h:5993
IndirectGotoStmt - This represents an indirect goto.
Definition: Stmt.h:3008
Describes an C or C++ initializer list.
Definition: Expr.h:5235
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:2146
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition: ExprCXX.h:1970
Base class for BreakStmt and ContinueStmt.
Definition: Stmt.h:3057
This represents a Microsoft inline-assembly statement extension.
Definition: Stmt.h:3614
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:936
MS property subscript expression.
Definition: ExprCXX.h:1007
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition: ExprCXX.h:4914
MatrixSubscriptExpr - Matrix subscript expression for the MatrixType extension.
Definition: Expr.h:2801
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition: Expr.h:3300
Represents a place-holder for an object not to be initialized by anything.
Definition: Expr.h:5813
NullStmt - This is the null statement ";": C99 6.8.3p3.
Definition: Stmt.h:1683
An explicit cast in C or a C-style cast in C++, which uses the syntax ([s1][s2]......
Definition: ExprOpenMP.h:24
This represents '#pragma omp atomic' directive.
Definition: StmtOpenMP.h:2947
This represents '#pragma omp barrier' directive.
Definition: StmtOpenMP.h:2625
This represents '#pragma omp cancel' directive.
Definition: StmtOpenMP.h:3655
This represents '#pragma omp cancellation point' directive.
Definition: StmtOpenMP.h:3597
Representation of an OpenMP canonical loop.
Definition: StmtOpenMP.h:142
This represents '#pragma omp critical' directive.
Definition: StmtOpenMP.h:2076
This represents '#pragma omp depobj' directive.
Definition: StmtOpenMP.h:2841
This represents '#pragma omp dispatch' directive.
Definition: StmtOpenMP.h:6030
This represents '#pragma omp distribute' directive.
Definition: StmtOpenMP.h:4425
This represents '#pragma omp distribute parallel for' composite directive.
Definition: StmtOpenMP.h:4547
This represents '#pragma omp distribute parallel for simd' composite directive.
Definition: StmtOpenMP.h:4643
This represents '#pragma omp distribute simd' composite directive.
Definition: StmtOpenMP.h:4708
This represents '#pragma omp error' directive.
Definition: StmtOpenMP.h:6514
This is a basic class for representing single OpenMP executable directive.
Definition: StmtOpenMP.h:266
This represents '#pragma omp flush' directive.
Definition: StmtOpenMP.h:2789
This represents '#pragma omp for' directive.
Definition: StmtOpenMP.h:1634
This represents '#pragma omp for simd' directive.
Definition: StmtOpenMP.h:1724
This represents '#pragma omp loop' directive.
Definition: StmtOpenMP.h:6185
Represents the '#pragma omp interchange' loop transformation directive.
Definition: StmtOpenMP.h:5851
This represents '#pragma omp interop' directive.
Definition: StmtOpenMP.h:5977
OpenMP 5.0 [2.1.6 Iterators] Iterators are identifiers that expand to multiple values in the clause o...
Definition: ExprOpenMP.h:151
The base class for all loop-based directives, including loop transformation directives.
Definition: StmtOpenMP.h:682
This is a common base class for loop directives ('omp simd', 'omp for', 'omp for simd' etc....
Definition: StmtOpenMP.h:1004
The base class for all loop transformation directives.
Definition: StmtOpenMP.h:959
This represents '#pragma omp masked' directive.
Definition: StmtOpenMP.h:6095
This represents '#pragma omp masked taskloop' directive.
Definition: StmtOpenMP.h:3930
This represents '#pragma omp masked taskloop simd' directive.
Definition: StmtOpenMP.h:4071
This represents '#pragma omp master' directive.
Definition: StmtOpenMP.h:2028
This represents '#pragma omp master taskloop' directive.
Definition: StmtOpenMP.h:3854
This represents '#pragma omp master taskloop simd' directive.
Definition: StmtOpenMP.h:4006
This represents '#pragma omp metadirective' directive.
Definition: StmtOpenMP.h:6146
This represents '#pragma omp ordered' directive.
Definition: StmtOpenMP.h:2893
This represents '#pragma omp parallel' directive.
Definition: StmtOpenMP.h:611
This represents '#pragma omp parallel for' directive.
Definition: StmtOpenMP.h:2147
This represents '#pragma omp parallel for simd' directive.
Definition: StmtOpenMP.h:2244
This represents '#pragma omp parallel loop' directive.
Definition: StmtOpenMP.h:6387
This represents '#pragma omp parallel masked' directive.
Definition: StmtOpenMP.h:2372
This represents '#pragma omp parallel masked taskloop' directive.
Definition: StmtOpenMP.h:4215
This represents '#pragma omp parallel masked taskloop simd' directive.
Definition: StmtOpenMP.h:4360
This represents '#pragma omp parallel master' directive.
Definition: StmtOpenMP.h:2309
This represents '#pragma omp parallel master taskloop' directive.
Definition: StmtOpenMP.h:4137
This represents '#pragma omp parallel master taskloop simd' directive.
Definition: StmtOpenMP.h:4293
This represents '#pragma omp parallel sections' directive.
Definition: StmtOpenMP.h:2436
Represents the '#pragma omp reverse' loop transformation directive.
Definition: StmtOpenMP.h:5779
This represents '#pragma omp scan' directive.
Definition: StmtOpenMP.h:5924
This represents '#pragma omp scope' directive.
Definition: StmtOpenMP.h:1925
This represents '#pragma omp section' directive.
Definition: StmtOpenMP.h:1864
This represents '#pragma omp sections' directive.
Definition: StmtOpenMP.h:1787
This represents '#pragma omp simd' directive.
Definition: StmtOpenMP.h:1571
This represents '#pragma omp single' directive.
Definition: StmtOpenMP.h:1977
This represents the '#pragma omp stripe' loop transformation directive.
Definition: StmtOpenMP.h:5625
This represents '#pragma omp target data' directive.
Definition: StmtOpenMP.h:3206
This represents '#pragma omp target' directive.
Definition: StmtOpenMP.h:3152
This represents '#pragma omp target enter data' directive.
Definition: StmtOpenMP.h:3260
This represents '#pragma omp target exit data' directive.
Definition: StmtOpenMP.h:3315
This represents '#pragma omp target parallel' directive.
Definition: StmtOpenMP.h:3369
This represents '#pragma omp target parallel for' directive.
Definition: StmtOpenMP.h:3449
This represents '#pragma omp target parallel for simd' directive.
Definition: StmtOpenMP.h:4774
This represents '#pragma omp target parallel loop' directive.
Definition: StmtOpenMP.h:6452
This represents '#pragma omp target simd' directive.
Definition: StmtOpenMP.h:4841
This represents '#pragma omp target teams' directive.
Definition: StmtOpenMP.h:5199
This represents '#pragma omp target teams distribute' combined directive.
Definition: StmtOpenMP.h:5255
This represents '#pragma omp target teams distribute parallel for' combined directive.
Definition: StmtOpenMP.h:5322
This represents '#pragma omp target teams distribute parallel for simd' combined directive.
Definition: StmtOpenMP.h:5420
This represents '#pragma omp target teams distribute simd' combined directive.
Definition: StmtOpenMP.h:5490
This represents '#pragma omp target teams loop' directive.
Definition: StmtOpenMP.h:6312
This represents '#pragma omp target update' directive.
Definition: StmtOpenMP.h:4491
This represents '#pragma omp task' directive.
Definition: StmtOpenMP.h:2517
This represents '#pragma omp taskloop' directive.
Definition: StmtOpenMP.h:3715
This represents '#pragma omp taskloop simd' directive.
Definition: StmtOpenMP.h:3788
This represents '#pragma omp taskgroup' directive.
Definition: StmtOpenMP.h:2722
This represents '#pragma omp taskwait' directive.
Definition: StmtOpenMP.h:2671
This represents '#pragma omp taskyield' directive.
Definition: StmtOpenMP.h:2579
This represents '#pragma omp teams' directive.
Definition: StmtOpenMP.h:3544
This represents '#pragma omp teams distribute' directive.
Definition: StmtOpenMP.h:4906
This represents '#pragma omp teams distribute parallel for' composite directive.
Definition: StmtOpenMP.h:5106
This represents '#pragma omp teams distribute parallel for simd' composite directive.
Definition: StmtOpenMP.h:5040
This represents '#pragma omp teams distribute simd' combined directive.
Definition: StmtOpenMP.h:4972
This represents '#pragma omp teams loop' directive.
Definition: StmtOpenMP.h:6247
This represents the '#pragma omp tile' loop transformation directive.
Definition: StmtOpenMP.h:5548
This represents the '#pragma omp unroll' loop transformation directive.
Definition: StmtOpenMP.h:5705
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp,...
Definition: ExprObjC.h:192
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:1703
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition: ExprObjC.h:88
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:128
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers,...
Definition: ExprObjC.h:1643
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
Definition: ExprObjC.h:308
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:409
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:1582
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC 'id' type.
Definition: ExprObjC.h:1498
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:548
An expression that sends a message to the given Objective-C object or class.
Definition: ExprObjC.h:940
@ SuperInstance
The receiver is the instance of the superclass object.
Definition: ExprObjC.h:954
@ Instance
The receiver is an object instance.
Definition: ExprObjC.h:948
@ SuperClass
The receiver is a superclass.
Definition: ExprObjC.h:951
@ Class
The receiver is a class.
Definition: ExprObjC.h:945
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:616
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition: ExprObjC.h:504
ObjCSelectorExpr used for @selector in Objective-C.
Definition: ExprObjC.h:454
ObjCStringLiteral, used for Objective-C string literals i.e.
Definition: ExprObjC.h:52
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:839
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type,...
Definition: Expr.h:2529
Helper class for OffsetOfExpr.
Definition: Expr.h:2423
unsigned getArrayExprIndex() const
For an array element node, returns the index into the array of expressions.
Definition: Expr.h:2481
FieldDecl * getField() const
For a field offsetof node, returns the field.
Definition: Expr.h:2487
IdentifierInfo * getFieldName() const
For a field or identifier offsetof node, returns the name of the field.
Definition: Expr.cpp:1684
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range that covers this offsetof node.
Definition: Expr.h:2508
@ Array
An index into an array.
Definition: Expr.h:2428
@ Identifier
A field in a dependent type, known only by its name.
Definition: Expr.h:2432
@ Field
A field.
Definition: Expr.h:2430
@ Base
An implicit indirection through a C++ base class, when the field found is in a base class.
Definition: Expr.h:2435
Kind getKind() const
Determine what kind of offsetof node this is.
Definition: Expr.h:2477
CXXBaseSpecifier * getBase() const
For a base class node, returns the base specifier.
Definition: Expr.h:2497
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
Definition: Expr.h:1180
This is a base class for any OpenACC statement-level constructs that have an associated statement.
Definition: StmtOpenACC.h:81
This expression type represents an asterisk in an OpenACC Size-Expr, used in the 'tile' and 'gang' cl...
Definition: Expr.h:2092
This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...
Definition: StmtOpenACC.h:132
This is the base class for an OpenACC statement-level construct, other construct types are expected t...
Definition: StmtOpenACC.h:26
This class represents a 'loop' construct.
Definition: StmtOpenACC.h:190
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr.
Definition: ExprCXX.h:3122
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition: ExprCXX.h:4357
ParenExpr - This represents a parenthesized expression, e.g.
Definition: Expr.h:2184
Represents a parameter to a function.
Definition: Decl.h:1789
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:2007
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition: Expr.h:6692
Expr *const * semantics_iterator
Definition: Expr.h:6751
Frontend produces RecoveryExprs on semantic errors that prevent creating other well-formed expression...
Definition: Expr.h:7364
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
Definition: ExprConcepts.h:505
ReturnStmt - This represents a return, optionally of an expression: return; return 4;.
Definition: Stmt.h:3160
Represents a __leave statement.
Definition: Stmt.h:3847
SYCLKernelCallStmt represents the transformation that is applied to the body of a function declared w...
Definition: StmtSYCL.h:37
static std::enable_if_t< std::is_base_of_v< Attr, AttrInfo >, SourceLocation > getAttrLoc(const AttrInfo &AL)
A helper function to provide Attribute Location for the Attr types AND the ParsedAttr.
Definition: Sema.h:4808
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition: Expr.h:4579
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:4435
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(),...
Definition: Expr.h:4953
Encodes a location in the source.
A trivial tuple used to represent a source range.
SourceLocation getEnd() const
SourceLocation getBegin() const
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition: Expr.h:4531
StmtVisitor - This class implements a simple visitor for Stmt subclasses.
Definition: StmtVisitor.h:186
Stmt - This represents one statement.
Definition: Stmt.h:85
SourceLocation getEndLoc() const LLVM_READONLY
Definition: Stmt.cpp:358
LambdaExprBitfields LambdaExprBits
Definition: Stmt.h:1372
child_range children()
Definition: Stmt.cpp:295
StmtClass getStmtClass() const
Definition: Stmt.h:1472
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
Definition: Stmt.cpp:334
TypeTraitExprBitfields TypeTraitExprBits
Definition: Stmt.h:1361
CXXNewExprBitfields CXXNewExprBits
Definition: Stmt.h:1359
ConstantExprBitfields ConstantExprBits
Definition: Stmt.h:1324
RequiresExprBitfields RequiresExprBits
Definition: Stmt.h:1373
CXXFoldExprBitfields CXXFoldExprBits
Definition: Stmt.h:1376
PackIndexingExprBitfields PackIndexingExprBits
Definition: Stmt.h:1377
DependentScopeDeclRefExprBitfields DependentScopeDeclRefExprBits
Definition: Stmt.h:1362
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: Stmt.cpp:346
void AddString(StringRef V) const
Definition: Diagnostic.h:1166
StringLiteral - This represents a string literal expression, e.g.
Definition: Expr.h:1801
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition: ExprCXX.h:4658
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition: ExprCXX.h:4748
SwitchStmt - This represents a 'switch' stmt.
Definition: Stmt.h:2509
Location wrapper for a TemplateArgument.
Definition: TemplateBase.h:528
A container of type source information.
Definition: TypeBase.h:8314
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2890
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition: Expr.h:2627
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition: Expr.h:2246
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:3384
Represents a C++ member access expression for which lookup produced a set of overloaded functions.
Definition: ExprCXX.h:4120
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:640
Represents a call to the builtin function __builtin_va_arg.
Definition: Expr.h:4893
WhileStmt - This represents a 'while' stmt.
Definition: Stmt.h:2697
A static requirement that can be used in a requires-expression to check properties of types and expre...
Definition: ExprConcepts.h:170
StmtCode
Record codes for each kind of statement or expression.
Definition: ASTBitCodes.h:1550
@ EXPR_DESIGNATED_INIT
A DesignatedInitExpr record.
Definition: ASTBitCodes.h:1700
@ EXPR_COMPOUND_LITERAL
A CompoundLiteralExpr record.
Definition: ASTBitCodes.h:1691
@ STMT_OMP_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1999
@ EXPR_OBJC_IVAR_REF_EXPR
An ObjCIvarRefExpr record.
Definition: ASTBitCodes.h:1778
@ EXPR_MEMBER
A MemberExpr record.
Definition: ASTBitCodes.h:1673
@ EXPR_CXX_TEMPORARY_OBJECT
A CXXTemporaryObjectExpr record.
Definition: ASTBitCodes.h:1852
@ STMT_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:2010
@ EXPR_COMPOUND_ASSIGN_OPERATOR
A CompoundAssignOperator record.
Definition: ASTBitCodes.h:1679
@ EXPR_CXX_STATIC_CAST
A CXXStaticCastExpr record.
Definition: ASTBitCodes.h:1855
@ EXPR_OBJC_STRING_LITERAL
An ObjCStringLiteral record.
Definition: ASTBitCodes.h:1762
@ EXPR_VA_ARG
A VAArgExpr record.
Definition: ASTBitCodes.h:1718
@ STMT_OMP_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:2004
@ EXPR_OBJC_ISA
An ObjCIsa Expr record.
Definition: ASTBitCodes.h:1793
@ EXPR_CXX_OPERATOR_CALL
A CXXOperatorCallExpr record.
Definition: ASTBitCodes.h:1837
@ STMT_OBJC_AT_TRY
An ObjCAtTryStmt record.
Definition: ASTBitCodes.h:1808
@ STMT_DO
A DoStmt record.
Definition: ASTBitCodes.h:1589
@ STMT_OBJC_CATCH
An ObjCAtCatchStmt record.
Definition: ASTBitCodes.h:1802
@ STMT_IF
An IfStmt record.
Definition: ASTBitCodes.h:1580
@ EXPR_STRING_LITERAL
A StringLiteral record.
Definition: ASTBitCodes.h:1643
@ EXPR_OBJC_AVAILABILITY_CHECK
An ObjCAvailabilityCheckExpr record.
Definition: ASTBitCodes.h:1823
@ STMT_OMP_PARALLEL_MASKED_TASKLOOP_DIRECTIVE
Definition: ASTBitCodes.h:1994
@ EXPR_PSEUDO_OBJECT
A PseudoObjectExpr record.
Definition: ASTBitCodes.h:1751
@ STMT_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE
Definition: ASTBitCodes.h:2009
@ EXPR_IMPLICIT_CAST
An ImplicitCastExpr record.
Definition: ASTBitCodes.h:1685
@ STMT_CAPTURED
A CapturedStmt record.
Definition: ASTBitCodes.h:1613
@ STMT_OMP_TARGET_PARALLEL_FOR_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:2001
@ STMT_GCCASM
A GCC-style AsmStmt record.
Definition: ASTBitCodes.h:1619
@ EXPR_IMAGINARY_LITERAL
An ImaginaryLiteral record.
Definition: ASTBitCodes.h:1640
@ STMT_WHILE
A WhileStmt record.
Definition: ASTBitCodes.h:1586
@ EXPR_CONVERT_VECTOR
A ConvertVectorExpr record.
Definition: ASTBitCodes.h:1742
@ EXPR_OBJC_SUBSCRIPT_REF_EXPR
An ObjCSubscriptRefExpr record.
Definition: ASTBitCodes.h:1784
@ EXPR_STMT
A StmtExpr record.
Definition: ASTBitCodes.h:1724
@ STMT_OMP_PARALLEL_GENERIC_LOOP_DIRECTIVE
Definition: ASTBitCodes.h:2019
@ EXPR_CXX_REINTERPRET_CAST
A CXXReinterpretCastExpr record.
Definition: ASTBitCodes.h:1861
@ EXPR_DESIGNATED_INIT_UPDATE
A DesignatedInitUpdateExpr record.
Definition: ASTBitCodes.h:1703
@ STMT_OBJC_AT_SYNCHRONIZED
An ObjCAtSynchronizedStmt record.
Definition: ASTBitCodes.h:1811
@ STMT_OMP_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE
Definition: ASTBitCodes.h:1998
@ EXPR_BUILTIN_BIT_CAST
A BuiltinBitCastExpr record.
Definition: ASTBitCodes.h:1873
@ STMT_OMP_TARGET_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:2011
@ STMT_SYCLKERNELCALL
A SYCLKernelCallStmt record.
Definition: ASTBitCodes.h:1616
@ EXPR_CHARACTER_LITERAL
A CharacterLiteral record.
Definition: ASTBitCodes.h:1646
@ EXPR_OBJC_ENCODE
An ObjCEncodeExpr record.
Definition: ASTBitCodes.h:1769
@ EXPR_CSTYLE_CAST
A CStyleCastExpr record.
Definition: ASTBitCodes.h:1688
@ EXPR_OBJC_BOOL_LITERAL
An ObjCBoolLiteralExpr record.
Definition: ASTBitCodes.h:1820
@ EXPR_EXT_VECTOR_ELEMENT
An ExtVectorElementExpr record.
Definition: ASTBitCodes.h:1694
@ EXPR_ATOMIC
An AtomicExpr record.
Definition: ASTBitCodes.h:1754
@ EXPR_OFFSETOF
An OffsetOfExpr record.
Definition: ASTBitCodes.h:1658
@ STMT_RETURN
A ReturnStmt record.
Definition: ASTBitCodes.h:1607
@ STMT_OBJC_FOR_COLLECTION
An ObjCForCollectionStmt record.
Definition: ASTBitCodes.h:1799
@ STMT_OMP_TARGET_TEAMS_DISTRIBUTE_DIRECTIVE
Definition: ASTBitCodes.h:2008
@ EXPR_ARRAY_INIT_LOOP
An ArrayInitLoopExpr record.
Definition: ASTBitCodes.h:1709
@ STMT_OMP_PARALLEL_MASTER_TASKLOOP_DIRECTIVE
Definition: ASTBitCodes.h:1990
@ STMT_OMP_PARALLEL_MASKED_TASKLOOP_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1995
@ STMT_CONTINUE
A ContinueStmt record.
Definition: ASTBitCodes.h:1601
@ EXPR_PREDEFINED
A PredefinedExpr record.
Definition: ASTBitCodes.h:1628
@ EXPR_CXX_BOOL_LITERAL
A CXXBoolLiteralExpr record.
Definition: ASTBitCodes.h:1882
@ EXPR_PAREN_LIST
A ParenListExpr record.
Definition: ASTBitCodes.h:1652
@ EXPR_CXX_PAREN_LIST_INIT
A CXXParenListInitExpr record.
Definition: ASTBitCodes.h:1885
@ STMT_OMP_MASTER_TASKLOOP_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1989
@ STMT_COMPOUND
A CompoundStmt record.
Definition: ASTBitCodes.h:1565
@ STMT_FOR
A ForStmt record.
Definition: ASTBitCodes.h:1592
@ STMT_ATTRIBUTED
An AttributedStmt record.
Definition: ASTBitCodes.h:1577
@ STMT_OMP_TARGET_TEAMS_GENERIC_LOOP_DIRECTIVE
Definition: ASTBitCodes.h:2018
@ EXPR_CXX_REWRITTEN_BINARY_OPERATOR
A CXXRewrittenBinaryOperator record.
Definition: ASTBitCodes.h:1843
@ STMT_GOTO
A GotoStmt record.
Definition: ASTBitCodes.h:1595
@ EXPR_NO_INIT
An NoInitExpr record.
Definition: ASTBitCodes.h:1706
@ EXPR_OBJC_PROTOCOL_EXPR
An ObjCProtocolExpr record.
Definition: ASTBitCodes.h:1775
@ EXPR_ARRAY_INIT_INDEX
An ArrayInitIndexExpr record.
Definition: ASTBitCodes.h:1712
@ EXPR_CXX_CONSTRUCT
A CXXConstructExpr record.
Definition: ASTBitCodes.h:1846
@ STMT_OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE
Definition: ASTBitCodes.h:2006
@ STMT_OMP_PARALLEL_MASTER_TASKLOOP_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1991
@ STMT_OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:2005
@ EXPR_CXX_DYNAMIC_CAST
A CXXDynamicCastExpr record.
Definition: ASTBitCodes.h:1858
@ STMT_CXX_TRY
A CXXTryStmt record.
Definition: ASTBitCodes.h:1831
@ EXPR_GENERIC_SELECTION
A GenericSelectionExpr record.
Definition: ASTBitCodes.h:1748
@ EXPR_OBJC_INDIRECT_COPY_RESTORE
An ObjCIndirectCopyRestoreExpr record.
Definition: ASTBitCodes.h:1796
@ EXPR_CXX_INHERITED_CTOR_INIT
A CXXInheritedCtorInitExpr record.
Definition: ASTBitCodes.h:1849
@ EXPR_CALL
A CallExpr record.
Definition: ASTBitCodes.h:1670
@ EXPR_GNU_NULL
A GNUNullExpr record.
Definition: ASTBitCodes.h:1730
@ EXPR_OBJC_PROPERTY_REF_EXPR
An ObjCPropertyRefExpr record.
Definition: ASTBitCodes.h:1781
@ STMT_OMP_TARGET_PARALLEL_FOR_DIRECTIVE
Definition: ASTBitCodes.h:1981
@ EXPR_CXX_CONST_CAST
A CXXConstCastExpr record.
Definition: ASTBitCodes.h:1864
@ STMT_REF_PTR
A reference to a previously [de]serialized Stmt record.
Definition: ASTBitCodes.h:1559
@ EXPR_OBJC_MESSAGE_EXPR
An ObjCMessageExpr record.
Definition: ASTBitCodes.h:1790
@ STMT_CASE
A CaseStmt record.
Definition: ASTBitCodes.h:1568
@ EXPR_CONSTANT
A constant expression context.
Definition: ASTBitCodes.h:1625
@ STMT_STOP
A marker record that indicates that we are at the end of an expression.
Definition: ASTBitCodes.h:1553
@ STMT_MSASM
A MS-style AsmStmt record.
Definition: ASTBitCodes.h:1622
@ EXPR_CONDITIONAL_OPERATOR
A ConditionOperator record.
Definition: ASTBitCodes.h:1682
@ EXPR_BINARY_OPERATOR
A BinaryOperator record.
Definition: ASTBitCodes.h:1676
@ EXPR_CXX_STD_INITIALIZER_LIST
A CXXStdInitializerListExpr record.
Definition: ASTBitCodes.h:1879
@ EXPR_SHUFFLE_VECTOR
A ShuffleVectorExpr record.
Definition: ASTBitCodes.h:1739
@ STMT_OBJC_FINALLY
An ObjCAtFinallyStmt record.
Definition: ASTBitCodes.h:1805
@ EXPR_OBJC_SELECTOR_EXPR
An ObjCSelectorExpr record.
Definition: ASTBitCodes.h:1772
@ EXPR_FLOATING_LITERAL
A FloatingLiteral record.
Definition: ASTBitCodes.h:1637
@ STMT_NULL_PTR
A NULL expression.
Definition: ASTBitCodes.h:1556
@ STMT_DEFAULT
A DefaultStmt record.
Definition: ASTBitCodes.h:1571
@ EXPR_CHOOSE
A ChooseExpr record.
Definition: ASTBitCodes.h:1727
@ STMT_NULL
A NullStmt record.
Definition: ASTBitCodes.h:1562
@ EXPR_BLOCK
BlockExpr.
Definition: ASTBitCodes.h:1745
@ EXPR_DECL_REF
A DeclRefExpr record.
Definition: ASTBitCodes.h:1631
@ EXPR_INIT_LIST
An InitListExpr record.
Definition: ASTBitCodes.h:1697
@ EXPR_IMPLICIT_VALUE_INIT
An ImplicitValueInitExpr record.
Definition: ASTBitCodes.h:1715
@ STMT_OBJC_AUTORELEASE_POOL
An ObjCAutoreleasePoolStmt record.
Definition: ASTBitCodes.h:1817
@ EXPR_RECOVERY
A RecoveryExpr record.
Definition: ASTBitCodes.h:1757
@ EXPR_PAREN
A ParenExpr record.
Definition: ASTBitCodes.h:1649
@ STMT_OMP_TARGET_PARALLEL_GENERIC_LOOP_DIRECTIVE
Definition: ASTBitCodes.h:2020
@ STMT_LABEL
A LabelStmt record.
Definition: ASTBitCodes.h:1574
@ EXPR_CXX_FUNCTIONAL_CAST
A CXXFunctionalCastExpr record.
Definition: ASTBitCodes.h:1870
@ EXPR_USER_DEFINED_LITERAL
A UserDefinedLiteral record.
Definition: ASTBitCodes.h:1876
@ EXPR_INTEGER_LITERAL
An IntegerLiteral record.
Definition: ASTBitCodes.h:1634
@ EXPR_SOURCE_LOC
A SourceLocExpr record.
Definition: ASTBitCodes.h:1733
@ EXPR_CXX_MEMBER_CALL
A CXXMemberCallExpr record.
Definition: ASTBitCodes.h:1840
@ STMT_SWITCH
A SwitchStmt record.
Definition: ASTBitCodes.h:1583
@ STMT_DECL
A DeclStmt record.
Definition: ASTBitCodes.h:1610
@ EXPR_SUBST_NON_TYPE_TEMPLATE_PARM_PACK
Definition: ASTBitCodes.h:1921
@ STMT_OMP_MASKED_TASKLOOP_SIMD_DIRECTIVE
Definition: ASTBitCodes.h:1993
@ EXPR_SIZEOF_ALIGN_OF
A SizefAlignOfExpr record.
Definition: ASTBitCodes.h:1661
@ STMT_BREAK
A BreakStmt record.
Definition: ASTBitCodes.h:1604
@ STMT_OBJC_AT_THROW
An ObjCAtThrowStmt record.
Definition: ASTBitCodes.h:1814
@ EXPR_ADDR_LABEL
An AddrLabelExpr record.
Definition: ASTBitCodes.h:1721
@ STMT_CXX_FOR_RANGE
A CXXForRangeStmt record.
Definition: ASTBitCodes.h:1834
@ EXPR_CXX_ADDRSPACE_CAST
A CXXAddrspaceCastExpr record.
Definition: ASTBitCodes.h:1867
@ EXPR_ARRAY_SUBSCRIPT
An ArraySubscriptExpr record.
Definition: ASTBitCodes.h:1664
@ EXPR_UNARY_OPERATOR
A UnaryOperator record.
Definition: ASTBitCodes.h:1655
@ STMT_CXX_CATCH
A CXXCatchStmt record.
Definition: ASTBitCodes.h:1828
@ EXPR_BUILTIN_PP_EMBED
A EmbedExpr record.
Definition: ASTBitCodes.h:1736
@ STMT_INDIRECT_GOTO
An IndirectGotoStmt record.
Definition: ASTBitCodes.h:1598
@ DESIG_ARRAY_RANGE
GNU array range designator.
Definition: ASTBitCodes.h:2079
@ DESIG_FIELD_NAME
Field designator where only the field name is known.
Definition: ASTBitCodes.h:2069
@ DESIG_FIELD_DECL
Field designator where the field has been resolved to a declaration.
Definition: ASTBitCodes.h:2073
@ DESIG_ARRAY
Array designator.
Definition: ASTBitCodes.h:2076
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:151
bool isAlignedAllocation(AlignedAllocationMode Mode)
Definition: ExprCXX.h:2267
bool isTypeAwareAllocation(TypeAwareAllocationMode Mode)
Definition: ExprCXX.h:2255
@ VK_PRValue
A pr-value expression (in the C++11 taxonomy) produces a temporary value.
Definition: Specifiers.h:135
unsigned long uint64_t
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
Definition: ASTConcept.h:91
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
Definition: TemplateBase.h:730
SourceLocation LAngleLoc
The source location of the left angle bracket ('<').
Definition: TemplateBase.h:732
unsigned NumTemplateArgs
The number of template arguments in TemplateArgs.
Definition: TemplateBase.h:744
SourceLocation RAngleLoc
The source location of the right angle bracket ('>').
Definition: TemplateBase.h:735
SourceLocation TemplateKWLoc
The source location of the template keyword; this is used as part of the representation of qualified ...
Definition: TemplateBase.h:741
AlignedAllocationMode PassAlignment
Definition: ExprCXX.h:2309
TypeAwareAllocationMode PassTypeIdentity
Definition: ExprCXX.h:2308
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:261
Iterator for iterating over Stmt * arrays that contain only T *.
Definition: Stmt.h:1430