1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586(**************************************************************************)(* *)(* 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). *)(* *)(**************************************************************************)openMetrics_parameters;;let()=Enabled.set_output_dependencies[Ast.self;AstType.self;OutputFile.self;SyntacticallyReachable.self;Libc.self];;letsyntactic?(libc=Metrics_parameters.Libc.get())()=beginmatchAstType.get()with|"cil"->Metrics_cilast.compute_on_cilast~libc(* Cabs metrics are experimental. unregistered *)|"cabs"->Metrics_cabs.compute_on_cabs()|"acsl"->Metrics_acsl.dump()|_->assertfalse(* the possible values are checked by the kernel*)end;SyntacticallyReachable.iter(funkf->letreachable=Metrics_coverage.compute_syntactic~libckfinletcov_printer=newMetrics_coverage.syntactic_printer~libcreachableinMetrics_parameters.result"%a"cov_printer#pp_reached_from_functionkf)let()=ValueCoverage.set_output_dependencies[Eva.Analysis.self;Libc.self]letvalue~libc()=Eva.Analysis.compute();ifEva.Analysis.is_computed()thenbeginletcov_metrics=Metrics_coverage.compute~libcinletcov_printer=newMetrics_coverage.semantic_printer~libccov_metricsinMetrics_parameters.result"%t"cov_printer#pp_value_coverage;Metrics_parameters.result"%t"cov_printer#pp_unreached_calls;Metrics_parameters.result"%t"cov_printer#pp_stmts_reached_by_function;end;;letmain()=letlibc=Libc.get()inifEnabled.get()thenEnabled.output(syntactic~libc);ifValueCoverage.get()thenValueCoverage.output(value~libc);ifLocalsSize.is_set()thenbeginAst.compute();Metrics_parameters.result"function\tlocals_size_no_temps\t\
locals_size_with_temps\t\
max_call_size_no_temps\t\
max_call_size_with_temps";LocalsSize.iter(funkf->Metrics_cilast.compute_locals_sizekf);end;ifUsedFiles.get()thenbeginletused_files=Metrics_cilast.used_files()inMetrics_cilast.pretty_used_filesused_filesend;;(* Register main entry points *)let()=Db.Main.extendmain(*
Local Variables:
compile-command: "make -C ../../.."
End:
*)