From 91d1f833cbf6f19b5ebb4ec59a44d122725a5963 Mon Sep 17 00:00:00 2001
From: Thomas Munro <thomas.munro@gmail.com>
Date: Tue, 15 Mar 2022 12:01:49 +1300
Subject: [PATCH] Silence LLVM 14 API deprecation warnings.

We are going to need to handle the opaque pointer API changes[1],
possibly in time for LLVM 15, but in the meantime let's silence the
warnings produced by LLVM 14.

[1] https://llvm.org/docs/OpaquePointers.html

Discussion: https://postgr.es/m/CA%2BhUKG%2Bp%3DfaBQR2PSAqWoWa%2B_tJdKPT0wjZPQe7XcDEttUCgdQ%40mail.gmail.com
---
 src/backend/jit/llvm/Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/backend/jit/llvm/Makefile b/src/backend/jit/llvm/Makefile
index 0268bd46d5..4af57b02b0 100644
--- a/src/backend/jit/llvm/Makefile
+++ b/src/backend/jit/llvm/Makefile
@@ -22,6 +22,12 @@ endif
 PGFILEDESC = "llvmjit - JIT using LLVM"
 NAME = llvmjit
 
+# LLVM 14 produces deprecation warnings.  We'll handle those, but for now
+# silence the warnings.
+ifeq ($(GCC), yes)
+LLVM_CFLAGS += -Wno-deprecated-declarations
+endif
+
 # All files in this directory use LLVM.
 CFLAGS += $(LLVM_CFLAGS)
 CXXFLAGS += $(LLVM_CXXFLAGS)
-- 
2.30.2

