Skip to content

Commit d531c56

Browse files
authored
Merge pull request MicrosoftDocs#3509 from MicrosoftDocs/master
4/15/2021 AM Publish
2 parents aaab04d + 660abf4 commit d531c56

27 files changed

+1053
-1047
lines changed

docs/assembler/masm/masm-bnf-grammar.md

Lines changed: 512 additions & 512 deletions
Large diffs are not rendered by default.

docs/atl/understanding-parse-trees.md

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,49 @@
11
---
2-
description: "Learn more about: Understanding Parse Trees"
2+
description: "Learn more about: Understanding parse trees"
33
title: "ATL Registrar and Parse Trees"
4-
ms.date: "11/04/2016"
4+
ms.date: 04/15/2021
55
helpviewer_keywords: ["parse trees"]
6-
ms.assetid: 668ce2dd-a1c3-4ca0-8135-b25267cb6a85
76
---
8-
# Understanding Parse Trees
7+
# Understanding parse trees
98

109
You can define one or more parse trees in your registrar script, where each parse tree has the following form:
1110

12-
> \<root key>{\<registry expression>}+
11+
> \<root-key>{\<registry expression>}+
1312
1413
where:
1514

16-
> \<root key> ::= HKEY_CLASSES_ROOT \| HKEY_CURRENT_USER \|\
17-
> &emsp;HKEY_LOCAL_MACHINE \| HKEY_USERS \|\
18-
> &emsp;HKEY_PERFORMANCE_DATA \| HKEY_DYN_DATA \|\
19-
> &emsp;HKEY_CURRENT_CONFIG \| HKCR \| HKCU \|\
20-
> &emsp;HKLM \| HKU \| HKPD \| HKDD \| HKCC
21-
22-
> \<registry expression> ::= \<Add Key> \| \<Delete Key>
23-
24-
> \<Add Key> ::= \[**ForceRemove** \| **NoRemove** \| **val**]\<Key Name> [\<Key Value>][{\<Add Key>}]
25-
26-
> \<Delete Key> ::= **Delete**\<Key Name>
27-
28-
> \<Key Name> ::= **'**\<AlphaNumeric>+**'**
29-
30-
> \<AlphaNumeric> ::= *any character not NULL, i.e. ASCII 0*
31-
32-
> \<Key Value> ::= \<Key Type>\<Key Name>
33-
34-
> \<Key Type> ::= **s** \| **d**
35-
36-
> \<Key Value> ::= **'**\<AlphaNumeric>**'**
15+
> *\<root-key>* ::=\
16+
> &emsp;**`HKEY_CLASSES_ROOT`** &vert; **`HKEY_CURRENT_USER`** &vert;\
17+
> &emsp;**`HKEY_LOCAL_MACHINE`** &vert; **`HKEY_USERS`** &vert;\
18+
> &emsp;**`HKEY_PERFORMANCE_DATA`** &vert; **`HKEY_DYN_DATA`** &vert;\
19+
> &emsp;**`HKEY_CURRENT_CONFIG`** &vert; **`HKCR`** &vert; **`HKCU`** &vert;\
20+
> &emsp;**`HKLM`** &vert; **`HKU`** &vert; **`HKPD`** &vert; **`HKDD`** &vert; **`HKCC`**
21+
>
22+
> *\<registry-expression>* ::=\
23+
> &emsp; *\<Add-Key>* &vert; *\<Delete-Key>*
24+
>
25+
> *\<Add-Key>* ::=\
26+
> &emsp; \[**`ForceRemove`** &vert; **`NoRemove`** &vert; **`val`**] *\<Key-Name>* \[*\<Key-Value>*] \[ **`{`** *\<Add-Key>* **`}`** ]
27+
>
28+
> *\<Delete-Key>* ::=\
29+
> &emsp; **`Delete`** *\<Key-Name>*
30+
>
31+
> *\<Key-Name>* ::=\
32+
> &emsp; **`'`***\<AlphaNumeric>*+**`'`**
33+
>
34+
> *\<AlphaNumeric>* ::=\
35+
> &emsp; any non-null character.
36+
>
37+
> *\<Key-Value>* ::=\
38+
> &emsp; *\<Key-Type>* *\<Key-Name>*
39+
>
40+
> *\<Key-Type>* ::=\
41+
> &emsp; **`s`** &vert; **`d`**
3742
3843
> [!NOTE]
39-
> `HKEY_CLASSES_ROOT` and `HKCR` are equivalent; `HKEY_CURRENT_USER` and `HKCU` are equivalent; and so on.
44+
> **`HKEY_CLASSES_ROOT`** and **`HKCR`** are equivalent; **`HKEY_CURRENT_USER`** and **`HKCU`** are equivalent; and so on.
4045
41-
A parse tree can add multiple keys and subkeys to the \<root key>. In doing so, it keeps a subkey's handle open until the parser has completed parsing all of its subkeys. This approach is more efficient than operating on a single key at a time, as seen in the following example:
46+
A parse tree can add multiple keys and subkeys to the \<root-key>. The Registrar keeps each subkey handle open until the parser has completed parsing all of its subkeys. It's more efficient than operating on a single key at a time. Here's an example:
4247

