[Bitcode Driver] make sure -embed-bitcode works with -force-single-frontend-invocation.

With both force-single-frontend-invocation and embed-bitcode, we create
CompileJobAction and BackendJobAction, similar to how we handle embed-bitcode
with StandarCompile.

This commit should only affect Bitcode mode.

rdar://20796819


Swift SVN r28129
This commit is contained in:
Manman Ren
2015-05-04 19:40:54 +00:00
parent 43c96de2b0
commit 249239e14d
3 changed files with 48 additions and 1 deletions

View File

@@ -14,6 +14,7 @@
#include "ToolChains.h"
#include "swift/Basic/Dwarf.h"
#include "swift/Basic/Fallthrough.h"
#include "swift/Basic/LLVM.h"
#include "swift/Basic/Platform.h"
#include "swift/Basic/Range.h"
@@ -298,6 +299,15 @@ Job *Swift::constructJob(const JobAction &JA, std::unique_ptr<JobList> Inputs,
break;
}
case OutputInfo::Mode::SingleCompile:
if (isa<BackendJobAction>(JA)) {
assert(Inputs->size() == 1 && "The Swift backend expects one input!");
Arguments.push_back("-primary-file");
const Job *Cmd = Inputs->front();
Arguments.push_back(
Cmd->getOutput().getPrimaryOutputFilename().c_str());
break;
}
SWIFT_FALLTHROUGH;
case OutputInfo::Mode::Immediate: {
for (const Action *A : InputActions) {
const InputAction *IA = dyn_cast<InputAction>(A);