aboutsummaryrefslogtreecommitdiff
path: root/AST/Decl.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2007-09-26 18:27:25 +0000
committerFariborz Jahanian <fjahanian@apple.com>2007-09-26 18:27:25 +0000
commitd0b90bff98bafb72ea9809f509bf37c93c60e74e (patch)
treed24b1c4e75fd7cca92f339e0735ef44e6c33e201 /AST/Decl.cpp
parent095ffca8c5f69df5826fea8714b7f50a1313d7c6 (diff)
This patch inserts ivars declared in @implementation in its object and verifies
that they conform(in type, name and numbers) to those declared in @interface. Test case highlights kind of checking we do here. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42360 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'AST/Decl.cpp')
-rw-r--r--AST/Decl.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/AST/Decl.cpp b/AST/Decl.cpp
index c0a77a2faa..83762e9465 100644
--- a/AST/Decl.cpp
+++ b/AST/Decl.cpp
@@ -294,6 +294,19 @@ void ObjcInterfaceDecl::ObjcAddInstanceVariablesToClass(ObjcIvarDecl **ivars,
}
}
+/// ObjcAddInstanceVariablesToClassImpl - Checks for correctness of Instance
+/// Variables (Ivars) relative to what declared in @implementation;s class.
+/// Ivars into ObjcImplementationDecl's fields.
+///
+void ObjcImplementationDecl::ObjcAddInstanceVariablesToClassImpl(
+ ObjcIvarDecl **ivars, unsigned numIvars) {
+ NumIvars = numIvars;
+ if (numIvars) {
+ Ivars = new ObjcIvarDecl*[numIvars];
+ memcpy(Ivars, ivars, numIvars*sizeof(ObjcIvarDecl*));
+ }
+}
+
/// addObjcMethods - Insert instance and methods declarations into
/// ObjcInterfaceDecl's InsMethods and ClsMethods fields.
///