]> granicus.if.org Git - clang/commitdiff
Start support of weak_import objective-c classes.
authorFariborz Jahanian <fjahanian@apple.com>
Tue, 17 Nov 2009 19:08:08 +0000 (19:08 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Tue, 17 Nov 2009 19:08:08 +0000 (19:08 +0000)
(Radar 6815425).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89124 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDeclAttr.cpp
lib/Sema/SemaDeclObjC.cpp

index e7ea43be021b402d6957417caa8b5df376541e78..c96ab4681cc5d2c7823a7339e2163e841f449799 100644 (file)
@@ -862,7 +862,7 @@ static void HandleWeakImportAttr(Decl *D, const AttributeList &Attr, Sema &S) {
   } else if (isa<ObjCPropertyDecl>(D) || isa<ObjCMethodDecl>(D)) {
     // We ignore weak import on properties and methods
     return;
-  } else {
+  } else if (!(S.LangOpts.ObjCNonFragileABI && isa<ObjCInterfaceDecl>(D))) {
     S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type)
     << Attr.getName() << 2 /*variable and function*/;
     return;
index d1b40bed0fd8ae71f2ef1f97d4dbb6b204c00060..a5fdb8725c865d6067f6d1f62086c8e57ba82696 100644 (file)
@@ -112,6 +112,8 @@ ActOnStartClassInterface(SourceLocation AtInterfaceLoc,
       IDecl->setLocation(AtInterfaceLoc);
       IDecl->setForwardDecl(false);
       IDecl->setClassLoc(ClassLoc);
+      if (AttrList)
+        ProcessDeclAttributeList(TUScope, IDecl, AttrList);
     }
   } else {
     IDecl = ObjCInterfaceDecl::Create(Context, CurContext, AtInterfaceLoc,