let compute_on_cilast () =
  let file = Ast.get () in
  (* Do as before *)
  let cil_visitor = new slocVisitor in
  Visitor.visitFramacFileSameGlobals
    (cil_visitor:>Visitor.frama_c_visitor) file;
  if Metrics_parameters.ByFunction.get () then
    Metrics.result "@[<v 0>Cil AST@ %t@]" cil_visitor#pp_detailed_text_metrics;
  let r =  metrics_to_result cil_visitor in
  (* Print the result to file if required *)
  let out_fname = OutputFile.get () in
  begin
    if out_fname <> "" then
      try
        let oc = open_out_bin out_fname in
        let fmt = Format.formatter_of_out_channel oc in
        (match Metrics_base.get_file_type out_fname with
          | Html -> dump_html fmt cil_visitor
          | Text ->
            Format.fprintf fmt "@[<v 0>%t@ %a@]"
            cil_visitor#pp_detailed_text_metrics
            Metrics_base.pretty r
        );
        close_out oc;
      with Sys_error _ ->
        Metrics.failure "Cannot open file %s.@." out_fname
  end;
  r