Wire up -emit-objc-header[-path] options that don't do anything yet.

These options piggyback on the "merge module" phase of the driver
because the header we output needs an entire complete module.

Swift SVN r13800
This commit is contained in:
Jordan Rose
2014-02-12 01:19:13 +00:00
parent 8b9dfb017a
commit 798e13d15c
9 changed files with 123 additions and 30 deletions

View File

@@ -168,6 +168,7 @@ Job *Swift::constructJob(const JobAction &JA, std::unique_ptr<JobList> Inputs,
case types::TY_Dependencies:
case types::TY_ClangModuleFile:
case types::TY_SerializedDiagnostics:
case types::TY_ObjCHeader:
case types::TY_Image:
llvm_unreachable("Output type can never be primary output.");
case types::TY_INVALID:
@@ -324,6 +325,14 @@ Job *MergeModule::constructJob(const JobAction &JA,
assert(Output->getPrimaryOutputType() == types::TY_SwiftModuleFile &&
"The MergeModule tool only produces swiftmodule files!");
const std::string &ObjCHeaderOutputPath =
Output->getAdditionalOutputForType(types::TY_ObjCHeader);
if (!ObjCHeaderOutputPath.empty()) {
Arguments.push_back("-emit-objc-header");
Arguments.push_back("-emit-objc-header-path");
Arguments.push_back(ObjCHeaderOutputPath.c_str());
}
Arguments.push_back("-o");
Arguments.push_back(Args.MakeArgString(Output->getPrimaryOutputFilename()));