summaryrefslogtreecommitdiff
path: root/compiler/main/HscStats.hs
diff options
context:
space:
mode:
authorKavon Farvardin <kavon@farvard.in>2018-09-23 15:29:37 -0500
committerKavon Farvardin <kavon@farvard.in>2018-09-23 15:29:37 -0500
commit84c2ad99582391005b5e873198b15e9e9eb4f78d (patch)
treecaa8c2f2ec7e97fbb4977263c6817c9af5025cf4 /compiler/main/HscStats.hs
parent8ddb47cfcf5776e9a3c55fd37947c8a95e00fa12 (diff)
parente68b439fe5de61b9a2ca51af472185c62ccb8b46 (diff)
downloadhaskell-wip/T13904.tar.gz
update to current master againwip/T13904
Diffstat (limited to 'compiler/main/HscStats.hs')
-rw-r--r--compiler/main/HscStats.hs15
1 files changed, 10 insertions, 5 deletions
diff --git a/compiler/main/HscStats.hs b/compiler/main/HscStats.hs
index 598cb5be0a..ce59ca1877 100644
--- a/compiler/main/HscStats.hs
+++ b/compiler/main/HscStats.hs
@@ -8,6 +8,8 @@
module HscStats ( ppSourceStats ) where
+import GhcPrelude
+
import Bag
import HsSyn
import Outputable
@@ -68,18 +70,18 @@ ppSourceStats short (L _ (HsModule _ exports imports ldecls _ _))
trim ls = takeWhile (not.isSpace) (dropWhile isSpace ls)
(fixity_sigs, bind_tys, bind_specs, bind_inlines, generic_sigs)
- = count_sigs [d | SigD d <- decls]
+ = count_sigs [d | SigD _ d <- decls]
-- NB: this omits fixity decls on local bindings and
-- in class decls. ToDo
- tycl_decls = [d | TyClD d <- decls]
+ tycl_decls = [d | TyClD _ d <- decls]
(class_ds, type_ds, data_ds, newt_ds, type_fam_ds) =
countTyClDecls tycl_decls
- inst_decls = [d | InstD d <- decls]
+ inst_decls = [d | InstD _ d <- decls]
inst_ds = length inst_decls
default_ds = count (\ x -> case x of { DefD{} -> True; _ -> False}) decls
- val_decls = [d | ValD d <- decls]
+ val_decls = [d | ValD _ d <- decls]
real_exports = case exports of { Nothing -> []; Just (L _ es) -> es }
n_exports = length real_exports
@@ -100,7 +102,7 @@ ppSourceStats short (L _ (HsModule _ exports imports ldecls _ _))
(inst_method_ds, method_specs, method_inlines, inst_type_ds, inst_data_ds)
= sum5 (map inst_info inst_decls)
- count_bind (PatBind { pat_lhs = L _ (VarPat _) }) = (1,0,0)
+ count_bind (PatBind { pat_lhs = L _ (VarPat{}) }) = (1,0,0)
count_bind (PatBind {}) = (0,1,0)
count_bind (FunBind {}) = (0,1,0)
count_bind (PatSynBind {}) = (0,0,1)
@@ -118,6 +120,7 @@ ppSourceStats short (L _ (HsModule _ exports imports ldecls _ _))
import_info (L _ (ImportDecl { ideclSafe = safe, ideclQualified = qual
, ideclAs = as, ideclHiding = spec }))
= add7 (1, safe_info safe, qual_info qual, as_info as, 0,0,0) (spec_info spec)
+ import_info (L _ (XImportDecl _)) = panic "import_info"
safe_info = qual_info
qual_info False = 0
qual_info True = 1
@@ -153,6 +156,8 @@ ppSourceStats short (L _ (HsModule _ exports imports ldecls _ _))
ss, is, length ats, length adts)
where
methods = map unLoc $ bagToList inst_meths
+ inst_info (ClsInstD _ (XClsInstDecl _)) = panic "inst_info"
+ inst_info (XInstDecl _) = panic "inst_info"
-- TODO: use Sum monoid
addpr :: (Int,Int,Int) -> Int