emit: Emit the types for inline structs defined in pointer members

I.e. before:

  $ pfunct --compile /home/acme/git/build/v5.1-rc4+/block/partitions/sgi.o > a.c
    $ gcc -g -c a.c
  a.c:9:3: error: unknown type name ‘sector_t’
     sector_t           from;                 /*     0     8 */
     ^~~~~~~~
  a.c:10:3: error: unknown type name ‘sector_t’
     sector_t           size;                 /*     8     8 */
     ^~~~~~~~
  a.c:13:30: error: field ‘info’ has incomplete type
     struct partition_meta_info info;         /*    21   101 */
                                ^~~~
  $

After:

  $ pfunct --compile /home/acme/git/build/v5.1-rc4+/block/partitions/sgi.o > a.c
  $ gcc -g -c a.c
  $ head -40 a.c
  struct block_device;

  typedef long unsigned int sector_t;

  typedef _Bool bool;

  typedef unsigned char __u8;
  typedef __u8 u8;

  struct partition_meta_info {
  	char                       uuid[37];             /*     0    37 */
  	u8                         volname[64];          /*    37    64 */

  	/* size: 101, cachelines: 2, members: 2 */
  	/* last cacheline: 37 bytes */
  };

  struct parsed_partitions {
  	struct block_device * bdev;                      /*     0     8 */
  	char                       name[32];             /*     8    32 */
  	struct {
  		sector_t           from;                 /*     0     8 */
  		sector_t           size;                 /*     8     8 */
  		int                flags;                /*    16     4 */
  		bool               has_info;             /*    20     1 */
  		struct partition_meta_info info;         /*    21   101 */
  	} * parts; /*    40     8 */
  	int                        next;                 /*    48     4 */
  	int                        limit;                /*    52     4 */
  	bool                       access_beyond_eod;    /*    56     1 */

  	/* XXX 7 bytes hole, try to pack */

  	/* --- cacheline 1 boundary (64 bytes) --- */
  	char *                     pp_buf;               /*    64     8 */

  	/* size: 72, cachelines: 2, members: 7 */
  	/* sum members: 65, holes: 1, sum holes: 7 */
  	/* last cacheline: 8 bytes */
  };
  $

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 file changed