summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/FunctionAttrs.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-01-23 00:20:53 +0000
committerBill Wendling <isanbard@gmail.com>2013-01-23 00:20:53 +0000
commit70d2ca0725b05a2d372e4dc3336e8ea350093e98 (patch)
tree2249ebb9f544a38c5ed721ded4957a66bb1b5917 /lib/Transforms/IPO/FunctionAttrs.cpp
parentbdd4e1311830bea92c8b8c09f0644cba15421241 (diff)
downloadllvm-70d2ca0725b05a2d372e4dc3336e8ea350093e98.tar.gz
llvm-70d2ca0725b05a2d372e4dc3336e8ea350093e98.tar.bz2
llvm-70d2ca0725b05a2d372e4dc3336e8ea350093e98.tar.xz
Use the AttributeSet when adding multiple attributes and an Attribute::AttrKind
when adding a single attribute to the function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173210 91177308-0d34-0410-b5e6-96231b3b80d8
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;