From 975c9747039af0b196486198752b6e40d273cb9a Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Fri, 10 Jan 2020 18:42:21 -0500
Subject: [PATCH 042/113] analyzer: uglify #include directives

---
 gcc/analyzer/analysis-plan.cc      | 12 ++++++++++++
 gcc/analyzer/analysis-plan.h       |  2 --
 gcc/analyzer/analyzer-logging.h    |  2 --
 gcc/analyzer/analyzer-selftests.cc |  1 +
 gcc/analyzer/analyzer.cc           |  1 +
 gcc/analyzer/analyzer.h            |  2 --
 gcc/analyzer/call-string.cc        |  9 +++++++++
 gcc/analyzer/checker-path.cc       | 26 ++++++++++++++++++++++++++
 gcc/analyzer/checker-path.h        |  3 ---
 gcc/analyzer/constraint-manager.cc |  9 +++++++++
 gcc/analyzer/constraint-manager.h  |  2 --
 gcc/analyzer/diagnostic-manager.cc | 26 ++++++++++++++++++++++++++
 gcc/analyzer/diagnostic-manager.h  |  2 --
 gcc/analyzer/engine.cc             | 29 +++++++++++++++++++++++++++++
 gcc/analyzer/exploded-graph.h      |  9 ---------
 gcc/analyzer/pending-diagnostic.cc |  6 ++++++
 gcc/analyzer/pending-diagnostic.h  |  3 ---
 gcc/analyzer/program-point.cc      | 25 +++++++++++++++++++++++++
 gcc/analyzer/program-point.h       |  3 ---
 gcc/analyzer/program-state.cc      | 25 +++++++++++++++++++++++++
 gcc/analyzer/program-state.h       |  3 ---
 gcc/analyzer/region-model.cc       | 12 ++++++++++++
 gcc/analyzer/region-model.h        |  8 --------
 gcc/analyzer/sm-file.cc            |  7 ++++++-
 gcc/analyzer/sm-malloc.cc          |  5 ++++-
 gcc/analyzer/sm-pattern-test.cc    |  5 ++++-
 gcc/analyzer/sm-sensitive.cc       |  5 ++++-
 gcc/analyzer/sm-signal.cc          | 26 ++++++++++++++++++++++++--
 gcc/analyzer/sm-taint.cc           |  5 ++++-
 gcc/analyzer/sm.cc                 |  3 +++
 gcc/analyzer/sm.h                  |  2 --
 gcc/analyzer/state-purge.cc        | 10 ++++++++++
 gcc/analyzer/state-purge.h         |  3 ---
 gcc/analyzer/supergraph.cc         |  6 ++++++
 gcc/analyzer/supergraph.h          | 10 ----------
 35 files changed, 246 insertions(+), 61 deletions(-)

diff --git a/gcc/analyzer/analysis-plan.cc b/gcc/analyzer/analysis-plan.cc
index 6a4129b07a2..8ad2fa2ebb4 100644
--- a/gcc/analyzer/analysis-plan.cc
+++ b/gcc/analyzer/analysis-plan.cc
@@ -26,8 +26,20 @@ along with GCC; see the file COPYING3.  If not see
 #include "cgraph.h"
 #include "timevar.h"
 #include "ipa-utils.h"
+#include "function.h"
 #include "analyzer/analyzer.h"
+#include "diagnostic-core.h"
+#include "analyzer/analyzer-logging.h"
 #include "analyzer/analysis-plan.h"
+#include "ordered-hash-map.h"
+#include "options.h"
+#include "cgraph.h"
+#include "function.h"
+#include "cfg.h"
+#include "basic-block.h"
+#include "gimple.h"
+#include "gimple-iterator.h"
+#include "digraph.h"
 #include "analyzer/supergraph.h"
 
 #if ENABLE_ANALYZER
diff --git a/gcc/analyzer/analysis-plan.h b/gcc/analyzer/analysis-plan.h
index 5a8f756492a..a44c79561be 100644
--- a/gcc/analyzer/analysis-plan.h
+++ b/gcc/analyzer/analysis-plan.h
@@ -21,8 +21,6 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef GCC_ANALYZER_ANALYSIS_PLAN_H
 #define GCC_ANALYZER_ANALYSIS_PLAN_H
 
