new type tag
[libfirm] / ir / common / firm_common.h
1 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
2 * All rights reserved.
3 */
4
5 /**
6  * @file firm_common.h
7  *
8  * common firm declarations
9  *
10  * @author Martin Trapp, Christian Schaefer & Goetz Lindenmaier
11  */
12
13 /* $Id$ */
14
15 # ifndef _FIRM_COMMON_H_
16 # define _FIRM_COMMON_H_
17
18 #ifndef INLINE
19 #ifdef USE_GCC_INLINE
20 #define INLINE inline
21 #else
22 #define INLINE
23 #endif
24 #endif
25
26 /** a list of firm kinds
27  @@@ not all datatypes are tagged yet. */
28 typedef enum {
29   k_entity,     /**< an entity */
30   k_type,       /**< a type */
31   k_ir_graph,   /**< an ir graph */
32   k_ir_node,    /**< an ir node */
33   k_ir_mode,    /**< an ir mode */
34   k_ir_op,      /**< an ir opcode */
35   k_tarval,     /**< a tarval */
36   k_ir_loop,    /**< a loop */
37   k_ir_compound_graph_path, /**< a compound graph path, see entity.h */
38   k_ir_max      /**< maximum value -- illegal for firm nodes. */
39 } firm_kind;
40
41 /**
42  * Returns the kind of a thing.
43  *
44  * @param firm_thing  pointer representing a firm object
45  */
46 firm_kind get_kind(const void *firm_thing);
47
48 /** Returns the kind of a thing as a string. */
49 const char* print_firm_kind(void *firm_thing);
50
51 # endif /*_FIRM_COMMON_H_ */