]> granicus.if.org Git - clang/commitdiff
After discussing with John McCall, removing the ns_bridged attribute as it is unused.
authorAaron Ballman <aaron@aaronballman.com>
Thu, 19 Dec 2013 22:12:51 +0000 (22:12 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Thu, 19 Dec 2013 22:12:51 +0000 (22:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197729 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/Attr.td
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaDeclAttr.cpp
test/SemaObjC/attr-ns-bridged.m [deleted file]

index 27fc3938aba22c9b9d44286c38f58dd40e1de17b..8fa33648670dc00899540d06be7f83ae497c9310 100644 (file)
@@ -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>;
index 91a19aaf8825a1bb308d61abf86d8e7521452a27..5bc5637c52d174c0bbb71e4de4069b34b45ecd4a 100644 (file)
@@ -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<ObjCDesignatedInit>;
 
-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">;
index a6240368bf803a38bba42e4e2922069f264b9c24..73d67eb6fff86511b071fefe14e0aefe982515a7 100644 (file)
@@ -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<ObjCInterfaceDecl>(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 (file)
index 1ab60a2..0000000
+++ /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}}