diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-12-14 21:44:45 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-12-14 21:44:45 +0000 |
commit | c896ad064fd6ee73a7e0536d94df77b2cc7313b6 (patch) | |
tree | 24e13c68122b09d26770a43bbbc50be13bd2e3d5 | |
parent | d3d08533116b4ad5ff5d29c88a0e136687297058 (diff) |
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
-rw-r--r-- | include/clang/AST/DeclBase.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h index ab36054969..20f46a4172 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. /// |