'Check cachability of the given compile result.'

def check_cachable(self, cres):

    cannot_cache = None
    if self._is_closure:
        cannot_cache = 'as    it    uses    outer    variables    in    a    closure'
    elif cres.lifted:
        cannot_cache = 'as    it    uses    lifted    loops'
    elif cres.has_dynamic_globals:
        cannot_cache = 'as    it    uses    dynamic    globals    (such    as    ctypes    pointers    and    large    global    arrays)'
    if cannot_cache:
        msg = ('Cannot    cache    compiled    function    "%s"    %s' % (cres.fndesc.qualname.split('.')[(-1)], cannot_cache))
        warnings.warn_explicit(msg, NumbaWarning, self._locator._py_file, self._lineno)
        return False
    return True
