X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fmaster-project%2Fc%CE%BBash.git;a=blobdiff_plain;f=c%CE%BBash%2FCLasH%2FNormalize.hs;h=977cc0d804197915b776c77ed43645ff39fb1005;hp=dc3c0c2052141045c09b53f6af5af42012a50d6d;hb=675ebbda1e9efc84abc96b6e0cbf36391be3690e;hpb=2884f7deed39c010b7c246d164afcf1056588a25 diff --git "a/c\316\273ash/CLasH/Normalize.hs" "b/c\316\273ash/CLasH/Normalize.hs" index dc3c0c2..977cc0d 100644 --- "a/c\316\273ash/CLasH/Normalize.hs" +++ "b/c\316\273ash/CLasH/Normalize.hs" @@ -968,13 +968,14 @@ normalizeExpr :: normalizeExpr what expr = do startcount <- MonadState.get tsTransformCounter expr_uniqued <- genUniques expr + -- Do a debug print, if requested + let expr_uniqued' = Utils.traceIf (normalize_debug >= NormDbgFinal) (what ++ " before normalization:\n\n" ++ showSDoc ( ppr expr_uniqued ) ++ "\n") expr_uniqued -- Normalize this expression - trace (what ++ " before normalization:\n\n" ++ showSDoc ( ppr expr_uniqued ) ++ "\n") $ return () - expr' <- dotransforms transforms expr_uniqued + expr' <- dotransforms transforms expr_uniqued' endcount <- MonadState.get tsTransformCounter - trace ("\n" ++ what ++ " after normalization:\n\n" ++ showSDoc ( ppr expr') - ++ "\nNeeded " ++ show (endcount - startcount) ++ " transformations to normalize " ++ what) $ - return expr' + -- Do a debug print, if requested + Utils.traceIf (normalize_debug >= NormDbgFinal) (what ++ " after normalization:\n\n" ++ showSDoc ( ppr expr') ++ "\nNeeded " ++ show (endcount - startcount) ++ " transformations to normalize " ++ what) $ + return expr' -- | Split a normalized expression into the argument binders, top level -- bindings and the result binder. This function returns an error if