diff --git a/llvm/include/llvm/IR/Attributes.h b/llvm/include/llvm/IR/Attributes.h --- a/llvm/include/llvm/IR/Attributes.h +++ b/llvm/include/llvm/IR/Attributes.h @@ -459,41 +459,24 @@ /// Returns a new list because attribute lists are immutable. LLVM_NODISCARD AttributeList addAttributeAtIndex( LLVMContext &C, unsigned Index, Attribute::AttrKind Kind) const; - LLVM_NODISCARD AttributeList addAttribute(LLVMContext &C, unsigned Index, - Attribute::AttrKind Kind) const { - return addAttributeAtIndex(C, Index, Kind); - } /// Add an attribute to the attribute set at the given index. /// Returns a new list because attribute lists are immutable. LLVM_NODISCARD AttributeList addAttributeAtIndex(LLVMContext &C, unsigned Index, StringRef Kind, StringRef Value = StringRef()) const; - LLVM_NODISCARD AttributeList - addAttribute(LLVMContext &C, unsigned Index, StringRef Kind, - StringRef Value = StringRef()) const { - return addAttributeAtIndex(C, Index, Kind); - } /// Add an attribute to the attribute set at the given index. /// Returns a new list because attribute lists are immutable. LLVM_NODISCARD AttributeList addAttributeAtIndex(LLVMContext &C, unsigned Index, Attribute A) const; - LLVM_NODISCARD AttributeList addAttribute(LLVMContext &C, unsigned Index, - Attribute A) const { - return addAttributeAtIndex(C, Index, A); - } /// Add attributes to the attribute set at the given index. /// Returns a new list because attribute lists are immutable. LLVM_NODISCARD AttributeList addAttributesAtIndex(LLVMContext &C, unsigned Index, const AttrBuilder &B) const; - LLVM_NODISCARD AttributeList addAttributes(LLVMContext &C, unsigned Index, - const AttrBuilder &B) const { - return addAttributesAtIndex(C, Index, B); - } /// Add a function attribute to the list. Returns a new list because /// attribute lists are immutable. @@ -577,10 +560,6 @@ /// attribute list. Returns a new list because attribute lists are immutable. LLVM_NODISCARD AttributeList removeAttributeAtIndex( LLVMContext &C, unsigned Index, Attribute::AttrKind Kind) const; - LLVM_NODISCARD AttributeList removeAttribute(LLVMContext &C, unsigned Index, - Attribute::AttrKind Kind) const { - return removeAttributeAtIndex(C, Index, Kind); - } /// Remove the specified attribute at the specified index from this /// attribute list. Returns a new list because attribute lists are immutable. @@ -596,19 +575,11 @@ /// attribute list. Returns a new list because attribute lists are immutable. LLVM_NODISCARD AttributeList removeAttributesAtIndex( LLVMContext &C, unsigned Index, const AttrBuilder &AttrsToRemove) const; - LLVM_NODISCARD AttributeList removeAttributes( - LLVMContext &C, unsigned Index, const AttrBuilder &AttrsToRemove) const { - return removeAttributesAtIndex(C, Index, AttrsToRemove); - } /// Remove all attributes at the specified index from this /// attribute list. Returns a new list because attribute lists are immutable. LLVM_NODISCARD AttributeList removeAttributesAtIndex(LLVMContext &C, unsigned Index) const; - LLVM_NODISCARD AttributeList removeAttributes(LLVMContext &C, - unsigned Index) const { - return removeAttributesAtIndex(C, Index); - } /// Remove the specified attribute at the function index from this /// attribute list. Returns a new list because attribute lists are immutable. @@ -697,12 +668,6 @@ return Attrs.addAttributeAtIndex(C, ArgNo, Attr.getWithNewType(C, ReplacementTy)); } - LLVM_NODISCARD AttributeList replaceAttributeType(LLVMContext &C, - unsigned ArgNo, - Attribute::AttrKind Kind, - Type *ReplacementTy) const { - return replaceAttributeTypeAtIndex(C, ArgNo, Kind, ReplacementTy); - } /// \brief Add the dereferenceable attribute to the attribute set at the given /// index. Returns a new list because attribute lists are immutable. @@ -745,21 +710,12 @@ /// Return true if the attribute exists at the given index. bool hasAttributeAtIndex(unsigned Index, Attribute::AttrKind Kind) const; - bool hasAttribute(unsigned Index, Attribute::AttrKind Kind) const { - return hasAttributeAtIndex(Index, Kind); - } /// Return true if the attribute exists at the given index. bool hasAttributeAtIndex(unsigned Index, StringRef Kind) const; - bool hasAttribute(unsigned Index, StringRef Kind) const { - return hasAttributeAtIndex(Index, Kind); - } /// Return true if attribute exists at the given index. bool hasAttributesAtIndex(unsigned Index) const; - bool hasAttributes(unsigned Index) const { - return hasAttributesAtIndex(Index); - } /// Return true if the attribute exists for the given argument bool hasParamAttr(unsigned ArgNo, Attribute::AttrKind Kind) const { @@ -806,15 +762,9 @@ /// Return the attribute object that exists at the given index. Attribute getAttributeAtIndex(unsigned Index, Attribute::AttrKind Kind) const; - Attribute getAttribute(unsigned Index, Attribute::AttrKind Kind) const { - return getAttributeAtIndex(Index, Kind); - } /// Return the attribute object that exists at the given index. Attribute getAttributeAtIndex(unsigned Index, StringRef Kind) const; - Attribute getAttribute(unsigned Index, StringRef Kind) const { - return getAttributeAtIndex(Index, Kind); - } /// Return the attribute object that exists at the arg index. Attribute getParamAttr(unsigned ArgNo, Attribute::AttrKind Kind) const { diff --git a/llvm/include/llvm/IR/Function.h b/llvm/include/llvm/IR/Function.h --- a/llvm/include/llvm/IR/Function.h +++ b/llvm/include/llvm/IR/Function.h @@ -331,9 +331,6 @@ // TODO: remove non-AtIndex versions of these methods. /// adds the attribute to the list of attributes. void addAttributeAtIndex(unsigned i, Attribute Attr); - void addAttribute(unsigned i, Attribute Attr) { - addAttributeAtIndex(i, Attr); - } /// Add function attributes to this function. void addFnAttr(Attribute::AttrKind Kind); @@ -361,15 +358,9 @@ /// removes the attribute from the list of attributes. void removeAttributeAtIndex(unsigned i, Attribute::AttrKind Kind); - void removeAttribute(unsigned i, Attribute::AttrKind Kind) { - removeAttributeAtIndex(i, Kind); - } /// removes the attribute from the list of attributes. void removeAttributeAtIndex(unsigned i, StringRef Kind); - void removeAttribute(unsigned i, StringRef Kind) { - removeAttributeAtIndex(i, Kind); - } /// Remove function attributes from this function. void removeFnAttr(Attribute::AttrKind Kind); @@ -411,15 +402,9 @@ /// gets the attribute from the list of attributes. Attribute getAttributeAtIndex(unsigned i, Attribute::AttrKind Kind) const; - Attribute getAttribute(unsigned i, Attribute::AttrKind Kind) const { - return getAttributeAtIndex(i, Kind); - } /// gets the attribute from the list of attributes. Attribute getAttributeAtIndex(unsigned i, StringRef Kind) const; - Attribute getAttribute(unsigned i, StringRef Kind) const { - return getAttributeAtIndex(i, Kind); - } /// Return the attribute for the given attribute kind. Attribute getFnAttribute(Attribute::AttrKind Kind) const; diff --git a/llvm/include/llvm/IR/InstrTypes.h b/llvm/include/llvm/IR/InstrTypes.h --- a/llvm/include/llvm/IR/InstrTypes.h +++ b/llvm/include/llvm/IR/InstrTypes.h @@ -1490,17 +1490,11 @@ void addAttributeAtIndex(unsigned i, Attribute::AttrKind Kind) { Attrs = Attrs.addAttributeAtIndex(getContext(), i, Kind); } - void addAttribute(unsigned i, Attribute::AttrKind Kind) { - addAttributeAtIndex(i, Kind); - } /// adds the attribute to the list of attributes. void addAttributeAtIndex(unsigned i, Attribute Attr) { Attrs = Attrs.addAttributeAtIndex(getContext(), i, Attr); } - void addAttribute(unsigned i, Attribute Attr) { - addAttributeAtIndex(i, Attr); - } /// Adds the attribute to the function. void addFnAttr(Attribute::AttrKind Kind) { @@ -1538,17 +1532,11 @@ void removeAttributeAtIndex(unsigned i, Attribute::AttrKind Kind) { Attrs = Attrs.removeAttributeAtIndex(getContext(), i, Kind); } - void removeAttribute(unsigned i, Attribute::AttrKind Kind) { - removeAttributeAtIndex(i, Kind); - } /// removes the attribute from the list of attributes. void removeAttributeAtIndex(unsigned i, StringRef Kind) { Attrs = Attrs.removeAttributeAtIndex(getContext(), i, Kind); } - void removeAttribute(unsigned i, StringRef Kind) { - removeAttributeAtIndex(i, Kind); - } /// Removes the attributes from the function void removeFnAttrs(const AttrBuilder &AttrsToRemove) { @@ -1611,17 +1599,11 @@ Attribute getAttributeAtIndex(unsigned i, Attribute::AttrKind Kind) const { return getAttributes().getAttributeAtIndex(i, Kind); } - Attribute getAttribute(unsigned i, Attribute::AttrKind Kind) const { - return getAttributeAtIndex(i, Kind); - } /// Get the attribute of a given kind at a position. Attribute getAttributeAtIndex(unsigned i, StringRef Kind) const { return getAttributes().getAttributeAtIndex(i, Kind); } - Attribute getAttribute(unsigned i, StringRef Kind) const { - return getAttributeAtIndex(i, Kind); - } /// Get the attribute of a given kind for the function. Attribute getFnAttr(StringRef Kind) const {