[lld-macho] Avoid running LTO pipeline for no files
authorKeith Smiley <keithbsmiley@gmail.com>
Fri, 3 Mar 2023 21:27:03 +0000 (13:27 -0800)
committerKeith Smiley <keithbsmiley@gmail.com>
Fri, 3 Mar 2023 23:28:59 +0000 (15:28 -0800)
commita65678b35bbce31f09aebb2d1188c385b9dbac5e
tree4906891e363de9468c32556ef334069df9ffcd76
parent5ccdf2afde68346271ad2b1c0a49cbd1bad215dc
[lld-macho] Avoid running LTO pipeline for no files

If no bitcode files are given as inputs but -object_path_lto is passed
we should avoid running the LTO pipeline.

This mirrors this patch from the ELF port https://github.com/llvm/llvm-project/commit/f3994e4dfa0214b2a09a0e327ba37e6b38bbcdb3

Fixes https://github.com/llvm/llvm-project/issues/61031

Differential Revision: https://reviews.llvm.org/D145273
lld/MachO/LTO.cpp
lld/MachO/LTO.h
lld/test/MachO/lto-object-path.ll