[llvm-dev] Resurrect Bug18710 (Only generate .ARM.exidx and ARM.extab when needed with EHABI)

Christian Bruel via llvm-dev llvm-dev at lists.llvm.org
Mon Apr 3 01:53:48 PDT 2017


Hello,

After a few comments and rethought, it seems that the support needed to 
disable the cantunwind emission when the exception tables are not needed 
is best handled with a change of the uwtable attribute semantic rather 
than adding a new hidden flag.

So, for the ARM EHABI I propose the uwtable/nounwind semantic to be

nil (default) :             : do not need an entry   <- this is the change
nounwind                  : Function does not throw
uwtable                     : Need an entry because an exception might 
pass by
uwtable + nounwind : Need an entry even if no exception pass by

so "nil" really means "no table" and is orthogonal with uwtable.

then uwtable is only set when the exceptions are enabled (regardless of 
the language).
and  nounwind is only set when the function cannot throw (regardless of 
the language).

This makes -f[no]-unwind-tables, -f[no]-exceptions effective

A (logical) consequence is that the unwind directives (.fnstart,.fnend) 
are only emitted if uwtable is set, so the few llvm tests that expected 
the uwtable attribute to be the default need to be adapted.

I've updated

https://reviews.llvm.org/D31139
https://reviews.llvm.org/D31140

(For some reasons, no notification was sent to the Subscribers (at least 
for llvm-commits). Maybe I'm still doing something wrong with Phabricator ?)

Thanks for your feedback,

Cheers

Christian


More information about the llvm-dev mailing list