atch for implementation of objective-c's -Wselector
warning flag in clang. Little more to do
for a PCH issue. Radar 6507158.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109129 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h
index 490ff65..0540dd9 100644
--- a/lib/Sema/Sema.h
+++ b/lib/Sema/Sema.h
@@ -606,6 +606,11 @@
   MethodPool InstanceMethodPool;
   MethodPool FactoryMethodPool;
 
+  /// Method selectors used in a @selector expression. Used for implementation 
+  /// of -Wselector.
+  llvm::DenseMap<Selector, SourceLocation> ReferencedSelectors;
+
+
   MethodPool::iterator ReadMethodPool(Selector Sel, bool isInstance);
 
   /// Private Helper predicate to check for 'self'.
@@ -798,6 +803,8 @@
 
   DeclGroupPtrTy ConvertDeclToDeclGroup(DeclPtrTy Ptr);
 
+  void DiagnoseUseOfUnimplementedSelectors();
+
   virtual TypeTy *getTypeName(IdentifierInfo &II, SourceLocation NameLoc,
                               Scope *S, CXXScopeSpec *SS,
                               bool isClassName = false,
@@ -1656,7 +1663,7 @@
   /// unit are added to a global pool. This allows us to efficiently associate
   /// a selector with a method declaraation for purposes of typechecking
   /// messages sent to "id" (where the class of the object is unknown).
-  void AddInstanceMethodToGlobalPool(ObjCMethodDecl *Method);
+  void AddInstanceMethodToGlobalPool(ObjCMethodDecl *Method, bool impl=false);
 
   /// LookupInstanceMethodInGlobalPool - Returns the method and warns if
   /// there are multiple signatures.
@@ -1665,10 +1672,15 @@
 
   /// LookupFactoryMethodInGlobalPool - Returns the method and warns if
   /// there are multiple signatures.
-  ObjCMethodDecl *LookupFactoryMethodInGlobalPool(Selector Sel, SourceRange R);
+  ObjCMethodDecl *LookupFactoryMethodInGlobalPool(Selector Sel, SourceRange R,
+                                                  bool warn=true);
+
+  /// LookupImplementedMethodInGlobalPool - Returns the method which has an
+  /// implementation.
+  ObjCMethodDecl *LookupImplementedMethodInGlobalPool(Selector Sel);
 
   /// AddFactoryMethodToGlobalPool - Same as above, but for factory methods.
-  void AddFactoryMethodToGlobalPool(ObjCMethodDecl *Method);
+  void AddFactoryMethodToGlobalPool(ObjCMethodDecl *Method, bool impl=false);
 
   /// CollectIvarsToConstructOrDestruct - Collect those ivars which require
   /// initialization.