[gjs: 4/5] CI: Add missing files to IWYU script




commit b4d8f9373ec2f2c091aa472df989784515a3bdd8
Author: Philip Chimento <philip chimento gmail com>
Date:   Mon Jul 25 23:26:19 2022 -0700

    CI: Add missing files to IWYU script
    
    internal.cpp and text-encoding.cpp hadn't been added to IWYU (it's
    really annoying that globs won't work there, we should really find a way
    around that) so they were never checked by IWYU. Add them and update
    their headers.

 gjs/gjs_pch.hh        |  5 ++++-
 gjs/internal.cpp      | 42 ++++++++++++++++++++++--------------------
 gjs/internal.h        |  1 -
 gjs/text-encoding.cpp | 18 +++++++++++++-----
 gjs/text-encoding.h   |  4 ----
 tools/run_iwyu.sh     | 12 +++++++-----
 6 files changed, 46 insertions(+), 36 deletions(-)
---
diff --git a/gjs/gjs_pch.hh b/gjs/gjs_pch.hh
index ff91229bf..d4a820ff8 100644
--- a/gjs/gjs_pch.hh
+++ b/gjs/gjs_pch.hh
@@ -11,6 +11,8 @@
 #include <cstddef>
 #include <deque>
 #include <functional>
+#include <iosfwd>
+#include <iterator>
 #include <limits>
 #include <memory>
 #include <new>
@@ -93,7 +95,6 @@
 #include <js/Value.h>
 #include <js/ValueArray.h>
 #include <js/Warnings.h>
-#include <js/Wrapper.h>
 #include <js/experimental/CodeCoverage.h>
 #include <js/experimental/SourceHook.h>
 #include <js/experimental/TypedData.h>
@@ -101,6 +102,7 @@
 #include <jsapi.h>
 #include <jsfriendapi.h>
 #include <jspubtd.h>
+#include <limits.h>
 #include <locale.h>
 #include <mozilla/Atomics.h>
 #include <mozilla/CheckedInt.h>
@@ -109,6 +111,7 @@
 #include <mozilla/Likely.h>
 #include <mozilla/Maybe.h>
 #include <mozilla/Span.h>
+#include <mozilla/Tuple.h>
 #include <mozilla/UniquePtr.h>
 #include <mozilla/Unused.h>
 #include <mozilla/Vector.h>
diff --git a/gjs/internal.cpp b/gjs/internal.cpp
index fcdb5a019..9ffe48136 100644
--- a/gjs/internal.cpp
+++ b/gjs/internal.cpp
@@ -4,49 +4,51 @@
 #include "gjs/internal.h"
 
 #include <config.h>
+
+#include <stddef.h>  // for size_t
+#include <string.h>
+
+#include <memory>  // for unique_ptr
+
 #include <gio/gio.h>
-#include <girepository.h>
 #include <glib-object.h>
 #include <glib.h>
-#include <js/Array.h>
-#include <js/Class.h>
+
+#include <js/CallArgs.h>
+#include <js/CharacterEncoding.h>
 #include <js/CompilationAndEvaluation.h>
 #include <js/CompileOptions.h>
-#include <js/Conversions.h>
-#include <js/GCVector.h>  // for RootedVector
+#include <js/Exception.h>
+#include <js/GCAPI.h>  // for JS_AddExtraGCRootsTracer
 #include <js/Modules.h>
 #include <js/Promise.h>
 #include <js/PropertyDescriptor.h>
+#include <js/Realm.h>
 #include <js/RootingAPI.h>
 #include <js/SourceText.h>
+#include <js/String.h>
+#include <js/TracingAPI.h>
 #include <js/TypeDecls.h>
-#include <js/Wrapper.h>
+#include <js/Utility.h>  // for UniqueChars
+#include <js/Value.h>
+#include <js/ValueArray.h>
 #include <jsapi.h>  // for JS_DefinePropertyById, ...
 #include <jsfriendapi.h>
-#include <stddef.h>     // for size_t
-#include <sys/types.h>  // for ssize_t
-
-#include <memory>   // for unique_ptr
-#include <string>   // for u16string
-#include <vector>
+#include <jspubtd.h>  // for JSProto_Error
 
-#include "gjs/byteArray.h"
 #include "gjs/context-private.h"
-#include "gjs/context.h"
 #include "gjs/engine.h"
-#include "gjs/error-types.h"
 #include "gjs/global.h"
-#include "gjs/importer.h"
 #include "gjs/jsapi-util-args.h"
 #include "gjs/jsapi-util.h"
-#include "gjs/mainloop.h"
-#include "gjs/mem-private.h"
+#include "gjs/macros.h"
 #include "gjs/module.h"
-#include "gjs/native.h"
 #include "util/log.h"
 #include "util/misc.h"
 
-#include "gi/repo.h"
+namespace mozilla {
+union Utf8Unit;
+}
 
 // NOTE: You have to be very careful in this file to only do operations within
 // the correct global!
diff --git a/gjs/internal.h b/gjs/internal.h
index 212e5458d..564b3b240 100644
--- a/gjs/internal.h
+++ b/gjs/internal.h
@@ -7,7 +7,6 @@
 #include <config.h>
 
 #include <js/TypeDecls.h>
