[flang-commits] [flang] ad980b5 - [flang] Fix controlSuccessor chain for select rank construct

Valentin Clement via flang-commits flang-commits at lists.llvm.org
Sun Nov 6 01:56:56 PDT 2022


Author: Valentin Clement
Date: 2022-11-06T09:56:46+01:00
New Revision: ad980b570217b6906e08c7cfbc67f5ee0ec35714

URL: https://github.com/llvm/llvm-project/commit/ad980b570217b6906e08c7cfbc67f5ee0ec35714
DIFF: https://github.com/llvm/llvm-project/commit/ad980b570217b6906e08c7cfbc67f5ee0ec35714.diff

LOG: [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

Added: 
    

Modified: 
    flang/lib/Lower/PFTBuilder.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Lower/PFTBuilder.cpp b/flang/lib/Lower/PFTBuilder.cpp
index 8f87e96c986ca..19b2512dc9224 100644
--- a/flang/lib/Lower/PFTBuilder.cpp
+++ b/flang/lib/Lower/PFTBuilder.cpp
@@ -900,8 +900,13 @@ class PFTBuilder {
           },
           [&](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;


        


More information about the flang-commits mailing list