1. 03 Sep, 2005 1 commit
    • Benoit Perrot's avatar
      2005-09-03 Benoît Perrot <benoit@lrde.epita.fr> · c87d6b9a
      Benoit Perrot authored
      	Detect several definitions of the same label in a section.
      
      	* src/inst/section.hh (register_label):
      	Return false when label is already known in the section, true
      	otherwise. Move implementation to...
      	* src/inst/section.cc, src/inst/Makefile.am:
      	This new file.
      	* src/inst/data_section.hh, src/inst/data_section.cc,
      	* src/inst/text_section.hh, src/inst/text_section.cc (define_label):
      	Propagate status of register_label.
      	* src/inst/program_builder.hh.gen.py:
      	Generate an error when a label is defined more than once.
      	* tests/solve/data-label-already-defined.s,
      	* tests/solve/text-label-already-defined.s,
      	* tests/solve/Makefile.am:
      	Test it.
      
      c87d6b9a
  2. 01 Sep, 2005 1 commit
    • Benoit Perrot's avatar
      2005-09-01 Benoît Perrot <benoit@lrde.epita.fr> · 082b5c71
      Benoit Perrot authored
      	Simplify unique_string construction.
      
      	* src/misc/unique_string.hh, src/misc/unique_string.cc (create):
      	Remove. Move its implementation to unique_string's constructor,
      	hence make unique_string aggregate a pointer-to-string instead of a
      	reference.
      	* src/misc/test-unique_string.cc, src/vm/virtual_machine.cc, 
      	* src/shell/shell.cc, src/parse/asm-parse.yy.gen.py,
      	* src/parse/asm-scan.ll.gen.py, src/inst/label_exp.hh,
      	* src/inst/section.hh, src/inst/label.hh:
      	Adjust.
      
      082b5c71
  3. 03 Feb, 2005 2 commits
    • Benoit Perrot's avatar
      2005-02-03 Benoît Perrot <benoit@lrde.epita.fr> · cf2790d6
      Benoit Perrot authored
      	* src/inst/data_section.hh, src/inst/data_section.cc,
      	* src/inst/text_section.hh, src/inst/text_section.cc:
      	Maintain a list of encountered (not sorted) labels. Use it to 
      	print the content of the sections.
      	* src/inst/section.hh: Remove deprecated attributes.
      	* src/inst/text_label.hh (get_iterator): Constify return value.
      
      cf2790d6
    • Benoit Perrot's avatar
      2005-02-03 Benoît Perrot <benoit@lrde.epita.fr> · 72081162
      Benoit Perrot authored
      	* src/inst/section.hh: Store the labels in a set. Use Labels to get 
      	the offset.
      	* src/inst/label.hh (deref_ptr_less): Declare and define a label 
      	pointer comparator.
      
      72081162
  4. 01 Feb, 2005 1 commit
    • Benoit Perrot's avatar
      2005-01-29 Benoît Perrot <benoit@lrde.epita.fr> · 58ab9449
      Benoit Perrot authored
      	Make Label compose its associated offset.
      
      	* src/inst/label.hh: Protect default constructor. Compose its
      	associated offset. Add a constructor that waits for it.
      	* src/inst/section.hh (has_label, get_offset): Update accordingly.
      	(register_label): Wait for a Label only and use it to get its offset.
      	* src/inst/data_section.hh: Update accordingly.
      	* src/inst/text_label.hh: New.
      	* src/inst/Makefile.am: Update accordingly.
      	* src/inst/text_section.hh: Create TextLabels instead of Labels.
      	* src/inst/text_section.cc: Include inst.hh to gain access
      	to Inst's interface.
      
      58ab9449
  5. 27 Jan, 2005 1 commit
    • Benoit Perrot's avatar
      Index: ChangeLog · 24ea94c9
      Benoit Perrot authored
      from  Benoît Perrot  <benoit@lrde.epita.fr>
      
      	Make LabelExp independent from Label.
      
      	* src/inst/exp.hh, src/inst/exp.cc:
      	Make LabelExp aggregate a unique_string instead of a Label.
      	* dev/parse-asm-scan-gen.py: Return a unique_string when 
      	scanning an identifier (instead	of a Label).
      	* dev/parse-asm-parse-gen.py: Update accordingly.
      	* src/inst/section.hh (has_label, get_offset): Wait for a
      	unique_string (instead of a Label).
      	* dev/inst-builder-gen.py, dev/inst-solver-gen.py,
      	* src/vm/virtual_machine.cc, src/shell/shell.cc:
      	Update accordingly.
      
      24ea94c9
  6. 26 Jan, 2005 1 commit
    • Benoit Perrot's avatar
      Index: ChangeLog · 80ffde06
      Benoit Perrot authored
      from  Benoît Perrot  <benoit@lrde.epita.fr>
      
      	Let concrete sections choose how to handle labels definitions.
      
      	* src/inst/section.hh (add_label): Rename as `register_label'.
      	* src/inst/data_section.hh, src/inst/text_section.hh:
      	(add_label): Rename as...
      	(define_label): This, and make it wait for a unique_string and 
      	build the label.
      	* dev/parse-asm-scan-gen.py: Return a unique_string on a 
      	label definition.
      	* dev/parse-asm-parse-gen.py: Update accordingly.
      
      Index: src/inst/data_section.hh
      --- src/inst/data_section.hh	(revision 160)
      +++ src/inst/data_section.hh	(working copy)
      @@ -54,9 +54,9 @@
           }
           
         public:
      -    void		add_label(Label *label)
      +    void		define_label(const misc::unique_string &id)
           {
      -      Section::add_label(label, size_);
      +      Section::register_label(new inst::Label(id), size_);
           }
           
         public:
      Index: src/inst/section.hh
      --- src/inst/section.hh	(revision 160)
      +++ src/inst/section.hh	(working copy)
      @@ -49,7 +49,7 @@
           {}
           
         protected:
      -    void		add_label(Label *label, int offset)
      +    void		register_label(Label *label, int offset)
           {
             // FIXME: check that this label has not already been added.
             offsets_[*label] = offset;
      Index: src/inst/text_section.hh
      --- src/inst/text_section.hh	(revision 160)
      +++ src/inst/text_section.hh	(working copy)
      @@ -54,9 +54,9 @@
           }
       
         public:
      -    void		add_label(Label *label)
      +    void		define_label(const misc::unique_string &id)
           {
      -      Section::add_label(label, insts_.size() * 4);
      +      Section::register_label(new inst::Label(id), insts_.size() * 4);
           }
       
         public:
      Index: dev/inst-builder-gen.py
      --- dev/inst-builder-gen.py	(revision 160)
      +++ dev/inst-builder-gen.py	(working copy)
      @@ -78,14 +78,14 @@
           }
           
         public:
      -    void		add_inst_label(Label *label)
      +    void		define_inst_label(const misc::unique_string &id)
           {
      -      program_->text_section ().add_label(label);
      +      program_->text_section ().define_label(id);
           }
       
      -    void		add_data_label(Label *label)
      +    void		define_data_label(const misc::unique_string &id)
           {
      -      program_->data_section ().add_label(label);
      +      program_->data_section ().define_label(id);
           }
       
         public:
      Index: dev/parse-asm-scan-gen.py
      --- dev/parse-asm-scan-gen.py	(revision 160)
      +++ dev/parse-asm-scan-gen.py	(working copy)
      @@ -71,7 +71,7 @@
       dec_int			[0-9]+
       hex_int			0x[0-9A-Fa-f]+
       
      -label			[a-zA-Z_][a-zA-Z_0-9]*
      +id			[a-zA-Z_][a-zA-Z_0-9]*
       %%
       
       %{
      @@ -144,14 +144,14 @@
       }
       
       
      -{label}			{
      +{id}			{
         yylval->label = new inst::Label (yytext);
         return LABEL;
       }
      -{label}\":\"		{
      +{id}\":\"		{
         std::string label = yytext;
         label.resize(yyleng - 1);
      -  yylval->label = new inst::Label (label);
      +  yylval->id = &misc::unique_string::create(label);
         return LABEL_DEF;
       }
       
      Index: dev/parse-asm-parse-gen.py
      --- dev/parse-asm-parse-gen.py	(revision 160)
      +++ dev/parse-asm-parse-gen.py	(working copy)
      @@ -75,6 +75,7 @@
       {
         int			i;
         std::string		*s;
      +  const misc::unique_string	*id;
         inst::Label           *label;
         inst::Register        *reg;
         inst::Exp             *exp;
      @@ -84,7 +85,7 @@
       %}
       
       %token <label> LABEL		\"label\"
      -%token <label> LABEL_DEF	\"label definition\"
      +%token <id> LABEL_DEF		\"label definition\"
       %token <i> INTEGER              \"integer\"
       %token <s> STRING               \"string\"
       %token <reg> REGISTER           \"register\"
      @@ -138,7 +139,7 @@
       data
       // Label
       :  LABEL_DEF
      -{ program_builder.add_data_label($1); }
      +{ program_builder.define_data_label(*$1); }
       
       // Uninitialized space
       | DIR_SPACE INTEGER
      @@ -169,7 +170,7 @@
       instruction
       // Label
       : LABEL_DEF
      -{ program_builder.add_inst_label($1); }
      +{ program_builder.define_inst_label(*$1); }
       
       // Opcodes"""
       
      80ffde06
  7. 14 Jan, 2005 1 commit
    • Benoit Perrot's avatar
      Index: ChangeLog · 9312687f
      Benoit Perrot authored
      from  Benoît Perrot  <benoit@lrde.epita.fr>
      
      	Introduce unique_strings.
      	
      	* src/misc/unique_string.hh, src/misc/unique_string.cc:
      	Declare and define the string uniquifier.
      	* src/misc/test-unique_string.cc: Test it.
      	* src/misc/Makefile.am: Update accordingly.
      	* src/Makefile.am: Link with libmisc.a.
      	* src/inst/section.hh, src/inst/label.hh: 
      	Use misc::unique_string instead of std::string.
      	* src/inst/label.cc: Empty it. 
      
      9312687f
  8. 26 Sep, 2004 1 commit
    • Benoit Perrot's avatar
      Index: ChangeLog · d36fa2b8
      Benoit Perrot authored
      from  Benoît Perrot  <benoit@lrde.epita.fr>
      
      	Name sections.
      	
      	* src/inst/section: Add name attribute.
      	* src/inst/text_section.hh, src/inst/data_section.hh:
      	Default it to `.text' for text sections and `.data' for data sections.
      	* src/inst/text_section.cc, src/inst/data_section.cc (print):
      	Display name.
      
      d36fa2b8
  9. 03 Jun, 2004 1 commit
    • Benoit Perrot's avatar
      Index: ChangeLog · 8d8a0d8d
      Benoit Perrot authored
      from  Benoît Perrot  <benoit@lrde.epita.fr>
      
      	Bump to nolimips-0.7
      
      	* INSTALL, README, TODO,
      	* Makefile.am, bootstrap,
      	* configure.ac,
      	* dev/doc-inst-set-gen.py, dev/inst-builder-gen.py,
      	* dev/inst-makefile-gen.py, dev/inst-nodes-gen.py,
      	* dev/inst-solver-gen.py, dev/nolimips.py,
      	* dev/nolimips.xml, dev/parse-asm-parse-gen.py,
      	* dev/parse-asm-scan-gen.py,
      	* doc/Makefile.am, doc/macros.texi,
      	* src/Makefile.am, src/common.hh, src/modules.hh,
      	* src/inst/section.hh,
      	* src/inst/data_section.hh, src/inst/data_section.cc
      	* src/inst/text_section.hh, src/inst/text_section.cc,
      	* src/inst/program.hh, src/inst/program_builder.cc,
      	* src/inst/exp-visitor.hh, src/inst/exp.hh, src/inst/exp.cc
      	* src/inst/inst-tasks.cc, src/inst/inst-tasks.hh, 
      	* src/inst/inst.hh, src/inst/label.cc, src/inst/label.hh
      	* src/inst/register.hh,
      	* src/parse/Makefile.am, src/parse/asm-scan.hh,
      	* src/parse/libparse.cc, src/parse/libparse.hh,
      	* src/parse/parse-tasks.cc, src/parse/parse-tasks.hh,
      	* src/shell/cmd.hh,
      	* src/shell/shell-tasks.cc, src/shell/shell-tasks.hh,
      	* src/shell/shell.cc, src/shell/shell.hh,
      	* src/task/task-tasks.cc, src/task/task-tasks.hh,
      	* src/task/task.cc, src/task/task.hh,
      	* src/task/task_register.cc, src/task/task_register.hh,
      	* src/vm/cp0.hh, src/vm/cpu.hh, src/vm/cpu.cc
      	* src/vm/memory.hh, src/vm/mmu.hh, src/vm/segment.hh
      	* src/vm/table.hh, src/vm/virtual_machine.hh
      	* src/vm/vm-tasks.cc, src/vm/vm-tasks.hh
      	* tests/Makefile.am, tests/generate-ref.mk, tests/good/check-good
      	* tests/good/fact.s, tests/lexical/check-lexical,
      	* tests/runtime/check-runtime, tests/solve/check-solve
      	* tests/syntax/check-syntax, tests/unlimited/check-unlimited:
      	Rename mipsy as nolimips.
      
      	* dev/mipsy.py, dev/mipsy.xml,
      	* doc/mipsy.texi,
      	* src/mipsy.cc, src/mipsy-tasks.cc, src/mipsy-tasks.hh,
      	* tests/mipsy-check:
      	Move to...
      	* dev/nolimips.py, dev/nolimips.xml,
      	* doc/nolimips.texi,
      	* src/nolimips.cc, src/nolimips-tasks.cc, src/nolimips-tasks.hh,
      	* tests/nolimips-check:
      	These new files.
      
      	* NEWS, configure.ac:
      	Bump to nolimips-0.7.
      
      8d8a0d8d
  10. 28 Mar, 2004 1 commit
    • Benoit Perrot's avatar
      Index: ChangeLog · eeaef65a
      Benoit Perrot authored
      from  Benoît Perrot  <benoit@lrde.epita.fr>
      
              Homogenize attribute names.
      
              * dev/inst-builder-gen.py, src/inst/program_builder.cc,
              * src/inst/data_section.hh, src/inst/data_section.cc,
              * src/inst/exp.hh, src/inst/exp.cc,
              * src/inst/label.cc, src/inst/label.hh,
              * src/inst/program.hh,
              * src/inst/program_solver.hh,
              * src/inst/register.hh,
              * src/inst/section.hh,
              * src/inst/text_section.hh, src/inst/text_section.cc,
              * src/misc/deref.hh, src/misc/escape.hh,
              * src/task/task.cc, src/task/task.hh
              * src/task/task_register.cc, src/task/task_register.hh
              * src/vm/cpu.hh, src/vm/cpu.cc
              * src/vm/memory.hh, src/vm/segment.hh,
              * src/vm/table.hh,
              * src/vm/virtual_machine.hh:
              Rename...
              (_program, fill_delay_slot_p, _size, bytes, immediate, integer)
              (label, kind, left, right, set, set_node, _text_section, _data_section)
              (_pc, _program, kind, index, labels, offsets, insts, postr, s)
              (print_delim, _long_opt, _short_opt, _module, _description)
              (dependencies, _execute, _modules, _tasks, _enabled_tasks, mmu, GPR)
              (hi, lo, pc, unlimited, halt, istr, ostr, call_stack)
              (check_callee_save_p, trace_p, bubble, pipeline, heap, stack)
              (stack_top, _size, _bytes, _scopes, memory, mmu, cpu)
              as...
              (program_, fill_delay_slot_p_, size_, bytes_, immediate_, integer_)
              (label_, kind_, left_, right_, set_, set_node_, text_section_)
              (data_section_, pc_, program_, kind_, index_, labels_, offsets_)
              (insts_, postr_, s_, print_delim_, long_opt_, short_opt_, module_)
              (description_, dependencies_, execute_, modules_, tasks_)
              (enabled_tasks_, mmu_, GPR_, hi_, lo_, pc_, unlimited_, halt_, istr_)
              (ostr_, call_stack_, check_callee_save_p_, trace_p_, bubble_)
              (pipeline_, heap_, stack_, stack_top_, size_, bytes_, scopes_)
              (memory_, mmu_, cpu_)
      
      eeaef65a
  11. 29 Feb, 2004 1 commit
    • Benoit Perrot's avatar
      Index: ChangeLog · 99749531
      Benoit Perrot authored
      from  Benoît Perrot  <benoit@lrde.epita.fr>
      
              Track memory leaks.
      
              * dev/inst-builder-gen.py,
              * dev/inst-nodes-gen.py,
              * dev/mipsy.xml,
              * dev/parse-asm-parse-gen.py,
              * src/inst/data_section.hh,
              * src/inst/exp.hh,
              * src/inst/program_builder.cc,
              * src/inst/section.hh,
              * src/inst/text_section.hh,
              * src/vm/cpu.hh, src/vm/cpu.cc
              * src/vm/segment.hh,
              * src/vm/vm-tasks.cc:
              Use pointers instead of references for each allocated attribute, 
              and delete them.
      
      99749531
  12. 24 Feb, 2004 1 commit
    • Benoit Perrot's avatar
      Index: ChangeLog · a546ec24
      Benoit Perrot authored
      from  Benoît Perrot  <benoit@lrde.epita.fr>
      
              * dev/doc-inst-set-gen.py,
              * dev/inst-builder-gen.py,
              * dev/inst-makefile-gen.py,
              * dev/inst-nodes-gen.py,
              * dev/mipsy.py,
              * dev/mipsy.xml,
              * dev/parse-asm-parse-gen.py,
              * dev/parse-asm-scan-gen.py,
              * src/common.hh,
              * src/mipsy-tasks.cc, src/mipsy-tasks.hh,
              * src/mipsy.cc,
              * src/modules.hh,
              * src/inst/data_section.hh,
              * src/inst/exp-visitor.hh,
              * src/inst/exp.hh,
              * src/inst/inst-tasks.cc, src/inst/inst-tasks.hh,
              * src/inst/inst.hh,
              * src/inst/label.cc, src/inst/label.hh,
              * src/inst/program.hh,
              * src/inst/program_builder.cc,
              * src/inst/program_solver.hh,
              * src/inst/register.hh,
              * src/inst/section.hh,
              * src/inst/text_section.hh,
              * src/parse/asm-scan.hh,
              * src/parse/libparse.cc, src/parse/libparse.hh,
              * src/parse/parse-tasks.cc, src/parse/parse-tasks.hh,
              * src/task/task-tasks.cc, src/task/task-tasks.hh,
              * src/task/task.cc, src/task/task.hh,
              * src/task/task_register.cc, src/task/task_register.hh,
              * src/vm/cpu.hh, src/vm/cpu.cc,
              * src/vm/memory.hh,
              * src/vm/mmu.hh,
              * src/vm/segment.hh,
              * src/vm/table.hh,
              * src/vm/virtual_machine.hh,
              * src/vm/vm-tasks.cc, src/vm/vm-tasks.hh:
              Update Copyright.
              Suggested by Akim Demaille.
      
      a546ec24
  13. 23 Feb, 2004 1 commit
    • Benoit Perrot's avatar
      Index: ChangeLog · e859e5ac
      Benoit Perrot authored
      from  Benoît Perrot  <benoit@lrde.epita.fr>
      
              Use STL type naming style.
      
              * dev/inst-nodes-gen.py,
              * src/inst/section.hh,
              * src/inst/data_section.hh,
              * src/inst/text_section.hh,
              * src/inst/exp.hh, src/inst/exp-visitor.hh
              * src/inst/label.hh, src/inst/label.cc,
              * src/task/task.hh,
              * src/task/task_register.cc,
              * src/vm/cpu.hh, src/vm/cpu.cc,
              * src/vm/table.hh,
              * src/misc/select_const.hh (label_list_t, kind_t, string_set_t)
              (offset_label_t, label_offset_t, deps_t, register_t, uregister_t) 
              (scope_t, scope_t, t):
              Rename as...
              (label_list_type, kind_type, string_set_type, offset_label_type)
              (label_offset_type, deps_type, register_type, uregister_type)
              (scope_type, scopes_type, type):
              these.
      e859e5ac
  14. 24 Jun, 2003 1 commit
  15. 17 Jul, 2003 2 commits
  16. 12 Jul, 2003 1 commit