From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Thomas Munro <tmunro@postgresql.org>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: pgsql: jit: Support opaque pointers in LLVM 16.
Date: Mon, 6 Nov 2023 19:11:54 +0100
Message-ID: <202311061811.m5heranea4gj@alvherre.pgsql> (raw)
In-Reply-To: <E1qt3rg-00195L-KR@gemulon.postgresql.org>
On 2023-Oct-18, Thomas Munro wrote:
> jit: Support opaque pointers in LLVM 16.
>
> Remove use of LLVMGetElementType() and provide the type of all pointers
> to LLVMBuildXXX() functions when emitting IR, as required by modern LLVM
> versions[1].
>
> * For LLVM <= 14, we'll still use the old LLVMBuildXXX() functions.
I have LLVM 14 (whatever Debian ships[*]), and running headerscheck results
in a bunch of warnings from this:
In file included from /tmp/headerscheck.s89Gdv/test.c:2:
/pgsql/source/master/src/include/jit/llvmjit_emit.h: In function ‘l_call’:
/pgsql/source/master/src/include/jit/llvmjit_emit.h:141:9: warning: ‘LLVMBuildCall’ is deprecated [-Wdeprecated-declarations]
141 | return LLVMBuildCall(b, fn, args, nargs, name);
| ^~~~~~
In file included from /usr/include/llvm-c/Core.h:18,
from /pgsql/source/master/src/include/jit/llvmjit_emit.h:18:
/usr/include/llvm-c/Core.h:3991:1: note: declared here
3991 | LLVM_ATTRIBUTE_C_DEPRECATED(
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
These warnings go away if I change the conditional from
LLVM_VERSION_MAJOR < 16 to 14.
Let's ... do that? As in the attached patch.
In 13, there's a comment about it being deprecated, but no macro to make
the compiler whine:
https://github.com/hdoc/llvm-project/blob/release/13.x/llvm/include/llvm-c/Core.h#L3953
This changed in 14:
https://github.com/hdoc/llvm-project/blob/release/14.x/llvm/include/llvm-c/Core.h#L3898
[*] apt policy llvm:
llvm:
Installed: 1:14.0-55.7~deb12u1
Candidate: 1:14.0-55.7~deb12u1
Version table:
*** 1:14.0-55.7~deb12u1 500
500 http://ftp.de.debian.org/debian bookworm/main amd64 Packages
100 /var/lib/dpkg/status
--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/Attachments:
0001-use-non-deprecated-LLVM-functions-starting-with-its-.patch (text/x-diff, 0B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: alvherre@alvh.no-ip.org, tmunro@postgresql.org, pgsql-hackers@lists.postgresql.org
Subject: Re: pgsql: jit: Support opaque pointers in LLVM 16.
In-Reply-To: <202311061811.m5heranea4gj@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox