From: Valentin Clement Date: Sun, 6 Nov 2022 08:56:19 +0000 (+0100) Subject: [flang] Fix controlSuccessor chain for select rank construct X-Git-Tag: upstream/17.0.6~28413 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ad980b570217b6906e08c7cfbc67f5ee0ec35714;p=platform%2Fupstream%2Fllvm.git [flang] Fix controlSuccessor chain for select rank construct Represent the select rank statement + select rank case statement the same way the select case statement and case statement are represented. controlSuccessor was not correctly attributed to the next type guard stmt. Similar to D137460 for select type construct. Reviewed By: vdonaldson Differential Revision: https://reviews.llvm.org/D137490 --- diff --git a/flang/lib/Lower/PFTBuilder.cpp b/flang/lib/Lower/PFTBuilder.cpp index 8f87e96..19b2512 100644 --- a/flang/lib/Lower/PFTBuilder.cpp +++ b/flang/lib/Lower/PFTBuilder.cpp @@ -900,8 +900,13 @@ private: }, [&](const parser::SelectRankStmt &s) { insertConstructName(s, parentConstruct); + lastConstructStmtEvaluation = &eval; + }, + [&](const parser::SelectRankCaseStmt &) { + eval.isNewBlock = true; + lastConstructStmtEvaluation->controlSuccessor = &eval; + lastConstructStmtEvaluation = &eval; }, - [&](const parser::SelectRankCaseStmt &) { eval.isNewBlock = true; }, [&](const parser::SelectTypeStmt &s) { insertConstructName(s, parentConstruct); lastConstructStmtEvaluation = &eval;