[PATCH] D12903: Allow the -load option in the driver and pass it through to -cc1

Renato Golin via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 16 08:11:34 PDT 2015


rengolin added a comment.

In http://reviews.llvm.org/D12903#247075, @john.brawn wrote:

> The use-case is loading llvm plugins that add optimization passes via the PassManagerBuilder::addGlobalExtension mechanism (i.e. just loading the plugin is enough and you don't have to add anything extra to the command-line). Currently you have to do clang -Xclang -load -Xclang plugin.so, and it would be nicer to be able to do clang -load plugin.so.


Right, I'm not familiar with that extension, so I can't really give an opinion. Maybe some of the Clang folks could help? Feel free to find the appropriate people and add them as reviewers, so they're aware of it.

> I'm not sure how to best add a test for this. Maybe I should add another pass to llvm that's built as a plugin like llvm/lib/Transforms/Hello but that uses PassManagerBuilder::addGlobalExtension and have a clang test that runs that?


Well, since this is Clang, I think just a simple -### test checking that the flag was passed correctly down to CC1 would be enough, as I assume there are tests already for the flag in CC1 mode.


Repository:
  rL LLVM

http://reviews.llvm.org/D12903





More information about the cfe-commits mailing list