MWCC C++ ABI
This documentation aims to explain how MWCC for PowerPC(the main compiler used for the Nintendo GameCube and Wii) does object layout and RTTI for C++ classes. We'll be using the Itanium C++ ABI as a point of comparison to discuss where MWCC made interesting/different implementation decisions.
The overarching design philosophy of the two is wildly different: where Itanium tries to keep polymorphic object sizes as small as possible, emitting any static lookup tables necessary to achieve this, MWCC goes for the opposite approach and will gladly increase the complexity of special member functions or put extra data in runtime objects if it means a simpler(and smaller) data structure to emit at compile time, thus keeping code size low. It is clearly designed for environments where storage space is at a premium, but RAM usage isn't as much of a concern when polymorphic objects are in use.
This document has been heavily inspired by write-ups done on GCC/Itanium ABI in the past, most notably Moyang Wang's VTable Notes(and I'll be using plenty of examples lifted from this write-up as my own). Feel free to use this to get a refresher on Itanium's VTable layouts, as I'll mostly be highlighting the differences here. If you want the full details, there's always the Itanium ABI spec for you to peruse.