2 * Copyright (C) 1995-2011 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 Central firm functionality.
23 * @author Martin Trapp, Christian Schaefer, Goetz Lindenmaier
27 #include "firm_revision.h"
43 #include "irgraph_t.h"
49 #include "iredges_t.h"
50 #include "irmemory_t.h"
56 /* returns the firm root */
57 lc_opt_entry_t *firm_opt_get_root(void)
59 static lc_opt_entry_t *grp = NULL;
61 grp = lc_opt_get_grp(lc_opt_root_grp(), "firm");
67 /* for historical reasons be_init must be run first */
70 /* initialize firm flags */
72 /* initialize all ident stuff */
74 /* Edges need hooks. */
76 /* create the type kinds. */
78 /* create an obstack and put all tarvals in a pdeq */
79 init_tarval_1(0l, /* support_quad_precision */0);
80 /* Builds a basic program representation, so modes can be added. */
82 /* initialize all modes an ir node can consist of */
84 /* initialize tarvals, and floating point arithmetic */
86 /* init graph construction */
88 /* kind of obstack initialization */
90 /* initialize all op codes an irnode can consist of */
92 /* initialize reassociation */
93 firm_init_reassociation();
94 /* initialize function call optimization */
95 firm_init_funccalls();
96 /* initialize function inlining */
98 /* initialize scalar replacement */
99 firm_init_scalar_replace();
100 /* Builds a construct allowing to access all information to be constructed
103 /* Initialize the type module and construct some idents needed. */
105 /* initialize the entity module */
107 /* class cast optimization */
108 firm_init_class_casts_opt();
109 /* memory disambiguation */
110 firm_init_memory_disambiguator();
111 firm_init_loop_opt();
113 /* Init architecture dependent optimizations. */
114 arch_dep_set_opts(arch_dep_none);
119 /* integrated debugger extension */
120 firm_init_debugger();
128 /* must iterate backwards here */
129 for (i = get_irp_n_irgs(); i > 0;)
130 free_ir_graph(get_irp_irg(--i));
132 free_type_entities(get_glob_type());
133 /* must iterate backwards here */
134 for (i = get_irp_n_types(); i > 0;)
135 free_type_entities(get_irp_type(--i));
137 for (i = get_irp_n_types(); i > 0;)
138 free_type(get_irp_type(--i));
153 unsigned ir_get_version_major(void)
155 return libfirm_VERSION_MAJOR;
158 unsigned ir_get_version_minor(void)
160 return libfirm_VERSION_MINOR;
163 const char *ir_get_version_revision(void)
165 #ifdef libfirm_VERSION_REVISION
166 return libfirm_VERSION_REVISION;
172 const char *ir_get_version_build(void)