-#include "analyzer/analyzer-logging.h"
-
 /* A class to encapsulate decisions about how the analysis should happen.
    Examples:
    - the order in which functions should be analyzed, so that function
diff --git a/gcc/analyzer/analyzer-logging.h b/gcc/analyzer/analyzer-logging.h
index 09310a2c66b..9d5364bfa8f 100644
--- a/gcc/analyzer/analyzer-logging.h
+++ b/gcc/analyzer/analyzer-logging.h
@@ -23,8 +23,6 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef ANALYZER_LOGGING_H
 #define ANALYZER_LOGGING_H
 
-#include "diagnostic-core.h"
-
 /* A logger encapsulates a logging stream: a way to send
    lines of pertinent information to a FILE *.  */
 
diff --git a/gcc/analyzer/analyzer-selftests.cc b/gcc/analyzer/analyzer-selftests.cc
index 5ffacd575ab..8f52ce2e45c 100644
--- a/gcc/analyzer/analyzer-selftests.cc
+++ b/gcc/analyzer/analyzer-selftests.cc
@@ -23,6 +23,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tree.h"
 #include "stringpool.h"
+#include "function.h"
 #include "analyzer/analyzer.h"
 #include "analyzer/analyzer-selftests.h"
 
diff --git a/gcc/analyzer/analyzer.cc b/gcc/analyzer/analyzer.cc
index abe0f7dd081..2a3ffaee852 100644
--- a/gcc/analyzer/analyzer.cc
+++ b/gcc/analyzer/analyzer.cc
@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimple.h"
 #include "diagnostic.h"
 #include "intl.h"
+#include "function.h"
 #include "analyzer/analyzer.h"
 
 #if ENABLE_ANALYZER
diff --git a/gcc/analyzer/analyzer.h b/gcc/analyzer/analyzer.h
index 16c6ab476d2..e207d7a9436 100644
--- a/gcc/analyzer/analyzer.h
+++ b/gcc/analyzer/analyzer.h
@@ -21,8 +21,6 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef GCC_ANALYZER_ANALYZER_H
 #define GCC_ANALYZER_ANALYZER_H
 
-#include "function.h"
-
 /* Forward decls of common types, with indentation to show inheritance.  */
 
 class graphviz_out;
diff --git a/gcc/analyzer/call-string.cc b/gcc/analyzer/call-string.cc
index 229d27bb83e..3d398c39a88 100644
--- a/gcc/analyzer/call-string.cc
+++ b/gcc/analyzer/call-string.cc
@@ -25,6 +25,15 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "options.h"
 #include "analyzer/call-string.h"
+#include "ordered-hash-map.h"
+#include "options.h"
+#include "cgraph.h"
+#include "function.h"
+#include "cfg.h"
+#include "basic-block.h"
+#include "gimple.h"
+#include "gimple-iterator.h"
+#include "digraph.h"
 #include "analyzer/supergraph.h"
 
 #if ENABLE_ANALYZER
diff --git a/gcc/analyzer/checker-path.cc b/gcc/analyzer/checker-path.cc
index b24952b9391..6c0f66cc275 100644
--- a/gcc/analyzer/checker-path.cc
+++ b/gcc/analyzer/checker-path.cc
@@ -27,10 +27,36 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimple.h"
 #include "gimple-pretty-print.h"
 #include "fold-const.h"
+#include "function.h"
+#include "diagnostic-path.h"
+#include "options.h"
+#include "cgraph.h"
+#include "function.h"
+#include "cfg.h"
+#include "digraph.h"
+#include "alloc-pool.h"
+#include "fibonacci_heap.h"
+#include "diagnostic-event-id.h"
+#include "shortest-paths.h"
 #include "analyzer/analyzer.h"
+#include "analyzer/analyzer-logging.h"
+#include "analyzer/sm.h"
+#include "sbitmap.h"
+#include "tristate.h"
+#include "ordered-hash-map.h"
+#include "selftest.h"
+#include "analyzer/region-model.h"
+#include "analyzer/program-state.h"
 #include "analyzer/checker-path.h"
+#include "gimple-iterator.h"
 #include "analyzer/supergraph.h"
