ecg.c 32.5 KB
Newer Older
1
2
3
/* -*- c -*- */

/*
4
 * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
Matthias Braun's avatar
Matthias Braun committed
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 *
 * 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.
20
21
 */

Matthias Braun's avatar
Matthias Braun committed
22
23
24
25
26
27
28
/**
 * @file
 * @brief    Extended Call Graph
 * @author   Florian
 * @date     14.09.2004
 * @version  $Id$
 */
29
#ifdef HAVE_CONFIG_H
Michael Beck's avatar
Michael Beck committed
30
# include "config.h"
31
32
#endif

Michael Beck's avatar
Michael Beck committed
33
34
#include <assert.h>

35
36
/**
   Erweiterter Aufrufgraph.
Florian Liekweg's avatar
Florian Liekweg committed
37
*/
38
39
40
41
42
43
44
45
46

#include "irnode.h"
#include "pmap.h"
/* #include "eset.h" */
#include "irgwalk.h"
#include "irgmod.h"
#include "irvrfy.h"
#include "trvrfy.h"
#include "xmalloc.h"
Michael Beck's avatar
Michael Beck committed
47
48
#include "irdump.h"
#include "irprog_t.h"
49

50
51
52
53
# ifndef TRUE
#  define TRUE 1
#  define FALSE 0
# endif /* not defined TRUE */
54
55
56
57

# define BUF_SIZE 1024

# include "ecg.h"
58
59
# include "typalise.h"
# include "lset.h"
60

Florian Liekweg's avatar
Florian Liekweg committed
61
62
# include "gnu_ext.h"

Florian Liekweg's avatar
Florian Liekweg committed
63
64
# define HERE(msg)  fprintf (stdout, "%s:%i %s\n", __FUNCTION__, __LINE__, msg)

65
/*
Florian Liekweg's avatar
Florian Liekweg committed
66
  le flag
67
68
69
70
71
*/
/* static int verbose     = 0; */
static int do_typalise = 0;

/*
Florian Liekweg's avatar
Florian Liekweg committed
72
  globals
73
74
*/

75
76
77
78
/* Ids for the ctxs */
static int ctx_id = 0;
ctx_info_t *main_ctx = NULL;

79
80
81
82
/* mapping from method graphs (callR) to method graphs (lset_ts of callEds) */
/* static pmap *calls; */
static pmap *graph_infos;

83
84
85
86
/* linked list of all graph_infos: */
static graph_info_t *graph_infos_list = NULL;

/* Counters for ecg_ecg and friends */
87
88
89
90
91
92
93
94
static long _graphs = 0;
static long _calls  = 0;
static long _allocs = 0;

static int _depth = 0;
static int _max_depth = 0;

static int _max_callEds = 0;
95
static ir_entity* _max_callEds_callR = NULL;
96

97
98
99
/* Protos */
void set_main_ctx (ctx_info_t*);

100
/* ====================
Florian Liekweg's avatar
Florian Liekweg committed
101
102
   Alloc stuff
   ==================== */
103
static void append_alloc (graph_info_t *ginfo, ir_node *alloc, ir_type *tp)
104
{
105
  alloc_info_t *ainfo = xmalloc (sizeof (alloc_info_t));
106
107
108
109
110
111
112
113
114
115
116

  ainfo->graph = ginfo->graph;
  ainfo->alloc = alloc;
  ainfo->tp    = tp;

  ainfo->prev = ginfo->allocs;
  ginfo->allocs = ainfo;
}


/* ====================
Florian Liekweg's avatar
Florian Liekweg committed
117
118
   CallEd stuff
   ==================== */
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/**
   Create a new call info struct from the given values.
*/
static call_info_t *new_call_info (ir_node *call,
                                   callEd_info_t *callEds,
                                   call_info_t *prev)
{
  call_info_t *cinfo = xmalloc (sizeof (call_info_t));
  cinfo->call = call;
  cinfo->callEds = callEds;
  cinfo->prev = prev;

  return (cinfo);
}

134
135
136
137
138
/**
   Append the given callEd to the given callEd info.
*/
static callEd_info_t *append_callEd_info (callEd_info_t *ced, ir_graph *callEd)
{
139
140
141
  callEd_info_t *nced = xmalloc (sizeof (callEd_info_t));

  assert (NULL != callEd);
142
143
144
145
146
147
148
149
150
151
152
153

  nced->callEd = callEd;
  nced->prev = ced;

  return (nced);
}

/**
   Append all callEd methods of the given (call) node to the given graph_info.
*/
static void append_calls (graph_info_t *info, ir_node *call, lset_t *callEds)
{
154
155
  ir_graph *callEd = NULL;
  call_info_t *cinfo = new_call_info (call, NULL, info->calls);
156
157
158
159

  info->calls = cinfo;

  /* enter */
160
161
162
  callEd = lset_first (callEds);

  while (NULL != callEd) {
163
    cinfo->callEds = append_callEd_info (cinfo->callEds, callEd);
164
165
166
    callEd = lset_next(callEds);
  }

167
168
169
170
171
172
173
}

/**
   Append the (single) callEd to the given (call) node of the given graph_info.
*/
static void append_call (graph_info_t *info, ir_node *call, ir_graph *callEd)
{
174
  call_info_t *cinfo = new_call_info (call, NULL, info->calls);
175
176
177
178
179
180
181
182
183
184

  info->calls = cinfo;

  cinfo->callEds = append_callEd_info (cinfo->callEds, callEd);
}

/**
   Given a method, find the firm graph that implements that method.
   Return NULL for abstract and native methods.
*/
185
static ir_graph *_get_implementing_graph (ir_entity *method)
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
{
  ir_graph *graph = NULL;

  /* What's up with the fenced out stuff in rta? */
  if (peculiarity_existent == get_entity_peculiarity (method)) {
    if (visibility_external_allocated == get_entity_visibility (method)) {
      /* Todo: native implementation */

      return (NULL);
    } else {
      graph = get_entity_irg (get_SymConst_entity (get_atomic_ent_value (method)));
      assert (graph && "no graph");

      return (graph);
    }
  } else if (0 && (peculiarity_description == get_entity_peculiarity (method))) {
    /* abstract --- can't find an implementation */
    graph = get_entity_irg (method);
    assert (!graph && "graph in abstract method");

    return (NULL);
  } else if ((peculiarity_description == get_entity_peculiarity (method)) ||
             (peculiarity_inherited == get_entity_peculiarity (method))) {
    /* search UPWARDS */
    int i;
    int n_over = get_entity_n_overwrites (method);

    assert (!graph);

    for (i = 0; (NULL == graph) && (i < n_over); i ++) {
216
      ir_entity *over = get_entity_overwrites (method, i);
217
218
219
220
221
222
223
224
225
226
227
228
229
230

      graph = _get_implementing_graph (over);
    }
  } else {
    assert (0 && "invalid peculiarity");
  }


  return (graph);
}

