Remove an ifdef
authorIan Lynagh <igloo@earth.li>
Mon, 16 Jun 2008 11:11:14 +0000 (11:11 +0000)
committerIan Lynagh <igloo@earth.li>
Mon, 16 Jun 2008 11:11:14 +0000 (11:11 +0000)
compiler/ghci/RtClosureInspect.hs

index cb16c1d..d342337 100644 (file)
@@ -70,9 +70,7 @@ import Outputable
 import FastString
 import Panic
 
-#ifndef GHCI_TABLES_NEXT_TO_CODE
 import Constants        ( wORD_SIZE )
-#endif
 
 import GHC.Arr          ( Array(..) )
 import GHC.Exts
@@ -180,15 +178,17 @@ getClosureData :: a -> IO Closure
 getClosureData a =
    case unpackClosure# a of 
      (# iptr, ptrs, nptrs #) -> do
-#ifndef GHCI_TABLES_NEXT_TO_CODE
-           -- the info pointer we get back from unpackClosure# is to the
-           -- beginning of the standard info table, but the Storable instance
-           -- for info tables takes into account the extra entry pointer
-           -- when !tablesNextToCode, so we must adjust here:
-           itbl <- peek (Ptr iptr `plusPtr` negate wORD_SIZE)
-#else
-           itbl <- peek (Ptr iptr)
-#endif
+           let iptr'
+                | ghciTablesNextToCode =
+                   Ptr iptr
+                | otherwise =
+                   -- the info pointer we get back from unpackClosure#
+                   -- is to the beginning of the standard info table,
+                   -- but the Storable instance for info tables takes
+                   -- into account the extra entry pointer when
+                   -- !ghciTablesNextToCode, so we must adjust here:
+                   Ptr iptr `plusPtr` negate wORD_SIZE
+           itbl <- peek iptr'
            let tipe = readCType (BCI.tipe itbl)
                elems = fromIntegral (BCI.ptrs itbl)
                ptrsList = Array 0 (elems - 1) elems ptrs