What is the difference between a CallInst and an InvokeInst in LLVM? Is an InvokeInst a CallInst that can throw an exception?
Thanks,
Ryan
What is the difference between a CallInst and an InvokeInst in LLVM? Is an InvokeInst a CallInst that can throw an exception?
Thanks,
Ryan
What is the difference between a CallInst and an InvokeInst in LLVM? Is
an InvokeInst a CallInst that can throw an exception?
Sort off. The return destination of a CallInst is implied .. the next
instruction. The return destination of an InvokeInst is explicit and
there are two of them: normal case and exceptional case. If the unwind
instruction is executed (during the call) it causes a stack unwind and
branch to the exceptional case. Normal returns (without unwind
instruction) return to the normal case.
The intention is for exception handling.
Reid.
They both allow the callee to throw an exception. Invoke is used when a callee is calling a function and wants to stop unwinding if it throws.
Some references:
http://llvm.org/docs/LangRef.html#i_invoke
http://llvm.org/pubs/2004-01-30-CGO-LLVM.html
-Chris