/**
   Collect all graphs of 'method' in the given set.
*/
231
static void _collect_implementing_graphs (ir_entity *method, lset_t *set)
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
{
  /* search DOWN-wards in clazz hierarchy */
  int i;
  int n_over = get_entity_n_overwrittenby (method);
  ir_graph *graph = get_entity_irg (method);

  if (NULL == graph) {
    graph = _get_implementing_graph (method);
  }

  if (graph) {
    lset_insert (set, graph);
  }

  for (i = 0; i < n_over; i ++) {
247
    ir_entity *over = get_entity_overwrittenby (method, i);
248
249
250
251
252
253
254
255
256

    _collect_implementing_graphs (over, set);
  }
}


/**
   Collect all graphs that could possibly be executed when 'method' is called.
*/
257
static lset_t *get_implementing_graphs (ir_entity *method, ir_node *select)
258
{
259
260
261
  /* const char *name = get_entity_name (method); */
  /* fprintf (stdout, "%s (ent %s)\n", __FUNCTION__, name); */

Michael Beck's avatar
Michael Beck committed
262
  int n_graphs;
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
  lset_t *set = lset_create ();
  {
    ir_graph *impl = _get_implementing_graph (method);

    if (NULL != impl) {
      lset_insert (set, impl);
    } else {
      /* actually, abstract OR native */
    }
  }

  _collect_implementing_graphs (method, set);

  if (lset_empty (set)) {
    /* then it's a method which is only implemented natively, and we
       don' bother to analyse anything */
    return (set);
  }

  /* void *tmp = lset_first (set); */
Michael Beck's avatar
Michael Beck committed
283
  n_graphs = lset_n_entries (set);
284

285
286
287
288
289
290
291
292
293
294
295

  if (visibility_external_allocated != get_entity_visibility (method)) {
    if (0 == n_graphs) {
      ir_graph *graph = get_irn_irg (select);

      dump_ir_block_graph (graph, "-typealise");

      /* fprintf (stdout, "no graphs for method %s\n", get_entity_name (method)); */
      assert (n_graphs && "no graphs for method");
    }
  }
296
297
298
299
  /* typalise select_in */
  if (do_typalise) {
    ir_node *select_in = get_Sel_ptr (select);
    typalise_t *ta = typalise (select_in);
300
    /* assert (ta && "typalise failed (go figure)"); */
301

302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
    /*
    fprintf (stdout, "typalyse res = ");

    if (NULL != ta) {
      if (type_invalid == ta->kind) {
        fprintf (stdout, "invalid");
      } else if (type_exact == ta->kind) {
        const char *name = get_type_name (ta->res.type);

        fprintf (stdout, "exact [");
        fprintf (stdout, "%s", name);
        fprintf (stdout, "]\n");
      } else if (type_types == ta->kind) {
        fprintf (stdout, "types [");
        fprintf (stdout, "...");
        fprintf (stdout, "]\n");
      } else if (type_type == ta->kind) {
        const char *name = get_type_name (ta->res.type);
        fprintf (stdout, "type [");
        fprintf (stdout, "%s", name);
        fprintf (stdout, "]\n");
      }
    } else {
      fprintf (stdout, "(null)\n");
    }
    */
328
329

    if (1 != n_graphs) {
Michael Beck's avatar
Michael Beck committed
330
      int n_filtered_graphs;
331

Michael Beck's avatar
Michael Beck committed
332
333
      set = filter_for_ta (set, ta);
      n_filtered_graphs = lset_n_entries (set);
334
335

      /*
Florian Liekweg's avatar
Florian Liekweg committed
336
337
338
339
340
        fprintf (stdout, "%s: %02d %02d\n",
        __FUNCTION__,
        n_graphs,
        n_filtered_graphs,
        n_graphs - n_filtered_graphs);
341
342
343
      */
      n_graphs = n_filtered_graphs;
    }
344
345
346
347
348
349
350
351
352
353
354

    if (visibility_external_allocated != get_entity_visibility (method)) {
      if (0 == n_graphs) {
        ir_graph *graph = get_irn_irg (select);

        dump_ir_block_graph (graph, "-ecg");
        /* fprintf (stdout, "no graphs for method %s\n", get_entity_name (method)); */
        assert (n_graphs && "no graphs for method");
      }
    }

355
356
357
358
359
360
361
362
  }

  if (n_graphs > _max_callEds) {
    _max_callEds = n_graphs;
    _max_callEds_callR = method;
  }


363
364
365
366
367
368
369
370
371
372
373
374
375
  return (set);
}

/**
   Determine whether a call is actually a call or if it is being
   abused for some b/d-ed reason.
*/
static int call_is_call (ir_node *call, ir_node *ptr)
{
  if (op_SymConst != get_irn_op (ptr)) {
    return (TRUE);
  } else if (get_SymConst_kind (ptr) != symconst_addr_name) {
    return (TRUE);
376
377
  }

378
  return (FALSE);
379
380
381
382
383
384
385
}

