From a0949495c194e4219f71fcdcb148efaacb5078a2 Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Fri, 7 Jun 2019 03:16:22 -0700 Subject: [PATCH] [sledge] Translate `invoke abort` to `abort` Summary: Sometimes calls to the `abort` C stdlib function appear as `invoke` instructions in LLVM. They should be translated to the LLAIR abort instruction just like the non-raising `call abort` case. Reviewed By: kren1 Differential Revision: D15706574 fbshipit-source-id: 1509ed0e3 --- sledge/src/llair/frontend.ml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sledge/src/llair/frontend.ml b/sledge/src/llair/frontend.ml index 86bfcc7c2..f9e0c488f 100644 --- a/sledge/src/llair/frontend.ml +++ b/sledge/src/llair/frontend.ml @@ -1037,6 +1037,8 @@ let xlate_instr : | ["__llair_throw"] -> let dst = Llair.Jump.mk unwind_dst args in emit_term (Llair.Term.goto ~dst ~loc) + | ["abort"] -> + emit_term ~prefix:[Llair.Inst.abort ~loc] Llair.Term.unreachable | ["_Znwm" (* operator new(size_t num) *)] |[ "_ZnwmSt11align_val_t" (* operator new(unsigned long num, std::align_val_t) *) ]