[cfe-commits] patch: nounwind on __cxa_guard_*

Nick Lewycky nicholas at mxc.ca
Sat Feb 11 23:32:11 PST 2012


This patch would cause clang to mark the __cxa_guard_* functions 
'nounwind'. I believe this is the correct reading of the Itanium ABI; 
the functions are completely specified, and each function which may 
throw an exception specifically says what exception it will throw and 
under what conditions. Most of the functions say nothing about throwing 
exceptions, so I assume that they aren't allowed to throw.

I'm not an expert on this though, so please review.

This would fix the intersting problem of invokes to __cxa_guard_* 
functions. Even though clang never generates an invoke to these, one 
still manages to show up in 
SingleSource/Benchmarks/Misc-C++-EH/Output/spirit.llvm.bc. How? When the 
inliner inlines an invoke, all calls inside the callee turn into invokes 
with their unwind-destination pointing at the inline-callsite's 
unwind-destination.

Naturally, marking the __cxa_guard_* methods nounwind would fix that.

Nick

-------------- next part --------------
A non-text attachment was scrubbed...
Name: itanium-abi-nounwind-1.patch
Type: text/x-patch
Size: 1352 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120211/6e05c796/attachment.bin>


More information about the cfe-commits mailing list