[PATCH] Recognize "CC" and "clang-CC" as C++ compiler aliases on FreeBSD

Dimitry Andric dimitry at andric.com
Sun Jan 25 09:24:48 PST 2015

Hi mcrosier, joerg,

For a few years now, FreeBSD has been carrying around a patch to recognize "CC" and "clang-CC" as progname aliases for g++ mode.  I would really like to get this into upstreamed, to eliminate as many custom patches as I can.

I've just put the FreeBSD specific part between #if __FreeBSD__ delimiters, but I suspect other OSes with case sensitive filesystems, and a historic usage of CC as g++ aliases will also want to use this.  Those can add additional defines later on.



Index: tools/clang/tools/driver/driver.cpp
--- tools/clang/tools/driver/driver.cpp
+++ tools/clang/tools/driver/driver.cpp
@@ -213,11 +213,17 @@
       {"clang", nullptr},
       {"clang++", "--driver-mode=g++"},
       {"clang-c++", "--driver-mode=g++"},
+#if defined(__FreeBSD__)
+      {"clang-CC", "--driver-mode=g++" },
       {"clang-cc", nullptr},
       {"clang-cpp", "--driver-mode=cpp"},
       {"clang-g++", "--driver-mode=g++"},
       {"clang-gcc", nullptr},
       {"clang-cl", "--driver-mode=cl"},
+#if defined(__FreeBSD__)
+      {"CC", "--driver-mode=g++"},
       {"cc", nullptr},
       {"cpp", "--driver-mode=cpp"},
       {"cl", "--driver-mode=cl"},

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7164.18730.patch
Type: text/x-patch
Size: 755 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150125/46db6a42/attachment.bin>

More information about the cfe-commits mailing list