Skip to content

Commit

Permalink
[sledge] Warn of each uninterpreted intrinsic only once
Browse files Browse the repository at this point in the history
Reviewed By: mbouaziz

Differential Revision: D10389476

fbshipit-source-id: 6e1a7e00d
  • Loading branch information
jberdine authored and facebook-github-bot committed Oct 17, 2018
1 parent 452e240 commit da89fc8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sledge/src/llair/frontend.ml
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,8 @@ let rec xlate_func_name x llv =
| InlineAsm -> todo "inline asm: %a" pp_llvalue llv ()
| _ -> fail "unknown function: %a" pp_llvalue llv ()

let ignored_callees = Hash_set.create (module String)

let xlate_instr :
pop_thunk
-> x
Expand Down Expand Up @@ -888,7 +890,9 @@ let xlate_instr :
let fname = Llvm.value_name llfunc in
let reg = xlate_name_opt x instr in
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
continue (fun (insts, term) ->
(Llair.Inst.nondet ~reg ~msg ~loc :: insts, term, []) )
Expand Down Expand Up @@ -1363,6 +1367,7 @@ let translate : string -> Llair.t =
Hashtbl.clear anon_struct_name ;
Hashtbl.clear memo_type ;
Hashtbl.clear memo_value ;
Hash_set.clear ignored_callees ;
Llvm.dispose_module llmodule ;
Llvm.dispose_context llcontext ;
Llair.mk ~globals ~functions
Expand Down

0 comments on commit da89fc8

Please sign in to comment.