]> granicus.if.org Git - clang/commitdiff
[ODRHash] Canonicalize Decl's before processing.
authorRichard Trieu <rtrieu@google.com>
Thu, 21 Dec 2017 22:38:29 +0000 (22:38 +0000)
committerRichard Trieu <rtrieu@google.com>
Thu, 21 Dec 2017 22:38:29 +0000 (22:38 +0000)
Canonicalizing the Decl before processing it as part of the hash should reduce
issues with non-canonical types showing up as mismatches.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321319 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ODRHash.cpp

index 17c95f2a0af7732bd779bb3854256c816246010f..0f07b6225d95de95b0817911340590fa9f21d497 100644 (file)
@@ -468,6 +468,7 @@ void ODRHash::AddCXXRecordDecl(const CXXRecordDecl *Record) {
 
 void ODRHash::AddDecl(const Decl *D) {
   assert(D && "Expecting non-null pointer.");
+  D = D->getCanonicalDecl();
   auto Result = DeclMap.insert(std::make_pair(D, DeclMap.size()));
   ID.AddInteger(Result.first->second);
   // On first encounter of a Decl pointer, process it.  Every time afterwards,