X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fana%2Fcgana.h;h=3f90b4c0035f4ff0b8bc0dd1e5684e417ded0070;hb=6d3cc33efb41b34b6d392c489921855f32c9baf5;hp=8eadc3562f487f84a6b729469b76c6af7e205fea;hpb=8ec38d4da90f38a8167a9289f3b67145cfe317ea;p=libfirm diff --git a/ir/ana/cgana.h b/ir/ana/cgana.h index 8eadc3562..3f90b4c00 100644 --- a/ir/ana/cgana.h +++ b/ir/ana/cgana.h @@ -1,23 +1,29 @@ -/* ------------------------------------------------------------------- - * $Id$ - * ------------------------------------------------------------------- - * Intraprozedurale Analyse zur Abschaetzung der Aufrulrelation. Es - * wird eine Menge von freien Methoden und anschliessend die an den +/* + * Project: libFIRM + * File name: ir/ana/cgana.h + * Purpose: Intraprozedural analyses to estimate the call graph. + * Author: Hubert Schmid + * Modified by: + * Created: 09.06.2002 + * CVS-ID: $Id$ + * Copyright: (c) 1999-2003 Universität Karlsruhe + * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. + */ + +/** + * Intraprozedurale Analyse zur Abschätzung der Aufrulrelation. Es + * wird eine Menge von freien Methoden und anschließend die an den * Call-Operationen aufrufbaren Methoden bestimmt. * - * Erstellt: Hubert Schmid, 09.06.2002 - * ---------------------------------------------------------------- */ - + */ #ifndef _CGANA_H_ #define _CGANA_H_ - #include "entity.h" - /* Methoden sind "frei", wenn ihr Funktionszeiger (potentiell) - *"explizit" bekannt ist, d.h.: + * "explizit" bekannt ist, d.h.: * * - die Methode ist von aussen sichtbar (external_visible). * @@ -30,15 +36,19 @@ * * Die Links an den "ir_node"s werden geloescht. */ - - /** Analyses a rough estimation of the possible call graph. * - * Bestimmt fuer jede Call-Operation die Menge der aufrufbaren Methode - * und speichert das Ergebnis in der Call-Operation. (siehe - * "set_Call_callee"). Die Methode gibt die Menge der - * "freien" Methoden zurueck, die vom Aufrufer wieder freigegeben - * werden muss (free). + * 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. + * + * cgana sets the callee_info_state of each graph to consistent. + * * The algorithm implements roughly Static Class Hierarchy Analysis * as described in "Optimization of Object-Oriented Programs Using * Static Class Hierarchy Analysis" by Jeffrey Dean and David Grove @@ -52,6 +62,12 @@ /* @@@ I assume this can not be called via JNI :-( -- how to obtain the array pointer? */ void cgana(int *len, entity ***free_methods); +/** Free callee information. + * + * Sets callee_info_state of the graph passed to none. + */ +void free_callee_info(ir_graph *irg); + /* Optimize the address expressions passed to call nodes. * Performs only the optimizations done by cgana. */ /* @@@ move to irgopt ?! */