[sledge] Resolve match-on-mutable-state-prevent-uncurry warnings

Summary:
This warning (68) triggers when a function argument pattern depends on
mutable state, which prevents the remaining arguments from being
uncurried, causing additional closure allocations.

Reviewed By: jvillard

Differential Revision: D27188311

fbshipit-source-id: a43354e15
master
Josh Berdine 4 years ago committed by Facebook GitHub Bot
parent 65f8b48aac
commit 9ee705bb88

@ -32,11 +32,11 @@ let bindings (itv : t) =
let sexp_of_t (itv : t) = let sexp_of_t (itv : t) =
let sexps = let sexps =
Array.fold_right (bindings itv) [] ~f:(fun (v, {inf; sup}) acc -> Array.fold_right (bindings itv) [] ~f:(fun (v, i) acc ->
Sexp.List Sexp.List
[ Sexp.Atom (Var.to_string v) [ Sexp.Atom (Var.to_string v)
; Sexp.Atom (Scalar.to_string inf) ; Sexp.Atom (Scalar.to_string i.inf)
; Sexp.Atom (Scalar.to_string sup) ] ; Sexp.Atom (Scalar.to_string i.sup) ]
:: acc ) :: acc )
in in
Sexp.List sexps Sexp.List sexps

@ -91,8 +91,8 @@ module Make (Opts : Domain_intf.Opts) (Dom : Domain_intf.Dom) = struct
let empty = Empty |> check invariant let empty = Empty |> check invariant
let push_return Llair.{callee= {formals; locals}; return; recursive} let push_return call from_call stk =
from_call stk = let Llair.{callee= {formals; locals}; return; recursive; _} = call in
Return {recursive; dst= return; formals; locals; from_call; stk} Return {recursive; dst= return; formals; locals; from_call; stk}
|> check invariant |> check invariant
@ -366,8 +366,8 @@ module Make (Opts : Domain_intf.Opts) (Dom : Domain_intf.Dom) = struct
let state = Option.fold ~f:Dom.exec_kill areturn state in let state = Option.fold ~f:Dom.exec_kill areturn state in
exec_jump stk state block return exec_jump stk state block return
let exec_call stk state block ({Llair.callee; areturn; return; _} as call) let exec_call stk state block call globals =
globals = let Llair.{callee; areturn; return; _} = call in
if Llair.Func.is_undefined callee then if Llair.Func.is_undefined callee then
exec_skip_func stk state block areturn return exec_skip_func stk state block areturn return
else exec_call stk state block call globals else exec_call stk state block call globals

Loading…
Cancel
Save