r358409 - [clang] Aligned allocation is actually supported in macosx 10.13

Louis Dionne via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 15 07:14:45 PDT 2019


Author: ldionne
Date: Mon Apr 15 07:14:45 2019
New Revision: 358409

URL: http://llvm.org/viewvc/llvm-project?rev=358409&view=rev
Log:
[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

Modified:
    cfe/trunk/include/clang/Basic/AlignedAllocation.h
    cfe/trunk/test/Driver/unavailable_aligned_allocation.cpp
    cfe/trunk/test/SemaCXX/unavailable_aligned_allocation.cpp

Modified: cfe/trunk/include/clang/Basic/AlignedAllocation.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/AlignedAllocation.h?rev=358409&r1=358408&r2=358409&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/AlignedAllocation.h (original)
+++ cfe/trunk/include/clang/Basic/AlignedAllocation.h Mon Apr 15 07:14:45 2019
@@ -26,8 +26,8 @@ inline llvm::VersionTuple alignedAllocMi
   default:
     break;
   case llvm::Triple::Darwin:
-  case llvm::Triple::MacOSX: // Earliest supporting version is 10.14.
-    return llvm::VersionTuple(10U, 14U);
+  case llvm::Triple::MacOSX: // Earliest supporting version is 10.13.
+    return llvm::VersionTuple(10U, 13U);
   case llvm::Triple::IOS:
   case llvm::Triple::TvOS: // Earliest supporting version is 11.0.0.
     return llvm::VersionTuple(11U);

Modified: cfe/trunk/test/Driver/unavailable_aligned_allocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/unavailable_aligned_allocation.cpp?rev=358409&r1=358408&r2=358409&view=diff
==============================================================================
--- cfe/trunk/test/Driver/unavailable_aligned_allocation.cpp (original)
+++ cfe/trunk/test/Driver/unavailable_aligned_allocation.cpp Mon Apr 15 07:14:45 2019
@@ -1,4 +1,4 @@
-// RUN: %clang -target x86_64-apple-macosx10.13 -c -### %s 2>&1 \
+// RUN: %clang -target x86_64-apple-macosx10.12 -c -### %s 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=UNAVAILABLE
 //
 // RUN: %clang -target arm64-apple-ios10 -c -### %s 2>&1 \
@@ -24,7 +24,7 @@
 //
 // UNAVAILABLE: "-faligned-alloc-unavailable"
 
-// RUN: %clang -target x86_64-apple-macosx10.14 -c -### %s 2>&1 \
+// RUN: %clang -target x86_64-apple-macosx10.13 -c -### %s 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=AVAILABLE
 //
 // RUN: %clang -target arm64-apple-ios11 -c -### %s 2>&1 \
@@ -54,10 +54,10 @@
 // Check that passing -faligned-allocation or -fno-aligned-allocation stops the
 // driver from passing -faligned-alloc-unavailable to cc1.
 //
-// RUN: %clang -target x86_64-apple-macosx10.13 -faligned-allocation -c -### %s 2>&1 \
+// RUN: %clang -target x86_64-apple-macosx10.12 -faligned-allocation -c -### %s 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=AVAILABLE
 //
-// RUN: %clang -target x86_64-apple-macosx10.13 -fno-aligned-allocation -c -### %s 2>&1 \
+// RUN: %clang -target x86_64-apple-macosx10.12 -fno-aligned-allocation -c -### %s 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=AVAILABLE
 
 // AVAILABLE-NOT: "-faligned-alloc-unavailable"

Modified: cfe/trunk/test/SemaCXX/unavailable_aligned_allocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/unavailable_aligned_allocation.cpp?rev=358409&r1=358408&r2=358409&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/unavailable_aligned_allocation.cpp (original)
+++ cfe/trunk/test/SemaCXX/unavailable_aligned_allocation.cpp Mon Apr 15 07:14:45 2019
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -triple x86_64-apple-macosx10.13.0 -fexceptions -faligned-alloc-unavailable -std=c++1z -verify %s
-// RUN: %clang_cc1 -triple x86_64-apple-macosx10.13.0 -fexceptions -std=c++1z -verify -DNO_ERRORS %s
-// RUN: %clang_cc1 -triple x86_64-apple-macosx10.13.0 -fexceptions -faligned-allocation -faligned-alloc-unavailable -std=c++14 -verify %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.12.0 -fexceptions -faligned-alloc-unavailable -std=c++1z -verify %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.12.0 -fexceptions -std=c++1z -verify -DNO_ERRORS %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.12.0 -fexceptions -faligned-allocation -faligned-alloc-unavailable -std=c++14 -verify %s
 // RUN: %clang_cc1 -triple arm64-apple-ios10.0.0 -fexceptions -faligned-alloc-unavailable -std=c++1z -verify -DIOS %s
 // RUN: %clang_cc1 -triple arm64-apple-ios10.0.0 -fexceptions -std=c++1z -verify -DNO_ERRORS %s
 // 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() {
 // expected-error at -13 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is only available on watchOS 4 or newer}}}
 // expected-error at -14 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on watchOS 4 or newer}}}
 #else
-// expected-error at -16 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is only available on macOS 10.14 or newer}}}
-// expected-error at -17 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on macOS 10.14 or newer}}}
+// expected-error at -16 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is only available on macOS 10.13 or newer}}}
+// expected-error at -17 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on macOS 10.13 or newer}}}
 #endif
 
 // expected-note at -20 2 {{if you supply your own aligned allocation functions}}
@@ -146,7 +146,7 @@ OveralignedS2::~OveralignedS2() {}
 // expected-error at -12 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on watchOS 4 or newer}}}
 // expected-note at -13 {{if you supply your own aligned allocation functions}}
 #else
-// expected-error at -15 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on macOS 10.14 or newer}}}
+// expected-error at -15 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on macOS 10.13 or newer}}}
 // expected-note at -16 {{if you supply your own aligned allocation functions}}
 #endif
 #endif




More information about the cfe-commits mailing list