r274064 - AvailabilityAttr: we accept "macos" as the platform name.
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 29 19:18:18 PDT 2016
On Wed, Jun 29, 2016 at 11:57 AM, Manman Ren <manman.ren at gmail.com> wrote:
> Good point! In r274133.
Thank you!
~Aaron
>
> Manman
>
> On Wed, Jun 29, 2016 at 7:30 AM, Aaron Ballman <aaron at aaronballman.com>
> wrote:
>>
>> On Tue, Jun 28, 2016 at 4:55 PM, Manman Ren via cfe-commits
>> <cfe-commits at lists.llvm.org> wrote:
>> > Author: mren
>> > Date: Tue Jun 28 15:55:30 2016
>> > New Revision: 274064
>> >
>> > URL: http://llvm.org/viewvc/llvm-project?rev=274064&view=rev
>> > Log:
>> > AvailabilityAttr: we accept "macos" as the platform name.
>> >
>> > We continue accepting "macosx" but canonicalize it to "macos", When
>> > emitting
>> > diagnostics, we use "macOS" instead of "OS X".
>> >
>> > The PlatformName in TargetInfo is changed from "macosx" to "macos" so we
>> > can
>> > directly compare the Platform in AvailabilityAttr with the PlatformName
>> > in TargetInfo.
>> >
>> > rdar://26795172
>> > rdar://26800775
>> >
>> > Modified:
>> > cfe/trunk/include/clang-c/Index.h
>> > cfe/trunk/include/clang/Basic/Attr.td
>> > cfe/trunk/include/clang/Basic/AttrDocs.td
>> > cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
>> > cfe/trunk/lib/AST/Decl.cpp
>> > cfe/trunk/lib/Basic/Targets.cpp
>> > cfe/trunk/lib/Parse/ParseDecl.cpp
>> > cfe/trunk/test/Index/annotate-comments-availability-attrs.cpp
>> > cfe/trunk/test/Index/availability.c
>> > cfe/trunk/test/Misc/ast-print-objectivec.m
>> > cfe/trunk/test/Sema/attr-availability-macosx.c
>> > cfe/trunk/test/Sema/attr-availability.c
>> > cfe/trunk/test/Sema/attr-print.c
>> > cfe/trunk/test/SemaCXX/attr-deprecated-replacement-fixit.cpp
>> > cfe/trunk/test/SemaObjC/attr-availability-1.m
>> > cfe/trunk/test/SemaObjC/attr-availability.m
>> > cfe/trunk/test/SemaObjC/attr-deprecated.m
>> > cfe/trunk/test/SemaObjC/property-noninherited-availability-attr.m
>> >
>> > Modified: cfe/trunk/include/clang-c/Index.h
>> > URL:
>> > http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang-c/Index.h?rev=274064&r1=274063&r2=274064&view=diff
>> >
>> > ==============================================================================
>> > --- cfe/trunk/include/clang-c/Index.h (original)
>> > +++ cfe/trunk/include/clang-c/Index.h Tue Jun 28 15:55:30 2016
>> > @@ -2570,7 +2570,7 @@ typedef struct CXPlatformAvailability {
>> > * \brief A string that describes the platform for which this
>> > structure
>> > * provides availability information.
>> > *
>> > - * Possible values are "ios" or "macosx".
>> > + * Possible values are "ios" or "macos".
>> > */
>> > CXString Platform;
>> > /**
>> >
>> > Modified: cfe/trunk/include/clang/Basic/Attr.td
>> > URL:
>> > http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?rev=274064&r1=274063&r2=274064&view=diff
>> >
>> > ==============================================================================
>> > --- cfe/trunk/include/clang/Basic/Attr.td (original)
>> > +++ cfe/trunk/include/clang/Basic/Attr.td Tue Jun 28 15:55:30 2016
>> > @@ -477,11 +477,11 @@ def Availability : InheritableAttr {
>> > return llvm::StringSwitch<llvm::StringRef>(Platform)
>> > .Case("android", "Android")
>> > .Case("ios", "iOS")
>> > - .Case("macosx", "OS X")
>> > + .Case("macos", "macOS")
>> > .Case("tvos", "tvOS")
>> > .Case("watchos", "watchOS")
>> > .Case("ios_app_extension", "iOS (App Extension)")
>> > - .Case("macosx_app_extension", "OS X (App Extension)")
>> > + .Case("macos_app_extension", "macOS (App Extension)")
>> > .Case("tvos_app_extension", "tvOS (App Extension)")
>> > .Case("watchos_app_extension", "watchOS (App Extension)")
>> > .Default(llvm::StringRef());
>> >
>> > Modified: cfe/trunk/include/clang/Basic/AttrDocs.td
>> > URL:
>> > http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/AttrDocs.td?rev=274064&r1=274063&r2=274064&view=diff
>> >
>> > ==============================================================================
>> > --- cfe/trunk/include/clang/Basic/AttrDocs.td (original)
>> > +++ cfe/trunk/include/clang/Basic/AttrDocs.td Tue Jun 28 15:55:30 2016
>> > @@ -691,7 +691,7 @@ the function declaration for a hypotheti
>> >
>> > .. code-block:: c++
>> >
>> > - void f(void)
>> > __attribute__((availability(macosx,introduced=10.4,deprecated=10.6,obsoleted=10.7)));
>> > + void f(void)
>> > __attribute__((availability(macos,introduced=10.4,deprecated=10.6,obsoleted=10.7)));
>> >
>> > The availability attribute states that ``f`` was introduced in Mac OS X
>> > 10.4,
>> > deprecated in Mac OS X 10.6, and obsoleted in Mac OS X 10.7. This
>> > information
>> > @@ -743,7 +743,7 @@ are:
>> > the ``-mios-version-min=*version*`` or
>> > ``-miphoneos-version-min=*version*``
>> > command-line arguments.
>> >
>> > -``macosx``
>> > +``macos``
>>
>> Can you please continue to document that we support macosx, but that
>> it's deprecated?
>>
>> ~Aaron
>>
>> > Apple's Mac OS X operating system. The minimum deployment target is
>> > specified by the ``-mmacosx-version-min=*version*`` command-line
>> > argument.
>> >
>> > @@ -777,24 +777,24 @@ platform. For example:
>> >
>> > .. code-block:: c
>> >
>> > - void g(void) __attribute__((availability(macosx,introduced=10.4)));
>> > - void g(void) __attribute__((availability(macosx,introduced=10.4)));
>> > // okay, matches
>> > + void g(void) __attribute__((availability(macos,introduced=10.4)));
>> > + void g(void) __attribute__((availability(macos,introduced=10.4))); //
>> > okay, matches
>> > void g(void) __attribute__((availability(ios,introduced=4.0))); //
>> > okay, adds a new platform
>> > - void g(void); // okay, inherits both macosx and ios availability from
>> > above.
>> > - void g(void) __attribute__((availability(macosx,introduced=10.5)));
>> > // error: mismatch
>> > + void g(void); // okay, inherits both macos and ios availability from
>> > above.
>> > + void g(void) __attribute__((availability(macos,introduced=10.5))); //
>> > error: mismatch
>> >
>> > When one method overrides another, the overriding method can be more
>> > widely available than the overridden method, e.g.,:
>> >
>> > .. code-block:: objc
>> >
>> > @interface A
>> > - - (id)method __attribute__((availability(macosx,introduced=10.4)));
>> > - - (id)method2 __attribute__((availability(macosx,introduced=10.4)));
>> > + - (id)method __attribute__((availability(macos,introduced=10.4)));
>> > + - (id)method2 __attribute__((availability(macos,introduced=10.4)));
>> > @end
>> >
>> > @interface B : A
>> > - - (id)method __attribute__((availability(macosx,introduced=10.3)));
>> > // okay: method moved into base class later
>> > - - (id)method __attribute__((availability(macosx,introduced=10.5)));
>> > // error: this method was available via the base class in 10.4
>> > + - (id)method __attribute__((availability(macos,introduced=10.3))); //
>> > okay: method moved into base class later
>> > + - (id)method __attribute__((availability(macos,introduced=10.5))); //
>> > error: this method was available via the base class in 10.4
>> > @end
>> > }];
>> > }
>> >
>> > Modified: cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
>> > URL:
>> > http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td?rev=274064&r1=274063&r2=274064&view=diff
>> >
>> > ==============================================================================
>> > --- cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td (original)
>> > +++ cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td Tue Jun 28
>> > 15:55:30 2016
>> > @@ -803,7 +803,7 @@ def warn_expected_consistent_version_sep
>> > def err_zero_version : Error<
>> > "version number must have non-zero major, minor, or sub-minor
>> > version">;
>> > def err_availability_expected_platform : Error<
>> > - "expected a platform name, e.g., 'macosx'">;
>> > + "expected a platform name, e.g., 'macos'">;
>> >
>> > // objc_bridge_related attribute
>> > def err_objcbridge_related_expected_related_class : Error<
>> >
>> > Modified: cfe/trunk/lib/AST/Decl.cpp
>> > URL:
>> > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=274064&r1=274063&r2=274064&view=diff
>> >
>> > ==============================================================================
>> > --- cfe/trunk/lib/AST/Decl.cpp (original)
>> > +++ cfe/trunk/lib/AST/Decl.cpp Tue Jun 28 15:55:30 2016
>> > @@ -222,7 +222,7 @@ static Optional<Visibility> getVisibilit
>> > // implies visibility(default).
>> > if (D->getASTContext().getTargetInfo().getTriple().isOSDarwin()) {
>> > for (const auto *A : D->specific_attrs<AvailabilityAttr>())
>> > - if (A->getPlatform()->getName().equals("macosx"))
>> > + if (A->getPlatform()->getName().equals("macos"))
>> > return DefaultVisibility;
>> > }
>> >
>> >
>> > Modified: cfe/trunk/lib/Basic/Targets.cpp
>> > URL:
>> > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=274064&r1=274063&r2=274064&view=diff
>> >
>> > ==============================================================================
>> > --- cfe/trunk/lib/Basic/Targets.cpp (original)
>> > +++ cfe/trunk/lib/Basic/Targets.cpp Tue Jun 28 15:55:30 2016
>> > @@ -141,7 +141,7 @@ static void getDarwinDefines(MacroBuilde
>> > unsigned Maj, Min, Rev;
>> > if (Triple.isMacOSX()) {
>> > Triple.getMacOSXVersion(Maj, Min, Rev);
>> > - PlatformName = "macosx";
>> > + PlatformName = "macos";
>> > } else {
>> > Triple.getOSVersion(Maj, Min, Rev);
>> > PlatformName = llvm::Triple::getOSTypeName(Triple.getOS());
>> >
>> > Modified: cfe/trunk/lib/Parse/ParseDecl.cpp
>> > URL:
>> > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=274064&r1=274063&r2=274064&view=diff
>> >
>> > ==============================================================================
>> > --- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
>> > +++ cfe/trunk/lib/Parse/ParseDecl.cpp Tue Jun 28 15:55:30 2016
>> > @@ -880,6 +880,13 @@ void Parser::ParseAvailabilityAttribute(
>> > return;
>> > }
>> > IdentifierLoc *Platform = ParseIdentifierLoc();
>> > + // Canonicalize platform name from "macosx" to "macos".
>> > + if (Platform->Ident && Platform->Ident->getName() == "macosx")
>> > + Platform->Ident = PP.getIdentifierInfo("macos");
>> > + // Canonicalize platform name from "macosx_app_extension" to
>> > + // "macos_app_extension".
>> > + if (Platform->Ident && Platform->Ident->getName() ==
>> > "macosx_app_extension")
>> > + Platform->Ident = PP.getIdentifierInfo("macos_app_extension");
>> >
>> > // Parse the ',' following the platform name.
>> > if (ExpectAndConsume(tok::comma)) {
>> >
>> > Modified: cfe/trunk/test/Index/annotate-comments-availability-attrs.cpp
>> > URL:
>> > http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/annotate-comments-availability-attrs.cpp?rev=274064&r1=274063&r2=274064&view=diff
>> >
>> > ==============================================================================
>> > --- cfe/trunk/test/Index/annotate-comments-availability-attrs.cpp
>> > (original)
>> > +++ cfe/trunk/test/Index/annotate-comments-availability-attrs.cpp Tue
>> > Jun 28 15:55:30 2016
>> > @@ -13,12 +13,12 @@
>> > void attr_availability_1()
>> > __attribute__((availability(macosx,obsoleted=10.0,introduced=8.0,deprecated=9.0,
>> > message="use availability_test in <foo.h>")))
>> > __attribute__((availability(ios,unavailable,
>> > message="not for iOS")));
>> >
>> > -// CHECK: FullCommentAsXML=[<Function
>> > file="{{[^"]+}}annotate-comments-availability-attrs.cpp" line="[[@LINE-3]]"
>> > column="6"><Name>attr_availability_1</Name><USR>c:@F at attr_availability_1#</USR><Declaration>void
>> > attr_availability_1()</Declaration><Abstract><Para>
>> > Aaa.</Para></Abstract><Availability
>> > distribution="iOS"><DeprecationSummary>not for
>> > iOS</DeprecationSummary><Unavailable/></Availability><Availability
>> > distribution="OS
>> > X"><IntroducedInVersion>8.0</IntroducedInVersion><DeprecatedInVersion>9.0</DeprecatedInVersion><RemovedAfterVersion>10.0</RemovedAfterVersion><DeprecationSummary>use
>> > availability_test in
>> > <foo.h></DeprecationSummary></Availability></Function>]
>> > +// CHECK: FullCommentAsXML=[<Function
>> > file="{{[^"]+}}annotate-comments-availability-attrs.cpp" line="[[@LINE-3]]"
>> > column="6"><Name>attr_availability_1</Name><USR>c:@F at attr_availability_1#</USR><Declaration>void
>> > attr_availability_1()</Declaration><Abstract><Para>
>> > Aaa.</Para></Abstract><Availability
>> > distribution="iOS"><DeprecationSummary>not for
>> > iOS</DeprecationSummary><Unavailable/></Availability><Availability
>> > distribution="macOS"><IntroducedInVersion>8.0</IntroducedInVersion><DeprecatedInVersion>9.0</DeprecatedInVersion><RemovedAfterVersion>10.0</RemovedAfterVersion><DeprecationSummary>use
>> > availability_test in
>> > <foo.h></DeprecationSummary></Availability></Function>]
>> >
>> > /// Aaa.
>> > void attr_availability_2()
>> > __attribute__((availability(macosx,obsoleted=10.0.1,introduced=8.0.1,deprecated=9.0.1)));
>> >
>> > -// CHECK: FullCommentAsXML=[<Function
>> > file="{{[^"]+}}annotate-comments-availability-attrs.cpp" line="[[@LINE-2]]"
>> > column="6"><Name>attr_availability_2</Name><USR>c:@F at attr_availability_2#</USR><Declaration>void
>> > attr_availability_2()</Declaration><Abstract><Para>
>> > Aaa.</Para></Abstract><Availability distribution="OS
>> > X"><IntroducedInVersion>8.0.1</IntroducedInVersion><DeprecatedInVersion>9.0.1</DeprecatedInVersion><RemovedAfterVersion>10.0.1</RemovedAfterVersion></Availability></Function>]
>> > +// CHECK: FullCommentAsXML=[<Function
>> > file="{{[^"]+}}annotate-comments-availability-attrs.cpp" line="[[@LINE-2]]"
>> > column="6"><Name>attr_availability_2</Name><USR>c:@F at attr_availability_2#</USR><Declaration>void
>> > attr_availability_2()</Declaration><Abstract><Para>
>> > Aaa.</Para></Abstract><Availability
>> > distribution="macOS"><IntroducedInVersion>8.0.1</IntroducedInVersion><DeprecatedInVersion>9.0.1</DeprecatedInVersion><RemovedAfterVersion>10.0.1</RemovedAfterVersion></Availability></Function>]
>> >
>> > /// Aaa.
>> > void attr_deprecated_1() __attribute__((deprecated));
>> >
>> > Modified: cfe/trunk/test/Index/availability.c
>> > URL:
>> > http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/availability.c?rev=274064&r1=274063&r2=274064&view=diff
>> >
>> > ==============================================================================
>> > --- cfe/trunk/test/Index/availability.c (original)
>> > +++ cfe/trunk/test/Index/availability.c Tue Jun 28 15:55:30 2016
>> > @@ -14,7 +14,7 @@ enum {
>> > // RUN: FileCheck -check-prefix=CHECK-1 %s < %t
>> > // RUN: FileCheck -check-prefix=CHECK-2 %s < %t
>> > // CHECK-1: (ios, introduced=3.2, deprecated=4.1)
>> > -// CHECK-2: (macosx, introduced=10.4, deprecated=10.5, obsoleted=10.7)
>> > +// CHECK-2: (macos, introduced=10.4, deprecated=10.5, obsoleted=10.7)
>> >
>> > // CHECK-2: EnumConstantDecl=old_enum:6:3 (Definition) (deprecated)
>> > -// CHECK-2: EnumConstantDecl=old_enum_plat:10:3 {{.*}} (macosx,
>> > introduced=10.4, deprecated=10.5, obsoleted=10.7)
>> > +// CHECK-2: EnumConstantDecl=old_enum_plat:10:3 {{.*}} (macos,
>> > introduced=10.4, deprecated=10.5, obsoleted=10.7)
>> >
>> > Modified: cfe/trunk/test/Misc/ast-print-objectivec.m
>> > URL:
>> > http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/ast-print-objectivec.m?rev=274064&r1=274063&r2=274064&view=diff
>> >
>> > ==============================================================================
>> > --- cfe/trunk/test/Misc/ast-print-objectivec.m (original)
>> > +++ cfe/trunk/test/Misc/ast-print-objectivec.m Tue Jun 28 15:55:30 2016
>> > @@ -20,22 +20,22 @@
>> > @end
>> >
>> > // CHECK: @protocol P
>> > -// CHECK: - (void) MethP __attribute__((availability(macosx,
>> > introduced=10.1.0, deprecated=10.2)));
>> > +// CHECK: - (void) MethP __attribute__((availability(macos,
>> > introduced=10.1.0, deprecated=10.2)));
>> > // CHECK: @end
>> >
>> > // CHECK: @interface I : NSObject<P>
>> > -// CHECK: - (void) MethI __attribute__((availability(macosx,
>> > introduced=10.1.0, deprecated=10.2)));
>> > +// CHECK: - (void) MethI __attribute__((availability(macos,
>> > introduced=10.1.0, deprecated=10.2)));
>> > // CHECK: @end
>> >
>> > // CHECK: @interface I(CAT)
>> > -// CHECK: - (void) MethCAT __attribute__((availability(macosx,
>> > introduced=10_1_0, deprecated=10_2)));
>> > +// CHECK: - (void) MethCAT __attribute__((availability(macos,
>> > introduced=10_1_0, deprecated=10_2)));
>> > // CHECK: @end
>> >
>> > // CHECK: @implementation I
>> > -// CHECK: - (void) MethP __attribute__((availability(macosx,
>> > introduced=10.1.0, deprecated=10.2))) {
>> > +// CHECK: - (void) MethP __attribute__((availability(macos,
>> > introduced=10.1.0, deprecated=10.2))) {
>> > // CHECK: }
>> >
>> > -// CHECK: - (void) MethI __attribute__((availability(macosx,
>> > introduced=10.1.0, deprecated=10.2))) {
>> > +// CHECK: - (void) MethI __attribute__((availability(macos,
>> > introduced=10.1.0, deprecated=10.2))) {
>> > // CHECK: }
>> >
>> > // CHECK: @end
>> >
>> > 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=274064&r1=274063&r2=274064&view=diff
>> >
>> > ==============================================================================
>> > --- cfe/trunk/test/Sema/attr-availability-macosx.c (original)
>> > +++ cfe/trunk/test/Sema/attr-availability-macosx.c Tue Jun 28 15:55:30
>> > 2016
>> > @@ -15,11 +15,11 @@ void f6(int) __attribute__((availability
>> > void test() {
>> > f0(0);
>> > f1(0);
>> > - f2(0); // expected-warning{{'f2' is deprecated: first deprecated in
>> > OS X 10.5}}
>> > + f2(0); // expected-warning{{'f2' is deprecated: first deprecated in
>> > macOS 10.5}}
>> > f3(0);
>> > - f4(0); // expected-error{{f4' is unavailable: obsoleted in OS X
>> > 10.5}}
>> > - f5(0); // expected-error{{'f5' is unavailable: not available on OS
>> > X}}
>> > - f6(0); // expected-error{{'f6' is unavailable: introduced in OS X
>> > 10.6}}
>> > + f4(0); // expected-error{{f4' is unavailable: obsoleted in macOS
>> > 10.5}}
>> > + f5(0); // expected-error{{'f5' is unavailable: not available on
>> > macOS}}
>> > + f6(0); // expected-error{{'f6' is unavailable: introduced in macOS
>> > 10.6}}
>> > }
>> >
>> > struct __attribute__((availability(macosx,strict,introduced=10.6)))
>> > @@ -27,7 +27,7 @@ struct __attribute__((availability(macos
>> > expected-note{{'not_yet_introduced_struct' has been explicitly
>> > marked unavailable here}}
>> >
>> > void uses_not_introduced_struct(struct not_yet_introduced_struct *); //
>> > \
>> > - expected-error{{'not_yet_introduced_struct' is unavailable:
>> > introduced in OS X 10.6}}
>> > + expected-error{{'not_yet_introduced_struct' is unavailable:
>> > introduced in macOS 10.6}}
>> >
>> > __attribute__((availability(macosx,strict,introduced=10.6)))
>> > void uses_not_introduced_struct_same_availability(struct
>> > not_yet_introduced_struct *);
>> > @@ -53,6 +53,6 @@ struct __attribute__((availability(macos
>> > };
>> > struct type_info;
>> > int test2() {
>> > - struct type_info *t; // expected-error{{'type_info' is unavailable:
>> > introduced in OS X 10.9}}
>> > + struct type_info *t; // expected-error{{'type_info' is unavailable:
>> > introduced in macOS 10.9}}
>> > return 0;
>> > }
>> >
>> > Modified: cfe/trunk/test/Sema/attr-availability.c
>> > URL:
>> > http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/attr-availability.c?rev=274064&r1=274063&r2=274064&view=diff
>> >
>> > ==============================================================================
>> > --- cfe/trunk/test/Sema/attr-availability.c (original)
>> > +++ cfe/trunk/test/Sema/attr-availability.c Tue Jun 28 15:55:30 2016
>> > @@ -2,7 +2,7 @@
>> > // RUN: %clang_cc1 -D WARN_PARTIAL -Wpartial-availability -triple
>> > x86_64-apple-darwin9 -fsyntax-only -fblocks -verify %s
>> > //
>> >
>> > -void f0()
>> > __attribute__((availability(macosx,introduced=10.4,deprecated=10.2))); //
>> > expected-warning{{feature cannot be deprecated in OS X version 10.2 before
>> > it was introduced in version 10.4; attribute ignored}}
>> > +void f0()
>> > __attribute__((availability(macosx,introduced=10.4,deprecated=10.2))); //
>> > expected-warning{{feature cannot be deprecated in macOS version 10.2 before
>> > it was introduced in version 10.4; attribute ignored}}
>> > void f1()
>> > __attribute__((availability(ios,obsoleted=2.1,deprecated=3.0))); //
>> > expected-warning{{feature cannot be obsoleted in iOS version 2.1 before it
>> > was deprecated in version 3.0; attribute ignored}}
>> > void f2()
>> > __attribute__((availability(ios,introduced=2.1,deprecated=2.1)));
>> >
>> > @@ -26,11 +26,11 @@ enum __attribute__((availability(macosx,
>> > };
>> >
>> > void test_10095131() {
>> > - ATSFontGetName("Hello"); // expected-warning {{'ATSFontGetName' is
>> > deprecated: first deprecated in OS X 9.0 - use CTFontCopyFullName}}
>> > - ATSFontGetPostScriptName(100); // expected-error
>> > {{'ATSFontGetPostScriptName' is unavailable: obsoleted in OS X 9.0 - use
>> > ATSFontGetFullPostScriptName}}
>> > + ATSFontGetName("Hello"); // expected-warning {{'ATSFontGetName' is
>> > deprecated: first deprecated in macOS 9.0 - use CTFontCopyFullName}}
>> > + ATSFontGetPostScriptName(100); // expected-error
>> > {{'ATSFontGetPostScriptName' is unavailable: obsoleted in macOS 9.0 - use
>> > ATSFontGetFullPostScriptName}}
>> >
>> > #if defined(WARN_PARTIAL)
>> > - // expected-warning at +2 {{is partial: introduced in OS X 10.8}}
>> > expected-note at +2 {{explicitly redeclare 'PartiallyAvailable' to silence this
>> > warning}}
>> > + // expected-warning at +2 {{is partial: introduced in macOS 10.8}}
>> > expected-note at +2 {{explicitly redeclare 'PartiallyAvailable' to silence this
>> > warning}}
>> > #endif
>> > PartiallyAvailable();
>> > }
>> >
>> > Modified: cfe/trunk/test/Sema/attr-print.c
>> > URL:
>> > http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/attr-print.c?rev=274064&r1=274063&r2=274064&view=diff
>> >
>> > ==============================================================================
>> > --- cfe/trunk/test/Sema/attr-print.c (original)
>> > +++ cfe/trunk/test/Sema/attr-print.c Tue Jun 28 15:55:30 2016
>> > @@ -33,5 +33,5 @@ int * __uptr __ptr32 p32_3;
>> > // CHECK: int * __sptr * __ptr32 ppsp32;
>> > int * __sptr * __ptr32 ppsp32;
>> >
>> > -// CHECK: __attribute__((availability(macosx, strict,
>> > introduced=10.6)));
>> > +// CHECK: __attribute__((availability(macos, strict,
>> > introduced=10.6)));
>> > void f6(int)
>> > __attribute__((availability(macosx,strict,introduced=10.6)));
>> >
>> > Modified: cfe/trunk/test/SemaCXX/attr-deprecated-replacement-fixit.cpp
>> > URL:
>> > http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/attr-deprecated-replacement-fixit.cpp?rev=274064&r1=274063&r2=274064&view=diff
>> >
>> > ==============================================================================
>> > --- cfe/trunk/test/SemaCXX/attr-deprecated-replacement-fixit.cpp
>> > (original)
>> > +++ cfe/trunk/test/SemaCXX/attr-deprecated-replacement-fixit.cpp Tue Jun
>> > 28 15:55:30 2016
>> > @@ -19,6 +19,6 @@ void new2(int);
>> > void test() {
>> > f_8(0); // expected-warning{{'f_8' is deprecated}}
>> > // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:3-[[@LINE-1]]:6}:"new8"
>> > - f_2(0); // expected-warning{{'f_2' is deprecated: first deprecated in
>> > OS X 9.0}}
>> > + f_2(0); // expected-warning{{'f_2' is deprecated: first deprecated in
>> > macOS 9.0}}
>> > // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:3-[[@LINE-1]]:6}:"new2"
>> > }
>> >
>> > Modified: cfe/trunk/test/SemaObjC/attr-availability-1.m
>> > URL:
>> > http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/attr-availability-1.m?rev=274064&r1=274063&r2=274064&view=diff
>> >
>> > ==============================================================================
>> > --- cfe/trunk/test/SemaObjC/attr-availability-1.m (original)
>> > +++ cfe/trunk/test/SemaObjC/attr-availability-1.m Tue Jun 28 15:55:30
>> > 2016
>> > @@ -25,19 +25,19 @@
>> > // rdar://11475360
>> > @interface B : A
>> > - (void)method; // NOTE: we expect 'method' to *not* inherit
>> > availability.
>> > -- (void)overridden
>> > __attribute__((availability(macosx,introduced=10_4))); //
>> > expected-warning{{overriding method introduced after overridden method on OS
>> > X (10_4 vs. 10_3)}}
>> > +- (void)overridden
>> > __attribute__((availability(macosx,introduced=10_4))); //
>> > expected-warning{{overriding method introduced after overridden method on
>> > macOS (10_4 vs. 10_3)}}
>> > - (void)overridden2
>> > __attribute__((availability(macosx,introduced=10_2)));
>> > - (void)overridden3
>> > __attribute__((availability(macosx,deprecated=10_4)));
>> > -- (void)overridden4
>> > __attribute__((availability(macosx,deprecated=10_2))); //
>> > expected-warning{{overriding method deprecated before overridden method on
>> > OS X (10_3 vs. 10_2)}}
>> > +- (void)overridden4
>> > __attribute__((availability(macosx,deprecated=10_2))); //
>> > expected-warning{{overriding method deprecated before overridden method on
>> > macOS (10_3 vs. 10_2)}}
>> > - (void)overridden5
>> > __attribute__((availability(macosx,introduced=10_3)));
>> > -- (void)overridden6 __attribute__((availability(macosx,unavailable)));
>> > // expected-warning{{overriding method cannot be unavailable on OS X when
>> > its overridden method is available}}
>> > +- (void)overridden6 __attribute__((availability(macosx,unavailable)));
>> > // expected-warning{{overriding method cannot be unavailable on macOS when
>> > its overridden method is available}}
>> > @end
>> >
>> > void f(A *a, B *b) {
>> > - [a method]; // expected-warning{{'method' is deprecated: first
>> > deprecated in OS X 10.2}}
>> > + [a method]; // expected-warning{{'method' is deprecated: first
>> > deprecated in macOS 10.2}}
>> > [b method]; // no-warning
>> > - [a proto_method]; // expected-warning{{'proto_method' is deprecated:
>> > first deprecated in OS X 10.2}}
>> > - [b proto_method]; // expected-warning{{'proto_method' is deprecated:
>> > first deprecated in OS X 10.2}}
>> > + [a proto_method]; // expected-warning{{'proto_method' is deprecated:
>> > first deprecated in macOS 10.2}}
>> > + [b proto_method]; // expected-warning{{'proto_method' is deprecated:
>> > first deprecated in macOS 10.2}}
>> > }
>> >
>> > // Test case for <rdar://problem/11627873>. Warn about
>> > @@ -57,7 +57,7 @@ void f(A *a, B *b) {
>> >
>> > @implementation D
>> > - (void) method {
>> > - [super method]; // expected-warning {{'method' is deprecated: first
>> > deprecated in OS X 10.2}}
>> > + [super method]; // expected-warning {{'method' is deprecated: first
>> > deprecated in macOS 10.2}}
>> > }
>> > @end
>> >
>> > @@ -112,9 +112,9 @@ id NSNibOwner, topNibObjects;
>> > @end
>> >
>> > void foo (A18804883* pa) {
>> > - [pa interface_method]; // expected-error {{'interface_method' is
>> > unavailable: not available on OS X}}
>> > + [pa interface_method]; // expected-error {{'interface_method' is
>> > unavailable: not available on macOS}}
>> > [pa proto_method];
>> > - [pa strange_method]; // expected-error {{'strange_method' is
>> > unavailable: not available on OS X}}
>> > + [pa strange_method]; // expected-error {{'strange_method' is
>> > unavailable: not available on macOS}}
>> > [pa always_available];
>> > }
>> >
>> >
>> > Modified: cfe/trunk/test/SemaObjC/attr-availability.m
>> > URL:
>> > http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/attr-availability.m?rev=274064&r1=274063&r2=274064&view=diff
>> >
>> > ==============================================================================
>> > --- cfe/trunk/test/SemaObjC/attr-availability.m (original)
>> > +++ cfe/trunk/test/SemaObjC/attr-availability.m Tue Jun 28 15:55:30 2016
>> > @@ -30,32 +30,32 @@
>> > @interface B : A
>> > - (void)method; // NOTE: we expect 'method' to *not* inherit
>> > availability.
>> > - (void)partialMethod; // Likewise.
>> > -- (void)overridden
>> > __attribute__((availability(macosx,introduced=10.4))); //
>> > expected-warning{{overriding method introduced after overridden method on OS
>> > X (10.4 vs. 10.3)}}
>> > +- (void)overridden
>> > __attribute__((availability(macosx,introduced=10.4))); //
>> > expected-warning{{overriding method introduced after overridden method on
>> > macOS (10.4 vs. 10.3)}}
>> > - (void)overridden2
>> > __attribute__((availability(macosx,introduced=10.2)));
>> > - (void)overridden3
>> > __attribute__((availability(macosx,deprecated=10.4)));
>> > -- (void)overridden4
>> > __attribute__((availability(macosx,deprecated=10.2))); //
>> > expected-warning{{overriding method deprecated before overridden method on
>> > OS X (10.3 vs. 10.2)}}
>> > +- (void)overridden4
>> > __attribute__((availability(macosx,deprecated=10.2))); //
>> > expected-warning{{overriding method deprecated before overridden method on
>> > macOS (10.3 vs. 10.2)}}
>> > - (void)overridden5
>> > __attribute__((availability(macosx,introduced=10.3)));
>> > -- (void)overridden6 __attribute__((availability(macosx,unavailable)));
>> > // expected-warning{{overriding method cannot be unavailable on OS X when
>> > its overridden method is available}}
>> > +- (void)overridden6 __attribute__((availability(macosx,unavailable)));
>> > // expected-warning{{overriding method cannot be unavailable on macOS when
>> > its overridden method is available}}
>> > - (void)unavailableMethod; // does *not* inherit unavailability
>> > @end
>> >
>> > void f(A *a, B *b) {
>> > - [a method]; // expected-warning{{'method' is deprecated: first
>> > deprecated in OS X 10.2}}
>> > + [a method]; // expected-warning{{'method' is deprecated: first
>> > deprecated in macOS 10.2}}
>> > [b method]; // no-warning
>> > - [a proto_method]; // expected-warning{{'proto_method' is deprecated:
>> > first deprecated in OS X 10.2}}
>> > - [b proto_method]; // expected-warning{{'proto_method' is deprecated:
>> > first deprecated in OS X 10.2}}
>> > + [a proto_method]; // expected-warning{{'proto_method' is deprecated:
>> > first deprecated in macOS 10.2}}
>> > + [b proto_method]; // expected-warning{{'proto_method' is deprecated:
>> > first deprecated in macOS 10.2}}
>> >
>> > #if defined(WARN_PARTIAL)
>> > - // expected-warning at +2 {{'partialMethod' is partial: introduced in OS
>> > X 10.8}} expected-note at +2 {{explicitly redeclare 'partialMethod' to silence
>> > this warning}}
>> > + // expected-warning at +2 {{'partialMethod' is partial: introduced in
>> > macOS 10.8}} expected-note at +2 {{explicitly redeclare 'partialMethod' to
>> > silence this warning}}
>> > #endif
>> > [a partialMethod];
>> > [b partialMethod]; // no warning
>> > #if defined(WARN_PARTIAL)
>> > - // expected-warning at +2 {{'partial_proto_method' is partial:
>> > introduced in OS X 10.8}} expected-note at +2 {{explicitly redeclare
>> > 'partial_proto_method' to silence this warning}}
>> > + // expected-warning at +2 {{'partial_proto_method' is partial:
>> > introduced in macOS 10.8}} expected-note at +2 {{explicitly redeclare
>> > 'partial_proto_method' to silence this warning}}
>> > #endif
>> > [a partial_proto_method];
>> > #if defined(WARN_PARTIAL)
>> > - // expected-warning at +2 {{'partial_proto_method' is partial:
>> > introduced in OS X 10.8}} expected-note at +2 {{explicitly redeclare
>> > 'partial_proto_method' to silence this warning}}
>> > + // expected-warning at +2 {{'partial_proto_method' is partial:
>> > introduced in macOS 10.8}} expected-note at +2 {{explicitly redeclare
>> > 'partial_proto_method' to silence this warning}}
>> > #endif
>> > [b partial_proto_method];
>> > }
>> > @@ -89,7 +89,7 @@ void f_after_redecl(A *a, B *b) {
>> >
>> > @implementation D
>> > - (void) method {
>> > - [super method]; // expected-warning {{'method' is deprecated: first
>> > deprecated in OS X 10.2}}
>> > + [super method]; // expected-warning {{'method' is deprecated: first
>> > deprecated in macOS 10.2}}
>> > }
>> > @end
>> >
>> > @@ -163,14 +163,14 @@ void partialfun(PartialI* a) {
>> > [a partialMethod]; // no warning
>> > [a ipartialMethod1]; // no warning
>> > #if defined(WARN_PARTIAL)
>> > - // expected-warning at +2 {{'ipartialMethod2' is partial: introduced in
>> > OS X 10.8}} expected-note at +2 {{explicitly redeclare 'ipartialMethod2' to
>> > silence this warning}}
>> > + // expected-warning at +2 {{'ipartialMethod2' is partial: introduced in
>> > macOS 10.8}} expected-note at +2 {{explicitly redeclare 'ipartialMethod2' to
>> > silence this warning}}
>> > #endif
>> > [a ipartialMethod2];
>> > [a ppartialMethod]; // no warning
>> > [PartialI partialMethod]; // no warning
>> > [PartialI ipartialMethod1]; // no warning
>> > #if defined(WARN_PARTIAL)
>> > - // expected-warning at +2 {{'ipartialMethod2' is partial: introduced in
>> > OS X 10.8}} expected-note at +2 {{explicitly redeclare 'ipartialMethod2' to
>> > silence this warning}}
>> > + // expected-warning at +2 {{'ipartialMethod2' is partial: introduced in
>> > macOS 10.8}} expected-note at +2 {{explicitly redeclare 'ipartialMethod2' to
>> > silence this warning}}
>> > #endif
>> > [PartialI ipartialMethod2];
>> > [PartialI ppartialMethod]; // no warning
>> > @@ -183,7 +183,7 @@ __attribute__((availability(macosx, intr
>> > @end
>> >
>> > #if defined(WARN_PARTIAL)
>> > - // expected-warning at +2 {{'PartialI2' is partial: introduced in OS X
>> > 10.8}} expected-note at +2 {{explicitly redeclare 'PartialI2' to silence this
>> > warning}}
>> > + // expected-warning at +2 {{'PartialI2' is partial: introduced in macOS
>> > 10.8}} expected-note at +2 {{explicitly redeclare 'PartialI2' to silence this
>> > warning}}
>> > #endif
>> > void partialinter1(PartialI2* p) {
>> > }
>> > @@ -220,7 +220,7 @@ void use_myEnum() {
>> > @end
>> >
>> > void testAvailabilityP2(id<AvailabilityP2> obj) {
>> > - [obj methodA]; // expected-warning{{'methodA' is deprecated: first
>> > deprecated in OS X 10.2}}
>> > + [obj methodA]; // expected-warning{{'methodA' is deprecated: first
>> > deprecated in macOS 10.2}}
>> > [obj methodB]; // expected-error{{'methodB' is unavailable}}
>> > }
>> >
>> > @@ -242,13 +242,13 @@ __attribute__((objc_root_class))
>> > -(void)methodA {
>> > // Make sure we're not inheriting availability.
>> > id<AvailabilityP2> obj = self;
>> > - [obj methodA]; // expected-warning{{'methodA' is deprecated: first
>> > deprecated in OS X 10.2}}
>> > + [obj methodA]; // expected-warning{{'methodA' is deprecated: first
>> > deprecated in macOS 10.2}}
>> > [obj methodB]; // expected-error{{'methodB' is unavailable}}
>> > }
>> > -(void)methodB {
>> > // Make sure we're not inheriting unavailability.
>> > id<AvailabilityP2> obj = self;
>> > - [obj methodA]; // expected-warning{{'methodA' is deprecated: first
>> > deprecated in OS X 10.2}}
>> > + [obj methodA]; // expected-warning{{'methodA' is deprecated: first
>> > deprecated in macOS 10.2}}
>> > [obj methodB]; // expected-error{{'methodB' is unavailable}}
>> > }
>> >
>> > @@ -257,13 +257,13 @@ __attribute__((objc_root_class))
>> > void testImplementsAvailabilityP2b(ImplementsAvailabilityP2b *obj) {
>> > // still get warnings/errors because we see the protocol version.
>> >
>> > - [obj methodA]; // expected-warning{{'methodA' is deprecated: first
>> > deprecated in OS X 10.2}}
>> > + [obj methodA]; // expected-warning{{'methodA' is deprecated: first
>> > deprecated in macOS 10.2}}
>> > [obj methodB]; // expected-error{{'methodB' is unavailable}}
>> > }
>> >
>> > __attribute__((objc_root_class))
>> > @interface ImplementsAvailabilityP2c <AvailabilityP2>
>> > --(void)methodA __attribute__((availability(macosx,introduced=10.2)));
>> > // expected-warning{{method introduced after the protocol method it
>> > implements on OS X (10.2 vs. 10.1)}}
>> > +-(void)methodA __attribute__((availability(macosx,introduced=10.2)));
>> > // expected-warning{{method introduced after the protocol method it
>> > implements on macOS (10.2 vs. 10.1)}}
>> > -(void)methodB __attribute__((unavailable));
>> > @end
>> >
>> > @@ -272,7 +272,7 @@ __attribute__((objc_root_class))
>> > @end
>> >
>> > @implementation ImplementsAvailabilityP2d
>> > --(void)methodA __attribute__((availability(macosx,introduced=10.2))) //
>> > expected-warning{{method introduced after the protocol method it implements
>> > on OS X (10.2 vs. 10.1)}}
>> > +-(void)methodA __attribute__((availability(macosx,introduced=10.2))) //
>> > expected-warning{{method introduced after the protocol method it implements
>> > on macOS (10.2 vs. 10.1)}}
>> > {
>> > }
>> > -(void)methodB __attribute__((unavailable)) {
>> >
>> > Modified: cfe/trunk/test/SemaObjC/attr-deprecated.m
>> > URL:
>> > http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/attr-deprecated.m?rev=274064&r1=274063&r2=274064&view=diff
>> >
>> > ==============================================================================
>> > --- cfe/trunk/test/SemaObjC/attr-deprecated.m (original)
>> > +++ cfe/trunk/test/SemaObjC/attr-deprecated.m Tue Jun 28 15:55:30 2016
>> > @@ -235,7 +235,7 @@ expected-note {{property declared here}}
>> >
>> > id PID = 0;
>> > const char * func() {
>> > - return [PID cString]; // expected-warning {{'cString' is deprecated:
>> > first deprecated in OS X 10.4}}
>> > + return [PID cString]; // expected-warning {{'cString' is deprecated:
>> > first deprecated in macOS 10.4}}
>> > }
>> >
>> > // rdar://18960378
>> >
>> > Modified:
>> > cfe/trunk/test/SemaObjC/property-noninherited-availability-attr.m
>> > URL:
>> > http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/property-noninherited-availability-attr.m?rev=274064&r1=274063&r2=274064&view=diff
>> >
>> > ==============================================================================
>> > --- cfe/trunk/test/SemaObjC/property-noninherited-availability-attr.m
>> > (original)
>> > +++ cfe/trunk/test/SemaObjC/property-noninherited-availability-attr.m
>> > Tue Jun 28 15:55:30 2016
>> > @@ -20,8 +20,8 @@
>> > @end
>> >
>> > void test(Foo *y, Bar *x, id<myProtocol> z) {
>> > - y.myProperty = 0; // expected-warning {{'myProperty' is deprecated:
>> > first deprecated in OS X 10.8}}
>> > - (void)[y myProperty]; // expected-warning {{'myProperty' is
>> > deprecated: first deprecated in OS X 10.8}}
>> > + y.myProperty = 0; // expected-warning {{'myProperty' is deprecated:
>> > first deprecated in macOS 10.8}}
>> > + (void)[y myProperty]; // expected-warning {{'myProperty' is
>> > deprecated: first deprecated in macOS 10.8}}
>> >
>> > x.myProperty = 1; // no-warning
>> > (void)[x myProperty]; // no-warning
>> > @@ -29,5 +29,5 @@ void test(Foo *y, Bar *x, id<myProtocol>
>> > x.myProtocolProperty = 0; // no-warning
>> >
>> > (void)[x myProtocolProperty]; // no-warning
>> > - (void)[z myProtocolProperty]; // expected-warning
>> > {{'myProtocolProperty' is deprecated: first deprecated in OS X 10.8}}
>> > + (void)[z myProtocolProperty]; // expected-warning
>> > {{'myProtocolProperty' is deprecated: first deprecated in macOS 10.8}}
>> > }
>> >
>> >
>> > _______________________________________________
>> > 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