summaryrefslogtreecommitdiff
path: root/lib/IR/Attributes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/IR/Attributes.cpp')
-rw-r--r--lib/IR/Attributes.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/IR/Attributes.cpp b/lib/IR/Attributes.cpp
index a3abd36fc0..4bd2391dfd 100644
--- a/lib/IR/Attributes.cpp
+++ b/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
//===----------------------------------------------------------------------===//