Module Checkers.ConfigGating

module F = Stdlib.Format

Config Gating Analysis: determines which config flags gate the execution of each call site.

The abstract state tracks, for each config, which values it MAY have if execution reaches this point. A config absent from the map may have any value (unconstrained). A call site is "gated" if some config is constrained to a strict subset of possible values.

module ConfigName : sig ... end

Identifies a config flag.

module BranchVal : sig ... end

Which value the config may have on this path.

module ConfigGuards : sig ... end

For each config, the set of values it may have if this point is reached. Absent config = unconstrained (may be any value). Join = union of possible value sets per config; if a config becomes unconstrained (both True and False are possible), it is removed. Empty map = no config is constrained = code always executes.

module ConfigFlat : sig ... end

Tracks which variables hold config values.

module Mem : sig ... end
module Domain : sig ... end

Full abstract domain: config guards + variable-to-config memory.

val is_config_method : IR.Procname.t -> bool

Check whether a callee matches any of the configured config-gating method patterns. The callee is matched as "ClassName.methodName" against each regex pattern.

val get_config_name : 'a -> (IR.Exp.t * 'b) list -> string

Extract a config name from the call arguments. Tries string constant first (static method pattern), then int constant at arg index 1 (instance method pattern with receiver at index 0).

val get_config_from_exp : Mem.t -> IR.Exp.t -> (ConfigName.t * BranchVal.t) option

Extract config info from a pruned expression: returns (config_name, branch_value) indicating which value the config may have on this path.

module TransferFunctions : sig ... end
module Analyzer : sig ... end
val checker : Absint.IntraproceduralAnalysis.t -> unit