[clang] [LinkerWrapper] Fix `-Xoffload-linker a=b` in offloading (PR #100270)
Joseph Huber via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 24 08:54:55 PDT 2024
================
@@ -1214,7 +1214,13 @@ DerivedArgList getLinkerArgs(ArrayRef<OffloadFile> Input,
// Forward '-Xoffload-linker' options to the appropriate backend.
for (StringRef Arg : Args.getAllArgValues(OPT_device_linker_args_EQ)) {
auto [Triple, Value] = Arg.split('=');
- if (Value.empty())
+ llvm::Triple TT(Triple);
+ // If this isn't a recognized triple then it's an `arg=value` option.
+ if (TT.getArch() <= Triple::ArchType::UnknownArch ||
+ TT.getArch() >= Triple::ArchType::LastArchType)
----------------
jhuber6 wrote:
Good catch
```suggestion
TT.getArch() > Triple::ArchType::LastArchType)
```
https://github.com/llvm/llvm-project/pull/100270
More information about the cfe-commits
mailing list