[clang] [lld] [llvm] [llvm][lld][clang] Delay initializing TargetOptions in LTO builds until a Triple is available (PR #179509)

Paul Kirth via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 10 15:50:02 PST 2026


ilovepi wrote:

> If lld::initTargetOptionsFromCodeGenFlags is dead, please delete it.
> 

I've deleted the dead APIs.

> I think I'd prefer to add the specific options that we expect linkers to actually set to llvm::lto::Config, and then have LTO set the target config settings. That lets us review and restrict which bits we're actually exposing here. (And TargetOptions is generally a terrible mechanism for passing options around.)

That sounds like a reasonable idea. A lot of the complexity I'm noticing is in how llvm/lib/LTO.cpp sets up and configures the different backends. There seems to be an awful lot of duplicated code, and  there's also a lot of callbacks getting created/registered. I'm hoping to take a look over the next quarter at refactoring/consolidating/simplifying some of this.

https://github.com/llvm/llvm-project/pull/179509


More information about the cfe-commits mailing list