[PATCH] D145273: [lld-macho] Avoid running LTO pipeline for no files

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 3 13:40:39 PST 2023


int3 accepted this revision.
int3 added a comment.
This revision is now accepted and ready to land.

Thanks!! I think we should follow LLD-ELF whenever reasonable/possible, so I like this better



================
Comment at: lld/MachO/Driver.cpp:556
   auto *lto = make<BitcodeCompiler>();
+  bool hasFiles = false;
   for (InputFile *file : inputFiles)
----------------
personally I think it's nicer to have `hasFiles` be a member of `BitcodeCompiler` and have it set by `BitcodeCompiler::add()` -- in principle the `BitcodeCompiler` should already know if it has any files, we shouldn't need to tell it twice


================
Comment at: lld/test/MachO/lto-object-path.ll:42-43
 ; CHECK:             0000000000000000                - 00 0000    SO /tmp/test.cpp
 ; NOOBJPATH-NEXT:    0000000000000000                - 03 0001   OSO /tmp/lto.tmp
+; NOLTOPATH-NEXT:    0000000000000000                - 03 0001   OSO [[DIR]]/test-obj.o
 ;; check that modTime is nonzero when `-object_path_lto` is provided
----------------
ultra nit: "NOOBJPATH" refers to the fact that we are not passing `-object_path_lto`, but "NOLTOPATH" here means we are not passing in any paths to LTO files... the similarity in names seems kind of misleading. Maybe "NOLTOFILES" would be better?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145273



More information about the llvm-commits mailing list