aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordavve <davve@dtek.chalmers.se>2007-01-17 21:40:26 +0000
committerdavve <davve@dtek.chalmers.se>2007-01-17 21:40:26 +0000
commit0ea1e14f473dabe75f9e355dc7d2debeffb0fafc (patch)
treeab4df8a427efcf7aebea481f530a2460ba0e80c7 /src
parent77507eb719d8db00573e5053a45d4bac7b664860 (diff)
Add trace_ppr to GHCUtils
Diffstat (limited to 'src')
-rw-r--r--src/GHCUtils.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/GHCUtils.hs b/src/GHCUtils.hs
index 01bc89f4..e6820c66 100644
--- a/src/GHCUtils.hs
+++ b/src/GHCUtils.hs
@@ -1,7 +1,12 @@
module GHCUtils where
+import Debug.Trace
+
+import GHC
import HsSyn
import SrcLoc
+import HscTypes
+import Outputable
getMainDeclBinder :: HsDecl name -> Maybe name
getMainDeclBinder (TyClD d) = Just (tcdName d)
@@ -13,3 +18,8 @@ getMainDeclBinder (SigD d) = sigNameNoLoc d
getMainDeclBinder (ForD (ForeignImport name _ _)) = Just (unLoc name)
getMainDeclBinder (ForD (ForeignExport name _ _)) = Nothing
getMainDeclBinder _ = Nothing
+
+modInfoName = moduleName . mi_module . minf_iface
+modInfoMod = mi_module . minf_iface
+
+trace_ppr x y = trace (showSDoc (ppr x)) y