internal void SelfRemove() { DataFlowForwardRelated.RemoveAllTwoWay(); DataFlowBackRelated.RemoveAllTwoWay(); foreach (var forwardRoute in ProgramFlowForwardRoutes) { forwardRoute.ProgramFlowBackRoutes.AddTwoWay(ProgramFlowBackRoutes); } //RemoveFromBranches(); ProgramFlowBackRoutes.RemoveAllTwoWay(); ProgramFlowForwardRoutes.RemoveAllTwoWay(); }
internal virtual void SelfRemoveAndStitch() { foreach (var forwardInst in DataFlowForwardRelated.ToArray()) { int index = forwardInst.ArgIndex; forwardInst.MirrorArg.ContainingList.AddTwoWay(DataFlowBackRelated.Select(x => x.Argument).ToList(), index); forwardInst.ContainingList.RemoveTwoWay(forwardInst); } foreach (var forwardPath in ProgramFlowForwardRoutes.ToArray()) { forwardPath.ProgramFlowBackRoutes.AddTwoWay(ProgramFlowBackRoutes.ToList()); ProgramFlowForwardRoutes.RemoveTwoWay(forwardPath); } RemoveFromBranches(); DataFlowBackRelated.RemoveAllTwoWay(); foreach (CoupledList related in new CoupledList[] { ProgramFlowBackRoutes, SingleUnitBackRelated, SingleUnitForwardRelated }) { related.RemoveAllTwoWay(); } }
public InstructionNode(Instruction instruction, MethodDefinition method) { Instruction = instruction; Method = method; // TODO rework, this must precede StackPopCount for now, yuck DataFlowBackRelated = new DataFlowBackArgList(this); StackPushCount = GetStackPushCount(instruction); StackPopCount = GetStackPopCount(instruction); MemoryReadCount = MemoryProperties.GetMemReadCount(instruction.OpCode.Code); MemoryStoreCount = MemoryProperties.GetMemStoreCount(instruction.OpCode.Code); ProgramFlowBackRoutes = new ProgramFlowBackRoutes(this); ProgramFlowForwardRoutes = new ProgramFlowForwardRoutes(this); DataFlowForwardRelated = new DataFlowForwardArgList(this); SingleUnitBackRelated = new SingleUnitBackRelated(this); SingleUnitForwardRelated = new SingleUnitForwardRelated(this); SingleUnitNodes = new List <InstructionNode>(); MethodNameForSerilization = method.Name; MyGuid = Guid.NewGuid(); _BranchProperties = new BranchProperties(this); BranchProperties.BaseBranch.AddTwoWay(this); }