-#include <jsapi.h>
 
 #include "gjs/macros.h"
 
diff --git a/gjs/text-encoding.cpp b/gjs/text-encoding.cpp
index 2618d8ba8..e9010023b 100644
--- a/gjs/text-encoding.cpp
+++ b/gjs/text-encoding.cpp
@@ -5,37 +5,45 @@
 
 #include <config.h>
 
+#include <limits.h>  // for SSIZE_MAX
+#include <stddef.h>  // for size_t
 #include <stdint.h>
 #include <string.h>  // for strcmp, memchr, strlen
 
 #include <algorithm>
+#include <iosfwd>    // for nullptr_t
+#include <iterator>  // for distance
+#include <string>    // for u16string
 #include <vector>
 
 #include <gio/gio.h>
-#include <girepository.h>
 #include <glib-object.h>
 #include <glib.h>
 
 #include <js/ArrayBuffer.h>
 #include <js/CallArgs.h>
 #include <js/CharacterEncoding.h>
+#include <js/ErrorReport.h>  // for JS_ReportOutOfMemory
+#include <js/Exception.h>    // for JS_ClearPendingException, JS_...
 #include <js/GCAPI.h>  // for AutoCheckCannotGC
 #include <js/PropertySpec.h>
 #include <js/RootingAPI.h>
 #include <js/String.h>
 #include <js/TypeDecls.h>
 #include <js/Utility.h>  // for UniqueChars
+#include <js/Value.h>
 #include <js/experimental/TypedData.h>
 #include <jsapi.h>        // for JS_DefineFunctionById, JS_DefineFun...
 #include <jsfriendapi.h>  // for ProtoKeyToClass
+#include <jspubtd.h>      // for JSProto_TypeError, JSProto_InternalError
+#include <mozilla/Maybe.h>
+#include <mozilla/Span.h>
+#include <mozilla/Tuple.h>
 #include <mozilla/Unused.h>
 
-#include "gi/boxed.h"
-#include "gjs/atoms.h"
-#include "gjs/context-private.h"
-#include "gjs/deprecation.h"
 #include "gjs/jsapi-util-args.h"
 #include "gjs/jsapi-util.h"
+#include "gjs/macros.h"
 #include "gjs/text-encoding.h"
 
 // Callback to use with JS::NewExternalArrayBuffer()
diff --git a/gjs/text-encoding.h b/gjs/text-encoding.h
index e4daa85e2..0cc597d39 100644
--- a/gjs/text-encoding.h
+++ b/gjs/text-encoding.h
@@ -6,10 +6,6 @@
 
 #include <config.h>
 
-#include <stddef.h>  // for size_t
-
-#include <glib.h>
-
 #include <js/TypeDecls.h>
 
 #include "gjs/macros.h"
diff --git a/tools/run_iwyu.sh b/tools/run_iwyu.sh
index e67ff5969..047281c03 100755
--- a/tools/run_iwyu.sh
+++ b/tools/run_iwyu.sh
@@ -70,14 +70,16 @@ done
 
 for FILE in $SRCDIR/gi/*.cpp $SRCDIR/gjs/atoms.cpp $SRCDIR/gjs/byteArray.cpp \
     $SRCDIR/gjs/coverage.cpp $SRCDIR/gjs/debugger.cpp \
-    $SRCDIR/gjs/deprecation.cpp $SRCDIR/gjs/error-types.cpp \
-    $SRCDIR/gjs/engine.cpp $SRCDIR/gjs/global.cpp $SRCDIR/gjs/importer.cpp \
+    $SRCDIR/gjs/deprecation.cpp $SRCDIR/gjs/engine.cpp \
+    $SRCDIR/gjs/error-types.cpp $SRCDIR/gjs/global.cpp \
+    $SRCDIR/gjs/internal.cpp $SRCDIR/gjs/importer.cpp \
     $SRCDIR/gjs/jsapi-util*.cpp $SRCDIR/gjs/mainloop.cpp \
     $SRCDIR/gjs/module.cpp $SRCDIR/gjs/native.cpp \
     $SRCDIR/gjs/objectbox.cpp $SRCDIR/gjs/promise.cpp $SRCDIR/gjs/stack.cpp \
-    $SRCDIR/modules/cairo-*.cpp $SRCDIR/modules/console.cpp \
-    $SRCDIR/modules/print.cpp $SRCDIR/modules/system.cpp $SRCDIR/test/*.cpp \
-    $SRCDIR/util/*.cpp $SRCDIR/libgjs-private/*.c
+    $SRCDIR/gjs/text-encoding.cpp $SRCDIR/modules/cairo-*.cpp \
+    $SRCDIR/modules/console.cpp $SRCDIR/modules/print.cpp \
+    $SRCDIR/modules/system.cpp $SRCDIR/test/*.cpp $SRCDIR/util/*.cpp \
+    $SRCDIR/libgjs-private/*.c
 do
     if should_analyze $FILE; then
         if ! $IWYU $FILE -- $PRIVATE_MAPPING $IWYU_TOOL_ARGS | $POSTPROCESS; then


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]