// // This file is part of Nolimips, a MIPS simulator with unlimited registers // Copyright (C) 2006 Benoit Perrot // // Nolimips is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // Nolimips is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // #ifndef INST_PROGRAM_SOLVER_HXX # define INST_PROGRAM_SOLVER_HXX # include "inst/program_solver.hh" # include "inst/exp.hh" # include "inst/program.hh" namespace inst { // inline ProgramSolver::ProgramSolver(): program_(0), max_callee_save_(8), max_caller_save_(10), max_args_(4), unlimited_regs_enabled_(false) { } // inline void ProgramSolver::set_max_callee_save(int max_callee_save) { max_callee_save_ = max_callee_save; } inline void ProgramSolver::set_max_caller_save(int max_caller_save) { max_caller_save_ = max_caller_save; } inline void ProgramSolver::set_max_args(int max_args) { max_args_ = max_args; } inline void ProgramSolver::enable_unlimited_regs(bool flag) { unlimited_regs_enabled_ = flag; } // inline void ProgramSolver::solve(Program &program) { program_ = &program; pc_ = 4; for (TextSection::instruction_list_type::const_iterator it = program.text_section().begin(); it != program.text_section().end(); ++it, pc_ += 4) (*it)->accept(*this); } inline void ProgramSolver::solve_exp(Exp &exp) { exp.accept(*this); } } // namespace inst #endif // !INST_PROGRAM_SOLVER_HXX