From 11115747b4f92b265e3e6d47cc7823cd8c825f15 Mon Sep 17 00:00:00 2001 From: Nikos Gorogiannis Date: Mon, 2 Dec 2024 06:54:31 -0800 Subject: [PATCH] [ocaml] 5.2.1 Summary: Upgrade to OCaml 5.2.1. Reviewed By: jvillard Differential Revision: D66591244 Privacy Context Container: L1208441 fbshipit-source-id: 242cf47e4fc7a672579220f42a5bc8cdb6114798 --- build-infer.sh | 8 +- dependencies/ocamldot/ocamldot.mll | 6 +- infer/src/dune.common.in | 2 + infer/src/dune.in | 8 +- infer/src/linking-flags.sexp | 8 +- infer/src/python/unit/PyIRTest.ml | 4 +- infer/src/python/unit/PyIRTestBasic.ml | 9 +- infer/src/python/unit/PyIRTestMatch.ml | 470 +++++++++++----------- infer/src/python/unit/PyIRTestVariadic.ml | 8 +- opam/infer-tests.opam.locked | 40 +- opam/infer.opam | 2 +- opam/infer.opam.locked | 40 +- opam/ocamlformat.opam.locked | 20 +- 13 files changed, 315 insertions(+), 310 deletions(-) diff --git a/build-infer.sh b/build-infer.sh index 11155b90194..e653ff255af 100755 --- a/build-infer.sh +++ b/build-infer.sh @@ -17,8 +17,8 @@ DEPENDENCIES_DIR="$INFER_ROOT/facebook/dependencies" PLATFORM="$(uname)" SANDCASTLE=${SANDCASTLE:-} NCPU="$(getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1)" -INFER_OPAM_DEFAULT_SWITCH="4.14.0+flambda" -INFER_OPAM_DEFAULT_SWITCH_OPTIONS="--package=ocaml-variants.4.14.0+options,ocaml-option-flambda" +INFER_OPAM_DEFAULT_SWITCH="5.2.1+flambda" +INFER_OPAM_DEFAULT_SWITCH_OPTIONS="--package=ocaml-variants.5.2.1+options,ocaml-option-flambda" INFER_OPAM_SWITCH=${INFER_OPAM_SWITCH:-$INFER_OPAM_DEFAULT_SWITCH} INFER_OPAM_SWITCH_OPTIONS=${INFER_OPAM_SWITCH_OPTIONS:-$INFER_OPAM_DEFAULT_SWITCH_OPTIONS} PLUGIN_DIR="$INFER_ROOT/facebook-clang-plugins" @@ -171,9 +171,7 @@ install_opam_deps () { if [ "$USE_OPAM_LOCK" == yes ]; then locked=.locked fi - if [ -z "$SANDCASTLE" ] ; then - opam pin add --no-action stdcompat "$INFER_ROOT"/dependencies/stdcompat - fi + opam pin add --no-action stdcompat "$INFER_ROOT"/dependencies/stdcompat opam install --deps-only "$INFER_ROOT"/opam/infer.opam$locked } diff --git a/dependencies/ocamldot/ocamldot.mll b/dependencies/ocamldot/ocamldot.mll index 5b1f4b8c697..3772ee2b9a3 100644 --- a/dependencies/ocamldot/ocamldot.mll +++ b/dependencies/ocamldot/ocamldot.mll @@ -24,7 +24,7 @@ rule processSource = parse let i = String.rindex s '.' in let s = String.sub s 0 i in let s = Filename.basename s in - let s = String.capitalize s in + let s = String.capitalize_ascii s in currentSource := s; processTargets lexbuf } | eof @@ -43,7 +43,7 @@ and processTargets = parse let i = String.rindex t '.' in let t = String.sub t 0 i in let t = Filename.basename t in - let t = String.capitalize t in + let t = String.capitalize_ascii t in addDepend t; processTargets lexbuf } | eof @@ -319,7 +319,7 @@ let dir_to_mod_names graph dir = ) StringSet.empty graph in fold_dir (fun dir_to_mod_names path -> let file = Filename.basename path in - let mod_name = String.capitalize (try Filename.chop_extension file with _ -> file) in + let mod_name = String.capitalize_ascii (try Filename.chop_extension file with _ -> file) in if ((Filename.check_suffix file ".ml") && StringSet.mem mod_name nodes) then diff --git a/infer/src/dune.common.in b/infer/src/dune.common.in index 60eab2fafb7..4b37d4b66b0 100644 --- a/infer/src/dune.common.in +++ b/infer/src/dune.common.in @@ -26,3 +26,5 @@ let facebook = is_yes "@IS_FACEBOOK_TREE@" let extra_cflags = if is_empty "@EXTRA_CFLAGS@" then [] else ["@EXTRA_CFLAGS@"] let windows = is_yes "@WINDOWS_BUILD@" + +let darwin = String.equal "@BUILD_PLATFORM@" "Darwin" diff --git a/infer/src/dune.in b/infer/src/dune.in index 5e14b774197..713c6158b88 100644 --- a/infer/src/dune.in +++ b/infer/src/dune.in @@ -38,6 +38,10 @@ let strict_flags = ocamlc_flags @ ["-w"; warnings; "-warn-error"; fatal_warnings] |> String.concat " " +(* OCaml 5.2 on macos with -O3 can lead to compilation failing + https://github.com/ocaml/ocaml/issues/13596 *) +let ocamlopt_flags_val = if darwin then "(:standard -O2)" else "(:standard -O3)" + let env_stanza = Format.sprintf {| @@ -47,13 +51,13 @@ let env_stanza = (inline_tests enabled)) (opt (flags %s) - (ocamlopt_flags (:standard -O3))) + (ocamlopt_flags %s)) (dev-noerror (flags %s) (inline_tests enabled)) ) |} - strict_flags lenient_flags lenient_flags + strict_flags lenient_flags ocamlopt_flags_val lenient_flags (** Put this *first* in (libraries) specifications to prevent a clash between extlib's and base64's diff --git a/infer/src/linking-flags.sexp b/infer/src/linking-flags.sexp index b19290bbe43..65ece074fa7 100644 --- a/infer/src/linking-flags.sexp +++ b/infer/src/linking-flags.sexp @@ -9,7 +9,7 @@ ; 2. Check the dune logs in infer/_build/log. At the very end is the linking command, which ; contains linking directives starting with `-l`, e.g. ; -; '-lcamlstr' '-lzarith' '-lgmp' '-lcamlzip' '-lz' '-lsqlite3_stubs' '-lsqlite3' '-lparmap_stubs' '-lmtime_clock_stubs' '-lrt' '-lfilename_unix_stubs' '-lsys_unix_stubs' '-lcore_unix_stubs' '-lspawn_stubs' '-lsignal_unix_stubs' '-lerror_checking_mutex_stubs' '-lthreadsnat' '-lpthread' '-lANSITerminal_stubs' '-lpyml_stubs' '-lstdcompat_stubs' '-lcore_stubs' '-lheap_block_stubs' '-lbase_bigstring_stubs' '-lunix' '-lexpect_test_collector_stubs' '-ltime_now_stubs' '-lbin_prot_stubs' '-lbase_stubs' '-lbase_internalhash_types_stubs' '/home/nikosg/.opam/4.14.0+flambda/lib/ocaml/libasmrun.a' -lm +; '-lcamlstrnat' '-lcomprmarsh' '-lzarith' '-lgmp' '-lcamlzip' '-lz' '-lsqlite3_stubs' '-lsqlite3' '-lparmap_stubs' '-lmtime_clock_stubs' '-lrt' '-lfilename_unix_stubs' '-lsys_unix_stubs' '-lcore_unix_stubs' '-lspawn_stubs' '-lsignal_unix_stubs' '-lerror_checking_mutex_stubs' '-lthreadsnat' '-lANSITerminal_stubs' '-lpyml_stubs' '-lstdcompat_stubs' '-lunixnat' '-lcore_stubs' '-lheap_block_stubs' '-lbase_bigstring_stubs' '-lexpect_test_collector_stubs' '-ltime_now_stubs' '-lbin_prot_stubs' '-lbase_stubs' '-lbase_internalhash_types_stubs' ; ; 3. Copy those below as follows: Keep the flags the same until the dynamic section after ; `-cclib -Wl,-Bdynamic`. The flags already included are for static libraries; we want to keep @@ -29,12 +29,12 @@ -cclib -Wl,-Bstatic -cclib -lzarith -cclib -lgmp -cclib -lsqlite3_stubs -cclib -lsqlite3 -cclib -Wl,-Bdynamic - -cclib -lcamlzip -cclib -lz -cclib -lpthread -cclib -lparmap_stubs - -cclib -lmtime_clock_stubs -cclib -lrt -cclib -lcamlstr -cclib -lfilename_unix_stubs + -cclib -lcomprmarsh -cclib -lcamlzip -cclib -lz -cclib -lpthread -cclib -lparmap_stubs + -cclib -lmtime_clock_stubs -cclib -lrt -cclib -lcamlstrnat -cclib -lfilename_unix_stubs -cclib -lsys_unix_stubs -cclib -lcore_unix_stubs -cclib -lspawn_stubs -cclib -lsignal_unix_stubs -cclib -lerror_checking_mutex_stubs -cclib -lthreadsnat -cclib -lpthread -cclib -lANSITerminal_stubs -cclib -lpyml_stubs -cclib -lstdcompat_stubs -cclib -lcore_stubs -cclib -lheap_block_stubs -cclib -lbase_bigstring_stubs -cclib -lexpect_test_collector_stubs -cclib -ltime_now_stubs - -cclib -lbin_prot_stubs -cclib -lunix -cclib -lbase_stubs -cclib -lbase_internalhash_types_stubs + -cclib -lbin_prot_stubs -cclib -lunixnat -cclib -lbase_stubs -cclib -lbase_internalhash_types_stubs -cclib -lasmrun -cclib -lm -cclib -ldl ) diff --git a/infer/src/python/unit/PyIRTest.ml b/infer/src/python/unit/PyIRTest.ml index 9b8bbdbd5bd..5d4d18b994f 100644 --- a/infer/src/python/unit/PyIRTest.ml +++ b/infer/src/python/unit/PyIRTest.ml @@ -1336,7 +1336,7 @@ def g(l): in PyIR.test source ; [%expect - {xxx| + {| module dummy: function toplevel(): @@ -1410,7 +1410,7 @@ def g(l): jmp b1 b3: - return $BuildMap() |xxx}] + return $BuildMap() |}] let%expect_test _ = diff --git a/infer/src/python/unit/PyIRTestBasic.ml b/infer/src/python/unit/PyIRTestBasic.ml index 9fc066b3b6d..c78c2330d1b 100644 --- a/infer/src/python/unit/PyIRTestBasic.ml +++ b/infer/src/python/unit/PyIRTestBasic.ml @@ -279,7 +279,7 @@ d = { 0x78: "abc", # 1-n decoding mapping in PyIR.test source ; [%expect - {xxx| + {| module dummy: function toplevel(): @@ -298,7 +298,7 @@ d = { 0x78: "abc", # 1-n decoding mapping n8 <- $Call(n5, n7, None) n9 <- $BuildConstKeyMap($BuildTuple(120, "abc", 1, 121), "abc", 120, None, "", None) TOPLEVEL[d] <- n9 - return None |xxx}] + return None |}] let%expect_test _ = @@ -433,7 +433,7 @@ x = o.f(0, *args1, *args2, **d1, **d2) in PyIR.test source ; [%expect - {xxx| + {| module dummy: function toplevel(): @@ -524,8 +524,7 @@ x = o.f(0, *args1, *args2, **d1, **d2) n70 <- $DictMerge($BuildMap(), n69, None) n71 <- $CallFunctionEx(n61, n66, $BuildMap(), None) TOPLEVEL[x] <- n71 - return None -|xxx}] + return None |}] let%expect_test _ = diff --git a/infer/src/python/unit/PyIRTestMatch.ml b/infer/src/python/unit/PyIRTestMatch.ml index 1181cacd61e..fc0fb435bff 100644 --- a/infer/src/python/unit/PyIRTestMatch.ml +++ b/infer/src/python/unit/PyIRTestMatch.ml @@ -236,101 +236,101 @@ foo(C.BAR, C.BAR) PyIR.test source ; [%expect {| - module dummy: - - function toplevel(): - b0: - n0 <- $MakeFunction["C", "dummy.C", None, None, None, None] - n1 <- $BuildClass(n0, "C", None) - TOPLEVEL[C] <- n1 - n2 <- $MakeFunction["foo", "dummy.foo", None, None, None, None] - TOPLEVEL[foo] <- n2 - n3 <- TOPLEVEL[foo] - n4 <- TOPLEVEL[C] - n5 <- n4.FOO - n6 <- TOPLEVEL[C] - n7 <- n6.FOO - n8 <- $Call(n3, n5, n7, None) - n9 <- TOPLEVEL[foo] - n10 <- TOPLEVEL[C] - n11 <- n10.BAR - n12 <- TOPLEVEL[C] - n13 <- n12.BAR - n14 <- $Call(n9, n11, n13, None) - return None - - - function dummy.C(): - b0: - n0 <- TOPLEVEL[__name__] - TOPLEVEL[__module__] <- n0 - TOPLEVEL[__qualname__] <- "C" - TOPLEVEL[FOO] <- "FOO" - TOPLEVEL[BAR] <- "BAR" - return None - - - function dummy.foo(n, m): - b0: - n0 <- LOCAL[n] - n1 <- LOCAL[m] - if $MatchSequence($BuildTuple(n0, n1)) then jmp b1 else jmp b5( - $BuildTuple(n0, n1)) - - b1: - n2 <- $Compare.eq($GetLen($BuildTuple(n0, n1)), 2, None) - if n2 then jmp b2 else jmp b5($BuildTuple(n0, n1)) - - b10: - n18 <- GLOBAL[print] - n19 <- $Call(n18, "BAR", None) - return None - - b11(n14): - return None - - b12: - return None - - b2: - n3 <- GLOBAL[C] - n4 <- n3.FOO - n5 <- $Compare.eq($BuildTuple(n0, n1)[0], n4, None) - if n5 then jmp b3 else jmp b5($BuildTuple(n0, n1)[1]) - - b3: - n7 <- GLOBAL[C] - n8 <- n7.FOO - n9 <- $Compare.eq($BuildTuple(n0, n1)[1], n8, None) - if n9 then jmp b4 else jmp b6 - - b4: - n20 <- $BuildTuple(n0, n1) - n21 <- GLOBAL[print] - n22 <- $Call(n21, "FOO", None) - return None - - b5(n6): - jmp b6 - - b6: - if $MatchSequence($BuildTuple(n0, n1)) then jmp b7 else jmp b11($BuildTuple(n0, n1)) - - b7: - n10 <- $Compare.eq($GetLen($BuildTuple(n0, n1)), 2, None) - if n10 then jmp b8 else jmp b11($BuildTuple(n0, n1)) - - b8: - n11 <- GLOBAL[C] - n12 <- n11.BAR - n13 <- $Compare.eq($BuildTuple(n0, n1)[0], n12, None) - if n13 then jmp b9 else jmp b11($BuildTuple(n0, n1)[1]) - - b9: - n15 <- GLOBAL[C] - n16 <- n15.BAR - n17 <- $Compare.eq($BuildTuple(n0, n1)[1], n16, None) - if n17 then jmp b10 else jmp b12 |}] + module dummy: + + function toplevel(): + b0: + n0 <- $MakeFunction["C", "dummy.C", None, None, None, None] + n1 <- $BuildClass(n0, "C", None) + TOPLEVEL[C] <- n1 + n2 <- $MakeFunction["foo", "dummy.foo", None, None, None, None] + TOPLEVEL[foo] <- n2 + n3 <- TOPLEVEL[foo] + n4 <- TOPLEVEL[C] + n5 <- n4.FOO + n6 <- TOPLEVEL[C] + n7 <- n6.FOO + n8 <- $Call(n3, n5, n7, None) + n9 <- TOPLEVEL[foo] + n10 <- TOPLEVEL[C] + n11 <- n10.BAR + n12 <- TOPLEVEL[C] + n13 <- n12.BAR + n14 <- $Call(n9, n11, n13, None) + return None + + + function dummy.C(): + b0: + n0 <- TOPLEVEL[__name__] + TOPLEVEL[__module__] <- n0 + TOPLEVEL[__qualname__] <- "C" + TOPLEVEL[FOO] <- "FOO" + TOPLEVEL[BAR] <- "BAR" + return None + + + function dummy.foo(n, m): + b0: + n0 <- LOCAL[n] + n1 <- LOCAL[m] + if $MatchSequence($BuildTuple(n0, n1)) then jmp b1 else jmp b5( + $BuildTuple(n0, n1)) + + b1: + n2 <- $Compare.eq($GetLen($BuildTuple(n0, n1)), 2, None) + if n2 then jmp b2 else jmp b5($BuildTuple(n0, n1)) + + b10: + n18 <- GLOBAL[print] + n19 <- $Call(n18, "BAR", None) + return None + + b11(n14): + return None + + b12: + return None + + b2: + n3 <- GLOBAL[C] + n4 <- n3.FOO + n5 <- $Compare.eq($BuildTuple(n0, n1)[0], n4, None) + if n5 then jmp b3 else jmp b5($BuildTuple(n0, n1)[1]) + + b3: + n7 <- GLOBAL[C] + n8 <- n7.FOO + n9 <- $Compare.eq($BuildTuple(n0, n1)[1], n8, None) + if n9 then jmp b4 else jmp b6 + + b4: + n20 <- $BuildTuple(n0, n1) + n21 <- GLOBAL[print] + n22 <- $Call(n21, "FOO", None) + return None + + b5(n6): + jmp b6 + + b6: + if $MatchSequence($BuildTuple(n0, n1)) then jmp b7 else jmp b11($BuildTuple(n0, n1)) + + b7: + n10 <- $Compare.eq($GetLen($BuildTuple(n0, n1)), 2, None) + if n10 then jmp b8 else jmp b11($BuildTuple(n0, n1)) + + b8: + n11 <- GLOBAL[C] + n12 <- n11.BAR + n13 <- $Compare.eq($BuildTuple(n0, n1)[0], n12, None) + if n13 then jmp b9 else jmp b11($BuildTuple(n0, n1)[1]) + + b9: + n15 <- GLOBAL[C] + n16 <- n15.BAR + n17 <- $Compare.eq($BuildTuple(n0, n1)[1], n16, None) + if n17 then jmp b10 else jmp b12 |}] let%expect_test _ = @@ -630,85 +630,85 @@ def location(point): PyIR.test source ; [%expect {| - module dummy: - - function toplevel(): - b0: - n0 <- $MakeFunction["Point", "dummy.Point", None, None, None, None] - n1 <- $BuildClass(n0, "Point", None) - TOPLEVEL[Point] <- n1 - n2 <- $MakeFunction["location", "dummy.location", None, None, None, None] - TOPLEVEL[location] <- n2 - return None - - - function dummy.Point(): - b0: - n0 <- TOPLEVEL[__name__] - TOPLEVEL[__module__] <- n0 - TOPLEVEL[__qualname__] <- "Point" - $SETUP_ANNOTATIONS - n1 <- TOPLEVEL[int] - n2 <- TOPLEVEL[__annotations__] - n2["x"] <- n1 - n3 <- TOPLEVEL[int] - n4 <- TOPLEVEL[__annotations__] - n4["y"] <- n3 - TOPLEVEL[__match_args__] <- $BuildTuple("x", "y") - return None - - - function dummy.location(point): - b0: - n0 <- GLOBAL[points] - if $MatchSequence(n0) then jmp b1 else jmp b8(n0) - - b1: - n1 <- $Compare.eq($GetLen(n0), 2, None) - if n1 then jmp b2 else jmp b8(n0) - - b2: - n2 <- GLOBAL[Point] - n3 <- $MatchClass(n0[0], n2, 2, $BuildTuple()) - if $BoolOfMatchClass(n3) then jmp b3 else jmp b7(n0[1], $AttributesOfMatchClass(n3)) - - b3: - n4 <- $AttributesOfMatchClass(n3)[0] - n5 <- $Compare.eq(n4, 0, None) - if n5 then jmp b4 else jmp b7(n0[1], $AttributesOfMatchClass(n3)) - - b4: - n6 <- $AttributesOfMatchClass(n3)[1] - n7 <- $AttributesOfMatchClass(n3) - n8 <- GLOBAL[Point] - n9 <- $MatchClass(n0[1], n8, 2, $BuildTuple()) - if $BoolOfMatchClass(n9) then jmp b5 else jmp b7(n6, $AttributesOfMatchClass(n9)) - - b5: - n10 <- $AttributesOfMatchClass(n9)[0] - n11 <- $Compare.eq(n10, 0, None) - if n11 then jmp b6 else jmp b7(n6, $AttributesOfMatchClass(n9)) - - b6: - n17 <- $AttributesOfMatchClass(n9)[1] - n18 <- $AttributesOfMatchClass(n9) - LOCAL[y1] <- n6 - LOCAL[y2] <- n17 - n19 <- GLOBAL[print] - n20 <- LOCAL[y1] - n21 <- $Format(n20, None, None) - n22 <- LOCAL[y2] - n23 <- $Format(n22, None, None) - n24 <- $Call(n19, $BuildString("Two points on the Y axis at ", n21, ", ", n23, " are in the list."), None) - return None - - b7(n12, n13): - jmp b8(n12) - - b8(n14): - n15 <- GLOBAL[print] - n16 <- $Call(n15, "Something else is found in the list.", None) - return None |}] + module dummy: + + function toplevel(): + b0: + n0 <- $MakeFunction["Point", "dummy.Point", None, None, None, None] + n1 <- $BuildClass(n0, "Point", None) + TOPLEVEL[Point] <- n1 + n2 <- $MakeFunction["location", "dummy.location", None, None, None, None] + TOPLEVEL[location] <- n2 + return None + + + function dummy.Point(): + b0: + n0 <- TOPLEVEL[__name__] + TOPLEVEL[__module__] <- n0 + TOPLEVEL[__qualname__] <- "Point" + $SETUP_ANNOTATIONS + n1 <- TOPLEVEL[int] + n2 <- TOPLEVEL[__annotations__] + n2["x"] <- n1 + n3 <- TOPLEVEL[int] + n4 <- TOPLEVEL[__annotations__] + n4["y"] <- n3 + TOPLEVEL[__match_args__] <- $BuildTuple("x", "y") + return None + + + function dummy.location(point): + b0: + n0 <- GLOBAL[points] + if $MatchSequence(n0) then jmp b1 else jmp b8(n0) + + b1: + n1 <- $Compare.eq($GetLen(n0), 2, None) + if n1 then jmp b2 else jmp b8(n0) + + b2: + n2 <- GLOBAL[Point] + n3 <- $MatchClass(n0[0], n2, 2, $BuildTuple()) + if $BoolOfMatchClass(n3) then jmp b3 else jmp b7(n0[1], $AttributesOfMatchClass(n3)) + + b3: + n4 <- $AttributesOfMatchClass(n3)[0] + n5 <- $Compare.eq(n4, 0, None) + if n5 then jmp b4 else jmp b7(n0[1], $AttributesOfMatchClass(n3)) + + b4: + n6 <- $AttributesOfMatchClass(n3)[1] + n7 <- $AttributesOfMatchClass(n3) + n8 <- GLOBAL[Point] + n9 <- $MatchClass(n0[1], n8, 2, $BuildTuple()) + if $BoolOfMatchClass(n9) then jmp b5 else jmp b7(n6, $AttributesOfMatchClass(n9)) + + b5: + n10 <- $AttributesOfMatchClass(n9)[0] + n11 <- $Compare.eq(n10, 0, None) + if n11 then jmp b6 else jmp b7(n6, $AttributesOfMatchClass(n9)) + + b6: + n17 <- $AttributesOfMatchClass(n9)[1] + n18 <- $AttributesOfMatchClass(n9) + LOCAL[y1] <- n6 + LOCAL[y2] <- n17 + n19 <- GLOBAL[print] + n20 <- LOCAL[y1] + n21 <- $Format(n20, None, None) + n22 <- LOCAL[y2] + n23 <- $Format(n22, None, None) + n24 <- $Call(n19, $BuildString("Two points on the Y axis at ", n21, ", ", n23, " are in the list."), None) + return None + + b7(n12, n13): + jmp b8(n12) + + b8(n14): + n15 <- GLOBAL[print] + n16 <- $Call(n15, "Something else is found in the list.", None) + return None |}] let%expect_test _ = @@ -723,64 +723,64 @@ def main(): PyIR.test source ; [%expect {| - module dummy: - - function toplevel(): - b0: - n0 <- $MakeFunction["main", "dummy.main", None, None, None, None] - TOPLEVEL[main] <- n0 - return None - - - function dummy.main(a, b, c): - b0: - n0 <- GLOBAL[o] - if $MatchSequence(n0) then jmp b1 else jmp b9(n0) - - b1: - n1 <- $Compare.eq($GetLen(n0), 1, None) - if n1 then jmp b2 else jmp b9(n0) - - b2: - n2 <- GLOBAL[ast] - n3 <- n2.Cons1 - n4 <- $MatchClass(n0[0], n3, 2, $BuildTuple()) - if $BoolOfMatchClass(n4) then jmp b3 else jmp b9($AttributesOfMatchClass(n4)) - - b3: - n5 <- $AttributesOfMatchClass(n4)[1] - n6 <- GLOBAL[ast] - n7 <- n6.Const2 - n8 <- $MatchClass(n5, n7, 1, $BuildTuple()) - if $BoolOfMatchClass(n8) then jmp b4 else jmp b8 - - b4: - n9 <- $AttributesOfMatchClass(n8)[0] - if $MatchSequence(n9) then jmp b5 else jmp b7 - - b5: - n10 <- $Compare.eq($GetLen(n9), 3, None) - if n10 then jmp b6 else jmp b7 - - b6: - n13 <- $AttributesOfMatchClass(n8) - n14 <- $AttributesOfMatchClass(n4) - LOCAL[a] <- n9[0] - LOCAL[b] <- n9[1] - LOCAL[c] <- n9[2] - n15 <- GLOBAL[action] - n16 <- LOCAL[a] - n17 <- LOCAL[b] - n18 <- LOCAL[c] - n19 <- $Call(n15, n16, n17, n18, None) - return None - - b7: - jmp b8 - - b8: - n11 <- $AttributesOfMatchClass(n8) - jmp b9($AttributesOfMatchClass(n4)) - - b9(n12): - return None |}] + module dummy: + + function toplevel(): + b0: + n0 <- $MakeFunction["main", "dummy.main", None, None, None, None] + TOPLEVEL[main] <- n0 + return None + + + function dummy.main(a, b, c): + b0: + n0 <- GLOBAL[o] + if $MatchSequence(n0) then jmp b1 else jmp b9(n0) + + b1: + n1 <- $Compare.eq($GetLen(n0), 1, None) + if n1 then jmp b2 else jmp b9(n0) + + b2: + n2 <- GLOBAL[ast] + n3 <- n2.Cons1 + n4 <- $MatchClass(n0[0], n3, 2, $BuildTuple()) + if $BoolOfMatchClass(n4) then jmp b3 else jmp b9($AttributesOfMatchClass(n4)) + + b3: + n5 <- $AttributesOfMatchClass(n4)[1] + n6 <- GLOBAL[ast] + n7 <- n6.Const2 + n8 <- $MatchClass(n5, n7, 1, $BuildTuple()) + if $BoolOfMatchClass(n8) then jmp b4 else jmp b8 + + b4: + n9 <- $AttributesOfMatchClass(n8)[0] + if $MatchSequence(n9) then jmp b5 else jmp b7 + + b5: + n10 <- $Compare.eq($GetLen(n9), 3, None) + if n10 then jmp b6 else jmp b7 + + b6: + n13 <- $AttributesOfMatchClass(n8) + n14 <- $AttributesOfMatchClass(n4) + LOCAL[a] <- n9[0] + LOCAL[b] <- n9[1] + LOCAL[c] <- n9[2] + n15 <- GLOBAL[action] + n16 <- LOCAL[a] + n17 <- LOCAL[b] + n18 <- LOCAL[c] + n19 <- $Call(n15, n16, n17, n18, None) + return None + + b7: + jmp b8 + + b8: + n11 <- $AttributesOfMatchClass(n8) + jmp b9($AttributesOfMatchClass(n4)) + + b9(n12): + return None |}] diff --git a/infer/src/python/unit/PyIRTestVariadic.ml b/infer/src/python/unit/PyIRTestVariadic.ml index 8fb885d9834..2b4e2efb15e 100644 --- a/infer/src/python/unit/PyIRTestVariadic.ml +++ b/infer/src/python/unit/PyIRTestVariadic.ml @@ -84,7 +84,7 @@ start() in PyIR.test source ; [%expect - {xxx| + {| module dummy: function toplevel(): @@ -178,7 +178,7 @@ start() n17 <- $ListExtend($BuildList(), n16, None) n18 <- $ListToTuple($BuildList(), None) n19 <- $CallFunctionEx(n14, n18, None, None) - return None |xxx}] + return None |}] let%expect_test _ = @@ -272,7 +272,7 @@ f(**d1, x=42) in PyIR.test source ; [%expect - {xxx| + {| module dummy: function toplevel(): @@ -326,7 +326,7 @@ f(**d1, x=42) jmp b1 b3: - return None |xxx}] + return None |}] let%expect_test _ = diff --git a/opam/infer-tests.opam.locked b/opam/infer-tests.opam.locked index ab8d6737dcc..640d7522329 100644 --- a/opam/infer-tests.opam.locked +++ b/opam/infer-tests.opam.locked @@ -19,6 +19,8 @@ depends: [ "base" {= "v0.16.3"} "base-bigarray" {= "base"} "base-bytes" {= "base"} + "base-domains" {= "base"} + "base-nnp" {= "base"} "base-threads" {= "base"} "base-unix" {= "base"} "base64" {= "3.5.1"} @@ -41,14 +43,14 @@ depends: [ "core" {= "v0.16.2"} "core_kernel" {= "v0.16.0"} "core_unix" {= "v0.16.0"} - "cppo" {= "1.6.9"} + "cppo" {= "1.7.0"} "csexp" {= "1.5.2"} "ctypes" {= "0.23.0"} - "dune" {= "3.16.0"} - "dune-configurator" {= "3.16.0"} + "dune" {= "3.16.1"} + "dune-configurator" {= "3.16.1"} "easy-format" {= "1.3.4"} "expect_test_helpers_core" {= "v0.16.0"} - "extlib" {= "1.7.9"} + "extlib" {= "1.8.0"} "fieldslib" {= "v0.16.0"} "fmt" {= "0.9.0"} "gen" {= "1.1"} @@ -57,12 +59,10 @@ depends: [ "iter" {= "1.8"} "jane-street-headers" {= "v0.16.0"} "javalib" {= "3.2.2"} - "js_of_ocaml" {= "5.8.2"} - "js_of_ocaml-compiler" {= "5.8.2"} "jst-config" {= "v0.16.0"} "lambda-term" {= "3.3.2"} "logs" {= "0.7.0"} - "lwt" {= "5.7.0"} + "lwt" {= "5.9.0"} "lwt_react" {= "1.2.0"} "memtrace" {= "0.2.3"} "menhir" {= "20240715"} @@ -71,13 +71,13 @@ depends: [ "menhirSdk" {= "20240715"} "mew" {= "0.1.0"} "mew_vi" {= "0.5.0"} - "mtime" {= "2.0.0"} + "mtime" {= "2.1.0"} "num" {= "1.5-1"} - "ocaml" {= "4.14.0"} - "ocaml-compiler-libs" {= "v0.12.4"} - "ocaml-config" {= "2"} + "ocaml" {= "5.2.1"} + "ocaml-compiler-libs" {= "v0.17.0"} + "ocaml-config" {= "3"} "ocaml-option-flambda" {= "1"} - "ocaml-variants" {= "4.14.0+options"} + "ocaml-variants" {= "5.2.1+options"} "ocaml_intrinsics" {= "v0.16.1"} "ocamlbuild" {= "0.15.0"} "ocamlfind" {= "1.9.6"} @@ -97,7 +97,7 @@ depends: [ "ppx_compare" {= "v0.16.0"} "ppx_custom_printf" {= "v0.16.0"} "ppx_derivers" {= "1.2.1"} - "ppx_deriving" {= "6.0.2"} + "ppx_deriving" {= "6.0.3"} "ppx_disable_unused_warnings" {= "v0.16.0"} "ppx_enumerate" {= "v0.16.0"} "ppx_expect" {= "v0.16.0"} @@ -131,22 +131,22 @@ depends: [ "ppxlib" {= "0.33.0"} "protocol_version_header" {= "v0.16.0"} "pyml" {= "20220905"} - "re" {= "1.11.0"} + "re" {= "1.12.0"} "react" {= "1.2.2"} "result" {= "1.5"} "sawja" {= "1.5.12"} - "sedlex" {= "3.2"} + "sedlex" {= "3.3"} "seq" {= "base"} "sexp_pretty" {= "v0.16.0"} "sexplib" {= "v0.16.0"} "sexplib0" {= "v0.16.0"} - "spawn" {= "v0.15.1"} + "spawn" {= "v0.17.0"} "splittable_random" {= "v0.16.0"} "sqlite3" {= "5.2.0"} "stdcompat" {= "19"} "stdio" {= "v0.16.0"} "stdlib-shims" {= "0.3.0"} - "tdigest" {= "2.1.3"} + "tdigest" {= "2.2.0"} "textutils" {= "v0.16.0"} "textutils_kernel" {= "v0.16.0"} "time_now" {= "v0.16.0"} @@ -156,11 +156,11 @@ depends: [ "typerep" {= "v0.16.0"} "uchar" {= "0.0.2"} "utop" {= "2.14.0"} - "uucp" {= "15.1.0"} - "uuseg" {= "15.1.0"} + "uucp" {= "16.0.0"} + "uuseg" {= "16.0.0"} "uutf" {= "1.0.3"} "variantslib" {= "v0.16.0"} - "xdg" {= "3.16.0"} + "xdg" {= "3.16.1"} "xmlm" {= "1.4.0"} "yojson" {= "2.2.2"} "zarith" {= "1.14"} diff --git a/opam/infer.opam b/opam/infer.opam index 32c73d85b0d..02b3c833930 100644 --- a/opam/infer.opam +++ b/opam/infer.opam @@ -28,7 +28,7 @@ depends: [ "memtrace" {>="0.1.2"} "menhir" {>= "20220210"} "mtime" {>="2"} - "ocaml" {>="4.12.0"} + "ocaml" {>="5.2.1"} "ocamlfind" {build} "ocamlgraph" "ounit" {>="2.0.5"} diff --git a/opam/infer.opam.locked b/opam/infer.opam.locked index 81bf2abbeb5..db34c6bd1f7 100644 --- a/opam/infer.opam.locked +++ b/opam/infer.opam.locked @@ -19,6 +19,8 @@ depends: [ "base" {= "v0.16.3"} "base-bigarray" {= "base"} "base-bytes" {= "base"} + "base-domains" {= "base"} + "base-nnp" {= "base"} "base-threads" {= "base"} "base-unix" {= "base"} "base64" {= "3.5.1"} @@ -41,14 +43,14 @@ depends: [ "core" {= "v0.16.2"} "core_kernel" {= "v0.16.0"} "core_unix" {= "v0.16.0"} - "cppo" {= "1.6.9"} + "cppo" {= "1.7.0"} "csexp" {= "1.5.2"} "ctypes" {= "0.23.0"} - "dune" {= "3.16.0"} - "dune-configurator" {= "3.16.0"} + "dune" {= "3.16.1"} + "dune-configurator" {= "3.16.1"} "easy-format" {= "1.3.4"} "expect_test_helpers_core" {= "v0.16.0"} - "extlib" {= "1.7.9"} + "extlib" {= "1.8.0"} "fieldslib" {= "v0.16.0"} "fmt" {= "0.9.0"} "gen" {= "1.1"} @@ -57,12 +59,10 @@ depends: [ "iter" {= "1.8"} "jane-street-headers" {= "v0.16.0"} "javalib" {= "3.2.2"} - "js_of_ocaml" {= "5.8.2"} - "js_of_ocaml-compiler" {= "5.8.2"} "jst-config" {= "v0.16.0"} "lambda-term" {= "3.3.2"} "logs" {= "0.7.0"} - "lwt" {= "5.7.0"} + "lwt" {= "5.9.0"} "lwt_react" {= "1.2.0"} "memtrace" {= "0.2.3"} "menhir" {= "20240715"} @@ -71,13 +71,13 @@ depends: [ "menhirSdk" {= "20240715"} "mew" {= "0.1.0"} "mew_vi" {= "0.5.0"} - "mtime" {= "2.0.0"} + "mtime" {= "2.1.0"} "num" {= "1.5-1"} - "ocaml" {= "4.14.0"} - "ocaml-compiler-libs" {= "v0.12.4"} - "ocaml-config" {= "2"} + "ocaml" {= "5.2.1"} + "ocaml-compiler-libs" {= "v0.17.0"} + "ocaml-config" {= "3"} "ocaml-option-flambda" {= "1"} - "ocaml-variants" {= "4.14.0+options"} + "ocaml-variants" {= "5.2.1+options"} "ocaml_intrinsics" {= "v0.16.1"} "ocamlbuild" {= "0.15.0"} "ocamlfind" {= "1.9.6"} @@ -97,7 +97,7 @@ depends: [ "ppx_compare" {= "v0.16.0"} "ppx_custom_printf" {= "v0.16.0"} "ppx_derivers" {= "1.2.1"} - "ppx_deriving" {= "6.0.2"} + "ppx_deriving" {= "6.0.3"} "ppx_disable_unused_warnings" {= "v0.16.0"} "ppx_enumerate" {= "v0.16.0"} "ppx_expect" {= "v0.16.0"} @@ -131,22 +131,22 @@ depends: [ "ppxlib" {= "0.33.0"} "protocol_version_header" {= "v0.16.0"} "pyml" {= "20220905"} - "re" {= "1.11.0"} + "re" {= "1.12.0"} "react" {= "1.2.2"} "result" {= "1.5"} "sawja" {= "1.5.12"} - "sedlex" {= "3.2"} + "sedlex" {= "3.3"} "seq" {= "base"} "sexp_pretty" {= "v0.16.0"} "sexplib" {= "v0.16.0"} "sexplib0" {= "v0.16.0"} - "spawn" {= "v0.15.1"} + "spawn" {= "v0.17.0"} "splittable_random" {= "v0.16.0"} "sqlite3" {= "5.2.0"} "stdcompat" {= "19"} "stdio" {= "v0.16.0"} "stdlib-shims" {= "0.3.0"} - "tdigest" {= "2.1.3"} + "tdigest" {= "2.2.0"} "textutils" {= "v0.16.0"} "textutils_kernel" {= "v0.16.0"} "time_now" {= "v0.16.0"} @@ -156,11 +156,11 @@ depends: [ "typerep" {= "v0.16.0"} "uchar" {= "0.0.2"} "utop" {= "2.14.0" & with-test} - "uucp" {= "15.1.0"} - "uuseg" {= "15.1.0"} + "uucp" {= "16.0.0"} + "uuseg" {= "16.0.0"} "uutf" {= "1.0.3"} "variantslib" {= "v0.16.0"} - "xdg" {= "3.16.0"} + "xdg" {= "3.16.1"} "xmlm" {= "1.4.0"} "yojson" {= "2.2.2"} "zarith" {= "1.14"} diff --git a/opam/ocamlformat.opam.locked b/opam/ocamlformat.opam.locked index 0690dfcf98c..7b20378f28e 100644 --- a/opam/ocamlformat.opam.locked +++ b/opam/ocamlformat.opam.locked @@ -17,15 +17,17 @@ depends: [ "base" {= "v0.16.3"} "base-bigarray" {= "base"} "base-bytes" {= "base"} + "base-domains" {= "base"} + "base-nnp" {= "base"} "base-threads" {= "base"} "base-unix" {= "base"} "camlp-streams" {= "5.0.1"} "cmdliner" {= "1.3.0"} "conf-bash" {= "1"} "csexp" {= "1.5.2"} - "dune" {= "3.16.0"} - "dune-build-info" {= "3.14.2"} - "dune-configurator" {= "3.16.0"} + "dune" {= "3.16.1"} + "dune-build-info" {= "3.16.1"} + "dune-configurator" {= "3.16.1"} "either" {= "1.0.0"} "fix" {= "20230505"} "fpath" {= "0.7.3"} @@ -33,23 +35,23 @@ depends: [ "menhirCST" {= "20240715"} "menhirLib" {= "20240715"} "menhirSdk" {= "20240715"} - "ocaml" {= "4.14.0"} - "ocaml-config" {= "2"} + "ocaml" {= "5.2.1"} + "ocaml-config" {= "3"} "ocaml-option-flambda" {= "1"} - "ocaml-variants" {= "4.14.0+options"} + "ocaml-variants" {= "5.2.1+options"} "ocaml-version" {= "3.6.4"} "ocamlbuild" {= "0.15.0"} "ocamlfind" {= "1.9.6"} "ocamlformat-lib" {= "0.26.2"} "ocp-indent" {= "1.8.1"} - "re" {= "1.11.0"} + "re" {= "1.12.0"} "result" {= "1.5"} "seq" {= "base"} "sexplib0" {= "v0.16.0"} "stdio" {= "v0.16.0"} "topkg" {= "1.0.7"} - "uucp" {= "15.1.0"} - "uuseg" {= "15.1.0"} + "uucp" {= "16.0.0"} + "uuseg" {= "16.0.0"} "uutf" {= "1.0.3"} ] build: [