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

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 14 19:56:45 PST 2023


================
@@ -833,8 +831,10 @@ static Triple::ObjectFormatType getDefaultFormat(const Triple &T) {
       return Triple::COFF;
     else if (T.isUEFI())
       return Triple::COFF;
-    return Triple::ELF;
 
+    if (T.isOSDarwin())
----------------
arsenm wrote:

It kind of works but isOSDarwin covers a few too many things:

`    return isMacOSX() || isiOS() || isWatchOS() || isDriverKit();`
```
  bool isiOS() const {
    return getOS() == Triple::IOS || isTvOS();
  }
```


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


More information about the llvm-commits mailing list