[cfe-commits] @property metadata does not report weak attribute under ARC rdar://9945095
Remy Demarest
remy.demarest at gmail.com
Fri Aug 12 11:09:59 PDT 2011
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110812/283fbe5b/attachment.html>
More information about the cfe-commits
mailing list