[sledge] Warn of each uninterpreted intrinsic only once

Reviewed By: mbouaziz

Differential Revision: D10389476

fbshipit-source-id: 6e1a7e00d
master
Josh Berdine 6 years ago committed by Facebook Github Bot
parent 452e240e67
commit da89fc8f95

@ -837,6 +837,8 @@ let rec xlate_func_name x llv =
| InlineAsm -> todo "inline asm: %a" pp_llvalue llv () | InlineAsm -> todo "inline asm: %a" pp_llvalue llv ()
| _ -> fail "unknown function: %a" pp_llvalue llv () | _ -> fail "unknown function: %a" pp_llvalue llv ()
let ignored_callees = Hash_set.create (module String)
let xlate_instr : let xlate_instr :
pop_thunk pop_thunk
-> x -> x
@ -888,7 +890,9 @@ let xlate_instr :
let fname = Llvm.value_name llfunc in let fname = Llvm.value_name llfunc in
let reg = xlate_name_opt x instr in let reg = xlate_name_opt x instr in
let skip msg = let skip msg =
warn "ignoring uninterpreted %s %s" msg fname ; ( match Hash_set.strict_add ignored_callees fname with
| Ok () -> warn "ignoring uninterpreted %s %s" msg fname
| Error _ -> () ) ;
let msg = Llvm.string_of_llvalue instr in let msg = Llvm.string_of_llvalue instr in
continue (fun (insts, term) -> continue (fun (insts, term) ->
(Llair.Inst.nondet ~reg ~msg ~loc :: insts, term, []) ) (Llair.Inst.nondet ~reg ~msg ~loc :: insts, term, []) )
@ -1363,6 +1367,7 @@ let translate : string -> Llair.t =
Hashtbl.clear anon_struct_name ; Hashtbl.clear anon_struct_name ;
Hashtbl.clear memo_type ; Hashtbl.clear memo_type ;
Hashtbl.clear memo_value ; Hashtbl.clear memo_value ;
Hash_set.clear ignored_callees ;
Llvm.dispose_module llmodule ; Llvm.dispose_module llmodule ;
Llvm.dispose_context llcontext ; Llvm.dispose_context llcontext ;
Llair.mk ~globals ~functions Llair.mk ~globals ~functions

Loading…
Cancel
Save