From: Aaron Ballman Date: Thu, 19 Dec 2013 22:12:51 +0000 (+0000) Subject: After discussing with John McCall, removing the ns_bridged attribute as it is unused. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=531dac19f53f1a73c076f52e2051b0bb4ca706e5;p=clang After discussing with John McCall, removing the ns_bridged attribute as it is unused. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197729 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td index 27fc3938ab..8fa3364867 100644 --- a/include/clang/Basic/Attr.td +++ b/include/clang/Basic/Attr.td @@ -634,12 +634,6 @@ def NoThrow : InheritableAttr { let Spellings = [GNU<"nothrow">, CXX11<"gnu", "nothrow">]; } -def NSBridged : InheritableAttr { - let Spellings = [GNU<"ns_bridged">]; - let Subjects = SubjectList<[Struct], ErrorDiag, "ExpectedStruct">; - let Args = [IdentifierArgument<"BridgedType", 1>]; -} - def ObjCBridge : InheritableAttr { let Spellings = [GNU<"objc_bridge">]; let Subjects = SubjectList<[Record], ErrorDiag>; diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 91a19aaf88..5bc5637c52 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -2451,9 +2451,6 @@ def warn_objc_implementation_missing_designated_init_override : Warning< "method override for the designated initializer of the superclass %objcinstance0 not found">, InGroup; -def err_ns_bridged_not_interface : Error< - "parameter of 'ns_bridged' attribute does not name an Objective-C class">; - // objc_bridge attribute diagnostics. def err_objc_attr_not_id : Error< "parameter of %0 attribute must be a single name of an Objective-C %select{class|protocol}1">; diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index a6240368bf..73d67eb6ff 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -3649,31 +3649,6 @@ static void handleCFUnknownTransferAttr(Sema &S, Decl *D, Attr.getAttributeSpellingListIndex())); } -static void handleNSBridgedAttr(Sema &S, Scope *Sc, Decl *D, - const AttributeList &Attr) { - IdentifierLoc *Parm = Attr.isArgIdent(0) ? Attr.getArgAsIdent(0) : 0; - - // In Objective-C, verify that the type names an Objective-C type. - // We don't want to check this outside of ObjC because people sometimes - // do crazy C declarations of Objective-C types. - if (Parm && S.getLangOpts().ObjC1) { - // Check for an existing type with this name. - LookupResult R(S, DeclarationName(Parm->Ident), Parm->Loc, - Sema::LookupOrdinaryName); - if (S.LookupName(R, Sc)) { - NamedDecl *Target = R.getFoundDecl(); - if (Target && !isa(Target)) { - S.Diag(D->getLocStart(), diag::err_ns_bridged_not_interface); - S.Diag(Target->getLocStart(), diag::note_declared_at); - } - } - } - - D->addAttr(::new (S.Context) - NSBridgedAttr(Attr.getRange(), S.Context, Parm ? Parm->Ident : 0, - Attr.getAttributeSpellingListIndex())); -} - static void handleObjCBridgeAttr(Sema &S, Scope *Sc, Decl *D, const AttributeList &Attr) { IdentifierLoc * Parm = Attr.isArgIdent(0) ? Attr.getArgAsIdent(0) : 0; @@ -3970,9 +3945,6 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, case AttributeList::AT_ObjCRequiresSuper: handleObjCRequiresSuperAttr(S, D, Attr); break; - case AttributeList::AT_NSBridged: - handleNSBridgedAttr(S, scope, D, Attr); break; - case AttributeList::AT_ObjCBridge: handleObjCBridgeAttr(S, scope, D, Attr); break; diff --git a/test/SemaObjC/attr-ns-bridged.m b/test/SemaObjC/attr-ns-bridged.m deleted file mode 100644 index 1ab60a2b0d..0000000000 --- a/test/SemaObjC/attr-ns-bridged.m +++ /dev/null @@ -1,15 +0,0 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s - -typedef struct __attribute__((ns_bridged)) test0s *test0ref; - -void test0func(void) __attribute__((ns_bridged)); // expected-error {{'ns_bridged' attribute only applies to structs}} - -union __attribute__((ns_bridged)) test0u; // expected-error {{'ns_bridged' attribute only applies to structs}} - -struct __attribute__((ns_bridged(Test1))) test1s; - -@class Test2; -struct __attribute__((ns_bridged(Test2))) test2s; - -void Test3(void); // expected-note {{declared here}} -struct __attribute__((ns_bridged(Test3))) test3s; // expected-error {{parameter of 'ns_bridged' attribute does not name an Objective-C class}}