def verify_uses(func): """Verify the def-use chains""" # NOTE: verify should be importable from any pass! from pykit.analysis import defuse uses = defuse.defuse(func) diff = set.difference(set(uses), set(func.uses)) assert not diff, diff
def reset_uses(self): from pykit.analysis import defuse self.uses = defuse.defuse(self)