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;


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

In passing, I also corrected the IsStruct function.

IsUnionTypedef.patch (684 Bytes)

Thanks a lot! Now applied: