Commit 3e0109b3 authored by Krzysztof Gogolewski's avatar Krzysztof Gogolewski
Browse files

Remove deprecated _scc_ (#8170)

parent 3e7b7c3a
......@@ -593,7 +593,7 @@ ppr_expr (EAsPat v e) = ppr v <> char '@' <> pprParendExpr e
ppr_expr (EViewPat p e) = ppr p <+> ptext (sLit "->") <+> ppr e
ppr_expr (HsSCC lbl expr)
= sep [ ptext (sLit "_scc_") <+> doubleQuotes (ftext lbl),
= sep [ ptext (sLit "{-# SCC") <+> doubleQuotes (ftext lbl) <+> ptext (sLit "#-}"),
pprParendExpr expr ]
ppr_expr (HsWrap co_fn e) = pprHsWrapper (pprExpr e) co_fn
......
......@@ -660,7 +660,6 @@ reservedWordsFM = listToUFM $
( "then", ITthen, 0 ),
( "type", ITtype, 0 ),
( "where", ITwhere, 0 ),
( "_scc_", ITscc, 0 ), -- ToDo: remove
( "forall", ITforall, bit explicitForallBit .|.
bit inRulePragBit),
......
......@@ -227,7 +227,6 @@ incorrect.
'then' { L _ ITthen }
'type' { L _ ITtype }
'where' { L _ ITwhere }
'_scc_' { L _ ITscc } -- ToDo: remove
'forall' { L _ ITforall } -- GHC extension keywords
'foreign' { L _ ITforeign }
......@@ -1504,9 +1503,7 @@ optSemi :: { Bool }
| {- empty -} { False }
scc_annot :: { Located FastString }
: '_scc_' STRING {% (addWarning Opt_WarnWarningsDeprecations (getLoc $1) (text "_scc_ is deprecated; use an SCC pragma instead")) >>= \_ ->
( do scc <- getSCC $2; return $ LL scc ) }
| '{-# SCC' STRING '#-}' {% do scc <- getSCC $2; return $ LL scc }
: '{-# SCC' STRING '#-}' {% do scc <- getSCC $2; return $ LL scc }
| '{-# SCC' VARID '#-}' { LL (getVARID $2) }
hpc_annot :: { Located (FastString,(Int,Int),(Int,Int)) }
......
......@@ -591,12 +591,12 @@ mkUnpackCase scrut uniq boxing_con unpk_args body
Note [Profiling and unpacking]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If the original function looked like
f = \ x -> _scc_ "foo" E
f = \ x -> {-# SCC "foo" #-} E
then we want the CPR'd worker to look like
\ x -> _scc_ "foo" (case E of I# x -> x)
\ x -> {-# SCC "foo" #-} (case E of I# x -> x)
and definitely not
\ x -> case (_scc_ "foo" E) of I# x -> x)
\ x -> case ({-# SCC "foo" #-} E) of I# x -> x)
This transform doesn't move work or allocation
from one cost centre to another.
......
......@@ -66,7 +66,7 @@ Mutex ccs_mutex;
* Built-in cost centres and cost-centre stacks:
*
* MAIN is the root of the cost-centre stack tree. If there are
* no _scc_s in the program, all costs will be attributed
* no {-# SCC #-}s in the program, all costs will be attributed
* to MAIN.
*
* SYSTEM is the RTS in general (scheduler, etc.). All costs for
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment