private void mergeBlocks()
    {
        boolean cont = false;
        do 
        {
            cont = false;
            for ( BasicBlock block : getAllBlocks() ) 
            {
                if ( block.equals( functionEntry ) || block.equals( functionExit ) ) 
                {
                    continue; // never remove those 
                }

                final Set<BasicBlock> predecessors = block.getPredecessors();
                if ( predecessors.size() == 1 ) 
                {
                    final Set<BasicBlock> successors = block.getSuccessors();
                    /* merge with predecessor:
                     * 
                     *  1 -> 2 -> 3
                     *  1   ->    3
                     */
                    BasicBlock predecessor = predecessors.iterator().next();
                    if ( predecessor.equals( functionEntry ) || predecessor.getSuccessors().size() > 1 ) {
                        continue;
                    }
                    
                    predecessor.addASTNodes( block.getASTNodes() );
                    allBlocks.remove( block );
                    
                    predecessor.blockRemoved( block );
                    for ( BasicBlock successor : successors ) {
                        successor.blockRemoved( block );
                        predecessor.addSuccessor( successor );                        
                    }
                    cont = true;
                    break;
                }
            }
        } while( cont );
    }