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

Jan Sjodin jan_sjodin at yahoo.com
Wed Oct 31 11:59:36 PDT 2012


>I guess the question is more why do you care that when extracting a

>symbol foo, every alias that points to foo is also extracted?


My original task was to split a module into individual functions and global variables. The question was where should the aliases go? I chose to bundle them with the aliasees. I have written a separate tool that does everything in one go, but that is another story. If the -alias is enough for most people I think we can skip adding the -with-aliases. The question is if "convenience options" like, -with-aliases, belong in the llvm-extract tool, or if that is supposed to be done externally?


>I see that your patch uses the recursive .resolveAliasedGlobal. If you run
>$ llvm-extract -with-aliases -alias=foo, don't you want to extract
>aliases that alias foo?

Yes, now that the -alias flag exists, that is true.


>What should be done when you hit a weak symbol? Should you be passing
>false to resolveAliasedGlobal? Please include a testcase showing the
>desired behavior.

The choice I made was to not stop at weak symbols, but this could obvbiously be controlled e.g. with -with-aliases=[all/strong].


>The bit about erasing aliases is out of date, aliases are handled by
>createGVExtractionPass now, so you should only have to put them in
>GVs.


Ok, I will update the patch after we decide what to do with the -with-aliases option.


- Jan





More information about the llvm-commits mailing list