Skip to content

Commit 209b6e2

Browse files
committedSep 6, 2016
[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 llvm-svn: 280702
1 parent 80c047d commit 209b6e2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
 

‎clang/test/Driver/cl-options.c

+2
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,8 @@
493493
// RUN: env CL="/Gy" _CL_="/Gy- -- %s" %clang_cl -### 2>&1 | FileCheck -check-prefix=ENV-_CL_ %s
494494
// ENV-_CL_-NOT: "-ffunction-sections"
495495

496+
// RUN: env CL="%s" _CL_="%s" not %clang --rsp-quoting=windows -c
497+
496498
// Accept "core" clang options.
497499
// (/Zs is for syntax-only, -Werror makes it fail hard on unknown options)
498500
// RUN: %clang_cl \

‎clang/tools/driver/driver.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ int main(int argc_, const char **argv_) {
393393

394394
// Handle CL and _CL_ which permits additional command line options to be
395395
// prepended or appended.
396-
if (Tokenizer == &llvm::cl::TokenizeWindowsCommandLine) {
396+
if (ClangCLMode) {
397397
// Arguments in "CL" are prepended.
398398
llvm::Optional<std::string> OptCL = llvm::sys::Process::GetEnv("CL");
399399
if (OptCL.hasValue()) {

0 commit comments

Comments
 (0)
Please sign in to comment.