21 #include "llvm/ADT/SmallString.h"
22 using namespace clang;
23 using namespace clang::serialization;
33 llvm::BitstreamCursor &DeclsCursor;
38 return Reader.ReadToken(F, R, I);
41 SourceLocation ReadSourceLocation(
const RecordData &R,
unsigned &I) {
42 return Reader.ReadSourceLocation(F, R, I);
45 SourceRange ReadSourceRange(
const RecordData &R,
unsigned &I) {
46 return Reader.ReadSourceRange(F, R, I);
49 std::string ReadString(
const RecordData &R,
unsigned &I) {
50 return Reader.ReadString(R, I);
53 TypeSourceInfo *GetTypeSourceInfo(
const RecordData &R,
unsigned &I) {
54 return Reader.GetTypeSourceInfo(F, R, I);
58 return Reader.ReadDeclID(F, R, I);
61 Decl *ReadDecl(
const RecordData &R,
unsigned &I) {
62 return Reader.ReadDecl(F, R, I);
66 T *ReadDeclAs(
const RecordData &R,
unsigned &I) {
67 return Reader.ReadDeclAs<T>(F, R, I);
72 Reader.ReadDeclarationNameLoc(F, DNLoc, Name, R, I);
77 Reader.ReadDeclarationNameInfo(F, NameInfo, R, I);
82 llvm::BitstreamCursor &
Cursor,
84 : Reader(Reader), F(F), DeclsCursor(Cursor), Record(Record), Idx(Idx) { }
88 static const unsigned NumStmtFields = 0;
92 static const unsigned NumExprFields = NumStmtFields + 7;
96 unsigned NumTemplateArgs);
99 unsigned NumTemplateArgs);
101 void VisitStmt(
Stmt *
S);
102 #define STMT(Type, Base) \
103 void Visit##Type(Type *);
104 #include "clang/AST/StmtNodes.inc"
110 unsigned NumTemplateArgs) {
115 for (
unsigned i = 0; i != NumTemplateArgs; ++i)
117 Reader.ReadTemplateArgumentLoc(F, Record, Idx));
122 assert(Idx == NumStmtFields &&
"Incorrect statement field count");
125 void ASTStmtReader::VisitNullStmt(
NullStmt *
S) {
127 S->
setSemiLoc(ReadSourceLocation(Record, Idx));
128 S->HasLeadingEmptyMacro = Record[Idx++];
131 void ASTStmtReader::VisitCompoundStmt(
CompoundStmt *S) {
134 unsigned NumStmts = Record[Idx++];
136 Stmts.push_back(Reader.ReadSubStmt());
137 S->
setStmts(Reader.getContext(), Stmts.data(), Stmts.size());
138 S->LBraceLoc = ReadSourceLocation(Record, Idx);
139 S->RBraceLoc = ReadSourceLocation(Record, Idx);
142 void ASTStmtReader::VisitSwitchCase(
SwitchCase *S) {
144 Reader.RecordSwitchCaseID(S, Record[Idx++]);
149 void ASTStmtReader::VisitCaseStmt(
CaseStmt *S) {
151 S->
setLHS(Reader.ReadSubExpr());
152 S->
setRHS(Reader.ReadSubExpr());
157 void ASTStmtReader::VisitDefaultStmt(
DefaultStmt *S) {
162 void ASTStmtReader::VisitLabelStmt(
LabelStmt *S) {
164 LabelDecl *LD = ReadDeclAs<LabelDecl>(Record, Idx);
173 uint64_t NumAttrs = Record[Idx++];
175 Reader.ReadAttributes(F, Attrs, Record, Idx);
177 assert(NumAttrs == S->NumAttrs);
178 assert(NumAttrs == Attrs.size());
179 std::copy(Attrs.begin(), Attrs.end(), S->getAttrArrayPtr());
180 S->SubStmt = Reader.ReadSubStmt();
181 S->AttrLoc = ReadSourceLocation(Record, Idx);
184 void ASTStmtReader::VisitIfStmt(
IfStmt *S) {
187 ReadDeclAs<VarDecl>(Record, Idx));
188 S->
setCond(Reader.ReadSubExpr());
189 S->
setThen(Reader.ReadSubStmt());
190 S->
setElse(Reader.ReadSubStmt());
191 S->
setIfLoc(ReadSourceLocation(Record, Idx));
192 S->
setElseLoc(ReadSourceLocation(Record, Idx));
195 void ASTStmtReader::VisitSwitchStmt(
SwitchStmt *S) {
198 ReadDeclAs<VarDecl>(Record, Idx));
199 S->
setCond(Reader.ReadSubExpr());
200 S->
setBody(Reader.ReadSubStmt());
206 for (
unsigned N = Record.size(); Idx != N; ++Idx) {
207 SwitchCase *SC = Reader.getSwitchCaseWithID(Record[Idx]);
217 void ASTStmtReader::VisitWhileStmt(
WhileStmt *S) {
220 ReadDeclAs<VarDecl>(Record, Idx));
222 S->
setCond(Reader.ReadSubExpr());
223 S->
setBody(Reader.ReadSubStmt());
227 void ASTStmtReader::VisitDoStmt(
DoStmt *S) {
229 S->
setCond(Reader.ReadSubExpr());
230 S->
setBody(Reader.ReadSubStmt());
231 S->
setDoLoc(ReadSourceLocation(Record, Idx));
236 void ASTStmtReader::VisitForStmt(
ForStmt *S) {
238 S->
setInit(Reader.ReadSubStmt());
239 S->
setCond(Reader.ReadSubExpr());
241 ReadDeclAs<VarDecl>(Record, Idx));
242 S->
setInc(Reader.ReadSubExpr());
243 S->
setBody(Reader.ReadSubStmt());
244 S->
setForLoc(ReadSourceLocation(Record, Idx));
249 void ASTStmtReader::VisitGotoStmt(
GotoStmt *S) {
251 S->
setLabel(ReadDeclAs<LabelDecl>(Record, Idx));
252 S->
setGotoLoc(ReadSourceLocation(Record, Idx));
258 S->
setGotoLoc(ReadSourceLocation(Record, Idx));
259 S->
setStarLoc(ReadSourceLocation(Record, Idx));
263 void ASTStmtReader::VisitContinueStmt(
ContinueStmt *S) {
268 void ASTStmtReader::VisitBreakStmt(
BreakStmt *S) {
273 void ASTStmtReader::VisitReturnStmt(
ReturnStmt *S) {
280 void ASTStmtReader::VisitDeclStmt(
DeclStmt *S) {
283 S->
setEndLoc(ReadSourceLocation(Record, Idx));
285 if (Idx + 1 == Record.size()) {
290 Decls.reserve(Record.size() - Idx);
291 for (
unsigned N = Record.size(); Idx != N; )
292 Decls.push_back(ReadDecl(Record, Idx));
299 void ASTStmtReader::VisitAsmStmt(
AsmStmt *S) {
304 S->
setAsmLoc(ReadSourceLocation(Record, Idx));
309 void ASTStmtReader::VisitGCCAsmStmt(
GCCAsmStmt *S) {
312 S->
setAsmString(cast_or_null<StringLiteral>(Reader.ReadSubStmt()));
322 for (
unsigned I = 0, N = NumOutputs + NumInputs; I != N; ++I) {
323 Names.push_back(Reader.GetIdentifierInfo(F, Record, Idx));
324 Constraints.push_back(cast_or_null<StringLiteral>(Reader.ReadSubStmt()));
325 Exprs.push_back(Reader.ReadSubStmt());
330 for (
unsigned I = 0; I != NumClobbers; ++I)
331 Clobbers.push_back(cast_or_null<StringLiteral>(Reader.ReadSubStmt()));
333 S->setOutputsAndInputsAndClobbers(Reader.getContext(),
334 Names.data(), Constraints.data(),
335 Exprs.data(), NumOutputs, NumInputs,
336 Clobbers.data(), NumClobbers);
339 void ASTStmtReader::VisitMSAsmStmt(
MSAsmStmt *S) {
341 S->LBraceLoc = ReadSourceLocation(Record, Idx);
342 S->EndLoc = ReadSourceLocation(Record, Idx);
343 S->NumAsmToks = Record[Idx++];
344 std::string AsmStr = ReadString(Record, Idx);
348 AsmToks.reserve(S->NumAsmToks);
349 for (
unsigned i = 0, e = S->NumAsmToks; i != e; ++i) {
350 AsmToks.push_back(ReadToken(Record, Idx));
361 for (
unsigned i = 0, e = S->
NumClobbers; i != e; ++i) {
362 ClobbersData.push_back(ReadString(Record, Idx));
363 Clobbers.push_back(ClobbersData.back());
371 Exprs.reserve(NumOperands);
372 ConstraintsData.reserve(NumOperands);
373 Constraints.reserve(NumOperands);
374 for (
unsigned i = 0; i != NumOperands; ++i) {
375 Exprs.push_back(cast<Expr>(Reader.ReadSubStmt()));
376 ConstraintsData.push_back(ReadString(Record, Idx));
377 Constraints.push_back(ConstraintsData.back());
380 S->initialize(Reader.getContext(), AsmStr, AsmToks,
381 Constraints, Exprs, Clobbers);
384 void ASTStmtReader::VisitCapturedStmt(
CapturedStmt *S) {
395 *I = Reader.ReadSubExpr();
398 S->setCapturedStmt(Reader.ReadSubStmt());
403 I.VarAndKind.setPointer(ReadDeclAs<VarDecl>(Record, Idx));
405 .setInt(static_cast<CapturedStmt::VariableCaptureKind>(Record[Idx++]));
406 I.Loc = ReadSourceLocation(Record, Idx);
410 void ASTStmtReader::VisitExpr(
Expr *E) {
412 E->
setType(Reader.readType(F, Record, Idx));
416 E->ExprBits.ContainsUnexpandedParameterPack = Record[Idx++];
417 E->
setValueKind(static_cast<ExprValueKind>(Record[Idx++]));
418 E->
setObjectKind(static_cast<ExprObjectKind>(Record[Idx++]));
419 assert(Idx == NumExprFields &&
"Incorrect expression field count");
426 E->FnName = cast_or_null<StringLiteral>(Reader.ReadSubExpr());
429 void ASTStmtReader::VisitDeclRefExpr(
DeclRefExpr *E) {
432 E->DeclRefExprBits.HasQualifier = Record[Idx++];
433 E->DeclRefExprBits.HasFoundDecl = Record[Idx++];
434 E->DeclRefExprBits.HasTemplateKWAndArgsInfo = Record[Idx++];
435 E->DeclRefExprBits.HadMultipleCandidates = Record[Idx++];
436 E->DeclRefExprBits.RefersToEnclosingVariableOrCapture = Record[Idx++];
437 unsigned NumTemplateArgs = 0;
439 NumTemplateArgs = Record[Idx++];
442 E->getInternalQualifierLoc()
443 = Reader.ReadNestedNameSpecifierLoc(F, Record, Idx);
445 if (E->hasFoundDecl())
446 E->getInternalFoundDecl() = ReadDeclAs<NamedDecl>(Record, Idx);
452 E->
setDecl(ReadDeclAs<ValueDecl>(Record, Idx));
460 E->
setValue(Reader.getContext(), Reader.ReadAPInt(Record, Idx));
465 E->
setRawSemantics(static_cast<Stmt::APFloatSemantics>(Record[Idx++]));
479 unsigned Len = Record[Idx++];
481 "Wrong number of concatenated tokens!");
485 bool isPascal = Record[Idx++];
501 E->
setKind(static_cast<CharacterLiteral::CharacterKind>(Record[Idx++]));
504 void ASTStmtReader::VisitParenExpr(
ParenExpr *E) {
506 E->
setLParen(ReadSourceLocation(Record, Idx));
507 E->
setRParen(ReadSourceLocation(Record, Idx));
513 unsigned NumExprs = Record[Idx++];
514 E->Exprs =
new (Reader.getContext())
Stmt*[NumExprs];
515 for (
unsigned i = 0; i != NumExprs; ++i)
516 E->Exprs[i] = Reader.ReadSubStmt();
517 E->NumExprs = NumExprs;
518 E->LParenLoc = ReadSourceLocation(Record, Idx);
519 E->RParenLoc = ReadSourceLocation(Record, Idx);
529 void ASTStmtReader::VisitOffsetOfExpr(
OffsetOfExpr *E) {
552 case Node::Identifier:
555 Reader.GetIdentifierInfo(F, Record, Idx),
561 *Base = Reader.ReadCXXBaseSpecifier(F, Record, Idx);
574 E->
setKind(static_cast<UnaryExprOrTypeTrait>(Record[Idx++]));
575 if (Record[Idx] == 0) {
587 E->
setLHS(Reader.ReadSubExpr());
588 E->
setRHS(Reader.ReadSubExpr());
592 void ASTStmtReader::VisitCallExpr(
CallExpr *E) {
594 E->
setNumArgs(Reader.getContext(), Record[Idx++]);
597 for (
unsigned I = 0, N = E->
getNumArgs(); I != N; ++I)
598 E->
setArg(I, Reader.ReadSubExpr());
605 void ASTStmtReader::VisitMemberExpr(
MemberExpr *E) {
607 assert(E->getStmtClass() == Stmt::MemberExprClass &&
608 "It's a subclass, we must advance Idx!");
611 void ASTStmtReader::VisitObjCIsaExpr(
ObjCIsaExpr *E) {
613 E->
setBase(Reader.ReadSubExpr());
615 E->
setOpLoc(ReadSourceLocation(Record, Idx));
622 E->Operand = Reader.ReadSubExpr();
623 E->setShouldCopy(Record[Idx++]);
627 VisitExplicitCastExpr(E);
628 E->LParenLoc = ReadSourceLocation(Record, Idx);
629 E->BridgeKeywordLoc = ReadSourceLocation(Record, Idx);
630 E->Kind = Record[Idx++];
633 void ASTStmtReader::VisitCastExpr(
CastExpr *E) {
635 unsigned NumBaseSpecs = Record[Idx++];
640 while (NumBaseSpecs--) {
642 *BaseSpec = Reader.ReadCXXBaseSpecifier(F, Record, Idx);
649 E->
setLHS(Reader.ReadSubExpr());
650 E->
setRHS(Reader.ReadSubExpr());
657 VisitBinaryOperator(E);
664 E->SubExprs[ConditionalOperator::COND] = Reader.ReadSubExpr();
665 E->SubExprs[ConditionalOperator::LHS] = Reader.ReadSubExpr();
666 E->SubExprs[ConditionalOperator::RHS] = Reader.ReadSubExpr();
667 E->QuestionLoc = ReadSourceLocation(Record, Idx);
668 E->ColonLoc = ReadSourceLocation(Record, Idx);
674 E->OpaqueValue = cast<OpaqueValueExpr>(Reader.ReadSubExpr());
675 E->SubExprs[BinaryConditionalOperator::COMMON] = Reader.ReadSubExpr();
676 E->SubExprs[BinaryConditionalOperator::COND] = Reader.ReadSubExpr();
677 E->SubExprs[BinaryConditionalOperator::LHS] = Reader.ReadSubExpr();
678 E->SubExprs[BinaryConditionalOperator::RHS] = Reader.ReadSubExpr();
679 E->QuestionLoc = ReadSourceLocation(Record, Idx);
680 E->ColonLoc = ReadSourceLocation(Record, Idx);
693 VisitExplicitCastExpr(E);
708 E->
setBase(Reader.ReadSubExpr());
709 E->
setAccessor(Reader.GetIdentifierInfo(F, Record, Idx));
713 void ASTStmtReader::VisitInitListExpr(
InitListExpr *E) {
715 if (
InitListExpr *SyntForm = cast_or_null<InitListExpr>(Reader.ReadSubStmt()))
719 bool isArrayFiller = Record[Idx++];
720 Expr *filler =
nullptr;
722 filler = Reader.ReadSubExpr();
723 E->ArrayFillerOrUnionFieldInit = filler;
725 E->ArrayFillerOrUnionFieldInit = ReadDeclAs<FieldDecl>(Record, Idx);
727 unsigned NumInits = Record[Idx++];
730 for (
unsigned I = 0; I != NumInits; ++I) {
731 Expr *init = Reader.ReadSubExpr();
732 E->
updateInit(Reader.getContext(), I, init ? init : filler);
735 for (
unsigned I = 0; I != NumInits; ++I)
736 E->
updateInit(Reader.getContext(), I, Reader.ReadSubExpr());
744 unsigned NumSubExprs = Record[Idx++];
745 assert(NumSubExprs == E->
getNumSubExprs() &&
"Wrong number of subexprs");
746 for (
unsigned I = 0; I != NumSubExprs; ++I)
752 while (Idx < Record.size()) {
755 FieldDecl *Field = ReadDeclAs<FieldDecl>(Record, Idx);
757 = ReadSourceLocation(Record, Idx);
759 = ReadSourceLocation(Record, Idx);
760 Designators.push_back(Designator(Field->
getIdentifier(), DotLoc,
762 Designators.back().setField(Field);
767 const IdentifierInfo *Name = Reader.GetIdentifierInfo(F, Record, Idx);
769 = ReadSourceLocation(Record, Idx);
771 = ReadSourceLocation(Record, Idx);
772 Designators.push_back(Designator(Name, DotLoc, FieldLoc));
777 unsigned Index = Record[Idx++];
779 = ReadSourceLocation(Record, Idx);
781 = ReadSourceLocation(Record, Idx);
782 Designators.push_back(Designator(Index, LBracketLoc, RBracketLoc));
787 unsigned Index = Record[Idx++];
789 = ReadSourceLocation(Record, Idx);
791 = ReadSourceLocation(Record, Idx);
793 = ReadSourceLocation(Record, Idx);
794 Designators.push_back(Designator(Index, LBracketLoc, EllipsisLoc,
801 Designators.data(), Designators.size());
806 E->
setBase(Reader.ReadSubExpr());
810 void ASTStmtReader::VisitNoInitExpr(
NoInitExpr *E) {
818 void ASTStmtReader::VisitVAArgExpr(
VAArgExpr *E) {
830 E->
setLabel(ReadDeclAs<LabelDecl>(Record, Idx));
833 void ASTStmtReader::VisitStmtExpr(
StmtExpr *E) {
837 E->
setSubStmt(cast_or_null<CompoundStmt>(Reader.ReadSubStmt()));
840 void ASTStmtReader::VisitChooseExpr(
ChooseExpr *E) {
842 E->
setCond(Reader.ReadSubExpr());
843 E->
setLHS(Reader.ReadSubExpr());
844 E->
setRHS(Reader.ReadSubExpr());
850 void ASTStmtReader::VisitGNUNullExpr(
GNUNullExpr *E) {
858 unsigned NumExprs = Record[Idx++];
860 Exprs.push_back(Reader.ReadSubExpr());
861 E->
setExprs(Reader.getContext(), Exprs);
868 E->BuiltinLoc = ReadSourceLocation(Record, Idx);
869 E->RParenLoc = ReadSourceLocation(Record, Idx);
870 E->TInfo = GetTypeSourceInfo(Record, Idx);
871 E->SrcExpr = Reader.ReadSubExpr();
874 void ASTStmtReader::VisitBlockExpr(
BlockExpr *E) {
881 E->NumAssocs = Record[Idx++];
882 E->AssocTypes =
new (Reader.getContext())
TypeSourceInfo*[E->NumAssocs];
884 new(Reader.getContext())
Stmt*[GenericSelectionExpr::END_EXPR+E->NumAssocs];
886 E->SubExprs[GenericSelectionExpr::CONTROLLING] = Reader.ReadSubExpr();
887 for (
unsigned I = 0, N = E->
getNumAssocs(); I != N; ++I) {
888 E->AssocTypes[I] = GetTypeSourceInfo(Record, Idx);
889 E->SubExprs[GenericSelectionExpr::END_EXPR+I] = Reader.ReadSubExpr();
891 E->ResultIndex = Record[Idx++];
893 E->GenericLoc = ReadSourceLocation(Record, Idx);
894 E->DefaultLoc = ReadSourceLocation(Record, Idx);
895 E->RParenLoc = ReadSourceLocation(Record, Idx);
900 unsigned numSemanticExprs = Record[Idx++];
901 assert(numSemanticExprs + 1 == E->PseudoObjectExprBits.NumSubExprs);
902 E->PseudoObjectExprBits.ResultIndex = Record[Idx++];
905 E->getSubExprsBuffer()[0] = Reader.ReadSubExpr();
908 for (
unsigned i = 0; i != numSemanticExprs; ++i) {
909 Expr *subExpr = Reader.ReadSubExpr();
910 E->getSubExprsBuffer()[i+1] = subExpr;
914 void ASTStmtReader::VisitAtomicExpr(
AtomicExpr *E) {
918 for (
unsigned I = 0; I != E->NumSubExprs; ++I)
919 E->SubExprs[I] = Reader.ReadSubExpr();
920 E->BuiltinLoc = ReadSourceLocation(Record, Idx);
921 E->RParenLoc = ReadSourceLocation(Record, Idx);
929 E->
setString(cast<StringLiteral>(Reader.ReadSubStmt()));
930 E->
setAtLoc(ReadSourceLocation(Record, Idx));
936 E->SubExpr = Reader.ReadSubStmt();
937 E->BoxingMethod = ReadDeclAs<ObjCMethodDecl>(Record, Idx);
938 E->Range = ReadSourceRange(Record, Idx);
943 unsigned NumElements = Record[Idx++];
944 assert(NumElements == E->
getNumElements() &&
"Wrong number of elements");
946 for (
unsigned I = 0, N = NumElements; I != N; ++I)
947 Elements[I] = Reader.ReadSubExpr();
948 E->ArrayWithObjectsMethod = ReadDeclAs<ObjCMethodDecl>(Record, Idx);
949 E->Range = ReadSourceRange(Record, Idx);
954 unsigned NumElements = Record[Idx++];
955 assert(NumElements == E->
getNumElements() &&
"Wrong number of elements");
956 bool HasPackExpansions = Record[Idx++];
957 assert(HasPackExpansions == E->HasPackExpansions &&
"Pack expansion mismatch");
958 ObjCDictionaryLiteral::KeyValuePair *KeyValues = E->getKeyValues();
959 ObjCDictionaryLiteral::ExpansionData *Expansions = E->getExpansionData();
960 for (
unsigned I = 0; I != NumElements; ++I) {
961 KeyValues[I].Key = Reader.ReadSubExpr();
962 KeyValues[I].Value = Reader.ReadSubExpr();
963 if (HasPackExpansions) {
964 Expansions[I].EllipsisLoc = ReadSourceLocation(Record, Idx);
965 Expansions[I].NumExpansionsPlusOne = Record[Idx++];
968 E->DictWithObjectsMethod = ReadDeclAs<ObjCMethodDecl>(Record, Idx);
969 E->Range = ReadSourceRange(Record, Idx);
975 E->
setAtLoc(ReadSourceLocation(Record, Idx));
981 E->
setSelector(Reader.ReadSelector(F, Record, Idx));
982 E->
setAtLoc(ReadSourceLocation(Record, Idx));
988 E->
setProtocol(ReadDeclAs<ObjCProtocolDecl>(Record, Idx));
989 E->
setAtLoc(ReadSourceLocation(Record, Idx));
990 E->ProtoLoc = ReadSourceLocation(Record, Idx);
996 E->
setDecl(ReadDeclAs<ObjCIvarDecl>(Record, Idx));
998 E->
setOpLoc(ReadSourceLocation(Record, Idx));
999 E->
setBase(Reader.ReadSubExpr());
1006 unsigned MethodRefFlags = Record[Idx++];
1007 bool Implicit = Record[Idx++] != 0;
1009 ObjCMethodDecl *Getter = ReadDeclAs<ObjCMethodDecl>(Record, Idx);
1010 ObjCMethodDecl *Setter = ReadDeclAs<ObjCMethodDecl>(Record, Idx);
1011 E->setImplicitProperty(Getter, Setter, MethodRefFlags);
1013 E->setExplicitProperty(ReadDeclAs<ObjCPropertyDecl>(Record, Idx),
1016 E->setLocation(ReadSourceLocation(Record, Idx));
1017 E->setReceiverLocation(ReadSourceLocation(Record, Idx));
1018 switch (Record[Idx++]) {
1020 E->setBase(Reader.ReadSubExpr());
1023 E->setSuperReceiver(Reader.readType(F, Record, Idx));
1026 E->setClassReceiver(ReadDeclAs<ObjCInterfaceDecl>(Record, Idx));
1036 E->GetAtIndexMethodDecl = ReadDeclAs<ObjCMethodDecl>(Record, Idx);
1037 E->SetAtIndexMethodDecl = ReadDeclAs<ObjCMethodDecl>(Record, Idx);
1044 unsigned NumStoredSelLocs = Record[Idx++];
1045 E->SelLocsKind = Record[Idx++];
1047 E->IsImplicit = Record[Idx++];
1061 QualType T = Reader.readType(F, Record, Idx);
1073 E->
setSelector(Reader.ReadSelector(F, Record, Idx));
1075 E->LBracLoc = ReadSourceLocation(Record, Idx);
1076 E->RBracLoc = ReadSourceLocation(Record, Idx);
1078 for (
unsigned I = 0, N = E->
getNumArgs(); I != N; ++I)
1079 E->
setArg(I, Reader.ReadSubExpr());
1082 for (
unsigned I = 0; I != NumStoredSelLocs; ++I)
1083 Locs[I] = ReadSourceLocation(Record, Idx);
1090 S->
setBody(Reader.ReadSubStmt());
1091 S->
setForLoc(ReadSourceLocation(Record, Idx));
1112 S->
setAtLoc(ReadSourceLocation(Record, Idx));
1119 bool HasFinally = Record[Idx++];
1122 S->
setCatchStmt(I, cast_or_null<ObjCAtCatchStmt>(Reader.ReadSubStmt()));
1152 void ASTStmtReader::VisitCXXCatchStmt(
CXXCatchStmt *S) {
1154 S->CatchLoc = ReadSourceLocation(Record, Idx);
1155 S->ExceptionDecl = ReadDeclAs<VarDecl>(Record, Idx);
1156 S->HandlerBlock = Reader.ReadSubStmt();
1159 void ASTStmtReader::VisitCXXTryStmt(
CXXTryStmt *S) {
1161 assert(Record[Idx] == S->
getNumHandlers() &&
"NumStmtFields is wrong ?");
1163 S->TryLoc = ReadSourceLocation(Record, Idx);
1164 S->getStmts()[0] = Reader.ReadSubStmt();
1166 S->getStmts()[i + 1] = Reader.ReadSubStmt();
1171 S->
setForLoc(ReadSourceLocation(Record, Idx));
1176 S->
setCond(Reader.ReadSubExpr());
1177 S->
setInc(Reader.ReadSubExpr());
1179 S->
setBody(Reader.ReadSubStmt());
1184 S->KeywordLoc = ReadSourceLocation(Record, Idx);
1185 S->IsIfExists = Record[Idx++];
1186 S->QualifierLoc = Reader.ReadNestedNameSpecifierLoc(F, Record, Idx);
1187 ReadDeclarationNameInfo(S->NameInfo, Record, Idx);
1188 S->SubStmt = Reader.ReadSubStmt();
1194 E->Range = Reader.ReadSourceRange(F, Record, Idx);
1200 E->NumArgs = Record[Idx++];
1202 E->Args =
new (Reader.getContext())
Stmt*[E->NumArgs];
1204 E->
setArg(I, Reader.ReadSubExpr());
1213 E->ParenOrBraceRange = ReadSourceRange(Record, Idx);
1217 VisitCXXConstructExpr(E);
1218 E->Type = GetTypeSourceInfo(Record, Idx);
1221 void ASTStmtReader::VisitLambdaExpr(
LambdaExpr *E) {
1223 unsigned NumCaptures = Record[Idx++];
1224 assert(NumCaptures == E->NumCaptures);(void)NumCaptures;
1225 unsigned NumArrayIndexVars = Record[Idx++];
1226 E->IntroducerRange = ReadSourceRange(Record, Idx);
1228 E->CaptureDefaultLoc = ReadSourceLocation(Record, Idx);
1229 E->ExplicitParams = Record[Idx++];
1230 E->ExplicitResultType = Record[Idx++];
1231 E->ClosingBrace = ReadSourceLocation(Record, Idx);
1237 *
C = Reader.ReadSubExpr();
1240 if (NumArrayIndexVars > 0) {
1241 unsigned *ArrayIndexStarts = E->getArrayIndexStarts();
1242 for (
unsigned I = 0; I != NumCaptures + 1; ++I)
1243 ArrayIndexStarts[I] = Record[Idx++];
1245 VarDecl **ArrayIndexVars = E->getArrayIndexVars();
1246 for (
unsigned I = 0; I != NumArrayIndexVars; ++I)
1247 ArrayIndexVars[I] = ReadDeclAs<VarDecl>(Record, Idx);
1254 E->SubExpr = Reader.ReadSubExpr();
1258 VisitExplicitCastExpr(E);
1261 E->RParenLoc = R.
getEnd();
1262 R = ReadSourceRange(Record, Idx);
1263 E->AngleBrackets = R;
1267 return VisitCXXNamedCastExpr(E);
1271 return VisitCXXNamedCastExpr(E);
1275 return VisitCXXNamedCastExpr(E);
1279 return VisitCXXNamedCastExpr(E);
1283 VisitExplicitCastExpr(E);
1290 E->UDSuffixLoc = ReadSourceLocation(Record, Idx);
1309 GetTypeSourceInfo(Record, Idx));
1317 void ASTStmtReader::VisitCXXThisExpr(
CXXThisExpr *E) {
1323 void ASTStmtReader::VisitCXXThrowExpr(
CXXThrowExpr *E) {
1325 E->ThrowLoc = ReadSourceLocation(Record, Idx);
1326 E->Op = Reader.ReadSubExpr();
1327 E->IsThrownVariableInScope = Record[Idx++];
1333 assert((
bool)Record[Idx] == E->Param.getInt() &&
"We messed up at creation ?");
1335 E->Param.setPointer(ReadDeclAs<ParmVarDecl>(Record, Idx));
1336 E->Loc = ReadSourceLocation(Record, Idx);
1341 E->Field = ReadDeclAs<FieldDecl>(Record, Idx);
1342 E->Loc = ReadSourceLocation(Record, Idx);
1347 E->
setTemporary(Reader.ReadCXXTemporary(F, Record, Idx));
1353 E->TypeInfo = GetTypeSourceInfo(Record, Idx);
1354 E->RParenLoc = ReadSourceLocation(Record, Idx);
1357 void ASTStmtReader::VisitCXXNewExpr(
CXXNewExpr *E) {
1359 E->GlobalNew = Record[Idx++];
1360 bool isArray = Record[Idx++];
1361 E->UsualArrayDeleteWantsSize = Record[Idx++];
1362 unsigned NumPlacementArgs = Record[Idx++];
1363 E->StoredInitializationStyle = Record[Idx++];
1366 E->AllocatedTypeInfo = GetTypeSourceInfo(Record, Idx);
1367 E->TypeIdParens = ReadSourceRange(Record, Idx);
1368 E->Range = ReadSourceRange(Record, Idx);
1369 E->DirectInitRange = ReadSourceRange(Record, Idx);
1372 E->StoredInitializationStyle != 0);
1377 *I = Reader.ReadSubStmt();
1382 E->GlobalDelete = Record[Idx++];
1383 E->ArrayForm = Record[Idx++];
1384 E->ArrayFormAsWritten = Record[Idx++];
1385 E->UsualArrayDeleteWantsSize = Record[Idx++];
1386 E->OperatorDelete = ReadDeclAs<FunctionDecl>(Record, Idx);
1387 E->Argument = Reader.ReadSubExpr();
1388 E->Loc = ReadSourceLocation(Record, Idx);
1394 E->Base = Reader.ReadSubExpr();
1395 E->IsArrow = Record[Idx++];
1396 E->OperatorLoc = ReadSourceLocation(Record, Idx);
1397 E->QualifierLoc = Reader.ReadNestedNameSpecifierLoc(F, Record, Idx);
1398 E->ScopeType = GetTypeSourceInfo(Record, Idx);
1399 E->ColonColonLoc = ReadSourceLocation(Record, Idx);
1400 E->TildeLoc = ReadSourceLocation(Record, Idx);
1412 unsigned NumObjects = Record[Idx++];
1414 for (
unsigned i = 0; i != NumObjects; ++i)
1415 E->getObjectsBuffer()[i] = ReadDeclAs<BlockDecl>(Record, Idx);
1417 E->SubExpr = Reader.ReadSubExpr();
1425 ReadTemplateKWAndArgsInfo(*E->getTemplateKWAndArgsInfo(),
1428 E->Base = Reader.ReadSubExpr();
1429 E->BaseType = Reader.readType(F, Record, Idx);
1430 E->IsArrow = Record[Idx++];
1431 E->OperatorLoc = ReadSourceLocation(Record, Idx);
1432 E->QualifierLoc = Reader.ReadNestedNameSpecifierLoc(F, Record, Idx);
1433 E->FirstQualifierFoundInScope = ReadDeclAs<NamedDecl>(Record, Idx);
1434 ReadDeclarationNameInfo(E->MemberNameInfo, Record, Idx);
1442 ReadTemplateKWAndArgsInfo(*E->getTemplateKWAndArgsInfo(),
1445 E->QualifierLoc = Reader.ReadNestedNameSpecifierLoc(F, Record, Idx);
1446 ReadDeclarationNameInfo(E->NameInfo, Record, Idx);
1452 assert(Record[Idx] == E->
arg_size() &&
"Read wrong record during creation ?");
1454 for (
unsigned I = 0, N = E->
arg_size(); I != N; ++I)
1455 E->
setArg(I, Reader.ReadSubExpr());
1456 E->Type = GetTypeSourceInfo(Record, Idx);
1461 void ASTStmtReader::VisitOverloadExpr(
OverloadExpr *E) {
1468 unsigned NumDecls = Record[Idx++];
1470 for (
unsigned i = 0; i != NumDecls; ++i) {
1471 NamedDecl *D = ReadDeclAs<NamedDecl>(Record, Idx);
1477 ReadDeclarationNameInfo(E->NameInfo, Record, Idx);
1478 E->QualifierLoc = Reader.ReadNestedNameSpecifierLoc(F, Record, Idx);
1482 VisitOverloadExpr(E);
1483 E->IsArrow = Record[Idx++];
1484 E->HasUnresolvedUsing = Record[Idx++];
1485 E->Base = Reader.ReadSubExpr();
1486 E->BaseType = Reader.readType(F, Record, Idx);
1487 E->OperatorLoc = ReadSourceLocation(Record, Idx);
1491 VisitOverloadExpr(E);
1492 E->RequiresADL = Record[Idx++];
1493 E->Overloaded = Record[Idx++];
1494 E->NamingClass = ReadDeclAs<CXXRecordDecl>(Record, Idx);
1499 E->TypeTraitExprBits.NumArgs = Record[Idx++];
1500 E->TypeTraitExprBits.Kind = Record[Idx++];
1501 E->TypeTraitExprBits.Value = Record[Idx++];
1504 E->RParenLoc = Range.
getEnd();
1507 for (
unsigned I = 0, N = E->
getNumArgs(); I != N; ++I)
1508 Args[I] = GetTypeSourceInfo(Record, Idx);
1514 E->Value = (
unsigned int)Record[Idx++];
1517 E->RParen = Range.
getEnd();
1518 E->QueriedType = GetTypeSourceInfo(Record, Idx);
1524 E->Value = (
bool)Record[Idx++];
1526 E->QueriedExpression = Reader.ReadSubExpr();
1528 E->RParen = Range.
getEnd();
1533 E->Value = (
bool)Record[Idx++];
1534 E->Range = ReadSourceRange(Record, Idx);
1535 E->Operand = Reader.ReadSubExpr();
1540 E->EllipsisLoc = ReadSourceLocation(Record, Idx);
1541 E->NumExpansions = Record[Idx++];
1542 E->Pattern = Reader.ReadSubExpr();
1547 E->OperatorLoc = ReadSourceLocation(Record, Idx);
1548 E->PackLoc = ReadSourceLocation(Record, Idx);
1549 E->RParenLoc = ReadSourceLocation(Record, Idx);
1550 E->Length = Record[Idx++];
1551 E->Pack = ReadDeclAs<NamedDecl>(Record, Idx);
1554 void ASTStmtReader::VisitSubstNonTypeTemplateParmExpr(
1557 E->Param = ReadDeclAs<NonTypeTemplateParmDecl>(Record, Idx);
1558 E->NameLoc = ReadSourceLocation(Record, Idx);
1559 E->Replacement = Reader.ReadSubExpr();
1562 void ASTStmtReader::VisitSubstNonTypeTemplateParmPackExpr(
1565 E->Param = ReadDeclAs<NonTypeTemplateParmDecl>(Record, Idx);
1571 E->NumArguments = ArgPack.pack_size();
1572 E->NameLoc = ReadSourceLocation(Record, Idx);
1577 E->NumParameters = Record[Idx++];
1578 E->ParamPack = ReadDeclAs<ParmVarDecl>(Record, Idx);
1579 E->NameLoc = ReadSourceLocation(Record, Idx);
1581 for (
unsigned i = 0, n = E->NumParameters; i != n; ++i)
1582 Parms[i] = ReadDeclAs<ParmVarDecl>(Record, Idx);
1587 E->State = Reader.ReadSubExpr();
1588 auto VD = ReadDeclAs<ValueDecl>(Record, Idx);
1589 unsigned ManglingNumber = Record[Idx++];
1593 void ASTStmtReader::VisitCXXFoldExpr(
CXXFoldExpr *E) {
1595 E->LParenLoc = ReadSourceLocation(Record, Idx);
1596 E->EllipsisLoc = ReadSourceLocation(Record, Idx);
1597 E->RParenLoc = ReadSourceLocation(Record, Idx);
1598 E->SubExprs[0] = Reader.ReadSubExpr();
1599 E->SubExprs[1] = Reader.ReadSubExpr();
1605 E->SourceExpr = Reader.ReadSubExpr();
1606 E->Loc = ReadSourceLocation(Record, Idx);
1609 void ASTStmtReader::VisitTypoExpr(
TypoExpr *E) {
1610 llvm_unreachable(
"Cannot read TypoExpr nodes");
1618 E->IsArrow = (Record[Idx++] != 0);
1619 E->BaseExpr = Reader.ReadSubExpr();
1620 E->QualifierLoc = Reader.ReadNestedNameSpecifierLoc(F, Record, Idx);
1621 E->MemberLoc = ReadSourceLocation(Record, Idx);
1622 E->TheDecl = ReadDeclAs<MSPropertyDecl>(Record, Idx);
1630 GetTypeSourceInfo(Record, Idx));
1638 void ASTStmtReader::VisitSEHLeaveStmt(
SEHLeaveStmt *S) {
1645 S->Loc = ReadSourceLocation(Record, Idx);
1646 S->Children[SEHExceptStmt::FILTER_EXPR] = Reader.ReadSubStmt();
1652 S->Loc = ReadSourceLocation(Record, Idx);
1653 S->Block = Reader.ReadSubStmt();
1656 void ASTStmtReader::VisitSEHTryStmt(
SEHTryStmt *S) {
1658 S->IsCXXTry = Record[Idx++];
1659 S->TryLoc = ReadSourceLocation(Record, Idx);
1660 S->Children[SEHTryStmt::TRY] = Reader.ReadSubStmt();
1661 S->Children[SEHTryStmt::HANDLER] = Reader.ReadSubStmt();
1670 E->
setConfig(cast<CallExpr>(Reader.ReadSubExpr()));
1676 void ASTStmtReader::VisitAsTypeExpr(
AsTypeExpr *E) {
1678 E->BuiltinLoc = ReadSourceLocation(Record, Idx);
1679 E->RParenLoc = ReadSourceLocation(Record, Idx);
1680 E->SrcExpr = Reader.ReadSubExpr();
1696 : Reader(R),
Context(C), Record(Record), Idx(Idx) { }
1697 #define OPENMP_CLAUSE(Name, Class) \
1698 void Visit##Class(Class *S);
1699 #include "clang/Basic/OpenMPKinds.def"
1706 switch (Record[Idx++]) {
1713 case OMPC_num_threads:
1725 case OMPC_proc_bind:
1740 case OMPC_mergeable:
1761 case OMPC_firstprivate:
1764 case OMPC_lastprivate:
1770 case OMPC_reduction:
1782 case OMPC_copyprivate:
1793 C->
setLocStart(Reader->ReadSourceLocation(Record, Idx));
1794 C->
setLocEnd(Reader->ReadSourceLocation(Record, Idx));
1799 void OMPClauseReader::VisitOMPIfClause(
OMPIfClause *
C) {
1800 C->setCondition(Reader->Reader.ReadSubExpr());
1801 C->
setLParenLoc(Reader->ReadSourceLocation(Record, Idx));
1805 C->setCondition(Reader->Reader.ReadSubExpr());
1806 C->
setLParenLoc(Reader->ReadSourceLocation(Record, Idx));
1810 C->setNumThreads(Reader->Reader.ReadSubExpr());
1811 C->
setLParenLoc(Reader->ReadSourceLocation(Record, Idx));
1815 C->setSafelen(Reader->Reader.ReadSubExpr());
1816 C->
setLParenLoc(Reader->ReadSourceLocation(Record, Idx));
1820 C->setNumForLoops(Reader->Reader.ReadSubExpr());
1821 C->
setLParenLoc(Reader->ReadSourceLocation(Record, Idx));
1826 static_cast<OpenMPDefaultClauseKind>(Record[Idx++]));
1827 C->
setLParenLoc(Reader->ReadSourceLocation(Record, Idx));
1828 C->setDefaultKindKwLoc(Reader->ReadSourceLocation(Record, Idx));
1833 static_cast<OpenMPProcBindClauseKind>(Record[Idx++]));
1834 C->
setLParenLoc(Reader->ReadSourceLocation(Record, Idx));
1835 C->setProcBindKindKwLoc(Reader->ReadSourceLocation(Record, Idx));
1840 static_cast<OpenMPScheduleClauseKind>(Record[Idx++]));
1841 C->setChunkSize(Reader->Reader.ReadSubExpr());
1842 C->setHelperChunkSize(Reader->Reader.ReadSubExpr());
1843 C->setLParenLoc(Reader->ReadSourceLocation(Record, Idx));
1844 C->setScheduleKindLoc(Reader->ReadSourceLocation(Record, Idx));
1845 C->setCommaLoc(Reader->ReadSourceLocation(Record, Idx));
1856 void OMPClauseReader::VisitOMPReadClause(
OMPReadClause *) {}
1867 C->
setLParenLoc(Reader->ReadSourceLocation(Record, Idx));
1870 Vars.reserve(NumVars);
1871 for (
unsigned i = 0; i != NumVars; ++i)
1872 Vars.push_back(Reader->Reader.ReadSubExpr());
1875 for (
unsigned i = 0; i != NumVars; ++i)
1876 Vars.push_back(Reader->Reader.ReadSubExpr());
1877 C->setPrivateCopies(Vars);
1881 C->
setLParenLoc(Reader->ReadSourceLocation(Record, Idx));
1884 Vars.reserve(NumVars);
1885 for (
unsigned i = 0; i != NumVars; ++i)
1886 Vars.push_back(Reader->Reader.ReadSubExpr());
1889 for (
unsigned i = 0; i != NumVars; ++i)
1890 Vars.push_back(Reader->Reader.ReadSubExpr());
1891 C->setPrivateCopies(Vars);
1893 for (
unsigned i = 0; i != NumVars; ++i)
1894 Vars.push_back(Reader->Reader.ReadSubExpr());
1899 C->
setLParenLoc(Reader->ReadSourceLocation(Record, Idx));
1902 Vars.reserve(NumVars);
1903 for (
unsigned i = 0; i != NumVars; ++i)
1904 Vars.push_back(Reader->Reader.ReadSubExpr());
1907 for (
unsigned i = 0; i != NumVars; ++i)
1908 Vars.push_back(Reader->Reader.ReadSubExpr());
1911 for (
unsigned i = 0; i != NumVars; ++i)
1912 Vars.push_back(Reader->Reader.ReadSubExpr());
1913 C->setSourceExprs(Vars);
1915 for (
unsigned i = 0; i != NumVars; ++i)
1916 Vars.push_back(Reader->Reader.ReadSubExpr());
1917 C->setDestinationExprs(Vars);
1919 for (
unsigned i = 0; i != NumVars; ++i)
1920 Vars.push_back(Reader->Reader.ReadSubExpr());
1921 C->setAssignmentOps(Vars);
1925 C->
setLParenLoc(Reader->ReadSourceLocation(Record, Idx));
1928 Vars.reserve(NumVars);
1929 for (
unsigned i = 0; i != NumVars; ++i)
1930 Vars.push_back(Reader->Reader.ReadSubExpr());
1935 C->
setLParenLoc(Reader->ReadSourceLocation(Record, Idx));
1936 C->setColonLoc(Reader->ReadSourceLocation(Record, Idx));
1938 Reader->Reader.ReadNestedNameSpecifierLoc(Reader->F, Record, Idx);
1940 Reader->ReadDeclarationNameInfo(DNI, Record, Idx);
1941 C->setQualifierLoc(NNSL);
1942 C->setNameInfo(DNI);
1946 Vars.reserve(NumVars);
1947 for (
unsigned i = 0; i != NumVars; ++i)
1948 Vars.push_back(Reader->Reader.ReadSubExpr());
1951 for (
unsigned i = 0; i != NumVars; ++i)
1952 Vars.push_back(Reader->Reader.ReadSubExpr());
1953 C->setLHSExprs(Vars);
1955 for (
unsigned i = 0; i != NumVars; ++i)
1956 Vars.push_back(Reader->Reader.ReadSubExpr());
1957 C->setRHSExprs(Vars);
1959 for (
unsigned i = 0; i != NumVars; ++i)
1960 Vars.push_back(Reader->Reader.ReadSubExpr());
1961 C->setReductionOps(Vars);
1965 C->
setLParenLoc(Reader->ReadSourceLocation(Record, Idx));
1966 C->setColonLoc(Reader->ReadSourceLocation(Record, Idx));
1969 Vars.reserve(NumVars);
1970 for (
unsigned i = 0; i != NumVars; ++i)
1971 Vars.push_back(Reader->Reader.ReadSubExpr());
1974 for (
unsigned i = 0; i != NumVars; ++i)
1975 Vars.push_back(Reader->Reader.ReadSubExpr());
1978 for (
unsigned i = 0; i != NumVars; ++i)
1979 Vars.push_back(Reader->Reader.ReadSubExpr());
1980 C->setUpdates(Vars);
1982 for (
unsigned i = 0; i != NumVars; ++i)
1983 Vars.push_back(Reader->Reader.ReadSubExpr());
1985 C->setStep(Reader->Reader.ReadSubExpr());
1986 C->setCalcStep(Reader->Reader.ReadSubExpr());
1990 C->setLParenLoc(Reader->ReadSourceLocation(Record, Idx));
1991 C->
setColonLoc(Reader->ReadSourceLocation(Record, Idx));
1992 unsigned NumVars = C->varlist_size();
1994 Vars.reserve(NumVars);
1995 for (
unsigned i = 0; i != NumVars; ++i)
1996 Vars.push_back(Reader->Reader.ReadSubExpr());
1997 C->setVarRefs(Vars);
1998 C->setAlignment(Reader->Reader.ReadSubExpr());
2002 C->setLParenLoc(Reader->ReadSourceLocation(Record, Idx));
2003 unsigned NumVars = C->varlist_size();
2005 Exprs.reserve(NumVars);
2006 for (
unsigned i = 0; i != NumVars; ++i)
2007 Exprs.push_back(Reader->Reader.ReadSubExpr());
2008 C->setVarRefs(Exprs);
2010 for (
unsigned i = 0; i != NumVars; ++i)
2011 Exprs.push_back(Reader->Reader.ReadSubExpr());
2012 C->setSourceExprs(Exprs);
2014 for (
unsigned i = 0; i != NumVars; ++i)
2015 Exprs.push_back(Reader->Reader.ReadSubExpr());
2016 C->setDestinationExprs(Exprs);
2018 for (
unsigned i = 0; i != NumVars; ++i)
2019 Exprs.push_back(Reader->Reader.ReadSubExpr());
2020 C->setAssignmentOps(Exprs);
2024 C->setLParenLoc(Reader->ReadSourceLocation(Record, Idx));
2025 unsigned NumVars = C->varlist_size();
2027 Exprs.reserve(NumVars);
2028 for (
unsigned i = 0; i != NumVars; ++i)
2029 Exprs.push_back(Reader->Reader.ReadSubExpr());
2030 C->setVarRefs(Exprs);
2032 for (
unsigned i = 0; i != NumVars; ++i)
2033 Exprs.push_back(Reader->Reader.ReadSubExpr());
2034 C->setSourceExprs(Exprs);
2036 for (
unsigned i = 0; i != NumVars; ++i)
2037 Exprs.push_back(Reader->Reader.ReadSubExpr());
2038 C->setDestinationExprs(Exprs);
2040 for (
unsigned i = 0; i != NumVars; ++i)
2041 Exprs.push_back(Reader->Reader.ReadSubExpr());
2042 C->setAssignmentOps(Exprs);
2046 C->setLParenLoc(Reader->ReadSourceLocation(Record, Idx));
2047 unsigned NumVars = C->varlist_size();
2049 Vars.reserve(NumVars);
2050 for (
unsigned i = 0; i != NumVars; ++i)
2051 Vars.push_back(Reader->Reader.ReadSubExpr());
2052 C->setVarRefs(Vars);
2056 C->setLParenLoc(Reader->ReadSourceLocation(Record, Idx));
2057 C->setDependencyKind(static_cast<OpenMPDependClauseKind>(Record[Idx++]));
2058 C->setDependencyLoc(Reader->ReadSourceLocation(Record, Idx));
2059 C->setColonLoc(Reader->ReadSourceLocation(Record, Idx));
2060 unsigned NumVars = C->varlist_size();
2062 Vars.reserve(NumVars);
2063 for (
unsigned i = 0; i != NumVars; ++i)
2064 Vars.push_back(Reader->Reader.ReadSubExpr());
2065 C->setVarRefs(Vars);
2073 E->
setLocEnd(ReadSourceLocation(Record, Idx));
2077 Clauses.push_back(ClauseReader.readClause());
2087 VisitOMPExecutableDirective(D);
2092 D->
setCond(Reader.ReadSubExpr());
2093 D->
setInit(Reader.ReadSubExpr());
2094 D->
setInc(Reader.ReadSubExpr());
2106 Sub.reserve(CollapsedNum);
2107 for (
unsigned i = 0; i < CollapsedNum; ++i)
2108 Sub.push_back(Reader.ReadSubExpr());
2111 for (
unsigned i = 0; i < CollapsedNum; ++i)
2112 Sub.push_back(Reader.ReadSubExpr());
2115 for (
unsigned i = 0; i < CollapsedNum; ++i)
2116 Sub.push_back(Reader.ReadSubExpr());
2119 for (
unsigned i = 0; i < CollapsedNum; ++i)
2120 Sub.push_back(Reader.ReadSubExpr());
2128 VisitOMPExecutableDirective(D);
2132 VisitOMPLoopDirective(D);
2136 VisitOMPLoopDirective(D);
2140 VisitOMPLoopDirective(D);
2147 VisitOMPExecutableDirective(D);
2152 VisitOMPExecutableDirective(D);
2159 VisitOMPExecutableDirective(D);
2164 VisitOMPExecutableDirective(D);
2169 VisitOMPExecutableDirective(D);
2170 ReadDeclarationNameInfo(D->DirName, Record, Idx);
2174 VisitOMPLoopDirective(D);
2177 void ASTStmtReader::VisitOMPParallelForSimdDirective(
2179 VisitOMPLoopDirective(D);
2182 void ASTStmtReader::VisitOMPParallelSectionsDirective(
2187 VisitOMPExecutableDirective(D);
2194 VisitOMPExecutableDirective(D);
2199 VisitOMPExecutableDirective(D);
2204 VisitOMPExecutableDirective(D);
2209 VisitOMPExecutableDirective(D);
2214 VisitOMPExecutableDirective(D);
2221 VisitOMPExecutableDirective(D);
2226 VisitOMPExecutableDirective(D);
2233 VisitOMPExecutableDirective(D);
2234 D->setX(Reader.ReadSubExpr());
2235 D->setV(Reader.ReadSubExpr());
2236 D->setExpr(Reader.ReadSubExpr());
2237 D->setUpdateExpr(Reader.ReadSubExpr());
2238 D->IsXLHSInRHSPart = Record[Idx++] != 0;
2239 D->IsPostfixUpdate = Record[Idx++] != 0;
2246 VisitOMPExecutableDirective(D);
2253 VisitOMPExecutableDirective(D);
2256 void ASTStmtReader::VisitOMPCancellationPointDirective(
2259 VisitOMPExecutableDirective(D);
2260 D->setCancelRegion(static_cast<OpenMPDirectiveKind>(Record[Idx++]));
2265 VisitOMPExecutableDirective(D);
2266 D->setCancelRegion(static_cast<OpenMPDirectiveKind>(Record[Idx++]));
2274 switch (ReadingKind) {
2276 llvm_unreachable(
"should not call this when not reading anything");
2279 return ReadStmtFromStream(F);
2281 return ReadSubStmt();
2284 llvm_unreachable(
"ReadingKind not set ?");
2288 return cast_or_null<Expr>(ReadStmt(F));
2292 return cast_or_null<Expr>(ReadSubStmt());
2302 Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) {
2304 ReadingKindTracker ReadingKind(Read_Stmt, *
this);
2305 llvm::BitstreamCursor &
Cursor = F.DeclsCursor;
2309 llvm::DenseMap<uint64_t, Stmt *> StmtEntries;
2312 unsigned PrevNumStmts = StmtStack.size();
2318 Stmt::EmptyShell Empty;
2321 llvm::BitstreamEntry Entry = Cursor.advanceSkippingSubblocks();
2323 switch (Entry.Kind) {
2324 case llvm::BitstreamEntry::SubBlock:
2326 Error(
"malformed block record in AST file");
2328 case llvm::BitstreamEntry::EndBlock:
2330 case llvm::BitstreamEntry::Record:
2338 bool Finished =
false;
2339 bool IsStmtReference =
false;
2340 switch ((
StmtCode)Cursor.readRecord(Entry.ID, Record)) {
2346 IsStmtReference =
true;
2347 assert(StmtEntries.find(Record[0]) != StmtEntries.end() &&
2348 "No stmt was recorded for this offset reference!");
2349 S = StmtEntries[Record[Idx++]];
2447 Record[ASTStmtReader::NumExprFields + 1],
2448 Record[ASTStmtReader::NumExprFields + 2],
2449 Record[ASTStmtReader::NumExprFields + 2] ?
2450 Record[ASTStmtReader::NumExprFields + 5] : 0);
2489 Record[ASTStmtReader::NumExprFields + 1]);
2511 if (Record[Idx++]) {
2512 QualifierLoc = ReadNestedNameSpecifierLoc(F, Record, Idx);
2517 bool HasTemplateKWAndArgsInfo = Record[Idx++];
2518 if (HasTemplateKWAndArgsInfo) {
2519 TemplateKWLoc = ReadSourceLocation(F, Record, Idx);
2520 unsigned NumTemplateArgs = Record[Idx++];
2521 ArgInfo.
setLAngleLoc(ReadSourceLocation(F, Record, Idx));
2522 ArgInfo.
setRAngleLoc(ReadSourceLocation(F, Record, Idx));
2523 for (
unsigned i = 0; i != NumTemplateArgs; ++i)
2524 ArgInfo.
addArgument(ReadTemplateArgumentLoc(F, Record, Idx));
2527 bool HadMultipleCandidates = Record[Idx++];
2529 NamedDecl *FoundD = ReadDeclAs<NamedDecl>(F, Record, Idx);
2533 QualType T = readType(F, Record, Idx);
2536 Expr *Base = ReadSubExpr();
2537 ValueDecl *MemberD = ReadDeclAs<ValueDecl>(F, Record, Idx);
2540 bool IsArrow = Record[Idx++];
2544 TemplateKWLoc, MemberD, FoundDecl, MemberNameInfo,
2545 HasTemplateKWAndArgsInfo ? &ArgInfo :
nullptr, T,
2547 ReadDeclarationNameLoc(F, cast<MemberExpr>(S)->MemberDNLoc,
2549 if (HadMultipleCandidates)
2550 cast<MemberExpr>(
S)->setHadMultipleCandidates(
true);
2659 Record[ASTStmtReader::NumExprFields + 1]);
2680 llvm_unreachable(
"mismatching AST file");
2684 Record[ASTStmtReader::NumExprFields + 1]);
2707 Record[ASTStmtReader::NumStmtFields + 1]);
2764 CollapsedNum, Empty);
2810 CollapsedNum, Empty);
2818 CollapsedNum, Empty);
2958 if (HasOtherExprStored) {
2959 Expr *SubExpr = ReadSubExpr();
2994 Record[ASTStmtReader::NumExprFields]
2995 ? Record[ASTStmtReader::NumExprFields + 1]
3002 Record[ASTStmtReader::NumExprFields]
3003 ? Record[ASTStmtReader::NumExprFields + 1]
3015 Record[ASTStmtReader::NumExprFields]
3016 ? Record[ASTStmtReader::NumExprFields + 1]
3023 Record[ASTStmtReader::NumExprFields]
3024 ? Record[ASTStmtReader::NumExprFields + 1]
3109 ++NumStatementsRead;
3111 if (S && !IsStmtReference) {
3113 StmtEntries[Cursor.GetCurrentBitNo()] =
S;
3117 assert(Idx == Record.size() &&
"Invalid deserialization of statement");
3118 StmtStack.push_back(S);
3121 assert(StmtStack.size() > PrevNumStmts &&
"Read too many sub-stmts!");
3122 assert(StmtStack.size() == PrevNumStmts + 1 &&
"Extra expressions on stack!");
3123 return StmtStack.pop_back_val();
A CXXConstCastExpr record.
static AttributedStmt * CreateEmpty(const ASTContext &C, unsigned NumAttrs)
A call to an overloaded operator written using operator syntax.
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 master' directive.
DesignatorTypes
The kinds of designators that can occur in a DesignatedInitExpr.
SourceLocation getEnd() const
void setRangeStmt(Stmt *S)
The null pointer literal (C++11 [lex.nullptr])
This represents '#pragma omp task' directive.
void setEnsureUpperBound(Expr *EUB)
CapturedDecl * getCapturedDecl()
Retrieve the outlined function declaration.
unsigned arg_size() const
Retrieve the number of arguments.
void setSubStmt(CompoundStmt *S)
unsigned getNumOutputs() const
A UserDefinedLiteral record.
The receiver is an object instance.
static OMPMasterDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
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.
void setCapturedDecl(CapturedDecl *D)
Set the outlined function declaration.
void setOperatorLoc(SourceLocation L)
static StringLiteral * CreateEmpty(const ASTContext &C, unsigned NumStrs)
Construct an empty string literal.
void setRawSemantics(APFloatSemantics Sem)
void setNRVOCandidate(const VarDecl *Var)
void setLocation(SourceLocation L)
A CXXStaticCastExpr record.
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
An AttributedStmt record.
IdentifierInfo * getIdentifier() const
A CXXReinterpretCastExpr record.
A ObjCBoolLiteralExpr record.
static OMPTaskwaitDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
void setLastIteration(Expr *LI)
void setBeginEndStmt(Stmt *S)
This represents '#pragma omp for simd' directive.
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.
void setDeclGroup(DeclGroupRef DGR)
An ImplicitCastExpr record.
void setRBracket(SourceLocation RB)
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.
ASTStmtReader(ASTReader &Reader, ModuleFile &F, llvm::BitstreamCursor &Cursor, const ASTReader::RecordData &Record, unsigned &Idx)
Represents an attribute applied to a statement.
void setUpperBoundVariable(Expr *UB)
void setComputationResultType(QualType T)
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)
A CXXTemporaryObjectExpr record.
Represents Objective-C's @throw statement.
uint32_t DeclID
An ID number that refers to a declaration in an AST file.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
void setNextLowerBound(Expr *NLB)
Represents a call to a C++ constructor.
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 setInstanceReceiver(Expr *rec)
Turn this message send into an instance message that computes the receiver object with the given expr...
This represents '#pragma omp parallel for' directive.
void setStartLoc(SourceLocation L)
void setForLoc(SourceLocation L)
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
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 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 setRAngleLoc(SourceLocation Loc)
static OffsetOfExpr * CreateEmpty(const ASTContext &C, unsigned NumComps, unsigned NumExprs)
This represents 'read' clause in the '#pragma omp atomic' directive.
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.
This represents 'num_threads' clause in the '#pragma omp ...' directive.
void setSubExpr(unsigned Idx, Expr *E)
void setFPContractable(bool FPC)
void setInitializer(Expr *E)
void setOpLoc(SourceLocation L)
static FunctionParmPackExpr * CreateEmpty(const ASTContext &Context, unsigned NumParams)
void setAsmLoc(SourceLocation L)
static DependentScopeDeclRefExpr * CreateEmpty(const ASTContext &C, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
void setValue(unsigned Val)
A ConditionOperator record.
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>". This is safe to be used inside an AST node, in contrast with TemplateArgumentListInfo.
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. This clause does not e...
A CXXConstructExpr record.
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]).
ParmVarDecl - Represents a parameter to a function.
unsigned path_size() const
A ShuffleVectorExpr record.
This represents 'safelen' clause in the '#pragma omp ...' directive.
A C++ static_cast expression (C++ [expr.static.cast]).
OpenMPDirectiveKind getDirectiveKind() const
void AllocateArgsArray(const ASTContext &C, bool isArray, unsigned numPlaceArgs, bool hasInitializer)
void setStrTokenLoc(unsigned TokNum, SourceLocation L)
void setAtLoc(SourceLocation L)
Represents a C99 designated initializer expression.
void setFinals(ArrayRef< Expr * > A)
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
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.
unsigned getNumAssocs() const
An ObjCProtocolExpr record.
An ObjCSelectorExpr record.
static OMPCancelDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static ObjCMessageExpr * CreateEmpty(const ASTContext &Context, unsigned NumArgs, unsigned NumStoredSelLocs)
Create an empty Objective-C message expression, to be filled in by subsequent calls.
This represents clause 'lastprivate' in the '#pragma omp ...' directives.
Represents a place-holder for an object not to be initialized by anything.
void setNumArgs(const ASTContext &C, unsigned NumArgs)
void setForLoc(SourceLocation Loc)
void setRequiresZeroInitialization(bool ZeroInit)
ASTTemplateKWAndArgsInfo * getTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
static OMPFlushDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setArg(unsigned I, Expr *E)
void setArg(unsigned Arg, Expr *ArgExpr)
setArg - Set the specified argument.
void setColonLoc(SourceLocation Loc)
Sets the location of ':'.
void setRParen(SourceLocation Loc)
void setReturnLoc(SourceLocation L)
Represents a C++ member access expression for which lookup produced a set of overloaded functions...
This represents '#pragma omp barrier' directive.
void setComponent(unsigned Idx, OffsetOfNode ON)
This is a common base class for loop directives ('omp simd', 'omp for', 'omp for simd' etc...
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
This represents '#pragma omp critical' directive.
void setRParenLoc(SourceLocation L)
Represents Objective-C's @catch statement.
void setLBraceLoc(SourceLocation Loc)
This represents clause 'copyprivate' in the '#pragma omp ...' directives.
Describes an C or C++ initializer list.
void setConstructor(CXXConstructorDecl *C)
void setValue(const ASTContext &C, const llvm::APInt &Val)
void setBuiltinLoc(SourceLocation L)
void setOperatorNew(FunctionDecl *D)
static DeclAccessPair make(NamedDecl *D, AccessSpecifier AS)
void setLocation(SourceLocation L)
void setCounters(ArrayRef< Expr * > A)
void setSynchBody(Stmt *S)
void setSelector(Selector S)
capture_init_iterator capture_init_end() const
Retrieve the iterator pointing one past the last initialization argument for this lambda expression...
A reference to a previously [de]serialized Stmt record.
void setEndLoc(SourceLocation L)
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 '('.
static CXXTryStmt * Create(const ASTContext &C, SourceLocation tryLoc, Stmt *tryBlock, ArrayRef< Stmt * > handlers)
void setAccessor(IdentifierInfo *II)
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.
This represents 'final' clause in the '#pragma omp ...' directive.
This represents 'mergeable' clause in the '#pragma omp ...' directive.
void setListInitialization(bool V)
This represents '#pragma omp teams' directive.
void setOperatorLoc(SourceLocation L)
This represents clause 'reduction' in the '#pragma omp ...' directives.
A marker record that indicates that we are at the end of an expression.
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'.
Represents a C++ member access expression where the actual member referenced could not be resolved be...
void setRParenLoc(SourceLocation Loc)
ASTTemplateKWAndArgsInfo * getTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
void setRParenLoc(SourceLocation R)
A default argument (C++ [dcl.fct.default]).
void setStmt(LabelStmt *T)
void setSourceRange(SourceRange R)
void setRParenLoc(SourceLocation L)
Represents the this expression in C++.
void setCastKind(CastKind K)
Extends ASTTemplateArgumentListInfo with the source location information for the template keyword; th...
void setEqualOrColonLoc(SourceLocation L)
void setArgument(Expr *E)
void setTypeSourceInfo(TypeSourceInfo *tsi)
static LambdaExpr * CreateDeserialized(const ASTContext &C, unsigned NumCaptures, unsigned NumArrayIndexVars)
Construct a new lambda expression that will be deserialized from an external source.
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
void setAmpAmpLoc(SourceLocation L)
static OMPTaskgroupDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
void setBreakLoc(SourceLocation L)
void setBlockDecl(BlockDecl *BD)
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)
capture_init_iterator capture_init_begin() const
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
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.
void setLocEnd(SourceLocation Loc)
Sets the ending location of the clause.
void setLParen(SourceLocation Loc)
static CXXDefaultArgExpr * Create(const ASTContext &C, SourceLocation Loc, ParmVarDecl *Param)
VAArgExpr, used for 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 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)
void setLocation(SourceLocation Location)
void setRParenLoc(SourceLocation Loc)
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.
void setDesignators(const ASTContext &C, const Designator *Desigs, unsigned NumDesigs)
void setRBraceLoc(SourceLocation Loc)
void setWhileLoc(SourceLocation L)
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
void setRParenLoc(SourceLocation L)
void setLParenLoc(SourceLocation L)
Stmt * ReadStmt(ModuleFile &F)
Reads a statement.
void setSyntacticForm(InitListExpr *Init)
Represents a C++ functional cast expression that builds a temporary object.
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)
Field designator where only the field name is known.
An ObjCSubscriptRefExpr record.
raw_arg_iterator raw_arg_end()
static CXXReinterpretCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
void setWrittenTypeInfo(TypeSourceInfo *TI)
void setRetValue(Expr *E)
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.
An ArraySubscriptExpr record.
static FloatingLiteral * Create(const ASTContext &C, const llvm::APFloat &V, bool isexact, QualType Type, SourceLocation L)
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
Information about a module that has been loaded by the ASTReader.
This represents 'ordered' clause in the '#pragma omp ...' directive.
static OMPFlushClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
A PseudoObjectExpr record.
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c array literal.
void setFinallyStmt(Stmt *S)
An ObjCIndirectCopyRestoreExpr record.
This represents '#pragma omp for' directive.
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.
void setAssociatedStmt(Stmt *S)
Set the associated statement for the directive.
An expression that sends a message to the given Objective-C object or class.
unsigned getNumComponents() const
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)
A member reference to an MSPropertyDecl.
DeclarationName getDeclName() const
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 setRParenLoc(SourceLocation L)
unsigned getNumClauses() const
Get number of clauses.
An ObjCPropertyRefExpr record.
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)
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.
void setSynchExpr(Stmt *S)
const llvm::fltSemantics & getSemantics() const
Return the APFloat semantics this literal uses.
void setLowerBoundVariable(Expr *LB)
void setLParenLoc(SourceLocation L)
void setTypeSourceInfo(TypeSourceInfo *tinfo)
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
void setComputationLHSType(QualType T)
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...
This captures a statement into a function. For example, the following pragma annotated compound state...
void setLParenLoc(SourceLocation L)
OMPClauseReader(ASTStmtReader *R, ASTContext &C, const ASTReader::RecordData &Record, unsigned &Idx)
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. The SourceManager can decode this to get at the full include stack...
void setLocation(SourceLocation L)
void setIterationVariable(Expr *IV)
static OMPOrderedDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
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)
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 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...
capture_init_iterator capture_init_end() const
Retrieve the iterator pointing one past the last initialization argument.
void setSourceRange(SourceRange R)
This represents 'schedule' clause in the '#pragma omp ...' directive.
static ObjCAtTryStmt * CreateEmpty(const ASTContext &Context, unsigned NumCatchStmts, bool HasFinally)
unsigned getCollapsedNumber() const
Get number of collapsed loops.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
void setIdentLoc(SourceLocation L)
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()
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)
void setConditionVariable(const ASTContext &C, VarDecl *V)
This is a basic class for representing single OpenMP clause.
void setIsFreeIvar(bool A)
Expr * updateInit(const ASTContext &C, unsigned Init, Expr *expr)
Updates the initializer at index Init with the new expression expr, and returns the old expression at...
void addDecl(NamedDecl *D)
void setDecl(ValueDecl *NewD)
void setThrowLoc(SourceLocation Loc)
Stmt * getCapturedStmt()
Retrieve the statement being captured.
This represents '#pragma omp target' directive.
SourceLocation getBegin() const
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)
void setBaseExpr(Stmt *S)
An expression trait intrinsic.
void setEncodedTypeSourceInfo(TypeSourceInfo *EncType)
This represents '#pragma omp ordered' directive.
static OMPCriticalDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
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)
A qualified reference to a name whose declaration cannot yet be resolved.
Expr ** getElements()
Retrieve elements of array of literals.
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...
ast_type_traits::DynTypedNode Node
Represents a reference to a function parameter pack that has been substituted but not yet expanded...
Represents a template argument.
void setGotoLoc(SourceLocation L)
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)
void setExtendingDecl(const ValueDecl *ExtendedBy, unsigned ManglingNumber)
An IntegerLiteral 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. "delete[] pArray"...
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
void setRParenLoc(SourceLocation L)
static CapturedStmt * CreateDeserialized(const ASTContext &Context, unsigned NumCaptures)
An ExtVectorElementExpr record.
void setLabel(LabelDecl *L)
void setTypeInfoAsWritten(TypeSourceInfo *writtenTy)
This represents '#pragma omp section' directive.
void setAtLoc(SourceLocation L)
Reads an AST files chain containing the contents of a translation unit.
Expr * ReadExpr(ModuleFile &F)
Reads an expression.
void setCollection(Expr *E)
An ObjCIvarRefExpr record.
void setDecl(ObjCIvarDecl *d)
void setFileScope(bool FS)
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
This represents '#pragma omp simd' directive.
void setConstructionKind(ConstructionKind CK)
An ObjCAutoreleasePoolStmt record.
const internal::VariadicDynCastAllOfMatcher< Stmt, CUDAKernelCallExpr > CUDAKernelCallExpr
Matches CUDA kernel call expression.
unsigned getNumHandlers() const
A CharacterLiteral record.
Represents a C++11 pack expansion that produces a sequence of expressions.
An ObjCStringLiteral record.
A CXXDynamicCastExpr record.
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.
bool isTypeOperand() const
for(auto typeArg:T->getTypeArgsAsWritten())
unsigned getNumArgs() const
void setLParenLoc(SourceLocation L)
void setSelector(Selector S)
unsigned getNumArgs() const
unsigned getNumConcatenated() const
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.
void setRBracketLoc(SourceLocation L)
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.
static OMPForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setConditionVariable(const ASTContext &C, VarDecl *V)
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)
static OMPCopyprivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
void setColonLoc(SourceLocation Loc)
static UnresolvedMemberExpr * CreateEmpty(const ASTContext &C, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
A SizefAlignOfExpr record.
Represents a call to a CUDA kernel function.
void setRParenLoc(SourceLocation Loc)
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. ...
void setFPContractable(bool FPC)
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.
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...
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)
void setBuiltinLoc(SourceLocation L)
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
GNU array range designator.
A GCC-style AsmStmt record.
This represents 'nowait' clause in the '#pragma omp ...' directive.
void setStrideVariable(Expr *ST)
static CXXStaticCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
void initializeFrom(SourceLocation TemplateKWLoc, const TemplateArgumentListInfo &List)
static OMPParallelSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setElseLoc(SourceLocation L)
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.
void setIfLoc(SourceLocation L)
Field designator where the field has been resolved to a declaration.
void setIsaMemberLoc(SourceLocation L)
unsigned kind
All of the diagnostics that can be emitted by the frontend.
void setExprOperand(Expr *E)
unsigned getNumSubExprs()
Represents Objective-C's @try ... @catch ... @finally statement.
void setCapturedRegionKind(CapturedRegionKind Kind)
Set the captured region kind.
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.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
void setOpLoc(SourceLocation L)
void setLoopVarStmt(Stmt *S)
capture_init_iterator capture_init_begin() const
Retrieve the first initialization argument.
void setPreCond(Expr *PC)
void setRParenLoc(SourceLocation L)
void reserveInits(const ASTContext &C, unsigned NumInits)
Reserve space for some number of initializers.
An ObjCMessageExpr record.
Abstract class common to all of the C++ "named"/"keyword" casts.
This represents '#pragma omp sections' directive.
void setNextSwitchCase(SwitchCase *SC)
A CompoundAssignOperator record.
void setNextUpperBound(Expr *NUB)
void setKind(CharacterKind kind)
A reference to a declared variable, function, enum, etc. [C99 6.5.1p2].
void setLabel(LabelDecl *D)
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.
A boolean literal, per ([C++ lex.bool] Boolean literals).
This represents '#pragma omp parallel sections' directive.
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 setStmts(const ASTContext &C, Stmt **Stmts, unsigned NumStmts)
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.
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
A GenericSelectionExpr record.
static OMPCancellationPointDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
void setLabelLoc(SourceLocation L)
void ReadTemplateKWAndArgsInfo(ASTTemplateKWAndArgsInfo &Args, unsigned NumTemplateArgs)
Read and initialize a ExplicitTemplateArgumentList structure.
#define BLOCK(DERIVED, BASE)
void setAtLoc(SourceLocation Loc)
void setIsConditionTrue(bool isTrue)