def analyze(self, func, sig): t = TranslationContext() t.buildannotator().build_types(func, sig) t.buildrtyper().specialize() fgraph = graphof(t, func) return VirtualizableAnalyzer(t).analyze( fgraph.startblock.operations[0])
def __init__(self, cpu=None, jitdrivers_sd=[]): assert isinstance(jitdrivers_sd, list) # debugging self.cpu = cpu self.jitdrivers_sd = jitdrivers_sd self.jitcodes = {} # map {graph: jitcode} self.unfinished_graphs = [] # list of graphs with pending jitcodes self.callinfocollection = CallInfoCollection() if hasattr(cpu, 'rtyper'): # for tests self.rtyper = cpu.rtyper translator = self.rtyper.annotator.translator self.raise_analyzer = RaiseAnalyzer(translator) self.readwrite_analyzer = ReadWriteAnalyzer(translator) self.virtualizable_analyzer = VirtualizableAnalyzer(translator) self.quasiimmut_analyzer = QuasiImmutAnalyzer(translator) self.randomeffects_analyzer = RandomEffectsAnalyzer(translator) self.seen = DependencyTracker(self.readwrite_analyzer) else: self.seen = None # for index, jd in enumerate(jitdrivers_sd): jd.index = index