[PATCH] D61711: [ELF][Driver] Fix precedence of symbol ordering file and CGProfile

Tiancong Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 10 09:50:58 PDT 2019


tcwang added inline comments.


================
Comment at: lld/ELF/Driver.cpp:968-970
+    if (Args.hasArg(OPT_call_graph_ordering_file))
+      error("--symbol-ordering-file should NOT be used together"
+            " with --call-graph-order-file");
----------------
ruiu wrote:
> Check for invalid combination of flags are usually done in `checkOptions()`. Can you write a check for this combination there?
checkOptions() function doesn't take any arguments in but I need Args to check if OPT_call_graph_ordering_file is present or not. It's because the flag is read very late in the stage (just before writeResult<ELFT>() ) and not saved to any Config field, I have to use Args to directly check its presence. Whereas in checkOptions(), all other checkings are done by checking Config fields. Also, if I do check in checkOptions(), which happens after readConfigs(), it needs to read in the file even if an error will be reported later?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61711/new/

https://reviews.llvm.org/D61711





More information about the llvm-commits mailing list