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
ef63002f
Commit
ef63002f
authored
Feb 19, 2010
by
Christoph Mallon
Browse files
Remove address name SymConsts.
[r27182]
parent
d59632bf
Changes
15
Hide whitespace changes
Inline
Side-by-side
include/libfirm/firm_types.h
View file @
ef63002f
...
...
@@ -146,8 +146,8 @@ typedef enum {
}
mtp_additional_property
;
/** This enum names the different kinds of symbolic Constants represented by
* SymConst. The content of the attribute
type_or_id
depends on this tag.
Use
* the proper access routine after testing this flag. */
* SymConst. The content of the attribute
symconst_symbol
depends on this tag.
*
Use
the proper access routine after testing this flag. */
typedef
enum
symconst_kind
{
symconst_type_tag
,
/**< The SymConst is a type tag for the given type.
symconst_symbol is type *. */
...
...
@@ -155,9 +155,6 @@ typedef enum symconst_kind {
symconst_symbol is type *. */
symconst_type_align
,
/**< The SymConst is the alignment of the given type.
symconst_symbol is type *. */
symconst_addr_name
,
/**< The SymConst is a symbolic pointer to be filled in
by the linker. The pointer is represented by a string.
symconst_symbol is ident *. */
symconst_addr_ent
,
/**< The SymConst is a symbolic pointer to be filled in
by the linker. The pointer is represented by an entity.
symconst_symbol is entity *. */
...
...
@@ -173,7 +170,6 @@ typedef enum symconst_kind {
*/
typedef
union
symconst_symbol
{
ir_type
*
type_p
;
/**< The type of a SymConst. */
ident
*
ident_p
;
/**< The ident of a SymConst. */
ir_entity
*
entity_p
;
/**< The entity of a SymConst. */
ir_enum_const
*
enum_p
;
/**< The enumeration constant of a SymConst. */
}
symconst_symbol
;
...
...
include/libfirm/ircons.h
View file @
ef63002f
...
...
@@ -543,24 +543,12 @@
* symconst_type_tag The symbolic constant represents a type tag.
* symconst_type_size The symbolic constant represents the size of a type.
* symconst_type_align The symbolic constant represents the alignment of a type.
* symconst_addr_name Information for the linker, e.g. the name of a global
* variable.
* symconst_addr_ent The symbolic constant represents the address of an entity.
* symconst_ofs_ent The symbolic constant represents the offset of an
* entity in its owner type.
* symconst_enum_const The symbolic constant is a enumeration constant of an
* enumeration type.
*
* To represent a pointer to an entity that is represented by an entity
* datastructure don't use
* sym.ident_p = get_entity_ld_ident(ent);
* new_SymConst(mode_P, sym, symconst_addr_name);.
* Use a real const instead:
* sym.entity_p = ent;
* new_SymConst(mode_P, sym, symconst_addr_ent);
* This makes the constant independent of name changes of the entity due to
* mangling.
*
* Parameters
* mode P for SymConsts representing addresses, Iu otherwise.
* value The type, ident, entity or enum constant, depending on the
...
...
@@ -577,7 +565,6 @@
* -symconst_type_tag
* -symconst_type_size
* -symconst_type_align
* -symconst_addr_name
* -symconst_addr_ent
*
* If the attr.i.num is symconst_type_tag, symconst_type_size or symconst_type_align,
...
...
@@ -1316,9 +1303,6 @@ ir_node *new_rd_Const_long(dbg_info *db, ir_graph *irg,
* - symconst_type_align The symbolic constant represents the alignment of a
* type. The type of which the constant represents the
* size is given explicitly.
* - symconst_addr_name The symbolic constant represents the address of an
* entity (variable or method). The variable is
* indicated by a name that is valid for linking.
* - symconst_addr_ent The symbolic constant represents the address of an
* entity (variable or method). The variable is given
* explicitly by a firm entity.
...
...
@@ -1371,15 +1355,6 @@ ir_node *new_rd_SymConst_addr_ent(dbg_info *db, ir_graph *irg, ir_mode *mode,
ir_node
*
new_rd_SymConst_ofs_ent
(
dbg_info
*
db
,
ir_graph
*
irg
,
ir_mode
*
mode
,
ir_entity
*
symbol
,
ir_type
*
tp
);
/** Constructor for a SymConst addr_name node.
*
* Same as new_rd_SymConst_type, except that the constructor is tailored for
* symconst_addr_name.
* Adds the SymConst to the start block of irg.
*/
ir_node
*
new_rd_SymConst_addr_name
(
dbg_info
*
db
,
ir_graph
*
irg
,
ir_mode
*
mode
,
ident
*
symbol
,
ir_type
*
tp
);
/** Constructor for a SymConst type_tag node.
*
* Same as new_rd_SymConst_type, except that the constructor is tailored for
...
...
@@ -2184,9 +2159,6 @@ ir_node *new_r_Const_type(ir_graph *irg, tarval *con, ir_type *tp);
* - symconst_type_align The symbolic constant represents the alignment of a
* type. The type of which the constant represents the
* size is given explicitly.
* - symconst_addr_name The symbolic constant represents the address of an
* entity (variable or method). The variable is
* indicated by a name that is valid for linking.
* - symconst_addr_ent The symbolic constant represents the address of an
* entity (variable or method). The variable is given
* explicitly by a firm entity.
...
...
@@ -2959,9 +2931,6 @@ ir_node *new_d_Const(dbg_info *db, tarval *con);
* - symconst_type_align The symbolic constant represents the alignment of a
* type. The type of which the constant represents the
* size is given explicitly.
* - symconst_addr_name The symbolic constant represents the address of an
* entity (variable or method). The variable is
* indicated by a name that is valid for linking.
* - symconst_addr_ent The symbolic constant represents the address of an
* entity (variable or method). The variable is given
* explicitly by a firm entity.
...
...
@@ -3772,9 +3741,6 @@ ir_node *new_Const_type(tarval *con, ir_type *tp);
* - symconst_type_align The symbolic constant represents the alignment of a
* type. The type of which the constant represents the
* size is given explicitly.
* - symconst_addr_name The symbolic constant represents the address of an
* entity (variable or method). The variable is
* indicated by a name that is valid for linking.
* - symconst_addr_ent The symbolic constant represents the address of an
* entity (variable or method). The variable is given
* explicitly by a firm entity.
...
...
@@ -3811,9 +3777,6 @@ ir_node *new_SymConst_type(ir_mode *mode, union symconst_symbol value, symconst_
* - symconst_type_align The symbolic constant represents the alignment of a
* type. The type of which the constant represents the
* size is given explicitly.
* - symconst_addr_name The symbolic constant represents the address of an
* entity (variable or method). The variable is
* indicated by a name that is valid for linking.
* - symconst_addr_ent The symbolic constant represents the address of an
* entity (variable or method). The variable is given
* explicitly by a firm entity.
...
...
include/libfirm/irnode.h
View file @
ef63002f
...
...
@@ -499,9 +499,6 @@ void set_Const_type(ir_node *node, ir_type *tp);
/** Returns non-zero if s symconst kind has a type attribute */
#define SYMCONST_HAS_TYPE(kind) ((kind) <= symconst_type_align)
/** Returns non-zero if s symconst kind has an ident attribute */
#define SYMCONST_HAS_ID(kind) ((kind) == symconst_addr_name)
/** Returns non-zero if s symconst kind has an entity attribute */
#define SYMCONST_HAS_ENT(kind) ((kind) == symconst_addr_ent || (kind) == symconst_ofs_ent)
...
...
@@ -517,10 +514,6 @@ void set_SymConst_kind(ir_node *node, symconst_kind num);
ir_type
*
get_SymConst_type
(
const
ir_node
*
node
);
void
set_SymConst_type
(
ir_node
*
node
,
ir_type
*
tp
);
/** Only to access SymConst of kind addr_name. Else assertion: */
ident
*
get_SymConst_name
(
const
ir_node
*
node
);
void
set_SymConst_name
(
ir_node
*
node
,
ident
*
name
);
/** Only to access SymConst of kind addr_ent. Else assertion: */
ir_entity
*
get_SymConst_entity
(
const
ir_node
*
node
);
void
set_SymConst_entity
(
ir_node
*
node
,
ir_entity
*
ent
);
...
...
include/libfirm/old_fctnames.h
View file @
ef63002f
...
...
@@ -47,13 +47,10 @@
/* irnode.h */
#define get_Return_n_res get_Return_n_ress
#define get_Sel_n_index get_Sel_n_indexs
#define get_SymConst_ptrinfo get_SymConst_name
#define set_SymConst_ptrinfo set_SymConst_name
#define type_tag symconst_type_tag
/* don't do this -- too many use this name elswhere */
/* #define size symconst_type_size */
#define symconst_size symconst_type_size
#define linkage_ptr_info symconst_addr_name
#define get_nodes_Block(X) get_nodes_block(X)
#define set_nodes_Block(X, Y) set_nodes_block(X, Y)
...
...
ir/ana/cgana.c
View file @
ef63002f
...
...
@@ -163,8 +163,8 @@ static ir_entity ** get_impl_methods(ir_entity * method)
*/
static
void
sel_methods_walker
(
ir_node
*
node
,
void
*
env
)
{
pmap
*
ldname_map
=
env
;
ir_entity
**
arr
;
(
void
)
env
;
/* Call standard optimizations */
if
(
is_Sel
(
node
))
{
...
...
@@ -175,16 +175,7 @@ static void sel_methods_walker(ir_node *node, void *env)
}
}
/* replace SymConst(name)-operations by SymConst(ent) */
if
(
is_SymConst
(
node
))
{
if
(
get_SymConst_kind
(
node
)
==
symconst_addr_name
)
{
pmap_entry
*
entry
=
pmap_find
(
ldname_map
,
get_SymConst_name
(
node
));
if
(
entry
!=
NULL
)
{
/* Method is declared in the compiled code */
assert
(
!
"There should not be a SymConst[addr_name] addressing a method with an implementation"
"in this compilation unit. Use a SymConst[addr_ent]."
);
}
}
}
else
if
(
is_Sel
(
node
)
&&
is_Method_type
(
get_entity_type
(
get_Sel_entity
(
node
))))
{
if
(
is_Sel
(
node
)
&&
is_Method_type
(
get_entity_type
(
get_Sel_entity
(
node
))))
{
ir_entity
*
ent
=
get_SymConst_entity
(
get_atomic_ent_value
(
get_Sel_entity
(
node
)));
if
(
!
eset_contains
(
entities
,
ent
))
{
...
...
@@ -250,7 +241,7 @@ static void sel_methods_init(void)
}
}
all_irg_walk
(
sel_methods_walker
,
NULL
,
ldname_map
);
all_irg_walk
(
sel_methods_walker
,
NULL
,
NULL
);
pmap_destroy
(
ldname_map
);
}
...
...
@@ -672,17 +663,14 @@ static void callee_ana_node(ir_node *node, eset *methods)
call and ignore it completely. */
eset_insert
(
methods
,
unknown_entity
);
/* free method -> unknown */
break
;
case
iro_SymConst
:
if
(
get_SymConst_kind
(
node
)
==
symconst_addr_ent
)
{
ir_entity
*
ent
=
get_SymConst_entity
(
node
);
assert
(
ent
&&
is_method_entity
(
ent
));
eset_insert
(
methods
,
ent
);
}
else
{
assert
(
get_SymConst_kind
(
node
)
==
symconst_addr_name
);
/* external method (because fix_symconst()!) */
eset_insert
(
methods
,
unknown_entity
);
/* free method -> unknown */
}
case
iro_SymConst
:
{
ir_entity
*
ent
=
get_SymConst_entity
(
node
);
assert
(
ent
&&
is_method_entity
(
ent
));
eset_insert
(
methods
,
ent
);
break
;
}
case
iro_Sel
:
/* polymorphic method */
for
(
i
=
get_Sel_n_methods
(
node
)
-
1
;
i
>=
0
;
--
i
)
{
...
...
ir/ana/rta.c
View file @
ef63002f
...
...
@@ -157,11 +157,6 @@ static void rta_act(ir_node *node, void *env)
}
else
{
/* it's an external allocated thing. */
}
}
else
if
(
get_SymConst_kind
(
ptr
)
==
symconst_addr_name
)
{
/* Entities of kind addr_name may not be allocated in this compilation unit.
If so, the frontend built faulty Firm. So just ignore. */
/* if (get_SymConst_name(ptr) != new_id_from_str("iro_Catch"))
assert(ent && "couldn't determine entity of call to SymConst of kind addr_name."); */
}
else
{
/* other symconst. */
panic
(
"This SymConst can not be an address for a method call."
);
...
...
ir/be/begnuas.c
View file @
ef63002f
...
...
@@ -664,10 +664,6 @@ static void do_emit_atomic_init(be_gas_decl_env_t *env, ir_node *init)
case
iro_SymConst
:
switch
(
get_SymConst_kind
(
init
))
{
case
symconst_addr_name
:
be_emit_ident
(
get_SymConst_name
(
init
));
break
;
case
symconst_addr_ent
:
ent
=
get_SymConst_entity
(
init
);
be_gas_emit_entity
(
ent
);
...
...
ir/be/mips/mips_emitter.c
View file @
ef63002f
...
...
@@ -145,9 +145,6 @@ static const char *get_symconst_str(ir_node *node)
ident *id;
switch (get_SymConst_kind(node)) {
case symconst_addr_name:
id = get_SymConst_name(node);
return get_id_str(id);
case symconst_addr_ent:
id = get_entity_ident(get_SymConst_entity(node));
return get_id_str(id);
...
...
ir/ir/ircons.c
View file @
ef63002f
...
...
@@ -499,13 +499,6 @@ ir_node *new_rd_SymConst_ofs_ent(dbg_info *db, ir_graph *irg, ir_mode *mode, ir_
return
new_rd_SymConst_type
(
db
,
irg
,
mode
,
sym
,
symconst_ofs_ent
,
tp
);
}
/* new_rd_SymConst_ofs_ent */
ir_node
*
new_rd_SymConst_addr_name
(
dbg_info
*
db
,
ir_graph
*
irg
,
ir_mode
*
mode
,
ident
*
symbol
,
ir_type
*
tp
)
{
symconst_symbol
sym
;
sym
.
ident_p
=
symbol
;
return
new_rd_SymConst_type
(
db
,
irg
,
mode
,
sym
,
symconst_addr_name
,
tp
);
}
/* new_rd_SymConst_addr_name */
ir_node
*
new_rd_SymConst_type_tag
(
dbg_info
*
db
,
ir_graph
*
irg
,
ir_mode
*
mode
,
ir_type
*
symbol
,
ir_type
*
tp
)
{
symconst_symbol
sym
;
...
...
ir/ir/irdump.c
View file @
ef63002f
...
...
@@ -783,10 +783,6 @@ int dump_node_opcode(FILE *F, ir_node *n)
switch
(
get_irn_opcode
(
n
))
{
case
iro_SymConst
:
switch
(
get_SymConst_kind
(
n
))
{
case
symconst_addr_name
:
/* don't use get_SymConst_ptr_info as it mangles the name. */
fprintf
(
F
,
"SymC %s"
,
get_id_str
(
get_SymConst_name
(
n
)));
break
;
case
symconst_addr_ent
:
fprintf
(
F
,
"SymC &%s"
,
get_entity_name
(
get_SymConst_entity
(
n
)));
break
;
...
...
ir/ir/irdumptxt.c
View file @
ef63002f
...
...
@@ -317,10 +317,6 @@ int dump_irnode_to_file(FILE *F, ir_node *n)
}
break
;
case
iro_SymConst
:
{
switch
(
get_SymConst_kind
(
n
))
{
case
symconst_addr_name
:
fprintf
(
F
,
" kind: addr_name
\n
"
);
fprintf
(
F
,
" name: %s
\n
"
,
get_id_str
(
get_SymConst_name
(
n
)));
break
;
case
symconst_addr_ent
:
fprintf
(
F
,
" kind: addr_ent
\n
"
);
fprintf
(
F
,
" entity: "
);
...
...
ir/ir/irnode.c
View file @
ef63002f
...
...
@@ -1270,18 +1270,6 @@ void set_SymConst_type(ir_node *node, ir_type *tp)
node
->
attr
.
symc
.
sym
.
type_p
=
tp
;
}
ident
*
get_SymConst_name
(
const
ir_node
*
node
)
{
assert
(
is_SymConst
(
node
)
&&
SYMCONST_HAS_ID
(
get_SymConst_kind
(
node
)));
return
node
->
attr
.
symc
.
sym
.
ident_p
;
}
void
set_SymConst_name
(
ir_node
*
node
,
ident
*
name
)
{
assert
(
is_SymConst
(
node
)
&&
SYMCONST_HAS_ID
(
get_SymConst_kind
(
node
)));
node
->
attr
.
symc
.
sym
.
ident_p
=
name
;
}
/* Only to access SymConst of kind symconst_addr_ent. Else assertion: */
ir_entity
*
get_SymConst_entity
(
const
ir_node
*
node
)
...
...
ir/lower/lower_hl.c
View file @
ef63002f
...
...
@@ -277,9 +277,6 @@ static void lower_symconst(ir_node *symc)
hook_lower
(
symc
);
exchange
(
symc
,
newn
);
break
;
case
symconst_addr_name
:
/* do not rewrite - pass info to back end */
break
;
case
symconst_addr_ent
:
/* leave */
break
;
...
...
ir/opt/combo.c
View file @
ef63002f
...
...
@@ -2103,7 +2103,6 @@ static void compute_SymConst(node_t *node)
}
switch
(
get_SymConst_kind
(
irn
))
{
case
symconst_addr_ent
:
/* case symconst_addr_name: cannot handle this yet */
node
->
type
.
sym
=
get_SymConst_symbol
(
irn
);
break
;
default:
...
...
win32/firmEvaluator/firm.c
View file @
ef63002f
...
...
@@ -531,12 +531,6 @@ static HRESULT format_node(DEBUGHELPER *pHelper, int nBase, const void *addr, ch
return
E_FAIL
;
_tcsncat
(
pResult
,
name
,
max
);
break
;
case
symconst_addr_name
:
_tcsncat
(
pResult
,
"NAME:"
,
max
);
if
(
format_ident
(
pHelper
,
n
.
attr
.
symc
.
sym
.
ident_p
,
name
,
sizeof
(
name
))
!=
S_OK
)
return
E_FAIL
;
_tcsncat
(
pResult
,
name
,
max
);
break
;
case
symconst_addr_ent
:
_tcsncat
(
pResult
,
"ENT:"
,
max
);
if
(
format_entity
(
pHelper
,
nBase
,
n
.
attr
.
symc
.
sym
.
entity_p
,
name
,
sizeof
(
name
),
0
)
!=
S_OK
)
...
...
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