]> granicus.if.org Git - clang/commitdiff
[clang-cl] Check that we are in clang cl mode before enabling support for the CL...
authorPierre Gousseau <pierregousseau14@gmail.com>
Tue, 6 Sep 2016 10:48:27 +0000 (10:48 +0000)
committerPierre Gousseau <pierregousseau14@gmail.com>
Tue, 6 Sep 2016 10:48:27 +0000 (10:48 +0000)
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

test/Driver/cl-options.c
tools/driver/driver.cpp

index e5e540207cf6eb53efe410a7b958d5edcfc04aa1..9b06963eb73da56eb722ae06ddd7c85e4f994106 100644 (file)
 // 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 \
index 9208ecdba0038505afc56240d15b865acae43504..61613028625b3557594896391a2c3ef1b93d0e48 100644 (file)
@@ -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<std::string> OptCL = llvm::sys::Process::GetEnv("CL");
     if (OptCL.hasValue()) {