static inline void finalize_ssa_uses (struct function *fn, gimple *stmt) { unsigned new_i; struct use_optype_d new_list; use_optype_p old_ops, ptr, last; /* Pre-pend the VUSE we may have built. */ if (build_vuse != NULL_TREE) { tree oldvuse = gimple_vuse (stmt); if (oldvuse && TREE_CODE (oldvuse) == SSA_NAME) oldvuse = SSA_NAME_VAR (oldvuse); if (oldvuse != (build_vuse != NULL_TREE ? build_vuse : build_vdef)) gimple_set_vuse (stmt, NULL_TREE); build_uses.safe_insert (0, gimple_vuse_ptr (stmt)); } new_list.next = NULL; last = &new_list; old_ops = gimple_use_ops (stmt); /* Clear a no longer necessary VUSE. */ if (build_vuse == NULL_TREE && gimple_vuse (stmt) != NULL_TREE) gimple_set_vuse (stmt, NULL_TREE); /* If there is anything in the old list, free it. */ if (old_ops) { for (ptr = old_ops; ptr->next; ptr = ptr->next) delink_imm_use (USE_OP_PTR (ptr)); delink_imm_use (USE_OP_PTR (ptr)); ptr->next = gimple_ssa_operands (fn)->free_uses; gimple_ssa_operands (fn)->free_uses = old_ops; } /* If we added a VUSE, make sure to set the operand if it is not already present and mark it for renaming. */ if (build_vuse != NULL_TREE && gimple_vuse (stmt) == NULL_TREE) { gimple_set_vuse (stmt, gimple_vop (fn)); fn->gimple_df->rename_vops = 1; fn->gimple_df->ssa_renaming_needed = 1; } /* Now create nodes for all the new nodes. */ for (new_i = 0; new_i < build_uses.length (); new_i++) { tree *op = build_uses[new_i]; last = add_use_op (fn, stmt, op, last); } /* Now set the stmt's operands. */ gimple_set_use_ops (stmt, new_list.next); }
static inline void finalize_ssa_uses (gimple stmt) { unsigned new_i; struct use_optype_d new_list; use_optype_p old_ops, ptr, last; /* Pre-pend the VUSE we may have built. */ if (build_vuse != NULL_TREE) { tree oldvuse = gimple_vuse (stmt); if (oldvuse && TREE_CODE (oldvuse) == SSA_NAME) oldvuse = SSA_NAME_VAR (oldvuse); if (oldvuse != (build_vuse != NULL_TREE ? build_vuse : build_vdef)) gimple_set_vuse (stmt, NULL_TREE); VEC_safe_insert (tree, heap, build_uses, 0, (tree)gimple_vuse_ptr (stmt)); } new_list.next = NULL; last = &new_list; old_ops = gimple_use_ops (stmt); /* Clear a no longer necessary VUSE. */ if (build_vuse == NULL_TREE && gimple_vuse (stmt) != NULL_TREE) gimple_set_vuse (stmt, NULL_TREE); /* If there is anything in the old list, free it. */ if (old_ops) { for (ptr = old_ops; ptr; ptr = ptr->next) delink_imm_use (USE_OP_PTR (ptr)); old_ops->next = gimple_ssa_operands (cfun)->free_uses; gimple_ssa_operands (cfun)->free_uses = old_ops; } /* If we added a VUSE, make sure to set the operand if it is not already present and mark it for renaming. */ if (build_vuse != NULL_TREE && gimple_vuse (stmt) == NULL_TREE) { gimple_set_vuse (stmt, gimple_vop (cfun)); mark_sym_for_renaming (gimple_vop (cfun)); } /* Now create nodes for all the new nodes. */ for (new_i = 0; new_i < VEC_length (tree, build_uses); new_i++) last = add_use_op (stmt, (tree *) VEC_index (tree, build_uses, new_i), last); /* Now set the stmt's operands. */ gimple_set_use_ops (stmt, new_list.next); }