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)
commit236446cd4c32233f42f513a552bbcc29de020ff4
treedb1cc8f3b48b8d74c17162480670f67a22b50de1
parentf071bd0a18873098507fe2728f8eb96338896a2a
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

llvm-svn: 238152
llvm/lib/Transforms/IPO/FunctionAttrs.cpp
llvm/test/Transforms/FunctionAttrs/readnone.ll [new file with mode: 0644]