diff options
Diffstat (limited to 'clang/lib/Serialization/ASTReaderStmt.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTReaderStmt.cpp | 365 |
1 files changed, 134 insertions, 231 deletions
diff --git a/clang/lib/Serialization/ASTReaderStmt.cpp b/clang/lib/Serialization/ASTReaderStmt.cpp index a40c5499a6d7..0e1af53303b4 100644 --- a/clang/lib/Serialization/ASTReaderStmt.cpp +++ b/clang/lib/Serialization/ASTReaderStmt.cpp @@ -226,6 +226,8 @@ void ASTStmtReader::VisitIfStmt(IfStmt *S) { S->setInit(Record.readSubStmt()); S->setIfLoc(readSourceLocation()); + S->setLParenLoc(readSourceLocation()); + S->setRParenLoc(readSourceLocation()); if (HasElse) S->setElseLoc(readSourceLocation()); } @@ -247,6 +249,8 @@ void ASTStmtReader::VisitSwitchStmt(SwitchStmt *S) { S->setConditionVariable(Record.getContext(), readDeclAs<VarDecl>()); S->setSwitchLoc(readSourceLocation()); + S->setLParenLoc(readSourceLocation()); + S->setRParenLoc(readSourceLocation()); SwitchCase *PrevSC = nullptr; for (auto E = Record.size(); Record.getIdx() != E; ) { @@ -610,7 +614,7 @@ void ASTStmtReader::VisitDeclRefExpr(DeclRefExpr *E) { *E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(), E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs); - E->setDecl(readDeclAs<ValueDecl>()); + E->D = readDeclAs<ValueDecl>(); E->setLocation(readSourceLocation()); E->DNLoc = Record.readDeclarationNameLoc(E->getDecl()->getDeclName()); } @@ -708,7 +712,8 @@ void ASTStmtReader::VisitUnaryOperator(UnaryOperator *E) { E->setOperatorLoc(readSourceLocation()); E->setCanOverflow(Record.readInt()); if (hasFP_Features) - E->setStoredFPFeatures(FPOptionsOverride(Record.readInt())); + E->setStoredFPFeatures( + FPOptionsOverride::getFromOpaqueInt(Record.readInt())); } void ASTStmtReader::VisitOffsetOfExpr(OffsetOfExpr *E) { @@ -991,12 +996,16 @@ void ASTStmtReader::VisitOMPIteratorExpr(OMPIteratorExpr *E) { void ASTStmtReader::VisitCallExpr(CallExpr *E) { VisitExpr(E); unsigned NumArgs = Record.readInt(); + bool HasFPFeatures = Record.readInt(); assert((NumArgs == E->getNumArgs()) && "Wrong NumArgs!"); E->setRParenLoc(readSourceLocation()); E->setCallee(Record.readSubExpr()); for (unsigned I = 0; I != NumArgs; ++I) E->setArg(I, Record.readSubExpr()); E->setADLCallKind(static_cast<CallExpr::ADLCallKind>(Record.readInt())); + if (HasFPFeatures) + E->setStoredFPFeatures( + FPOptionsOverride::getFromOpaqueInt(Record.readInt())); } void ASTStmtReader::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) { @@ -1073,6 +1082,8 @@ void ASTStmtReader::VisitCastExpr(CastExpr *E) { VisitExpr(E); unsigned NumBaseSpecs = Record.readInt(); assert(NumBaseSpecs == E->path_size()); + unsigned HasFPFeatures = Record.readInt(); + assert(E->hasStoredFPFeatures() == HasFPFeatures); E->setSubExpr(Record.readSubExpr()); E->setCastKind((CastKind)Record.readInt()); CastExpr::path_iterator BaseI = E->path_begin(); @@ -1081,6 +1092,9 @@ void ASTStmtReader::VisitCastExpr(CastExpr *E) { *BaseSpec = Record.readCXXBaseSpecifier(); *BaseI++ = BaseSpec; } + if (HasFPFeatures) + *E->getTrailingFPFeatures() = + FPOptionsOverride::getFromOpaqueInt(Record.readInt()); } void ASTStmtReader::VisitBinaryOperator(BinaryOperator *E) { @@ -1093,7 +1107,8 @@ void ASTStmtReader::VisitBinaryOperator(BinaryOperator *E) { E->setRHS(Record.readSubExpr()); E->setOperatorLoc(readSourceLocation()); if (hasFP_Features) - E->setStoredFPFeatures(FPOptionsOverride(Record.readInt())); + E->setStoredFPFeatures( + FPOptionsOverride::getFromOpaqueInt(Record.readInt())); } void ASTStmtReader::VisitCompoundAssignOperator(CompoundAssignOperator *E) { @@ -1662,7 +1677,6 @@ void ASTStmtReader::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) { VisitCallExpr(E); E->CXXOperatorCallExprBits.OperatorKind = Record.readInt(); E->Range = Record.readSourceRange(); - E->setFPFeatures(FPOptionsOverride(Record.readInt())); } void ASTStmtReader::VisitCXXRewrittenBinaryOperator( @@ -1976,10 +1990,10 @@ ASTStmtReader::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) { void ASTStmtReader::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E) { VisitExpr(E); - assert(Record.peekInt() == E->arg_size() && + assert(Record.peekInt() == E->getNumArgs() && "Read wrong record during creation ?"); Record.skipInts(1); - for (unsigned I = 0, N = E->arg_size(); I != N; ++I) + for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I) E->setArg(I, Record.readSubExpr()); E->TSI = readTypeSourceInfo(); E->setLParenLoc(readSourceLocation()); @@ -2107,7 +2121,8 @@ void ASTStmtReader::VisitSizeOfPackExpr(SizeOfPackExpr *E) { void ASTStmtReader::VisitSubstNonTypeTemplateParmExpr( SubstNonTypeTemplateParmExpr *E) { VisitExpr(E); - E->Param = readDeclAs<NonTypeTemplateParmDecl>(); + E->ParamAndRef.setPointer(readDeclAs<NonTypeTemplateParmDecl>()); + E->ParamAndRef.setInt(Record.readInt()); E->SubstNonTypeTemplateParmExprBits.NameLoc = readSourceLocation(); E->Replacement = Record.readSubExpr(); } @@ -2152,6 +2167,7 @@ void ASTStmtReader::VisitCXXFoldExpr(CXXFoldExpr *E) { E->NumExpansions = Record.readInt(); E->SubExprs[0] = Record.readSubExpr(); E->SubExprs[1] = Record.readSubExpr(); + E->SubExprs[2] = Record.readSubExpr(); E->Opcode = (BinaryOperatorKind)Record.readInt(); } @@ -2171,9 +2187,9 @@ void ASTStmtReader::VisitRecoveryExpr(RecoveryExpr *E) { unsigned NumArgs = Record.readInt(); E->BeginLoc = readSourceLocation(); E->EndLoc = readSourceLocation(); - assert( - (NumArgs == std::distance(E->children().begin(), E->children().end())) && - "Wrong NumArgs!"); + assert((NumArgs + 0LL == + std::distance(E->children().begin(), E->children().end())) && + "Wrong NumArgs!"); (void)NumArgs; for (Stmt *&Child : E->children()) Child = Record.readSubStmt(); @@ -2258,99 +2274,22 @@ void ASTStmtReader::VisitAsTypeExpr(AsTypeExpr *E) { //===----------------------------------------------------------------------===// void ASTStmtReader::VisitOMPExecutableDirective(OMPExecutableDirective *E) { + Record.readOMPChildren(E->Data); E->setLocStart(readSourceLocation()); E->setLocEnd(readSourceLocation()); - SmallVector<OMPClause *, 5> Clauses; - for (unsigned i = 0; i < E->getNumClauses(); ++i) - Clauses.push_back(Record.readOMPClause()); - E->setClauses(Clauses); - if (E->hasAssociatedStmt()) - E->setAssociatedStmt(Record.readSubStmt()); } void ASTStmtReader::VisitOMPLoopDirective(OMPLoopDirective *D) { VisitStmt(D); - // Two fields (NumClauses and CollapsedNum) were read in ReadStmtFromStream. - Record.skipInts(2); + // Field CollapsedNum was read in ReadStmtFromStream. + Record.skipInts(1); VisitOMPExecutableDirective(D); - D->setIterationVariable(Record.readSubExpr()); - D->setLastIteration(Record.readSubExpr()); - D->setCalcLastIteration(Record.readSubExpr()); - D->setPreCond(Record.readSubExpr()); - D->setCond(Record.readSubExpr()); - D->setInit(Record.readSubExpr()); - D->setInc(Record.readSubExpr()); - D->setPreInits(Record.readSubStmt()); - if (isOpenMPWorksharingDirective(D->getDirectiveKind()) || - isOpenMPTaskLoopDirective(D->getDirectiveKind()) || - isOpenMPDistributeDirective(D->getDirectiveKind())) { - D->setIsLastIterVariable(Record.readSubExpr()); - D->setLowerBoundVariable(Record.readSubExpr()); - D->setUpperBoundVariable(Record.readSubExpr()); - D->setStrideVariable(Record.readSubExpr()); - D->setEnsureUpperBound(Record.readSubExpr()); - D->setNextLowerBound(Record.readSubExpr()); - D->setNextUpperBound(Record.readSubExpr()); - D->setNumIterations(Record.readSubExpr()); - } - if (isOpenMPLoopBoundSharingDirective(D->getDirectiveKind())) { - D->setPrevLowerBoundVariable(Record.readSubExpr()); - D->setPrevUpperBoundVariable(Record.readSubExpr()); - D->setDistInc(Record.readSubExpr()); - D->setPrevEnsureUpperBound(Record.readSubExpr()); - D->setCombinedLowerBoundVariable(Record.readSubExpr()); - D->setCombinedUpperBoundVariable(Record.readSubExpr()); - D->setCombinedEnsureUpperBound(Record.readSubExpr()); - D->setCombinedInit(Record.readSubExpr()); - D->setCombinedCond(Record.readSubExpr()); - D->setCombinedNextLowerBound(Record.readSubExpr()); - D->setCombinedNextUpperBound(Record.readSubExpr()); - D->setCombinedDistCond(Record.readSubExpr()); - D->setCombinedParForInDistCond(Record.readSubExpr()); - } - SmallVector<Expr *, 4> Sub; - unsigned CollapsedNum = D->getCollapsedNumber(); - Sub.reserve(CollapsedNum); - for (unsigned i = 0; i < CollapsedNum; ++i) - Sub.push_back(Record.readSubExpr()); - D->setCounters(Sub); - Sub.clear(); - for (unsigned i = 0; i < CollapsedNum; ++i) - Sub.push_back(Record.readSubExpr()); - D->setPrivateCounters(Sub); - Sub.clear(); - for (unsigned i = 0; i < CollapsedNum; ++i) - Sub.push_back(Record.readSubExpr()); - D->setInits(Sub); - Sub.clear(); - for (unsigned i = 0; i < CollapsedNum; ++i) - Sub.push_back(Record.readSubExpr()); - D->setUpdates(Sub); - Sub.clear(); - for (unsigned i = 0; i < CollapsedNum; ++i) - Sub.push_back(Record.readSubExpr()); - D->setFinals(Sub); - Sub.clear(); - for (unsigned i = 0; i < CollapsedNum; ++i) - Sub.push_back(Record.readSubExpr()); - D->setDependentCounters(Sub); - Sub.clear(); - for (unsigned i = 0; i < CollapsedNum; ++i) - Sub.push_back(Record.readSubExpr()); - D->setDependentInits(Sub); - Sub.clear(); - for (unsigned i = 0; i < CollapsedNum; ++i) - Sub.push_back(Record.readSubExpr()); - D->setFinalsConditions(Sub); } void ASTStmtReader::VisitOMPParallelDirective(OMPParallelDirective *D) { VisitStmt(D); - // The NumClauses field was read in ReadStmtFromStream. - Record.skipInts(1); VisitOMPExecutableDirective(D); - D->setTaskReductionRefExpr(Record.readSubExpr()); - D->setHasCancel(Record.readInt()); + D->setHasCancel(Record.readBool()); } void ASTStmtReader::VisitOMPSimdDirective(OMPSimdDirective *D) { @@ -2359,8 +2298,7 @@ void ASTStmtReader::VisitOMPSimdDirective(OMPSimdDirective *D) { void ASTStmtReader::VisitOMPForDirective(OMPForDirective *D) { VisitOMPLoopDirective(D); - D->setTaskReductionRefExpr(Record.readSubExpr()); - D->setHasCancel(Record.readInt()); + D->setHasCancel(Record.readBool()); } void ASTStmtReader::VisitOMPForSimdDirective(OMPForSimdDirective *D) { @@ -2369,23 +2307,18 @@ void ASTStmtReader::VisitOMPForSimdDirective(OMPForSimdDirective *D) { void ASTStmtReader::VisitOMPSectionsDirective(OMPSectionsDirective *D) { VisitStmt(D); - // The NumClauses field was read in ReadStmtFromStream. - Record.skipInts(1); VisitOMPExecutableDirective(D); - D->setTaskReductionRefExpr(Record.readSubExpr()); - D->setHasCancel(Record.readInt()); + D->setHasCancel(Record.readBool()); } void ASTStmtReader::VisitOMPSectionDirective(OMPSectionDirective *D) { VisitStmt(D); VisitOMPExecutableDirective(D); - D->setHasCancel(Record.readInt()); + D->setHasCancel(Record.readBool()); } void ASTStmtReader::VisitOMPSingleDirective(OMPSingleDirective *D) { VisitStmt(D); - // The NumClauses field was read in ReadStmtFromStream. - Record.skipInts(1); VisitOMPExecutableDirective(D); } @@ -2396,16 +2329,13 @@ void ASTStmtReader::VisitOMPMasterDirective(OMPMasterDirective *D) { void ASTStmtReader::VisitOMPCriticalDirective(OMPCriticalDirective *D) { VisitStmt(D); - // The NumClauses field was read in ReadStmtFromStream. - Record.skipInts(1); VisitOMPExecutableDirective(D); D->DirName = Record.readDeclarationNameInfo(); } void ASTStmtReader::VisitOMPParallelForDirective(OMPParallelForDirective *D) { VisitOMPLoopDirective(D); - D->setTaskReductionRefExpr(Record.readSubExpr()); - D->setHasCancel(Record.readInt()); + D->setHasCancel(Record.readBool()); } void ASTStmtReader::VisitOMPParallelForSimdDirective( @@ -2416,28 +2346,20 @@ void ASTStmtReader::VisitOMPParallelForSimdDirective( void ASTStmtReader::VisitOMPParallelMasterDirective( OMPParallelMasterDirective *D) { VisitStmt(D); - // The NumClauses field was read in ReadStmtFromStream. - Record.skipInts(1); VisitOMPExecutableDirective(D); - D->setTaskReductionRefExpr(Record.readSubExpr()); } void ASTStmtReader::VisitOMPParallelSectionsDirective( OMPParallelSectionsDirective *D) { VisitStmt(D); - // The NumClauses field was read in ReadStmtFromStream. - Record.skipInts(1); VisitOMPExecutableDirective(D); - D->setTaskReductionRefExpr(Record.readSubExpr()); - D->setHasCancel(Record.readInt()); + D->setHasCancel(Record.readBool()); } void ASTStmtReader::VisitOMPTaskDirective(OMPTaskDirective *D) { VisitStmt(D); - // The NumClauses field was read in ReadStmtFromStream. - Record.skipInts(1); VisitOMPExecutableDirective(D); - D->setHasCancel(Record.readInt()); + D->setHasCancel(Record.readBool()); } void ASTStmtReader::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) { @@ -2457,100 +2379,73 @@ void ASTStmtReader::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) { void ASTStmtReader::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) { VisitStmt(D); - // The NumClauses field was read in ReadStmtFromStream. - Record.skipInts(1); VisitOMPExecutableDirective(D); - D->setReductionRef(Record.readSubExpr()); } void ASTStmtReader::VisitOMPFlushDirective(OMPFlushDirective *D) { VisitStmt(D); - // The NumClauses field was read in ReadStmtFromStream. - Record.skipInts(1); VisitOMPExecutableDirective(D); } void ASTStmtReader::VisitOMPDepobjDirective(OMPDepobjDirective *D) { VisitStmt(D); - // The NumClauses field was read in ReadStmtFromStream. - Record.skipInts(1); VisitOMPExecutableDirective(D); } void ASTStmtReader::VisitOMPScanDirective(OMPScanDirective *D) { VisitStmt(D); - // The NumClauses field was read in ReadStmtFromStream. - Record.skipInts(1); VisitOMPExecutableDirective(D); } void ASTStmtReader::VisitOMPOrderedDirective(OMPOrderedDirective *D) { VisitStmt(D); - // The NumClauses field was read in ReadStmtFromStream. - Record.skipInts(1); VisitOMPExecutableDirective(D); } void ASTStmtReader::VisitOMPAtomicDirective(OMPAtomicDirective *D) { VisitStmt(D); - // The NumClauses field was read in ReadStmtFromStream. - Record.skipInts(1); VisitOMPExecutableDirective(D); - D->setX(Record.readSubExpr()); - D->setV(Record.readSubExpr()); - D->setExpr(Record.readSubExpr()); - D->setUpdateExpr(Record.readSubExpr()); - D->IsXLHSInRHSPart = Record.readInt() != 0; - D->IsPostfixUpdate = Record.readInt() != 0; + D->IsXLHSInRHSPart = Record.readBool(); + D->IsPostfixUpdate = Record.readBool(); } void ASTStmtReader::VisitOMPTargetDirective(OMPTargetDirective *D) { VisitStmt(D); - // The NumClauses field was read in ReadStmtFromStream. - Record.skipInts(1); VisitOMPExecutableDirective(D); } void ASTStmtReader::VisitOMPTargetDataDirective(OMPTargetDataDirective *D) { VisitStmt(D); - Record.skipInts(1); VisitOMPExecutableDirective(D); } void ASTStmtReader::VisitOMPTargetEnterDataDirective( OMPTargetEnterDataDirective *D) { VisitStmt(D); - Record.skipInts(1); VisitOMPExecutableDirective(D); } void ASTStmtReader::VisitOMPTargetExitDataDirective( OMPTargetExitDataDirective *D) { VisitStmt(D); - Record.skipInts(1); VisitOMPExecutableDirective(D); } void ASTStmtReader::VisitOMPTargetParallelDirective( OMPTargetParallelDirective *D) { VisitStmt(D); - Record.skipInts(1); VisitOMPExecutableDirective(D); - D->setTaskReductionRefExpr(Record.readSubExpr()); D->setHasCancel(Record.readBool()); } void ASTStmtReader::VisitOMPTargetParallelForDirective( OMPTargetParallelForDirective *D) { VisitOMPLoopDirective(D); - D->setTaskReductionRefExpr(Record.readSubExpr()); - D->setHasCancel(Record.readInt()); + D->setHasCancel(Record.readBool()); } void ASTStmtReader::VisitOMPTeamsDirective(OMPTeamsDirective *D) { VisitStmt(D); - // The NumClauses field was read in ReadStmtFromStream. - Record.skipInts(1); VisitOMPExecutableDirective(D); } @@ -2558,20 +2453,18 @@ void ASTStmtReader::VisitOMPCancellationPointDirective( OMPCancellationPointDirective *D) { VisitStmt(D); VisitOMPExecutableDirective(D); - D->setCancelRegion(static_cast<OpenMPDirectiveKind>(Record.readInt())); + D->setCancelRegion(Record.readEnum<OpenMPDirectiveKind>()); } void ASTStmtReader::VisitOMPCancelDirective(OMPCancelDirective *D) { VisitStmt(D); - // The NumClauses field was read in ReadStmtFromStream. - Record.skipInts(1); VisitOMPExecutableDirective(D); - D->setCancelRegion(static_cast<OpenMPDirectiveKind>(Record.readInt())); + D->setCancelRegion(Record.readEnum<OpenMPDirectiveKind>()); } void ASTStmtReader::VisitOMPTaskLoopDirective(OMPTaskLoopDirective *D) { VisitOMPLoopDirective(D); - D->setHasCancel(Record.readInt()); + D->setHasCancel(Record.readBool()); } void ASTStmtReader::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) { @@ -2581,7 +2474,7 @@ void ASTStmtReader::VisitOMPTaskLoopSimdDirective(OMPTaskLoopSimdDirective *D) { void ASTStmtReader::VisitOMPMasterTaskLoopDirective( OMPMasterTaskLoopDirective *D) { VisitOMPLoopDirective(D); - D->setHasCancel(Record.readInt()); + D->setHasCancel(Record.readBool()); } void ASTStmtReader::VisitOMPMasterTaskLoopSimdDirective( @@ -2592,7 +2485,7 @@ void ASTStmtReader::VisitOMPMasterTaskLoopSimdDirective( void ASTStmtReader::VisitOMPParallelMasterTaskLoopDirective( OMPParallelMasterTaskLoopDirective *D) { VisitOMPLoopDirective(D); - D->setHasCancel(Record.readInt()); + D->setHasCancel(Record.readBool()); } void ASTStmtReader::VisitOMPParallelMasterTaskLoopSimdDirective( @@ -2606,15 +2499,13 @@ void ASTStmtReader::VisitOMPDistributeDirective(OMPDistributeDirective *D) { void ASTStmtReader::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) { VisitStmt(D); - Record.skipInts(1); VisitOMPExecutableDirective(D); } void ASTStmtReader::VisitOMPDistributeParallelForDirective( OMPDistributeParallelForDirective *D) { VisitOMPLoopDirective(D); - D->setTaskReductionRefExpr(Record.readSubExpr()); - D->setHasCancel(Record.readInt()); + D->setHasCancel(Record.readBool()); } void ASTStmtReader::VisitOMPDistributeParallelForSimdDirective( @@ -2654,14 +2545,11 @@ void ASTStmtReader::VisitOMPTeamsDistributeParallelForSimdDirective( void ASTStmtReader::VisitOMPTeamsDistributeParallelForDirective( OMPTeamsDistributeParallelForDirective *D) { VisitOMPLoopDirective(D); - D->setTaskReductionRefExpr(Record.readSubExpr()); - D->setHasCancel(Record.readInt()); + D->setHasCancel(Record.readBool()); } void ASTStmtReader::VisitOMPTargetTeamsDirective(OMPTargetTeamsDirective *D) { VisitStmt(D); - // The NumClauses field was read in ReadStmtFromStream. - Record.skipInts(1); VisitOMPExecutableDirective(D); } @@ -2673,8 +2561,7 @@ void ASTStmtReader::VisitOMPTargetTeamsDistributeDirective( void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForDirective( OMPTargetTeamsDistributeParallelForDirective *D) { VisitOMPLoopDirective(D); - D->setTaskReductionRefExpr(Record.readSubExpr()); - D->setHasCancel(Record.readInt()); + D->setHasCancel(Record.readBool()); } void ASTStmtReader::VisitOMPTargetTeamsDistributeParallelForSimdDirective( @@ -2977,7 +2864,8 @@ Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) { case EXPR_CALL: S = CallExpr::CreateEmpty( - Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], Empty); + Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], + /*HasFPFeatures=*/Record[ASTStmtReader::NumExprFields + 1], Empty); break; case EXPR_RECOVERY: @@ -3011,13 +2899,17 @@ Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) { break; case EXPR_IMPLICIT_CAST: - S = ImplicitCastExpr::CreateEmpty(Context, - /*PathSize*/ Record[ASTStmtReader::NumExprFields]); + S = ImplicitCastExpr::CreateEmpty( + Context, + /*PathSize*/ Record[ASTStmtReader::NumExprFields], + /*HasFPFeatures*/ Record[ASTStmtReader::NumExprFields + 1]); break; case EXPR_CSTYLE_CAST: - S = CStyleCastExpr::CreateEmpty(Context, - /*PathSize*/ Record[ASTStmtReader::NumExprFields]); + S = CStyleCastExpr::CreateEmpty( + Context, + /*PathSize*/ Record[ASTStmtReader::NumExprFields], + /*HasFPFeatures*/ Record[ASTStmtReader::NumExprFields + 1]); break; case EXPR_COMPOUND_LITERAL: @@ -3246,24 +3138,24 @@ Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) { break; case STMT_OMP_SIMD_DIRECTIVE: { - unsigned NumClauses = Record[ASTStmtReader::NumStmtFields]; - unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1]; + unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; + unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; S = OMPSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum, Empty); break; } case STMT_OMP_FOR_DIRECTIVE: { - unsigned NumClauses = Record[ASTStmtReader::NumStmtFields]; - unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1]; + unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; + unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; S = OMPForDirective::CreateEmpty(Context, NumClauses, CollapsedNum, Empty); break; } case STMT_OMP_FOR_SIMD_DIRECTIVE: { - unsigned NumClauses = Record[ASTStmtReader::NumStmtFields]; - unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1]; + unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; + unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; S = OMPForSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum, Empty); break; @@ -3293,16 +3185,16 @@ Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) { break; case STMT_OMP_PARALLEL_FOR_DIRECTIVE: { - unsigned NumClauses = Record[ASTStmtReader::NumStmtFields]; - unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1]; + unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; + unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; S = OMPParallelForDirective::CreateEmpty(Context, NumClauses, CollapsedNum, Empty); break; } case STMT_OMP_PARALLEL_FOR_SIMD_DIRECTIVE: { - unsigned NumClauses = Record[ASTStmtReader::NumStmtFields]; - unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1]; + unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; + unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; S = OMPParallelForSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum, Empty); break; @@ -3355,10 +3247,13 @@ Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) { Context, Record[ASTStmtReader::NumStmtFields], Empty); break; - case STMT_OMP_ORDERED_DIRECTIVE: - S = OMPOrderedDirective::CreateEmpty( - Context, Record[ASTStmtReader::NumStmtFields], Empty); + case STMT_OMP_ORDERED_DIRECTIVE: { + unsigned NumClauses = Record[ASTStmtReader::NumStmtFields]; + bool HasAssociatedStmt = Record[ASTStmtReader::NumStmtFields + 2]; + S = OMPOrderedDirective::CreateEmpty(Context, NumClauses, + !HasAssociatedStmt, Empty); break; + } case STMT_OMP_ATOMIC_DIRECTIVE: S = OMPAtomicDirective::CreateEmpty( @@ -3391,8 +3286,8 @@ Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) { break; case STMT_OMP_TARGET_PARALLEL_FOR_DIRECTIVE: { - unsigned NumClauses = Record[ASTStmtReader::NumStmtFields]; - unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1]; + unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; + unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; S = OMPTargetParallelForDirective::CreateEmpty(Context, NumClauses, CollapsedNum, Empty); break; @@ -3418,72 +3313,72 @@ Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) { break; case STMT_OMP_TASKLOOP_DIRECTIVE: { - unsigned NumClauses = Record[ASTStmtReader::NumStmtFields]; - unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1]; + unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; + unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; S = OMPTaskLoopDirective::CreateEmpty(Context, NumClauses, CollapsedNum, Empty); break; } case STMT_OMP_TASKLOOP_SIMD_DIRECTIVE: { - unsigned NumClauses = Record[ASTStmtReader::NumStmtFields]; - unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1]; + unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; + unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; S = OMPTaskLoopSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum, Empty); break; } case STMT_OMP_MASTER_TASKLOOP_DIRECTIVE: { - unsigned NumClauses = Record[ASTStmtReader::NumStmtFields]; - unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1]; + unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; + unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; S = OMPMasterTaskLoopDirective::CreateEmpty(Context, NumClauses, CollapsedNum, Empty); break; } case STMT_OMP_MASTER_TASKLOOP_SIMD_DIRECTIVE: { - unsigned NumClauses = Record[ASTStmtReader::NumStmtFields]; - unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1]; + unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; + unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; S = OMPMasterTaskLoopSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum, Empty); break; } case STMT_OMP_PARALLEL_MASTER_TASKLOOP_DIRECTIVE: { - unsigned NumClauses = Record[ASTStmtReader::NumStmtFields]; - unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1]; + unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; + unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; S = OMPParallelMasterTaskLoopDirective::CreateEmpty(Context, NumClauses, CollapsedNum, Empty); break; } case STMT_OMP_PARALLEL_MASTER_TASKLOOP_SIMD_DIRECTIVE: { - unsigned NumClauses = Record[ASTStmtReader::NumStmtFields]; - unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1]; + unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; + unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; S = OMPParallelMasterTaskLoopSimdDirective::CreateEmpty( Context, NumClauses, CollapsedNum, Empty); break; } case STMT_OMP_DISTRIBUTE_DIRECTIVE: { - unsigned NumClauses = Record[ASTStmtReader::NumStmtFields]; - unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1]; + unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; + unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; S = OMPDistributeDirective::CreateEmpty(Context, NumClauses, CollapsedNum, Empty); break; } case STMT_OMP_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE: { - unsigned NumClauses = Record[ASTStmtReader::NumStmtFields]; - unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1]; + unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; + unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; S = OMPDistributeParallelForDirective::CreateEmpty(Context, NumClauses, CollapsedNum, Empty); break; } case STMT_OMP_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE: { - unsigned NumClauses = Record[ASTStmtReader::NumStmtFields]; - unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1]; + unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; + unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; S = OMPDistributeParallelForSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum, Empty); @@ -3491,56 +3386,56 @@ Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) { } case STMT_OMP_DISTRIBUTE_SIMD_DIRECTIVE: { - unsigned NumClauses = Record[ASTStmtReader::NumStmtFields]; - unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1]; + unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; + unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; S = OMPDistributeSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum, Empty); break; } case STMT_OMP_TARGET_PARALLEL_FOR_SIMD_DIRECTIVE: { - unsigned NumClauses = Record[ASTStmtReader::NumStmtFields]; - unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1]; + unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; + unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; S = OMPTargetParallelForSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum, Empty); break; } case STMT_OMP_TARGET_SIMD_DIRECTIVE: { - auto NumClauses = Record[ASTStmtReader::NumStmtFields]; - auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1]; + unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; + unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; S = OMPTargetSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum, Empty); break; } case STMT_OMP_TEAMS_DISTRIBUTE_DIRECTIVE: { - auto NumClauses = Record[ASTStmtReader::NumStmtFields]; - auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1]; - S = OMPTeamsDistributeDirective::CreateEmpty(Context, NumClauses, - CollapsedNum, Empty); - break; + unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; + unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; + S = OMPTeamsDistributeDirective::CreateEmpty(Context, NumClauses, + CollapsedNum, Empty); + break; } case STMT_OMP_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE: { - unsigned NumClauses = Record[ASTStmtReader::NumStmtFields]; - unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1]; + unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; + unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; S = OMPTeamsDistributeSimdDirective::CreateEmpty(Context, NumClauses, CollapsedNum, Empty); break; } case STMT_OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE: { - auto NumClauses = Record[ASTStmtReader::NumStmtFields]; - auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1]; + unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; + unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; S = OMPTeamsDistributeParallelForSimdDirective::CreateEmpty( Context, NumClauses, CollapsedNum, Empty); break; } case STMT_OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE: { - auto NumClauses = Record[ASTStmtReader::NumStmtFields]; - auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1]; + unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; + unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; S = OMPTeamsDistributeParallelForDirective::CreateEmpty( Context, NumClauses, CollapsedNum, Empty); break; @@ -3552,32 +3447,32 @@ Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) { break; case STMT_OMP_TARGET_TEAMS_DISTRIBUTE_DIRECTIVE: { - auto NumClauses = Record[ASTStmtReader::NumStmtFields]; - auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1]; + unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; + unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; S = OMPTargetTeamsDistributeDirective::CreateEmpty(Context, NumClauses, CollapsedNum, Empty); break; } case STMT_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE: { - auto NumClauses = Record[ASTStmtReader::NumStmtFields]; - auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1]; + unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; + unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; S = OMPTargetTeamsDistributeParallelForDirective::CreateEmpty( Context, NumClauses, CollapsedNum, Empty); break; } case STMT_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE: { - auto NumClauses = Record[ASTStmtReader::NumStmtFields]; - auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1]; + unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; + unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; S = OMPTargetTeamsDistributeParallelForSimdDirective::CreateEmpty( Context, NumClauses, CollapsedNum, Empty); break; } case STMT_OMP_TARGET_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE: { - auto NumClauses = Record[ASTStmtReader::NumStmtFields]; - auto CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1]; + unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields]; + unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1]; S = OMPTargetTeamsDistributeSimdDirective::CreateEmpty( Context, NumClauses, CollapsedNum, Empty); break; @@ -3585,12 +3480,14 @@ Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) { case EXPR_CXX_OPERATOR_CALL: S = CXXOperatorCallExpr::CreateEmpty( - Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], Empty); + Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], + /*HasFPFeatures=*/Record[ASTStmtReader::NumExprFields + 1], Empty); break; case EXPR_CXX_MEMBER_CALL: S = CXXMemberCallExpr::CreateEmpty( - Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], Empty); + Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], + /*HasFPFeatures=*/Record[ASTStmtReader::NumExprFields + 1], Empty); break; case EXPR_CXX_REWRITTEN_BINARY_OPERATOR: @@ -3614,8 +3511,10 @@ Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) { break; case EXPR_CXX_STATIC_CAST: - S = CXXStaticCastExpr::CreateEmpty(Context, - /*PathSize*/ Record[ASTStmtReader::NumExprFields]); + S = CXXStaticCastExpr::CreateEmpty( + Context, + /*PathSize*/ Record[ASTStmtReader::NumExprFields], + /*HasFPFeatures*/ Record[ASTStmtReader::NumExprFields + 1]); break; case EXPR_CXX_DYNAMIC_CAST: @@ -3637,8 +3536,10 @@ Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) { break; case EXPR_CXX_FUNCTIONAL_CAST: - S = CXXFunctionalCastExpr::CreateEmpty(Context, - /*PathSize*/ Record[ASTStmtReader::NumExprFields]); + S = CXXFunctionalCastExpr::CreateEmpty( + Context, + /*PathSize*/ Record[ASTStmtReader::NumExprFields], + /*HasFPFeatures*/ Record[ASTStmtReader::NumExprFields + 1]); break; case EXPR_BUILTIN_BIT_CAST: @@ -3648,7 +3549,8 @@ Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) { case EXPR_USER_DEFINED_LITERAL: S = UserDefinedLiteral::CreateEmpty( - Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], Empty); + Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], + /*HasFPFeatures=*/Record[ASTStmtReader::NumExprFields + 1], Empty); break; case EXPR_CXX_STD_INITIALIZER_LIST: @@ -3831,7 +3733,8 @@ Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) { case EXPR_CUDA_KERNEL_CALL: S = CUDAKernelCallExpr::CreateEmpty( - Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], Empty); + Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], + /*HasFPFeatures=*/Record[ASTStmtReader::NumExprFields + 1], Empty); break; case EXPR_ASTYPE: |