private EvaluatedRegion <NullLattice, NullLatticeValue> InterpretSingleBB(ControlFlowGraph cfg) { var mainBB = cfg.Blocks.Single(bb => bb.Kind == BasicBlockKind.Block); var mainRegion = cfg.Root.NestedRegions[0]; var mainEvalRegion = EvaluatedRegion <NullLattice, NullLatticeValue> .CreateFromRegion(cfg.Root.NestedRegions[0]); //Nested regions not yet supported mainRegion.NestedRegions.ShouldBeEmpty(); var analysis = new NullCheckElimination(); return(analysis.InterpretBB(mainBB, mainEvalRegion)); }
static void TestAbstractImplementation(ControlFlowGraph cfg) { var mainBB = cfg.Blocks.Single(bb => bb.Kind == BasicBlockKind.Block); var mainRegion = mainBB.EnclosingRegion; var mainEvalRegion = EvaluatedRegion <NullLattice, NullLatticeValue> .CreateFromRegion(cfg.Root.NestedRegions[0]); var analysis = new NullCheckElimination(); analysis.InterpretBB(mainBB, mainEvalRegion); //Nested regions not yet supported Debug.Assert(cfg.Root.NestedRegions.Count() == 1); }