whitespace
[libfirm] / ir / debug / dbginfo.c
1 /*
2  * Project:     libFIRM
3  * File name:   ir/debug/dbginfo.c
4  * Purpose:     Implements the Firm interface to debug information.
5  * Author:      Goetz Lindenmaier
6  * Modified by:
7  * Created:     2001
8  * CVS-ID:      $Id$
9  * Copyright:   (c) 2001-2003 Universität Karlsruhe
10  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
11  */
12
13
14 #ifdef HAVE_CONFIG_H
15 # include <config.h>
16 #endif
17
18 #include "dbginfo_t.h"
19 #include "irnode_t.h"
20 #include "type_t.h"
21 #include "entity_t.h"
22
23 void
24 dbg_info_merge_pair(ir_node *nw, ir_node *old, dbg_action info) {
25   set_irn_dbg_info(nw, get_irn_dbg_info(old));
26 }
27
28 void
29 dbg_info_merge_sets(ir_node **new_nodes, int n_new_nodes,
30             ir_node **old_nodes, int n_old_nodes,
31             dbg_action info) {
32 }
33
34
35 void (*__dbg_info_merge_pair)(ir_node *nw, ir_node *old, dbg_action info)
36      = &dbg_info_merge_pair;
37
38 void (*__dbg_info_merge_sets)(ir_node **new_nodes, int n_new_nodes,
39                   ir_node **old_nodes, int n_old_nodes,
40                   dbg_action info)
41      = &dbg_info_merge_sets;
42
43
44 void dbg_init( merge_pair_func *mpf, merge_sets_func *msf )
45 {
46   __dbg_info_merge_pair = mpf;
47   __dbg_info_merge_sets = msf;
48 }
49
50
51 void
52 set_irn_dbg_info(ir_node *n, struct dbg_info* db) {
53   n->dbi = db;
54 }
55
56 struct dbg_info *
57 get_irn_dbg_info(ir_node *n) {
58   return n->dbi;
59 }
60
61
62 /* Routines to access the field of an entity containing the
63    debugging information. */
64 void set_entity_dbg_info(entity *ent, dbg_info* db) {
65   ent->dbi = db;
66 }
67 dbg_info *get_entity_dbg_info(entity *ent) {
68   return ent->dbi;
69 }
70 /* Routines to access the field of a type containing the
71    debugging information. */
72 void set_type_dbg_info(type *tp, dbg_info* db) {
73   tp->dbi = db;
74 }
75 dbg_info *get_type_dbg_info(type *tp) {
76   return tp->dbi;
77 }