Skip to content

Commit 57362a8

Browse files
committed
Fix documentation comments.
1 parent c187c8a commit 57362a8

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

include/swift/SIL/ApplySite.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,13 @@ class ApplySite {
149149

150150
/// Return the referenced function if the callee is a function_ref like
151151
/// instruction.
152+
///
152153
/// WARNING: This not necessarily the function that will be called at runtime.
153-
/// If the callee is a (prev_)dynamic_function_ref the actuall function called
154-
/// might be different.
154+
/// If the callee is a (prev_)dynamic_function_ref the actual function called
155+
/// might be different because it could be dynamically replaced at runtime.
156+
///
157+
/// If the client of this API wants to look at the content of the returned SIL
158+
/// function it should call getReferencedFunctionOrNull() instead.
155159
SILFunction *getInitiallyReferencedFunction() const {
156160
FOREACH_IMPL_RETURN(getInitiallyReferencedFunction());
157161
}

include/swift/SIL/SILInstruction.h

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1854,9 +1854,13 @@ class ApplyInstBase<Impl, Base, false> : public Base {
18541854

18551855
/// Return the referenced function if the callee is a function_ref like
18561856
/// instruction.
1857+
///
18571858
/// WARNING: This not necessarily the function that will be called at runtime.
1858-
/// If this is a (prev_)dynamic_function_ref the actuall function called might
1859-
/// be different.
1859+
/// If the callee is a (prev_)dynamic_function_ref the actual function called
1860+
/// might be different because it could be dynamically replaced at runtime.
1861+
///
1862+
/// If the client of this API wants to look at the content of the returned SIL
1863+
/// function it should call getReferencedFunctionOrNull() instead.
18601864
SILFunction *getInitiallyReferencedFunction() const {
18611865
if (auto *FRI = dyn_cast<FunctionRefBaseInst>(getCallee()))
18621866
return FRI->getInitiallyReferencedFunction();
@@ -2319,10 +2323,14 @@ class FunctionRefBaseInst : public LiteralInst {
23192323
return nullptr;
23202324
}
23212325

2322-
/// Return the referenced function.
2326+
/// Return the initially referenced function.
2327+
///
23232328
/// WARNING: This not necessarily the function that will be called at runtime.
2324-
/// If this is a (prev_)dynamic_function_ref the actuall function called might
2325-
/// be different.
2329+
/// If the callee is a (prev_)dynamic_function_ref the actual function called
2330+
/// might be different because it could be dynamically replaced at runtime.
2331+
///
2332+
/// If the client of this API wants to look at the content of the returned SIL
2333+
/// function it should call getReferencedFunctionOrNull() instead.
23262334
SILFunction *getInitiallyReferencedFunction() const { return f; }
23272335

23282336
void dropReferencedFunction();

0 commit comments

Comments
 (0)