[cfe-commits] r42923 - in /cfe/trunk: Sema/SemaDecl.cpp clang.xcodeproj/project.pbxproj test/Sema/check-dup-decl-methods-1.m

Steve Naroff snaroff at apple.com
Fri Oct 12 11:49:25 PDT 2007


Author: snaroff
Date: Fri Oct 12 13:49:25 2007
New Revision: 42923

URL: http://llvm.org/viewvc/llvm-project?rev=42923&view=rev
Log:

Replace one FIXME with another. We handle protocols just fine now. The ObjC decl will only be 0 when we have an error on the ObjC decl. I would prefer we pass in a decl that is marked as invalid. I don't think this is critical to fix now, however I'd like us to be consistent. There are currently many places that don't mark the decl as invalid (which need to be fixed)...

Modified:
    cfe/trunk/Sema/SemaDecl.cpp
    cfe/trunk/clang.xcodeproj/project.pbxproj
    cfe/trunk/test/Sema/check-dup-decl-methods-1.m

Modified: cfe/trunk/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaDecl.cpp?rev=42923&r1=42922&r2=42923&view=diff

==============================================================================
--- cfe/trunk/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/Sema/SemaDecl.cpp Fri Oct 12 13:49:25 2007
@@ -1737,11 +1737,13 @@
 void Sema::ActOnAddMethodsToObjcDecl(Scope* S, DeclTy *classDecl,
                                      DeclTy **allMethods, unsigned allNum) {
   Decl *ClassDecl = static_cast<Decl *>(classDecl);
-  
-  // FIXME: Fix this when we can handle methods declared in protocols.
-  // See Parser::ParseObjCAtProtocolDeclaration
+
+  // FIXME: If we don't have a ClassDecl, we have an error. I (snaroff) would
+  // prefer we always pass in a decl. If the decl has an error, isInvalidDecl()
+  // should be true.
   if (!ClassDecl)
     return;
+  
   llvm::SmallVector<ObjcMethodDecl*, 32> insMethods;
   llvm::SmallVector<ObjcMethodDecl*, 16> clsMethods;
   

Modified: cfe/trunk/clang.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/clang.xcodeproj/project.pbxproj?rev=42923&r1=42922&r2=42923&view=diff

==============================================================================
--- cfe/trunk/clang.xcodeproj/project.pbxproj (original)
+++ cfe/trunk/clang.xcodeproj/project.pbxproj Fri Oct 12 13:49:25 2007
@@ -742,7 +742,6 @@
 		08FB7793FE84155DC02AAC07 /* Project object */ = {
 			isa = PBXProject;
 			buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */;
-			compatibilityVersion = "Xcode 2.4";
 			hasScannedForEncodings = 1;
 			mainGroup = 08FB7794FE84155DC02AAC07 /* clang */;
 			projectDirPath = "";

Modified: cfe/trunk/test/Sema/check-dup-decl-methods-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/check-dup-decl-methods-1.m?rev=42923&r1=42922&r2=42923&view=diff

==============================================================================
--- cfe/trunk/test/Sema/check-dup-decl-methods-1.m (original)
+++ cfe/trunk/test/Sema/check-dup-decl-methods-1.m Fri Oct 12 13:49:25 2007
@@ -30,3 +30,9 @@
 + (T**) meth1; // expected-error {{duplicate declaration of method 'meth1'}}
 + (int) foobar;
 @end
+
+ at protocol P
+- (int) meth;
+- (int*) meth;
+ at end
+





More information about the cfe-commits mailing list