"This patch uses the new ObjCImplDecl class to merge  Sema::ImplMethodsVsClassMethods and Sema::ImplCategoryMethodsVsIntfMethods methods.
And now, when clang check a class implementation to find unimplemented methods, it also checks all methods from the class extensions (unnamed categories).

There is also a test case to check this warning.

This patch contains also a minor update for ObjCImplDecl . getNameAsCString and getNameAsString now returns an empty string instead of crashing for unnamed categories."

Patch by Jean-Daniel Dupas!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65744 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h
index 3e9d07a..6e0b935 100644
--- a/lib/Sema/Sema.h
+++ b/lib/Sema/Sema.h
@@ -68,6 +68,7 @@
   class ObjCInterfaceDecl;
   class ObjCCompatibleAliasDecl;
   class ObjCProtocolDecl;
+  class ObjCImplDecl;
   class ObjCImplementationDecl;
   class ObjCCategoryImplDecl;
   class ObjCCategoryDecl;
@@ -930,14 +931,11 @@
                                 SourceLocation Loc);
   
   /// ImplMethodsVsClassMethods - This is main routine to warn if any method
-  /// remains unimplemented in the @implementation class.
-  void ImplMethodsVsClassMethods(ObjCImplementationDecl* IMPDecl, 
-                                 ObjCInterfaceDecl* IDecl);
+  /// remains unimplemented in the class or category @implementation.
+  void ImplMethodsVsClassMethods(ObjCImplDecl* IMPDecl, 
+                                 ObjCContainerDecl* IDecl, 
+                                 bool IncompleteImpl = false);
   
-  /// ImplCategoryMethodsVsIntfMethods - Checks that methods declared in the
-  /// category interface is implemented in the category @implementation.
-  void ImplCategoryMethodsVsIntfMethods(ObjCCategoryImplDecl *CatImplDecl,
-                                        ObjCCategoryDecl *CatClassDecl);
   /// MatchTwoMethodDeclarations - Checks if two methods' type match and returns
   /// true, or false, accordingly.
   bool MatchTwoMethodDeclarations(const ObjCMethodDecl *Method,