diff --git a/clang/include/clang/Index/Entity.h b/clang/include/clang/Index/Entity.h index 283f55276e956e72a32d7936e6353347e9a7e4b9..edbb329723426df6aa3fb816f0255acf4fc18114 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;