[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.

llvm-svn: 321319
This commit is contained in:
Richard Trieu 2017-12-21 22:38:29 +00:00
parent e9d8789de3
commit f72fb7e989
1 changed files with 1 additions and 0 deletions

View 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,