aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/Job.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Driver/Job.cpp')
-rw-r--r--lib/Driver/Job.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/Driver/Job.cpp b/lib/Driver/Job.cpp
index ee68e6f14d51..42cc1bc29077 100644
--- a/lib/Driver/Job.cpp
+++ b/lib/Driver/Job.cpp
@@ -7,7 +7,11 @@
//
//===----------------------------------------------------------------------===//
+#include "clang/Driver/Driver.h"
+#include "clang/Driver/DriverDiagnostic.h"
#include "clang/Driver/Job.h"
+#include "clang/Driver/Tool.h"
+#include "clang/Driver/ToolChain.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSwitch.h"
@@ -37,7 +41,7 @@ static int skipArgs(const char *Flag) {
.Cases("-internal-externc-isystem", "-iprefix", "-iwithprefix", true)
.Cases("-iwithprefixbefore", "-isysroot", "-isystem", "-iquote", true)
.Cases("-resource-dir", "-serialize-diagnostic-file", true)
- .Case("-dwarf-debug-flags", true)
+ .Cases("-dwarf-debug-flags", "-ivfsoverlay", true)
.Default(false);
// Match found.
@@ -58,7 +62,8 @@ static int skipArgs(const char *Flag) {
// These flags are treated as a single argument (e.g., -F<Dir>).
StringRef FlagRef(Flag);
- if (FlagRef.startswith("-F") || FlagRef.startswith("-I"))
+ if (FlagRef.startswith("-F") || FlagRef.startswith("-I") ||
+ FlagRef.startswith("-fmodules-cache-path="))
return 1;
return 0;
@@ -119,9 +124,9 @@ int Command::Execute(const StringRef **Redirects, std::string *ErrMsg,
Argv.push_back(Executable);
for (size_t i = 0, e = Arguments.size(); i != e; ++i)
Argv.push_back(Arguments[i]);
- Argv.push_back(0);
+ Argv.push_back(nullptr);
- return llvm::sys::ExecuteAndWait(Executable, Argv.data(), /*env*/ 0,
+ return llvm::sys::ExecuteAndWait(Executable, Argv.data(), /*env*/ nullptr,
Redirects, /*secondsToWait*/ 0,
/*memoryLimit*/ 0, ErrMsg, ExecutionFailed);
}
@@ -159,6 +164,9 @@ int FallbackCommand::Execute(const StringRef **Redirects, std::string *ErrMsg,
if (ExecutionFailed)
*ExecutionFailed = false;
+ const Driver &D = getCreator().getToolChain().getDriver();
+ D.Diag(diag::warn_drv_invoking_fallback) << Fallback->getExecutable();
+
int SecondaryStatus = Fallback->Execute(Redirects, ErrMsg, ExecutionFailed);
return SecondaryStatus;
}