[patch][rfc] "alias weak" X "weak alias"

Duncan P. N. Exon Smith dexonsmith at apple.com
Wed Jul 30 15:46:52 PDT 2014


LGTM.

> On 2014-Jul-29, at 11:52, Rafael Espíndola <rafael.espindola at gmail.com> wrote:
> 
> ping
> 
> On 23 July 2014 20:05, Rafael Espíndola <rafael.espindola at gmail.com> wrote:
>> Rebased patch attached now that we have agreed that the .ll format is
>> not stable.
>> 
>> On 5 June 2014 02:33, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote:
>>> 
>>> On 2014 Jun 3, at 12:42, Rafael Espíndola <rafael.espindola at gmail.com> wrote:
>>> 
>>>> It always amused me that we have
>>>> 
>>>> @a = weak global ...
>>>> but
>>>> @b = alias weak ...
>>>> 
>>>> I decided to dig why that is. The best I could find was
>>>> 
>>>> http://llvm.org/bugs/show_bug.cgi?id=1017#c15
>>>> 
>>>> Looking at some really old cold then suggests that the reason was that
>>>> the old bison based parser hard a reduction for alias linkages and
>>>> another one for global variable linkages. Putting the alias first
>>>> avoided the reduce/reduce conflict.
>>>> 
>>>> The days of the old .ll parser are long gone, but is it too late to
>>>> change? In case it is not, the attached patches implement just that
>>>> :-)
>>>> 
>>>> Cheers,
>>>> Rafael
>>>> <clang.patch><llvm.patch>
>>> 
>>> This change SGTM -- the alias ordering is unnatural, and given the
>>> current grammar, I don't think it makes parsing any easier.  Might
>>> be worth pinging llvmdev about it though.
>>> 
>>> Also, it looks to me like you added an extra space in
>>> test/CodeGenCXX/extern-c.cpp:
>>> 
>>>> diff --git a/test/CodeGenCXX/extern-c.cpp b/test/CodeGenCXX/extern-c.cpp
>>>> index fefb216..3e87d51 100644
>>>> --- a/test/CodeGenCXX/extern-c.cpp
>>>> +++ b/test/CodeGenCXX/extern-c.cpp
>>>> @@ -59,10 +59,10 @@ extern "C" {
>>>> 
>>>>   // CHECK-NOT: @unused
>>>>   // CHECK-NOT: @duplicate_internal
>>>> -  // CHECK: @internal_var = alias internal i32* @_Z12internal_var
>>>> +  // CHECK: @internal_var =  internal alias i32* @_Z12internal_var
>>> 
>>> here ~~~~~~~~~~~~~~~~~~~~~~~~~~^
>>> 
>>>>   // CHECK-NOT: @unused
>>>>   // CHECK-NOT: @duplicate_internal
>>>> -  // CHECK: @internal_fn = alias internal i32 ()* @_Z11internal_fnv
>>>> +  // CHECK: @internal_fn = internal alias i32 ()* @_Z11internal_fnv
>>>>   // CHECK-NOT: @unused
>>>>   // CHECK-NOT: @duplicate_internal
>>>> }
>>>> 
>>> 





More information about the llvm-commits mailing list