[clang] clang: Add BoundArch argument to addClangTargetOptions (PR #196504)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 9 06:45:11 PDT 2026


https://github.com/jhuber6 commented:

I'm not a big fan of this, the bound architecture is supposed to be a driver artifact used to build the toolchains and argument lists. Once we have those in place we should probably defer to the arguments. Could we instead just have a helper in CommonArgs or similar?

```c++
StringRef getOffloadArch(const llvm::opt::ArgList &Args) const {   
  if (const llvm::Triple &T = getTriple(); T.isAMDGPU())
    return Args.getLastArgValue(options::OPT_mcpu_EQ);
  return Args.getLastArgValue(options::OPT_march_EQ);
}
```

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


More information about the cfe-commits mailing list