File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
lib/SILOptimizer/Mandatory Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -899,10 +899,16 @@ static SILValue tryRewriteToPartialApplyStack(
899
899
900
900
OrigUnmodifiedDuringClosureLifetimeWalker origUseWalker (
901
901
closureLiveness, origIsUnmodifiedDuringClosureLifetime);
902
- auto walkResult = std::move(origUseWalker).walk(orig);
903
-
904
- if (walkResult == AddressUseKind::Unknown ||
905
- !origIsUnmodifiedDuringClosureLifetime) {
902
+ switch (origUseWalker.walk(orig)) {
903
+ case AddressUseKind::NonEscaping:
904
+ case AddressUseKind::Dependent:
905
+ // Dependent uses are ignored because they cannot modify the original.
906
+ break ;
907
+ case AddressUseKind::PointerEscape:
908
+ case AddressUseKind::Unknown:
909
+ continue ;
910
+ }
911
+ if (!origIsUnmodifiedDuringClosureLifetime) {
906
912
continue ;
907
913
}
908
914
You can’t perform that action at this time.
0 commit comments