From: Sitsofe Wheeler Date: Tue, 20 Mar 2018 15:18:43 +0000 (+0000) Subject: Add include-what-you-use pragmas X-Git-Tag: fio-3.6~28^2 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=c473a9bd8fadf0b8e7521edcabb2204d87f35b04 Add include-what-you-use pragmas Add IWYU pragmas to improve its analysis. Signed-off-by: Sitsofe Wheeler --- diff --git a/arch/arch-x86.h b/arch/arch-x86.h index 457b44c1..c6bcb54c 100644 --- a/arch/arch-x86.h +++ b/arch/arch-x86.h @@ -10,7 +10,7 @@ static inline void do_cpuid(unsigned int *eax, unsigned int *ebx, : "memory"); } -#include "arch-x86-common.h" +#include "arch-x86-common.h" /* IWYU pragma: export */ #define FIO_ARCH (arch_x86) diff --git a/arch/arch-x86_64.h b/arch/arch-x86_64.h index e686d109..484ea0c5 100644 --- a/arch/arch-x86_64.h +++ b/arch/arch-x86_64.h @@ -10,7 +10,7 @@ static inline void do_cpuid(unsigned int *eax, unsigned int *ebx, : "memory"); } -#include "arch-x86-common.h" +#include "arch-x86-common.h" /* IWYU pragma: export */ #define FIO_ARCH (arch_x86_64) diff --git a/arch/arch.h b/arch/arch.h index 4fb9b518..0ec3f10f 100644 --- a/arch/arch.h +++ b/arch/arch.h @@ -34,6 +34,7 @@ extern unsigned long arch_flags; #define ARCH_CPU_CLOCK_WRAPS +/* IWYU pragma: begin_exports */ #if defined(__i386__) #include "arch-x86.h" #elif defined(__x86_64__) @@ -66,6 +67,7 @@ extern unsigned long arch_flags; #endif #include "../lib/ffz.h" +/* IWYU pragma: end_exports */ #ifndef ARCH_HAVE_INIT static inline int arch_init(char *envp[]) diff --git a/compiler/compiler.h b/compiler/compiler.h index 8488aa0d..4d92ac49 100644 --- a/compiler/compiler.h +++ b/compiler/compiler.h @@ -1,6 +1,7 @@ #ifndef FIO_COMPILER_H #define FIO_COMPILER_H +/* IWYU pragma: begin_exports */ #if __GNUC__ >= 4 #include "compiler-gcc4.h" #elif __GNUC__ == 3 @@ -8,6 +9,7 @@ #else #error Compiler too old, need gcc at least gcc 3.x #endif +/* IWYU pragma: end_exports */ #ifndef __must_check #define __must_check diff --git a/fio_time.h b/fio_time.h index 39fb17ba..c00f8e78 100644 --- a/fio_time.h +++ b/fio_time.h @@ -2,8 +2,10 @@ #define FIO_TIME_H #include +/* IWYU pragma: begin_exports */ #include #include +/* IWYU pragma: end_exports */ #include "lib/types.h" struct thread_data; diff --git a/lib/types.h b/lib/types.h index bb245068..236bf8a3 100644 --- a/lib/types.h +++ b/lib/types.h @@ -10,7 +10,7 @@ typedef int bool; #define true 1 #endif #else -#include +#include /* IWYU pragma: export */ #endif #endif diff --git a/os/os.h b/os/os.h index 1a4437c9..95ed7cf2 100644 --- a/os/os.h +++ b/os/os.h @@ -8,7 +8,7 @@ #include #include -#include "../arch/arch.h" +#include "../arch/arch.h" /* IWYU pragma: export */ #include "../lib/types.h" enum { @@ -27,6 +27,7 @@ enum { os_nr, }; +/* IWYU pragma: begin_exports */ #if defined(__ANDROID__) #include "os-android.h" #elif defined(__linux__) @@ -67,6 +68,7 @@ typedef struct aiocb os_aiocb_t; #ifndef CONFIG_STRLCAT #include "../oslib/strlcat.h" #endif +/* IWYU pragma: end_exports */ #ifdef MSG_DONTWAIT #define OS_MSG_DONTWAIT MSG_DONTWAIT