4348
```rgs
4449
HKEY_CLASSES_ROOT
@@ -53,8 +58,8 @@ HKEY_CLASSES_ROOT
5358
}
5459
```
5560

56-
Here, the Registrar initially opens (creates) `HKEY_CLASSES_ROOT\MyVeryOwnKey`. It then sees that `MyVeryOwnKey` has a subkey. Rather than close the key to `MyVeryOwnKey`, the Registrar retains the handle and opens (creates) `HasASubKey` using this parent handle. (The system registry can be slower when no parent handle is open.) Thus, opening `HKEY_CLASSES_ROOT\MyVeryOwnKey` and then opening `HasASubKey` with `MyVeryOwnKey` as the parent is faster than opening `MyVeryOwnKey`, closing `MyVeryOwnKey`, and then opening `MyVeryOwnKey\HasASubKey`.
61+
Here, the Registrar initially opens (creates) `HKEY_CLASSES_ROOT\MyVeryOwnKey`. It then sees that `MyVeryOwnKey` has a subkey. Rather than close the key to `MyVeryOwnKey`, the Registrar keeps the handle and opens (creates) `HasASubKey` using this parent handle. (The system registry can be slower when no parent handle is open.) So, opening `HKEY_CLASSES_ROOT\MyVeryOwnKey` and then opening `HasASubKey` with `MyVeryOwnKey` as the parent is faster than opening `MyVeryOwnKey`, closing `MyVeryOwnKey`, and then opening `MyVeryOwnKey\HasASubKey`.
5762

5863
## See also
5964

60-
[Creating Registrar Scripts](../atl/creating-registrar-scripts.md)
65+
[Creating registrar scripts](../atl/creating-registrar-scripts.md)

docs/build/cmake-presets-vs.md

Lines changed: 64 additions & 57 deletions
Large diffs are not rendered by default.

docs/build/reference/d-preprocessor-definitions.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,36 @@ Defines a preprocessing symbol for a source file.
1212

1313
## Syntax
1414

15-
> **/D**\[ ]_name_\[`=` \| `#` \[{ *string* \| *number* }] ]\
16-
> **/D**\[ ]`"`_name_\[`=` \| `#` \[{ *string* \| *number* }] ]`"`
15+
> **`/D`**\[ ]_name_\[`=` &vert; `#` \[{ *string* &vert; *number* }] ]\
16+
> **`/D`**\[ ]`"`_name_\[`=` &vert; `#` \[{ *string* &vert; *number* }] ]`"`
1717
1818
## Remarks
1919

2020
You can use this symbol together with `#if` or `#ifdef` to compile source code conditionally. The symbol definition remains in effect until it's redefined in the code, or is undefined in the code by an `#undef` directive.
2121

