Skip to content

Commit 4b2da0a

Browse files
committed
[AliasAnalysis] Remove the default argument from getMemoryBehavior.
ObserveRetains is not an obvious default and it does not make sense to have it as a default argument.
1 parent c1dce5c commit 4b2da0a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Diff for: include/swift/SILAnalysis/AliasAnalysis.h

+5-4
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ class AliasAnalysis : public SILAnalysis {
111111
/// TODO: When ref count behavior is separated from generic memory behavior,
112112
/// the IgnoreRefCountIncrements flag will be unnecessary.
113113
MemoryBehavior getMemoryBehavior(SILInstruction *Inst, SILValue V,
114-
RetainObserveKind =
115-
RetainObserveKind::ObserveRetains);
114+
RetainObserveKind);
116115

117116
/// Returns true if Inst may read from memory in a manner that affects V.
118117
bool mayReadFromMemory(SILInstruction *Inst, SILValue V) {
@@ -141,7 +140,8 @@ class AliasAnalysis : public SILAnalysis {
141140

142141
/// Returns true if Inst may have side effects in a manner that affects V.
143142
bool mayHaveSideEffects(SILInstruction *Inst, SILValue V) {
144-
MemoryBehavior B = getMemoryBehavior(Inst, V);
143+
MemoryBehavior B = getMemoryBehavior(Inst, V,
144+
RetainObserveKind::ObserveRetains);
145145
return B == MemoryBehavior::MayWrite ||
146146
B == MemoryBehavior::MayReadWrite ||
147147
B == MemoryBehavior::MayHaveSideEffects;
@@ -151,7 +151,8 @@ class AliasAnalysis : public SILAnalysis {
151151
/// V. This is independent of whether or not Inst may write to V and is meant
152152
/// to encode notions such as ref count modifications.
153153
bool mayHavePureSideEffects(SILInstruction *Inst, SILValue V) {
154-
return getMemoryBehavior(Inst, V) == MemoryBehavior::MayHaveSideEffects;
154+
return getMemoryBehavior(Inst, V, RetainObserveKind::ObserveRetains) ==
155+
MemoryBehavior::MayHaveSideEffects;
155156
}
156157

157158
virtual void invalidate(SILAnalysis::InvalidationKind K) { AliasCache.clear(); }

0 commit comments

Comments
 (0)