def err_drv_modules_validate_once_requires_timestamp : Error<
"option '-fmodules-validate-once-per-build-session' requires "
"'-fbuild-session-timestamp=<seconds since Epoch>'">;
+
+def note_drv_invoking_fallback : Note<"falling back to %0">;
}
/// getCreator - Return the Tool which caused the creation of this job.
const Tool &getCreator() const { return Creator; }
+ const char *getExecutable() const { return Executable; }
+
const llvm::opt::ArgStringList &getArguments() const { return Arguments; }
static bool classof(const Job *J) {
//
//===----------------------------------------------------------------------===//
+#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"
if (ExecutionFailed)
*ExecutionFailed = false;
+ const Driver &D = getCreator().getToolChain().getDriver();
+ D.Diag(diag::note_drv_invoking_fallback).setForceEmit()
+ << Fallback->getExecutable();
+
int SecondaryStatus = Fallback->Execute(Redirects, ErrMsg, ExecutionFailed);
return SecondaryStatus;
}
// RUN: %clang_cl /fallback /P -### -- %s 2>&1 | FileCheck -check-prefix=P %s
// P-NOT: ||
// P-NOT: "cl.exe"
+
+// RUN: not %clang_cl /fallback /c -- %s 2>&1 | \
+// RUN: FileCheck -check-prefix=ErrNote %s
+// ErrNote: note: falling back to cl.exe
+
+#error "This fails to compile."