X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=gcc%2Fanalyzer%2Fanalysis-plan.cc;h=3a91b182f70501a9b23a260058675bcb6ae375b3;hb=83ffe9cde7fe0b4deb0d1b54175fd9b19c38179c;hp=7dfc48e9c3eaea7926eb73b6eaa2a3b6d8631483;hpb=99dee82307f1e163e150c9c810452979994047ce;p=thirdparty%2Fgcc.git diff --git a/gcc/analyzer/analysis-plan.cc b/gcc/analyzer/analysis-plan.cc index 7dfc48e9c3ea..3a91b182f705 100644 --- a/gcc/analyzer/analysis-plan.cc +++ b/gcc/analyzer/analysis-plan.cc @@ -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 . This file is part of GCC. @@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see . */ #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;