D-Programming-GDC/GDC — pull request #54 by jpf91 (2013-03-02 09:12:33+00:00)
Title: Make sure type variants are set correctly

For some types (structs, classes) addTypeModifiers wasn't called
and therefore TYPE_MAIN_VARIANT wasn't set up. So the backend
thought it handled two different types if a variant was
encountered. This prevented inlining in some cases.

Also refactor the toCtype functions so the the main logic
is only executed for the main variant. Other variants
just get the main variant Ctype and use addTypeModifiers
to obtain the final type.

This fixes the inlining problem recently mentioned on the newsgroup:
http://gdcproject.org/bugzilla/show_bug.cgi?id=37

The diff looks quite scary but it's mostly indentation changes.