[llvm] Triple: Fix handling of macos with unexpected target arches (PR #75469)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 19 15:02:42 PST 2023


MaskRay wrote:

> @MaskRay FYI (since you did a bunch of march -> mtriple changes that were necessary before this).

Thanks for CCing me!

```
  EXPECT_EQ(Triple::ELF, Triple("amdgcn-apple-macosx").getObjectFormat());
  EXPECT_EQ(Triple::ELF, Triple("r600-apple-macosx").getObjectFormat());
```

I know this serves as a change detector about the current behavior and not an endorsement of what this makes sense.

However, ELF does not make more sense here. If we want to unsupport some unexpected target triples, I feel that the change should be made at an upper level, or change the return value to `UnknownObjectFormat`.

If the issue is `{opt,llc} -march=...`, fix them to switch to `-mtriple=` instead.

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


More information about the llvm-commits mailing list