/// 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, Value);
- }
/// 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.
/// 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.
/// 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.
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.
/// 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 {
/// 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 {
// 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);
/// 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);
/// 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;
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) {
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) {
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 {