[llvm] r185735 - Extend 'readonly' and 'readnone' to work on function arguments as well as
Chandler Carruth
chandlerc at google.com
Fri Jul 5 17:48:46 PDT 2013
On Fri, Jul 5, 2013 at 5:29 PM, Nick Lewycky <nicholas at mxc.ca> wrote:
> + bool onlyReadsMemory(unsigned n) const {
> + return AttributeSets.hasAttribute(n, Attribute::ReadOnly) ||
> + AttributeSets.hasAttribute(n, Attribute::ReadNone);
> + }
> + void setOnlyReadsMemory(unsigned n) {
> + addAttribute(n, Attribute::ReadOnly);
> + }
> +
>
It seems weird interface wise to only expose this in the 'or' form. I know
the only user you have today expects that form, but interface wise it would
seem cleaner to either expose the attribute semantics directly, or to
expose an OR of the attributes and the readnone separately (as readnone is
essentially a strict subset of readonly).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130705/719d2a83/attachment.html>
More information about the llvm-commits
mailing list