12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667(**************************************************************************)(* *)(* 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). *)(* *)(**************************************************************************)letmain()=ifSlicingParameters.is_on()thenbeginSlicingParameters.feedback~level:1"slicing requests in progress...";(* have to do the value analysis before the selections
* because some functions use its results,
* and the value analysis is not launched automatically. *)Eva.Analysis.compute();letproject_name=SlicingParameters.ProjectName.get()inApi.Project.reset_slicing();Api.Request.add_persistent_cmdline();(* Apply all pending requests. *)ifApi.Request.is_request_empty_internal()thenbeginSlicingParameters.warning"No internal slicing request from the command line.";ifSlicingParameters.Mode.Callers.get()thenletkf_entry,_library=Globals.entry_point()inSlicingParameters.warning"Adding an extra request on the entry point of function: %a."Kernel_function.prettykf_entry;letset=Api.Select.empty_selectsinletset=Api.Select.select_func_calls_intoset~spare:truekf_entryinApi.Request.add_persistent_selectionsetend;Api.Request.apply_all_internal();ifSlicingParameters.Mode.Callers.get()thenApi.Slice.remove_uncalled();letsliced_project_name=project_name^(SlicingParameters.ExportedProjectPostfix.get())inSlicingParameters.set_off();letsliced_project=Api.Project.extractsliced_project_nameinProject.onsliced_projectSlicingParameters.clear();SlicingParameters.feedback~level:2"done (slicing requests in progress).";end(** Register the function [main] as a main entry point. *)let()=Db.Main.extendmain(*
Local Variables:
compile-command: "make -C ../../.."
End:
*)