on master help sign in
Better unused argument spotting
commit9c0cb925f77839c93bfe006120ce17ab1c6e1136 authorEdwin Brady <ecb10@st-andrews.ac.uk> dateThu 7 Nov 2013, 23:43 (13 years ago) parent18d037f
2 files changed+3
src/Core/CaseTree.hs+1 src/IRTS/Compiler.hs+2
src/Core/CaseTree.hs+1
@@ -136,6 +136,7 @@ findCalls sc topargs = nub $ nu' topargs sc where
136136 | (P Ref n _, args) <- unApply fn
137137 = if n `elem` ps then nut ps f ++ nut ps a
138138 else [(n, map argNames args)] ++ concatMap (nut ps) args
139+ | (P (TCon _ _) n _, _) <- unApply fn = []
139140 | otherwise = nut ps f ++ nut ps a
140141 nut ps (Bind n (Let t v) sc) = nut ps v ++ nut (n:ps) sc
141142 nut ps (Proj t _) = nut ps t
src/IRTS/Compiler.hs+2
@@ -217,6 +217,8 @@ instance ToIR (TT Name) where
217217-- return (LOp LBPlus [k', LConst (BI 1)])
218218 | (P (DCon t a) n _, args) <- unApply tm
219219 = irCon env t a n args
220+ | (P (TCon t a) n _, args) <- unApply tm
221+ = return LNothing
220222 | (P _ n _, args) <- unApply tm
221223 = do i <- getIState
222224 args' <- mapM (ir' env) args