Use the AttributeSet when removing multiple attributes. Use Attribute::AttrKind
when removing one attribute. This further encapsulates the use of the attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173214 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/IR/Attributes.cpp b/lib/IR/Attributes.cpp
index c67b1f3..a3abd36 100644
--- a/lib/IR/Attributes.cpp
+++ b/lib/IR/Attributes.cpp
@@ -730,6 +730,16 @@
return get(C, NewAttrList);
}
+AttributeSet AttributeSet::removeAttribute(LLVMContext &C, unsigned Idx,
+ Attribute::AttrKind Attr) const {
+ return removeAttr(C, Idx, Attribute::get(C, Attr));
+}
+
+AttributeSet AttributeSet::removeAttributes(LLVMContext &C, unsigned Idx,
+ AttributeSet Attrs) const {
+ return removeAttr(C, Idx, Attrs.getAttributes(Idx));
+}
+
AttributeSet AttributeSet::removeAttr(LLVMContext &C, unsigned Idx,
Attribute Attrs) const {
#ifndef NDEBUG