@@ -488,8 +488,8 @@ class PrunedLiveness {
488488 return liveBlocks.empty ();
489489 }
490490
491- void clear () {
492- liveBlocks.clear ();
491+ void invalidate () {
492+ liveBlocks.invalidate ();
493493 users.clear ();
494494 }
495495
@@ -752,10 +752,10 @@ class SSAPrunedLiveness : public PrunedLiveRange<SSAPrunedLiveness> {
752752
753753 SILValue getDef () const { return def; }
754754
755- void clear () {
755+ void invalidate () {
756756 def = SILValue ();
757757 defInst = nullptr ;
758- PrunedLiveRange::clear ();
758+ PrunedLiveRange::invalidate ();
759759 }
760760
761761 void initializeDef (SILValue def) {
@@ -820,8 +820,10 @@ class MultiDefPrunedLiveness : public PrunedLiveRange<MultiDefPrunedLiveness> {
820820 : PrunedLiveRange(function, discoveredBlocks), defs(function),
821821 defBlocks (function) {}
822822
823- void clear () {
824- llvm_unreachable (" multi-def liveness cannot be reused" );
823+ void invalidate () {
824+ defs.invalidate ();
825+ defBlocks.invalidate ();
826+ PrunedLiveRange::invalidate ();
825827 }
826828
827829 void initializeDef (SILInstruction *defInst) {
@@ -895,8 +897,8 @@ class DiagnosticPrunedLiveness : public SSAPrunedLiveness {
895897 : SSAPrunedLiveness(function, discoveredBlocks),
896898 nonLifetimeEndingUsesInLiveOut (nonLifetimeEndingUsesInLiveOut) {}
897899
898- void clear () {
899- SSAPrunedLiveness::clear ();
900+ void invalidate () {
901+ SSAPrunedLiveness::invalidate ();
900902 if (nonLifetimeEndingUsesInLiveOut)
901903 nonLifetimeEndingUsesInLiveOut->clear ();
902904 }
0 commit comments