<div dir="ltr">There isn't a flag to do this, but depending on what you need, you can hack clang to get it.<div><br></div><div>Someone else wanted Clang to pass structs directly as LLVM aggregates, but that would definitely be an ABI break:</div>
<div><a href="http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-April/036615.html">http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-April/036615.html</a></div><div><br></div><div>This might be a reasonable lowering, if it works for you:</div>
<div><br></div><div>struct A { int a; int b; };</div><div>void foo(A x) { }</div><div><br></div><div>%struct.A = type { i32, i32 }</div><div>define void @foo(%struct.A* byval %x) {</div><div>  ret void<br>}</div><div><br>
</div><div>Something like this would be easy to implement and might even be ABI compatible with the integral coercion lowering, but I make no guarantees.  You'd change TargetInfo.cpp to return ABIArgInfo::getIndirect(0, /*ByVal=*/true) for every record that is currently expanded or passed directly.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 16, 2014 at 8:55 AM, Zvonimir Rakamaric <span dir="ltr"><<a href="mailto:zvonimir@cs.utah.edu" target="_blank">zvonimir@cs.utah.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In particular, I would for example like to prevent that two fields of<br>
type i32 are packed into an i64 parameter. And so on...<br>
<br>
Thanks!<br>
-- Zvonimir<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</blockquote></div><br></div>