<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Apr 21, 2014 at 1:33 PM, Matthew O'Connor <span dir="ltr"><<a href="mailto:thegreendragon@gmail.com" target="_blank">thegreendragon@gmail.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div><div>1. Is there a way to force Clang to respect a struct being passed by value in the source (either as arguments or the return value from a function) and not converted to pointers in & out?<br>
<br></div><div>I think, roughly, what I want is to be able to "disable" Clang's use of ABIArgInfo's Kind's Indirect & Expand.</div></div></div></div></div></blockquote><div><br></div><div>What exactly do you want clang to do?  Do you want it to pass the value as an LLVM first class aggregate, or to use a pointer with the byval attribute?</div>
<div><br></div><div>Either way, there is no flag to do this.  You would have to modify Clang.</div><div><br></div><div>First, this would break all C++, which may not matter to you.</div><div><br></div><div>Second, your code would probably be ABI incompatible with all other code.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div>2. Is there a way to make Clang only perform aligned loads & stores?<br>
</div></div></div></div></blockquote><div><br></div><div>Are you asking if it's possible to force the alignment of loads and stores up to the natural alignment of the storage type?  Clang will already add alignment annotations to loads and stores as required by the language.  It only leaves them off in cases where it knows the alignment is lost, like packed structs or explicitly underaligned types. </div>
</div></div></div>