[PATCH] Make discardable symbols externally visible to prevent discarding in llvm-extract.

Lang Hames lhames at gmail.com
Mon Mar 4 14:41:50 PST 2013


Thanks for the review Jim and Meador. Committed in r176459.

- Lang.


On Mon, Mar 4, 2013 at 11:34 AM, Meador Inge <meadori at codesourcery.com>wrote:

> On 03/03/2013 06:40 PM, Lang Hames wrote:
>
> > Hi All,
> >
> > llvm-extract has tricked me a couple of times by handing me back an
> empty module
> > when I asked it to extract a linkonce function. The problem is that when
> DCE
> > tidies up the module, it strips out the function that you wanted to
> extract.
> >
> > To avoid that problem, this patch sets the linkage on any function that
> was
> > requested on the command line, and that would be discarded by DCE, to
> > ExternalLinkage.
> >
> > Given the use cases that I'm aware of for llvm-extract I think this
> should be an
> > improvement. It certainly seems better than handing back an empty
> module. If
> > anybody is concerned about this quietly changing the linkage type then I
> can
> > improve the patch to restore the original linkage types after DCE is run.
>
> Test case?  I see a few tests using llvm-extract under test/Other/.
>
>
> --
> Meador Inge
> CodeSourcery / Mentor Embedded
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130304/dd339260/attachment.html>


More information about the llvm-commits mailing list