aboutsummaryrefslogtreecommitdiff
path: root/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
commit19c874638d9478a5d5028854817a5ee72293bb2b (patch)
tree748636424f3d1005b6c8713365639fb969466c37 /lib/Transforms/IPO/AddReadAttrs.cpp
parentd5d8191b202c0f96f33c826c93d9796451ff7fca (diff)
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 'lib/Transforms/IPO/AddReadAttrs.cpp')
-rw-r--r--lib/Transforms/IPO/AddReadAttrs.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/IPO/AddReadAttrs.cpp b/lib/Transforms/IPO/AddReadAttrs.cpp
index 4e0677b0d8..897548bad5 100644
--- a/lib/Transforms/IPO/AddReadAttrs.cpp
+++ b/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++;