summaryrefslogtreecommitdiff
path: root/include/llvm/Function.h
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2008-09-26 22:53:05 +0000
committerDevang Patel <dpatel@apple.com>2008-09-26 22:53:05 +0000
commit19c874638d9478a5d5028854817a5ee72293bb2b (patch)
tree748636424f3d1005b6c8713365639fb969466c37 /include/llvm/Function.h
parentd5d8191b202c0f96f33c826c93d9796451ff7fca (diff)
downloadllvm-19c874638d9478a5d5028854817a5ee72293bb2b.tar.gz
llvm-19c874638d9478a5d5028854817a5ee72293bb2b.tar.bz2
llvm-19c874638d9478a5d5028854817a5ee72293bb2b.tar.xz
Now Attributes are divided in three groups
- return attributes - inreg, zext and sext - parameter attributes - function attributes - nounwind, readonly, readnone, noreturn Return attributes use 0 as the index. Function attributes use ~0U as the index. This patch requires corresponding changes in llvm-gcc and clang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56704 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Function.h')
-rw-r--r--include/llvm/Function.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/include/llvm/Function.h b/include/llvm/Function.h
index 82871bbff6..19ff2bf4da 100644
--- a/include/llvm/Function.h
+++ b/include/llvm/Function.h
@@ -187,38 +187,38 @@ public:
/// @brief Determine if the function does not access memory.
bool doesNotAccessMemory() const {
- return paramHasAttr(0, Attribute::ReadNone);
+ return paramHasAttr(~0, Attribute::ReadNone);
}
void setDoesNotAccessMemory(bool DoesNotAccessMemory = true) {
- if (DoesNotAccessMemory) addAttribute(0, Attribute::ReadNone);
- else removeAttribute(0, Attribute::ReadNone);
+ if (DoesNotAccessMemory) addAttribute(~0, Attribute::ReadNone);
+ else removeAttribute(~0, Attribute::ReadNone);
}
/// @brief Determine if the function does not access or only reads memory.
bool onlyReadsMemory() const {
- return doesNotAccessMemory() || paramHasAttr(0, Attribute::ReadOnly);
+ return doesNotAccessMemory() || paramHasAttr(~0, Attribute::ReadOnly);
}
void setOnlyReadsMemory(bool OnlyReadsMemory = true) {
- if (OnlyReadsMemory) addAttribute(0, Attribute::ReadOnly);
- else removeAttribute(0, Attribute::ReadOnly | Attribute::ReadNone);
+ if (OnlyReadsMemory) addAttribute(~0, Attribute::ReadOnly);
+ else removeAttribute(~0, Attribute::ReadOnly | Attribute::ReadNone);
}
/// @brief Determine if the function cannot return.
bool doesNotReturn() const {
- return paramHasAttr(0, Attribute::NoReturn);
+ return paramHasAttr(~0, Attribute::NoReturn);
}
void setDoesNotReturn(bool DoesNotReturn = true) {
- if (DoesNotReturn) addAttribute(0, Attribute::NoReturn);
- else removeAttribute(0, Attribute::NoReturn);
+ if (DoesNotReturn) addAttribute(~0, Attribute::NoReturn);
+ else removeAttribute(~0, Attribute::NoReturn);
}
/// @brief Determine if the function cannot unwind.
bool doesNotThrow() const {
- return paramHasAttr(0, Attribute::NoUnwind);
+ return paramHasAttr(~0, Attribute::NoUnwind);
}
void setDoesNotThrow(bool DoesNotThrow = true) {
- if (DoesNotThrow) addAttribute(0, Attribute::NoUnwind);
- else removeAttribute(0, Attribute::NoUnwind);
+ if (DoesNotThrow) addAttribute(~0, Attribute::NoUnwind);
+ else removeAttribute(~0, Attribute::NoUnwind);
}
/// @brief Determine if the function returns a structure through first