[LLVMdev] How to create an IntegerType of the native word size

ether zhhb etherzhhb at gmail.com
Mon Jan 24 02:25:19 PST 2011


hi,

You may try TargetData's "getIntPtrType" for intptr_t.

best regards
ether

On Mon, Jan 24, 2011 at 5:56 PM, Harel Cain <harel.cain at gmail.com> wrote:
> Hi all,
>
> I couldn't find any reasonable way to create the IntegerType that would
> match, say, intptr_t, that is the native word size of the machine I'm
> building on. More accurately defined, when compiling on a 64 bit Mac OS
> machine I want it to be Int64Ty, but if for example I'm using the "-arch
> i386" command line option on that machine during compilation, I want it to
> be Int32Ty.
>
> I'm sure that has to be some perfect solution out there, does anyone know?
>
>
> Thanks!
>
> Harel Cain
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>




More information about the llvm-dev mailing list