84019ebb0322072b326c6517ae25489cc937ce62
[libfirm] / include / libfirm / analyze_irg_args.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     read/write analyze of graph argument, which have mode reference
23  * @author    Beyhan Veliev
24  * @version   $Id$
25  */
26 #ifndef FIRM_ANA_ANALYZE_IRG_ARGS_H
27 #define FIRM_ANA_ANALYZE_IRG_ARGS_H
28
29 #include "irgraph.h"
30 #include "firm_types.h"
31 #include "typerep.h"
32
33 /**
34  * Returns for a method with pointer parameter
35  * if they will be read or written.
36  *
37  * @param ent  The entity that represent this method.
38  * @param pos  The position of method's parameter for that
39  *             we need information.
40
41  * If the pos'th parameter is NOT of a pointer type, ptr_access_none
42  * is returned;
43  */
44 ptr_access_kind get_method_param_access(ir_entity *ent, int pos);
45
46 /**
47  * Analyze how pointer arguments of a given
48  * ir graph are accessed.
49  *
50  * @param irg   The ir graph to analyze.
51  */
52 void analyze_irg_args(ir_graph *irg);
53
54 /**
55  * Returns for a method the 'weight' that every parameter
56  * has on optimization possibility. Higher values allows
57  * higher optimization with procedure cloning.
58  *
59  * The values are calculation on demand only.
60  */
61 unsigned get_method_param_weight(ir_entity *ent, int pos);
62
63 /**
64  * Analyze the parameters of a given ir graph.
65  *
66  * @param irg The ir graph to analyze.
67  */
68 void analyze_irg_args_weight(ir_graph *irg);
69
70 #endif