let select_all_outputs proj kf =
  let pdg = !Db.Pdg.get kf in
  let outputs = !Db.Outputs.get_external kf in
    debug 1 "selecting output zones %a@."
      Locations.Zone.pretty outputs;
  try
  let nodes, undef = !Db.Pdg.find_location_nodes_at_end pdg outputs in
  let nodes =
    try ((!Db.Pdg.find_ret_output_node pdg),None) :: nodes
    with Db.Pdg.NotFound -> nodes
  in
  let nodes_and_co = ([], [], (nodes, undef)) in
  let to_select = add_nodes_and_undef_to_select false nodes_and_co [] in
    select_pdg_elements proj pdg to_select
  with PdgIndex.NotFound -> (* end is unreachable *)
    ()