From: hololeap <hololeap@protonmail.com>
Date: Mon, 16 Jun 2025 11:40:06 -0700
Subject: [PATCH 1/1] Patch ghc-9.12 for llvm-20 support

This patch was adapted from the original ghc-9.4.5-llvm-16.patch

Thanks-to: Violet Purcell <vimproved@inventati.org>
Bug: https://github.com/gentoo-haskell/gentoo-haskell/issues/1519
Signed-off-by: hololeap <hololeap@protonmail.com>
--- a/llvm-passes
+++ b/llvm-passes
@@ -1,5 +1,5 @@
 [
-(0, "-passes=function(require<tbaa>),function(mem2reg),globalopt,function(lower-expect)"),
-(1, "-passes=default<O1>"),
-(2, "-passes=default<O2>")
+(0, "-passes=module(default<O0>,function(mem2reg),globalopt,function(lower-expect))"),
+(1, "-passes=module(default<O1>,globalopt)"),
+(2, "-passes=module(default<O2>)")
 ]

--- a/configure.ac
+++ b/configure.ac
@@ -528,7 +528,7 @@ AC_SUBST(InstallNameToolCmd)
 # versions of LLVM simultaneously, but that stopped working around
 # 3.5/3.6 release of LLVM.
 LlvmMinVersion=13  # inclusive
-LlvmMaxVersion=20  # not inclusive
+LlvmMaxVersion=21  # not inclusive
 AC_SUBST([LlvmMinVersion])
 AC_SUBST([LlvmMaxVersion])
 
-- 
2.49.0

