diff options
author | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2020-07-11 03:02:09 +0200 |
---|---|---|
committer | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2020-07-12 18:22:46 +0200 |
commit | 494f55ec7ce17302c345e961d3a0b14da80ad72e (patch) | |
tree | d362944c95463faf9cf881deb28fd7849172e079 | |
parent | c4de6a7a5c6433ae8c4df8a9fa09fbd9f3bbd0bf (diff) | |
download | haskell-wip/no-core.tar.gz |
Remove {-# CORE #-} pragma (part of #18048)wip/no-core
This pragma has no effect since 2011.
It was introduced for External Core, which no longer exists.
Updates haddock submodule.
-rw-r--r-- | compiler/GHC/Hs/Expr.hs | 11 | ||||
-rw-r--r-- | compiler/GHC/HsToCore/Expr.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/HsToCore/Quote.hs | 1 | ||||
-rw-r--r-- | compiler/GHC/Parser.y | 9 | ||||
-rw-r--r-- | compiler/GHC/Parser/Lexer.x | 2 | ||||
-rw-r--r-- | compiler/GHC/Rename/Expr.hs | 1 | ||||
-rw-r--r-- | compiler/GHC/Tc/Gen/Expr.hs | 1 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/annotations/Test10313.hs | 3 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/annotations/stringSource.hs | 1 | ||||
-rw-r--r-- | testsuite/tests/printer/Ppr009.hs | 3 | ||||
m--------- | utils/haddock | 0 |
11 files changed, 3 insertions, 31 deletions
diff --git a/compiler/GHC/Hs/Expr.hs b/compiler/GHC/Hs/Expr.hs index 9f5e6a7ef2..1cff36309a 100644 --- a/compiler/GHC/Hs/Expr.hs +++ b/compiler/GHC/Hs/Expr.hs @@ -685,14 +685,6 @@ data HsPragE p SourceText -- Note [Pragma source text] in GHC.Types.Basic StringLiteral -- "set cost centre" SCC pragma - -- | - 'GHC.Parser.Annotation.AnnKeywordId' : 'GHC.Parser.Annotation.AnnOpen' @'{-\# CORE'@, - -- 'GHC.Parser.Annotation.AnnVal', 'GHC.Parser.Annotation.AnnClose' @'\#-}'@ - - -- For details on above see note [Api annotations] in GHC.Parser.Annotation - | HsPragCore (XCoreAnn p) - SourceText -- Note [Pragma source text] in GHC.Types.Basic - StringLiteral -- hdaume: core annotation - -- | - 'GHC.Parser.Annotation.AnnKeywordId' : 'GHC.Parser.Annotation.AnnOpen', -- 'GHC.Parser.Annotation.AnnOpen' @'{-\# GENERATED'@, -- 'GHC.Parser.Annotation.AnnVal','GHC.Parser.Annotation.AnnVal', @@ -1246,9 +1238,6 @@ isAtomicHsExpr (XExpr x) isAtomicHsExpr _ = False instance Outputable (HsPragE (GhcPass p)) where - ppr (HsPragCore _ stc (StringLiteral sta s)) = - pprWithSourceText stc (text "{-# CORE") - <+> pprWithSourceText sta (doubleQuotes $ ftext s) <+> text "#-}" ppr (HsPragSCC _ st (StringLiteral stl lbl)) = pprWithSourceText st (text "{-# SCC") -- no doublequotes if stl empty, for the case where the SCC was written diff --git a/compiler/GHC/HsToCore/Expr.hs b/compiler/GHC/HsToCore/Expr.hs index 696cebe565..181f0b836a 100644 --- a/compiler/GHC/HsToCore/Expr.hs +++ b/compiler/GHC/HsToCore/Expr.hs @@ -822,8 +822,6 @@ ds_prag_expr (HsPragSCC _ _ cc) expr = do Tick (ProfNote (mkUserCC nm mod_name (getLoc expr) flavour) count True) <$> dsLExpr expr else dsLExpr expr -ds_prag_expr (HsPragCore _ _ _) expr - = dsLExpr expr ds_prag_expr (HsPragTick _ _ _ _) expr = do dflags <- getDynFlags if gopt Opt_Hpc dflags diff --git a/compiler/GHC/HsToCore/Quote.hs b/compiler/GHC/HsToCore/Quote.hs index cdea4a6ff5..d92c442bce 100644 --- a/compiler/GHC/HsToCore/Quote.hs +++ b/compiler/GHC/HsToCore/Quote.hs @@ -1570,7 +1570,6 @@ repE (HsUnboundVar _ uv) = do sname <- repNameS occ repUnboundVar sname -repE e@(HsPragE _ HsPragCore {} _) = notHandled "Core annotations" (ppr e) repE e@(HsPragE _ HsPragSCC {} _) = notHandled "Cost centres" (ppr e) repE e@(HsPragE _ HsPragTick {} _) = notHandled "Tick Pragma" (ppr e) repE e = notHandled "Expression form" (ppr e) diff --git a/compiler/GHC/Parser.y b/compiler/GHC/Parser.y index 041b25d586..8c9f0f8ef2 100644 --- a/compiler/GHC/Parser.y +++ b/compiler/GHC/Parser.y @@ -521,7 +521,6 @@ are the most common patterns, rewritten as regular expressions for clarity: '{-# SPECIALISE_INLINE' { L _ (ITspec_inline_prag _ _) } '{-# SOURCE' { L _ (ITsource_prag _) } '{-# RULES' { L _ (ITrules_prag _) } - '{-# CORE' { L _ (ITcore_prag _) } -- hdaume: annotated core '{-# SCC' { L _ (ITscc_prag _)} '{-# GENERATED' { L _ (ITgenerated_prag _) } '{-# DEPRECATED' { L _ (ITdeprecated_prag _) } @@ -2695,7 +2694,7 @@ optSemi :: { ([Located Token],Bool) } {- Note [Pragmas and operator fixity] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -'prag_e' is an expression pragma, such as {-# SCC ... #-}, {-# CORE ... #-}, or +'prag_e' is an expression pragma, such as {-# SCC ... #-} or {-# GENERATED ... #-}. It must be used with care, or else #15730 happens. Consider this infix @@ -2764,11 +2763,6 @@ prag_e :: { Located ([AddAnn], HsPragE GhcPs) } (getINT $7, getINT $9)) ((getINTEGERs $3, getINTEGERs $5), (getINTEGERs $7, getINTEGERs $9) )) } - | '{-# CORE' STRING '#-}' - { sLL $1 $> $ - ([mo $1,mj AnnVal $2,mc $3], - HsPragCore noExtField (getCORE_PRAGs $1) (getStringLiteral $2)) } - fexp :: { ECP } : fexp aexp { ECP $ superFunArg $ @@ -3915,7 +3909,6 @@ getWARNING_PRAGs (L _ (ITwarning_prag src)) = src getDEPRECATED_PRAGs (L _ (ITdeprecated_prag src)) = src getSCC_PRAGs (L _ (ITscc_prag src)) = src getGENERATED_PRAGs (L _ (ITgenerated_prag src)) = src -getCORE_PRAGs (L _ (ITcore_prag src)) = src getUNPACK_PRAGs (L _ (ITunpack_prag src)) = src getNOUNPACK_PRAGs (L _ (ITnounpack_prag src)) = src getANN_PRAGs (L _ (ITann_prag src)) = src diff --git a/compiler/GHC/Parser/Lexer.x b/compiler/GHC/Parser/Lexer.x index a2ca634c53..ef9f1803bf 100644 --- a/compiler/GHC/Parser/Lexer.x +++ b/compiler/GHC/Parser/Lexer.x @@ -743,7 +743,6 @@ data Token | ITcolumn_prag SourceText -- not usually produced, see 'UsePosPragsBit' | ITscc_prag SourceText | ITgenerated_prag SourceText - | ITcore_prag SourceText -- hdaume: core annotations | ITunpack_prag SourceText | ITnounpack_prag SourceText | ITann_prag SourceText @@ -3230,7 +3229,6 @@ oneWordPrags = Map.fromList [ ("deprecated", strtoken (\s -> ITdeprecated_prag (SourceText s))), ("scc", strtoken (\s -> ITscc_prag (SourceText s))), ("generated", strtoken (\s -> ITgenerated_prag (SourceText s))), - ("core", strtoken (\s -> ITcore_prag (SourceText s))), ("unpack", strtoken (\s -> ITunpack_prag (SourceText s))), ("nounpack", strtoken (\s -> ITnounpack_prag (SourceText s))), ("ann", strtoken (\s -> ITann_prag (SourceText s))), diff --git a/compiler/GHC/Rename/Expr.hs b/compiler/GHC/Rename/Expr.hs index 2bfba1fb7f..7d4f1fde7d 100644 --- a/compiler/GHC/Rename/Expr.hs +++ b/compiler/GHC/Rename/Expr.hs @@ -242,7 +242,6 @@ rnExpr (HsPragE x prag expr) where rn_prag :: HsPragE GhcPs -> HsPragE GhcRn rn_prag (HsPragSCC x1 src ann) = HsPragSCC x1 src ann - rn_prag (HsPragCore x1 src lbl) = HsPragCore x1 src lbl rn_prag (HsPragTick x1 src info srcInfo) = HsPragTick x1 src info srcInfo rnExpr (HsLam x matches) diff --git a/compiler/GHC/Tc/Gen/Expr.hs b/compiler/GHC/Tc/Gen/Expr.hs index eaf3a3db0c..f2456df368 100644 --- a/compiler/GHC/Tc/Gen/Expr.hs +++ b/compiler/GHC/Tc/Gen/Expr.hs @@ -1081,7 +1081,6 @@ tcExpr other _ = pprPanic "tcLExpr" (ppr other) tcExprPrag :: HsPragE GhcRn -> HsPragE GhcTc tcExprPrag (HsPragSCC x1 src ann) = HsPragSCC x1 src ann -tcExprPrag (HsPragCore x1 src lbl) = HsPragCore x1 src lbl tcExprPrag (HsPragTick x1 src info srcInfo) = HsPragTick x1 src info srcInfo diff --git a/testsuite/tests/ghc-api/annotations/Test10313.hs b/testsuite/tests/ghc-api/annotations/Test10313.hs index 130e84b0e3..b8ed962a62 100644 --- a/testsuite/tests/ghc-api/annotations/Test10313.hs +++ b/testsuite/tests/ghc-api/annotations/Test10313.hs @@ -28,8 +28,7 @@ foreign import prim unsafe "a\x62" a :: IO Int {-# INLINE strictStream #-} strictStream (Bitstream l v) - = {-# CORE "Strict Bitstream stre\x61m" #-} - S.concatMap stream (GV.stream v) + = S.concatMap stream (GV.stream v) `S.sized` Exact l diff --git a/testsuite/tests/ghc-api/annotations/stringSource.hs b/testsuite/tests/ghc-api/annotations/stringSource.hs index 776aebd048..2bc2638e84 100644 --- a/testsuite/tests/ghc-api/annotations/stringSource.hs +++ b/testsuite/tests/ghc-api/annotations/stringSource.hs @@ -84,7 +84,6 @@ testOneFile libdir fileName = do doHsExpr _ = [] doPragE :: HsPragE GhcPs -> [(String,[Located (SourceText,FastString)])] - doPragE (HsPragCore _ src ss) = [("co",[conv (noLoc ss)])] doPragE (HsPragSCC _ src ss) = [("sc",[conv (noLoc ss)])] doPragE (HsPragTick _ src (ss,_,_) _ss2) = [("tp",[conv (noLoc ss)])] diff --git a/testsuite/tests/printer/Ppr009.hs b/testsuite/tests/printer/Ppr009.hs index d24ecdc517..baaeb211db 100644 --- a/testsuite/tests/printer/Ppr009.hs +++ b/testsuite/tests/printer/Ppr009.hs @@ -3,7 +3,6 @@ module Ppr009 where {-# INLINE strictStream #-} strictStream (Bitstream l v) - = {-# CORE "Strict Bitstream stream" #-} - S.concatMap stream (GV.stream v) + = S.concatMap stream (GV.stream v) `S.sized` Exact l diff --git a/utils/haddock b/utils/haddock -Subproject 075067254fc30ef56bad67ac65dd3c5f4101f8f +Subproject 22b42eab6ec6b3b321b6d54041b7b3a6e54af3c |