From 1646ec54dc898fd8e92108b63e6f2e7d0f5991b2 Mon Sep 17 00:00:00 2001 From: Mohit Mishra Date: Sun, 11 Oct 2026 00:13:59 +0530 Subject: [PATCH] Move the prototype instantiation IL documentation to ALL_TEMPLATE_INFO_IN_IL. [GH #81] --- src/host_envir.h | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/src/host_envir.h b/src/host_envir.h index 9d850c3557..fae9c969d4 100644 --- a/src/host_envir.h +++ b/src/host_envir.h @@ -725,12 +725,22 @@ slower. #endif /* IL_SHOULD_BE_WRITTEN_TO_FILE */ /* -When this flag is TRUE, any prototype instantiations of function definitions -that are done are included in the IL. When the flag is FALSE, prototype -instantiations of function definitions may or may not be done, depending -on other modes, but the definition generated (if any) will not be included -in the IL. If PROTOTYPE_INSTANTIATIONS_IN_IL is already defined, use that -as the basis of the value for this flag. +A prototype instantiation results from parsing and analyzing a template +without substituting actual template argument entities for the formal +parameters. This flag should be set to TRUE if such structured but abstract +representations should be recorded in the IL. (It is typically not needed +for direct code generation.) When this flag is TRUE, any prototype +instantiations of function definitions that are done are included in the IL. +When the flag is FALSE, prototype instantiations of function definitions may +or may not be done, depending on other modes, but the definition generated +(if any) will not be included in the IL. It is the default value of the +variable all_template_info_in_il, except when doing IL lowering, where that +variable is set from prototype_instantiations_in_il instead. Note that +prototype instantiations cannot be generated when doing IL lowering. + +This flag replaces the legacy macro PROTOTYPE_INSTANTIATIONS_IN_IL. If +PROTOTYPE_INSTANTIATIONS_IN_IL is already defined, use that as the basis of +the value for this flag; otherwise, the default is FALSE. */ #ifndef ALL_TEMPLATE_INFO_IN_IL #ifdef PROTOTYPE_INSTANTIATIONS_IN_IL @@ -745,13 +755,13 @@ as the basis of the value for this flag. #endif /* ifndef ALL_TEMPLATE_INFO_IN_IL */ /* -A prototype instantiation results from parsing and analyzing a template -without substituting actual template argument entities for the formal -parameters. This flag should be set to TRUE if such structured but abstract -representations should be recorded in the IL. (It is typically not needed -for direct code generation.) It is the default value of the variable -prototype_instantiations_in_il. Note that prototype instantiations cannot -be generated when doing IL lowering. +PROTOTYPE_INSTANTIATIONS_IN_IL is the legacy macro for recording prototype +instantiations in the IL; see ALL_TEMPLATE_INFO_IN_IL above, which is the +current macro. If PROTOTYPE_INSTANTIATIONS_IN_IL is defined before +ALL_TEMPLATE_INFO_IN_IL is set, its value becomes the default for +ALL_TEMPLATE_INFO_IN_IL. The default of TRUE supplied here does not affect +ALL_TEMPLATE_INFO_IN_IL, which has already been set. This macro is the +default value of the variable prototype_instantiations_in_il. This flag must now be set to TRUE. The flag and the tests that use it will be removed at some point.