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
512afc22
Commit
512afc22
authored
Dec 20, 2001
by
Götz Lindenmaier
Browse files
Some access routines for visited flags in entity.h, irnode.h,
bug in oo_program_example. [r291]
parent
b4cfa9a1
Changes
9
Hide whitespace changes
Inline
Side-by-side
Changes
View file @
512afc22
20.12.2001 Goetz
Some access routines for visited flags in entity.h, irnode.h,
bug in oo_program_example.
17.12.2001 Boris
Removed all obsolete Makefiles
...
...
ir/common/common.h
View file @
512afc22
...
...
@@ -47,7 +47,7 @@
/* If this and DEBUG_libfirm are defined irdump uses the nodeid numbers as
labels for the vcg nodes. This makes the vcg graph better readable.
Sometimes it's useful to see the pointer values, though. */
#define NODEID_AS_LABEL
0
#define NODEID_AS_LABEL
1
/* a list of firm kinds */
typedef
enum
{
...
...
ir/ir/irgmod.h
View file @
512afc22
...
...
@@ -13,6 +13,11 @@
# include "irnode.h"
/* Exchanges two nodes by conserving edges leaving old (i.e., pointers
pointing to old). Turns the old node into an Id. Requires that
current_ir_graph is set properly. */
inline
void
exchange
(
ir_node
*
old
,
ir_node
*
new
);
/* Turns a node into a "useless" Tuple. The Tuple node just forms a tuple
from several inputs. The predecessors of the tuple have to be
set by hand. The block predecessor automatically remains the same.
...
...
@@ -20,11 +25,6 @@
extracting values from the tuple are not available. */
void
turn_into_tuple
(
ir_node
*
node
,
int
arity
);
/* Exchanges two nodes by conserving edges leaving old (i.e., pointers
pointing to old). Turns the old node into an Id. Requires that
current_ir_graph is set properly. */
inline
void
exchange
(
ir_node
*
old
,
ir_node
*
new
);
/* Walks over the passed ir graph and collects all Phi nodes as a
list built with the link field in their corresponding block.
Further it collects all Proj nodes in a list of the node producing
...
...
ir/ir/irnode.h
View file @
512afc22
...
...
@@ -58,7 +58,7 @@ int get_irn_arity (ir_node *node);
/* returns the array with the ins: */
inline
ir_node
**
get_irn_in
(
ir_node
*
node
);
/* Replaces the old in array by a new one that will contain the ins given in
the parameters. It copies the array passed.
the parameters.
Conserves the block predecessor.
It copies the array passed.
This function is necessary to ajust in arrays of blocks, calls and phis.
Assumes the current_ir_graph is set to the graph containing "node".
"in" must contain all predecessors except the block that are required for
...
...
ir/tr/entity.h
View file @
512afc22
...
...
@@ -222,7 +222,7 @@ ir_graph *get_entity_irg(entity *ent);
void
set_entity_irg
(
entity
*
ent
,
ir_graph
*
irg
);
/* Returns true if the type of the entity is a primitive, pointer
n
/* Returns true if the type of the entity is a primitive, pointer
enumeration or method type. */
int
is_atomic_entity
(
entity
*
ent
);
/* Returns true if the type of the entity is a class, structure,
...
...
ir/tr/type.c
View file @
512afc22
...
...
@@ -40,6 +40,7 @@
# include "irprog.h"
# include "mangle.h"
# include "tv.h"
# include "ircons.h"
/*******************************************************************/
/** TYPE **/
...
...
@@ -532,8 +533,8 @@ int get_array_n_dimensions (type *array) {
assert
(
array
&&
(
array
->
type_op
==
type_array
));
return
array
->
attr
.
aa
.
n_dimensions
;
}
void
set_array_bounds_int
(
type
*
array
,
int
dimension
,
int
lower_bound
,
int
upper_bound
)
{
void
set_array_bounds_int
(
type
*
array
,
int
dimension
,
int
lower_bound
,
int
upper_bound
)
{
ir_graph
*
rem
;
assert
(
array
&&
(
array
->
type_op
==
type_array
));
rem
=
current_ir_graph
;
...
...
@@ -545,8 +546,8 @@ void set_array_bounds_int (type *array, int dimension, int lower_bound,
current_ir_graph
=
rem
;
}
void
set_array_bounds
(
type
*
array
,
int
dimension
,
ir_node
*
lower_bound
,
ir_node
*
upper_bound
)
{
void
set_array_bounds
(
type
*
array
,
int
dimension
,
ir_node
*
lower_bound
,
ir_node
*
upper_bound
)
{
assert
(
array
&&
(
array
->
type_op
==
type_array
));
array
->
attr
.
aa
.
lower_bound
[
dimension
]
=
lower_bound
;
array
->
attr
.
aa
.
upper_bound
[
dimension
]
=
upper_bound
;
...
...
ir/tr/typewalk.c
View file @
512afc22
...
...
@@ -22,6 +22,7 @@
#include "irnode.h"
#include "irprog.h"
#include "type_or_entity.h"
#include "typegmod.h"
/* Make types visible to allow most efficient access */
#include "entity_t.h"
...
...
ir/tr/typewalk.h
View file @
512afc22
...
...
@@ -35,12 +35,13 @@ void type_walk_irg(ir_graph *irg,
void
(
post
)(
type_or_ent
*
,
void
*
),
void
*
env
);
/** Walks over all
type
information reachable from global roots.
Touches every
type and entity
in specified order:
- first the super
type
s
- second the
type
itself
- third the sub
typ
es. If new
types/entiti
es are created
/** Walks over all
classes
information reachable from global roots.
Touches every
class
in specified order:
- first the super
clas
s
- second the
class
itself
- third the sub
class
es. If new
class
es are created
during the traversal these will be visited, too. **/
/** @@@ shoulc be named class-walk **/
void
type_walk_super2sub
(
void
(
pre
)(
type_or_ent
*
,
void
*
),
void
(
post
)(
type_or_ent
*
,
void
*
),
void
*
env
);
...
...
testprograms/oo_program_example.c
View file @
512afc22
...
...
@@ -115,7 +115,7 @@ main(void)
obj_size
=
new_SymConst
((
type_or_id_p
)
class_prima
,
size
);
obj_o
=
new_Alloc
(
get_store
(),
obj_size
,
class_prima
,
heap_alloc
);
set_store
(
new_Proj
(
obj_o
,
mode_M
,
0
));
/* make the changed memory visible */
obj_o
=
new_Proj
(
obj_o
,
mode_p
,
1
);
/* remember the pointer to the object */
obj_o
=
new_Proj
(
obj_o
,
mode_p
,
2
);
/* remember the pointer to the object */
set_value
(
o_pos
,
obj_o
);
/* Get the pointer to the procedure from the object. */
...
...
Write
Preview
Markdown
is supported
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