@@ -31,6 +31,17 @@ struct SupplementaryOutputPaths {
3131 // / \sa swift::printAsObjC
3232 std::string ObjCHeaderOutputPath;
3333
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+
3445 // / The path to which we should emit a serialized module.
3546 // / It is valid whenever there are any inputs.
3647 // /
@@ -160,7 +171,9 @@ struct SupplementaryOutputPaths {
160171 // / Apply a given function for each existing (non-empty string) supplementary output
161172 void forEachSetOutput (llvm::function_ref<void (const std::string&)> fn) const {
162173 if (!ObjCHeaderOutputPath.empty ())
163- fn (ObjCHeaderOutputPath);
174+ fn (ObjCHeaderOutputPath);
175+ if (!CxxHeaderOutputPath.empty ())
176+ fn (CxxHeaderOutputPath);
164177 if (!ModuleOutputPath.empty ())
165178 fn (ModuleOutputPath);
166179 if (!ModuleSourceInfoOutputPath.empty ())
@@ -196,14 +209,16 @@ struct SupplementaryOutputPaths {
196209 }
197210
198211 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 () &&
201215 ReferenceDependenciesFilePath.empty () &&
202216 SerializedDiagnosticsPath.empty () && LoadedModuleTracePath.empty () &&
203217 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 ();
207222 }
208223};
209224} // namespace swift
0 commit comments