Skip to content

Commit e94027f

Browse files
authored
Merge pull request #5057 from TylerMSFT/ifcmap
add /ifcMap article
2 parents 8bb46fe + 80e3419 commit e94027f

File tree

4 files changed

+97
-7
lines changed

4 files changed

+97
-7
lines changed

docs/build/reference/ifc-map.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
title: "/ifcMap"
3+
description: "Map named modules and header units to IFC files."
4+
ms.date: 10/13/2023
5+
author: "tylermsft"
6+
ms.author: "twhitney"
7+
f1_keywords: ["/ifcMap", "VC.Project.VCCLCompilerTool.ifcMap"]
8+
helpviewer_keywords: ["/ifcMap", "Specify named module and header unit mappings to IFC files."]
9+
---
10+
# `/ifcMap`
11+
12+
This switch tells the compiler where to find the [TOML](https://toml.io/en/) file that maps named modules and header units to their respective IFC (.ifc) files.
13+
14+
## Syntax
15+
16+
> **`/ifcMap`** *`filename`*
17+
18+
## Remarks
19+
20+
The *`filename`* argument specifies a TOML (Tom's Obvious Minimal Language) file. The file can be relative to the compiler's working directory, or an absolute path.
21+
Multiple `/ifcMap` arguments can be provided to the compiler.
22+
23+
The TOML file can contain a mix of `[[module]]` and `[[header-unit]]` references. Syntax errors or unrecognized table names result in compiler error `C7696` (TOML parse error).
24+
25+
### TOML for named modules
26+
27+
The format of the TOML file must adhere to the following specification for named modules:
28+
29+
```
30+
# Using literal strings
31+
[[module]]
32+
name = 'M'
33+
ifc = 'C:\modules\M.ifc'
34+
35+
# Using basic strings
36+
[[module]]
37+
name = "N"
38+
ifc = "C:\\modules\\N.ifc"
39+
```
40+
41+
This TOML file maps the named modules `'M'` and `'N'` to their respective IFC files. The equivalent [`/reference'](module-reference.md) is:
42+
43+
```cmd
44+
/reference M=C:\modules\M.ifc /reference N=C:\modules\N.ifc
45+
```
46+
47+
For more information about what types of module names are valid for the `name` field, see [`/reference remarks`](module-reference.md#remarks).
48+
49+
### TOML for header units
50+
51+
The format of the TOML for header units is:
52+
53+
```
54+
# Using literal strings
55+
[[header-unit]]
56+
name = ['quote', 'my-utility.h']
57+
ifc = 'C:\header-units\my-utility.h.ifc'
58+
59+
[[header-unit]]
60+
name = ['angle', 'vector']
61+
ifc = 'C:\header-units\vector.ifc'
62+
63+
# Using basic strings
64+
[[header-unit]]
65+
name = ["quote", "my-engine.h"]
66+
ifc = "C:\\header-units\\my-engine.h.ifc"
67+
68+
[[header-unit]]
69+
name = ["angle", "algorithm"]
70+
ifc = "C:\\header-units\\algorithm.ifc"
71+
```
72+
73+
When `[[header-unit]]` is specified in the TOML, the compiler implicitly enables [`/Zc:preprocessor`](zc-preprocessor.md), just as it's implicitly enabled when [`/headerUnit`](headerunit.md) is used. For more information about the behavior of the 'angle' and 'quote' lookup methods, see the [/headerUnit Remarks](headerunit.md#remarks).
74+
75+
### To set this compiler option in the Visual Studio development environment
76+
77+
1. Open the **Property Pages** dialog box for the project. For more information, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
78+
79+
1. Select the **Configuration Properties** > **C/C++** > **Command Line** property page.
80+
81+
1. In the **Additional options** box, add `/ifcMap tomlfile.toml`.
82+
83+
## See also
84+
85+
[Overview of modules in C++](../../cpp/modules-cpp.md)\
86+
[Walkthrough: Build and import header units in Visual C++ projects](../walkthrough-header-units.md)\
87+
[Using C++ Modules in MSVC from the Command Line](https://devblogs.microsoft.com/cppblog/using-cpp-modules-in-msvc-from-the-command-line-part-1/)

docs/build/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,8 @@ items:
620620
href: ../build/reference/i-additional-include-directories.md
621621
- name: /ifcOutput (Specify where the compiled `.ifc` should go.)
622622
href: ../build/reference/ifc-output.md
623+
- name: /ifcMap (Map named modules and header units to IFC files.)
624+
href: ../build/reference/ifc-map.md
623625
- name: /interface (Treat input file as a module interface unit)
624626
href: ../build/reference/interface.md
625627
- name: /internalPartition (Treat the input file as an internal partition unit.)

docs/cpp/modules-cpp.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import std.regex;
4545

4646
To consume the Microsoft Standard Library modules, compile your program with [`/EHsc`](../build/reference/eh-exception-handling-model.md) and [`/MD`](../build/reference/md-mt-ld-use-run-time-library.md) options.
4747

48-
## Basic example
48+
## Example
4949

5050
The following example shows a simple module definition in a source file called *`Example.ixx`*. The *`.ixx`* extension is required for module interface files in Visual Studio. In this example, the interface file contains both the function definition and the declaration. However, you can also place the definitions in one or more separate module implementation files, as shown in a later example. The `export module Example;` statement indicates that this file is the primary interface for a module called `Example`. The **`export`** modifier on `f()` indicates that this function is visible when `Example` is imported by another program or module. The module references a namespace `Example_NS`.
5151

@@ -111,7 +111,7 @@ The `import` declaration can appear only at global scope.
111111

112112
A *module interface* exports the module name and all the namespaces, types, functions, and so on that make up the public interface of the module. A *module implementation* defines the things exported by the module. In its simplest form, a module can consist of a single file that combines the module interface and implementation. You can also put the implementations in one or more separate module implementation files, similar to how *`.h`* and *`.cpp`* files are used.
113113

114-
For larger modules, you can split parts of the module into submodules called *partitions*. Each partition consists of a module interface file that exports a module partition name. A partition may also have one or more partition implementation files. The module as a whole has one *primary module interface*, the public interface of the module that may also import and export the partition interfaces.
114+
For larger modules, you can split parts of the module into submodules called *partitions*. Each partition consists of a module interface file that exports a module partition name. A partition might also have one or more partition implementation files. The module as a whole has one *primary module interface*, the public interface of the module that might also import and export the partition interfaces.
115115

116116
A module consists of one or more *module units*. A module unit is a translation unit (a source file) that contains a module declaration. There are several types of module units:
117117

@@ -203,4 +203,4 @@ import "myheader.h";
203203

204204
[`module`, `import`, `export`](import-export-module.md)\
205205
[Named modules tutorial](tutorial-named-modules-cpp.md)\
206-
[Compare header units, modules, and precompiled headers](../build/compare-inclusion-methods.md)
206+
[Compare header units, modules, and precompiled headers](../build/compare-inclusion-methods.md)

docs/error-messages/compiler-errors-2/compiler-errors-c7500-through-c7999.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
description: "Learn more about: Compiler errors C7500 through C7999"
33
title: "Compiler errors C7500 through C7999"
4-
ms.date: 04/18/2021
5-
f1_keywords: ["C7500", "C7501", "C7502", "C7503", "C7504", "C7505", "C7506", "C7507", "C7508", "C7509", "C7511", "C7512", "C7513", "C7514", "C7515", "C7516", "C7517", "C7518", "C7519", "C7520", "C7521", "C7522", "C7523", "C7524", "C7525", "C7526", "C7527", "C7528", "C7529", "C7530", "C7531", "C7532", "C7533", "C7534", "C7535", "C7537", "C7538", "C7539", "C7540", "C7541", "C7542", "C7543", "C7544", "C7545", "C7546", "C7547", "C7548", "C7549", "C7550", "C7551", "C7552", "C7554", "C7555", "C7556", "C7557", "C7558", "C7559", "C7560", "C7561", "C7562", "C7563", "C7564", "C7565", "C7566", "C7567", "C7568", "C7569", "C7570", "C7571", "C7572", "C7573", "C7574", "C7575", "C7576", "C7577", "C7578", "C7579", "C7580", "C7581", "C7582", "C7583", "C7584", "C7585", "C7586", "C7587", "C7588", "C7589", "C7590", "C7591", "C7592", "C7593", "C7594", "C7595", "C7596", "C7597", "C7599", "C7600", "C7601", "C7602", "C7603", "C7604", "C7605", "C7606", "C7607", "C7608", "C7609", "C7610", "C7611", "C7612", "C7613", "C7614", "C7615", "C7616", "C7617", "C7618", "C7619", "C7620", "C7621", "C7622", "C7623", "C7624", "C7625", "C7627", "C7628", "C7629", "C7630", "C7631", "C7632", "C7633", "C7634", "C7635", "C7636", "C7637", "C7638", "C7639", "C7640", "C7641", "C7642", "C7643", "C7644", "C7645", "C7646", "C7647", "C7648", "C7649", "C7650", "C7651", "C7652", "C7653", "C7654", "C7655", "C7656", "C7657", "C7658", "C7659", "C7660", "C7661", "C7662", "C7700", "C7701", "C7702", "C7703", "C7704"]
6-
helpviewer_keywords: ["C7500", "C7501", "C7502", "C7503", "C7504", "C7505", "C7506", "C7507", "C7508", "C7509", "C7511", "C7512", "C7513", "C7514", "C7515", "C7516", "C7517", "C7518", "C7519", "C7520", "C7521", "C7522", "C7523", "C7524", "C7525", "C7526", "C7527", "C7528", "C7529", "C7530", "C7531", "C7532", "C7533", "C7534", "C7535", "C7537", "C7538", "C7539", "C7540", "C7541", "C7542", "C7543", "C7544", "C7545", "C7546", "C7547", "C7548", "C7549", "C7550", "C7551", "C7552", "C7554", "C7555", "C7556", "C7557", "C7558", "C7559", "C7560", "C7561", "C7562", "C7563", "C7564", "C7565", "C7566", "C7567", "C7568", "C7569", "C7570", "C7571", "C7572", "C7573", "C7574", "C7575", "C7576", "C7577", "C7578", "C7579", "C7580", "C7581", "C7582", "C7583", "C7584", "C7585", "C7586", "C7587", "C7588", "C7589", "C7590", "C7591", "C7592", "C7593", "C7594", "C7595", "C7596", "C7597", "C7599", "C7600", "C7601", "C7602", "C7603", "C7604", "C7605", "C7606", "C7607", "C7608", "C7609", "C7610", "C7611", "C7612", "C7613", "C7614", "C7615", "C7616", "C7617", "C7618", "C7619", "C7620", "C7621", "C7622", "C7623", "C7624", "C7625", "C7627", "C7628", "C7629", "C7630", "C7631", "C7632", "C7633", "C7634", "C7635", "C7636", "C7637", "C7638", "C7639", "C7640", "C7641", "C7642", "C7643", "C7644", "C7645", "C7646", "C7647", "C7648", "C7649", "C7650", "C7651", "C7652", "C7653", "C7654", "C7655", "C7656", "C7657", "C7658", "C7659", "C7660", "C7661", "C7662", "C7700", "C7701", "C7702", "C7703", "C7704"]
4+
ms.date: 10/13/2023
5+
f1_keywords: ["C7500", "C7501", "C7502", "C7503", "C7504", "C7505", "C7506", "C7507", "C7508", "C7509", "C7511", "C7512", "C7513", "C7514", "C7515", "C7516", "C7517", "C7518", "C7519", "C7520", "C7521", "C7522", "C7523", "C7524", "C7525", "C7526", "C7527", "C7528", "C7529", "C7530", "C7531", "C7532", "C7533", "C7534", "C7535", "C7537", "C7538", "C7539", "C7540", "C7541", "C7542", "C7543", "C7544", "C7545", "C7546", "C7547", "C7548", "C7549", "C7550", "C7551", "C7552", "C7554", "C7555", "C7556", "C7557", "C7558", "C7559", "C7560", "C7561", "C7562", "C7563", "C7564", "C7565", "C7566", "C7567", "C7568", "C7569", "C7570", "C7571", "C7572", "C7573", "C7574", "C7575", "C7576", "C7577", "C7578", "C7579", "C7580", "C7581", "C7582", "C7583", "C7584", "C7585", "C7586", "C7587", "C7588", "C7589", "C7590", "C7591", "C7592", "C7593", "C7594", "C7595", "C7596", "C7597", "C7599", "C7600", "C7601", "C7602", "C7603", "C7604", "C7605", "C7606", "C7607", "C7608", "C7609", "C7610", "C7611", "C7612", "C7613", "C7614", "C7615", "C7616", "C7617", "C7618", "C7619", "C7620", "C7621", "C7622", "C7623", "C7624", "C7625", "C7627", "C7628", "C7629", "C7630", "C7631", "C7632", "C7633", "C7634", "C7635", "C7636", "C7637", "C7638", "C7639", "C7640", "C7641", "C7642", "C7643", "C7644", "C7645", "C7646", "C7647", "C7648", "C7649", "C7650", "C7651", "C7652", "C7653", "C7654", "C7655", "C7656", "C7657", "C7658", "C7659", "C7660", "C7661", "C7662", "C7696", "C7700", "C7701", "C7702", "C7703", "C7704"]
6+
helpviewer_keywords: ["C7500", "C7501", "C7502", "C7503", "C7504", "C7505", "C7506", "C7507", "C7508", "C7509", "C7511", "C7512", "C7513", "C7514", "C7515", "C7516", "C7517", "C7518", "C7519", "C7520", "C7521", "C7522", "C7523", "C7524", "C7525", "C7526", "C7527", "C7528", "C7529", "C7530", "C7531", "C7532", "C7533", "C7534", "C7535", "C7537", "C7538", "C7539", "C7540", "C7541", "C7542", "C7543", "C7544", "C7545", "C7546", "C7547", "C7548", "C7549", "C7550", "C7551", "C7552", "C7554", "C7555", "C7556", "C7557", "C7558", "C7559", "C7560", "C7561", "C7562", "C7563", "C7564", "C7565", "C7566", "C7567", "C7568", "C7569", "C7570", "C7571", "C7572", "C7573", "C7574", "C7575", "C7576", "C7577", "C7578", "C7579", "C7580", "C7581", "C7582", "C7583", "C7584", "C7585", "C7586", "C7587", "C7588", "C7589", "C7590", "C7591", "C7592", "C7593", "C7594", "C7595", "C7596", "C7597", "C7599", "C7600", "C7601", "C7602", "C7603", "C7604", "C7605", "C7606", "C7607", "C7608", "C7609", "C7610", "C7611", "C7612", "C7613", "C7614", "C7615", "C7616", "C7617", "C7618", "C7619", "C7620", "C7621", "C7622", "C7623", "C7624", "C7625", "C7627", "C7628", "C7629", "C7630", "C7631", "C7632", "C7633", "C7634", "C7635", "C7636", "C7637", "C7638", "C7639", "C7640", "C7641", "C7642", "C7643", "C7644", "C7645", "C7646", "C7647", "C7648", "C7649", "C7650", "C7651", "C7652", "C7653", "C7654", "C7655", "C7656", "C7657", "C7658", "C7659", "C7660", "C7661", "C7662", "C7696", "C7700", "C7701", "C7702", "C7703", "C7704"]
77
---
88
# Compiler errors C7500 through C7999
99

10-
The articles in this section of the documentation explain a subset of the error messages that are generated by the compiler.
10+
The articles in this section of the documentation explain a subset of the error messages generated by the compiler.
1111

1212
[!INCLUDE[error-boilerplate](../../error-messages/includes/error-boilerplate.md)]
1313

@@ -178,6 +178,7 @@ The articles in this section of the documentation explain a subset of the error
178178
| Compiler error C7661 | header-name '%s' has an ambiguous resolution to header '%s' |
179179
| Compiler error C7662 | '%$S': a coroutine cannot be constexpr or consteval |
180180
| [Compiler error C7688](compiler-error-c7688.md) | '`#pragma omp atomic`': expected an expression of scalar type |
181+
| Compiler error C7686 | TOML parse error |
181182
| Compiler error C7700 | type '%$T' in _Generic association compatible with previous association type '%$T' |
182183
| Compiler error C7701 | default _Generic association previously specified |
183184
| Compiler error C7702 | no compatible type for '%$T' in _Generic association list |

0 commit comments

Comments
 (0)