<p dir="ltr"><br>
On Apr 20, 2015 4:59 PM, "Duncan P. N. Exon Smith" <<a href="mailto:dexonsmith@apple.com">dexonsmith@apple.com</a>> wrote:<br>
><br>
><br>
> > On 2015-Apr-20, at 13:28, Luqman Aden <<a href="mailto:me%2Bllvm@luqman.ca">me+llvm@luqman.ca</a>> wrote:<br>
> ><br>
> > From df1b11c561dc826d8e4836b9e910ac75185bcf05 Mon Sep 17 00:00:00 2001<br>
> > From: Luqman Aden <<a href="mailto:luqman@apple.com">luqman@apple.com</a>><br>
> > Date: Wed, 15 Apr 2015 12:22:32 -0700<br>
> > Subject: [PATCH] llvm-link: Add -override flag to prefer one of a duplicate<br>
> >  symbol.<br>
> ><br>
> > ---<br>
> >  include/llvm/Linker/Linker.h       |  4 +++-<br>
> >  lib/Linker/LinkModules.cpp         | 20 +++++++++++++++----<br>
> >  test/tools/llvm-link/Inputs/foo.ll |  4 ++++<br>
> >  test/tools/llvm-link/hello.ll      | 20 +++++++++++++++++++<br>
> >  test/tools/llvm-link/lit.local.cfg |  1 +<br>
> >  tools/llvm-link/llvm-link.cpp      | 40 ++++++++++++++++++++++++--------------<br>
> >  6 files changed, 69 insertions(+), 20 deletions(-)<br>
> >  create mode 100644 test/tools/llvm-link/Inputs/foo.ll<br>
> >  create mode 100644 test/tools/llvm-link/hello.ll<br>
> >  create mode 100644 test/tools/llvm-link/lit.local.cfg<br>
> ><br>
><br>
> > From df1b11c561dc826d8e4836b9e910ac75185bcf05 Mon Sep 17 00:00:00 2001<br>
> > From: Luqman Aden <<a href="mailto:luqman@apple.com">luqman@apple.com</a>><br>
> > Date: Wed, 15 Apr 2015 12:22:32 -0700<br>
> > Subject: [PATCH] llvm-link: Add -override flag to prefer one of a duplicate<br>
> >  symbol.<br>
><br>
> Luqman and I talked in person, and he added some context for this (seems<br>
> to still be missing from llvm-commits?).  The idea is to support an LLVM<br>
> developer workflow where a subset of the module is extracted to a side<br>
> module to be manipulated or optimized differently.  Sometime before<br>
> CodeGen, these functions are merged back in, and should replace the<br>
> copies in the "main" module (regardless of IR linkage types).<br>
><br>
> This seems like a pretty useful debugging workflow to me, and the<br>
> approach in this patch seems about right.<br>
><br>
> @Rafael, I'd appreciate your opinion on this.<br></p>
<p dir="ltr">I think I will eventually need to add support for telling lib/Linker exactly which symbols to copy. This will be to fix the hacks/bugs in tools/gold.</p>
<p dir="ltr">So this seems like a reasonable special case.</p>
<p dir="ltr">No objections to the idea. </p>
<p dir="ltr">Cheers, <br>
Rafael</p>