Skip to content

Commit ad980b5

Browse files
committed
[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
1 parent bb63567 commit ad980b5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

flang/lib/Lower/PFTBuilder.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -900,8 +900,13 @@ class PFTBuilder {
900900
},
901901
[&](const parser::SelectRankStmt &s) {
902902
insertConstructName(s, parentConstruct);
903+
lastConstructStmtEvaluation = &eval;
904+
},
905+
[&](const parser::SelectRankCaseStmt &) {
906+
eval.isNewBlock = true;
907+
lastConstructStmtEvaluation->controlSuccessor = &eval;
908+
lastConstructStmtEvaluation = &eval;
903909
},
904-
[&](const parser::SelectRankCaseStmt &) { eval.isNewBlock = true; },
905910
[&](const parser::SelectTypeStmt &s) {
906911
insertConstructName(s, parentConstruct);
907912
lastConstructStmtEvaluation = &eval;

0 commit comments

Comments
 (0)