forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit964d01a
committed
Automatically generate node support functions
Add a script to automatically generate the node support functions(copy, equal, out, and read, as well as the node tags enum) from thestruct definitions.For each of the four node support files, it creates two include files,e.g., copyfuncs.funcs.c and copyfuncs.switch.c, to include in the mainfile. All the scaffolding of the main file stays in place.I have tried to mostly make the coverage of the output match what iscurrently there. For example, one could now do out/read coverage ofutility statement nodes, but I have manually excluded those for now.The reason is mainly that it's easier to diff the before and after,and adding a bunch of stuff like this might require a separateanalysis and review.Subtyping (TidScan -> Scan) is supported.For the hard cases, you can just write a manual function and excludegenerating one. For the not so hard cases, there is a way ofannotating struct fields to get special behaviors. For example,pg_node_attr(equal_ignore) has the field ignored in equal functions.(In this patch, I have only ifdef'ed out the code to could be removed,mainly so that it won't constantly have merge conflicts. It will bedeleted in a separate patch. All the code comments that are worthkeeping from those sections have already been moved to the headerfiles where the structs are defined.)Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://www.postgresql.org/message-id/flat/c1097590-a6a4-486a-64b1-e1f9cc0533ce%40enterprisedb.com1 parent2373fe7 commit964d01a
File tree
23 files changed
+1614
-223
lines changed- src
- backend
- nodes
- include
- catalog
- executor
- nodes
- utils
- tools
- msvc
- pgindent
23 files changed
+1614
-223
lines changedLines changed: 8 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
143 | 143 |
| |
144 | 144 |
| |
145 | 145 |
| |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
146 | 150 |
| |
147 | 151 |
| |
148 | 152 |
| |
149 | 153 |
| |
150 |
| - | |
| 154 | + | |
151 | 155 |
| |
152 | 156 |
| |
153 | 157 |
| |
| |||
162 | 166 |
| |
163 | 167 |
| |
164 | 168 |
| |
165 |
| - | |
| 169 | + | |
166 | 170 |
| |
167 | 171 |
| |
168 | 172 |
| |
| |||
185 | 189 |
| |
186 | 190 |
| |
187 | 191 |
| |
| 192 | + | |
188 | 193 |
| |
189 | 194 |
| |
190 | 195 |
| |
| |||
297 | 302 |
| |
298 | 303 |
| |
299 | 304 |
| |
| 305 | + | |
300 | 306 |
| |
301 | 307 |
| |
302 | 308 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + |
Lines changed: 59 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + |
Lines changed: 44 additions & 36 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
6 |
| - | |
7 |
| - | |
8 | 6 |
| |
9 | 7 |
| |
10 | 8 |
| |
11 |
| - | |
12 |
| - | |
13 |
| - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
14 | 19 |
| |
15 | 20 |
| |
16 | 21 |
| |
17 | 22 |
| |
18 | 23 |
| |
19 |
| - | |
20 |
| - | |
21 |
| - | |
22 |
| - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
23 | 28 |
| |
24 | 29 |
| |
25 | 30 |
| |
| 31 | + | |
| 32 | + | |
| 33 | + | |
26 | 34 |
| |
27 | 35 |
| |
28 | 36 |
| |
| |||
33 | 41 |
| |
34 | 42 |
| |
35 | 43 |
| |
36 |
| - | |
| 44 | + | |
37 | 45 |
| |
38 | 46 |
| |
39 | 47 |
| |
| |||
42 | 50 |
| |
43 | 51 |
| |
44 | 52 |
| |
| 53 | + | |
| 54 | + | |
45 | 55 |
| |
46 | 56 |
| |
47 | 57 |
| |
48 | 58 |
| |
49 | 59 |
| |
50 | 60 |
| |
51 |
| - | |
52 |
| - | |
53 |
| - | |
54 |
| - | |
55 |
| - | |
| 61 | + | |
56 | 62 |
| |
57 |
| - | |
58 |
| - | |
59 |
| - | |
60 |
| - | |
61 |
| - | |
62 |
| - | |
63 |
| - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
64 | 70 |
| |
65 | 71 |
| |
66 | 72 |
| |
67 |
| - | |
68 |
| - | |
69 |
| - | |
70 |
| - | |
71 |
| - | |
72 |
| - | |
73 |
| - | |
74 |
| - | |
75 |
| - | |
76 |
| - | |
77 |
| - | |
78 |
| - | |
79 |
| - | |
80 |
| - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + |
Lines changed: 16 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
26 |
| - | |
27 |
| - | |
28 |
| - | |
29 | 26 |
| |
30 |
| - | |
31 | 27 |
| |
32 | 28 |
| |
33 | 29 |
| |
| |||
73 | 69 |
| |
74 | 70 |
| |
75 | 71 |
| |
| 72 | + | |
| 73 | + | |
| 74 | + | |
76 | 75 |
| |
77 | 76 |
| |
78 | 77 |
| |
| |||
1431 | 1430 |
| |
1432 | 1431 |
| |
1433 | 1432 |
| |
| 1433 | + | |
1434 | 1434 |
| |
1435 | 1435 |
| |
1436 | 1436 |
| |
| |||
1470 | 1470 |
| |
1471 | 1471 |
| |
1472 | 1472 |
| |
| 1473 | + | |
1473 | 1474 |
| |
1474 | 1475 |
| |
1475 | 1476 |
| |
| |||
3214 | 3215 |
| |
3215 | 3216 |
| |
3216 | 3217 |
| |
| 3218 | + | |
3217 | 3219 |
| |
3218 | 3220 |
| |
3219 | 3221 |
| |
| |||
3254 | 3256 |
| |
3255 | 3257 |
| |
3256 | 3258 |
| |
| 3259 | + | |
3257 | 3260 |
| |
3258 | 3261 |
| |
3259 | 3262 |
| |
| |||
5419 | 5422 |
| |
5420 | 5423 |
| |
5421 | 5424 |
| |
| 5425 | + | |
5422 | 5426 |
| |
5423 | 5427 |
| |
5424 | 5428 |
| |
| |||
5441 | 5445 |
| |
5442 | 5446 |
| |
5443 | 5447 |
| |
| 5448 | + | |
5444 | 5449 |
| |
5445 | 5450 |
| |
5446 | 5451 |
| |
| |||
5511 | 5516 |
| |
5512 | 5517 |
| |
5513 | 5518 |
| |
| 5519 | + | |
5514 | 5520 |
| |
5515 | 5521 |
| |
5516 | 5522 |
| |
| |||
5531 | 5537 |
| |
5532 | 5538 |
| |
5533 | 5539 |
| |
| 5540 | + | |
| 5541 | + | |
5534 | 5542 |
| |
5535 | 5543 |
| |
5536 | 5544 |
| |
| |||
5969 | 5977 |
| |
5970 | 5978 |
| |
5971 | 5979 |
| |
| 5980 | + | |
5972 | 5981 |
| |
5973 | 5982 |
| |
5974 | 5983 |
| |
| |||
5986 | 5995 |
| |
5987 | 5996 |
| |
5988 | 5997 |
| |
| 5998 | + | |
| 5999 | + | |
5989 | 6000 |
| |
5990 | 6001 |
| |
5991 | 6002 |
| |
| |||
6537 | 6548 |
| |
6538 | 6549 |
| |
6539 | 6550 |
| |
| 6551 | + | |
6540 | 6552 |
| |
6541 | 6553 |
| |
6542 | 6554 |
| |
|
0 commit comments
Comments
(0)