[nem-pl] Crossreferencing
"Paweł W. Olszta"
pawel.olszta at adv.pl
Thu Jun 24 14:35:59 CEST 2004
<quote>
> Is there a cross-referencing tool for Standard ML available to help
> you find out which variables are used where?
MLton has a command line option that will cause def-use information to
be saved to a file. For example,
mlton -show-def-use foo.du foo.sml
will cause def-use information for foo.sml to be written to foo.du.
You might also be interested in MLton's -warn-unused flag, which
prints a warning for unused variables.
</quote>
Interesujące. Wypisuje coś w tym stylu:
structure matching_over_integers_sml matching_over_integers_sml.sml 2.11
matching_over_integers_sml.sml 424.9
variable method_a matching_over_integers_sml.sml 5.7
matching_over_integers_sml.sml 413.17
variable parm matching_over_integers_sml.sml 5.16
matching_over_integers_sml.sml 6.10
matching_over_integers_sml.sml 407.14
variable run_method_a matching_over_integers_sml.sml 410.7
matching_over_integers_sml.sml 417.14
matching_over_integers_sml.sml 420.17
Z tego co pamiętam, to w tej chwili nie zbieramy informacji o użyciach
zadeklarowanych zmiennych/pól/metod. Dorobienie flagi-znacznika użycia
nie będzie dużo kosztowało, pytanie jednak o trzymanie pełnej listy użyć
(jak wyżej) -- ile to ma sensu?
Przychodzi mi do głowy tylko użycie w optymalizacjach (inlining, zamiana
zmiennej lokalnej na push/pop, współdzielenie pamięci, etc.)
--
"Any sufficiently complicated C or Fortran program contains
an ad hoc informally-specified bug-ridden slow implementation
of half of Common Lisp." -- Philip Greenspun
More information about the devel-pl
mailing list