[gjs: 6/12] CI: Fix bug in IWYU postprocess script




commit 87b96d82d8193092808e09668dd81ad553fd6513
Author: Philip Chimento <philip chimento gmail com>
Date:   Mon Nov 23 22:41:02 2020 -0800

    CI: Fix bug in IWYU postprocess script
    
    This bug was causing includes to be dropped, because we would reset the
    state to None directly after setting it to ADD when a new file was
    started. Correct existing mistakes that were not caught due to the bug.

 gi/gobject.cpp        | 2 ++
 gi/ns.cpp             | 2 ++
 gjs/coverage.cpp      | 1 +
 gjs/deprecation.cpp   | 4 +++-
 gjs/profiler.cpp      | 2 ++
 tools/process_iwyu.py | 3 +--
 6 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/gi/gobject.cpp b/gi/gobject.cpp
index ce6762b5..27c7d13c 100644
--- a/gi/gobject.cpp
+++ b/gi/gobject.cpp
@@ -10,9 +10,11 @@
 #include <glib-object.h>
 #include <glib.h>
 
+#include <js/PropertyDescriptor.h>  // for JSPROP_READONLY
 #include <js/RootingAPI.h>
 #include <js/TypeDecls.h>
 #include <js/Value.h>
+#include <js/ValueArray.h>
 #include <jsapi.h>  // for JS_New, JSAutoRealm, JS_GetProperty
 
 #include "gi/gobject.h"
diff --git a/gi/ns.cpp b/gi/ns.cpp
index cb90913d..c8b352bb 100644
--- a/gi/ns.cpp
+++ b/gi/ns.cpp
@@ -9,7 +9,9 @@
 
 #include <js/CallArgs.h>
 #include <js/Class.h>
+#include <js/ComparisonOperators.h>
 #include <js/Id.h>  // for JSID_IS_STRING
+#include <js/PropertyDescriptor.h>  // for JSPROP_READONLY
 #include <js/PropertySpec.h>
 #include <js/RootingAPI.h>
 #include <js/TypeDecls.h>
diff --git a/gjs/coverage.cpp b/gjs/coverage.cpp
index 810c5b69..b6e0835b 100644
--- a/gjs/coverage.cpp
+++ b/gjs/coverage.cpp
@@ -17,6 +17,7 @@
 #include <js/RootingAPI.h>
 #include <js/TracingAPI.h>
 #include <js/TypeDecls.h>
+#include <js/Utility.h>  // for UniqueChars
 #include <js/Value.h>
 #include <js/experimental/CodeCoverage.h>  // for EnableCodeCoverage
 #include <jsapi.h>        // for JSAutoRealm, JS_SetPropertyById
diff --git a/gjs/deprecation.cpp b/gjs/deprecation.cpp
index 3ab7f786..1d32b045 100644
--- a/gjs/deprecation.cpp
+++ b/gjs/deprecation.cpp
@@ -5,9 +5,11 @@
 #include <config.h>
 
 #include <cstddef>        // for size_t
+#include <functional>     // for hash<int>
 #include <string>         // for string
+#include <string_view>    // for hash<string>
 #include <unordered_set>  // for unordered_set
-#include <utility>        // for hash, move
+#include <utility>        // for move
 
 #include <glib.h>  // for g_warning
 
diff --git a/gjs/profiler.cpp b/gjs/profiler.cpp
index 85851286..20d5463d 100644
--- a/gjs/profiler.cpp
+++ b/gjs/profiler.cpp
@@ -31,6 +31,8 @@
 #endif
 
 #include <js/ProfilingStack.h>  // for EnableContextProfilingStack, ...
+#include <js/TypeDecls.h>
+#include <mozilla/Atomics.h>  // for ProfilingStack operators
 
 #include "gjs/context.h"
 #include "gjs/jsapi-util.h"
diff --git a/tools/process_iwyu.py b/tools/process_iwyu.py
index cfd71fa2..9c28d126 100755
--- a/tools/process_iwyu.py
+++ b/tools/process_iwyu.py
@@ -97,6 +97,7 @@ FALSE_POSITIVES = (
     # Weird false positive on some versions of IWYU
     ('gi/arg.cpp', 'struct _GHashTable;', ''),
     ('gi/arg.cpp', 'struct _GVariant;', ''),
+    ('gjs/profiler.cpp', '#include <gjs/profiler.h>', ''),
 )
 
 
@@ -131,8 +132,6 @@ def output():
             print(f'{Colors.RED}-{line}{Colors.NORMAL}{why}')
         there_were_errors = True
 
-    state = None
-    file = None
     add.clear()
     remove.clear()
     all_includes.clear()


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