Now Attributes are divided in three groups
[oota-llvm.git] / lib / Transforms / IPO / AddReadAttrs.cpp
index 4e0677b0d8e10f38bda054a784c2f3f5e0aa03df..897548bad5b312ca436c8601e8e20b5a3b8babd5 100644 (file)
@@ -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++;