Skip to content

Commit 775754e

Browse files
committed
Revert "[flang][hlfir] Fixed assignment/finalization order for user-defined assignments. (#66736)"
This reverts commit a9a1f84.
1 parent a041572 commit 775754e

File tree

2 files changed

+1
-299
lines changed

2 files changed

+1
-299
lines changed

flang/lib/Optimizer/HLFIR/Transforms/LowerHLFIROrderedAssignments.cpp

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,22 +1112,7 @@ void OrderedAssignmentRewriter::generateSaveEntity(
11121112
assert(inserted.second && "entity must have been emplaced");
11131113
(void)inserted;
11141114
} else {
1115-
if (constructStack.empty() &&
1116-
mlir::isa<hlfir::RegionAssignOp>(region.getParentOp())) {
1117-
// Here the clean-up code is inserted after the original
1118-
// RegionAssignOp, so that the assignment code happens
1119-
// before the cleanup. We do this only for standalone
1120-
// operations, because the clean-up is handled specially
1121-
// during lowering of the parent constructs if any
1122-
// (e.g. see generateNoneElementalCleanupIfAny for
1123-
// WhereOp).
1124-
auto insertionPoint = builder.saveInsertionPoint();
1125-
builder.setInsertionPointAfter(region.getParentOp());
1126-
generateCleanupIfAny(oldYield);
1127-
builder.restoreInsertionPoint(insertionPoint);
1128-
} else {
1129-
generateCleanupIfAny(oldYield);
1130-
}
1115+
generateCleanupIfAny(oldYield);
11311116
}
11321117
}
11331118

0 commit comments

Comments
 (0)