[llvm-commits] [llvm] r49006 - in /llvm/trunk/lib: CodeGen/DwarfWriter.cpp CodeGen/LLVMTargetMachine.cpp CodeGen/SelectionDAG/SelectionDAGISel.cpp Target/PowerPC/PPCAsmPrinter.cpp Target/PowerPC/PPCRegisterInfo.cpp Target/X86/X86AsmPrinter.cpp Target/X86/X86RegisterInfo.cpp Transforms/Utils/LowerInvoke.cpp

Dale Johannesen dalej at apple.com
Tue Apr 1 11:22:21 PDT 2008


On Apr 1, 2008, at 11:12 AM, Chris Lattner wrote:

>
> On Apr 1, 2008, at 10:49 AM, Dale Johannesen wrote:
>
>>
>> On Apr 1, 2008, at 10:40 AM, Chris Lattner wrote:
>>>>
>>>> Hmm.  llvm-gcc does not, in fact, mark foo() as nounwind.
>>>
>>> In this case, that is because baz() could throw.  Try:
>>>
>>> int foo() {
>>> try {
>>>   bar();
>>> } catch(...) {
>>>   return 17
>>> }
>>> return 42;
>>> }
>>
>> llvm-gcc still does not mark foo as nounwind.
>
> Regardless of whether it does or not, it would be correct for it to be
> marked nounwind.  This detail is a missed optimization in llvm-gcc,
> but it doesn't affect the discussion afaict.

No, it only affects whether things work:)

> How about something like:
>
> void bar();
> int foo() throw() {
>   bar();
> }
>
> Same idea, and it is marked nounwind.

OK, this one I believe.  While llvm-g++ does produce an EH table, llvm- 
g++ -emit-llvm | llc does not.  I'll fix it.
  



More information about the llvm-commits mailing list