[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.

http://reviews.llvm.org/D7164

Files:
  tools/clang/tools/driver/driver.cpp

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++" },
+#endif
       {"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++"},
+#endif
       {"cc", nullptr},
       {"cpp", "--driver-mode=cpp"},
       {"cl", "--driver-mode=cl"},

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- 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