Union oddity

This crashes. I'm not sure what's going on...

// RUN: clang -emit-llvm %s

typedef union { int i; int *j; } value;

int get_value(value v) {
  return *v.j;
}

Hi,

Patch attached:

The IsUnion function of Type wasn't ignoring the typedef as stated in the
header. The codegen wasn't seeing an union didn't include the necessary
bitcast.

In passing, I also corrected the IsStruct function.

IsUnionTypedef.patch (684 Bytes)

Thanks a lot! Now applied:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20071126/003120.html