[LLVMdev] how to resolve llvm exception IR?

Jim Grosbach grosbach at apple.com
Mon Apr 27 21:53:48 PDT 2009

On Apr 27, 2009, at 7:37 PM, zhengjian zhang wrote:
>    59          %3 = invoke
> %"struct.std::basic_ostream<char,std::char_traits<char> >"*
> @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
> (%"struct.std::basic_ostream<char,std::char_traits<char>
>> "* @_ZSt4cout, i8* getelementptr ([10 x i8]* @.str, i32 0, i32 0))
> my  question is at line 59  can throw an exception?

Yes. The 'invoke' instruction indicates a call which can return either  
via the normal return sequence or by throwing an exception.

> my another problem :  are there any different of above two  llmv-ir
> on  handle c++ exception  ?

Different in what way? I'm not sure I understand your question. In  
neither case will an exception thrown from the << operator be caught.  
In the first case, the << operator is not in a try block, and in both  
cases, only an exception of integer type is caught, while the <<  
operator throws exceptions (when enabled) of type ios::exception.


More information about the llvm-dev mailing list