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

Chris Lattner clattner at apple.com
Sun Nov 1 13:13:29 PST 2009


On Nov 1, 2009, at 12:58 PM, Nick Lewycky wrote:

> 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 :)

Right, they can't all be lowered to aliases.  The functions in  
question have to adjust 'this'.

-Chris



More information about the llvm-commits mailing list