[cfe-commits] r49321 - in /cfe/trunk: include/clang/AST/Type.h lib/AST/Type.cpp

Chris Lattner sabre at nondot.org
Sun Apr 6 23:37:47 PDT 2008


Author: lattner
Date: Mon Apr  7 01:37:47 2008
New Revision: 49321

URL: http://llvm.org/viewvc/llvm-project?rev=49321&view=rev
Log:
Fix a really bad bug where type uniquing would merge a<x> with b<x> as the same
type, because it did not include a/b in the hash.

Modified:
    cfe/trunk/include/clang/AST/Type.h
    cfe/trunk/lib/AST/Type.cpp

Modified: cfe/trunk/include/clang/AST/Type.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=49321&r1=49320&r2=49321&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/Type.h (original)
+++ cfe/trunk/include/clang/AST/Type.h Mon Apr  7 01:37:47 2008
@@ -1109,6 +1109,7 @@
   
   void Profile(llvm::FoldingSetNodeID &ID);
   static void Profile(llvm::FoldingSetNodeID &ID, 
+                      const ObjCInterfaceDecl *Decl,
                       ObjCProtocolDecl **protocols, unsigned NumProtocols);
  
   static bool classof(const Type *T) { 

Modified: cfe/trunk/lib/AST/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Type.cpp?rev=49321&r1=49320&r2=49321&view=diff

==============================================================================
--- cfe/trunk/lib/AST/Type.cpp (original)
+++ cfe/trunk/lib/AST/Type.cpp Mon Apr  7 01:37:47 2008
@@ -704,14 +704,16 @@
 }
 
 void ObjCQualifiedInterfaceType::Profile(llvm::FoldingSetNodeID &ID,
+                                         const ObjCInterfaceDecl *Decl,
                                          ObjCProtocolDecl **protocols, 
                                          unsigned NumProtocols) {
+  ID.AddPointer(Decl);
   for (unsigned i = 0; i != NumProtocols; i++)
     ID.AddPointer(protocols[i]);
 }
 
 void ObjCQualifiedInterfaceType::Profile(llvm::FoldingSetNodeID &ID) {
-  Profile(ID, &Protocols[0], getNumProtocols());
+  Profile(ID, getDecl(), &Protocols[0], getNumProtocols());
 }
 
 void ObjCQualifiedIdType::Profile(llvm::FoldingSetNodeID &ID,





More information about the cfe-commits mailing list