X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fana%2Firtypeinfo.h;h=47c8e8022b4b14845e0c55b4bc6677c95656ef96;hb=83909ad3889884e223dcab09fddc3c77410ac15c;hp=6a5b87fb4e3a011ee2a12f887042a7791ff8b102;hpb=a763f0583a07c4be377c0f1b9908dc166dce835b;p=libfirm diff --git a/ir/ana/irtypeinfo.h b/ir/ana/irtypeinfo.h index 6a5b87fb4..47c8e8022 100644 --- a/ir/ana/irtypeinfo.h +++ b/ir/ana/irtypeinfo.h @@ -19,14 +19,10 @@ * graph is valid. Further it defines an auxiliary type "init_type". * */ +#ifndef _IRTYPEINFO_H_ +#define _IRTYPEINFO_H_ - -# ifndef _IRTYPEINFO_H_ -# define _IRTYPEINFO_H_ - -# include "irgraph.h" -# include "irnode.h" -# include "type.h" +#include "firm_types.h" /* ------------ Auxiliary type. --------------------------------------- */ @@ -36,7 +32,7 @@ * variable is set by init_irtypeinfo. The type is freed by * free_irtypeinfo. */ -extern type *initial_type; +extern ir_type *initial_type; @@ -54,32 +50,45 @@ void free_irtypeinfo(void); /* ------------ Irgraph state handling. ------------------------------- */ +/* +#define irg_typeinfo_none ir_typeinfo_none +#define irg_typeinfo_consistent ir_typeinfo_consistent +#define irg_typeinfo_inconsistent ir_typeinfo_inconsistent +#define irg_typeinfo_state ir_typeinfo_state +*/ + typedef enum { - irg_typeinfo_none, /**< No typeinfo computed, calls to set/get_irn_type + ir_typeinfo_none, /**< No typeinfo computed, calls to set/get_irn_type are invalid. */ - irg_typeinfo_consistent, /**< Type info valid, calls to set/get_irn_type return + ir_typeinfo_consistent, /**< Type info valid, calls to set/get_irn_type return the proper type. */ - irg_typeinfo_inconsistent /**< Type info can be accessed, but it can be invalid + ir_typeinfo_inconsistent /**< Type info can be accessed, but it can be invalid because of other transformations. */ -} irg_typeinfo_state; +} ir_typeinfo_state; -void set_irg_typeinfo_state(ir_graph *irg, irg_typeinfo_state s); -irg_typeinfo_state get_irg_typeinfo_state(ir_graph *irg); +void set_irg_typeinfo_state(ir_graph *irg, ir_typeinfo_state s); +ir_typeinfo_state get_irg_typeinfo_state(ir_graph *irg); + +/** Returns accumulated type information state information. + * + * Returns ir_typeinfo_consistent if the type information of all irgs is + * consistent. Returns ir_typeinfo_inconsistent if at least one irg has inconsistent + * or no type information. Returns ir_typeinfo_none if no irg contains type information. + */ +ir_typeinfo_state get_irp_typeinfo_state(void); +void set_irp_typeinfo_state(ir_typeinfo_state s); +/** If typeinfo is consistent, sets it to inconsistent. */ +void set_irp_typeinfo_inconsistent(void); /* ------------ Irnode type information. ------------------------------ */ /** Accessing the type information. * * These routines only work properly if the ir_graph is in state - * irg_typeinfo_consistent or irg_typeinfo_inconsistent. They + * ir_typeinfo_consistent or ir_typeinfo_inconsistent. They * assume current_ir_graph set properly. */ -type *get_irn_typeinfo_type(ir_node *n); -void set_irn_typeinfo_type(ir_node *n, type *tp); - -/** Return the type associated with the value produced by n - * if the node remarks this type as it is the case for - * Cast, Const, SymConst and some Proj nodes. */ -type *get_irn_type(ir_node *n); +ir_type *get_irn_typeinfo_type(ir_node *n); +void set_irn_typeinfo_type(ir_node *n, ir_type *tp); #endif /* _IRTYPEINFO_H_ */