本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
}