https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70201
--- Comment #4 from Andrés Agustín Tiraboschi <andres.tiraboschi at tallertechnologies dot com> --- Created attachment 38139 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38139&action=edit Patch adding new flag in order to dump information about template instantiations. Hi, the attached patch adds a new compilation flag 'ftemplate-instantiations' in order to allow dumping debug information for template instantiations. This flag has 2 possible values: none(by default) and hreadable, that prints wich templates instantiations had been made in a human readable way. This patch was also made in order to add options easily and to interarct with plugins. For example in a plugin can be defined a derived class for template_instantiations_callbacks implementing _function_instantiation, _class_instantiation, _using_instantiation and then using add_template_instantiations_callbacks in order to access information about wich template instantiations had been made. This is an updated version. Changelog 2016-03-29 Andres Tiraboschi <andres.tirabos...@tallertechnologies.com> * gcc/c-family/c.opt (ftemplate-instantiations): New flag. * gcc/flag-types.h (ti_dump_options): New type. * gcc/cp/decl2.c (cp_write_global_declarations): Added code to dump information. * gcc/cp/cp-tree.h (template_instantiations_callbacks): New type. (call_template_instantiation_callbacks): Declare. (add_template_instantiations_callbacks): Likewise. (clean_up_callbacks): Likewise. * gcc/cp/pt.c (human_readable_template_instantiations): New type. (instantiation_callbacks): Declare. (call_template_instantiation_callback): New function. (call_template_instantiation_callbacks): Likewise. (add_template_instantiations_callbacks): Likewise. (initialize_instantiations_callbacks): Likewise. (clean_up_callbacks): Likewise. (init_template_processing): Added code to initialize instatiation_callbacks. (register_specialization): Added code to dump information. * gcc/doc/invoke.texi (ftemplate-instantiations): Added documentation. Thanks.