Attribute: Make hashes match when looking up AttributeImpls.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 5 Jan 2013 12:08:00 +0000 (12:08 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 5 Jan 2013 12:08:00 +0000 (12:08 +0000)
This isn't optimal either but fixes a massive compile time regression from the
attribute uniquing work.

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

lib/IR/Attributes.cpp

index c0704dc97bccde2254c0db921c7d20d2723755d7..117b510288b1727b2b8c6971a41eaddeac3331af 100644 (file)
@@ -45,7 +45,8 @@ Attribute Attribute::get(LLVMContext &Context, AttrBuilder &B) {
   // Otherwise, build a key to look up the existing attributes.
   LLVMContextImpl *pImpl = Context.pImpl;
   FoldingSetNodeID ID;
-  ID.AddInteger(B.getBitMask());
+  // FIXME: Don't look up ConstantInts here.
+  ID.AddPointer(ConstantInt::get(Type::getInt64Ty(Context), B.getBitMask()));
 
   void *InsertPoint;
   AttributeImpl *PA = pImpl->AttrsSet.FindNodeOrInsertPos(ID, InsertPoint);