summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2008-04-17 18:25:18 +0000
committerFariborz Jahanian <fjahanian@apple.com>2008-04-17 18:25:18 +0000
commit8e36cddde048eeeaa396ad7c65a412fab2845b36 (patch)
treedc31aa19872f68b3649a01de0a802a96e05317fb /clang/lib/AST/DeclObjC.cpp
parenta506fec90a603e99b8a6c47d23d81710a85596e2 (diff)
downloadbcm5719-llvm-8e36cddde048eeeaa396ad7c65a412fab2845b36.tar.gz
bcm5719-llvm-8e36cddde048eeeaa396ad7c65a412fab2845b36.zip
Added property decl support for protocols.
Added assertion if unexpected property decls are found where they don't belong. Consolidated property decl. printing by using a helper function. llvm-svn: 49862
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r--clang/lib/AST/DeclObjC.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp
index 2d959445d4a..a5eb07a84c4 100644
--- a/clang/lib/AST/DeclObjC.cpp
+++ b/clang/lib/AST/DeclObjC.cpp
@@ -198,6 +198,18 @@ void ObjCInterfaceDecl::addProperties(ObjCPropertyDecl **Properties,
}
/// addProperties - Insert property declaration AST nodes into
+/// ObjCProtocolDecl's PropertyDecl field.
+///
+void ObjCProtocolDecl::addProperties(ObjCPropertyDecl **Properties,
+ unsigned NumProperties) {
+ if (NumProperties == 0) return;
+
+ NumPropertyDecl = NumProperties;
+ PropertyDecl = new ObjCPropertyDecl*[NumProperties];
+ memcpy(PropertyDecl, Properties, NumProperties*sizeof(ObjCPropertyDecl*));
+}
+
+/// addProperties - Insert property declaration AST nodes into
/// ObjCCategoryDecl's PropertyDecl field.
///
void ObjCCategoryDecl::addProperties(ObjCPropertyDecl **Properties,
OpenPOWER on IntegriCloud