Skip to content

Commit 221ec9c

Browse files
authored
Merge pull request #4537 from robert-andrzejuk/patch-2
Update attributes.md - remove duplicate entries
2 parents da2c53c + d75ebdc commit 221ec9c

File tree

1 file changed

+0
-37
lines changed

1 file changed

+0
-37
lines changed

docs/cpp/attributes.md

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -167,40 +167,3 @@ The Microsoft-specific attribute `[[msvc::noinline_calls]]` has the same usage a
167167
### `[[msvc::no_tls_guard]]`
168168

169169
The Microsoft-specific `[[msvc::no_tls_guard]]` attribute disables checks for initialization on first access to thread-local variables in DLLs. The checks are enabled by default in code built using Visual Studio 2019 version 16.5 and later versions. This attribute applies only to the specific variable that follows it. To disable checks globally, use the [`/Zc:tlsGuards-`](../build/reference/zc-tlsguards.md) compiler option.
170-
171-
### `[[msvc::forceinline]]`
172-
173-
This Microsoft specific `[[msvc::forceinline]]` attribute has the same meaning as `__forceinline` when placed before a function declaration.
174-
175-
### `[[msvc::forceinline_calls]]`
176-
177-
This Microsoft specific `[[msvc::forceinline_calls]]` attribute can be placed on before a statement or a block, and will cause the inline heurisitc to attempt to forceinline all calls in that statement or block:
178-
179-
```cpp
180-
void f() {
181-
[[msvc::forceinline_calls]]
182-
{
183-
foo();
184-
bar();
185-
}
186-
...
187-
[[msvc::forceinline_calls]]
188-
bar();
189-
190-
foo();
191-
}
192-
```
193-
194-
Here, the first call to `foo` and both calls to `bar` will be treated as if they were declared `__forceinline`, but not the second call to `foo`.
195-
196-
### `[[msvc::noinline]]`
197-
198-
This Microsoft specific `[[msvc::noinline]]` attribute has the same meaning as `declspec(noinline)` when placed before a function declaration.
199-
200-
### `[[msvc::noinline_calls]]`
201-
202-
This Microsoft specific `[[msvc::noinline_calls]]` attribute has the same usage as `[[msvc::forceinline_calls]]`, and can be placed before any statement or block. Rather than forceinlining all calls in that block, however, it has the effect of turning off inlining for the scope to which it is applied.
203-
204-
### `[[msvc::flatten]]`
205-
206-
This Microsoft specific `[[msvc::flatten]]` attribute is very similar to `[[msvc::forceinline_calls]]`, and can be used in the same places and in the same way. The difference is flatten will dutifully forceinline all calls in the scope to which it is applied recursively, until no calls are left. This may have consequences for the resulting code size growth of the function or the throughput of the compiler, which the user must manage manually.

0 commit comments

Comments
 (0)