[PATCH] llvm-link: Add -override flag to prefer duplicate symbols from one module.
Rafael EspĂndola
rafael.espindola at gmail.com
Mon Apr 20 15:22:23 PDT 2015
On Apr 20, 2015 4:59 PM, "Duncan P. N. Exon Smith" <dexonsmith at apple.com>
wrote:
>
>
> > On 2015-Apr-20, at 13:28, Luqman Aden <me+llvm at luqman.ca> wrote:
> >
> > From df1b11c561dc826d8e4836b9e910ac75185bcf05 Mon Sep 17 00:00:00 2001
> > From: Luqman Aden <luqman at apple.com>
> > Date: Wed, 15 Apr 2015 12:22:32 -0700
> > Subject: [PATCH] llvm-link: Add -override flag to prefer one of a
duplicate
> > symbol.
> >
> > ---
> > include/llvm/Linker/Linker.h | 4 +++-
> > lib/Linker/LinkModules.cpp | 20 +++++++++++++++----
> > test/tools/llvm-link/Inputs/foo.ll | 4 ++++
> > test/tools/llvm-link/hello.ll | 20 +++++++++++++++++++
> > test/tools/llvm-link/lit.local.cfg | 1 +
> > tools/llvm-link/llvm-link.cpp | 40
++++++++++++++++++++++++--------------
> > 6 files changed, 69 insertions(+), 20 deletions(-)
> > create mode 100644 test/tools/llvm-link/Inputs/foo.ll
> > create mode 100644 test/tools/llvm-link/hello.ll
> > create mode 100644 test/tools/llvm-link/lit.local.cfg
> >
>
> > From df1b11c561dc826d8e4836b9e910ac75185bcf05 Mon Sep 17 00:00:00 2001
> > From: Luqman Aden <luqman at apple.com>
> > Date: Wed, 15 Apr 2015 12:22:32 -0700
> > Subject: [PATCH] llvm-link: Add -override flag to prefer one of a
duplicate
> > symbol.
>
> Luqman and I talked in person, and he added some context for this (seems
> to still be missing from llvm-commits?). The idea is to support an LLVM
> developer workflow where a subset of the module is extracted to a side
> module to be manipulated or optimized differently. Sometime before
> CodeGen, these functions are merged back in, and should replace the
> copies in the "main" module (regardless of IR linkage types).
>
> This seems like a pretty useful debugging workflow to me, and the
> approach in this patch seems about right.
>
> @Rafael, I'd appreciate your opinion on this.
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.
So this seems like a reasonable special case.
No objections to the idea.
Cheers,
Rafael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150420/fb806354/attachment.html>
More information about the llvm-commits
mailing list