summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/AddReadAttrs.cpp
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
commita05633e105cc2df01f0a5017b1269b6f32e01416 (patch)
tree0cd054e5465d3df86a493c7b0d9b45d069190cdf /llvm/lib/Transforms/IPO/AddReadAttrs.cpp
parentc966a737c52264b95387f677f6200c21274a9403 (diff)
downloadbcm5719-llvm-a05633e105cc2df01f0a5017b1269b6f32e01416.tar.gz
bcm5719-llvm-a05633e105cc2df01f0a5017b1269b6f32e01416.zip
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. llvm-svn: 56704
Diffstat (limited to 'llvm/lib/Transforms/IPO/AddReadAttrs.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/AddReadAttrs.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/AddReadAttrs.cpp b/llvm/lib/Transforms/IPO/AddReadAttrs.cpp
index 4e0677b0d8e..897548bad5b 100644
--- a/llvm/lib/Transforms/IPO/AddReadAttrs.cpp
+++ b/llvm/lib/Transforms/IPO/AddReadAttrs.cpp
@@ -105,10 +105,10 @@ bool AddReadAttrs::runOnSCC(const std::vector<CallGraphNode *> &SCC) {
MadeChange = true;
// Clear out any existing attributes.
- F->removeAttribute(0, Attribute::ReadOnly | Attribute::ReadNone);
+ F->removeAttribute(~0, Attribute::ReadOnly | Attribute::ReadNone);
// Add in the new attribute.
- F->addAttribute(0, ReadsMemory ? Attribute::ReadOnly : Attribute::ReadNone);
+ F->addAttribute(~0, ReadsMemory ? Attribute::ReadOnly : Attribute::ReadNone);
if (ReadsMemory)
NumReadOnly++;
OpenPOWER on IntegriCloud