bugfixes
[libfirm] / ir / debug / dbginfo.c
1 /*
2 **  Copyright (C) 2001 by Universitaet Karlsruhe
3 **  All rights reserved.
4 **
5 **  Authors: Goetz Lindenmaier
6 **
7 **  dbginfo: This is a empty implementation of the Firm interface to
8 **  debugging support.  It only guarantees that the Firm library compiles
9 **  and runs without any real debugging support.
10 **  The functions herein are declared weak so that they can be overriden
11 **  by a real implementation.
12 */
13
14 /* $Id$ */
15
16 #ifdef HAVE_CONFIG_H
17 # include <config.h>
18 #endif
19
20 #include "dbginfo_t.h"
21 #include "irnode_t.h"
22
23
24 inline void
25 dbg_info_merge_pair(ir_node *nw, ir_node *old, dbg_action info) {
26   set_irn_dbg_info(nw, get_irn_dbg_info(old));
27 }
28
29 inline void
30 dbg_info_merge_sets(ir_node **new_nodes, int n_new_nodes,
31                     ir_node **old_nodes, int n_old_nodes,
32                     dbg_action info) {
33 }
34
35
36 void (*__dbg_info_merge_pair)(ir_node *nw, ir_node *old, dbg_action info)
37      = &dbg_info_merge_pair;
38
39 void (*__dbg_info_merge_sets)(ir_node **new_nodes, int n_new_nodes,
40                               ir_node **old_nodes, int n_old_nodes,
41                               dbg_action info)
42      = &dbg_info_merge_sets;
43
44
45 void dbg_init( void (merge_pair)(ir_node *nw, ir_node *old, dbg_action info) ,
46                void (merge_sets)(ir_node **new_nodes, int n_new_nodes,
47                                  ir_node **old_nodes, int n_old_nodes,
48                                   dbg_action info)
49                ) {
50   __dbg_info_merge_pair = merge_pair;
51   __dbg_info_merge_sets = merge_sets;
52 }
53
54
55 inline void
56 set_irn_dbg_info(ir_node *n, struct dbg_info* db) {
57   n->dbi = db;
58 }
59
60 inline struct dbg_info *
61 get_irn_dbg_info(ir_node *n) {
62   return n->dbi;
63 }