On 5/17/2011 11:37 PM, Duncan Sands wrote:> Hi George,
>
>> Does llvm provide a way to determine instructions that cause
control to
>> leave functions? For example, return statements and exit statements
cause
>> control exit out of function.
> there is no "exit" statement.
>
> I am looking for something similar to basic block
>> terminators. Thanks.
> Control can leave a function either (1) due to a return instruction
> (ReturnInst); or (2) due to a function call (CallInst or InvokeInst).
> A function call can return normally, unwind an exception or never
> return (eg: infinite loop or causing the program to exit).
To add to what Duncan said, there is also the unwind instruction (which
is similar to the ReturnInst). The exception handling intrinsics may
also cause control to leave a function, but I haven't looked at them
and, therefore, do not know for certain.
The Language Reference Manual (http://llvm.org/docs/LangRef.html) may be
of help.
-- John T.
> Ciao, Duncan.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev