- for ( i = get_Call_n_params(irn) - 1; i >= 0; i--) {
- param = get_Call_param(irn, i);
- if(get_irn_op(param) == op_Sel) {
-
- key_sels.sel = param;
- value_sels = set_find(env->set_sels, &key_sels, sizeof(key_sels), HASH_PTR(key_sels.sel));
- if(value_sels != NULL ) {
- /* We have found a call, that have as parameter a sel from our set_sels.*/
- call_ptr = get_Call_ptr(irn);
- op = get_irn_op(call_ptr);
-
- if(op == op_SymConst && get_SymConst_kind(call_ptr) == symconst_addr_ent)
- meth_ent = get_SymConst_entity(call_ptr);
- else
- continue;
- /* we get the access type for our sel.*/
- acces_type = get_method_param_access(meth_ent, i);
- /* we save the access type and this call in the array allocated for this block.
- * The value number of this entity get us the position in the array to save this
- * information. Why we expect more calls as one we allocate a set.*/
- vnum = GET_ENT_VNUM(value_sels->ent);
- blk = get_nodes_block(irn);
- val_arr = get_irn_link(blk);
-
- if(val_arr[vnum].access_type > 3)
- /* The address of this entity have been stored.*/
- continue;
-
- if(val_arr[vnum].calls == NULL)
- /* for this entity i have found the firs call in this block and we must allocate the set.*/
- val_arr[vnum].calls = new_set(call_cmp, 8);
-
- /* This call performs anything with the scalar and we must mark it.*/
- key_call.call = irn;
- key_call.access_type = acces_type;
- value_call = set_insert(val_arr[vnum].calls, &key_call, sizeof(key_call), HASH_PTR(key_call.call));
-
- if(value_call->access_type < acces_type)
- /* this case tread, when a call access an entity more at once.
- * Than we must save the highest access type.*/
- value_call->access_type = acces_type;
-
- if(acces_type > 3) {
- /* This call save the address of our scalar and we can't
- * use the scalars of this entity for optimization as from now.
- * we mark this.*/
- val_arr[vnum].access_type = acces_type;
- /* We must update our scalars number.*/
- key_ent.ent = value_sels->ent;
- value_ent = set_find(env->set_ent, &key_ent, sizeof(key_ent), HASH_PTR(key_ent.ent));
- }
- }
- }
+ /* We iterate over the parameters of this call nodes.*/
+ for ( i = get_Call_n_params(irn) - 1; i >= 0; i--) {
+ param = get_Call_param(irn, i);
+ if (is_Sel(param)) {
+ /* We have found a parameter with operation sel.*/
+ key_sels.sel = param;
+ value_sels = set_find(env->set_sels, &key_sels, sizeof(key_sels), HASH_PTR(key_sels.sel));
+ if(value_sels != NULL ) {
+
+ /* We have found a call, that have as parameter a sel from our set_sels.*/
+ call_ptr = get_Call_ptr(irn);
+
+ if (is_SymConst(call_ptr) && get_SymConst_kind(call_ptr) == symconst_addr_ent) {
+ meth_ent = get_SymConst_entity(call_ptr);
+ /* we get the access type for our sel.*/
+ acces_type = get_method_param_access(meth_ent, i);
+ } else
+ /* We can't analyze this function and we asume, that it store the address.*/
+ acces_type = ptr_access_store;
+
+ /* we save the access type and this call in the array allocated for this block.
+ * The value number of this entity get us the position in the array to save this
+ * information. Why we expect more calls as one we allocate a set.*/
+ vnum = GET_ENT_VNUM(value_sels->ent);
+ blk = get_nodes_block(irn);
+ val_arr = get_irn_link(blk);
+
+ if(val_arr[vnum].access_type > 3)
+ /* The address of this entity have been stored.*/
+ continue;
+
+ if(val_arr[vnum].calls == NULL)
+ /* for this entity i have found the firs call in this block and we must allocate the set.*/
+ val_arr[vnum].calls = new_set(call_cmp, 8);
+
+ /* This call performs anything with the scalar and we must mark it.*/
+ key_call.call = irn;
+ key_call.access_type = acces_type;
+ value_call = set_insert(val_arr[vnum].calls, &key_call, sizeof(key_call), HASH_PTR(key_call.call));
+
+ if(value_call->access_type < acces_type)
+ /* this case tread, when a call access an entity more at once.
+ * Than we must save the highest access type.*/
+ value_call->access_type = acces_type;
+
+ if(acces_type > 3)
+ /* This call save the address of our scalar and we can't
+ * use the scalars of this entity for optimization as from now.
+ * we mark this.*/
+ val_arr[vnum].access_type = acces_type;
+ }