[comp.lang.c++] eliminating redundant virtual function tables

forsyth@minster.york.ac.uk (03/29/89)

I found +e0 and +e1 unsatisfactory.  I considered adding +e<name>, but
that seemed equally clumsy.  Eventually, I realised that the virtual
function table name was used only by the constructor.  I changed
several parts of cfront (mainly simpl.c and print.c) to generate the
virtual function table only when the constructor body was generated.
Of course, declaring an inline constructor causes the table to be
generated more than once, but at least now control over this is per
class and linked to the declaration of the class in an obvious way;
it also agrees with the gain of speed at the expense of space
that one often sees with inline functions (and the original scheme
would have generated the table anyway).

The change made it practical to replace our C graphics library by
a C++ one.  Previously C++ programs were often much larger than the C ones,
because of the many copies of the function tables.  Now they are
smaller (because more code is now common to all Popups, for instance).

I should prefer not to distribute diffs, unless cfront 2.0 will not be
available for some time, since we have a shamefully old version of the
translator (1.1).  Perhaps version 2.0 will make this change.  If not,
I shall prepare diffs for 2.0 when we get it.

ukc!minster!forsyth
forsyth@minster.york.ac.uk