aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Function.h
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-10-09 07:45:08 +0000
committerBill Wendling <isanbard@gmail.com>2012-10-09 07:45:08 +0000
commit6765834754cbb3cb0f15b4b15e98c5e73fa50066 (patch)
treed2d827f8d5acfde264a1b8f883884e8297879c5f /include/llvm/Function.h
parent50cf36351cefbc64bca9b82b4a3897394feecac7 (diff)
downloadexternal_llvm-6765834754cbb3cb0f15b4b15e98c5e73fa50066.zip
external_llvm-6765834754cbb3cb0f15b4b15e98c5e73fa50066.tar.gz
external_llvm-6765834754cbb3cb0f15b4b15e98c5e73fa50066.tar.bz2
Create enums for the different attributes.
We use the enums to query whether an Attributes object has that attribute. The opaque layer is responsible for knowing where that specific attribute is stored. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165488 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Function.h')
-rw-r--r--include/llvm/Function.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/include/llvm/Function.h b/include/llvm/Function.h
index f5bed69..5601c47 100644
--- a/include/llvm/Function.h
+++ b/include/llvm/Function.h
@@ -219,7 +219,7 @@ public:
/// @brief Determine if the function does not access memory.
bool doesNotAccessMemory() const {
- return getFnAttributes().hasReadNoneAttr();
+ return getFnAttributes().hasAttribute(Attributes::ReadNone);
}
void setDoesNotAccessMemory(bool DoesNotAccessMemory = true) {
if (DoesNotAccessMemory) addFnAttr(Attribute::ReadNone);
@@ -228,7 +228,8 @@ public:
/// @brief Determine if the function does not access or only reads memory.
bool onlyReadsMemory() const {
- return doesNotAccessMemory() || getFnAttributes().hasReadOnlyAttr();
+ return doesNotAccessMemory() ||
+ getFnAttributes().hasAttribute(Attributes::ReadOnly);
}
void setOnlyReadsMemory(bool OnlyReadsMemory = true) {
if (OnlyReadsMemory) addFnAttr(Attribute::ReadOnly);
@@ -237,7 +238,7 @@ public:
/// @brief Determine if the function cannot return.
bool doesNotReturn() const {
- return getFnAttributes().hasNoReturnAttr();
+ return getFnAttributes().hasAttribute(Attributes::NoReturn);
}
void setDoesNotReturn(bool DoesNotReturn = true) {
if (DoesNotReturn) addFnAttr(Attribute::NoReturn);
@@ -246,7 +247,7 @@ public:
/// @brief Determine if the function cannot unwind.
bool doesNotThrow() const {
- return getFnAttributes().hasNoUnwindAttr();
+ return getFnAttributes().hasAttribute(Attributes::NoUnwind);
}
void setDoesNotThrow(bool DoesNotThrow = true) {
if (DoesNotThrow) addFnAttr(Attribute::NoUnwind);
@@ -256,7 +257,7 @@ public:
/// @brief True if the ABI mandates (or the user requested) that this
/// function be in a unwind table.
bool hasUWTable() const {
- return getFnAttributes().hasUWTableAttr();
+ return getFnAttributes().hasAttribute(Attributes::UWTable);
}
void setHasUWTable(bool HasUWTable = true) {
if (HasUWTable)
@@ -273,14 +274,13 @@ public:
/// @brief Determine if the function returns a structure through first
/// pointer argument.
bool hasStructRetAttr() const {
- return getParamAttributes(1).hasStructRetAttr();
+ return getParamAttributes(1).hasAttribute(Attributes::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 n != 0 ? getParamAttributes(n).hasNoAliasAttr() :
- AttributeList.getRetAttributes().hasNoAliasAttr();
+ return getParamAttributes(n).hasAttribute(Attributes::NoAlias);
}
void setDoesNotAlias(unsigned n, bool DoesNotAlias = true) {
if (DoesNotAlias) addAttribute(n, Attribute::NoAlias);
@@ -290,7 +290,7 @@ public:
/// @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).hasNoCaptureAttr();
+ return getParamAttributes(n).hasAttribute(Attributes::NoCapture);
}
void setDoesNotCapture(unsigned n, bool DoesNotCapture = true) {
if (DoesNotCapture) addAttribute(n, Attribute::NoCapture);