1
0
mirror of https://github.com/catseye/SixtyPical.git synced 2024-11-22 01:32:13 +00:00

Routines that are goto'd are also in the call graph.

This commit is contained in:
Chris Pressey 2019-10-21 17:15:28 +01:00
parent 182935a088
commit b09d0c0b76

View File

@ -517,17 +517,17 @@ class Analyzer(object):
raise NotImplementedError(opcode) raise NotImplementedError(opcode)
def analyze_call(self, instr, context): def analyze_call(self, instr, context):
type = self.get_type(instr.location) type_ = self.get_type(instr.location)
if not isinstance(type, (RoutineType, VectorType)): if not isinstance(type_, (RoutineType, VectorType)):
raise TypeMismatchError(instr, instr.location.name) raise TypeMismatchError(instr, instr.location.name)
context.mark_as_called(instr.location, type) context.mark_as_called(instr.location, type_)
if isinstance(type, VectorType): if isinstance(type_, VectorType):
type = type.of_type type_ = type_.of_type
for ref in type.inputs: for ref in type_.inputs:
context.assert_meaningful(ref) context.assert_meaningful(ref)
for ref in type.outputs: for ref in type_.outputs:
context.set_written(ref) context.set_written(ref)
for ref in type.trashes: for ref in type_.trashes:
context.assert_writeable(ref) context.assert_writeable(ref)
context.set_touched(ref) context.set_touched(ref)
context.set_unmeaningful(ref) context.set_unmeaningful(ref)
@ -538,6 +538,7 @@ class Analyzer(object):
if not isinstance(type_, (RoutineType, VectorType)): if not isinstance(type_, (RoutineType, VectorType)):
raise TypeMismatchError(instr, location.name) raise TypeMismatchError(instr, location.name)
context.mark_as_called(instr.location, type_)
# assert that the dest routine's inputs are all initialized # assert that the dest routine's inputs are all initialized
if isinstance(type_, VectorType): if isinstance(type_, VectorType):