<div dir="ltr">Hi All,<div><br></div><div>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.</div>
<div><br></div><div style>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.</div><div style><br></div><div style>
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.</div>
<div style><br></div><div style>Cheers,</div><div style>Lang.</div></div>