123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122(**************************************************************************)(* *)(* 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). *)(* *)(**************************************************************************)includePlugin.Register(structletname="Eva"letshortname="eva"lethelp="automatically computes variation domains for the variables of the program"end)let()=add_plugin_output_aliases~visible:false~deprecated:true["value";"val"](* Do not add dependencies to Kernel parameters here, but at the top of
Parameters. *)letkernel_dependencies=[Ast.self;Alarms.self;Annotations.code_annot_state;]letproxy=State_builder.Proxy.(create"eva"Forwardkernel_dependencies)letstate=State_builder.Proxy.getproxy(* Current state of the analysis *)typecomputation_state=NotComputed|Computing|Computed|AbortedmoduleComputationState=structletto_string=function|NotComputed->"NotComputed"|Computing->"Computing"|Computed->"Computed"|Aborted->"Aborted"modulePrototype=structincludeDatatype.Serializable_undefinedtypet=computation_stateletname="Eva.Analysis.ComputationState"letprettyfmts=Format.pp_print_stringfmt(to_strings)letreprs=[NotComputed;Computing;Computed;Aborted]letdependencies=[state]letdefault()=NotComputedendmoduleDatatype'=Datatype.Make(Prototype)include(State_builder.Ref(Datatype')(Prototype))endletis_computed()=matchComputationState.get()with|Computed|Aborted->true|NotComputed|Computing->false(* Debug categories. *)letdkey_initial_state=register_category"initial-state"letdkey_final_states=register_category"final-states"letdkey_summary=register_category"summary"letdkey_pointer_comparison=register_category"pointer-comparison"letdkey_cvalue_domain=register_category"d-cvalue"letdkey_incompatible_states=register_category"incompatible-states"letdkey_iterator=register_category"iterator"letdkey_callbacks=register_category"callbacks"letdkey_widening=register_category"widening"letdkey_recursion=register_category"recursion"let()=letactivatedkey=add_debug_keysdkeyinList.iteractivate[dkey_initial_state;dkey_final_states;dkey_summary;dkey_cvalue_domain;dkey_recursion;](* Warning categories. *)letwkey_alarm=register_warn_category"alarm"letwkey_locals_escaping=register_warn_category"locals-escaping"letwkey_garbled_mix_read=register_warn_category"garbled-mix:read"let()=set_warn_statuswkey_garbled_mix_readLog.Wfeedbackletwkey_garbled_mix_write=register_warn_category"garbled-mix:write"let()=set_warn_statuswkey_garbled_mix_writeLog.Wfeedbackletwkey_garbled_mix_assigns=register_warn_category"garbled-mix:assigns"let()=set_warn_statuswkey_garbled_mix_assignsLog.Winactiveletwkey_garbled_mix_summary=register_warn_category"garbled-mix:summary"let()=set_warn_statuswkey_garbled_mix_summaryLog.Winactiveletwkey_builtins_missing_spec=register_warn_category"builtins:missing-spec"letwkey_builtins_override=register_warn_category"builtins:override"letwkey_libc_unsupported_spec=register_warn_category"libc:unsupported-spec"letwkey_loop_unroll_auto=register_warn_category"loop-unroll:auto"let()=set_warn_statuswkey_loop_unroll_autoLog.Wfeedbackletwkey_loop_unroll_partial=register_warn_category"loop-unroll:partial"let()=set_warn_statuswkey_loop_unroll_partialLog.Wfeedbackletwkey_missing_loop_unroll=register_warn_category"loop-unroll:missing"let()=set_warn_statuswkey_missing_loop_unrollLog.Winactiveletwkey_missing_loop_unroll_for=register_warn_category"loop-unroll:missing:for"let()=set_warn_statuswkey_missing_loop_unroll_forLog.Winactiveletwkey_signed_overflow=register_warn_category"signed-overflow"letwkey_invalid_assigns=register_warn_category"invalid-assigns"let()=set_warn_statuswkey_invalid_assignsLog.Wfeedbackletwkey_experimental=register_warn_category"experimental"letwkey_unknown_size=register_warn_category"unknown-size"letwkey_ensures_false=register_warn_category"ensures-false"letwkey_watchpoint=register_warn_category"watchpoint"let()=set_warn_statuswkey_watchpointLog.Wfeedback