Added itrools, a (currently small) collection of often used helper functions
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Fri, 22 Jul 2005 12:23:04 +0000 (12:23 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Fri, 22 Jul 2005 12:23:04 +0000 (12:23 +0000)
[r6273]

ir/common/Makefile.in
ir/common/irtools.c [new file with mode: 0644]
ir/common/irtools.h [new file with mode: 0644]

index 761cd1c..4e55bf5 100644 (file)
@@ -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 (file)
index 0000000..bb0fdda
--- /dev/null
@@ -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 <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);
+}
diff --git a/ir/common/irtools.h b/ir/common/irtools.h
new file mode 100644 (file)
index 0000000..279ab8f
--- /dev/null
@@ -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_ */