From: Argyrios Kyrtzidis Date: Tue, 21 Jul 2009 02:10:32 +0000 (+0000) Subject: Keep only canonical Decls in Entities. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1f717270d0ef91918413a05d513474db7a9b4c3e;p=clang Keep only canonical Decls in Entities. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76532 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Index/Entity.h b/include/clang/Index/Entity.h index 9a5b126d11..8eb72e6135 100644 --- a/include/clang/Index/Entity.h +++ b/include/clang/Index/Entity.h @@ -47,7 +47,7 @@ class Entity { /// translation unit, otherwise it stores the associated EntityImpl. llvm::PointerUnion Val; - explicit Entity(Decl *D) : Val(D) { } + explicit Entity(Decl *D); explicit Entity(EntityImpl *impl) : Val(impl) { } friend class EntityGetter; diff --git a/lib/Index/Entity.cpp b/lib/Index/Entity.cpp index feed3e4c80..cc45e25cc7 100644 --- a/lib/Index/Entity.cpp +++ b/lib/Index/Entity.cpp @@ -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())