clang-cl: Ignore /fallback when not actually compiling (PR18456)
For example, don't fall back in /P (preprocess) mode.
llvm-svn: 199153
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index 2084c0f..489c6ba 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -3725,7 +3725,8 @@
}
// Finally add the compile command to the compilation.
- if (Args.hasArg(options::OPT__SLASH_fallback)) {
+ if (Args.hasArg(options::OPT__SLASH_fallback) &&
+ Output.getType() == types::TY_Object) {
tools::visualstudio::Compile CL(getToolChain());
Command *CLCommand = CL.GetCommand(C, JA, Output, Inputs, Args,
LinkingOutput);