def enter(s, blk, rtlir):
    """ entry point for RTLIR type checking """
    s.blk = blk
    s.globals = blk.__globals__
    s.closure = {}
    for i, var in enumerate(blk.__code__.co_freevars):
        try:
            s.closure[var] = blk.__closure__[i].cell_contents
        except ValueError:
            pass
    s.visit(rtlir)
