firm_common.h 2.03 KB
Newer Older
Götz Lindenmaier's avatar
Götz Lindenmaier committed
1
/*
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
 *
 * This file is part of libFirm.
 *
 * This file may be distributed and/or modified under the terms of the
 * GNU General Public License version 2 as published by the Free Software
 * Foundation and appearing in the file LICENSE.GPL included in the
 * packaging of this file.
 *
 * Licensees holding valid libFirm Professional Edition licenses may use
 * this file in accordance with the libFirm Commercial License.
 * Agreement provided with the Software.
 *
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE.
Götz Lindenmaier's avatar
Götz Lindenmaier committed
18
 */
Christian Schäfer's avatar
Christian Schäfer committed
19

Michael Beck's avatar
Michael Beck committed
20
/**
21
22
23
24
 * @file
 * @brief    common firm declarations
 * @author   Martin Trapp, Christian Schaefer, Goetz Lindenmaier
 * @version  $Id$
Michael Beck's avatar
Michael Beck committed
25
 */
26
27
#ifndef FIRM_COMMON_FIRM_COMMON_H
#define FIRM_COMMON_FIRM_COMMON_H
Christian Schäfer's avatar
Christian Schäfer committed
28

29
30
/** a list of firm kinds
 @@@ not all datatypes are tagged yet. */
Christian Schäfer's avatar
Christian Schäfer committed
31
typedef enum {
Michael Beck's avatar
Michael Beck committed
32
33
34
35
36
37
38
39
40
41
42
43
44
45
	k_BAD = 0,                /**< An invalid firm node. */
	k_entity,                 /**< An entity. */
	k_type,                   /**< A type. */
	k_ir_graph,               /**< An IR graph. */
	k_ir_node,                /**< An IR node. */
	k_ir_mode,                /**< An IR mode. */
	k_ir_op,                  /**< An IR opcode. */
	k_tarval,                 /**< A tarval. */
	k_ir_loop,                /**< A loop. */
	k_ir_compound_graph_path, /**< A compound graph path, see entity.h. */
	k_ir_extblk,              /**< An extended basic block. */
	k_ir_prog,                /**< A program representation (irp). */
	k_ir_region,              /**< A region. */
	k_ir_max                  /**< maximum value -- illegal for firm nodes. */
46
47
} firm_kind;

Michael Beck's avatar
Michael Beck committed
48
49
50
/**
 * Returns the kind of a thing.
 *
Andreas Schösser's avatar
Andreas Schösser committed
51
 * @param firm_thing  pointer representing a firm object
Michael Beck's avatar
Michael Beck committed
52
 */
Michael Beck's avatar
Michael Beck committed
53
firm_kind get_kind(const void *firm_thing);
Christian Schäfer's avatar
Christian Schäfer committed
54

Michael Beck's avatar
Michael Beck committed
55
/** Returns the kind of a thing as a string. */
Michael Beck's avatar
Michael Beck committed
56
const char *print_firm_kind(void *firm_thing);
Götz Lindenmaier's avatar
Götz Lindenmaier committed
57

58
59
60
/** Print an identification of a firm thing. */
void firm_identify_thing(void *X);

61
#endif