[cfe-commits] @property metadata does not report weak attribute under ARC rdar://9945095

jahanian fjahanian at apple.com
Fri Aug 12 13:01:05 PDT 2011


Looks OK. But please provide a clang  test case.

- Fariborz

On Aug 12, 2011, at 11:09 AM, Remy Demarest wrote:

> Hello everyone,
> 
> I just found out the metadata generated by the compiler does not include the weak attribute of a property.
> 
> Here is the test code:
> 
> https://gist.github.com/518fddd28144e58f3974
> 
> Here is the diff to correct that bug:
> 
> Index: include/clang/AST/DeclObjC.h
> ===================================================================
> --- include/clang/AST/DeclObjC.h	(revision 137478)
> +++ include/clang/AST/DeclObjC.h	(working copy)
> @@ -1429,7 +1429,7 @@
>      NumPropertyAttrsBits = 12
>    };
>  
> -  enum SetterKind { Assign, Retain, Copy };
> +  enum SetterKind { Assign, Retain, Copy, Weak };
>    enum PropertyControl { None, Required, Optional };
>  private:
>    SourceLocation AtLoc;   // location of @property
> @@ -1509,6 +1509,8 @@
>        return Retain;
>      if (PropertyAttributes & OBJC_PR_copy)
>        return Copy;
> +    if (PropertyAttributes & OBJC_PR_weak)
> +      return Weak;
>      return Assign;
>    }
>  
> Index: lib/AST/ASTContext.cpp
> ===================================================================
> --- lib/AST/ASTContext.cpp	(revision 137478)
> +++ lib/AST/ASTContext.cpp	(working copy)
> @@ -4078,6 +4078,7 @@
>      case ObjCPropertyDecl::Assign: break;
>      case ObjCPropertyDecl::Copy:   S += ",C"; break;
>      case ObjCPropertyDecl::Retain: S += ",&"; break;
> +    case ObjCPropertyDecl::Weak:   S += ",W"; break;
>      }
>    }
> 
> ____________________________________
> Remy Demarest
> remy.demarest at gmail.com
> +1 (647) 862-1779
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110812/f993a0ff/attachment.html>


More information about the cfe-commits mailing list