[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
This commit is contained in:
Valentin Clement 2022-11-06 09:56:19 +01:00
parent bb635672b9
commit ad980b5702
No known key found for this signature in database
GPG Key ID: 086D54783C928776
1 changed files with 6 additions and 1 deletions

View File

@ -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;