From c896ad064fd6ee73a7e0536d94df77b2cc7313b6 Mon Sep 17 00:00:00 2001 From: Douglas Gregor <dgregor@apple.com> Date: Wed, 14 Dec 2011 21:44:45 +0000 Subject: [PATCH] Introduce Decl::isSameEntityAs(), to help compare declarations using their canonical Decl nodes. Not used yet, but it will be. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146591 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/DeclBase.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h index ab36054969b..20f46a41720 100644 --- a/include/clang/AST/DeclBase.h +++ b/include/clang/AST/DeclBase.h @@ -590,6 +590,12 @@ public: /// \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. /// -- GitLab