/**
   Action for the graph.
*/
static void ecg_calls_act (ir_node *node, void *env)
{
Michael Beck's avatar
Michael Beck committed
386
  ir_op *op = get_irn_op(node);
387
388
  graph_info_t *graph_info = (graph_info_t*) env;

Michael Beck's avatar
Michael Beck committed
389
  if (op_Call == op) {         /* CALL */
390
    ir_entity *ent = NULL;
391
392
    ir_node *ptr = get_Call_ptr (node);

393
394
395
396
397
398
399
400
    if (!call_is_call (node, ptr)) {
      /*
      fprintf (stdout, "not a call: %s[%li]\n",
               get_op_name (get_irn_op (node)),
               get_irn_node_nr (node)); */
      return;
    }

401
    /* CALL SEL */
402
    if (op_Sel == get_irn_op (ptr)) {
Michael Beck's avatar
Michael Beck committed
403
      lset_t *graphs;
404
      ent = get_Sel_entity (ptr);
Michael Beck's avatar
Michael Beck committed
405
      graphs = get_implementing_graphs (ent, ptr);
406
407

      append_calls (graph_info, node, graphs);
408
    } else if (op_SymConst == get_irn_op (ptr)) {
409
      if (get_SymConst_kind (ptr) == symconst_addr_ent) {
Michael Beck's avatar
Michael Beck committed
410
        ir_graph *graph;
411
        ent = get_SymConst_entity (ptr);
Michael Beck's avatar
Michael Beck committed
412
        graph = get_entity_irg (ent);
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434

        if (graph) {
          append_call (graph_info, node, graph);
        } else {
          /* it's an externally allocated thingy */
        }
      } else if (get_SymConst_kind (ptr) == symconst_addr_name) {
        /* If this SymConst refers to a method the method is external_visible
           and therefore must be considered live anyways. */
        if (get_SymConst_name (ptr) != new_id_from_str ("iro_Catch")) {
          assert (ent && "couldn't determine entity of call to symConst");
        }
      } else {
        /* other symconst. */
        assert (0 && "This SymConst can not be an address for a method call.");
      }

      /* STRANGE, no less ... */
    } else {
      DDMN (ptr);
      assert (0 && "Unexpected address expression");
    }
Michael Beck's avatar
Michael Beck committed
435
  } else if (op_Alloc == op) {
436
    ir_type *tp = get_Alloc_type (node);
Florian Liekweg's avatar
Florian Liekweg committed
437
    /* const char *name = get_type_name (tp); */
438
439
440

    append_alloc (graph_info, node, tp);

Florian Liekweg's avatar
Florian Liekweg committed
441
    /* fprintf (stdout, "NEW \"%s\"\n", name); */
442
443
444
445
446
447
448
449
  }
}

/**
   Collect called graphs for the given graph.
*/
static void ecg_fill_graph_calls (ir_graph *graph)
{
450
  graph_info_t *ginfo = xmalloc (sizeof (graph_info_t));
Florian Liekweg's avatar
Florian Liekweg committed
451
452
453

  /* memset (ginfo, 0x00, sizeof (graph_info_t)); */
  assert (ginfo != graph_infos_list);
454

455
456
457
458
459
460
461
462
  ginfo->graph       = graph;
  ginfo->calls       = NULL;
  ginfo->allocs      = NULL;
  ginfo->ctxs        = NULL;
  ginfo->n_ctxs      = 0;
  ginfo->ecg_seen    = 0;
  ginfo->allocs_seen = 0;
  ginfo->prev        = NULL;
463

464
  /* link up into global list */
Florian Liekweg's avatar
Florian Liekweg committed
465
466
467
468
  ginfo->prev = graph_infos_list;
  graph_infos_list = ginfo;

  assert (ginfo != ginfo->prev);
469

Florian Liekweg's avatar
Florian Liekweg committed
470
  irg_walk_graph (graph, ecg_calls_act, NULL, ginfo);
471

Florian Liekweg's avatar
Florian Liekweg committed
472
  pmap_insert (graph_infos, graph, ginfo);
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
}

/**
   For each graph, collect called graphs, and enter them into calls.
*/
static void ecg_fill_calls (void)
{
  int i;

  for (i = 0; i < get_irp_n_irgs (); i++) {
    ir_graph *graph = get_irp_irg (i);

    ecg_fill_graph_calls (graph);
  }
}

489
490
491
492
493
/**
   Allocate a new ctx for the given graph and the given enclosing ctx.
*/
static ctx_info_t *new_ctx (ir_graph *graph, ir_node *call, ctx_info_t *enc)
{
494
  ctx_info_t *res = xmalloc (sizeof (ctx_info_t));
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513

  res->graph = graph;
  res->call = call;
  res->enc = enc;
  res->id = ctx_id ++;

  return (res);
}


/**
   Fill in the ctxs parts of the graph_infos
*/
static void ecg_fill_ctxs_count (ir_graph *graph)
{
  graph_info_t *ginfo = ecg_get_info (graph);

  /* count how many ctxs we have per graph */
  if (0 == ginfo->ecg_seen) {
Michael Beck's avatar
Michael Beck committed
514
    call_info_t *cinfo = ginfo->calls;
515
516
517
518
519
520
521
522
523
524
525
526
527

    ginfo->ecg_seen = 1;

    while (NULL != cinfo) {
      callEd_info_t *ced = cinfo->callEds;

      while (NULL != ced) {
        ir_graph *callEd_graph = ced->callEd;

        /* first step: we have a new ctx */
        graph_info_t *callEd_info = ecg_get_info (callEd_graph);
        callEd_info->n_ctxs ++;

Florian Liekweg's avatar
Florian Liekweg committed
528
        /* CallR graph -> CallEd_graph */
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
        ecg_fill_ctxs_count (callEd_graph);

        ced = ced->prev;
      } /* end forall callEds (call) */

      cinfo = cinfo->prev;
    } /* end forall (calls(graph)) */

    ginfo->ecg_seen = 0;
  }
}

static void ecg_fill_ctxs_alloc (void)
{
  /* allocate the memory needed for the ctxts: */
  graph_info_t *ginfo = graph_infos_list;

  while (NULL != ginfo) {
547
    ginfo->ctxs = xcalloc (ginfo->n_ctxs, sizeof (ctx_info_t *));
548
549

    /*
Florian Liekweg's avatar
Florian Liekweg committed
550
551
      fprintf (stdout, "graph of \"%s\": n_ctxs = %i\n",
      get_entity_name (get_irg_entity (ginfo->graph)), ginfo->n_ctxs);
552
553
554
    */
    ginfo->n_ctxs = 0;

Florian Liekweg's avatar
Florian Liekweg committed
555
    assert (ginfo != ginfo->prev);
556
557
558
559
560
561
562
563
564
565
566
567
568
569
    ginfo = ginfo->prev;
  }
}

