summaryrefslogtreecommitdiff
path: root/toplevel
diff options
context:
space:
mode:
authorFlorian Angeletti <florian.angeletti@inria.fr>2022-01-20 10:55:58 +0100
committeroctachron <octa@polychoron.fr>2022-01-20 12:51:27 +0100
commit3aaa9a7cf52b6980a850bfafde724157a783b98d (patch)
tree22f1c2814af835a42fabd4ce64e1823fd0ecc04d /toplevel
parentade6577539477d165bb4cf1cf7186031d54ba188 (diff)
downloadocaml-3aaa9a7cf52b6980a850bfafde724157a783b98d.tar.gz
Merge pull request #10825 from gasche/shape-strong-call-by-need
Shapes: a strong-call-by-need evaluator (cherry picked from commit 7705e920648cb9ee4879e832da942fae45230f6d)
Diffstat (limited to 'toplevel')
-rw-r--r--toplevel/byte/topeval.ml3
-rw-r--r--toplevel/native/topeval.ml3
2 files changed, 4 insertions, 2 deletions
diff --git a/toplevel/byte/topeval.ml b/toplevel/byte/topeval.ml
index 8058ca0908..d3c07574b5 100644
--- a/toplevel/byte/topeval.ml
+++ b/toplevel/byte/topeval.ml
@@ -120,10 +120,11 @@ let execute_phrase print_outcome ppf phr =
Typemod.type_toplevel_phrase oldenv sstr
in
if !Clflags.dump_typedtree then Printtyped.implementation ppf str;
- if !Clflags.dump_shape then Shape.print ppf shape;
let sg' = Typemod.Signature_names.simplify newenv sn sg in
ignore (Includemod.signatures ~mark:Mark_positive oldenv sg sg');
Typecore.force_delayed_checks ();
+ let shape = Shape.local_reduce shape in
+ if !Clflags.dump_shape then Shape.print ppf shape;
let lam = Translmod.transl_toplevel_definition str in
Warnings.check_fatal ();
begin try
diff --git a/toplevel/native/topeval.ml b/toplevel/native/topeval.ml
index 7ad4ef9edd..ff56c27953 100644
--- a/toplevel/native/topeval.ml
+++ b/toplevel/native/topeval.ml
@@ -165,10 +165,11 @@ let execute_phrase print_outcome ppf phr =
Typemod.type_toplevel_phrase oldenv sstr
in
if !Clflags.dump_typedtree then Printtyped.implementation ppf str;
- if !Clflags.dump_shape then Shape.print ppf shape;
let sg' = Typemod.Signature_names.simplify newenv names sg in
ignore (Includemod.signatures oldenv ~mark:Mark_positive sg sg');
Typecore.force_delayed_checks ();
+ let shape = Shape.local_reduce shape in
+ if !Clflags.dump_shape then Shape.print ppf shape;
(* `let _ = <expression>` or even just `<expression>` require special
handling in toplevels, or nothing is displayed. In bytecode, the
lambda for <expression> is directly executed and the result _is_ the