Skip to content

Commit 904091a

Browse files
authored
Merge pull request #3615 from MicrosoftDocs/master
6/11/2021 AM Publish
2 parents 569cc08 + ec5f24c commit 904091a

40 files changed

+2254
-992
lines changed

docs/build-insights/get-started-with-cpp-build-insights.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,12 @@ Read these articles from the official C++ team blog for more information on C++
4848

4949
[Faster builds with PCH suggestions from C++ Build Insights](https://devblogs.microsoft.com/cppblog/faster-builds-with-pch-suggestions-from-c-build-insights/)
5050

51+
[Profiling template metaprograms with C++ Build Insights](https://devblogs.microsoft.com/cppblog/profiling-template-metaprograms-with-cpp-build-insights/)
52+
53+
[Improving code generation time with C++ Build Insights](https://devblogs.microsoft.com/cppblog/improving-code-generation-time-with-cpp-build-insights/)
54+
55+
[Introducing vcperf /timetrace for C++ build time analysis](https://devblogs.microsoft.com/cppblog/introducing-vcperf-timetrace-for-cpp-build-time-analysis/)
56+
57+
[Faster C++ builds, simplified: a new metric for time](https://devblogs.microsoft.com/cppblog/faster-cpp-builds-simplified-a-new-metric-for-time/)
58+
5159
::: moniker-end
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: "TRANSLATION_UNIT_TYPE_DATA enum"
3+
description: "The C++ Build Insights SDK TRANSLATION_UNIT_TYPE_DATA enum reference."
4+
ms.date: "06/10/2021"
5+
helpviewer_keywords: ["C++ Build Insights", "C++ Build Insights SDK", "TRANSLATION_UNIT_TYPE_DATA", "throughput analysis", "build time analysis", "vcperf.exe"]
6+
---
7+
# TRANSLATION_UNIT_TYPE_DATA enum
8+
9+
::: moniker range="<=msvc-140"
10+
11+
The C++ Build Insights SDK is compatible with Visual Studio 2017 and above. To see the documentation for these versions, set the Visual Studio **Version** selector control for this article to Visual Studio 2017 or Visual Studio 2019. It's found at the top of the table of contents on this page.
12+
13+
::: moniker-end
14+
::: moniker range=">=msvc-150"
15+
16+
The `TRANSLATION_UNIT_TYPE_DATA` structure describes the type of the translation unit in the compiler front end pass.
17+
18+
## Syntax
19+
20+
```cpp
21+
typedef struct TRANSLATION_UNIT_TYPE_DATA_TAG
22+
{
23+
int TranslationUnitType;
24+
25+
} TRANSLATION_UNIT_TYPE_DATA;
26+
```
27+
28+
## Members
29+
30+
| Name | Description |
31+
|--|--|
32+
| `TranslationUnitType` | The type of this translation unit (either modules, header unit, or precompiled header). |
33+
34+
## Remarks
35+
36+
Used by the C SDK functions.
37+
38+
::: moniker-end
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: "TRANSLATION_UNIT_TYPE enum"
3+
description: "The C++ Build Insights SDK TRANSLATION_UNIT_TYPE enum reference."
4+
ms.date: "06/10/2021"
5+
helpviewer_keywords: ["C++ Build Insights", "C++ Build Insights SDK", "TRANSLATION_UNIT_TYPE", "throughput analysis", "build time analysis", "vcperf.exe"]
6+
---
7+
# TRANSLATION_UNIT_TYPE enum
8+
9+
::: moniker range="<=msvc-140"
10+
11+
The C++ Build Insights SDK is compatible with Visual Studio 2017 and above. To see the documentation for these versions, set the Visual Studio **Version** selector control for this article to Visual Studio 2017 or Visual Studio 2019. It's found at the top of the table of contents on this page.
12+
13+
::: moniker-end
14+
::: moniker range=">=msvc-150"
15+
16+
The `TRANSLATION_UNIT_TYPE` enum.
17+
18+
## Members
19+
20+
| Name | Value | Description |
21+
|--|--|--|
22+
| `TRANSLATION_UNIT_TYPE_MODULE` | 0 (0x00000000) | The type of this translation unit is a module interface. |
23+
| `TRANSLATION_UNIT_TYPE_HEADER_UNIT` | 1 (0x00000001) | The type of this translation unit is a header unit. |
24+
| `TRANSLATION_UNIT_TYPE_PRECOMPILED_HEADER` | 2 (0x00000002) | The type of this translation unit is a precompiled header (PCH). |
25+
26+
## Remarks
27+
28+
Used by the C SDK functions.
29+
30+
::: moniker-end
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: "HeaderUnit class"
3+
description: "The C++ Build Insights SDK HeaderUnit class reference."
4+
ms.date: "06/08/2021"
5+
helpviewer_keywords: ["C++ Build Insights", "C++ Build Insights SDK", "HeaderUnit", "throughput analysis", "build time analysis", "vcperf.exe"]
6+
---
7+
# HeaderUnit class
8+
9+
::: moniker range="<=msvc-140"
10+
11+
The C++ Build Insights SDK is compatible with Visual Studio 2017 and above. To see the documentation for these versions, set the Visual Studio **Version** selector control for this article to Visual Studio 2017 or Visual Studio 2019. It's found at the top of the table of contents on this page.
12+
13+
::: moniker-end
14+
::: moniker range=">=msvc-150"
15+
16+
The `HeaderUnit` class is used with the [MatchEvent](../functions/match-event.md), [MatchEventInMemberFunction](../functions/match-event-in-member-function.md), [MatchEventStack](../functions/match-event-stack.md), and [MatchEventStackInMemberFunction](../functions/match-event-stack-in-member-function.md) functions. Use it to match a [HEADER_UNIT](../event-table.md#header-unit) event.
17+
18+
## Syntax
19+
20+
```cpp
21+
class HeaderUnit : public TranslationUnitType
22+
{
23+
public:
24+
HeaderUnit(const RawEvent& event);
25+
};
26+
```
27+
28+
## Members
29+
30+
Along with the inherited members from its [TranslationUnitType](translation-unit-type.md) base class, the `HeaderUnit` class contains the following members:
31+
32+
### Constructors
33+
34+
[HeaderUnit](#header-unit)
35+
36+
### Functions
37+
38+
None
39+
40+
## <a name="header-unit"></a> HeaderUnit
41+
42+
```cpp
43+
HeaderUnit(const RawEvent& event);
44+
```
45+
46+
### Parameters
47+
48+
*event*\
49+
A [HEADER_UNIT](../event-table.md#header-unit) event.
50+
51+
::: moniker-end
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: "Module class"
3+
description: "The C++ Build Insights SDK Module class reference."
4+
ms.date: "06/08/2021"
5+
helpviewer_keywords: ["C++ Build Insights", "C++ Build Insights SDK", "Module", "throughput analysis", "build time analysis", "vcperf.exe"]
6+
---
7+
# Module class
8+
9+
::: moniker range="<=msvc-140"
10+
11+
The C++ Build Insights SDK is compatible with Visual Studio 2017 and above. To see the documentation for these versions, set the Visual Studio **Version** selector control for this article to Visual Studio 2017 or Visual Studio 2019. It's found at the top of the table of contents on this page.
12+
13+
::: moniker-end
14+
::: moniker range=">=msvc-150"
15+
16+
The `Module` class is used with the [MatchEvent](../functions/match-event.md), [MatchEventInMemberFunction](../functions/match-event-in-member-function.md), [MatchEventStack](../functions/match-event-stack.md), and [MatchEventStackInMemberFunction](../functions/match-event-stack-in-member-function.md) functions. Use it to match a [MODULE](../event-table.md#module) event.
17+
18+
## Syntax
19+
20+
```cpp
21+
class Module : public TranslationUnitType
22+
{
23+
public:
24+
Module(const RawEvent& event);
25+
};
26+
```
27+
28+
## Members
29+
30+
Along with the inherited members from its [TranslationUnitType](translation-unit-type.md) base class, the `Module` class contains the following members:
31+
32+
### Constructors
33+
34+
[Module](#module)
35+
36+
### Functions
37+
38+
None
39+
40+
## <a name="module"></a> Module
41+
42+
```cpp
43+
Module(const RawEvent& event);
44+
```
45+
46+
### Parameters
47+
48+
*event*\
49+
A [MODULE](../event-table.md#module) event.
50+
51+
::: moniker-end
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: "PrecompiledHeader class"
3+
description: "The C++ Build Insights SDK PrecompiledHeader class reference."
4+
ms.date: "06/08/2021"
5+
helpviewer_keywords: ["C++ Build Insights", "C++ Build Insights SDK", "PrecompiledHeader", "throughput analysis", "build time analysis", "vcperf.exe"]
6+
---
7+
# PrecompiledHeader class
8+
9+
::: moniker range="<=msvc-140"
10+
11+
The C++ Build Insights SDK is compatible with Visual Studio 2017 and above. To see the documentation for these versions, set the Visual Studio **Version** selector control for this article to Visual Studio 2017 or Visual Studio 2019. It's found at the top of the table of contents on this page.
12+
13+
::: moniker-end
14+
::: moniker range=">=msvc-150"
15+
16+
The `PrecompiledHeader` class is used with the [MatchEvent](../functions/match-event.md), [MatchEventInMemberFunction](../functions/match-event-in-member-function.md), [MatchEventStack](../functions/match-event-stack.md), and [MatchEventStackInMemberFunction](../functions/match-event-stack-in-member-function.md) functions. Use it to match a [PRECOMPILED_HEADER](../event-table.md#precompiled-header) event.
17+
18+
## Syntax
19+
20+
```cpp
21+
class PrecompiledHeader : public TranslationUnitType
22+
{
23+
public:
24+
PrecompiledHeader(const RawEvent& event);
25+
};
26+
```
27+
28+
## Members
29+
30+
Along with the inherited members from its [TranslationUnitType](translation-unit-type.md) base class, the `PrecompiledHeader` class contains the following members:
31+
32+
### Constructors
33+
34+
[PrecompiledHeader](#precompiled-header)
35+
36+
### Functions
37+
38+
None
39+
40+
## <a name="precompiled-header"></a> PrecompiledHeader
41+
42+
```cpp
43+
PrecompiledHeader(const RawEvent& event);
44+
```
45+
46+
### Parameters
47+
48+
*event*\
49+
A [PRECOMPILED_HEADER](../event-table.md#precompiled-header) event.
50+
51+
::: moniker-end
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
title: "TranslationUnitType class"
3+
description: "The C++ Build Insights SDK TranslationUnitType class reference."
4+
ms.date: "06/08/2021"
5+
helpviewer_keywords: ["C++ Build Insights", "C++ Build Insights SDK", "TranslationUnitType", "throughput analysis", "build time analysis", "vcperf.exe"]
6+
---
7+
# TranslationUnitType class
8+
9+
::: moniker range="<=msvc-140"
10+
11+
The C++ Build Insights SDK is compatible with Visual Studio 2017 and above. To see the documentation for these versions, set the Visual Studio **Version** selector control for this article to Visual Studio 2017 or Visual Studio 2019. It's found at the top of the table of contents on this page.
12+
13+
::: moniker-end
14+
::: moniker range=">=msvc-150"
15+
16+
The `TranslationUnitType` class is used with the [MatchEvent](../functions/match-event.md), [MatchEventInMemberFunction](../functions/match-event-in-member-function.md), [MatchEventStack](../functions/match-event-stack.md), and [MatchEventStackInMemberFunction](../functions/match-event-stack-in-member-function.md) functions. Use it to match a [TRANSLATION_UNIT_TYPE](../event-table.md#translation-unit-type) event.
17+
18+
## Syntax
19+
20+
```cpp
21+
class TranslationUnitType : public SimpleEvent
22+
{
23+
public:
24+
enum class Type
25+
{
26+
MODULE = TRANSLATION_UNIT_TYPE_MODULE,
27+
HEADER_UNIT = TRANSLATION_UNIT_TYPE_HEADER_UNIT,
28+
PCH = TRANSLATION_UNIT_TYPE_PRECOMPILED_HEADER
29+
};
30+
31+
TranslationUnitType(const RawEvent& event);
32+
33+
Type Type() const;
34+
};
35+
```
36+
37+
## Members
38+
39+
Along with the inherited members from its [SimpleEvent](simple-event.md) base class, the `TranslationUnitType` class contains the following members:
40+
41+
### Constructors
42+
43+
[TranslationUnitType](#translation-unit-type)
44+
45+
### Functions
46+
47+
[Type](#type)
48+
49+
## <a name="type"></a> Type
50+
51+
```cpp
52+
Type Type() const;
53+
```
54+
55+
### Return Value
56+
57+
The type of the translation unit: either MODULE, HEADER_UNIT, or PCH.
58+
59+
## <a name="translation-unit-type"></a> TranslationUnitType
60+
61+
```cpp
62+
TranslationUnitType(const RawEvent& event);
63+
```
64+
65+
### Parameters
66+
67+
*event*\
68+
A [TRANSLATION_UNIT_TYPE](../event-table.md#translation-unit-type) event.
69+
70+
::: moniker-end

docs/build-insights/reference/sdk/event-table.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ The C++ Build Insights SDK is compatible with Visual Studio 2017 and above. To s
2828
[C1_DLL](#c1-dll)\
2929
[FRONT_END_FILE](#front-end-file)\
3030
[TEMPLATE_INSTANTIATION](#template-instantiation)\
31-
[SYMBOL_NAME](#symbol-name)
31+
[SYMBOL_NAME](#symbol-name)\
32+
[MODULE](#module)\
33+
[HEADER_UNIT](#header-unit)\
34+
[PRECOMPILED_HEADER](#precompiled-header)
3235

3336
## Compiler back-end events
3437

@@ -143,7 +146,7 @@ The C++ Build Insights SDK is compatible with Visual Studio 2017 and above. To s
143146
| | Description | Occurs when the compiler front end starts and stops processing a file. This event is recursive. Recursion happens when the front end is parsing included files. |
144147
| <a name="front-end-pass"></a> FRONT_END_PASS | Type | Activity |
145148
| | Parents | [COMPILER](#compiler) |
146-
| | Children | [C1_DLL](#c1-dll) |
149+
| | Children | [C1_DLL](#c1-dll)<br/>[MODULE](#module)<br/>[HEADER_UNIT](#header-unit)<br/>[PRECOMPILED_HEADER](#precompiled-header) |
147150
| | Properties | - Absolute path to input source file<br/>- Absolute path to output object file |
148151
| | Capture classes | [Activity](cpp-event-data-types/activity.md)<br/>[CompilerPass](cpp-event-data-types/compiler-pass.md)<br/>[FrontEndPass](cpp-event-data-types/front-end-pass.md) |
149152
| | Description | Occurs at the start and stop of the compiler front-end pass. This pass is responsible for parsing C/C++ source code and converting it into intermediate language. |
@@ -153,6 +156,12 @@ The C++ Build Insights SDK is compatible with Visual Studio 2017 and above. To s
153156
| | Properties | - Name of the function |
154157
| | Capture classes | [Activity](cpp-event-data-types/activity.md)<br/>[Function](cpp-event-data-types/function.md) |
155158
| | Description | Occurs when starting and ending generating the code for a function. |
159+
| <a name="header-unit"></a> HEADER_UNIT | Type | Activity |
160+
| | Parents | [FRONT_END_PASS](#front-end-pass) |
161+
| | Children | None |
162+
| | Properties | None |
163+
| | Capture classes | [SimpleEvent](cpp-event-data-types/simple-event.md)<br/>[TranslationUnitType](cpp-event-data-types/translation-unit-type.md)<br/>[HeaderUnit](cpp-event-data-types/header-unit.md) |
164+
| | Description | Occurs at the start of the front-end pass and represents that a header unit translation unit is being processed. |
156165
| <a name="imp-lib-output"></a> IMP_LIB_OUTPUT | Type | Simple Event |
157166
| | Parents | [LINKER](#linker) |
158167
| | Children | None |
@@ -177,6 +186,12 @@ The C++ Build Insights SDK is compatible with Visual Studio 2017 and above. To s
177186
| | Properties | None |
178187
| | Capture classes | [Activity](cpp-event-data-types/activity.md)<br/>[LTCG](cpp-event-data-types/ltcg.md) |
179188
| | Description | Occurs at the start and stop of link-time code generation. |
189+
| <a name="module"></a> MODULE | Type | Activity |
190+
| | Parents | [FRONT_END_PASS](#front-end-pass) |
191+
| | Children | None |
192+
| | Properties | None |
193+
| | Capture classes | [SimpleEvent](cpp-event-data-types/simple-event.md)<br/>[TranslationUnitType](cpp-event-data-types/translation-unit-type.md)<br/>[Module](cpp-event-data-types/module.md) |
194+
| | Description | Occurs at the start of the front-end pass and represents that a module translation unit is being processed. |
180195
| <a name="obj-output"></a> OBJ_OUTPUT | Type | Simple Event |
181196
| | Parents | [COMPILER](#compiler) |
182197
| | Children | None |
@@ -213,6 +228,12 @@ The C++ Build Insights SDK is compatible with Visual Studio 2017 and above. To s
213228
| | Properties | None |
214229
| | Capture classes | [Activity](cpp-event-data-types/activity.md)<br/>[Pass2](cpp-event-data-types/pass2.md) |
215230
| | Description | Occurs at the start and stop of the linker's pass 2. |
231+
| <a name="precompiled-header"></a> PRECOMPILED_HEADER | Type | Activity |
232+
| | Parents | [FRONT_END_PASS](#front-end-pass) |
233+
| | Children | None |
234+
| | Properties | None |
235+
| | Capture classes | [SimpleEvent](cpp-event-data-types/simple-event.md)<br/>[TranslationUnitType](cpp-event-data-types/translation-unit-type.md)<br/>[PrecompiledHeader](cpp-event-data-types/precompiled-header.md) |
236+
| | Description | Occurs at the start of the front-end pass and represents that a precompiled header (PCH) translation unit is being processed. |
216237
| <a name="pre-ltcg-opt-ref"></a> PRE_LTCG_OPT_REF | Type | Activity |
217238
| | Parents | [PASS1](#pass1) |
218239
| | Children | None |
@@ -243,6 +264,12 @@ The C++ Build Insights SDK is compatible with Visual Studio 2017 and above. To s
243264
| | Properties | None |
244265
| | Capture classes | [Activity](cpp-event-data-types/activity.md)<br/>[TopDown](cpp-event-data-types/top-down.md) |
245266
| | Description | Occurs at the start and stop of the whole program analysis' top-down pass. |
267+
| <a name="translation-unit-type"></a> TRANSLATION_UNIT_TYPE | Type | Activity |
268+
| | Parents | [FRONT_END_PASS](#front-end-pass) |
269+
| | Children | [MODULE](#module)<br/>[HEADER_UNIT](#header-unit)<br/>[PRECOMPILED_HEADER](#precompiled-header) |
270+
| | Properties | - The type of translation unit. |
271+
| | Capture classes | [SimpleEvent](cpp-event-data-types/simple-event.md)<br/>[TranslationUnitType](cpp-event-data-types/translation-unit-type.md) |
272+
| | Description | Occurs at the start of the front-end pass. The type identifies whether this pass is processing a module, header unit, or precompiled header. |
246273
| <a name="whole-program-analysis"></a> WHOLE_PROGRAM_ANALYSIS | Type | Activity |
247274
| | Parents | [C2_DLL](#c2-dll) |
248275
| | Children | [BOTTOM_UP](#bottom-up)<br/>[TOP_DOWN](#top-down) |

0 commit comments

Comments
 (0)