Skip to content

Commit b0ee684

Browse files
TylerMSFTTylerMSFT
authored andcommitted
Merge branch 'main' of https://github.com/MicrosoftDocs/cpp-docs-pr into build-insights
2 parents 94c0ed1 + 942537e commit b0ee684

File tree

5 files changed

+50
-6
lines changed

5 files changed

+50
-6
lines changed

docs/build/reference/compiler-options-listed-alphabetically.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ This table contains an alphabetical list of compiler options. For a list of comp
197197
| [`/vmv`](vmm-vms-vmv-general-purpose-representation.md) | Declares virtual inheritance. |
198198
| [`/volatile:iso`](volatile-volatile-keyword-interpretation.md) | Acquire/release semantics not guaranteed on volatile accesses. |
199199
| [`/volatile:ms`](volatile-volatile-keyword-interpretation.md) | Acquire/release semantics guaranteed on volatile accesses. |
200-
| `/volatileMetadata` | Generate metadata on volatile memory accesses. |
200+
| [`/volatileMetadata`](volatile.md) | Generate metadata on volatile memory accesses. |
201201
| [`/w`](compiler-option-warning-level.md) | Disable all warnings. |
202202
| [`/W0`, `/W1`, `/W2`, `/W3`, `/W4`](compiler-option-warning-level.md) | Set output warning level. |
203203
| [`/w1<n>`, `/w2<n>`, `/w3<n>`, `/w4<n>`](compiler-option-warning-level.md) | Set warning level for the specified warning. |

docs/build/reference/compiler-options-listed-by-category.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ This article contains a categorical list of compiler options. For an alphabetica
262262
| [`/utf-8`](utf-8-set-source-and-executable-character-sets-to-utf-8.md) | Set source and execution character sets to UTF-8. |
263263
| [`/V`](v-version-number.md) | Deprecated. Sets the version string. |
264264
| [`/validate-charset`](validate-charset-validate-for-compatible-characters.md) | Validate UTF-8 files for only compatible characters. |
265-
| `/volatileMetadata` | Generate metadata on volatile memory accesses. |
265+
| [`/volatileMetadata`](volatile.md) | Generate metadata on volatile memory accesses. |
266266
| [`/Yc`](yc-create-precompiled-header-file.md) | Create *`.PCH`* file. |
267267
| [`/Yd`](yd-place-debug-information-in-object-file.md) | Deprecated. Places complete debugging information in all object files. Use [`/Zi`](z7-zi-zi-debug-information-format.md) instead. |
268268
| [`/Yl`](yl-inject-pch-reference-for-debug-library.md) | Injects a PCH reference when creating a debug library. |

docs/build/reference/headerunit.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "/headerUnit (Use header unit IFC)"
33
description: "Use the /headerUnit compiler option to associate a header file with the header unit to import in its place."
4-
ms.date: 02/01/2022
4+
ms.date: 5/28/2024
55
f1_keywords: ["/headerUnit"]
66
helpviewer_keywords: ["/headerUnit", "Use header unit IFC"]
77
author: "tylermsft"
@@ -14,8 +14,8 @@ Imports a header unit. Tells the compiler where to find the *`.ifc`* file (the b
1414
## Syntax
1515

1616
> **`/headerUnit`** *`header-filename`*=*`ifc-filename`*\
17-
> **`/headerUnit:quote`** \[*`header-filename`*=*`ifc-filename`*\]\
18-
> **`/headerUnit:angle`** \[*`header-filename`*=*`ifc-filename`*\]
17+
> **`/headerUnit:quote`** *`header-filename`*=*`ifc-filename`*\
18+
> **`/headerUnit:angle`** *`header-filename`*=*`ifc-filename`*
1919
2020
### Arguments
2121

@@ -39,7 +39,7 @@ When the compiler comes across `import "file";` or `import <file>;` this compile
3939

4040
- **`/headerUnit:angle`** looks up the compiled header unit file using the same rules as `#include <file>`.
4141

42-
The compiler can't map a single *`header-name`* to multiple *`.ifc`* files. Mapping multiple *`header-name`* arguments to a single *`.ifc`* is possible, but it isn't recommended. The contents of the *`.ifc`* are imported as if it was only the header specified by *`header-name`*.
42+
The compiler can't map a single *`header-name`* to multiple *`.ifc`* files. You can map multiple *`header-name`* arguments to a single *`.ifc`*. The contents of the *`.ifc`* are imported as if it was only the header specified by *`header-name`*.
4343

4444
The compiler implicitly enables the new preprocessor when this option is used. If any form of `/headerUnit` is specified on the command line, then [`/Zc:preprocessor`](zc-preprocessor.md) is added to the command line by the compiler. To opt out of the implicit `/Zc:preprocessor`, specify: `/Zc:preprocessor-`
4545

docs/build/reference/volatile.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
description: "Learn more about: /volatileMetadata"
3+
title: "/volatileMetadata (Generate metadata on volatile memory accesses)"
4+
ms.date: 5/29/2024
5+
f1_keywords: ["/volatileMetadata"]
6+
helpviewer_keywords: ["/volatileMetadata", "-volatileMetadata compiler option", "/volatileMetadata compiler option", "volatileMetadata"]
7+
---
8+
# `/volatileMetadata` (Generate metadata on volatile memory accesses)
9+
10+
Generate metadata for volatile memory accesses to improve performance when running x64 code on ARM64.
11+
12+
## Syntax
13+
14+
```cpp
15+
/volatileMetadata[-]
16+
```
17+
18+
## Arguments
19+
20+
**`-`**\
21+
Turns off `/volatileMetadata`. This may result in worse performance when your code runs in emulation mode on ARM64 because the emulator pessimistically assumes that every load/store needs a barrier.
22+
23+
## Remarks
24+
25+
Starting with Visual Studio 2019 16.10, `/volatileMetadata` is on by default when generating x64 code. It improves the emulation performance of x64 code on ARM64 by generating metadata that identifies volatile memory addresses. An emulator can use this metadata to improve performance by not using acquire/release semantics on those accesses it knows aren't volatile. Without this metadata, the emulator assumes that all addresses are volatile and uses acquire and release semantics.
26+
27+
One side effect of `/volatileMetadata` is you may see `npad` macros used in the generated code. This macro expands to a specified number of `NOP` instructions that create an address to associate with a memory barrier. That address is then recorded in the metadata to indicate that acquire/release semantics should be used to access it.
28+
29+
`/volatileMetadata` is ignored when targeting x86.
30+
31+
`/volatileMetadata` can be disabled by using `/volatileMetadata-`.
32+
33+
`/volatileMetadata` is ignored when targeting x86.
34+
35+
## Requirements
36+
37+
Visual Studio 2019 version 16.10 or later.
38+
39+
## See also
40+
41+
[MSVC Compiler Options](compiler-options.md)\
42+
[MSVC Compiler Command-Line Syntax](compiler-command-line-syntax.md)

docs/build/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,8 @@ items:
746746
href: ../build/reference/vmm-vms-vmv-general-purpose-representation.md
747747
- name: /volatile (volatile keyword interpretation)
748748
href: ../build/reference/volatile-volatile-keyword-interpretation.md
749+
- name: /volatileMetadata
750+
href: ../build/reference/volatile.md
749751
- name: /w, /W0, /W1, /W2, /W3, /W4, /w1, /w2, /w3, /w4, /Wall, /wd, /we, /wo, /Wv, /WX (Warning level)
750752
href: ../build/reference/compiler-option-warning-level.md
751753
- name: /WL (Enable one-line diagnostics)

0 commit comments

Comments
 (0)