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

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Wed May 11 04:51:45 PDT 2016


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

Cheers,
Rafael


More information about the llvm-commits mailing list