123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293(**************************************************************************)(* *)(* This file is part of Frama-C. *)(* *)(* Copyright (C) 2007-2023 *)(* CEA (Commissariat à l'énergie atomique et aux énergies *)(* alternatives) *)(* *)(* you can redistribute it and/or modify it under the terms of the GNU *)(* Lesser General Public License as published by the Free Software *)(* Foundation, version 2.1. *)(* *)(* It is distributed in the hope that it will be useful, *)(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)(* GNU Lesser General Public License for more details. *)(* *)(* See the GNU Lesser General Public License version 2.1 *)(* for more details (enclosed in the file licenses/LGPLv2.1). *)(* *)(**************************************************************************)openPdg_typeslet()=Cmdline.run_after_extended_stage(fun()->State_dependency_graph.add_codependencies~onto:Pdg_tbl.self[From.self])letdeps=[Pdg_tbl.self;Pdg_parameters.BuildAll.self;Pdg_parameters.BuildFct.self]let()=Pdg_parameters.BuildAll.set_output_dependenciesdepsletcompute_for_kfkf=letall=Pdg_parameters.BuildAll.get()in(all&&Eva.Results.is_calledkf)||Kernel_function.Set.memkf(Pdg_parameters.BuildFct.get())letcompute()=Eva.Analysis.compute();letdo_kf_pdgkf=ifcompute_for_kfkfthenletpdg=Pdg_tbl.getkfinletdot_basename=Pdg_parameters.DotBasename.get()inifdot_basename<>""thenletfname=Kernel_function.get_namekfinPdg_tbl.print_dotpdg(dot_basename^"."^fname^".dot")inCallgraph.Uses.iter_in_rev_orderdo_kf_pdg;letpp_sepfmt()=Format.pp_print_stringfmt","inPdg_parameters.(debug"Logging keys : %a"(Format.pp_print_list~pp_seppp_category)(get_debug_keys()));ifPdg_parameters.BuildAll.get()thenPdg_parameters.feedback"====== PDG GRAPH COMPUTED ======"letcompute_once,_=State_builder.apply_once"Pdg.Register.compute_once"depscomputeletoutput()=letbw=Pdg_parameters.PrintBw.get()inletdo_kf_pdgkf=ifcompute_for_kfkfthenletpdg=Pdg_tbl.getkfinletheaderfmt=Format.fprintffmt"PDG for %a"Kernel_function.prettykfinPdg_parameters.printf~header"@[ @[%a@]@]"(PdgTypes.Pdg.pretty_bw~bw)pdginCallgraph.Uses.iter_in_rev_orderdo_kf_pdgletsomething_to_do()=Pdg_parameters.BuildAll.get()||not(Kernel_function.Set.is_empty(Pdg_parameters.BuildFct.get()))letmain()=ifsomething_to_do()then(compute_once();Pdg_parameters.BuildAll.outputoutput)let()=Db.Main.extendmain(*
Local Variables:
compile-command: "make -C ../../.."
End:
*)