53#include "llvm/ADT/BitmaskEnum.h"
54#include "llvm/ADT/DenseMap.h"
55#include "llvm/ADT/SmallString.h"
56#include "llvm/ADT/SmallVector.h"
57#include "llvm/ADT/StringRef.h"
58#include "llvm/Bitstream/BitstreamReader.h"
59#include "llvm/Support/Casting.h"
60#include "llvm/Support/ErrorHandling.h"
68using namespace serialization;
74 llvm::BitstreamCursor &DeclsCursor;
76 std::optional<BitsUnpacker> CurrentUnpackingBits;
79 return Record.readSourceLocation();
83 return Record.readSourceRange();
86 std::string readString() {
87 return Record.readString();
91 return Record.readTypeSourceInfo();
121 unsigned NumTemplateArgs);
124#define STMT(Type, Base) \
125 void Visit##Type(Type *);
126#include "clang/AST/StmtNodes.inc"
133 unsigned NumTemplateArgs) {
138 for (
unsigned i = 0; i != NumTemplateArgs; ++i)
147void ASTStmtReader::VisitNullStmt(
NullStmt *S) {
149 S->setSemiLoc(readSourceLocation());
150 S->NullStmtBits.HasLeadingEmptyMacro =
Record.readInt();
156 unsigned NumStmts =
Record.readInt();
157 unsigned HasFPFeatures =
Record.readInt();
158 assert(S->hasStoredFPFeatures() == HasFPFeatures);
160 Stmts.push_back(
Record.readSubStmt());
163 S->setStoredFPFeatures(
165 S->LBraceLoc = readSourceLocation();
166 S->RBraceLoc = readSourceLocation();
169void ASTStmtReader::VisitSwitchCase(
SwitchCase *S) {
172 S->setKeywordLoc(readSourceLocation());
173 S->setColonLoc(readSourceLocation());
176void ASTStmtReader::VisitCaseStmt(
CaseStmt *S) {
178 bool CaseStmtIsGNURange =
Record.readInt();
179 S->setLHS(
Record.readSubExpr());
180 S->setSubStmt(
Record.readSubStmt());
181 if (CaseStmtIsGNURange) {
182 S->setRHS(
Record.readSubExpr());
183 S->setEllipsisLoc(readSourceLocation());
187void ASTStmtReader::VisitDefaultStmt(
DefaultStmt *S) {
189 S->setSubStmt(
Record.readSubStmt());
192void ASTStmtReader::VisitLabelStmt(
LabelStmt *S) {
194 bool IsSideEntry =
Record.readInt();
195 auto *LD = readDeclAs<LabelDecl>();
198 S->setSubStmt(
Record.readSubStmt());
199 S->setIdentLoc(readSourceLocation());
200 S->setSideEntry(IsSideEntry);
210 Record.readAttributes(Attrs);
212 assert(NumAttrs == S->AttributedStmtBits.NumAttrs);
213 assert(NumAttrs == Attrs.size());
214 std::copy(Attrs.begin(), Attrs.end(), S->getAttrArrayPtr());
215 S->SubStmt =
Record.readSubStmt();
216 S->AttributedStmtBits.AttrLoc = readSourceLocation();
219void ASTStmtReader::VisitIfStmt(
IfStmt *S) {
222 CurrentUnpackingBits.emplace(
Record.readInt());
224 bool HasElse = CurrentUnpackingBits->getNextBit();
225 bool HasVar = CurrentUnpackingBits->getNextBit();
226 bool HasInit = CurrentUnpackingBits->getNextBit();
229 S->setCond(
Record.readSubExpr());
230 S->setThen(
Record.readSubStmt());
232 S->setElse(
Record.readSubStmt());
234 S->setConditionVariableDeclStmt(cast<DeclStmt>(
Record.readSubStmt()));
236 S->setInit(
Record.readSubStmt());
238 S->setIfLoc(readSourceLocation());
239 S->setLParenLoc(readSourceLocation());
240 S->setRParenLoc(readSourceLocation());
242 S->setElseLoc(readSourceLocation());
245void ASTStmtReader::VisitSwitchStmt(
SwitchStmt *S) {
248 bool HasInit =
Record.readInt();
249 bool HasVar =
Record.readInt();
250 bool AllEnumCasesCovered =
Record.readInt();
251 if (AllEnumCasesCovered)
252 S->setAllEnumCasesCovered();
254 S->setCond(
Record.readSubExpr());
255 S->setBody(
Record.readSubStmt());
257 S->setInit(
Record.readSubStmt());
259 S->setConditionVariableDeclStmt(cast<DeclStmt>(
Record.readSubStmt()));
261 S->setSwitchLoc(readSourceLocation());
262 S->setLParenLoc(readSourceLocation());
263 S->setRParenLoc(readSourceLocation());
271 S->setSwitchCaseList(SC);
277void ASTStmtReader::VisitWhileStmt(
WhileStmt *S) {
280 bool HasVar =
Record.readInt();
282 S->setCond(
Record.readSubExpr());
283 S->setBody(
Record.readSubStmt());
285 S->setConditionVariableDeclStmt(cast<DeclStmt>(
Record.readSubStmt()));
287 S->setWhileLoc(readSourceLocation());
288 S->setLParenLoc(readSourceLocation());
289 S->setRParenLoc(readSourceLocation());
292void ASTStmtReader::VisitDoStmt(
DoStmt *S) {
294 S->setCond(
Record.readSubExpr());
295 S->setBody(
Record.readSubStmt());
296 S->setDoLoc(readSourceLocation());
297 S->setWhileLoc(readSourceLocation());
298 S->setRParenLoc(readSourceLocation());
301void ASTStmtReader::VisitForStmt(
ForStmt *S) {
303 S->setInit(
Record.readSubStmt());
304 S->setCond(
Record.readSubExpr());
305 S->setConditionVariableDeclStmt(cast_or_null<DeclStmt>(
Record.readSubStmt()));
306 S->setInc(
Record.readSubExpr());
307 S->setBody(
Record.readSubStmt());
308 S->setForLoc(readSourceLocation());
309 S->setLParenLoc(readSourceLocation());
310 S->setRParenLoc(readSourceLocation());
313void ASTStmtReader::VisitGotoStmt(
GotoStmt *S) {
315 S->setLabel(readDeclAs<LabelDecl>());
316 S->setGotoLoc(readSourceLocation());
317 S->setLabelLoc(readSourceLocation());
322 S->setGotoLoc(readSourceLocation());
323 S->setStarLoc(readSourceLocation());
324 S->setTarget(
Record.readSubExpr());
329 S->setContinueLoc(readSourceLocation());
332void ASTStmtReader::VisitBreakStmt(
BreakStmt *S) {
334 S->setBreakLoc(readSourceLocation());
337void ASTStmtReader::VisitReturnStmt(
ReturnStmt *S) {
340 bool HasNRVOCandidate =
Record.readInt();
342 S->setRetValue(
Record.readSubExpr());
343 if (HasNRVOCandidate)
344 S->setNRVOCandidate(readDeclAs<VarDecl>());
346 S->setReturnLoc(readSourceLocation());
349void ASTStmtReader::VisitDeclStmt(
DeclStmt *S) {
351 S->setStartLoc(readSourceLocation());
352 S->setEndLoc(readSourceLocation());
361 for (
int I = 0; I < N; ++I)
362 Decls.push_back(readDecl());
369void ASTStmtReader::VisitAsmStmt(
AsmStmt *S) {
371 S->NumOutputs =
Record.readInt();
372 S->NumInputs =
Record.readInt();
373 S->NumClobbers =
Record.readInt();
374 S->setAsmLoc(readSourceLocation());
375 S->setVolatile(
Record.readInt());
376 S->setSimple(
Record.readInt());
379void ASTStmtReader::VisitGCCAsmStmt(
GCCAsmStmt *S) {
381 S->NumLabels =
Record.readInt();
382 S->setRParenLoc(readSourceLocation());
383 S->setAsmString(cast_or_null<StringLiteral>(
Record.readSubStmt()));
385 unsigned NumOutputs = S->getNumOutputs();
386 unsigned NumInputs = S->getNumInputs();
387 unsigned NumClobbers = S->getNumClobbers();
388 unsigned NumLabels = S->getNumLabels();
394 for (
unsigned I = 0, N = NumOutputs + NumInputs; I != N; ++I) {
395 Names.push_back(
Record.readIdentifier());
396 Constraints.push_back(cast_or_null<StringLiteral>(
Record.readSubStmt()));
397 Exprs.push_back(
Record.readSubStmt());
402 for (
unsigned I = 0; I != NumClobbers; ++I)
403 Clobbers.push_back(cast_or_null<StringLiteral>(
Record.readSubStmt()));
406 for (
unsigned I = 0, N = NumLabels; I != N; ++I) {
407 Names.push_back(
Record.readIdentifier());
408 Exprs.push_back(
Record.readSubStmt());
411 S->setOutputsAndInputsAndClobbers(
Record.getContext(),
412 Names.data(), Constraints.data(),
413 Exprs.data(), NumOutputs, NumInputs,
415 Clobbers.data(), NumClobbers);
418void ASTStmtReader::VisitMSAsmStmt(
MSAsmStmt *S) {
420 S->LBraceLoc = readSourceLocation();
421 S->EndLoc = readSourceLocation();
422 S->NumAsmToks =
Record.readInt();
423 std::string AsmStr = readString();
427 AsmToks.reserve(S->NumAsmToks);
428 for (
unsigned i = 0, e = S->NumAsmToks; i != e; ++i) {
429 AsmToks.push_back(
Record.readToken());
438 ClobbersData.reserve(S->NumClobbers);
439 Clobbers.reserve(S->NumClobbers);
440 for (
unsigned i = 0, e = S->NumClobbers; i != e; ++i) {
441 ClobbersData.push_back(readString());
442 Clobbers.push_back(ClobbersData.back());
446 unsigned NumOperands = S->NumOutputs + S->NumInputs;
450 Exprs.reserve(NumOperands);
451 ConstraintsData.reserve(NumOperands);
452 Constraints.reserve(NumOperands);
453 for (
unsigned i = 0; i != NumOperands; ++i) {
454 Exprs.push_back(cast<Expr>(
Record.readSubStmt()));
455 ConstraintsData.push_back(readString());
456 Constraints.push_back(ConstraintsData.back());
459 S->initialize(
Record.getContext(), AsmStr, AsmToks,
460 Constraints, Exprs, Clobbers);
465 assert(
Record.peekInt() == S->NumParams);
467 auto *StoredStmts = S->getStoredStmts();
469 i < CoroutineBodyStmt::SubStmt::FirstParamMove + S->NumParams; ++i)
470 StoredStmts[i] =
Record.readSubStmt();
475 S->CoreturnLoc =
Record.readSourceLocation();
476 for (
auto &SubStmt: S->SubStmts)
477 SubStmt =
Record.readSubStmt();
478 S->IsImplicit =
Record.readInt() != 0;
483 E->KeywordLoc = readSourceLocation();
484 for (
auto &SubExpr:
E->SubExprs)
485 SubExpr =
Record.readSubStmt();
486 E->OpaqueValue = cast_or_null<OpaqueValueExpr>(
Record.readSubStmt());
487 E->setIsImplicit(
Record.readInt() != 0);
492 E->KeywordLoc = readSourceLocation();
493 for (
auto &SubExpr:
E->SubExprs)
494 SubExpr =
Record.readSubStmt();
495 E->OpaqueValue = cast_or_null<OpaqueValueExpr>(
Record.readSubStmt());
500 E->KeywordLoc = readSourceLocation();
501 for (
auto &SubExpr:
E->SubExprs)
502 SubExpr =
Record.readSubStmt();
508 S->setCapturedDecl(readDeclAs<CapturedDecl>());
510 S->setCapturedRecordDecl(readDeclAs<RecordDecl>());
514 E = S->capture_init_end();
516 *I =
Record.readSubExpr();
519 S->setCapturedStmt(
Record.readSubStmt());
520 S->getCapturedDecl()->setBody(S->getCapturedStmt());
523 for (
auto &I : S->captures()) {
524 I.VarAndKind.setPointer(readDeclAs<VarDecl>());
527 I.Loc = readSourceLocation();
531void ASTStmtReader::VisitExpr(
Expr *
E) {
533 CurrentUnpackingBits.emplace(
Record.readInt());
535 CurrentUnpackingBits->getNextBits(5)));
537 CurrentUnpackingBits->getNextBits(2)));
539 CurrentUnpackingBits->getNextBits(3)));
543 "Incorrect expression field count");
550 assert(
E->getResultStorageKind() == StorageKind &&
"Wrong ResultKind!");
558 switch (StorageKind) {
563 E->Int64Result() =
Record.readInt();
567 E->APValueResult() =
Record.readAPValue();
568 if (
E->APValueResult().needsCleanup()) {
570 Record.getContext().addDestruction(&
E->APValueResult());
575 E->setSubExpr(
Record.readSubExpr());
581 E->setLocation(readSourceLocation());
582 E->setLParenLocation(readSourceLocation());
583 E->setRParenLocation(readSourceLocation());
585 E->setTypeSourceInfo(
Record.readTypeSourceInfo());
590 bool HasFunctionName =
Record.readInt();
594 E->setLocation(readSourceLocation());
596 E->setFunctionName(cast<StringLiteral>(
Record.readSubExpr()));
602 CurrentUnpackingBits.emplace(
Record.readInt());
603 E->
DeclRefExprBits.HadMultipleCandidates = CurrentUnpackingBits->getNextBit();
605 CurrentUnpackingBits->getNextBit();
607 CurrentUnpackingBits->getNextBits(2);
608 E->
DeclRefExprBits.IsImmediateEscalating = CurrentUnpackingBits->getNextBit();
612 CurrentUnpackingBits->getNextBit();
613 E->
DeclRefExprBits.CapturedByCopyInLambdaWithExplicitObjectParameter =
false;
614 unsigned NumTemplateArgs = 0;
615 if (
E->hasTemplateKWAndArgsInfo())
616 NumTemplateArgs =
Record.readInt();
618 if (
E->hasQualifier())
622 if (
E->hasFoundDecl())
623 *
E->getTrailingObjects<
NamedDecl *>() = readDeclAs<NamedDecl>();
625 if (
E->hasTemplateKWAndArgsInfo())
630 E->D = readDeclAs<ValueDecl>();
631 E->setLocation(readSourceLocation());
632 E->DNLoc =
Record.readDeclarationNameLoc(
E->getDecl()->getDeclName());
637 E->setLocation(readSourceLocation());
643 E->setLocation(readSourceLocation());
651 static_cast<llvm::APFloatBase::Semantics
>(
Record.readInt()));
653 E->setValue(
Record.getContext(),
Record.readAPFloat(
E->getSemantics()));
654 E->setLocation(readSourceLocation());
659 E->setSubExpr(
Record.readSubExpr());
667 unsigned NumConcatenated =
Record.readInt();
668 unsigned Length =
Record.readInt();
669 unsigned CharByteWidth =
Record.readInt();
670 assert((NumConcatenated ==
E->getNumConcatenated()) &&
671 "Wrong number of concatenated tokens!");
672 assert((Length ==
E->getLength()) &&
"Wrong Length!");
673 assert((CharByteWidth ==
E->getCharByteWidth()) &&
"Wrong character width!");
680 assert((CharByteWidth ==
681 StringLiteral::mapCharByteWidth(
Record.getContext().getTargetInfo(),
683 "Wrong character width!");
686 for (
unsigned I = 0; I < NumConcatenated; ++I)
687 E->setStrTokenLoc(I, readSourceLocation());
690 char *StrData =
E->getStrDataAsChar();
691 for (
unsigned I = 0; I < Length * CharByteWidth; ++I)
692 StrData[I] =
Record.readInt();
698 E->setLocation(readSourceLocation());
702void ASTStmtReader::VisitParenExpr(
ParenExpr *
E) {
704 E->setLParen(readSourceLocation());
705 E->setRParen(readSourceLocation());
706 E->setSubExpr(
Record.readSubExpr());
711 unsigned NumExprs =
Record.readInt();
712 assert((NumExprs ==
E->getNumExprs()) &&
"Wrong NumExprs!");
713 for (
unsigned I = 0; I != NumExprs; ++I)
714 E->getTrailingObjects<
Stmt *>()[I] =
Record.readSubStmt();
715 E->LParenLoc = readSourceLocation();
716 E->RParenLoc = readSourceLocation();
721 bool hasFP_Features = CurrentUnpackingBits->getNextBit();
722 assert(hasFP_Features ==
E->hasStoredFPFeatures());
723 E->setSubExpr(
Record.readSubExpr());
726 E->setOperatorLoc(readSourceLocation());
727 E->setCanOverflow(CurrentUnpackingBits->getNextBit());
729 E->setStoredFPFeatures(
735 assert(
E->getNumComponents() ==
Record.peekInt());
737 assert(
E->getNumExpressions() ==
Record.peekInt());
739 E->setOperatorLoc(readSourceLocation());
740 E->setRParenLoc(readSourceLocation());
741 E->setTypeSourceInfo(readTypeSourceInfo());
742 for (
unsigned I = 0, N =
E->getNumComponents(); I != N; ++I) {
771 for (
unsigned I = 0, N =
E->getNumExpressions(); I != N; ++I)
772 E->setIndexExpr(I,
Record.readSubExpr());
778 if (
Record.peekInt() == 0) {
779 E->setArgument(
Record.readSubExpr());
782 E->setArgument(readTypeSourceInfo());
784 E->setOperatorLoc(readSourceLocation());
785 E->setRParenLoc(readSourceLocation());
795 unsigned NumDetailRecords =
Record.readInt();
796 for (
unsigned i = 0; i != NumDetailRecords; ++i) {
799 StringRef DiagMessage =
C.backupStr(
Record.readString());
801 Satisfaction.
Details.emplace_back(
803 DiagLocation, DiagMessage));
811void ASTStmtReader::VisitConceptSpecializationExpr(
816 E->ConceptRef =
Record.readConceptReference();
825 StringRef SubstitutedEntity =
C.backupStr(
Record.readString());
827 StringRef DiagMessage =
C.backupStr(
Record.readString());
829 return new (
Record.getContext())
836 unsigned NumLocalParameters =
Record.readInt();
837 unsigned NumRequirements =
Record.readInt();
842 for (
unsigned i = 0; i < NumLocalParameters; ++i)
843 LocalParameters.push_back(cast<ParmVarDecl>(
Record.readDecl()));
844 std::copy(LocalParameters.begin(), LocalParameters.end(),
847 for (
unsigned i = 0; i < NumRequirements; ++i) {
857 R =
new (
Record.getContext())
860 R =
new (
Record.getContext())
875 std::optional<concepts::ExprRequirement::ReturnTypeRequirement> Req;
881 NoexceptLoc =
Record.readSourceLocation();
882 switch (
Record.readInt()) {
892 SubstitutedConstraintExpr =
893 cast<ConceptSpecializationExpr>(
Record.readExpr());
905 std::move(*Req), Status, SubstitutedConstraintExpr);
914 bool HasInvalidConstraint =
Record.readInt();
915 if (HasInvalidConstraint) {
916 StringRef InvalidConstraint =
C.backupStr(
Record.readString());
918 Record.getContext(), InvalidConstraint,
932 Requirements.push_back(R);
934 std::copy(Requirements.begin(), Requirements.end(),
936 E->LParenLoc =
Record.readSourceLocation();
937 E->RParenLoc =
Record.readSourceLocation();
938 E->RBraceLoc =
Record.readSourceLocation();
943 E->setLHS(
Record.readSubExpr());
944 E->setRHS(
Record.readSubExpr());
945 E->setRBracketLoc(readSourceLocation());
950 E->setBase(
Record.readSubExpr());
951 E->setRowIdx(
Record.readSubExpr());
952 E->setColumnIdx(
Record.readSubExpr());
953 E->setRBracketLoc(readSourceLocation());
960 E->setBase(
Record.readSubExpr());
961 E->setLowerBound(
Record.readSubExpr());
962 E->setLength(
Record.readSubExpr());
964 if (
E->isOMPArraySection())
965 E->setStride(
Record.readSubExpr());
967 E->setColonLocFirst(readSourceLocation());
969 if (
E->isOMPArraySection())
970 E->setColonLocSecond(readSourceLocation());
972 E->setRBracketLoc(readSourceLocation());
977 unsigned NumDims =
Record.readInt();
978 E->setBase(
Record.readSubExpr());
980 for (
unsigned I = 0; I < NumDims; ++I)
981 Dims[I] =
Record.readSubExpr();
982 E->setDimensions(Dims);
984 for (
unsigned I = 0; I < NumDims; ++I)
985 SRs[I] = readSourceRange();
986 E->setBracketsRanges(SRs);
987 E->setLParenLoc(readSourceLocation());
988 E->setRParenLoc(readSourceLocation());
993 unsigned NumIters =
Record.readInt();
994 E->setIteratorKwLoc(readSourceLocation());
995 E->setLParenLoc(readSourceLocation());
996 E->setRParenLoc(readSourceLocation());
997 for (
unsigned I = 0; I < NumIters; ++I) {
998 E->setIteratorDeclaration(I,
Record.readDeclRef());
999 E->setAssignmentLoc(I, readSourceLocation());
1006 SecColonLoc = readSourceLocation();
1007 E->setIteratorRange(I,
Begin, ColonLoc, End, SecColonLoc, Step);
1014 E->setHelper(I, HD);
1018void ASTStmtReader::VisitCallExpr(
CallExpr *
E) {
1021 unsigned NumArgs =
Record.readInt();
1022 CurrentUnpackingBits.emplace(
Record.readInt());
1025 bool HasFPFeatures = CurrentUnpackingBits->getNextBit();
1026 assert((NumArgs ==
E->getNumArgs()) &&
"Wrong NumArgs!");
1027 E->setRParenLoc(readSourceLocation());
1028 E->setCallee(
Record.readSubExpr());
1029 for (
unsigned I = 0; I != NumArgs; ++I)
1030 E->setArg(I,
Record.readSubExpr());
1033 E->setStoredFPFeatures(
1041void ASTStmtReader::VisitMemberExpr(
MemberExpr *
E) {
1044 CurrentUnpackingBits.emplace(
Record.readInt());
1045 bool HasQualifier = CurrentUnpackingBits->getNextBit();
1046 bool HasFoundDecl = CurrentUnpackingBits->getNextBit();
1047 bool HasTemplateInfo = CurrentUnpackingBits->getNextBit();
1048 unsigned NumTemplateArgs =
Record.readInt();
1050 E->Base =
Record.readSubExpr();
1052 E->MemberDNLoc =
Record.readDeclarationNameLoc(
E->MemberDecl->getDeclName());
1053 E->MemberLoc =
Record.readSourceLocation();
1058 E->
MemberExprBits.HadMultipleCandidates = CurrentUnpackingBits->getNextBit();
1060 CurrentUnpackingBits->getNextBits(2);
1073 if (HasTemplateInfo)
1081 E->setBase(
Record.readSubExpr());
1082 E->setIsaMemberLoc(readSourceLocation());
1083 E->setOpLoc(readSourceLocation());
1084 E->setArrow(
Record.readInt());
1090 E->Operand =
Record.readSubExpr();
1091 E->setShouldCopy(
Record.readInt());
1095 VisitExplicitCastExpr(
E);
1096 E->LParenLoc = readSourceLocation();
1097 E->BridgeKeywordLoc = readSourceLocation();
1101void ASTStmtReader::VisitCastExpr(
CastExpr *
E) {
1103 unsigned NumBaseSpecs =
Record.readInt();
1104 assert(NumBaseSpecs ==
E->path_size());
1106 CurrentUnpackingBits.emplace(
Record.readInt());
1107 E->setCastKind((
CastKind)CurrentUnpackingBits->getNextBits(7));
1108 unsigned HasFPFeatures = CurrentUnpackingBits->getNextBit();
1109 assert(
E->hasStoredFPFeatures() == HasFPFeatures);
1111 E->setSubExpr(
Record.readSubExpr());
1114 while (NumBaseSpecs--) {
1116 *BaseSpec =
Record.readCXXBaseSpecifier();
1117 *BaseI++ = BaseSpec;
1120 *
E->getTrailingFPFeatures() =
1126 CurrentUnpackingBits.emplace(
Record.readInt());
1129 bool hasFP_Features = CurrentUnpackingBits->getNextBit();
1130 E->setHasStoredFPFeatures(hasFP_Features);
1131 E->setExcludedOverflowPattern(CurrentUnpackingBits->getNextBit());
1132 E->setLHS(
Record.readSubExpr());
1133 E->setRHS(
Record.readSubExpr());
1134 E->setOperatorLoc(readSourceLocation());
1136 E->setStoredFPFeatures(
1141 VisitBinaryOperator(
E);
1142 E->setComputationLHSType(
Record.readType());
1143 E->setComputationResultType(
Record.readType());
1148 E->SubExprs[ConditionalOperator::COND] =
Record.readSubExpr();
1149 E->SubExprs[ConditionalOperator::LHS] =
Record.readSubExpr();
1150 E->SubExprs[ConditionalOperator::RHS] =
Record.readSubExpr();
1151 E->QuestionLoc = readSourceLocation();
1152 E->ColonLoc = readSourceLocation();
1158 E->OpaqueValue = cast<OpaqueValueExpr>(
Record.readSubExpr());
1159 E->SubExprs[BinaryConditionalOperator::COMMON] =
Record.readSubExpr();
1160 E->SubExprs[BinaryConditionalOperator::COND] =
Record.readSubExpr();
1161 E->SubExprs[BinaryConditionalOperator::LHS] =
Record.readSubExpr();
1162 E->SubExprs[BinaryConditionalOperator::RHS] =
Record.readSubExpr();
1163 E->QuestionLoc = readSourceLocation();
1164 E->ColonLoc = readSourceLocation();
1169 E->setIsPartOfExplicitCast(CurrentUnpackingBits->getNextBit());
1174 E->setTypeInfoAsWritten(readTypeSourceInfo());
1178 VisitExplicitCastExpr(
E);
1179 E->setLParenLoc(readSourceLocation());
1180 E->setRParenLoc(readSourceLocation());
1185 E->setLParenLoc(readSourceLocation());
1186 E->setTypeSourceInfo(readTypeSourceInfo());
1187 E->setInitializer(
Record.readSubExpr());
1188 E->setFileScope(
Record.readInt());
1193 E->setBase(
Record.readSubExpr());
1194 E->setAccessor(
Record.readIdentifier());
1195 E->setAccessorLoc(readSourceLocation());
1200 if (
auto *SyntForm = cast_or_null<InitListExpr>(
Record.readSubStmt()))
1201 E->setSyntacticForm(SyntForm);
1202 E->setLBraceLoc(readSourceLocation());
1203 E->setRBraceLoc(readSourceLocation());
1204 bool isArrayFiller =
Record.readInt();
1205 Expr *filler =
nullptr;
1206 if (isArrayFiller) {
1207 filler =
Record.readSubExpr();
1208 E->ArrayFillerOrUnionFieldInit = filler;
1210 E->ArrayFillerOrUnionFieldInit = readDeclAs<FieldDecl>();
1211 E->sawArrayRangeDesignator(
Record.readInt());
1212 unsigned NumInits =
Record.readInt();
1213 E->reserveInits(
Record.getContext(), NumInits);
1214 if (isArrayFiller) {
1215 for (
unsigned I = 0; I != NumInits; ++I) {
1217 E->updateInit(
Record.getContext(), I, init ? init : filler);
1220 for (
unsigned I = 0; I != NumInits; ++I)
1221 E->updateInit(
Record.getContext(), I,
Record.readSubExpr());
1229 unsigned NumSubExprs =
Record.readInt();
1230 assert(NumSubExprs ==
E->getNumSubExprs() &&
"Wrong number of subexprs");
1231 for (
unsigned I = 0; I != NumSubExprs; ++I)
1232 E->setSubExpr(I,
Record.readSubExpr());
1233 E->setEqualOrColonLoc(readSourceLocation());
1234 E->setGNUSyntax(
Record.readInt());
1240 auto *
Field = readDeclAs<FieldDecl>();
1244 Field->getIdentifier(), DotLoc, FieldLoc));
1245 Designators.back().setFieldDecl(Field);
1259 unsigned Index =
Record.readInt();
1269 unsigned Index =
Record.readInt();
1274 Index, LBracketLoc, EllipsisLoc, RBracketLoc));
1279 E->setDesignators(
Record.getContext(),
1280 Designators.data(), Designators.size());
1285 E->setBase(
Record.readSubExpr());
1286 E->setUpdater(
Record.readSubExpr());
1289void ASTStmtReader::VisitNoInitExpr(
NoInitExpr *
E) {
1295 E->SubExprs[0] =
Record.readSubExpr();
1296 E->SubExprs[1] =
Record.readSubExpr();
1307void ASTStmtReader::VisitVAArgExpr(
VAArgExpr *
E) {
1309 E->setSubExpr(
Record.readSubExpr());
1310 E->setWrittenTypeInfo(readTypeSourceInfo());
1311 E->setBuiltinLoc(readSourceLocation());
1312 E->setRParenLoc(readSourceLocation());
1313 E->setIsMicrosoftABI(
Record.readInt());
1318 E->ParentContext = readDeclAs<DeclContext>();
1319 E->BuiltinLoc = readSourceLocation();
1320 E->RParenLoc = readSourceLocation();
1324void ASTStmtReader::VisitEmbedExpr(
EmbedExpr *
E) {
1326 E->EmbedKeywordLoc = readSourceLocation();
1328 Data->BinaryData = cast<StringLiteral>(
Record.readSubStmt());
1331 E->NumOfElements =
Record.readInt();
1336 E->setAmpAmpLoc(readSourceLocation());
1337 E->setLabelLoc(readSourceLocation());
1338 E->setLabel(readDeclAs<LabelDecl>());
1341void ASTStmtReader::VisitStmtExpr(
StmtExpr *
E) {
1343 E->setLParenLoc(readSourceLocation());
1344 E->setRParenLoc(readSourceLocation());
1345 E->setSubStmt(cast_or_null<CompoundStmt>(
Record.readSubStmt()));
1349void ASTStmtReader::VisitChooseExpr(
ChooseExpr *
E) {
1351 E->setCond(
Record.readSubExpr());
1352 E->setLHS(
Record.readSubExpr());
1353 E->setRHS(
Record.readSubExpr());
1354 E->setBuiltinLoc(readSourceLocation());
1355 E->setRParenLoc(readSourceLocation());
1356 E->setIsConditionTrue(
Record.readInt());
1361 E->setTokenLocation(readSourceLocation());
1367 unsigned NumExprs =
Record.readInt();
1369 Exprs.push_back(
Record.readSubExpr());
1370 E->setExprs(
Record.getContext(), Exprs);
1371 E->setBuiltinLoc(readSourceLocation());
1372 E->setRParenLoc(readSourceLocation());
1377 E->BuiltinLoc = readSourceLocation();
1378 E->RParenLoc = readSourceLocation();
1379 E->TInfo = readTypeSourceInfo();
1380 E->SrcExpr =
Record.readSubExpr();
1383void ASTStmtReader::VisitBlockExpr(
BlockExpr *
E) {
1385 E->setBlockDecl(readDeclAs<BlockDecl>());
1391 unsigned NumAssocs =
Record.readInt();
1392 assert(NumAssocs ==
E->getNumAssocs() &&
"Wrong NumAssocs!");
1393 E->IsExprPredicate =
Record.readInt();
1394 E->ResultIndex =
Record.readInt();
1396 E->DefaultLoc = readSourceLocation();
1397 E->RParenLoc = readSourceLocation();
1399 Stmt **Stmts =
E->getTrailingObjects<
Stmt *>();
1403 for (
unsigned I = 0, N = NumAssocs + 1; I < N; ++I)
1404 Stmts[I] =
Record.readSubExpr();
1407 for (
unsigned I = 0, N = NumAssocs; I < N; ++I)
1408 TSIs[I] = readTypeSourceInfo();
1413 unsigned numSemanticExprs =
Record.readInt();
1418 E->getSubExprsBuffer()[0] =
Record.readSubExpr();
1421 for (
unsigned i = 0; i != numSemanticExprs; ++i) {
1423 E->getSubExprsBuffer()[i+1] = subExpr;
1427void ASTStmtReader::VisitAtomicExpr(
AtomicExpr *
E) {
1431 for (
unsigned I = 0; I !=
E->NumSubExprs; ++I)
1432 E->SubExprs[I] =
Record.readSubExpr();
1433 E->BuiltinLoc = readSourceLocation();
1434 E->RParenLoc = readSourceLocation();
1442 E->setString(cast<StringLiteral>(
Record.readSubStmt()));
1443 E->setAtLoc(readSourceLocation());
1449 E->SubExpr =
Record.readSubStmt();
1450 E->BoxingMethod = readDeclAs<ObjCMethodDecl>();
1451 E->Range = readSourceRange();
1456 unsigned NumElements =
Record.readInt();
1457 assert(NumElements ==
E->getNumElements() &&
"Wrong number of elements");
1458 Expr **Elements =
E->getElements();
1459 for (
unsigned I = 0, N = NumElements; I != N; ++I)
1460 Elements[I] =
Record.readSubExpr();
1461 E->ArrayWithObjectsMethod = readDeclAs<ObjCMethodDecl>();
1462 E->Range = readSourceRange();
1467 unsigned NumElements =
Record.readInt();
1468 assert(NumElements ==
E->getNumElements() &&
"Wrong number of elements");
1469 bool HasPackExpansions =
Record.readInt();
1470 assert(HasPackExpansions ==
E->HasPackExpansions &&
"Pack expansion mismatch");
1475 for (
unsigned I = 0; I != NumElements; ++I) {
1476 KeyValues[I].Key =
Record.readSubExpr();
1477 KeyValues[I].Value =
Record.readSubExpr();
1478 if (HasPackExpansions) {
1479 Expansions[I].EllipsisLoc = readSourceLocation();
1480 Expansions[I].NumExpansionsPlusOne =
Record.readInt();
1483 E->DictWithObjectsMethod = readDeclAs<ObjCMethodDecl>();
1484 E->Range = readSourceRange();
1489 E->setEncodedTypeSourceInfo(readTypeSourceInfo());
1490 E->setAtLoc(readSourceLocation());
1491 E->setRParenLoc(readSourceLocation());
1496 E->setSelector(
Record.readSelector());
1497 E->setAtLoc(readSourceLocation());
1498 E->setRParenLoc(readSourceLocation());
1503 E->setProtocol(readDeclAs<ObjCProtocolDecl>());
1504 E->setAtLoc(readSourceLocation());
1505 E->ProtoLoc = readSourceLocation();
1506 E->setRParenLoc(readSourceLocation());
1511 E->setDecl(readDeclAs<ObjCIvarDecl>());
1512 E->setLocation(readSourceLocation());
1513 E->setOpLoc(readSourceLocation());
1514 E->setBase(
Record.readSubExpr());
1515 E->setIsArrow(
Record.readInt());
1516 E->setIsFreeIvar(
Record.readInt());
1521 unsigned MethodRefFlags =
Record.readInt();
1524 auto *Getter = readDeclAs<ObjCMethodDecl>();
1525 auto *Setter = readDeclAs<ObjCMethodDecl>();
1526 E->setImplicitProperty(Getter, Setter, MethodRefFlags);
1528 E->setExplicitProperty(readDeclAs<ObjCPropertyDecl>(), MethodRefFlags);
1530 E->setLocation(readSourceLocation());
1531 E->setReceiverLocation(readSourceLocation());
1532 switch (
Record.readInt()) {
1534 E->setBase(
Record.readSubExpr());
1537 E->setSuperReceiver(
Record.readType());
1540 E->setClassReceiver(readDeclAs<ObjCInterfaceDecl>());
1547 E->setRBracket(readSourceLocation());
1548 E->setBaseExpr(
Record.readSubExpr());
1549 E->setKeyExpr(
Record.readSubExpr());
1550 E->GetAtIndexMethodDecl = readDeclAs<ObjCMethodDecl>();
1551 E->SetAtIndexMethodDecl = readDeclAs<ObjCMethodDecl>();
1556 assert(
Record.peekInt() ==
E->getNumArgs());
1558 unsigned NumStoredSelLocs =
Record.readInt();
1559 E->SelLocsKind =
Record.readInt();
1560 E->setDelegateInitCall(
Record.readInt());
1561 E->IsImplicit =
Record.readInt();
1565 E->setInstanceReceiver(
Record.readSubExpr());
1569 E->setClassReceiver(readTypeSourceInfo());
1581 assert(Kind ==
E->getReceiverKind());
1584 E->setMethodDecl(readDeclAs<ObjCMethodDecl>());
1586 E->setSelector(
Record.readSelector());
1588 E->LBracLoc = readSourceLocation();
1589 E->RBracLoc = readSourceLocation();
1591 for (
unsigned I = 0, N =
E->getNumArgs(); I != N; ++I)
1592 E->setArg(I,
Record.readSubExpr());
1595 for (
unsigned I = 0; I != NumStoredSelLocs; ++I)
1596 Locs[I] = readSourceLocation();
1601 S->setElement(
Record.readSubStmt());
1602 S->setCollection(
Record.readSubExpr());
1603 S->setBody(
Record.readSubStmt());
1604 S->setForLoc(readSourceLocation());
1605 S->setRParenLoc(readSourceLocation());
1610 S->setCatchBody(
Record.readSubStmt());
1611 S->setCatchParamDecl(readDeclAs<VarDecl>());
1612 S->setAtCatchLoc(readSourceLocation());
1613 S->setRParenLoc(readSourceLocation());
1618 S->setFinallyBody(
Record.readSubStmt());
1619 S->setAtFinallyLoc(readSourceLocation());
1624 S->setSubStmt(
Record.readSubStmt());
1625 S->setAtLoc(readSourceLocation());
1630 assert(
Record.peekInt() == S->getNumCatchStmts());
1632 bool HasFinally =
Record.readInt();
1633 S->setTryBody(
Record.readSubStmt());
1634 for (
unsigned I = 0, N = S->getNumCatchStmts(); I != N; ++I)
1635 S->setCatchStmt(I, cast_or_null<ObjCAtCatchStmt>(
Record.readSubStmt()));
1638 S->setFinallyStmt(
Record.readSubStmt());
1639 S->setAtTryLoc(readSourceLocation());
1644 S->setSynchExpr(
Record.readSubStmt());
1645 S->setSynchBody(
Record.readSubStmt());
1646 S->setAtSynchronizedLoc(readSourceLocation());
1651 S->setThrowExpr(
Record.readSubStmt());
1652 S->setThrowLoc(readSourceLocation());
1657 E->setValue(
Record.readInt());
1658 E->setLocation(readSourceLocation());
1666 E->VersionToCheck =
Record.readVersionTuple();
1673void ASTStmtReader::VisitCXXCatchStmt(
CXXCatchStmt *S) {
1675 S->CatchLoc = readSourceLocation();
1676 S->ExceptionDecl = readDeclAs<VarDecl>();
1677 S->HandlerBlock =
Record.readSubStmt();
1680void ASTStmtReader::VisitCXXTryStmt(
CXXTryStmt *S) {
1682 assert(
Record.peekInt() == S->getNumHandlers() &&
"NumStmtFields is wrong ?");
1684 S->TryLoc = readSourceLocation();
1685 S->getStmts()[0] =
Record.readSubStmt();
1686 for (
unsigned i = 0, e = S->getNumHandlers(); i != e; ++i)
1687 S->getStmts()[i + 1] =
Record.readSubStmt();
1692 S->ForLoc = readSourceLocation();
1693 S->CoawaitLoc = readSourceLocation();
1694 S->ColonLoc = readSourceLocation();
1695 S->RParenLoc = readSourceLocation();
1696 S->setInit(
Record.readSubStmt());
1697 S->setRangeStmt(
Record.readSubStmt());
1698 S->setBeginStmt(
Record.readSubStmt());
1699 S->setEndStmt(
Record.readSubStmt());
1700 S->setCond(
Record.readSubExpr());
1701 S->setInc(
Record.readSubExpr());
1702 S->setLoopVarStmt(
Record.readSubStmt());
1703 S->setBody(
Record.readSubStmt());
1708 S->KeywordLoc = readSourceLocation();
1709 S->IsIfExists =
Record.readInt();
1710 S->QualifierLoc =
Record.readNestedNameSpecifierLoc();
1711 S->NameInfo =
Record.readDeclarationNameInfo();
1712 S->SubStmt =
Record.readSubStmt();
1718 E->Range =
Record.readSourceRange();
1721void ASTStmtReader::VisitCXXRewrittenBinaryOperator(
1725 E->SemanticForm =
Record.readSubExpr();
1731 unsigned NumArgs =
Record.readInt();
1732 assert((NumArgs ==
E->getNumArgs()) &&
"Wrong NumArgs!");
1742 E->Constructor = readDeclAs<CXXConstructorDecl>();
1743 E->ParenOrBraceRange = readSourceRange();
1745 for (
unsigned I = 0; I != NumArgs; ++I)
1746 E->setArg(I,
Record.readSubExpr());
1751 E->Constructor = readDeclAs<CXXConstructorDecl>();
1752 E->Loc = readSourceLocation();
1753 E->ConstructsVirtualBase =
Record.readInt();
1754 E->InheritedFromVirtualBase =
Record.readInt();
1758 VisitCXXConstructExpr(
E);
1759 E->TSI = readTypeSourceInfo();
1762void ASTStmtReader::VisitLambdaExpr(
LambdaExpr *
E) {
1764 unsigned NumCaptures =
Record.readInt();
1767 E->IntroducerRange = readSourceRange();
1769 E->CaptureDefaultLoc = readSourceLocation();
1772 E->ClosingBrace = readSourceLocation();
1776 CEnd =
E->capture_init_end();
1787 E->SubExpr =
Record.readSubExpr();
1791 VisitExplicitCastExpr(
E);
1795 if (CurrentUnpackingBits->getNextBit())
1796 E->AngleBrackets = readSourceRange();
1800 return VisitCXXNamedCastExpr(
E);
1804 return VisitCXXNamedCastExpr(
E);
1808 return VisitCXXNamedCastExpr(
E);
1812 return VisitCXXNamedCastExpr(
E);
1816 return VisitCXXNamedCastExpr(
E);
1820 VisitExplicitCastExpr(
E);
1821 E->setLParenLoc(readSourceLocation());
1822 E->setRParenLoc(readSourceLocation());
1826 VisitExplicitCastExpr(
E);
1827 E->KWLoc = readSourceLocation();
1828 E->RParenLoc = readSourceLocation();
1833 E->UDSuffixLoc = readSourceLocation();
1838 E->setValue(
Record.readInt());
1839 E->setLocation(readSourceLocation());
1844 E->setLocation(readSourceLocation());
1849 E->setSourceRange(readSourceRange());
1850 if (
E->isTypeOperand())
1851 E->Operand = readTypeSourceInfo();
1853 E->Operand =
Record.readSubExpr();
1858 E->setLocation(readSourceLocation());
1859 E->setImplicit(
Record.readInt());
1860 E->setCapturedByCopyInLambdaWithExplicitObjectParameter(
Record.readInt());
1866 E->Operand =
Record.readSubExpr();
1872 E->Param = readDeclAs<ParmVarDecl>();
1873 E->UsedContext = readDeclAs<DeclContext>();
1877 *
E->getTrailingObjects<
Expr *>() =
Record.readSubExpr();
1883 E->Field = readDeclAs<FieldDecl>();
1884 E->UsedContext = readDeclAs<DeclContext>();
1887 *
E->getTrailingObjects<
Expr *>() =
Record.readSubExpr();
1892 E->setTemporary(
Record.readCXXTemporary());
1893 E->setSubExpr(
Record.readSubExpr());
1898 E->TypeInfo = readTypeSourceInfo();
1902void ASTStmtReader::VisitCXXNewExpr(
CXXNewExpr *
E) {
1905 bool IsArray =
Record.readInt();
1906 bool HasInit =
Record.readInt();
1907 unsigned NumPlacementArgs =
Record.readInt();
1908 bool IsParenTypeId =
Record.readInt();
1916 assert((IsArray ==
E->isArray()) &&
"Wrong IsArray!");
1917 assert((HasInit ==
E->hasInitializer()) &&
"Wrong HasInit!");
1918 assert((NumPlacementArgs ==
E->getNumPlacementArgs()) &&
1919 "Wrong NumPlacementArgs!");
1920 assert((IsParenTypeId ==
E->isParenTypeId()) &&
"Wrong IsParenTypeId!");
1923 (void)NumPlacementArgs;
1925 E->setOperatorNew(readDeclAs<FunctionDecl>());
1926 E->setOperatorDelete(readDeclAs<FunctionDecl>());
1927 E->AllocatedTypeInfo = readTypeSourceInfo();
1929 E->getTrailingObjects<
SourceRange>()[0] = readSourceRange();
1930 E->Range = readSourceRange();
1931 E->DirectInitRange = readSourceRange();
1935 N =
E->raw_arg_end();
1937 *I =
Record.readSubStmt();
1946 E->OperatorDelete = readDeclAs<FunctionDecl>();
1947 E->Argument =
Record.readSubExpr();
1954 E->Base =
Record.readSubExpr();
1955 E->IsArrow =
Record.readInt();
1956 E->OperatorLoc = readSourceLocation();
1957 E->QualifierLoc =
Record.readNestedNameSpecifierLoc();
1958 E->ScopeType = readTypeSourceInfo();
1959 E->ColonColonLoc = readSourceLocation();
1960 E->TildeLoc = readSourceLocation();
1964 E->setDestroyedType(II, readSourceLocation());
1966 E->setDestroyedType(readTypeSourceInfo());
1972 unsigned NumObjects =
Record.readInt();
1973 assert(NumObjects ==
E->getNumObjects());
1974 for (
unsigned i = 0; i != NumObjects; ++i) {
1978 Obj = readDeclAs<BlockDecl>();
1980 Obj = cast<CompoundLiteralExpr>(
Record.readSubExpr());
1982 llvm_unreachable(
"unexpected cleanup object type");
1987 E->SubExpr =
Record.readSubExpr();
1990void ASTStmtReader::VisitCXXDependentScopeMemberExpr(
1994 unsigned NumTemplateArgs =
Record.readInt();
1995 CurrentUnpackingBits.emplace(
Record.readInt());
1996 bool HasTemplateKWAndArgsInfo = CurrentUnpackingBits->getNextBit();
1997 bool HasFirstQualifierFoundInScope = CurrentUnpackingBits->getNextBit();
1999 assert((HasTemplateKWAndArgsInfo ==
E->hasTemplateKWAndArgsInfo()) &&
2000 "Wrong HasTemplateKWAndArgsInfo!");
2002 (HasFirstQualifierFoundInScope ==
E->hasFirstQualifierFoundInScope()) &&
2003 "Wrong HasFirstQualifierFoundInScope!");
2005 if (HasTemplateKWAndArgsInfo)
2010 assert((NumTemplateArgs ==
E->getNumTemplateArgs()) &&
2011 "Wrong NumTemplateArgs!");
2014 CurrentUnpackingBits->getNextBit();
2016 E->BaseType =
Record.readType();
2017 E->QualifierLoc =
Record.readNestedNameSpecifierLoc();
2019 if (CurrentUnpackingBits->getNextBit())
2020 E->Base =
Record.readSubExpr();
2026 if (HasFirstQualifierFoundInScope)
2027 *
E->getTrailingObjects<
NamedDecl *>() = readDeclAs<NamedDecl>();
2029 E->MemberNameInfo =
Record.readDeclarationNameInfo();
2036 if (CurrentUnpackingBits->getNextBit())
2040 CurrentUnpackingBits->getNextBits(16));
2042 E->QualifierLoc =
Record.readNestedNameSpecifierLoc();
2043 E->NameInfo =
Record.readDeclarationNameInfo();
2049 assert(
Record.peekInt() ==
E->getNumArgs() &&
2050 "Read wrong record during creation ?");
2052 for (
unsigned I = 0, N =
E->getNumArgs(); I != N; ++I)
2053 E->setArg(I,
Record.readSubExpr());
2054 E->TypeAndInitForm.setPointer(readTypeSourceInfo());
2055 E->setLParenLoc(readSourceLocation());
2056 E->setRParenLoc(readSourceLocation());
2057 E->TypeAndInitForm.setInt(
Record.readInt());
2063 unsigned NumResults =
Record.readInt();
2064 CurrentUnpackingBits.emplace(
Record.readInt());
2065 bool HasTemplateKWAndArgsInfo = CurrentUnpackingBits->getNextBit();
2066 assert((
E->getNumDecls() == NumResults) &&
"Wrong NumResults!");
2067 assert((
E->hasTemplateKWAndArgsInfo() == HasTemplateKWAndArgsInfo) &&
2068 "Wrong HasTemplateKWAndArgsInfo!");
2070 if (HasTemplateKWAndArgsInfo) {
2071 unsigned NumTemplateArgs =
Record.readInt();
2073 E->getTrailingTemplateArgumentLoc(),
2075 assert((
E->getNumTemplateArgs() == NumTemplateArgs) &&
2076 "Wrong NumTemplateArgs!");
2080 for (
unsigned I = 0; I != NumResults; ++I) {
2081 auto *
D = readDeclAs<NamedDecl>();
2088 for (
unsigned I = 0; I != NumResults; ++I) {
2089 Results[I] = (
Iter + I).getPair();
2092 E->NameInfo =
Record.readDeclarationNameInfo();
2093 E->QualifierLoc =
Record.readNestedNameSpecifierLoc();
2097 VisitOverloadExpr(
E);
2100 CurrentUnpackingBits->getNextBit();
2102 if (CurrentUnpackingBits->getNextBit())
2103 E->Base =
Record.readSubExpr();
2107 E->OperatorLoc = readSourceLocation();
2109 E->BaseType =
Record.readType();
2113 VisitOverloadExpr(
E);
2115 E->NamingClass = readDeclAs<CXXRecordDecl>();
2128 for (
unsigned I = 0, N =
E->getNumArgs(); I != N; ++I)
2129 Args[I] = readTypeSourceInfo();
2139 E->QueriedType = readTypeSourceInfo();
2140 E->Dimension =
Record.readSubExpr();
2148 E->QueriedExpression =
Record.readSubExpr();
2156 E->Range = readSourceRange();
2157 E->Operand =
Record.readSubExpr();
2162 E->EllipsisLoc = readSourceLocation();
2163 E->NumExpansions =
Record.readInt();
2164 E->Pattern =
Record.readSubExpr();
2169 unsigned NumPartialArgs =
Record.readInt();
2170 E->OperatorLoc = readSourceLocation();
2171 E->PackLoc = readSourceLocation();
2172 E->RParenLoc = readSourceLocation();
2174 if (
E->isPartiallySubstituted()) {
2175 assert(
E->Length == NumPartialArgs);
2177 *
E = I + NumPartialArgs;
2187 E->TransformedExpressions =
Record.readInt();
2188 E->ExpandedToEmptyPack =
Record.readInt();
2189 E->EllipsisLoc = readSourceLocation();
2190 E->RSquareLoc = readSourceLocation();
2191 E->SubExprs[0] =
Record.readStmt();
2192 E->SubExprs[1] =
Record.readStmt();
2193 auto **Exprs =
E->getTrailingObjects<
Expr *>();
2194 for (
unsigned I = 0; I <
E->TransformedExpressions; ++I)
2195 Exprs[I] =
Record.readExpr();
2198void ASTStmtReader::VisitSubstNonTypeTemplateParmExpr(
2201 E->AssociatedDeclAndRef.setPointer(readDeclAs<Decl>());
2202 E->AssociatedDeclAndRef.setInt(CurrentUnpackingBits->getNextBit());
2203 E->Index = CurrentUnpackingBits->getNextBits(12);
2204 if (CurrentUnpackingBits->getNextBit())
2205 E->PackIndex =
Record.readInt();
2209 E->Replacement =
Record.readSubExpr();
2212void ASTStmtReader::VisitSubstNonTypeTemplateParmPackExpr(
2215 E->AssociatedDecl = readDeclAs<Decl>();
2223 E->NameLoc = readSourceLocation();
2228 E->NumParameters =
Record.readInt();
2229 E->ParamPack = readDeclAs<ParmVarDecl>();
2230 E->NameLoc = readSourceLocation();
2231 auto **Parms =
E->getTrailingObjects<
VarDecl *>();
2232 for (
unsigned i = 0, n =
E->NumParameters; i != n; ++i)
2233 Parms[i] = readDeclAs<VarDecl>();
2238 bool HasMaterialzedDecl =
Record.readInt();
2239 if (HasMaterialzedDecl)
2240 E->State = cast<LifetimeExtendedTemporaryDecl>(
Record.readDecl());
2242 E->State =
Record.readSubExpr();
2247 E->LParenLoc = readSourceLocation();
2248 E->EllipsisLoc = readSourceLocation();
2249 E->RParenLoc = readSourceLocation();
2250 E->NumExpansions =
Record.readInt();
2251 E->SubExprs[0] =
Record.readSubExpr();
2252 E->SubExprs[1] =
Record.readSubExpr();
2253 E->SubExprs[2] =
Record.readSubExpr();
2259 unsigned ExpectedNumExprs =
Record.readInt();
2260 assert(
E->NumExprs == ExpectedNumExprs &&
2261 "expected number of expressions does not equal the actual number of "
2262 "serialized expressions.");
2263 E->NumUserSpecifiedExprs =
Record.readInt();
2264 E->InitLoc = readSourceLocation();
2265 E->LParenLoc = readSourceLocation();
2266 E->RParenLoc = readSourceLocation();
2267 for (
unsigned I = 0; I < ExpectedNumExprs; I++)
2268 E->getTrailingObjects<
Expr *>()[I] =
Record.readSubExpr();
2270 bool HasArrayFillerOrUnionDecl =
Record.readBool();
2271 if (HasArrayFillerOrUnionDecl) {
2272 bool HasArrayFiller =
Record.readBool();
2273 if (HasArrayFiller) {
2274 E->setArrayFiller(
Record.readSubExpr());
2276 E->setInitializedFieldInUnion(readDeclAs<FieldDecl>());
2279 E->updateDependence();
2284 E->SourceExpr =
Record.readSubExpr();
2286 E->setIsUnique(
Record.readInt());
2289void ASTStmtReader::VisitTypoExpr(
TypoExpr *
E) {
2290 llvm_unreachable(
"Cannot read TypoExpr nodes");
2295 unsigned NumArgs =
Record.readInt();
2296 E->BeginLoc = readSourceLocation();
2297 E->EndLoc = readSourceLocation();
2298 assert((NumArgs + 0LL ==
2303 Child =
Record.readSubStmt();
2311 E->IsArrow = (
Record.readInt() != 0);
2312 E->BaseExpr =
Record.readSubExpr();
2313 E->QualifierLoc =
Record.readNestedNameSpecifierLoc();
2314 E->MemberLoc = readSourceLocation();
2315 E->TheDecl = readDeclAs<MSPropertyDecl>();
2320 E->setBase(
Record.readSubExpr());
2321 E->setIdx(
Record.readSubExpr());
2322 E->setRBracketLoc(readSourceLocation());
2327 E->setSourceRange(readSourceRange());
2328 E->Guid = readDeclAs<MSGuidDecl>();
2329 if (
E->isTypeOperand())
2330 E->Operand = readTypeSourceInfo();
2332 E->Operand =
Record.readSubExpr();
2335void ASTStmtReader::VisitSEHLeaveStmt(
SEHLeaveStmt *S) {
2337 S->setLeaveLoc(readSourceLocation());
2342 S->Loc = readSourceLocation();
2343 S->Children[SEHExceptStmt::FILTER_EXPR] =
Record.readSubStmt();
2344 S->Children[SEHExceptStmt::BLOCK] =
Record.readSubStmt();
2349 S->Loc = readSourceLocation();
2350 S->Block =
Record.readSubStmt();
2353void ASTStmtReader::VisitSEHTryStmt(
SEHTryStmt *S) {
2355 S->IsCXXTry =
Record.readInt();
2356 S->TryLoc = readSourceLocation();
2357 S->Children[SEHTryStmt::TRY] =
Record.readSubStmt();
2358 S->Children[SEHTryStmt::HANDLER] =
Record.readSubStmt();
2367 E->setPreArg(CUDAKernelCallExpr::CONFIG,
Record.readSubExpr());
2373void ASTStmtReader::VisitAsTypeExpr(
AsTypeExpr *
E) {
2375 E->BuiltinLoc = readSourceLocation();
2376 E->RParenLoc = readSourceLocation();
2377 E->SrcExpr =
Record.readSubExpr();
2386 for (
Stmt *&SubStmt : S->SubStmts)
2387 SubStmt =
Record.readSubStmt();
2391 Record.readOMPChildren(
E->Data);
2392 E->setLocStart(readSourceLocation());
2393 E->setLocEnd(readSourceLocation());
2400 VisitOMPExecutableDirective(
D);
2404 VisitOMPLoopBasedDirective(
D);
2411 VisitOMPExecutableDirective(
D);
2416 VisitOMPExecutableDirective(
D);
2417 D->setHasCancel(
Record.readBool());
2421 VisitOMPLoopDirective(
D);
2424void ASTStmtReader::VisitOMPLoopTransformationDirective(
2426 VisitOMPLoopBasedDirective(
D);
2427 D->setNumGeneratedLoops(
Record.readUInt32());
2431 VisitOMPLoopTransformationDirective(
D);
2435 VisitOMPLoopTransformationDirective(
D);
2439 VisitOMPLoopTransformationDirective(
D);
2443 VisitOMPLoopTransformationDirective(
D);
2447 VisitOMPLoopDirective(
D);
2448 D->setHasCancel(
Record.readBool());
2452 VisitOMPLoopDirective(
D);
2457 VisitOMPExecutableDirective(
D);
2458 D->setHasCancel(
Record.readBool());
2463 VisitOMPExecutableDirective(
D);
2464 D->setHasCancel(
Record.readBool());
2469 VisitOMPExecutableDirective(
D);
2474 VisitOMPExecutableDirective(
D);
2479 VisitOMPExecutableDirective(
D);
2484 VisitOMPExecutableDirective(
D);
2485 D->DirName =
Record.readDeclarationNameInfo();
2489 VisitOMPLoopDirective(
D);
2490 D->setHasCancel(
Record.readBool());
2493void ASTStmtReader::VisitOMPParallelForSimdDirective(
2495 VisitOMPLoopDirective(
D);
2498void ASTStmtReader::VisitOMPParallelMasterDirective(
2501 VisitOMPExecutableDirective(
D);
2504void ASTStmtReader::VisitOMPParallelMaskedDirective(
2507 VisitOMPExecutableDirective(
D);
2510void ASTStmtReader::VisitOMPParallelSectionsDirective(
2513 VisitOMPExecutableDirective(
D);
2514 D->setHasCancel(
Record.readBool());
2519 VisitOMPExecutableDirective(
D);
2520 D->setHasCancel(
Record.readBool());
2525 VisitOMPExecutableDirective(
D);
2530 VisitOMPExecutableDirective(
D);
2537 VisitOMPExecutableDirective(
D);
2542 VisitOMPExecutableDirective(
D);
2549 VisitOMPExecutableDirective(
D);
2554 VisitOMPExecutableDirective(
D);
2559 VisitOMPExecutableDirective(
D);
2564 VisitOMPExecutableDirective(
D);
2569 VisitOMPExecutableDirective(
D);
2574 VisitOMPExecutableDirective(
D);
2579 VisitOMPExecutableDirective(
D);
2580 D->Flags.IsXLHSInRHSPart =
Record.readBool() ? 1 : 0;
2581 D->Flags.IsPostfixUpdate =
Record.readBool() ? 1 : 0;
2582 D->Flags.IsFailOnly =
Record.readBool() ? 1 : 0;
2587 VisitOMPExecutableDirective(
D);
2592 VisitOMPExecutableDirective(
D);
2595void ASTStmtReader::VisitOMPTargetEnterDataDirective(
2598 VisitOMPExecutableDirective(
D);
2601void ASTStmtReader::VisitOMPTargetExitDataDirective(
2604 VisitOMPExecutableDirective(
D);
2607void ASTStmtReader::VisitOMPTargetParallelDirective(
2610 VisitOMPExecutableDirective(
D);
2611 D->setHasCancel(
Record.readBool());
2614void ASTStmtReader::VisitOMPTargetParallelForDirective(
2616 VisitOMPLoopDirective(
D);
2617 D->setHasCancel(
Record.readBool());
2622 VisitOMPExecutableDirective(
D);
2625void ASTStmtReader::VisitOMPCancellationPointDirective(
2628 VisitOMPExecutableDirective(
D);
2634 VisitOMPExecutableDirective(
D);
2639 VisitOMPLoopDirective(
D);
2640 D->setHasCancel(
Record.readBool());
2644 VisitOMPLoopDirective(
D);
2647void ASTStmtReader::VisitOMPMasterTaskLoopDirective(
2649 VisitOMPLoopDirective(
D);
2650 D->setHasCancel(
Record.readBool());
2653void ASTStmtReader::VisitOMPMaskedTaskLoopDirective(
2655 VisitOMPLoopDirective(
D);
2656 D->setHasCancel(
Record.readBool());
2659void ASTStmtReader::VisitOMPMasterTaskLoopSimdDirective(
2661 VisitOMPLoopDirective(
D);
2664void ASTStmtReader::VisitOMPMaskedTaskLoopSimdDirective(
2666 VisitOMPLoopDirective(
D);
2669void ASTStmtReader::VisitOMPParallelMasterTaskLoopDirective(
2671 VisitOMPLoopDirective(
D);
2672 D->setHasCancel(
Record.readBool());
2675void ASTStmtReader::VisitOMPParallelMaskedTaskLoopDirective(
2677 VisitOMPLoopDirective(
D);
2678 D->setHasCancel(
Record.readBool());
2681void ASTStmtReader::VisitOMPParallelMasterTaskLoopSimdDirective(
2683 VisitOMPLoopDirective(
D);
2686void ASTStmtReader::VisitOMPParallelMaskedTaskLoopSimdDirective(
2688 VisitOMPLoopDirective(
D);
2692 VisitOMPLoopDirective(
D);
2697 VisitOMPExecutableDirective(
D);
2700void ASTStmtReader::VisitOMPDistributeParallelForDirective(
2702 VisitOMPLoopDirective(
D);
2703 D->setHasCancel(
Record.readBool());
2706void ASTStmtReader::VisitOMPDistributeParallelForSimdDirective(
2708 VisitOMPLoopDirective(
D);
2711void ASTStmtReader::VisitOMPDistributeSimdDirective(
2713 VisitOMPLoopDirective(
D);
2716void ASTStmtReader::VisitOMPTargetParallelForSimdDirective(
2718 VisitOMPLoopDirective(
D);
2722 VisitOMPLoopDirective(
D);
2725void ASTStmtReader::VisitOMPTeamsDistributeDirective(
2727 VisitOMPLoopDirective(
D);
2730void ASTStmtReader::VisitOMPTeamsDistributeSimdDirective(
2732 VisitOMPLoopDirective(
D);
2735void ASTStmtReader::VisitOMPTeamsDistributeParallelForSimdDirective(
2737 VisitOMPLoopDirective(
D);
2740void ASTStmtReader::VisitOMPTeamsDistributeParallelForDirective(
2742 VisitOMPLoopDirective(
D);
2743 D->setHasCancel(
Record.readBool());
2748 VisitOMPExecutableDirective(
D);
2751void ASTStmtReader::VisitOMPTargetTeamsDistributeDirective(
2753 VisitOMPLoopDirective(
D);
2756void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForDirective(
2758 VisitOMPLoopDirective(
D);
2759 D->setHasCancel(
Record.readBool());
2762void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
2764 VisitOMPLoopDirective(
D);
2767void ASTStmtReader::VisitOMPTargetTeamsDistributeSimdDirective(
2769 VisitOMPLoopDirective(
D);
2774 VisitOMPExecutableDirective(
D);
2779 VisitOMPExecutableDirective(
D);
2780 D->setTargetCallLoc(
Record.readSourceLocation());
2785 VisitOMPExecutableDirective(
D);
2789 VisitOMPLoopDirective(
D);
2792void ASTStmtReader::VisitOMPTeamsGenericLoopDirective(
2794 VisitOMPLoopDirective(
D);
2797void ASTStmtReader::VisitOMPTargetTeamsGenericLoopDirective(
2799 VisitOMPLoopDirective(
D);
2800 D->setCanBeParallelFor(
Record.readBool());
2803void ASTStmtReader::VisitOMPParallelGenericLoopDirective(
2805 VisitOMPLoopDirective(
D);
2808void ASTStmtReader::VisitOMPTargetParallelGenericLoopDirective(
2810 VisitOMPLoopDirective(
D);
2819 S->Range =
Record.readSourceRange();
2820 S->DirectiveLoc =
Record.readSourceLocation();
2821 Record.readOpenACCClauseList(S->Clauses);
2824void ASTStmtReader::VisitOpenACCAssociatedStmtConstruct(
2826 VisitOpenACCConstructStmt(S);
2827 S->setAssociatedStmt(
Record.readSubStmt());
2832 VisitOpenACCAssociatedStmtConstruct(S);
2833 S->findAndSetChildLoops();
2838 VisitOpenACCAssociatedStmtConstruct(S);
2846 switch (ReadingKind) {
2848 llvm_unreachable(
"should not call this when not reading anything");
2851 return ReadStmtFromStream(F);
2856 llvm_unreachable(
"ReadingKind not set ?");
2860 return cast_or_null<Expr>(
ReadStmt(F));
2875 ReadingKindTracker ReadingKind(Read_Stmt, *
this);
2880 llvm::DenseMap<uint64_t, Stmt *> StmtEntries;
2883 unsigned PrevNumStmts = StmtStack.size();
2892 Cursor.advanceSkippingSubblocks();
2894 Error(
toString(MaybeEntry.takeError()));
2897 llvm::BitstreamEntry Entry = MaybeEntry.get();
2899 switch (Entry.Kind) {
2900 case llvm::BitstreamEntry::SubBlock:
2901 case llvm::BitstreamEntry::Error:
2902 Error(
"malformed block record in AST file");
2904 case llvm::BitstreamEntry::EndBlock:
2906 case llvm::BitstreamEntry::Record:
2913 bool Finished =
false;
2914 bool IsStmtReference =
false;
2916 if (!MaybeStmtCode) {
2917 Error(
toString(MaybeStmtCode.takeError()));
2920 switch ((
StmtCode)MaybeStmtCode.get()) {
2926 IsStmtReference =
true;
2927 assert(StmtEntries.contains(
Record[0]) &&
2928 "No stmt was recorded for this offset reference!");
2929 S = StmtEntries[
Record.readInt()];
2969 bool HasElse = IfStmtBits.getNextBit();
2970 bool HasVar = IfStmtBits.getNextBit();
2971 bool HasInit = IfStmtBits.getNextBit();
3053 DeclRefExprBits.advance(5);
3054 bool HasFoundDecl = DeclRefExprBits.getNextBit();
3055 bool HasQualifier = DeclRefExprBits.getNextBit();
3056 bool HasTemplateKWAndArgsInfo = DeclRefExprBits.getNextBit();
3057 unsigned NumTemplateArgs = HasTemplateKWAndArgsInfo
3061 HasTemplateKWAndArgsInfo, NumTemplateArgs);
3106 bool HasFPFeatures = UnaryOperatorBits.getNextBit();
3146 CallExprBits.advance(1);
3147 auto HasFPFeatures = CallExprBits.getNextBit();
3159 bool HasQualifier = ExprMemberBits.getNextBit();
3160 bool HasFoundDecl = ExprMemberBits.getNextBit();
3161 bool HasTemplateInfo = ExprMemberBits.getNextBit();
3164 HasTemplateInfo, NumTemplateArgs);
3170 BinaryOperatorBits.advance( 6);
3171 bool HasFPFeatures = BinaryOperatorBits.getNextBit();
3178 BinaryOperatorBits.advance( 6);
3179 bool HasFPFeatures = BinaryOperatorBits.getNextBit();
3195 CastExprBits.advance(7);
3196 bool HasFPFeatures = CastExprBits.getNextBit();
3204 CastExprBits.advance(7);
3205 bool HasFPFeatures = CastExprBits.getNextBit();
3338 llvm_unreachable(
"mismatching AST file");
3452 CollapsedNum,
Empty);
3472 "Reverse directive accepts only a single loop");
3474 "Reverse directive has no clauses");
3534 CollapsedNum,
Empty);
3542 CollapsedNum,
Empty);
3608 !HasAssociatedStmt,
Empty);
3646 CollapsedNum,
Empty);
3681 CollapsedNum,
Empty);
3689 CollapsedNum,
Empty);
3697 CollapsedNum,
Empty);
3705 CollapsedNum,
Empty);
3713 CollapsedNum,
Empty);
3721 CollapsedNum,
Empty);
3729 CollapsedNum,
Empty);
3737 Context, NumClauses, CollapsedNum,
Empty);
3745 Context, NumClauses, CollapsedNum,
Empty);
3761 CollapsedNum,
Empty);
3778 CollapsedNum,
Empty);
3786 CollapsedNum,
Empty);
3802 CollapsedNum,
Empty);
3810 CollapsedNum,
Empty);
3818 Context, NumClauses, CollapsedNum,
Empty);
3826 Context, NumClauses, CollapsedNum,
Empty);
3839 CollapsedNum,
Empty);
3847 Context, NumClauses, CollapsedNum,
Empty);
3855 Context, NumClauses, CollapsedNum,
Empty);
3863 Context, NumClauses, CollapsedNum,
Empty);
3886 CollapsedNum,
Empty);
3894 CollapsedNum,
Empty);
3902 CollapsedNum,
Empty);
3910 CollapsedNum,
Empty);
3918 Context, NumClauses, CollapsedNum,
Empty);
3931 CallExprBits.advance(1);
3932 auto HasFPFeatures = CallExprBits.getNextBit();
3941 CallExprBits.advance(1);
3942 auto HasFPFeatures = CallExprBits.getNextBit();
3971 CastExprBits.advance(7);
3972 bool HasFPFeatures = CastExprBits.getNextBit();
4000 CastExprBits.advance(7);
4001 bool HasFPFeatures = CastExprBits.getNextBit();
4009 assert(PathSize == 0 &&
"Wrong PathSize!");
4018 CallExprBits.advance(1);
4019 auto HasFPFeatures = CallExprBits.getNextBit();
4113 bool HasTemplateKWAndArgsInfo = DependentScopeMemberBits.getNextBit();
4115 bool HasFirstQualifierFoundInScope =
4116 DependentScopeMemberBits.getNextBit();
4118 Context, HasTemplateKWAndArgsInfo, NumTemplateArgs,
4119 HasFirstQualifierFoundInScope);
4127 bool HasTemplateKWAndArgsInfo = DependentScopeDeclRefBits.getNextBit();
4128 unsigned NumTemplateArgs =
4129 HasTemplateKWAndArgsInfo
4130 ? DependentScopeDeclRefBits.getNextBits(16)
4133 Context, HasTemplateKWAndArgsInfo, NumTemplateArgs);
4145 auto HasTemplateKWAndArgsInfo = OverloadExprBits.getNextBit();
4146 auto NumTemplateArgs = HasTemplateKWAndArgsInfo
4150 Context, NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
4157 auto HasTemplateKWAndArgsInfo = OverloadExprBits.getNextBit();
4158 auto NumTemplateArgs = HasTemplateKWAndArgsInfo
4162 Context, NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
4232 CallExprBits.advance(1);
4233 auto HasFPFeatures = CallExprBits.getNextBit();
4307 ++NumStatementsRead;
4309 if (S && !IsStmtReference) {
4311 StmtEntries[
Cursor.GetCurrentBitNo()] = S;
4315 "Invalid deserialization of statement");
4316 StmtStack.push_back(S);
4319 assert(StmtStack.size() > PrevNumStmts &&
"Read too many sub-stmts!");
4320 assert(StmtStack.size() == PrevNumStmts + 1 &&
"Extra expressions on stack!");
4321 return StmtStack.pop_back_val();
This file provides AST data structures related to concepts.
Defines the clang::ASTContext interface.
static concepts::Requirement::SubstitutionDiagnostic * readSubstitutionDiagnostic(ASTRecordReader &Record)
static ConstraintSatisfaction readConstraintSatisfaction(ASTRecordReader &Record)
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines the C++ template declaration subclasses.
Defines the clang::Expr interface and subclasses for C++ expressions.
Defines enumerations for expression traits intrinsics.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines several types used to describe C++ lambda expressions that are shared between the parser and ...
Defines the clang::LangOptions interface.
llvm::MachO::Record Record
This file defines OpenMP AST classes for clauses.
Defines some OpenMP-specific enums and functions.
Defines an enumeration for C++ overloaded operators.
static std::string toString(const clang::SanitizerSet &Sanitizers)
Produce a string containing comma-separated names of sanitizers in Sanitizers set.
Defines the clang::SourceLocation class and associated facilities.
Defines various enumerations that describe declaration and type specifiers.
Defines the Objective-C statement AST node classes.
This file defines OpenMP AST classes for executable directives and clauses.
Defines enumerations for the type traits support.
C Language Family Type Representation.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
ASTContext & getContext()
Retrieve the AST context that this AST reader supplements.
Stmt * ReadSubStmt()
Reads a sub-statement operand during statement reading.
Expr * ReadSubExpr()
Reads a sub-expression operand during statement reading.
Expr * ReadExpr(ModuleFile &F)
Reads an expression.
Stmt * ReadStmt(ModuleFile &F)
Reads a statement.
An object for streaming information from a record.
static const unsigned NumExprFields
The number of record fields required for the Expr class itself.
static const unsigned NumStmtFields
The number of record fields required for the Stmt class itself.
static const unsigned NumExprBits
The number of bits required for the packing bits for the Expr class.
void ReadTemplateKWAndArgsInfo(ASTTemplateKWAndArgsInfo &Args, TemplateArgumentLoc *ArgsLocArray, unsigned NumTemplateArgs)
Read and initialize a ExplicitTemplateArgumentList structure.
ASTStmtReader(ASTRecordReader &Record, llvm::BitstreamCursor &Cursor)
AddrLabelExpr - The GNU address of label extension, representing &&label.
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Represents a loop initializing the elements of an array.
This class represents BOTH the OpenMP Array Section and OpenACC 'subarray', with a boolean differenti...
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
unsigned getNumSubExprs() const
Represents an attribute applied to a statement.
static AttributedStmt * CreateEmpty(const ASTContext &C, unsigned NumAttrs)
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
A builtin binary operation expression such as "x + y" or "x <= y".
static BinaryOperator * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
A simple helper class to unpack an integer to bits and consuming the bits in order.
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
BreakStmt - This represents a break.
Represents a C++2a __builtin_bit_cast(T, v) expression.
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr....
static CStyleCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize, bool HasFPFeatures)
Represents a call to a CUDA kernel function.
static CUDAKernelCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPFeatures, EmptyShell Empty)
A C++ addrspace_cast expression (currently only enabled for OpenCL).
static CXXAddrspaceCastExpr * CreateEmpty(const ASTContext &Context)
Represents a base class of a C++ class.
Represents binding an expression to a temporary.
A boolean literal, per ([C++ lex.bool] Boolean literals).
CXXCatchStmt - This represents a C++ catch block.
A C++ const_cast expression (C++ [expr.const.cast]).
static CXXConstCastExpr * CreateEmpty(const ASTContext &Context)
Represents a call to a C++ constructor.
static CXXConstructExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs)
Create an empty C++ construction expression.
A default argument (C++ [dcl.fct.default]).
static CXXDefaultArgExpr * CreateEmpty(const ASTContext &C, bool HasRewrittenInit)
A use of a default initializer in a constructor or in aggregate initialization.
static CXXDefaultInitExpr * CreateEmpty(const ASTContext &C, bool HasRewrittenInit)
Represents a delete expression for memory deallocation and destructor calls, e.g.
Represents a C++ member access expression where the actual member referenced could not be resolved be...
static CXXDependentScopeMemberExpr * CreateEmpty(const ASTContext &Ctx, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs, bool HasFirstQualifierFoundInScope)
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
static CXXDynamicCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
Represents a folding of a pack over an operator.
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr....
static CXXFunctionalCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize, bool HasFPFeatures)
Represents a call to an inherited base class constructor from an inheriting constructor.
Represents a call to a member function that may be written either with member call syntax (e....
static CXXMemberCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPFeatures, EmptyShell Empty)
Abstract class common to all of the C++ "named"/"keyword" casts.
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
static CXXNewExpr * CreateEmpty(const ASTContext &Ctx, bool IsArray, bool HasInit, unsigned NumPlacementArgs, bool IsParenTypeId)
Create an empty c++ new expression.
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
The null pointer literal (C++11 [lex.nullptr])
A call to an overloaded operator written using operator syntax.
static CXXOperatorCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPFeatures, EmptyShell Empty)
Represents a list-initialization with parenthesis.
static CXXParenListInitExpr * CreateEmpty(ASTContext &C, unsigned numExprs, EmptyShell Empty)
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
static CXXReinterpretCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
A rewritten comparison expression that was originally written using operator syntax.
An expression "T()" which creates an rvalue of a non-class type T.
A C++ static_cast expression (C++ [expr.static.cast]).
static CXXStaticCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize, bool hasFPFeatures)
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Represents a C++ functional cast expression that builds a temporary object.
static CXXTemporaryObjectExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs)
Represents the this expression in C++.
static CXXThisExpr * CreateEmpty(const ASTContext &Ctx)
A C++ throw-expression (C++ [except.throw]).
CXXTryStmt - A C++ try block, including all handlers.
static CXXTryStmt * Create(const ASTContext &C, SourceLocation tryLoc, CompoundStmt *tryBlock, ArrayRef< Stmt * > handlers)
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
static CXXUnresolvedConstructExpr * CreateEmpty(const ASTContext &Context, unsigned NumArgs)
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
static CallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPFeatures, EmptyShell Empty)
Create an empty call expression, for deserialization.
This captures a statement into a function.
static CapturedStmt * CreateDeserialized(const ASTContext &Context, unsigned NumCaptures)
VariableCaptureKind
The different capture forms: by 'this', by reference, capture for variable-length array type etc.
CaseStmt - Represent a case statement.
static CaseStmt * CreateEmpty(const ASTContext &Ctx, bool CaseStmtIsGNURange)
Build an empty case statement.
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Represents a 'co_await' expression.
CompoundAssignOperator - For compound assignments (e.g.
static CompoundAssignOperator * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
CompoundLiteralExpr - [C99 6.5.2.5].
CompoundStmt - This represents a group of statements like { stmt stmt }.
static CompoundStmt * CreateEmpty(const ASTContext &C, unsigned NumStmts, bool HasFPFeatures)
Represents the specialization of a concept - evaluates to a prvalue of type bool.
ConditionalOperator - The ?: ternary operator.
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
static ConstantExpr * CreateEmpty(const ASTContext &Context, ConstantResultStorageKind StorageKind)
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
std::pair< SourceLocation, StringRef > SubstitutionDiagnostic
llvm::SmallVector< Detail, 4 > Details
The substituted constraint expr, if the template arguments could be substituted into them,...
ContinueStmt - This represents a continue.
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Represents a 'co_return' statement in the C++ Coroutines TS.
Represents the body of a coroutine.
static CoroutineBodyStmt * Create(const ASTContext &C, CtorArgs const &Args)
Represents a 'co_yield' expression.
A POD class for pairing a NamedDecl* with an access specifier.
static DeclAccessPair make(NamedDecl *D, AccessSpecifier AS)
static DeclGroup * Create(ASTContext &C, Decl **Decls, unsigned NumDecls)
A reference to a declared variable, function, enum, etc.
static DeclRefExpr * CreateEmpty(const ASTContext &Context, bool HasQualifier, bool HasFoundDecl, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Construct an empty declaration reference expression.
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
Decl - This represents one declaration (or definition), e.g.
Represents a 'co_await' expression while the type of the promise is dependent.
A qualified reference to a name whose declaration cannot yet be resolved.
static DependentScopeDeclRefExpr * CreateEmpty(const ASTContext &Context, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Represents a single C99 designator.
Represents a C99 designated initializer expression.
static DesignatedInitExpr * CreateEmpty(const ASTContext &C, unsigned NumIndexExprs)
Designator - A designator in a C99 designated initializer.
static Designator CreateArrayRangeDesignator(Expr *Start, Expr *End, SourceLocation LBracketLoc, SourceLocation EllipsisLoc)
Creates a GNU array-range designator.
static Designator CreateArrayDesignator(Expr *Index, SourceLocation LBracketLoc)
Creates an array designator.
static Designator CreateFieldDesignator(const IdentifierInfo *FieldName, SourceLocation DotLoc, SourceLocation FieldLoc)
Creates a field designator.
DoStmt - This represents a 'do/while' stmt.
Represents a reference to #emded data.
ExplicitCastExpr - An explicit cast written in the source code.
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
llvm::PointerUnion< BlockDecl *, CompoundLiteralExpr * > CleanupObject
The type of objects that are kept in the cleanup.
static ExprWithCleanups * Create(const ASTContext &C, EmptyShell empty, unsigned numObjects)
This represents one expression.
bool isValueDependent() const
Determines whether the value of this expression depends on.
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on.
void setValueKind(ExprValueKind Cat)
setValueKind - Set the value kind produced by this expression.
void setObjectKind(ExprObjectKind Cat)
setObjectKind - Set the object kind produced by this expression.
void setDependence(ExprDependence Deps)
Each concrete expr subclass is expected to compute its dependence and call this in the constructor.
An expression trait intrinsic.
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
static FPOptionsOverride getFromOpaqueInt(storage_type I)
static FixedPointLiteral * Create(const ASTContext &C, EmptyShell Empty)
Returns an empty fixed-point literal.
static FloatingLiteral * Create(const ASTContext &C, const llvm::APFloat &V, bool isexact, QualType Type, SourceLocation L)
ForStmt - This represents a 'for (init;cond;inc)' stmt.
Represents a reference to a function parameter pack or init-capture pack that has been substituted bu...
static FunctionParmPackExpr * CreateEmpty(const ASTContext &Context, unsigned NumParams)
This represents a GCC inline-assembly statement extension.
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Represents a C11 generic selection.
static GenericSelectionExpr * CreateEmpty(const ASTContext &Context, unsigned NumAssocs)
Create an empty generic selection expression for deserialization.
GotoStmt - This represents a direct goto.
One of these records is kept for each identifier that is lexed.
IfStmt - This represents an if/then/else.
static IfStmt * CreateEmpty(const ASTContext &Ctx, bool HasElse, bool HasVar, bool HasInit)
Create an empty IfStmt optionally with storage for an else statement, condition variable and init exp...
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1....
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
static ImplicitCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize, bool HasFPFeatures)
Represents an implicitly-generated value initialization of an object of a given type.
IndirectGotoStmt - This represents an indirect goto.
Describes an C or C++ initializer list.
static IntegerLiteral * Create(const ASTContext &C, const llvm::APInt &V, QualType type, SourceLocation l)
Returns a new integer literal with value 'V' and type 'type'.
LabelStmt - Represents a label, which has a substatement.
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
static LambdaExpr * CreateDeserialized(const ASTContext &C, unsigned NumCaptures)
Construct a new lambda expression that will be deserialized from an external source.
This represents a Microsoft inline-assembly statement extension.
Representation of a Microsoft __if_exists or __if_not_exists statement with a dependent name.
A member reference to an MSPropertyDecl.
MS property subscript expression.
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
MatrixSubscriptExpr - Matrix subscript expression for the MatrixType extension.
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
static MemberExpr * CreateEmpty(const ASTContext &Context, bool HasQualifier, bool HasFoundDecl, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
This represents a decl that may have a name.
A C++ nested-name-specifier augmented with source location information.
Represents a place-holder for an object not to be initialized by anything.
NullStmt - This is the null statement ";": C99 6.8.3p3.
An explicit cast in C or a C-style cast in C++, which uses the syntax ([s1][s2]......
static OMPArrayShapingExpr * CreateEmpty(const ASTContext &Context, unsigned NumDims)
static OMPAssumeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
This represents '#pragma omp atomic' directive.
static OMPAtomicDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp barrier' directive.
static OMPBarrierDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
This represents '#pragma omp cancel' directive.
static OMPCancelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
This represents '#pragma omp cancellation point' directive.
static OMPCancellationPointDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Representation of an OpenMP canonical loop.
static OMPCanonicalLoop * createEmpty(const ASTContext &Ctx)
Create an empty OMPCanonicalLoop for deserialization.
This represents '#pragma omp critical' directive.
static OMPCriticalDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
This represents '#pragma omp depobj' directive.
static OMPDepobjDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp dispatch' directive.
static OMPDispatchDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp distribute' directive.
static OMPDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp distribute parallel for' composite directive.
static OMPDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp distribute parallel for simd' composite directive.
static OMPDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.