if (!PA) {
// If we didn't find any existing attributes of the same shape then create a
// new one and insert it.
- PA = new AttributeImpl(B.Raw());
+ PA = new AttributeImpl(Context, B.Raw());
pImpl->AttrsSet.InsertNode(PA, InsertPoint);
}
// AttributeImpl Definition
//===----------------------------------------------------------------------===//
+AttributeImpl::AttributeImpl(LLVMContext &C, uint64_t data) {
+ Data = ConstantInt::get(Type::getInt64Ty(C), data);
+}
+
+uint64_t AttributeImpl::Raw() const {
+ return cast<ConstantInt>(Data)->getZExtValue();
+}
+
uint64_t AttributeImpl::getAttrMask(uint64_t Val) {
switch (Val) {
case Attribute::None: return 0;
return Raw() & getAttrMask(Attribute::StackAlignment);
}
+void AttributeImpl::Profile(FoldingSetNodeID &ID, Constant *Data) {
+ ID.AddInteger(cast<ConstantInt>(Data)->getZExtValue());
+}
+
//===----------------------------------------------------------------------===//
// AttributeSetImpl Definition
//===----------------------------------------------------------------------===//