123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687(**************************************************************************)(* *)(* 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). *)(* *)(**************************************************************************)(* This code duplicates more or less Option_signature.With_output. Since Inout prints
the results of all its options interleaved, it is difficult to proceed
otherwise *)moduleShouldOutput=State_builder.True_ref(structletdependencies=[Eva.Analysis.self](* To be completed if some computations
use some other results than Eva *)letname="Inout.Register.ShouldOuput"end)let()=Inout_parameters.Output.add_set_hook(fun_v->ifvthenShouldOutput.settrue)letmain()=letforceout=Inout_parameters.ForceOut.get()inletforceexternalout=Inout_parameters.ForceExternalOut.get()inletforceinput=Inout_parameters.ForceInput.get()inletforceinout=Inout_parameters.ForceInout.get()inletforceinoutwithformals=Inout_parameters.ForceInoutExternalWithFormals.get()inletforcederef=Inout_parameters.ForceDeref.get()inletforceinputwithformals=Inout_parameters.ForceInputWithFormals.get()inif(forceout||forceexternalout||forceinput||forceinputwithformals||forcederef||forceinout||forceinoutwithformals)&&Inout_parameters.Output.get()&&ShouldOutput.get()thenbeginShouldOutput.setfalse;Eva.Analysis.compute();Callgraph.Uses.iter_in_rev_order(funkf->ifKernel_function.is_definitionkf&&Eva.Results.is_calledkfthenbeginifforceoutthenInout_parameters.result"%a"Outputs.pretty_internalkf;ifforceexternaloutthenInout_parameters.result"%a"Outputs.pretty_externalkf;ifforceinputthenInout_parameters.result"%a"Inputs.pretty_externalkf;ifforcederefthenbeginDerefs.compute_externalkf;Inout_parameters.result"%a"Derefs.pretty_externalkf;end;ifforceinoutthenInout_parameters.result"%a"Operational_inputs.pretty_operational_inputs_internalkf;ifforceinoutwithformalsthenInout_parameters.result"%a"Operational_inputs.pretty_operational_inputs_external_with_formalskf;ifforceinputwithformalsthenInout_parameters.result"%a"Inputs.pretty_with_formalskf;end)endlet()=Db.Main.extendmain(*
Local Variables:
compile-command: "make -C ../../.."
End:
*)