+#include "analyzer/pending-diagnostic.h"
 #include "analyzer/diagnostic-manager.h"
+#include "analyzer/constraint-manager.h"
+#include "analyzer/diagnostic-manager.h"
+#include "analyzer/checker-path.h"
+#include "analyzer/call-string.h"
+#include "analyzer/program-point.h"
 #include "analyzer/exploded-graph.h"
 
 #if ENABLE_ANALYZER
diff --git a/gcc/analyzer/checker-path.h b/gcc/analyzer/checker-path.h
index 363a230b09b..cabbeb4fd4f 100644
--- a/gcc/analyzer/checker-path.h
+++ b/gcc/analyzer/checker-path.h
@@ -21,9 +21,6 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef GCC_ANALYZER_CHECKER_PATH_H
 #define GCC_ANALYZER_CHECKER_PATH_H
 
-#include "diagnostic-path.h"
-#include "analyzer/program-state.h"
-
 /* An enum for discriminating between the concrete subclasses of
    checker_event.  */
 
diff --git a/gcc/analyzer/constraint-manager.cc b/gcc/analyzer/constraint-manager.cc
index 8dff49e25cf..669d604e1b7 100644
--- a/gcc/analyzer/constraint-manager.cc
+++ b/gcc/analyzer/constraint-manager.cc
@@ -29,8 +29,17 @@ along with GCC; see the file COPYING3.  If not see
 #include "fold-const.h"
 #include "selftest.h"
 #include "graphviz.h"
+#include "function.h"
 #include "analyzer/analyzer.h"
+#include "ordered-hash-map.h"
+#include "options.h"
+#include "cgraph.h"
+#include "cfg.h"
+#include "digraph.h"
 #include "analyzer/supergraph.h"
+#include "sbitmap.h"
+#include "tristate.h"
+#include "analyzer/region-model.h"
 #include "analyzer/constraint-manager.h"
 #include "analyzer/analyzer-selftests.h"
 
diff --git a/gcc/analyzer/constraint-manager.h b/gcc/analyzer/constraint-manager.h
index 5b71b3dbd1c..c6a40f90a33 100644
--- a/gcc/analyzer/constraint-manager.h
+++ b/gcc/analyzer/constraint-manager.h
@@ -21,8 +21,6 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef GCC_ANALYZER_CONSTRAINT_MANAGER_H
 #define GCC_ANALYZER_CONSTRAINT_MANAGER_H
 
-#include "analyzer/region-model.h" // for svalue_id
-
 class constraint_manager;
 
 /* Abstract base class for specifying how state should be purged.  */
diff --git a/gcc/analyzer/diagnostic-manager.cc b/gcc/analyzer/diagnostic-manager.cc
index 0fe30c42254..12b8e5a4ac4 100644
--- a/gcc/analyzer/diagnostic-manager.cc
+++ b/gcc/analyzer/diagnostic-manager.cc
@@ -25,8 +25,34 @@ along with GCC; see the file COPYING3.  If not see
 #include "pretty-print.h"
 #include "gcc-rich-location.h"
 #include "gimple-pretty-print.h"
+#include "function.h"
+#include "diagnostic-core.h"
+#include "diagnostic-event-id.h"
+#include "diagnostic-path.h"
+#include "alloc-pool.h"
+#include "fibonacci_heap.h"
+#include "shortest-paths.h"
+#include "sbitmap.h"
+#include "tristate.h"
+#include "selftest.h"
+#include "ordered-hash-map.h"
 #include "analyzer/analyzer.h"
+#include "analyzer/analyzer-logging.h"
+#include "analyzer/sm.h"
+#include "analyzer/pending-diagnostic.h"
 #include "analyzer/diagnostic-manager.h"
+#include "analyzer/region-model.h"
+#include "analyzer/constraint-manager.h"
+#include "cfg.h"
+#include "basic-block.h"
+#include "gimple.h"
+#include "gimple-iterator.h"
+#include "cgraph.h"
+#include "digraph.h"
+#include "analyzer/supergraph.h"
+#include "analyzer/call-string.h"
+#include "analyzer/program-point.h"
+#include "analyzer/program-state.h"
 #include "analyzer/exploded-graph.h"
 #include "analyzer/checker-path.h"
 
