3 * File name: ir/debug/dbginfo.c
4 * Purpose: Implements the Firm interface to debug information.
5 * Author: Goetz Lindenmaier
6 * Modified by: Michael Beck
9 * Copyright: (c) 2001-2006 Universität Karlsruhe
10 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
17 #include "dbginfo_t.h"
23 default_dbg_info_merge_pair(ir_node *nw, ir_node *old, dbg_action info) {
24 dbg_info *old_db = get_irn_dbg_info(old);
26 set_irn_dbg_info(nw, old_db);
30 default_dbg_info_merge_sets(ir_node **new_nodes, int n_new_nodes,
31 ir_node **old_nodes, int n_old_nodes,
35 merge_pair_func *__dbg_info_merge_pair = default_dbg_info_merge_pair;
37 merge_sets_func *__dbg_info_merge_sets = default_dbg_info_merge_sets;
39 snprint_dbg_func *__dbg_info_snprint = (snprint_dbg_func *)0;
41 void dbg_init( merge_pair_func *mpf, merge_sets_func *msf, snprint_dbg_func *snprint_dbg )
43 __dbg_info_merge_pair = mpf ? mpf : default_dbg_info_merge_pair;
44 __dbg_info_merge_sets = msf ? msf : default_dbg_info_merge_sets;
45 __dbg_info_snprint = snprint_dbg;
50 set_irn_dbg_info(ir_node *n, struct dbg_info* db) {
55 get_irn_dbg_info(const ir_node *n) {
60 /* Routines to access the field of an entity containing the
61 debugging information. */
62 void set_entity_dbg_info(entity *ent, dbg_info* db) {
66 dbg_info *get_entity_dbg_info(entity *ent) {
70 /* Routines to access the field of a type containing the
71 debugging information. */
72 void set_type_dbg_info(ir_type *tp, dbg_info* db) {
76 dbg_info *get_type_dbg_info(ir_type *tp) {
81 * Converts a debug_action into a string.
83 const char *dbg_action_2_str(dbg_action a) {
84 #define CASE(a) case a: return #a
89 CASE(dbg_opt_auxnode);
92 CASE(dbg_straightening);
93 CASE(dbg_if_simplification);
94 CASE(dbg_algebraic_simplification);
95 CASE(dbg_write_after_write);
96 CASE(dbg_write_after_read);
97 CASE(dbg_read_after_write);
98 CASE(dbg_read_after_read);
99 CASE(dbg_read_a_const);
100 CASE(dbg_rem_poly_call);
102 CASE(dbg_opt_confirm);
106 return "string conversion not implemented";