@@ -60,10 +60,13 @@ class CanonicalizeBorrowScope {
60
60
// The borrow that begins this scope.
61
61
BorrowedValue borrowedValue;
62
62
63
+ // / The function containing this scope.
64
+ SILFunction *function;
65
+
63
66
// / Pruned liveness for the extended live range including copies. For this
64
67
// / purpose, only consuming instructions are considered "lifetime
65
68
// / ending". end_borrows do not end a liverange that may include owned copies.
66
- SSAPrunedLiveness liveness;
69
+ BitfieldRef< SSAPrunedLiveness> liveness;
67
70
68
71
InstructionDeleter &deleter;
69
72
@@ -86,11 +89,11 @@ class CanonicalizeBorrowScope {
86
89
87
90
public:
88
91
CanonicalizeBorrowScope (SILFunction *function, InstructionDeleter &deleter)
89
- : liveness (function), deleter(deleter) {}
92
+ : function (function), deleter(deleter) {}
90
93
91
94
BorrowedValue getBorrowedValue () const { return borrowedValue; }
92
95
93
- const SSAPrunedLiveness &getLiveness () const { return liveness; }
96
+ const SSAPrunedLiveness &getLiveness () const { return * liveness; }
94
97
95
98
InstructionDeleter &getDeleter () { return deleter; }
96
99
@@ -136,11 +139,13 @@ class CanonicalizeBorrowScope {
136
139
137
140
protected:
138
141
void initBorrow (BorrowedValue borrow) {
139
- assert (borrow && liveness.empty () && persistentCopies.empty ());
142
+ assert (borrow && persistentCopies.empty () &&
143
+ (!liveness || liveness->empty ()));
140
144
141
145
updatedCopies.clear ();
142
146
borrowedValue = borrow;
143
- liveness.initializeDef (borrowedValue.value );
147
+ if (liveness)
148
+ liveness->initializeDef (borrowedValue.value );
144
149
}
145
150
146
151
bool computeBorrowLiveness ();
0 commit comments