[clang] [Clang][Driver][LTO] Fix empty stats filename when in LTO mode (PR #71197)
Min-Yih Hsu via cfe-commits
cfe-commits at lists.llvm.org
Sun Nov 5 11:30:37 PST 2023
================
@@ -535,7 +535,15 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
if (D.isUsingLTO()) {
assert(!Inputs.empty() && "Must have at least one input.");
- addLTOOptions(ToolChain, Args, CmdArgs, Output, Inputs[0],
+ // Find the first filename InputInfo object.
+ auto Input = llvm::find_if(
+ Inputs, [](const InputInfo &II) -> bool { return II.isFilename(); });
+ if (Input == Inputs.end())
+ // For a very rare case, all of the inputs to the linker are
+ // flags. If that happens, just use the first InputInfo.
----------------
mshockwave wrote:
Done
https://github.com/llvm/llvm-project/pull/71197
More information about the cfe-commits
mailing list