r261548 - Add has_feature attribute_availability_with_strict.
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 22 10:37:36 PST 2016
On Mon, Feb 22, 2016 at 1:24 PM, Manman Ren via cfe-commits
<cfe-commits at lists.llvm.org> wrote:
> Author: mren
> Date: Mon Feb 22 12:24:30 2016
> New Revision: 261548
>
> URL: http://llvm.org/viewvc/llvm-project?rev=261548&view=rev
> Log:
> Add has_feature attribute_availability_with_strict.
>
> rdar://23791325
Please add more context to commit logs; radar reports in commit logs
don't help those of us who are not at Apple. Also, I don't recall
seeing this patch go through the review process, can you point me to
the thread?
>
> Modified:
> cfe/trunk/lib/Lex/PPMacroExpansion.cpp
> cfe/trunk/test/Sema/attr-availability-macosx.c
>
> Modified: cfe/trunk/lib/Lex/PPMacroExpansion.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPMacroExpansion.cpp?rev=261548&r1=261547&r2=261548&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Lex/PPMacroExpansion.cpp (original)
> +++ cfe/trunk/lib/Lex/PPMacroExpansion.cpp Mon Feb 22 12:24:30 2016
> @@ -1066,6 +1066,7 @@ static bool HasFeature(const Preprocesso
> .Case("attribute_availability_with_version_underscores", true)
> .Case("attribute_availability_tvos", true)
> .Case("attribute_availability_watchos", true)
> + .Case("attribute_availability_with_strict", true)
I wonder if this would actually be better as an attribute feature
testing macro, instead of bolted on to __has_feature. It's strange to
have attribute feature testing capabilities and not use them. That
being said, I'm not opposed to this patch as-is because there are
other attribute_availability_* feature test.
Thanks!
~Aaron
> .Case("attribute_cf_returns_not_retained", true)
> .Case("attribute_cf_returns_retained", true)
> .Case("attribute_cf_returns_on_parameters", true)
>
> Modified: cfe/trunk/test/Sema/attr-availability-macosx.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/attr-availability-macosx.c?rev=261548&r1=261547&r2=261548&view=diff
> ==============================================================================
> --- cfe/trunk/test/Sema/attr-availability-macosx.c (original)
> +++ cfe/trunk/test/Sema/attr-availability-macosx.c Mon Feb 22 12:24:30 2016
> @@ -1,5 +1,9 @@
> // RUN: %clang_cc1 "-triple" "x86_64-apple-darwin9.0.0" -fsyntax-only -verify %s
>
> +#if !__has_feature(attribute_availability_with_strict)
> +#error "Missing __has_feature"
> +#endif
> +
> void f0(int) __attribute__((availability(macosx,introduced=10.4,deprecated=10.6)));
> void f1(int) __attribute__((availability(macosx,introduced=10.5)));
> void f2(int) __attribute__((availability(macosx,introduced=10.4,deprecated=10.5))); // expected-note {{'f2' has been explicitly marked deprecated here}}
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list