[llvm-branch-commits] [cfe-branch] r142366 - in /cfe/branches/release_30: ./ lib/Basic/Targets.cpp test/SemaCXX/warn-unreachable.cpp
Bill Wendling
isanbard at gmail.com
Tue Oct 18 10:22:17 PDT 2011
Author: void
Date: Tue Oct 18 12:22:17 2011
New Revision: 142366
URL: http://llvm.org/viewvc/llvm-project?rev=142366&view=rev
Log:
Merging r142349:
------------------------------------------------------------------------
r142349 | d0k | 2011-10-18 03:10:08 -0700 (Tue, 18 Oct 2011) | 4 lines
Use llvm::Triple's methods to parse FreeBSD version numbers.
Who could've thought that FreeBSD would ever reach version 10!
Patch from Dimitry Andric.
------------------------------------------------------------------------
Modified:
cfe/branches/release_30/ (props changed)
cfe/branches/release_30/lib/Basic/Targets.cpp
cfe/branches/release_30/test/SemaCXX/warn-unreachable.cpp (props changed)
Propchange: cfe/branches/release_30/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 18 12:22:17 2011
@@ -1,3 +1,3 @@
/cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:142113,142133-142134
+/cfe/trunk:142113,142133-142134,142349
/cfe/trunk/test/SemaTemplate:126920
Modified: cfe/branches/release_30/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_30/lib/Basic/Targets.cpp?rev=142366&r1=142365&r2=142366&view=diff
==============================================================================
--- cfe/branches/release_30/lib/Basic/Targets.cpp (original)
+++ cfe/branches/release_30/lib/Basic/Targets.cpp Tue Oct 18 12:22:17 2011
@@ -247,11 +247,12 @@
MacroBuilder &Builder) const {
// FreeBSD defines; list based off of gcc output
- // FIXME: Move version number handling to llvm::Triple.
- StringRef Release = Triple.getOSName().substr(strlen("freebsd"), 1);
+ unsigned Release = Triple.getOSMajorVersion();
+ if (Release == 0U)
+ Release = 8;
- Builder.defineMacro("__FreeBSD__", Release);
- Builder.defineMacro("__FreeBSD_cc_version", Release + "00001");
+ Builder.defineMacro("__FreeBSD__", Twine(Release));
+ Builder.defineMacro("__FreeBSD_cc_version", Twine(Release * 100000U + 1U));
Builder.defineMacro("__KPRINTF_ATTRIBUTE__");
DefineStd(Builder, "unix", Opts);
Builder.defineMacro("__ELF__");
Propchange: cfe/branches/release_30/test/SemaCXX/warn-unreachable.cpp
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 18 12:22:17 2011
@@ -1,2 +1,2 @@
/cfe/branches/type-system-rewrite/test/SemaCXX/warn-unreachable.cpp:134693-134817
-/cfe/trunk/test/SemaCXX/warn-unreachable.cpp:121961,142113,142133-142134
+/cfe/trunk/test/SemaCXX/warn-unreachable.cpp:121961,142113,142133-142134,142349
More information about the llvm-branch-commits
mailing list