From: Pierre Gousseau Date: Tue, 6 Sep 2016 10:48:27 +0000 (+0000) Subject: [clang-cl] Check that we are in clang cl mode before enabling support for the CL... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5e15bac435c04056a3f96c656aeb747e6f23b6ae;p=clang [clang-cl] Check that we are in clang cl mode before enabling support for the CL environment variable. Checking for the type of the command line tokenizer should not be the criteria to enable support for the CL environment variable, this change checks that we are in clang-cl mode instead. Differential Revision: https://reviews.llvm.org/D23503 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280702 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Driver/cl-options.c b/test/Driver/cl-options.c index e5e540207c..9b06963eb7 100644 --- a/test/Driver/cl-options.c +++ b/test/Driver/cl-options.c @@ -493,6 +493,8 @@ // RUN: env CL="/Gy" _CL_="/Gy- -- %s" %clang_cl -### 2>&1 | FileCheck -check-prefix=ENV-_CL_ %s // ENV-_CL_-NOT: "-ffunction-sections" +// RUN: env CL="%s" _CL_="%s" not %clang --rsp-quoting=windows -c + // Accept "core" clang options. // (/Zs is for syntax-only, -Werror makes it fail hard on unknown options) // RUN: %clang_cl \ diff --git a/tools/driver/driver.cpp b/tools/driver/driver.cpp index 9208ecdba0..6161302862 100644 --- a/tools/driver/driver.cpp +++ b/tools/driver/driver.cpp @@ -393,7 +393,7 @@ int main(int argc_, const char **argv_) { // Handle CL and _CL_ which permits additional command line options to be // prepended or appended. - if (Tokenizer == &llvm::cl::TokenizeWindowsCommandLine) { + if (ClangCLMode) { // Arguments in "CL" are prepended. llvm::Optional OptCL = llvm::sys::Process::GetEnv("CL"); if (OptCL.hasValue()) {