[llvm] r183743 - Require members of llvm.used to be named.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed Jul 23 08:32:14 PDT 2014


On 16 July 2014 20:10, Reid Kleckner <rnk at google.com> wrote:
> Why can't we have unnamed globals in @llvm.used?  I just tried to create
> some unnamed globals in Clang to implement pragma init_seg, but this
> verifier check rejected my IR.  I can name them, but there is no reason to.
> They will have private linkage, and they will go in an explicit section
> similar to .init_array, which will be found later either by the CRT or some
> other external code.

We use the name to provide an order which is used when recreating
llvm.used in GlobalOpt. I agree that given your example this seems a
bit of a hack. Then again, llvm.used is itself a bit of a hack :-(

Cheers,
Rafael



More information about the llvm-commits mailing list