[PATCH] D70577: [Remarks][LTO] Infer remarks file path from -object_path_lto

Steven Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 2 09:12:55 PST 2019


steven_wu requested changes to this revision.
steven_wu added inline comments.
This revision now requires changes to proceed.


================
Comment at: clang/docs/UsersManual.rst:363
 
+   On Darwin platforms, if ``-flto`` is used and the file path is not provided,
+   the output file will be chosen according to the linker argument
----------------
The implementation doesn't check `-flto` is used. You don't need to document this part.


================
Comment at: clang/lib/Driver/ToolChains/Darwin.cpp:433
+  bool ExpectPathNext = false;
+  for (Arg *A : Args) {
+    if (ExpectPathNext) {
----------------
You can use a filtered iterator here. Also I think the last argument of the same type wins, rather than the first one.

This is rather ugly. Can you let linker pass the file path to you through LTO interface, rather to infer that from -Xlinker or -Wl option?


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

https://reviews.llvm.org/D70577





More information about the llvm-commits mailing list