<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:efriedma@quicinc.com" title="Eli Friedman <efriedma@quicinc.com>"> <span class="fn">Eli Friedman</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WONTFIX - Struct return does not match Windows X64 stack convention."
   href="https://bugs.llvm.org/show_bug.cgi?id=43208">bug 43208</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;">CC</td>
           <td>
                
           </td>
           <td>efriedma@quicinc.com
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>WONTFIX
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WONTFIX - Struct return does not match Windows X64 stack convention."
   href="https://bugs.llvm.org/show_bug.cgi?id=43208#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WONTFIX - Struct return does not match Windows X64 stack convention."
   href="https://bugs.llvm.org/show_bug.cgi?id=43208">bug 43208</a>
              from <span class="vcard"><a class="email" href="mailto:efriedma@quicinc.com" title="Eli Friedman <efriedma@quicinc.com>"> <span class="fn">Eli Friedman</span></a>
</span></b>
        <pre>Yes, this is handled in clang.

In general, LLVM IR does not contain enough information about C structs to
compute the C calling convention correctly; we can't even distinguish whether
an LLVM IR struct type was originally a C struct.  Therefore, LLVM IR's
handling of struct type in the calling convention is intentionally simplified:
LLVM IR structs are always passed and returned in registers, as long as enough
registers are available.

The only supported way to lower a C calling convention call involving a
class/struct/union/complex type is to use clang's IR generation API, or
implement equivalent code yourself.  There's been some discussion in the past
of providing an API for non-clang frontends that's more convenient, but nothing
has been implemented.  You should be able to find some discussion in the
mailing list archive. (If you have trouble finding it, ask, and I'll try to dig
it up.)</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>