From: Argyrios Kyrtzidis Date: Wed, 29 Jul 2009 23:39:42 +0000 (+0000) Subject: Add Entity::getInternalDecl() to be used only on Entities that refer to internal X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e380c51d6f56a2cc32fa0f5723584224214c5b9f;p=clang Add Entity::getInternalDecl() to be used only on Entities that refer to internal (in translation unit) declarations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77533 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Index/Entity.h b/include/clang/Index/Entity.h index 283f55276e..edbb329723 100644 --- a/include/clang/Index/Entity.h +++ b/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;