/**
   Fill in the ctxs parts of the graph_infos
*/
static void ecg_fill_ctxs_write (ir_graph *graph, ctx_info_t *enc_ctx)
{
  graph_info_t *ginfo = ecg_get_info (graph);

  /* enter a new ctx for all callEds along the call edges of this graph */
  if (0 == ginfo->ecg_seen) {
    call_info_t *cinfo = ginfo->calls;
Michael Beck's avatar
Michael Beck committed
570
    ginfo->ecg_seen = 1;
571
572
573
574
575

    while (NULL != cinfo) {
      callEd_info_t *ced = cinfo->callEds;

      while (NULL != ced) {
Florian Liekweg's avatar
Florian Liekweg committed
576
        ctx_info_t *ctx = new_ctx (graph, cinfo->call, enc_ctx);
577
578
579
580
581
582
583
584
585

        ir_graph *callEd_graph = ced->callEd;

        /* write the ctx of this call into the callEd graph */
        graph_info_t *callEd_info = ecg_get_info (callEd_graph);

        callEd_info->ctxs [callEd_info->n_ctxs] = ctx;
        callEd_info->n_ctxs ++;

586
        /* CallR graph -> callEd_graph */
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
        ecg_fill_ctxs_write (callEd_graph, ctx);

        ced = ced->prev;
      } /* end forall callEds (call) */

      cinfo = cinfo->prev;
    } /* end forall (calls(graph)) */

    ginfo->ecg_seen = 0;
  }
}

/**
   Fill in the ctxs parts of the graph_infos
*/
static void ecg_fill_ctxs (void)
{
Michael Beck's avatar
Michael Beck committed
604
605
606
607
  ctx_info_t *main_ctx;
  ir_graph *main_irg;
  graph_info_t *ginfo;

608
609
610
  ecg_fill_ctxs_count (get_irp_main_irg ());
  ecg_fill_ctxs_alloc ();

Michael Beck's avatar
Michael Beck committed
611
612
  main_ctx = new_ctx (get_irp_main_irg (), NULL, NULL);
  main_irg = get_irp_main_irg ();
613
614
615
616

  set_main_ctx (main_ctx);

  /* Grrr, have to add this ctx manually to main.ginfo ... */
Michael Beck's avatar
Michael Beck committed
617
  ginfo = ecg_get_info (main_irg);
618
  ginfo->n_ctxs = 1;
619
  ginfo->ctxs = xcalloc (1, sizeof (ctx_info_t *));
620
621
622
623
624
625
626
  ginfo->ctxs [0] = main_ctx;

  ecg_fill_ctxs_write (main_irg, main_ctx);
}

/* ====================
   CTX stuff
Florian Liekweg's avatar
Florian Liekweg committed
627
   ==================== */
628
629
630
631
632
/*
  Nicely print a ctx_info_t to the given output stream
*/
void ecg_print_ctx (ctx_info_t *ctx, FILE *stream)
{
633
  ir_entity *ent = get_irg_entity(ctx->graph);
634
  ir_node *call = ctx->call;
Michael Beck's avatar
Michael Beck committed
635
636
  const char *ent_name = get_entity_name (ent);
  const char *own_name = get_type_name (get_entity_owner (ent));
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660

  fprintf (stream, "CTX[%i](%s.%s->%s[%li])",
           ctx->id, own_name, ent_name,
           get_op_name (get_irn_op (call)),
           get_irn_node_nr (call));

  if (NULL != ctx->enc) {
    fprintf (stream, "->%i", ctx->enc->id);
  }

  fprintf (stream, "\n");
}

/*
  Get a ctx of the given graph info
*/
ctx_info_t *get_ctx (graph_info_t *ginfo, int ctx_idx)
{
  assert (ginfo->n_ctxs > ctx_idx);

  return (ginfo->ctxs [ctx_idx]);
}

/*
Florian Liekweg's avatar
Florian Liekweg committed
661
  Get the pseudo-ctx of 'main'
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
*/
ctx_info_t *get_main_ctx ()
{
  return (main_ctx);
}

/*
  Set the pseudo-ctx of 'main'
*/
void set_main_ctx (ctx_info_t *ctx)
{
  main_ctx = ctx;
}


677
/* ====================
Florian Liekweg's avatar
Florian Liekweg committed
678
679
680
681
682
683
684
685
686
687
688
689
690
691
   ECG stuff
   ==================== */

/* ====================
   Iterator stuff
   ==================== */
/*
   Iterate over all graphs
*/
void ecg_iterate_graphs (graph_hnd_t *hnd, void *env)
{
  graph_info_t *ginfo = graph_infos_list;

  while (NULL != ginfo) {
Florian Liekweg's avatar
Florian Liekweg committed
692
693
694
695
696
    /* do not visit graphs that have 0 == ginfo->n_ctxs, since they
       are not called */
    if (0 != ginfo->n_ctxs) {
      hnd (ginfo, env);
    }
Florian Liekweg's avatar
Florian Liekweg committed
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746

    ginfo = ginfo->prev;
  }
}


/*
   Iterate of all allocs of a given graph info
*/
void ecg_iterate_allocs (graph_info_t *ginfo, alloc_hnd_t *hnd, void *env)
{
  alloc_info_t *ainfo = ginfo->allocs;

  while (NULL != ainfo) {
    hnd (ainfo, env);

    ainfo = ainfo->prev;
  }
}


/*
  Iterate over all calls of the given graph info
*/
void ecg_iterate_calls  (graph_info_t *ginfo, call_hnd_t *hnd, void *env)
{
  call_info_t *cinfo = ginfo->calls;

  while (NULL != cinfo) {
    hnd (cinfo, env);

    cinfo = cinfo->prev;
  }
}


/*
  Iterate over all callEds of the given call info
*/
void ecg_iterate_callEds  (call_info_t *cinfo, callEd_hnd_t *hnd, void *env)
{
  callEd_info_t *ced = cinfo->callEds;

  while (NULL != ced) {
    hnd (ced, env);

    ced = ced->prev;
  }
}

747
748
749
750
751
752
753
754
755
756
757
758
759

/*
  get the call infos for the given graph
*/
graph_info_t *ecg_get_info (ir_graph *graph)
{
  graph_info_t *ginfo = (graph_info_t*) pmap_get (graph_infos, graph);

  assert (ginfo && "no info for graph");

  return (ginfo);
}

760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
/*
  Get the Alloc Infos for the given graph
*/
alloc_info_t *ecg_get_alloc_info (ir_graph *graph)
{
  graph_info_t *ginfo = ecg_get_info (graph);

  return (ginfo->allocs);
}