22-
**/D** has the same effect as a `#define` directive at the beginning of a source code file. The difference is that **/D** strips quotation marks on the command line, and a `#define` directive keeps them. You can have whitespace between the **/D** and the symbol. There can't be whitespace between the symbol and the equals sign, or between the equals sign and any value assigned.
22+
**`/D`** has the same effect as a `#define` directive at the beginning of a source code file. The difference is that **`/D`** strips quotation marks on the command line, and a `#define` directive keeps them. You can have whitespace between the **`/D`** and the symbol. There can't be whitespace between the symbol and the equals sign, or between the equals sign and any value assigned.
2323

2424
By default, the value associated with a symbol is 1. For example, `/D name` is equivalent to `/D name=1`. In the example at the end of this article, the definition of `TEST` is shown to print `1`.
2525

2626
Compiling by using `/D name=` causes the symbol *name* to have no associated value. Although the symbol can still be used to conditionally compile code, it otherwise evaluates to nothing. In the example, if you compile by using `/DTEST=`, an error occurs. This behavior resembles the use of `#define` with or without a value.
2727

28-
The **/D** option doesn't support function-like macro definitions. To insert definitions that can't be defined on the command line, consider the [/FI (Name forced include file)](fi-name-forced-include-file.md) compiler option.
28+
The **`/D`** option doesn't support function-like macro definitions. To insert definitions that can't be defined on the command line, consider the [`/FI` (Name forced include file)](fi-name-forced-include-file.md) compiler option.
2929

30-
You can use **/D** multiple times on the command line to define additional symbols. If the same symbol is defined more than once, the last definition is used.
30+
You can use **`/D`** multiple times on the command line to define more symbols. If the same symbol is defined more than once, the last definition is used.
3131

3232
This command defines the symbol DEBUG in TEST.c:
3333

3434
```cmd
3535
CL /DDEBUG TEST.C
3636
```
3737

38-
This command removes all occurrences of the keyword `__far` in TEST.c:
38+
This command removes all occurrences of the keyword **`__far`** in TEST.c:
3939

4040
```cmd
4141
CL /D __far= TEST.C
4242
```
4343

44-
The **CL** environment variable can't be set to a string that contains the equal sign. To use **/D** together with the **CL** environment variable, you must specify the number sign (`#`) instead of the equal sign:
44+
The **CL** environment variable can't be set to a string that contains the equal sign. To use **`/D`** together with the **`CL`** environment variable, you must specify the number sign (`#`) instead of the equal sign:
4545

4646
```cmd
4747
SET CL=/DTEST#0
@@ -57,11 +57,11 @@ CL /DTEST=%% TEST.C
5757

5858
1. Open the project **Property Pages** dialog box. For more information, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
5959

60-
1. In the left pane, select **Configuration Properties**, **C/C++**, **Preprocessor**.
60+
1. Select the **Configuration Properties** > **C/C++** > **Preprocessor** property page.
6161

62-
1. In the right pane, in the right-hand column of the **Preprocessor Definitions** property, open the drop-down menu and choose **Edit**.
62+
1. Open the drop-down menu of the **Preprocessor Definitions** property and choose **Edit**.
6363

64-
1. In the **Preprocessor Definitions** dialog box, add (one per line), modify, or delete one or more definitions. Choose **OK** to save your changes.
64+
1. In the **Preprocessor Definitions** dialog box, add, modify, or delete one or more definitions, one per line. Choose **OK** to save your changes.
6565

6666
You don't need to include the '/D' option prefix on the definitions you specify here. In the property page, definitions are separated by semicolons (`;`).
6767

@@ -92,9 +92,9 @@ TEST defined 1
9292

9393
## See also
9494

95-
[MSVC Compiler Options](compiler-options.md)\
96-
[MSVC Compiler Command-Line Syntax](compiler-command-line-syntax.md)\
97-
[/FI (Name forced include file)](fi-name-forced-include-file.md)\
98-
[/U, /u (Undefine Symbols)](u-u-undefine-symbols.md)\
99-
[#undef Directive (C/C++)](../../preprocessor/hash-undef-directive-c-cpp.md)\
100-
[#define Directive (C/C++)](../../preprocessor/hash-define-directive-c-cpp.md)
95+
[MSVC compiler options](compiler-options.md)\
96+
[MSVC compiler command-line syntax](compiler-command-line-syntax.md)\
97+
[`/FI` (Name forced include file)](fi-name-forced-include-file.md)\
98+
[`/U`, `/u` (Undefine Symbols)](u-u-undefine-symbols.md)\
99+
[`#undef` Directive (C/C++)](../../preprocessor/hash-undef-directive-c-cpp.md)\
100+
[`#define` Directive (C/C++)](../../preprocessor/hash-define-directive-c-cpp.md)
Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,72 @@
11
---
22
description: "Learn more about: /GENPROFILE, /FASTGENPROFILE (Generate Profiling Instrumented Build)"
33
title: "/GENPROFILE, /FASTGENPROFILE (Generate Profiling Instrumented Build)"
4-
ms.date: "03/14/2018"
4+
ms.date: 04/14/2021
55
f1_keywords: ["GENPROFILE", "FASTGENPROFILE", "/GENPROFILE", "/FASTGENPROFILE"]
66
helpviewer_keywords: ["GENPROFILE", "FASTGENPROFILE"]
7-
ms.assetid: deff5ce7-46f5-448a-b9cd-a7a83a6864c6
87
---
9-
# /GENPROFILE, /FASTGENPROFILE (Generate Profiling Instrumented Build)
8+
# `/GENPROFILE`, `/FASTGENPROFILE` (Generate Profiling Instrumented Build)
109

