bool FunctionMergePass::visitProg2(BinaryExpr * from, BinaryExpr * to) { in->setFirst(visitExpr(in->first())); in->setSecond(visitExpr(in->second())); return in; }
bool FunctionMergePass::visitLocalProcedure(LocalProcedureExpr * from, LocalProcedureExpr * to) { return visitExpr(from->arg(), to->arg()); }
bool FunctionMergePass::visitLocalReturn(ReturnExpr * from, ReturnExpr * to) { return visitExpr(from->arg(), to->arg()); }
bool FunctionMergePass::visitFor(ForExpr * from, ForExpr * to) { return visitExpr(from->init(), to->init()) && visitExpr(from->test(), to->test()) && visitExpr(from->incr(), to->incr()) && visitExpr(from->body(), to->body()); }
bool FunctionMergePass::visitThrow(ThrowExpr * from, ThrowExpr * to) { return visitExpr(from->arg(), to->arg()); }
bool FunctionMergePass::visitBoundMethod(BoundMethodExpr * from, BoundMethodExpr * to) { in->setSelfArg(visitExpr(in->selfArg())); return in; }
bool FunctionMergePass::visitIf(IfExpr * from, IfExpr * to) { return visitExpr(from->test(), to->test()) && visitExpr(from->thenVal(), to->thenVal()) && visitExpr(from->elseVal(), to->elseVal()); }
bool FunctionMergePass::visitPtrDeref(UnaryExpr * from, UnaryExpr * to) { in->setArg(visitExpr(in->arg())); return in; }
bool FunctionMergePass::visitComplement(UnaryExpr * from, UnaryExpr * to) { return visitExpr(from->arg(), to->arg()); }
bool FunctionMergePass::visitCompare(CompareExpr * from, CompareExpr * to) { return visitExpr(from->first(), to->first()) && visitExpr(from->second(), to->second()); }
bool FunctionMergePass::visitInstanceOf(InstanceOfExpr * from, InstanceOfExpr * to) { in->setValue(visitExpr(in->value())); return in; }
bool FunctionMergePass::visitIndirectCall(CallExpr * from, CallExpr * to) { visitExpr(in->function()); //in->setSelfArg(visitExpr(in->selfArg())); visitExprArgs(in); return in; }
bool FunctionMergePass::visitAssign(AssignmentExpr * from, AssignmentExpr * to) { return visitExpr(from->fromExpr(), to->fromExpr()) && visitExpr(from->toExpr(), to->toExpr()); }
bool FunctionMergePass::visitElementRef(BinaryExpr * from, BinaryExpr * to) { return visitExpr(to->first(), from->first()) && visitExpr(to->second(), from->second()); }
bool FunctionMergePass::visitSharedValue(SharedValueExpr * from, SharedValueExpr * to) { in->setArg(visitExpr(in->arg())); return in; }
bool FunctionMergePass::visitProg2(BinaryExpr * from, BinaryExpr * to) { return visitExpr(from->first(), to->first()) && visitExpr(from->second(), to->second()); }
void visitBinaryOp(BinaryOp *Op) { visitExpr(Op->getLHS()); visitExpr(Op->getRHS()); }
void CompilerPass::expr(AST *&ast_) { fodder(ast_->openFodder); visitExpr(ast_); }