diff --git a/gcc/analyzer/diagnostic-manager.h b/gcc/analyzer/diagnostic-manager.h
index 92623234cdc..aa939430348 100644
--- a/gcc/analyzer/diagnostic-manager.h
+++ b/gcc/analyzer/diagnostic-manager.h
@@ -21,8 +21,6 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef GCC_ANALYZER_DIAGNOSTIC_MANAGER_H
 #define GCC_ANALYZER_DIAGNOSTIC_MANAGER_H
 
-#include "analyzer/pending-diagnostic.h"
-
 /* A to-be-emitted diagnostic stored within diagnostic_manager.  */
 
 class saved_diagnostic
diff --git a/gcc/analyzer/engine.cc b/gcc/analyzer/engine.cc
index 53683b47455..3e3d8a120b7 100644
--- a/gcc/analyzer/engine.cc
+++ b/gcc/analyzer/engine.cc
@@ -24,6 +24,35 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "fold-const.h"
 #include "gcc-rich-location.h"
+#include "alloc-pool.h"
+#include "fibonacci_heap.h"
+#include "shortest-paths.h"
+#include "diagnostic-core.h"
+#include "diagnostic-event-id.h"
+#include "diagnostic-path.h"
+#include "function.h"
+#include "pretty-print.h"
+#include "sbitmap.h"
+#include "tristate.h"
+#include "ordered-hash-map.h"
+#include "selftest.h"
+#include "analyzer/analyzer.h"
+#include "analyzer/analyzer-logging.h"
+#include "analyzer/region-model.h"
+#include "analyzer/constraint-manager.h"
+#include "analyzer/sm.h"
+#include "analyzer/pending-diagnostic.h"
+#include "analyzer/diagnostic-manager.h"
+#include "cfg.h"
+#include "basic-block.h"
+#include "gimple.h"
+#include "gimple-iterator.h"
+#include "cgraph.h"
+#include "digraph.h"
+#include "analyzer/supergraph.h"
+#include "analyzer/call-string.h"
+#include "analyzer/program-point.h"
+#include "analyzer/program-state.h"
 #include "analyzer/exploded-graph.h"
 #include "analyzer/analysis-plan.h"
 #include "analyzer/checker-path.h"
diff --git a/gcc/analyzer/exploded-graph.h b/gcc/analyzer/exploded-graph.h
index c81b65c2428..ddc5e06b3b6 100644
--- a/gcc/analyzer/exploded-graph.h
+++ b/gcc/analyzer/exploded-graph.h
@@ -21,15 +21,6 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef GCC_ANALYZER_EXPLODED_GRAPH_H
 #define GCC_ANALYZER_EXPLODED_GRAPH_H
 
-#include "alloc-pool.h"
-#include "fibonacci_heap.h"
-#include "shortest-paths.h"
-#include "analyzer/analyzer-logging.h"
-#include "analyzer/constraint-manager.h"
-#include "analyzer/diagnostic-manager.h"
-#include "analyzer/program-point.h"
-#include "analyzer/program-state.h"
-
 /* Concrete implementation of region_model_context, wiring it up to the
    rest of the analysis engine.  */
 
diff --git a/gcc/analyzer/pending-diagnostic.cc b/gcc/analyzer/pending-diagnostic.cc
index c88f17e6cff..f6c48837a59 100644
--- a/gcc/analyzer/pending-diagnostic.cc
+++ b/gcc/analyzer/pending-diagnostic.cc
@@ -24,7 +24,13 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "intl.h"
 #include "diagnostic.h"
+#include "function.h"
 #include "analyzer/analyzer.h"
+#include "diagnostic-event-id.h"
+#include "analyzer/analyzer-logging.h"
+#include "analyzer/sm.h"
+#include "diagnostic-event-id.h"
+#include "analyzer/sm.h"
 #include "analyzer/pending-diagnostic.h"
 
 #if ENABLE_ANALYZER
diff --git a/gcc/analyzer/pending-diagnostic.h b/gcc/analyzer/pending-diagnostic.h
index 781268ceb62..bb03e752530 100644
--- a/gcc/analyzer/pending-diagnostic.h
+++ b/gcc/analyzer/pending-diagnostic.h
@@ -21,9 +21,6 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef GCC_ANALYZER_PENDING_DIAGNOSTIC_H
 #define GCC_ANALYZER_PENDING_DIAGNOSTIC_H
 
