Skip to content

Commit

Permalink
Review update
Browse files Browse the repository at this point in the history
  • Loading branch information
vdonaldson committed May 20, 2020
1 parent 787f290 commit 72b6b1d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions flang/lib/Lower/Bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1666,21 +1666,25 @@ class FirConverter : public Fortran::lower::AbstractConverter {
setCurrentPosition(eval.position);
if (unstructuredContext) {
// When transitioning from unstructured to structured code,
// the structured code might be a target that starts a new block.
// the structured code could be a target that starts a new block.
maybeStartBlock(eval.isConstruct() && eval.lowerAsStructured()
? eval.evaluationList->front().block
: eval.block);
}

eval.visit([&](const auto &stmt) { genFIR(eval, stmt); });

if (unstructuredContext && blockIsUnterminated()) {
// Exit from an unstructured IF or SELECT construct block.
Fortran::lower::pft::Evaluation *successor{};
if (eval.isActionStmt())
if (eval.isActionStmt()) {
successor = eval.controlSuccessor;
else if (eval.isConstruct() &&
eval.evaluationList->back()
} else if (eval.isConstruct()) {
assert(!eval.evaluationList->empty() && "empty construct eval list");
if (eval.evaluationList->back()
.lexicalSuccessor->isIntermediateConstructStmt())
successor = eval.constructExit;
successor = eval.constructExit;
}
if (successor && successor->block)
genBranch(successor->block);
}
Expand Down

0 comments on commit 72b6b1d

Please sign in to comment.