diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-01-21 21:57:28 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-01-21 21:57:28 +0000 |
commit | bd4ea16bf39033271255dfbcc8ffb636a7de26bb (patch) | |
tree | 1f7b638c81daf44cefb27e811c4c3f2003c0a633 /llvm/lib/IR/Attributes.cpp | |
parent | 9d86a4a3b636abc9871108d0ffecb990b824f3dd (diff) | |
download | bcm5719-llvm-bd4ea16bf39033271255dfbcc8ffb636a7de26bb.tar.gz bcm5719-llvm-bd4ea16bf39033271255dfbcc8ffb636a7de26bb.zip |
Make AttributeSet::getFnAttributes() return an AttributeSet instead of an Attribute.
This is more code to isolate the use of the Attribute class to that of just
holding one attribute instead of a collection of attributes.
llvm-svn: 173094
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. |