let rec process_call_inputs proj =
  let rec process (to_select, unused) todo = match todo with
    | [] -> (to_select, unused)
    | (pdg_caller, call, sel, m) as e :: calls ->
        let kf_caller = PdgTypes.Pdg.get_kf pdg_caller in
        let fm_caller = get_marks proj kf_caller in
        let visible = match call with
          | Some call ->
              let fm = match fm_caller with 
                | None -> fatal "the caller should have marks@."
                | Some fm -> fm 
              in
                call_visible fm call
          | None -> (* let see if the function is visible or not *)
              assert (PdgTypes.Pdg.is_top pdg_caller);
              match  fm_caller with None -> false | Some _fm -> true 
        in
        let res = if visible then
            let to_select = add_pdg_selection to_select pdg_caller (sel, m) 
            in (to_select, unused)
          else (to_select, e::unused)
        in process res calls
  in
  let to_select, new_list = process ([], []) !call_in_to_check in
    match to_select with
      | [] -> call_in_to_check := []
             (* nothing more to mark : finished ! we can forget [new_list] *)
      | _ ->
          call_in_to_check := new_list;
          List.iter (fun (pdg, sel) -> select_pdg_elements proj pdg sel)
                    to_select;
          process_call_inputs proj