-#include "diagnostic-event-id.h"
-#include "analyzer/sm.h"
-
 /* Various bundles of information used for generating more precise
    messages for events within a diagnostic_path, for passing to the
    various "describe_*" vfuncs of pending_diagnostic.  See those
diff --git a/gcc/analyzer/program-point.cc b/gcc/analyzer/program-point.cc
index f6c91622ae6..e85f1ba49f0 100644
--- a/gcc/analyzer/program-point.cc
+++ b/gcc/analyzer/program-point.cc
@@ -24,7 +24,32 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "gimple-pretty-print.h"
 #include "gcc-rich-location.h"
+#include "analyzer/call-string.h"
+#include "ordered-hash-map.h"
+#include "options.h"
+#include "cgraph.h"
+#include "function.h"
+#include "cfg.h"
+#include "basic-block.h"
+#include "gimple.h"
+#include "gimple-iterator.h"
+#include "digraph.h"
+#include "analyzer/analyzer.h"
+#include "analyzer/analyzer-logging.h"
+#include "analyzer/supergraph.h"
 #include "analyzer/program-point.h"
+#include "sbitmap.h"
+#include "tristate.h"
+#include "selftest.h"
+#include "analyzer/region-model.h"
+#include "analyzer/sm.h"
+#include "analyzer/program-state.h"
+#include "alloc-pool.h"
+#include "fibonacci_heap.h"
+#include "diagnostic-event-id.h"
+#include "analyzer/pending-diagnostic.h"
+#include "analyzer/diagnostic-manager.h"
+#include "shortest-paths.h"
 #include "analyzer/exploded-graph.h"
 #include "analyzer/analysis-plan.h"
 
diff --git a/gcc/analyzer/program-point.h b/gcc/analyzer/program-point.h
index 908727eb0fd..b9fe548f3a6 100644
--- a/gcc/analyzer/program-point.h
+++ b/gcc/analyzer/program-point.h
@@ -21,9 +21,6 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef GCC_ANALYZER_PROGRAM_POINT_H
 #define GCC_ANALYZER_PROGRAM_POINT_H
 
-#include "analyzer/call-string.h"
-#include "analyzer/supergraph.h"
-
 class exploded_graph;
 
 /* An enum for distinguishing the various kinds of program_point.  */
diff --git a/gcc/analyzer/program-state.cc b/gcc/analyzer/program-state.cc
index 743f7a8acf0..04346ae9dc8 100644
--- a/gcc/analyzer/program-state.cc
+++ b/gcc/analyzer/program-state.cc
@@ -23,9 +23,34 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tree.h"
 #include "diagnostic.h"
+#include "function.h"
 #include "analyzer/analyzer.h"
+#include "analyzer/analyzer-logging.h"
+#include "analyzer/sm.h"
+#include "sbitmap.h"
+#include "tristate.h"
+#include "ordered-hash-map.h"
+#include "selftest.h"
+#include "analyzer/region-model.h"
 #include "analyzer/program-state.h"
 #include "analyzer/constraint-manager.h"
+#include "alloc-pool.h"
+#include "fibonacci_heap.h"
+#include "shortest-paths.h"
+#include "analyzer/constraint-manager.h"
+#include "diagnostic-event-id.h"
+#include "analyzer/pending-diagnostic.h"
+#include "analyzer/diagnostic-manager.h"
+#include "cfg.h"
+#include "basic-block.h"
+#include "gimple.h"
+#include "gimple-iterator.h"
+#include "cgraph.h"
+#include "digraph.h"
+#include "analyzer/supergraph.h"
+#include "analyzer/call-string.h"
+#include "analyzer/program-point.h"
+#include "analyzer/program-state.h"
 #include "analyzer/exploded-graph.h"
 #include "analyzer/state-purge.h"
 #include "analyzer/analyzer-selftests.h"
