[PATCH] D23503: [clang-cl] Check that we are in clang cl mode before enabling support for the CL environment variable.
pierre gousseau via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 15 05:23:09 PDT 2016
pgousseau created this revision.
pgousseau added reviewers: rsmith, majnemer.
pgousseau added subscribers: cfe-commits, wristow, gbedwell, probinson.
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.
https://reviews.llvm.org/D23503
Files:
test/Driver/cl-options.c
tools/driver/driver.cpp
Index: tools/driver/driver.cpp
===================================================================
--- tools/driver/driver.cpp
+++ tools/driver/driver.cpp
@@ -393,7 +393,7 @@
// 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()) {
Index: test/Driver/cl-options.c
===================================================================
--- test/Driver/cl-options.c
+++ test/Driver/cl-options.c
@@ -468,6 +468,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 \
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23503.68020.patch
Type: text/x-patch
Size: 1028 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160815/1868b57c/attachment.bin>
More information about the cfe-commits
mailing list