[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 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.Atom (Var.to_string v)
; Sexp.Atom (Scalar.to_string inf)
; Sexp.Atom (Scalar.to_string sup) ]
; Sexp.Atom (Scalar.to_string i.inf)
; Sexp.Atom (Scalar.to_string i.sup) ]
:: acc )
in
Sexp.List sexps

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

Loading…
Cancel
Save