removed unused header
[libfirm] / ir / ana2 / ecg.c
index bb5a277..6b3c7d7 100644 (file)
@@ -1,17 +1,31 @@
 /* -*- c -*- */
 
 /*
- * Project:     libFIRM
- * File name:   ir/ana/ecg.c
- * Purpose:     Extended Call Graph
- * Author:      Florian
- * Modified by:
- * Created:     14.09.2004
- * CVS-ID:      $Id$
- * Copyright:   (c) 1999-2004 Universität Karlsruhe
- * Licence:     This file is protected by the 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    Extended Call Graph
+ * @author   Florian
+ * @date     14.09.2004
+ * @version  $Id$
+ */
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
@@ -78,7 +92,7 @@ static int _depth = 0;
 static int _max_depth = 0;
 
 static int _max_callEds = 0;
-static entity* _max_callEds_callR = NULL;
+static ir_entity* _max_callEds_callR = NULL;
 
 /* Protos */
 void set_main_ctx (ctx_info_t*);
@@ -86,7 +100,7 @@ void set_main_ctx (ctx_info_t*);
 /* ====================
    Alloc stuff
    ==================== */
-static void append_alloc (graph_info_t *ginfo, ir_node *alloc, type *tp)
+static void append_alloc (graph_info_t *ginfo, ir_node *alloc, ir_type *tp)
 {
   alloc_info_t *ainfo = xmalloc (sizeof (alloc_info_t));
 
@@ -168,7 +182,7 @@ static void append_call (graph_info_t *info, ir_node *call, ir_graph *callEd)
    Given a method, find the firm graph that implements that method.
    Return NULL for abstract and native methods.
 */
-static ir_graph *_get_implementing_graph (entity *method)
+static ir_graph *_get_implementing_graph (ir_entity *method)
 {
   ir_graph *graph = NULL;
 
@@ -199,7 +213,7 @@ static ir_graph *_get_implementing_graph (entity *method)
     assert (!graph);
 
     for (i = 0; (NULL == graph) && (i < n_over); i ++) {
-      entity *over = get_entity_overwrites (method, i);
+      ir_entity *over = get_entity_overwrites (method, i);
 
       graph = _get_implementing_graph (over);
     }
@@ -214,7 +228,7 @@ static ir_graph *_get_implementing_graph (entity *method)
 /**
    Collect all graphs of 'method' in the given set.
 */
-static void _collect_implementing_graphs (entity *method, lset_t *set)
+static void _collect_implementing_graphs (ir_entity *method, lset_t *set)
 {
   /* search DOWN-wards in clazz hierarchy */
   int i;
@@ -230,7 +244,7 @@ static void _collect_implementing_graphs (entity *method, lset_t *set)
   }
 
   for (i = 0; i < n_over; i ++) {
-    entity *over = get_entity_overwrittenby (method, i);
+    ir_entity *over = get_entity_overwrittenby (method, i);
 
     _collect_implementing_graphs (over, set);
   }
@@ -240,7 +254,7 @@ static void _collect_implementing_graphs (entity *method, lset_t *set)
 /**
    Collect all graphs that could possibly be executed when 'method' is called.
 */
-static lset_t *get_implementing_graphs (entity *method, ir_node *select)
+static lset_t *get_implementing_graphs (ir_entity *method, ir_node *select)
 {
   /* const char *name = get_entity_name (method); */
   /* fprintf (stdout, "%s (ent %s)\n", __FUNCTION__, name); */
@@ -373,7 +387,7 @@ static void ecg_calls_act (ir_node *node, void *env)
   graph_info_t *graph_info = (graph_info_t*) env;
 
   if (op_Call == op) {         /* CALL */
-    entity *ent = NULL;
+    ir_entity *ent = NULL;
     ir_node *ptr = get_Call_ptr (node);
 
     if (!call_is_call (node, ptr)) {
@@ -419,7 +433,7 @@ static void ecg_calls_act (ir_node *node, void *env)
       assert (0 && "Unexpected address expression");
     }
   } else if (op_Alloc == op) {
-    type *tp = get_Alloc_type (node);
+    ir_type *tp = get_Alloc_type (node);
     /* const char *name = get_type_name (tp); */
 
     append_alloc (graph_info, node, tp);
@@ -616,7 +630,7 @@ static void ecg_fill_ctxs (void)
 */
 void ecg_print_ctx (ctx_info_t *ctx, FILE *stream)
 {
-  entity *ent = get_irg_entity(ctx->graph);
+  ir_entity *ent = get_irg_entity(ctx->graph);
   ir_node *call = ctx->call;
   const char *ent_name = get_entity_name (ent);
   const char *own_name = get_type_name (get_entity_owner (ent));
@@ -1198,8 +1212,8 @@ void ecg_report ()
         fprintf (dot, "\", color=\"green3\"];\n");
 
         fprintf (dot,
-                 "\tgraph_0x%08x -> ctx_0x%08x:HEAD [label=\"ctx\", dir=\"none\", style=\"dotted\"];\n",
-                 (int) graph, (int) graph);
+                 "\tgraph_0x%p -> ctx_0x%p:HEAD [label=\"ctx\", dir=\"none\", style=\"dotted\"];\n",
+                 graph, graph);
       }
     } else {
       fprintf (dot, "\t/* graph is not called */\n");
@@ -1266,7 +1280,13 @@ void ecg_ecg (void)
 \f
 
 /*
-  $Log$
+  $Log: ecg.c,v $
+  Revision 1.23  2006/12/13 19:46:47  beck
+  rename type entity into ir_entity
+
+  Revision 1.22  2006/01/13 22:55:03  beck
+  renamed all types 'type' to 'ir_type'
+
   Revision 1.21  2005/12/31 15:58:57  beck
   added missing includes