private static Iterator collectVars(final FlowGraph cfg) {
		// SSAConstructionInfo objects for cfg
		final Map infos = new HashMap();

		cfg.visit(new TreeVisitor() {
			// Visit all statements in the CFG. Remove any pre-existing
			// PhiStmts.
			public void visitTree(final Tree tree) {
				final Iterator iter = tree.stmts().iterator();

				while (iter.hasNext()) {
					final Stmt stmt = (Stmt) iter.next();

					if (stmt instanceof PhiStmt) {
						iter.remove();

					} else {
						stmt.visit(this);
					}
				}
			}

			// Recall that VarExprs represent variables. If we have not
			// already created a SSAConstructionInfo for a variable
			// (VarExpr), do so. Make note of the fact that this is a real
			// occurrence of the variable.
			public void visitVarExpr(final VarExpr expr) {
				expr.visitChildren(this);

				expr.setDef(null);

				final Object key = expr.comparator();

				SSAConstructionInfo info = (SSAConstructionInfo) infos.get(key);

				if (info == null) {
					info = new SSAConstructionInfo(cfg, expr);
					infos.put(key, info);
				}

				info.addReal(expr);
			}
		});

		return infos.values().iterator();
	}