[patch] Don't rauw an alias in llvm.used

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue Apr 16 09:57:04 PDT 2013


> can you please give some examples.

Yes, sorry. I forgot to git add the testcase. A new patch is attached.

> Anyway, it sounds like an impedance mismatch between the nature of
> llvm.used,
> which is adapted to recording that a particular bit of memory is used (the
> memory represented by a global variable), and how llvm.used is being used by
> clang: to record that a certain *name* (the name of a global variable) is
> being
> used somewhere.

Good point. The definition of llvm.used is a bit fuzzy. It says "This
array contains a list of pointers to global variables and
functions..." so strictly speaking even putting an alias in there
would not be allowed. On the other hand, it does say "then the
compiler, assembler, and linker are required to treat the symbol as if
there is a reference to the global that it cannot see."

Would you be ok with a patch just clarifying what llvm.used is (and
making the verifier enforce it)? I think we should allow functions,
global variables, aliases and casts thereof. The wording about an
unseen reference to the symbol would stay the same.

> Thanks, Duncan.

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: application/octet-stream
Size: 4920 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130416/d9ad8e37/attachment.obj>


More information about the llvm-commits mailing list