Skip to content

Commit 4083cbb

Browse files
authored
Merge pull request swiftlang#35261 from atrick/comment-maywrite
2 parents 409ad6e + 08e0988 commit 4083cbb

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

include/swift/SIL/SILInstruction.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,8 @@ class SILInstruction
620620
/// that are not visible by merely examining their uses.
621621
bool mayHaveSideEffects() const;
622622

623-
/// Returns true if the instruction may write to memory.
623+
/// Returns true if the instruction may write to memory, deinitialize memory,
624+
/// or have other unknown side effects.
624625
bool mayWriteToMemory() const {
625626
MemoryBehavior B = getMemoryBehavior();
626627
return B == MemoryBehavior::MayWrite ||
@@ -636,7 +637,8 @@ class SILInstruction
636637
B == MemoryBehavior::MayHaveSideEffects;
637638
}
638639

639-
/// Returns true if the instruction may read from or write to memory.
640+
/// Returns true if the instruction may read from memory, write to memory,
641+
/// deinitialize memory, or have other unknown side effects.
640642
bool mayReadOrWriteMemory() const {
641643
return getMemoryBehavior() != MemoryBehavior::None;
642644
}

include/swift/SILOptimizer/Analysis/AliasAnalysis.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,17 +224,17 @@ class AliasAnalysis : public SILAnalysis {
224224
B == MemoryBehavior::MayHaveSideEffects;
225225
}
226226

227-
/// Returns true if \p Inst may write to memory in a manner that
228-
/// affects V.
227+
/// Returns true if \p Inst may write to memory, deinitialize memory, or have
228+
/// other side effects that may affect V.
229229
bool mayWriteToMemory(SILInstruction *Inst, SILValue V) {
230230
auto B = computeMemoryBehavior(Inst, V);
231231
return B == MemoryBehavior::MayWrite ||
232232
B == MemoryBehavior::MayReadWrite ||
233233
B == MemoryBehavior::MayHaveSideEffects;
234234
}
235235

236-
/// Returns true if \p Inst may read or write to memory in a manner that
237-
/// affects V.
236+
/// Returns true if \p Inst may read to memory, write to memory, deinitialize
237+
/// memory, or have other side effects that may affect V.
238238
bool mayReadOrWriteMemory(SILInstruction *Inst, SILValue V) {
239239
auto B = computeMemoryBehavior(Inst, V);
240240
return MemoryBehavior::None != B;

0 commit comments

Comments
 (0)