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.

llvm-svn: 49321
This commit is contained in:
Chris Lattner 2008-04-07 06:37:47 +00:00
parent c9062d01d7
commit 64bf6ba308
2 changed files with 4 additions and 1 deletions

View 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) {

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