]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/analyzer/analysis-plan.cc
Update copyright years.
[thirdparty/gcc.git] / gcc / analyzer / analysis-plan.cc
index 7dfc48e9c3eaea7926eb73b6eaa2a3b6d8631483..3a91b182f70501a9b23a260058675bcb6ae375b3 100644 (file)
@@ -1,5 +1,5 @@
 /* A class to encapsulate decisions about how the analysis should happen.
-   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+   Copyright (C) 2019-2023 Free Software Foundation, Inc.
    Contributed by David Malcolm <dmalcolm@redhat.com>.
 
 This file is part of GCC.
@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3.  If not see
 <http://www.gnu.org/licenses/>.  */
 
 #include "config.h"
+#define INCLUDE_MEMORY
 #include "system.h"
 #include "coretypes.h"
 #include "tree.h"
@@ -27,7 +28,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "timevar.h"
 #include "ipa-utils.h"
 #include "function.h"
-#include "json.h"
 #include "analyzer/analyzer.h"
 #include "diagnostic-core.h"
 #include "analyzer/analyzer-logging.h"
@@ -35,7 +35,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "ordered-hash-map.h"
 #include "options.h"
 #include "cgraph.h"
-#include "function.h"
 #include "cfg.h"
 #include "basic-block.h"
 #include "gimple.h"
@@ -109,6 +108,10 @@ analysis_plan::use_summary_p (const cgraph_edge *edge) const
   if (!flag_analyzer_call_summaries)
     return false;
 
+  /* Don't use call summaries if there is no callgraph edge */
+  if (!edge || !edge->callee)
+    return false;
+
   /* TODO: don't count callsites each time.  */
   int num_call_sites = 0;
   const cgraph_node *callee = edge->callee;