[PATCH] D20121: Make "@name =" mandatory for globals in .ll files

Duncan Exon Smith via llvm-commits llvm-commits at lists.llvm.org
Wed May 11 08:25:38 PDT 2016



> On May 11, 2016, at 04:51, Rafael EspĂ­ndola <rafael.espindola at gmail.com> wrote:
> 
> On 11 May 2016 at 02:31, Duncan P. N. Exon Smith via llvm-commits
> <llvm-commits at lists.llvm.org> wrote:
>> I'm not sure this goes far enough.
>> 
>> While it's inconvenient for parsing and not particularly readable, it makes .ll files with unnamed globals easier to modify.  E.g., if you have this file:
>> --
>> global i32 42
>> global i32 43
>> global i32 44
>> --
>> you can delete the second line to create:
>> --
>> global i32 42
>> global i32 44
>> --
>> 
>> However, IIRC, skipping a slot would be illegal:
>> --
>> @0 = global i32 42
>> @2 = global i32 44
>> --
>> 
>> If you make the above (skipping a slot) legal (or if I'm wrong and it's already legal), then I'm fine with this.
> 
> 
> I think it is illegal, but other than when testing unnamed globals,
> when do you need them in tests? That is, why do you need to have
> 
> 
> @0 = global i32 0
> @1 = global i32 1
> @2 = global i32 2
> 
> instead of
> 
> @g0 = global i32 0
> @g1 = global i32 1
> @g2 = global i32 2
> 

I agree it's not useful for checked in tests, but it's useful for hacking/debugging a test case that happens to have unnamed globals before it has been understood or fully reduced.

> Cheers,
> Rafael


More information about the llvm-commits mailing list