Add include-what-you-use pragmas
authorSitsofe Wheeler <sitsofe@yahoo.com>
Tue, 20 Mar 2018 15:18:43 +0000 (15:18 +0000)
committerSitsofe Wheeler <sitsofe@yahoo.com>
Wed, 21 Mar 2018 22:09:28 +0000 (22:09 +0000)
Add IWYU pragmas to improve its analysis.

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
arch/arch-x86.h
arch/arch-x86_64.h
arch/arch.h
compiler/compiler.h
fio_time.h
lib/types.h
os/os.h

index 457b44c17eb3ad52cb51a98858c90ab2255ec55b..c6bcb54ccf0d36d442401b483a788959a7358709 100644 (file)
@@ -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)
 
index e686d109e762998fbbfbf2c40d8d857ee2ce47ad..484ea0c5b8eb82ba892a1676b100131bf13a8635 100644 (file)
@@ -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)
 
index 4fb9b518085aeeae06a390874ee35346ad5ef9b7..0ec3f10feae03f25d372e39ae179fa9987e6dda2 100644 (file)
@@ -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[])
index 8488aa0d4bd0ee558c9448561325ce11baa0c0a8..4d92ac4949c4a5111df6ae5ba0fd36325281be49 100644 (file)
@@ -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
index 39fb17ba245caee553ccec82924685fee3fc9dda..c00f8e7866d94fd47ae6e0b54f03453efdbd0844 100644 (file)
@@ -2,8 +2,10 @@
 #define FIO_TIME_H
 
 #include <stdint.h>
+/* IWYU pragma: begin_exports */
 #include <time.h>
 #include <sys/time.h>
+/* IWYU pragma: end_exports */
 #include "lib/types.h"
 
 struct thread_data;
index bb2450680872255cebdc0b7f121031dcafab4cd0..236bf8a3a8f4be7b56554ef0fef618f29c118be1 100644 (file)
@@ -10,7 +10,7 @@ typedef int bool;
 #define true   1
 #endif
 #else
-#include <stdbool.h>
+#include <stdbool.h> /* IWYU pragma: export */
 #endif
 
 #endif
diff --git a/os/os.h b/os/os.h
index 1a4437c940ad1b3f9c7f9266be1f2d021963d797..95ed7cf2d7cd169c173d9dd971db01ac6b9d734b 100644 (file)
--- a/os/os.h
+++ b/os/os.h
@@ -8,7 +8,7 @@
 #include <unistd.h>
 #include <stdlib.h>
 
-#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