Skip to content

Commit 7f80e59

Browse files
authored
Merge branch 'main' into overhaul-documentation-issue-section-in-how-to-report-a-problem-with-the-visual-cpp-toolset
2 parents 65b3645 + 354da21 commit 7f80e59

File tree

2,656 files changed

+15993
-11370
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,656 files changed

+15993
-11370
lines changed

docs/assembler/arm/arm-assembler-command-line-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ms.date: 05/09/2022
55
---
66
# ARM Assembler command-line reference
77

8-
The Microsoft ARM assemblers, **armasm** and **armasm64**, support several command-line options. By default, **armasm** assembles ARMv7 Thumb assembly language into the Microsoft implementation of the Common Object File Format (COFF). The **armasm64** assembler creates COFF object code for ARM64 and ARM64EC targets. The linker can link COFF code objects produced by both the ARM assembler and the C/C++ compiler. It can link either together with object libraries created by the librarian.
8+
The Microsoft ARM assemblers, **armasm** and **armasm64**, support several command-line options. By default, **armasm** assembles ARMv7 Thumb assembly language into the Microsoft implementation of the Common Object File Format (COFF). The **armasm64** assembler creates COFF object code for ARM64 and ARM64EC targets. The linker can link COFF code objects produced by both the ARM assembler and the MSVC compiler. It can link either together with object libraries created by the librarian.
99

1010
## Syntax
1111

docs/assembler/inline/asm.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
---
2-
description: "Learn more about: `__asm`"
32
title: "__asm"
4-
ms.date: "10/09/2018"
3+
description: "Learn more about: `__asm`"
4+
ms.date: 10/09/2018
5+
ms.topic: reference
56
f1_keywords: ["__asm", "_asm", "__asm_cpp"]
67
helpviewer_keywords: ["__asm keyword [C++], vs. asm blocks", "__asm keyword [C++]"]
7-
ms.assetid: 77ff3bc9-a492-4b5e-85e1-fa4e414e79cd
8-
ms.topic: reference
98
---
109
# `__asm`
1110

@@ -14,7 +13,7 @@ ms.topic: reference
1413
The **`__asm`** keyword invokes the inline assembler and can appear wherever a C or C++ statement is legal. It can't appear by itself. It must be followed by an assembly instruction, a group of instructions enclosed in braces, or, at minimum, an empty pair of braces. The term "**`__asm`** block" here refers to any instruction or group of instructions, whether or not in braces.
1514

1615
> [!NOTE]
17-
> Visual C++ support for the Standard C++ **`asm`** keyword is limited to the fact that the compiler will not generate an error on the keyword. However, an **`asm`** block will not generate any meaningful code. Use **`__asm`** instead of **`asm`**.
16+
> MSVC support for the Standard C++ **`asm`** keyword is limited to the fact that the compiler will not generate an error on the keyword. However, an **`asm`** block will not generate any meaningful code. Use **`__asm`** instead of **`asm`**.
1817
1918
## Grammar
2019

@@ -28,7 +27,7 @@ The **`__asm`** keyword invokes the inline assembler and can appear wherever a C
2827

2928
## Remarks
3029

31-
If used without braces, the **`__asm`** keyword means that the rest of the line is an assembly-language statement. If used with braces, it means that each line between the braces is an assembly-language statement. For compatibility with previous versions, **`_asm`** is a synonym for **`__asm`**.
30+
If used without braces, the **`__asm`** keyword means that the rest of the line is an assembly-language statement. If used with braces, it means that each line between the braces is an assembly-language statement. For compatibility with previous versions, **`_asm`** is a synonym for **`__asm`** unless compiler option [`/Za` (Disable language extensions)](../../build/reference/za-ze-disable-language-extensions.md) is specified.
3231

3332
Since the **`__asm`** keyword is a statement separator, you can put assembly instructions on the same line.
3433

@@ -42,8 +41,6 @@ didn't cause native code to be generated when compiled with **/clr**; the compil
4241

4342
`__asm int 3` now results in native code generation for the function. If you want a function to cause a break point in your code and if you want that function compiled to MSIL, use [__debugbreak](../../intrinsics/debugbreak.md).
4443

