[cfe-dev] Union oddity

Cédric Venet cedric.venet at student.ecp.fr
Sun Dec 2 08:23:57 PST 2007


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.

-- 
Cédric Venet


> -----Message d'origine-----
> De : cfe-dev-bounces at cs.uiuc.edu [mailto:cfe-dev-bounces at cs.uiuc.edu]
> De la part de Sanghyeon Seo
> Envoyé : dimanche 2 décembre 2007 15:34
> À : cfe-dev at cs.uiuc.edu
> Objet : [cfe-dev] 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;
> }
> 
> --
> Seo Sanghyeon
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: IsUnionTypedef.patch
Type: application/octet-stream
Size: 679 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20071202/0e922204/attachment.obj>


More information about the cfe-dev mailing list