Lines Matching refs:eval

324     Fortran::lower::pft::Evaluation &eval = addEvaluation(  in enterConstructOrDirective()  local
326 eval.evaluationList.reset(new lower::pft::EvaluationList); in enterConstructOrDirective()
327 pushEvaluationList(eval.evaluationList.get()); in enterConstructOrDirective()
328 pftParentStack.emplace_back(eval); in enterConstructOrDirective()
329 constructAndDirectiveStack.emplace_back(&eval); in enterConstructOrDirective()
335 auto *eval = constructAndDirectiveStack.back(); in exitConstructOrDirective() local
336 if (eval->isExecutableDirective()) { in exitConstructOrDirective()
340 *eval->evaluationList; in exitConstructOrDirective()
401 lower::pft::Evaluation &addEvaluation(lower::pft::Evaluation &&eval) { in addEvaluation() argument
405 eval.parentConstruct = constructAndDirectiveStack.back(); in addEvaluation()
406 auto &entryPointList = eval.getOwningProcedure()->entryPointList; in addEvaluation()
407 evaluationListStack.back()->emplace_back(std::move(eval)); in addEvaluation()
505 auto &eval = *it; in rewriteIfGotos() local
506 if (eval.isA<parser::EntryStmt>()) { in rewriteIfGotos()
513 const Fortran::lower::pft::Evaluation &targetEval = *firstStmt(&eval); in rewriteIfGotos()
553 if (eval.isA<parser::IfConstruct>() && eval.evaluationList->size() == 3) { in rewriteIfGotos()
554 const auto bodyEval = std::next(eval.evaluationList->begin()); in rewriteIfGotos()
572 void analyzeIoBranches(lower::pft::Evaluation &eval, const A &stmt) { in analyzeIoBranches() argument
577 eval.isUnstructured = true; in analyzeIoBranches()
592 markBranchTarget(eval, label.v); in analyzeIoBranches()
624 void setConstructExit(lower::pft::Evaluation &eval) { in setConstructExit() argument
625 eval.constructExit = &eval.evaluationList->back().nonNopSuccessor(); in setConstructExit()
648 for (lower::pft::Evaluation *eval = &targetEvaluation; eval; in markBranchTarget() local
649 eval = eval->parentConstruct) { in markBranchTarget()
650 eval->isUnstructured = true; in markBranchTarget()
655 if (eval->constructExit && (eval->isA<parser::DoConstruct>() || in markBranchTarget()
656 eval->isA<parser::IfConstruct>())) in markBranchTarget()
657 eval->constructExit->isNewBlock = true; in markBranchTarget()
671 void markSuccessorAsNewBlock(lower::pft::Evaluation &eval) { in markSuccessorAsNewBlock() argument
672 eval.nonNopSuccessor().isNewBlock = true; in markSuccessorAsNewBlock()
727 for (auto &eval : evaluationList) { in analyzeBranches() local
728 eval.visit(common::visitors{ in analyzeBranches()
738 markBranchTarget(eval, altReturn->v); in analyzeBranches()
747 markBranchTarget(eval, construct->evaluationList->back()); in analyzeBranches()
755 markBranchTarget(eval, *construct->constructExit); in analyzeBranches()
758 eval.isUnstructured = true; in analyzeBranches()
759 if (eval.lexicalSuccessor->lexicalSuccessor) in analyzeBranches()
760 markSuccessorAsNewBlock(eval); in analyzeBranches()
762 [&](const parser::GotoStmt &s) { markBranchTarget(eval, s.v); }, in analyzeBranches()
764 eval.lexicalSuccessor->isNewBlock = true; in analyzeBranches()
765 lastConstructStmtEvaluation = &eval; in analyzeBranches()
768 eval.isUnstructured = true; in analyzeBranches()
769 if (eval.lexicalSuccessor->lexicalSuccessor) in analyzeBranches()
770 markSuccessorAsNewBlock(eval); in analyzeBranches()
773 eval.isUnstructured = true; in analyzeBranches()
774 if (eval.lexicalSuccessor->lexicalSuccessor) in analyzeBranches()
775 markSuccessorAsNewBlock(eval); in analyzeBranches()
779 markBranchTarget(eval, label); in analyzeBranches()
782 markBranchTarget(eval, std::get<1>(s.t)); in analyzeBranches()
783 markBranchTarget(eval, std::get<2>(s.t)); in analyzeBranches()
784 markBranchTarget(eval, std::get<3>(s.t)); in analyzeBranches()
808 eval.isUnstructured = true; in analyzeBranches()
809 markSuccessorAsNewBlock(eval); in analyzeBranches()
814 eval.lexicalSuccessor->isNewBlock = true; in analyzeBranches()
826 lastConstructStmtEvaluation = &eval; in analyzeBranches()
829 eval.isNewBlock = true; in analyzeBranches()
830 lastConstructStmtEvaluation->controlSuccessor = &eval; in analyzeBranches()
831 lastConstructStmtEvaluation = &eval; in analyzeBranches()
834 eval.nonNopSuccessor().isNewBlock = true; in analyzeBranches()
849 eval.isUnstructured = true; // infinite loop in analyzeBranches()
852 eval.nonNopSuccessor().isNewBlock = true; in analyzeBranches()
853 eval.controlSuccessor = &evaluationList.back(); in analyzeBranches()
858 eval.isUnstructured = true; // real-valued loop control in analyzeBranches()
861 eval.isUnstructured = true; // while loop in analyzeBranches()
866 eval.controlSuccessor = &doEval; in analyzeBranches()
884 eval.isNewBlock |= in analyzeBranches()
891 eval.lexicalSuccessor->isNewBlock = true; in analyzeBranches()
892 lastConstructStmtEvaluation = &eval; in analyzeBranches()
895 eval.isNewBlock = true; in analyzeBranches()
896 eval.lexicalSuccessor->isNewBlock = true; in analyzeBranches()
897 lastConstructStmtEvaluation->controlSuccessor = &eval; in analyzeBranches()
898 lastConstructStmtEvaluation = &eval; in analyzeBranches()
901 eval.isNewBlock = true; in analyzeBranches()
902 lastConstructStmtEvaluation->controlSuccessor = &eval; in analyzeBranches()
917 [&](const parser::SelectRankCaseStmt &) { eval.isNewBlock = true; }, in analyzeBranches()
921 [&](const parser::TypeGuardStmt &) { eval.isNewBlock = true; }, in analyzeBranches()
924 [&](const parser::AssociateConstruct &) { setConstructExit(eval); }, in analyzeBranches()
927 eval.constructExit = &eval.evaluationList->back(); in analyzeBranches()
930 setConstructExit(eval); in analyzeBranches()
931 eval.isUnstructured = true; in analyzeBranches()
935 eval.constructExit = &eval.evaluationList->back(); in analyzeBranches()
939 eval.constructExit = &eval.evaluationList->back(); in analyzeBranches()
941 [&](const parser::DoConstruct &) { setConstructExit(eval); }, in analyzeBranches()
942 [&](const parser::ForallConstruct &) { setConstructExit(eval); }, in analyzeBranches()
943 [&](const parser::IfConstruct &) { setConstructExit(eval); }, in analyzeBranches()
945 setConstructExit(eval); in analyzeBranches()
946 eval.isUnstructured = true; in analyzeBranches()
949 setConstructExit(eval); in analyzeBranches()
950 eval.isUnstructured = true; in analyzeBranches()
952 [&](const parser::WhereConstruct &) { setConstructExit(eval); }, in analyzeBranches()
963 analyzeIoBranches(eval, stmt); in analyzeBranches()
968 if (eval.evaluationList) in analyzeBranches()
969 analyzeBranches(&eval, *eval.evaluationList); in analyzeBranches()
972 if (!eval.controlSuccessor && eval.lexicalSuccessor && in analyzeBranches()
973 eval.lexicalSuccessor->isIntermediateConstructStmt()) { in analyzeBranches()
974 eval.controlSuccessor = parentConstruct->constructExit; in analyzeBranches()
975 eval.lexicalSuccessor->isNewBlock = true; in analyzeBranches()
979 if (parentConstruct && eval.isUnstructured) in analyzeBranches()
983 if (eval.controlSuccessor && eval.isActionStmt() && in analyzeBranches()
984 eval.lowerAsUnstructured()) in analyzeBranches()
985 markSuccessorAsNewBlock(eval); in analyzeBranches()
1064 llvm::StringRef evaluationName(const lower::pft::Evaluation &eval) { in evaluationName() argument
1065 return eval.visit([](const auto &parseTreeNode) { in evaluationName()
1071 const lower::pft::Evaluation &eval, in dumpEvaluation() argument
1073 llvm::StringRef name = evaluationName(eval); in dumpEvaluation()
1074 llvm::StringRef newBlock = eval.isNewBlock ? "^" : ""; in dumpEvaluation()
1075 llvm::StringRef bang = eval.isUnstructured ? "!" : ""; in dumpEvaluation()
1077 if (eval.printIndex) in dumpEvaluation()
1078 outputStream << eval.printIndex << ' '; in dumpEvaluation()
1079 if (eval.hasNestedEvaluations()) in dumpEvaluation()
1083 if (eval.negateCondition) in dumpEvaluation()
1085 if (eval.constructExit) in dumpEvaluation()
1086 outputStream << " -> " << eval.constructExit->printIndex; in dumpEvaluation()
1087 else if (eval.controlSuccessor) in dumpEvaluation()
1088 outputStream << " -> " << eval.controlSuccessor->printIndex; in dumpEvaluation()
1089 else if (eval.isA<parser::EntryStmt>() && eval.lexicalSuccessor) in dumpEvaluation()
1090 outputStream << " -> " << eval.lexicalSuccessor->printIndex; in dumpEvaluation()
1091 if (!eval.position.empty()) in dumpEvaluation()
1092 outputStream << ": " << eval.position.ToString(); in dumpEvaluation()
1093 else if (auto *dir = eval.getIf<Fortran::parser::CompilerDirective>()) in dumpEvaluation()
1096 if (eval.hasNestedEvaluations()) { in dumpEvaluation()
1097 dumpEvaluationList(outputStream, *eval.evaluationList, indent + 1); in dumpEvaluation()
1103 const lower::pft::Evaluation &eval) { in dumpEvaluation() argument
1104 dumpEvaluation(ostream, eval, ""); in dumpEvaluation()
1112 for (const lower::pft::Evaluation &eval : evaluationList) in dumpEvaluationList() local
1113 dumpEvaluation(outputStream, eval, indentString, indent); in dumpEvaluationList()
1866 const Fortran::lower::pft::Evaluation &eval, in visitAllSymbols() argument
1869 eval.visit([&](const auto &functionParserNode) { in visitAllSymbols()