Skip to content

Commit 2276a93

Browse files
committed
[AliasAnalysis] Clean some of the docs.
Move some comments from the definition to the decleration and tidy some of the comments.
1 parent 08d75ca commit 2276a93

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

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

+8-5
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ class AliasAnalysis : public SILAnalysis {
113113
MemoryBehavior getMemoryBehavior(SILInstruction *Inst, SILValue V,
114114
RetainObserveKind);
115115

116-
/// Returns true if Inst may read from memory in a manner that affects V.
116+
/// Returns true if \p Inst may read from memory in a manner that
117+
/// affects V.
117118
bool mayReadFromMemory(SILInstruction *Inst, SILValue V) {
118119
MemoryBehavior B = getMemoryBehavior(Inst, V,
119120
RetainObserveKind::IgnoreRetains);
@@ -122,7 +123,8 @@ class AliasAnalysis : public SILAnalysis {
122123
B == MemoryBehavior::MayHaveSideEffects;
123124
}
124125

125-
/// Returns true if Inst may write to memory in a manner that affects V.
126+
/// Returns true if \p Inst may write to memory in a manner that
127+
/// affects V.
126128
bool mayWriteToMemory(SILInstruction *Inst, SILValue V) {
127129
MemoryBehavior B = getMemoryBehavior(Inst, V,
128130
RetainObserveKind::IgnoreRetains);
@@ -131,8 +133,8 @@ class AliasAnalysis : public SILAnalysis {
131133
B == MemoryBehavior::MayHaveSideEffects;
132134
}
133135

134-
/// Returns true if Inst may read or write to memory in a manner that affects
135-
/// V.
136+
/// Returns true if \p Inst may read or write to memory in a manner that
137+
/// affects V.
136138
bool mayReadOrWriteMemory(SILInstruction *Inst, SILValue V) {
137139
auto B = getMemoryBehavior(Inst, V, RetainObserveKind::IgnoreRetains);
138140
return B != MemoryBehavior::None;
@@ -169,7 +171,8 @@ llvm::raw_ostream &operator<<(llvm::raw_ostream &OS,
169171
/// Otherwise, return an empty type.
170172
SILType computeTBAAType(SILValue V);
171173

172-
/// Check if V points to a let-variable.
174+
/// Check if \p V points to a let-member.
175+
/// Nobody can write into let members.
173176
bool isLetPointer(SILValue V);
174177

175178
} // end namespace swift

Diff for: lib/SILAnalysis/AliasAnalysis.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -699,10 +699,8 @@ AliasResult AliasAnalysis::aliasInner(SILValue V1, SILValue V2,
699699
return AliasResult::MayAlias;
700700
}
701701

702-
/// Check if this is the address of a "let" member.
703-
/// Nobody can write into let members.
704702
bool swift::isLetPointer(SILValue V) {
705-
// Traverse the "access" path for V and check that starts with "let"
703+
// Traverse the "access" path for V and check that it starts with "let"
706704
// and everything along this path is a value-type (i.e. struct or tuple).
707705

708706
// Is this an address of a "let" class member?

0 commit comments

Comments
 (0)