public void replacePhis(final FlowGraph cfg) {
		replaceCatchPhis(cfg);
		replaceJoinPhis(cfg);

		// Remove the phis.
		cfg.visit(new TreeVisitor() {
			public void visitTree(final Tree tree) {
				final Iterator e = tree.stmts().iterator();

				while (e.hasNext()) {
					final Stmt s = (Stmt) e.next();

					if (s instanceof PhiStmt) {
						e.remove();
					}
				}
			}
		});
	}