diff options
author | Peter Eisentraut | 2024-03-04 11:00:11 +0000 |
---|---|---|
committer | Peter Eisentraut | 2024-03-04 11:02:20 +0000 |
commit | dbbca2cf299b81299112ca6ada671a36235ec008 (patch) | |
tree | aac5368f0983f682c6a31b6bc6140cd89b50fe3c /src/backend/storage/lmgr | |
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/storage/lmgr')
-rw-r--r-- | src/backend/storage/lmgr/condition_variable.c | 2 | ||||
-rw-r--r-- | src/backend/storage/lmgr/lmgr.c | 1 | ||||
-rw-r--r-- | src/backend/storage/lmgr/lock.c | 2 | ||||
-rw-r--r-- | src/backend/storage/lmgr/lwlock.c | 3 | ||||
-rw-r--r-- | src/backend/storage/lmgr/predicate.c | 2 | ||||
-rw-r--r-- | src/backend/storage/lmgr/proc.c | 1 | ||||
-rw-r--r-- | src/backend/storage/lmgr/spin.c | 1 |
7 files changed, 0 insertions, 12 deletions
diff --git a/src/backend/storage/lmgr/condition_variable.c b/src/backend/storage/lmgr/condition_variable.c index 10fdae19dcc..1e8559ed47b 100644 --- a/src/backend/storage/lmgr/condition_variable.c +++ b/src/backend/storage/lmgr/condition_variable.c @@ -21,11 +21,9 @@ #include "miscadmin.h" #include "portability/instr_time.h" #include "storage/condition_variable.h" -#include "storage/ipc.h" #include "storage/proc.h" #include "storage/proclist.h" #include "storage/spin.h" -#include "utils/memutils.h" /* Initially, we are not prepared to sleep on any condition variable. */ static ConditionVariable *cv_sleep_target = NULL; diff --git a/src/backend/storage/lmgr/lmgr.c b/src/backend/storage/lmgr/lmgr.c index 7d964f2dc07..41fd856c654 100644 --- a/src/backend/storage/lmgr/lmgr.c +++ b/src/backend/storage/lmgr/lmgr.c @@ -16,7 +16,6 @@ #include "postgres.h" #include "access/subtrans.h" -#include "access/transam.h" #include "access/xact.h" #include "catalog/catalog.h" #include "commands/progress.h" diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c index 0d904ef6554..0d93932d8d3 100644 --- a/src/backend/storage/lmgr/lock.c +++ b/src/backend/storage/lmgr/lock.c @@ -35,12 +35,10 @@ #include "access/transam.h" #include "access/twophase.h" #include "access/twophase_rmgr.h" -#include "access/xact.h" #include "access/xlog.h" #include "access/xlogutils.h" #include "miscadmin.h" #include "pg_trace.h" -#include "pgstat.h" #include "storage/proc.h" #include "storage/procarray.h" #include "storage/sinvaladt.h" diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c index d405c61b21e..30f3a09a4ce 100644 --- a/src/backend/storage/lmgr/lwlock.c +++ b/src/backend/storage/lmgr/lwlock.c @@ -81,9 +81,6 @@ #include "pgstat.h" #include "port/pg_bitutils.h" #include "postmaster/postmaster.h" -#include "replication/slot.h" -#include "storage/ipc.h" -#include "storage/predicate.h" #include "storage/proc.h" #include "storage/proclist.h" #include "storage/spin.h" diff --git a/src/backend/storage/lmgr/predicate.c b/src/backend/storage/lmgr/predicate.c index d4483591ebd..3f378c0099b 100644 --- a/src/backend/storage/lmgr/predicate.c +++ b/src/backend/storage/lmgr/predicate.c @@ -199,7 +199,6 @@ #include "access/parallel.h" #include "access/slru.h" -#include "access/subtrans.h" #include "access/transam.h" #include "access/twophase.h" #include "access/twophase_rmgr.h" @@ -208,7 +207,6 @@ #include "miscadmin.h" #include "pgstat.h" #include "port/pg_lfind.h" -#include "storage/bufmgr.h" #include "storage/predicate.h" #include "storage/predicate_internals.h" #include "storage/proc.h" diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c index 1949d149656..f3e20038f42 100644 --- a/src/backend/storage/lmgr/proc.c +++ b/src/backend/storage/lmgr/proc.c @@ -39,7 +39,6 @@ #include "miscadmin.h" #include "pgstat.h" #include "postmaster/autovacuum.h" -#include "replication/slot.h" #include "replication/slotsync.h" #include "replication/syncrep.h" #include "storage/condition_variable.h" diff --git a/src/backend/storage/lmgr/spin.c b/src/backend/storage/lmgr/spin.c index 50cb99cd3b6..ec9a4048cc6 100644 --- a/src/backend/storage/lmgr/spin.c +++ b/src/backend/storage/lmgr/spin.c @@ -23,7 +23,6 @@ #include "postgres.h" #include "storage/pg_sema.h" -#include "storage/shmem.h" #include "storage/spin.h" |