From: Matthijs Kooijman Date: Sun, 21 Jun 2009 15:25:56 +0000 (+0200) Subject: Improve debug output timing. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;ds=inline;h=7e65fbaf0756893d3c62faf42d28aa5bd363ae3b;hp=f18e8ab055de511846f09efc7752628013142d0f;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Improve debug output timing. The Before: line is now really printed before the transform, so also when the transform fails. --- diff --git a/Normalize.hs b/Normalize.hs index 0d58d04..647168b 100644 --- a/Normalize.hs +++ b/Normalize.hs @@ -362,14 +362,15 @@ normalizeBind bndr = do case expr_maybe of Just expr -> do -- Normalize this expression + trace ("Transforming " ++ (show bndr) ++ "\nBefore:\n\n" ++ showSDoc ( ppr expr ) ++ "\n") $ return () expr' <- dotransforms transforms expr - let expr'' = trace ("Before:\n\n" ++ showSDoc ( ppr expr ) ++ "\n\nAfter:\n\n" ++ showSDoc ( ppr expr')) expr' + trace ("\nAfter:\n\n" ++ showSDoc ( ppr expr')) $ return () -- And store the normalized version in the session - modA tsBindings (Map.insert bndr expr'') + modA tsBindings (Map.insert bndr expr') -- Find all vars used with a function type. All of these should be global -- binders (i.e., functions used), since any local binders with a function -- type should have been inlined already. - let used_funcs_set = CoreFVs.exprSomeFreeVars (\v -> (Type.isFunTy . snd . Type.splitForAllTys . Id.idType) v) expr'' + let used_funcs_set = CoreFVs.exprSomeFreeVars (\v -> (Type.isFunTy . snd . Type.splitForAllTys . Id.idType) v) expr' let used_funcs = VarSet.varSetElems used_funcs_set -- Process each of the used functions recursively mapM normalizeBind used_funcs