Fixed memory leaks
[libfirm] / ir / opt / opt_polymorphy.h
1 /*
2  * Project:     libFIRM
3  * File name:   ir/opt/opt_polymorphy.h
4  * Purpose:     Optimize polymorphic Sel and Load nodes.
5  * Author:
6  * Created:
7  * CVS-ID:      $Id$
8  * Copyright:   (c) 2005 Universität Karlsruhe
9  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
10  */
11
12 /** @file
13  *
14  *  This file subsumes optimization code from cgana.
15  */
16 #ifndef _OPT_POLYMORPHY_H_
17 #define _OPT_POLYMORPHY_H_
18
19 #include "firm_types.h"
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25 /**
26  * Transform  Sel(Alloc)[method]
27  * to SymC[method] under the following conditions:
28  *
29  * - opt_dyn_meth_dispatch must be set
30  * - the method is not overwritten OR
31  * - the dynamic type is known
32  */
33 ir_node *transform_node_Sel(ir_node *node);
34
35 /** Transform  Load(Sel(Alloc)[constant static entity])
36  *  to Const[constant static entity value].
37  *
38  *  This function returns a node replacing the Proj(Load)[Value].
39  *  If this is actually called in transform_node, we must build
40  *  a tuple, or replace the Projs of the load.
41  *  Therefore we call this optimization in ldstopt.
42  */
43 ir_node *transform_node_Load(ir_node *n);
44
45 #ifdef __cplusplus
46 }
47 #endif
48
49 #endif /* _OPT_POLYMORPHY_H_ */