Commit 486613fc authored by Akim Demaille's avatar Akim Demaille

styles: untabify

* common.hh, inst-tasks.cc, inst-tasks.hh, inst/data_section.cc,
* inst/inst.hh, inst/op_exp.cc, inst/op_exp.hxx,
* inst/program_builder.cc, inst/program_builder.hxx,
* inst/program_solver.hxx, inst/register.hh, inst/section.cc,
* inst/section.hh, inst/text_label.hh, inst/text_label.hxx,
* inst/text_section.cc, misc/contract.hh, misc/counted_ptr.hh,
* misc/deref.hh, misc/escape.hh, misc/has.hh, misc/lexutils.cc,
* misc/lexutils.hh, misc/select_const.hh, misc/table.hh,
* misc/test-unique_string.cc, misc/unique_string.cc,
* misc/unique_string.hh, modules.hh, nolimips-tasks.cc,
* nolimips-tasks.hh, nolimips.cc, parse-tasks.cc, parse-tasks.hh,
* parse/asm-scan.hh, parse/fwd.hh, parse/libparse.cc,
* parse/libparse.hh, shell-tasks.cc, shell-tasks.hh, shell/cmd.hh,
* shell/cmd.hxx, shell/shell.cc, shell/shell.hh, shell/shell.hxx,
* task-tasks.cc, task-tasks.hh, task/boolean_task.cc,
* task/boolean_task.hh, task/function_task.cc, task/function_task.hh,
* task/int_task.cc, task/int_task.hh, task/libtask.hh,
* task/string_task.cc, task/string_task.hh, task/task.cc,
* task/task.hh, task/task.hxx, task/task_register.cc,
* task/task_register.hh, task/task_register.hxx, vm-tasks.cc,
* vm-tasks.hh, vm/cp0.hh, vm/cpu.cc, vm/cpu.hh, vm/cpu.hxx, vm/fwd.hh,
* vm/memory.hh, vm/memory.hxx, vm/mmu.hh, vm/mmu.hxx,
* vm/nolimips_system_library.cc, vm/nolimips_system_library.hh,
* vm/nolimips_system_library.hxx, vm/segment.hxx,
* vm/spim_system_library.cc, vm/spim_system_library.hxx,
* vm/virtual_machine.cc, vm/virtual_machine.hh:
Untabify (using GNU expand).
Remove trailing spaces.
parent 81bf8323
......@@ -6,12 +6,12 @@
// 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 Nolimips. If not, see <http://www.gnu.org/licenses/>.
//
......
......@@ -6,12 +6,12 @@
// 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 Nolimips. If not, see <http://www.gnu.org/licenses/>.
//
......@@ -47,7 +47,7 @@ namespace inst
program_solver.enable_unlimited_regs(parse::unlimited_regs_p);
program_solver.solve(* parse::tasks::program);
if (exit_status != exit_success)
exit (exit_status);
exit (exit_status);
}
} // namespace tasks
......
......@@ -6,12 +6,12 @@
// 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 Nolimips. If not, see <http://www.gnu.org/licenses/>.
//
......@@ -29,25 +29,25 @@ namespace inst
TASK_MODULE ("2. Instructions");
TASK_DECLARE ("prg-display",
"Display the read program",
prg_display, "parse");
"Display the read program",
prg_display, "parse");
TASK_DECLARE ("prg-solve",
"Resolve jump offsets and check bounds of immediates",
prg_solve, "parse");
"Resolve jump offsets and check bounds of immediates",
prg_solve, "parse");
INT_TASK_DECLARE ("callee-save",
"Set max number of callee-save registers",
max_callee_save, 8, 0, 8,
"");
"");
INT_TASK_DECLARE ("caller-save",
"Set max number of caller-save registers",
max_caller_save, 10, 0, 10,
"");
"");
INT_TASK_DECLARE ("argument-registers",
"Set max number of argument registers",
max_args, 4, 0, 4,
"");
"");
} // namespace tasks
} // namespace inst
......
......@@ -48,40 +48,40 @@ namespace inst
{
if (0 < size())
{
ostr << "\t" << name_ << std::endl;
std::vector<const Label*>::const_iterator label_it = labels_.begin();
int next_labeled_offset = size();
if (!labels_.empty())
next_labeled_offset = (*label_it)->get_offset();
for (int i = 0; i < size(); ++i)
{
while (i == next_labeled_offset)
{
ostr << *(*label_it) << ':' << std::endl;
++label_it;
if (label_it != labels_.end())
next_labeled_offset = (*label_it)->get_offset();
else // No more labels
break;
}
ostr << "\t.byte\t0x"
<< std::hex << static_cast<unsigned>(bytes_[i])
<< std::endl;
}
// Print labels that point right after the last data
while (label_it != labels_.end())
{
ostr << *(*label_it) << ':' << std::endl;
++label_it;
}
ostr << std::dec;
ostr << "\t" << name_ << std::endl;
std::vector<const Label*>::const_iterator label_it = labels_.begin();
int next_labeled_offset = size();
if (!labels_.empty())
next_labeled_offset = (*label_it)->get_offset();
for (int i = 0; i < size(); ++i)
{
while (i == next_labeled_offset)
{
ostr << *(*label_it) << ':' << std::endl;
++label_it;
if (label_it != labels_.end())
next_labeled_offset = (*label_it)->get_offset();
else // No more labels
break;
}
ostr << "\t.byte\t0x"
<< std::hex << static_cast<unsigned>(bytes_[i])
<< std::endl;
}
// Print labels that point right after the last data
while (label_it != labels_.end())
{
ostr << *(*label_it) << ':' << std::endl;
++label_it;
}
ostr << std::dec;
}
}
......
......@@ -30,9 +30,9 @@ namespace inst
public:
enum format_type
{
i_type = 0,
r_type = 1,
j_type = 2
i_type = 0,
r_type = 1,
j_type = 2
};
public:
......@@ -47,7 +47,7 @@ namespace inst
virtual void write(std::ostream&) const = 0;
public:
format_type get_format() const;
format_type get_format() const;
private:
const format_type format_;
......
......@@ -6,12 +6,12 @@
// 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 Nolimips. If not, see <http://www.gnu.org/licenses/>.
//
......@@ -49,7 +49,7 @@ namespace inst
case sub: ostr << " - "; break;
case mul: ostr << " * "; break;
case div: ostr << " / "; break;
}
}
ostr << *right_;
}
......
......@@ -6,12 +6,12 @@
// 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 Nolimips. If not, see <http://www.gnu.org/licenses/>.
//
......@@ -26,7 +26,7 @@ namespace inst
//
inline
OpExp::OpExp(const CountedExp &left, kind_type kind,
const CountedExp &right):
const CountedExp &right):
kind_(kind), left_(left), right_(right)
{
// assertion(left && right);
......
This diff is collapsed.
......@@ -49,9 +49,9 @@ namespace inst
// FIXME: fill end of program with NOPs for pipeline (really dirty!)
for (unsigned i = 0; i < 6; ++i)
program_->text_section().
add_inst (new Sll(Register(Register::general, Cpu::zero),
Register(Register::general, Cpu::zero),
new IntExp(0)));
add_inst (new Sll(Register(Register::general, Cpu::zero),
Register(Register::general, Cpu::zero),
new IntExp(0)));
return program_;
}
......@@ -61,9 +61,9 @@ namespace inst
{
if (!program_->text_section ().define_label(id))
{
std::cerr << "Instruction label already defined in this section."
<< std::endl;
exit_set(exit_solve);
std::cerr << "Instruction label already defined in this section."
<< std::endl;
exit_set(exit_solve);
}
}
......@@ -72,9 +72,9 @@ namespace inst
{
if (!program_->data_section ().define_label(id))
{
std::cerr << "Data label already defined in this section."
<< std::endl;
exit_set(exit_solve);
std::cerr << "Data label already defined in this section."
<< std::endl;
exit_set(exit_solve);
}
}
......
......@@ -65,8 +65,8 @@ namespace inst
pc_ = 4;
for (TextSection::instruction_list_type::const_iterator
it = program.text_section().begin();
it != program.text_section().end(); ++it, pc_ += 4)
it = program.text_section().begin();
it != program.text_section().end(); ++it, pc_ += 4)
(*it)->accept(*this);
}
......
......@@ -28,12 +28,12 @@ namespace inst
public:
enum kind_type
{
/// Generic (processor, coprocessor) kind ($0, $1, etc.)
generic,
/// General purpose (processor) register ($zero, $a0, etc.)
general,
/// Unlimited (processor) register ($x2097, etc.)
unlimited
/// Generic (processor, coprocessor) kind ($0, $1, etc.)
generic,
/// General purpose (processor) register ($zero, $a0, etc.)
general,
/// Unlimited (processor) register ($x2097, etc.)
unlimited
};
public:
......
......@@ -23,7 +23,7 @@ namespace inst
Section::~Section()
{
// for (label_set_type::iterator
// it = sorted_labels_.begin(); it != sorted_labels_.end(); ++it)
// it = sorted_labels_.begin(); it != sorted_labels_.end(); ++it)
// delete *it;
}
......@@ -32,10 +32,10 @@ namespace inst
{
label_set_type::const_iterator it(sorted_labels_.find(label));
if (it == sorted_labels_.end()
|| *(*it) < *label)
|| *(*it) < *label)
{
it = sorted_labels_.insert(it, label);
return true;
it = sorted_labels_.insert(it, label);
return true;
}
return false;
}
......
......@@ -42,7 +42,7 @@ namespace inst
protected:
/** Return false if the label already exists in this section, true
otherwise */
otherwise */
bool register_label(Label *label);
public:
......
......@@ -29,7 +29,7 @@ namespace inst
{
public:
TextLabel(const std::string &s,
TextSection::instruction_list_type::iterator it);
TextSection::instruction_list_type::iterator it);
virtual ~TextLabel();
public:
......
......@@ -28,7 +28,7 @@ namespace inst
//
inline
TextLabel::TextLabel(const std::string &s,
TextSection::instruction_list_type::iterator it):
TextSection::instruction_list_type::iterator it):
Label(s), it_(it)
{
}
......
......@@ -29,7 +29,7 @@ namespace inst
TextSection::~TextSection()
{
for (instruction_list_type::const_iterator
it = insts_.begin(); it != insts_.end(); ++it)
it = insts_.begin(); it != insts_.end(); ++it)
delete (*it);
}
......@@ -62,27 +62,27 @@ namespace inst
next_labeled_it = (*label_it)->get_iterator();
for (instruction_list_type::const_iterator
inst_it = begin(); inst_it != end(); ++inst_it)
inst_it = begin(); inst_it != end(); ++inst_it)
{
while (inst_it == next_labeled_it)
{
ostr << *(*label_it) << ':' << std::endl;
++label_it;
while (inst_it == next_labeled_it)
{
ostr << *(*label_it) << ':' << std::endl;
++label_it;
if (label_it != labels_.end())
next_labeled_it = (*label_it)->get_iterator();
else // No more labels
break;
}
if (label_it != labels_.end())
next_labeled_it = (*label_it)->get_iterator();
else // No more labels
break;
}
ostr << '\t' << *(*inst_it) << std::endl;
ostr << '\t' << *(*inst_it) << std::endl;
}
// Print labels that point right after the last instruction
while (label_it != labels_.end())
{
ostr << *(*label_it) << ':' << std::endl;
++label_it;
ostr << *(*label_it) << ':' << std::endl;
++label_it;
}
}
......
......@@ -6,19 +6,19 @@
// 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.
//
//
// It 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 Nolimips. If not, see <http://www.gnu.org/licenses/>.
//
/** \file misc/contract.hh
\brief Replacement for cassert.
\brief Replacement for cassert.
The implementation is inspired from LRDE's contract.hh/contract.cc
provided in the Tiger Compiler and the Vaucanson project.
*/
......@@ -39,21 +39,21 @@
# include <cstdlib>
inline void __FailedCondition(const char* condType,
const char* condText,
const char* fileName,
int fileLine)
const char* condText,
const char* fileName,
int fileLine)
{
std::cerr << fileName << ':'
<< fileLine
<< ": "
<< condType << " `"
<< condText << "' failed." << std::endl;
<< fileLine
<< ": "
<< condType << " `"
<< condText << "' failed." << std::endl;
abort();
}
# define __TestCondition(condType,expr) \
((void) ((expr) ? 0 : (__FailedCondition( #condType, #expr, \
__FILE__, __LINE__ ), 0)))
# define __TestCondition(condType,expr) \
((void) ((expr) ? 0 : (__FailedCondition( #condType, #expr, \
__FILE__, __LINE__ ), 0)))
# define assertion(expr) __TestCondition(Assertion,expr)
# define invariant(expr) __TestCondition(Invariant,expr)
......
......@@ -6,12 +6,12 @@
// 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.
//
//
// It 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 Nolimips. If not, see <http://www.gnu.org/licenses/>.
//
......@@ -19,7 +19,7 @@
/** \file misc/counted_ptr.hh
\brief Counted reference wrapper.
A great part of the implementation comes from LRDE's ref.hh/ref.hxx,
A great part of the implementation comes from LRDE's ref.hh/ref.hxx,
provided in Tiger Compiler by Raphael Poss. */
#ifndef MISC_COUNTED_PTR_HH
......@@ -35,7 +35,7 @@ namespace misc
of garbage collection.
This class implements the proposal of Gregory Colvin in Exception
Safe Smart Pointers, C++ committee document 94-168/N0555, July, 1994.
Safe Smart Pointers, C++ committee document 94-168/N0555, July, 1994.
The concept of counted pointers is very similar to the concept of
file links in file systems, that is why I choose to use the
......@@ -58,18 +58,18 @@ namespace misc
friend class counted_ptr;
/** \name Constructor and destructor
\{ */
\{ */
public:
/** \brief A counted_ptr is usually constructed from a raw pointer.
\param ptr A pointer (defaults to NULL). */
\param ptr A pointer (defaults to NULL). */
counted_ptr(element_type *ptr = 0):
ptr_(ptr)
{
count_ = new long(1);
}
/** \brief A counted_ptr can be constructed from another counted_ptr.
\param c Another %auto_ptr of the same type. */
\param c Another %auto_ptr of the same type. */
counted_ptr(const counted_ptr &c):
ptr_(c.ptr_), count_(c.count_)
{
......@@ -87,13 +87,13 @@ namespace misc
/** \} */
/** \name Conversion, assignement, comparison
\{ */
\{ */
public:
/** \brief counted_ptr conversion operator.
This conversion operator avoids having to define several
constructors and test operators for creation from or comparison with
counted pointers of a different but related type.
This conversion operator avoids having to define several
constructors and test operators for creation from or comparison with
counted pointers of a different but related type.
*/
template < typename U >
operator counted_ptr< U >() const
......@@ -102,14 +102,14 @@ namespace misc
}
/** \brief counted_ptr assignment operator.
\param c Another counted_ptr of the same type. */
\param c Another counted_ptr of the same type. */
counted_ptr&
operator=(const counted_ptr &c)
{
link(c.ptr_, c.count_);
return *this;
}
/** \brief Return true if \a c and this share the same data. */
bool
operator==(const counted_ptr &c)
......@@ -129,25 +129,25 @@ namespace misc
{
--(*count_);
if (!*count_)
{
delete ptr_;
delete count_;
}
{
delete ptr_;
delete count_;
}
}
void link(T *ptr, long *count)
{
if (count_ != count)
{
++(*count);
unlink();
ptr_ = ptr;
count_ = count;
}
{
++(*count);
unlink();
ptr_ = ptr;
count_ = count;
}
}
/** \name Dereferencing
\{ */
\{ */
public:
bool
exists() const
......@@ -172,7 +172,7 @@ namespace misc
precondition(ptr_ != 0);
return ptr_;
}
/** \} */
/** \} */
private:
......
//
// deref.hh: pretty printing pointers
// Copyright