]> granicus.if.org Git - clang/commitdiff
Keep only canonical Decls in Entities.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 21 Jul 2009 02:10:32 +0000 (02:10 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 21 Jul 2009 02:10:32 +0000 (02:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76532 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Index/Entity.h
lib/Index/Entity.cpp

index 9a5b126d112a9056c6b4df795d6d27aab858de1c..8eb72e613599a7ffbb906ebd5fda23769c1b8ef1 100644 (file)
@@ -47,7 +47,7 @@ class Entity {
   /// translation unit, otherwise it stores the associated EntityImpl.
   llvm::PointerUnion<Decl *, EntityImpl *> Val;
 
-  explicit Entity(Decl *D) : Val(D) { }
+  explicit Entity(Decl *D);
   explicit Entity(EntityImpl *impl) : Val(impl) { }
   friend class EntityGetter;
   
index feed3e4c80771a6d973173a35d95b2b796e38e8d..cc45e25cc767a2cc4a4c40a6fa7034e7ceb939b6 100644 (file)
@@ -138,6 +138,8 @@ Entity EntityImpl::get(Decl *D, ProgramImpl &Prog) {
 // Entity Implementation
 //===----------------------------------------------------------------------===//
 
+Entity::Entity(Decl *D) : Val(D->getCanonicalDecl()) { }
+
 /// \brief Find the Decl that can be referred to by this entity.
 Decl *Entity::getDecl(ASTContext &AST) {
   if (isInvalid())