Remove conflicting attributes before adding deduced readonly/readnone
authorBjorn Steinbrink <bsteinbr@gmail.com>
Mon, 25 May 2015 19:46:38 +0000 (19:46 +0000)
committerBjorn Steinbrink <bsteinbr@gmail.com>
Mon, 25 May 2015 19:46:38 +0000 (19:46 +0000)
commit0cb6d37deac94934069d47c7ceaef7288088ea07
tree018cb3bbcdd303be83d7fe6cab39d74053544ac1
parent41a6e6a69852117c0bb18c97673e0cab57e8547c
Remove conflicting attributes before adding deduced readonly/readnone

Summary:
In case of functions that have a pointer argument and only pass it to
each other, the function attributes pass deduces that the pointer should
get the readnone attribute, but fails to remove a readonly attribute
that may already have been present.

Reviewers: nlewycky

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D9995

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238152 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/FunctionAttrs.cpp
test/Transforms/FunctionAttrs/readnone.ll [new file with mode: 0644]