aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/FunctionAttrs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/IPO/FunctionAttrs.cpp')
-rw-r--r--lib/Transforms/IPO/FunctionAttrs.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/Transforms/IPO/FunctionAttrs.cpp b/lib/Transforms/IPO/FunctionAttrs.cpp
index e9bc4ad437..c267097c4a 100644
--- a/lib/Transforms/IPO/FunctionAttrs.cpp
+++ b/lib/Transforms/IPO/FunctionAttrs.cpp
@@ -219,10 +219,8 @@ bool FunctionAttrs::AddReadAttrs(const CallGraphSCC &SCC) {
Attribute::get(F->getContext(), B));
// Add in the new attribute.
- B.clear();
- B.addAttribute(ReadsMemory ? Attribute::ReadOnly : Attribute::ReadNone);
F->addAttribute(AttributeSet::FunctionIndex,
- Attribute::get(F->getContext(), B));
+ ReadsMemory ? Attribute::ReadOnly : Attribute::ReadNone);
if (ReadsMemory)
++NumReadOnly;