Skip to content

Commit 101bdc2

Browse files
author
Colin Robertson
authored
Front-run acrolinx fixes before emsp bulk (MicrosoftDocs#3507)
* Front-run acrolinx fixes before emsp bulk * fix genprofile syntax block
1 parent 71772e7 commit 101bdc2

6 files changed

+134
-130
lines changed
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+
>  { **`COUNTER32`** | **`COUNTER64`** }\
19+
>  { **`EXACT`** | **`NOEXACT`** }\
20+
>  **`MEMMAX=`**_value_\
21+
>  **`MEMMIN=`**_value_\
22+
>  { **`PATH`** | **`NOPATH`** }\
23+
>  { **`TRACKEH`** | **`NOTRACKEH`** }\
24+
>  **`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)
Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,39 @@
11
---
22
description: "Learn more about: C Constant Expressions"
33
title: "C Constant Expressions"
4-
ms.date: "06/14/2018"
4+
ms.date: 04/14/2021
55
helpviewer_keywords: ["constant expressions, syntax", "constant expressions", "expressions [C++], constant"]
6-
ms.assetid: d48a6c47-e44c-4be2-9c8b-7944c7ef8de7
76
---
87
# C Constant Expressions
98

10-
A constant expression is evaluated at compile time, not run time, and can be used in any place that a constant can be used. The constant expression must evaluate to a constant that is in the range of representable values for that type. The operands of a constant expression can be integer constants, character constants, floating-point constants, enumeration constants, type casts, **`sizeof`** expressions, and other constant expressions.
9+
A constant expression gets evaluated at compile time, not run time, and can be used in any place that a constant can be used. The constant expression must evaluate to a constant that is in the range of representable values for that type. The operands of a constant expression can be integer constants, character constants, floating-point constants, enumeration constants, type casts, **`sizeof`** expressions, and other constant expressions.
1110

1211
## Syntax
1312

14-
*constant-expression*:<br/>
15-
&nbsp;&nbsp;&nbsp;&nbsp;*conditional-expression*
13+
*`constant-expression`*:\
14+
&emsp;*`conditional-expression`*
1615

17-
*conditional-expression*:<br/>
18-
&nbsp;&nbsp;&nbsp;&nbsp;*logical-OR-expression*<br/>
19-
&nbsp;&nbsp;&nbsp;&nbsp;*logical-OR-expression* **?** *expression* **:** *conditional-expression*
16+
*`conditional-expression`*:\
17+
&emsp;*`logical-OR-expression`*\
18+
&emsp;*`logical-OR-expression`* **`?`** *`expression`* **`:`** *`conditional-expression`*
2019

21-
*expression*:<br/>
22-
&nbsp;&nbsp;&nbsp;&nbsp;*assignment-expression*<br/>
23-
&nbsp;&nbsp;&nbsp;&nbsp;*expression* **,** *assignment-expression*
20+
*`expression`*:\
21+
&emsp;*`assignment-expression`*\
22+
&emsp;*`expression`* **`,`** *`assignment-expression`*
2423

25-
*assignment-expression*:<br/>
26-
&nbsp;&nbsp;&nbsp;&nbsp;*conditional-expression*<br/>
27-
&nbsp;&nbsp;&nbsp;&nbsp;*unary-expression* *assignment-operator* *assignment-expression*
24+
*`assignment-expression`*:\
25+
&emsp;*`conditional-expression`*\
26+
&emsp;*`unary-expression`* *`assignment-operator`* *`assignment-expression`*
2827

29-
*assignment-operator*: one of<br/>
30-
&nbsp;&nbsp;&nbsp;&nbsp;**=** **&#42;=** **/=** **%=** **+=** **-=** **\<\<=** **>>=** **&=** **^=** **&#124;=**
28+
*`assignment-operator`*: one of\
29+
&emsp;**`=`** **`*=`** **`/=`** **`%=`** **`+=`** **`-=`** **`<<=`** **`>>=`** **`&=`** **`^=`** **`|=`**
3130

32-
The nonterminals for struct declarator, enumerator, direct declarator, direct-abstract declarator, and labeled statement contain the *constant-expression* nonterminal.
31+
The nonterminals for struct declarator, enumerator, direct declarator, direct-abstract declarator, and labeled statement contain the *`constant-expression`* nonterminal.
3332

3433
An integral constant expression must be used to specify the size of a bit-field member of a structure, the value of an enumeration constant, the size of an array, or the value of a **`case`** constant.
3534

36-
Constant expressions used in preprocessor directives are subject to additional restrictions. Consequently, they are known as "restricted constant expressions." A restricted constant expression cannot contain **`sizeof`** expressions, enumeration constants, type casts to any type, or floating-type constants. It can, however, contain the special constant expression **defined (** _identifier_ **)**.
35+
Constant expressions used in preprocessor directives are subject to several restrictions. They're known as *restricted* constant expressions. A restricted constant expression can't contain **`sizeof`** expressions, enumeration constants, type casts to any type, or floating-type constants. It can, however, contain the special constant expression **`defined (`** _identifier_ **`)`**.
3736

3837
## See also
3938

40-
- [Operands and Expressions](../c-language/operands-and-expressions.md)
39+
[Operands and Expressions](../c-language/operands-and-expressions.md)
Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,40 @@
11
---
2-
description: "Learn more about: C Extended Storage-Class Attributes"
3-
title: "C Extended Storage-Class Attributes"
4-
ms.date: "11/04/2016"
2+
description: "Learn more about: C extended storage-class attributes"
3+
title: "C extended storage-class attributes"
4+
ms.date: 04/14/2021
55
helpviewer_keywords: ["__declspec keyword [C]", "extended attributes", "extended storage-class attributes", "storage class specifiers, C storage classes"]
6-
ms.assetid: 2580735c-f5bf-46ab-9468-0696893d82be
76
---
8-
# C Extended Storage-Class Attributes
7+
# C extended storage-class attributes
98

109
**Microsoft Specific**
1110

12-
More up-to-date information on this topic can be found under [__declspec (C++ Reference)](../cpp/declspec.md).
11+
More up-to-date information on storage class attributes can be found under [`__declspec` (C++ Reference)](../cpp/declspec.md).
1312

14-
Extended attribute syntax simplifies and standardizes the Microsoft-specific extensions to the C language. The storage-class attributes that use extended attribute syntax include thread, naked, dllimport, and dllexport.
13+
Extended attribute syntax simplifies and standardizes the Microsoft-specific extensions to the C language. The storage-class attributes that use extended attribute syntax include **`thread`**, **`naked`**, **`dllimport`**, and **`dllexport`**.
1514

16-
The extended attribute syntax for specifying storage-class information uses the __declspec keyword, which specifies that an instance of a given type is to be stored with a Microsoft-specific storage-class attribute (thread, naked, dllimport, or dllexport). Examples of other storage-class modifiers include the static and extern keywords. However, these keywords are part of the ANSI C standard and as such are not covered by extended attribute syntax.
15+
The extended attribute syntax for specifying storage-class information uses the **`__declspec`** keyword, which specifies that an instance of a given type is to be stored with a Microsoft-specific storage-class attribute (**`thread`**, **`naked`**, **`dllimport`**, or **`dllexport`**). Examples of other storage-class modifiers include the **`static`** and **`extern`** keywords. However, these keywords are part of the ISO C standard and aren't covered by extended attribute syntax.
1716

1817
## Syntax
1918

20-
*storage-class-specifier*:<br/>
21-
&nbsp;&nbsp;&nbsp;&nbsp;**__declspec (** *extended-decl-modifier-seq* **)** /\* Microsoft-specific \*/
19+
*`storage-class-specifier`*:<br/>
20+
&emsp;**`__declspec (`** *`extended-decl-modifier-seq`* **`)`** /\* Microsoft-specific \*/
2221

23-
*extended-decl-modifier-seq*:&nbsp;&nbsp;&nbsp;&nbsp;/\* Microsoft-specific \*/<br/>
24-
&nbsp;&nbsp;&nbsp;&nbsp;*extended-decl-modifier*<sub>opt</sub><br/>
25-
&nbsp;&nbsp;&nbsp;&nbsp;*extended-decl-modifier-seq* *extended-decl-modifier*
22+
*`extended-decl-modifier-seq`*:&emsp;/\* Microsoft-specific \*/<br/>
23+
&emsp;*`extended-decl-modifier`*<sub>opt</sub><br/>
24+
&emsp;*`extended-decl-modifier-seq`* *`extended-decl-modifier`*
2625

27-
*extended-decl-modifier*:&nbsp;&nbsp;&nbsp;&nbsp;/\* Microsoft-specific \*/<br/>
28-
&nbsp;&nbsp;&nbsp;&nbsp;**`thread`**<br/>
29-
&nbsp;&nbsp;&nbsp;&nbsp;**`naked`**<br/>
30-
&nbsp;&nbsp;&nbsp;&nbsp;**`dllimport`**<br/>
31-
&nbsp;&nbsp;&nbsp;&nbsp;**`dllexport`**
26+
*`extended-decl-modifier`*:&emsp;/\* Microsoft-specific \*/<br/>
27+
&emsp;**`thread`**<br/>
28+
&emsp;**`naked`**<br/>
29+
&emsp;**`dllimport`**<br/>
30+
&emsp;**`dllexport`**
3231

33-
White space separates the declaration modifiers. Note that *extended-decl-modifier-seq* can be empty; in this case, __declspec has no effect.
32+
White space separates the declaration modifiers. An *`extended-decl-modifier-seq`* can be empty; in this case, **`__declspec`** has no effect.
3433

35-
The thread, naked, dllimport, and dllexport storage-class attributes are a property only of the declaration of the data or function to which they are applied; they do not redefine the type attributes of the function itself. The thread attribute affects data only. The naked attribute affects functions only. The dllimport and dllexport attributes affect functions and data.
34+
The **`thread`**, **`naked`**, **`dllimport`**, and **`dllexport`** storage-class attributes are a property only of the declaration of the data or function to which they're applied. They don't redefine the type attributes of the function itself. The **`thread`** attribute affects data only. The **`naked`** attribute affects functions only. The **`dllimport`** and **`dllexport`** attributes affect functions and data.
3635

3736
**END Microsoft Specific**
3837

3938
## See also
4039

41-
[Declarations and Types](../c-language/declarations-and-types.md)
40+
[Declarations and types](../c-language/declarations-and-types.md)

0 commit comments

Comments
 (0)