aboutsummaryrefslogtreecommitdiff
path: root/include/clang
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-07-29 23:39:42 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-07-29 23:39:42 +0000
commite380c51d6f56a2cc32fa0f5723584224214c5b9f (patch)
treee7135f4bad7615506aff87b4d9a2aea9628b051b /include/clang
parent6dbbc0e20a648cb2a9d520f5a7a394a6c07d6c68 (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.h7
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;