[cfe-commits] r43507 - in /cfe/trunk: Sema/SemaDecl.cpp test/Sema/ivar-encoding-1.m
Fariborz Jahanian
fjahanian at apple.com
Tue Oct 30 11:27:03 PDT 2007
Author: fjahanian
Date: Tue Oct 30 13:27:03 2007
New Revision: 43507
URL: http://llvm.org/viewvc/llvm-project?rev=43507&view=rev
Log:
Revisited my last patch to be able to do encoding of ivar types with 'id'.
Added:
cfe/trunk/test/Sema/ivar-encoding-1.m
Modified:
cfe/trunk/Sema/SemaDecl.cpp
Modified: cfe/trunk/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaDecl.cpp?rev=43507&r1=43506&r2=43507&view=diff
==============================================================================
--- cfe/trunk/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/Sema/SemaDecl.cpp Tue Oct 30 13:27:03 2007
@@ -1193,6 +1193,15 @@
/// Check that class of this category is already completely declared.
if (!IDecl || IDecl->isForwardDecl())
Diag(ClassLoc, diag::err_undef_interface, ClassName->getName());
+
+ // We cannot build type 'id' laziliy. It is needed when checking if a
+ // type is an 'id' (via call to isObjcIdType) even if there is no
+ // need for the dafult 'id' type.
+ // FIXME: Depending on the need to compare to 'id', this may have to go
+ // somewhere else. At this time, this is a good enough place to do type
+ // encoding of methods and ivars for the rewrite client.
+ GetObjcIdType(AtCatImplLoc);
+
/// TODO: Check that CatName, category name, is not used in another
// implementation.
return CDecl;
@@ -1261,7 +1270,15 @@
// Check that there is no duplicate implementation of this class.
if (!ObjcImplementations.insert(ClassName))
Diag(ClassLoc, diag::err_dup_implementation_class, ClassName->getName());
-
+
+ // We cannot build type 'id' laziliy. It is needed when checking if a
+ // type is an 'id' (via call to isObjcIdType) even if there is no
+ // need for the dafult 'id' type.
+ // FIXME: Depending on the need to compare to 'id', this may have to go
+ // somewhere else. At this time, this is a good enough place to do type
+ // encoding of methods and ivars for the rewrite client.
+ GetObjcIdType(AtClassImplLoc);
+
return IMPDecl;
}
@@ -1964,14 +1981,6 @@
AttributeList *AttrList, tok::ObjCKeywordKind MethodDeclKind) {
llvm::SmallVector<ParmVarDecl*, 16> Params;
- // We cannot build type 'id' laziliy. It is needed when checking if a
- // type is an 'id' (via call to isObjcIdType) even if there is no
- // need for the dafult 'id' type.
- // FIXME: Depending on the need to compare to 'id', this may have to go
- // somewhere else. At this time, this is a good enough place to do type
- // encoding of methods and ivars for the rewrite client.
- GetObjcIdType(MethodLoc);
-
for (unsigned i = 0; i < Sel.getNumArgs(); i++) {
// FIXME: arg->AttrList must be stored too!
QualType argType;
Added: cfe/trunk/test/Sema/ivar-encoding-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/ivar-encoding-1.m?rev=43507&view=auto
==============================================================================
--- cfe/trunk/test/Sema/ivar-encoding-1.m (added)
+++ cfe/trunk/test/Sema/ivar-encoding-1.m Tue Oct 30 13:27:03 2007
@@ -0,0 +1,15 @@
+// RUN: clang -rewrite-test -verify %s
+
+ at interface Intf
+{
+ id ivar;
+ id ivar1[12];
+
+ id **ivar3;
+
+ id (*ivar4) (id, id);
+}
+ at end
+
+ at implementation Intf
+ at end
More information about the cfe-commits
mailing list