aboutsummaryrefslogtreecommitdiff
path: root/include/clang
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 /include/clang
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 'include/clang')
-rw-r--r--include/clang/AST/Decl.h7
-rw-r--r--include/clang/Basic/DiagnosticKinds.def7
-rw-r--r--include/clang/Parse/Action.h4
3 files changed, 16 insertions, 2 deletions
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h
index 7cb370b41c..b420c1da81 100644
--- a/include/clang/AST/Decl.h
+++ b/include/clang/AST/Decl.h
@@ -587,6 +587,9 @@ public:
NumIntfRefProtocols = numRefProtos;
}
}
+ ObjcIvarDecl **getIntfDeclIvars() const { return Ivars; }
+ int getIntfDeclNumIvars() const { return NumIvars; }
+
void ObjcAddInstanceVariablesToClass(ObjcIvarDecl **ivars,
unsigned numIvars);
@@ -883,8 +886,8 @@ class ObjcImplementationDecl : public TypeDecl {
Ivars(0), NumIvars(-1),
InsMethods(0), NumInsMethods(-1), ClsMethods(0), NumClsMethods(-1) {}
- void ObjcAddInstanceVariablesToClass(ObjcIvarDecl **ivars,
- unsigned numIvars);
+ void ObjcAddInstanceVariablesToClassImpl(ObjcIvarDecl **ivars,
+ unsigned numIvars);
void ObjcAddMethods(ObjcMethodDecl **insMethods, unsigned numInsMembers,
ObjcMethodDecl **clsMethods, unsigned numClsMembers);
diff --git a/include/clang/Basic/DiagnosticKinds.def b/include/clang/Basic/DiagnosticKinds.def
index bd41546cd3..d77e6b4d24 100644
--- a/include/clang/Basic/DiagnosticKinds.def
+++ b/include/clang/Basic/DiagnosticKinds.def
@@ -426,6 +426,13 @@ DIAG(err_dup_implementation_class, ERROR,
"reimplementation of class '%0'")
DIAG(err_conflicting_super_class, ERROR,
"conflicting super class name '%0'")
+DIAG(err_conflicting_ivar_name, ERROR,
+ "conflicting instance variable name '%0'")
+DIAG(err_inconsistant_ivar, ERROR,
+ "inconsistent instance variable specification")
+DIAG(err_conflicting_ivar_type, ERROR,
+ "conflicting instance variable type")
+
//===----------------------------------------------------------------------===//
// Semantic Analysis
diff --git a/include/clang/Parse/Action.h b/include/clang/Parse/Action.h
index fe902fc00f..bc14226bec 100644
--- a/include/clang/Parse/Action.h
+++ b/include/clang/Parse/Action.h
@@ -448,6 +448,10 @@ public:
DeclTy **allMethods, unsigned allNum) {
return;
}
+ virtual void ActOnImpleIvarVsClassIvars(DeclTy *ClassDecl,
+ DeclTy **Fields, unsigned NumFields) {
+ return;
+ }
virtual DeclTy *ObjcStartProtoInterface(Scope* S,
SourceLocation AtProtoInterfaceLoc,
IdentifierInfo *ProtocolName, SourceLocation ProtocolLoc,