public int CompareTo(InstructionBlock block)
 {
     return(first.Offset - block.First.Offset);
 }
Example #2
0
 void RegisterBlock(InstructionBlock block)
 {
     blocks.Add(block.First.Offset, block);
 }
		static int GetBlockId (ControlFlowGraph cfg, InstructionBlock block)
		{
			return ((IList<InstructionBlock>) cfg.Blocks).IndexOf (block) + 1;
		}
Example #4
0
        void ComputeInstructionData(HashSet <InstructionBlock> visited, int stackHeight, InstructionBlock block)
        {
            if (visited.Contains(block))
            {
                return;
            }

            visited.Add(block);

            foreach (var instruction in block)
            {
                stackHeight = ComputeInstructionData(stackHeight, instruction);
            }

            foreach (var successor in block.Successors)
            {
                ComputeInstructionData(visited, stackHeight, successor);
            }
        }