package cd.transform.optimizers;

import cd.ir.Ast;
import cd.ir.AstRewriteVisitor;

public abstract class GlobalOptimizerVisitor<A>
		extends AstRewriteVisitor<A>
		implements IGlobalOptimizer {
	private boolean changed;

	@Override
	protected void nodeReplaced(Ast oldNode, Ast newNode) {
		changed = true;
	}

	boolean hasChanged() {
		return changed;
	}

	final void setChanged(boolean changed) {
		this.changed = changed;
	}
}
