[LLVMdev] type-system-rewrite branch landing tomorrow

Chris Lattner clattner at apple.com
Sat Jul 9 17:22:18 PDT 2011


On Jul 9, 2011, at 2:38 PM, Nick Lewycky wrote:

> 
> Here's a subset of that problem. This C program:
> 
>  struct S;
>  struct T {
>    struct S *s;
>  } t;
>  struct S { int i; };
> 
> produces IR with the definition of both %struct.S and %struct.T. This program however:
> 
>  struct S;
>  struct T {
>    struct S (*p)(void);
>  } t;
>  struct S { int i; };
> 
> outputs a "%struct.T = type { {}* }" with no mention of struct S (or for that matter, the fact it's a function!)

This is by-design.  Also, the LLVM asmprinter only ever prints out types that are referenced by the module (just like we do for metadata) so if you remove the last use of a type, the type won't be printed.

This is why the DeadTypeElimination pass is obsolete and gone.

-Chris



More information about the llvm-dev mailing list