So could I just call TD->setAlignment() and comment out the assert (as I'm sure it will assert) to overwrite the ABI alignments? Does this affect the actual ABI permanently or does this only effect it while TD is in scope? <br>
<br>I'd rather not permanently overwrite it, as I use llvm to compile programs for this architecture.<br><br><div class="gmail_quote">On Thu, Mar 22, 2012 at 2:56 PM, Ryan Taylor <span dir="ltr"><<a href="mailto:ryta1203@gmail.com">ryta1203@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Ryan Taylor</b> <span dir="ltr"><<a href="mailto:ryta1203@gmail.com" target="_blank">ryta1203@gmail.com</a>></span><br>
Date: Thu, Mar 22, 2012 at 2:56 PM<br>
Subject: Re: [LLVMdev] Target Data<br>To: Chris Lattner <<a href="mailto:clattner@apple.com" target="_blank">clattner@apple.com</a>><br><br><br>So I read that link yesterday and it says that it uses some default unless they are overridden by the datalayout keyword, which from what I can tell can only be put in an LLVM IR file to be read, is there a way to set this via the API? <br>

<div><div>
<br><div class="gmail_quote">On Thu, Mar 22, 2012 at 2:46 PM, Chris Lattner <span dir="ltr"><<a href="mailto:clattner@apple.com" target="_blank">clattner@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div style="word-wrap:break-word"><br><div><div><div>On Mar 22, 2012, at 2:28 PM, Ryan Taylor wrote:</div><br><blockquote type="cite">I see, thanks. <br><br>However, if I -emit-llvm and then append the "target datalayout" string (then operate on that emitted llvm), I can then change the data type sizes and alignments, correct?<br>


</blockquote><div><br></div></div>If the frontend is making different assumptions than the target data string, then you'll get broken code in a variety of situations.  A trivial example is that sizeof() folds to an integer constant in the frontend.</div>


<span><font color="#888888"><div><br></div><div>-Chris</div></font></span><div><div><br><blockquote type="cite"><br>Thanks.<br>
<br><div class="gmail_quote">On Thu, Mar 22, 2012 at 2:25 PM, Chris Lattner <span dir="ltr"><<a href="mailto:clattner@apple.com" target="_blank">clattner@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div><br>
On Mar 21, 2012, at 5:57 PM, Ryan Taylor wrote:<br>
<br>
> Is it possible to change the widths of types independent of the architecture? Or to reset the widths of types?<br>
><br>
> I haven't seen anything like this. Thanks.<br>
<br>
</div>The datalayout string is required to match the target, if it exists:<br>
<a href="http://llvm.org/docs/LangRef.html#datalayout" target="_blank">http://llvm.org/docs/LangRef.html#datalayout</a><br>
<br>
You can't control it to change how things are laid out.<br>
<span><font color="#888888"><br>
-Chris<br>
<br>
</font></span></blockquote></div><br>
</blockquote></div><br></div></div>
</blockquote></div><br>
</div></div></div><br>
</div></div></blockquote></div><br>