git: 9a9a55ba2be8 - 2026Q3 - devel/cvise: make it build with DEFAULT_VERSIONS+=llvm=22

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Mon, 13 Jul 2026 18:14:47 UTC
The branch 2026Q3 has been updated by dim:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9a9a55ba2be8bdf3c94636ac4cf46536eb9edee9

commit 9a9a55ba2be8bdf3c94636ac4cf46536eb9edee9
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2026-06-29 13:19:22 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2026-07-13 18:14:36 +0000

    devel/cvise: make it build with DEFAULT_VERSIONS+=llvm=22
    
    Upstream cvise added support for building against llvm 22 in:
    <https://github.com/marxin/cvise/commit/42da06f>
    <https://github.com/marxin/cvise/commit/59e9058>
    <https://github.com/marxin/cvise/commit/fa1be95>
    <https://github.com/marxin/cvise/commit/b17bbac>
    <https://github.com/marxin/cvise/commit/c7f9642>
    
    Add these as PATCHFILES, and use a similar approach for the llvm 21
    patch.
    
    PR:             296376
    Approved by:    maintainer timeout (2 weeks)
    MFH:            2026Q3
    
    (cherry picked from commit 358f3c706f394dabc1b0eb1787d89f14bf5b03b5)
---
 devel/cvise/Makefile           |   9 +++
 devel/cvise/distinfo           |  14 +++-
 devel/cvise/files/patch-llvm21 | 152 -----------------------------------------
 3 files changed, 22 insertions(+), 153 deletions(-)

diff --git a/devel/cvise/Makefile b/devel/cvise/Makefile
index f8ffea061445..fba9ee204968 100644
--- a/devel/cvise/Makefile
+++ b/devel/cvise/Makefile
@@ -1,8 +1,17 @@
 PORTNAME=	cvise
 DISTVERSIONPREFIX=	v
 DISTVERSION=	2.12.0
+PORTREVISION=	1
 CATEGORIES=	devel python
 
+PATCH_SITES=	https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
+PATCHFILES+=	68262f7d6de584b6474801827cb7dfc68011de25.patch:-p1 # Add support for LLVM 21 as of 2025.06.24 (#183)
+PATCHFILES+=	42da06fd108c351c5f4a42657c16208300121545.patch:-p1 # clang_delta: Add tests for replace-dependent-typedef (#275)
+PATCHFILES+=	59e9058c43b12b802893bde668113c8b3b3525b7.patch:-p1 # clang_delta: Skip non-dep typedefs in replace-dependent-typedef (#276)
+PATCHFILES+=	fa1be9523d569adfe207c85a1e44f074172bc305.patch:-p1 # Support for LLVM 22 (#373)
+PATCHFILES+=	b17bbacdb279babd87dc9ef24756f3003746717c.patch:-p1 # clang_delta: Support for LLVM 22 20251014 (#430)
+PATCHFILES+=	c7f9642340eb61c09a05c96498fd21c9b7293770.patch:-p1 # Support for LLVM 22 updated, as of 2025-10-25 (#439)
+
 MAINTAINER=	bofh@FreeBSD.org
 COMMENT=	C-Vise is a super-parallel Python port of the C-Reduce
 WWW=		https://github.com/marxin/cvise
diff --git a/devel/cvise/distinfo b/devel/cvise/distinfo
index 9fb50593eb4a..514c984d20a4 100644
--- a/devel/cvise/distinfo
+++ b/devel/cvise/distinfo
@@ -1,3 +1,15 @@
-TIMESTAMP = 1758790001
+TIMESTAMP = 1782737253
 SHA256 (marxin-cvise-v2.12.0_GH0.tar.gz) = 7eb3b2ec4e64e3033cb47e35363336f50b1313a34a106609ad1110c532389779
 SIZE (marxin-cvise-v2.12.0_GH0.tar.gz) = 274458
