@@ -111,8 +111,7 @@ class AliasAnalysis : public SILAnalysis {
111
111
// / TODO: When ref count behavior is separated from generic memory behavior,
112
112
// / the IgnoreRefCountIncrements flag will be unnecessary.
113
113
MemoryBehavior getMemoryBehavior (SILInstruction *Inst, SILValue V,
114
- RetainObserveKind =
115
- RetainObserveKind::ObserveRetains);
114
+ RetainObserveKind);
116
115
117
116
// / Returns true if Inst may read from memory in a manner that affects V.
118
117
bool mayReadFromMemory (SILInstruction *Inst, SILValue V) {
@@ -141,7 +140,8 @@ class AliasAnalysis : public SILAnalysis {
141
140
142
141
// / Returns true if Inst may have side effects in a manner that affects V.
143
142
bool mayHaveSideEffects (SILInstruction *Inst, SILValue V) {
144
- MemoryBehavior B = getMemoryBehavior (Inst, V);
143
+ MemoryBehavior B = getMemoryBehavior (Inst, V,
144
+ RetainObserveKind::ObserveRetains);
145
145
return B == MemoryBehavior::MayWrite ||
146
146
B == MemoryBehavior::MayReadWrite ||
147
147
B == MemoryBehavior::MayHaveSideEffects;
@@ -151,7 +151,8 @@ class AliasAnalysis : public SILAnalysis {
151
151
// / V. This is independent of whether or not Inst may write to V and is meant
152
152
// / to encode notions such as ref count modifications.
153
153
bool mayHavePureSideEffects (SILInstruction *Inst, SILValue V) {
154
- return getMemoryBehavior (Inst, V) == MemoryBehavior::MayHaveSideEffects;
154
+ return getMemoryBehavior (Inst, V, RetainObserveKind::ObserveRetains) ==
155
+ MemoryBehavior::MayHaveSideEffects;
155
156
}
156
157
157
158
virtual void invalidate (SILAnalysis::InvalidationKind K) { AliasCache.clear (); }
0 commit comments