[llvm-commits] [patch] Change how we handle mandatory unwind tables

Rafael Ávila de Espíndola rafael.espindola at gmail.com
Tue May 24 06:46:06 PDT 2011


On 11-05-24 4:21 AM, Duncan Sands wrote:
> Hi Rafael,
>
>> One way to fix this would be to move the logic from Clang's codegen to
>> LLVM's codegen, but we would still have problems with:
>>
>> $ clang -fno-asynchronous-unwind-tables -c -emit-llvm test.c
>> $ clang test.o -o test
>
> can't this be fixed via better documentation?  I.e. explain that codegen options
> don't do anything when not doing codegen (and perhaps have clang warn about
> this), and that you should do this instead:
>
>   >  $ clang -c -emit-llvm test.c
>   >  $ clang -fno-asynchronous-unwind-tables test.o -o test

We would need to extend the LTO api to implement this, but it should be 
possible.

That is how gcc works (or used to work at least), but IMHO it is a 
terrible idea. If without LTO I can put unwind tables in some functions 
but not others, why can't I do that with LTO?


>> The change to prune-eh also removes some optimization opportunities.
>> Preventing adding nounwind can prevent converting an invoke to a call.
>
> I'm confused.  What has prune-eh got to do with unwind-tables?

It adds the nounwind attribute.

> Ciao, Duncan.

Cheers,
Rafael



More information about the llvm-commits mailing list