[m-rev.] for post-commit review: --show-movability
Julien Fischer
jfischer at opturion.com
Sun Oct 1 20:59:49 AEDT 2023
On Sun, 1 Oct 2023, Zoltan Somogyi wrote:
> I am seeking opinions on the name of the new option,
> which generates reports such as the ones attached,
> and on its documentation. Once we have consensus
> on that, I will update doc/reference_manual.texi,
> and also NEWS.md if people think this is a good idea.
I think that is a good idea.
> Add a new option --show-movability.
Perhaps, --show-pred-movability.
...
> diff --git a/compiler/hlds_call_tree.m b/compiler/hlds_call_tree.m
> index 03d360e43..170333c05 100644
> --- a/compiler/hlds_call_tree.m
> +++ b/compiler/hlds_call_tree.m
...
> + ( if set_tree234.is_empty(ConflictExportedPredIdSet) then
> + ConflictExportedPieces = []
> + else
> + ConflictExportedPredPieces = name_set_to_line_pieces(ModuleInfo,
> + ConflictExportedPredIdSet),
> + ConflictExportedPieces =
> + [words("Moving these predicates and/or functions to a new module"),
> + words("would require the new module to import the current module"),
> + words("to get access to")] ++
> + ConflictExportedPredPieces
> + ),
> +
> + MovingPieces =
> + [words("The set of predicates and/or functions reachable from"),
> + words("the proposed-to-be-moved predicates and/or functions,"),
> + words("which should therefore be moved to the new module,"),
> + words("would be")] ++
> + MovingPredPieces,
> +
> + ( if set_tree234.is_empty(MovingStayingPredIdSet) then
> + MovingStayingPieces = []
> + else
> + MovingStayingPredPieces = name_set_to_line_pieces(ModuleInfo,
> + MovingStayingPredIdSet),
> + MovingStayingPieces =
> + [words("However, the following local predicates and/or functions"),
> + words("are reachable both from code being moved and"),
> + words("code that is staying, which means that they would"),
> + words("need to be either duplicated, or, if included in only"),
> + words("one of the two modules, old and new, they would"),
> + words("need to be exported from the module they end up in"),
> + words("to be accessible from the other module."),
> + words("Neither options is usually a good idea.")] ++
s/options/option/
That looks fine otherwise.
Julien.
More information about the reviews
mailing list