summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-01-20 20:04:12 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-01-20 20:04:12 +0000
commit2f85a6450a00cff4b178323f196393cf84cf1c47 (patch)
treecc52f6a203ee2a76959bf697e6100607636dda1b /clang/lib
parent5faaef7692198dbefb850942075670a196021741 (diff)
downloadbcm5719-llvm-2f85a6450a00cff4b178323f196393cf84cf1c47.tar.gz
bcm5719-llvm-2f85a6450a00cff4b178323f196393cf84cf1c47.zip
Detailed documentation for encoding of properties and a test
case. llvm-svn: 62607
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/ASTContext.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index bdcb7af9c03..d1a8b8208b4 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -1699,9 +1699,30 @@ void ASTContext::getObjCEncodingForMethodDecl(const ObjCMethodDecl *Decl,
}
/// getObjCEncodingForPropertyDecl - Return the encoded type for this
-/// method declaration. If non-NULL, Container must be either an
+/// property declaration. If non-NULL, Container must be either an
/// ObjCCategoryImplDecl or ObjCImplementationDecl; it should only be
/// NULL when getting encodings for protocol properties.
+/// Property attributes are stored as a comma-delimited C string. The simple
+/// attributes readonly and bycopy are encoded as single characters. The
+/// parametrized attributes, getter=name, setter=name, and ivar=name, are
+/// encoded as single characters, followed by an identifier. Property types
+/// are also encoded as a parametrized attribute. The characters used to encode
+/// these attributes are defined by the following enumeration:
+/// @code
+/// enum PropertyAttributes {
+/// kPropertyReadOnly = 'R', // property is read-only.
+/// kPropertyBycopy = 'C', // property is a copy of the value last assigned
+/// kPropertyByref = '&', // property is a reference to the value last assigned
+/// kPropertyDynamic = 'D', // property is dynamic
+/// kPropertyGetter = 'G', // followed by getter selector name
+/// kPropertySetter = 'S', // followed by setter selector name
+/// kPropertyInstanceVariable = 'V' // followed by instance variable name
+/// kPropertyType = 't' // followed by old-style type encoding.
+/// kPropertyWeak = 'W' // 'weak' property
+/// kPropertyStrong = 'P' // property GC'able
+/// kPropertyNonAtomic = 'N' // property non-atomic
+/// };
+/// @endcode
void ASTContext::getObjCEncodingForPropertyDecl(const ObjCPropertyDecl *PD,
const Decl *Container,
std::string& S) {
OpenPOWER on IntegriCloud