[Git][ghc/ghc][wip/sjakobi/deprecated-flags-2016] 2 commits: Make T2464 actually test #ifdef'd pragmas
Simon Jakobi pushed to branch wip/sjakobi/deprecated-flags-2016 at Glasgow Haskell Compiler / GHC Commits: 62b509fe by Simon Jakobi at 2026-10-13T21:43:20+02:00 Make T2464 actually test #ifdef'd pragmas The test guarded a LANGUAGE EmptyDataDecls pragma behind #if, but EmptyDataDecls is on by default since Haskell2010, so the module compiled even when the guarded pragma was ignored. Guard MagicHash instead, which is unlikely to be included in a future default language. The test also checks that warnings from file-header pragmas are emitted only once, even though the pragmas are parsed both before and after CPP, using the -fffi deprecation warning as the canary. Use an unrecognised warning flag instead, so the test no longer depends on a deprecated flag that is about to be removed. Context: #27939 Assisted-by: Claude Fable 5.1 - - - - - 15f211c9 by Simon Jakobi at 2026-10-13T22:00:15+02:00 Remove command-line flags deprecated in GHC 8.2 or earlier Also remove the INCLUDE file-header pragma, which only expanded to the now-removed -#include. Closes #27939. Assisted-by: Claude Fable 5.1 - - - - - 29 changed files: - + changelog.d/remove-long-deprecated-flags.md - compiler/GHC/CmmToC.hs - compiler/GHC/CoreToStg.hs - compiler/GHC/Driver/Flags.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Parser/Errors/Ppr.hs - compiler/GHC/Parser/Errors/Types.hs - compiler/GHC/Parser/Header.hs - compiler/GHC/Parser/Lexer.x - compiler/GHC/Stg/Make.hs - compiler/GHC/Types/Tickish.hs - docs/users_guide/codegens.rst - docs/users_guide/expected-undocumented-flags.txt - docs/users_guide/exts/control.rst - docs/users_guide/exts/ffi.rst - docs/users_guide/exts/pragmas.rst - docs/users_guide/ghc.rst - docs/users_guide/profiling.rst - − docs/users_guide/what_glasgow_exts_does.rst - testsuite/tests/driver/Makefile - testsuite/tests/driver/T2464.hs - testsuite/tests/driver/T2464.stderr - testsuite/tests/ffi/should_run/T2594.hs - testsuite/tests/ffi/should_run/ffi015.hs - testsuite/tests/ffi/should_run/fptr01.hs - testsuite/tests/ffi/should_run/fptrfail01.hs - testsuite/tests/indexed-types/should_compile/all.T - testsuite/tests/indexed-types/should_fail/SkolemOccursLoop.hs - utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs Changes: ===================================== changelog.d/remove-long-deprecated-flags.md ===================================== @@ -0,0 +1,15 @@ +section: compiler +synopsis: Remove command-line flags deprecated in GHC 8.2 or earlier +issues: #27939 +mrs: !16801 +description: { + The following flags, deprecated in GHC 8.2 or earlier, are no longer + accepted: ``-n``, ``-Onot``, ``-recomp``, ``-syslib``, ``-package-conf``, + ``-no-user-package-conf``, ``-auto``, ``-auto-all``, ``-caf-all``, + ``-fglasgow-exts``, ``-frewrite-rules``, ``-fvia-C``, ``-fcontext-stack``, + ``-ftype-function-depth``, ``-#include``, the pre-``-X`` extension + spellings such as ``-fth`` and ``-fffi``, and their negations. + + The ``INCLUDE`` file-header pragma, which only expanded to ``-#include``, + is no longer recognised either. +} ===================================== compiler/GHC/CmmToC.hs ===================================== @@ -8,8 +8,6 @@ -- -- (c) The University of Glasgow 2004-2006 -- --- Print Cmm as real C, for -fvia-C --- -- See wiki:commentary/compiler/backends/ppr-c -- -- This is simpler than the old PprAbsC, because Cmm is "macro-expanded" ===================================== compiler/GHC/CoreToStg.hs ===================================== @@ -190,12 +190,12 @@ We now initialize these correctly. The initialization works like this: - For top-level bindings, check if the binding is a CAF - - CAF: If -fcaf-all is enabled, create a new CAF just for this CAF + - CAF: If -fprof-cafs is enabled, create a new CAF just for this CAF and use it. Note that these new cost centres need to be collected to be able to generate cost centre initialization code, so `coreToTopStgRhs` now returns `CollectedCCs`. - If -fcaf-all is not enabled, use "all CAFs" cost centre. + If -fprof-cafs is not enabled, use "all CAFs" cost centre. - Non-CAF: Top-level (static) data is not counted in heap profiles; nor do we set CCCS from it; so we just slam in ===================================== compiler/GHC/Driver/Flags.hs ===================================== @@ -35,7 +35,6 @@ module GHC.Driver.Flags , validHoleFitsImpliedGFlags , impliedGFlags , impliedOffGFlags - , glasgowExtsFlags , ExtensionDeprecation(..) , Deprecation(..) @@ -403,41 +402,6 @@ impliedGFlags = [(Opt_DeferTypeErrors, turnOn, Opt_DeferTypedHoles) impliedOffGFlags :: [(GeneralFlag, TurnOnFlag, GeneralFlag)] impliedOffGFlags = [(Opt_Strictness, turnOff, Opt_WorkerWrapper)] --- Please keep @docs/users_guide/what_glasgow_exts_does.rst@ up to date with this list. -glasgowExtsFlags :: [LangExt.Extension] -glasgowExtsFlags = [ - LangExt.ConstrainedClassMethods - , LangExt.DeriveDataTypeable - , LangExt.DeriveFoldable - , LangExt.DeriveFunctor - , LangExt.DeriveGeneric - , LangExt.DeriveTraversable - , LangExt.EmptyDataDecls - , LangExt.ExistentialQuantification - , LangExt.ExplicitNamespaces - , LangExt.FlexibleContexts - , LangExt.FlexibleInstances - , LangExt.ForeignFunctionInterface - , LangExt.FunctionalDependencies - , LangExt.GeneralizedNewtypeDeriving - , LangExt.ImplicitParams - , LangExt.KindSignatures - , LangExt.LiberalTypeSynonyms - , LangExt.MagicHash - , LangExt.MultiParamTypeClasses - , LangExt.ParallelListComp - , LangExt.PatternGuards - , LangExt.PostfixOperators - , LangExt.RankNTypes - , LangExt.RecursiveDo - , LangExt.ScopedTypeVariables - , LangExt.StandaloneDeriving - , LangExt.TypeOperators - , LangExt.TypeSynonymInstances - , LangExt.UnboxedTuples - , LangExt.UnicodeSyntax - , LangExt.UnliftedFFITypes ] - -- | Debugging flags data DumpFlag -- See Note [Updating flag description in the User's Guide] in GHC.Driver.Session ===================================== compiler/GHC/Driver/Session.hs ===================================== @@ -21,7 +21,6 @@ module GHC.Driver.Session ( Language(..), FatalMessager, FlushOut(..), ProfAuto(..), - glasgowExtsFlags, hasPprDebug, hasNoDebugOutput, hasNoStateHack, hasNoOptCoercion, dopt, dopt_set, dopt_unset, gopt, gopt_set, gopt_unset, setGeneralFlag', unSetGeneralFlag', @@ -55,7 +54,7 @@ module GHC.Driver.Session ( PackageDBFlag(..), PkgDbRef(..), Option(..), showOpt, DynLibLoader(..), - fFlags, fLangFlags, xFlags, + fFlags, xFlags, wWarningFlags, makeDynFlagsConsistent, positionIndependent, @@ -1084,14 +1083,8 @@ add_dep_message (AnySuffix f) message = -- See Note [Supporting CLI completion] dynamic_flags_deps :: [(Deprecation, Flag (CmdLineP DynFlags))] dynamic_flags_deps = [ - make_dep_flag defFlag "n" (NoArg $ return ()) - "The -n flag is deprecated and no longer has any effect" - , make_ord_flag defFlag "cpp" (NoArg (setExtensionFlag LangExt.Cpp)) + make_ord_flag defFlag "cpp" (NoArg (setExtensionFlag LangExt.Cpp)) , make_ord_flag defFlag "F" (NoArg (setGeneralFlag Opt_Pp)) - , (Deprecated, defFlag "#include" - (HasArg (\_s -> - deprecate ("-#include and INCLUDE pragmas are " ++ - "deprecated: They no longer have any effect")))) , make_ord_flag defFlag "v" (OptIntSuffix setVerbosity) , make_ord_flag defGhcFlag "j" (OptIntSuffix @@ -1408,13 +1401,6 @@ dynamic_flags_deps = [ (NoArg (setGeneralFlag Opt_Ticky_Dyn_Thunk)) , make_ord_flag defGhcFlag "ticky-tag-checks" (NoArg (setGeneralFlag Opt_Ticky_Tag)) - - ------- recompilation checker -------------------------------------- - , make_dep_flag defGhcFlag "recomp" - (NoArg $ unSetGeneralFlag Opt_ForceRecomp) - "Use -fno-force-recomp instead" - , make_dep_flag defGhcFlag "no-recomp" - (NoArg $ setGeneralFlag Opt_ForceRecomp) "Use -fforce-recomp instead" , make_ord_flag defFlag "fmax-errors" (intSuffix (\n d -> d { maxErrors = Just (max 1 n) })) , make_ord_flag defFlag "fno-max-errors" @@ -1772,8 +1758,6 @@ dynamic_flags_deps = [ , make_ord_flag defGhcFlag "fplugin-library" (hasArg addExternalPlugin) ------ Optimisation flags ------------------------------------------ - , make_dep_flag defGhcFlag "Onot" (noArgM $ setOptLevel 0 ) - "Use -O0 instead" , make_ord_flag defGhcFlag "O" (optIntSuffixM (\mb_n -> setOptLevel (mb_n `orElse` 1))) -- If the number is missing, use 1 @@ -1850,14 +1834,6 @@ dynamic_flags_deps = [ (intSuffix (\n d -> d { wantedsFuel = n })) , make_ord_flag defFlag "fqcs-expansion-fuel" (intSuffix (\n d -> d { qcsFuel = n })) - , (Deprecated, defFlag "fcontext-stack" - (intSuffixM (\n d -> - do { deprecate $ "use -freduction-depth=" ++ show n ++ " instead" - ; return $ d { reductionDepth = treatZeroAsInf n } }))) - , (Deprecated, defFlag "ftype-function-depth" - (intSuffixM (\n d -> - do { deprecate $ "use -freduction-depth=" ++ show n ++ " instead" - ; return $ d { reductionDepth = treatZeroAsInf n } }))) , make_ord_flag defFlag "fstrictness-before" (intSuffix (\n d -> d { strictnessBefore = n : strictnessBefore d })) , make_ord_flag defFlag "ffloat-lam-args" @@ -1936,28 +1912,6 @@ dynamic_flags_deps = [ (intSuffix (\n d -> d { uniqueIncrement = n })) ------ Profiling ---------------------------------------------------- - - -- OLD profiling flags - , make_dep_flag defGhcFlag "auto-all" - (noArg (\d -> d { profAuto = ProfAutoAll } )) - "Use -fprof-auto instead" - , make_dep_flag defGhcFlag "no-auto-all" - (noArg (\d -> d { profAuto = NoProfAuto } )) - "Use -fno-prof-auto instead" - , make_dep_flag defGhcFlag "auto" - (noArg (\d -> d { profAuto = ProfAutoExports } )) - "Use -fprof-auto-exported instead" - , make_dep_flag defGhcFlag "no-auto" - (noArg (\d -> d { profAuto = NoProfAuto } )) - "Use -fno-prof-auto instead" - , make_dep_flag defGhcFlag "caf-all" - (NoArg (setGeneralFlag Opt_AutoSccsOnIndividualCafs)) - "Use -fprof-cafs instead" - , make_dep_flag defGhcFlag "no-caf-all" - (NoArg (unSetGeneralFlag Opt_AutoSccsOnIndividualCafs)) - "Use -fno-prof-cafs instead" - - -- NEW profiling flags , make_ord_flag defGhcFlag "fprof-auto" (noArg (\d -> d { profAuto = ProfAutoAll } )) , make_ord_flag defGhcFlag "fprof-auto-top" @@ -1982,12 +1936,6 @@ dynamic_flags_deps = [ ------ Compiler flags ----------------------------------------------- , make_ord_flag defGhcFlag "fasm" (NoArg (setObjBackend ncgBackend)) - , make_ord_flag defGhcFlag "fvia-c" (NoArg - (deprecate $ "The -fvia-c flag does nothing; " ++ - "it will be removed in a future GHC release")) - , make_ord_flag defGhcFlag "fvia-C" (NoArg - (deprecate $ "The -fvia-C flag does nothing; " ++ - "it will be removed in a future GHC release")) , make_ord_flag defGhcFlag "fllvm" (NoArg (setObjBackend llvmBackend)) , make_ord_flag defFlag "fno-code" (NoArg ((upd $ \d -> @@ -2001,11 +1949,6 @@ dynamic_flags_deps = [ dflags' <- liftEwM getCmdLineState pure $ gopt_unset dflags' Opt_ByteCodeAndObjectCode - , make_dep_flag defFlag "fglasgow-exts" - (NoArg enableGlasgowExts) "Use individual extensions instead" - , make_dep_flag defFlag "fno-glasgow-exts" - (NoArg disableGlasgowExts) "Use individual extensions instead" - ------ Safe Haskell flags ------------------------------------------- , make_ord_flag defFlag "fpackage-trust" (NoArg setPackageTrust) , make_ord_flag defFlag "fno-safe-infer" (noArg (\d -> @@ -2067,8 +2010,6 @@ dynamic_flags_deps = [ ] ------ Language flags ------------------------------------------------- - ++ map (mkFlag turnOn "f" setExtensionFlag ) fLangFlagsDeps - ++ map (mkFlag turnOff "fno-" unSetExtensionFlag) fLangFlagsDeps ++ map (mkFlag turnOn "X" setExtensionFlag ) xFlagsDeps ++ map (mkFlag turnOff "XNo" unSetExtensionFlag) xFlagsDeps ++ map (mkFlag turnOn "X" setLanguage ) languageFlagsDeps @@ -2142,11 +2083,6 @@ package_flags_deps = [ (NoArg (addPkgDbRef GlobalPkgDb)) , make_ord_flag defFlag "user-package-db" (NoArg (addPkgDbRef UserPkgDb)) - -- backwards compat with GHC<=7.4 : - , make_dep_flag defFlag "package-conf" - (HasArg $ addPkgDbRef . PkgDbPath . OsPath.unsafeEncodeUtf) "Use -package-db instead" - , make_dep_flag defFlag "no-user-package-conf" - (NoArg removeUserPkgDb) "Use -no-user-package-db instead" , make_ord_flag defGhcFlag "package-name" (HasArg $ \name -> upd (setUnitId name)) , make_ord_flag defGhcFlag "this-unit-id" (hasArg setUnitId) @@ -2167,7 +2103,6 @@ package_flags_deps = [ (NoArg (setGeneralFlag Opt_HideAllPluginPackages)) , make_ord_flag defFlag "package-env" (HasArg setPackageEnv) , make_ord_flag defFlag "ignore-package" (HasArg ignorePackage) - , make_dep_flag defFlag "syslib" (HasArg exposePackage) "Use -package instead" , make_ord_flag defFlag "distrust-all-packages" (NoArg (setGeneralFlag Opt_DistrustAllPackages)) , make_ord_flag defFlag "trust" (HasArg trustPackage) @@ -2643,8 +2578,6 @@ fFlagsDeps = [ flagSpec "prof-late-inline" Opt_ProfLateInlineCcs, flagSpec "regs-graph" Opt_RegsGraph, flagSpec "regs-iterative" Opt_RegsIterative, - depFlagSpec' "rewrite-rules" Opt_EnableRewriteRules - (useInstead "-f" "enable-rewrite-rules"), flagSpec "shared-implib" Opt_SharedImplib, flagSpec "spec-constr" Opt_SpecConstr, flagSpec "spec-constr-keen" Opt_SpecConstrKeen, @@ -2739,43 +2672,6 @@ fHoleFlags = [ flagSpec "unclutter-valid-hole-fits" Opt_UnclutterValidHoleFits ] --- | These @-f\<blah\>@ flags can all be reversed with @-fno-\<blah\>@ -fLangFlags :: [FlagSpec LangExt.Extension] -fLangFlags = map snd fLangFlagsDeps - -fLangFlagsDeps :: [(Deprecation, FlagSpec LangExt.Extension)] -fLangFlagsDeps = [ --- See Note [Updating flag description in the User's Guide] --- See Note [Supporting CLI completion] - depFlagSpecOp' "th" LangExt.TemplateHaskell - checkTemplateHaskellOk - (deprecatedForExtension "TemplateHaskell"), - depFlagSpec' "fi" LangExt.ForeignFunctionInterface - (deprecatedForExtension "ForeignFunctionInterface"), - depFlagSpec' "ffi" LangExt.ForeignFunctionInterface - (deprecatedForExtension "ForeignFunctionInterface"), - depFlagSpec' "arrows" LangExt.Arrows - (deprecatedForExtension "Arrows"), - depFlagSpec' "implicit-prelude" LangExt.ImplicitPrelude - (deprecatedForExtension "ImplicitPrelude"), - depFlagSpec' "bang-patterns" LangExt.BangPatterns - (deprecatedForExtension "BangPatterns"), - depFlagSpec' "monomorphism-restriction" LangExt.MonomorphismRestriction - (deprecatedForExtension "MonomorphismRestriction"), - depFlagSpec' "extended-default-rules" LangExt.ExtendedDefaultRules - (deprecatedForExtension "ExtendedDefaultRules"), - depFlagSpec' "implicit-params" LangExt.ImplicitParams - (deprecatedForExtension "ImplicitParams"), - depFlagSpec' "scoped-type-variables" LangExt.ScopedTypeVariables - (deprecatedForExtension "ScopedTypeVariables"), - depFlagSpec' "allow-overlapping-instances" LangExt.OverlappingInstances - (deprecatedForExtension "OverlappingInstances"), - depFlagSpec' "allow-undecidable-instances" LangExt.UndecidableInstances - (deprecatedForExtension "UndecidableInstances"), - depFlagSpec' "allow-incoherent-instances" LangExt.IncoherentInstances - (deprecatedForExtension "IncoherentInstances") - ] - supportedLanguages :: [String] supportedLanguages = map (flagSpecName . snd) languageFlagsDeps @@ -2876,15 +2772,6 @@ enableDLint = do , Opt_LlvmFillUndefWithGarbage ] -enableGlasgowExts :: DynP () -enableGlasgowExts = do setGeneralFlag Opt_PrintExplicitForalls - mapM_ setExtensionFlag glasgowExtsFlags - -disableGlasgowExts :: DynP () -disableGlasgowExts = do unSetGeneralFlag Opt_PrintExplicitForalls - mapM_ unSetExtensionFlag glasgowExtsFlags - - setWarnSafe :: Bool -> DynP () setWarnSafe True = getCurLoc >>= \l -> upd (\d -> d { warnSafeOnLoc = l }) setWarnSafe False = return () @@ -3094,7 +2981,6 @@ setExtensionFlag' f dflags = foldr ($) (xopt_set dflags f) deps unSetExtensionFlag' f dflags = xopt_unset dflags f -- When you un-set f, however, we don't un-set the things it implies - -- (except for -fno-glasgow-exts, which is treated specially) -------------------------- ===================================== compiler/GHC/Parser/Errors/Ppr.hs ===================================== @@ -971,6 +971,5 @@ forallSym False = text "forall" pprFileHeaderPragmaType :: FileHeaderPragmaType -> SDoc pprFileHeaderPragmaType OptionsPrag = text "OPTIONS" -pprFileHeaderPragmaType IncludePrag = text "INCLUDE" pprFileHeaderPragmaType LanguagePrag = text "LANGUAGE" pprFileHeaderPragmaType DocOptionsPrag = text "OPTIONS_HADDOCK" ===================================== compiler/GHC/Parser/Errors/Types.hs ===================================== @@ -650,7 +650,6 @@ data TransLayoutReason data FileHeaderPragmaType = OptionsPrag - | IncludePrag | LanguagePrag | DocOptionsPrag ===================================== compiler/GHC/Parser/Header.hs ===================================== @@ -319,11 +319,6 @@ getOptions' opts sec supported toks src_span = getLoc open real_src_span = expectJust (srcSpanToRealSrcSpan src_span) starting_loc = realSrcSpanStart real_src_span - parseToks (open:close:xs) - | ITinclude_prag str <- unLoc open - , ITclose_prag <- unLoc close - = fmap (map (L (getLoc open)) ["-#include",removeSpaces str] ++) - (parseToks xs) parseToks (open:close:xs) | ITdocOptions str _ <- unLoc open , ITclose_prag <- unLoc close @@ -355,8 +350,6 @@ getOptions' opts sec supported toks mkMessage (L loc token) | IToptions_prag _ <- token = Just (singleMessage $ mkPlainMsgEnvelope diag_opts loc (PsWarnMisplacedPragma OptionsPrag)) - | ITinclude_prag _ <- token - = Just (singleMessage $ mkPlainMsgEnvelope diag_opts loc (PsWarnMisplacedPragma IncludePrag)) | ITdocOptions _ _ <- token = Just (singleMessage $ mkPlainMsgEnvelope diag_opts loc (PsWarnMisplacedPragma DocOptionsPrag)) | ITlanguage_prag <- token ===================================== compiler/GHC/Parser/Lexer.x ===================================== @@ -857,7 +857,6 @@ data Token | ITcomplete_prag SourceText | ITclose_prag | IToptions_prag String - | ITinclude_prag String | ITlanguage_prag | ITminimal_prag SourceText | IToverlappable_prag SourceText -- instance overlap mode @@ -3507,8 +3506,7 @@ linePrags = Map.singleton "line" linePrag fileHeaderPrags = Map.fromList([("options", lex_string_prag IToptions_prag), ("options_ghc", lex_string_prag IToptions_prag), ("options_haddock", lex_string_prag_comment ITdocOptions), - ("language", token ITlanguage_prag), - ("include", lex_string_prag ITinclude_prag)]) + ("language", token ITlanguage_prag)]) ignoredPrags = Map.fromList (map ignored pragmas) where ignored opt = (opt, nested_comment) ===================================== compiler/GHC/Stg/Make.hs ===================================== @@ -67,7 +67,7 @@ mkTopStgRhs allow_toplevel_con_app opt_AutoSccsOnIndividualCafs this_mod ccs bnd upd_flag | isAtMostOnceDmd (idDemandInfo bndr) = SingleEntry | otherwise = Updatable - -- CAF cost centres generated for -fcaf-all + -- CAF cost centres generated for -fprof-cafs caf_cc = mkAutoCC bndr modl caf_ccs = mkSingletonCCS caf_cc -- careful: the binder might be :Main.main, ===================================== compiler/GHC/Types/Tickish.hs ===================================== @@ -106,7 +106,7 @@ type CmmTickish = GenTickish 'TickishPassCmm -- See Note [GHC Formalism] in GHC.Core.Lint data GenTickish pass = -- | An @{-# SCC #-}@ profiling annotation, either automatically - -- added by the desugarer as a result of -auto-all, or added by + -- added by the desugarer as a result of -fprof-auto, or added by -- the user. ProfNote { profNoteCC :: CostCentre, -- ^ the cost centre ===================================== docs/users_guide/codegens.rst ===================================== @@ -69,23 +69,14 @@ To install LLVM and Clang: .. _c-code-gen: -C Code Generator (``-fvia-C``) ------------------------------- +C Code Generator +---------------- .. index:: single: C code generator - single: -fvia-C - -.. ghc-flag:: -fvia-C - :shortdesc: use the C code generator - :type: dynamic - :category: warnings - - Use the C code generator. Only supposed in unregisterised GHC builds. This is the oldest code generator in GHC and is generally not included -any more having been deprecated around GHC 7.0. Select it with the -:ghc-flag:`-fvia-C` flag. +any more. The C code generator is only supported when GHC is built in unregisterised mode, a mode where GHC produces "portable" C code as ===================================== docs/users_guide/expected-undocumented-flags.txt ===================================== @@ -1,8 +1,6 @@ --#include --abi-hash --backpack --show-packages --Onot -Walternative-layout-rule-transitional -XAlternativeLayoutRule -XAlternativeLayoutRuleTransitional @@ -19,17 +17,11 @@ -dsource-stats -dstg-stats -dsuppress-stg-exts --fallow-incoherent-instances --fallow-overlapping-instances --fallow-undecidable-instances --farrows --fbang-patterns -fbuilding-cabal-package -fconstraint-solver-iterations -fgivens-expansion-fuel -fwanteds-expansion-fuel -fqcs-expansion-fuel --fcontext-stack -fcross-module-specialize -fdiagnostics-color=always -fdiagnostics-color=auto @@ -38,10 +30,7 @@ -fprint-error-index-links=auto -fprint-error-index-links=never -fembed-manifest --fextended-default-rules -ffast-pap-calls --fffi --ffi -ffloat-all-lams -ffloat-lam-args -ffrontend-opt @@ -49,48 +38,34 @@ -fghci-history -fghci-sandbox -fhistory-size --fimplicit-params --fimplicit-prelude -firrefutable-tuples -fmax-errors -fmax-pmcheck-iterations --fmonomorphism-restriction -fpre-inlining -fprint-bind-contents -freduction-depth --frewrite-rules --fscoped-type-variables -fshared-implib -fshow-valid-hole-fits -fshow-valid-substitutions -fspec-constr-recursive -fspecialize -fspecialize-aggressively --fth --ftype-function-depth -fversion-macros --fvia-c -haddock-opts -instantiated-with -keep-hi-file -keep-o-file --n -no-keep-hi-file -no-keep-o-file -no-link --no-recomp -no-rtsopts --no-user-package-conf --package-conf -package-name -pgmar -pgmranlib --recomp -relative-dynlib-paths -rtsopts=all -rtsopts=ignore -rtsopts=ignoreAll -rtsopts=none -rtsopts=some --syslib -this-component-id ===================================== docs/users_guide/exts/control.rst ===================================== @@ -244,25 +244,3 @@ Similarly, language extensions can be controlled (either enabled or disabled): * :extension:`StarIsType` * :extension:`TraditionalRecordSyntax` * :extension:`ImplicitStagePersistence` - - - -Although not recommended, the deprecated :ghc-flag:`-fglasgow-exts` flag enables -a large swath of the extensions supported by GHC at once. - -.. ghc-flag:: -fglasgow-exts - :shortdesc: Deprecated. Enable most language extensions; - see :ref:`options-language` for exactly which ones. - :type: dynamic - :reverse: -fno-glasgow-exts - :category: misc - - The flag ``-fglasgow-exts`` is equivalent to enabling the following extensions: - - .. include:: ../what_glasgow_exts_does.rst - - Enabling these options is the *only* effect of ``-fglasgow-exts``. We are trying - to move away from this portmanteau flag, and towards enabling features - individually. - - ===================================== docs/users_guide/exts/ffi.rst ===================================== @@ -766,9 +766,6 @@ calls across module and package boundaries: there's no need for the header file to be available when compiling an inlined version of a foreign call, so the compiler is free to inline foreign calls in any context. -The ``-#include`` option is now deprecated, and the ``includes`` -field in a Cabal package specification is ignored. - Memory Allocation ~~~~~~~~~~~~~~~~~ ===================================== docs/users_guide/exts/pragmas.rst ===================================== @@ -26,8 +26,8 @@ Certain pragmas are *file-header pragmas*: - File-header pragmas are read once only, before pre-processing the file (e.g. with cpp). -- The file-header pragmas are: ``{-# LANGUAGE #-}``, - ``{-# OPTIONS_GHC #-}``, and ``{-# INCLUDE #-}``. +- The file-header pragmas are: ``{-# LANGUAGE #-}`` and + ``{-# OPTIONS_GHC #-}``. .. _language-pragma: @@ -80,16 +80,6 @@ Previous versions of GHC accepted ``OPTIONS`` rather than ``OPTIONS_GHC`` is a file-header pragma (see :ref:`pragmas`). -.. _include-pragma: - -``INCLUDE`` pragma ------------------- - -The ``INCLUDE`` used to be necessary for specifying header files to be -included when using the FFI and compiling via C. It is no longer -required for GHC, but is accepted (and ignored) for compatibility with -other compilers. - .. _warning-deprecated-pragma: ``WARNING`` and ``DEPRECATED`` pragmas ===================================== docs/users_guide/ghc.rst ===================================== @@ -28,8 +28,7 @@ As a rule of thumb, all the language options are dynamic, as are the warning options and the debugging options. The rest are static, with the notable exceptions of -``-v``, ``-cpp``, ``-fasm``, ``-fvia-C``, ``-fllvm``, and -``-#include``. +``-v``, ``-cpp``, ``-fasm``, and ``-fllvm``. The OPTIONS sections lists the status of each flag. Common suffixes of file names for Haskell are: ===================================== docs/users_guide/profiling.rst ===================================== @@ -594,42 +594,6 @@ of your profiled program will be different to that of the unprofiled one. Process (or ignore) manual ``SCC`` annotations. Can be helpful to ignore annotations from libraries which are not desired. -.. ghc-flag:: -auto-all - :shortdesc: *(deprecated)* Alias for :ghc-flag:`-fprof-auto` - :type: dynamic - - Deprecated alias for :ghc-flag:`-fprof-auto` - -.. ghc-flag:: -auto - :shortdesc: *(deprecated)* Alias for :ghc-flag:`-fprof-auto-exported` - :type: dynamic - - Deprecated alias for :ghc-flag:`-fprof-auto-exported` - -.. ghc-flag:: -caf-all - :shortdesc: *(deprecated)* Alias for :ghc-flag:`-fprof-cafs` - :type: dynamic - - Deprecated alias for :ghc-flag:`-fprof-cafs` - -.. ghc-flag:: -no-auto-all - :shortdesc: *(deprecated)* Alias for :ghc-flag:`-fno-prof-auto` - :type: dynamic - - Deprecated alias for :ghc-flag:`-fno-prof-auto` - -.. ghc-flag:: -no-auto - :shortdesc: *(deprecated)* Alias for :ghc-flag:`-fno-prof-auto` - :type: dynamic - - Deprecated alias for :ghc-flag:`-fno-prof-auto` - -.. ghc-flag:: -no-caf-all - :shortdesc: *(deprecated)* Alias for :ghc-flag:`-fno-prof-cafs` - :type: dynamic - - Deprecated alias for :ghc-flag:`-fno-prof-cafs` - .. _prof-time-options: Time and allocation profiling ===================================== docs/users_guide/what_glasgow_exts_does.rst deleted ===================================== @@ -1,34 +0,0 @@ -.. hlist:: - - * :extension:`ConstrainedClassMethods` - * :extension:`DeriveDataTypeable` - * :extension:`DeriveFoldable` - * :extension:`DeriveFunctor` - * :extension:`DeriveGeneric` - * :extension:`DeriveTraversable` - * :extension:`EmptyDataDecls` - * :extension:`ExistentialQuantification` - * :extension:`ExplicitNamespaces` - * :extension:`FlexibleContexts` - * :extension:`FlexibleInstances` - * :extension:`ForeignFunctionInterface` - * :extension:`FunctionalDependencies` - * :extension:`GeneralizedNewtypeDeriving` - * :extension:`ImplicitParams` - * :extension:`InterruptibleFFI` - * :extension:`KindSignatures` - * :extension:`LiberalTypeSynonyms` - * :extension:`MagicHash` - * :extension:`MultiParamTypeClasses` - * :extension:`ParallelListComp` - * :extension:`PatternGuards` - * :extension:`PostfixOperators` - * :extension:`RankNTypes` - * :extension:`RecursiveDo` - * :extension:`ScopedTypeVariables` - * :extension:`StandaloneDeriving` - * :extension:`TypeOperators` - * :extension:`TypeSynonymInstances` - * :extension:`UnboxedTuples` - * :extension:`UnicodeSyntax` - * :extension:`UnliftedFFITypes` ===================================== testsuite/tests/driver/Makefile ===================================== @@ -149,18 +149,16 @@ test026: test -f d026/P/Q$(OBJSUFFIX) # test stub generation -# -fvia-C, because we want to check that the .hc file can #include the stub.h test027: $(RM) B027/F.hi B027/F$(OBJSUFFIX) B027/F_stub.h - "$(TEST_HC)" $(TEST_HC_OPTS) -c B027/F.hs -fno-warn-deprecated-flags -fvia-C + "$(TEST_HC)" $(TEST_HC_OPTS) -c B027/F.hs test -f B027/F_stub.h # test -stubdir -# -fvia-C, because we want to check that the .hc file can #include the stub.h test028: $(RM) B028/F.hi B028/F$(OBJSUFFIX) $(RM) stub028/B028/F_stub.h - "$(TEST_HC)" $(TEST_HC_OPTS) -c B028/F.hs -stubdir stub028 -fno-warn-deprecated-flags -fvia-C + "$(TEST_HC)" $(TEST_HC_OPTS) -c B028/F.hs -stubdir stub028 test -f stub028/B028/F_stub.h # ----------------------------------------------------------------------------- @@ -289,16 +287,16 @@ test053: # ----------------------------------------------------------------------------- # Other tests -# Test that -keep-s-files works with --make and -fvia-C +# Test that -keep-s-files works with --make test061a: $(RM) A061a.hi A061a$(OBJSUFFIX) A061a.s - "$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make -keep-s-files -fno-warn-deprecated-flags -fvia-C A061a.hs + "$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make -keep-s-files A061a.hs test -f A061a.s # Test that -keep-s-files works without --make test061b: $(RM) A061b.hi A061b$(OBJSUFFIX) A061b.s - "$(TEST_HC)" $(TEST_HC_OPTS) -c -keep-s-files -fno-warn-deprecated-flags -fvia-C A061b.hs + "$(TEST_HC)" $(TEST_HC_OPTS) -c -keep-s-files A061b.hs test -f A061b.s # Test that -main-is works with --make ===================================== testsuite/tests/driver/T2464.hs ===================================== @@ -1,9 +1,13 @@ {-# LANGUAGE CPP #-} {-# OPTIONS_GHC -DTEST #-} -{-# OPTIONS_GHC -fffi #-} -- deprecation warning +{-# OPTIONS_GHC -Wno-such-warning #-} -- warned about exactly once #if defined(TEST) -{-# LANGUAGE EmptyDataDecls #-} +{-# LANGUAGE MagicHash #-} #endif module Test2464 where -data T + +import GHC.Exts + +f :: Int# -> Int# +f x = x +# 1# ===================================== testsuite/tests/driver/T2464.stderr ===================================== @@ -1,3 +1,3 @@ -T2464.hs:3:17: warning: [GHC-53692] [-Wdeprecated-flags (in -Wdefault)] - -fffi is deprecated: use -XForeignFunctionInterface or pragma {-# LANGUAGE ForeignFunctionInterface #-} instead +T2464.hs:3:17: warning: [GHC-93741] [-Wunrecognised-warning-flags (in -Wdefault)] + unrecognised warning flag: -Wno-such-warning ===================================== testsuite/tests/ffi/should_run/T2594.hs ===================================== @@ -1,4 +1,4 @@ -{-# options -fffi #-} +{-# LANGUAGE ForeignFunctionInterface #-} import Foreign import Foreign.C.Types ===================================== testsuite/tests/ffi/should_run/ffi015.hs ===================================== @@ -1,4 +1,3 @@ -{-# OPTIONS_GHC -#include "ffi015_cbits.h" #-} {-# LANGUAGE ForeignFunctionInterface #-} import Foreign ===================================== testsuite/tests/ffi/should_run/fptr01.hs ===================================== @@ -4,8 +4,6 @@ module Main where import Foreign -{-# INCLUDE "fptr01.h" #-} - foreign import ccall "&f" fptr :: FunPtr (Ptr Int -> IO ()) foreign import ccall "&g" gptr :: FunPtr (Ptr Int -> IO ()) foreign import ccall "&h" hptr :: FunPtr (Ptr Int -> IO ()) ===================================== testsuite/tests/ffi/should_run/fptrfail01.hs ===================================== @@ -5,8 +5,6 @@ module Main where import Foreign import GHC.ForeignPtr -{-# INCLUDE "fptrfail01.h" #-} - foreign import ccall "&f" fptr :: FunPtr (Ptr Int -> IO ()) main :: IO () ===================================== testsuite/tests/indexed-types/should_compile/all.T ===================================== @@ -17,7 +17,7 @@ test('Simple16', normal, compile, ['']) test('Simple17', normal, compile, ['']) test('Simple18', normal, compile, ['']) test('Simple19', normal, compile, ['']) -test('Simple20', expect_broken(4296), compile, ['-fcontext-stack=10']) +test('Simple20', expect_broken(4296), compile, ['-freduction-depth=10']) test('Simple21', normal, compile, ['']) test('Simple22', normal, compile, ['']) test('Simple23', normal, compile, ['']) ===================================== testsuite/tests/indexed-types/should_fail/SkolemOccursLoop.hs ===================================== @@ -1,4 +1,4 @@ -{-# OPTIONS_GHC -ftype-function-depth=3 #-} +{-# OPTIONS_GHC -freduction-depth=3 #-} {-# LANGUAGE TypeFamilies, FlexibleContexts, EmptyDataDecls #-} module SkolemOccursLoop where ===================================== utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs ===================================== @@ -257,7 +257,6 @@ classify tok = ITcomplete_prag{} -> TkPragma ITclose_prag -> TkPragma IToptions_prag{} -> TkPragma - ITinclude_prag{} -> TkPragma ITlanguage_prag -> TkPragma ITminimal_prag{} -> TkPragma IToverlappable_prag{} -> TkPragma @@ -397,7 +396,6 @@ inPragma False tok = ITann_prag{} -> True ITcomplete_prag{} -> True IToptions_prag{} -> True - ITinclude_prag{} -> True ITlanguage_prag -> True ITminimal_prag{} -> True IToverlappable_prag{} -> True View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b3ba3621bb41972b140eb7857e50f2e... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b3ba3621bb41972b140eb7857e50f2e... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
Simon Jakobi (@sjakobi)