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
Hi Harel Cain,
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?
try the getIntPtrType method defined in TargetData. It is defined in TargetData
because you need to know the target in order to know the size of a pointer.
Ciao, Duncan.
hi,
You may try TargetData's "getIntPtrType" for intptr_t.
best regards
ether