21 #include "llvm/ADT/SmallString.h"
22 using namespace clang;
23 using namespace clang::serialization;
31 llvm::BitstreamCursor &DeclsCursor;
34 return Record.readSourceLocation();
38 return Record.readSourceRange();
41 std::string ReadString() {
42 return Record.readString();
46 return Record.getTypeSourceInfo();
50 return Record.readDecl();
55 return Record.readDeclAs<T>();
60 Record.readDeclarationNameLoc(DNLoc, Name);
64 Record.readDeclarationNameInfo(NameInfo);
69 : Record(Record), DeclsCursor(Cursor) {}
73 static const unsigned NumStmtFields = 0;
77 static const unsigned NumExprFields = NumStmtFields + 7;
82 unsigned NumTemplateArgs);
85 unsigned NumTemplateArgs);
87 void VisitStmt(
Stmt *
S);
88 #define STMT(Type, Base) \
89 void Visit##Type(Type *);
90 #include "clang/AST/StmtNodes.inc"
96 unsigned NumTemplateArgs) {
101 for (
unsigned i = 0; i != NumTemplateArgs; ++i)
102 ArgInfo.
addArgument(Record.readTemplateArgumentLoc());
107 assert(Record.getIdx() == NumStmtFields &&
"Incorrect statement field count");
110 void ASTStmtReader::VisitNullStmt(
NullStmt *
S) {
113 S->HasLeadingEmptyMacro = Record.readInt();
116 void ASTStmtReader::VisitCompoundStmt(
CompoundStmt *S) {
119 unsigned NumStmts = Record.readInt();
121 Stmts.push_back(Record.readSubStmt());
122 S->
setStmts(Record.getContext(), Stmts);
123 S->LBraceLoc = ReadSourceLocation();
124 S->RBraceLoc = ReadSourceLocation();
127 void ASTStmtReader::VisitSwitchCase(
SwitchCase *S) {
129 Record.recordSwitchCaseID(S, Record.readInt());
134 void ASTStmtReader::VisitCaseStmt(
CaseStmt *S) {
136 S->
setLHS(Record.readSubExpr());
137 S->
setRHS(Record.readSubExpr());
142 void ASTStmtReader::VisitDefaultStmt(
DefaultStmt *S) {
147 void ASTStmtReader::VisitLabelStmt(
LabelStmt *S) {
158 uint64_t NumAttrs = Record.readInt();
160 Record.readAttributes(Attrs);
162 assert(NumAttrs == S->NumAttrs);
163 assert(NumAttrs == Attrs.size());
164 std::copy(Attrs.begin(), Attrs.end(), S->getAttrArrayPtr());
165 S->SubStmt = Record.readSubStmt();
166 S->AttrLoc = ReadSourceLocation();
169 void ASTStmtReader::VisitIfStmt(
IfStmt *S) {
172 S->
setInit(Record.readSubStmt());
174 S->
setCond(Record.readSubExpr());
175 S->
setThen(Record.readSubStmt());
176 S->
setElse(Record.readSubStmt());
181 void ASTStmtReader::VisitSwitchStmt(
SwitchStmt *S) {
183 S->
setInit(Record.readSubStmt());
185 S->
setCond(Record.readSubExpr());
186 S->
setBody(Record.readSubStmt());
188 if (Record.readInt())
192 for (
auto E = Record.size(); Record.getIdx() !=
E; ) {
193 SwitchCase *SC = Record.getSwitchCaseWithID(Record.readInt());
203 void ASTStmtReader::VisitWhileStmt(
WhileStmt *S) {
207 S->
setCond(Record.readSubExpr());
208 S->
setBody(Record.readSubStmt());
212 void ASTStmtReader::VisitDoStmt(
DoStmt *S) {
214 S->
setCond(Record.readSubExpr());
215 S->
setBody(Record.readSubStmt());
221 void ASTStmtReader::VisitForStmt(
ForStmt *S) {
223 S->
setInit(Record.readSubStmt());
224 S->
setCond(Record.readSubExpr());
226 S->
setInc(Record.readSubExpr());
227 S->
setBody(Record.readSubStmt());
233 void ASTStmtReader::VisitGotoStmt(
GotoStmt *S) {
235 S->
setLabel(ReadDeclAs<LabelDecl>());
247 void ASTStmtReader::VisitContinueStmt(
ContinueStmt *S) {
252 void ASTStmtReader::VisitBreakStmt(
BreakStmt *S) {
257 void ASTStmtReader::VisitReturnStmt(
ReturnStmt *S) {
264 void ASTStmtReader::VisitDeclStmt(
DeclStmt *S) {
269 if (Record.size() - Record.getIdx() == 1) {
274 int N = Record.size() - Record.getIdx();
276 for (
int I = 0;
I < N; ++
I)
277 Decls.push_back(ReadDecl());
284 void ASTStmtReader::VisitAsmStmt(
AsmStmt *S) {
294 void ASTStmtReader::VisitGCCAsmStmt(
GCCAsmStmt *S) {
297 S->
setAsmString(cast_or_null<StringLiteral>(Record.readSubStmt()));
307 for (
unsigned I = 0, N = NumOutputs + NumInputs;
I != N; ++
I) {
308 Names.push_back(Record.getIdentifierInfo());
309 Constraints.push_back(cast_or_null<StringLiteral>(Record.readSubStmt()));
310 Exprs.push_back(Record.readSubStmt());
315 for (
unsigned I = 0;
I != NumClobbers; ++
I)
316 Clobbers.push_back(cast_or_null<StringLiteral>(Record.readSubStmt()));
318 S->setOutputsAndInputsAndClobbers(Record.getContext(),
319 Names.data(), Constraints.data(),
320 Exprs.data(), NumOutputs, NumInputs,
321 Clobbers.data(), NumClobbers);
324 void ASTStmtReader::VisitMSAsmStmt(
MSAsmStmt *S) {
326 S->LBraceLoc = ReadSourceLocation();
327 S->EndLoc = ReadSourceLocation();
328 S->NumAsmToks = Record.readInt();
329 std::string AsmStr = ReadString();
333 AsmToks.reserve(S->NumAsmToks);
334 for (
unsigned i = 0, e = S->NumAsmToks; i != e; ++i) {
335 AsmToks.push_back(Record.readToken());
346 for (
unsigned i = 0, e = S->
NumClobbers; i != e; ++i) {
347 ClobbersData.push_back(ReadString());
348 Clobbers.push_back(ClobbersData.back());
356 Exprs.reserve(NumOperands);
357 ConstraintsData.reserve(NumOperands);
358 Constraints.reserve(NumOperands);
359 for (
unsigned i = 0; i != NumOperands; ++i) {
360 Exprs.push_back(cast<Expr>(Record.readSubStmt()));
361 ConstraintsData.push_back(ReadString());
362 Constraints.push_back(ConstraintsData.back());
365 S->initialize(Record.getContext(), AsmStr, AsmToks,
366 Constraints, Exprs, Clobbers);
371 assert(Record.peekInt() == S->NumParams);
373 auto *StoredStmts = S->getStoredStmts();
375 i < CoroutineBodyStmt::SubStmt::FirstParamMove + S->NumParams; ++i)
376 StoredStmts[i] = Record.readSubStmt();
379 void ASTStmtReader::VisitCoreturnStmt(
CoreturnStmt *S) {
381 S->CoreturnLoc = Record.readSourceLocation();
382 for (
auto &SubStmt: S->SubStmts)
383 SubStmt = Record.readSubStmt();
384 S->IsImplicit = Record.readInt() != 0;
389 E->KeywordLoc = ReadSourceLocation();
390 for (
auto &SubExpr: E->SubExprs)
391 SubExpr = Record.readSubStmt();
392 E->OpaqueValue = cast_or_null<OpaqueValueExpr>(Record.readSubStmt());
396 void ASTStmtReader::VisitCoyieldExpr(
CoyieldExpr *E) {
398 E->KeywordLoc = ReadSourceLocation();
399 for (
auto &SubExpr: E->SubExprs)
400 SubExpr = Record.readSubStmt();
401 E->OpaqueValue = cast_or_null<OpaqueValueExpr>(Record.readSubStmt());
406 E->KeywordLoc = ReadSourceLocation();
407 for (
auto &SubExpr: E->SubExprs)
408 SubExpr = Record.readSubStmt();
411 void ASTStmtReader::VisitCapturedStmt(
CapturedStmt *S) {
422 *
I = Record.readSubExpr();
425 S->setCapturedStmt(Record.readSubStmt());
430 I.VarAndKind.setPointer(ReadDeclAs<VarDecl>());
432 static_cast<CapturedStmt::VariableCaptureKind>(Record.readInt()));
433 I.Loc = ReadSourceLocation();
437 void ASTStmtReader::VisitExpr(
Expr *E) {
443 E->
ExprBits.ContainsUnexpandedParameterPack = Record.readInt();
444 E->
setValueKind(static_cast<ExprValueKind>(Record.readInt()));
445 E->
setObjectKind(static_cast<ExprObjectKind>(Record.readInt()));
446 assert(Record.getIdx() == NumExprFields &&
447 "Incorrect expression field count");
454 E->FnName = cast_or_null<StringLiteral>(Record.readSubExpr());
457 void ASTStmtReader::VisitDeclRefExpr(
DeclRefExpr *E) {
464 E->
DeclRefExprBits.RefersToEnclosingVariableOrCapture = Record.readInt();
465 unsigned NumTemplateArgs = 0;
467 NumTemplateArgs = Record.readInt();
473 if (E->hasFoundDecl())
474 *E->getTrailingObjects<
NamedDecl *>() = ReadDeclAs<NamedDecl>();
477 ReadTemplateKWAndArgsInfo(
481 E->
setDecl(ReadDeclAs<ValueDecl>());
489 E->
setValue(Record.getContext(), Record.readAPInt());
494 E->
setRawSemantics(static_cast<Stmt::APFloatSemantics>(Record.readInt()));
507 unsigned Len = Record.readInt();
509 "Wrong number of concatenated tokens!");
513 bool isPascal = Record.readInt();
516 auto B = &Record.peekInt();
519 Record.skipInts(Len);
530 E->
setKind(static_cast<CharacterLiteral::CharacterKind>(Record.readInt()));
533 void ASTStmtReader::VisitParenExpr(
ParenExpr *E) {
542 unsigned NumExprs = Record.readInt();
543 E->Exprs =
new (Record.getContext())
Stmt*[NumExprs];
544 for (
unsigned i = 0; i != NumExprs; ++i)
545 E->Exprs[i] = Record.readSubStmt();
546 E->NumExprs = NumExprs;
547 E->LParenLoc = ReadSourceLocation();
548 E->RParenLoc = ReadSourceLocation();
558 void ASTStmtReader::VisitOffsetOfExpr(
OffsetOfExpr *E) {
589 *Base = Record.readCXXBaseSpecifier();
602 E->
setKind(static_cast<UnaryExprOrTypeTrait>(Record.readInt()));
603 if (Record.peekInt() == 0) {
615 E->
setLHS(Record.readSubExpr());
616 E->
setRHS(Record.readSubExpr());
622 E->
setBase(Record.readSubExpr());
629 void ASTStmtReader::VisitCallExpr(
CallExpr *E) {
631 E->
setNumArgs(Record.getContext(), Record.readInt());
635 E->
setArg(
I, Record.readSubExpr());
642 void ASTStmtReader::VisitMemberExpr(
MemberExpr *E) {
645 "It's a subclass, we must advance Idx!");
648 void ASTStmtReader::VisitObjCIsaExpr(
ObjCIsaExpr *E) {
650 E->
setBase(Record.readSubExpr());
659 E->Operand = Record.readSubExpr();
660 E->setShouldCopy(Record.readInt());
664 VisitExplicitCastExpr(E);
665 E->LParenLoc = ReadSourceLocation();
666 E->BridgeKeywordLoc = ReadSourceLocation();
667 E->Kind = Record.readInt();
670 void ASTStmtReader::VisitCastExpr(
CastExpr *E) {
672 unsigned NumBaseSpecs = Record.readInt();
677 while (NumBaseSpecs--) {
679 *BaseSpec = Record.readCXXBaseSpecifier();
686 E->
setLHS(Record.readSubExpr());
687 E->
setRHS(Record.readSubExpr());
694 VisitBinaryOperator(E);
701 E->SubExprs[ConditionalOperator::COND] = Record.readSubExpr();
702 E->SubExprs[ConditionalOperator::LHS] = Record.readSubExpr();
703 E->SubExprs[ConditionalOperator::RHS] = Record.readSubExpr();
704 E->QuestionLoc = ReadSourceLocation();
705 E->ColonLoc = ReadSourceLocation();
711 E->OpaqueValue = cast<OpaqueValueExpr>(Record.readSubExpr());
712 E->SubExprs[BinaryConditionalOperator::COMMON] = Record.readSubExpr();
713 E->SubExprs[BinaryConditionalOperator::COND] = Record.readSubExpr();
714 E->SubExprs[BinaryConditionalOperator::LHS] = Record.readSubExpr();
715 E->SubExprs[BinaryConditionalOperator::RHS] = Record.readSubExpr();
716 E->QuestionLoc = ReadSourceLocation();
717 E->ColonLoc = ReadSourceLocation();
730 VisitExplicitCastExpr(E);
745 E->
setBase(Record.readSubExpr());
750 void ASTStmtReader::VisitInitListExpr(
InitListExpr *E) {
752 if (
InitListExpr *SyntForm = cast_or_null<InitListExpr>(Record.readSubStmt()))
756 bool isArrayFiller = Record.readInt();
757 Expr *filler =
nullptr;
759 filler = Record.readSubExpr();
760 E->ArrayFillerOrUnionFieldInit = filler;
762 E->ArrayFillerOrUnionFieldInit = ReadDeclAs<FieldDecl>();
764 unsigned NumInits = Record.readInt();
767 for (
unsigned I = 0;
I != NumInits; ++
I) {
768 Expr *init = Record.readSubExpr();
769 E->
updateInit(Record.getContext(),
I, init ? init : filler);
772 for (
unsigned I = 0;
I != NumInits; ++
I)
773 E->
updateInit(Record.getContext(),
I, Record.readSubExpr());
781 unsigned NumSubExprs = Record.readInt();
782 assert(NumSubExprs == E->
getNumSubExprs() &&
"Wrong number of subexprs");
783 for (
unsigned I = 0;
I != NumSubExprs; ++
I)
789 while (Record.getIdx() < Record.size()) {
795 Designators.push_back(Designator(Field->
getIdentifier(), DotLoc,
797 Designators.back().setField(Field);
805 Designators.push_back(Designator(Name, DotLoc, FieldLoc));
810 unsigned Index = Record.readInt();
813 Designators.push_back(Designator(Index, LBracketLoc, RBracketLoc));
818 unsigned Index = Record.readInt();
822 Designators.push_back(Designator(Index, LBracketLoc, EllipsisLoc,
829 Designators.data(), Designators.size());
834 E->
setBase(Record.readSubExpr());
838 void ASTStmtReader::VisitNoInitExpr(
NoInitExpr *E) {
844 E->SubExprs[0] = Record.readSubExpr();
845 E->SubExprs[1] = Record.readSubExpr();
856 void ASTStmtReader::VisitVAArgExpr(
VAArgExpr *E) {
869 E->
setLabel(ReadDeclAs<LabelDecl>());
872 void ASTStmtReader::VisitStmtExpr(
StmtExpr *E) {
876 E->
setSubStmt(cast_or_null<CompoundStmt>(Record.readSubStmt()));
879 void ASTStmtReader::VisitChooseExpr(
ChooseExpr *E) {
881 E->
setCond(Record.readSubExpr());
882 E->
setLHS(Record.readSubExpr());
883 E->
setRHS(Record.readSubExpr());
889 void ASTStmtReader::VisitGNUNullExpr(
GNUNullExpr *E) {
897 unsigned NumExprs = Record.readInt();
899 Exprs.push_back(Record.readSubExpr());
900 E->
setExprs(Record.getContext(), Exprs);
907 E->BuiltinLoc = ReadSourceLocation();
908 E->RParenLoc = ReadSourceLocation();
909 E->TInfo = GetTypeSourceInfo();
910 E->SrcExpr = Record.readSubExpr();
913 void ASTStmtReader::VisitBlockExpr(
BlockExpr *E) {
920 E->NumAssocs = Record.readInt();
921 E->AssocTypes =
new (Record.getContext())
TypeSourceInfo*[E->NumAssocs];
923 new(Record.getContext())
Stmt*[GenericSelectionExpr::END_EXPR+E->NumAssocs];
925 E->SubExprs[GenericSelectionExpr::CONTROLLING] = Record.readSubExpr();
927 E->AssocTypes[
I] = GetTypeSourceInfo();
928 E->SubExprs[GenericSelectionExpr::END_EXPR+
I] = Record.readSubExpr();
930 E->ResultIndex = Record.readInt();
932 E->GenericLoc = ReadSourceLocation();
933 E->DefaultLoc = ReadSourceLocation();
934 E->RParenLoc = ReadSourceLocation();
939 unsigned numSemanticExprs = Record.readInt();
944 E->getSubExprsBuffer()[0] = Record.readSubExpr();
947 for (
unsigned i = 0; i != numSemanticExprs; ++i) {
948 Expr *subExpr = Record.readSubExpr();
949 E->getSubExprsBuffer()[i+1] = subExpr;
953 void ASTStmtReader::VisitAtomicExpr(
AtomicExpr *E) {
957 for (
unsigned I = 0;
I != E->NumSubExprs; ++
I)
958 E->SubExprs[
I] = Record.readSubExpr();
959 E->BuiltinLoc = ReadSourceLocation();
960 E->RParenLoc = ReadSourceLocation();
968 E->
setString(cast<StringLiteral>(Record.readSubStmt()));
975 E->SubExpr = Record.readSubStmt();
976 E->BoxingMethod = ReadDeclAs<ObjCMethodDecl>();
977 E->Range = ReadSourceRange();
982 unsigned NumElements = Record.readInt();
983 assert(NumElements == E->
getNumElements() &&
"Wrong number of elements");
985 for (
unsigned I = 0, N = NumElements;
I != N; ++
I)
986 Elements[
I] = Record.readSubExpr();
987 E->ArrayWithObjectsMethod = ReadDeclAs<ObjCMethodDecl>();
988 E->Range = ReadSourceRange();
993 unsigned NumElements = Record.readInt();
994 assert(NumElements == E->
getNumElements() &&
"Wrong number of elements");
995 bool HasPackExpansions = Record.readInt();
996 assert(HasPackExpansions == E->HasPackExpansions &&
"Pack expansion mismatch");
1001 for (
unsigned I = 0;
I != NumElements; ++
I) {
1002 KeyValues[
I].
Key = Record.readSubExpr();
1003 KeyValues[
I].
Value = Record.readSubExpr();
1004 if (HasPackExpansions) {
1005 Expansions[
I].EllipsisLoc = ReadSourceLocation();
1006 Expansions[
I].NumExpansionsPlusOne = Record.readInt();
1009 E->DictWithObjectsMethod = ReadDeclAs<ObjCMethodDecl>();
1010 E->Range = ReadSourceRange();
1031 E->ProtoLoc = ReadSourceLocation();
1037 E->
setDecl(ReadDeclAs<ObjCIvarDecl>());
1040 E->
setBase(Record.readSubExpr());
1047 unsigned MethodRefFlags = Record.readInt();
1048 bool Implicit = Record.readInt() != 0;
1052 E->setImplicitProperty(Getter, Setter, MethodRefFlags);
1054 E->setExplicitProperty(ReadDeclAs<ObjCPropertyDecl>(), MethodRefFlags);
1056 E->setLocation(ReadSourceLocation());
1057 E->setReceiverLocation(ReadSourceLocation());
1058 switch (Record.readInt()) {
1060 E->setBase(Record.readSubExpr());
1063 E->setSuperReceiver(Record.readType());
1066 E->setClassReceiver(ReadDeclAs<ObjCInterfaceDecl>());
1076 E->GetAtIndexMethodDecl = ReadDeclAs<ObjCMethodDecl>();
1077 E->SetAtIndexMethodDecl = ReadDeclAs<ObjCMethodDecl>();
1084 unsigned NumStoredSelLocs = Record.readInt();
1085 E->SelLocsKind = Record.readInt();
1087 E->IsImplicit = Record.readInt();
1110 if (Record.readInt())
1115 E->LBracLoc = ReadSourceLocation();
1116 E->RBracLoc = ReadSourceLocation();
1119 E->
setArg(
I, Record.readSubExpr());
1122 for (
unsigned I = 0;
I != NumStoredSelLocs; ++
I)
1123 Locs[
I] = ReadSourceLocation();
1130 S->
setBody(Record.readSubStmt());
1159 bool HasFinally = Record.readInt();
1162 S->
setCatchStmt(
I, cast_or_null<ObjCAtCatchStmt>(Record.readSubStmt()));
1193 E->VersionToCheck = Record.readVersionTuple();
1200 void ASTStmtReader::VisitCXXCatchStmt(
CXXCatchStmt *S) {
1202 S->CatchLoc = ReadSourceLocation();
1203 S->ExceptionDecl = ReadDeclAs<VarDecl>();
1204 S->HandlerBlock = Record.readSubStmt();
1207 void ASTStmtReader::VisitCXXTryStmt(
CXXTryStmt *S) {
1209 assert(Record.peekInt() == S->
getNumHandlers() &&
"NumStmtFields is wrong ?");
1211 S->TryLoc = ReadSourceLocation();
1212 S->getStmts()[0] = Record.readSubStmt();
1214 S->getStmts()[i + 1] = Record.readSubStmt();
1219 S->ForLoc = ReadSourceLocation();
1220 S->CoawaitLoc = ReadSourceLocation();
1221 S->ColonLoc = ReadSourceLocation();
1222 S->RParenLoc = ReadSourceLocation();
1226 S->
setCond(Record.readSubExpr());
1227 S->
setInc(Record.readSubExpr());
1229 S->
setBody(Record.readSubStmt());
1234 S->KeywordLoc = ReadSourceLocation();
1235 S->IsIfExists = Record.readInt();
1236 S->QualifierLoc = Record.readNestedNameSpecifierLoc();
1237 ReadDeclarationNameInfo(S->NameInfo);
1238 S->SubStmt = Record.readSubStmt();
1244 E->Range = Record.readSourceRange();
1250 E->NumArgs = Record.readInt();
1252 E->Args =
new (Record.getContext())
Stmt*[E->NumArgs];
1254 E->
setArg(
I, Record.readSubExpr());
1255 E->setConstructor(ReadDeclAs<CXXConstructorDecl>());
1263 E->ParenOrBraceRange = ReadSourceRange();
1268 E->Constructor = ReadDeclAs<CXXConstructorDecl>();
1269 E->Loc = ReadSourceLocation();
1270 E->ConstructsVirtualBase = Record.readInt();
1271 E->InheritedFromVirtualBase = Record.readInt();
1275 VisitCXXConstructExpr(E);
1276 E->Type = GetTypeSourceInfo();
1279 void ASTStmtReader::VisitLambdaExpr(
LambdaExpr *E) {
1281 unsigned NumCaptures = Record.readInt();
1282 assert(NumCaptures == E->NumCaptures);(void)NumCaptures;
1283 E->IntroducerRange = ReadSourceRange();
1285 E->CaptureDefaultLoc = ReadSourceLocation();
1286 E->ExplicitParams = Record.readInt();
1287 E->ExplicitResultType = Record.readInt();
1288 E->ClosingBrace = ReadSourceLocation();
1294 *
C = Record.readSubExpr();
1300 E->SubExpr = Record.readSubExpr();
1304 VisitExplicitCastExpr(E);
1307 E->RParenLoc = R.
getEnd();
1308 R = ReadSourceRange();
1309 E->AngleBrackets = R;
1313 return VisitCXXNamedCastExpr(E);
1317 return VisitCXXNamedCastExpr(E);
1321 return VisitCXXNamedCastExpr(E);
1325 return VisitCXXNamedCastExpr(E);
1329 VisitExplicitCastExpr(E);
1336 E->UDSuffixLoc = ReadSourceLocation();
1355 GetTypeSourceInfo());
1363 void ASTStmtReader::VisitCXXThisExpr(
CXXThisExpr *E) {
1369 void ASTStmtReader::VisitCXXThrowExpr(
CXXThrowExpr *E) {
1371 E->ThrowLoc = ReadSourceLocation();
1372 E->Op = Record.readSubExpr();
1373 E->IsThrownVariableInScope = Record.readInt();
1378 E->Param = ReadDeclAs<ParmVarDecl>();
1379 E->Loc = ReadSourceLocation();
1384 E->Field = ReadDeclAs<FieldDecl>();
1385 E->Loc = ReadSourceLocation();
1396 E->TypeInfo = GetTypeSourceInfo();
1397 E->RParenLoc = ReadSourceLocation();
1400 void ASTStmtReader::VisitCXXNewExpr(
CXXNewExpr *E) {
1402 E->GlobalNew = Record.readInt();
1403 bool isArray = Record.readInt();
1404 E->PassAlignment = Record.readInt();
1405 E->UsualArrayDeleteWantsSize = Record.readInt();
1406 unsigned NumPlacementArgs = Record.readInt();
1407 E->StoredInitializationStyle = Record.readInt();
1410 E->AllocatedTypeInfo = GetTypeSourceInfo();
1411 E->TypeIdParens = ReadSourceRange();
1412 E->Range = ReadSourceRange();
1413 E->DirectInitRange = ReadSourceRange();
1416 E->StoredInitializationStyle != 0);
1421 *
I = Record.readSubStmt();
1426 E->GlobalDelete = Record.readInt();
1427 E->ArrayForm = Record.readInt();
1428 E->ArrayFormAsWritten = Record.readInt();
1429 E->UsualArrayDeleteWantsSize = Record.readInt();
1430 E->OperatorDelete = ReadDeclAs<FunctionDecl>();
1431 E->Argument = Record.readSubExpr();
1432 E->Loc = ReadSourceLocation();
1438 E->Base = Record.readSubExpr();
1439 E->IsArrow = Record.readInt();
1440 E->OperatorLoc = ReadSourceLocation();
1441 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1442 E->ScopeType = GetTypeSourceInfo();
1443 E->ColonColonLoc = ReadSourceLocation();
1444 E->TildeLoc = ReadSourceLocation();
1456 unsigned NumObjects = Record.readInt();
1458 for (
unsigned i = 0; i != NumObjects; ++i)
1459 E->getTrailingObjects<
BlockDecl *>()[i] =
1460 ReadDeclAs<BlockDecl>();
1463 E->SubExpr = Record.readSubExpr();
1470 if (Record.readInt())
1471 ReadTemplateKWAndArgsInfo(
1476 E->Base = Record.readSubExpr();
1477 E->BaseType = Record.readType();
1478 E->IsArrow = Record.readInt();
1479 E->OperatorLoc = ReadSourceLocation();
1480 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1481 E->FirstQualifierFoundInScope = ReadDeclAs<NamedDecl>();
1482 ReadDeclarationNameInfo(E->MemberNameInfo);
1489 if (Record.readInt())
1490 ReadTemplateKWAndArgsInfo(
1495 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1496 ReadDeclarationNameInfo(E->NameInfo);
1502 assert(Record.peekInt() == E->
arg_size() &&
1503 "Read wrong record during creation ?");
1505 for (
unsigned I = 0, N = E->
arg_size();
I != N; ++
I)
1506 E->
setArg(
I, Record.readSubExpr());
1507 E->Type = GetTypeSourceInfo();
1512 void ASTStmtReader::VisitOverloadExpr(
OverloadExpr *E) {
1515 if (Record.readInt())
1520 unsigned NumDecls = Record.readInt();
1522 for (
unsigned i = 0; i != NumDecls; ++i) {
1529 ReadDeclarationNameInfo(E->NameInfo);
1530 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1534 VisitOverloadExpr(E);
1535 E->IsArrow = Record.readInt();
1536 E->HasUnresolvedUsing = Record.readInt();
1537 E->Base = Record.readSubExpr();
1538 E->BaseType = Record.readType();
1539 E->OperatorLoc = ReadSourceLocation();
1543 VisitOverloadExpr(E);
1544 E->RequiresADL = Record.readInt();
1545 E->Overloaded = Record.readInt();
1546 E->NamingClass = ReadDeclAs<CXXRecordDecl>();
1556 E->RParenLoc = Range.
getEnd();
1560 Args[
I] = GetTypeSourceInfo();
1566 E->Value = (
unsigned int)Record.readInt();
1569 E->RParen = Range.
getEnd();
1570 E->QueriedType = GetTypeSourceInfo();
1571 E->Dimension = Record.readSubExpr();
1577 E->Value = (
bool)Record.readInt();
1579 E->QueriedExpression = Record.readSubExpr();
1581 E->RParen = Range.
getEnd();
1586 E->Value = (
bool)Record.readInt();
1587 E->Range = ReadSourceRange();
1588 E->Operand = Record.readSubExpr();
1593 E->EllipsisLoc = ReadSourceLocation();
1594 E->NumExpansions = Record.readInt();
1595 E->Pattern = Record.readSubExpr();
1600 unsigned NumPartialArgs = Record.readInt();
1601 E->OperatorLoc = ReadSourceLocation();
1602 E->PackLoc = ReadSourceLocation();
1603 E->RParenLoc = ReadSourceLocation();
1604 E->Pack = Record.readDeclAs<
NamedDecl>();
1606 assert(E->Length == NumPartialArgs);
1608 *E =
I + NumPartialArgs;
1612 E->Length = Record.readInt();
1616 void ASTStmtReader::VisitSubstNonTypeTemplateParmExpr(
1619 E->Param = ReadDeclAs<NonTypeTemplateParmDecl>();
1620 E->NameLoc = ReadSourceLocation();
1621 E->Replacement = Record.readSubExpr();
1624 void ASTStmtReader::VisitSubstNonTypeTemplateParmPackExpr(
1627 E->Param = ReadDeclAs<NonTypeTemplateParmDecl>();
1633 E->NumArguments = ArgPack.pack_size();
1634 E->NameLoc = ReadSourceLocation();
1639 E->NumParameters = Record.readInt();
1640 E->ParamPack = ReadDeclAs<ParmVarDecl>();
1641 E->NameLoc = ReadSourceLocation();
1643 for (
unsigned i = 0, n = E->NumParameters; i != n; ++i)
1644 Parms[i] = ReadDeclAs<ParmVarDecl>();
1649 E->State = Record.readSubExpr();
1650 auto VD = ReadDeclAs<ValueDecl>();
1651 unsigned ManglingNumber = Record.readInt();
1655 void ASTStmtReader::VisitCXXFoldExpr(
CXXFoldExpr *E) {
1657 E->LParenLoc = ReadSourceLocation();
1658 E->EllipsisLoc = ReadSourceLocation();
1659 E->RParenLoc = ReadSourceLocation();
1660 E->SubExprs[0] = Record.readSubExpr();
1661 E->SubExprs[1] = Record.readSubExpr();
1667 E->SourceExpr = Record.readSubExpr();
1668 E->Loc = ReadSourceLocation();
1671 void ASTStmtReader::VisitTypoExpr(
TypoExpr *E) {
1672 llvm_unreachable(
"Cannot read TypoExpr nodes");
1680 E->IsArrow = (Record.readInt() != 0);
1681 E->BaseExpr = Record.readSubExpr();
1682 E->QualifierLoc = Record.readNestedNameSpecifierLoc();
1683 E->MemberLoc = ReadSourceLocation();
1684 E->TheDecl = ReadDeclAs<MSPropertyDecl>();
1689 E->setBase(Record.readSubExpr());
1690 E->setIdx(Record.readSubExpr());
1697 std::string UuidStr = ReadString();
1698 E->
setUuidStr(StringRef(UuidStr).copy(Record.getContext()));
1701 GetTypeSourceInfo());
1709 void ASTStmtReader::VisitSEHLeaveStmt(
SEHLeaveStmt *S) {
1716 S->Loc = ReadSourceLocation();
1717 S->Children[SEHExceptStmt::FILTER_EXPR] = Record.readSubStmt();
1723 S->Loc = ReadSourceLocation();
1724 S->Block = Record.readSubStmt();
1727 void ASTStmtReader::VisitSEHTryStmt(
SEHTryStmt *S) {
1729 S->IsCXXTry = Record.readInt();
1730 S->TryLoc = ReadSourceLocation();
1731 S->Children[SEHTryStmt::TRY] = Record.readSubStmt();
1732 S->Children[SEHTryStmt::HANDLER] = Record.readSubStmt();
1741 E->
setConfig(cast<CallExpr>(Record.readSubExpr()));
1747 void ASTStmtReader::VisitAsTypeExpr(
AsTypeExpr *E) {
1749 E->BuiltinLoc = ReadSourceLocation();
1750 E->RParenLoc = ReadSourceLocation();
1751 E->SrcExpr = Record.readSubExpr();
1764 : Reader(R),
Context(Record.getContext()) {}
1765 #define OPENMP_CLAUSE(Name, Class) void Visit##Class(Class *C);
1766 #include "clang/Basic/OpenMPKinds.def"
1775 switch (Reader->Record.readInt()) {
1782 case OMPC_num_threads:
1797 case OMPC_proc_bind:
1812 case OMPC_mergeable:
1842 case OMPC_firstprivate:
1845 case OMPC_lastprivate:
1851 case OMPC_reduction:
1854 case OMPC_task_reduction:
1866 case OMPC_copyprivate:
1879 unsigned NumVars = Reader->Record.readInt();
1880 unsigned NumDeclarations = Reader->Record.readInt();
1881 unsigned NumLists = Reader->Record.readInt();
1882 unsigned NumComponents = Reader->Record.readInt();
1887 case OMPC_num_teams:
1890 case OMPC_thread_limit:
1896 case OMPC_grainsize:
1899 case OMPC_num_tasks:
1905 case OMPC_dist_schedule:
1908 case OMPC_defaultmap:
1912 unsigned NumVars = Reader->Record.readInt();
1913 unsigned NumDeclarations = Reader->Record.readInt();
1914 unsigned NumLists = Reader->Record.readInt();
1915 unsigned NumComponents = Reader->Record.readInt();
1921 unsigned NumVars = Reader->Record.readInt();
1922 unsigned NumDeclarations = Reader->Record.readInt();
1923 unsigned NumLists = Reader->Record.readInt();
1924 unsigned NumComponents = Reader->Record.readInt();
1929 case OMPC_use_device_ptr: {
1930 unsigned NumVars = Reader->Record.readInt();
1931 unsigned NumDeclarations = Reader->Record.readInt();
1932 unsigned NumLists = Reader->Record.readInt();
1933 unsigned NumComponents = Reader->Record.readInt();
1935 NumLists, NumComponents);
1938 case OMPC_is_device_ptr: {
1939 unsigned NumVars = Reader->Record.readInt();
1940 unsigned NumDeclarations = Reader->Record.readInt();
1941 unsigned NumLists = Reader->Record.readInt();
1942 unsigned NumComponents = Reader->Record.readInt();
1944 NumLists, NumComponents);
1950 C->
setLocEnd(Reader->ReadSourceLocation());
1961 VisitOMPClauseWithPreInit(C);
1965 void OMPClauseReader::VisitOMPIfClause(
OMPIfClause *C) {
1966 VisitOMPClauseWithPreInit(C);
1967 C->setNameModifier(static_cast<OpenMPDirectiveKind>(Reader->Record.readInt()));
1968 C->setNameModifierLoc(Reader->ReadSourceLocation());
1969 C->setColonLoc(Reader->ReadSourceLocation());
1970 C->setCondition(Reader->Record.readSubExpr());
1975 C->setCondition(Reader->Record.readSubExpr());
1980 VisitOMPClauseWithPreInit(C);
1981 C->setNumThreads(Reader->Record.readSubExpr());
1986 C->setSafelen(Reader->Record.readSubExpr());
1991 C->setSimdlen(Reader->Record.readSubExpr());
1996 C->setNumForLoops(Reader->Record.readSubExpr());
2002 static_cast<OpenMPDefaultClauseKind>(Reader->Record.readInt()));
2004 C->setDefaultKindKwLoc(Reader->ReadSourceLocation());
2009 static_cast<OpenMPProcBindClauseKind>(Reader->Record.readInt()));
2011 C->setProcBindKindKwLoc(Reader->ReadSourceLocation());
2015 VisitOMPClauseWithPreInit(C);
2017 static_cast<OpenMPScheduleClauseKind>(Reader->Record.readInt()));
2018 C->setFirstScheduleModifier(
2019 static_cast<OpenMPScheduleClauseModifier>(Reader->Record.readInt()));
2020 C->setSecondScheduleModifier(
2021 static_cast<OpenMPScheduleClauseModifier>(Reader->Record.readInt()));
2022 C->setChunkSize(Reader->Record.readSubExpr());
2023 C->setLParenLoc(Reader->ReadSourceLocation());
2024 C->setFirstScheduleModifierLoc(Reader->ReadSourceLocation());
2025 C->setSecondScheduleModifierLoc(Reader->ReadSourceLocation());
2026 C->setScheduleKindLoc(Reader->ReadSourceLocation());
2027 C->setCommaLoc(Reader->ReadSourceLocation());
2031 C->setNumForLoops(Reader->Record.readSubExpr());
2041 void OMPClauseReader::VisitOMPReadClause(
OMPReadClause *) {}
2053 void OMPClauseReader::VisitOMPSIMDClause(
OMPSIMDClause *) {}
2061 Vars.reserve(NumVars);
2062 for (
unsigned i = 0; i != NumVars; ++i)
2063 Vars.push_back(Reader->Record.readSubExpr());
2066 for (
unsigned i = 0; i != NumVars; ++i)
2067 Vars.push_back(Reader->Record.readSubExpr());
2068 C->setPrivateCopies(Vars);
2072 VisitOMPClauseWithPreInit(C);
2076 Vars.reserve(NumVars);
2077 for (
unsigned i = 0; i != NumVars; ++i)
2078 Vars.push_back(Reader->Record.readSubExpr());
2081 for (
unsigned i = 0; i != NumVars; ++i)
2082 Vars.push_back(Reader->Record.readSubExpr());
2083 C->setPrivateCopies(Vars);
2085 for (
unsigned i = 0; i != NumVars; ++i)
2086 Vars.push_back(Reader->Record.readSubExpr());
2091 VisitOMPClauseWithPostUpdate(C);
2095 Vars.reserve(NumVars);
2096 for (
unsigned i = 0; i != NumVars; ++i)
2097 Vars.push_back(Reader->Record.readSubExpr());
2100 for (
unsigned i = 0; i != NumVars; ++i)
2101 Vars.push_back(Reader->Record.readSubExpr());
2104 for (
unsigned i = 0; i != NumVars; ++i)
2105 Vars.push_back(Reader->Record.readSubExpr());
2106 C->setSourceExprs(Vars);
2108 for (
unsigned i = 0; i != NumVars; ++i)
2109 Vars.push_back(Reader->Record.readSubExpr());
2110 C->setDestinationExprs(Vars);
2112 for (
unsigned i = 0; i != NumVars; ++i)
2113 Vars.push_back(Reader->Record.readSubExpr());
2114 C->setAssignmentOps(Vars);
2121 Vars.reserve(NumVars);
2122 for (
unsigned i = 0; i != NumVars; ++i)
2123 Vars.push_back(Reader->Record.readSubExpr());
2128 VisitOMPClauseWithPostUpdate(C);
2130 C->setColonLoc(Reader->ReadSourceLocation());
2133 Reader->ReadDeclarationNameInfo(DNI);
2134 C->setQualifierLoc(NNSL);
2135 C->setNameInfo(DNI);
2139 Vars.reserve(NumVars);
2140 for (
unsigned i = 0; i != NumVars; ++i)
2141 Vars.push_back(Reader->Record.readSubExpr());
2144 for (
unsigned i = 0; i != NumVars; ++i)
2145 Vars.push_back(Reader->Record.readSubExpr());
2146 C->setPrivates(Vars);
2148 for (
unsigned i = 0; i != NumVars; ++i)
2149 Vars.push_back(Reader->Record.readSubExpr());
2150 C->setLHSExprs(Vars);
2152 for (
unsigned i = 0; i != NumVars; ++i)
2153 Vars.push_back(Reader->Record.readSubExpr());
2154 C->setRHSExprs(Vars);
2156 for (
unsigned i = 0; i != NumVars; ++i)
2157 Vars.push_back(Reader->Record.readSubExpr());
2158 C->setReductionOps(Vars);
2162 VisitOMPClauseWithPostUpdate(C);
2164 C->setColonLoc(Reader->ReadSourceLocation());
2167 Reader->ReadDeclarationNameInfo(DNI);
2168 C->setQualifierLoc(NNSL);
2169 C->setNameInfo(DNI);
2173 Vars.reserve(NumVars);
2174 for (
unsigned I = 0;
I != NumVars; ++
I)
2175 Vars.push_back(Reader->Record.readSubExpr());
2178 for (
unsigned I = 0;
I != NumVars; ++
I)
2179 Vars.push_back(Reader->Record.readSubExpr());
2180 C->setPrivates(Vars);
2182 for (
unsigned I = 0;
I != NumVars; ++
I)
2183 Vars.push_back(Reader->Record.readSubExpr());
2184 C->setLHSExprs(Vars);
2186 for (
unsigned I = 0;
I != NumVars; ++
I)
2187 Vars.push_back(Reader->Record.readSubExpr());
2188 C->setRHSExprs(Vars);
2190 for (
unsigned I = 0;
I != NumVars; ++
I)
2191 Vars.push_back(Reader->Record.readSubExpr());
2192 C->setReductionOps(Vars);
2196 VisitOMPClauseWithPostUpdate(C);
2198 C->setColonLoc(Reader->ReadSourceLocation());
2199 C->setModifier(static_cast<OpenMPLinearClauseKind>(Reader->Record.readInt()));
2200 C->setModifierLoc(Reader->ReadSourceLocation());
2203 Vars.reserve(NumVars);
2204 for (
unsigned i = 0; i != NumVars; ++i)
2205 Vars.push_back(Reader->Record.readSubExpr());
2208 for (
unsigned i = 0; i != NumVars; ++i)
2209 Vars.push_back(Reader->Record.readSubExpr());
2210 C->setPrivates(Vars);
2212 for (
unsigned i = 0; i != NumVars; ++i)
2213 Vars.push_back(Reader->Record.readSubExpr());
2216 for (
unsigned i = 0; i != NumVars; ++i)
2217 Vars.push_back(Reader->Record.readSubExpr());
2218 C->setUpdates(Vars);
2220 for (
unsigned i = 0; i != NumVars; ++i)
2221 Vars.push_back(Reader->Record.readSubExpr());
2223 C->setStep(Reader->Record.readSubExpr());
2224 C->setCalcStep(Reader->Record.readSubExpr());
2228 C->setLParenLoc(Reader->ReadSourceLocation());
2230 unsigned NumVars = C->varlist_size();
2232 Vars.reserve(NumVars);
2233 for (
unsigned i = 0; i != NumVars; ++i)
2234 Vars.push_back(Reader->Record.readSubExpr());
2235 C->setVarRefs(Vars);
2236 C->setAlignment(Reader->Record.readSubExpr());
2240 C->setLParenLoc(Reader->ReadSourceLocation());
2241 unsigned NumVars = C->varlist_size();
2243 Exprs.reserve(NumVars);
2244 for (
unsigned i = 0; i != NumVars; ++i)
2245 Exprs.push_back(Reader->Record.readSubExpr());
2246 C->setVarRefs(Exprs);
2248 for (
unsigned i = 0; i != NumVars; ++i)
2249 Exprs.push_back(Reader->Record.readSubExpr());
2250 C->setSourceExprs(Exprs);
2252 for (
unsigned i = 0; i != NumVars; ++i)
2253 Exprs.push_back(Reader->Record.readSubExpr());
2254 C->setDestinationExprs(Exprs);
2256 for (
unsigned i = 0; i != NumVars; ++i)
2257 Exprs.push_back(Reader->Record.readSubExpr());
2258 C->setAssignmentOps(Exprs);
2262 C->setLParenLoc(Reader->ReadSourceLocation());
2263 unsigned NumVars = C->varlist_size();
2265 Exprs.reserve(NumVars);
2266 for (
unsigned i = 0; i != NumVars; ++i)
2267 Exprs.push_back(Reader->Record.readSubExpr());
2268 C->setVarRefs(Exprs);
2270 for (
unsigned i = 0; i != NumVars; ++i)
2271 Exprs.push_back(Reader->Record.readSubExpr());
2272 C->setSourceExprs(Exprs);
2274 for (
unsigned i = 0; i != NumVars; ++i)
2275 Exprs.push_back(Reader->Record.readSubExpr());
2276 C->setDestinationExprs(Exprs);
2278 for (
unsigned i = 0; i != NumVars; ++i)
2279 Exprs.push_back(Reader->Record.readSubExpr());
2280 C->setAssignmentOps(Exprs);
2284 C->setLParenLoc(Reader->ReadSourceLocation());
2285 unsigned NumVars = C->varlist_size();
2287 Vars.reserve(NumVars);
2288 for (
unsigned i = 0; i != NumVars; ++i)
2289 Vars.push_back(Reader->Record.readSubExpr());
2290 C->setVarRefs(Vars);
2294 C->setLParenLoc(Reader->ReadSourceLocation());
2295 C->setDependencyKind(
2296 static_cast<OpenMPDependClauseKind>(Reader->Record.readInt()));
2297 C->setDependencyLoc(Reader->ReadSourceLocation());
2298 C->setColonLoc(Reader->ReadSourceLocation());
2299 unsigned NumVars = C->varlist_size();
2301 Vars.reserve(NumVars);
2302 for (
unsigned i = 0; i != NumVars; ++i)
2303 Vars.push_back(Reader->Record.readSubExpr());
2304 C->setVarRefs(Vars);
2309 C->setDevice(Reader->Record.readSubExpr());
2313 void OMPClauseReader::VisitOMPMapClause(
OMPMapClause *C) {
2314 C->setLParenLoc(Reader->ReadSourceLocation());
2315 C->setMapTypeModifier(
2316 static_cast<OpenMPMapClauseKind>(Reader->Record.readInt()));
2318 static_cast<OpenMPMapClauseKind>(Reader->Record.readInt()));
2319 C->setMapLoc(Reader->ReadSourceLocation());
2320 C->setColonLoc(Reader->ReadSourceLocation());
2321 auto NumVars = C->varlist_size();
2327 Vars.reserve(NumVars);
2328 for (
unsigned i = 0; i != NumVars; ++i)
2329 Vars.push_back(Reader->Record.readSubExpr());
2330 C->setVarRefs(Vars);
2333 Decls.reserve(UniqueDecls);
2334 for (
unsigned i = 0; i < UniqueDecls; ++i)
2335 Decls.push_back(Reader->Record.readDeclAs<
ValueDecl>());
2339 ListsPerDecl.reserve(UniqueDecls);
2340 for (
unsigned i = 0; i < UniqueDecls; ++i)
2341 ListsPerDecl.push_back(Reader->Record.readInt());
2345 ListSizes.reserve(TotalLists);
2346 for (
unsigned i = 0; i < TotalLists; ++i)
2347 ListSizes.push_back(Reader->Record.readInt());
2351 Components.reserve(TotalComponents);
2352 for (
unsigned i = 0; i < TotalComponents; ++i) {
2353 Expr *AssociatedExpr = Reader->Record.readSubExpr();
2356 AssociatedExpr, AssociatedDecl));
2362 VisitOMPClauseWithPreInit(C);
2363 C->setNumTeams(Reader->Record.readSubExpr());
2368 VisitOMPClauseWithPreInit(C);
2369 C->setThreadLimit(Reader->Record.readSubExpr());
2374 C->setPriority(Reader->Record.readSubExpr());
2379 C->setGrainsize(Reader->Record.readSubExpr());
2384 C->setNumTasks(Reader->Record.readSubExpr());
2388 void OMPClauseReader::VisitOMPHintClause(
OMPHintClause *C) {
2389 C->setHint(Reader->Record.readSubExpr());
2394 VisitOMPClauseWithPreInit(C);
2395 C->setDistScheduleKind(
2396 static_cast<OpenMPDistScheduleClauseKind>(Reader->Record.readInt()));
2397 C->setChunkSize(Reader->Record.readSubExpr());
2398 C->setLParenLoc(Reader->ReadSourceLocation());
2399 C->setDistScheduleKindLoc(Reader->ReadSourceLocation());
2400 C->setCommaLoc(Reader->ReadSourceLocation());
2404 C->setDefaultmapKind(
2405 static_cast<OpenMPDefaultmapClauseKind>(Reader->Record.readInt()));
2406 C->setDefaultmapModifier(
2407 static_cast<OpenMPDefaultmapClauseModifier>(Reader->Record.readInt()));
2408 C->setLParenLoc(Reader->ReadSourceLocation());
2409 C->setDefaultmapModifierLoc(Reader->ReadSourceLocation());
2410 C->setDefaultmapKindLoc(Reader->ReadSourceLocation());
2413 void OMPClauseReader::VisitOMPToClause(
OMPToClause *C) {
2414 C->setLParenLoc(Reader->ReadSourceLocation());
2415 auto NumVars = C->varlist_size();
2421 Vars.reserve(NumVars);
2422 for (
unsigned i = 0; i != NumVars; ++i)
2423 Vars.push_back(Reader->Record.readSubExpr());
2424 C->setVarRefs(Vars);
2427 Decls.reserve(UniqueDecls);
2428 for (
unsigned i = 0; i < UniqueDecls; ++i)
2429 Decls.push_back(Reader->Record.readDeclAs<
ValueDecl>());
2433 ListsPerDecl.reserve(UniqueDecls);
2434 for (
unsigned i = 0; i < UniqueDecls; ++i)
2435 ListsPerDecl.push_back(Reader->Record.readInt());
2439 ListSizes.reserve(TotalLists);
2440 for (
unsigned i = 0; i < TotalLists; ++i)
2441 ListSizes.push_back(Reader->Record.readInt());
2445 Components.reserve(TotalComponents);
2446 for (
unsigned i = 0; i < TotalComponents; ++i) {
2447 Expr *AssociatedExpr = Reader->Record.readSubExpr();
2450 AssociatedExpr, AssociatedDecl));
2455 void OMPClauseReader::VisitOMPFromClause(
OMPFromClause *C) {
2456 C->setLParenLoc(Reader->ReadSourceLocation());
2457 auto NumVars = C->varlist_size();
2463 Vars.reserve(NumVars);
2464 for (
unsigned i = 0; i != NumVars; ++i)
2465 Vars.push_back(Reader->Record.readSubExpr());
2466 C->setVarRefs(Vars);
2469 Decls.reserve(UniqueDecls);
2470 for (
unsigned i = 0; i < UniqueDecls; ++i)
2471 Decls.push_back(Reader->Record.readDeclAs<
ValueDecl>());
2475 ListsPerDecl.reserve(UniqueDecls);
2476 for (
unsigned i = 0; i < UniqueDecls; ++i)
2477 ListsPerDecl.push_back(Reader->Record.readInt());
2481 ListSizes.reserve(TotalLists);
2482 for (
unsigned i = 0; i < TotalLists; ++i)
2483 ListSizes.push_back(Reader->Record.readInt());
2487 Components.reserve(TotalComponents);
2488 for (
unsigned i = 0; i < TotalComponents; ++i) {
2489 Expr *AssociatedExpr = Reader->Record.readSubExpr();
2492 AssociatedExpr, AssociatedDecl));
2498 C->setLParenLoc(Reader->ReadSourceLocation());
2499 auto NumVars = C->varlist_size();
2505 Vars.reserve(NumVars);
2506 for (
unsigned i = 0; i != NumVars; ++i)
2507 Vars.push_back(Reader->Record.readSubExpr());
2508 C->setVarRefs(Vars);
2510 for (
unsigned i = 0; i != NumVars; ++i)
2511 Vars.push_back(Reader->Record.readSubExpr());
2512 C->setPrivateCopies(Vars);
2514 for (
unsigned i = 0; i != NumVars; ++i)
2515 Vars.push_back(Reader->Record.readSubExpr());
2519 Decls.reserve(UniqueDecls);
2520 for (
unsigned i = 0; i < UniqueDecls; ++i)
2521 Decls.push_back(Reader->Record.readDeclAs<
ValueDecl>());
2525 ListsPerDecl.reserve(UniqueDecls);
2526 for (
unsigned i = 0; i < UniqueDecls; ++i)
2527 ListsPerDecl.push_back(Reader->Record.readInt());
2531 ListSizes.reserve(TotalLists);
2532 for (
unsigned i = 0; i < TotalLists; ++i)
2533 ListSizes.push_back(Reader->Record.readInt());
2537 Components.reserve(TotalComponents);
2538 for (
unsigned i = 0; i < TotalComponents; ++i) {
2539 Expr *AssociatedExpr = Reader->Record.readSubExpr();
2542 AssociatedExpr, AssociatedDecl));
2548 C->setLParenLoc(Reader->ReadSourceLocation());
2549 auto NumVars = C->varlist_size();
2555 Vars.reserve(NumVars);
2556 for (
unsigned i = 0; i != NumVars; ++i)
2557 Vars.push_back(Reader->Record.readSubExpr());
2558 C->setVarRefs(Vars);
2562 Decls.reserve(UniqueDecls);
2563 for (
unsigned i = 0; i < UniqueDecls; ++i)
2564 Decls.push_back(Reader->Record.readDeclAs<
ValueDecl>());
2568 ListsPerDecl.reserve(UniqueDecls);
2569 for (
unsigned i = 0; i < UniqueDecls; ++i)
2570 ListsPerDecl.push_back(Reader->Record.readInt());
2574 ListSizes.reserve(TotalLists);
2575 for (
unsigned i = 0; i < TotalLists; ++i)
2576 ListSizes.push_back(Reader->Record.readInt());
2580 Components.reserve(TotalComponents);
2581 for (
unsigned i = 0; i < TotalComponents; ++i) {
2582 Expr *AssociatedExpr = Reader->Record.readSubExpr();
2585 AssociatedExpr, AssociatedDecl));
2599 Clauses.push_back(ClauseReader.readClause());
2609 VisitOMPExecutableDirective(D);
2614 D->
setCond(Record.readSubExpr());
2615 D->
setInit(Record.readSubExpr());
2616 D->
setInc(Record.readSubExpr());
2645 Sub.reserve(CollapsedNum);
2646 for (
unsigned i = 0; i < CollapsedNum; ++i)
2647 Sub.push_back(Record.readSubExpr());
2650 for (
unsigned i = 0; i < CollapsedNum; ++i)
2651 Sub.push_back(Record.readSubExpr());
2654 for (
unsigned i = 0; i < CollapsedNum; ++i)
2655 Sub.push_back(Record.readSubExpr());
2658 for (
unsigned i = 0; i < CollapsedNum; ++i)
2659 Sub.push_back(Record.readSubExpr());
2662 for (
unsigned i = 0; i < CollapsedNum; ++i)
2663 Sub.push_back(Record.readSubExpr());
2671 VisitOMPExecutableDirective(D);
2672 D->setHasCancel(Record.readInt());
2676 VisitOMPLoopDirective(D);
2680 VisitOMPLoopDirective(D);
2681 D->setHasCancel(Record.readInt());
2685 VisitOMPLoopDirective(D);
2692 VisitOMPExecutableDirective(D);
2693 D->setHasCancel(Record.readInt());
2698 VisitOMPExecutableDirective(D);
2706 VisitOMPExecutableDirective(D);
2711 VisitOMPExecutableDirective(D);
2718 VisitOMPExecutableDirective(D);
2719 ReadDeclarationNameInfo(D->DirName);
2723 VisitOMPLoopDirective(D);
2724 D->setHasCancel(Record.readInt());
2727 void ASTStmtReader::VisitOMPParallelForSimdDirective(
2729 VisitOMPLoopDirective(D);
2732 void ASTStmtReader::VisitOMPParallelSectionsDirective(
2737 VisitOMPExecutableDirective(D);
2738 D->setHasCancel(Record.readInt());
2745 VisitOMPExecutableDirective(D);
2746 D->setHasCancel(Record.readInt());
2751 VisitOMPExecutableDirective(D);
2756 VisitOMPExecutableDirective(D);
2761 VisitOMPExecutableDirective(D);
2768 VisitOMPExecutableDirective(D);
2775 VisitOMPExecutableDirective(D);
2782 VisitOMPExecutableDirective(D);
2789 VisitOMPExecutableDirective(D);
2790 D->setX(Record.readSubExpr());
2791 D->setV(Record.readSubExpr());
2792 D->setExpr(Record.readSubExpr());
2793 D->setUpdateExpr(Record.readSubExpr());
2794 D->IsXLHSInRHSPart = Record.readInt() != 0;
2795 D->IsPostfixUpdate = Record.readInt() != 0;
2802 VisitOMPExecutableDirective(D);
2808 VisitOMPExecutableDirective(D);
2811 void ASTStmtReader::VisitOMPTargetEnterDataDirective(
2815 VisitOMPExecutableDirective(D);
2818 void ASTStmtReader::VisitOMPTargetExitDataDirective(
2822 VisitOMPExecutableDirective(D);
2825 void ASTStmtReader::VisitOMPTargetParallelDirective(
2829 VisitOMPExecutableDirective(D);
2832 void ASTStmtReader::VisitOMPTargetParallelForDirective(
2834 VisitOMPLoopDirective(D);
2835 D->setHasCancel(Record.readInt());
2842 VisitOMPExecutableDirective(D);
2845 void ASTStmtReader::VisitOMPCancellationPointDirective(
2848 VisitOMPExecutableDirective(D);
2849 D->setCancelRegion(static_cast<OpenMPDirectiveKind>(Record.readInt()));
2856 VisitOMPExecutableDirective(D);
2857 D->setCancelRegion(static_cast<OpenMPDirectiveKind>(Record.readInt()));
2861 VisitOMPLoopDirective(D);
2865 VisitOMPLoopDirective(D);
2869 VisitOMPLoopDirective(D);
2875 VisitOMPExecutableDirective(D);
2877 void ASTStmtReader::VisitOMPDistributeParallelForDirective(
2879 VisitOMPLoopDirective(D);
2882 void ASTStmtReader::VisitOMPDistributeParallelForSimdDirective(
2884 VisitOMPLoopDirective(D);
2887 void ASTStmtReader::VisitOMPDistributeSimdDirective(
2889 VisitOMPLoopDirective(D);
2892 void ASTStmtReader::VisitOMPTargetParallelForSimdDirective(
2894 VisitOMPLoopDirective(D);
2898 VisitOMPLoopDirective(D);
2901 void ASTStmtReader::VisitOMPTeamsDistributeDirective(
2903 VisitOMPLoopDirective(D);
2906 void ASTStmtReader::VisitOMPTeamsDistributeSimdDirective(
2908 VisitOMPLoopDirective(D);
2911 void ASTStmtReader::VisitOMPTeamsDistributeParallelForSimdDirective(
2913 VisitOMPLoopDirective(D);
2916 void ASTStmtReader::VisitOMPTeamsDistributeParallelForDirective(
2918 VisitOMPLoopDirective(D);
2925 VisitOMPExecutableDirective(D);
2928 void ASTStmtReader::VisitOMPTargetTeamsDistributeDirective(
2930 VisitOMPLoopDirective(D);
2933 void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForDirective(
2935 VisitOMPLoopDirective(D);
2938 void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
2940 VisitOMPLoopDirective(D);
2943 void ASTStmtReader::VisitOMPTargetTeamsDistributeSimdDirective(
2945 VisitOMPLoopDirective(D);
2953 switch (ReadingKind) {
2955 llvm_unreachable(
"should not call this when not reading anything");
2958 return ReadStmtFromStream(F);
2960 return ReadSubStmt();
2963 llvm_unreachable(
"ReadingKind not set ?");
2967 return cast_or_null<Expr>(ReadStmt(F));
2971 return cast_or_null<Expr>(ReadSubStmt());
2981 Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) {
2983 ReadingKindTracker ReadingKind(Read_Stmt, *
this);
2984 llvm::BitstreamCursor &
Cursor = F.DeclsCursor;
2988 llvm::DenseMap<uint64_t, Stmt *> StmtEntries;
2991 unsigned PrevNumStmts = StmtStack.size();
2999 llvm::BitstreamEntry Entry = Cursor.advanceSkippingSubblocks();
3001 switch (Entry.Kind) {
3002 case llvm::BitstreamEntry::SubBlock:
3004 Error(
"malformed block record in AST file");
3006 case llvm::BitstreamEntry::EndBlock:
3008 case llvm::BitstreamEntry::Record:
3015 bool Finished =
false;
3016 bool IsStmtReference =
false;
3017 switch ((
StmtCode)Record.readRecord(Cursor, Entry.ID)) {
3023 IsStmtReference =
true;
3024 assert(StmtEntries.find(Record[0]) != StmtEntries.end() &&
3025 "No stmt was recorded for this offset reference!");
3026 S = StmtEntries[Record.readInt()];
3124 Record[ASTStmtReader::NumExprFields + 1],
3125 Record[ASTStmtReader::NumExprFields + 2],
3126 Record[ASTStmtReader::NumExprFields + 2] ?
3127 Record[ASTStmtReader::NumExprFields + 5] : 0);
3166 Record[ASTStmtReader::NumExprFields + 1]);
3190 assert(Record.getIdx() == 0);
3192 if (Record.readInt()) {
3193 QualifierLoc = Record.readNestedNameSpecifierLoc();
3198 bool HasTemplateKWAndArgsInfo = Record.readInt();
3199 if (HasTemplateKWAndArgsInfo) {
3200 TemplateKWLoc = Record.readSourceLocation();
3201 unsigned NumTemplateArgs = Record.readInt();
3204 for (
unsigned i = 0; i != NumTemplateArgs; ++i)
3205 ArgInfo.
addArgument(Record.readTemplateArgumentLoc());
3208 bool HadMultipleCandidates = Record.readInt();
3217 Expr *Base = ReadSubExpr();
3221 bool IsArrow = Record.readInt();
3225 TemplateKWLoc, MemberD, FoundDecl, MemberNameInfo,
3226 HasTemplateKWAndArgsInfo ? &ArgInfo :
nullptr, T,
3228 Record.readDeclarationNameLoc(cast<MemberExpr>(S)->MemberDNLoc,
3230 if (HadMultipleCandidates)
3231 cast<MemberExpr>(
S)->setHadMultipleCandidates(
true);
3348 Record[ASTStmtReader::NumExprFields + 1]);
3369 llvm_unreachable(
"mismatching AST file");
3373 Record[ASTStmtReader::NumExprFields + 1]);
3396 Record[ASTStmtReader::NumStmtFields + 1]);
3456 CollapsedNum, Empty);
3503 CollapsedNum, Empty);
3511 CollapsedNum, Empty);
3586 CollapsedNum, Empty);
3621 CollapsedNum, Empty);
3637 CollapsedNum, Empty);
3654 CollapsedNum, Empty);
3662 CollapsedNum, Empty);
3678 CollapsedNum, Empty);
3686 CollapsedNum, Empty);
3694 Context, NumClauses, CollapsedNum, Empty);
3702 Context, NumClauses, CollapsedNum, Empty);
3716 CollapsedNum, Empty);
3724 Context, NumClauses, CollapsedNum, Empty);
3732 Context, NumClauses, CollapsedNum, Empty);
3740 Context, NumClauses, CollapsedNum, Empty);
3858 Record[ASTStmtReader::NumExprFields]
3859 ? Record[ASTStmtReader::NumExprFields + 1]
3866 Record[ASTStmtReader::NumExprFields]
3867 ? Record[ASTStmtReader::NumExprFields + 1]
3879 Record[ASTStmtReader::NumExprFields]
3880 ? Record[ASTStmtReader::NumExprFields + 1]
3887 Record[ASTStmtReader::NumExprFields]
3888 ? Record[ASTStmtReader::NumExprFields + 1]
3996 ++NumStatementsRead;
3998 if (S && !IsStmtReference) {
4000 StmtEntries[Cursor.GetCurrentBitNo()] =
S;
4003 assert(Record.getIdx() == Record.size() &&
4004 "Invalid deserialization of statement");
4005 StmtStack.push_back(S);
4008 assert(StmtStack.size() > PrevNumStmts &&
"Read too many sub-stmts!");
4009 assert(StmtStack.size() == PrevNumStmts + 1 &&
"Extra expressions on stack!");
4010 return StmtStack.pop_back_val();
void setPreInits(Stmt *PreInits)
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.
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 OMPDependClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
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.
SourceLocation getEnd() const
StmtClass getStmtClass() const
void setRangeStmt(Stmt *S)
The null pointer literal (C++11 [lex.nullptr])
This represents '#pragma omp task' directive.
void setEnsureUpperBound(Expr *EUB)
This represents a GCC inline-assembly statement extension.
Represents a 'co_await' expression while the type of the promise is dependent.
unsigned arg_size() const
Retrieve the number of arguments.
void setSubStmt(CompoundStmt *S)
unsigned getNumOutputs() const
This represents 'thread_limit' clause in the '#pragma omp ...' directive.
A UserDefinedLiteral record.
The receiver is an object instance.
static OMPMasterDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
static OMPCopyinClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
An IndirectGotoStmt record.
This represents clause 'copyin' in the '#pragma omp ...' directives.
A (possibly-)qualified type.
static OMPUseDevicePtrClause * CreateEmpty(const ASTContext &C, unsigned NumVars, unsigned NumUniqueDeclarations, unsigned NumComponentLists, unsigned NumComponents)
Creates an empty clause with the place for NumVars variables.
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument.
void setOperatorLoc(SourceLocation L)
static StringLiteral * CreateEmpty(const ASTContext &C, unsigned NumStrs)
Construct an empty string literal.
void setStmts(const ASTContext &C, ArrayRef< Stmt * > Stmts)
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)
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.
IdentifierInfo * getIdentifier() const
getIdentifier - Get the identifier that names this declaration, if there is one.
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)
IfStmt - This represents an if/then/else.
Class that handles pre-initialization statement for some clauses, like 'shedule', 'firstprivate' etc...
This represents '#pragma omp for simd' directive.
for(unsigned I=0, E=TL.getNumArgs();I!=E;++I)
void setRParenLoc(SourceLocation L)
void setContinueLoc(SourceLocation L)
void setThrowExpr(Stmt *S)
void setAtLoc(SourceLocation L)
An ImplicitValueInitExpr record.
static OMPFirstprivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
Decl - This represents one declaration (or definition), e.g.
void setDeclGroup(DeclGroupRef DGR)
This represents 'grainsize' clause in the '#pragma omp ...' directive.
An ImplicitCastExpr record.
This represents '#pragma omp teams distribute parallel for' composite directive.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
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...
This represents 'if' clause in the '#pragma omp ...' directive.
Defines the C++ template declaration subclasses.
void setPrevEnsureUpperBound(Expr *PrevEUB)
Represents an attribute applied to a statement.
void setUpperBoundVariable(Expr *UB)
void setComputationResultType(QualType T)
void setNumIterations(Expr *NI)
static OMPMapClause * CreateEmpty(const ASTContext &C, unsigned NumVars, unsigned NumUniqueDeclarations, unsigned NumComponentLists, unsigned NumComponents)
Creates an empty clause with the place for for NumVars original expressions, NumUniqueDeclarations de...
ParenExpr - This represents a parethesized expression, e.g.
A CXXOperatorCallExpr record.
pack_iterator pack_begin() const
Iterator referencing the first argument of a template argument pack.
void setSuper(SourceLocation Loc, QualType T, bool IsInstanceSuper)
This represents 'priority' clause in the '#pragma omp ...' directive.
This represents '#pragma omp target teams distribute' combined directive.
A CXXTemporaryObjectExpr record.
Represents Objective-C's @throw statement.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
void setNextLowerBound(Expr *NLB)
DeclRefExprBitfields DeclRefExprBits
Represents a call to a C++ constructor.
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent...
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
A container of type source information.
This represents 'update' clause in the '#pragma omp atomic' directive.
void setSwitchCaseList(SwitchCase *SC)
Set the case list for this switch statement.
void setComponents(ArrayRef< MappableComponent > Components, ArrayRef< unsigned > CLSs)
Set the components that are in the trailing objects of the class.
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)
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
This represents '#pragma omp target teams distribute parallel for' combined directive.
void setLocation(SourceLocation Loc)
static ObjCDictionaryLiteral * CreateEmpty(const ASTContext &C, unsigned NumElements, bool HasPackExpansions)
void setConditionVariable(const ASTContext &C, VarDecl *V)
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
void setLocation(SourceLocation L)
void setDelegateInitCall(bool isDelegate)
void setProtocol(ObjCProtocolDecl *P)
void setRParenLoc(SourceLocation L)
static OMPReductionClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
void setIsLastIterVariable(Expr *IL)
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
This represents '#pragma omp target exit data' directive.
void setRAngleLoc(SourceLocation Loc)
static OffsetOfExpr * CreateEmpty(const ASTContext &C, unsigned NumComps, unsigned NumExprs)
This represents 'read' clause in the '#pragma omp atomic' directive.
static OMPTargetTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents clause 'private' in the '#pragma omp ...' directives.
static OMPParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for N clauses.
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC 'id' type.
This represents 'num_threads' clause in the '#pragma omp ...' directive.
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)
This represents 'defaultmap' clause in the '#pragma omp ...' directive.
static FunctionParmPackExpr * CreateEmpty(const ASTContext &Context, unsigned NumParams)
void setAsmLoc(SourceLocation L)
static DependentScopeDeclRefExpr * CreateEmpty(const ASTContext &C, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
ObjCMethodDecl - Represents an instance or class method declaration.
void setValue(unsigned Val)
A ConditionOperator record.
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.
void setGNUSyntax(bool GNU)
This represents implicit clause 'flush' for the '#pragma omp flush' directive.
A CXXConstructExpr record.
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()
void initializeResults(const ASTContext &C, UnresolvedSetIterator Begin, UnresolvedSetIterator End)
A C++ throw-expression (C++ [except.throw]).
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
ParmVarDecl - Represents a parameter to a function.
unsigned path_size() const
static OMPTaskReductionClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
This represents 'nogroup' clause in the '#pragma omp ...' directive.
A ShuffleVectorExpr record.
This represents 'safelen' clause in the '#pragma omp ...' directive.
A C++ static_cast expression (C++ [expr.static.cast]).
OpenMPDirectiveKind getDirectiveKind() const
LabelStmt - Represents a label, which has a substatement.
void AllocateArgsArray(const ASTContext &C, bool isArray, unsigned numPlaceArgs, bool hasInitializer)
static OMPTargetExitDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
void setStrTokenLoc(unsigned TokNum, SourceLocation L)
void setAtLoc(SourceLocation L)
Represents a C99 designated initializer expression.
void setFinals(ArrayRef< Expr * > A)
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.
unsigned getTotalComponentListNum() const
Return the number of lists derived from the clause expressions.
An ObjCAtThrowStmt record.
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.
unsigned getNumInputs() const
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.
This represents 'simd' clause in the '#pragma omp ...' directive.
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.
unsigned getNumAssocs() const
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.
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
This represents clause 'lastprivate' in the '#pragma omp ...' directives.
void setIsMicrosoftABI(bool IsMS)
Represents a place-holder for an object not to be initialized by anything.
void setNumArgs(const ASTContext &C, unsigned NumArgs)
setNumArgs - This changes the number of arguments present in this call.
void setRequiresZeroInitialization(bool ZeroInit)
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...
This represents clause 'map' in the '#pragma omp ...' directives.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
void setArg(unsigned I, Expr *E)
void setArg(unsigned Arg, Expr *ArgExpr)
setArg - Set the specified argument.
This represents clause 'to' in the '#pragma omp ...' directives.
void setColonLoc(SourceLocation Loc)
Sets the location of ':'.
void setRParen(SourceLocation Loc)
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...
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
void VisitOMPClauseWithPostUpdate(OMPClauseWithPostUpdate *C)
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]];.
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...
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
This represents '#pragma omp critical' directive.
static OMPCriticalDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
void setRParenLoc(SourceLocation L)
unsigned getTotalComponentsNum() const
Return the total number of components in all lists derived from the clause.
Represents Objective-C's @catch statement.
void setLBraceLoc(SourceLocation Loc)
This represents clause 'copyprivate' in the '#pragma omp ...' directives.
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)
ForStmt - This represents a 'for (init;cond;inc)' stmt.
void setOperatorNew(FunctionDecl *D)
static DeclAccessPair make(NamedDecl *D, AccessSpecifier AS)
void setLocation(SourceLocation L)
void setCounters(ArrayRef< Expr * > A)
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)
static OMPIsDevicePtrClause * CreateEmpty(const ASTContext &C, unsigned NumVars, unsigned NumUniqueDeclarations, unsigned NumComponentLists, unsigned NumComponents)
Creates an empty clause with the place for NumVars variables.
A convenient class for passing around template argument information.
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)
A builtin binary operation expression such as "x + y" or "x <= y".
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
bool isValueDependent() const
isValueDependent - Determines whether this expression is value-dependent (C++ [temp.dep.constexpr]).
static OMPTargetTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static CXXTryStmt * Create(const ASTContext &C, SourceLocation tryLoc, Stmt *tryBlock, ArrayRef< Stmt * > handlers)
void setAccessor(IdentifierInfo *II)
static OMPToClause * CreateEmpty(const ASTContext &C, unsigned NumVars, unsigned NumUniqueDeclarations, unsigned NumComponentLists, unsigned NumComponents)
Creates an empty clause with the place for NumVars variables.
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
Class that handles post-update expression for some clauses, like 'lastprivate', 'reduction' etc...
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)
This represents 'default' clause in the '#pragma omp ...' directive.
ObjCStringLiteral, used for Objective-C string literals i.e.
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
This represents 'final' clause in the '#pragma omp ...' directive.
This represents 'mergeable' clause in the '#pragma omp ...' directive.
void setCombinedInit(Expr *CombInit)
void setListInitialization(bool V)
This represents '#pragma omp teams' directive.
void setOperatorLoc(SourceLocation L)
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
This represents clause 'reduction' in the '#pragma omp ...' directives.
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 ReadTemplateKWAndArgsInfo(ASTTemplateKWAndArgsInfo &Args, TemplateArgumentLoc *ArgsLocArray, unsigned NumTemplateArgs)
Read and initialize a ExplicitTemplateArgumentList structure.
Represents a C++ member access expression where the actual member referenced could not be resolved be...
This represents clause 'is_device_ptr' in the '#pragma omp ...' directives.
void setRParenLoc(SourceLocation Loc)
detail::InMemoryDirectory::const_iterator I
void setRParenLoc(SourceLocation R)
A default argument (C++ [dcl.fct.default]).
void setStmt(LabelStmt *T)
void setSourceRange(SourceRange R)
void setRParenLoc(SourceLocation L)
This represents clause 'from' in the '#pragma omp ...' directives.
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.
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.
void setFPFeatures(FPOptions F)
CompoundStmt - This represents a group of statements like { stmt stmt }.
void setBlockDecl(BlockDecl *BD)
This represents 'threads' clause in the '#pragma omp ...' directive.
This represents '#pragma omp taskgroup' directive.
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
static OMPSingleDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
unsigned getNumObjects() const
CastKind
CastKind - The kind of operation required for a conversion.
void setSemiLoc(SourceLocation L)
This represents clause 'aligned' in the '#pragma omp ...' directives.
static OMPAlignedClause * CreateEmpty(const ASTContext &C, unsigned NumVars)
Creates an empty clause with the place for NumVars variables.
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
void setLocEnd(SourceLocation Loc)
Sets the ending location of the clause.
void setLParen(SourceLocation Loc)
This represents clause 'task_reduction' in the '#pragma omp taskgroup' directives.
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)
This represents '#pragma omp distribute' directive.
This represents implicit clause 'depend' for the '#pragma omp task' directive.
void setString(const ASTContext &C, StringRef Str, StringKind Kind, bool IsPascal)
Sets the string data to the given string data.
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)
BlockDecl - This represents a block literal declaration, which is like an unnamed FunctionDecl...
This represents 'proc_bind' clause in the '#pragma omp ...' directive.
static OMPSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'capture' clause in the '#pragma omp atomic' directive.
ValueDecl - Represent the declaration of a variable (in which case it is an lvalue) a function (in wh...
Expr - This represents one expression.
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)
This represents 'simdlen' clause in the '#pragma omp ...' directive.
void setLParenLoc(SourceLocation L)
Stmt * ReadStmt(ModuleFile &F)
Reads a statement.
void setSyntacticForm(InitListExpr *Init)
Represents a C++ functional cast expression that builds a temporary object.
void setRBracketLoc(SourceLocation L)
A C++ const_cast expression (C++ [expr.const.cast]).
unsigned getNumExpressions() const
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.
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)
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
void setObjectKind(ExprObjectKind Cat)
setObjectKind - Set the object kind produced by this expression.
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.
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.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
Information about a module that has been loaded by the ASTReader.
void setDeclNumLists(ArrayRef< unsigned > DNLs)
Set the number of lists per declaration that are in the trailing objects of the class.
This represents 'ordered' clause in the '#pragma omp ...' directive.
ExprWithCleanupsBitfields ExprWithCleanupsBits
static OMPFlushClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
An ArrayInitLoopExpr record.
A PseudoObjectExpr record.
void setColonLoc(SourceLocation L)
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c array literal.
void setFinallyStmt(Stmt *S)
unsigned getNumSubExprs() const
An ObjCIndirectCopyRestoreExpr record.
This represents '#pragma omp for' directive.
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.
static OMPLinearClause * CreateEmpty(const ASTContext &C, unsigned NumVars)
Creates an empty clause with the place for NumVars variables.
void setRParenLoc(SourceLocation L)
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.
unsigned getNumComponents() const
This represents a Microsoft inline-assembly statement extension.
void setColonLoc(SourceLocation L)
void setPrivateCopies(ArrayRef< Expr * > PrivateCopies)
Set list of helper expressions, required for generation of private copies of original lastprivate var...
void setRParenLoc(SourceLocation L)
A DesignatedInitUpdateExpr record.
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.
A member reference to an MSPropertyDecl.
DeclarationName getDeclName() const
getDeclName - Get the actual, stored name of the declaration, which may be a special name...
static OMPParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Represents a reference to a non-type template parameter that has been substituted with a template arg...
static OMPPrivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
void setForLoc(SourceLocation Loc)
This represents '#pragma omp cancel' directive.
This represents 'collapse' clause in the '#pragma omp ...' directive.
This represents clause 'firstprivate' in the '#pragma omp ...' directives.
void setDistInc(Expr *DistInc)
An ObjCAvailabilityCheckExpr record.
void setRParenLoc(SourceLocation L)
unsigned getNumClauses() const
Get number of clauses.
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.
An ObjCPropertyRefExpr record.
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1...
An ObjCForCollectionStmt record.
This represents '#pragma omp flush' directive.
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.
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.
This represents 'seq_cst' clause in the '#pragma omp atomic' directive.
This represents 'untied' clause in the '#pragma omp ...' directive.
void setTypeOperandSourceInfo(TypeSourceInfo *TSI)
A MS-style AsmStmt record.
void setLocStart(SourceLocation Loc)
Set starting location of directive kind.
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)
const llvm::fltSemantics & getSemantics() const
Return the APFloat semantics this literal uses.
This represents '#pragma omp target enter data' directive.
void setPostUpdateExpr(Expr *S)
Set pre-initialization statement for the clause.
void setLowerBoundVariable(Expr *LB)
void setLParenLoc(SourceLocation L)
void setUniqueDecls(ArrayRef< ValueDecl * > UDs)
Set the unique declarations that are in the trailing objects of the class.
This represents 'num_teams' clause in the '#pragma omp ...' directive.
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...
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.
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)
void setHadMultipleCandidates(bool V)
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)
This represents 'hint' clause in the '#pragma omp ...' directive.
PseudoObjectExprBitfields PseudoObjectExprBits
void setUpdater(Expr *Updater)
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 CXXDependentScopeMemberExpr * CreateEmpty(const ASTContext &C, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
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)
void setVarRefs(ArrayRef< Expr * > VL)
Sets the list of variables for this clause.
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit...
void setSourceRange(SourceRange R)
This represents 'schedule' clause in the '#pragma omp ...' directive.
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...
unsigned getCollapsedNumber() const
Get number of collapsed loops.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
void setIdentLoc(SourceLocation L)
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
OpenMPDirectiveKind
OpenMP directives.
LabelDecl - Represents the declaration of a label.
This represents clause 'shared' in the '#pragma omp ...' directives.
void setLabelLoc(SourceLocation L)
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 ...
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 setConditionVariable(const ASTContext &C, VarDecl *V)
This is a basic class for representing single OpenMP clause.
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>.
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.
void setDecl(ValueDecl *NewD)
void setThrowLoc(SourceLocation Loc)
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.
SourceLocation getBegin() const
static OMPTeamsDistributeParallelForDirective * 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.
static DesignatedInitExpr * CreateEmpty(const ASTContext &C, unsigned NumIndexExprs)
static DeclGroup * Create(ASTContext &C, Decl **Decls, unsigned NumDecls)
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)
An expression trait intrinsic.
void setEncodedTypeSourceInfo(TypeSourceInfo *EncType)
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 VisitOMPClauseWithPreInit(OMPClauseWithPreInit *C)
void setLAngleLoc(SourceLocation Loc)
void sawArrayRangeDesignator(bool ARD=true)
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)
void setPrivateCounters(ArrayRef< Expr * > A)
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)
CompoundAssignOperator - For compound assignments (e.g.
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof...
Expr ** getElements()
Retrieve elements of array of literals.
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)
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 setLParenLoc(SourceLocation Loc)
Sets the location of '('.
void setExtendingDecl(const ValueDecl *ExtendedBy, unsigned ManglingNumber)
This represents 'device' clause in the '#pragma omp ...' directive.
An IntegerLiteral record.
OMPClauseReader(ASTStmtReader *R, ASTRecordReader &Record)
void setExprs(const ASTContext &C, ArrayRef< Expr * > Exprs)
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 setLParenLoc(SourceLocation Loc)
Sets the location of '('.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
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.
Expr * ReadExpr(ModuleFile &F)
Reads an expression.
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.
void setConstructionKind(ConstructionKind CK)
Represents a 'co_yield' expression.
An ObjCAutoreleasePoolStmt record.
DeclarationName - The name of a declaration.
unsigned getNumHandlers() const
A CharacterLiteral record.
void setCounterValue(Expr *V)
Set the loop counter value for the depend clauses with 'sink|source' kind of dependency.
Represents a C++11 pack expansion that produces a sequence of expressions.
unsigned getUniqueDeclarationsNum() const
Return the number of unique base declarations in this clause.
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.
This represents clause 'linear' in the '#pragma omp ...' directives.
void setInstantiationDependent(bool ID)
Set whether this expression is instantiation-dependent or not.
void setEllipsisLoc(SourceLocation L)
A CXXForRangeStmt record.
Kind
The kind of offsetof node we have.
bool isTypeOperand() const
detail::InMemoryDirectory::const_iterator E
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
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...
unsigned getNumArgs() const
unsigned getNumConcatenated() const
getNumConcatenated - Get the number of string literal tokens that were concatenated in translation ph...
void setMethodDecl(ObjCMethodDecl *MD)
This represents '#pragma omp atomic' directive.
void setLocStart(SourceLocation Loc)
Sets the starting location of the clause.
static PseudoObjectExpr * Create(const ASTContext &Context, Expr *syntactic, ArrayRef< Expr * > semantic, unsigned resultIndex)
static OMPSharedClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
An ObjCAtFinallyStmt record.
Represents a __leave statement.
void setRBracketLoc(SourceLocation L)
void setComponentListSizes(ArrayRef< unsigned > CLSs)
Set the cumulative component lists sizes that are in the trailing objects of the class.
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
bool hasQualifier() const
Determine whether this declaration reference was preceded by a C++ nested-name-specifier, e.g., N::foo.
SwitchStmt - This represents a 'switch' stmt.
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.
void setConditionVariable(const ASTContext &C, VarDecl *V)
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.
static OMPBarrierDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
Represents Objective-C's collection statement.
An ObjCAtSynchronizedStmt record.
void setIndexExpr(unsigned Idx, Expr *E)
ObjCEncodeExpr, used for @encode in Objective-C.
static OMPCopyprivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
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...
static UnresolvedMemberExpr * CreateEmpty(const ASTContext &C, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
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)
void setLParenLoc(SourceLocation L)
unsigned getNumArgs() const
Return the number of actual arguments in this message, not counting the receiver. ...
The template argument is actually a parameter pack.
Represents a base class of a C++ class.
This represents 'write' clause in the '#pragma omp atomic' directive.
void setRParenLoc(SourceLocation L)
unsigned getNumCatchStmts() const
Retrieve the number of @catch statements in this try-catch-finally block.
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)
void setOperatorLoc(SourceLocation L)
void setLocation(SourceLocation Location)
A ConvertVectorExpr record.
void setStarLoc(SourceLocation L)
bool hasAssociatedStmt() const
Returns true if directive has associated statement.
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)
static UnresolvedLookupExpr * CreateEmpty(const ASTContext &C, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
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.
An ArrayInitIndexExpr record.
A GCC-style AsmStmt record.
This represents '#pragma omp target parallel' directive.
This represents 'nowait' clause in the '#pragma omp ...' 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.
This represents 'num_tasks' clause in the '#pragma omp ...' directive.
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.
void setElseLoc(SourceLocation L)
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
CXXCatchStmt - This represents a C++ catch block.
static CXXUnresolvedConstructExpr * CreateEmpty(const ASTContext &C, unsigned NumArgs)
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr.type.conv]).
void setUpdates(ArrayRef< Expr * > A)
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.
void initializeFrom(SourceLocation TemplateKWLoc, const TemplateArgumentListInfo &List, TemplateArgumentLoc *OutArgArray)
void setIfLoc(SourceLocation L)
Field designator where the field has been resolved to a declaration.
void setIsaMemberLoc(SourceLocation L)
A CXXInheritedCtorInitExpr record.
unsigned kind
All of the diagnostics that can be emitted by the frontend.
void setExprOperand(Expr *E)
Represents Objective-C's @try ... @catch ... @finally statement.
This represents '#pragma omp taskloop simd' directive.
bool hasTemplateKWAndArgsInfo() const
void setTokenLocation(SourceLocation L)
static OMPSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
StringLiteral - This represents a string literal expression, e.g.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
void setPreInitStmt(Stmt *S, OpenMPDirectiveKind ThisRegion=OMPD_unknown)
Set pre-initialization statement for the clause.
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)
This represents 'dist_schedule' clause in the '#pragma omp ...' directive.
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.
static OMPFromClause * CreateEmpty(const ASTContext &C, unsigned NumVars, unsigned NumUniqueDeclarations, unsigned NumComponentLists, unsigned NumComponents)
Creates an empty clause with the place for NumVars variables.
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.
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.
Designator - A designator in a C99 designated initializer.
void setLabel(LabelDecl *D)
BreakStmt - This represents a break.
void setSubStmt(Stmt *SS)
static ObjCArrayLiteral * CreateEmpty(const ASTContext &C, unsigned NumElements)
unsigned getNumClobbers() const
A trivial tuple used to represent a source range.
This represents '#pragma omp taskyield' directive.
NamedDecl - This represents a decl with 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)
void setStdInitListInitialization(bool V)
bool isTypeOperand() const
The receiver is a superclass.
static OMPLastprivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
void setCombinedNextUpperBound(Expr *CombNUB)
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
Represents Objective-C's @autoreleasepool Statement.
void setWhileLoc(SourceLocation L)
unsigned varlist_size() const
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.
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 setInits(ArrayRef< Expr * > A)
void setKeywordLoc(SourceLocation L)
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c dictionary literal.
void setCapturedRegionKind(CapturedRegionKind Kind)
Set the captured region kind.
A GenericSelectionExpr record.
This represents '#pragma omp target parallel for' directive.
This represents clause 'use_device_ptr' in the '#pragma omp ...' directives.
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)
This represents '#pragma omp taskloop' directive.