diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2024-03-04 12:00:11 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2024-03-04 12:02:20 +0100 |
commit | dbbca2cf299b81299112ca6ada671a36235ec008 (patch) | |
tree | aac5368f0983f682c6a31b6bc6140cd89b50fe3c /src/backend/access/gin | |
parent | 24eebc65c26cfcc0ea5b8a95b61fa2fda6118e68 (diff) |
Remove unused #include's from backend .c files
as determined by include-what-you-use (IWYU)
While IWYU also suggests to *add* a bunch of #include's (which is its
main purpose), this patch does not do that. In some cases, a more
specific #include replaces another less specific one.
Some manual adjustments of the automatic result:
- IWYU currently doesn't know about includes that provide global
variable declarations (like -Wmissing-variable-declarations), so
those includes are being kept manually.
- All includes for port(ability) headers are being kept for now, to
play it safe.
- No changes of catalog/pg_foo.h to catalog/pg_foo_d.h, to keep the
patch from exploding in size.
Note that this patch touches just *.c files, so nothing declared in
header files changes in hidden ways.
As a small example, in src/backend/access/transam/rmgr.c, some IWYU
pragma annotations are added to handle a special case there.
Discussion: https://www.postgresql.org/message-id/flat/af837490-6b2f-46df-ba05-37ea6a6653fc%40eisentraut.org
Diffstat (limited to 'src/backend/access/gin')
-rw-r--r-- | src/backend/access/gin/ginarrayproc.c | 2 | ||||
-rw-r--r-- | src/backend/access/gin/ginentrypage.c | 1 | ||||
-rw-r--r-- | src/backend/access/gin/ginfast.c | 2 | ||||
-rw-r--r-- | src/backend/access/gin/gininsert.c | 5 | ||||
-rw-r--r-- | src/backend/access/gin/ginlogic.c | 6 | ||||
-rw-r--r-- | src/backend/access/gin/ginutil.c | 3 | ||||
-rw-r--r-- | src/backend/access/gin/ginvalidate.c | 2 |
7 files changed, 4 insertions, 17 deletions
diff --git a/src/backend/access/gin/ginarrayproc.c b/src/backend/access/gin/ginarrayproc.c index 134f55f9f21..2373e76f77e 100644 --- a/src/backend/access/gin/ginarrayproc.c +++ b/src/backend/access/gin/ginarrayproc.c @@ -16,7 +16,7 @@ #include "access/gin.h" #include "access/stratnum.h" #include "utils/array.h" -#include "utils/builtins.h" +#include "utils/fmgrprotos.h" #include "utils/lsyscache.h" diff --git a/src/backend/access/gin/ginentrypage.c b/src/backend/access/gin/ginentrypage.c index 63dd9a3722a..94ef951e14f 100644 --- a/src/backend/access/gin/ginentrypage.c +++ b/src/backend/access/gin/ginentrypage.c @@ -17,7 +17,6 @@ #include "access/gin_private.h" #include "access/ginxlog.h" #include "access/xloginsert.h" -#include "miscadmin.h" #include "utils/rel.h" static void entrySplitPage(GinBtree btree, Buffer origbuf, diff --git a/src/backend/access/gin/ginfast.c b/src/backend/access/gin/ginfast.c index e118cecb9a4..eeca3ed318f 100644 --- a/src/backend/access/gin/ginfast.c +++ b/src/backend/access/gin/ginfast.c @@ -31,7 +31,7 @@ #include "storage/lmgr.h" #include "storage/predicate.h" #include "utils/acl.h" -#include "utils/builtins.h" +#include "utils/fmgrprotos.h" #include "utils/memutils.h" #include "utils/rel.h" diff --git a/src/backend/access/gin/gininsert.c b/src/backend/access/gin/gininsert.c index 45cc8c133f2..71f38be90c3 100644 --- a/src/backend/access/gin/gininsert.c +++ b/src/backend/access/gin/gininsert.c @@ -15,15 +15,12 @@ #include "postgres.h" #include "access/gin_private.h" -#include "access/ginxlog.h" #include "access/tableam.h" #include "access/xloginsert.h" -#include "catalog/index.h" #include "miscadmin.h" +#include "nodes/execnodes.h" #include "storage/bufmgr.h" -#include "storage/indexfsm.h" #include "storage/predicate.h" -#include "storage/smgr.h" #include "utils/memutils.h" #include "utils/rel.h" diff --git a/src/backend/access/gin/ginlogic.c b/src/backend/access/gin/ginlogic.c index b18ddd11c2d..28caf91f857 100644 --- a/src/backend/access/gin/ginlogic.c +++ b/src/backend/access/gin/ginlogic.c @@ -35,12 +35,6 @@ #include "postgres.h" #include "access/gin_private.h" -#include "access/reloptions.h" -#include "catalog/pg_collation.h" -#include "catalog/pg_type.h" -#include "miscadmin.h" -#include "storage/indexfsm.h" -#include "storage/lmgr.h" /* diff --git a/src/backend/access/gin/ginutil.c b/src/backend/access/gin/ginutil.c index 6d05e7bdcda..5747ae6a4ca 100644 --- a/src/backend/access/gin/ginutil.c +++ b/src/backend/access/gin/ginutil.c @@ -23,10 +23,9 @@ #include "commands/vacuum.h" #include "miscadmin.h" #include "storage/indexfsm.h" -#include "storage/lmgr.h" -#include "storage/predicate.h" #include "utils/builtins.h" #include "utils/index_selfuncs.h" +#include "utils/rel.h" #include "utils/typcache.h" diff --git a/src/backend/access/gin/ginvalidate.c b/src/backend/access/gin/ginvalidate.c index 13cf390bb3d..74420a129aa 100644 --- a/src/backend/access/gin/ginvalidate.c +++ b/src/backend/access/gin/ginvalidate.c @@ -21,8 +21,6 @@ #include "catalog/pg_opclass.h" #include "catalog/pg_opfamily.h" #include "catalog/pg_type.h" -#include "utils/builtins.h" -#include "utils/lsyscache.h" #include "utils/regproc.h" #include "utils/syscache.h" |