In fact the 'src' should never (I think?) be 'touched'.
Chris Pressey
7 years ago
140 | 140 | |
141 | 141 | def set_touched(self, *refs): |
142 | 142 | for ref in refs: |
143 | # FIXME review the whole "touched" thing. what does it even mean? how is it different from "written"? | |
144 | if isinstance(ref.type, RoutineType): | |
145 | continue | |
146 | 143 | self._touched.add(ref) |
147 | 144 | |
148 | 145 | def set_meaningful(self, *refs): |
402 | 399 | elif isinstance(src, IndirectRef) and isinstance(dest, LocationRef): |
403 | 400 | context.assert_meaningful(src.ref, REG_Y) |
404 | 401 | # TODO this will need to be more sophisticated. the thing ref points to is touched, as well. |
405 | context.set_touched(src.ref) # TODO and REG_Y? if not, why not? | |
406 | context.set_touched(dest) | |
407 | 402 | context.set_written(dest) |
408 | 403 | elif isinstance(src, LocationRef) and isinstance(dest, IndexedRef): |
409 | 404 | context.assert_meaningful(src, dest.ref, dest.index) |
410 | context.set_touched(src) # TODO and dest.index? | |
411 | 405 | context.set_written(dest.ref) |
412 | 406 | elif isinstance(src, ConstantRef) and isinstance(dest, IndexedRef): |
413 | 407 | context.assert_meaningful(src, dest.ref, dest.index) |
414 | 408 | context.set_written(dest.ref) |
415 | 409 | elif isinstance(src, IndexedRef) and isinstance(dest, LocationRef): |
416 | 410 | context.assert_meaningful(src.ref, src.index, dest) |
417 | context.set_touched(dest) # TODO and src.index? | |
411 | context.set_touched(dest) | |
418 | 412 | context.set_written(dest) |
419 | 413 | else: |
420 | 414 | context.assert_meaningful(src) |