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
c3914363
Commit
c3914363
authored
Jun 25, 2002
by
Florian Liekweg
Browse files
Added iro_InstOf operator --flo
Added exc/instanceof fields --flo [r416]
parent
966d9403
Changes
5
Hide whitespace changes
Inline
Side-by-side
ir/tr/entity.c
View file @
c3914363
...
...
@@ -354,7 +354,8 @@ get_compound_ent_value(entity *ent, int pos) {
}
/* Copies the value i of the entity to current_block in current_ir_graph. */
ir_node
*
copy_compound_ent_value
(
entity
*
ent
,
int
pos
)
{
ir_node
*
copy_compound_ent_value
(
entity
*
ent
,
int
pos
)
{
assert
(
ent
&&
is_compound_entity
(
ent
)
&&
(
ent
->
variability
!=
uninitialized
));
return
copy_const_value
(
ent
->
values
[
pos
+
1
]);
}
...
...
ir/tr/entity.h
View file @
c3914363
...
...
@@ -39,7 +39,7 @@
** of owner is determined.
** ir_graph *irg; If (type == method_type) this is the corresponding irg.
** The ir_graph constructor automatically sets this field.
** If (type !
-
method_type) access of this field will cause
** If (type !
=
method_type) access of this field will cause
** an assertion.
*/
...
...
@@ -175,7 +175,7 @@ typedef enum {
external_visible
,
/* The entity is visible to other external program parts, but
it is defined here. It may not be optimized away. The entity must
be static_allocated. */
external_allocated
/* The entity is defined and allocated externaly. This compilation
external_allocated
/* The entity is defined and allocated external
l
y. This compilation
must not allocate memory for this entity. The entity must
be static_allocated. */
}
ent_visibility
;
...
...
ir/tr/type.c
View file @
c3914363
...
...
@@ -150,7 +150,7 @@ void set_type_ident(type *tp, ident* id) {
const
char
*
get_type_name
(
type
*
tp
)
{
assert
(
tp
&&
tp
->
kind
==
k_type
);
return
id_to_str
(
tp
->
name
);
return
(
id_to_str
(
tp
->
name
)
)
;
}
int
get_type_size
(
type
*
tp
)
{
...
...
@@ -263,6 +263,7 @@ type *new_type_class (ident *name) {
res
->
attr
.
ca
.
subtypes
=
NEW_ARR_F
(
type
*
,
1
);
res
->
attr
.
ca
.
supertypes
=
NEW_ARR_F
(
type
*
,
1
);
res
->
attr
.
ca
.
peculiarity
=
existent
;
res
->
attr
.
ca
.
dfn
=
0
;
return
res
;
}
...
...
@@ -395,6 +396,16 @@ inline void set_class_peculiarity (type *clss, peculiarity pec) {
clss
->
attr
.
ca
.
peculiarity
=
pec
;
}
void
set_class_dfn
(
type
*
clss
,
int
dfn
)
{
clss
->
attr
.
ca
.
dfn
=
dfn
;
}
int
get_class_dfn
(
type
*
clss
)
{
return
(
clss
->
attr
.
ca
.
dfn
);
}
/* typecheck */
bool
is_class_type
(
type
*
clss
)
{
assert
(
clss
);
...
...
@@ -607,7 +618,7 @@ bool is_union_type (type *uni) {
/* create a new type array -- set dimension sizes independently */
type
*
new_type_array
(
ident
*
name
,
int
n_dimensions
,
type
*
element_type
)
{
type
*
element_type
)
{
type
*
res
;
int
i
;
assert
((
element_type
->
type_op
!=
type_method
));
...
...
@@ -627,6 +638,7 @@ type *new_type_array (ident *name, int n_dimensions,
new_entity
(
res
,
mangle_u
(
name
,
id_from_str
(
"elem_ent"
,
8
)),
element_type
);
return
res
;
}
inline
void
free_array_attrs
(
type
*
array
)
{
assert
(
array
&&
(
array
->
type_op
==
type_array
));
free
(
array
->
attr
.
aa
.
lower_bound
);
...
...
ir/tr/type.h
View file @
c3914363
...
...
@@ -125,7 +125,7 @@ void set_type_ident(type *tp, ident* id);
const
char
*
get_type_name
(
type
*
tp
);
int
get_type_size
(
type
*
tp
);
/* For primitives, enumerations
m
, pointer and method types the size
/* For primitives, enumerations, pointer and method types the size
is always fixed. This call is legal but has no effect. */
void
set_type_size
(
type
*
tp
,
int
size
);
...
...
@@ -281,6 +281,10 @@ typedef enum peculiarity {
inline
peculiarity
get_class_peculiarity
(
type
*
clss
);
inline
void
set_class_peculiarity
(
type
*
clss
,
peculiarity
pec
);
/* Set and get a class' dfn */
void
set_class_dfn
(
type
*
,
int
);
int
get_class_dfn
(
type
*
);
/* typecheck */
bool
is_class_type
(
type
*
clss
);
/*****/
...
...
@@ -429,7 +433,7 @@ void set_union_delim_nameid (type *uni, int pos, ident *id);
Entity for array elements is built automatically.
Set dimension sizes after call to constructor with set_* routines. */
type
*
new_type_array
(
ident
*
name
,
int
n_dimensions
,
type
*
element_type
);
type
*
element_type
);
/* manipulate private fields of array type */
int
get_array_n_dimensions
(
type
*
array
);
...
...
ir/tr/type_t.h
View file @
c3914363
...
...
@@ -26,6 +26,7 @@ typedef struct {
type
**
subtypes
;
/* direct subtypes */
type
**
supertypes
;
/* direct supertypes */
peculiarity
peculiarity
;
int
dfn
;
/* number used for 'instanceof' operator */
}
cls_attr
;
typedef
struct
{
...
...
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