<div dir="ltr">Ahh, later on you even have the latter option for CallSite:<div><br></div><div><span style="font-family:arial,sans-serif;font-size:13px">Modified: llvm/trunk/include/llvm/</span><span style="font-family:arial,sans-serif;font-size:13px">Support/CallSite.h</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">URL: </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CallSite.h?rev=185735&r1=185734&r2=185735&view=diff" target="_blank" class="cremed" style="font-family:arial,sans-serif;font-size:13px">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CallSite.h?rev=185735&r1=185734&r2=185735&view=diff</a><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">==============================</span><span style="font-family:arial,sans-serif;font-size:13px">==============================</span><span style="font-family:arial,sans-serif;font-size:13px">==================</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">--- llvm/trunk/include/llvm/</span><span style="font-family:arial,sans-serif;font-size:13px">Support/CallSite.h (original)</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">+++ llvm/trunk/include/llvm/</span><span style="font-family:arial,sans-serif;font-size:13px">Support/CallSite.h Fri Jul 5 19:29:58 2013</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">@@ -257,6 +257,15 @@ public:</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px"> return paramHasAttr(ArgNo + 1, Attribute::ByVal);</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px"> }</span><br style="font-family:arial,sans-serif;font-size:13px"><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">+ bool doesNotAccessMemory(unsigned ArgNo) const {</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">+ return paramHasAttr(ArgNo + 1, Attribute::ReadNone);</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">+ }</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">+</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">+ bool onlyReadsMemory(unsigned ArgNo) const {</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">+ return paramHasAttr(ArgNo + 1, Attribute::ReadOnly) ||</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">+ paramHasAttr(ArgNo + 1, Attribute::ReadNone);</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">+ }</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">+</span><br></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Fri, Jul 5, 2013 at 5:48 PM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@google.com" target="_blank">chandlerc@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote"><div class="im">On Fri, Jul 5, 2013 at 5:29 PM, Nick Lewycky <span dir="ltr"><<a href="mailto:nicholas@mxc.ca" target="_blank">nicholas@mxc.ca</a>></span> wrote:<br>
</div><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="overflow:hidden">+ bool onlyReadsMemory(unsigned n) const {<br>
+ return AttributeSets.hasAttribute(n, Attribute::ReadOnly) ||<br>
+ AttributeSets.hasAttribute(n, Attribute::ReadNone);<br>
+ }<br>
+ void setOnlyReadsMemory(unsigned n) {<br>
+ addAttribute(n, Attribute::ReadOnly);<br>
+ }<br>
+</div></blockquote></div></div><br>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).</div>
</div>
</blockquote></div><br></div>