Bläddra i källkod

[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
Richard Trieu 7 år sedan
förälder
incheckning
1b4233ec4b
1 ändrade filer med 1 tillägg och 0 borttagningar
  1. 1 0
      lib/AST/ODRHash.cpp

+ 1 - 0
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,