[sledge] Add __llair_unreachable intrinsic for use in model code

Reviewed By: jvillard

Differential Revision: D25146156

fbshipit-source-id: cf48508b9
master
Josh Berdine 4 years ago committed by Facebook GitHub Bot
parent 4605f505ce
commit c9185ae607

@ -1112,6 +1112,7 @@ let xlate_instr :
| ["__llair_throw"] ->
let pre, exc = xlate_value x (Llvm.operand instr 0) in
emit_term ~prefix:(pop loc @ pre) (Term.throw ~exc ~loc)
| ["__llair_unreachable"] -> emit_term Term.unreachable
(* dropped / handled elsewhere *)
| ["llvm"; "dbg"; ("declare" | "value")]
|"llvm" :: ("lifetime" | "invariant") :: ("start" | "end") :: _
@ -1180,6 +1181,7 @@ let xlate_instr :
xlate_jump x instr unwind_blk loc []
in
emit_term ~prefix (Term.goto ~dst ~loc) ~blocks
| ["__llair_unreachable"] -> emit_term Term.unreachable
(* unimplemented *)
| "llvm" :: "experimental" :: "gc" :: "statepoint" :: _ ->
todo "statepoints:@ %a" pp_llvalue instr ()

@ -13,9 +13,13 @@ extern "C" {
__attribute__((noreturn)) void __llair_throw(void* thrown_exception);
/* This models allocation that cannot fail. */
/* express assumption that an execution is not possible */
__attribute__((noreturn)) void __llair_unreachable();
/* allocation that cannot fail. */
void* __llair_alloc(unsigned size);
/* non-deterministic choice */
int __llair_choice();
#ifdef __cplusplus

Loading…
Cancel
Save