[LLVMdev] Porting to System z

Neale Ferguson neale at sinenomine.net
Tue Apr 7 13:43:59 PDT 2009

Yes, that works much better. However, I fear the problem is more to do with
trying to force enums to be a different size which appears not to be
supported by most compilers. The IBM C++ compiler apparently has a #pragma
which can be used to do it and gcc 4.3 seems to be happy with the hack
described but as Duncan says trying to force this behavior in a union is
probably less than desirable in the long term.

Another ugly hack that I tried:

    union {
      uintptr_t V;
#ifdef _LP64
      SimpleValueType SimpleTyU[2];
# define SimpleTy SimpleTyU[1]
      SimpleValueType SimpleTyU[1];
# define SimpleTy SimpleTyU[0]
      const Type *LLVMTy;

This works on my big endian 64-bit system but I've not seen what damage it
may do on other platform types.

On 4/7/09 4:09 PM, "Anton Korobeynikov" <anton at korobeynikov.info> wrote:

> Hello,
>> +static const uintptr_t minus_one = -1;
> -1 here is of signed int type. What if you will use -1ULL ?

More information about the llvm-dev mailing list