Add DeclContext::Equals to compare declaration contexts based on their primary context. Use this instead of pointer comparisons

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80690 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/IdentifierResolver.cpp b/lib/Sema/IdentifierResolver.cpp
index 1e5fb26..a36b85a 100644
--- a/lib/Sema/IdentifierResolver.cpp
+++ b/lib/Sema/IdentifierResolver.cpp
@@ -134,8 +134,7 @@
     return false;
   }
 
-  return D->getDeclContext()->getLookupContext()->getPrimaryContext() == 
-    Ctx->getPrimaryContext();
+  return D->getDeclContext()->getLookupContext()->Equals(Ctx);
 }
 
 /// AddDecl - Link the decl to its shadowed decl chain.