Commit 4fbb0766 authored by Benoit Perrot's avatar Benoit Perrot
Browse files

2005-09-25 Benoît Perrot <benoit@lrde.epita.fr>

	Reduce includes' dependencies.
	
	* src/vm/cpu.hh, src/vm/cpu.cc
	* src/vm/virtual_machine.hh, src/vm/virtual_machine.cc
	* src/parse/asm-parse.yy.gen.py, src/parse/asm-scan.ll.gen.py,
	* src/inst/register.hh,
	* src/inst/op_exp.hh,
	* src/inst/label_exp.hh,
	* src/inst/exp.hh,
	* src/inst/section.hh, src/inst/data_section.hh,
	* src/inst/program.hh
	* src/inst/nodes.gen.py
	* src/inst/inst.hh
	* src/inst/label.hh:
	Remove unused includes, forward-declare classes.
parent 902282e4
2005-09-25 Benot Perrot <benoit@lrde.epita.fr>
Reduce includes' dependencies.
* src/vm/cpu.hh, src/vm/cpu.cc
* src/vm/virtual_machine.hh, src/vm/virtual_machine.cc
* src/parse/asm-parse.yy.gen.py, src/parse/asm-scan.ll.gen.py,
* src/inst/register.hh,
* src/inst/op_exp.hh,
* src/inst/label_exp.hh,
* src/inst/exp.hh,
* src/inst/section.hh, src/inst/data_section.hh,
* src/inst/program.hh
* src/inst/nodes.gen.py
* src/inst/inst.hh
* src/inst/label.hh:
Remove unused includes, forward-declare classes.
2005-09-24 Benot Perrot <benoit@lrde.epita.fr> 2005-09-24 Benot Perrot <benoit@lrde.epita.fr>
Introduce system libraries. Introduce system libraries.
......
...@@ -23,14 +23,19 @@ ...@@ -23,14 +23,19 @@
# include <stdint.h> # include <stdint.h>
# include <iostream> # include <ostream>
# include <vector> # include <vector>
# include <string>
# include "misc/contract.hh"
# include "misc/unique_string.hh"
# include "inst/section.hh" # include "inst/section.hh"
# include "inst/inst.hh"
namespace inst namespace inst
{ {
class Label;
/// Abstract an assembly data section /// Abstract an assembly data section
class DataSection: class DataSection:
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#ifndef INST_EXP_HH #ifndef INST_EXP_HH
# define INST_EXP_HH # define INST_EXP_HH
# include <iostream> # include <ostream>
# include "misc/contract.hh" # include "misc/contract.hh"
# include "misc/lockable.hh" # include "misc/lockable.hh"
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#ifndef INST_INST_HH #ifndef INST_INST_HH
# define INST_INST_HH # define INST_INST_HH
# include <iostream> # include <ostream>
# include "inst/visitor.hh" # include "inst/visitor.hh"
......
...@@ -19,9 +19,8 @@ ...@@ -19,9 +19,8 @@
#ifndef INST_LABEL_HH #ifndef INST_LABEL_HH
# define INST_LABEL_HH # define INST_LABEL_HH
# include <set>
# include <string> # include <string>
# include <iostream> # include <ostream>
# include "misc/contract.hh" # include "misc/contract.hh"
# include "misc/lockable.hh" # include "misc/lockable.hh"
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#ifndef INST_LABEL_EXP_HH #ifndef INST_LABEL_EXP_HH
# define INST_LABEL_EXP_HH # define INST_LABEL_EXP_HH
# include <ostream>
# include "misc/unique_string.hh" # include "misc/unique_string.hh"
# include "inst/exp.hh" # include "inst/exp.hh"
......
...@@ -68,17 +68,22 @@ def class_generate(inst): ...@@ -68,17 +68,22 @@ def class_generate(inst):
print """ print """
# include \"inst/register.hh\" # include \"inst/register.hh\"
# include \"inst/exp.hh\" # include \"inst/exp.hh\"
# include \"inst/inst.hh\" # include \"inst/inst.hh\""""
# include \"inst/visitor.hh\"
""" sys.stdout = impl
print "#include \"inst/visitor.hh\""
for f in [inline, impl]: for f in [inline, impl]:
sys.stdout = f sys.stdout = f
print "#include \"inst/" + file_id + ".hh\"" print "#include \"inst/" + file_id + ".hh\""
# Open namespace # Open namespace
for f in [header, inline, impl]: for f in [header, inline, impl]:
sys.stdout = f sys.stdout = f
print "\nnamespace inst\n{\n" print """
namespace inst
{
"""
## Declare class ## Declare class
sys.stdout = header sys.stdout = header
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#ifndef INST_OP_EXP_HH #ifndef INST_OP_EXP_HH
# define INST_OP_EXP_HH # define INST_OP_EXP_HH
# include <ostream>
# include "inst/exp.hh" # include "inst/exp.hh"
namespace inst namespace inst
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#ifndef INST_PROGRAM_HH #ifndef INST_PROGRAM_HH
# define INST_PROGRAM_HH # define INST_PROGRAM_HH
# include <iostream> # include <ostream>
# include "inst/text_section.hh" # include "inst/text_section.hh"
# include "inst/data_section.hh" # include "inst/data_section.hh"
...@@ -39,7 +39,7 @@ namespace inst ...@@ -39,7 +39,7 @@ namespace inst
{ {
return text_section_; return text_section_;
} }
public: public:
DataSection& data_section () DataSection& data_section ()
{ {
......
...@@ -19,9 +19,7 @@ ...@@ -19,9 +19,7 @@
#ifndef INST_REGISTER_HH #ifndef INST_REGISTER_HH
# define INST_REGISTER_HH # define INST_REGISTER_HH
# include <iostream> # include <ostream>
# include "misc/contract.hh"
namespace inst namespace inst
{ {
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#ifndef INST_SECTION_HH #ifndef INST_SECTION_HH
# define INST_SECTION_HH # define INST_SECTION_HH
# include <ostream>
# include <set> # include <set>
# include "misc/contract.hh" # include "misc/contract.hh"
......
...@@ -50,12 +50,9 @@ print """ ...@@ -50,12 +50,9 @@ print """
#include \"inst/register.hh\" #include \"inst/register.hh\"
#include \"inst/all.hh\" #include \"inst/all.hh\"
#include \"vm/cpu.hh\"
#include \"parse/libparse.hh\" #include \"parse/libparse.hh\"
using namespace inst; using namespace inst;
using vm::Cpu;
%} %}
%error-verbose %error-verbose
......
...@@ -284,6 +284,8 @@ yylex_destroy(void) ...@@ -284,6 +284,8 @@ yylex_destroy(void)
} }
#endif #endif
#include <stack>
namespace parse namespace parse
{ {
......
...@@ -18,8 +18,6 @@ ...@@ -18,8 +18,6 @@
// //
#include <iomanip> #include <iomanip>
#include "common.hh"
#include "vm/cpu.hh" #include "vm/cpu.hh"
#include "vm/system_library.hh" #include "vm/system_library.hh"
......
...@@ -25,13 +25,15 @@ ...@@ -25,13 +25,15 @@
# include <stdint.h> # include <stdint.h>
# include <stack> # include <vector>
# include "common.hh"
# include "misc/table.hh" # include "misc/table.hh"
# include "inst/inst.hh"
# include "inst/visitor.hh" # include "inst/visitor.hh"
# include "inst/register.hh" # include "inst/register.hh"
# include "inst/program.hh"
# include "vm/mmu.hh" # include "vm/mmu.hh"
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
#include "vm/virtual_machine.hh" #include "vm/virtual_machine.hh"
#include "inst/program.hh"
namespace vm namespace vm
{ {
......
...@@ -21,19 +21,19 @@ ...@@ -21,19 +21,19 @@
#ifndef VM_VIRTUAL_MACHINE_HH #ifndef VM_VIRTUAL_MACHINE_HH
# define VM_VIRTUAL_MACHINE_HH # define VM_VIRTUAL_MACHINE_HH
# include <iostream> # include <ostream>
# include "misc/contract.hh" # include "misc/contract.hh"
# include "misc/has.hh" # include "misc/has.hh"
# include "common.hh" # include "common.hh"
# include "inst/program.hh"
# include "vm/memory.hh" # include "vm/memory.hh"
# include "vm/mmu.hh" # include "vm/mmu.hh"
# include "vm/cp0.hh" # include "vm/cp0.hh"
# include "vm/cpu.hh" # include "vm/cpu.hh"
namespace inst { class Program; }
namespace vm namespace vm
{ {
class SystemLibrary; class SystemLibrary;
...@@ -82,7 +82,7 @@ namespace vm ...@@ -82,7 +82,7 @@ namespace vm
public: public:
/// Load a program into memory. /// Load a program into memory.
void load_program(const inst::Program& program); void load_program(const inst::Program &program);
void set_system_library(SystemLibrary *l) { cpu_.set_system_library(l); } void set_system_library(SystemLibrary *l) { cpu_.set_system_library(l); }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment