fix
[libfirm] / ir / ana2 / pto_util.h
index 7f95ae5..df44bc4 100644 (file)
 /* -*- c -*- */
 
 /*
- * Project:     libFIRM
- * File name:   ir/ana2/pto_util.c
- * Purpose:     Pto Utilities
- * Author:      Florian
- * Modified by:
- * Created:     Mon 18 Oct 2004
- * CVS-ID:      $Id$
- * Copyright:   (c) 1999-2004 Universität Karlsruhe
- * Licence:     This file is protected by GPL -  GNU GENERAL PUBLIC LICENSE.
+ * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
+ *
+ * This file is part of libFirm.
+ *
+ * This file may be distributed and/or modified under the terms of the
+ * GNU General Public License version 2 as published by the Free Software
+ * Foundation and appearing in the file LICENSE.GPL included in the
+ * packaging of this file.
+ *
+ * Licensees holding valid libFirm Professional Edition licenses may use
+ * this file in accordance with the libFirm Commercial License.
+ * Agreement provided with the Software.
+ *
+ * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+ * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE.
  */
 
-# ifndef _PTO_UTIL_H_
-# define _PTO_UTIL_H_
-
-# include "irgraph.h"
-# include "qset.h"
-
-# define N_INITIAL_OBJS         5
-
-typedef enum obj_kind_enum {
-  obj_kind_obj,
-  obj_kind_array,
-} obj_kind_t;
-
-typedef struct obj_desc_str
-{
-  obj_kind_t kind;              /* written obj_kind_obj or obj_kind_array */
-  struct obj_desc_str *next;    /* link all descrs into a linked list */
-# ifdef PTO_DUMMY
-  int is_dummy;                 /* allow to filter out dummy objects */
-# endif /* defined PTO_DUMMY */
-  type *tp;                     /* type of described object */
-} obj_desc_t;
-
-typedef struct obj_obj_desc_str
-{
-  obj_kind_t kind;              /* always written obj_kind_obj */
-  struct obj_desc_str *next;    /* link all descrs into a linked list */
-# ifdef PTO_DUMMY
-  int is_dummy;                 /* allow to filter out dummy objects */
-# endif /* defined PTO_DUMMY */
-  type *tp;                     /* type of described object */
-  entity **fields;              /* fields of described object */
-  int n_fields;                 /* number of fields */
-  qset_t **vals;                /* qsets of values of the fields */
-} obj_obj_desc_t;
-
-typedef struct obj_arr_desc_str
-{
-  obj_kind_t kind;              /* always written obj_kind_array */
-  struct obj_desc_str *next;    /* link all descrs into a linked list */
-# ifdef PTO_DUMMY
-  int is_dummy;                 /* allow to filter out dummy objects */
-# endif /* defined PTO_DUMMY */
-  type *tp;                     /* (array) type of described object */
-  qset_t *val;                  /* all values of 'the' 'field' */
-} obj_arr_desc_t;
-
-typedef struct pto_str
-{
-  void *kind;                   /* always written to &pto_id */
-  ir_node *node;                /* Rubbish: node for which this pto_t was constructed */
-  qset_t *objs;                 /* qset of obj_desc_t* */
-} pto_t;
-
-
-/* Get the entity of a ptr */
-entity *get_ptr_ent (ir_node*);
-
-/* Ctors for the pto types */
-obj_desc_t *obj_desc_new (type*);
-
-# ifdef PTO_DUMMY
-/* Mark an obj desc as a dummy */
-void obj_desc_set_dummy (obj_desc_t*);
-
-/* Say whether an obj desc is a dummy */
-int obj_desc_is_dummy (obj_desc_t*);
-# endif /* defined PTO_DUMMY */
-
-
-/* Deallocate an obj desc */
-void obj_desc_delete (obj_desc_t*);
-
-/* List all obj descs that have been created.  If tp is given non-NULL,
-  only descs for this type are listed, else all types are listed. */
-void obj_desc_list_all (type*);
-
-/* Create a new pto value containing a name of the given type. */
-pto_t *pto_new_name (ir_node*, type*);
-
-/* Create a new pto value containing no names. */
-pto_t *pto_new_empty (ir_node*);
-
-/* Deallocate a pto */
-void pto_delete (pto_t*);
-
-/* Sanity checking on a pto_t */
-void check_pto (pto_t*);
-
-/*   Add the given name to the given pto. */
-void pto_add_name (pto_t*, obj_desc_t*);
-
-/* Add all the given names to the given pto. */
-void pto_add_all_names (pto_t*, qset_t*);
+/**
+ * @file
+ * @brief    Utilitites for PTO
+ * @author   Florian
+ * @date     Sat Nov 13 19:35:27 CET 2004
+ * @version  $Id$
+ */
+# ifndef FIRM_ANA2_PTO_UTIL_H
+# define FIRM_ANA2_PTO_UTIL_H
+
+# include "irnode.h"
+# include "entity.h"
+
+/* ===================================================
+   Global Defines:
+   =================================================== */
+
+/* ===================================================
+ Global Data Types:
+ =================================================== */
+
+/* ===================================================
+   Global Prototypes:
+   =================================================== */
+/** Get the entity of a ptr. */
+ir_entity *get_ptr_ent (ir_node *ptr);
+
+/**
+ * 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.
+ *
+ * @param irg  The IR graph
+ */
+ir_node **find_irg_args (ir_graph *irg);
 
+/* Check whether the load of the given ptr is a dummy */
+int is_dummy_load_ptr (ir_node*);
 
-/* 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.
-  If an argument is not used, it is also written NULL in this array. */
-ir_node **find_irg_args (ir_graph*);
-/* int is_field (entity*); */
+/* ===================================================
+   Global Variables:
+   =================================================== */
 
 
-/* Perform a lookup of the contents of the given field in the given pto */
-qset_t *pto_lookup (obj_desc_t*, entity*);
+# endif /* not defined _PTO_UTIL_ */
 
-# endif /* not defined _PTO_UTIL_H_ */
 
 \f
 /*
   $Log$
-  Revision 1.2  2004/11/04 14:58:38  liekweg
-  expanded pto, added initialisation, added debugging printing
+  Revision 1.8  2006/12/13 19:46:47  beck
+  rename type entity into ir_entity
 
-  Revision 1.1  2004/10/22 15:10:51  liekweg
-  moved utils to pto_util
+  Revision 1.7  2005/06/17 17:43:52  beck
+  added doxygen docu
 
+  Revision 1.6  2004/11/26 15:59:14  liekweg
+  recognize dummy loads
 
- */
+  Revision 1.5  2004/11/24 14:53:56  liekweg
+  Bugfixes
+
+  Revision 1.4  2004/11/18 16:37:07  liekweg
+  rewrite
+
+
+*/