44fd13e042a916cdea5408eac562175007b182fa
[libfirm] / ir / ir / irflag.c
1 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
2 ** All rights reserved.
3 **
4 ** Authors: Christian Schaefer
5 **
6 ** irflag --- optimization flags
7 */
8
9 #ifdef HAVE_CONFIG_H
10 # include <config.h>
11 #endif
12
13
14 /* 0 - don't do this optimization
15    1 - lets see, if there is a better graph */
16 int opt_cse = 1;                    /* Hash the nodes */
17 int opt_constant_folding = 1;       /* Evaluate operations */
18 int opt_unreachable_code = 1;       /* Bad node propagation */
19 int opt_dead_node_elimination = 1;  /* Reclaim memory */
20 int optimized = 1;
21 int opt_inline = 1;
22
23 /* set the flags with set_flagname, get the flag with get_flagname */
24
25 inline void
26 set_opt_cse (int value)
27 {
28   opt_cse = value;
29 }
30
31 inline int
32 get_opt_cse (void)
33 {
34   return opt_cse;
35 }
36
37 inline void
38 set_opt_constant_folding (int value)
39 {
40   opt_constant_folding=value;
41 }
42
43 inline int
44 get_opt_constant_folding (void)
45 {
46   return opt_constant_folding;
47 }
48
49 inline void
50 set_opt_unreachable_code(int value)
51 {
52   opt_unreachable_code = value;
53 }
54
55 inline int
56 get_opt_unreachable_code(void)
57 {
58   return opt_unreachable_code;
59 }
60
61
62 inline void
63 set_opt_dead_node_elimination (int value)
64 {
65   opt_dead_node_elimination = value;
66 }
67
68 inline int
69 get_opt_dead_node_elimination (void)
70 {
71   return opt_dead_node_elimination;
72 }
73
74 inline void
75 set_optimize (int value)
76 {
77   optimized = value;
78 }
79
80 inline int
81 get_optimize (void)
82 {
83   return optimized;
84 }
85
86
87 void set_opt_inline (int value) {
88   opt_inline = value;
89 }
90
91 int  get_opt_inline (void) {
92   return opt_inline;
93 }