[PATCH] D36227: [ELF] - LTO: Try to be option compatible with the gold plugin.
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 11 09:08:30 PDT 2017
ruiu added inline comments.
================
Comment at: ELF/Driver.cpp:703
+ for (auto *Arg : Args.filtered(OPT_plugin_opt, OPT_plugin_opt_eq)) {
+ StringRef S = Arg->getValue();
----------------
grimar wrote:
> grimar wrote:
> > ruiu wrote:
> > > plugin_opt_eq is an alias for plugin_opt. Do you have to pass both?
> > I'll recheck.
> > plugin_opt_eq is an alias for plugin_opt. Do you have to pass both?
>
> Yes, so if you have `--plugin-opt=aaa --plugin-opt bbb`, then
> `Args.filtered(OPT_plugin_opt)` will return only `bbb` and
> `Args.filtered(OPT_plugin_opt_eq)` will return only `aaa`.
>
> Not sure if it is a bug or by design of `filtered()`, but atm we need both it seems.
OK, maybe it cannot handle aliases correctly. It is OK for now.
================
Comment at: ELF/Driver.cpp:710
+ else if (S.startswith("O"))
+ Config->LTOO = parseInt(S.drop_front(1), Arg);
+ else if (S.startswith("lto-partitions="))
----------------
drop_front(N) is the same as substr(N), right? Please use substr.
https://reviews.llvm.org/D36227
More information about the llvm-commits
mailing list