[patch][rfc] "alias weak" X "weak alias"
Rafael EspĂndola
rafael.espindola at gmail.com
Wed Jul 23 17:05:37 PDT 2014
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
>> }
>>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: text/x-patch
Size: 49449 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140723/cf082822/attachment.bin>
More information about the llvm-commits
mailing list