<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:chisophugis@gmail.com" title="Sean Silva <chisophugis@gmail.com>"> <span class="fn">Sean Silva</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - -Wignored-qualifier noisy on common pattern"
href="http://llvm.org/bugs/show_bug.cgi?id=21348">bug 21348</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>NEW
</td>
<td>RESOLVED
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>INVALID
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - -Wignored-qualifier noisy on common pattern"
href="http://llvm.org/bugs/show_bug.cgi?id=21348#c10">Comment # 10</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - -Wignored-qualifier noisy on common pattern"
href="http://llvm.org/bugs/show_bug.cgi?id=21348">bug 21348</a>
from <span class="vcard"><a class="email" href="mailto:chisophugis@gmail.com" title="Sean Silva <chisophugis@gmail.com>"> <span class="fn">Sean Silva</span></a>
</span></b>
<pre>(In reply to <a href="show_bug.cgi?id=21348#c8">comment #8</a>)
<span class="quote">> Yes its to abstract an issue with some ABIs, and really comes into its own
> when a vector library is cross platform.
>
> For instance Win32 only passes 3 128bit vectors in register and the rest get
> passed on the stack (and a not a guaranteed 16-byte aligned stack at
> that..). Other targets have issues with passing different size vectors
> (64bit, 256bit, ....), especially when they aren't native.
>
> The _arg pattern allows us to hide all pass-by-reference vs pass-by-value
> issues - and when used by lightweight functions that get inlined many of
> those reference loads disappear as well.
>
> But given that _arg types have the potential to be pass-by-reference I'd
> highly recommend to do everything possible to keep the const qualifier on
> all typedefs - otherwise you have the potential to develop on a
> pass-by-value target and not see const modification compile errors that only
> occur on pass-by-reference, or even worse modify the referenced value.</span >
Thanks Simon. That clarifies things. Now that I look at it, all of the cases
I've seen actually use these variations:
typedef const Vec4& Vec4_arg;
// or
typedef const Vec4 Vec4_arg;
which are const anyway, so I guess it makes sense to have clang warn on `const
Vec4_arg` since the const there is just redundant (rather than actively
deceiving as in the case that motivated the warning and that Arthur was talking
about).</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>