af81e0043c20852ceb2b499280d2de73177a8c01
[libfirm] / ir / common / irtools.h
1 /*
2  * Project:     libFIRM
3  * File name:   ir/ir/irtools.h
4  * Purpose:     Some often needed tool-functions
5  * Author:      Michael Beck
6  * Modified by:
7  * Created:
8  * CVS-ID:      $Id$
9  * Copyright:   (c) 1999-2005 Universität Karlsruhe
10  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
11  */
12 #ifndef _IRTOOLS_H_
13 #define _IRTOOLS_H_
14
15 #include "firm_config.h"
16
17 #ifdef WITH_LIBCORE
18 #include <libcore/lc_opts.h>
19 lc_opt_entry_t *firm_opt_get_root(void);
20 #endif
21
22
23 #include "irnode.h"
24
25 /**
26  * convert an integer into pointer
27  */
28 #define INT_TO_PTR(v)   ((void *)((char *)0 + (v)))
29
30 /**
31  * convert a pointer into an integer
32  */
33 #define PTR_TO_INT(v)   ((int)((char *)(v) - (char *)0))
34
35 /**
36  * The famous clear_link() walker-function.
37  * Do not implement it by yourself, use this one
38  */
39 void firm_clear_link(ir_node *n, void *env);
40
41 #endif /* _IRTOOLS_H_ */