aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Function.h
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-12-19 07:18:57 +0000
committerBill Wendling <isanbard@gmail.com>2012-12-19 07:18:57 +0000
commit034b94b17006f51722886b0f2283fb6fb19aca1f (patch)
treee42e091c12137e9599d0e58bfa4336c4af7333b3 /include/llvm/Function.h
parent85022561f9c78446bbc5f745cd9b58f4e5dc92ec (diff)
Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170502 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Function.h')
-rw-r--r--include/llvm/Function.h50
1 files changed, 25 insertions, 25 deletions
diff --git a/include/llvm/Function.h b/include/llvm/Function.h
index 6edc660c9c..ce7ae2646b 100644
--- a/include/llvm/Function.h
+++ b/include/llvm/Function.h
@@ -170,21 +170,21 @@ public:
/// getFnAttributes - Return the function attributes for querying.
///
- Attributes getFnAttributes() const {
+ Attribute getFnAttributes() const {
return AttributeList.getFnAttributes();
}
/// addFnAttr - Add function attributes to this function.
///
- void addFnAttr(Attributes::AttrVal N) {
- // Function Attributes are stored at ~0 index
- addAttribute(AttributeSet::FunctionIndex, Attributes::get(getContext(), N));
+ void addFnAttr(Attribute::AttrVal N) {
+ // Function Attribute are stored at ~0 index
+ addAttribute(AttributeSet::FunctionIndex, Attribute::get(getContext(), N));
}
/// removeFnAttr - Remove function attributes from this function.
///
- void removeFnAttr(Attributes N) {
- // Function Attributes are stored at ~0 index
+ void removeFnAttr(Attribute N) {
+ // Function Attribute are stored at ~0 index
removeAttribute(~0U, N);
}
@@ -197,20 +197,20 @@ public:
/// getRetAttributes - Return the return attributes for querying.
- Attributes getRetAttributes() const {
+ Attribute getRetAttributes() const {
return AttributeList.getRetAttributes();
}
/// getParamAttributes - Return the parameter attributes for querying.
- Attributes getParamAttributes(unsigned Idx) const {
+ Attribute getParamAttributes(unsigned Idx) const {
return AttributeList.getParamAttributes(Idx);
}
/// addAttribute - adds the attribute to the list of attributes.
- void addAttribute(unsigned i, Attributes attr);
+ void addAttribute(unsigned i, Attribute attr);
/// removeAttribute - removes the attribute from the list of attributes.
- void removeAttribute(unsigned i, Attributes attr);
+ void removeAttribute(unsigned i, Attribute attr);
/// @brief Extract the alignment for a call or parameter (0=unknown).
unsigned getParamAlignment(unsigned i) const {
@@ -219,44 +219,44 @@ public:
/// @brief Determine if the function does not access memory.
bool doesNotAccessMemory() const {
- return getFnAttributes().hasAttribute(Attributes::ReadNone);
+ return getFnAttributes().hasAttribute(Attribute::ReadNone);
}
void setDoesNotAccessMemory() {
- addFnAttr(Attributes::ReadNone);
+ addFnAttr(Attribute::ReadNone);
}
/// @brief Determine if the function does not access or only reads memory.
bool onlyReadsMemory() const {
return doesNotAccessMemory() ||
- getFnAttributes().hasAttribute(Attributes::ReadOnly);
+ getFnAttributes().hasAttribute(Attribute::ReadOnly);
}
void setOnlyReadsMemory() {
- addFnAttr(Attributes::ReadOnly);
+ addFnAttr(Attribute::ReadOnly);
}
/// @brief Determine if the function cannot return.
bool doesNotReturn() const {
- return getFnAttributes().hasAttribute(Attributes::NoReturn);
+ return getFnAttributes().hasAttribute(Attribute::NoReturn);
}
void setDoesNotReturn() {
- addFnAttr(Attributes::NoReturn);
+ addFnAttr(Attribute::NoReturn);
}
/// @brief Determine if the function cannot unwind.
bool doesNotThrow() const {
- return getFnAttributes().hasAttribute(Attributes::NoUnwind);
+ return getFnAttributes().hasAttribute(Attribute::NoUnwind);
}
void setDoesNotThrow() {
- addFnAttr(Attributes::NoUnwind);
+ addFnAttr(Attribute::NoUnwind);
}
/// @brief True if the ABI mandates (or the user requested) that this
/// function be in a unwind table.
bool hasUWTable() const {
- return getFnAttributes().hasAttribute(Attributes::UWTable);
+ return getFnAttributes().hasAttribute(Attribute::UWTable);
}
void setHasUWTable() {
- addFnAttr(Attributes::UWTable);
+ addFnAttr(Attribute::UWTable);
}
/// @brief True if this function needs an unwind table.
@@ -267,25 +267,25 @@ public:
/// @brief Determine if the function returns a structure through first
/// pointer argument.
bool hasStructRetAttr() const {
- return getParamAttributes(1).hasAttribute(Attributes::StructRet);
+ return getParamAttributes(1).hasAttribute(Attribute::StructRet);
}
/// @brief Determine if the parameter does not alias other parameters.
/// @param n The parameter to check. 1 is the first parameter, 0 is the return
bool doesNotAlias(unsigned n) const {
- return getParamAttributes(n).hasAttribute(Attributes::NoAlias);
+ return getParamAttributes(n).hasAttribute(Attribute::NoAlias);
}
void setDoesNotAlias(unsigned n) {
- addAttribute(n, Attributes::get(getContext(), Attributes::NoAlias));
+ addAttribute(n, Attribute::get(getContext(), Attribute::NoAlias));
}
/// @brief Determine if the parameter can be captured.
/// @param n The parameter to check. 1 is the first parameter, 0 is the return
bool doesNotCapture(unsigned n) const {
- return getParamAttributes(n).hasAttribute(Attributes::NoCapture);
+ return getParamAttributes(n).hasAttribute(Attribute::NoCapture);
}
void setDoesNotCapture(unsigned n) {
- addAttribute(n, Attributes::get(getContext(), Attributes::NoCapture));
+ addAttribute(n, Attribute::get(getContext(), Attribute::NoCapture));
}
/// copyAttributesFrom - copy all additional attributes (those not needed to