aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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