Skip to content

Commit

Permalink
Revert "[flang][hlfir] Fixed assignment/finalization order for user-d…
Browse files Browse the repository at this point in the history
…efined assignments. (llvm#66736)"

This reverts commit a9a1f84.
  • Loading branch information
vzakhari committed Sep 19, 2023
1 parent a041572 commit 775754e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 299 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1112,22 +1112,7 @@ void OrderedAssignmentRewriter::generateSaveEntity(
assert(inserted.second && "entity must have been emplaced");
(void)inserted;
} else {
if (constructStack.empty() &&
mlir::isa<hlfir::RegionAssignOp>(region.getParentOp())) {
// Here the clean-up code is inserted after the original
// RegionAssignOp, so that the assignment code happens
// before the cleanup. We do this only for standalone
// operations, because the clean-up is handled specially
// during lowering of the parent constructs if any
// (e.g. see generateNoneElementalCleanupIfAny for
// WhereOp).
auto insertionPoint = builder.saveInsertionPoint();
builder.setInsertionPointAfter(region.getParentOp());
generateCleanupIfAny(oldYield);
builder.restoreInsertionPoint(insertionPoint);
} else {
generateCleanupIfAny(oldYield);
}
generateCleanupIfAny(oldYield);
}
}

Expand Down
Loading

0 comments on commit 775754e

Please sign in to comment.