+SHA256 (68262f7d6de584b6474801827cb7dfc68011de25.patch) = 0a690589ec49fdd2bf714f456313919409ceb84635e0129b816ba4432b5ae4aa
+SIZE (68262f7d6de584b6474801827cb7dfc68011de25.patch) = 7238
+SHA256 (42da06fd108c351c5f4a42657c16208300121545.patch) = 3660a6024637eb33a07d170ddc6f704098de49de91c4a942145e86265f683581
+SIZE (42da06fd108c351c5f4a42657c16208300121545.patch) = 5376
+SHA256 (59e9058c43b12b802893bde668113c8b3b3525b7.patch) = b912849fa3fb9528af11c4949aaecd818762950c9203a922857845cd8d9488ba
+SIZE (59e9058c43b12b802893bde668113c8b3b3525b7.patch) = 6884
+SHA256 (fa1be9523d569adfe207c85a1e44f074172bc305.patch) = b5a2d033c3fbd9b995a4bdb04334569ddd8284bfe9fa1c17d7f9e5ce5d5ba838
+SIZE (fa1be9523d569adfe207c85a1e44f074172bc305.patch) = 49886
+SHA256 (b17bbacdb279babd87dc9ef24756f3003746717c.patch) = b6ee407c2018aca52f68525c17925b9bb2493ea584602b601ac75029a8fc375c
+SIZE (b17bbacdb279babd87dc9ef24756f3003746717c.patch) = 2144
+SHA256 (c7f9642340eb61c09a05c96498fd21c9b7293770.patch) = 18574c5a73f214c2e1b8c429e9c6ace2e3872907f6db8ea6007ff794b930d6d0
+SIZE (c7f9642340eb61c09a05c96498fd21c9b7293770.patch) = 17093
diff --git a/devel/cvise/files/patch-llvm21 b/devel/cvise/files/patch-llvm21
deleted file mode 100644
index 750ff4d1da11..000000000000
--- a/devel/cvise/files/patch-llvm21
+++ /dev/null
@@ -1,152 +0,0 @@
-commit 68262f7d6de584b6474801827cb7dfc68011de25
-Author: Maksim Ivanov <emaxx@google.com>
-Date:   2025-06-24T22:14:34+02:00
-
-    Add support for LLVM 21 as of 2025.06.24 (#183)
-
-    Adjust the C++ code according to backwards-incompatible changes
-    that are being made in the tip-of-the-tree LLVM sources (for the upcoming
-    21 release).
-
-    Switch the CI-LLVM-nightly job to using LLVM version 21.
-
-    This fixes #171.
-
---- .github/workflows/build-llvm-nightly.yml.orig	2025-09-23 20:51:29 UTC
-+++ .github/workflows/build-llvm-nightly.yml
-@@ -27,10 +27,10 @@ jobs:
-       - run: nproc
-       - run: wget https://apt.llvm.org/llvm.sh
-       - run: chmod +x llvm.sh
--      - run: ./llvm.sh 20
--      - run: apt-get install -y bolt-20 clang-20 libclang-common-20-dev libclang-20-dev mlir-20-tools llvm-20-tools libclang-common-20-dev libclang-20-dev libclang1-20 clang-format-20 python3-clang-20 clangd-20 clang-tidy-20 libomp-20-dev
-+      - run: ./llvm.sh 21
-+      - run: apt-get install -y bolt-21 clang-21 libclang-common-21-dev libclang-21-dev mlir-21-tools llvm-21-tools libclang-common-21-dev libclang-21-dev libclang1-21 clang-format-21 python3-clang-21 clangd-21 clang-tidy-21 libomp-21-dev
-       # TODO: remove in the future
--      - run: touch /usr/lib/llvm-20/lib/libLibcTableGenUtil.a
-+      - run: touch /usr/lib/llvm-21/lib/libLibcTableGenUtil.a
-       - uses: actions/checkout@v4
-       - run: mkdir objdir
-       - run: cmake ..
---- clang_delta/CommonRenameClassRewriteVisitor.h.orig	2025-09-23 20:51:29 UTC
-+++ clang_delta/CommonRenameClassRewriteVisitor.h
-@@ -368,7 +368,12 @@ template<typename T> bool CommonRenameClassRewriteVisi
-     dyn_cast<DependentTemplateSpecializationType>(Ty);
-   TransAssert(DTST && "Bad DependentTemplateSpecializationType!");
- 
--  const IdentifierInfo *IdInfo = DTST->getIdentifier();
-+  const IdentifierInfo *IdInfo =
-+#if LLVM_VERSION_MAJOR > 20
-+    DTST->getDependentTemplateName().getName().getIdentifier();
-+#else
-+    DTST->getIdentifier();
-+#endif
-   std::string IdName = IdInfo->getName().str();
-   std::string Name;
-   if (getNewNameByName(IdName, Name)) {
---- clang_delta/RemoveNamespace.cpp.orig	2025-09-23 20:51:29 UTC
-+++ clang_delta/RemoveNamespace.cpp
-@@ -440,7 +440,12 @@ bool RemoveNamespaceRewriteVisitor::VisitDependentTemp
-     dyn_cast<DependentTemplateSpecializationType>(Ty);
-   TransAssert(DTST && "Bad DependentTemplateSpecializationType!");
- 
--  const IdentifierInfo *IdInfo = DTST->getIdentifier();
-+  const IdentifierInfo *IdInfo =
-+#if LLVM_VERSION_MAJOR > 20
-+    DTST->getDependentTemplateName().getName().getIdentifier();
-+#else
-+    DTST->getIdentifier();
-+#endif
-   std::string IdName = IdInfo->getName().str();
-   std::string Name;
- 
-@@ -563,7 +568,9 @@ bool RemoveNamespaceRewriteVisitor::TraverseNestedName
-         break;
-       }
-       case NestedNameSpecifier::TypeSpec: // Fall-through
-+#if LLVM_VERSION_MAJOR <= 20
-       case NestedNameSpecifier::TypeSpecWithTemplate:
-+#endif
-         TraverseTypeLoc(Loc.getTypeLoc());
-         break;
-       default:
---- clang_delta/RemoveUnusedFunction.cpp.orig	2025-09-23 20:51:29 UTC
-+++ clang_delta/RemoveUnusedFunction.cpp
-@@ -254,7 +254,11 @@ bool RUFAnalysisVisitor::VisitFunctionDecl(FunctionDec
- 
-   if (FD->isReferenced() ||
-       FD->isMain() ||
-+#if LLVM_VERSION_MAJOR > 20
-+      FD->hasAttr<DeviceKernelAttr>() ||
-+#else
-       FD->hasAttr<OpenCLKernelAttr>() ||
-+#endif
-       ConsumerInstance->hasReferencedSpecialization(CanonicalFD) ||
-       ConsumerInstance->isInlinedSystemFunction(CanonicalFD) ||
-       ConsumerInstance->isInReferencedSet(CanonicalFD) ||
---- clang_delta/RenameFun.cpp.orig	2025-09-23 20:51:29 UTC
-+++ clang_delta/RenameFun.cpp
-@@ -261,7 +261,13 @@ void RenameFun::addFun(const FunctionDecl *FD)
- {
-   std::string Name = FD->getNameAsString();
-   // Skip special functions
--  if (isSpecialFun(Name) || FD->hasAttr<OpenCLKernelAttr>())
-+  if (isSpecialFun(Name) ||
-+#if LLVM_VERSION_MAJOR > 20
-+      FD->hasAttr<DeviceKernelAttr>()
-+#else
-+      FD->hasAttr<OpenCLKernelAttr>()
-+#endif
-+     )
-     FunToNameMap[FD] = Name;
- 
-   if (FunToNameMap.find(FD) != FunToNameMap.end())
---- clang_delta/Transformation.cpp.orig	2025-09-23 20:51:29 UTC
-+++ clang_delta/Transformation.cpp
-@@ -675,7 +675,10 @@ const DeclContext *Transformation::getDeclContextFromS
-         return NAD->getNamespace()->getCanonicalDecl();
-       }
-       case NestedNameSpecifier::TypeSpec: // Fall-through
--      case NestedNameSpecifier::TypeSpecWithTemplate: {
-+#if LLVM_VERSION_MAJOR <= 20
-+      case NestedNameSpecifier::TypeSpecWithTemplate:
-+#endif
-+    {
-         const Type *Ty = NNS->getAsType();
-         if (const RecordType *RT = Ty->getAs<RecordType>())
-           return RT->getDecl();
-@@ -1163,4 +1166,3 @@ Transformation::~Transformation(void)
- {
-   RewriteUtils::Finalize();
- }
--
---- clang_delta/TransformationManager.cpp.orig	2025-09-23 20:51:29 UTC
-+++ clang_delta/TransformationManager.cpp
-@@ -163,7 +163,12 @@ bool TransformationManager::initializeCompilerInstance
-     ClangInstance->createFileManager();
- 
-     if(CLCPath != NULL && ClangInstance->hasFileManager() &&
--       ClangInstance->getFileManager().getDirectory(CLCPath, false)) {
-+#if LLVM_VERSION_MAJOR > 20
-+	ClangInstance->getFileManager().getDirectoryRef(CLCPath, false)
-+#else
-+	ClangInstance->getFileManager().getDirectory(CLCPath, false)
-+#endif
-+      ) {
-         Args.push_back("-I");
-         Args.push_back(CLCPath);
-     }
-@@ -186,7 +191,12 @@ bool TransformationManager::initializeCompilerInstance
- 
-   TargetInfo *Target = 
-     TargetInfo::CreateTargetInfo(ClangInstance->getDiagnostics(),
--                                 ClangInstance->getInvocation().TargetOpts);
-+#if LLVM_VERSION_MAJOR > 20
-+				ClangInstance->getInvocation().getTargetOpts()
-+#else
-+				ClangInstance->getInvocation().TargetOpts
-+#endif
-+	);
-   ClangInstance->setTarget(Target);
- 
-   if (const char *env = getenv("CVISE_INCLUDE_PATH")) {