[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:
Connor Wakamo
2014-07-18 22:04:29 +00:00
parent ae0dfd4676
commit 497eeffa55
6 changed files with 32 additions and 17 deletions

View File

@@ -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()) {