From bc858fad2ef4a54d3b7aabae002130e59ee1af39 Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Wed, 16 Oct 2019 05:11:12 -0700 Subject: [PATCH] [sledge][NFC] Rename Term.call's func arg to callee to match type Summary: Just for consistency Reviewed By: bennostein Differential Revision: D17821846 fbshipit-source-id: 778c61a56 --- sledge/src/llair/frontend.ml | 10 +++++----- sledge/src/llair/llair.ml | 11 ++--------- sledge/src/llair/llair.mli | 2 +- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/sledge/src/llair/frontend.ml b/sledge/src/llair/frontend.ml index efe9b0822..bfa638572 100644 --- a/sledge/src/llair/frontend.ml +++ b/sledge/src/llair/frontend.ml @@ -985,7 +985,7 @@ let xlate_instr : skip "inline asm" (* general function call that may not throw *) | _ -> - let func = xlate_func_name x llfunc in + let callee = xlate_func_name x llfunc in let typ = xlate_type x lltyp in let lbl = name ^ ".ret" in let call = @@ -1000,7 +1000,7 @@ let xlate_instr : warn "ignoring variable arguments to variadic \ function: %a" - Exp.pp func () + Exp.pp callee () | _ -> () ) ; let llfty = Llvm.element_type lltyp in ( match Llvm.classify_type llfty with @@ -1015,7 +1015,7 @@ let xlate_instr : in let areturn = xlate_name_opt x instr in let return = Llair.Jump.mk lbl in - Llair.Term.call ~func ~typ ~actuals ~areturn ~return + Llair.Term.call ~callee ~typ ~actuals ~areturn ~return ~throw:None ~loc in continue (fun (insts, term) -> @@ -1067,7 +1067,7 @@ let xlate_instr : todo "statepoints:@ %a" pp_llvalue instr () (* general function call that may throw *) | _ -> - let func = xlate_func_name x llfunc in + let callee = xlate_func_name x llfunc in let typ = xlate_type x (Llvm.type_of llfunc) in let actuals = List.rev_init num_actuals ~f:(fun i -> @@ -1078,7 +1078,7 @@ let xlate_instr : let throw, blocks = xlate_jump x instr unwind_blk loc blocks in let throw = Some throw in emit_term - (Llair.Term.call ~func ~typ ~actuals ~areturn ~return ~throw + (Llair.Term.call ~callee ~typ ~actuals ~areturn ~return ~throw ~loc) ~blocks ) | Ret -> diff --git a/sledge/src/llair/llair.ml b/sledge/src/llair/llair.ml index 874f51a88..065fb53b7 100644 --- a/sledge/src/llair/llair.ml +++ b/sledge/src/llair/llair.ml @@ -329,16 +329,9 @@ module Term = struct let iswitch ~ptr ~tbl ~loc = Iswitch {ptr; tbl; loc} |> check invariant - let call ~func ~typ ~actuals ~areturn ~return ~throw ~loc = + let call ~callee ~typ ~actuals ~areturn ~return ~throw ~loc = Call - { callee= func - ; typ - ; actuals - ; areturn - ; return - ; throw - ; recursive= false - ; loc } + {callee; typ; actuals; areturn; return; throw; recursive= false; loc} |> check invariant let return ~exp ~loc = Return {exp; loc} |> check invariant diff --git a/sledge/src/llair/llair.mli b/sledge/src/llair/llair.mli index 1721555ca..faa137191 100644 --- a/sledge/src/llair/llair.mli +++ b/sledge/src/llair/llair.mli @@ -148,7 +148,7 @@ module Term : sig val iswitch : ptr:Exp.t -> tbl:jump vector -> loc:Loc.t -> term val call : - func:Exp.t + callee:Exp.t -> typ:Typ.t -> actuals:Exp.t list -> areturn:Reg.t option