[cfe-commits] r77533 - /cfe/trunk/include/clang/Index/Entity.h
Argiris Kirtzidis
akyrtzi at gmail.com
Wed Jul 29 16:39:42 PDT 2009
Author: akirtzidis
Date: Wed Jul 29 18:39:42 2009
New Revision: 77533
URL: http://llvm.org/viewvc/llvm-project?rev=77533&view=rev
Log:
Add Entity::getInternalDecl() to be used only on Entities that refer to internal
(in translation unit) declarations.
Modified:
cfe/trunk/include/clang/Index/Entity.h
Modified: cfe/trunk/include/clang/Index/Entity.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Index/Entity.h?rev=77533&r1=77532&r2=77533&view=diff
==============================================================================
--- cfe/trunk/include/clang/Index/Entity.h (original)
+++ cfe/trunk/include/clang/Index/Entity.h Wed Jul 29 18:39:42 2009
@@ -57,6 +57,13 @@
/// \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;
More information about the cfe-commits
mailing list