[sledge][NFC] Simplify harness selection code

Summary: Only refactor

Reviewed By: jvillard

Differential Revision: D15424821

fbshipit-source-id: 0e3ea58c3
master
Josh Berdine 6 years ago committed by Facebook Github Bot
parent d47824fe37
commit c690416622

@ -367,17 +367,14 @@ let harness : Llair.t -> Work.t option =
List.find_map ["__llair_main"; "_Z12__llair_mainv"; "main"] List.find_map ["__llair_main"; "_Z12__llair_mainv"; "main"]
~f:(fun name -> ~f:(fun name ->
Vector.find_map pgm.functions ~f:(fun func -> Vector.find_map pgm.functions ~f:(fun func ->
let fname = Var.name func.name.var in Option.some_if (String.equal name (Var.name func.name.var)) func
Option.some_if (String.equal name fname) (fname, func) ) ) ) )
|> function |> function
| Some (("__llair_main" | "_Z12__llair_mainv" | "main"), main) -> | Some {entry= {params= []} as block} ->
let block = main.entry in Some
if List.is_empty block.params then (Work.init
Some (fst (Domain.call (Domain.init pgm.globals) [] [] block.locals))
(Work.init block)
(fst (Domain.call (Domain.init pgm.globals) [] [] block.locals))
block)
else None
| _ -> None | _ -> None
let exec_pgm : Llair.t -> unit = let exec_pgm : Llair.t -> unit =

Loading…
Cancel
Save