Implement Statement::toIR in terms of a visitor interface