X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fana%2Fcgana.h;h=fcfbe0a1da8e9b93b22ae374518248c820d87fef;hb=05c0043facd79786feecb7c3b756c4e95628908c;hp=381af6a647b015d59b157ab6457cebaf1e0f2e6f;hpb=28b91a0b173f4e882681ef4269c4c3520a1d17c7;p=libfirm diff --git a/ir/ana/cgana.h b/ir/ana/cgana.h index 381af6a64..fcfbe0a1d 100644 --- a/ir/ana/cgana.h +++ b/ir/ana/cgana.h @@ -34,20 +34,22 @@ * * Die main-Methode ist immer in der Menge enthalten. * - * Die Links an den "ir_node"s werden geloescht. */ + * Die Links an den "ir_node"s werden geloescht. + */ /** Analyses a rough estimation of the possible call graph. * * Determines for each Call node the set of possibly called methods. * Stores the result in the field 'callees' of the Call node. If the * address can not be analysed, e.g. because it is loaded from a - * variable, the array contains NULL. @@@ the array should contain a - * special entity 'unknown'. (See "set_Call_callee"). cgana returns - * the set of 'free' methods, i.e., the methods that can be called - * from external or via function pointers. This datastructure must - * be freed with 'free()' by the caller of cgana. + * variable, the array contains the unknown_entity. (See + * "set_Call_callee"). cgana returns the set of 'free' methods, i.e., + * the methods that can be called from external or via function + * pointers. This datastructure must be freed with 'free()' by the + * caller of cgana. * - * cgana sets the callee_info_state of each graph to consistent. + * cgana sets the callee_info_state of each graph and the program to + * consistent. * * The algorithm implements roughly Static Class Hierarchy Analysis * as described in "Optimization of Object-Oriented Programs Using @@ -55,27 +57,30 @@ * 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. + * - 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. * - * Sets callee_info_state of the graph passed to none. + * Sets callee_info_state of the graph passed to none. Sets callee field + * in all call nodes to NULL. Else it happens that the field contains + * pointers to other than firm arrays. */ void free_callee_info(ir_graph *irg); +void free_irp_callee_info(void); /* Optimize the address expressions passed to call nodes. * Performs only the optimizations done by cgana. */ -/* @@@ move to irgopt ?! */ -/* @@@ not fully implemented as buggy !!! */ void opt_call_addrs(void); + + #endif /* _CGANA_H_ */