diff --git a/gcc/analyzer/program-state.h b/gcc/analyzer/program-state.h
index be83d32b883..37fb7cc4101 100644
--- a/gcc/analyzer/program-state.h
+++ b/gcc/analyzer/program-state.h
@@ -21,9 +21,6 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef GCC_ANALYZER_PROGRAM_STATE_H
 #define GCC_ANALYZER_PROGRAM_STATE_H
 
-#include "analyzer/sm.h"
-#include "analyzer/region-model.h"
-
 /* Data shared by all program_state instances.  */
 
 class extrinsic_state
diff --git a/gcc/analyzer/region-model.cc b/gcc/analyzer/region-model.cc
index 06191b822bb..2b0945a4ce8 100644
--- a/gcc/analyzer/region-model.cc
+++ b/gcc/analyzer/region-model.cc
@@ -37,13 +37,25 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-pretty-print.h"
 #include "diagnostic-color.h"
 #include "diagnostic-metadata.h"
+#include "diagnostic-core.h"
 #include "tristate.h"
 #include "selftest.h"
+#include "function.h"
 #include "analyzer/analyzer.h"
 #include "analyzer/analyzer-logging.h"
+#include "ordered-hash-map.h"
+#include "options.h"
+#include "cgraph.h"
+#include "cfg.h"
+#include "digraph.h"
 #include "analyzer/supergraph.h"
+#include "sbitmap.h"
 #include "analyzer/region-model.h"
 #include "analyzer/constraint-manager.h"
+#include "diagnostic-event-id.h"
+#include "analyzer/sm.h"
+#include "diagnostic-event-id.h"
+#include "analyzer/sm.h"
 #include "analyzer/pending-diagnostic.h"
 #include "analyzer/analyzer-selftests.h"
 
diff --git a/gcc/analyzer/region-model.h b/gcc/analyzer/region-model.h
index 5e0a464a252..ec5282f6956 100644
--- a/gcc/analyzer/region-model.h
+++ b/gcc/analyzer/region-model.h
@@ -21,14 +21,6 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef GCC_ANALYZER_REGION_MODEL_H
 #define GCC_ANALYZER_REGION_MODEL_H
 
