Routines that are goto'd are also in the call graph.
Chris Pressey
5 years ago
516 | 516 | raise NotImplementedError(opcode) |
517 | 517 | |
518 | 518 | 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)): | |
521 | 521 | 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: | |
526 | 526 | context.assert_meaningful(ref) |
527 | for ref in type.outputs: | |
527 | for ref in type_.outputs: | |
528 | 528 | context.set_written(ref) |
529 | for ref in type.trashes: | |
529 | for ref in type_.trashes: | |
530 | 530 | context.assert_writeable(ref) |
531 | 531 | context.set_touched(ref) |
532 | 532 | context.set_unmeaningful(ref) |
537 | 537 | |
538 | 538 | if not isinstance(type_, (RoutineType, VectorType)): |
539 | 539 | raise TypeMismatchError(instr, location.name) |
540 | context.mark_as_called(instr.location, type_) | |
540 | 541 | |
541 | 542 | # assert that the dest routine's inputs are all initialized |
542 | 543 | if isinstance(type_, VectorType): |