[patch] Respect llvm.used in Internalize

Rafael EspĂ­ndola rafael.espindola at gmail.com
Fri Jul 19 13:41:31 PDT 2013


On 19 July 2013 15:52, Sean Silva <silvas at purdue.edu> wrote:
> + at llvm.compiler_used = appending global [1 x void ()*] [void ()* @g],
> section "llvm.metadata"
>
> @llvm.compiler.used?

duh, fixed.

> +GlobalVariable *
> +llvm::collectUsedGlobalVariables(const Module &M, const char *Name,
> +                                 SmallPtrSet<GlobalValue *, 8> &Set) {
>
> (for a future patch). The return value seems kind of arbitrary; it seems to
> be just to save a name lookup in the module. Maybe this function should take
> a GlobalVariable * instead of a name? and leave it to the client to extract
> the GlobalVariable* from the module? You could also then remove the `const
> Module &M` parameter. Also, the function does something pretty specific, so
> maybe it should have a more specific-sounding name.

Doing the lookup also shares a bit of code for passes that need look
at llvm.used and llvm.compiler.used. Maybe a better change would be to
pass just a boolean instead of the name?

> -- Sean Silva

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


More information about the llvm-commits mailing list