当前位置: 首页>>代码示例>>C#>>正文


C# BasicBlock.ToString方法代码示例

本文整理汇总了C#中BasicBlock.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# BasicBlock.ToString方法的具体用法?C# BasicBlock.ToString怎么用?C# BasicBlock.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BasicBlock的用法示例。


在下文中一共展示了BasicBlock.ToString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RemoveDeadBlock

        protected void RemoveDeadBlock(BasicBlock block)
        {
            if (trace.Active) trace.Log("*** RemoveBlock: " + block.ToString());

            var nextBlocks = block.NextBlocks.ToArray();

            EmptyBlockOfAllInstructions(block);

            UpdatePhiList(block, nextBlocks);
        }
开发者ID:yonglehou,项目名称:MOSA-Project,代码行数:10,代码来源:SparseConditionalConstantPropagationStage.cs

示例2: RemoveDeadBlock

        protected void RemoveDeadBlock(BasicBlock block)
        {
            //if (block.PreviousBlocks.Count != 0 || BasicBlocks.HeadBlocks.Contains(block))
            //	return;

            if (trace.Active) trace.Log("*** RemoveBlock: " + block.ToString());

            var nextBlocks = block.NextBlocks.ToArray();

            EmptyBlockOfAllInstructions(block);

            UpdatePhiList(block, nextBlocks);

            Debug.Assert(block.NextBlocks.Count == 0);

            //Debug.Assert(block.PreviousBlocks.Count == 0);
        }
开发者ID:tgiphil,项目名称:MOSA-Project,代码行数:17,代码来源:SparseConditionalConstantPropagationStage.cs

示例3: RemoveBlock

        private void RemoveBlock(BasicBlock block, CompilerTrace trace)
        {
            Debug.Assert(block.NextBlocks.Count == 1);

            BasicBlock target = block.NextBlocks[0];

            if (trace.Active)
            {
                trace.Log("====== Removing: " + block.ToString() + " # " + block.Sequence);
                trace.Log("     New Target: " + target.ToString());
                foreach (var from in block.PreviousBlocks)
                {
                    trace.Log("Previous Blocks: " + from.ToString());
                }
            }

            target.PreviousBlocks.Remove(block);

            foreach (var from in block.PreviousBlocks)
            {
                from.NextBlocks.Remove(block);
                from.NextBlocks.AddIfNew(target);

                if (trace.Active)
                {
                    trace.Log("  Add target to NextBlock of " + from.ToString());
                }

                target.PreviousBlocks.AddIfNew(from);

                if (trace.Active)
                {
                    trace.Log("  Add " + from.ToString() + " to PreviousBlock of " + target.ToString());
                }

                ReplaceBranchTargets(from, block, target);
            }

            block.NextBlocks.Clear();
            block.PreviousBlocks.Clear();

            EmptyBlockOfAllInstructions(block);
        }
开发者ID:tea,项目名称:MOSA-Project,代码行数:43,代码来源:EmptyBlockRemovalStage.cs

示例4: ProcessBlock

        private void ProcessBlock(BasicBlock block)
        {
            if (MainTrace.Active) MainTrace.Log("Process Block: " + block.ToString());

            // if the block has only one successor block, add successor block to executed block list
            if (block.NextBlocks.Count == 1)
            {
                AddExecutionBlock(block.NextBlocks[0]);
            }

            ProcessInstructionsContinuiously(block.First);

            // re-analysis phi statements
            var phiUse = phiStatements.Get(block);

            if (phiUse == null)
                return;

            foreach (var index in phiUse)
            {
                AddInstruction(index);
            }
        }
开发者ID:pacificIT,项目名称:MOSA-Project,代码行数:23,代码来源:SparseConditionalConstantPropagation.cs

示例5: CheckAndClearEmptyBlock

        private void CheckAndClearEmptyBlock(BasicBlock block)
        {
            if (block.PreviousBlocks.Count != 0 || BasicBlocks.HeadBlocks.Contains(block))
                return;

            if (trace.Active) trace.Log("*** RemoveBlock: " + block.ToString());

            blockRemovedCount++;

            var nextBlocks = block.NextBlocks.ToArray();

            EmptyBlockOfAllInstructions(block);

            UpdatePhiList(block, nextBlocks);

            Debug.Assert(block.NextBlocks.Count == 0);
            Debug.Assert(block.PreviousBlocks.Count == 0);
        }
开发者ID:Profi-Concept,项目名称:MOSA-Project,代码行数:18,代码来源:IROptimizationStage.cs

示例6: CheckAndClearEmptyBlock

        private void CheckAndClearEmptyBlock(BasicBlock block)
        {
            if (block.PreviousBlocks.Count != 0 || BasicBlocks.HeadBlocks.Contains(block))
                return;

            if (trace.Active) trace.Log("*** RemoveBlock");
            if (trace.Active) trace.Log("    Block: " + block.ToString());

            blockRemovedCount++;

            var nextBlocks = new List<BasicBlock>(block.NextBlocks.Count);

            foreach (var next in block.NextBlocks)
            {
                next.PreviousBlocks.Remove(block);
                nextBlocks.Add(next);
            }

            block.NextBlocks.Clear();

            for (Context context = new Context(InstructionSet, block); !context.IsBlockEndInstruction; context.GotoNext())
            {
                if (context.IsEmpty)
                    continue;

                if (context.IsBlockStartInstruction)
                    continue;

                if (context.Instruction == IRInstruction.Nop)
                    continue;

                AddOperandUsageToWorkList(context);
                if (trace.Active) trace.Log("REMOVED:\t" + context.ToString());
                context.SetInstruction(IRInstruction.Nop);
                instructionsRemovedCount++;
            }

            foreach (var next in nextBlocks)
            {
                CheckAndClearEmptyBlock(next);
            }
        }
开发者ID:tea,项目名称:MOSA-Project,代码行数:42,代码来源:SSAOptimizations.cs


注:本文中的BasicBlock.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。