ir/ir/irop_t.h added
[libfirm] / ir / ana2 / pto_debug.c
1 /* -*- c -*- */
2
3 /*
4    Project:     libFIRM
5    File name:   ir/ana/pto_debug.c
6    Purpose:     Useful Macros for Debugging
7    Author:      Florian
8    Modified by:
9    Created:     Sat Nov 13 19:30:21 CET 2004
10    CVS-ID:      $Id$
11    Copyright:   (c) 1999-2004 Universität Karlsruhe
12    Licence:     This file is protected by the GPL -  GNU GENERAL PUBLIC LICENSE.
13 */
14
15 # ifdef HAVE_CONFIG_H
16 #  include "config.h"
17 # endif
18
19 /*
20  pto_debug: Useful Macros for Debugging
21 */
22
23 # include "pto_debug.h"
24 # include "pto_comp.h"
25 # include "gnu_ext.h"
26 # include "qset.h"
27
28 /* # include "xmalloc.h" */
29
30 /* Local Defines: */
31
32 /* Local Data Types: */
33
34 /* Local Variables: */
35 static int dbg_lvl = 0;
36
37 /* Local Prototypes: */
38
39 /* ===================================================
40    Local Implementation:
41    =================================================== */
42
43
44 /* ===================================================
45    Exported Implementation:
46    =================================================== */
47 int get_dbg_lvl ()
48 {
49   return (dbg_lvl);
50 }
51
52 void set_dbg_lvl (int lvl)
53 {
54   /* fprintf (stdout, "%s:%s (): dbg_lvl: %i -> %i\n", */
55 /*            __FILE__, __FUNCTION__, dbg_lvl, lvl); */
56   dbg_lvl = lvl;
57 }
58
59 void pto_print_pto (ir_node *node)
60 {
61   pto_t *pto = get_node_pto (node);
62
63   fprintf (stdout, "pto (%s[%li]) = ", OPNAME (node), OPNUM (node));
64   if (NULL != pto) {
65     qset_print (pto->values, stdout);
66   } else {
67     fprintf (stdout, "NULL");
68   }
69 }
70
71
72 \f
73 /*
74   $Log$
75   Revision 1.5  2005/02/25 16:47:51  liekweg
76   fix GNU stuff
77
78   Revision 1.4  2004/12/20 17:34:35  liekweg
79   fix recursion handling
80
81   Revision 1.3  2004/12/02 16:17:51  beck
82   fixed config.h include
83
84   Revision 1.2  2004/11/24 14:53:56  liekweg
85   Bugfixes
86
87   Revision 1.1  2004/11/18 16:37:34  liekweg
88   rewritten
89
90
91 */