206 | 206 |
if routine.block is None:
|
207 | 207 |
# it's an extern, that's fine
|
208 | 208 |
return
|
209 | |
type = routine.location.type
|
210 | |
context = Context(self.routines, routine, type.inputs, type.outputs, type.trashes)
|
|
209 |
type_ = routine.location.type
|
|
210 |
context = Context(self.routines, routine, type_.inputs, type_.outputs, type_.trashes)
|
211 | 211 |
if self.debug:
|
212 | 212 |
print "at start of routine `{}`:".format(routine.name)
|
213 | 213 |
print context
|
|
216 | 216 |
print "at end of routine `{}`:".format(routine.name)
|
217 | 217 |
print context
|
218 | 218 |
if not self.has_encountered_goto:
|
219 | |
for ref in type.outputs:
|
|
219 |
for ref in type_.outputs:
|
220 | 220 |
context.assert_meaningful(ref, exception_class=UnmeaningfulOutputError)
|
221 | 221 |
for ref in context.each_touched():
|
222 | |
if ref not in type.outputs and ref not in type.trashes:
|
|
222 |
if ref not in type_.outputs and ref not in type_.trashes:
|
223 | 223 |
message = '%s in %s' % (ref.name, routine.name)
|
224 | 224 |
raise ForbiddenWriteError(message)
|
225 | 225 |
self.current_routine = None
|
|
465 | 465 |
|
466 | 466 |
self.has_encountered_goto = True
|
467 | 467 |
elif opcode == 'trash':
|
|
468 |
context.set_touched(instr.dest)
|
468 | 469 |
context.set_unmeaningful(instr.dest)
|
469 | 470 |
else:
|
470 | 471 |
raise NotImplementedError(opcode)
|