File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
include/swift/SILOptimizer/Utils Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -396,6 +396,13 @@ class CanonicalizeOSSALifetime final {
396
396
UserRange getUsers () const { return liveness->getAllUsers (); }
397
397
398
398
private:
399
+ bool respectsDeinitBarriers () const {
400
+ if (!currentDef->isLexical ())
401
+ return false ;
402
+ auto &module = currentDef->getFunction ()->getModule ();
403
+ return module .getASTContext ().SILOpts .supportsLexicalLifetimes (module );
404
+ }
405
+
399
406
void recordDebugValue (DebugValueInst *dvi) { debugValues.insert (dvi); }
400
407
401
408
void recordConsumingUse (Operand *use) {
Original file line number Diff line number Diff line change @@ -1124,7 +1124,7 @@ bool CanonicalizeOSSALifetime::computeLiveness() {
1124
1124
clear ();
1125
1125
return false ;
1126
1126
}
1127
- if (currentDef-> isLexical ()) {
1127
+ if (respectsDeinitBarriers ()) {
1128
1128
extendLivenessToDeinitBarriers ();
1129
1129
}
1130
1130
if (accessBlockAnalysis) {
You can’t perform that action at this time.
0 commit comments