diff --git a/lib/VMCore/Attributes.cpp b/lib/VMCore/Attributes.cpp index 4b975238b25..9e24add8c8d 100644 --- a/lib/VMCore/Attributes.cpp +++ b/lib/VMCore/Attributes.cpp @@ -382,7 +382,7 @@ AttributeSet AttributeSet::get(LLVMContext &C, // If we didn't find any existing attributes of the same shape then // create a new one and insert it. if (!PA) { - PA = new AttributeSetImpl(Attrs); + PA = new AttributeSetImpl(C, Attrs); pImpl->AttrsLists.InsertNode(PA, InsertPoint); } diff --git a/lib/VMCore/AttributesImpl.h b/lib/VMCore/AttributesImpl.h index 0b3b4971f36..396634ed0fe 100644 --- a/lib/VMCore/AttributesImpl.h +++ b/lib/VMCore/AttributesImpl.h @@ -20,6 +20,8 @@ namespace llvm { +class LLVMContext; + class AttributesImpl : public FoldingSetNode { uint64_t Bits; // FIXME: We will be expanding this. public: @@ -50,10 +52,11 @@ class AttributeSetImpl : public FoldingSetNode { void operator=(const AttributeSetImpl &) LLVM_DELETED_FUNCTION; AttributeSetImpl(const AttributeSetImpl &) LLVM_DELETED_FUNCTION; public: + LLVMContext &Context; SmallVector Attrs; - AttributeSetImpl(ArrayRef attrs) - : Attrs(attrs.begin(), attrs.end()) {} + AttributeSetImpl(LLVMContext &C, ArrayRef attrs) + : Context(C), Attrs(attrs.begin(), attrs.end()) {} void Profile(FoldingSetNodeID &ID) const { Profile(ID, Attrs);