/*
  Get the Call Info for the given call
*/
callEd_info_t *ecg_get_callEd_info (ir_node *call)
{
  ir_graph *graph = get_irn_irg (call);
  graph_info_t *ginfo = ecg_get_info (graph);

  call_info_t *call_info = ginfo->calls;

  while (NULL != call_info) {
    if (call == call_info->call) {
      return (call_info->callEds);
    }

    call_info = call_info->prev;
  }

  return (NULL);
}
790
791
792
793
794
795
796


/**
   Dump the given graph and it's calls and it's calls callEds to the given file.
*/
static int ecg_ecg_graph (FILE *dot, ir_graph *graph)
{
Michael Beck's avatar
Michael Beck committed
797
798
799
  int graph_no;
  call_info_t *cinfo;
  alloc_info_t *ainfo;
800
801
802
803
804
805
806
  const char *name = get_irg_entity (graph) ?
    get_entity_name (get_irg_entity (graph)) : "noEntity";
  const char *color =
    (get_entity_stickyness
     (get_irg_entity (graph)) == stickyness_sticky) ?
    "red" : "lightyellow";

807
808
  /* graph_info_t *ginfo = (graph_info_t*) pmap_get (graph_infos, graph); */
  graph_info_t *ginfo = ecg_get_info (graph);
809
810
811
812
813
814
815
816
817
818
819
820
821

  if (0 != ginfo->ecg_seen) {
    fprintf (dot, "\t/* recursive call to \"%s\" (%d) */\n",
             name, (int) ginfo->ecg_seen);
# if 0
    fprintf (dot, "\t/* recursive call to \"%s\" (0x%08x) */\n",
             name, (int) graph);
# endif /* 0 */
    return (ginfo->ecg_seen);
  }

  assert (0L <= _graphs);

Michael Beck's avatar
Michael Beck committed
822
  graph_no = _graphs ++;
823
824
825
826
827
  ginfo->ecg_seen = graph_no;

  fprintf (dot, "\t/* Graph of \"%s.%s\" */\n",
           get_type_name (get_entity_owner (get_irg_entity (graph))),
           name);
828
  fprintf (dot, "\tgraph_%i [label=\"<HEAD>%s\\l%s\\l|<CTX>n_ctx = %i\\l\", color=\"%s\"];\n",
829
830
831
           graph_no,
           get_type_name (get_entity_owner (get_irg_entity (graph))),
           name,
832
           ginfo->n_ctxs,
833
834
835
836
837
838
839
840
841
842
           color);
  fprintf (dot, "\n");

  if (visibility_external_allocated ==
      get_entity_visibility (get_irg_entity (graph))) {
    fprintf (dot, "\t/* graph \"%s\" is external */\n", name);

    return (graph_no);
  }

Michael Beck's avatar
Michael Beck committed
843
  cinfo = ginfo->calls;
844
845
846
847
  while (NULL != cinfo) {
    ir_node *call = cinfo->call;
    callEd_info_t *ced = cinfo->callEds;
    const int call_no = _calls ++;
Florian Liekweg's avatar
Florian Liekweg committed
848
849
    const char *call_color = (NULL == ced) ? "blue" :
      (NULL == ced->prev) ? "lightblue" : "blue3";
850

851
852
853
    fprintf (dot, "\t/* Call %li */\n", get_irn_node_nr (call));
    fprintf (dot, "\tcall_%i [label=\"call\\[%li\\]\", color=\"%s\", shape=\"ellipse\"];\n",
             call_no, get_irn_node_nr (call), call_color);
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
    fprintf (dot, "\tgraph_%i -> call_%i [color=\"black\"];\n", graph_no, call_no);

    while (NULL != ced) {
      ir_graph *callEd_graph = ced->callEd;
      const int callEd_no = ecg_ecg_graph (dot, callEd_graph);
      const char *callEd_name = get_irg_entity (callEd_graph) ?
        get_entity_name (get_irg_entity (callEd_graph)) : "noEntity";
      const char *direction = (callEd_no <= graph_no) ? "forward" : "forward";
      const char *callEd_color     = (callEd_no <= graph_no) ? "red" : "black";

      fprintf (dot, "\t/* Call from graph \"%s\" to graph \"%s\" */\n",
               name,
               callEd_name);
      /* Check for recursive calls */
      /* if (callEd_no > graph_no) */ { /* do recursive calls (for now) */
869
        fprintf (dot, "\tcall_%i -> graph_%i:HEAD [color=\"%s\", dir=\"%s\"];\n",
870
871
872
873
874
875
876
877
878
879
880
                 call_no, callEd_no, callEd_color, direction);
      }

      ced = ced->prev;
      /* ced = NULL; */
    } /* done all calEds (call) */

    cinfo = cinfo->prev;
  } /* done all calls (graph) */

  /* now the allocs */
Michael Beck's avatar
Michael Beck committed
881
  ainfo = ecg_get_alloc_info (graph);
882
883
884
885
886
887
888
889
890
891
892
893
  if (ainfo) {
    fprintf (dot, "\t/* now the allocs */\n");
  } else {
    fprintf (dot, "\t/* no allocs */\n");
  }

  while (NULL != ainfo) {
    ir_node *alloc = ainfo->alloc;
    const char *name = get_type_name (ainfo->tp);
    const char *color = "red1";

    _allocs ++;
894
895
    fprintf (dot, "\talloc_0x%08x_%i [label=\"%s\", color=\"%s\"];\n",
             (int) alloc, graph_no, name, color);
896

897
898
    fprintf (dot, "\tgraph_%i -> alloc_0x%08x_%i;\n",
             graph_no, (int) alloc, graph_no);
899
900
901
902
903
904
905
906

    ainfo = ainfo->prev;
  }

  if (0 == ginfo->allocs_seen) {
    ginfo->allocs_seen = 1;
  }

907
908
909
  /* write table of ctxs */
  {
    int i;
Florian Liekweg's avatar
Florian Liekweg committed
910
    const int max_ctxs = 30;
911
912
    const int n_ctxs = (ginfo->n_ctxs > max_ctxs) ? max_ctxs : ginfo->n_ctxs;

Michael Beck's avatar
Michael Beck committed
913
914
    fprintf (dot, "\tctx_%i [label=\"<HEAD>", graph_no);

Florian Liekweg's avatar
Florian Liekweg committed
915
916
917
    assert (ginfo->ctxs && "no ctx");
    for (i = 0; i < n_ctxs; i ++) {
      ctx_info_t *ctx_info = ginfo->ctxs [i];
918

Florian Liekweg's avatar
Florian Liekweg committed
919
920
921
922
923
924
925
926
927
      if (NULL != ctx_info->enc) {
        fprintf (dot, "ctx_info \\[%i\\] = ctx\\[%i\\-\\>%i\\]\\l",
                 i,
                 ctx_info->id,
                 ctx_info->enc->id);
      } else {
        fprintf (dot, "ctx_info \\[%i\\] = ctx\\[%i\\]\\l",
                 i, ctx_info->id);
      }
928

Florian Liekweg's avatar
Florian Liekweg committed
929
930
      if (i+1 != n_ctxs) {
        fprintf (dot, "|");
931
932
933
934
935
936
937
938
939
940
941
942
943
944
      }
    }

    if (0 < ginfo->n_ctxs - max_ctxs) {
      fprintf (dot, "(%i more)\\l", ginfo->n_ctxs - max_ctxs);
    }

    fprintf (dot, "\", color=\"green3\"];\n");

    fprintf (dot,
             "\tgraph_%i:CTX -> ctx_%i:HEAD [label=\"ctx\", dir=\"none\", style=\"dotted\"];\n",
             graph_no, graph_no);
  }

945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
  fprintf (dot, "\t/* done with graph of \"%s\" */\n\n", name);

  fflush (dot);
  ginfo->ecg_seen = 0;

  return (graph_no);
}

