removed unused header
[libfirm] / ir / ana2 / typalise.c
index f5a8aa4..bced3f0 100644 (file)
@@ -1,18 +1,31 @@
 /* -*- c -*- */
 
 /*
- * Project:     libFIRM
- * File name:   ir/ana2/pto.c
- * Purpose:     Pto
- * 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.
  */
 
-
+/**
+ * @file
+ * @brief     Pto
+ * @author    Florian
+ * @date      Mon 18 Oct 2004
+ * @version   $Id$
+ */
 # ifdef HAVE_CONFIG_H
 #  include "config.h"
 # endif
@@ -195,7 +208,7 @@ static lset_t *subtype_closure (ir_type *otype)
 /**
    Helper method for get_owner_types
 */
-static void _collect_owner_types (entity *method, ir_graph *graph, lset_t *tps)
+static void _collect_owner_types (ir_entity *method, ir_graph *graph, lset_t *tps)
 {
   int i, n_over;
 
@@ -218,7 +231,7 @@ static void _collect_owner_types (entity *method, ir_graph *graph, lset_t *tps)
 
   n_over = get_entity_n_overwrittenby (method);
   for (i = 0; i < n_over; i ++) {
-    entity *ometh = get_entity_overwrittenby (method, i);
+    ir_entity *ometh = get_entity_overwrittenby (method, i);
 
     _collect_owner_types (ometh, graph, tps);
   }
@@ -231,7 +244,7 @@ static void _collect_owner_types (entity *method, ir_graph *graph, lset_t *tps)
 static lset_t *get_owner_types (ir_graph *graph)
 {
   lset_t *tps = lset_create ();
-  entity *meth = get_irg_entity (graph);
+  ir_entity *meth = get_irg_entity (graph);
 
   _collect_owner_types (meth, graph, tps);
 
@@ -423,7 +436,7 @@ static const char *ta_name (typalise_t *ta)
    method.  Presumably, this is because clazz inherits the graph as
    the implementation for a method.
 */
-static int uses_graph (ir_type *clazz, entity *meth, ir_graph *graph)
+static int uses_graph (ir_type *clazz, ir_entity *meth, ir_graph *graph)
 {
   ir_type *g_clazz = get_entity_owner (meth);
   int i, n_over, use = FALSE;
@@ -443,7 +456,7 @@ static int uses_graph (ir_type *clazz, entity *meth, ir_graph *graph)
   /* else inherited or description */
   n_over = get_entity_n_overwrittenby (meth); /* DOWN-wards */
   for (i = 0; (i < n_over) && (!use); i ++) {
-    entity *over = get_entity_overwrittenby (meth, i);
+    ir_entity *over = get_entity_overwrittenby (meth, i);
 
     use |= uses_graph (clazz, over, graph);
   }
@@ -471,7 +484,7 @@ static int ta_supports (typalise_t *ta, ir_graph *graph)
     return (res);
   }
   case (type_type): {
-    entity *meth = get_irg_entity (graph);
+    ir_entity *meth = get_irg_entity (graph);
     ir_type *tp = get_entity_owner (meth);
     int res = is_subtype (tp, ta->res.type);
 
@@ -505,7 +518,7 @@ static int ta_supports (typalise_t *ta, ir_graph *graph)
 */
 static typalise_t *typalise_call (ir_node *call)
 {
-  entity *ent = NULL;
+  ir_entity *ent = NULL;
   ir_type *tp = NULL;
   typalise_t *res = NULL;
   ir_node *call_ptr = get_Call_ptr (call);
@@ -560,7 +573,7 @@ static typalise_t *typalise_call (ir_node *call)
 */
 static typalise_t *typalise_load (ir_node *load)
 {
-  entity *ent = NULL;
+  ir_entity *ent = NULL;
   ir_type *tp = NULL;
   typalise_t *res = NULL;
   ir_node *load_ptr = get_Load_ptr (load);
@@ -610,8 +623,8 @@ static typalise_t *typalise_proj (ir_node *proj)
     proj_in = get_Proj_pred (proj_in);
     if (iro_Start == get_irn_opcode (proj_in)) {
       /* aha, proj arg */
-      ir_graph *graph = get_irn_irg (proj);
-      entity   *meth  = get_irg_entity (graph);
+      ir_graph  *graph = get_irn_irg (proj);
+      ir_entity *meth  = get_irg_entity (graph);
 
       long n = get_Proj_proj (proj);
       ir_type *tp = get_method_param_type (get_entity_type (meth), n);
@@ -630,7 +643,7 @@ static typalise_t *typalise_proj (ir_node *proj)
       cough_and_die (proj_in);
     }
   } else {
-    opcode op = get_irn_opcode (proj_in);
+    ir_opcode op = get_irn_opcode (proj_in);
     if ((iro_Load != op) && (iro_Alloc != op) && (iro_Call != op)) {
       fprintf (stdout, "\n Proj (%s) not handled\n",
                get_op_name (get_irn_op (proj_in)));
@@ -677,7 +690,7 @@ lset_t *filter_for_ta (lset_t *set, typalise_t *ta)
 */
 typalise_t *typalise (ir_node *node)
 {
-  opcode op = get_irn_opcode (node);
+  ir_opcode op = get_irn_opcode (node);
   typalise_t *res = NULL;
 
   switch (op) {
@@ -723,7 +736,7 @@ typalise_t *typalise (ir_node *node)
   case (iro_Sel): {
     /* FILTER */
     /* it's call (sel (ptr)) or load (sel (ptr)) */
-    entity *ent = get_Sel_entity (node);
+    ir_entity *ent = get_Sel_entity (node);
     ir_type *tp = get_entity_type (ent);
 
     if (is_Method_type (tp)) {
@@ -781,7 +794,7 @@ typalise_t *typalise (ir_node *node)
   case (iro_Call): {
     /* presumably call (sel (proj (call))) */
     ir_node *ptr = get_Call_ptr (node);
-    entity *meth = NULL;
+    ir_entity *meth = NULL;
     if (iro_Sel == get_irn_opcode (ptr)) {
       meth = get_Sel_entity (ptr);
     } else if (iro_SymConst == get_irn_opcode (ptr)) {
@@ -811,7 +824,7 @@ typalise_t *typalise (ir_node *node)
 
       res = ta_type (tp);
     } else if (get_SymConst_kind (node) == symconst_addr_ent) {
-      entity *ent = get_SymConst_entity (node);
+      ir_entity *ent = get_SymConst_entity (node);
       ir_type *tp = get_entity_owner (ent);
 
       while (is_Pointer_type (tp)) {
@@ -874,6 +887,12 @@ void typalise_init (void)
 \f
 /*
   $Log$
+  Revision 1.14  2007/01/16 15:45:42  beck
+  renamed type opcode to ir_opcode
+
+  Revision 1.13  2006/12/13 19:46:47  beck
+  rename type entity into ir_entity
+
   Revision 1.12  2006/01/13 21:54:02  beck
   renamed all types 'type' to 'ir_type'