[PATCH] D20037: Make __FreeBSD_cc_version predefined macro configurable at build time

Dimitry Andric via cfe-commits cfe-commits at lists.llvm.org
Fri May 20 10:33:50 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL270240: Make __FreeBSD_cc_version predefined macro configurable at build time (authored by dim).

Changed prior to commit:
  http://reviews.llvm.org/D20037?vs=56476&id=57952#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D20037

Files:
  cfe/trunk/lib/Basic/Targets.cpp

Index: cfe/trunk/lib/Basic/Targets.cpp
===================================================================
--- cfe/trunk/lib/Basic/Targets.cpp
+++ cfe/trunk/lib/Basic/Targets.cpp
@@ -308,6 +308,10 @@
   }
 };
 
+#ifndef FREEBSD_CC_VERSION
+#define FREEBSD_CC_VERSION 0U
+#endif
+
 // FreeBSD Target
 template<typename Target>
 class FreeBSDTargetInfo : public OSTargetInfo<Target> {
@@ -318,10 +322,13 @@
 
     unsigned Release = Triple.getOSMajorVersion();
     if (Release == 0U)
-      Release = 8;
+      Release = 8U;
+    unsigned CCVersion = FREEBSD_CC_VERSION;
+    if (CCVersion == 0U)
+      CCVersion = Release * 100000U + 1U;
 
     Builder.defineMacro("__FreeBSD__", Twine(Release));
-    Builder.defineMacro("__FreeBSD_cc_version", Twine(Release * 100000U + 1U));
+    Builder.defineMacro("__FreeBSD_cc_version", Twine(CCVersion));
     Builder.defineMacro("__KPRINTF_ATTRIBUTE__");
     DefineStd(Builder, "unix", Opts);
     Builder.defineMacro("__ELF__");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20037.57952.patch
Type: text/x-patch
Size: 974 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160520/eb1af3c2/attachment.bin>


More information about the cfe-commits mailing list