mirror of
https://github.com/postgres/postgres.git
synced 2025-10-29 22:49:41 +03:00
Add FIELDNO_* macro designating offset into structs required for JIT.
For any interesting JIT target, fields inside structs need to be
accessed. b96d550e contains infrastructure for syncing the definition
of types between postgres C code and runtime code generation with
LLVM. But that doesn't sync the number or names of fields inside
structs, just the types (including padding etc).
One option would be to hardcode the offset numbers in the JIT code,
but that'd be hard to keep in sync. Instead add macros indicating the
field offset to the fields that need to be accessed. Not pretty, but
manageable.
Author: Andres Freund
Discussion: https://postgr.es/m/20170901064131.tazjxwus3k2w3ybh@alap3.anarazel.de
This commit is contained in:
@@ -80,9 +80,12 @@ typedef struct FunctionCallInfoData
|
||||
fmNodePtr context; /* pass info about context of call */
|
||||
fmNodePtr resultinfo; /* pass or return extra info about result */
|
||||
Oid fncollation; /* collation for function to use */
|
||||
#define FIELDNO_FUNCTIONCALLINFODATA_ISNULL 4
|
||||
bool isnull; /* function must set true if result is NULL */
|
||||
short nargs; /* # arguments actually passed */
|
||||
#define FIELDNO_FUNCTIONCALLINFODATA_ARG 6
|
||||
Datum arg[FUNC_MAX_ARGS]; /* Arguments passed to function */
|
||||
#define FIELDNO_FUNCTIONCALLINFODATA_ARGNULL 7
|
||||
bool argnull[FUNC_MAX_ARGS]; /* T if arg[i] is actually NULL */
|
||||
} FunctionCallInfoData;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user