MCPcopy Index your code
hub / github.com/RustPython/RustPython / make_bb

Method make_bb

Lib/test/test_peepholer.py:2413–2423  ·  view source on GitHub ↗
(self, insts)

Source from the content-addressed store, hash-verified

2411
2412class OptimizeLoadFastTestCase(DirectCfgOptimizerTests):
2413 def make_bb(self, insts):
2414 last_loc = insts[-1][2]
2415 maxconst = 0
2416 for op, arg, _ in insts:
2417 if op == "LOAD_CONST":
2418 maxconst = max(maxconst, arg)
2419 consts = [None for _ in range(maxconst + 1)]
2420 return insts + [
2421 ("LOAD_CONST", 0, last_loc + 1),
2422 ("RETURN_VALUE", None, last_loc + 2),
2423 ], consts
2424
2425 def check(self, insts, expected_insts, consts=None):
2426 insts_bb, insts_consts = self.make_bb(insts)

Callers 1

checkMethod · 0.95

Calls 1

maxFunction · 0.85

Tested by

no test coverage detected