[LLVMdev] Fwd: Target Data

Ryan Taylor ryta1203 at gmail.com
Thu Mar 22 14:56:33 PDT 2012


---------- Forwarded message ----------
From: Ryan Taylor <ryta1203 at gmail.com>
Date: Thu, Mar 22, 2012 at 2:56 PM
Subject: Re: [LLVMdev] Target Data
To: Chris Lattner <clattner at apple.com>


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?

On Thu, Mar 22, 2012 at 2:46 PM, Chris Lattner <clattner at apple.com> wrote:

>
> On Mar 22, 2012, at 2:28 PM, Ryan Taylor wrote:
>
> I see, thanks.
>
> 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?
>
>
> 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.
>
> -Chris
>
>
> Thanks.
>
> On Thu, Mar 22, 2012 at 2:25 PM, Chris Lattner <clattner at apple.com> wrote:
>
>>
>> On Mar 21, 2012, at 5:57 PM, Ryan Taylor wrote:
>>
>> > Is it possible to change the widths of types independent of the
>> architecture? Or to reset the widths of types?
>> >
>> > I haven't seen anything like this. Thanks.
>>
>> The datalayout string is required to match the target, if it exists:
>> http://llvm.org/docs/LangRef.html#datalayout
>>
>> You can't control it to change how things are laid out.
>>
>> -Chris
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120322/045e3518/attachment.html>


More information about the llvm-dev mailing list