public override bool Branch(Label pc, Label target, bool leavesExceptionBlock, BlockWithLabels <Label> currentBlock) { currentBlock.AddLabel(pc); CurrentSubroutine.AddSuccessor(currentBlock, EdgeTag.Branch, CurrentSubroutine.GetTargetBlock(target)); return(true); }
public override bool Return(Label pc, Dummy source, BlockWithLabels <Label> currentBlock) { currentBlock.AddLabel(pc); CurrentSubroutine.AddSuccessor(currentBlock, EdgeTag.Return, CurrentSubroutine.Exit); CurrentSubroutine.AddReturnBlock(currentBlock); return(true); }
private bool HandleConditionalBranch(Label pc, Label target, bool isTrueBranch, BlockWithLabels <Label> currentBlock) { currentBlock.AddLabel(pc); EdgeTag trueTag = isTrueBranch ? EdgeTag.True : EdgeTag.False; EdgeTag falseTag = isTrueBranch ? EdgeTag.False : EdgeTag.True; AssumeBlock <Label> trueBlock = CurrentSubroutine.NewAssumeBlock(pc, trueTag); this.builder.RecordInformationSameAsOtherBlock(trueBlock, this.current_block); CurrentSubroutine.AddSuccessor(currentBlock, trueTag, trueBlock); CurrentSubroutine.AddSuccessor(trueBlock, EdgeTag.FallThrough, CurrentSubroutine.GetTargetBlock(target)); AssumeBlock <Label> falseBlock = CurrentSubroutine.NewAssumeBlock(pc, falseTag); this.builder.RecordInformationSameAsOtherBlock(falseBlock, this.current_block); CurrentSubroutine.AddSuccessor(currentBlock, falseTag, falseBlock); this.current_block = falseBlock; return(false); }
public override bool EndFinally(Label pc, BlockWithLabels <Label> currentBlock) { currentBlock.AddLabel(pc); CurrentSubroutine.AddSuccessor(currentBlock, EdgeTag.EndSubroutine, CurrentSubroutine.Exit); return(true); }
public override bool Rethrow(Label pc, BlockWithLabels <Label> currentBlock) { currentBlock.AddLabel(pc); return(true); }
public override bool Throw(Label pc, Dummy exception, BlockWithLabels <Label> currentBlock) { currentBlock.AddLabel(pc); return(true); }
public override bool DefaultVisit(Label pc, BlockWithLabels <Label> currentBlock) { currentBlock.AddLabel(pc); return(false); }