mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[driver] Allow -force-single-frontend-invocation and -emit-objc-header[-path] to be used together.
Added support in Driver which allows -force-single-frontend-invocation and -emit-objc-header[-path] to be used together in a single invocation. Added support in tools::Swift to pass -emit-objc-header-path if an Objective-C header was requested; this is only valid in OutputInfo::Mode::SingleCompile mode, and an assertion enforces this. Added a test which ensures that the same header is emitted in with -force-single-frontend-invocation and without it. Swift SVN r20185
This commit is contained in:
@@ -368,6 +368,17 @@ Job *Swift::constructJob(const JobAction &JA, std::unique_ptr<JobList> Inputs,
|
||||
Arguments.push_back(ModuleOutputPath.c_str());
|
||||
}
|
||||
|
||||
const std::string &ObjCHeaderOutputPath =
|
||||
Output->getAdditionalOutputForType(types::ID::TY_ObjCHeader);
|
||||
if (!ObjCHeaderOutputPath.empty()) {
|
||||
assert(OI.CompilerMode == OutputInfo::Mode::SingleCompile &&
|
||||
"The Swift tool should only emit an Obj-C header in single compile"
|
||||
"mode!");
|
||||
|
||||
Arguments.push_back("-emit-objc-header-path");
|
||||
Arguments.push_back(ObjCHeaderOutputPath.c_str());
|
||||
}
|
||||
|
||||
const std::string &SerializedDiagnosticsPath =
|
||||
Output->getAdditionalOutputForType(types::TY_SerializedDiagnostics);
|
||||
if (!SerializedDiagnosticsPath.empty()) {
|
||||
|
||||
Reference in New Issue
Block a user