45-
For compatibility with previous versions, **`_asm`** is a synonym for **`__asm`** unless compiler option [/Za \(Disable language extensions)](../../build/reference/za-ze-disable-language-extensions.md) is specified.
46-
4744
## Example
4845

4946
The following code fragment is a simple **`__asm`** block enclosed in braces:
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
---
2-
description: "Learn more about: EVEN and ALIGN Directives"
32
title: "EVEN and ALIGN Directives"
4-
ms.date: "08/30/2018"
3+
description: "Learn more about: EVEN and ALIGN Directives"
4+
ms.date: 08/30/2018
55
helpviewer_keywords: ["EVEN directive", "directives, MASM", "MASM (Microsoft Macro Assembler), directives", "NOP (no operation instruction)", "ALIGN directive"]
6-
ms.assetid: 7357ab2d-4a5c-43ca-accb-a5f21cdfcde5
76
---
8-
# EVEN and ALIGN Directives
7+
# `EVEN` and `ALIGN` Directives
98

109
**Microsoft Specific**
1110

12-
Although the inline assembler doesn't support most MASM directives, it does support `EVEN` and **ALIGN**. These directives put **NOP** (no operation) instructions in the assembly code as needed to align labels to specific boundaries. This makes instruction-fetch operations more efficient for some processors.
11+
Although the inline assembler doesn't support most MASM directives, it does support [`EVEN`](../masm/even.md) and [`ALIGN`](../masm/align-masm.md). These directives put `NOP` (no operation) instructions in the assembly code as needed to align labels to specific boundaries. This makes instruction-fetch operations more efficient for some processors.
1312

1413
**END Microsoft Specific**
1514

1615
## See also
1716

18-
[Using Assembly Language in __asm Blocks](../../assembler/inline/using-assembly-language-in-asm-blocks.md)<br/>
17+
[Using Assembly Language in `__asm` Blocks](using-assembly-language-in-asm-blocks.md)

docs/assembler/inline/instruction-set-for-inline-assembly.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ms.assetid: a45b5b22-9b5f-4545-81ec-70eb8ea2ef9b
1010

1111
**Microsoft Specific**
1212

13-
The Microsoft C++ compiler supports all opcodes through the Pentium 4 and AMD Athlon. Additional instructions supported by the target processor can be created with the [_emit Pseudoinstruction](../../assembler/inline/emit-pseudoinstruction.md).
13+
The MSVC compiler supports all opcodes through the Pentium 4 and AMD Athlon. Additional instructions supported by the target processor can be created with the [_emit Pseudoinstruction](../../assembler/inline/emit-pseudoinstruction.md).
1414

1515
**END Microsoft Specific**
1616

docs/assembler/inline/intel-s-mmx-instruction-set.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ms.assetid: 705deb2d-c3fd-4696-9e22-8bcf25866daf
1010

1111
**Microsoft Specific**
1212

13-
The Microsoft C++ compiler allows you to use Intel's MMX (multimedia extension) instruction set in the inline assembler. The MMX instructions are also supported by the debugger disassembly. The compiler generates a warning message if the function contains MMX instructions but does not contain an EMMS instruction to empty the multimedia state. For more information, see the Intel Web site.
13+
The MSVC compiler allows you to use Intel's MMX (multimedia extension) instruction set in the inline assembler. The MMX instructions are also supported by the debugger disassembly. The compiler generates a warning message if the function contains MMX instructions but does not contain an EMMS instruction to empty the multimedia state. For more information, see the Intel Web site.
1414

1515
**END Microsoft Specific**
1616

docs/assembler/masm/even.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
---
2-
description: "Learn more about: EVEN"
32
title: "EVEN"
4-
ms.date: "12/17/2019"
3+
description: "Learn more about: EVEN"
4+
ms.date: 12/17/2019
55
f1_keywords: ["EVEN"]
66
helpviewer_keywords: ["EVEN directive"]
7-
ms.assetid: 68938ba4-8cb9-44d4-914e-9f9fee6bcbf4
87
---
9-
# EVEN
8+
# `EVEN`
109

1110
Aligns the next variable or instruction on an even byte.
1211

@@ -16,5 +15,6 @@ Aligns the next variable or instruction on an even byte.
1615
1716
## See also
1817

