diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-07-29 23:39:42 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-07-29 23:39:42 +0000 |
commit | e380c51d6f56a2cc32fa0f5723584224214c5b9f (patch) | |
tree | e7135f4bad7615506aff87b4d9a2aea9628b051b /include/clang | |
parent | 6dbbc0e20a648cb2a9d520f5a7a394a6c07d6c68 (diff) |
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
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/Index/Entity.h | 7 |
1 files changed, 7 insertions, 0 deletions
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<Decl *>(); + } + /// \brief Get a printable name for debugging purpose. std::string getPrintableName() const; |