Skip to content

Commit

Permalink
[clang-cl] Check that we are in clang cl mode before enabling support…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
goussepi committed Sep 6, 2016
1 parent 80c047d commit 209b6e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions clang/test/Driver/cl-options.c
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion clang/tools/driver/driver.cpp
Expand Up @@ -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()) {
Expand Down

0 comments on commit 209b6e2

Please sign in to comment.