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;
77 return Record.readSourceLocation();
81 return Record.readSourceRange();
84 std::string readString() {
85 return Record.readString();
89 return Record.readTypeSourceInfo();
93 return Record.readDecl();
98 return Record.readDeclAs<T>();
103 : Record(Record), DeclsCursor(Cursor) {}
116 unsigned NumTemplateArgs);
119#define STMT(Type, Base) \
120 void Visit##Type(Type *);
121#include "clang/AST/StmtNodes.inc"
128 unsigned NumTemplateArgs) {
133 for (
unsigned i = 0; i != NumTemplateArgs; ++i)
142void ASTStmtReader::VisitNullStmt(
NullStmt *S) {
144 S->setSemiLoc(readSourceLocation());
145 S->NullStmtBits.HasLeadingEmptyMacro = Record.
readInt();
151 unsigned NumStmts = Record.
readInt();
152 unsigned HasFPFeatures = Record.
readInt();
153 assert(S->hasStoredFPFeatures() == HasFPFeatures);
158 S->setStoredFPFeatures(
160 S->LBraceLoc = readSourceLocation();
161 S->RBraceLoc = readSourceLocation();
164void ASTStmtReader::VisitSwitchCase(
SwitchCase *S) {
167 S->setKeywordLoc(readSourceLocation());
168 S->setColonLoc(readSourceLocation());
171void ASTStmtReader::VisitCaseStmt(
CaseStmt *S) {
173 bool CaseStmtIsGNURange = Record.
readInt();
176 if (CaseStmtIsGNURange) {
178 S->setEllipsisLoc(readSourceLocation());
182void ASTStmtReader::VisitDefaultStmt(
DefaultStmt *S) {
187void ASTStmtReader::VisitLabelStmt(
LabelStmt *S) {
189 bool IsSideEntry = Record.
readInt();
190 auto *LD = readDeclAs<LabelDecl>();
194 S->setIdentLoc(readSourceLocation());
195 S->setSideEntry(IsSideEntry);
207 assert(NumAttrs == S->AttributedStmtBits.NumAttrs);
208 assert(NumAttrs == Attrs.size());
209 std::copy(Attrs.begin(), Attrs.end(), S->getAttrArrayPtr());
211 S->AttributedStmtBits.AttrLoc = readSourceLocation();
214void ASTStmtReader::VisitIfStmt(
IfStmt *S) {
217 bool HasElse = Record.
readInt();
218 bool HasVar = Record.
readInt();
219 bool HasInit = Record.
readInt();
227 S->setConditionVariableDeclStmt(cast<DeclStmt>(Record.
readSubStmt()));
231 S->setIfLoc(readSourceLocation());
232 S->setLParenLoc(readSourceLocation());
233 S->setRParenLoc(readSourceLocation());
235 S->setElseLoc(readSourceLocation());
238void ASTStmtReader::VisitSwitchStmt(
SwitchStmt *S) {
241 bool HasInit = Record.
readInt();
242 bool HasVar = Record.
readInt();
243 bool AllEnumCasesCovered = Record.
readInt();
244 if (AllEnumCasesCovered)
245 S->setAllEnumCasesCovered();
252 S->setConditionVariableDeclStmt(cast<DeclStmt>(Record.
readSubStmt()));
254 S->setSwitchLoc(readSourceLocation());
255 S->setLParenLoc(readSourceLocation());
256 S->setRParenLoc(readSourceLocation());
259 for (
auto E = Record.
size(); Record.
getIdx() != E; ) {
264 S->setSwitchCaseList(SC);
270void ASTStmtReader::VisitWhileStmt(
WhileStmt *S) {
273 bool HasVar = Record.
readInt();
278 S->setConditionVariableDeclStmt(cast<DeclStmt>(Record.
readSubStmt()));
280 S->setWhileLoc(readSourceLocation());
281 S->setLParenLoc(readSourceLocation());
282 S->setRParenLoc(readSourceLocation());
285void ASTStmtReader::VisitDoStmt(
DoStmt *S) {
289 S->setDoLoc(readSourceLocation());
290 S->setWhileLoc(readSourceLocation());
291 S->setRParenLoc(readSourceLocation());
294void ASTStmtReader::VisitForStmt(
ForStmt *S) {
298 S->setConditionVariableDeclStmt(cast_or_null<DeclStmt>(Record.
readSubStmt()));
301 S->setForLoc(readSourceLocation());
302 S->setLParenLoc(readSourceLocation());
303 S->setRParenLoc(readSourceLocation());
306void ASTStmtReader::VisitGotoStmt(
GotoStmt *S) {
308 S->setLabel(readDeclAs<LabelDecl>());
309 S->setGotoLoc(readSourceLocation());
310 S->setLabelLoc(readSourceLocation());
315 S->setGotoLoc(readSourceLocation());
316 S->setStarLoc(readSourceLocation());
322 S->setContinueLoc(readSourceLocation());
325void ASTStmtReader::VisitBreakStmt(
BreakStmt *S) {
327 S->setBreakLoc(readSourceLocation());
330void ASTStmtReader::VisitReturnStmt(
ReturnStmt *S) {
333 bool HasNRVOCandidate = Record.
readInt();
336 if (HasNRVOCandidate)
337 S->setNRVOCandidate(readDeclAs<VarDecl>());
339 S->setReturnLoc(readSourceLocation());
342void ASTStmtReader::VisitDeclStmt(
DeclStmt *S) {
344 S->setStartLoc(readSourceLocation());
345 S->setEndLoc(readSourceLocation());
354 for (
int I = 0; I < N; ++I)
355 Decls.push_back(readDecl());
362void ASTStmtReader::VisitAsmStmt(
AsmStmt *S) {
364 S->NumOutputs = Record.
readInt();
365 S->NumInputs = Record.
readInt();
366 S->NumClobbers = Record.
readInt();
367 S->setAsmLoc(readSourceLocation());
368 S->setVolatile(Record.
readInt());
369 S->setSimple(Record.
readInt());
372void ASTStmtReader::VisitGCCAsmStmt(
GCCAsmStmt *S) {
374 S->NumLabels = Record.
readInt();
375 S->setRParenLoc(readSourceLocation());
376 S->setAsmString(cast_or_null<StringLiteral>(Record.
readSubStmt()));
378 unsigned NumOutputs = S->getNumOutputs();
379 unsigned NumInputs = S->getNumInputs();
380 unsigned NumClobbers = S->getNumClobbers();
381 unsigned NumLabels = S->getNumLabels();
387 for (
unsigned I = 0, N = NumOutputs + NumInputs; I != N; ++I) {
389 Constraints.push_back(cast_or_null<StringLiteral>(Record.
readSubStmt()));
395 for (
unsigned I = 0; I != NumClobbers; ++I)
396 Clobbers.push_back(cast_or_null<StringLiteral>(Record.
readSubStmt()));
399 for (
unsigned I = 0, N = NumLabels; I != N; ++I) {
404 S->setOutputsAndInputsAndClobbers(Record.
getContext(),
405 Names.data(), Constraints.data(),
406 Exprs.data(), NumOutputs, NumInputs,
408 Clobbers.data(), NumClobbers);
411void ASTStmtReader::VisitMSAsmStmt(
MSAsmStmt *S) {
413 S->LBraceLoc = readSourceLocation();
414 S->EndLoc = readSourceLocation();
415 S->NumAsmToks = Record.
readInt();
416 std::string AsmStr = readString();
420 AsmToks.reserve(S->NumAsmToks);
421 for (
unsigned i = 0, e = S->NumAsmToks; i != e; ++i) {
431 ClobbersData.reserve(S->NumClobbers);
432 Clobbers.reserve(S->NumClobbers);
433 for (
unsigned i = 0, e = S->NumClobbers; i != e; ++i) {
434 ClobbersData.push_back(readString());
435 Clobbers.push_back(ClobbersData.back());
439 unsigned NumOperands = S->NumOutputs + S->NumInputs;
443 Exprs.reserve(NumOperands);
444 ConstraintsData.reserve(NumOperands);
445 Constraints.reserve(NumOperands);
446 for (
unsigned i = 0; i != NumOperands; ++i) {
448 ConstraintsData.push_back(readString());
449 Constraints.push_back(ConstraintsData.back());
452 S->initialize(Record.
getContext(), AsmStr, AsmToks,
453 Constraints, Exprs, Clobbers);
458 assert(Record.
peekInt() == S->NumParams);
460 auto *StoredStmts = S->getStoredStmts();
462 i < CoroutineBodyStmt::SubStmt::FirstParamMove + S->NumParams; ++i)
469 for (
auto &SubStmt: S->SubStmts)
471 S->IsImplicit = Record.
readInt() != 0;
474void ASTStmtReader::VisitCoawaitExpr(
CoawaitExpr *E) {
476 E->KeywordLoc = readSourceLocation();
477 for (
auto &SubExpr: E->SubExprs)
479 E->OpaqueValue = cast_or_null<OpaqueValueExpr>(Record.
readSubStmt());
483void ASTStmtReader::VisitCoyieldExpr(
CoyieldExpr *E) {
485 E->KeywordLoc = readSourceLocation();
486 for (
auto &SubExpr: E->SubExprs)
488 E->OpaqueValue = cast_or_null<OpaqueValueExpr>(Record.
readSubStmt());
493 E->KeywordLoc = readSourceLocation();
494 for (
auto &SubExpr: E->SubExprs)
501 S->setCapturedDecl(readDeclAs<CapturedDecl>());
503 S->setCapturedRecordDecl(readDeclAs<RecordDecl>());
507 E = S->capture_init_end();
513 S->getCapturedDecl()->setBody(S->getCapturedStmt());
516 for (
auto &I : S->captures()) {
517 I.VarAndKind.setPointer(readDeclAs<VarDecl>());
520 I.Loc = readSourceLocation();
524void ASTStmtReader::VisitExpr(
Expr *E) {
531 "Incorrect expression field count");
537 auto StorageKind = Record.
readInt();
538 assert(E->
ConstantExprBits.ResultKind == StorageKind &&
"Wrong ResultKind!");
546 switch (StorageKind) {
551 E->Int64Result() = Record.
readInt();
555 E->APValueResult() = Record.readAPValue();
562 llvm_unreachable(
"unexpected ResultKind!");
571 E->setLocation(readSourceLocation());
572 E->setLParenLocation(readSourceLocation());
573 E->setRParenLocation(readSourceLocation());
580 bool HasFunctionName = Record.
readInt();
586 E->setFunctionName(cast<StringLiteral>(Record.
readSubExpr()));
589void ASTStmtReader::VisitDeclRefExpr(
DeclRefExpr *E) {
599 unsigned NumTemplateArgs = 0;
601 NumTemplateArgs = Record.
readInt();
607 if (E->hasFoundDecl())
608 *E->getTrailingObjects<
NamedDecl *>() = readDeclAs<NamedDecl>();
615 E->D = readDeclAs<ValueDecl>();
636 static_cast<llvm::APFloatBase::Semantics
>(Record.
readInt()));
652 unsigned NumConcatenated = Record.
readInt();
653 unsigned Length = Record.
readInt();
654 unsigned CharByteWidth = Record.
readInt();
656 "Wrong number of concatenated tokens!");
657 assert((Length == E->
getLength()) &&
"Wrong Length!");
658 assert((CharByteWidth == E->
getCharByteWidth()) &&
"Wrong character width!");
665 assert((CharByteWidth ==
668 "Wrong character width!");
671 for (
unsigned I = 0; I < NumConcatenated; ++I)
672 E->setStrTokenLoc(I, readSourceLocation());
675 char *StrData = E->getStrDataAsChar();
676 for (
unsigned I = 0; I < Length * CharByteWidth; ++I)
687void ASTStmtReader::VisitParenExpr(
ParenExpr *E) {
696 unsigned NumExprs = Record.
readInt();
697 assert((NumExprs == E->
getNumExprs()) &&
"Wrong NumExprs!");
698 for (
unsigned I = 0; I != NumExprs; ++I)
700 E->LParenLoc = readSourceLocation();
701 E->RParenLoc = readSourceLocation();
706 bool hasFP_Features = Record.
readInt();
778 unsigned NumDetailRecords = Record.readInt();
779 for (
unsigned i = 0; i != NumDetailRecords; ++i) {
780 Expr *ConstraintExpr = Record.readExpr();
781 if (Record.readInt()) {
783 std::string DiagMessage = Record.readString();
784 Satisfaction.
Details.emplace_back(
785 ConstraintExpr,
new (Record.getContext())
787 DiagLocation, DiagMessage});
789 Satisfaction.
Details.emplace_back(ConstraintExpr, Record.readExpr());
795void ASTStmtReader::VisitConceptSpecializationExpr(
808 std::string SubstitutedEntity = Record.readString();
810 std::string DiagMessage = Record.readString();
811 return new (Record.getContext())
818 unsigned NumLocalParameters = Record.
readInt();
819 unsigned NumRequirements = Record.
readInt();
824 for (
unsigned i = 0; i < NumLocalParameters; ++i)
825 LocalParameters.push_back(cast<ParmVarDecl>(Record.
readDecl()));
826 std::copy(LocalParameters.begin(), LocalParameters.end(),
829 for (
unsigned i = 0; i < NumRequirements; ++i) {
857 std::optional<concepts::ExprRequirement::ReturnTypeRequirement> Req;
874 SubstitutedConstraintExpr =
875 cast<ConceptSpecializationExpr>(Record.
readExpr());
884 if (
Expr *Ex = E.dyn_cast<
Expr *>())
887 std::move(*Req), Status, SubstitutedConstraintExpr);
895 bool HasInvalidConstraint = Record.
readInt();
896 if (HasInvalidConstraint) {
897 std::string InvalidConstraint = Record.
readString();
898 char *InvalidConstraintBuf =
899 new (Record.
getContext())
char[InvalidConstraint.size()];
900 std::copy(InvalidConstraint.begin(), InvalidConstraint.end(),
901 InvalidConstraintBuf);
904 StringRef(InvalidConstraintBuf, InvalidConstraint.size()),
919 Requirements.push_back(R);
921 std::copy(Requirements.begin(), Requirements.end(),
956 unsigned NumDims = Record.
readInt();
959 for (
unsigned I = 0; I < NumDims; ++I)
961 E->setDimensions(Dims);
963 for (
unsigned I = 0; I < NumDims; ++I)
964 SRs[I] = readSourceRange();
965 E->setBracketsRanges(SRs);
972 unsigned NumIters = Record.
readInt();
976 for (
unsigned I = 0; I < NumIters; ++I) {
977 E->setIteratorDeclaration(I, Record.
readDeclRef());
978 E->setAssignmentLoc(I, readSourceLocation());
985 SecColonLoc = readSourceLocation();
986 E->setIteratorRange(I,
Begin, ColonLoc, End, SecColonLoc, Step);
997void ASTStmtReader::VisitCallExpr(
CallExpr *E) {
999 unsigned NumArgs = Record.
readInt();
1000 bool HasFPFeatures = Record.
readInt();
1001 assert((NumArgs == E->
getNumArgs()) &&
"Wrong NumArgs!");
1004 for (
unsigned I = 0; I != NumArgs; ++I)
1016void ASTStmtReader::VisitMemberExpr(
MemberExpr *E) {
1019 bool HasQualifier = Record.
readInt();
1020 bool HasFoundDecl = Record.
readInt();
1021 bool HasTemplateInfo = Record.
readInt();
1022 unsigned NumTemplateArgs = Record.
readInt();
1029 E->
MemberExprBits.HasQualifierOrFoundDecl = HasQualifier || HasFoundDecl;
1035 if (HasQualifier || HasFoundDecl) {
1054 if (HasTemplateInfo)
1060void ASTStmtReader::VisitObjCIsaExpr(
ObjCIsaExpr *E) {
1072 E->setShouldCopy(Record.
readInt());
1076 VisitExplicitCastExpr(E);
1077 E->LParenLoc = readSourceLocation();
1078 E->BridgeKeywordLoc = readSourceLocation();
1082void ASTStmtReader::VisitCastExpr(
CastExpr *E) {
1084 unsigned NumBaseSpecs = Record.
readInt();
1086 unsigned HasFPFeatures = Record.
readInt();
1091 while (NumBaseSpecs--) {
1094 *BaseI++ = BaseSpec;
1102 bool hasFP_Features;
1115 VisitBinaryOperator(E);
1122 E->SubExprs[ConditionalOperator::COND] = Record.
readSubExpr();
1123 E->SubExprs[ConditionalOperator::LHS] = Record.
readSubExpr();
1124 E->SubExprs[ConditionalOperator::RHS] = Record.
readSubExpr();
1125 E->QuestionLoc = readSourceLocation();
1126 E->ColonLoc = readSourceLocation();
1132 E->OpaqueValue = cast<OpaqueValueExpr>(Record.
readSubExpr());
1133 E->SubExprs[BinaryConditionalOperator::COMMON] = Record.
readSubExpr();
1134 E->SubExprs[BinaryConditionalOperator::COND] = Record.
readSubExpr();
1135 E->SubExprs[BinaryConditionalOperator::LHS] = Record.
readSubExpr();
1136 E->SubExprs[BinaryConditionalOperator::RHS] = Record.
readSubExpr();
1137 E->QuestionLoc = readSourceLocation();
1138 E->ColonLoc = readSourceLocation();
1152 VisitExplicitCastExpr(E);
1172void ASTStmtReader::VisitInitListExpr(
InitListExpr *E) {
1174 if (
auto *SyntForm = cast_or_null<InitListExpr>(Record.
readSubStmt()))
1178 bool isArrayFiller = Record.
readInt();
1179 Expr *filler =
nullptr;
1180 if (isArrayFiller) {
1182 E->ArrayFillerOrUnionFieldInit = filler;
1184 E->ArrayFillerOrUnionFieldInit = readDeclAs<FieldDecl>();
1186 unsigned NumInits = Record.
readInt();
1188 if (isArrayFiller) {
1189 for (
unsigned I = 0; I != NumInits; ++I) {
1194 for (
unsigned I = 0; I != NumInits; ++I)
1203 unsigned NumSubExprs = Record.
readInt();
1204 assert(NumSubExprs == E->
getNumSubExprs() &&
"Wrong number of subexprs");
1205 for (
unsigned I = 0; I != NumSubExprs; ++I)
1214 auto *
Field = readDeclAs<FieldDecl>();
1218 Field->getIdentifier(), DotLoc, FieldLoc));
1219 Designators.back().setFieldDecl(Field);
1233 unsigned Index = Record.
readInt();
1243 unsigned Index = Record.
readInt();
1248 Index, LBracketLoc, EllipsisLoc, RBracketLoc));
1254 Designators.data(), Designators.size());
1263void ASTStmtReader::VisitNoInitExpr(
NoInitExpr *E) {
1281void ASTStmtReader::VisitVAArgExpr(
VAArgExpr *E) {
1292 E->ParentContext = readDeclAs<DeclContext>();
1293 E->BuiltinLoc = readSourceLocation();
1294 E->RParenLoc = readSourceLocation();
1303 E->
setLabel(readDeclAs<LabelDecl>());
1306void ASTStmtReader::VisitStmtExpr(
StmtExpr *E) {
1314void ASTStmtReader::VisitChooseExpr(
ChooseExpr *E) {
1324void ASTStmtReader::VisitGNUNullExpr(
GNUNullExpr *E) {
1332 unsigned NumExprs = Record.
readInt();
1342 E->BuiltinLoc = readSourceLocation();
1343 E->RParenLoc = readSourceLocation();
1344 E->TInfo = readTypeSourceInfo();
1348void ASTStmtReader::VisitBlockExpr(
BlockExpr *E) {
1356 unsigned NumAssocs = Record.
readInt();
1357 assert(NumAssocs == E->
getNumAssocs() &&
"Wrong NumAssocs!");
1358 E->IsExprPredicate = Record.
readInt();
1359 E->ResultIndex = Record.
readInt();
1361 E->DefaultLoc = readSourceLocation();
1362 E->RParenLoc = readSourceLocation();
1364 Stmt **Stmts = E->getTrailingObjects<
Stmt *>();
1368 for (
unsigned I = 0, N = NumAssocs + 1; I < N; ++I)
1372 for (
unsigned I = 0, N = NumAssocs; I < N; ++I)
1373 TSIs[I] = readTypeSourceInfo();
1378 unsigned numSemanticExprs = Record.
readInt();
1386 for (
unsigned i = 0; i != numSemanticExprs; ++i) {
1388 E->getSubExprsBuffer()[i+1] = subExpr;
1392void ASTStmtReader::VisitAtomicExpr(
AtomicExpr *E) {
1396 for (
unsigned I = 0; I != E->NumSubExprs; ++I)
1398 E->BuiltinLoc = readSourceLocation();
1399 E->RParenLoc = readSourceLocation();
1415 E->BoxingMethod = readDeclAs<ObjCMethodDecl>();
1416 E->Range = readSourceRange();
1421 unsigned NumElements = Record.
readInt();
1422 assert(NumElements == E->
getNumElements() &&
"Wrong number of elements");
1424 for (
unsigned I = 0, N = NumElements; I != N; ++I)
1426 E->ArrayWithObjectsMethod = readDeclAs<ObjCMethodDecl>();
1427 E->Range = readSourceRange();
1432 unsigned NumElements = Record.
readInt();
1433 assert(NumElements == E->
getNumElements() &&
"Wrong number of elements");
1434 bool HasPackExpansions = Record.
readInt();
1435 assert(HasPackExpansions == E->HasPackExpansions &&
"Pack expansion mismatch");
1440 for (
unsigned I = 0; I != NumElements; ++I) {
1443 if (HasPackExpansions) {
1444 Expansions[I].EllipsisLoc = readSourceLocation();
1445 Expansions[I].NumExpansionsPlusOne = Record.
readInt();
1448 E->DictWithObjectsMethod = readDeclAs<ObjCMethodDecl>();
1449 E->Range = readSourceRange();
1470 E->ProtoLoc = readSourceLocation();
1476 E->
setDecl(readDeclAs<ObjCIvarDecl>());
1486 unsigned MethodRefFlags = Record.
readInt();
1489 auto *Getter = readDeclAs<ObjCMethodDecl>();
1490 auto *Setter = readDeclAs<ObjCMethodDecl>();
1491 E->setImplicitProperty(Getter, Setter, MethodRefFlags);
1493 E->setExplicitProperty(readDeclAs<ObjCPropertyDecl>(), MethodRefFlags);
1495 E->setLocation(readSourceLocation());
1496 E->setReceiverLocation(readSourceLocation());
1502 E->setSuperReceiver(Record.
readType());
1505 E->setClassReceiver(readDeclAs<ObjCInterfaceDecl>());
1515 E->GetAtIndexMethodDecl = readDeclAs<ObjCMethodDecl>();
1516 E->SetAtIndexMethodDecl = readDeclAs<ObjCMethodDecl>();
1523 unsigned NumStoredSelLocs = Record.
readInt();
1524 E->SelLocsKind = Record.
readInt();
1526 E->IsImplicit = Record.
readInt();
1553 E->LBracLoc = readSourceLocation();
1554 E->RBracLoc = readSourceLocation();
1556 for (
unsigned I = 0, N = E->
getNumArgs(); I != N; ++I)
1560 for (
unsigned I = 0; I != NumStoredSelLocs; ++I)
1561 Locs[I] = readSourceLocation();
1569 S->setForLoc(readSourceLocation());
1570 S->setRParenLoc(readSourceLocation());
1576 S->setCatchParamDecl(readDeclAs<VarDecl>());
1577 S->setAtCatchLoc(readSourceLocation());
1578 S->setRParenLoc(readSourceLocation());
1584 S->setAtFinallyLoc(readSourceLocation());
1590 S->setAtLoc(readSourceLocation());
1595 assert(Record.
peekInt() == S->getNumCatchStmts());
1597 bool HasFinally = Record.
readInt();
1599 for (
unsigned I = 0, N = S->getNumCatchStmts(); I != N; ++I)
1600 S->setCatchStmt(I, cast_or_null<ObjCAtCatchStmt>(Record.
readSubStmt()));
1604 S->setAtTryLoc(readSourceLocation());
1611 S->setAtSynchronizedLoc(readSourceLocation());
1617 S->setThrowLoc(readSourceLocation());
1638void ASTStmtReader::VisitCXXCatchStmt(
CXXCatchStmt *S) {
1640 S->CatchLoc = readSourceLocation();
1641 S->ExceptionDecl = readDeclAs<VarDecl>();
1645void ASTStmtReader::VisitCXXTryStmt(
CXXTryStmt *S) {
1647 assert(Record.
peekInt() == S->getNumHandlers() &&
"NumStmtFields is wrong ?");
1649 S->TryLoc = readSourceLocation();
1651 for (
unsigned i = 0, e = S->getNumHandlers(); i != e; ++i)
1657 S->ForLoc = readSourceLocation();
1658 S->CoawaitLoc = readSourceLocation();
1659 S->ColonLoc = readSourceLocation();
1660 S->RParenLoc = readSourceLocation();
1673 S->KeywordLoc = readSourceLocation();
1674 S->IsIfExists = Record.
readInt();
1686void ASTStmtReader::VisitCXXRewrittenBinaryOperator(
1696 unsigned NumArgs = Record.
readInt();
1697 assert((NumArgs == E->
getNumArgs()) &&
"Wrong NumArgs!");
1707 E->Constructor = readDeclAs<CXXConstructorDecl>();
1708 E->ParenOrBraceRange = readSourceRange();
1710 for (
unsigned I = 0; I != NumArgs; ++I)
1716 E->Constructor = readDeclAs<CXXConstructorDecl>();
1717 E->Loc = readSourceLocation();
1718 E->ConstructsVirtualBase = Record.
readInt();
1719 E->InheritedFromVirtualBase = Record.
readInt();
1723 VisitCXXConstructExpr(E);
1724 E->TSI = readTypeSourceInfo();
1727void ASTStmtReader::VisitLambdaExpr(
LambdaExpr *E) {
1729 unsigned NumCaptures = Record.
readInt();
1732 E->IntroducerRange = readSourceRange();
1734 E->CaptureDefaultLoc = readSourceLocation();
1737 E->ClosingBrace = readSourceLocation();
1756 VisitExplicitCastExpr(E);
1759 E->RParenLoc = R.
getEnd();
1760 R = readSourceRange();
1761 E->AngleBrackets = R;
1765 return VisitCXXNamedCastExpr(E);
1769 return VisitCXXNamedCastExpr(E);
1773 return VisitCXXNamedCastExpr(E);
1777 return VisitCXXNamedCastExpr(E);
1781 return VisitCXXNamedCastExpr(E);
1785 VisitExplicitCastExpr(E);
1791 VisitExplicitCastExpr(E);
1792 E->KWLoc = readSourceLocation();
1793 E->RParenLoc = readSourceLocation();
1798 E->UDSuffixLoc = readSourceLocation();
1816 E->Operand = readTypeSourceInfo();
1821void ASTStmtReader::VisitCXXThisExpr(
CXXThisExpr *E) {
1827void ASTStmtReader::VisitCXXThrowExpr(
CXXThrowExpr *E) {
1836 E->Param = readDeclAs<ParmVarDecl>();
1837 E->UsedContext = readDeclAs<DeclContext>();
1847 E->Field = readDeclAs<FieldDecl>();
1848 E->UsedContext = readDeclAs<DeclContext>();
1862 E->TypeInfo = readTypeSourceInfo();
1866void ASTStmtReader::VisitCXXNewExpr(
CXXNewExpr *E) {
1869 bool IsArray = Record.
readInt();
1870 bool HasInit = Record.
readInt();
1871 unsigned NumPlacementArgs = Record.
readInt();
1872 bool IsParenTypeId = Record.
readInt();
1879 assert((IsArray == E->
isArray()) &&
"Wrong IsArray!");
1882 "Wrong NumPlacementArgs!");
1883 assert((IsParenTypeId == E->
isParenTypeId()) &&
"Wrong IsParenTypeId!");
1886 (void)NumPlacementArgs;
1890 E->AllocatedTypeInfo = readTypeSourceInfo();
1892 E->getTrailingObjects<
SourceRange>()[0] = readSourceRange();
1893 E->Range = readSourceRange();
1894 E->DirectInitRange = readSourceRange();
1909 E->OperatorDelete = readDeclAs<FunctionDecl>();
1918 E->IsArrow = Record.
readInt();
1919 E->OperatorLoc = readSourceLocation();
1921 E->ScopeType = readTypeSourceInfo();
1922 E->ColonColonLoc = readSourceLocation();
1923 E->TildeLoc = readSourceLocation();
1935 unsigned NumObjects = Record.
readInt();
1937 for (
unsigned i = 0; i != NumObjects; ++i) {
1941 Obj = readDeclAs<BlockDecl>();
1943 Obj = cast<CompoundLiteralExpr>(Record.
readSubExpr());
1945 llvm_unreachable(
"unexpected cleanup object type");
1953void ASTStmtReader::VisitCXXDependentScopeMemberExpr(
1957 bool HasTemplateKWAndArgsInfo = Record.
readInt();
1958 unsigned NumTemplateArgs = Record.
readInt();
1959 bool HasFirstQualifierFoundInScope = Record.
readInt();
1961 assert((HasTemplateKWAndArgsInfo == E->hasTemplateKWAndArgsInfo()) &&
1962 "Wrong HasTemplateKWAndArgsInfo!");
1964 (HasFirstQualifierFoundInScope == E->hasFirstQualifierFoundInScope()) &&
1965 "Wrong HasFirstQualifierFoundInScope!");
1967 if (HasTemplateKWAndArgsInfo)
1973 "Wrong NumTemplateArgs!");
1981 if (HasFirstQualifierFoundInScope)
1982 *E->getTrailingObjects<
NamedDecl *>() = readDeclAs<NamedDecl>();
2005 "Read wrong record during creation ?");
2007 for (
unsigned I = 0, N = E->
getNumArgs(); I != N; ++I)
2009 E->TypeAndInitForm.setPointer(readTypeSourceInfo());
2012 E->TypeAndInitForm.setInt(Record.
readInt());
2015void ASTStmtReader::VisitOverloadExpr(
OverloadExpr *E) {
2018 unsigned NumResults = Record.
readInt();
2019 bool HasTemplateKWAndArgsInfo = Record.
readInt();
2020 assert((E->
getNumDecls() == NumResults) &&
"Wrong NumResults!");
2022 "Wrong HasTemplateKWAndArgsInfo!");
2024 if (HasTemplateKWAndArgsInfo) {
2025 unsigned NumTemplateArgs = Record.
readInt();
2030 "Wrong NumTemplateArgs!");
2034 for (
unsigned I = 0; I != NumResults; ++I) {
2035 auto *D = readDeclAs<NamedDecl>();
2042 for (
unsigned I = 0; I != NumResults; ++I) {
2043 Results[I] = (
Iter + I).getPair();
2051 VisitOverloadExpr(E);
2056 E->OperatorLoc = readSourceLocation();
2060 VisitOverloadExpr(E);
2063 E->NamingClass = readDeclAs<CXXRecordDecl>();
2072 E->Loc =
Range.getBegin();
2073 E->RParenLoc =
Range.getEnd();
2076 for (
unsigned I = 0, N = E->
getNumArgs(); I != N; ++I)
2077 Args[I] = readTypeSourceInfo();
2085 E->Loc =
Range.getBegin();
2086 E->RParen =
Range.getEnd();
2087 E->QueriedType = readTypeSourceInfo();
2097 E->Loc =
Range.getBegin();
2098 E->RParen =
Range.getEnd();
2104 E->Range = readSourceRange();
2110 E->EllipsisLoc = readSourceLocation();
2111 E->NumExpansions = Record.
readInt();
2117 unsigned NumPartialArgs = Record.
readInt();
2118 E->OperatorLoc = readSourceLocation();
2119 E->PackLoc = readSourceLocation();
2120 E->RParenLoc = readSourceLocation();
2123 assert(E->Length == NumPartialArgs);
2125 *E = I + NumPartialArgs;
2133void ASTStmtReader::VisitSubstNonTypeTemplateParmExpr(
2136 E->AssociatedDeclAndRef.setPointer(readDeclAs<Decl>());
2137 E->AssociatedDeclAndRef.setInt(Record.
readInt());
2139 E->PackIndex = Record.
readInt();
2144void ASTStmtReader::VisitSubstNonTypeTemplateParmPackExpr(
2147 E->AssociatedDecl = readDeclAs<Decl>();
2155 E->NameLoc = readSourceLocation();
2160 E->NumParameters = Record.
readInt();
2161 E->ParamPack = readDeclAs<ParmVarDecl>();
2162 E->NameLoc = readSourceLocation();
2163 auto **Parms = E->getTrailingObjects<
VarDecl *>();
2164 for (
unsigned i = 0, n = E->NumParameters; i != n; ++i)
2165 Parms[i] = readDeclAs<VarDecl>();
2170 bool HasMaterialzedDecl = Record.
readInt();
2171 if (HasMaterialzedDecl)
2172 E->State = cast<LifetimeExtendedTemporaryDecl>(Record.
readDecl());
2177void ASTStmtReader::VisitCXXFoldExpr(
CXXFoldExpr *E) {
2179 E->LParenLoc = readSourceLocation();
2180 E->EllipsisLoc = readSourceLocation();
2181 E->RParenLoc = readSourceLocation();
2182 E->NumExpansions = Record.
readInt();
2191 unsigned ExpectedNumExprs = Record.
readInt();
2192 assert(E->NumExprs == ExpectedNumExprs &&
2193 "expected number of expressions does not equal the actual number of "
2194 "serialized expressions.");
2195 E->NumUserSpecifiedExprs = Record.
readInt();
2196 E->InitLoc = readSourceLocation();
2197 E->LParenLoc = readSourceLocation();
2198 E->RParenLoc = readSourceLocation();
2199 for (
unsigned I = 0; I < ExpectedNumExprs; I++)
2202 bool HasArrayFillerOrUnionDecl = Record.
readBool();
2203 if (HasArrayFillerOrUnionDecl) {
2204 bool HasArrayFiller = Record.
readBool();
2205 if (HasArrayFiller) {
2221void ASTStmtReader::VisitTypoExpr(
TypoExpr *E) {
2222 llvm_unreachable(
"Cannot read TypoExpr nodes");
2225void ASTStmtReader::VisitRecoveryExpr(
RecoveryExpr *E) {
2227 unsigned NumArgs = Record.
readInt();
2228 E->BeginLoc = readSourceLocation();
2229 E->EndLoc = readSourceLocation();
2230 assert((NumArgs + 0LL ==
2243 E->IsArrow = (Record.
readInt() != 0);
2246 E->MemberLoc = readSourceLocation();
2247 E->TheDecl = readDeclAs<MSPropertyDecl>();
2260 E->Guid = readDeclAs<MSGuidDecl>();
2262 E->Operand = readTypeSourceInfo();
2267void ASTStmtReader::VisitSEHLeaveStmt(
SEHLeaveStmt *S) {
2269 S->setLeaveLoc(readSourceLocation());
2274 S->Loc = readSourceLocation();
2275 S->Children[SEHExceptStmt::FILTER_EXPR] = Record.
readSubStmt();
2276 S->Children[SEHExceptStmt::BLOCK] = Record.
readSubStmt();
2281 S->Loc = readSourceLocation();
2285void ASTStmtReader::VisitSEHTryStmt(
SEHTryStmt *S) {
2287 S->IsCXXTry = Record.
readInt();
2288 S->TryLoc = readSourceLocation();
2289 S->Children[SEHTryStmt::TRY] = Record.
readSubStmt();
2290 S->Children[SEHTryStmt::HANDLER] = Record.
readSubStmt();
2305void ASTStmtReader::VisitAsTypeExpr(
AsTypeExpr *E) {
2307 E->BuiltinLoc = readSourceLocation();
2308 E->RParenLoc = readSourceLocation();
2318 for (
Stmt *&SubStmt : S->SubStmts)
2333 VisitOMPExecutableDirective(D);
2337 VisitOMPLoopBasedDirective(D);
2344 VisitOMPExecutableDirective(D);
2349 VisitOMPExecutableDirective(D);
2350 D->setHasCancel(Record.
readBool());
2354 VisitOMPLoopDirective(D);
2357void ASTStmtReader::VisitOMPLoopTransformationDirective(
2359 VisitOMPLoopBasedDirective(D);
2364 VisitOMPLoopTransformationDirective(D);
2368 VisitOMPLoopTransformationDirective(D);
2372 VisitOMPLoopDirective(D);
2373 D->setHasCancel(Record.
readBool());
2377 VisitOMPLoopDirective(D);
2382 VisitOMPExecutableDirective(D);
2383 D->setHasCancel(Record.
readBool());
2388 VisitOMPExecutableDirective(D);
2394 VisitOMPExecutableDirective(D);
2399 VisitOMPExecutableDirective(D);
2404 VisitOMPExecutableDirective(D);
2409 VisitOMPExecutableDirective(D);
2414 VisitOMPLoopDirective(D);
2415 D->setHasCancel(Record.
readBool());
2418void ASTStmtReader::VisitOMPParallelForSimdDirective(
2420 VisitOMPLoopDirective(D);
2423void ASTStmtReader::VisitOMPParallelMasterDirective(
2426 VisitOMPExecutableDirective(D);
2429void ASTStmtReader::VisitOMPParallelMaskedDirective(
2432 VisitOMPExecutableDirective(D);
2435void ASTStmtReader::VisitOMPParallelSectionsDirective(
2438 VisitOMPExecutableDirective(D);
2439 D->setHasCancel(Record.
readBool());
2444 VisitOMPExecutableDirective(D);
2445 D->setHasCancel(Record.
readBool());
2450 VisitOMPExecutableDirective(D);
2455 VisitOMPExecutableDirective(D);
2462 VisitOMPExecutableDirective(D);
2469 VisitOMPExecutableDirective(D);
2474 VisitOMPExecutableDirective(D);
2479 VisitOMPExecutableDirective(D);
2484 VisitOMPExecutableDirective(D);
2489 VisitOMPExecutableDirective(D);
2494 VisitOMPExecutableDirective(D);
2499 VisitOMPExecutableDirective(D);
2500 D->Flags.IsXLHSInRHSPart = Record.
readBool() ? 1 : 0;
2501 D->Flags.IsPostfixUpdate = Record.
readBool() ? 1 : 0;
2502 D->Flags.IsFailOnly = Record.
readBool() ? 1 : 0;
2507 VisitOMPExecutableDirective(D);
2512 VisitOMPExecutableDirective(D);
2515void ASTStmtReader::VisitOMPTargetEnterDataDirective(
2518 VisitOMPExecutableDirective(D);
2521void ASTStmtReader::VisitOMPTargetExitDataDirective(
2524 VisitOMPExecutableDirective(D);
2527void ASTStmtReader::VisitOMPTargetParallelDirective(
2530 VisitOMPExecutableDirective(D);
2531 D->setHasCancel(Record.
readBool());
2534void ASTStmtReader::VisitOMPTargetParallelForDirective(
2536 VisitOMPLoopDirective(D);
2537 D->setHasCancel(Record.
readBool());
2542 VisitOMPExecutableDirective(D);
2545void ASTStmtReader::VisitOMPCancellationPointDirective(
2548 VisitOMPExecutableDirective(D);
2554 VisitOMPExecutableDirective(D);
2559 VisitOMPLoopDirective(D);
2560 D->setHasCancel(Record.
readBool());
2564 VisitOMPLoopDirective(D);
2567void ASTStmtReader::VisitOMPMasterTaskLoopDirective(
2569 VisitOMPLoopDirective(D);
2570 D->setHasCancel(Record.
readBool());
2573void ASTStmtReader::VisitOMPMaskedTaskLoopDirective(
2575 VisitOMPLoopDirective(D);
2576 D->setHasCancel(Record.
readBool());
2579void ASTStmtReader::VisitOMPMasterTaskLoopSimdDirective(
2581 VisitOMPLoopDirective(D);
2584void ASTStmtReader::VisitOMPMaskedTaskLoopSimdDirective(
2586 VisitOMPLoopDirective(D);
2589void ASTStmtReader::VisitOMPParallelMasterTaskLoopDirective(
2591 VisitOMPLoopDirective(D);
2592 D->setHasCancel(Record.
readBool());
2595void ASTStmtReader::VisitOMPParallelMaskedTaskLoopDirective(
2597 VisitOMPLoopDirective(D);
2598 D->setHasCancel(Record.
readBool());
2601void ASTStmtReader::VisitOMPParallelMasterTaskLoopSimdDirective(
2603 VisitOMPLoopDirective(D);
2606void ASTStmtReader::VisitOMPParallelMaskedTaskLoopSimdDirective(
2608 VisitOMPLoopDirective(D);
2612 VisitOMPLoopDirective(D);
2617 VisitOMPExecutableDirective(D);
2620void ASTStmtReader::VisitOMPDistributeParallelForDirective(
2622 VisitOMPLoopDirective(D);
2623 D->setHasCancel(Record.
readBool());
2626void ASTStmtReader::VisitOMPDistributeParallelForSimdDirective(
2628 VisitOMPLoopDirective(D);
2631void ASTStmtReader::VisitOMPDistributeSimdDirective(
2633 VisitOMPLoopDirective(D);
2636void ASTStmtReader::VisitOMPTargetParallelForSimdDirective(
2638 VisitOMPLoopDirective(D);
2642 VisitOMPLoopDirective(D);
2645void ASTStmtReader::VisitOMPTeamsDistributeDirective(
2647 VisitOMPLoopDirective(D);
2650void ASTStmtReader::VisitOMPTeamsDistributeSimdDirective(
2652 VisitOMPLoopDirective(D);
2655void ASTStmtReader::VisitOMPTeamsDistributeParallelForSimdDirective(
2657 VisitOMPLoopDirective(D);
2660void ASTStmtReader::VisitOMPTeamsDistributeParallelForDirective(
2662 VisitOMPLoopDirective(D);
2663 D->setHasCancel(Record.
readBool());
2668 VisitOMPExecutableDirective(D);
2671void ASTStmtReader::VisitOMPTargetTeamsDistributeDirective(
2673 VisitOMPLoopDirective(D);
2676void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForDirective(
2678 VisitOMPLoopDirective(D);
2679 D->setHasCancel(Record.
readBool());
2682void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
2684 VisitOMPLoopDirective(D);
2687void ASTStmtReader::VisitOMPTargetTeamsDistributeSimdDirective(
2689 VisitOMPLoopDirective(D);
2694 VisitOMPExecutableDirective(D);
2699 VisitOMPExecutableDirective(D);
2705 VisitOMPExecutableDirective(D);
2709 VisitOMPLoopDirective(D);
2712void ASTStmtReader::VisitOMPTeamsGenericLoopDirective(
2714 VisitOMPLoopDirective(D);
2717void ASTStmtReader::VisitOMPTargetTeamsGenericLoopDirective(
2719 VisitOMPLoopDirective(D);
2722void ASTStmtReader::VisitOMPParallelGenericLoopDirective(
2724 VisitOMPLoopDirective(D);
2727void ASTStmtReader::VisitOMPTargetParallelGenericLoopDirective(
2729 VisitOMPLoopDirective(D);
2737 switch (ReadingKind) {
2739 llvm_unreachable(
"should not call this when not reading anything");
2742 return ReadStmtFromStream(F);
2747 llvm_unreachable(
"ReadingKind not set ?");
2751 return cast_or_null<Expr>(
ReadStmt(F));
2766 ReadingKindTracker ReadingKind(Read_Stmt, *
this);
2771 llvm::DenseMap<uint64_t, Stmt *> StmtEntries;
2774 unsigned PrevNumStmts = StmtStack.size();
2783 Cursor.advanceSkippingSubblocks();
2785 Error(
toString(MaybeEntry.takeError()));
2788 llvm::BitstreamEntry Entry = MaybeEntry.get();
2790 switch (Entry.Kind) {
2791 case llvm::BitstreamEntry::SubBlock:
2792 case llvm::BitstreamEntry::Error:
2793 Error(
"malformed block record in AST file");
2795 case llvm::BitstreamEntry::EndBlock:
2797 case llvm::BitstreamEntry::Record:
2804 bool Finished =
false;
2805 bool IsStmtReference =
false;
2807 if (!MaybeStmtCode) {
2808 Error(
toString(MaybeStmtCode.takeError()));
2811 switch ((
StmtCode)MaybeStmtCode.get()) {
2817 IsStmtReference =
true;
2818 assert(StmtEntries.contains(Record[0]) &&
2819 "No stmt was recorded for this offset reference!");
2820 S = StmtEntries[
Record.readInt()];
2879 S =
new (Context)
DoStmt(Empty);
2883 S =
new (Context)
ForStmt(Empty);
3201 llvm_unreachable(
"mismatching AST file");
3315 CollapsedNum, Empty);
3381 CollapsedNum, Empty);
3389 CollapsedNum, Empty);
3455 !HasAssociatedStmt, Empty);
3493 CollapsedNum, Empty);
3528 CollapsedNum, Empty);
3536 CollapsedNum, Empty);
3544 CollapsedNum, Empty);
3552 CollapsedNum, Empty);
3560 CollapsedNum, Empty);
3568 CollapsedNum, Empty);
3576 CollapsedNum, Empty);
3584 Context, NumClauses, CollapsedNum, Empty);
3592 Context, NumClauses, CollapsedNum, Empty);
3608 CollapsedNum, Empty);
3625 CollapsedNum, Empty);
3633 CollapsedNum, Empty);
3649 CollapsedNum, Empty);
3657 CollapsedNum, Empty);
3665 Context, NumClauses, CollapsedNum, Empty);
3673 Context, NumClauses, CollapsedNum, Empty);
3686 CollapsedNum, Empty);
3694 Context, NumClauses, CollapsedNum, Empty);
3702 Context, NumClauses, CollapsedNum, Empty);
3710 Context, NumClauses, CollapsedNum, Empty);
3733 CollapsedNum, Empty);
3741 CollapsedNum, Empty);
3749 CollapsedNum, Empty);
3757 CollapsedNum, Empty);
3765 Context, NumClauses, CollapsedNum, Empty);
4094 ++NumStatementsRead;
4096 if (S && !IsStmtReference) {
4098 StmtEntries[
Cursor.GetCurrentBitNo()] = S;
4102 "Invalid deserialization of statement");
4103 StmtStack.push_back(S);
4106 assert(StmtStack.size() > PrevNumStmts &&
"Read too many sub-stmts!");
4107 assert(StmtStack.size() == PrevNumStmts + 1 &&
"Extra expressions on stack!");
4108 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.
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.
void setValue(const ASTContext &C, const llvm::APInt &Val)
bool needsCleanup() const
Returns whether the object performed allocations.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
const TargetInfo & getTargetInfo() const
void addDestruction(T *Ptr) const
If T isn't trivially destructible, calls AddDeallocation to register it for destruction.
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.
bool readBool()
Read a boolean value, advancing Idx.
std::string readString()
Read a string, advancing Idx.
Decl * readDecl()
Reads a declaration from the given position in a record in the given module, advancing Idx.
uint32_t readUInt32()
Read a 32-bit unsigned value; required to satisfy BasicReader.
llvm::APFloat readAPFloat(const llvm::fltSemantics &Sem)
Read an arbitrary constant value, advancing Idx.
TemplateArgumentLoc readTemplateArgumentLoc()
Reads a TemplateArgumentLoc, advancing Idx.
void readAttributes(AttrVec &Attrs)
Reads attributes from the current stream position, advancing Idx.
unsigned getIdx() const
The current position in this record.
DeclarationNameLoc readDeclarationNameLoc(DeclarationName Name)
Read a declaration name, advancing Idx.
CXXBaseSpecifier readCXXBaseSpecifier()
Read a C++ base specifier, advancing Idx.
QualType readType()
Read a type from the current position in the record.
T * readDeclAs()
Reads a declaration from the given position in the record, advancing Idx.
DeclarationNameInfo readDeclarationNameInfo()
size_t size() const
The length of this record.
IdentifierInfo * readIdentifier()
TemplateArgument readTemplateArgument(bool Canonicalize)
ASTContext & getContext()
Retrieve the AST context that this AST reader supplements.
TypeSourceInfo * readTypeSourceInfo()
Reads a declarator info from the given record, advancing Idx.
uint64_t peekInt()
Returns the current value in this record, without advancing.
void skipInts(unsigned N)
Skips the specified number of values.
SourceRange readSourceRange(LocSeq *Seq=nullptr)
Read a source range, advancing Idx.
NestedNameSpecifierLoc readNestedNameSpecifierLoc()
Return a nested name specifier, advancing Idx.
ConceptReference * readConceptReference()
SwitchCase * getSwitchCaseWithID(unsigned ID)
Retrieve the switch-case statement with the given ID.
Token readToken()
Reads a token out of a record, advancing Idx.
void recordSwitchCaseID(SwitchCase *SC, unsigned ID)
void readOMPChildren(OMPChildren *Data)
Read an OpenMP children, advancing Idx.
Selector readSelector()
Read a selector from the Record, advancing Idx.
CXXTemporary * readCXXTemporary()
TemplateParameterList * readTemplateParameterList()
Read a template parameter list, advancing Idx.
VersionTuple readVersionTuple()
Read a version tuple, advancing Idx.
Stmt * readSubStmt()
Reads a sub-statement operand during statement reading.
uint64_t readInt()
Returns the current value in this record, and advances to the next value.
Expr * readExpr()
Reads an expression.
SourceLocation readSourceLocation(LocSeq *Seq=nullptr)
Read a source location, advancing Idx.
Expr * readSubExpr()
Reads a sub-expression operand during statement reading.
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.
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.
void setLabel(LabelDecl *L)
void setLabelLoc(SourceLocation L)
void setAmpAmpLoc(SourceLocation L)
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Represents a loop initializing the elements of an array.
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
void setRBracketLoc(SourceLocation L)
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".
void setHasStoredFPFeatures(bool B)
Set and fetch the bit that shows whether FPFeatures needs to be allocated in Trailing Storage.
void setOperatorLoc(SourceLocation L)
static BinaryOperator * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
void setStoredFPFeatures(FPOptionsOverride F)
Set FPFeatures in trailing storage, used only by Serialization.
void setOpcode(Opcode Opc)
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
void setBlockDecl(BlockDecl *BD)
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)
void setRParenLoc(SourceLocation L)
void setLParenLoc(SourceLocation L)
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.
void setTemporary(CXXTemporary *T)
A boolean literal, per ([C++ lex.bool] Boolean literals).
void setLocation(SourceLocation L)
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.
void setArg(unsigned Arg, Expr *ArgExpr)
Set the specified argument.
unsigned getNumArgs() const
Return the number of arguments to the constructor call.
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...
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
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....
void setLParenLoc(SourceLocation L)
static CXXFunctionalCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize, bool HasFPFeatures)
void setRParenLoc(SourceLocation L)
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.
bool hasInitializer() const
Whether this new-expression has any initializer at all.
void setOperatorDelete(FunctionDecl *D)
unsigned getNumPlacementArgs() const
bool isParenTypeId() const
raw_arg_iterator raw_arg_end()
raw_arg_iterator raw_arg_begin()
void setOperatorNew(FunctionDecl *D)
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
The null pointer literal (C++11 [lex.nullptr])
void setLocation(SourceLocation L)
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.
void setInitializedFieldInUnion(FieldDecl *FD)
static CXXParenListInitExpr * CreateEmpty(ASTContext &C, unsigned numExprs, EmptyShell Empty)
void setArrayFiller(Expr *E)
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
void setDestroyedType(IdentifierInfo *II, SourceLocation Loc)
Set the name of destroyed type for a dependent pseudo-destructor expression.
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 a value-initialized rvalue of type T, which is a non-class type.
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++.
void setLocation(SourceLocation L)
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...
bool isTypeOperand() const
void setSourceRange(SourceRange R)
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
void setRParenLoc(SourceLocation L)
void setArg(unsigned I, Expr *E)
void setLParenLoc(SourceLocation L)
unsigned getNumArgs() const
Retrieve the number of arguments.
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...
bool isTypeOperand() const
void setSourceRange(SourceRange R)
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
void setRParenLoc(SourceLocation L)
void setArg(unsigned Arg, Expr *ArgExpr)
setArg - Set the specified argument.
void setADLCallKind(ADLCallKind V=UsesADL)
static CallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPFeatures, EmptyShell Empty)
Create an empty call expression, for deserialization.
void setPreArg(unsigned I, Stmt *PreArg)
void setStoredFPFeatures(FPOptionsOverride F)
Set FPOptionsOverride in trailing storage. Used only by Serialization.
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
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...
FPOptionsOverride * getTrailingFPFeatures()
Return a pointer to the trailing FPOptions.
path_iterator path_begin()
unsigned path_size() const
void setCastKind(CastKind K)
bool hasStoredFPFeatures() const
void setValue(unsigned Val)
void setLocation(SourceLocation Location)
void setKind(CharacterKind kind)
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
void setRParenLoc(SourceLocation L)
void setIsConditionTrue(bool isTrue)
void setBuiltinLoc(SourceLocation L)
Represents a 'co_await' expression.
void setIsImplicit(bool value=true)
CompoundAssignOperator - For compound assignments (e.g.
void setComputationResultType(QualType T)
static CompoundAssignOperator * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
void setComputationLHSType(QualType T)
CompoundLiteralExpr - [C99 6.5.2.5].
void setFileScope(bool FS)
void setTypeSourceInfo(TypeSourceInfo *tinfo)
void setLParenLoc(SourceLocation L)
void setInitializer(Expr *E)
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...
ResultStorageKind
Describes the kind of result that can be tail-allocated.
static ConstantExpr * CreateEmpty(const ASTContext &Context, ResultStorageKind StorageKind)
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
llvm::SmallVector< std::pair< const Expr *, Detail >, 4 > Details
Pairs of unsatisfied atomic constraint expressions along with the substituted constraint expr,...
std::pair< SourceLocation, StringRef > SubstitutionDiagnostic
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.
bool hasTemplateKWAndArgsInfo() const
static DeclRefExpr * CreateEmpty(const ASTContext &Context, bool HasQualifier, bool HasFoundDecl, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Construct an empty declaration reference expression.
void setLocation(SourceLocation L)
bool hasQualifier() const
Determine whether this declaration reference was preceded by a C++ nested-name-specifier,...
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
Decl - This represents one declaration (or definition), e.g.
AccessSpecifier getAccess() const
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)
void setSubExpr(unsigned Idx, Expr *E)
void setGNUSyntax(bool GNU)
void setEqualOrColonLoc(SourceLocation L)
void setDesignators(const ASTContext &C, const Designator *Desigs, unsigned NumDesigs)
unsigned getNumSubExprs() const
Retrieve the total number of subexpressions in this designated initializer expression,...
void setUpdater(Expr *Updater)
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.
ExplicitCastExpr - An explicit cast written in the source code.
void setTypeInfoAsWritten(TypeSourceInfo *writtenTy)
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
unsigned getNumObjects() const
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 ...
void setAccessor(IdentifierInfo *II)
void setAccessorLoc(SourceLocation L)
static FPOptionsOverride getFromOpaqueInt(storage_type I)
static FixedPointLiteral * Create(const ASTContext &C, EmptyShell Empty)
Returns an empty fixed-point literal.
void setLocation(SourceLocation Location)
void setScale(unsigned S)
static FloatingLiteral * Create(const ASTContext &C, const llvm::APFloat &V, bool isexact, QualType Type, SourceLocation L)
const llvm::fltSemantics & getSemantics() const
Return the APFloat semantics this literal uses.
void setValue(const ASTContext &C, const llvm::APFloat &Val)
void setRawSemantics(llvm::APFloatBase::Semantics Sem)
Set the raw enumeration value representing the floating-point semantics of this literal (32-bit IEEE,...
void setLocation(SourceLocation L)
ForStmt - This represents a 'for (init;cond;inc)' stmt.
void setSubExpr(Expr *E)
As with any mutator of the AST, be very careful when modifying an existing AST to preserve its invari...
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...
void setTokenLocation(SourceLocation L)
Represents a C11 generic selection.
unsigned getNumAssocs() const
The number of association expressions.
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)
void setIsPartOfExplicitCast(bool PartOfExplicitCast)
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.
void setSyntacticForm(InitListExpr *Init)
Expr * updateInit(const ASTContext &C, unsigned Init, Expr *expr)
Updates the initializer at index Init with the new expression expr, and returns the old expression at...
void setLBraceLoc(SourceLocation Loc)
void setRBraceLoc(SourceLocation Loc)
void sawArrayRangeDesignator(bool ARD=true)
void reserveInits(const ASTContext &C, unsigned NumInits)
Reserve space for some number of initializers.
void setLocation(SourceLocation Location)
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.
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument for this lambda expression.
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
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.
void setRBracketLoc(SourceLocation L)
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.
void setColumnIdx(Expr *E)
void setRBracketLoc(SourceLocation L)
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.
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special 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.
OpenMP 5.0 [2.1.5, Array Sections].
void setStride(Expr *E)
Set length of the array section.
void setLength(Expr *E)
Set length of the array section.
void setColonLocFirst(SourceLocation L)
void setLowerBound(Expr *E)
Set lower bound of the array section.
void setRBracketLoc(SourceLocation L)
void setBase(Expr *E)
Set base of the array section.
void setColonLocSecond(SourceLocation L)
An explicit cast in C or a C-style cast in C++, which uses the syntax ([s1][s2]......
void setLParenLoc(SourceLocation L)
static OMPArrayShapingExpr * CreateEmpty(const ASTContext &Context, unsigned NumDims)
void setRParenLoc(SourceLocation L)
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.
This represents '#pragma omp distribute simd' composite directive.
static OMPDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp error' directive.
static OMPErrorDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
This is a basic class for representing single OpenMP executable directive.
void setLocStart(SourceLocation Loc)
Set starting location of directive kind.
OMPChildren * Data
Data, associated with the directive.
void setLocEnd(SourceLocation Loc)
Set ending location of directive.
void setMappedDirective(OpenMPDirectiveKind MappedDirective)
This represents '#pragma omp flush' directive.
static OMPFlushDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp for' directive.
static OMPForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp for simd' directive.
static OMPForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp loop' directive.
static OMPGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with a place for NumClauses clauses.
This represents '#pragma omp interop' directive.
static OMPInteropDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
OpenMP 5.0 [2.1.6 Iterators] Iterators are identifiers that expand to multiple values in the clause o...
void setLParenLoc(SourceLocation L)
static OMPIteratorExpr * CreateEmpty(const ASTContext &Context, unsigned NumIterators)
void setRParenLoc(SourceLocation L)
void setIteratorKwLoc(SourceLocation L)
The base class for all loop-based directives, including loop transformation directives.
This is a common base class for loop directives ('omp simd', 'omp for', 'omp for simd' etc....
This represents '#pragma omp masked' directive.
static OMPMaskedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
This represents '#pragma omp masked taskloop' directive.
static OMPMaskedTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp masked taskloop simd' directive.
static OMPMaskedTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp master' directive.
static OMPMasterDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
This represents '#pragma omp master taskloop' directive.
static OMPMasterTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp master taskloop simd' directive.
static OMPMasterTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp ordered' directive.
static OMPOrderedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, bool IsStandalone, EmptyShell)
Creates an empty directive.
This represents '#pragma omp parallel' directive.
static OMPParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for N clauses.
This represents '#pragma omp parallel for' directive.
static OMPParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp parallel for simd' directive.
static OMPParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp parallel loop' directive.
static OMPParallelGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp parallel masked' directive.
static OMPParallelMaskedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp parallel masked taskloop' directive.
static OMPParallelMaskedTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp parallel masked taskloop simd' directive.
static OMPParallelMaskedTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp parallel master' directive.
static OMPParallelMasterDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp parallel master taskloop' directive.
static OMPParallelMasterTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp parallel master taskloop simd' directive.
static OMPParallelMasterTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp parallel sections' directive.
static OMPParallelSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp scan' directive.
static OMPScanDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp scope' directive.
static OMPScopeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
This represents '#pragma omp section' directive.
static OMPSectionDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
void setHasCancel(bool Has)
Set cancel state.
This represents '#pragma omp sections' directive.
static OMPSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp simd' directive.
static OMPSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp single' directive.
static OMPSingleDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target data' directive.
static OMPTargetDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
This represents '#pragma omp target' directive.
static OMPTargetDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target enter data' directive.
static OMPTargetEnterDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
This represents '#pragma omp target exit data' directive.
static OMPTargetExitDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
This represents '#pragma omp target parallel' directive.
static OMPTargetParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target parallel for' directive.
static OMPTargetParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target parallel for simd' directive.
static OMPTargetParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target parallel loop' directive.
static OMPTargetParallelGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target simd' directive.
static OMPTargetSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target teams' directive.
static OMPTargetTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target teams distribute' combined directive.
static OMPTargetTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target teams distribute parallel for' combined directive.
static OMPTargetTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target teams distribute parallel for simd' combined directive.
static OMPTargetTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target teams distribute simd' combined directive.
static OMPTargetTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target teams loop' directive.
static OMPTargetTeamsGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target update' directive.
static OMPTargetUpdateDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp task' directive.
static OMPTaskDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp taskloop' directive.
static OMPTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp taskloop simd' directive.
static OMPTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp taskgroup' directive.
static OMPTaskgroupDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
This represents '#pragma omp taskwait' directive.
static OMPTaskwaitDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
This represents '#pragma omp taskyield' directive.
static OMPTaskyieldDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
This represents '#pragma omp teams' directive.
static OMPTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp teams distribute' directive.
static OMPTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp teams distribute parallel for' composite directive.
static OMPTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp teams distribute parallel for simd' composite directive.
static OMPTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp teams distribute simd' combined directive.
static OMPTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp teams loop' directive.
static OMPTeamsGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents the '#pragma omp tile' loop transformation directive.