diff options
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r-- | llvm/lib/IR/Attributes.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp index 5de18272ffb..d3f284a41d8 100644 --- a/llvm/lib/IR/Attributes.cpp +++ b/llvm/lib/IR/Attributes.cpp @@ -530,9 +530,29 @@ void AttributeImpl::Profile(FoldingSetNodeID &ID, Constant *Data, } //===----------------------------------------------------------------------===// +// AttributeWithIndex Definition +//===----------------------------------------------------------------------===// + +AttributeWithIndex AttributeWithIndex::get(LLVMContext &C, unsigned Idx, + AttributeSet AS) { + // FIXME: This is temporary, but necessary for the conversion. + AttrBuilder B(AS, Idx); + return get(Idx, Attribute::get(C, B)); +} + +//===----------------------------------------------------------------------===// // AttributeSetImpl Definition //===----------------------------------------------------------------------===// +AttributeSet AttributeSet::getFnAttributes() const { + // FIXME: Remove. + return AttrList ? + AttributeSet::get(AttrList->getContext(), + AttributeWithIndex::get(FunctionIndex, + getAttributes(FunctionIndex))) : + AttributeSet(); +} + AttributeSet AttributeSet::get(LLVMContext &C, ArrayRef<AttributeWithIndex> Attrs) { // If there are no attributes then return a null AttributesList pointer. |