modules: move (public) datatypes into a new module
[mate.git] / Mate / BasicBlocks.hs
index 14f89997b61caf1a93d3728d504ea5af99f7ae27..229325d6a36423514d95f29dee312746a215854b 100644 (file)
@@ -6,7 +6,8 @@ module Mate.BasicBlocks(
   MapBB,
   printMapBB,
   parseMethod,
-  test_main
+  test_main,
+  testCFG -- added by hs to perform benches from outside
   )where
 
 import Data.Binary
@@ -20,22 +21,10 @@ import JVM.Converter
 import JVM.Assembler
 
 import Mate.Utilities
+import Mate.Types
 
 
-type BlockID = Int
--- Represents a CFG node
-data BasicBlock = BasicBlock {
-                     -- inputs  :: [Variable],
-                     -- outputs :: [Variable],
-                     code    :: [Instruction],
-                     successor :: BBEnd }
-
--- describes (leaving) edges of a CFG node
-data BBEnd = Return | FallThrough BlockID | OneTarget BlockID | TwoTarget BlockID BlockID deriving Show
-
-type MapBB = M.Map BlockID BasicBlock
-
--- for immediate representation for determine BBs
+-- for immediate representation to determine BBs
 type Offset = (Int, Maybe BBEnd) -- (offset in bytecode, offset to jump target)
 type OffIns = (Offset, Instruction)