11-
Specifies generation of a .pgd file by the linker to support profile-guided optimization (PGO). **/GENPROFILE** and **/FASTGENPROFILE** use different default parameters. Use **/GENPROFILE** to favor precision over speed and memory usage during profiling. Use **/FASTGENPROFILE** to favor smaller memory usage and speed over precision.
10+
Specifies generation of a *`.pgd`* file by the linker to support profile-guided optimization (PGO). **`/GENPROFILE`** and **`/FASTGENPROFILE`** use different default parameters. Use **`/GENPROFILE`** to favor precision over speed and memory usage during profiling. Use **`/FASTGENPROFILE`** to favor smaller memory usage and speed over precision.
1211

1312
## Syntax
1413

15-
> **/GENPROFILE**\[**:**{\[**COUNTER32**\|**COUNTER64**]\|\[**EXACT**\|**NOEXACT**]\|**MEMMAX=**_#_\|**MEMMIN=**_#_\|\[**PATH**\|**NOPATH**]\|\[**TRACKEH** \|**NOTRACKEH** ]\|**PGD=**_filename_}]\
16-
> **/FASTGENPROFILE**\[**:**{\[**COUNTER32**\|**COUNTER64**]\|\[**EXACT**\|**NOEXACT**]\|**MEMMAX=**_#_\|**MEMMIN=**_#_\|[**PATH**\|**NOPATH** ]\|\[**TRACKEH** \|**NOTRACKEH** ]\|**PGD=**_filename_}]
14+
> **`/GENPROFILE`**\[**`:`**_`profile-argument`_\[**`,`**_`profile-argument`_ ...]]\
15+
> **`/FASTGENPROFILE`**\[**`:`**_`profile-argument`_\[**`,`**_`profile-argument`_ ...]]\
16+
17+
> *`profile-argument`*\
18+
> &emsp;{ **`COUNTER32`** &vert; **`COUNTER64`** }\
19+
> &emsp;{ **`EXACT`** &vert; **`NOEXACT`** }\
20+
> &emsp;**`MEMMAX=`**_value_\
21+
> &emsp;**`MEMMIN=`**_value_\
22+
> &emsp;{ **`PATH`** &vert; **`NOPATH`** }\
23+
> &emsp;{ **`TRACKEH`** &vert; **`NOTRACKEH`** }\
24+
> &emsp;**`PGD=`**_filename_
1725
1826
### Arguments
1927

20-
Any of the following arguments may be specified to **/GENPROFILE** or **/FASTGENPROFILE**. Arguments listed here separated by a pipe (**|**) character are mutually exclusive. Use a comma (**,**) character to separate options.
28+
Any of the *`profile-argument`* arguments may be specified to **`/GENPROFILE`** or **`/FASTGENPROFILE`**. Arguments listed here separated by a pipe character (**`|`**) are mutually exclusive. Use a comma character (**`,`**) to separate arguments. Don't put spaces between arguments, commas, or after the colon (**`:`**).
2129

22-
**COUNTER32** &#124; **COUNTER64**<br/>
23-
Use **COUNTER32** to specify the use of 32-bit probe counters, and **COUNTER64** to specify 64-bit probe counters. When you specify **/GENPROFILE**, the default is **COUNTER64**. When you specify **/FASTGENPROFILE**, the default is **COUNTER32**.
30+
**`COUNTER32`** &vert; **`COUNTER64`**\
31+
Use **`COUNTER32`** to specify the use of 32-bit probe counters, and **`COUNTER64`** to specify 64-bit probe counters. When you specify **`/GENPROFILE`**, the default is **`COUNTER64`**. When you specify **`/FASTGENPROFILE`**, the default is **`COUNTER32`**.
2432

25-
**EXACT** &#124; **NOEXACT**<br/>
26-
Use **EXACT** to specify thread-safe interlocked increments for probes. **NOEXACT** specifies unprotected increment operations for probes. The default is **NOEXACT**.
33+
**`EXACT`** &vert; **`NOEXACT`**\
34+
Use **`EXACT`** to specify thread-safe interlocked increments for probes. **`NOEXACT`** specifies unprotected increment operations for probes. The default is **`NOEXACT`**.
2735

28-
**MEMMAX**=*value*, **MEMMIN**=*value*<br/>
29-
Use **MEMMAX** and **MEMMIN** to specify the maximum and minimum reservation sizes for training data in memory. The value is the amount of memory to reserve in bytes. By default, these values are determined by an internal heuristic.
36+
**`MEMMAX`**=*value*, **`MEMMIN`**=*value*\
37+
Use **`MEMMAX`** and **`MEMMIN`** to specify the maximum and minimum reservation sizes for training data in memory. The value is the amount of memory to reserve in bytes. By default, these values are determined by an internal heuristic.
3038

31-
**PATH** &#124; **NOPATH** <br/>
32-
Use **PATH** to specify a separate set of PGO counters for each unique path to a function. Use **NOPATH** to specify only one set of counters for each function. When you specify **/GENPROFILE**, the default is **PATH** . When you specify **/FASTGENPROFILE**, the default is **NOPATH** .
39+
**`PATH`** &vert; **`NOPATH`**\
40+
Use **`PATH`** to specify a separate set of PGO counters for each unique path to a function. Use **`NOPATH`** to specify only one set of counters for each function. When you specify **`/GENPROFILE`**, the default is **`PATH`** . When you specify **`/FASTGENPROFILE`**, the default is **`NOPATH`** .
3341

34-
**TRACKEH** &#124; **NOTRACKEH** <br/>
35-
Specifies whether to use extra counters to keep an accurate count when exceptions are thrown during training. Use **TRACKEH** to specify extra counters for an exact count. Use **NOTRACKEH** to specify single counters for code that does not use exception handling or that does not encounter exceptions in your training scenarios. When you specify **/GENPROFILE**, the default is **TRACKEH** . When you specify **/FASTGENPROFILE**, the default is **NOTRACKEH** .
42+
**`TRACKEH`** &vert; **`NOTRACKEH`**\
43+
Specifies whether to use extra counters to keep an accurate count when exceptions are thrown during training. Use **`TRACKEH`** to specify extra counters for an exact count. Use **`NOTRACKEH`** to specify single counters for code that doesn't use exception handling or that doesn't run into exceptions in your training scenarios. When you specify **`/GENPROFILE`**, the default is **`TRACKEH`** . When you specify **`/FASTGENPROFILE`**, the default is **`NOTRACKEH`** .
3644

37-
**PGD**=*filename*<br/>
38-
Specifies a base file name for the .pgd file. By default, the linker uses the base executable image file name with a .pgd extension.
45+
**`PGD`**=*filename*\
46+
Specifies a base file name for the *`.pgd`* file. By default, the linker uses the base executable image file name with a *`.pgd`* extension.
3947

4048
## Remarks
4149

42-
The **/GENPROFILE** and **/FASTGENPROFILE** options tell the linker to generate the profiling instrumentation file needed to support application training for profile-guided optimization (PGO). These options are new in Visual Studio 2015. Prefer these options to the deprecated **/LTCG:PGINSTRUMENT**, **/PGD** and **/POGOSAFEMODE** options and the **PogoSafeMode**, **VCPROFILE_ALLOC_SCALE** and **VCPROFILE_PATH** environment variables. The profiling information generated by application training is used as input to perform targeted whole-program optimizations during builds. You can set additional options to control various profiling features for performance during app training and builds. The default options specified by **/GENPROFILE** give most accurate results, especially for large, complex multi-threaded apps. The **/FASTGENPROFILE** option uses different defaults for a lower memory footprint and faster performance during training, at the expense of accuracy.
50+
The **`/GENPROFILE`** and **`/FASTGENPROFILE`** options tell the linker to generate the profiling instrumentation file needed to support application training for profile-guided optimization (PGO). These options are new in Visual Studio 2015. Prefer these options to the deprecated **`/LTCG:PGINSTRUMENT`**, **`/PGD`**, and **`/POGOSAFEMODE`** options, and to the **`PogoSafeMode`**, **`VCPROFILE_ALLOC_SCALE`**, and **`VCPROFILE_PATH`** environment variables. The profiling information generated by application training is used as input for targeted whole-program optimizations during builds. You can also set other options to control various profiling features for performance during app training and builds. The default options specified by **`/GENPROFILE`** give the most accurate results, especially for large, complex multi-threaded apps. The **`/FASTGENPROFILE`** option uses different defaults for a lower memory footprint and faster performance during training, at the expense of accuracy.
4351

44-
Profiling information is captured when you run the instrumented app after you build by using **/GENPROFILE** of **/FASTGENPROFILE**. This information is captured when you specify the [/USEPROFILE](useprofile.md) linker option to perform the profiling step and then used to guide the optimized build step. For more information on how to train your app and details on the collected data, see [Profile-Guided Optimizations](../profile-guided-optimizations.md).
52+
Profiling information is captured when you run the instrumented app after you build by using **`/GENPROFILE`** of **`/FASTGENPROFILE`**. This information is captured when you specify the [`/USEPROFILE`](useprofile.md) linker option to do the profiling step and then used to guide the optimized build step. For more information on how to train your app and details on the collected data, see [Profile-guided optimizations](../profile-guided-optimizations.md).
4553

46-
You must also specify **/LTCG** when you specify **/GENPROFILE** or **/FASTGENPROFILE**.
54+
Always specify **`/LTCG`** when you specify **`/GENPROFILE`** or **`/FASTGENPROFILE`**.
4755

4856
### To set this linker option in the Visual Studio development environment
4957

5058
1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
5159

5260
1. Select the **Configuration Properties** > **Linker** > **Command Line** property page.
5361

54-
1. Enter the **/GENPROFILE** or **/FASTGENPROFILE** options and arguments into the **Additional Options** box. Choose **OK** to save your changes.
62+
1. Enter the **`/GENPROFILE`** or **`/FASTGENPROFILE`** options and arguments into the **Additional Options** box. Choose **`OK`** to save your changes.
5563

5664
### To set this linker option programmatically
5765

5866
- See <xref:Microsoft.VisualStudio.VCProjectEngine.VCLinkerTool.AdditionalOptions%2A>.
5967

6068
## See also
6169

62-
[MSVC linker reference](linking.md)<br/>
63-
[MSVC Linker Options](linker-options.md)<br/>
64-
[/LTCG (Link-time Code Generation)](ltcg-link-time-code-generation.md)<br/>
70+
[MSVC linker reference](linking.md)\
71+
[MSVC linker options](linker-options.md)\
72+
[`/LTCG` (Link-time code generation)](ltcg-link-time-code-generation.md)

0 commit comments

Comments
 (0)