@@ -31,6 +31,17 @@ struct SupplementaryOutputPaths {
31
31
// / \sa swift::printAsObjC
32
32
std::string ObjCHeaderOutputPath;
33
33
34
+ // / The path to which we should emit a C++ header for the module.
35
+ // /
36
+ // / Currently only makes sense when the compiler has whole module knowledge.
37
+ // / The modes for which it makes sense include both WMO and the "merge
38
+ // / modules" job that happens after the normal compilation jobs. That's where
39
+ // / the header is emitted in single-file mode, since it needs whole-module
40
+ // / information.
41
+ // /
42
+ // / \sa swift::printAsCXX
43
+ std::string CxxHeaderOutputPath;
44
+
34
45
// / The path to which we should emit a serialized module.
35
46
// / It is valid whenever there are any inputs.
36
47
// /
@@ -160,7 +171,9 @@ struct SupplementaryOutputPaths {
160
171
// / Apply a given function for each existing (non-empty string) supplementary output
161
172
void forEachSetOutput (llvm::function_ref<void (const std::string&)> fn) const {
162
173
if (!ObjCHeaderOutputPath.empty ())
163
- fn (ObjCHeaderOutputPath);
174
+ fn (ObjCHeaderOutputPath);
175
+ if (!CxxHeaderOutputPath.empty ())
176
+ fn (CxxHeaderOutputPath);
164
177
if (!ModuleOutputPath.empty ())
165
178
fn (ModuleOutputPath);
166
179
if (!ModuleSourceInfoOutputPath.empty ())
@@ -196,14 +209,16 @@ struct SupplementaryOutputPaths {
196
209
}
197
210
198
211
bool empty () const {
199
- return ObjCHeaderOutputPath.empty () && ModuleOutputPath.empty () &&
200
- ModuleDocOutputPath.empty () && DependenciesFilePath.empty () &&
212
+ return ObjCHeaderOutputPath.empty () && CxxHeaderOutputPath.empty () &&
213
+ ModuleOutputPath.empty () && ModuleDocOutputPath.empty () &&
214
+ DependenciesFilePath.empty () &&
201
215
ReferenceDependenciesFilePath.empty () &&
202
216
SerializedDiagnosticsPath.empty () && LoadedModuleTracePath.empty () &&
203
217
TBDPath.empty () && ModuleInterfaceOutputPath.empty () &&
204
- ModuleSourceInfoOutputPath.empty () && ABIDescriptorOutputPath.empty () &&
205
- ModuleSemanticInfoOutputPath.empty () &&
206
- YAMLOptRecordPath.empty () && BitstreamOptRecordPath.empty ();
218
+ ModuleSourceInfoOutputPath.empty () &&
219
+ ABIDescriptorOutputPath.empty () &&
220
+ ModuleSemanticInfoOutputPath.empty () && YAMLOptRecordPath.empty () &&
221
+ BitstreamOptRecordPath.empty ();
207
222
}
208
223
};
209
224
} // namespace swift
0 commit comments