X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FdeSugar%2FDesugar.lhs;h=742bcb318e9ebac6840a0139e8678be628ae8a0f;hb=a3f24157839605f19e869fdde8cd73266fecf4ac;hp=f9e6212b18b8f0bbdaf57d0dff35702349034fdc;hpb=f6ff984bd9a556b547760fd09971fd5e023af189;p=ghc-hetmet.git diff --git a/compiler/deSugar/Desugar.lhs b/compiler/deSugar/Desugar.lhs index f9e6212..742bcb3 100644 --- a/compiler/deSugar/Desugar.lhs +++ b/compiler/deSugar/Desugar.lhs @@ -8,8 +8,6 @@ The Desugarer: turning HsSyn into Core. \begin{code} module Desugar ( deSugar, deSugarExpr ) where -#include "HsVersions.h" - import DynFlags import StaticFlags import HscTypes @@ -39,8 +37,8 @@ import Outputable import SrcLoc import Maybes import FastString -import Pretty ( Doc ) import Coverage + import Data.IORef \end{code} @@ -152,13 +150,15 @@ mkAutoScc mod exports | not opt_SccProfilingOn -- No profiling = NoSccs | opt_AutoSccsOnAllToplevs -- Add auto-scc on all top-level things - = AddSccs mod (\_ -> True) + = AddSccs mod (\id -> not $ isDerivedOccName $ getOccName id) + -- See #1641. This is pretty yucky, but I can't see a better way + -- to identify compiler-generated Ids, and at least this should + -- catch them all. | opt_AutoSccsOnExportedToplevs -- Only on exported things = AddSccs mod (\id -> idName id `elemNameSet` exports) | otherwise = NoSccs - deSugarExpr :: HscEnv -> Module -> GlobalRdrEnv -> TypeEnv -> LHsExpr Id @@ -232,7 +232,7 @@ addExportFlags target exports keep_alive prs rules is_exported | target == HscInterpreted = isExternalName | otherwise = (`elemNameSet` exports) -ppr_ds_rules :: [CoreRule] -> PprStyle -> Doc +ppr_ds_rules :: [CoreRule] -> SDoc ppr_ds_rules [] = empty ppr_ds_rules rules = text "" $$ text "-------------- DESUGARED RULES -----------------" $$ @@ -274,6 +274,6 @@ dsRule (L loc (HsRule name act vars lhs _tv_lhs rhs _fv_rhs)) ; return (Just rule) } } } where - msg = hang (ptext SLIT("RULE left-hand side too complicated to desugar; ignored")) + msg = hang (ptext (sLit "RULE left-hand side too complicated to desugar; ignored")) 2 (ppr lhs) \end{code}