forked from OSchip/llvm-project
clang-cl: Ignore /fallback when not actually compiling (PR18456)
For example, don't fall back in /P (preprocess) mode. llvm-svn: 199153
This commit is contained in:
parent
0ad27923d5
commit
859422a867
|
@ -3725,7 +3725,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
}
|
||||
|
||||
// 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);
|
||||
|
|
|
@ -39,3 +39,8 @@
|
|||
// RUN: %clang_cl /fallback /Ox -### -- %s 2>&1 | FileCheck -check-prefix=Ox %s
|
||||
// Ox: cl.exe
|
||||
// Ox: "/Ox"
|
||||
|
||||
// Only fall back when actually compiling, not for e.g. /P (preprocess).
|
||||
// RUN: %clang_cl /fallback /P -### -- %s 2>&1 | FileCheck -check-prefix=P %s
|
||||
// P-NOT: ||
|
||||
// P-NOT: "cl.exe"
|
||||
|
|
Loading…
Reference in New Issue