<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Nov 2, 2011, at 2:33 PM, Jan Voung wrote:</div><blockquote type="cite"><div><span style="background-color:rgb(255, 255, 255);font-family:arial, helvetica, sans-serif">re: passing c++ objects with copy constructors/destructors, there are multiple ABIs for doing this (e.g., the gcc way, msvc way).</span></div></blockquote><div><br></div><div>There are?  How does MSVC do it that's not just passing a pointer to a temporary?  Is the callee responsible for copying into a temporary or something?  I can't imagine how that would work.</div><br><blockquote type="cite"><div><span style="background-color:rgb(255, 255, 255);font-family:arial, helvetica, sans-serif"> </span><span style="background-color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; ">Is there a reason that the</span><span style="background-color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; "> DefaultABIInfo's classifyArgumentType doesn't match either of the existing ABIs? It both makes a temp copy the gcc way, AND marks pointers as "byval". All of the </span><span style="background-color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; ">other ABIs (x86, arm, mips) which would check and do:</span></div>


<div><span style="background-color:rgb(255, 255, 255);font-family:arial, helvetica, sans-serif"><br></span></div><div><span style="background-color:rgb(255, 255, 255);font-family:arial, helvetica, sans-serif"><div>    if (isRecordWithNonTrivialDestructorOrCopyConstructor(Ty))</div>


<div>      return ABIArgInfo::getIndirect(0, /*ByVal=*/false);</div><div><br></div><div>to only have one temp copy. So, should the default not mark "byval"?</div></span></div></blockquote><div><br></div>Yes, you're right, the default should not mark byval.</div><div><br></div><div>John.</div></body></html>