- Create a new pto value containing no names.
-*/
-pto_t *pto_new_empty (ir_node *node)
-{
- pto_t *pto = (pto_t*) xmalloc (sizeof (pto_t));
-
- pto->kind = &pto_id;
- pto->node = node;
- pto->is_dummy = FALSE;
- pto->objs = qset_new (N_INITIAL_OBJS);
-
- return (pto);
-}
-
-/*
- Create a new pto value containing a name of the given type.
-*/
-pto_t *pto_new_name (ir_node *node, type *tp)
-{
- pto_t *pto = pto_new_empty (node);
- obj_desc_t *desc = obj_desc_new (tp);
-
- qset_insert (pto->objs, desc);
-
- return (pto);
-}
-
-/*
- Deallocate a pto
-*/
-void pto_delete (pto_t *pto)
-{
- qset_delete (pto->objs);
-
- memset (pto, 0x00, sizeof (pto_t));
-
- free (pto);
-}
-
-
-/*
- Pto types misc ops
-*/
-/*
- Sanity checking on a pto_t
-*/
-void check_pto (pto_t *pto)
-{
- assert (&pto_id == pto->kind);
-}
-
-/*
- Add the given name to the given pto.
-*/
-void pto_add_name (pto_t *pto, obj_desc_t *obj)
-{
- qset_insert (pto->objs, obj);
-}
-
-/*
- Add all the given names to the given pto.
-*/
-void pto_add_all_names (pto_t *pto, qset_t *objs)
-{
- qset_insert_all (pto->objs, objs);
-}
-
-/* Mark the given pto as a dumy */
-void pto_set_dummy (pto_t *pto)
-{
- pto->is_dummy = TRUE;
-}
-
-/* Say whether the given pto is a dummy */
-int pto_is_dummy (pto_t *pto)
-{
- return (pto->is_dummy);
-}
-
-/*
- Find the arguments of a graph. For a method that has n args, the
- result array has 'n+1' entries, the last of which is written NULL.
-*/
-ir_node **find_irg_args (ir_graph *graph)
-{
- type *tp = get_entity_type (get_irg_entity (graph));
- const int n_args = get_method_n_params (tp);
- ir_node **args = (ir_node**) xmalloc (sizeof (ir_node*) * (n_args+1));
- ir_node *arg = get_irg_args (graph);
- find_irg_args_env_t *arg_env =
- (find_irg_args_env_t*) xmalloc (sizeof (find_irg_args_env_t));
-
- arg_env->args = args;
- arg_env->arg = arg;
-
- /* or use get_irg_end ?!? */
- {
- ir_graph *save = get_current_ir_graph ();
- set_current_ir_graph (graph);
- irg_walk (get_irg_end (graph), find_irg_arg, NULL, arg_env);
- set_current_ir_graph (save);
- }