From: Michael Beck Date: Mon, 3 Apr 2006 13:41:38 +0000 (+0000) Subject: HOOK_BACKEND added X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=edd767f589dbd44c04d28f349600fe305ead175d;p=libfirm HOOK_BACKEND added renamed init_hooks() into firm_init_hooks() [r7569] --- diff --git a/ir/ir/irhooks.c b/ir/ir/irhooks.c index db98c0ca3..6349aa051 100644 --- a/ir/ir/irhooks.c +++ b/ir/ir/irhooks.c @@ -29,7 +29,7 @@ hook_entry_t *hooks[hook_last]; /* register a hook */ void register_hook(hook_type_t hook, hook_entry_t *entry) { - /* check if a hook function is specifyed. It's a union, so no matter which one */ + /* check if a hook function is specified. It's a union, so no matter which one */ if (! entry->hook._hook_turn_into_id) return; @@ -63,6 +63,9 @@ void unregister_hook(hook_type_t hook, hook_entry_t *entry) {} #endif /* FIRM_ENABLE_HOOKS */ -int init_hooks(void) { +int firm_init_hooks(void) { + /* this strange code assures that both functions are available + in a shared library even if none of them is called. + Meanwhile not needed anymore but ... */ return (int)register_hook + (int)unregister_hook; } diff --git a/ir/ir/irhooks.h b/ir/ir/irhooks.h index 9ec788cdb..d0a1c1735 100644 --- a/ir/ir/irhooks.h +++ b/ir/ir/irhooks.h @@ -54,6 +54,7 @@ typedef enum { HOOK_OPT_CONFIRM_E, /**< a value was evaluated due to a Confirm */ HOOK_OPT_EXC_REM, /**< a exception edge was removed due to a Confirmation prove */ HOOK_LOWERED, /**< lowered */ + HOOK_BACKEND, /**< a backend transformation */ HOOK_OPT_LAST } hook_opt_kind; @@ -276,6 +277,6 @@ extern hook_entry_t *hooks[hook_last]; #define hook_new_type(tp) hook_exec(hook_new_type, (ctx, tp)) /* the initializer, move to hooks_t.h some day */ -int init_hooks(void); +int firm_init_hooks(void); #endif /* __IRHOOKS_H__ */