52 #include "llvm/ADT/DenseMap.h" 53 #include "llvm/ADT/SmallString.h" 54 #include "llvm/ADT/SmallVector.h" 55 #include "llvm/ADT/StringRef.h" 56 #include "llvm/Bitcode/BitstreamReader.h" 57 #include "llvm/Support/Casting.h" 58 #include "llvm/Support/ErrorHandling.h" 64 using namespace clang;
65 using namespace serialization;
73 llvm::BitstreamCursor &DeclsCursor;
83 std::string ReadString() {
111 : Record(Record), DeclsCursor(Cursor) {}
115 static const unsigned NumStmtFields = 0;
119 static const unsigned NumExprFields = NumStmtFields + 7;
124 unsigned NumTemplateArgs);
128 unsigned NumTemplateArgs);
130 void VisitStmt(
Stmt *S);
131 #define STMT(Type, Base) \ 132 void Visit##Type(Type *); 133 #include "clang/AST/StmtNodes.inc" 140 unsigned NumTemplateArgs) {
145 for (
unsigned i = 0; i != NumTemplateArgs; ++i)
151 assert(Record.
getIdx() == NumStmtFields &&
"Incorrect statement field count");
154 void ASTStmtReader::VisitNullStmt(
NullStmt *S) {
160 void ASTStmtReader::VisitCompoundStmt(
CompoundStmt *S) {
163 unsigned NumStmts = Record.
readInt();
168 S->RBraceLoc = ReadSourceLocation();
171 void ASTStmtReader::VisitSwitchCase(
SwitchCase *S) {
178 void ASTStmtReader::VisitCaseStmt(
CaseStmt *S) {
180 bool CaseStmtIsGNURange = Record.
readInt();
183 if (CaseStmtIsGNURange) {
189 void ASTStmtReader::VisitDefaultStmt(
DefaultStmt *S) {
194 void ASTStmtReader::VisitLabelStmt(
LabelStmt *S) {
196 auto *LD = ReadDeclAs<LabelDecl>();
208 uint64_t NumAttrs = Record.
readInt();
213 assert(NumAttrs == Attrs.size());
214 std::copy(Attrs.begin(), Attrs.end(), S->getAttrArrayPtr());
219 void ASTStmtReader::VisitIfStmt(
IfStmt *S) {
223 bool HasElse = Record.
readInt();
224 bool HasVar = Record.
readInt();
225 bool HasInit = Record.
readInt();
241 void ASTStmtReader::VisitSwitchStmt(
SwitchStmt *S) {
244 bool HasInit = Record.
readInt();
245 bool HasVar = Record.
readInt();
246 bool AllEnumCasesCovered = Record.
readInt();
247 if (AllEnumCasesCovered)
260 for (
auto E = Record.
size(); Record.
getIdx() != E; ) {
271 void ASTStmtReader::VisitWhileStmt(
WhileStmt *S) {
274 bool HasVar = Record.
readInt();
284 void ASTStmtReader::VisitDoStmt(
DoStmt *S) {
293 void ASTStmtReader::VisitForStmt(
ForStmt *S) {
305 void ASTStmtReader::VisitGotoStmt(
GotoStmt *S) {
307 S->
setLabel(ReadDeclAs<LabelDecl>());
319 void ASTStmtReader::VisitContinueStmt(
ContinueStmt *S) {
324 void ASTStmtReader::VisitBreakStmt(
BreakStmt *S) {
329 void ASTStmtReader::VisitReturnStmt(
ReturnStmt *S) {
332 bool HasNRVOCandidate = Record.
readInt();
335 if (HasNRVOCandidate)
341 void ASTStmtReader::VisitDeclStmt(
DeclStmt *S) {
353 for (
int I = 0; I < N; ++I)
354 Decls.push_back(ReadDecl());
361 void ASTStmtReader::VisitAsmStmt(
AsmStmt *S) {
371 void ASTStmtReader::VisitGCCAsmStmt(
GCCAsmStmt *S) {
384 for (
unsigned I = 0, N = NumOutputs + NumInputs; I != N; ++I) {
386 Constraints.push_back(cast_or_null<StringLiteral>(Record.
readSubStmt()));
392 for (
unsigned I = 0; I != NumClobbers; ++I)
393 Clobbers.push_back(cast_or_null<StringLiteral>(Record.
readSubStmt()));
395 S->setOutputsAndInputsAndClobbers(Record.
getContext(),
396 Names.data(), Constraints.data(),
397 Exprs.data(), NumOutputs, NumInputs,
398 Clobbers.data(), NumClobbers);
401 void ASTStmtReader::VisitMSAsmStmt(
MSAsmStmt *S) {
403 S->LBraceLoc = ReadSourceLocation();
404 S->EndLoc = ReadSourceLocation();
405 S->NumAsmToks = Record.
readInt();
406 std::string AsmStr = ReadString();
410 AsmToks.reserve(S->NumAsmToks);
411 for (
unsigned i = 0, e = S->NumAsmToks; i != e; ++i) {
423 for (
unsigned i = 0, e = S->
NumClobbers; i != e; ++i) {
424 ClobbersData.push_back(ReadString());
425 Clobbers.push_back(ClobbersData.back());
433 Exprs.reserve(NumOperands);
434 ConstraintsData.reserve(NumOperands);
435 Constraints.reserve(NumOperands);
436 for (
unsigned i = 0; i != NumOperands; ++i) {
438 ConstraintsData.push_back(ReadString());
439 Constraints.push_back(ConstraintsData.back());
442 S->initialize(Record.
getContext(), AsmStr, AsmToks,
443 Constraints, Exprs, Clobbers);
448 assert(Record.
peekInt() == S->NumParams);
450 auto *StoredStmts = S->getStoredStmts();
452 i < CoroutineBodyStmt::SubStmt::FirstParamMove + S->NumParams; ++i)
456 void ASTStmtReader::VisitCoreturnStmt(
CoreturnStmt *S) {
459 for (
auto &SubStmt: S->SubStmts)
461 S->IsImplicit = Record.
readInt() != 0;
464 void ASTStmtReader::VisitCoawaitExpr(
CoawaitExpr *E) {
466 E->KeywordLoc = ReadSourceLocation();
467 for (
auto &SubExpr: E->SubExprs)
469 E->OpaqueValue = cast_or_null<OpaqueValueExpr>(Record.
readSubStmt());
473 void ASTStmtReader::VisitCoyieldExpr(
CoyieldExpr *E) {
475 E->KeywordLoc = ReadSourceLocation();
476 for (
auto &SubExpr: E->SubExprs)
478 E->OpaqueValue = cast_or_null<OpaqueValueExpr>(Record.
readSubStmt());
483 E->KeywordLoc = ReadSourceLocation();
484 for (
auto &SubExpr: E->SubExprs)
488 void ASTStmtReader::VisitCapturedStmt(
CapturedStmt *S) {
507 I.VarAndKind.setPointer(ReadDeclAs<VarDecl>());
509 static_cast<CapturedStmt::VariableCaptureKind>(Record.
readInt()));
510 I.Loc = ReadSourceLocation();
514 void ASTStmtReader::VisitExpr(
Expr *E) {
523 assert(Record.
getIdx() == NumExprFields &&
524 "Incorrect expression field count");
527 void ASTStmtReader::VisitConstantExpr(
ConstantExpr *E) {
534 bool HasFunctionName = Record.
readInt();
539 E->setFunctionName(cast<StringLiteral>(Record.
readSubExpr()));
542 void ASTStmtReader::VisitDeclRefExpr(
DeclRefExpr *E) {
550 unsigned NumTemplateArgs = 0;
552 NumTemplateArgs = Record.
readInt();
558 if (E->hasFoundDecl())
559 *E->getTrailingObjects<
NamedDecl *>() = ReadDeclAs<NamedDecl>();
562 ReadTemplateKWAndArgsInfo(
566 E->
setDecl(ReadDeclAs<ValueDecl>());
601 unsigned NumConcatenated = Record.
readInt();
602 unsigned Length = Record.
readInt();
603 unsigned CharByteWidth = Record.
readInt();
605 "Wrong number of concatenated tokens!");
606 assert((Length == E->
getLength()) &&
"Wrong Length!");
607 assert((CharByteWidth == E->
getCharByteWidth()) &&
"Wrong character width!");
614 assert((CharByteWidth ==
617 "Wrong character width!");
620 for (
unsigned I = 0; I < NumConcatenated; ++I)
621 E->setStrTokenLoc(I, ReadSourceLocation());
624 char *StrData = E->getStrDataAsChar();
625 for (
unsigned I = 0; I < Length * CharByteWidth; ++I)
633 E->
setKind(static_cast<CharacterLiteral::CharacterKind>(Record.
readInt()));
636 void ASTStmtReader::VisitParenExpr(
ParenExpr *E) {
645 unsigned NumExprs = Record.
readInt();
646 assert((NumExprs == E->
getNumExprs()) &&
"Wrong NumExprs!");
647 for (
unsigned I = 0; I != NumExprs; ++I)
649 E->LParenLoc = ReadSourceLocation();
650 E->RParenLoc = ReadSourceLocation();
661 void ASTStmtReader::VisitOffsetOfExpr(
OffsetOfExpr *E) {
732 void ASTStmtReader::VisitCallExpr(
CallExpr *E) {
734 unsigned NumArgs = Record.
readInt();
735 assert((NumArgs == E->
getNumArgs()) &&
"Wrong NumArgs!");
738 for (
unsigned I = 0; I != NumArgs; ++I)
747 void ASTStmtReader::VisitMemberExpr(
MemberExpr *E) {
750 "It's a subclass, we must advance Idx!");
753 void ASTStmtReader::VisitObjCIsaExpr(
ObjCIsaExpr *E) {
765 E->setShouldCopy(Record.
readInt());
769 VisitExplicitCastExpr(E);
770 E->LParenLoc = ReadSourceLocation();
771 E->BridgeKeywordLoc = ReadSourceLocation();
775 void ASTStmtReader::VisitCastExpr(
CastExpr *E) {
777 unsigned NumBaseSpecs = Record.
readInt();
782 while (NumBaseSpecs--) {
799 VisitBinaryOperator(E);
806 E->SubExprs[ConditionalOperator::COND] = Record.
readSubExpr();
807 E->SubExprs[ConditionalOperator::LHS] = Record.
readSubExpr();
808 E->SubExprs[ConditionalOperator::RHS] = Record.
readSubExpr();
809 E->QuestionLoc = ReadSourceLocation();
810 E->ColonLoc = ReadSourceLocation();
816 E->OpaqueValue = cast<OpaqueValueExpr>(Record.
readSubExpr());
817 E->SubExprs[BinaryConditionalOperator::COMMON] = Record.
readSubExpr();
818 E->SubExprs[BinaryConditionalOperator::COND] = Record.
readSubExpr();
819 E->SubExprs[BinaryConditionalOperator::LHS] = Record.
readSubExpr();
820 E->SubExprs[BinaryConditionalOperator::RHS] = Record.
readSubExpr();
821 E->QuestionLoc = ReadSourceLocation();
822 E->ColonLoc = ReadSourceLocation();
836 VisitExplicitCastExpr(E);
856 void ASTStmtReader::VisitInitListExpr(
InitListExpr *E) {
858 if (
auto *SyntForm = cast_or_null<InitListExpr>(Record.
readSubStmt()))
862 bool isArrayFiller = Record.
readInt();
863 Expr *filler =
nullptr;
866 E->ArrayFillerOrUnionFieldInit = filler;
868 E->ArrayFillerOrUnionFieldInit = ReadDeclAs<FieldDecl>();
870 unsigned NumInits = Record.
readInt();
873 for (
unsigned I = 0; I != NumInits; ++I) {
878 for (
unsigned I = 0; I != NumInits; ++I)
887 unsigned NumSubExprs = Record.
readInt();
888 assert(NumSubExprs == E->
getNumSubExprs() &&
"Wrong number of subexprs");
889 for (
unsigned I = 0; I != NumSubExprs; ++I)
898 auto *Field = ReadDeclAs<FieldDecl>();
901 Designators.push_back(
Designator(Field->getIdentifier(), DotLoc,
903 Designators.back().setField(Field);
911 Designators.push_back(
Designator(Name, DotLoc, FieldLoc));
916 unsigned Index = Record.
readInt();
919 Designators.push_back(
Designator(Index, LBracketLoc, RBracketLoc));
924 unsigned Index = Record.
readInt();
928 Designators.push_back(
Designator(Index, LBracketLoc, EllipsisLoc,
935 Designators.data(), Designators.size());
944 void ASTStmtReader::VisitNoInitExpr(
NoInitExpr *E) {
962 void ASTStmtReader::VisitVAArgExpr(
VAArgExpr *E) {
975 E->
setLabel(ReadDeclAs<LabelDecl>());
978 void ASTStmtReader::VisitStmtExpr(
StmtExpr *E) {
985 void ASTStmtReader::VisitChooseExpr(
ChooseExpr *E) {
995 void ASTStmtReader::VisitGNUNullExpr(
GNUNullExpr *E) {
1003 unsigned NumExprs = Record.
readInt();
1013 E->BuiltinLoc = ReadSourceLocation();
1014 E->RParenLoc = ReadSourceLocation();
1015 E->TInfo = GetTypeSourceInfo();
1019 void ASTStmtReader::VisitBlockExpr(
BlockExpr *E) {
1026 E->NumAssocs = Record.
readInt();
1029 new(Record.
getContext())
Stmt*[GenericSelectionExpr::END_EXPR+E->NumAssocs];
1031 E->SubExprs[GenericSelectionExpr::CONTROLLING] = Record.
readSubExpr();
1032 for (
unsigned I = 0, N = E->
getNumAssocs(); I != N; ++I) {
1033 E->AssocTypes[I] = GetTypeSourceInfo();
1034 E->SubExprs[GenericSelectionExpr::END_EXPR+I] = Record.
readSubExpr();
1036 E->ResultIndex = Record.
readInt();
1038 E->GenericLoc = ReadSourceLocation();
1039 E->DefaultLoc = ReadSourceLocation();
1040 E->RParenLoc = ReadSourceLocation();
1045 unsigned numSemanticExprs = Record.
readInt();
1053 for (
unsigned i = 0; i != numSemanticExprs; ++i) {
1055 E->getSubExprsBuffer()[i+1] = subExpr;
1059 void ASTStmtReader::VisitAtomicExpr(
AtomicExpr *E) {
1063 for (
unsigned I = 0; I != E->NumSubExprs; ++I)
1065 E->BuiltinLoc = ReadSourceLocation();
1066 E->RParenLoc = ReadSourceLocation();
1082 E->BoxingMethod = ReadDeclAs<ObjCMethodDecl>();
1083 E->Range = ReadSourceRange();
1088 unsigned NumElements = Record.
readInt();
1089 assert(NumElements == E->
getNumElements() &&
"Wrong number of elements");
1091 for (
unsigned I = 0, N = NumElements; I != N; ++I)
1093 E->ArrayWithObjectsMethod = ReadDeclAs<ObjCMethodDecl>();
1094 E->Range = ReadSourceRange();
1099 unsigned NumElements = Record.
readInt();
1100 assert(NumElements == E->
getNumElements() &&
"Wrong number of elements");
1101 bool HasPackExpansions = Record.
readInt();
1102 assert(HasPackExpansions == E->HasPackExpansions &&
"Pack expansion mismatch");
1107 for (
unsigned I = 0; I != NumElements; ++I) {
1110 if (HasPackExpansions) {
1111 Expansions[I].EllipsisLoc = ReadSourceLocation();
1112 Expansions[I].NumExpansionsPlusOne = Record.
readInt();
1115 E->DictWithObjectsMethod = ReadDeclAs<ObjCMethodDecl>();
1116 E->Range = ReadSourceRange();
1137 E->ProtoLoc = ReadSourceLocation();
1143 E->
setDecl(ReadDeclAs<ObjCIvarDecl>());
1153 unsigned MethodRefFlags = Record.
readInt();
1154 bool Implicit = Record.
readInt() != 0;
1156 auto *Getter = ReadDeclAs<ObjCMethodDecl>();
1157 auto *Setter = ReadDeclAs<ObjCMethodDecl>();
1158 E->setImplicitProperty(Getter, Setter, MethodRefFlags);
1160 E->setExplicitProperty(ReadDeclAs<ObjCPropertyDecl>(), MethodRefFlags);
1162 E->setLocation(ReadSourceLocation());
1163 E->setReceiverLocation(ReadSourceLocation());
1169 E->setSuperReceiver(Record.
readType());
1172 E->setClassReceiver(ReadDeclAs<ObjCInterfaceDecl>());
1182 E->GetAtIndexMethodDecl = ReadDeclAs<ObjCMethodDecl>();
1183 E->SetAtIndexMethodDecl = ReadDeclAs<ObjCMethodDecl>();
1190 unsigned NumStoredSelLocs = Record.
readInt();
1191 E->SelLocsKind = Record.
readInt();
1193 E->IsImplicit = Record.
readInt();
1220 E->LBracLoc = ReadSourceLocation();
1221 E->RBracLoc = ReadSourceLocation();
1223 for (
unsigned I = 0, N = E->
getNumArgs(); I != N; ++I)
1227 for (
unsigned I = 0; I != NumStoredSelLocs; ++I)
1228 Locs[I] = ReadSourceLocation();
1264 bool HasFinally = Record.
readInt();
1305 void ASTStmtReader::VisitCXXCatchStmt(
CXXCatchStmt *S) {
1307 S->CatchLoc = ReadSourceLocation();
1308 S->ExceptionDecl = ReadDeclAs<VarDecl>();
1312 void ASTStmtReader::VisitCXXTryStmt(
CXXTryStmt *S) {
1316 S->TryLoc = ReadSourceLocation();
1324 S->ForLoc = ReadSourceLocation();
1325 S->CoawaitLoc = ReadSourceLocation();
1326 S->ColonLoc = ReadSourceLocation();
1327 S->RParenLoc = ReadSourceLocation();
1340 S->KeywordLoc = ReadSourceLocation();
1341 S->IsIfExists = Record.
readInt();
1343 ReadDeclarationNameInfo(S->NameInfo);
1357 unsigned NumArgs = Record.
readInt();
1358 assert((NumArgs == E->
getNumArgs()) &&
"Wrong NumArgs!");
1367 E->Constructor = ReadDeclAs<CXXConstructorDecl>();
1368 E->ParenOrBraceRange = ReadSourceRange();
1370 for (
unsigned I = 0; I != NumArgs; ++I)
1376 E->Constructor = ReadDeclAs<CXXConstructorDecl>();
1377 E->Loc = ReadSourceLocation();
1378 E->ConstructsVirtualBase = Record.
readInt();
1379 E->InheritedFromVirtualBase = Record.
readInt();
1383 VisitCXXConstructExpr(E);
1384 E->TSI = GetTypeSourceInfo();
1387 void ASTStmtReader::VisitLambdaExpr(
LambdaExpr *E) {
1389 unsigned NumCaptures = Record.
readInt();
1390 assert(NumCaptures == E->NumCaptures);(void)NumCaptures;
1391 E->IntroducerRange = ReadSourceRange();
1393 E->CaptureDefaultLoc = ReadSourceLocation();
1394 E->ExplicitParams = Record.
readInt();
1395 E->ExplicitResultType = Record.
readInt();
1396 E->ClosingBrace = ReadSourceLocation();
1412 VisitExplicitCastExpr(E);
1415 E->RParenLoc = R.
getEnd();
1416 R = ReadSourceRange();
1417 E->AngleBrackets = R;
1421 return VisitCXXNamedCastExpr(E);
1425 return VisitCXXNamedCastExpr(E);
1429 return VisitCXXNamedCastExpr(E);
1433 return VisitCXXNamedCastExpr(E);
1437 VisitExplicitCastExpr(E);
1444 E->UDSuffixLoc = ReadSourceLocation();
1463 GetTypeSourceInfo());
1471 void ASTStmtReader::VisitCXXThisExpr(
CXXThisExpr *E) {
1477 void ASTStmtReader::VisitCXXThrowExpr(
CXXThrowExpr *E) {
1486 E->Param = ReadDeclAs<ParmVarDecl>();
1492 E->Field = ReadDeclAs<FieldDecl>();
1504 E->TypeInfo = GetTypeSourceInfo();
1508 void ASTStmtReader::VisitCXXNewExpr(
CXXNewExpr *E) {
1511 bool IsArray = Record.
readInt();
1512 bool HasInit = Record.
readInt();
1513 unsigned NumPlacementArgs = Record.
readInt();
1514 bool IsParenTypeId = Record.
readInt();
1521 assert((IsArray == E->
isArray()) &&
"Wrong IsArray!");
1524 "Wrong NumPlacementArgs!");
1525 assert((IsParenTypeId == E->
isParenTypeId()) &&
"Wrong IsParenTypeId!");
1528 (void)NumPlacementArgs;
1532 E->AllocatedTypeInfo = GetTypeSourceInfo();
1534 E->getTrailingObjects<
SourceRange>()[0] = ReadSourceRange();
1535 E->Range = ReadSourceRange();
1536 E->DirectInitRange = ReadSourceRange();
1551 E->OperatorDelete = ReadDeclAs<FunctionDecl>();
1560 E->IsArrow = Record.
readInt();
1561 E->OperatorLoc = ReadSourceLocation();
1563 E->ScopeType = GetTypeSourceInfo();
1564 E->ColonColonLoc = ReadSourceLocation();
1565 E->TildeLoc = ReadSourceLocation();
1577 unsigned NumObjects = Record.
readInt();
1579 for (
unsigned i = 0; i != NumObjects; ++i)
1580 E->getTrailingObjects<
BlockDecl *>()[i] =
1581 ReadDeclAs<BlockDecl>();
1587 void ASTStmtReader::VisitCXXDependentScopeMemberExpr(
1591 bool HasTemplateKWAndArgsInfo = Record.
readInt();
1592 unsigned NumTemplateArgs = Record.
readInt();
1593 bool HasFirstQualifierFoundInScope = Record.
readInt();
1595 assert((HasTemplateKWAndArgsInfo == E->hasTemplateKWAndArgsInfo()) &&
1596 "Wrong HasTemplateKWAndArgsInfo!");
1598 (HasFirstQualifierFoundInScope == E->hasFirstQualifierFoundInScope()) &&
1599 "Wrong HasFirstQualifierFoundInScope!");
1601 if (HasTemplateKWAndArgsInfo)
1602 ReadTemplateKWAndArgsInfo(
1607 "Wrong NumTemplateArgs!");
1615 if (HasFirstQualifierFoundInScope)
1616 *E->getTrailingObjects<
NamedDecl *>() = ReadDeclAs<NamedDecl>();
1618 ReadDeclarationNameInfo(E->MemberNameInfo);
1626 ReadTemplateKWAndArgsInfo(
1632 ReadDeclarationNameInfo(E->NameInfo);
1639 "Read wrong record during creation ?");
1641 for (
unsigned I = 0, N = E->
arg_size(); I != N; ++I)
1643 E->TSI = GetTypeSourceInfo();
1648 void ASTStmtReader::VisitOverloadExpr(
OverloadExpr *E) {
1651 unsigned NumResults = Record.
readInt();
1652 bool HasTemplateKWAndArgsInfo = Record.
readInt();
1653 assert((E->
getNumDecls() == NumResults) &&
"Wrong NumResults!");
1655 "Wrong HasTemplateKWAndArgsInfo!");
1657 if (HasTemplateKWAndArgsInfo) {
1658 unsigned NumTemplateArgs = Record.
readInt();
1663 "Wrong NumTemplateArgs!");
1667 for (
unsigned I = 0; I != NumResults; ++I) {
1668 auto *D = ReadDeclAs<NamedDecl>();
1675 for (
unsigned I = 0; I != NumResults; ++I) {
1676 Results[I] = (Iter + I).getPair();
1679 ReadDeclarationNameInfo(E->NameInfo);
1684 VisitOverloadExpr(E);
1689 E->OperatorLoc = ReadSourceLocation();
1693 VisitOverloadExpr(E);
1696 E->NamingClass = ReadDeclAs<CXXRecordDecl>();
1706 E->RParenLoc = Range.
getEnd();
1709 for (
unsigned I = 0, N = E->
getNumArgs(); I != N; ++I)
1710 Args[I] = GetTypeSourceInfo();
1716 E->Value = (
unsigned int)Record.
readInt();
1719 E->RParen = Range.
getEnd();
1720 E->QueriedType = GetTypeSourceInfo();
1731 E->RParen = Range.
getEnd();
1737 E->Range = ReadSourceRange();
1743 E->EllipsisLoc = ReadSourceLocation();
1744 E->NumExpansions = Record.
readInt();
1750 unsigned NumPartialArgs = Record.
readInt();
1751 E->OperatorLoc = ReadSourceLocation();
1752 E->PackLoc = ReadSourceLocation();
1753 E->RParenLoc = ReadSourceLocation();
1756 assert(E->Length == NumPartialArgs);
1758 *E = I + NumPartialArgs;
1766 void ASTStmtReader::VisitSubstNonTypeTemplateParmExpr(
1769 E->Param = ReadDeclAs<NonTypeTemplateParmDecl>();
1774 void ASTStmtReader::VisitSubstNonTypeTemplateParmPackExpr(
1777 E->Param = ReadDeclAs<NonTypeTemplateParmDecl>();
1783 E->NumArguments = ArgPack.pack_size();
1784 E->NameLoc = ReadSourceLocation();
1789 E->NumParameters = Record.
readInt();
1790 E->ParamPack = ReadDeclAs<ParmVarDecl>();
1791 E->NameLoc = ReadSourceLocation();
1792 auto **Parms = E->getTrailingObjects<
ParmVarDecl *>();
1793 for (
unsigned i = 0, n = E->NumParameters; i != n; ++i)
1794 Parms[i] = ReadDeclAs<ParmVarDecl>();
1800 auto *VD = ReadDeclAs<ValueDecl>();
1801 unsigned ManglingNumber = Record.
readInt();
1805 void ASTStmtReader::VisitCXXFoldExpr(
CXXFoldExpr *E) {
1807 E->LParenLoc = ReadSourceLocation();
1808 E->EllipsisLoc = ReadSourceLocation();
1809 E->RParenLoc = ReadSourceLocation();
1822 void ASTStmtReader::VisitTypoExpr(
TypoExpr *E) {
1823 llvm_unreachable(
"Cannot read TypoExpr nodes");
1831 E->IsArrow = (Record.
readInt() != 0);
1834 E->MemberLoc = ReadSourceLocation();
1835 E->TheDecl = ReadDeclAs<MSPropertyDecl>();
1848 std::string UuidStr = ReadString();
1852 GetTypeSourceInfo());
1860 void ASTStmtReader::VisitSEHLeaveStmt(
SEHLeaveStmt *S) {
1867 S->Loc = ReadSourceLocation();
1868 S->Children[SEHExceptStmt::FILTER_EXPR] = Record.
readSubStmt();
1874 S->Loc = ReadSourceLocation();
1878 void ASTStmtReader::VisitSEHTryStmt(
SEHTryStmt *S) {
1880 S->IsCXXTry = Record.
readInt();
1881 S->TryLoc = ReadSourceLocation();
1882 S->Children[SEHTryStmt::TRY] = Record.
readSubStmt();
1883 S->Children[SEHTryStmt::HANDLER] = Record.
readSubStmt();
1898 void ASTStmtReader::VisitAsTypeExpr(
AsTypeExpr *E) {
1900 E->BuiltinLoc = ReadSourceLocation();
1901 E->RParenLoc = ReadSourceLocation();
1915 Clauses.push_back(ClauseReader.
readClause());
1925 VisitOMPExecutableDirective(D);
1963 Sub.reserve(CollapsedNum);
1964 for (
unsigned i = 0; i < CollapsedNum; ++i)
1968 for (
unsigned i = 0; i < CollapsedNum; ++i)
1972 for (
unsigned i = 0; i < CollapsedNum; ++i)
1976 for (
unsigned i = 0; i < CollapsedNum; ++i)
1980 for (
unsigned i = 0; i < CollapsedNum; ++i)
1989 VisitOMPExecutableDirective(D);
1990 D->setHasCancel(Record.
readInt());
1994 VisitOMPLoopDirective(D);
1998 VisitOMPLoopDirective(D);
1999 D->setHasCancel(Record.
readInt());
2003 VisitOMPLoopDirective(D);
2010 VisitOMPExecutableDirective(D);
2011 D->setHasCancel(Record.
readInt());
2016 VisitOMPExecutableDirective(D);
2024 VisitOMPExecutableDirective(D);
2029 VisitOMPExecutableDirective(D);
2036 VisitOMPExecutableDirective(D);
2037 ReadDeclarationNameInfo(D->DirName);
2041 VisitOMPLoopDirective(D);
2042 D->setHasCancel(Record.
readInt());
2045 void ASTStmtReader::VisitOMPParallelForSimdDirective(
2047 VisitOMPLoopDirective(D);
2050 void ASTStmtReader::VisitOMPParallelSectionsDirective(
2055 VisitOMPExecutableDirective(D);
2056 D->setHasCancel(Record.
readInt());
2063 VisitOMPExecutableDirective(D);
2064 D->setHasCancel(Record.
readInt());
2069 VisitOMPExecutableDirective(D);
2074 VisitOMPExecutableDirective(D);
2079 VisitOMPExecutableDirective(D);
2086 VisitOMPExecutableDirective(D);
2094 VisitOMPExecutableDirective(D);
2101 VisitOMPExecutableDirective(D);
2108 VisitOMPExecutableDirective(D);
2113 D->IsXLHSInRHSPart = Record.
readInt() != 0;
2114 D->IsPostfixUpdate = Record.
readInt() != 0;
2121 VisitOMPExecutableDirective(D);
2127 VisitOMPExecutableDirective(D);
2130 void ASTStmtReader::VisitOMPTargetEnterDataDirective(
2134 VisitOMPExecutableDirective(D);
2137 void ASTStmtReader::VisitOMPTargetExitDataDirective(
2141 VisitOMPExecutableDirective(D);
2144 void ASTStmtReader::VisitOMPTargetParallelDirective(
2148 VisitOMPExecutableDirective(D);
2151 void ASTStmtReader::VisitOMPTargetParallelForDirective(
2153 VisitOMPLoopDirective(D);
2154 D->setHasCancel(Record.
readInt());
2161 VisitOMPExecutableDirective(D);
2164 void ASTStmtReader::VisitOMPCancellationPointDirective(
2167 VisitOMPExecutableDirective(D);
2168 D->setCancelRegion(static_cast<OpenMPDirectiveKind>(Record.
readInt()));
2175 VisitOMPExecutableDirective(D);
2176 D->setCancelRegion(static_cast<OpenMPDirectiveKind>(Record.
readInt()));
2180 VisitOMPLoopDirective(D);
2184 VisitOMPLoopDirective(D);
2188 VisitOMPLoopDirective(D);
2194 VisitOMPExecutableDirective(D);
2197 void ASTStmtReader::VisitOMPDistributeParallelForDirective(
2199 VisitOMPLoopDirective(D);
2200 D->setHasCancel(Record.
readInt());
2203 void ASTStmtReader::VisitOMPDistributeParallelForSimdDirective(
2205 VisitOMPLoopDirective(D);
2208 void ASTStmtReader::VisitOMPDistributeSimdDirective(
2210 VisitOMPLoopDirective(D);
2213 void ASTStmtReader::VisitOMPTargetParallelForSimdDirective(
2215 VisitOMPLoopDirective(D);
2219 VisitOMPLoopDirective(D);
2222 void ASTStmtReader::VisitOMPTeamsDistributeDirective(
2224 VisitOMPLoopDirective(D);
2227 void ASTStmtReader::VisitOMPTeamsDistributeSimdDirective(
2229 VisitOMPLoopDirective(D);
2232 void ASTStmtReader::VisitOMPTeamsDistributeParallelForSimdDirective(
2234 VisitOMPLoopDirective(D);
2237 void ASTStmtReader::VisitOMPTeamsDistributeParallelForDirective(
2239 VisitOMPLoopDirective(D);
2240 D->setHasCancel(Record.
readInt());
2247 VisitOMPExecutableDirective(D);
2250 void ASTStmtReader::VisitOMPTargetTeamsDistributeDirective(
2252 VisitOMPLoopDirective(D);
2255 void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForDirective(
2257 VisitOMPLoopDirective(D);
2258 D->setHasCancel(Record.
readInt());
2261 void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
2263 VisitOMPLoopDirective(D);
2266 void ASTStmtReader::VisitOMPTargetTeamsDistributeSimdDirective(
2268 VisitOMPLoopDirective(D);
2276 switch (ReadingKind) {
2278 llvm_unreachable(
"should not call this when not reading anything");
2281 return ReadStmtFromStream(F);
2283 return ReadSubStmt();
2286 llvm_unreachable(
"ReadingKind not set ?");
2290 return cast_or_null<Expr>(ReadStmt(F));
2294 return cast_or_null<Expr>(ReadSubStmt());
2305 ReadingKindTracker ReadingKind(Read_Stmt, *
this);
2310 llvm::DenseMap<uint64_t, Stmt *> StmtEntries;
2313 unsigned PrevNumStmts = StmtStack.size();
2321 llvm::BitstreamEntry Entry = Cursor.advanceSkippingSubblocks();
2323 switch (Entry.Kind) {
2324 case llvm::BitstreamEntry::SubBlock:
2326 Error(
"malformed block record in AST file");
2328 case llvm::BitstreamEntry::EndBlock:
2330 case llvm::BitstreamEntry::Record:
2337 bool Finished =
false;
2338 bool IsStmtReference =
false;
2345 IsStmtReference =
true;
2346 assert(StmtEntries.find(Record[0]) != StmtEntries.end() &&
2347 "No stmt was recorded for this offset reference!");
2348 S = StmtEntries[Record.
readInt()];
2367 Record[ASTStmtReader::NumStmtFields + 3]);
2381 Record[ASTStmtReader::NumStmtFields]);
2387 Record[ASTStmtReader::NumStmtFields + 1],
2388 Record[ASTStmtReader::NumStmtFields + 2],
2389 Record[ASTStmtReader::NumStmtFields + 3]);
2395 Record[ASTStmtReader::NumStmtFields],
2396 Record[ASTStmtReader::NumStmtFields + 1]);
2402 Record[ASTStmtReader::NumStmtFields]);
2406 S =
new (Context)
DoStmt(Empty);
2410 S =
new (Context)
ForStmt(Empty);
2431 Context, Record[ASTStmtReader::NumStmtFields]);
2448 Context, Record[ASTStmtReader::NumStmtFields]);
2464 Record[ASTStmtReader::NumExprFields],
2465 Record[ASTStmtReader::NumExprFields + 1],
2466 Record[ASTStmtReader::NumExprFields + 2],
2467 Record[ASTStmtReader::NumExprFields + 2] ?
2468 Record[ASTStmtReader::NumExprFields + 5] : 0);
2486 Record[ASTStmtReader::NumExprFields],
2487 Record[ASTStmtReader::NumExprFields + 1],
2488 Record[ASTStmtReader::NumExprFields + 2]);
2502 Record[ASTStmtReader::NumExprFields]);
2511 Record[ASTStmtReader::NumExprFields],
2512 Record[ASTStmtReader::NumExprFields + 1]);
2529 Context, Record[ASTStmtReader::NumExprFields], Empty);
2537 assert(Record.
getIdx() == 0);
2545 bool HasTemplateKWAndArgsInfo = Record.
readInt();
2546 if (HasTemplateKWAndArgsInfo) {
2548 unsigned NumTemplateArgs = Record.
readInt();
2551 for (
unsigned i = 0; i != NumTemplateArgs; ++i)
2555 bool HadMultipleCandidates = Record.
readInt();
2568 bool IsArrow = Record.
readInt();
2572 TemplateKWLoc, MemberD, FoundDecl, MemberNameInfo,
2573 HasTemplateKWAndArgsInfo ? &ArgInfo :
nullptr, T,
2576 MemberD->getDeclName());
2577 if (HadMultipleCandidates)
2578 cast<MemberExpr>(S)->setHadMultipleCandidates(
true);
2600 Record[ASTStmtReader::NumExprFields]);
2605 Record[ASTStmtReader::NumExprFields]);
2622 Record[ASTStmtReader::NumExprFields] - 1);
2692 Record[ASTStmtReader::NumExprFields]);
2697 Record[ASTStmtReader::NumExprFields],
2698 Record[ASTStmtReader::NumExprFields + 1]);
2726 llvm_unreachable(
"mismatching AST file");
2730 Record[ASTStmtReader::NumExprFields],
2731 Record[ASTStmtReader::NumExprFields + 1]);
2760 Record[ASTStmtReader::NumStmtFields],
2761 Record[ASTStmtReader::NumStmtFields + 1]);
2806 Record[ASTStmtReader::NumStmtFields]);
2823 Record[ASTStmtReader::NumStmtFields],
2829 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2831 CollapsedNum, Empty);
2837 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2845 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2853 Context, Record[ASTStmtReader::NumStmtFields], Empty);
2862 Context, Record[ASTStmtReader::NumStmtFields], Empty);
2871 Context, Record[ASTStmtReader::NumStmtFields], Empty);
2876 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2878 CollapsedNum, Empty);
2884 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2886 CollapsedNum, Empty);
2892 Context, Record[ASTStmtReader::NumStmtFields], Empty);
2897 Context, Record[ASTStmtReader::NumStmtFields], Empty);
2914 Context, Record[ASTStmtReader::NumStmtFields], Empty);
2919 Context, Record[ASTStmtReader::NumStmtFields], Empty);
2924 Context, Record[ASTStmtReader::NumStmtFields], Empty);
2929 Context, Record[ASTStmtReader::NumStmtFields], Empty);
2934 Context, Record[ASTStmtReader::NumStmtFields], Empty);
2939 Context, Record[ASTStmtReader::NumStmtFields], Empty);
2944 Context, Record[ASTStmtReader::NumStmtFields], Empty);
2949 Context, Record[ASTStmtReader::NumStmtFields], Empty);
2954 Context, Record[ASTStmtReader::NumStmtFields], Empty);
2959 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2961 CollapsedNum, Empty);
2967 Context, Record[ASTStmtReader::NumStmtFields], Empty);
2972 Context, Record[ASTStmtReader::NumStmtFields], Empty);
2981 Context, Record[ASTStmtReader::NumStmtFields], Empty);
2986 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2994 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
2996 CollapsedNum, Empty);
3002 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3010 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3012 CollapsedNum, Empty);
3018 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3027 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3029 CollapsedNum, Empty);
3035 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3037 CollapsedNum, Empty);
3043 auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3051 auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3053 CollapsedNum, Empty);
3059 unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3061 CollapsedNum, Empty);
3067 auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3069 Context, NumClauses, CollapsedNum, Empty);
3075 auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3077 Context, NumClauses, CollapsedNum, Empty);
3083 Context, Record[ASTStmtReader::NumStmtFields], Empty);
3088 auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3090 CollapsedNum, Empty);
3096 auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3098 Context, NumClauses, CollapsedNum, Empty);
3104 auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3106 Context, NumClauses, CollapsedNum, Empty);
3112 auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
3114 Context, NumClauses, CollapsedNum, Empty);
3120 Context, Record[ASTStmtReader::NumExprFields], Empty);
3125 Context, Record[ASTStmtReader::NumExprFields], Empty);
3131 Record[ASTStmtReader::NumExprFields]);
3141 Record[ASTStmtReader::NumExprFields]);
3146 Record[ASTStmtReader::NumExprFields]);
3151 Record[ASTStmtReader::NumExprFields]);
3156 Record[ASTStmtReader::NumExprFields]);
3165 Record[ASTStmtReader::NumExprFields]);
3170 Context, Record[ASTStmtReader::NumExprFields], Empty);
3236 Record[ASTStmtReader::NumExprFields],
3237 Record[ASTStmtReader::NumExprFields + 1],
3238 Record[ASTStmtReader::NumExprFields + 2],
3239 Record[ASTStmtReader::NumExprFields + 3]);
3252 Record[ASTStmtReader::NumExprFields]);
3258 Record[ASTStmtReader::NumExprFields],
3259 Record[ASTStmtReader::NumExprFields + 1],
3261 Record[ASTStmtReader::NumExprFields + 2]);
3266 Record[ASTStmtReader::NumExprFields],
3267 Record[ASTStmtReader::NumExprFields]
3268 ? Record[ASTStmtReader::NumExprFields + 1]
3274 Record[ASTStmtReader::NumExprFields]);
3280 Record[ASTStmtReader::NumExprFields],
3281 Record[ASTStmtReader::NumExprFields + 1],
3283 Record[ASTStmtReader::NumExprFields + 1]
3284 ? Record[ASTStmtReader::NumExprFields + 2]
3291 Record[ASTStmtReader::NumExprFields],
3292 Record[ASTStmtReader::NumExprFields + 1],
3294 Record[ASTStmtReader::NumExprFields + 1]
3295 ? Record[ASTStmtReader::NumExprFields + 2]
3301 Record[ASTStmtReader::NumExprFields]);
3323 Record[ASTStmtReader::NumExprFields]);
3336 Record[ASTStmtReader::NumExprFields]);
3353 Context, Record[ASTStmtReader::NumExprFields], Empty);
3403 ++NumStatementsRead;
3405 if (S && !IsStmtReference) {
3407 StmtEntries[Cursor.GetCurrentBitNo()] = S;
3411 "Invalid deserialization of statement");
3412 StmtStack.push_back(S);
3415 assert(StmtStack.size() > PrevNumStmts &&
"Read too many sub-stmts!");
3416 assert(StmtStack.size() == PrevNumStmts + 1 &&
"Extra expressions on stack!");
3417 return StmtStack.pop_back_val();
void setPreInits(Stmt *PreInits)
void setCombinedParForInDistCond(Expr *CombParForInDistCond)
A CXXConstCastExpr record.
static AttributedStmt * CreateEmpty(const ASTContext &C, unsigned NumAttrs)
void setFPFeatures(FPOptions F)
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
const uint64_t & readInt()
Returns the current value in this record, and advances to the next value.
A call to an overloaded operator written using operator syntax.
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
The receiver is the instance of the superclass object.
Represents a single C99 designator.
void setConditionVariable(const ASTContext &C, VarDecl *V)
static DependentScopeDeclRefExpr * CreateEmpty(const ASTContext &Context, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
void setValueDependent(bool VD)
Set whether this expression is value-dependent or not.
Defines the clang::ASTContext interface.
void setRParenLoc(SourceLocation L)
A CompoundLiteralExpr record.
This represents '#pragma omp distribute simd' composite directive.
This represents '#pragma omp master' directive.
DesignatorTypes
The kinds of designators that can occur in a DesignatedInitExpr.
void setRangeStmt(Stmt *S)
SourceLocation readSourceLocation()
Read a source location, advancing Idx.
The null pointer literal (C++11 [lex.nullptr])
unsigned getNumDecls() const
Gets the number of declarations in the unresolved set.
This represents '#pragma omp task' directive.
void setEnsureUpperBound(Expr *EUB)
This represents a GCC inline-assembly statement extension.
static CXXConstructExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs)
Create an empty C++ construction expression.
Represents a 'co_await' expression while the type of the promise is dependent.
void setSubStmt(CompoundStmt *S)
A UserDefinedLiteral record.
The receiver is an object instance.
unsigned getNumInputs() const
static OMPMasterDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
UnresolvedMemberExprBitfields UnresolvedMemberExprBits
An IndirectGotoStmt record.
A (possibly-)qualified type.
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument.
StringKind getKind() const
void setOperatorLoc(SourceLocation L)
CXXDeleteExprBitfields CXXDeleteExprBits
void setRawSemantics(APFloatSemantics Sem)
Set the raw enumeration value representing the floating-point semantics of this literal (32-bit IEEE...
void setNRVOCandidate(const VarDecl *Var)
Set the variable that might be used for the named return value optimization.
Defines enumerations for the type traits support.
void setLocation(SourceLocation L)
A CXXStaticCastExpr record.
ASTStmtReader(ASTRecordReader &Record, llvm::BitstreamCursor &Cursor)
void setCombinedCond(Expr *CombCond)
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
An AttributedStmt record.
A CXXReinterpretCastExpr record.
An ObjCBoolLiteralExpr record.
void setCombinedLowerBoundVariable(Expr *CombLB)
static OMPTaskwaitDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static OMPTargetParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setHasCancel(bool Has)
Set cancel state.
Represents a 'co_return' statement in the C++ Coroutines TS.
Stmt - This represents one statement.
static OMPTaskgroupDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
void setLastIteration(Expr *LI)
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
IfStmt - This represents an if/then/else.
void setPrivateCounters(ArrayRef< Expr *> A)
C Language Family Type Representation.
unsigned getNumOutputs() const
This represents '#pragma omp for simd' directive.
void setOpcode(Opcode Opc)
void setRParenLoc(SourceLocation L)
void setContinueLoc(SourceLocation L)
void setThrowExpr(Stmt *S)
void setAtLoc(SourceLocation L)
An ImplicitValueInitExpr record.
Decl - This represents one declaration (or definition), e.g.
void setDeclGroup(DeclGroupRef DGR)
An ImplicitCastExpr record.
This represents '#pragma omp teams distribute parallel for' composite directive.
void setRBracket(SourceLocation RB)
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
LambdaCaptureDefault
The default, if any, capture method for a lambda expression.
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Defines the C++ template declaration subclasses.
void setPrevEnsureUpperBound(Expr *PrevEUB)
unsigned getNumSubExprs() const
Retrieve the total number of subexpressions in this designated initializer expression, including the actual initialized value and any expressions that occur within array and array-range designators.
Represents an attribute applied to a statement.
void setUpperBoundVariable(Expr *UB)
void setComputationResultType(QualType T)
llvm::APFloat readAPFloat(const llvm::fltSemantics &Sem)
Read a floating-point value, advancing Idx.
void setNumIterations(Expr *NI)
ParenExpr - This represents a parethesized expression, e.g.
A CXXOperatorCallExpr record.
void setSuper(SourceLocation Loc, QualType T, bool IsInstanceSuper)
This represents '#pragma omp target teams distribute' combined directive.
A CXXTemporaryObjectExpr record.
Represents Objective-C's @throw statement.
void setNextLowerBound(Expr *NLB)
DeclRefExprBitfields DeclRefExprBits
Represents a call to a C++ constructor.
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
void setADLCallKind(ADLCallKind V=UsesADL)
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent...
A constant expression context.
const TargetInfo & getTargetInfo() const
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
A container of type source information.
void setSwitchCaseList(SwitchCase *SC)
void setCanOverflow(bool C)
void setInstanceReceiver(Expr *rec)
Turn this message send into an instance message that computes the receiver object with the given expr...
Floating point control options.
This represents '#pragma omp parallel for' directive.
MS property subscript expression.
void setStartLoc(SourceLocation L)
void setForLoc(SourceLocation L)
This represents '#pragma omp target teams distribute parallel for' combined directive.
static ObjCDictionaryLiteral * CreateEmpty(const ASTContext &C, unsigned NumElements, bool HasPackExpansions)
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
void setLocation(SourceLocation L)
void setDelegateInitCall(bool isDelegate)
void setProtocol(ObjCProtocolDecl *P)
void setRParenLoc(SourceLocation L)
void setIsLastIterVariable(Expr *IL)
This represents '#pragma omp target exit data' directive.
void setRAngleLoc(SourceLocation Loc)
static OffsetOfExpr * CreateEmpty(const ASTContext &C, unsigned NumComps, unsigned NumExprs)
static OMPTargetTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for N clauses.
bool hasTemplateKWAndArgsInfo() const
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC 'id' type.
void setIsPartOfExplicitCast(bool PartOfExplicitCast)
CompoundLiteralExpr - [C99 6.5.2.5].
void setSubExpr(unsigned Idx, Expr *E)
void setInitializer(Expr *E)
void setLength(Expr *E)
Set length of the array section.
void setOpLoc(SourceLocation L)
void recordSwitchCaseID(SwitchCase *SC, unsigned ID)
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
static FunctionParmPackExpr * CreateEmpty(const ASTContext &Context, unsigned NumParams)
void setAsmLoc(SourceLocation L)
AttributedStmtBitfields AttributedStmtBits
QualType readType()
Read a type from the current position in the record.
static PredefinedExpr * CreateEmpty(const ASTContext &Ctx, bool HasFunctionName)
Create an empty PredefinedExpr.
void setCombinedDistCond(Expr *CombDistCond)
void setValue(unsigned Val)
A ConditionOperator record.
void setLocation(SourceLocation Location)
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
static DeclRefExpr * CreateEmpty(const ASTContext &Context, bool HasQualifier, bool HasFoundDecl, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Construct an empty declaration reference expression.
unsigned getNumPlacementArgs() const
void setGNUSyntax(bool GNU)
Defines the Objective-C statement AST node classes.
A CXXConstructExpr record.
unsigned getNumExpressions() const
void setBeginStmt(Stmt *S)
void setBase(Expr *E)
Set base of the array section.
ReceiverKind
The kind of receiver this message is sending to.
raw_arg_iterator raw_arg_begin()
A C++ throw-expression (C++ [except.throw]).
Represents an expression – generally a full-expression – that introduces cleanups to be run at the ...
Represents a parameter to a function.
Defines the clang::Expr interface and subclasses for C++ expressions.
A ShuffleVectorExpr record.
A C++ static_cast expression (C++ [expr.static.cast]).
LabelStmt - Represents a label, which has a substatement.
static OMPTargetExitDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
void setAtLoc(SourceLocation L)
Represents a C99 designated initializer expression.
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
NestedNameSpecifierLoc readNestedNameSpecifierLoc()
static OMPTargetTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
One of these records is kept for each identifier that is lexed.
An ObjCAtThrowStmt record.
T * readDeclAs()
Reads a declaration from the given position in the record, advancing Idx.
static OMPTargetDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
A DesignatedInitExpr record.
This represents '#pragma omp parallel' directive.
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
void setExprOperand(Expr *E)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
A C++ nested-name-specifier augmented with source location information.
static OMPTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Internal struct for storing Key/value pair.
An ObjCProtocolExpr record.
An ObjCSelectorExpr record.
static OMPTargetParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static ObjCMessageExpr * CreateEmpty(const ASTContext &Context, unsigned NumArgs, unsigned NumStoredSelLocs)
Create an empty Objective-C message expression, to be filled in by subsequent calls.
void setIsMicrosoftABI(bool IsMS)
Represents a place-holder for an object not to be initialized by anything.
static OMPFlushDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
void setArg(unsigned I, Expr *E)
void setArg(unsigned Arg, Expr *ArgExpr)
setArg - Set the specified argument.
The iterator over UnresolvedSets.
void setRParen(SourceLocation Loc)
TemplateArgument readTemplateArgument(bool Canonicalize=false)
Read a template argument, advancing Idx.
This represents '#pragma omp target simd' directive.
void setCapturedDecl(CapturedDecl *D)
Set the outlined function declaration.
void setReturnLoc(SourceLocation L)
Represents a C++ member access expression for which lookup produced a set of overloaded functions...
Defines some OpenMP-specific enums and functions.
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
OpenMPDirectiveKind getDirectiveKind() const
void setIfLoc(SourceLocation IfLoc)
This represents '#pragma omp barrier' directive.
void setComponent(unsigned Idx, OffsetOfNode ON)
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp, [NSNumber numberWithInt:42]];.
TypeSourceInfo * getTypeSourceInfo()
Reads a declarator info from the given record, advancing Idx.
unsigned getCharByteWidth() const
This is a common base class for loop directives ('omp simd', 'omp for', 'omp for simd' etc...
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
This represents '#pragma omp critical' directive.
static OMPCriticalDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
void setRParenLoc(SourceLocation L)
size_t size() const
The length of this record.
void setSubExpr(Expr *E)
As with any mutator of the AST, be very careful when modifying an existing AST to preserve its invari...
Represents Objective-C's @catch statement.
void setLBraceLoc(SourceLocation Loc)
static OMPTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
IndirectGotoStmt - This represents an indirect goto.
Describes an C or C++ initializer list.
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
This represents '#pragma omp distribute parallel for' composite directive.
void setValue(const ASTContext &C, const llvm::APInt &Val)
This represents '#pragma omp teams distribute parallel for simd' composite directive.
void setBuiltinLoc(SourceLocation L)
unsigned getLength() const
ForStmt - This represents a 'for (init;cond;inc)' stmt.
void setOperatorNew(FunctionDecl *D)
static DeclAccessPair make(NamedDecl *D, AccessSpecifier AS)
void setLocation(SourceLocation L)
CXXScalarValueInitExprBitfields CXXScalarValueInitExprBits
static OMPDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setSynchBody(Stmt *S)
A convenient class for passing around template argument information.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
void setSelector(Selector S)
A reference to a previously [de]serialized Stmt record.
void setEndLoc(SourceLocation L)
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
path_iterator path_begin()
void setLocation(SourceLocation L)
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
A builtin binary operation expression such as "x + y" or "x <= y".
static OMPTargetTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setAccessor(IdentifierInfo *II)
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
SourceRange readSourceRange()
Read a source range, advancing Idx.
static const unsigned NumStmtFields
The number of record fields required for the Stmt class itself.
This represents '#pragma omp cancellation point' directive.
void setString(StringLiteral *S)
void setAsmString(StringLiteral *E)
ObjCStringLiteral, used for Objective-C string literals i.e.
CaseStmt - Represent a case statement.
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
void setCombinedInit(Expr *CombInit)
This represents '#pragma omp teams' directive.
void setOperatorLoc(SourceLocation L)
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Helper class for OffsetOfExpr.
A marker record that indicates that we are at the end of an expression.
This represents '#pragma omp teams distribute simd' combined directive.
static OMPTargetParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Represents binding an expression to a temporary.
void setDestroyedType(IdentifierInfo *II, SourceLocation Loc)
Set the name of destroyed type for a dependent pseudo-destructor expression.
ArrayTypeTrait
Names for the array type traits.
bool isOpenMPWorksharingDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a worksharing directive.
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
static OMPTaskyieldDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
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'.
void setOpcode(Opcode Opc)
void ReadTemplateKWAndArgsInfo(ASTTemplateKWAndArgsInfo &Args, TemplateArgumentLoc *ArgsLocArray, unsigned NumTemplateArgs)
Read and initialize a ExplicitTemplateArgumentList structure.
DeclAccessPair * getTrailingResults()
Return the results. Defined after UnresolvedMemberExpr.
Represents a C++ member access expression where the actual member referenced could not be resolved be...
void setRParenLoc(SourceLocation Loc)
CXXBaseSpecifier readCXXBaseSpecifier()
Read a C++ base specifier, advancing Idx.
void setRParenLoc(SourceLocation R)
A default argument (C++ [dcl.fct.default]).
bool isTypeOperand() const
const uint64_t & peekInt()
Returns the current value in this record, without advancing.
void setSourceRange(SourceRange R)
void setRParenLoc(SourceLocation L)
Represents the this expression in C++.
void setCastKind(CastKind K)
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
static OMPTargetDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
static OMPTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
PredefinedExprBitfields PredefinedExprBits
void setEqualOrColonLoc(SourceLocation L)
This represents '#pragma omp target parallel for simd' directive.
void setArgument(Expr *E)
OpenMP 4.0 [2.4, Array Sections].
void setTypeSourceInfo(TypeSourceInfo *tsi)
ConditionalOperator - The ?: ternary operator.
static OMPTargetSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
void setAmpAmpLoc(SourceLocation L)
void setBreakLoc(SourceLocation L)
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
CompoundStmt - This represents a group of statements like { stmt stmt }.
void setBlockDecl(BlockDecl *BD)
This represents '#pragma omp taskgroup' directive.
static OMPSingleDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
CastKind
CastKind - The kind of operation required for a conversion.
void setSemiLoc(SourceLocation L)
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
void setLParen(SourceLocation Loc)
ConstantExpr - An expression that occurs in a constant context.
Represents a call to the builtin function __builtin_va_arg.
static OMPTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setLeaveLoc(SourceLocation L)
void setConditionVariable(const ASTContext &Ctx, VarDecl *V)
Set the condition variable for this if statement.
This represents '#pragma omp distribute' directive.
SubstNonTypeTemplateParmExprBitfields SubstNonTypeTemplateParmExprBits
void setInits(ArrayRef< Expr *> A)
void setOperatorDelete(FunctionDecl *D)
void setRParenLoc(SourceLocation L)
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type...
void setLocation(SourceLocation Location)
void setRParenLoc(SourceLocation Loc)
Pepresents a block literal declaration, which is like an unnamed FunctionDecl.
static OMPSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
This represents one expression.
Defines the clang::LangOptions interface.
void setDesignators(const ASTContext &C, const Designator *Desigs, unsigned NumDesigs)
void setRBraceLoc(SourceLocation Loc)
void setIsImplicit(bool value=true)
void setWhileLoc(SourceLocation L)
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
void setRParenLoc(SourceLocation L)
void setLParenLoc(SourceLocation L)
Stmt * ReadStmt(ModuleFile &F)
Reads a statement.
static CXXMemberCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, EmptyShell Empty)
void setSyntacticForm(InitListExpr *Init)
Represents a C++ functional cast expression that builds a temporary object.
static ReturnStmt * CreateEmpty(const ASTContext &Ctx, bool HasNRVOCandidate)
Create an empty return statement, optionally with storage for an NRVO candidate.
void setRBracketLoc(SourceLocation L)
A C++ const_cast expression (C++ [expr.const.cast]).
void setTypeDependent(bool TD)
Set whether this expression is type-dependent or not.
void setTypeOperandSourceInfo(TypeSourceInfo *TSI)
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Field designator where only the field name is known.
static OMPDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
An ObjCSubscriptRefExpr record.
Defines an enumeration for C++ overloaded operators.
This represents '#pragma omp target teams distribute parallel for simd' combined directive.
raw_arg_iterator raw_arg_end()
static CXXReinterpretCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
void setUuidStr(StringRef US)
void setWrittenTypeInfo(TypeSourceInfo *TI)
void setRetValue(Expr *E)
unsigned getNumTemplateArgs() const
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
void setObjectKind(ExprObjectKind Cat)
setObjectKind - Set the object kind produced by this expression.
bool hasQualifier() const
Determine whether this declaration reference was preceded by a C++ nested-name-specifier, e.g., N::foo.
static UserDefinedLiteral * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, EmptyShell Empty)
Represents Objective-C's @synchronized statement.
ObjCSelectorExpr used for @selector in Objective-C.
A CXXStdInitializerListExpr record.
void setFinallyBody(Stmt *S)
Represents an expression that computes the length of a parameter pack.
CXXTryStmt - A C++ try block, including all handlers.
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
An ArraySubscriptExpr record.
Decl * readDecl()
Reads a declaration from the given position in a record in the given module, advancing Idx...
static FloatingLiteral * Create(const ASTContext &C, const llvm::APFloat &V, bool isexact, QualType Type, SourceLocation L)
This represents '#pragma omp target teams distribute simd' combined directive.
CXXDefaultInitExprBitfields CXXDefaultInitExprBits
Information about a module that has been loaded by the ASTReader.
ExprWithCleanupsBitfields ExprWithCleanupsBits
An ArrayInitLoopExpr record.
unsigned getNumClauses() const
Get number of clauses.
A PseudoObjectExpr record.
void setColonLoc(SourceLocation L)
void setFinallyStmt(Stmt *S)
CompoundStmtBitfields CompoundStmtBits
An ObjCIndirectCopyRestoreExpr record.
This represents '#pragma omp for' directive.
IdentifierInfo * getIdentifierInfo()
static OMPTargetEnterDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
void setValueKind(ExprValueKind Cat)
setValueKind - Set the value kind produced by this expression.
StringLiteralBitfields StringLiteralBits
void setRParenLoc(SourceLocation L)
bool hasInitializer() const
Whether this new-expression has any initializer at all.
Represents a folding of a pack over an operator.
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
This represents '#pragma omp target teams' directive.
void setAssociatedStmt(Stmt *S)
Set the associated statement for the directive.
static OMPDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
An expression that sends a message to the given Objective-C object or class.
This represents a Microsoft inline-assembly statement extension.
void setColonLoc(SourceLocation L)
void setRParenLoc(SourceLocation L)
A DesignatedInitUpdateExpr record.
SourceLocation getEnd() const
void setAtLoc(SourceLocation L)
UnaryOperator - This represents the unary-expression's (except sizeof and alignof), the postinc/postdec operators from postfix-expression, and various extensions.
bool isOpenMPTaskLoopDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a taskloop directive.
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
A member reference to an MSPropertyDecl.
static OMPParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static UnresolvedLookupExpr * CreateEmpty(const ASTContext &Context, unsigned NumResults, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Represents a reference to a non-type template parameter that has been substituted with a template arg...
void setForLoc(SourceLocation Loc)
This represents '#pragma omp cancel' directive.
void setDistInc(Expr *DistInc)
An ObjCAvailabilityCheckExpr record.
void setRParenLoc(SourceLocation L)
std::string readString()
Read a string, advancing Idx.
void setConditionVariable(const ASTContext &Ctx, VarDecl *V)
Set the condition variable of this while statement.
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr.cast]), which uses the syntax (Type)expr.
static OMPDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setClauses(ArrayRef< OMPClause *> Clauses)
Sets the list of variables for this clause.
An ObjCPropertyRefExpr record.
void skipInts(unsigned N)
Skips the specified number of values.
This file defines OpenMP AST classes for clauses.
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1...
An ObjCForCollectionStmt record.
This represents '#pragma omp flush' directive.
This represents '#pragma omp parallel for simd' directive.
void setRParenLoc(SourceLocation L)
void setAtTryLoc(SourceLocation Loc)
DoStmt - This represents a 'do/while' stmt.
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
void setTypeOperandSourceInfo(TypeSourceInfo *TSI)
A MS-style AsmStmt record.
unsigned readRecord(llvm::BitstreamCursor &Cursor, unsigned AbbrevID)
Reads a record with id AbbrevID from Cursor, resetting the internal state.
void setConditionVariable(const ASTContext &Ctx, VarDecl *VD)
Set the condition variable in this switch statement.
void setLocStart(SourceLocation Loc)
Set starting location of directive kind.
OpaqueValueExprBitfields OpaqueValueExprBits
static OMPParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static CoroutineBodyStmt * Create(const ASTContext &C, CtorArgs const &Args)
void setSynchExpr(Stmt *S)
This represents '#pragma omp target enter data' directive.
void setUpdates(ArrayRef< Expr *> A)
const llvm::fltSemantics & getSemantics() const
Return the APFloat semantics this literal uses.
void setLowerBoundVariable(Expr *LB)
void setLParenLoc(SourceLocation L)
void setTypeSourceInfo(TypeSourceInfo *tinfo)
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
void setComputationLHSType(QualType T)
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
unsigned getNumArgs() const
Return the number of actual arguments in this message, not counting the receiver. ...
static OMPSectionDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
void setDecl(LabelDecl *D)
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr...
A field in a dependent type, known only by its name.
This captures a statement into a function.
Represents a call to an inherited base class constructor from an inheriting constructor.
unsigned path_size() const
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
void setLParenLoc(SourceLocation L)
void setAccessorLoc(SourceLocation L)
void setGotoLoc(SourceLocation L)
static CXXDynamicCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
CXXTemporary * readCXXTemporary()
unsigned getNumExprs() const
Return the number of expressions in this paren list.
void setLocation(SourceLocation L)
This represents '#pragma omp single' directive.
Encodes a location in the source.
void setLocation(SourceLocation L)
void setPrevLowerBoundVariable(Expr *PrevLB)
void setIterationVariable(Expr *IV)
Defines enumerations for expression traits intrinsics.
PseudoObjectExprBitfields PseudoObjectExprBits
Stmt * readSubStmt()
Reads a sub-statement operand during statement reading.
static CXXOperatorCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, EmptyShell Empty)
UnresolvedLookupExprBitfields UnresolvedLookupExprBits
unsigned getNumHandlers() const
void setUpdater(Expr *Updater)
CXXThrowExprBitfields CXXThrowExprBits
static OMPTaskDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This is a basic class for representing single OpenMP executable directive.
static OMPTargetUpdateDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setDoLoc(SourceLocation L)
static CXXConstCastExpr * CreateEmpty(const ASTContext &Context)
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
void setCombinedNextLowerBound(Expr *CombNLB)
void setAtCatchLoc(SourceLocation Loc)
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c dictionary literal.
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit...
void setSourceRange(SourceRange R)
static ObjCAtTryStmt * CreateEmpty(const ASTContext &Context, unsigned NumCatchStmts, bool HasFinally)
void setConstexpr(bool C)
Represents a call to a member function that may be written either with member call syntax (e...
static StringLiteral * CreateEmpty(const ASTContext &Ctx, unsigned NumConcatenated, unsigned Length, unsigned CharByteWidth)
Construct an empty string literal.
void setIdentLoc(SourceLocation L)
Defines several types used to describe C++ lambda expressions that are shared between the parser and ...
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
void setLabelLoc(SourceLocation L)
void readDeclarationNameInfo(DeclarationNameInfo &NameInfo)
ExprObjectKind
A further classification of the kind of object referenced by an l-value or x-value.
A CXXFunctionalCastExpr record.
void setTemporary(CXXTemporary *T)
A FloatingLiteral record.
static ExprWithCleanups * Create(const ASTContext &C, EmptyShell empty, unsigned numObjects)
void setAllEnumCasesCovered()
Set a flag in the SwitchStmt indicating that if the 'switch (X)' is a switch over an enum value then ...
Expr * readSubExpr()
Reads a sub-expression operand during statement reading.
StmtVisitor - This class implements a simple visitor for Stmt subclasses.
void setClassReceiver(TypeSourceInfo *TSInfo)
void setCatchParamDecl(VarDecl *D)
An ObjCEncodeExpr record.
static OMPAtomicDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp taskwait' directive.
An ImaginaryLiteral record.
void setConfig(CallExpr *E)
Sets the kernel configuration expression.
void setIsFreeIvar(bool A)
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load, __atomic_store, and __atomic_compare_exchange_*, for the similarly-named C++11 instructions, and __c11 variants for <stdatomic.h>, and corresponding __opencl_atomic_* for OpenCL 2.0.
void readDeclarationNameLoc(DeclarationNameLoc &DNLoc, DeclarationName Name)
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...
static OMPOrderedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
bool isOpenMPLoopBoundSharingDirective(OpenMPDirectiveKind Kind)
Checks if the specified directive kind is one of the composite or combined directives that need loop ...
void addDecl(NamedDecl *D)
ObjCProtocolExpr used for protocol expression in Objective-C.
static WhileStmt * CreateEmpty(const ASTContext &Ctx, bool HasVar)
Create an empty while statement optionally with storage for a condition variable. ...
bool isValueDependent() const
isValueDependent - Determines whether this expression is value-dependent (C++ [temp.dep.constexpr]).
void setDecl(ValueDecl *NewD)
void setThrowLoc(SourceLocation Loc)
unsigned getIdx() const
The current position in this record.
ASTContext & getContext()
Retrieve the AST context that this AST reader supplements.
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Stmt * getCapturedStmt()
Retrieve the statement being captured.
This represents '#pragma omp target' directive.
static OMPTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static DesignatedInitExpr * CreateEmpty(const ASTContext &C, unsigned NumIndexExprs)
static DeclGroup * Create(ASTContext &C, Decl **Decls, unsigned NumDecls)
bool isParenTypeId() const
static OMPTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setBaseExpr(Stmt *S)
NullStmtBitfields NullStmtBits
An expression trait intrinsic.
void setEncodedTypeSourceInfo(TypeSourceInfo *EncType)
static CXXDependentScopeMemberExpr * CreateEmpty(const ASTContext &Ctx, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs, bool HasFirstQualifierFoundInScope)
This represents '#pragma omp ordered' directive.
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
static SizeOfPackExpr * CreateDeserialized(ASTContext &Context, unsigned NumPartialArgs)
This represents '#pragma omp target update' directive.
ObjCBoxedExpr - used for generalized expression boxing.
void setLAngleLoc(SourceLocation Loc)
void sawArrayRangeDesignator(bool ARD=true)
static CXXTemporaryObjectExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs)
void addArgument(const TemplateArgumentLoc &Loc)
void setCapturedRecordDecl(RecordDecl *D)
Set the record declaration for captured variables.
Representation of a Microsoft __if_exists or __if_not_exists statement with a dependent name...
static MemberExpr * Create(const ASTContext &C, Expr *base, bool isarrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, ValueDecl *memberdecl, DeclAccessPair founddecl, DeclarationNameInfo MemberNameInfo, const TemplateArgumentListInfo *targs, QualType ty, ExprValueKind VK, ExprObjectKind OK)
A placeholder type used to construct an empty shell of a type, that will be filled in later (e...
A qualified reference to a name whose declaration cannot yet be resolved.
void setRBracketLoc(SourceLocation L)
void readAttributes(AttrVec &Attrs)
Reads attributes from the current stream position, advancing Idx.
CompoundAssignOperator - For compound assignments (e.g.
Expr ** getElements()
Retrieve elements of array of literals.
Defines various enumerations that describe declaration and type specifiers.
A POD class for pairing a NamedDecl* with an access specifier.
DeclarationNameLoc - Additional source/type location info for a declaration name. ...
Represents a C11 generic selection.
AddrLabelExpr - The GNU address of label extension, representing &&label.
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers...
Represents a reference to a function parameter pack that has been substituted but not yet expanded...
Represents a template argument.
void setGotoLoc(SourceLocation L)
void setPrevUpperBoundVariable(Expr *PrevUB)
static CXXUnresolvedConstructExpr * CreateEmpty(const ASTContext &Context, unsigned NumArgs)
void setCombinedEnsureUpperBound(Expr *CombEUB)
static OMPForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setLocation(SourceLocation L)
NullStmt - This is the null statement ";": C99 6.8.3p3.
void setCounters(ArrayRef< Expr *> A)
bool isTypeOperand() const
unsigned getNumAssocs() const
Dataflow Directional Tag Classes.
void setExtendingDecl(const ValueDecl *ExtendedBy, unsigned ManglingNumber)
An IntegerLiteral record.
llvm::BitstreamCursor DeclsCursor
DeclsCursor - This is a cursor to the start of the DECLS_BLOCK block.
void setBuiltinLoc(SourceLocation L)
[C99 6.4.2.2] - A predefined identifier such as func.
A CXXBoolLiteralExpr record.
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
void setCombinedUpperBoundVariable(Expr *CombUB)
void setRParenLoc(SourceLocation L)
static CapturedStmt * CreateDeserialized(const ASTContext &Context, unsigned NumCaptures)
An ExtVectorElementExpr record.
void setLabel(LabelDecl *L)
static OMPTargetTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setTypeInfoAsWritten(TypeSourceInfo *writtenTy)
This represents '#pragma omp section' directive.
void setAtLoc(SourceLocation L)
This represents '#pragma omp teams distribute' directive.
Selector readSelector()
Read a selector from the Record, advancing Idx.
Expr * ReadExpr(ModuleFile &F)
Reads an expression.
void setExprs(const ASTContext &C, ArrayRef< Expr *> Exprs)
void setCollection(Expr *E)
An ObjCIvarRefExpr record.
void setDecl(ObjCIvarDecl *d)
void setFileScope(bool FS)
A runtime availability query.
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
This represents '#pragma omp simd' directive.
Represents a 'co_yield' expression.
An ObjCAutoreleasePoolStmt record.
The name of a declaration.
StmtClass getStmtClass() const
A CharacterLiteral record.
Represents a C++11 pack expansion that produces a sequence of expressions.
An ObjCStringLiteral record.
A CXXDynamicCastExpr record.
static LambdaExpr * CreateDeserialized(const ASTContext &C, unsigned NumCaptures)
Construct a new lambda expression that will be deserialized from an external source.
static PseudoObjectExpr * Create(const ASTContext &Context, Expr *syntactic, ArrayRef< Expr *> semantic, unsigned resultIndex)
void setInstantiationDependent(bool ID)
Set whether this expression is instantiation-dependent or not.
void setEllipsisLoc(SourceLocation L)
Set the location of the ...
A CXXForRangeStmt record.
Kind
The kind of offsetof node we have.
TemplateArgumentLoc readTemplateArgumentLoc()
Reads a TemplateArgumentLoc, advancing Idx.
void setLParenLoc(SourceLocation L)
void setSelector(Selector S)
ExplicitCastExpr - An explicit cast written in the source code.
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
void setMethodDecl(ObjCMethodDecl *MD)
This represents '#pragma omp atomic' directive.
static CompoundStmt * CreateEmpty(const ASTContext &C, unsigned NumStmts)
pack_iterator pack_begin() const
Iterator referencing the first argument of a template argument pack.
An ObjCAtFinallyStmt record.
VersionTuple readVersionTuple()
Read a version tuple, advancing Idx.
CXXNewExprBitfields CXXNewExprBits
Represents a __leave statement.
unsigned getCollapsedNumber() const
Get number of collapsed loops.
unsigned getNumSubExprs() const
void setRBracketLoc(SourceLocation L)
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
SwitchStmt - This represents a 'switch' stmt.
CXXConstructExprBitfields CXXConstructExprBits
static OMPForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Represents the body of a coroutine.
TemplateArgumentLoc * getTrailingTemplateArgumentLoc()
Return the optional template arguments.
Location wrapper for a TemplateArgument.
bool isOpenMPDistributeDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a distribute directive.
static const unsigned NumExprFields
The number of record fields required for the Expr class itself.
void setCatchStmt(unsigned I, ObjCAtCatchStmt *S)
Set a particular catch statement.
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c array literal.
static OMPBarrierDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
This file defines OpenMP AST classes for executable directives and clauses.
Represents Objective-C's collection statement.
static CUDAKernelCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, EmptyShell Empty)
An ObjCAtSynchronizedStmt record.
unsigned getNumObjects() const
void setIndexExpr(unsigned Idx, Expr *E)
ObjCEncodeExpr, used for @encode in Objective-C.
void setLowerBound(Expr *E)
Set lower bound of the array section.
An implicit indirection through a C++ base class, when the field found is in a base class...
A SizefAlignOfExpr record.
Represents a call to a CUDA kernel function.
Represents a 'co_await' expression.
TypeTraitExprBitfields TypeTraitExprBits
static ImplicitCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
void setSwitchLoc(SourceLocation L)
A CXXMemberCallExpr record.
void setAtFinallyLoc(SourceLocation Loc)
void setArg(unsigned Arg, Expr *ArgExpr)
Set the specified argument.
void setKind(UnaryExprOrTypeTrait K)
void setRParenLoc(SourceLocation L)
void setOperatorLoc(SourceLocation L)
void setValue(const ASTContext &C, const llvm::APFloat &Val)
Represents Objective-C's @finally statement.
void setCatchBody(Stmt *S)
static CXXFunctionalCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
bool hasAssociatedStmt() const
Returns true if directive has associated statement.
void setLParenLoc(SourceLocation L)
The template argument is actually a parameter pack.
Represents a base class of a C++ class.
void setRParenLoc(SourceLocation L)
unsigned getNumClobbers() const
static OMPTargetTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
ObjCIvarRefExpr - A reference to an ObjC instance variable.
void setAtSynchronizedLoc(SourceLocation Loc)
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof...
void setElseLoc(SourceLocation ElseLoc)
void setOperatorLoc(SourceLocation L)
void setLocation(SourceLocation Location)
A ConvertVectorExpr record.
unsigned arg_size() const
Retrieve the number of arguments.
void setStarLoc(SourceLocation L)
void setLParenLoc(SourceLocation L)
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
GotoStmt - This represents a direct goto.
A use of a default initializer in a constructor or in aggregate initialization.
static CStyleCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
void setLocation(SourceLocation L)
CapturedDecl * getCapturedDecl()
Retrieve the outlined function declaration.
void setBuiltinLoc(SourceLocation L)
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
GNU array range designator.
Defines the clang::SourceLocation class and associated facilities.
An ArrayInitIndexExpr record.
A GCC-style AsmStmt record.
This represents '#pragma omp target parallel' directive.
void setStrideVariable(Expr *ST)
ContinueStmt - This represents a continue.
static CXXStaticCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
Represents a loop initializing the elements of an array.
static CXXTryStmt * Create(const ASTContext &C, SourceLocation tryLoc, Stmt *tryBlock, ArrayRef< Stmt *> handlers)
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
static OMPParallelSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
CXXDefaultArgExprBitfields CXXDefaultArgExprBits
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
CXXCatchStmt - This represents a C++ catch block.
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr.type.conv]).
An ObjCAtCatchStmt record.
static TypeTraitExpr * CreateDeserialized(const ASTContext &C, unsigned NumArgs)
Expr * ReadSubExpr()
Reads a sub-expression operand during statement reading.
WhileStmt - This represents a 'while' stmt.
CXXOperatorCallExprBitfields CXXOperatorCallExprBits
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...
void initializeFrom(SourceLocation TemplateKWLoc, const TemplateArgumentListInfo &List, TemplateArgumentLoc *OutArgArray)
Field designator where the field has been resolved to a declaration.
void setIsaMemberLoc(SourceLocation L)
unsigned getNumConcatenated() const
getNumConcatenated - Get the number of string literal tokens that were concatenated in translation ph...
static CXXNewExpr * CreateEmpty(const ASTContext &Ctx, bool IsArray, bool HasInit, unsigned NumPlacementArgs, bool IsParenTypeId)
Create an empty c++ new expression.
static ParenListExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumExprs)
Create an empty paren list.
A CXXInheritedCtorInitExpr record.
void setExprOperand(Expr *E)
Represents Objective-C's @try ... @catch ... @finally statement.
This represents '#pragma omp taskloop simd' directive.
void setTokenLocation(SourceLocation L)
static OMPSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
unsigned getNumCatchStmts() const
Retrieve the number of @catch statements in this try-catch-finally block.
StringLiteral - This represents a string literal expression, e.g.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
llvm::APInt readAPInt()
Read an integral value, advancing Idx.
void setOpLoc(SourceLocation L)
void setLoopVarStmt(Stmt *S)
An object for streaming information from a record.
Internal struct to describes an element that is a pack expansion, used if any of the elements in the ...
void setPreCond(Expr *PC)
RetTy Visit(PTR(Stmt) S, ParamTys... P)
void setRParenLoc(SourceLocation L)
void reserveInits(const ASTContext &C, unsigned NumInits)
Reserve space for some number of initializers.
static OMPCancelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
An ObjCMessageExpr record.
bool hasTemplateKWAndArgsInfo() const
Abstract class common to all of the C++ "named"/"keyword" casts.
This represents '#pragma omp sections' directive.
void setNextSwitchCase(SwitchCase *SC)
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
A CompoundAssignOperator record.
unsigned getNumComponents() const
This represents '#pragma omp target data' directive.
void setNextUpperBound(Expr *NUB)
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument for this lambda expression...
void setKind(CharacterKind kind)
A reference to a declared variable, function, enum, etc.
static CaseStmt * CreateEmpty(const ASTContext &Ctx, bool CaseStmtIsGNURange)
Build an empty case statement.
Designator - A designator in a C99 designated initializer.
void setLabel(LabelDecl *D)
Token readToken()
Reads a token out of a record, advancing Idx.
BreakStmt - This represents a break.
void setSubStmt(Stmt *SS)
static ObjCArrayLiteral * CreateEmpty(const ASTContext &C, unsigned NumElements)
CXXNoexceptExprBitfields CXXNoexceptExprBits
unsigned getNumArgs() const
Return the number of arguments to the constructor call.
static SwitchStmt * CreateEmpty(const ASTContext &Ctx, bool HasInit, bool HasVar)
Create an empty switch statement optionally with storage for an init expression and a condition varia...
A trivial tuple used to represent a source range.
This represents '#pragma omp taskyield' directive.
This represents a decl that may have a name.
This represents '#pragma omp distribute parallel for simd' composite directive.
A boolean literal, per ([C++ lex.bool] Boolean literals).
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type, member-designator).
This represents '#pragma omp parallel sections' directive.
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
void setCalcLastIteration(Expr *CLI)
SwitchCase * getSwitchCaseWithID(unsigned ID)
Retrieve the switch-case statement with the given ID.
static CallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, EmptyShell Empty)
Create an empty call expression, for deserialization.
The receiver is a superclass.
void setCombinedNextUpperBound(Expr *CombNUB)
SourceLocation getBegin() const
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument.
Represents Objective-C's @autoreleasepool Statement.
void setWhileLoc(SourceLocation L)
StmtCode
Record codes for each kind of statement or expression.
void setLocEnd(SourceLocation Loc)
Set ending location of directive.
void setArg(unsigned Arg, Expr *ArgExpr)
setArg - Set the specified argument.
void setFinals(ArrayRef< Expr *> A)
static OMPTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Represents an implicitly-generated value initialization of an object of a given type.
void setKeywordLoc(SourceLocation L)
void setCapturedRegionKind(CapturedRegionKind Kind)
Set the captured region kind.
A GenericSelectionExpr record.
This represents '#pragma omp target parallel for' directive.
static OMPCancellationPointDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
void setLabelLoc(SourceLocation L)
#define BLOCK(DERIVED, BASE)
void setAtLoc(SourceLocation Loc)
void setIsConditionTrue(bool isTrue)
CXXDependentScopeMemberExprBitfields CXXDependentScopeMemberExprBits
static UnresolvedMemberExpr * CreateEmpty(const ASTContext &Context, unsigned NumResults, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
This represents '#pragma omp taskloop' directive.