Guys,<br><br>    I would like to instrument the bytecode that LLVM produces with assertions. I have written the instrumentation code manually, but I do not know how to halt the program in case the assertion is false. I took a look into the bytecode that LLVM produces for a program like:<br>


<br>#include <stdlib.h><br>int main() {<br>  exit(1);<br>}<br><br>And it is like this:<br><br>define i32 @main() nounwind {<br>entry:<br>  %retval = alloca i32                            ; <i32*> [#uses=1]<br>


  %0 = alloca i32                                 ; <i32*> [#uses=0]<br>  %"alloca point" = bitcast i32 0 to i32          ; <i32> [#uses=0]<br>  call void @exit(i32 1) noreturn nounwind<br>  unreachable<br>


return:                                           ; No predecessors!<br>  %retval1 = load i32* %retval                    ; <i32> [#uses=1]<br>  ret i32 %retval1<br>}<br><br>So, what is the LLVM code to insert the call "call void @exit(i32 1) noreturn nounwind"? I thought about something like:<br>


<br>CallInst *abort = CallInst::Create(/*POINTER TO ABORT*/, ArrayRef<Value*>(), Twine(), assertfail);<br>abort->addAttribute(~0, Attribute::NoReturn);<br>
abort->addAttribute(~0, Attribute::NoUnwind);<br><br>However, I do not know what to fill up in /*POINTER TO ABORT*/. Can anyone help me?<br><br>Thank you very much,<br><br>Victor<br>