[llvm] r185735 - Extend 'readonly' and 'readnone' to work on function arguments as well as
Chandler Carruth
chandlerc at google.com
Fri Jul 5 23:25:42 PDT 2013
On Fri, Jul 5, 2013 at 6:08 PM, Nick Lewycky <nicholas at mxc.ca> wrote:
> Chandler Carruth wrote:
>
>>
>> On Fri, Jul 5, 2013 at 5:29 PM, Nick Lewycky <nicholas at mxc.ca
>> <mailto: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).
>>
>
> This is how the readnone/readonly function attributes already worked, I
> just added 'parameter n' variants. I can't think of any clients who are
> interested in seeing that something is readonly-but-not-readnone.
>
Sure, I'm mostly asking why no accessors on Function for readnone? Note
that CallSite has an additional accessor. I would either get rid of the one
on CallSite or add one here.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130705/5ee15f4e/attachment.html>
More information about the llvm-commits
mailing list