debug: remove #ifdef's and use dumb logger
[mate.git] / Mate / Utilities.hs
index 8f234e5394ab5faba2ddc58cae9c019bc3845172..43e264ce76877fa0b5d3c4fc5f9c10da7803ec35 100644 (file)
@@ -1,4 +1,3 @@
-{-# LANGUAGE CPP #-}
 {-# LANGUAGE OverloadedStrings #-}
 module Mate.Utilities where
 
@@ -14,10 +13,6 @@ import JVM.ClassFile
 import Mate.Types
 import Mate.NativeSizes
 
-#ifdef DEBUG
-import Text.Printf
-#endif
-
 buildMethodID :: Class Direct -> Word16 -> MethodInfo
 buildMethodID cls idx = MethodInfo (ntName nt) rc (ntSignature nt)
   where
@@ -76,15 +71,3 @@ methodIsStatic = S.member ACC_STATIC . methodAccessFlags
 lookupMethodSig :: B.ByteString -> MethodSignature -> Class Direct -> Maybe (Method Direct)
 lookupMethodSig name sig cls =
   find (\x -> methodName x == name && methodSignature x == sig) $ classMethods cls
-
-hexDumpMap :: Integral v => String -> M.Map B.ByteString v -> IO ()
-#ifdef DEBUG
-hexDumpMap header mmap = do
-  let printValue :: B.ByteString -> IO ()
-      printValue key = printf "\t%-70s: 0x%08x\n" (toString key) val
-        where val = fromIntegral (mmap M.! key) :: NativeWord
-  printf "%s\n" header
-  mapM_ printValue (M.keys mmap)
-#else
-hexDumpMap _ _ = return ()
-#endif