@@ -215,26 +215,31 @@ class AliasAnalysis : public SILAnalysis {
215
215
// / respect to V.
216
216
MemoryBehavior computeMemoryBehaviorInner (SILInstruction *Inst, SILValue V);
217
217
218
- // / Returns true if \p Inst may read from memory in a manner that
219
- // / affects V.
218
+ // / Returns true if \p Inst may read from memory at address \p V.
219
+ // /
220
+ // / For details see SILInstruction::MemoryBehavior::MayRead.
220
221
bool mayReadFromMemory (SILInstruction *Inst, SILValue V) {
221
222
auto B = computeMemoryBehavior (Inst, V);
222
223
return B == MemoryBehavior::MayRead ||
223
224
B == MemoryBehavior::MayReadWrite ||
224
225
B == MemoryBehavior::MayHaveSideEffects;
225
226
}
226
227
227
- // / Returns true if \p Inst may write to memory, deinitialize memory, or have
228
- // / other side effects that may affect V.
228
+ // / Returns true if \p Inst may write to memory or deinitialize memory at
229
+ // / address \p V.
230
+ // /
231
+ // / For details see SILInstruction::MemoryBehavior::MayWrite.
229
232
bool mayWriteToMemory (SILInstruction *Inst, SILValue V) {
230
233
auto B = computeMemoryBehavior (Inst, V);
231
234
return B == MemoryBehavior::MayWrite ||
232
235
B == MemoryBehavior::MayReadWrite ||
233
236
B == MemoryBehavior::MayHaveSideEffects;
234
237
}
235
238
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.
239
+ // / Returns true if \p Inst may read from memory, write to memory or
240
+ // / deinitialize memory at address \p V.
241
+ // /
242
+ // / For details see SILInstruction::MemoryBehavior.
238
243
bool mayReadOrWriteMemory (SILInstruction *Inst, SILValue V) {
239
244
auto B = computeMemoryBehavior (Inst, V);
240
245
return MemoryBehavior::None != B;
0 commit comments