Re: Doing without GCC's statement-blocks-as-expressions extension

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ian Lance Taylor wrote:
Since you are generating C code, you control the horizontal and the
vertical. Count the number of virtual calls you have, and emit struct object_header *__my_private_temp_1;
    struct object_header *__my_private_temp_2;
    ...
at the start of the C function.   Then for each virtual call do
    (__my_private_temp_N = objectexpression,
     ((int(*)(struct object_header *, int))
      (temp->vmt[VMTINDEX_MyObject_square))(__my_private_temp_N, 5)))
replacing N with the index of the call.

Ah, of course! That will make the code a lot nicer than what I was thinking.

Thanks!

Nicholas Sherlock


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux