public boolean isDirectlyControlDependentOn(BasicBlock insBlock,Branch b){
  Set<ControlFlowEdge> incomming=incomingEdgesOf(insBlock);
  if (incomming.size() == 1) {
    for (    ControlFlowEdge e : incomming) {
      if (!e.hasControlDependency() && !e.isExceptionEdge()) {
        return isDirectlyControlDependentOn(getEdgeSource(e),b);
      }
    }
  }
  boolean isRootDependent=isRootDependent(insBlock);
  if (b == null)   return isRootDependent;
  if (isRootDependent && b != null)   return false;
  for (  ControlFlowEdge e : incomming) {
    Branch current=e.getBranchInstruction();
    if (e.isExceptionEdge()) {
      if (current != null)       throw new IllegalStateException("expect exception edges to have no BranchInstruction set");
 else       continue;
    }
    if (current == null)     continue;
    if (current.equals(b))     return true;
  }
  return false;
}

public boolean isDirectlyControlDependentOn ( BasicBlock insBlock , Branch b ) { Set < ControlFlowEdge > incomming = incomingEdgesOf ( insBlock ) ; if ( incomming . size ( ) == 1 ) { for ( ControlFlowEdge e : incomming ) { if ( ! e . hasControlDependency ( ) && ! e . isExceptionEdge ( ) ) { return isDirectlyControlDependentOn ( getEdgeSource ( e ) , b ) ; } } } boolean isRootDependent = isRootDependent ( insBlock ) ; if ( b == null ) return isRootDependent ; if ( isRootDependent && b != null ) return false ; for ( ControlFlowEdge e : incomming ) { Branch current = e . getBranchInstruction ( ) ; if ( e . isExceptionEdge ( ) ) { if ( current != null ) throw new IllegalStateException ( "expect exception edges to have no BranchInstruction set" ) ; else continue ; } if ( current == null ) continue ; if ( current . equals ( b ) ) return true ; } return false ; }
determines whether the given basicblock is directly control dependent on the given branch . meaning within this cdg there is an incoming controlflowedge to this instructions basicblock holding the given branch as it ' s branchinstruction . if b is null , it is assumed to be the root branch . if the given instruction is not known to this cdg an illegalargumentexception is thrown .
