示例#1
0
        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));
        }
示例#2
0
文件: Program.cs 项目: mvacha/mi-gen
        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);
        }