From: Michael Beck Date: Fri, 22 Jul 2005 12:23:04 +0000 (+0000) Subject: Added itrools, a (currently small) collection of often used helper functions X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=a7e8e01c9d4de334f435bfe95436b40997330cf7;p=libfirm Added itrools, a (currently small) collection of often used helper functions [r6273] --- diff --git a/ir/common/Makefile.in b/ir/common/Makefile.in index 761cd1c8c..4e55bf587 100644 --- a/ir/common/Makefile.in +++ b/ir/common/Makefile.in @@ -15,13 +15,14 @@ srcdir = @srcdir@ topdir = ../.. subdir := ir/common -INSTALL_HEADERS := firm_common.h firm.h firmwalk.h statistics.h debug.h +INSTALL_HEADERS := firm_common.h firm.h firmwalk.h statistics.h debug.h irtools.h SOURCES = $(INSTALL_HEADERS) SOURCES += Makefile.in \ panic.c firm_common.c firm.c firmwalk.c \ - panic.h firm_common_t.h statistics.c debug.c old_fctnames.h + panic.h firm_common_t.h statistics.c debug.c old_fctnames.h \ + irtools.c include $(topdir)/MakeRules diff --git a/ir/common/irtools.c b/ir/common/irtools.c new file mode 100644 index 000000000..bb0fddaa0 --- /dev/null +++ b/ir/common/irtools.c @@ -0,0 +1,23 @@ +/* + * Project: libFIRM + * File name: ir/ir/irtools.c + * Purpose: Some often needed tool-functions + * Author: Michael Beck + * Modified by: + * Created: + * CVS-ID: $Id$ + * Copyright: (c) 1999-2005 Universität Karlsruhe + * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. + */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include "irnode_t.h" +#include "irtools.h" + +/* the famous clear_link implementation. */ +void firm_clear_link(ir_node *n, void *env) { + set_irn_link(n, NULL); +} diff --git a/ir/common/irtools.h b/ir/common/irtools.h new file mode 100644 index 000000000..279ab8f89 --- /dev/null +++ b/ir/common/irtools.h @@ -0,0 +1,23 @@ +/* + * Project: libFIRM + * File name: ir/ir/irtools.h + * Purpose: Some often needed tool-functions + * Author: Michael Beck + * Modified by: + * Created: + * CVS-ID: $Id$ + * Copyright: (c) 1999-2005 Universität Karlsruhe + * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. + */ +#ifndef _IRTOOLS_H_ +#define _IRTOOLS_H_ + +#include "irnode.h" + +/** + * The famous clear_link() walker-function. + * Do not implement it by yourself, use this one + */ +void firm_clear_link(ir_node *n, void *env); + +#endif /* _IRTOOLS_H_ */