summaryrefslogtreecommitdiff
path: root/compiler/main/StaticFlags.hs
Commit message (Collapse)AuthorAgeFilesLines
* Ditch static flagsSylvain Henry2017-02-021-248/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch converts the 4 lasting static flags (read from the command line and unsafely stored in immutable global variables) into dynamic flags. Most use cases have been converted into reading them from a DynFlags. In cases for which we don't have easy access to a DynFlags, we read from 'unsafeGlobalDynFlags' that is set at the beginning of each 'runGhc'. It's not perfect (not thread-safe) but it is still better as we can set/unset these 4 flags before each run when using GHC API. Updates haddock submodule. Rebased and finished by: bgamari Test Plan: validate Reviewers: goldfire, erikd, hvr, austin, simonmar, bgamari Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2839 GHC Trac Issues: #8440
* Simplify CPP logic as we now need v7.10 for bootstrappingGabor Greif2017-01-131-6/+1
|
* Make globals use sharedCAFMoritz Angermann2016-12-111-1/+19
| | | | | | | | | | | | | | | | | | | Summary: The use of globals is quite painful when multiple rts are loaded, e.g. when plugins are loaded, which bring in a second rts. The sharedCAF appraoch was employed for the FastStringTable; I've taken the libery to extend this to the other globals I could find. This is a reboot of D2575, that should hopefully not exhibit the same windows build issues. Reviewers: Phyx, simonmar, goldfire, bgamari, austin, hvr, erikd Reviewed By: Phyx, simonmar, bgamari Subscribers: mpickering, thomie Differential Revision: https://phabricator.haskell.org/D2773
* Revert "Make globals use sharedCAF"Ben Gamari2016-11-301-19/+1
| | | | | This reverts commit 6f7ed1e51bf360621a3c2a447045ab3012f68575 due to breakage of the build on Windows.
* Make globals use sharedCAFMoritz Angermann2016-11-291-1/+19
| | | | | | | | | | | | | | | The use of globals is quite painful when multiple rts are loaded, e.g. when plugins are loaded, which bring in a second rts. The sharedCAF appraoch was employed for the FastStringTable; I've taken the libery to extend this to the other globals I could find. Reviewers: rwbarton, simonmar, austin, hvr, erikd, bgamari Reviewed By: simonmar, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2575
* Make -fcpr-off a dynamic flagChristiaan Baaij2015-08-051-8/+1
| | | | | | | | | | | | | | Test Plan: validate Reviewers: austin, goldfire, simonpj, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D1110 GHC Trac Issues: #10706
* Delete commented-out lineSimon Peyton Jones2015-05-181-1/+0
|
* Revert multiple commitsAustin Seipp2015-05-141-0/+1
| | | | | | | | | | | | | | | | | | | | This reverts multiple commits from Simon: - 04a484eafc9eb9f8774b4bdd41a5dc6c9f640daf Test Trac #10359 - a9ccd37add8315e061c02e5bf26c08f05fad9ac9 Test Trac #10403 - c0aae6f699cbd222d826d0b8d78d6cb3f682079e Test Trac #10248 - eb6ca851f553262efe0824b8dcbe64952de4963d Make the "matchable-given" check happen first - ca173aa30467a0b1023682d573fcd94244d85c50 Add a case to checkValidTyCon - 51cbad15f86fca1d1b0e777199eb1079a1b64d74 Update haddock submodule - 6e1174da5b8e0b296f5bfc8b39904300d04eb5b7 Separate transCloVarSet from fixVarSet - a8493e03b89f3b3bfcdb6005795de050501f5c29 Fix imports in HscMain (stage2) - a154944bf07b2e13175519bafebd5a03926bf105 Two wibbles to fix the build - 5910a1bc8142b4e56a19abea104263d7bb5c5d3f Change in capitalisation of error msg - 130e93aab220bdf14d08028771f83df210da340b Refactor tuple constraints - 8da785d59f5989b9a9df06386d5bd13f65435bc0 Delete commented-out line These break the build by causing Haddock to fail mysteriously when trying to examine GHC.Prim it seems.
* Delete commented-out lineSimon Peyton Jones2015-05-131-1/+0
|
* Dont call unsafeGlobalDynFlags if it is not setThomas Miedema2015-03-161-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Parsing of static and mode flags happens before any session is started, i.e., before the first call to 'GHC.withGhc'. Therefore, to report errors for invalid usage of these two types of flags, we can not call any function that needs DynFlags, as there are no DynFlags available yet (unsafeGlobalDynFlags is not set either). So we always print "on the commandline" as the location, which is true except for Api users, which is probably ok. When reporting errors for invalid usage of dynamic flags we /can/ make use of DynFlags, and we do so explicitly in DynFlags.parseDynamicFlagsFull. Before, we called unsafeGlobalDynFlags when an invalid (combination of) flag(s) was given on the commandline, resulting in panics (#9963). This regression was introduced in 1d6124de. Also rename showSDocSimple to showSDocUnsafe, to hopefully prevent this from happening again. Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D730 GHC Trac Issues: #9963
* ghc: allow --show-options and --interactive togetherLennart Kolmodin2014-11-211-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously 'ghc --show-options' showed all options that GHC can possibly accept. With this patch, it'll only show the options that have effect in non-interactive modes. This change also adds support for using 'ghc --interactive --show-options' which previously was disallowed. This command will show all options that have effect in the interactive mode. The CmdLineParser is updated to know about the GHC modes, and then each flag is annotated with which mode it has effect. This fixes #9259. Test Plan: Try out --show-options with --interactive on the command line. With and without --interactive should give different results. Run the test suite, mode001 has been updated to verify this new flag combination. Reviewers: austin, jstolarek Reviewed By: austin, jstolarek Subscribers: jstolarek, thomie, carter, simonmar Differential Revision: https://phabricator.haskell.org/D337 GHC Trac Issues: #9259
* Update User's Guide, cleanup DynFlagsJan Stolarek2014-11-061-1/+5
|
* Add LANGUAGE pragmas to compiler/ source filesHerbert Valerio Riedel2014-05-151-1/+2
| | | | | | | | | | | | | | | | | | In some cases, the layout of the LANGUAGE/OPTIONS_GHC lines has been reorganized, while following the convention, to - place `{-# LANGUAGE #-}` pragmas at the top of the source file, before any `{-# OPTIONS_GHC #-}`-lines. - Moreover, if the list of language extensions fit into a single `{-# LANGUAGE ... -#}`-line (shorter than 80 characters), keep it on one line. Otherwise split into `{-# LANGUAGE ... -#}`-lines for each individual language extension. In both cases, try to keep the enumeration alphabetically ordered. (The latter layout is preferable as it's more diff-friendly) While at it, this also replaces obsolete `{-# OPTIONS ... #-}` pragma occurences by `{-# OPTIONS_GHC ... #-}` pragmas.
* Nuke {save,restore}StaticFlagGlobals.Austin Seipp2013-10-091-15/+16
| | | | | | | | | | | | | | | | | | | As discussed in #8276, this code was somewhat broken because while you could always revert the actual argument list, you can never revert the CAFs upon which they are based - so really this didn't buy you much. However, Haddock in particular expects to be able to parse GHC flags, including static flags, and used this code to do so. In its place, we instead have discardStaticFlags, which will safely remove any of the remaining 5 flags from a list of arguments. Haddock instead discards these, as they aren't related to anything it does anyway (mostly controlling debugging output and some basic optimizer phases.) This fixes #8276. In the future, we will eventually completely remove the remaining StaticFlags, removing the need for this fix. Unfortunately these changes will be quite invasive and require more time. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Turn -H and -Rghc-timing into dynamic flags.Austin Seipp2013-10-091-29/+0
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Delete old comments referring to newSessionAustin Seipp2013-10-011-2/+2
| | | | | | | As Herbert pointed it, it was removed a long time ago. Authored-by: Kazu Yamamoto <kazu@iij.ad.jp> Signed-off-by: Austin Seipp <austin@well-typed.com>
* resurrected -fdicts-strict, off by defaultNicolas Frisby2013-09-081-8/+0
| | | | also added -fdmd-tx-dict-sel, on by default
* Add --show-options to list all flags (Fixes #7843)Jan Stolarek2013-06-061-3/+10
|
* Make -fno-flat-cache use a dynamic, rather than static, flagIan Lynagh2013-05-101-5/+0
|
* Update the isStaticFlag predicateIan Lynagh2013-04-251-5/+0
| | | | | | | | | | | | | | | | | -fspec-inline-join-points was removed in Jan 2010: 99f41975ae61fc919638aa389199b32742332eff -fno-hi-version-check was removed in Nov 2003: 98744cef7b82e7eefbb1c6f1d8b9e28c415939c4 -dno-black-holing was removed in Aug 2011: 1c2f89535394958f75cfb15c8c5e0433a20953ed -fruntime-types was removed in Apr 2008: 8d6bc9bf51829ea04da5f599b84114ef220f0a19 -fhardwire-lib-paths was removed in Jan 2008: 1b98179e0faf8c1ddf79c12827b24d4b7979b83e
* Remove some old commented-out code in StaticFlagsIan Lynagh2013-04-251-17/+0
|
* Whitespace only in StaticFlagsIan Lynagh2013-04-251-32/+25
|
* Change a few throwGhcException uses to throwGhcExceptionIOIan Lynagh2013-01-301-2/+2
|
* StaticFlags code cleanup (fixes #7595)Jan Stolarek2013-01-281-69/+172
| | | | | | | | | Function responsible for parsing the static flags, that were spread across two modules (StaticFlags and StaticFlagParser), are now in one file. This is analogous to dynamic flags parsing, which is also contained within a single module. Signed-off-by: David Terei <davidterei@gmail.com>
* Replace all uses of ghcError with throwGhcException and purge ghcError.Erik de Castro Lopo2012-11-301-1/+1
|
* Make -fexcess-precision a fully-dynamic flagIan Lynagh2012-10-091-5/+0
| | | | It used to be part-dynamic, part-static.
* Make -f(no-)pre-inlining a dynamic flagIan Lynagh2012-10-091-5/+0
|
* Make -fsimple-list-literals a dynamic flagIan Lynagh2012-10-091-4/+0
|
* Make -fmax-worker-args a dynamic flagIan Lynagh2012-10-091-9/+6
|
* Make the -dsuppress-* flags dynamicIan Lynagh2012-10-091-59/+0
|
* Make the opt_UF_* static flags dynamicIan Lynagh2012-10-091-33/+3
| | | | | | | | I also removed the default values from the "Discounts and thresholds" note: most of them were no longer up-to-date. Along the way I added FloatSuffix to the argument parser, analogous to IntSuffix.
* Make the -ferror-spans flag dynamicIan Lynagh2012-10-091-8/+0
|
* Put the DynFlags in a global variable for tracing; fixes #7304Ian Lynagh2012-10-081-0/+21
| | | | | | | | | This is an ugly kludge to make a DynFlags value available for the 'trace' functions. It may not be the value we really ought to use, but it'll be good enough for the pretty-printer to use. Ideally we'd pass the real DynFlags down to all the trace calls, but this will do for now at least.
* A few more constraint solver improvementsSimon Peyton Jones2012-10-021-0/+4
| | | | | | | | | | | | | | | * Get rid of the lookupInInerts stage * Re-introduce the flat-cache for flattening type-family equations See Note [Type family equations] in TcSMonad. My previous clever attempt with organising the work list proved too fragile. There's a (static) flag -fno-flat-cache to switch if off, so you can try with and without * Improve the -ddump-cs-trace output * The usual round of refactoring
* Make -fhpc a dynamic flagIan Lynagh2012-09-031-7/+0
|
* Remove unused -dopt-fuelIan Lynagh2012-09-031-6/+0
|
* Make -fhistory-size dynamicIan Lynagh2012-09-031-4/+0
|
* Remove the unused opt_StubDeadValuesIan Lynagh2012-09-031-4/+0
|
* Move ldInputs into DynFlagsIan Lynagh2012-09-031-12/+0
|
* Make the ways dynamicIan Lynagh2012-09-031-213/+7
|
* Refactor the ways code a bitIan Lynagh2012-09-031-98/+104
| | | | | | | | We used to use a list lookup that couldn't fail. Now we just use functions. There were 3 overlapping entries for WayPar; I've commented out the ones that were shadowed for now.
* Add "Unregisterised" as a field in the settings fileIan Lynagh2012-08-071-3/+0
| | | | | | To explicitly choose whether you want an unregisterised build you now need to use the "--enable-unregisterised"/"--disable-unregisterised" configure flags.
* Make tablesNextToCode "dynamic"Ian Lynagh2012-08-061-10/+0
| | | | | This is a bit odd by itself, but it's a stepping stone on the way to putting "target unregisterised" into the settings file.
* Make -fscc-profiling a dynamic flagIan Lynagh2012-07-241-7/+0
| | | | All the flags that 'ways' imply are now dynamic
* Make -fPIC a dynamic flagIan Lynagh2012-07-161-9/+0
| | | | | | Hopefully I've kept the logic the same, and we now generate warnings if the user does -fno-PIC but we ignore them (e.g. because they're on OS X amd64).
* Remove 'on' from UtilIan Lynagh2012-06-221-0/+1
| | | | We can now rely on it being available from Data.Function
* Make -fgransim a dynamic flagIan Lynagh2012-06-201-4/+0
|
* Make -fparallel a dynamic flagIan Lynagh2012-06-201-4/+0
|
* Move and rename opt_HiVersionIan Lynagh2012-06-181-4/+0
| | | | It isn't really an option at all
* Make -firrefutable-tuples a dynamic flagIan Lynagh2012-06-181-4/+0
|