mirror of
https://github.com/postgres/postgres.git
synced 2025-07-11 10:01:57 +03:00
Adapt expression JIT to stdbool.h introduction.
The LLVM JIT provider uses clang to synchronize types between normal C code and runtime generated code. Clang represents stdbool.h style booleans in return values & parameters differently from booleans stored in variables. Thus the expression compilation code from2a0faed9d
needs to be adapted to9a95a77d9
. Instead of hardcoding i8 as the type for booleans (which already was wrong on some edge case platforms!), use postgres' notion of a boolean as used for storage and for parameters. Per buildfarm animal xenodermus. Author: Andres Freund
This commit is contained in:
@ -78,6 +78,24 @@ l_sizet_const(size_t i)
|
||||
return LLVMConstInt(TypeSizeT, i, false);
|
||||
}
|
||||
|
||||
/*
|
||||
* Emit constant boolean, as used for storage (e.g. global vars, structs).
|
||||
*/
|
||||
static inline LLVMValueRef
|
||||
l_sbool_const(bool i)
|
||||
{
|
||||
return LLVMConstInt(TypeStorageBool, (int) i, false);
|
||||
}
|
||||
|
||||
/*
|
||||
* Emit constant boolean, as used for parameters (e.g. function parameters).
|
||||
*/
|
||||
static inline LLVMValueRef
|
||||
l_pbool_const(bool i)
|
||||
{
|
||||
return LLVMConstInt(TypeParamBool, (int) i, false);
|
||||
}
|
||||
|
||||
/*
|
||||
* Load a pointer member idx from a struct.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user