From 7b60f8f385ecdda80a82d6a99df0db4de2b689a3 Mon Sep 17 00:00:00 2001
From: Thomas Munro <thomas.munro@gmail.com>
Date: Mon, 29 Dec 2025 18:13:57 +1300
Subject: [PATCH] jit: Remove suppression of deprecation warnings.

REL_18_STABLE and master have commit ee485912, so they always use the
new opaque pointer API.  Revert commit a56e7b660 in those branches, so
that we look out for any new deprecation warnings that arrive in future
LLVM versions.

Older branches continued to use functions marked deprecated in LLVM 14
and 15 (but not LLVM 16+), as a precaution against unforeseen
compatibility problems with bitcode already shipped.  In those branches,
the comment explaining the warning suppression is updated to explain
that.  In theory those branches could apply the warning suppression only
for LLVM 14 and 15 specifically, but that isn't done here.

Backpatch-through: 14
Reported-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/1407185.1766682319%40sss.pgh.pa.us
---
 src/backend/jit/llvm/Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/backend/jit/llvm/Makefile b/src/backend/jit/llvm/Makefile
index 68677ba42e1..1af95582ea3 100644
--- a/src/backend/jit/llvm/Makefile
+++ b/src/backend/jit/llvm/Makefile
@@ -22,8 +22,10 @@ endif
 PGFILEDESC = "llvmjit - JIT using LLVM"
 NAME = llvmjit
 
-# LLVM 14 produces deprecation warnings.  We'll need to make some changes
-# before the relevant functions are removed, but for now silence the warnings.
+# Some functions called in LLVM 14 and LLVM 15 are marked with GCC deprecation
+# attributes.  For LLVM 16 and later, we use the newer replacement functions
+# instead, but warnings are suppressed unconditionally.  (Note that this is
+# only done in branches before REL_18_STABLE.)
 ifeq ($(GCC), yes)
 LLVM_CFLAGS += -Wno-deprecated-declarations
 endif
-- 
2.52.0

