X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fana2%2Ftypalise.c;h=a2c9503b4dac017c7b33edb263c1fbd4f30b0a1f;hb=2c823d91e2d5ec5d434d1f6d730892b26e8f27fd;hp=30cc87368a1b21c24544002b1d782f8ce80575d3;hpb=41b022e5d3a77bd3743f6a7b4444b13179dbd2e0;p=libfirm diff --git a/ir/ana2/typalise.c b/ir/ana2/typalise.c index 30cc87368..a2c9503b4 100644 --- a/ir/ana2/typalise.c +++ b/ir/ana2/typalise.c @@ -25,6 +25,7 @@ # endif /* not defined TRUE */ # include +# include # include "irnode.h" # include "irgwalk.h" @@ -331,7 +332,7 @@ static typalise_t *ta_join (typalise_t *one, typalise_t *two) # ifdef SHUT_UP_GCC static const char *ta_name (typalise_t *ta) { - /* # define BUF_SIZE 1024 */ +# define BUF_SIZE 1024 static char buf [BUF_SIZE]; int len = sprintf (buf, "[%d] ", ta->id); @@ -462,23 +463,29 @@ static typalise_t *typalise_proj (ir_node *proj) proj_in = get_Proj_pred (proj_in); if (iro_Start == get_irn_opcode (proj_in)) { + ir_graph *graph = get_irn_irg (proj); + entity *meth = get_irg_entity (graph); + long n = get_Proj_proj (proj); + if (1 == n) { /* yay proj this */ - ir_graph *graph = get_irn_irg (proj); - entity *meth = get_irg_entity (graph); type *tp = get_entity_owner (meth); /* res = ta_exact (tp); */ res = ta_type (tp); /* TODO */ } else { /* ugh proj arg */ - /* hey, even 'filtering' this NULL by the select of the actual - call is probably as "precise" as anything: */ - return (NULL); + type *tp = get_method_param_type (get_entity_type (meth), n); + if (is_pointer_type (tp)) { + tp = get_pointer_points_to_type (tp); + } + + res = ta_type (tp); } } else if (iro_Call == get_irn_opcode (proj_in)) { /* call result ... 'whatever' */ + /* hey, this is redundant (or the check for iro_Call further down) */ ir_node *call_ptr = get_Call_ptr (proj_in); res = typalise (call_ptr); @@ -575,7 +582,6 @@ typalise_t *typalise (ir_node *node) } break; case (iro_Load): { - /* presumably it's call (load (ptr)) we're analyzing. */ ir_node *load_ptr = get_Load_ptr (node); res = typalise (load_ptr); @@ -698,6 +704,9 @@ typalise_t *typalise (ir_node *node) /* $Log$ + Revision 1.2 2004/10/22 09:53:10 liekweg + Correctly handle proj_args + Revision 1.1 2004/10/21 11:09:37 liekweg Moved memwalk stuf into irmemwalk Moved lset stuff into lset