From 605721f819f5b603db6bc1405ef414747d182116 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 19 Mar 2024 16:55:00 +0100 Subject: gen_node_support.pl: Mark location fields as type alias ParseLoc Instead of the rather ugly type=int + name ~= location$, we now have a marker type for offset pointers or sizes that are only relevant when a query text is included, which decreases the complexity required in gen_node_support.pl for handling these values. Author: Matthias van de Meent Discussion: https://www.postgresql.org/message-id/flat/CAEze2WgrCiR3JZmWyB0YTc8HV7ewRdx13j0CqD6mVkYAW+SFGQ@mail.gmail.com --- src/backend/nodes/gen_node_support.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/backend/nodes') diff --git a/src/backend/nodes/gen_node_support.pl b/src/backend/nodes/gen_node_support.pl index 2f0a59bc874..d4244facbb3 100644 --- a/src/backend/nodes/gen_node_support.pl +++ b/src/backend/nodes/gen_node_support.pl @@ -777,7 +777,7 @@ _equal${n}(const $n *a, const $n *b) print $eff "\tCOMPARE_BITMAPSET_FIELD($f);\n" unless $equal_ignore; } - elsif ($t eq 'int' && $f =~ 'location$') + elsif ($t eq 'ParseLoc') { print $cff "\tCOPY_LOCATION_FIELD($f);\n" unless $copy_ignore; print $eff "\tCOMPARE_LOCATION_FIELD($f);\n" unless $equal_ignore; @@ -1010,7 +1010,7 @@ _read${n}(void) print $off "\tWRITE_BOOL_FIELD($f);\n"; print $rff "\tREAD_BOOL_FIELD($f);\n" unless $no_read; } - elsif ($t eq 'int' && $f =~ 'location$') + elsif ($t eq 'ParseLoc') { print $off "\tWRITE_LOCATION_FIELD($f);\n"; print $rff "\tREAD_LOCATION_FIELD($f);\n" unless $no_read; @@ -1303,7 +1303,7 @@ _jumble${n}(JumbleState *jstate, Node *node) print $jff "\tJUMBLE_NODE($f);\n" unless $query_jumble_ignore; } - elsif ($t eq 'int' && $f =~ 'location$') + elsif ($t eq 'ParseLoc') { # Track the node's location only if directly requested. if ($query_jumble_location) -- cgit v1.2.3