summaryrefslogtreecommitdiff
path: root/src/backend/jit/llvm/llvmjit.c
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2025-09-17 12:00:16 +1200
committerThomas Munro <tmunro@postgresql.org>2025-09-17 13:38:35 +1200
commit0951942bba25f85ad29a4f096ed51a356652b5a2 (patch)
treeb8a5c6c88fdfcdbf4ab19ede16518c0b9a4413c3 /src/backend/jit/llvm/llvmjit.c
parent39f67d9b554fcd6dfb6c4f02a4af757eecd1fecf (diff)
jit: Fix type used for Datum values in LLVM IR.
Commit 2a600a93 made Datum 8 bytes wide everywhere. It was no longer appropriate to use TypeSizeT on 32 bit systems, and JIT compilation would fail with various type check errors. Introduce a separate LLVMTypeRef with the name TypeDatum. TypeSizeT is still used in some places for actual size_t values. Reported-by: Dmitry Mityugov <d.mityugov@postgrespro.ru> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Tested-by: Dmitry Mityugov <d.mityugov@postgrespro.ru> Discussion: https://postgr.es/m/0a9f0be59171c2e8f1b3bc10f4fcf267%40postgrespro.ru
Diffstat (limited to 'src/backend/jit/llvm/llvmjit.c')
-rw-r--r--src/backend/jit/llvm/llvmjit.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/backend/jit/llvm/llvmjit.c b/src/backend/jit/llvm/llvmjit.c
index 46511624f01..e978b996bae 100644
--- a/src/backend/jit/llvm/llvmjit.c
+++ b/src/backend/jit/llvm/llvmjit.c
@@ -54,6 +54,7 @@ typedef struct LLVMJitHandle
/* types & functions commonly needed for JITing */
LLVMTypeRef TypeSizeT;
+LLVMTypeRef TypeDatum;
LLVMTypeRef TypeParamBool;
LLVMTypeRef TypeStorageBool;
LLVMTypeRef TypePGFunction;
@@ -1011,6 +1012,7 @@ llvm_create_types(void)
LLVMDisposeMemoryBuffer(buf);
TypeSizeT = llvm_pg_var_type("TypeSizeT");
+ TypeDatum = llvm_pg_var_type("TypeDatum");
TypeParamBool = load_return_type(llvm_types_module, "FunctionReturningBool");
TypeStorageBool = llvm_pg_var_type("TypeStorageBool");
TypePGFunction = llvm_pg_var_type("TypePGFunction");