Commit 5c749a5e authored by Götz Lindenmaier's avatar Götz Lindenmaier
Browse files

removed whole flag:

with this flag set, external visible methods were removed, which is wrong.

[r3932]
parent abaf5686
......@@ -81,13 +81,16 @@ static entity * get_implementation(type * class, entity * method) {
static entity *get_inherited_methods_implementation(entity *inh_meth) {
entity *impl_meth = NULL;
ir_node *addr = get_atomic_ent_value(inh_meth);
assert(addr && "constant entity without value");
if ((get_irn_op(addr) == op_SymConst) &&
(get_SymConst_kind(addr) == symconst_addr_ent)) {
impl_meth = get_SymConst_entity(addr);
} else {
assert(0 && "Complex constant values not supported -- address of method should be straight constant!");
}
if (impl_meth && (get_entity_peculiarity(impl_meth) != peculiarity_existent)) {
/*
printf("this_meth: "); DDMEO(inh_meth);
......@@ -719,14 +722,13 @@ static void free_ana_walker(ir_node * node, eset * set) {
* SymConst-Operationen mssen in passende Const-Operationen
* umgewandelt worden sein, d.h. SymConst-Operationen verweisen immer
* auf eine echt externe Methode. */
static entity ** get_free_methods(int whole)
static entity ** get_free_methods(void)
{
eset * set = eset_create();
int i;
entity ** arr = NEW_ARR_F(entity *, 0);
entity * ent;
if (! whole) {
for (i = get_irp_n_irgs() - 1; i >= 0; --i) {
ir_graph * irg = get_irp_irg(i);
entity * ent = get_irg_entity(irg);
......@@ -738,7 +740,6 @@ static entity ** get_free_methods(int whole)
z.B. da die Adresse einer Methode abgespeichert wird. */
irg_walk_graph(irg, NULL, (irg_walk_func *) free_ana_walker, set);
}
}
/* insert sticky methods, too */
for (i = get_irp_n_irgs() - 1; i >= 0; --i) {
......@@ -764,12 +765,12 @@ static entity ** get_free_methods(int whole)
return arr;
}
void cgana(int *length, entity ***free_methods, int whole) {
void cgana(int *length, entity ***free_methods) {
entity ** free_meths;
int i;
sel_methods_init();
free_meths = get_free_methods(whole);
free_meths = get_free_methods();
callee_ana();
sel_methods_dispose();
......
......@@ -55,17 +55,18 @@
* and Craig Chambers.
*
* Performs some optimizations possible by the analysed information:
* - Replace SymConst nodes by Const nodes if possible,
* - Replace (Sel-method(Alloc)) by Const method,
* - Replaces Sel nodes by Bad if there is no implementation for the selected entity. (@@@ was genau meint unreachable?)
* - Replaces Sel-method by Const if the Method is never overwritten
* - Replaces Calls by Tuple containing Bads if callee array is empty (there is no implementation to call)
*
* - Replace SymConst-name nodes by SymConst-entity nodes if possible.
* - Replace (Sel-method(Alloc)) by SymConst-entity.
* - Replaces Sel nodes by Bad if there is no implementation for the
* selected entity. (@@@ was genau meint unreachable?)
* - Replaces Sel-method by SymConst-entity if the method is never overwritten.
* - Replaces Calls by Tuple containing Bads if callee array is empty
* (there is no implementation to call)
*
* Leaves Bad control predecessors in the graph!
*/
/* @@@ I assume this can not be called via JNI :-( -- how to obtain the array pointer? */
void cgana(int *len, entity ***free_methods, int whole);
void cgana(int *len, entity ***free_methods);
/** Free callee information.
*
......@@ -78,4 +79,6 @@ void free_callee_info(ir_graph *irg);
/* @@@ move to irgopt ?! */
/* @@@ not fully implemented as buggy !!! */
void opt_call_addrs(void);
#endif /* _CGANA_H_ */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment