X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbedbgout.c;h=d1e2b4a2e62b86c3388d2133ee397f12f53ac239;hb=4520b859eab8301352d6e9ecd05556796bb2a771;hp=fd03dd12f6d636242d266b7db5d9a9f78f8b3214;hpb=379fd05b0fb269dd9b9105810de1ce565b18e446;p=libfirm diff --git a/ir/be/bedbgout.c b/ir/be/bedbgout.c index fd03dd12f..d1e2b4a2e 100644 --- a/ir/be/bedbgout.c +++ b/ir/be/bedbgout.c @@ -24,9 +24,7 @@ * @date 11.9.2006 * @version $Id: bestabs.c 17143 2008-01-02 20:56:33Z beck $ */ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include "be_dbgout_t.h" #include "bemodule.h" @@ -34,42 +32,50 @@ static dbg_handle *handle = NULL; -void be_dbg_close(void) { +void be_dbg_close(void) +{ if (handle->ops->close) handle->ops->close(handle); } -void be_dbg_so(const char *filename) { +void be_dbg_so(const char *filename) +{ if (handle->ops->so) handle->ops->so(handle, filename); } -void be_dbg_main_program(void) { +void be_dbg_main_program(void) +{ if (handle->ops->main_program) handle->ops->main_program(handle); } -void be_dbg_method_begin(ir_entity *ent, const be_stack_layout_t *layout) { +void be_dbg_method_begin(const ir_entity *ent) +{ if (handle->ops->method_begin) - handle->ops->method_begin(handle, ent, layout); + handle->ops->method_begin(handle, ent); } -void be_dbg_method_end(void) { +void be_dbg_method_end(void) +{ if (handle->ops->method_end) handle->ops->method_end(handle); } -void be_dbg_types(void) { +void be_dbg_types(void) +{ if (handle->ops->types) handle->ops->types(handle); } -void be_dbg_variable(struct obstack *obst, ir_entity *ent) { +void be_dbg_variable(const ir_entity *ent) +{ if (handle->ops->variable) - handle->ops->variable(handle, obst, ent); + handle->ops->variable(handle, ent); } -void be_dbg_set_dbg_info(dbg_info *dbgi) { +void be_dbg_set_dbg_info(dbg_info *dbgi) +{ if (handle->ops->set_dbg_info) handle->ops->set_dbg_info(handle, dbgi); } @@ -77,34 +83,34 @@ void be_dbg_set_dbg_info(dbg_info *dbgi) { static be_module_list_entry_t *dbgout_modules = NULL; static be_create_dbgout_module_func selected_dbgout_module = NULL; -void be_dbg_open(void) { +void be_dbg_open(void) +{ handle = selected_dbgout_module(); } -void be_register_dbgout_module(const char *name, - be_create_dbgout_module_func func); - void be_register_dbgout_module(const char *name, be_create_dbgout_module_func func) { if (selected_dbgout_module == NULL) selected_dbgout_module = func; - be_add_module_to_list(&dbgout_modules, name, func); + be_add_module_to_list(&dbgout_modules, name, (void*)func); } static dbg_handle *create_null_dbgout_module(void) { - static const debug_ops null_ops; + static const debug_ops null_ops = { + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + }; static dbg_handle null_handle = { &null_ops }; return &null_handle; } -void be_init_dbgout(void) { +BE_REGISTER_MODULE_CONSTRUCTOR(be_init_dbgout); +void be_init_dbgout(void) +{ lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be"); be_add_module_list_opt(be_grp, "debuginfo", "debug info format", &dbgout_modules, (void**) &selected_dbgout_module); - be_register_dbgout_module("null", create_null_dbgout_module); + be_register_dbgout_module("none", create_null_dbgout_module); } - -BE_REGISTER_MODULE_CONSTRUCTOR(be_init_dbgout);