2 * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
4 * This file is part of libFirm.
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.
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.
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
22 * @brief Run most simple type analyses.
23 * @author Goetz Lindenmaier
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.
32 #ifndef FIRM_ANA_IRSIMPLETYPE_H
33 #define FIRM_ANA_IRSIMPLETYPE_H
41 /* ------------ Building and Removing the type information ----------- */
43 /** Computes type information for each node in all ir graphs.
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.
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
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.
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? ;-)).
60 void simple_analyse_types(void);
62 /** Frees all type information datastructures. Sets the flag in irg to "???". */
63 void free_simple_type_information(void);
65 /** Computes type information for a node.
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).
73 * Not yet implemented, but I guess we want this for iropt, to find the
74 * type for newly allocated constants.
76 /* type *analyse_irn_type(ir_node *node); */