r310382 - [Availability] Don't make an availability attribute imply default visibility on macOS
Erik Pilkington via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 15 17:22:26 PDT 2017
Probably not, this might be a risky change.
- Erik
On 8/15/17 9:15 AM, Nico Weber wrote:
> Do we want to merge this to 5.0?
>
> On Tue, Aug 8, 2017 at 1:09 PM, Erik Pilkington via cfe-commits
> <cfe-commits at lists.llvm.org <mailto:cfe-commits at lists.llvm.org>> wrote:
>
> Author: epilk
> Date: Tue Aug 8 10:09:09 2017
> New Revision: 310382
>
> URL: http://llvm.org/viewvc/llvm-project?rev=310382&view=rev
> <http://llvm.org/viewvc/llvm-project?rev=310382&view=rev>
> Log:
> [Availability] Don't make an availability attribute imply default
> visibility on macOS
>
> Fixes PR33796, rdar://33655115
>
> Differential revision: https://reviews.llvm.org/D36191
> <https://reviews.llvm.org/D36191>
>
> Modified:
> cfe/trunk/docs/ReleaseNotes.rst
> cfe/trunk/lib/AST/Decl.cpp
> cfe/trunk/test/CodeGen/attr-availability.c
>
> Modified: cfe/trunk/docs/ReleaseNotes.rst
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ReleaseNotes.rst?rev=310382&r1=310381&r2=310382&view=diff
> <http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ReleaseNotes.rst?rev=310382&r1=310381&r2=310382&view=diff>
> ==============================================================================
> --- cfe/trunk/docs/ReleaseNotes.rst (original)
> +++ cfe/trunk/docs/ReleaseNotes.rst Tue Aug 8 10:09:09 2017
> @@ -94,6 +94,9 @@ Clang now supports the ...
> Attribute Changes in Clang
> --------------------------
>
> +- The presence of __attribute__((availability(...))) on a
> declaration no longer
> + implies default visibility for that declaration on macOS.
> +
> - ...
>
> Windows Support
>
> Modified: cfe/trunk/lib/AST/Decl.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=310382&r1=310381&r2=310382&view=diff
> <http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=310382&r1=310381&r2=310382&view=diff>
> ==============================================================================
> --- cfe/trunk/lib/AST/Decl.cpp (original)
> +++ cfe/trunk/lib/AST/Decl.cpp Tue Aug 8 10:09:09 2017
> @@ -216,14 +216,6 @@ static Optional<Visibility> getVisibilit
> return getVisibilityFromAttr(A);
> }
>
> - // If we're on Mac OS X, an 'availability' for Mac OS X attribute
> - // implies visibility(default).
> - if (D->getASTContext().getTargetInfo().getTriple().isOSDarwin()) {
> - for (const auto *A : D->specific_attrs<AvailabilityAttr>())
> - if (A->getPlatform()->getName().equals("macos"))
> - return DefaultVisibility;
> - }
> -
> return None;
> }
>
>
> Modified: cfe/trunk/test/CodeGen/attr-availability.c
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/attr-availability.c?rev=310382&r1=310381&r2=310382&view=diff
> <http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/attr-availability.c?rev=310382&r1=310381&r2=310382&view=diff>
> ==============================================================================
> --- cfe/trunk/test/CodeGen/attr-availability.c (original)
> +++ cfe/trunk/test/CodeGen/attr-availability.c Tue Aug 8 10:09:09 2017
> @@ -8,9 +8,9 @@
> void f2();
> void f2() { }
>
> -// CHECK-10_4-LABEL: define void @f3
> -// CHECK-10_5-LABEL: define void @f3
> -// CHECK-10_6-LABEL: define void @f3
> +// CHECK-10_4-LABEL: define hidden void @f3
> +// CHECK-10_5-LABEL: define hidden void @f3
> +// CHECK-10_6-LABEL: define hidden void @f3
> void f3() __attribute__((availability(macosx,introduced=10.5)));
> void f3() { }
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org <mailto:cfe-commits at lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
> <http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170815/dcc0f928/attachment-0001.html>
More information about the cfe-commits
mailing list