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
760356ab
Commit
760356ab
authored
Aug 11, 2003
by
Götz Lindenmaier
Browse files
added output of array bound nodes to vcg
[r1643]
parent
a756679c
Changes
9
Hide whitespace changes
Inline
Side-by-side
ir/ir/irdump.c
View file @
760356ab
...
...
@@ -561,7 +561,6 @@ static void dump_node2type_edges (ir_node *n, void *env)
}
/* @@@@ Does not work as someone kills the visited flag. */
static
void
dump_const_expression
(
ir_node
*
value
)
{
ir_graph
*
rem
=
current_ir_graph
;
int
rem_dump_const_local
=
dump_const_local
;
...
...
@@ -781,6 +780,15 @@ dump_type_info (type_or_ent *tore, void *env) {
{
PRINT_TYPE_TYPE_EDGE
(
tp
,
get_array_element_type
(
tp
),
ARR_ELT_TYPE_EDGE_ATTR
);
PRINT_TYPE_ENT_EDGE
(
tp
,
get_array_element_entity
(
tp
),
ARR_ENT_EDGE_ATTR
);
for
(
i
=
0
;
i
<
get_array_n_dimensions
(
tp
);
i
++
)
{
ir_node
*
upper
=
get_array_upper_bound
(
tp
,
i
);
ir_node
*
lower
=
get_array_lower_bound
(
tp
,
i
);
PRINT_NODE_TYPE_EDGE
(
upper
,
tp
,
"label:
\"
upper %d
\"
"
,
get_array_order
(
tp
,
i
));
PRINT_NODE_TYPE_EDGE
(
lower
,
tp
,
"label:
\"
lower %d
\"
"
,
get_array_order
(
tp
,
i
));
dump_const_expression
(
upper
);
dump_const_expression
(
lower
);
}
}
break
;
case
tpo_enumeration
:
{
...
...
ir/tr/type.c
View file @
760356ab
...
...
@@ -1097,6 +1097,7 @@ set_array_bounds (type *array, int dimension, ir_node * lower_bound,
assert
(
array
&&
(
array
->
type_op
==
type_array
));
assert
(
lower_bound
&&
"lower_bound node may not be NULL."
);
assert
(
upper_bound
&&
"upper_bound node may not be NULL."
);
assert
(
dimension
<
array
->
attr
.
aa
.
n_dimensions
&&
dimension
>=
0
);
array
->
attr
.
aa
.
lower_bound
[
dimension
]
=
lower_bound
;
array
->
attr
.
aa
.
upper_bound
[
dimension
]
=
upper_bound
;
}
...
...
ir/tr/type.h
View file @
760356ab
...
...
@@ -648,7 +648,7 @@ void set_array_lower_bound (type *array, int dimension, ir_node *lower_bound);
void
set_array_lower_bound_int
(
type
*
array
,
int
dimension
,
int
lower_bound
);
void
set_array_upper_bound
(
type
*
array
,
int
dimension
,
ir_node
*
upper_bound
);
void
set_array_upper_bound_int
(
type
*
array
,
int
dimension
,
int
lower_bound
);
/* returns true i
s
lower bound != Unknown */
/* returns true i
f
lower bound != Unknown */
int
has_array_lower_bound
(
type
*
array
,
int
dimension
);
ir_node
*
get_array_lower_bound
(
type
*
array
,
int
dimension
);
int
has_array_upper_bound
(
type
*
array
,
int
dimension
);
...
...
ir/tv/IeeeCC754/readme.usage
View file @
760356ab
IeeeCC754 tests the correct implementation of the ieee floating
point constant evaluation.
Call make; make test to run the test.
Or do the test by hand:
How to call the driver program IeeeCC754
========================================
...
...
testprograms/array-heap_example.c
View file @
760356ab
...
...
@@ -85,19 +85,20 @@ main(void)
proc_main
=
new_type_method
(
id_from_str
(
"ARRAY-HEAP_EXAMPLE_main"
,
23
),
0
,
1
);
set_method_res_type
(
proc_main
,
0
,
(
type
*
)
prim_t_int
);
proc_main_e
=
new_entity
((
type
*
)
owner
,
id_from_str
(
"ARRAY-HEAP_EXAMPLE_main"
,
23
),
(
type
*
)
proc_main
);
main_irg
=
new_ir_graph
(
proc_main_e
,
4
);
/* make type information for the array and set the bounds */
# define N_DIMS 1
# define L_BOUND 0
# define U_BOUND 9
current_ir_graph
=
get_const_code_irg
();
array_type
=
new_type_array
(
id_from_str
(
"a"
,
1
),
N_DIMS
,
prim_t_int
);
set_array_bounds
(
array_type
,
1
,
set_array_bounds
(
array_type
,
0
,
new_Const
(
mode_Iu
,
new_tarval_from_long
(
L_BOUND
,
mode_Iu
)),
new_Const
(
mode_Iu
,
new_tarval_from_long
(
U_BOUND
,
mode_Iu
)));
/* As the array is accessed by Sel nodes, we need information about
the entity the node selects. Entities of an array are it's elements
which are, in this case, integers. */
main_irg
=
new_ir_graph
(
proc_main_e
,
4
);
array_ent
=
get_array_element_entity
(
array_type
);
/* Allocate the array. All program known variables that
...
...
@@ -155,6 +156,7 @@ main(void)
printf
(
"Dumping the graph and a type graph.
\n
"
);
dump_ir_block_graph
(
main_irg
);
dump_type_graph
(
main_irg
);
dump_all_types
();
printf
(
"use xvcg to view these graphs:
\n
"
);
printf
(
"/ben/goetz/bin/xvcg GRAPHNAME
\n\n
"
);
...
...
testprograms/array-stack_example.c
View file @
760356ab
...
...
@@ -76,16 +76,18 @@ main(void)
set_method_res_type
(
proc_main
,
0
,
prim_t_int
);
proc_main_e
=
new_entity
(
owner
,
id_from_str
(
"main"
,
4
),
proc_main
);
main_irg
=
new_ir_graph
(
proc_main_e
,
4
);
/* make type information for the array and set the bounds */
# define N_DIMS 1
# define L_BOUND 0
# define U_BOUND 9
array_type
=
new_type_array
(
id_from_str
(
"a_tp"
,
4
),
N_DIMS
,
prim_t_int
);
set_array_bounds
(
array_type
,
1
,
current_ir_graph
=
get_const_code_irg
();
set_array_bounds
(
array_type
,
0
,
new_Const
(
mode_Iu
,
new_tarval_from_long
(
L_BOUND
,
mode_Iu
)),
new_Const
(
mode_Iu
,
new_tarval_from_long
(
U_BOUND
,
mode_Iu
)));
main_irg
=
new_ir_graph
(
proc_main_e
,
4
);
/* The array is an entity of the method, placed on the mehtod's own memory,
the stack frame. */
array_ent
=
new_entity
(
get_cur_frame_type
(),
id_from_str
(
"a"
,
1
),
array_type
);
...
...
@@ -140,6 +142,7 @@ main(void)
dump_ir_block_graph
(
main_irg
);
dump_type_graph
(
main_irg
);
dump_ir_block_graph_w_types
(
main_irg
);
dump_all_types
();
printf
(
"Use xvcg to view these graphs:
\n
"
);
printf
(
"/ben/goetz/bin/xvcg GRAPHNAME
\n\n
"
);
...
...
testprograms/ref-results/ARRAY-HEAP_EXAMPLE_main-type.vcg
View file @
760356ab
...
...
@@ -17,9 +17,9 @@ classname 10: "Array Element Type"
classname 11: "Overwrites"
classname 12: "Member"
node: {title: "e
29
" label: "ent a_elem_ent" color: yellow
node: {title: "e
15
" label: "ent a_elem_ent" color: yellow
info1: "
id: e
29
id: e
15
allocation: automatic allocated
visibility: local
variability: uninitialized
...
...
@@ -29,12 +29,18 @@ name: a_elem_ent
ld_name: a_a_elem_ent
offset: -1"
}
edge: { sourcename: "e
29
" targetname: "t10"class: 3 label: "type" color: red}
node: {title: "t
28
" label: "array a" info1: "state: layout_undefined
edge: { sourcename: "e
15
" targetname: "t10"class: 3 label: "type" color: red}
node: {title: "t
14
" label: "array a" info1: "state: layout_undefined
size: -1B,
"}
edge: { sourcename: "t28" targetname: "t10"class: 10 label: "arr elt tp" color:green}
edge: { sourcename: "t28" targetname: "e29"class: 10 label: "arr ent" color: green}
edge: { sourcename: "t14" targetname: "t10"class: 10 label: "arr elt tp" color:green}
edge: { sourcename: "t14" targetname: "e15"class: 10 label: "arr ent" color: green}
edge: { sourcename: "n16" targetname: "t14"label: "upper 0"}
edge: { sourcename: "n17" targetname: "t14"label: "lower 0"}
node: {title: "n16" label: "0x9Iu 16" color: yellow info1: "visited: 1
"}
node: {title: "n17" label: "0x0Iu 17" color: yellow info1: "visited: 1
"}
node: {title: "t10" label: "primitive int" info1: "state: layout_fixed,
mode: Is,
size: 4B,
...
...
@@ -50,7 +56,7 @@ peculiarity: existent
name: ARRAY-HEAP_EXAMPLE_main
ld_name: GlobalType_ARRAY-HEAP_EXAMPLE_main
offset: -1
irg = g
26
"
irg = g
30
"
}
edge: { sourcename: "e13" targetname: "t11"class: 3 label: "type" color: red}
edge: { sourcename: "e13" targetname: "n12"label: "value 0"}
...
...
@@ -65,7 +71,7 @@ mode: P,
size: 4B,
"}
edge: { sourcename: "t11" targetname: "t10"class: 6 label: "res 0" color: green}
node: {title: "t1
4
" label: "class ARRAY-HEAP_EXAMPLE_mainframe_tp" info1: "state: layout_undefined
node: {title: "t1
8
" label: "class ARRAY-HEAP_EXAMPLE_mainframe_tp" info1: "state: layout_undefined
size: -1B,
" color: green}
}
testprograms/ref-results/ARRAY-STACK_EXAMPLE_main-all.vcg
View file @
760356ab
...
...
@@ -69,9 +69,9 @@ edge: {sourcename: "n57" targetname: "n50" label: "0" color: blue}
node: {title: "n61" label: "Bad 61" info1: "visited: 0
"}
node: {title: "e
30
" label: "ent a_tp_elem_ent" color: yellow
node: {title: "e
16
" label: "ent a_tp_elem_ent" color: yellow
info1: "
id: e
30
id: e
16
allocation: automatic allocated
visibility: local
variability: uninitialized
...
...
@@ -81,12 +81,18 @@ name: a_tp_elem_ent
ld_name: a_tp_a_tp_elem_ent
offset: -1"
}
edge: { sourcename: "e
30
" targetname: "t10"class: 3 label: "type" color: red}
node: {title: "t
29
" label: "array a_tp" info1: "state: layout_undefined
edge: { sourcename: "e
16
" targetname: "t10"class: 3 label: "type" color: red}
node: {title: "t
15
" label: "array a_tp" info1: "state: layout_undefined
size: -1B,
"}
edge: { sourcename: "t29" targetname: "t10"class: 10 label: "arr elt tp" color:green}
edge: { sourcename: "t29" targetname: "e30"class: 10 label: "arr ent" color: green}
edge: { sourcename: "t15" targetname: "t10"class: 10 label: "arr elt tp" color:green}
edge: { sourcename: "t15" targetname: "e16"class: 10 label: "arr ent" color: green}
edge: { sourcename: "n17" targetname: "t15"label: "upper 0"}
edge: { sourcename: "n18" targetname: "t15"label: "lower 0"}
node: {title: "n17" label: "0x9Iu 17" color: yellow info1: "visited: 2
"}
node: {title: "n18" label: "0x0Iu 18" color: yellow info1: "visited: 2
"}
node: {title: "t10" label: "primitive int" info1: "state: layout_fixed,
mode: Is,
size: 4B,
...
...
@@ -103,11 +109,11 @@ name: a
ld_name: mainframe_tp_a
offset: -1"
}
edge: { sourcename: "e33" targetname: "t
29
"class: 3 label: "type" color: red}
node: {title: "t1
5
" label: "class mainframe_tp" info1: "state: layout_undefined
edge: { sourcename: "e33" targetname: "t
15
"class: 3 label: "type" color: red}
node: {title: "t1
9
" label: "class mainframe_tp" info1: "state: layout_undefined
size: -1B,
" color: green}
edge: { sourcename: "t1
5
" targetname: "e33"class: 12 label: "member" color:blue}
edge: { sourcename: "t1
9
" targetname: "e33"class: 12 label: "member" color:blue}
node: {title: "e14" label: "ent main" color: yellow
info1: "
id: e14
...
...
@@ -119,7 +125,7 @@ peculiarity: existent
name: main
ld_name: ARRAY-STACK_EXAMPLE_main
offset: -1
irg = g
27
"
irg = g
31
"
}
edge: { sourcename: "e14" targetname: "t12"class: 3 label: "type" color: red}
edge: { sourcename: "e14" targetname: "n13"label: "value 0"}
...
...
@@ -134,6 +140,6 @@ mode: P,
size: 4B,
"}
edge: { sourcename: "t12" targetname: "t10"class: 6 label: "res 0" color: green}
edge: { sourcename: "n53" targetname: "e
30
"class: 2 priority: 2 linestyle: dotted}
edge: { sourcename: "n53" targetname: "e
16
"class: 2 priority: 2 linestyle: dotted}
edge: { sourcename: "n55" targetname: "e33"class: 2 priority: 2 linestyle: dotted}
}
testprograms/ref-results/main-type.vcg
View file @
760356ab
...
...
@@ -17,9 +17,9 @@ classname 10: "Array Element Type"
classname 11: "Overwrites"
classname 12: "Member"
node: {title: "e
30
" label: "ent a_tp_elem_ent" color: yellow
node: {title: "e
16
" label: "ent a_tp_elem_ent" color: yellow
info1: "
id: e
30
id: e
16
allocation: automatic allocated
visibility: local
variability: uninitialized
...
...
@@ -29,12 +29,18 @@ name: a_tp_elem_ent
ld_name: a_tp_a_tp_elem_ent
offset: -1"
}
edge: { sourcename: "e
30
" targetname: "t10"class: 3 label: "type" color: red}
node: {title: "t
29
" label: "array a_tp" info1: "state: layout_undefined
edge: { sourcename: "e
16
" targetname: "t10"class: 3 label: "type" color: red}
node: {title: "t
15
" label: "array a_tp" info1: "state: layout_undefined
size: -1B,
"}
edge: { sourcename: "t29" targetname: "t10"class: 10 label: "arr elt tp" color:green}
edge: { sourcename: "t29" targetname: "e30"class: 10 label: "arr ent" color: green}
edge: { sourcename: "t15" targetname: "t10"class: 10 label: "arr elt tp" color:green}
edge: { sourcename: "t15" targetname: "e16"class: 10 label: "arr ent" color: green}
edge: { sourcename: "n17" targetname: "t15"label: "upper 0"}
edge: { sourcename: "n18" targetname: "t15"label: "lower 0"}
node: {title: "n17" label: "0x9Iu 17" color: yellow info1: "visited: 1
"}
node: {title: "n18" label: "0x0Iu 18" color: yellow info1: "visited: 1
"}
node: {title: "t10" label: "primitive int" info1: "state: layout_fixed,
mode: Is,
size: 4B,
...
...
@@ -51,11 +57,11 @@ name: a
ld_name: mainframe_tp_a
offset: -1"
}
edge: { sourcename: "e33" targetname: "t
29
"class: 3 label: "type" color: red}
node: {title: "t1
5
" label: "class mainframe_tp" info1: "state: layout_undefined
edge: { sourcename: "e33" targetname: "t
15
"class: 3 label: "type" color: red}
node: {title: "t1
9
" label: "class mainframe_tp" info1: "state: layout_undefined
size: -1B,
" color: green}
edge: { sourcename: "t1
5
" targetname: "e33"class: 12 label: "member" color:blue}
edge: { sourcename: "t1
9
" targetname: "e33"class: 12 label: "member" color:blue}
node: {title: "e14" label: "ent main" color: yellow
info1: "
id: e14
...
...
@@ -67,7 +73,7 @@ peculiarity: existent
name: main
ld_name: ARRAY-STACK_EXAMPLE_main
offset: -1
irg = g
27
"
irg = g
31
"
}
edge: { sourcename: "e14" targetname: "t12"class: 3 label: "type" color: red}
edge: { sourcename: "e14" targetname: "n13"label: "value 0"}
...
...
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