[cfe-commits] r146591 - /cfe/trunk/include/clang/AST/DeclBase.h
Douglas Gregor
dgregor at apple.com
Wed Dec 14 13:44:46 PST 2011
Author: dgregor
Date: Wed Dec 14 15:44:45 2011
New Revision: 146591
URL: http://llvm.org/viewvc/llvm-project?rev=146591&view=rev
Log:
Introduce Decl::isSameEntityAs(), to help compare declarations using
their canonical Decl nodes. Not used yet, but it will be.
Modified:
cfe/trunk/include/clang/AST/DeclBase.h
Modified: cfe/trunk/include/clang/AST/DeclBase.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclBase.h?rev=146591&r1=146590&r2=146591&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclBase.h (original)
+++ cfe/trunk/include/clang/AST/DeclBase.h Wed Dec 14 15:44:45 2011
@@ -590,6 +590,12 @@
/// \brief Whether this particular Decl is a canonical one.
bool isCanonicalDecl() const { return getCanonicalDecl() == this; }
+ /// \brief Determine whether this declaration declares the same entity as
+ /// the other declaration.
+ bool isSameEntityAs(const Decl *Other) const {
+ return getCanonicalDecl() == Other->getCanonicalDecl();
+ }
+
protected:
/// \brief Returns the next redeclaration or itself if this is the only decl.
///
More information about the cfe-commits
mailing list