3 * File name: ir/debug/dbginfo.c
4 * Purpose: Implements the Firm interface to debug information.
5 * Author: Goetz Lindenmaier
9 * Copyright: (c) 2001-2003 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 set_irn_dbg_info(nw, get_irn_dbg_info(old));
28 default_dbg_info_merge_sets(ir_node **new_nodes, int n_new_nodes,
29 ir_node **old_nodes, int n_old_nodes,
33 merge_pair_func *__dbg_info_merge_pair = default_dbg_info_merge_pair;
35 merge_sets_func *__dbg_info_merge_sets = default_dbg_info_merge_sets;
37 snprint_dbg_func *__dbg_info_snprint = (snprint_dbg_func *)0;
39 void dbg_init( merge_pair_func *mpf, merge_sets_func *msf, snprint_dbg_func *snprint_dbg )
41 __dbg_info_merge_pair = mpf ? mpf : default_dbg_info_merge_pair;
42 __dbg_info_merge_sets = msf ? msf : default_dbg_info_merge_sets;
43 __dbg_info_snprint = snprint_dbg;
48 set_irn_dbg_info(ir_node *n, struct dbg_info* db) {
53 get_irn_dbg_info(ir_node *n) {
58 /* Routines to access the field of an entity containing the
59 debugging information. */
60 void set_entity_dbg_info(entity *ent, dbg_info* db) {
64 dbg_info *get_entity_dbg_info(entity *ent) {
68 /* Routines to access the field of a type containing the
69 debugging information. */
70 void set_type_dbg_info(type *tp, dbg_info* db) {
74 dbg_info *get_type_dbg_info(type *tp) {
79 * Converts a debug_action into a string.
81 const char *dbg_action_2_str(dbg_action a) {
82 #define CASE(a) case a: return #a
87 CASE(dbg_opt_auxnode);
90 CASE(dbg_straightening);
91 CASE(dbg_if_simplification);
92 CASE(dbg_algebraic_simplification);
93 CASE(dbg_write_after_write);
94 CASE(dbg_write_after_read);
95 CASE(dbg_read_after_write);
96 CASE(dbg_read_after_read);
97 CASE(dbg_read_a_const);
98 CASE(dbg_rem_poly_call);
100 CASE(dbg_opt_confirm);
103 return "string conversion not implemented";