Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
ee570c83
Commit
ee570c83
authored
Nov 19, 2002
by
Götz Lindenmaier
Browse files
Bugfixes
[r521]
parent
c3b44ae1
Changes
2
Hide whitespace changes
Inline
Side-by-side
testprograms/dead_block_example.c
View file @
ee570c83
...
...
@@ -57,8 +57,6 @@ int main(int argc, char **argv)
/* init library */
init_firm
();
set_opt_cse
(
0
);
/* there is a bug: first and start block are cse!! @@@ */
/*** Make basic type information for primitive type int. ***/
prim_t_int
=
new_type_primitive
(
id_from_str
(
"int"
,
3
),
mode_i
);
...
...
testprograms/if_else_example.c
View file @
ee570c83
...
...
@@ -34,6 +34,7 @@
int
main
(
int
argc
,
char
**
argv
)
{
type
*
prim_t_int
;
ir_graph
*
irg
;
/* this variable contains the irgraph */
type
*
owner
;
/* the class in which this method is defined */
type
*
method
;
/* the type of this method */
...
...
@@ -45,6 +46,9 @@ int main(int argc, char **argv)
/* init library */
init_firm
();
/*** Make basic type information for primitive type int. ***/
prim_t_int
=
new_type_primitive
(
id_from_str
(
"int"
,
3
),
mode_i
);
/* FIRM was designed for oo languages where all methods belong to a class.
* For imperative languages like C we view a file as a large class containing
* all functions as methods in this file.
...
...
@@ -55,6 +59,9 @@ int main(int argc, char **argv)
owner
=
get_glob_type
();
method
=
new_type_method
(
id_from_str
(
"main"
,
4
),
0
,
2
);
set_method_res_type
(
method
,
0
,
prim_t_int
);
set_method_res_type
(
method
,
1
,
prim_t_int
);
ent
=
new_entity
(
owner
,
id_from_str
(
ENTITYNAME
,
strlen
(
ENTITYNAME
)),
method
);
...
...
@@ -122,6 +129,8 @@ int main(int argc, char **argv)
/* Now we can mature the end block as all it's predecessors are known. */
mature_block
(
get_irg_end_block
(
irg
));
finalize_cons
(
irg
);
printf
(
"
\n
Optimizing ...
\n
"
);
local_optimize_graph
(
irg
);
dead_node_elimination
(
irg
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment