Author: pgousseau Date: Tue Sep 6 05:48:27 2016 New Revision: 280702 URL: http://llvm.org/viewvc/llvm-project?rev=280702&view=rev Log: [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 Modified: cfe/trunk/test/Driver/cl-options.c cfe/trunk/tools/driver/driver.cpp Modified: cfe/trunk/test/Driver/cl-options.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/cl-options.c?rev=280702&r1=280701&r2=280702&view=diff ============================================================================== --- cfe/trunk/test/Driver/cl-options.c (original) +++ cfe/trunk/test/Driver/cl-options.c Tue Sep 6 05:48:27 2016 @@ -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 \ Modified: cfe/trunk/tools/driver/driver.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/driver.cpp?rev=280702&r1=280701&r2=280702&view=diff ============================================================================== --- cfe/trunk/tools/driver/driver.cpp (original) +++ cfe/trunk/tools/driver/driver.cpp Tue Sep 6 05:48:27 2016 @@ -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()) { _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits