[PATCH] D36227: [ELF] - LTO: Try to be option compatible with the gold plugin.
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 3 04:30:25 PDT 2017
grimar added inline comments.
================
Comment at: ELF/Driver.cpp:623
+ StringRef Opt, unsigned Default) {
+ for (auto *Arg : Args.filtered(Key, OPT_plugin_opt, OPT_plugin_opt_eq)) {
+ StringRef Val;
----------------
ruiu wrote:
> This function is unnecessarily too complicated. Don't mix Key with other plugin options. Handle Key first, and then if Key does not exist, handle others. I.e.
>
> if (Args.hasArg(Key))
> return getInteger(Args, Key, Default);
> ...
If I do that then mix of options will work incorrectly, example:
`ld.lld --lto-O0 --plugin-opt=O6 ...`
will set optimization level 0 instead of 6
https://reviews.llvm.org/D36227
More information about the llvm-commits
mailing list