replaced char* by idents, minor fix in Firm codegen for call
[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
24 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 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( merge_pair_func *mpf, merge_sets_func *msf )
46 {
47   __dbg_info_merge_pair = mpf;
48   __dbg_info_merge_sets = msf;
49 }
50
51
52 void
53 set_irn_dbg_info(ir_node *n, struct dbg_info* db) {
54   n->dbi = db;
55 }
56
57 struct dbg_info *
58 get_irn_dbg_info(ir_node *n) {
59   return n->dbi;
60 }
61
62
63 /* Routines to access the field of an entity containing the
64    debugging information. */
65 void set_entity_dbg_info(entity *ent, dbg_info* db) {
66   ent->dbi = db;
67 }
68 dbg_info *get_entity_dbg_info(entity *ent) {
69   return ent->dbi;
70 }
71 /* Routines to access the field of a type containing the
72    debugging information. */
73 void set_type_dbg_info(type *tp, dbg_info* db) {
74   tp->dbi = db;
75 }
76 dbg_info *get_type_dbg_info(type *tp) {
77   return tp->dbi;
78 }