-#include "sbitmap.h"
-#include "ordered-hash-map.h"
-#include "pretty-print.h"
-#include "tristate.h"
-#include "selftest.h"
-#include "analyzer/analyzer.h"
-#include "analyzer/sm.h"
-
 /* Implementation of the region-based ternary model described in:
      "A Memory Model for Static Analysis of C Programs"
       (Zhongxing Xu, Ted Kremenek, and Jian Zhang)
diff --git a/gcc/analyzer/sm-file.cc b/gcc/analyzer/sm-file.cc
index a191f5350ce..ba18bf71a73 100644
--- a/gcc/analyzer/sm-file.cc
+++ b/gcc/analyzer/sm-file.cc
@@ -28,9 +28,14 @@ along with GCC; see the file COPYING3.  If not see
 #include "options.h"
 #include "diagnostic-path.h"
 #include "diagnostic-metadata.h"
+#include "function.h"
 #include "analyzer/analyzer.h"
-#include "analyzer/pending-diagnostic.h"
+#include "diagnostic-event-id.h"
+#include "analyzer/analyzer-logging.h"
 #include "analyzer/sm.h"
+#include "diagnostic-event-id.h"
+#include "analyzer/sm.h"
+#include "analyzer/pending-diagnostic.h"
 
 #if ENABLE_ANALYZER
 
diff --git a/gcc/analyzer/sm-malloc.cc b/gcc/analyzer/sm-malloc.cc
index b5847476c29..80ceb0f5913 100644
--- a/gcc/analyzer/sm-malloc.cc
+++ b/gcc/analyzer/sm-malloc.cc
@@ -29,9 +29,12 @@ along with GCC; see the file COPYING3.  If not see
 #include "bitmap.h"
 #include "diagnostic-path.h"
 #include "diagnostic-metadata.h"
+#include "function.h"
 #include "analyzer/analyzer.h"
-#include "analyzer/pending-diagnostic.h"
+#include "diagnostic-event-id.h"
+#include "analyzer/analyzer-logging.h"
 #include "analyzer/sm.h"
+#include "analyzer/pending-diagnostic.h"
 
 #if ENABLE_ANALYZER
 
diff --git a/gcc/analyzer/sm-pattern-test.cc b/gcc/analyzer/sm-pattern-test.cc
index 24b9b788caf..8c70858e938 100644
--- a/gcc/analyzer/sm-pattern-test.cc
+++ b/gcc/analyzer/sm-pattern-test.cc
@@ -30,9 +30,12 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-pretty-print.h"
 #include "diagnostic-path.h"
 #include "diagnostic-metadata.h"
+#include "function.h"
 #include "analyzer/analyzer.h"
-#include "analyzer/pending-diagnostic.h"
+#include "diagnostic-event-id.h"
+#include "analyzer/analyzer-logging.h"
 #include "analyzer/sm.h"
+#include "analyzer/pending-diagnostic.h"
 
 #if ENABLE_ANALYZER
 
diff --git a/gcc/analyzer/sm-sensitive.cc b/gcc/analyzer/sm-sensitive.cc
index 94d637eeff6..efb24325fbd 100644
--- a/gcc/analyzer/sm-sensitive.cc
+++ b/gcc/analyzer/sm-sensitive.cc
@@ -30,9 +30,12 @@ along with GCC; see the file COPYING3.  If not see
 #include "options.h"
 #include "diagnostic-path.h"
 #include "diagnostic-metadata.h"
+#include "function.h"
 #include "analyzer/analyzer.h"
-#include "analyzer/pending-diagnostic.h"
+#include "diagnostic-event-id.h"
+#include "analyzer/analyzer-logging.h"
 #include "analyzer/sm.h"
+#include "analyzer/pending-diagnostic.h"
 
 #if ENABLE_ANALYZER
 
diff --git a/gcc/analyzer/sm-signal.cc b/gcc/analyzer/sm-signal.cc
index 0bd31fcf117..ee41d1976c0 100644
--- a/gcc/analyzer/sm-signal.cc
+++ b/gcc/analyzer/sm-signal.cc
@@ -27,13 +27,35 @@ along with GCC; see the file COPYING3.  If not see
 #include "function.h"
 #include "basic-block.h"
 #include "gimple.h"
+#include "options.h"
+#include "bitmap.h"
 #include "diagnostic-path.h"
 #include "diagnostic-metadata.h"
+#include "function.h"
 #include "analyzer/analyzer.h"
+#include "diagnostic-event-id.h"
+#include "analyzer/analyzer-logging.h"
+#include "analyzer/sm.h"
+#include "analyzer/pending-diagnostic.h"
+#include "sbitmap.h"
+#include "tristate.h"
+#include "ordered-hash-map.h"
+#include "selftest.h"
+#include "analyzer/region-model.h"
+#include "analyzer/program-state.h"
 #include "analyzer/checker-path.h"
+#include "digraph.h"
+#include "cfg.h"
+#include "gimple-iterator.h"
+#include "cgraph.h"
+#include "analyzer/supergraph.h"
+#include "analyzer/call-string.h"
+#include "analyzer/program-point.h"
+#include "alloc-pool.h"
+#include "fibonacci_heap.h"
+#include "analyzer/diagnostic-manager.h"
+#include "shortest-paths.h"
 #include "analyzer/exploded-graph.h"
-#include "analyzer/pending-diagnostic.h"
-#include "analyzer/sm.h"
 
 #if ENABLE_ANALYZER
 
diff --git a/gcc/analyzer/sm-taint.cc b/gcc/analyzer/sm-taint.cc
index d5f218958fe..9382853503f 100644
--- a/gcc/analyzer/sm-taint.cc
+++ b/gcc/analyzer/sm-taint.cc
@@ -30,9 +30,12 @@ along with GCC; see the file COPYING3.  If not see
 #include "options.h"
 #include "diagnostic-path.h"
 #include "diagnostic-metadata.h"
+#include "function.h"
 #include "analyzer/analyzer.h"
-#include "analyzer/pending-diagnostic.h"
+#include "diagnostic-event-id.h"
+#include "analyzer/analyzer-logging.h"
 #include "analyzer/sm.h"
+#include "analyzer/pending-diagnostic.h"
 
 #if ENABLE_ANALYZER
 
diff --git a/gcc/analyzer/sm.cc b/gcc/analyzer/sm.cc
index c8a78f9eb72..03d65ffed3d 100644
--- a/gcc/analyzer/sm.cc
+++ b/gcc/analyzer/sm.cc
@@ -26,7 +26,10 @@ along with GCC; see the file COPYING3.  If not see
 #include "basic-block.h"
 #include "gimple.h"
 #include "options.h"
+#include "function.h"
+#include "diagnostic-core.h"
 #include "analyzer/analyzer.h"
+#include "analyzer/analyzer-logging.h"
 #include "analyzer/sm.h"
 
 #if ENABLE_ANALYZER
diff --git a/gcc/analyzer/sm.h b/gcc/analyzer/sm.h
index 0f72520100f..fb49630f073 100644
--- a/gcc/analyzer/sm.h
+++ b/gcc/analyzer/sm.h
@@ -21,8 +21,6 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef GCC_ANALYZER_SM_H
 #define GCC_ANALYZER_SM_H
 
-#include "analyzer/analyzer-logging.h"
-
 /* Utility functions for use by state machines.  */
 
 extern tree is_zero_assignment (const gimple *stmt);
