X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=include%2Flibfirm%2Firhooks.h;h=0f9c840fb8b0dc3b53017f13592ea0c83914e45c;hb=382f803c29c0e6711dba7f3d08f73bc0077b38c0;hp=d3d4c46f9e54a1597aee59f71e5a9d782a18a04f;hpb=ecdb60f1195aeca30b66d1ee99c603c4539f8fe3;p=libfirm diff --git a/include/libfirm/irhooks.h b/include/libfirm/irhooks.h index d3d4c46f9..0f9c840fb 100644 --- a/include/libfirm/irhooks.h +++ b/include/libfirm/irhooks.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -26,7 +26,6 @@ #ifndef FIRM_IR_IRHOOKS_H #define FIRM_IR_IRHOOKS_H -#include "firm_config.h" #include "irop.h" #include "irnode.h" #include "irgraph.h" @@ -40,8 +39,8 @@ typedef enum { HOOK_OPT_IFSIM, /**< if simplification */ HOOK_OPT_CONST_EVAL, /**< constant evaluation */ HOOK_OPT_ALGSIM, /**< algebraic simplification */ - HOOK_OPT_PHI, /**< Phi optmization */ - HOOK_OPT_SYNC, /**< Sync optmization */ + HOOK_OPT_PHI, /**< Phi optimization */ + HOOK_OPT_SYNC, /**< Sync optimization */ HOOK_OPT_WAW, /**< Write-After-Write optimization */ HOOK_OPT_WAR, /**< Write-After-Read optimization */ HOOK_OPT_RAW, /**< Read-After-Write optimization */ @@ -228,28 +227,20 @@ void register_hook(hook_type_t hook, hook_entry_t *entry); */ void unregister_hook(hook_type_t hook, hook_entry_t *entry); -#ifdef FIRM_ENABLE_HOOKS - extern hook_entry_t *hooks[hook_last]; /** * execute the hook what with the args args * Do not use this macro directly. */ -#define hook_exec(what, args) do { \ - hook_entry_t *p; \ - for (p = hooks[what]; p; p = p->next){ \ - void *ctx = p->context; \ - p->hook._##what args; \ - } \ +#define hook_exec(what, args) do { \ + hook_entry_t *_p; \ + for (_p = hooks[what]; _p; _p = _p->next){ \ + void *ctx = _p->context; \ + _p->hook._##what args; \ + } \ } while (0) -#else - -#define hook_exec(what, args) - -#endif /* FIRM_ENABLE_HOOKS */ - #define hook_new_ir_op(op) hook_exec(hook_new_ir_op, (ctx, op)) #define hook_free_ir_op(op) hook_exec(hook_free_ir_op, (ctx, op)) #define hook_new_node(graph, node) hook_exec(hook_new_node, (ctx, graph, node))