[llvm-commits] Patch to add flag in llvm-extract for including aliases in the extraction.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Sat Oct 6 09:02:58 PDT 2012


On 2 October 2012 19:30, Jan Sjodin <jan_sjodin at yahoo.com> wrote:
> It is useful for splitting modules, keeping the aliases and the functions/globals together without getting unrelated aliases in the mix. Combined with llvm-nm it becomes possible to extract a function and find out which aliases belong to it.
>

So, I agree that llvm-extract has a problem with aliases. With your testcase:

$ llvm-extract -func=foo test.ll -o test2.ll -S
$ llvm-extract -delete -func=foo test.ll -o test3.ll -S
$ llvm-link test2.ll test3.ll
llvm-link: link error in 'test3.ll': Linking globals named 'a0foo':
symbol multiply defined!

But I don't think that adding an option is the correct fix. The above
should just work IMHO.  What should happen I think is that test2.ll
should end up with just @foo and test3.ll should end up with @bar and
the 3 aliases.

If anyone wants to extract aliases, we should add a -alias option that
is analogous to -func and -glob.

Would that work for you? Does anyone object to that behavior?

> - Jan
>

Cheers,
Rafael



More information about the llvm-commits mailing list