18+
[`ALIGN`](align-masm.md)\
1919
[Directives reference](directives-reference.md)\
2020
[MASM BNF Grammar](masm-bnf-grammar.md)

docs/assembler/masm/option-language-masm.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
description: Learn more about the alternatives for the OPTION LANGUAGE directive
32
title: "OPTION LANGUAGE"
3+
description: "Learn more about the alternatives for the OPTION LANGUAGE directive"
44
ms.date: 09/21/2021
55
f1_keywords: ["language"]
66
helpviewer_keywords: ["OPTION LANGUAGE directive"]
@@ -20,11 +20,11 @@ Available languages include:
2020
:::row:::
2121
:::column span="":::
2222
**`C`**\
23-
**`SYSCALL`**\
23+
**`SYSCALL`**
2424
:::column-end:::
2525
:::column span="":::
2626
**`STDCALL`**\
27-
**`PASCAL`**\
27+
**`PASCAL`**
2828
:::column-end:::
2929
:::column span="":::
3030
**`FORTRAN`**\

docs/atl/reference/csnapinpropertypageimpl-class.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
2-
description: "Learn more about: CSnapInPropertyPageImpl Class"
32
title: "CSnapInPropertyPageImpl Class"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: CSnapInPropertyPageImpl Class"
4+
ms.date: 11/04/2016
55
f1_keywords: ["CSnapInPropertyPageImpl", "ATLSNAP/ATL::CSnapInPropertyPageImpl", "ATLSNAP/ATL::CSnapInPropertyPageImpl::CSnapInPropertyPageImpl", "ATLSNAP/ATL::CSnapInPropertyPageImpl::CancelToClose", "ATLSNAP/ATL::CSnapInPropertyPageImpl::Create", "ATLSNAP/ATL::CSnapInPropertyPageImpl::OnApply", "ATLSNAP/ATL::CSnapInPropertyPageImpl::OnHelp", "ATLSNAP/ATL::CSnapInPropertyPageImpl::OnKillActive", "ATLSNAP/ATL::CSnapInPropertyPageImpl::OnQueryCancel", "ATLSNAP/ATL::CSnapInPropertyPageImpl::OnReset", "ATLSNAP/ATL::CSnapInPropertyPageImpl::OnSetActive", "ATLSNAP/ATL::CSnapInPropertyPageImpl::OnWizardBack", "ATLSNAP/ATL::CSnapInPropertyPageImpl::OnWizardFinish", "ATLSNAP/ATL::CSnapInPropertyPageImpl::OnWizardNext", "ATLSNAP/ATL::CSnapInPropertyPageImpl::QuerySiblings", "ATLSNAP/ATL::CSnapInPropertyPageImpl::SetModified", "ATLSNAP/ATL::CSnapInPropertyPageImpl::m_psp"]
66
helpviewer_keywords: ["snap-ins, property pages", "snap-ins", "property pages, ATL", "CSnapInPropertyPageImpl class"]
7-
ms.assetid: 75bdce5a-985e-4166-bd44-493132e023c4
87
---
98
# CSnapInPropertyPageImpl Class
109

@@ -15,8 +14,9 @@ This class provides methods for implementing a snap-in property page object.
1514
1615
## Syntax
1716

