summaryrefslogtreecommitdiff
path: root/clang/lib/Driver/Job.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Driver/Job.cpp')
-rw-r--r--clang/lib/Driver/Job.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/clang/lib/Driver/Job.cpp b/clang/lib/Driver/Job.cpp
index 7dab2a022d92..6d1e7e61ba1d 100644
--- a/clang/lib/Driver/Job.cpp
+++ b/clang/lib/Driver/Job.cpp
@@ -371,14 +371,29 @@ int Command::Execute(ArrayRef<llvm::Optional<StringRef>> Redirects,
/*memoryLimit*/ 0, ErrMsg, ExecutionFailed);
}
+CC1Command::CC1Command(const Action &Source, const Tool &Creator,
+ const char *Executable,
+ const llvm::opt::ArgStringList &Arguments,
+ ArrayRef<InputInfo> Inputs)
+ : Command(Source, Creator, Executable, Arguments, Inputs) {
+ InProcess = true;
+}
+
void CC1Command::Print(raw_ostream &OS, const char *Terminator, bool Quote,
CrashReportInfo *CrashInfo) const {
- OS << " (in-process)\n";
+ if (InProcess)
+ OS << " (in-process)\n";
Command::Print(OS, Terminator, Quote, CrashInfo);
}
-int CC1Command::Execute(ArrayRef<llvm::Optional<StringRef>> /*Redirects*/,
+int CC1Command::Execute(ArrayRef<llvm::Optional<StringRef>> Redirects,
std::string *ErrMsg, bool *ExecutionFailed) const {
+ // FIXME: Currently, if there're more than one job, we disable
+ // -fintegrate-cc1. If we're no longer a integrated-cc1 job, fallback to
+ // out-of-process execution. See discussion in https://reviews.llvm.org/D74447
+ if (!InProcess)
+ return Command::Execute(Redirects, ErrMsg, ExecutionFailed);
+
PrintFileNames();
SmallVector<const char *, 128> Argv;