Write the sequence of instructions to a file.
(self, filename)
| 1484 | |
| 1485 | @unpurged |
| 1486 | def write_str(self, filename): |
| 1487 | """Write the sequence of instructions to a file.""" |
| 1488 | print("Writing to", filename) |
| 1489 | f = open(filename, "w") |
| 1490 | n = 0 |
| 1491 | for block in self.basicblocks: |
| 1492 | if block.instructions: |
| 1493 | f.write("# %s\n" % block.name) |
| 1494 | for line in block.instructions: |
| 1495 | f.write("%s # %d\n" % (line, n)) |
| 1496 | n += 1 |
| 1497 | f.close() |
| 1498 | |
| 1499 | @unpurged |
| 1500 | def write_bytes(self, filename=None): |
no test coverage detected