minir_dumping should do something usefull now
[libfirm] / include / libfirm / irsimpletype.h
1 /*
2  * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @brief    Run most simple type analyses.
23  * @author   Goetz Lindenmaier
24  * @date     22.8.2003
25  * @version  $Id$
26  * @brief
27  *  We compute type information for each node.  It is derived from the
28  *  types of the origines of values, e.g. parameter types can be derived
29  *  from the method type.
30  *  The type information so far is saved in the link field.
31  */
32 #ifndef FIRM_ANA_IRSIMPLETYPE_H
33 #define FIRM_ANA_IRSIMPLETYPE_H
34
35 #include "irgraph.h"
36 #include "irnode.h"
37 #include "typerep.h"
38
39
40
41 /* ------------ Building and Removing the type information  ----------- */
42
43 /** Computes type information for each node in all ir graphs.
44  *
45  * Computes type information for each node.  Stores the information in the
46  * field defined in irtypeinfo.h. Sets typestate in irg to irg_typeinfo_consistent.
47  *
48  * Derives the information from nodes/patterns that give hints about the
49  * type, as projecting an argument from the Start node.  Deletes all previous
50  * type information.
51  *
52  * If a non-pointer type is specified for a pointer value (as the Alloc node does:
53  * it contains the type allocated, but to type the result we need the type that
54  * describes a pointer to the allocated type) searches for a corresponding pointer
55  * type.  If several exist, uses one of them.  If none exists, uses unknown_type.
56  *
57  * Uses the link field of types.  Sets this field of each type to point to a
58  * pointer type that points to the type (Got it? ;-)).
59  */
60 void simple_analyse_types(void);
61
62 /** Frees all type information datastructures.  Sets the flag in irg to "???". */
63 void free_simple_type_information(void);
64
65 /** Computes type information for a node.
66  *
67  *  Computes type information for a node.  Does not remark this type information
68  *  in the ir.  Computes the type information by analysing the predecessors.
69  *  Calls the same basic analyses routine for a node as simple_analyse_types,
70  *  but returns unknown_type for Phi nodes.
71  *  Each call is theoretically O(n).
72  *
73  *  Not yet implemented, but I guess we want this for iropt, to find the
74  *  type for newly allocated constants.
75  */
76 /* type *analyse_irn_type(ir_node *node); */
77
78 #endif