bb_info (unsigned int index)
{
  if (index < df_rd->block_info_size)
    return &((class df_rd_bb_info *) df_rd->block_info)[index];
  else
    return NULL;
}

inline class df_lr_bb_info *
df_lr_get_bb_info (unsigned int index)
{
  if (index < df_lr->block_info_size)
    return &((class df_lr_bb_info *) df_lr->block_info)[index];
  else
    return NULL;
}

inline class df_md_bb_info *
df_md_get_bb_info (unsigned int index)
{
  if (index < df_md->block_info_size)
    return &((class df_md_bb_info *) df_md->block_info)[index];
  else
    return NULL;
}

inline class df_live_bb_info *
df_live_get_bb_info (unsigned int index)
{
  if (index < df_live->block_info_size)
    return &((class df_live_bb_info *) df_live->block_info)[index];
  else
    return NULL;
}

inline class df_word_lr_bb_info *
df_word_lr_get_bb_info (unsigned int index)
{
  if (index < df_word_lr->block_info_size)
    return &((class df_word_lr_bb_info *) df_word_lr->block_info)[index];
  else
    return NULL;
}

inline class df_mir_bb_info *
df_mir_get_bb_info (unsigned int index)
{
  if (index < df_mir->block_info_size)
    return &((class df_mir_bb_info *) df_mir->block_info)[index];
  else
    return NULL;
}

/* Get the live at out set for BB no matter what problem happens to be
   defined.  This function is used by the register allocators who
   choose different dataflow problems depending on the optimization
   level.  */

inline bitmap
df_get_live_out (basic_block bb)
{
  gcc_checking_assert (df_lr);

  if (df_live)
    return DF_LIVE_OUT (bb);
  else
    return DF_LR_OUT (bb);
}

/* Get the live at in set for BB no matter what problem happens to be
   defined.  This function is used by the register allocators who
   choose different dataflow problems depending on the optimization
   level.  */

inline bitmap
df_get_live_in (basic_block bb)
{
  gcc_checking_assert (df_lr);

  if (df_live)
    return DF_LIVE_IN (bb);
  else
    return DF_LR_IN (bb);
}

/* Get basic block info.  */
/* Get the artificial defs for a basic block.  */

inline df_ref
df_get_artificial_defs (unsigned int bb_index)
{
  return df_scan_get_bb_info (bb_index)->artificial_defs;
}


/* Get the artificial uses for a basic block.  */

inline df_ref
df_get_artificial_uses (unsigned int bb_index)
{
  return df_scan_get_bb_info (bb_index)->artificial_uses;
}

/* If INSN defines exactly one register, return the associated reference,
   otherwise return null.  */

inline df_ref
df_single_def (const df_insn_info *info)
{
  df_ref defs = DF_INSN_INFO_DEFS (info);
  return defs && !DF_REF_NEXT_LOC (defs) ? defs : NULL;
}

/* If INSN uses exactly one register, return the associated reference,
   otherwise return null.  */

inline df_ref
df_single_use (const df_insn_info *info)
{
  df_ref uses = DF_INSN_INFO_USES (info);
  return uses && !DF_REF_NEXT_LOC (uses) ? uses : NULL;
}

/* web */

struct web_entry_base
{
 private:
  /* Reference to the parent in the union/find tree.  */
  web_entry_base *pred_pvt;

 public:
  /* Accessors.  */
  web_entry_base *pred () { return pred_pvt; }
  void set_pred (web_entry_base *p) { pred_pvt = p; }

  /* Find representative in union-find tree.  */
  web_entry_base *unionfind_root ();

  /* Union with another set, returning TRUE if they are already unioned.  */
  friend bool unionfind_union (web_entry_base *first, web_entry_base *second);
};

#endif /* GCC_DF_H */
