[llvm] r187088 - Add helpful accessor methods to get the specified function attribute.
Bill Wendling
isanbard at gmail.com
Wed Jul 24 16:45:00 PDT 2013
Author: void
Date: Wed Jul 24 18:45:00 2013
New Revision: 187088
URL: http://llvm.org/viewvc/llvm-project?rev=187088&view=rev
Log:
Add helpful accessor methods to get the specified function attribute.
Modified:
llvm/trunk/include/llvm/IR/Function.h
Modified: llvm/trunk/include/llvm/IR/Function.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Function.h?rev=187088&r1=187087&r2=187088&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Function.h (original)
+++ llvm/trunk/include/llvm/IR/Function.h Wed Jul 24 18:45:00 2013
@@ -166,37 +166,32 @@ public:
(static_cast<unsigned>(CC) << 1));
}
- /// getAttributes - Return the attribute list for this Function.
- ///
+ /// @brief Return the attribute list for this Function.
AttributeSet getAttributes() const { return AttributeSets; }
- /// setAttributes - Set the attribute list for this Function.
- ///
+ /// @brief Set the attribute list for this Function.
void setAttributes(AttributeSet attrs) { AttributeSets = attrs; }
- /// addFnAttr - Add function attributes to this function.
- ///
+ /// @brief Add function attributes to this function.
void addFnAttr(Attribute::AttrKind N) {
setAttributes(AttributeSets.addAttribute(getContext(),
AttributeSet::FunctionIndex, N));
}
- /// removeFnAttr - Remove function attributes from this function.
- ///
+ /// @brief Remove function attributes from this function.
void removeFnAttr(Attribute::AttrKind N) {
setAttributes(AttributeSets.removeAttribute(
getContext(), AttributeSet::FunctionIndex, N));
}
- /// addFnAttr - Add function attributes to this function.
- ///
+ /// @brief Add function attributes to this function.
void addFnAttr(StringRef Kind) {
setAttributes(
AttributeSets.addAttribute(getContext(),
AttributeSet::FunctionIndex, Kind));
}
- /// \brief Return true if the function has the attribute.
+ /// @brief Return true if the function has the attribute.
bool hasFnAttribute(Attribute::AttrKind Kind) const {
return AttributeSets.hasAttribute(AttributeSet::FunctionIndex, Kind);
}
@@ -204,6 +199,14 @@ public:
return AttributeSets.hasAttribute(AttributeSet::FunctionIndex, Kind);
}
+ /// @brief Return the attribute for the given attribute kind.
+ Attribute getFnAttribute(Attribute::AttrKind Kind) const {
+ return AttributeSets.getAttribute(AttributeSet::FunctionIndex, Kind);
+ }
+ Attribute getFnAttribute(StringRef Kind) const {
+ return AttributeSets.getAttribute(AttributeSet::FunctionIndex, Kind);
+ }
+
/// hasGC/getGC/setGC/clearGC - The name of the garbage collection algorithm
/// to use during code generation.
bool hasGC() const;
More information about the llvm-commits
mailing list