X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=include%2Flibfirm%2Fcgana.h;h=98479ef5d8a0ee15955de034df1543036deef61e;hb=97bcf6f245eba55a1d3b25a7be543b367ab9c276;hp=d784be6288dc348a9b58fed1e53c7e5204e6bd02;hpb=1ec30d95387eb392ba5a1adc7958ebd91383d59c;p=libfirm diff --git a/include/libfirm/cgana.h b/include/libfirm/cgana.h index d784be628..98479ef5d 100644 --- a/include/libfirm/cgana.h +++ b/include/libfirm/cgana.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -22,9 +22,7 @@ * @brief Intraprozedural analyses to estimate the call graph. * @author Hubert Schmid * @date 09.06.2002 - * @version $Id$ - * @summary - * @summary + * @brief * Interprocedural analysis to estimate the calling relation. * * This analysis computes all entities representing methods that @@ -36,20 +34,10 @@ #define FIRM_ANA_CGANA_H #include "firm_types.h" +#include "begin.h" -/* Methoden sind "frei", wenn ihr Funktionszeiger (potentiell) - * "explizit" bekannt ist, d.h.: - * - * - die Methode ist von aussen sichtbar (external_visible). - * - * - ihr Funktionszeiger ist "frei", d.h. der Funktionszeiger wurde - * nicht ausschliesslich an den entsprechenden Eingang eines - * Call-Knotens weitergegeben, sondern z.B. in den Speicher - * geschrieben, als Parameter uebergeben, ... - * - * Die main-Methode ist immer in der Menge enthalten. - * - * Die Links an den "ir_node"s werden geloescht. +/** @addtogroup callgraph + * @{ */ /** Analyses a rough estimation of the possible call graph. @@ -58,12 +46,12 @@ * 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 the unknown_entity. (See - * "set_Call_callee"). cgana returns the set of 'free' methods, i.e., + * 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. + * pointers. This datastructure must be freed with 'xfree()' by the + * caller of cgana(). * - * cgana sets the callee_info_state of each graph and the program to + * cgana() sets the callee_info_state of each graph and the program to * consistent. * * The algorithm implements roughly Static Class Hierarchy Analysis @@ -72,30 +60,31 @@ * and Craig Chambers. * * Performs some optimizations possible by the analysed information: - * - 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! + * - Replace SymConst-name nodes by SymConst-entity nodes if possible. + * - Replace (Sel-method(Alloc)) by SymConst-entity. + * - Replaces Sel-method by SymConst-entity if the method is never overwritten. */ -void cgana(int *len, ir_entity ***free_methods); +FIRM_API size_t cgana(ir_entity ***free_methods); -/** Free callee information. +/** + * Frees callee information. * - * 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. + * 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. + */ +FIRM_API void free_callee_info(ir_graph *irg); +/** Frees callee information for all graphs in the current program. */ +FIRM_API void free_irp_callee_info(void); + +/** + * Optimizes the address expressions passed to call nodes. + * Performs only the optimizations done by cgana. */ -void free_callee_info(ir_graph *irg); -void free_irp_callee_info(void); +FIRM_API void opt_call_addrs(void); -/* Optimize the address expressions passed to call nodes. - * Performs only the optimizations done by cgana. */ -void opt_call_addrs(void); +/** @} */ +#include "end.h" #endif