This ensures that every expression will always contain a let at the top
level, since none of the transforms will remove the last let (lets are
only merged when two are nested).
expr_maybe <- getGlobalBind bndr
case expr_maybe of
Just expr -> do
+ -- Introduce an empty Let at the top level, so there will always be
+ -- a let in the expression (none of the transformations will remove
+ -- the last let).
+ let expr' = Let (Rec []) expr
-- Normalize this expression
trace ("Transforming " ++ (show bndr) ++ "\nBefore:\n\n" ++ showSDoc ( ppr expr ) ++ "\n") $ return ()
expr' <- dotransforms transforms expr