/* Generic routines for manipulating PHIs
- Copyright (C) 2003, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2005, 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC.
#include "tm.h"
#include "tree.h"
#include "rtl.h"
-#include "varray.h"
#include "ggc.h"
#include "basic-block.h"
#include "tree-flow.h"
for (i = 0; i < capacity; i++)
{
use_operand_p imm;
+
+ gimple_phi_arg_set_location (phi, i, UNKNOWN_LOCATION);
imm = gimple_phi_arg_imm_use_ptr (phi, i);
imm->use = gimple_phi_arg_def_ptr (phi, i);
imm->prev = NULL;
for (i = gimple_phi_num_args (new_phi); i < len; i++)
{
use_operand_p imm;
+
+ gimple_phi_arg_set_location (new_phi, i, UNKNOWN_LOCATION);
imm = gimple_phi_arg_imm_use_ptr (new_phi, i);
imm->use = gimple_phi_arg_def_ptr (new_phi, i);
imm->prev = NULL;
/* Adds PHI to BB. */
-void
+void
add_phi_node_to_bb (gimple phi, basic_block bb)
{
gimple_stmt_iterator gsi;
PHI points to the reallocated phi node when we return. */
void
-add_phi_arg (gimple phi, tree def, edge e)
+add_phi_arg (gimple phi, tree def, edge e, source_location locus)
{
basic_block bb = e->dest;
}
SET_PHI_ARG_DEF (phi, e->dest_idx, def);
+ gimple_phi_arg_set_location (phi, e->dest_idx, locus);
}
/* Set use on new node, and link into last element's place. */
*(new_p->use) = *(old_p->use);
relink_imm_use (new_p, old_p);
+ /* Move the location as well. */
+ gimple_phi_arg_set_location (phi, i,
+ gimple_phi_arg_location (phi, num_elem - 1));
}
/* Shrink the vector and return. Note that we do not have to clear
remove_phi_node (gimple_stmt_iterator *gsi, bool release_lhs_p)
{
gimple phi = gsi_stmt (*gsi);
+
+ if (release_lhs_p)
+ insert_debug_temps_for_defs (gsi);
+
gsi_remove (gsi, false);
/* If we are deleting the PHI node, then we should release the