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
--- /dev/null
+/*
+ * 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 <stdlib.h>
+#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);
+}
--- /dev/null
+/*
+ * 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_ */