DeclarationNameTable currently hold 3 void * to
FoldingSet<CXXSpecialName>, FoldingSet<CXXLiteralOperatorIdName>
and FoldingSet<CXXDeductionGuideNameExtra>.
CXXSpecialName, CXXLiteralOperatorIdName and
CXXDeductionGuideNameExtra are private classes holding extra
information about a "special" declaration name and are in the DeclarationName.cpp
The original intent seems to have been to keep these class private and only expose
DeclarationNameExtra and DeclarationName (the code dates from 2008 and
has not been significantly changed since).
However this make the code less straightforward than necessary because of
the need to have void* in DeclarationNameTable (with 1 of 3 comments wrong)
and to manually allocate/deallocate the FoldingSets.
Moreover removing the extra indirections reduce the run-time of an fsyntax-only on
all of Boost by 2.3% which is not totally unexpected given how frequently this
data structure is used.
Comments:
- For now I just moved the classes which were in DeclarationName.cpp to DeclarationName.h. We could find a way to hide them if desired, eg by stuffing them into a namespace detail or something...
- This requires including Type.h...