Lines Matching defs:eval
401 lower::pft::Evaluation &eval = addEvaluation(
403 eval.evaluationList.reset(new lower::pft::EvaluationList);
404 pushEvaluationList(eval.evaluationList.get());
405 pftParentStack.emplace_back(eval);
406 constructAndDirectiveStack.emplace_back(&eval);
411 auto isOpenMPLoopConstruct = [](lower::pft::Evaluation *eval) {
412 if (const auto *ompConstruct = eval->getIf<parser::OpenMPConstruct>())
420 auto *eval = constructAndDirectiveStack.back();
421 if (eval->isExecutableDirective() && !isOpenMPLoopConstruct(eval)) {
426 lower::pft::EvaluationList &evaluationList = *eval->evaluationList;
486 lower::pft::Evaluation &addEvaluation(lower::pft::Evaluation &&eval) {
489 eval.parentConstruct = constructAndDirectiveStack.back();
490 lower::pft::FunctionLikeUnit *owningProcedure = eval.getOwningProcedure();
491 evaluationListStack.back()->emplace_back(std::move(eval));
592 auto &eval = *it;
593 if (eval.isA<parser::EntryStmt>() || eval.isIntermediateConstructStmt()) {
600 const Fortran::lower::pft::Evaluation &targetEval = *firstStmt(&eval);
640 if (eval.isA<parser::IfConstruct>() && eval.evaluationList->size() == 3) {
641 const auto bodyEval = std::next(eval.evaluationList->begin());
660 void analyzeIoBranches(lower::pft::Evaluation &eval, const A &stmt) {
665 eval.isUnstructured = true;
680 markBranchTarget(eval, label.v);
712 void setConstructExit(lower::pft::Evaluation &eval) {
713 eval.constructExit = &eval.evaluationList->back().nonNopSuccessor();
736 for (lower::pft::Evaluation *eval = &targetEvaluation; eval;
737 eval = eval->parentConstruct) {
738 eval->isUnstructured = true;
743 if (eval->constructExit && (eval->isA<parser::DoConstruct>() ||
744 eval->isA<parser::IfConstruct>()))
745 eval->constructExit->isNewBlock = true;
759 void markSuccessorAsNewBlock(lower::pft::Evaluation &eval) {
760 eval.nonNopSuccessor().isNewBlock = true;
815 for (auto &eval : evaluationList) {
816 eval.visit(common::visitors{
826 markBranchTarget(eval, altReturn->v);
835 markBranchTarget(eval, construct->evaluationList->back());
843 markBranchTarget(eval, *construct->constructExit);
846 eval.isUnstructured = true;
847 if (eval.lexicalSuccessor->lexicalSuccessor)
848 markSuccessorAsNewBlock(eval);
850 [&](const parser::GotoStmt &s) { markBranchTarget(eval, s.v); },
852 eval.lexicalSuccessor->isNewBlock = true;
853 lastConstructStmtEvaluation = &eval;
856 eval.isUnstructured = true;
857 if (eval.lexicalSuccessor->lexicalSuccessor)
858 markSuccessorAsNewBlock(eval);
861 eval.isUnstructured = true;
862 if (eval.lexicalSuccessor->lexicalSuccessor)
863 markSuccessorAsNewBlock(eval);
867 markBranchTarget(eval, label);
870 markBranchTarget(eval, std::get<1>(s.t));
871 markBranchTarget(eval, std::get<2>(s.t));
872 markBranchTarget(eval, std::get<3>(s.t));
896 eval.isUnstructured = true;
897 markSuccessorAsNewBlock(eval);
902 eval.lexicalSuccessor->isNewBlock = true;
914 lastConstructStmtEvaluation = &eval;
917 eval.isNewBlock = true;
918 lastConstructStmtEvaluation->controlSuccessor = &eval;
919 lastConstructStmtEvaluation = &eval;
922 eval.isNewBlock = true;
937 eval.isUnstructured = true; // infinite loop
940 eval.nonNopSuccessor().isNewBlock = true;
941 eval.controlSuccessor = &evaluationList.back();
946 eval.isUnstructured = true; // real-valued loop control
949 eval.isUnstructured = true; // while loop
954 eval.controlSuccessor = &doEval;
972 eval.isNewBlock |=
979 eval.lexicalSuccessor->isNewBlock = true;
980 lastConstructStmtEvaluation = &eval;
983 eval.isNewBlock = true;
984 eval.lexicalSuccessor->isNewBlock = true;
985 lastConstructStmtEvaluation->controlSuccessor = &eval;
986 lastConstructStmtEvaluation = &eval;
989 eval.isNewBlock = true;
990 lastConstructStmtEvaluation->controlSuccessor = &eval;
1004 lastConstructStmtEvaluation = &eval;
1007 eval.isNewBlock = true;
1008 lastConstructStmtEvaluation->controlSuccessor = &eval;
1009 lastConstructStmtEvaluation = &eval;
1013 lastConstructStmtEvaluation = &eval;
1016 eval.isNewBlock = true;
1017 lastConstructStmtEvaluation->controlSuccessor = &eval;
1018 lastConstructStmtEvaluation = &eval;
1023 eval.constructExit = &eval.evaluationList->back();
1026 eval.constructExit = &eval.evaluationList->back();
1029 eval.constructExit = &eval.evaluationList->back();
1030 eval.isUnstructured = true;
1033 eval.constructExit = &eval.evaluationList->back();
1036 eval.constructExit = &eval.evaluationList->back();
1038 [&](const parser::DoConstruct &) { setConstructExit(eval); },
1039 [&](const parser::ForallConstruct &) { setConstructExit(eval); },
1040 [&](const parser::IfConstruct &) { setConstructExit(eval); },
1042 eval.constructExit = &eval.evaluationList->back();
1043 eval.isUnstructured = true;
1046 eval.constructExit = &eval.evaluationList->back();
1047 eval.isUnstructured = true;
1049 [&](const parser::WhereConstruct &) { setConstructExit(eval); },
1060 analyzeIoBranches(eval, stmt);
1065 if (eval.evaluationList)
1066 analyzeBranches(&eval, *eval.evaluationList);
1069 if (parentConstruct && eval.isUnstructured)
1073 if (eval.controlSuccessor && eval.isActionStmt() &&
1074 eval.lowerAsUnstructured())
1075 markSuccessorAsNewBlock(eval);
1202 llvm::StringRef evaluationName(const lower::pft::Evaluation &eval) {
1203 return eval.visit([](const auto &parseTreeNode) {
1209 const lower::pft::Evaluation &eval,
1211 llvm::StringRef name = evaluationName(eval);
1212 llvm::StringRef newBlock = eval.isNewBlock ? "^" : "";
1213 llvm::StringRef bang = eval.isUnstructured ? "!" : "";
1215 if (eval.printIndex)
1216 outputStream << eval.printIndex << ' ';
1217 if (eval.hasNestedEvaluations())
1221 if (eval.negateCondition)
1223 if (eval.constructExit)
1224 outputStream << " -> " << eval.constructExit->printIndex;
1225 else if (eval.controlSuccessor)
1226 outputStream << " -> " << eval.controlSuccessor->printIndex;
1227 else if (eval.isA<parser::EntryStmt>() && eval.lexicalSuccessor)
1228 outputStream << " -> " << eval.lexicalSuccessor->printIndex;
1230 if (!eval.position.empty())
1231 outputStream << ": " << eval.position.ToString();
1232 else if (auto *dir = eval.getIf<parser::CompilerDirective>()) {
1238 if (eval.hasNestedEvaluations()) {
1239 dumpEvaluationList(outputStream, *eval.evaluationList, indent + 1);
1245 const lower::pft::Evaluation &eval) {
1246 dumpEvaluation(ostream, eval, "");
1254 for (const lower::pft::Evaluation &eval : evaluationList)
1255 dumpEvaluation(outputStream, eval, indentString, indent);
2085 const Fortran::lower::pft::Evaluation &eval,
2088 eval.visit([&](const auto &functionParserNode) {