diff --git a/gcc/analyzer/state-purge.cc b/gcc/analyzer/state-purge.cc
index 61263d1edae..32c564767f9 100644
--- a/gcc/analyzer/state-purge.cc
+++ b/gcc/analyzer/state-purge.cc
@@ -35,7 +35,17 @@ along with GCC; see the file COPYING3.  If not see
 #include "options.h"
 #include "ssa-iterators.h"
 #include "gimple-pretty-print.h"
+#include "function.h"
 #include "analyzer/analyzer.h"
+#include "analyzer/call-string.h"
+#include "digraph.h"
+#include "ordered-hash-map.h"
+#include "cfg.h"
+#include "gimple-iterator.h"
+#include "cgraph.h"
+#include "analyzer/supergraph.h"
+#include "analyzer/program-point.h"
+#include "analyzer/analyzer-logging.h"
 #include "analyzer/state-purge.h"
 
 #if ENABLE_ANALYZER
diff --git a/gcc/analyzer/state-purge.h b/gcc/analyzer/state-purge.h
index 67e7433155c..77b7f622bbd 100644
--- a/gcc/analyzer/state-purge.h
+++ b/gcc/analyzer/state-purge.h
@@ -21,9 +21,6 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef GCC_ANALYZER_STATE_PURGE_H
 #define GCC_ANALYZER_STATE_PURGE_H
 
-#include "analyzer/analyzer-logging.h"
-#include "analyzer/program-point.h"
-
 /* Hash traits for function_point.  */
 
 template <> struct default_hash_traits<function_point>
diff --git a/gcc/analyzer/supergraph.cc b/gcc/analyzer/supergraph.cc
index a17e7d6e9e5..24f83c9b719 100644
--- a/gcc/analyzer/supergraph.cc
+++ b/gcc/analyzer/supergraph.cc
@@ -42,7 +42,13 @@ along with GCC; see the file COPYING3.  If not see
 #include "cgraph.h"
 #include "tree-dfa.h"
 #include "cfganal.h"
+#include "function.h"
 #include "analyzer/analyzer.h"
+#include "ordered-hash-map.h"
+#include "options.h"
+#include "cgraph.h"
+#include "cfg.h"
+#include "digraph.h"
 #include "analyzer/supergraph.h"
 #include "analyzer/analyzer-logging.h"
 
diff --git a/gcc/analyzer/supergraph.h b/gcc/analyzer/supergraph.h
index 81ea3ac0819..4c0775c59e2 100644
--- a/gcc/analyzer/supergraph.h
+++ b/gcc/analyzer/supergraph.h
@@ -21,16 +21,6 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef GCC_ANALYZER_SUPERGRAPH_H
 #define GCC_ANALYZER_SUPERGRAPH_H
 
-#include "ordered-hash-map.h"
-#include "options.h"
-#include "cgraph.h"
-#include "function.h"
-#include "cfg.h"
-#include "basic-block.h"
-#include "gimple.h"
-#include "gimple-iterator.h"
-#include "digraph.h"
-
 /* Forward decls, using indentation to show inheritance.  */
 
 class supergraph;
-- 
2.21.0

