58b93524cc736a6153aae5981b50d88853116859
[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 "qset.h"
26
27 /* # include "xmalloc.h" */
28
29 /* Local Defines: */
30
31 /* Local Data Types: */
32
33 /* Local Variables: */
34 static int dbg_lvl = 0;
35
36 /* Local Prototypes: */
37
38 /* ===================================================
39    Local Implementation:
40    =================================================== */
41
42
43 /* ===================================================
44    Exported Implementation:
45    =================================================== */
46 int get_dbg_lvl ()
47 {
48   return (dbg_lvl);
49 }
50
51 void set_dbg_lvl (int lvl)
52 {
53   dbg_lvl = lvl;
54 }
55
56 void pto_print_pto (ir_node *node)
57 {
58   pto_t *pto = get_node_pto (node);
59
60   fprintf (stdout, "pto (%s[%li]) = ", OPNAME (node), OPNUM (node));
61   if (NULL != pto) {
62     qset_print (pto->values, stdout);
63   } else {
64     fprintf (stdout, "NULL");
65   }
66 }
67
68
69 \f
70 /*
71   $Log$
72   Revision 1.4  2004/12/20 17:34:35  liekweg
73   fix recursion handling
74
75   Revision 1.3  2004/12/02 16:17:51  beck
76   fixed config.h include
77
78   Revision 1.2  2004/11/24 14:53:56  liekweg
79   Bugfixes
80
81   Revision 1.1  2004/11/18 16:37:34  liekweg
82   rewritten
83
84
85 */