From a207250f9fa6d061c26a58c96388d6e73d1009da Mon Sep 17 00:00:00 2001 From: Mark Shinwell Date: Thu, 11 Nov 2021 13:40:52 +0000 Subject: [PATCH] Compile more stdlib files with -O3 (#380) --- ocaml/stdlib/camlinternalAtomic.ml | 2 ++ ocaml/stdlib/either.ml | 2 ++ ocaml/stdlib/stdlib.ml | 1 + ocaml/testsuite/tests/backtrace/pr2195-locs.byte.reference | 2 +- ocaml/testsuite/tests/backtrace/pr2195.opt.reference | 4 ++-- .../tests/lib-dynlink-initializers/test10_main.byte.reference | 2 +- .../lib-dynlink-initializers/test10_main.native.reference | 2 +- 7 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ocaml/stdlib/camlinternalAtomic.ml b/ocaml/stdlib/camlinternalAtomic.ml index b7e74a53fae..a6425580548 100644 --- a/ocaml/stdlib/camlinternalAtomic.ml +++ b/ocaml/stdlib/camlinternalAtomic.ml @@ -13,6 +13,8 @@ (* *) (**************************************************************************) +[@@@ocaml.flambda_o3] + (* CamlinternalAtomic is a dependency of Stdlib, so it is compiled with -nopervasives. *) external ( == ) : 'a -> 'a -> bool = "%eq" diff --git a/ocaml/stdlib/either.ml b/ocaml/stdlib/either.ml index 9ea2f8935bc..4c9f20e316f 100644 --- a/ocaml/stdlib/either.ml +++ b/ocaml/stdlib/either.ml @@ -13,6 +13,8 @@ (* *) (**************************************************************************) +[@@@ocaml.flambda_o3] + type ('a, 'b) t = Left of 'a | Right of 'b let left v = Left v diff --git a/ocaml/stdlib/stdlib.ml b/ocaml/stdlib/stdlib.ml index c6de7f4d26d..bf24d69b2ee 100644 --- a/ocaml/stdlib/stdlib.ml +++ b/ocaml/stdlib/stdlib.ml @@ -15,6 +15,7 @@ (**************************************************************************) [@@@ocaml.warning "-49"] +[@@@ocaml.flambda_o3] (* Exceptions *) diff --git a/ocaml/testsuite/tests/backtrace/pr2195-locs.byte.reference b/ocaml/testsuite/tests/backtrace/pr2195-locs.byte.reference index 33f83c63058..a5a4610d19b 100644 --- a/ocaml/testsuite/tests/backtrace/pr2195-locs.byte.reference +++ b/ocaml/testsuite/tests/backtrace/pr2195-locs.byte.reference @@ -1,4 +1,4 @@ Fatal error: exception Stdlib.Exit -Raised by primitive operation at Stdlib.open_in_gen in file "stdlib.ml", line 401, characters 28-54 +Raised by primitive operation at Stdlib.open_in_gen in file "stdlib.ml", line 402, characters 28-54 Called from Pr2195 in file "pr2195.ml", line 24, characters 6-19 Re-raised at Pr2195 in file "pr2195.ml", line 29, characters 4-41 diff --git a/ocaml/testsuite/tests/backtrace/pr2195.opt.reference b/ocaml/testsuite/tests/backtrace/pr2195.opt.reference index 377a4bdd51b..a3e20811d06 100644 --- a/ocaml/testsuite/tests/backtrace/pr2195.opt.reference +++ b/ocaml/testsuite/tests/backtrace/pr2195.opt.reference @@ -1,5 +1,5 @@ Fatal error: exception Stdlib.Exit -Raised by primitive operation at Stdlib.open_in_gen in file "stdlib.ml", line 401, characters 28-54 -Called from Stdlib.open_in in file "stdlib.ml" (inlined), line 406, characters 2-45 +Raised by primitive operation at Stdlib.open_in_gen in file "stdlib.ml", line 402, characters 28-54 +Called from Stdlib.open_in in file "stdlib.ml" (inlined), line 407, characters 2-45 Called from Pr2195 in file "pr2195.ml", line 24, characters 6-19 Re-raised at Pr2195 in file "pr2195.ml", line 29, characters 4-41 diff --git a/ocaml/testsuite/tests/lib-dynlink-initializers/test10_main.byte.reference b/ocaml/testsuite/tests/lib-dynlink-initializers/test10_main.byte.reference index 9c89d6094e7..6aa44e7368d 100755 --- a/ocaml/testsuite/tests/lib-dynlink-initializers/test10_main.byte.reference +++ b/ocaml/testsuite/tests/lib-dynlink-initializers/test10_main.byte.reference @@ -1,5 +1,5 @@ Error: Failure("Plugin error") -Raised at Stdlib.failwith in file "stdlib.ml", line 31, characters 17-33 +Raised at Stdlib.failwith in file "stdlib.ml", line 32, characters 17-33 Called from Test10_plugin.g in file "test10_plugin.ml", line 3, characters 2-21 Called from Test10_plugin.f in file "test10_plugin.ml", line 6, characters 2-6 Called from Test10_plugin in file "test10_plugin.ml", line 10, characters 2-6 diff --git a/ocaml/testsuite/tests/lib-dynlink-initializers/test10_main.native.reference b/ocaml/testsuite/tests/lib-dynlink-initializers/test10_main.native.reference index 2b33a516f90..d7d54bb0604 100755 --- a/ocaml/testsuite/tests/lib-dynlink-initializers/test10_main.native.reference +++ b/ocaml/testsuite/tests/lib-dynlink-initializers/test10_main.native.reference @@ -1,5 +1,5 @@ Error: Failure("Plugin error") -Raised at Stdlib.failwith in file "stdlib.ml", line 31, characters 17-33 +Raised at Stdlib.failwith in file "stdlib.ml", line 32, characters 17-33 Called from Test10_plugin.g in file "test10_plugin.ml", line 2, characters 15-38 Called from Test10_plugin in file "test10_plugin.ml", line 10, characters 2-6 Called from Dynlink.Native.run.(fun) in file "otherlibs/dynlink/dynlink.ml", line 250, characters 12-29