[llvm-commits] First contribution to LLVM: improve the internalize pass

Pierre-Nicolas Clauss pini at tuxfamily.org
Sat Jun 23 04:27:21 PDT 2012


On Sat, Jun 23, 2012 at 9:09 AM, Duncan Sands <baldrick at free.fr> wrote:
>> The second change also introduces a new command line option to choose
>> whether to use the internal or the private linkage for the symbols
>> internalized.
>
> I'm not sure this is a good idea - why would you want this?

>From  what I understand, both linkage are similar, except internal
outputs the symbol in the object file (as a local symbol) and private
does not. When I work at the IR level, I always use private linkage
when I need some module-local symbol and never had any trouble with
this.

I suppose this change is more a kind of cosmetic modification, and I
don't see any situation where one of these linkages really differ in
behavior (except for the suffing of the object file's symbol table).
So I also don't see why this could be a bad idea.

I did this patch because I saw from the comments in the code that
someone already thought it could be done (and the patch is small and
easy). Do you know of a scenario where using private over internal
would break something?

Anyway, thanks for the review,

Best regards

-- 
pini



More information about the llvm-commits mailing list