18-
```
19-
CSnapInPropertyPageImpl : public CDialogImplBase
17+
```cpp
18+
template <class T, bool bAutoDelete = true>
19+
class ATL_NO_VTABLE CSnapInPropertyPageImpl : public CDialogImplBase
2020
```
2121
2222
## Members

docs/build-insights/index.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ landingContent:
1717
# Cards and links should be based on top customer tasks or top subjects
1818
# Start card title with a verb
1919
# Card (optional)
20-
- title: Learn how your build performs
20+
- title: Learn how your build performs
2121
linkLists:
2222
- linkListType: overview
2323
links:

docs/build-insights/tutorials/build-insights-function-view.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ Set the optimization level to maximum optimizations:
4545

4646
1. In the **Solution Explorer**, right-click the project name and select **Properties**.
4747
1. In the project properties, navigate to **C/C++** > **Optimization**.
48-
1. Set the **Optimization** dropdown to **Maximum Optimization (Favor Speed) ([`/O2`](../../build/reference/ob-inline-function-expansion.md))**.
48+
1. Set the **Optimization** dropdown to **Maximum Optimization (Favor Speed) ([`/O2`](../../build/reference/o1-o2-minimize-size-maximize-speed.md))**.
4949

5050
:::image type="content" source="./media/max-optimization-setting.png" alt-text="Screenshot of the project property pages dialog. The settings are open to Configuration Properties > C/C++ > Optimization. The Optimization dropdown is set to Maximum Optimization (Favor Speed) (/O2).":::
5151

5252
1. Click **OK** to close the dialog.
5353

5454
## Run Build Insights
5555

56-
On a project of your choosing, and using the **Release** build options set in the previous section, run Build Insights by choosing from the main menu **Build** > **Run Build Insights on Selection** > **Rebuild**. You can also right-click a project in the solution explorer and choose **Run Build Insights** > **Rebuild**. Choose **Rebuild** instead of **Build** to measure the build time for the entire project and not for just the few files may be dirty right now.
56+
On a project of your choosing, and using the **Release** build options set in the previous section, run Build Insights by choosing from the main menu **Build** > **Run Build Insights on Selection** > **Rebuild**. You can also right-click a project in the solution explorer and choose **Run Build Insights** > **Rebuild**. Choose **Rebuild** instead of **Build** to measure the build time for the entire project and not for just the few files that may be dirty right now.
5757

5858
:::image type="content" source="./media/build-insights-rebuild-project.png" alt-text="Screenshot of the main menu with Run Build Insights on Selection > Rebuild selected.":::
5959

@@ -69,9 +69,9 @@ In the Function Name column, performPhysicsCalculations() is highlighted and mar
6969

7070
The **Time [sec, %]** column shows how long it took to compile each function in [wall clock responsibility time (WCTR)](https://devblogs.microsoft.com/cppblog/faster-cpp-builds-simplified-a-new-metric-for-time/#:~:text=Today%2C%20we%E2%80%99d%20like%20to%20teach%20you%20about%20a,your%20build%2C%20even%20in%20the%20presence%20of%20parallelism). This metric distributes the wall clock time among functions based on their use of parallel compiler threads. For example, if two different threads are compiling two different functions simultaneously within a one-second period, each function's WCTR is recorded as 0.5 seconds. This reflects each function's proportional share of the total compilation time, taking into account the resources each consumed during parallel execution. Thus, WCTR provides a better measure of the impact each function has on the overall build time in environments where multiple compilation activities occur simultaneously.
7171

72-
The **Forceinline Size** column shows roughly how many instructions were generated for the function. Click the chevron before the function name to see the individual inlined functions that were expanded in that function how roughly how many instructions were generated for each.
72+
The **Forceinline Size** column shows roughly how many instructions were generated for the function. Click the chevron before the function name to see the individual inlined functions that were expanded in that function and roughly how many instructions were generated for each.
7373

74-
You can sort the list by clicking on the **Time** column to see which functions are taking the most time to compile. A 'fire' icon indicates that cost of generating that function is high and is worth investigating. Excessive use of `__forceinline` functions can significantly slow compilation.
74+
You can sort the list by clicking on the **Time** column to see which functions are taking the most time to compile. A 'fire' icon indicates that the cost of generating that function is high and is worth investigating. Excessive use of `__forceinline` functions can significantly slow compilation.
7575

7676
You can search for a specific function by using the **Filter Functions** box. If a function's code generation time is too small, it doesn't appear in the **Functions** View.
7777

@@ -89,7 +89,7 @@ By selecting the chevron before that function, and then sorting the **Forceinlin
8989
performPhysicsCalculations() is expanded and shows a long list of functions that were inlined inside it. There are multiple instances of functions such as complexOperation(), recursiveHelper(), and sin() shown. The Forceinline Size column shows that complexOperation() is the largest inlined function at 315 instructions. recursiveHelper() has 119 instructions. Sin() has 75 instructions, but there are many more instances of it than the other functions.
9090
:::image-end:::
9191

92-
There are some larger inlined functions, such as `Vector2D<float>::complexOperation()` and `Vector2D<float>::recursiveHelper()` that are contributing to the problem. But there are many more instances (not all shown here) of `Vector2d<float>::sin(float)`, `Vector2d<float>::cos(float)`, `Vector2D<float>::power(float,int)`, and `Vector2D<float>::factorial(int)`. When you add those up, the total number of generated instructions quickly exceeds the few larger generated functions.
92+
There are some larger inlined functions, such as `Vector2D<float>::complexOperation()` and `Vector2D<float>::recursiveHelper()` that are contributing to the problem. But there are many more instances (not all shown here) of `Vector2D<float>::sin(float)`, `Vector2D<float>::cos(float)`, `Vector2D<float>::power(float,int)`, and `Vector2D<float>::factorial(int)`. When you add those up, the total number of generated instructions quickly exceeds the few larger generated functions.
9393

9494
Looking at those functions in the source code, we see that execution time is going to be spent inside loops. For example, here's the code for `factorial()`:
9595

@@ -108,15 +108,15 @@ static __forceinline T factorial(int n)
108108
109109
Perhaps the overall cost of calling this function is insignificant compared to the cost of the function itself. Making a function inline is most beneficial when the time it takes to call the function (pushing arguments on the stack, jumping to the function, popping return arguments, and returning from the function) is roughly similar to the time it takes to execute the function, and when the function is called a lot. When that's not the case, there may be diminishing returns on making it inline. We can try removing the `__forceinline` directive from it to see if it helps the build time. The code for `power`, `sin()`, and `cos()` is similar in that the code consists of a loop that executes many times. We can try removing the `__forceinline` directive from those functions as well.
110110
111-
We rerun Build Insights from the main menu by choosing **Build** > **Run Build Insights on Selection** > **Rebuild**. You can also right-click a project in the solution explorer and choose **Run Build Insights** > **Rebuild**. We choose **Rebuild** instead of **Build** to measure the build time for the entire project, as before, and not for just the few files may be dirty right now.
111+
We rerun Build Insights from the main menu by choosing **Build** > **Run Build Insights on Selection** > **Rebuild**. You can also right-click a project in the solution explorer and choose **Run Build Insights** > **Rebuild**. We choose **Rebuild** instead of **Build** to measure the build time for the entire project, as before, and not for just the few files that may be dirty right now.
112112
113113
The build time goes from 25.181 seconds to 13.376 seconds and the `performPhysicsCalculations` function doesn't show up anymore in the **Functions** view because it doesn't contribute enough to the build time to be counted.
114114
115115
:::image type="complex" source="./media/functions-view-after-fix.png" alt-text="Screenshot of the 2D vector header file.":::
116116
In the Function Name column, performPhysicsCalculations() is highlighted and marked with a fire icon.
117117
:::image-end:::
118118
119-
The Diagnostics Session time is the overall time it took do the build plus any overhead for gathering the Build Insights data.
119+
The Diagnostics Session time is the overall time it took to do the build plus any overhead for gathering the Build Insights data.
120120
121121
The next step would be to profile the application to see if the performance of the application is negatively impacted by the change. If it is, we can selectively add `__forceinline` back as needed.
122122
@@ -145,7 +145,7 @@ Double-click, right-click, or press **Enter** while on a file in the **Functions
145145
[Build Insights tips and tricks](build-insights-tips.md)\
146146
[Inline functions (C++)](../../cpp/inline-functions-cpp.md)\
147147
[Faster C++ builds, simplified: a new metric for time](https://devblogs.microsoft.com/cppblog/faster-cpp-builds-simplified-a-new-metric-for-time)\
148-
[Build Insights in Visual Studio video - Pure Virtual C++ 2023](/events/pure-virtual-cpp-2023/build-insights-in-visual-studio)\
148+
[Build Insights in Visual Studio video - Pure Virtual C++ 2023](/shows/pure-virtual-cpp-2023/build-insights-in-visual-studio)\
149149
[Troubleshoot header file impact on build time](build-insights-included-files-view.md)\
150150
[Functions View for Build Insights in Visual Studio 2022 17.8](https://devblogs.microsoft.com/cppblog/functions-view-for-build-insights-in-visual-studio-2022-17-8/)\
151151
[Tutorial: vcperf and Windows Performance Analyzer](vcperf-and-wpa.md)\

0 commit comments

Comments
 (0)