Support ObjC methods as Entities.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77547 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Index/EntityImpl.h b/lib/Index/EntityImpl.h
index d28936e..b4a883a 100644
--- a/lib/Index/EntityImpl.h
+++ b/lib/Index/EntityImpl.h
@@ -15,43 +15,51 @@
 #define LLVM_CLANG_INDEX_ENTITYIMPL_H
 
 #include "clang/Index/Entity.h"
+#include "clang/AST/DeclarationName.h"
 #include "llvm/ADT/FoldingSet.h"
 #include "llvm/ADT/StringSet.h"
 
 namespace clang {
-  class IdentifierInfo;
 
 namespace idx {
   class ProgramImpl;
 
 class EntityImpl : public llvm::FoldingSetNode {
   Entity Parent;
-  IdentifierInfo *Id;
+  DeclarationName Name;
 
   /// \brief Identifier namespace.
   unsigned IdNS;
+  
+  /// \brief If Name is a selector, this keeps track whether it's for an
+  /// instance method.
+  bool IsObjCInstanceMethod;
 
 public:
-  EntityImpl(Entity parent, IdentifierInfo *id, unsigned idNS)
-    : Parent(parent), Id(id), IdNS(idNS) { }
+  EntityImpl(Entity parent, DeclarationName name, unsigned idNS,
+             bool isObjCInstanceMethod)
+    : Parent(parent), Name(name), IdNS(idNS),
+      IsObjCInstanceMethod(isObjCInstanceMethod) { }
 
   /// \brief Find the Decl that can be referred to by this entity.
   Decl *getDecl(ASTContext &AST);
 
   /// \brief Get an Entity associated with the given Decl.
   /// \returns Null if an Entity cannot refer to this Decl.
-  static Entity get(Decl *D, ProgramImpl &Prog);
+  static Entity get(Decl *D, Program &Prog, ProgramImpl &ProgImpl);
   
   std::string getPrintableName();
 
   void Profile(llvm::FoldingSetNodeID &ID) const {
-    Profile(ID, Parent, Id, IdNS);
+    Profile(ID, Parent, Name, IdNS, IsObjCInstanceMethod);
   }
   static void Profile(llvm::FoldingSetNodeID &ID, Entity Parent,
-                      IdentifierInfo *Id, unsigned IdNS) {
+                      DeclarationName Name, unsigned IdNS,
+                      bool isObjCInstanceMethod) {
     ID.AddPointer(Parent.getAsOpaquePtr());
-    ID.AddPointer(Id);
+    ID.AddPointer(Name.getAsOpaquePtr());
     ID.AddInteger(IdNS);
+    ID.AddBoolean(isObjCInstanceMethod);
   }
 };