[llvm-commits] Patch to add flag in llvm-extract for including aliases in the extraction.
Jan Sjodin
jan_sjodin at yahoo.com
Mon Oct 8 08:56:58 PDT 2012
> 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?
I agree that llvm-extract should do a better job on alaises by default, and what you propose seems
reasonable. In my mind we probably want both -alias and -with-aliases options. One operates only
on aliases, the other is used to bundle aliases with the functions/globals, which is really the capability
that I am looking for. It could potentially be included as a sub-option like -alias=<with-aliases-special-option>
- Jan
More information about the llvm-commits
mailing list