Here’s the 2nd part of the previous PCH patch for (some) C++ declarations. This patch only really adds support for CXXRecordDecl, CXXBaseClassSpecifier, and (partial support) CXXBaseOrMemberInitializer. Just a couple of notes:
This re-enables a previously disabled check in the namespace tests (which passes nicely)
I renamed an existing method CXXRecordDecl::setUserDeclaredDestructor to setHasUserDeclaredDestructor to be consistent with other setHasTrivial… methods. The only place this was called is SemaDecl.cpp.
I modified all of the member function documentation of most of the accessor/mutators I looked at to use \brief instead of “FunctionName - …”. Current comment formatting is inconsistent, so I chose this style. It seems less redundant.
CXXBaseOrMemberSpecializer seems like it might need some attention. It looks like it acquired some functionality for C99 designated initializers, which I had to look up That feature makes the class decidedly not CXX specific. Also, I think that there may be some redundancy in the storing of source locations between the BaseInitializer component and the MemberInitializer component. Basically, the class is starting to seem a little “unclean”. One solution might be to refactor the class as a union of 3 others: CXXBaseInitializer, CXXMemberInitializer, and DesignatedInitializer.
As it stands, I haven’t implemented PCH support for the DesignatedInitializer component of the class.
Also, this patch does /not/ (yet) add full support for methods, ctors, dtors, or conversion operators. I’ll try to send that upstream next after this is reviewed and eventually committed. Let me know if I need to add or remove anything prior to committing.
pch-classes.patch (25.6 KB)