From 4560276cf585666cf5fc5baa1fb046b82417cff9 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Wed, 29 Jul 2009 23:39:42 +0000 Subject: [PATCH] Add Entity::getInternalDecl() to be used only on Entities that refer to internal (in translation unit) declarations. llvm-svn: 77533 --- clang/include/clang/Index/Entity.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/clang/include/clang/Index/Entity.h b/clang/include/clang/Index/Entity.h index 283f55276e95..edbb32972342 100644 --- a/clang/include/clang/Index/Entity.h +++ b/clang/include/clang/Index/Entity.h @@ -57,6 +57,13 @@ public: /// \brief Find the Decl that can be referred to by this entity. Decl *getDecl(ASTContext &AST) const; + /// \brief If this Entity represents a declaration that is internal to its + /// translation unit, getInternalDecl() returns it. + Decl *getInternalDecl() const { + assert(isInternalToTU() && "This Entity is not internal!"); + return Val.get(); + } + /// \brief Get a printable name for debugging purpose. std::string getPrintableName() const; -- GitLab