From 1b4233ec4b1033b47d8c542c04e6706fac4a17ad Mon Sep 17 00:00:00 2001 From: Richard Trieu Date: Thu, 21 Dec 2017 22:38:29 +0000 Subject: [PATCH] [ODRHash] Canonicalize Decl's before processing. 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/AST/ODRHash.cpp b/lib/AST/ODRHash.cpp index 17c95f2a0a..0f07b6225d 100644 --- a/lib/AST/ODRHash.cpp +++ b/lib/AST/ODRHash.cpp @@ -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, -- 2.50.1