]> granicus.if.org Git - clang/commitdiff
Fix a really bad bug where type uniquing would merge a<x> with b<x> as the same
authorChris Lattner <sabre@nondot.org>
Mon, 7 Apr 2008 06:37:47 +0000 (06:37 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 7 Apr 2008 06:37:47 +0000 (06:37 +0000)
type, because it did not include a/b in the hash.

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

include/clang/AST/Type.h
lib/AST/Type.cpp

index bcefaeb1f6076ffae02ba492a4a0801fa0f782fb..2ee479fd8a907ac80af26efb109762c5142dcaa4 100644 (file)
@@ -1109,6 +1109,7 @@ public:
   
   void Profile(llvm::FoldingSetNodeID &ID);
   static void Profile(llvm::FoldingSetNodeID &ID, 
+                      const ObjCInterfaceDecl *Decl,
                       ObjCProtocolDecl **protocols, unsigned NumProtocols);
  
   static bool classof(const Type *T) { 
index f80f3641da020508a0701fec46cbea009b0e44b2..637061c499bf0f76e5d3fd87c0351f9e208a8b12 100644 (file)
@@ -704,14 +704,16 @@ void FunctionTypeProto::Profile(llvm::FoldingSetNodeID &ID) {
 }
 
 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,