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
diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h
index ab36054..20f46a4 100644
--- a/include/clang/AST/DeclBase.h
+++ b/include/clang/AST/DeclBase.h
@@ -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.
   ///