annotate python/irmach.py @ 271:cf7d5fb7d9c8

Reorganization
author Windel Bouwman
date Tue, 20 Aug 2013 18:56:02 +0200
parents cdc76d183bcc
children ea93e0a7a31e
rev   line source
261
444b9df2ed99 try to split up code generation
Windel Bouwman
parents:
diff changeset
1
269
5f8c04a8d26b Towards better modularity
Windel Bouwman
parents: 268
diff changeset
2 """
270
cdc76d183bcc first register allocator
Windel Bouwman
parents: 269
diff changeset
3 Abstract assembly language instructions.
cdc76d183bcc first register allocator
Windel Bouwman
parents: 269
diff changeset
4
cdc76d183bcc first register allocator
Windel Bouwman
parents: 269
diff changeset
5 This is the second intermediate representation.
cdc76d183bcc first register allocator
Windel Bouwman
parents: 269
diff changeset
6
cdc76d183bcc first register allocator
Windel Bouwman
parents: 269
diff changeset
7 Instructions are selected and scheduled at this stage.
269
5f8c04a8d26b Towards better modularity
Windel Bouwman
parents: 268
diff changeset
8 """
261
444b9df2ed99 try to split up code generation
Windel Bouwman
parents:
diff changeset
9
444b9df2ed99 try to split up code generation
Windel Bouwman
parents:
diff changeset
10
268
5ec7580976d9 Op naar tree-IR
Windel Bouwman
parents: 261
diff changeset
11 class AbstractInstruction:
261
444b9df2ed99 try to split up code generation
Windel Bouwman
parents:
diff changeset
12 """ Absract machine instruction """
268
5ec7580976d9 Op naar tree-IR
Windel Bouwman
parents: 261
diff changeset
13 def __init__(self, assem, src=(), dst=(), jumps=()):
5ec7580976d9 Op naar tree-IR
Windel Bouwman
parents: 261
diff changeset
14 self.assem = assem
5ec7580976d9 Op naar tree-IR
Windel Bouwman
parents: 261
diff changeset
15 self.src = tuple(src)
5ec7580976d9 Op naar tree-IR
Windel Bouwman
parents: 261
diff changeset
16 self.dst = tuple(dst)
5ec7580976d9 Op naar tree-IR
Windel Bouwman
parents: 261
diff changeset
17 self.jumps = tuple(jumps)
5ec7580976d9 Op naar tree-IR
Windel Bouwman
parents: 261
diff changeset
18
5ec7580976d9 Op naar tree-IR
Windel Bouwman
parents: 261
diff changeset
19 def __repr__(self):
5ec7580976d9 Op naar tree-IR
Windel Bouwman
parents: 261
diff changeset
20 return self.assem + str(self.src) + str(self.dst)
261
444b9df2ed99 try to split up code generation
Windel Bouwman
parents:
diff changeset
21
444b9df2ed99 try to split up code generation
Windel Bouwman
parents:
diff changeset
22