From: Fariborz Jahanian Date: Tue, 17 Nov 2009 19:08:08 +0000 (+0000) Subject: Start support of weak_import objective-c classes. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5f8f8571c52dbf12fdefb15d2fedbcccb212c15c;p=clang Start support of weak_import objective-c classes. (Radar 6815425). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89124 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index e7ea43be02..c96ab4681c 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -862,7 +862,7 @@ static void HandleWeakImportAttr(Decl *D, const AttributeList &Attr, Sema &S) { } else if (isa(D) || isa(D)) { // We ignore weak import on properties and methods return; - } else { + } else if (!(S.LangOpts.ObjCNonFragileABI && isa(D))) { S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type) << Attr.getName() << 2 /*variable and function*/; return; diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index d1b40bed0f..a5fdb8725c 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -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,