git @ Cat's Eye Technologies SixtyPical / construct-callgraph
Routines that are goto'd are also in the call graph. Chris Pressey 2 years ago
1 changed file(s) with 9 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
516516 raise NotImplementedError(opcode)
517517
518518 def analyze_call(self, instr, context):
519 type = self.get_type(instr.location)
520 if not isinstance(type, (RoutineType, VectorType)):
519 type_ = self.get_type(instr.location)
520 if not isinstance(type_, (RoutineType, VectorType)):
521521 raise TypeMismatchError(instr, instr.location.name)
522 context.mark_as_called(instr.location, type)
523 if isinstance(type, VectorType):
524 type = type.of_type
525 for ref in type.inputs:
522 context.mark_as_called(instr.location, type_)
523 if isinstance(type_, VectorType):
524 type_ = type_.of_type
525 for ref in type_.inputs:
526526 context.assert_meaningful(ref)
527 for ref in type.outputs:
527 for ref in type_.outputs:
528528 context.set_written(ref)
529 for ref in type.trashes:
529 for ref in type_.trashes:
530530 context.assert_writeable(ref)
531531 context.set_touched(ref)
532532 context.set_unmeaningful(ref)
537537
538538 if not isinstance(type_, (RoutineType, VectorType)):
539539 raise TypeMismatchError(instr, location.name)
540 context.mark_as_called(instr.location, type_)
540541
541542 # assert that the dest routine's inputs are all initialized
542543 if isinstance(type_, VectorType):