[llvm] [llvm][lit] Handle case when there is no llvm default target triple (PR #76934)

David Spickett via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 4 07:01:29 PST 2024


================
@@ -632,15 +632,28 @@ def use_clang(
             self.add_tool_substitutions(tool_substitutions)
             self.config.substitutions.append(("%resource_dir", builtin_include_dir))
 
-        self.config.substitutions.append(
-            (
-                "%itanium_abi_triple",
-                self.make_itanium_abi_triple(self.config.target_triple),
+        # There will be no default target triple if one was not specifically
+        # set, and the host's architecture is not an enabled target.
+        if (
+            self.config.target_triple
+            and self.config.target_triple != "@LLVM_TARGET_TRIPLE@"
----------------
DavidSpickett wrote:

Sure, the code below for `config.host_triple` does both but I can't explain exactly when it would not be expanded. Easy enough to add the same check for `config.target_triple` if anyone does manage to hit that situation in future.

I've applied your suggestion.

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


More information about the llvm-commits mailing list