--===============3577491966900114980== Content-Type: multipart/alternative; boundary=20cf307ac7abd8fc07051bbcade4 --20cf307ac7abd8fc07051bbcade4 Content-Type: text/plain; charset=UTF-8 On Sat, Jul 25, 2015 at 6:57 AM, Dimitry Andric wrote: > dim added inline comments. > > ================ > Comment at: include/__config:724 > @@ -719,1 +723,3 @@ > +#endif > + > #ifndef _LIBCPP_HAS_NO_ASAN > ---------------- > mclow.lists wrote: > > I think that this needs more exploration; someone needs to look at the > codegen. > > > > return x; > > > > is different from: > > > > return (x); // this is an expression > > > > I suspect that only one will trigger RVO. > > > Would you really think so? I would think the parentheses are superfluous, > and can be removed by parsing stages before it gets to RVO. But I will try > to check the codegen anyway. > Please file a bug if you find any cases where the parenthesized and non-parenthesized form behave differently wrt RVO / NRVO. > Alternatively, since the macro is for 'internal use only', we might try to > just remove the parentheses, e.g.: > > #ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES > # define _LIBCPP_EXPLICIT_MOVE(x) _VSTD::move(x) > #else > # define _LIBCPP_EXPLICIT_MOVE(x) x > #endif > > It is a bit ugly, but at least the code itself does not have to be > littered with #ifdefs. > > > http://reviews.llvm.org/D11394 > > > > > _______________________________________________ > cfe-commits mailing list > cfe-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits > --20cf307ac7abd8fc07051bbcade4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: Quoted-printable
On S= at, Jul 25, 2015 at 6:57 AM, Dimitry Andric <dimitry@andric.com>= wrote:
dim added inline comments.=

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Comment at: include/__config:724
@@ -719,1 +723,3 @@
+#endif
+
=C2=A0#ifndef _LIBCPP_HAS_NO_ASAN
----------------
mclow.lists wrote:
> I think that this needs more exploration; someone needs to look at the= codegen.
>
>=C2=A0 =C2=A0 =C2=A0 return x;
>
> is different from:
>
>=C2=A0 =C2=A0 =C2=A0 return (x);=C2=A0 =C2=A0// this is an expression >
> I suspect that only one will trigger RVO.
>
Would you really think so?=C2=A0 I would think the parentheses are s= uperfluous, and can be removed by parsing stages before it gets to RVO.=C2= =A0 But I will try to check the codegen anyway.

Please file a bug if you find any cases where the parenthesized an= d non-parenthesized form behave differently wrt RVO / NRVO.
=C2= =A0
Alternatively, since the macro is for 'internal use only', we might= try to just remove the parentheses, e.g.:

=C2=A0 =C2=A0 #ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES
=C2=A0 =C2=A0 #=C2=A0 define _LIBCPP_EXPLICIT_MOVE(x) _VSTD::move(x)
=C2=A0 =C2=A0 #else
=C2=A0 =C2=A0 #=C2=A0 define _LIBCPP_EXPLICIT_MOVE(x) x
=C2=A0 =C2=A0 #endif

It is a bit ugly, but at least the code itself does not have to be littered= with #ifdefs.


http://reviews.llvm.org/D11394




_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-c= ommits

--20cf307ac7abd8fc07051bbcade4-- --===============3577491966900114980== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ cfe-commits mailing list cfe-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits --===============3577491966900114980==--