summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Attributes.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-01-23 06:14:59 +0000
committerBill Wendling <isanbard@gmail.com>2013-01-23 06:14:59 +0000
commit49bc76cbb3072c077f684e93904df8bb46803210 (patch)
treea3a33d3d9c71bc02a6b9c69506a9904e0eba2b71 /llvm/lib/IR/Attributes.cpp
parentc77c8e95e3f3a3f9161da179abf4b59f5dc78e74 (diff)
downloadbcm5719-llvm-49bc76cbb3072c077f684e93904df8bb46803210.tar.gz
bcm5719-llvm-49bc76cbb3072c077f684e93904df8bb46803210.zip
Remove the last of uses that use the Attribute object as a collection of attributes.
Collections of attributes are handled via the AttributeSet class now. This finally frees us up to make significant changes to how attributes are structured. llvm-svn: 173228
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r--llvm/lib/IR/Attributes.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index a3abd36fc0d..4bd2391dfdb 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/lib/IR/Attributes.cpp
@@ -541,6 +541,14 @@ AttributeWithIndex AttributeWithIndex::get(LLVMContext &C, unsigned Idx,
// AttributeSetImpl Definition
//===----------------------------------------------------------------------===//
+AttributeSet AttributeSet::getParamAttributes(unsigned Idx) const {
+ // FIXME: Remove.
+ return AttrList && hasAttributes(Idx) ?
+ AttributeSet::get(AttrList->getContext(),
+ AttributeWithIndex::get(Idx, getAttributes(Idx))) :
+ AttributeSet();
+}
+
AttributeSet AttributeSet::getRetAttributes() const {
// FIXME: Remove.
return AttrList && hasAttributes(ReturnIndex) ?
@@ -601,6 +609,11 @@ AttributeSet AttributeSet::get(LLVMContext &C, unsigned Idx, AttrBuilder &B) {
return get(C, AttributeWithIndex::get(Idx, Attribute::get(C, B)));
}
+AttributeSet AttributeSet::get(LLVMContext &C, unsigned Idx,
+ Attribute::AttrKind Kind) {
+ return get(C, AttributeWithIndex::get(Idx, Attribute::get(C, Kind)));
+}
+
//===----------------------------------------------------------------------===//
// AttributeSet Method Implementations
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud