Skip to content

Commit 8902d71

Browse files
authored
Merge pull request #62215 from eeckstein/fix-inline-attribute-docs
docs: fix documentation for the `@inline` attribute
2 parents e166ec9 + e1d59b6 commit 8902d71

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

docs/ReferenceGuides/UnderscoredAttributes.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,15 @@ initializers from its superclass. This implies that all designated initializers
535535
overridden. This attribute is often printed alongside
536536
`@_hasMissingDesignatedInitializers` in this case.
537537

538+
## `@inline(__always)`
539+
540+
Forces the function to be inlined.
541+
542+
If it's not possible to always inline the function, e.g. if it's a self-
543+
recursive function, the attribute is ignored.
544+
545+
This attribute has no effect in debug builds.
546+
538547
## `@_noEagerMove`
539548

540549
When applied to a value, indicates that the value's lifetime is lexical, that

docs/SIL.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,14 +1070,14 @@ The minimal OS-version where the function is available.
10701070
::
10711071

10721072
sil-function-attribute ::= '[' sil-function-inlining ']'
1073-
sil-function-inlining ::= 'never'
1073+
sil-function-inlining ::= 'noinline'
10741074

10751075
The function is never inlined.
10761076
::
10771077

1078-
sil-function-inlining ::= 'always'
1078+
sil-function-inlining ::= 'always_inline'
10791079

1080-
The function is always inlined, even in a ``Onone`` build.
1080+
The function is always inlined.
10811081
::
10821082

10831083
sil-function-attribute ::= '[' sil-function-optimization ']'

0 commit comments

Comments
 (0)