From 3b4e2a7621efcb9115d3a8f11f56d60f0c78407d Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Tue, 21 Jul 2009 02:10:32 +0000 Subject: Keep only canonical Decls in Entities. llvm-svn: 76532 --- clang/include/clang/Index/Entity.h | 2 +- clang/lib/Index/Entity.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'clang') diff --git a/clang/include/clang/Index/Entity.h b/clang/include/clang/Index/Entity.h index 9a5b126d112..8eb72e61359 100644 --- a/clang/include/clang/Index/Entity.h +++ b/clang/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/clang/lib/Index/Entity.cpp b/clang/lib/Index/Entity.cpp index feed3e4c807..cc45e25cc76 100644 --- a/clang/lib/Index/Entity.cpp +++ b/clang/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()) -- cgit v1.2.3