diff options
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r-- | llvm/lib/IR/Attributes.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp index 8bcb080..8c989c4 100644 --- a/llvm/lib/IR/Attributes.cpp +++ b/llvm/lib/IR/Attributes.cpp @@ -1380,18 +1380,20 @@ AttributeList AttributeList::removeAttributeAtIndex(LLVMContext &C, unsigned Index, Attribute::AttrKind Kind) const { AttributeSet Attrs = getAttributes(Index); - if (!Attrs.hasAttribute(Kind)) + AttributeSet NewAttrs = Attrs.removeAttribute(C, Kind); + if (Attrs == NewAttrs) return *this; - return setAttributesAtIndex(C, Index, Attrs.removeAttribute(C, Kind)); + return setAttributesAtIndex(C, Index, NewAttrs); } AttributeList AttributeList::removeAttributeAtIndex(LLVMContext &C, unsigned Index, StringRef Kind) const { AttributeSet Attrs = getAttributes(Index); - if (!Attrs.hasAttribute(Kind)) + AttributeSet NewAttrs = Attrs.removeAttribute(C, Kind); + if (Attrs == NewAttrs) return *this; - return setAttributesAtIndex(C, Index, Attrs.removeAttribute(C, Kind)); + return setAttributesAtIndex(C, Index, NewAttrs); } AttributeList AttributeList::removeAttributesAtIndex( |