public static boolean defDoublesAsUse(Operand d,Instruction s){
  for (Enumeration<Operand> u=s.getUses(); u.hasMoreElements(); ) {
    Operand use=u.nextElement();
    if (use != null) {
      if (use.similar(d))       return true;
    }
  }
  return false;
}

public static boolean defDoublesAsUse ( Operand d , Instruction s ) { for ( Enumeration < Operand > u = s . getUses ( ) ; u . hasMoreElements ( ) ; ) { Operand use = u . nextElement ( ) ; if ( use != null ) { if ( use . similar ( d ) ) return true ; } } return false ; }
is the operand d , which is a def in instruction s , also a use in instruction s ? that is , is this operand defined as a du operand in instructionformatlist . dat . < p > todo ! ! : this implementation is slow . think about adding some ir support for this functionality ; possibly add methods like enumeratepuredefs ( ) , enumerateimpureuses ( ) , etc . . . , and restructure the caller to avoid having to call this function . not going to put effort into this now , as the whole scratch register architecture has a questionable future .
