[llvm] [lit] Fix errors with wasm32-wasi (PR #92505)

YAMAMOTO Takashi via llvm-commits llvm-commits at lists.llvm.org
Fri May 17 00:11:21 PDT 2024


https://github.com/yamt created https://github.com/llvm/llvm-project/pull/92505

This fixes errors like:
```
fatal: Could not turn 'wasm32-wasi' into Itanium ABI triple
```

>From 429c411e74600672c082d3812870c1810fd7e272 Mon Sep 17 00:00:00 2001
From: YAMAMOTO Takashi <yamamoto at midokura.com>
Date: Fri, 17 May 2024 16:09:11 +0900
Subject: [PATCH] [lit] Fix errors with wasm32-wasi

This fixes errors like:
```
fatal: Could not turn 'wasm32-wasi' into Itanium ABI triple
```
---
 llvm/utils/lit/lit/llvm/config.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/llvm/utils/lit/lit/llvm/config.py b/llvm/utils/lit/lit/llvm/config.py
index 1d4babc99984b..a80f552ed16e5 100644
--- a/llvm/utils/lit/lit/llvm/config.py
+++ b/llvm/utils/lit/lit/llvm/config.py
@@ -355,9 +355,8 @@ def get_clang_has_lsan(self, clang, triple):
     def make_itanium_abi_triple(self, triple):
         m = re.match(r"(\w+)-(\w+)-(\w+)", triple)
         if not m:
-            self.lit_config.fatal(
-                "Could not turn '%s' into Itanium ABI triple" % triple
-            )
+            # eg. wasm32-wasi comes here
+            return triple
         if m.group(3).lower() != "windows":
             # All non-windows triples use the Itanium ABI.
             return triple
@@ -366,7 +365,8 @@ def make_itanium_abi_triple(self, triple):
     def make_msabi_triple(self, triple):
         m = re.match(r"(\w+)-(\w+)-(\w+)", triple)
         if not m:
-            self.lit_config.fatal("Could not turn '%s' into MS ABI triple" % triple)
+            # eg. wasm32-wasi comes here
+            return triple
         isa = m.group(1).lower()
         vendor = m.group(2).lower()
         os = m.group(3).lower()



More information about the llvm-commits mailing list