/**
   Count how many nodes the ECG will have
*/
static char spaces [BUF_SIZE];

static void ecg_ecg_count (ir_graph *graph)
{
Michael Beck's avatar
Michael Beck committed
960
961
  int graph_no;
  call_info_t *cinfo;
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
  graph_info_t *ginfo = (graph_info_t*) pmap_get (graph_infos, graph);

  if (0 != ginfo->ecg_seen) {
    return;
  }

  _depth ++;
  if (_depth > _max_depth) {
    _max_depth = _depth;

    /*
      fprintf (stdout, "_max_depth = %i\n", _max_depth);
      fprintf (stdout, "\tn_graphs: %i\n", _graphs);
    */
  }

  assert (0L <= _graphs);

  /*
    if (0 == (_graphs % 1000000)) {
    fprintf (stdout, "\tn_graphs: %i\n", _graphs);
    fprintf (stdout, "_depth = %i\n", _depth);
    }
  */

Michael Beck's avatar
Michael Beck committed
987
  graph_no = _graphs ++;
988
989
990
991
992
993
994
  ginfo->ecg_seen = graph_no;

  fprintf (stdout, "%sMethod \"%s.%s\"\n",
           spaces + BUF_SIZE - _depth,
           get_type_name (get_entity_owner (get_irg_entity (graph))),
           get_entity_name (get_irg_entity (graph)));

Michael Beck's avatar
Michael Beck committed
995
  cinfo = ginfo->calls;
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
  while (NULL != cinfo) {

    callEd_info_t *ced = cinfo->callEds;

    fprintf (stdout, "%sCall \"0x%08x\"\n",
             spaces + BUF_SIZE - _depth,
             (int) cinfo->call);

    while (NULL != ced) {
      ir_graph *callEd_graph = ced->callEd;

      fprintf (stdout, "%sCall Target \"%s.%s\"\n",
               spaces + BUF_SIZE - _depth,
               get_type_name (get_entity_owner (get_irg_entity (callEd_graph))),
               get_entity_name (get_irg_entity (callEd_graph)));

      ecg_ecg_count (callEd_graph);

      ced = ced->prev;
    } /* done all calEds (call) */
    cinfo = cinfo->prev;
  } /* done all calls (graph) */

  ginfo->ecg_seen = 0;
  _depth --;
}

/* ====================
Florian Liekweg's avatar
Florian Liekweg committed
1024
1025
   Public Interface
   ==================== */
1026
1027
1028
1029
1030
1031
1032
1033

/**
   Initialise our data structures.
*/
void ecg_init (int typalise)
{
  do_typalise = typalise;

1034
1035
1036
1037
  if (typalise) {
    typalise_init ();
  }

1038
1039
1040
  graph_infos = pmap_create ();

  ecg_fill_calls ();
1041
1042
  ecg_fill_ctxs ();
  ecg_ecg ();
1043
1044
1045
1046
1047
}

/**
   Clean up our mess.
*/
Michael Beck's avatar
Michael Beck committed
1048
void ecg_cleanup (void)
1049
1050
1051
{
  int i;

Michael Beck's avatar
Michael Beck committed
1052
1053
  return;

1054
1055
1056
1057
1058
1059
1060
1061
1062
  for (i = 0; i < get_irp_n_irgs (); i++) {
    ir_graph *graph = get_irp_irg (i);

    graph_info_t *info = pmap_get (graph_infos, graph);
    call_info_t *cinfo = info->calls;

    while (NULL != cinfo) {
      callEd_info_t *ced = cinfo->callEds;

Michael Beck's avatar
Michael Beck committed
1063
1064
      cinfo->call = NULL;

1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
      while (NULL != ced) {
        callEd_info_t *nced = ced->prev;
        free (ced);
        ced->prev = NULL;
        ced->callEd = NULL;
        ced = nced;
      }

      cinfo->callEds = NULL;

      free (cinfo);
      cinfo = cinfo->prev;
    }

    free (info);
    pmap_insert (graph_infos, graph, NULL);
  }


  pmap_destroy (graph_infos);

1086
  /*  paranoia mode */
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
  graph_infos = NULL;
}

