[llvm-commits] [llvm-gcc-4.2] r85649 - /llvm-gcc-4.2/trunk/gcc/cp/decl.c

Nick Lewycky nicholas at mxc.ca
Sun Nov 1 12:58:04 PST 2009


Bill Wendling wrote:
> On Nov 1, 2009, at 1:49 AM, Duncan Sands wrote:
> 
>> Hi Bill,
>>
>>> When marking something as "nothrow", make sure that we're not  
>>> blindly marking a
>>> "thunk" as nothrow. It should have the same nothrow setting as the  
>>> function that
>>> it's thunking. This is because LLVM doesn't generate the add/jmp  
>>> instruction
>>> sequence that gcc does; it's actually a function which calls the  
>>> thunkee. If the
>>> thunkee can throw but the thunk is marked as "nothrow", then no EH  
>>> information
>>> will be generated for the thunk, and exceptions will go blammo!
>> I thought thunks got turned into LLVM aliases?
>>
> Apparently not. :) What are LLVM aliases?

http://llvm.org/docs/LangRef.html#aliasstructure , which maps to ELF 
aliases. You probably don't use them because they're not supported on 
Darwin / Mach-O. I've been arguing that codegen should lower aliases to 
thunks on Darwin.

The other thing is that not all GCC thunks can be lowered to LLVM 
aliases. See PR2861 for the case that hit me. I'm waiting to see what 
happens when clang needs to codegen the same thing :)

Nick



More information about the llvm-commits mailing list