[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
Wed Aug 2 20:24:02 PDT 2017


ruiu added inline comments.


================
Comment at: ELF/Driver.cpp:621
+
+static unsigned getLTOPluginIntOption(opt::InputArgList &Args, unsigned Key,
+                                      StringRef Opt, unsigned Default) {
----------------
Rename getLTOValue.


================
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;
----------------
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);
  ...


https://reviews.llvm.org/D36227





More information about the llvm-commits mailing list