/**
   Show what we have found.
*/
void ecg_report ()
{
  int i;

  FILE *dot = fopen ("calls.dot", "w");

  fprintf (dot, "digraph \"calls\" {\n");
Florian Liekweg's avatar
Florian Liekweg committed
1100
1101
1102
  fprintf (dot, "\tgraph [rankdir=\"LR\", ordering=\"out\", size=\"11, 7\", rotate=\"90\", ratio=\"fill\"];\n");
  fprintf (dot, "\tnode [shape=\"record\", style=\"filled\"];\n");
  fprintf (dot, "\tedge [color=\"black\"];\n");
1103
1104
1105
1106
  fprintf (dot, "\n");

  for (i = 0; i < get_irp_n_irgs (); i++) {
    ir_graph *graph = get_irp_irg (i);
Florian Liekweg's avatar
Florian Liekweg committed
1107
    graph_info_t *ginfo = (graph_info_t*) pmap_get (graph_infos, graph);
1108

Florian Liekweg's avatar
Florian Liekweg committed
1109
    if (0 != ginfo->n_ctxs) {
Michael Beck's avatar
Michael Beck committed
1110
1111
1112
      call_info_t *cinfo;
      alloc_info_t *ainfo;

Florian Liekweg's avatar
Florian Liekweg committed
1113
1114
      const char *name = get_irg_entity (graph) ?
        get_entity_name (get_irg_entity (graph)) : "noEntity";
1115

Florian Liekweg's avatar
Florian Liekweg committed
1116
1117
      const char *oname = get_type_name
        (get_entity_owner (get_irg_entity (graph)));
1118

Florian Liekweg's avatar
Florian Liekweg committed
1119
1120
1121
1122
      const char *color =
        (get_entity_stickyness
         (get_irg_entity (graph)) == stickyness_sticky) ?
        "red3" : "lightyellow";
1123

Florian Liekweg's avatar
Florian Liekweg committed
1124
1125
1126
1127
1128
      fprintf (dot, "\t/* graph_0x%08x (\"%s\") */\n", (int) graph, name);
      fprintf (dot,
               "\tgraph_0x%08x [label=\"%s\\l%s\", color=\"%s\"];\n",
               (int) graph, oname, name, color);
      fprintf (dot, "\n");
1129

Michael Beck's avatar
Michael Beck committed
1130
      cinfo = ginfo->calls;
Florian Liekweg's avatar
Florian Liekweg committed
1131
1132
1133
1134
1135
      if (cinfo) {
        fprintf (dot, "\t/* now the calls */\n");
      } else {
        fprintf (dot, "\t/* no calls, nothing to see, move along! */\n");
      }
1136

Florian Liekweg's avatar
Florian Liekweg committed
1137
      while (NULL != cinfo) {
Michael Beck's avatar
Michael Beck committed
1138
        callEd_info_t *ced;
Florian Liekweg's avatar
Florian Liekweg committed
1139
        ir_node *call = cinfo->call;
1140

Florian Liekweg's avatar
Florian Liekweg committed
1141
1142
1143
1144
1145
        fprintf (dot, "\t/* call_0x%08x */\n", (int) call);
        fprintf (dot, "\tcall_0x%08x [label=\"call\\[%li\\]\", shape=\"ellipse\", color=\"lightblue\"];\n",
                 (int) call, get_irn_node_nr (call));
        fprintf (dot, "\tgraph_0x%08x -> call_0x%08x;\n",
                 (int) graph, (int) call);
1146

Michael Beck's avatar
Michael Beck committed
1147
        ced = cinfo->callEds;
Florian Liekweg's avatar
Florian Liekweg committed
1148
1149
1150
1151
1152
1153
1154
1155
        while (NULL != ced) {
          fprintf (dot, "\tcall_0x%08x -> graph_0x%08x;\n",
                   (int) call, (int) ced->callEd);
          ced = ced->prev;
        }
        fprintf (dot, "\n");

        cinfo = cinfo->prev;
1156
1157
1158
      }
      fprintf (dot, "\n");

Michael Beck's avatar
Michael Beck committed
1159
      ainfo = ginfo->allocs;
Florian Liekweg's avatar
Florian Liekweg committed
1160
1161
1162
1163
1164
      if (ainfo) {
        fprintf (dot, "\t/* now the allocs */\n");
      } else {
        fprintf (dot, "\t/* no allocs */\n");
      }
1165

Florian Liekweg's avatar
Florian Liekweg committed
1166
1167
1168
1169
1170
      /* allocs */
      while (NULL != ainfo) {
        ir_node *alloc = ainfo->alloc;
        const char *name = get_type_name (ainfo->tp);
        const char *color = "red1";
1171

Florian Liekweg's avatar
Florian Liekweg committed
1172
1173
1174
1175
        fprintf (dot, "\talloc_0x%08x [label=\"%s\", color=\"%s\"];\n",
                 (int) alloc, name, color);
        fprintf (dot, "\tgraph_0x%08x -> alloc_0x%08x;\n",
                 (int) graph, (int) alloc);
1176

Florian Liekweg's avatar
Florian Liekweg committed
1177
1178
        ainfo = ainfo->prev;
      }
1179

Florian Liekweg's avatar
Florian Liekweg committed
1180
1181
1182
1183
1184
1185
      /* ctxs */
      {
        int i;
        const int max_ctxs = 30;
        const int n_ctxs = (ginfo->n_ctxs > max_ctxs) ? max_ctxs : ginfo->n_ctxs;

Michael Beck's avatar
Michael Beck committed
1186
        fprintf (dot, "\t/* now the ctxs */\n");
1187
        fprintf (dot, "\tctx_0x%08x [label=\"<HEAD>", (int) graph);
Michael Beck's avatar
Michael Beck committed
1188

Florian Liekweg's avatar
Florian Liekweg committed
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
        assert (ginfo->ctxs && "no ctx");
        for (i = 0; i < n_ctxs; i ++) {
          ctx_info_t *ctx_info = ginfo->ctxs [i];

          if (NULL != ctx_info->enc) {
            fprintf (dot, "ctx_info \\[%i\\] = ctx\\[%i\\-\\>%i\\]\\l",
                     i,
                     ctx_info->id,
                     ctx_info->enc->id);
          } else {
            fprintf (dot, "ctx_info \\[%i\\] = ctx\\[%i\\]\\l",
                     i, ctx_info->id);
          }

          if (i+1 != n_ctxs) {
            fprintf (dot, "|");
          }
        }
1207

Florian Liekweg's avatar
Florian Liekweg committed
1208
1209
1210
1211
1212
1213
1214
        if (0 < ginfo->n_ctxs - max_ctxs) {
          fprintf (dot, "(%i more)\\l", ginfo->n_ctxs - max_ctxs);
        }

        fprintf (dot, "\", color=\"green3\"];\n");

        fprintf (dot,
Michael Beck's avatar
Michael Beck committed
1215
1216
                 "\tgraph_0x%p -> ctx_0x%p:HEAD [label=\"ctx\", dir=\"none\", style=\"dotted\"];\n",
                 graph, graph);
Florian Liekweg's avatar
Florian Liekweg committed
1217
1218
1219
1220
      }
    } else {
      fprintf (dot, "\t/* graph is not called */\n");
    } /* end all graphs */
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
  }
  fprintf (dot, "}\n");

  /*
    fprintf (stdout, " max_callEds: %i\n", _max_callEds);
    fprintf (stdout, " max_callEds_callR: \"%s\"\n",
    get_entity_name (_max_callEds_callR));
  */
  fclose (dot);
}

