Closed toelli-msft closed 2 years ago
For example, the following only emits defs which are needed (transitively) by main () (you can also provide multiple roots):
main ()
ksc --compile-and-run \ --ks-source-file src/runtime/prelude.ks \ --ks-source-file test/ksc/$SOURCE.ks \ --ks-output-file obj/test/ksc/$SOURCE.kso \ --cpp-include prelude.h \ --cpp-output-file obj/test/ksc/$SOURCE.cpp \ --remove-unused --used '[main (Tuple)]' \ --c++ g++ \ --exe-output-file obj/test/ksc/$SOURCE.exe 2>&1 | tee /tmp/out
To get the old behaviour use all-defs
all-defs
ksc --compile-and-run \ --ks-source-file src/runtime/prelude.ks \ --ks-source-file test/ksc/$SOURCE.ks \ --ks-output-file obj/test/ksc/$SOURCE.kso \ --cpp-include prelude.h \ --cpp-output-file obj/test/ksc/$SOURCE.cpp \ --all-defs \ --c++ g++ \ --exe-output-file obj/test/ksc/$SOURCE.exe 2>&1 | tee /tmp/out
gmm.cpp goes from 4817 lines to 3093 lines. ex0.cpp goes from 1588 lines to 18 lines!
gmm.cpp
ex0.cpp
For example, the following only emits defs which are needed (transitively) by
main ()
(you can also provide multiple roots):To get the old behaviour use
all-defs