AST: Splitting MangleContext?


AST/MangleContext is becoming increasingly ABI-aware and less "pure"
over time, e.g. now it has notions of VTTs, VFTables, VBTables,
ItaniumThreadLocalWrapper etc.
ABI-specific implementations like ItaniumMangleContext and
MicrosoftMangleContext are privately defined in their own TUs.

I think it's time to split the MangleContext interface and expose the
ABI-specific methods in public ItaniumMangleContext and
MicrosoftMangleContext interfaces.

Probably a way to go is to
a) rename old {Itanium,Microsoft}MangleContext to
b) define new {Itanium,Microsoft}MangleContext interfaces in
AST/Mangle.h, inheriting from MangleContext
c) Move the ABI-specific virtual method declarations to the respective
d) Inherit {Itanium,Microsoft}MangleContextImpl from
e) Make create{Itanium,Microsoft}MangleContext static methods of

Are there any objections or suggestions?

I think this is the right way to go.


I was thinking along the same lines, but why do you need *Impl classes?

Oh, presumably to keep the data members out of the header?

Yes, exactly.