Making CallContext and InlineCodeBlock less special-case-y
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@lists.postgresql.org
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Date: 2022-07-09T23:50:15Z
Lists: pgsql-hackers
Attachments
- clean-up-callcontext-inlinecodeblock.patch (text/x-diff) patch
As committed, gen_node_support.pl excludes CallContext and InlineCodeBlock from getting unneeded support functions via some very ad-hoc code. (Right now, there are some other node types that are handled similarly, but I'm looking to drive that set to empty.) After looking at the situation a bit, I think the problem is that these nodes are declared in parsenodes.h even though they have exactly nothing to do with parse trees. What they are is function-calling API infrastructure, so it seems like the most natural home for them is fmgr.h. A weaker case could be made for funcapi.h, perhaps. So I tried moving them to fmgr.h, and it blew up because they need typedef NodeTag while fmgr.h does not #include nodes.h. I feel that the most reasonable approach is to just give up on that bit of micro-optimization and let fmgr.h include nodes.h. It was already doing a bit of hackery to compile "Node *" references without that inclusion, so this seems more clean not less so. Hence, I propose the attached. (The changes in the PL files are just to align them on a common best practice for an InlineCodeBlock argument.) regards, tom lane
Commits
-
Invent nodetag_only attribute for Nodes.
- ca187d7455f1 16.0 landed