Add the integer value of the ConstantInt instead of the Constant* value.
This is causing some problems. The root cause is unknown at this time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171923 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/IR/AttributeImpl.h b/lib/IR/AttributeImpl.h
index 7bb666a..1164d68 100644
--- a/lib/IR/AttributeImpl.h
+++ b/lib/IR/AttributeImpl.h
@@ -65,12 +65,7 @@
Profile(ID, Data, Vals);
}
static void Profile(FoldingSetNodeID &ID, Constant *Data,
- ArrayRef<Constant*> Vals) {
- ID.AddPointer(Data);
- for (ArrayRef<Constant*>::iterator I = Vals.begin(), E = Vals.end();
- I != E; ++I)
- ID.AddPointer(*I);
- }
+ ArrayRef<Constant*> Vals);
};
//===----------------------------------------------------------------------===//
diff --git a/lib/IR/Attributes.cpp b/lib/IR/Attributes.cpp
index bef7a6c..01a59a3 100644
--- a/lib/IR/Attributes.cpp
+++ b/lib/IR/Attributes.cpp
@@ -509,6 +509,14 @@
Vals.push_back(ConstantInt::get(Type::getInt64Ty(Context), Align));
}
+void Profile(FoldingSetNodeID &ID, Constant *Data,
+ ArrayRef<Constant*> Vals) {
+ ID.AddInteger(cast<ConstantInt>(Data)->getZExtValue());
+ for (ArrayRef<Constant*>::iterator I = Vals.begin(), E = Vals.end();
+ I != E; ++I)
+ ID.AddPointer(*I);
+}
+
//===----------------------------------------------------------------------===//
// AttributeSetImpl Definition
//===----------------------------------------------------------------------===//