missing include added
[libfirm] / ir / ana / irsimpletype.h
1 /*
2  * Project:     libFIRM
3  * File name:   ir/ana/irsimpletype.h
4  * Purpose:     Run most simple type analyses.
5  * Author:      Goetz Lindenmaier
6  * Modified by:
7  * Created:     22.8.2003
8  * CVS-ID:      $Id$
9  * Copyright:   (c) 2003 Universität Karlsruhe
10  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
11  */
12
13 /**
14  * @file irsimpletype.h
15  *
16  * We compute type information for each node.  It is derived from the
17  * types of the origines of values, e.g. parameter types can be derived
18  * from the method type.
19  * The type information so far is saved in the link field.
20  *
21  * @author Goetz Lindenmaier
22  */
23 # ifndef _IRSIMPLETYPE_H_
24 # define _IRSIMPLETYPE_H_
25
26 # include "irgraph.h"
27 # include "irnode.h"
28 # include "type.h"
29
30
31
32 /* ------------ Building and Removing the type information  ----------- */
33
34 /** Computes type information for each node in all ir graphs.
35  *
36  * Computes type information for each node.  Stores the information in the
37  * field defined in irtypeinfo.h. Sets typestate in irg to irg_typeinfo_consistent.
38  *
39  * Derives the information from nodes/patterns that give hints about the
40  * type, as projecting an argument from the Start node.  Deletes all previous
41  * type information.
42  *
43  * If a non-pointer type is specified for a pointer value (as the Alloc node does:
44  * it contains the type allocated, but to type the result we need the type that
45  * describes a pointer to the allocated type) searches for a corresponding pointer
46  * type.  If several exist, uses one of them.  If none exists, uses unknown_type.
47  *
48  * Uses the link field of types.  Sets this field of each type to point to a
49  * pointer type that points to the type (Got it? ;-)).
50  */
51 void simple_analyse_types(void);
52
53 /** Frees all type information datastructures.  Sets the flag in irg to "???". */
54 void free_simple_type_information(void);
55
56 /** Computes type information for a node.
57  *
58  *  Computes type information for a node.  Does not remark this type information
59  *  in the ir.  Computes the type information by analysing the predecessors.
60  *  Calls the same basic analyses routine for a node as simple_analyse_types,
61  *  but returns unknown_type for Phi nodes.
62  *  Each call is theoretically O(n).
63  *
64  *  Not yet implemented, but I guess we want this for iropt, to find the
65  *  type for newly allocated constants.
66  */
67 /* type *analyse_irn_type(ir_node *node); */
68
69 #endif /* _IRSIMPLETYPE_H_ */