/**
   Experimental:  Print the ecg
*/
Michael Beck's avatar
Michael Beck committed
1235
void ecg_ecg (void)
1236
{
Michael Beck's avatar
Michael Beck committed
1237
1238
1239
  FILE *dot;
  ir_graph *main_graph = get_irp_main_irg ();

1240
1241
1242
1243
  _graphs = 0;
  _calls  = 0;

  /*
Florian Liekweg's avatar
Florian Liekweg committed
1244
1245
    memset (spaces, '.', BUF_SIZE);
    spaces [BUF_SIZE-1] = '\0';
1246

Florian Liekweg's avatar
Florian Liekweg committed
1247
1248
1249
    ecg_ecg_count (main_graph);
    fprintf (stdout, "n_graphs: %i\n", _graphs);
    fprintf (stdout, "max_depth = %i\n", _max_depth);
1250
1251
1252
1253
1254
1255
1256
  */

  /* return; */

  _graphs = 0;
  _calls  = 0;

Michael Beck's avatar
Michael Beck committed
1257
  dot = fopen ("ecg.dot", "w");
1258
1259

  fprintf (dot, "digraph \"ecg\" {\n");
Florian Liekweg's avatar
Florian Liekweg committed
1260
1261
1262
  fprintf (dot, "\tgraph [rankdir=\"LR\", ordering=\"out\", size=\"11, 7\", rotate=\"90\", ratio=\"fill\"];\n");
  fprintf (dot, "\tnode [shape=\"record\", style=\"filled\"];\n");
  fprintf (dot, "\tedge [color=\"black\"];\n");
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
  fprintf (dot, "\n");
  fprintf (dot, "\n");

  /* ir_graph *main_graph = get_irp_main_irg (); */
  ecg_ecg_graph (dot, main_graph);

  fprintf (dot, "\t/* Grand Total: */\n");
  fprintf (dot, "\t/* calls:  %i */\n", (int) _calls);
  fprintf (dot, "\t/* graphs: %i */\n", (int) _graphs);
  fprintf (dot, "\t/* allocs: %i */\n", (int) _allocs);
  fprintf (dot, "\t/* (sales tax not included) */\n");

  fprintf (dot, "}\n");

  fclose (dot);
}



/*
Michael Beck's avatar
Michael Beck committed
1283
  $Log: ecg.c,v $
1284
1285
1286
  Revision 1.23  2006/12/13 19:46:47  beck
  rename type entity into ir_entity

1287
1288
1289
  Revision 1.22  2006/01/13 22:55:03  beck
  renamed all types 'type' to 'ir_type'

Michael Beck's avatar
Michael Beck committed
1290
1291
1292
  Revision 1.21  2005/12/31 15:58:57  beck
  added missing includes

Michael Beck's avatar
Michael Beck committed
1293
1294
1295
  Revision 1.20  2005/12/05 12:01:06  beck
  needed include added

1296
1297
1298
  Revision 1.19  2005/03/22 13:55:51  liekweg
  Need to initialise typalise now

Florian Liekweg's avatar
Florian Liekweg committed
1299
1300
1301
  Revision 1.18  2005/01/14 14:14:43  liekweg
  fix gnu extension

1302
1303
1304
  Revision 1.17  2005/01/14 13:34:25  liekweg
  Factor out call_info_t ctor; fix mallocs; fix initialisation

1305
1306
1307
  Revision 1.16  2005/01/10 17:26:34  liekweg
  fixup printfs, don't put environments on the stack

Michael Beck's avatar
Michael Beck committed
1308
1309
1310
  Revision 1.15  2004/12/23 15:40:03  beck
  used new xcalloc

Michael Beck's avatar
Michael Beck committed
1311
1312
1313
  Revision 1.14  2004/12/22 14:43:14  beck
  made allocations C-like

Michael Beck's avatar
Michael Beck committed
1314
1315
1316
  Revision 1.13  2004/12/21 14:21:16  beck
  removed C99 constructs

Florian Liekweg's avatar
Florian Liekweg committed
1317
1318
1319
  Revision 1.12  2004/12/20 17:34:34  liekweg
  fix recursion handling

Florian Liekweg's avatar
Florian Liekweg committed
1320
1321
1322
  Revision 1.11  2004/12/15 09:18:18  liekweg
  pto_name.c

Florian Liekweg's avatar
Florian Liekweg committed
1323
1324
1325
  Revision 1.10  2004/12/06 12:55:06  liekweg
  actually iterate

Michael Beck's avatar
Michael Beck committed
1326
1327
1328
  Revision 1.9  2004/12/02 16:17:50  beck
  fixed config.h include

1329
1330
1331
  Revision 1.8  2004/11/30 14:45:44  liekweg
  fix graph dumping, remove 'HERE's

Florian Liekweg's avatar
Florian Liekweg committed
1332
1333
1334
  Revision 1.7  2004/11/26 16:01:56  liekweg
  debugging annotations

Florian Liekweg's avatar
Florian Liekweg committed
1335
1336
1337
  Revision 1.6  2004/11/24 14:53:55  liekweg
  Bugfixes

Florian Liekweg's avatar
Florian Liekweg committed
1338
1339
1340
  Revision 1.5  2004/11/20 21:20:29  liekweg
  Added iterator functions

1341
1342
1343
  Revision 1.4  2004/11/18 16:36:37  liekweg
  Added unique ids for debugging, added access functions

Florian Liekweg's avatar
Florian Liekweg committed
1344
1345
1346
  Revision 1.3  2004/11/04 14:54:44  liekweg
  Nicer Colors

1347
1348
1349
1350
1351
  Revision 1.2  2004/10/21 11:09:37  liekweg
  Moved memwalk stuf into irmemwalk
  Moved lset stuff into lset
  Moved typalise stuff into typalise

1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
  Revision 1.1  2004/10/20 14:59:41  liekweg
  Added ana2, added ecg and pto

  Revision 1.6  2004/10/18 12:47:19  liekweg
  minor fix

  Revision 1.5  2004/10/14 11:31:28  liekweg
  SHUTUP_GCC

  Revision 1.4  2004/10/12 11:02:01  liekweg
  wtf?

*/