let get_kf_fi proj kf =
  let fct_var = Kernel_function.get_vi kf in
  try Cil_datatype.Varinfo.Hashtbl.find proj.T.functions fct_var
  with Not_found ->
    let fi_def, is_def =
      try let def = Kernel_function.get_definition kf in Some def, true
      with Kernel_function.No_Definition -> Nonefalse
    in
    let new_fi = {
      T.fi_kf = kf;
      T.fi_def = fi_def;
      T.fi_project = proj;
      T.fi_top = None;
      T.fi_level_option = get_default_level_option is_def;
      T.fi_init_marks = None ;
      T.fi_slices = [] ;
      T.fi_next_ff_num = 1;
      T.f_called_by = [] }
    in
    Cil_datatype.Varinfo.Hashtbl.add proj.T.functions fct_var new_fi;
    new_fi