1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071(**************************************************************************)(* *)(* This file is part of WP plug-in of Frama-C. *)(* *)(* Copyright (C) 2007-2024 *)(* CEA (Commissariat a l'energie atomique et aux energies *)(* 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). *)(* *)(**************************************************************************)(* Compute Init WP *)moduleMake(W:Mcfg.S)=structletcompute_global_initwenvfilterobj=Globals.Vars.fold_in_file_rev_order(funvarinitinfoobj->ifvar.vstorage=Externthenobjelseletdo_init=matchfilterwith|`All->true|`InitConst->Cil.isGlobalInitConstvarinifnotdo_initthenobjelseCurrent_loc.with_locvar.vdecl(W.initwenvvarinitinfo.init)obj)objletprocess_global_constwenvobj=Globals.Vars.fold_in_file_rev_order(funvar_initinfoobj->ifCil.isGlobalInitConstvarthenW.constwenvvarobjelseobj)obj(* WP of global initializations. *)letprocess_global_initwenvkfobj=ifCfgInfos.is_entry_pointkfthenbeginletobj=W.labelwenvNoneClabels.initobjincompute_global_initwenv`AllobjendelseifW.has_initwenvthenbeginletobj=ifWp_parameters.Init.get()thenprocess_global_constwenvobjelseobjinletobj=W.use_assignswenvNoneWpPropId.mk_init_assignsobjinletobj=W.labelwenvNoneClabels.initobjincompute_global_initwenv`AllobjendelseifWp_parameters.Init.get()thencompute_global_initwenv`InitConstobjelseobjend