X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fana%2Ftrouts.h;h=3fc8585bf1894010f42c0431b0ff577851f8c1d6;hb=4bad1346ff2abc3923beea23e5ac949acc7ca514;hp=4012e5c3f2d5f0c16d83c14dc529f84fd8bdbb90;hpb=5ceb18e5f9c9afa7b0ac63e2bfdda2875e8bc5df;p=libfirm diff --git a/ir/ana/trouts.h b/ir/ana/trouts.h index 4012e5c3f..3fc8585bf 100644 --- a/ir/ana/trouts.h +++ b/ir/ana/trouts.h @@ -11,22 +11,22 @@ */ /** -* @file trouts.h -* -* Trouts list all uses of types and entities. -* Each type gets a list of all Alloc nodes allocating it. -* Each entity gets two lists: -* - one containing all accesses (Load, (Call), Store), -* - and one containing all uses to get a reference (Sel, SymConst). -* -* @todo -* To list all uses of entities of a type, we also should list all -* static/automatic allocated entities in types. The Alloc nodes -* represent only the dynamic allocated entities. -* -* @author Goetz Lindenmaier -* -*/ + * @file trouts.h + * + * Trouts list all uses of types and entities. + * Each type gets a list of all Alloc nodes allocating it. + * Each entity gets two lists: + * - one containing all accesses (Load, (Call), Store), + * - and one containing all uses to get a reference (Sel, SymConst). + * + * @todo + * To list all uses of entities of a type, we also should list all + * static/automatic allocated entities in types. The Alloc nodes + * represent only the dynamic allocated entities. + * + * @author Goetz Lindenmaier + * + */ # ifndef _TROUTS_H_ # define _TROUTS_H_ @@ -57,22 +57,56 @@ int get_entity_n_references(entity *ent); ir_node *get_entity_reference(entity *ent, int pos); -/** Number of Alloc nodes that create an instance of this type */ -int get_type_n_allocations(type *tp); -/** Alloc node that create an instance of this type */ -ir_node *get_type_allocation(type *tp, int pos); +/** Number of Alloc nodes that create an instance of this type. */ +int get_type_n_allocs(type *tp); +/** Alloc node that create an instance of this type. */ +ir_node *get_type_alloc(type *tp, int pos); +/** Number of Cast nodes that cast a pointer to this type. */ +int get_type_n_casts(type *tp); +/** Cast node that cast a pointer to this type. */ +ir_node *get_type_cast(type *tp, int pos); +/** Return number of upcasts. O(#casts). */ +int get_class_n_upcasts(type *clss); +/** Return number of downcasts. O(#casts). */ +int get_class_n_downcasts(type *clss); + +/* Access all pointer types that point to tp. */ +int get_type_n_pointertypes_to(type *tp); +type *get_type_pointertype_to(type *tp, int pos); /*------------------------------------------------------------------*/ /* Building and Removing the trout datastructure */ /*------------------------------------------------------------------*/ +/** The state of the tr_out datastructure. + * + * We reuse the enum of irouts. */ +irg_outs_state get_trouts_state(void); +void set_trouts_inconsistent(void); /** Compute the outs of types and entities. * * Collects all reference from irnodes to types or entities in the - * corresponding types/entities. + * corresponding types/entities. Further reverses references between + * types and entities. + * + * Annotates the following nodes: + * Alloc --> get_Alloc_type() + * Cast --> get_Cast_type() + * Sel --> get_Sel_entity() + * SymConst --> get_SymConst_entity() + * Load(addr) --> get_addr_entity() \ ent von SymConst, oder falls Sel: ent von + * Store(addr) --> get_addr_entity() / outermost im compound. Ansonsten: nirgends. + * d.h. wir bekommen die array Elementzugriffe + * an die jack array Klasse annotiert. + * Call(Sel) --> get_Sel_entity() // ev. Tabellenzugriff --> Load. + * + * type --> pointer type refering to this type. + * type --> entity of this type. @@@ to be implemented. + * + * Sets trout state to outs_consistent. * * @todo @@@ We need a flag that signs the consistency of the out information. */ void compute_trouts(void);