[llvm-branch-commits] [cfe-branch] r215254 - Merge r215245: Change __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ for versions > 10.9.
Bob Wilson
bob.wilson at apple.com
Fri Aug 8 15:59:38 PDT 2014
Author: bwilson
Date: Fri Aug 8 17:59:37 2014
New Revision: 215254
URL: http://llvm.org/viewvc/llvm-project?rev=215254&view=rev
Log:
Merge r215245: Change __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ for versions > 10.9.
Modified:
cfe/branches/release_35/ (props changed)
cfe/branches/release_35/lib/Basic/Targets.cpp
cfe/branches/release_35/test/Frontend/darwin-version.c
Propchange: cfe/branches/release_35/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Aug 8 17:59:37 2014
@@ -1,4 +1,4 @@
/cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:213609,213611,213613,213741,213834,213840,213902,213912-213913,213993,213998-213999,214008,214050,214060,214119,214208,214222,214369,214390,214471,214734-214735,214777,215046
+/cfe/trunk:213609,213611,213613,213741,213834,213840,213902,213912-213913,213993,213998-213999,214008,214050,214060,214119,214208,214222,214369,214390,214471,214734-214735,214777,215046,215245
/cfe/trunk/test:170344
/cfe/trunk/test/SemaTemplate:126920
Modified: cfe/branches/release_35/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_35/lib/Basic/Targets.cpp?rev=215254&r1=215253&r2=215254&view=diff
==============================================================================
--- cfe/branches/release_35/lib/Basic/Targets.cpp (original)
+++ cfe/branches/release_35/lib/Basic/Targets.cpp Fri Aug 8 17:59:37 2014
@@ -155,12 +155,23 @@ static void getDarwinDefines(MacroBuilde
// revision numbers). So, we limit them to the maximum representable
// version.
assert(Maj < 100 && Min < 100 && Rev < 100 && "Invalid version!");
- char Str[5];
- Str[0] = '0' + (Maj / 10);
- Str[1] = '0' + (Maj % 10);
- Str[2] = '0' + std::min(Min, 9U);
- Str[3] = '0' + std::min(Rev, 9U);
- Str[4] = '\0';
+ char Str[7];
+ if (Maj < 10 || (Maj == 10 && Min < 10)) {
+ Str[0] = '0' + (Maj / 10);
+ Str[1] = '0' + (Maj % 10);
+ Str[2] = '0' + std::min(Min, 9U);
+ Str[3] = '0' + std::min(Rev, 9U);
+ Str[4] = '\0';
+ } else {
+ // Handle versions > 10.9.
+ Str[0] = '0' + (Maj / 10);
+ Str[1] = '0' + (Maj % 10);
+ Str[2] = '0' + (Min / 10);
+ Str[3] = '0' + (Min % 10);
+ Str[4] = '0' + (Rev / 10);
+ Str[5] = '0' + (Rev % 10);
+ Str[6] = '\0';
+ }
Builder.defineMacro("__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__", Str);
}
Modified: cfe/branches/release_35/test/Frontend/darwin-version.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_35/test/Frontend/darwin-version.c?rev=215254&r1=215253&r2=215254&view=diff
==============================================================================
--- cfe/branches/release_35/test/Frontend/darwin-version.c (original)
+++ cfe/branches/release_35/test/Frontend/darwin-version.c Fri Aug 8 17:59:37 2014
@@ -23,3 +23,5 @@
// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1050' | count 1
// RUN: %clang -target i686-apple-darwin9 -mmacosx-version-min=10.6 -dM -E -o %t %s
// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1060' | count 1
+// RUN: %clang -target x86_64-apple-macosx -mmacosx-version-min=10.10 -dM -E -o %t %s
+// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '101000' | count 1
More information about the llvm-branch-commits
mailing list