Skip to content

Commit f207332

Browse files
committedApr 15, 2019
[clang] Aligned allocation is actually supported in macosx 10.13
Summary: In r350649, I changed aligned allocation from being available starting in macosx10.13 to macosx10.14. However, aligned allocation is indeed available starting with macosx10.13, my investigation had been based on the wrong libc++abi dylib. This means that Clang before the fix will be more stringent when it comes to aligned allocation -- it will not allow it when back-deploying to macosx 10.13, when it would actually be safe to do so. Note that a companion change will be coming to fix the libc++ tests. Reviewers: ahatanak Subscribers: jkorous, dexonsmith, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60626 llvm-svn: 358409
1 parent f3e4f24 commit f207332

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed
 

Diff for: ‎clang/include/clang/Basic/AlignedAllocation.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ inline llvm::VersionTuple alignedAllocMinVersion(llvm::Triple::OSType OS) {
2626
default:
2727
break;
2828
case llvm::Triple::Darwin:
29-
case llvm::Triple::MacOSX: // Earliest supporting version is 10.14.
30-
return llvm::VersionTuple(10U, 14U);
29+
case llvm::Triple::MacOSX: // Earliest supporting version is 10.13.
30+
return llvm::VersionTuple(10U, 13U);
3131
case llvm::Triple::IOS:
3232
case llvm::Triple::TvOS: // Earliest supporting version is 11.0.0.
3333
return llvm::VersionTuple(11U);

Diff for: ‎clang/test/Driver/unavailable_aligned_allocation.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang -target x86_64-apple-macosx10.13 -c -### %s 2>&1 \
1+
// RUN: %clang -target x86_64-apple-macosx10.12 -c -### %s 2>&1 \
22
// RUN: | FileCheck %s -check-prefix=UNAVAILABLE
33
//
44
// RUN: %clang -target arm64-apple-ios10 -c -### %s 2>&1 \
@@ -24,7 +24,7 @@
2424
//
2525
// UNAVAILABLE: "-faligned-alloc-unavailable"
2626

27-
// RUN: %clang -target x86_64-apple-macosx10.14 -c -### %s 2>&1 \
27+
// RUN: %clang -target x86_64-apple-macosx10.13 -c -### %s 2>&1 \
2828
// RUN: | FileCheck %s -check-prefix=AVAILABLE
2929
//
3030
// RUN: %clang -target arm64-apple-ios11 -c -### %s 2>&1 \
@@ -54,10 +54,10 @@
5454
// Check that passing -faligned-allocation or -fno-aligned-allocation stops the
5555
// driver from passing -faligned-alloc-unavailable to cc1.
5656
//
57-
// RUN: %clang -target x86_64-apple-macosx10.13 -faligned-allocation -c -### %s 2>&1 \
57+
// RUN: %clang -target x86_64-apple-macosx10.12 -faligned-allocation -c -### %s 2>&1 \
5858
// RUN: | FileCheck %s -check-prefix=AVAILABLE
5959
//
60-
// RUN: %clang -target x86_64-apple-macosx10.13 -fno-aligned-allocation -c -### %s 2>&1 \
60+
// RUN: %clang -target x86_64-apple-macosx10.12 -fno-aligned-allocation -c -### %s 2>&1 \
6161
// RUN: | FileCheck %s -check-prefix=AVAILABLE
6262

6363
// AVAILABLE-NOT: "-faligned-alloc-unavailable"

Diff for: ‎clang/test/SemaCXX/unavailable_aligned_allocation.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.13.0 -fexceptions -faligned-alloc-unavailable -std=c++1z -verify %s
2-
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.13.0 -fexceptions -std=c++1z -verify -DNO_ERRORS %s
3-
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.13.0 -fexceptions -faligned-allocation -faligned-alloc-unavailable -std=c++14 -verify %s
1+
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.12.0 -fexceptions -faligned-alloc-unavailable -std=c++1z -verify %s
2+
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.12.0 -fexceptions -std=c++1z -verify -DNO_ERRORS %s
3+
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.12.0 -fexceptions -faligned-allocation -faligned-alloc-unavailable -std=c++14 -verify %s
44
// RUN: %clang_cc1 -triple arm64-apple-ios10.0.0 -fexceptions -faligned-alloc-unavailable -std=c++1z -verify -DIOS %s
55
// RUN: %clang_cc1 -triple arm64-apple-ios10.0.0 -fexceptions -std=c++1z -verify -DNO_ERRORS %s
66
// RUN: %clang_cc1 -triple arm64-apple-tvos10.0.0 -fexceptions -faligned-alloc-unavailable -std=c++1z -verify -DTVOS %s
@@ -117,8 +117,8 @@ void testOveralignedCheckOS() {
117117
// expected-error@-13 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is only available on watchOS 4 or newer}}}
118118
// expected-error@-14 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on watchOS 4 or newer}}}
119119
#else
120-
// expected-error@-16 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is only available on macOS 10.14 or newer}}}
121-
// expected-error@-17 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on macOS 10.14 or newer}}}
120+
// expected-error@-16 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is only available on macOS 10.13 or newer}}}
121+
// expected-error@-17 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on macOS 10.13 or newer}}}
122122
#endif
123123

124124
// expected-note@-20 2 {{if you supply your own aligned allocation functions}}
@@ -146,7 +146,7 @@ OveralignedS2::~OveralignedS2() {}
146146
// expected-error@-12 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on watchOS 4 or newer}}}
147147
// expected-note@-13 {{if you supply your own aligned allocation functions}}
148148
#else
149-
// expected-error@-15 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on macOS 10.14 or newer}}}
149+
// expected-error@-15 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on macOS 10.13 or newer}}}
150150
// expected-note@-16 {{if you supply your own aligned allocation functions}}
151151
#endif
152152
#endif

0 commit comments

Comments
 (0)
Please sign in to comment.