[clang] [clang] Add Swift support for MIPS (PR #205461)

Alsey Coleman Miller via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 26 06:01:11 PDT 2026


https://github.com/colemancda updated https://github.com/llvm/llvm-project/pull/205461

>From 3ef9456afd89e8b0865405f606626d80ceff309b Mon Sep 17 00:00:00 2001
From: Alsey Coleman Miller <alseycmiller at gmail.com>
Date: Wed, 24 Jun 2026 20:15:51 -0400
Subject: [PATCH] [clang] Add Swift support for MIPS

Adds support for compiling Swift targeting the MIPS ABI
---
 clang/lib/CodeGen/Targets/Mips.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/clang/lib/CodeGen/Targets/Mips.cpp b/clang/lib/CodeGen/Targets/Mips.cpp
index 22fdcd95ea8fa..3693e5dbfa91c 100644
--- a/clang/lib/CodeGen/Targets/Mips.cpp
+++ b/clang/lib/CodeGen/Targets/Mips.cpp
@@ -44,7 +44,10 @@ class MIPSTargetCodeGenInfo : public TargetCodeGenInfo {
 public:
   MIPSTargetCodeGenInfo(CodeGenTypes &CGT, bool IsO32)
       : TargetCodeGenInfo(std::make_unique<MipsABIInfo>(CGT, IsO32)),
-        SizeOfUnwindException(IsO32 ? 24 : 32) {}
+        SizeOfUnwindException(IsO32 ? 24 : 32) {
+    SwiftInfo =
+        std::make_unique<SwiftABIInfo>(CGT, /*SwiftErrorInRegister=*/false);
+  }
 
   int getDwarfEHStackPointer(CodeGen::CodeGenModule &CGM) const override {
     return 29;



More information about the cfe-commits mailing list