summaryrefslogtreecommitdiff
path: root/compiler/iface/FlagChecker.hs
Commit message (Collapse)AuthorAgeFilesLines
* Update Trac ticket URLs to point to GitLabRyan Scott2019-03-151-2/+2
| | | | | This moves all URL references to Trac tickets to their corresponding GitLab counterparts.
* Cache the fingerprint of sOpt_PBartosz Nitka2018-03-021-1/+36
| | | | | | | | | | | | | | | | | | | | | Before this change we would compute a hash of all the command line -optP flags once per file. With a lot of files and many -optP flags, that's a lot of repeated work. I added a new Note that explains the approach and rationale. Test Plan: new test Reviewers: simonmar, simonpj, bgamari Reviewed By: simonpj Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14697 Differential Revision: https://phabricator.haskell.org/D4445
* Change how includes for input file directory worksTamar Christina2018-02-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GHC Used to only allow for one include mode, namely `-I`. The problem with `-I` includes is that it supercedes all other includes, including the system include paths. This is not a problem for paths requested by the user, but it is a problem for the ones we implicitly derive and add. In particular we add the source directory of the input file to the include path. This is problematic because it causes any file with the name of a system include, to inadvertently loop as the wrong file gets included. Since this is an implicitly include, and as far as I can tell, only done so local includes are found (as the sources given to GCC reside in a temp folder) then switch from `-I` to `-iquote`. This requires a submodule update for haddock Test Plan: ./validate Reviewers: austin, bgamari, hvr Reviewed By: bgamari Subscribers: carter, rwbarton, thomie GHC Trac Issues: #14312 Differential Revision: https://phabricator.haskell.org/D4080
* Allow users to ignore optimization changesDavid Feuer2017-12-111-13/+54
| | | | | | | | | | | | | | | | | | | | * Add a new flag, `-fignore-optim-changes`, allowing them to avoid recompilation if the only changes are to the `-O` level or to flags controlling optimizations. * When `-fignore-optim-changes` is *off*, recompile when optimization flags (e.g., `-fno-full-laziness`) change. Previously, we ignored these unconditionally when deciding whether to recompile a module. Reviewers: austin, bgamari, simonmar Reviewed By: simonmar Subscribers: duog, carter, simonmar, rwbarton, thomie GHC Trac Issues: #13604 Differential Revision: https://phabricator.haskell.org/D4123
* compiler: introduce custom "GhcPrelude" PreludeHerbert Valerio Riedel2017-09-191-0/+2
| | | | | | | | | | | | | | | | | | This switches the compiler/ component to get compiled with -XNoImplicitPrelude and a `import GhcPrelude` is inserted in all modules. This is motivated by the upcoming "Prelude" re-export of `Semigroup((<>))` which would cause lots of name clashes in every modulewhich imports also `Outputable` Reviewers: austin, goldfire, bgamari, alanz, simonmar Reviewed By: bgamari Subscribers: goldfire, rwbarton, thomie, mpickering, bgamari Differential Revision: https://phabricator.haskell.org/D3989
* Implement recompilation checking for -fignore-assertsÖmer Sinan Ağacan2017-07-031-1/+5
| | | | | | | | | | | | | | Test Plan: Added a test which was previously failing Reviewers: austin, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, rwbarton, thomie GHC Trac Issues: #13914 Differential Revision: https://phabricator.haskell.org/D3698
* Recompile if -fhpc is added or removed (#11798)Reid Barton2017-03-261-2/+8
| | | | | | | | | | | | Test Plan: validate Reviewers: austin, bgamari, dfeuer Reviewed By: dfeuer Subscribers: dfeuer, thomie Differential Revision: https://phabricator.haskell.org/D3368
* Introduce and use EnumSet in DynFlagsBen Gamari2017-03-151-2/+2
| | | | | | | | | | | | | | | This factors out a repeated pattern found in DynFlags, where we use an IntSet and Enum to represent sets of flags. Requires bump of haddock submodule. Test Plan: validate Reviewers: austin, goldfire Subscribers: rwbarton, thomie, snowleopard Differential Revision: https://phabricator.haskell.org/D3331
* Fix a Backpack recompilation avoidance bug when signatures change.Edward Z. Yang2017-02-171-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Recompilation avoidance checks if -this-unit-id has changed by relying on the "wanted module" check in readIface ("Something is amiss..."). Unfortunately, this check didn't check if the instantiation made sense, which meant that if you changed the signatures of a Backpack package, we'd still treat the old signatures as up-to-date. The way I fixed this was by having findAndReadIface take in a 'Module' representing the /actual/ module we were intending to lookup. We convert this into the 'Module' we expect to see in 'mi_module' and now do a more elaborate check that will also verify that instantiations make sense. Along the way, I robustified the logging infrastructure for recompilation checking, and folded wrongIfaceModErr (which was dead code) into the error message. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: bgamari, austin Subscribers: thomie, snowleopard Differential Revision: https://phabricator.haskell.org/D3130
* Clean up handling of known-key Names in interface filesBen Gamari2016-10-131-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously BinIface had some dedicated logic for handling tuple names in the symbol table. As it turns out, this logic was essentially dead code as it was superceded by the special handling of known-key things. Here we cull the tuple code-path and use the known-key codepath for all tuple-ish things. This had a surprising number of knock-on effects, * constraint tuple datacons had to be made known-key (previously they were not) * IfaceTopBndr was changed from being a synonym of OccName to a synonym of Name (since we now need to be able to deserialize Names directly from interface files) * the change to IfaceTopBndr complicated fingerprinting, since we need to ensure that we don't go looking for the fingerprint of the thing we are currently fingerprinting in the fingerprint environment (see notes in MkIface). Handling this required distinguishing between binding and non-binding Name occurrences in the Binary serializers. * the original name cache logic which previously lived in IfaceEnv has been moved to a new NameCache module * I ripped tuples and sums out of knownKeyNames since they introduce a very large number of entries. During interface file deserialization we use static functions (defined in the new KnownUniques module) to map from a Unique to a known-key Name (the Unique better correspond to a known-key name!) When we need to do an original name cache lookup we rely on the parser implemented in isBuiltInOcc_maybe. * HscMain.allKnownKeyNames was folded into PrelInfo.knownKeyNames. * Lots of comments were sprinkled about describing the new scheme. Updates haddock submodule. Test Plan: Validate Reviewers: niteria, simonpj, austin, hvr Reviewed By: simonpj Subscribers: simonmar, niteria, thomie Differential Revision: https://phabricator.haskell.org/D2467 GHC Trac Issues: #12532, #12415
* Fix #10923 by fingerprinting optimization level.Edward Z. Yang2016-09-021-2/+8
| | | | | | | | | | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonmar, austin, bgamari, thomie, rwbarton Differential Revision: https://phabricator.haskell.org/D2509 GHC Trac Issues: #10923
* Some alpha renamingIan Lynagh2012-10-161-1/+1
| | | | | Mostly d -> g (matching DynFlag -> GeneralFlag). Also renamed if* to when*, matching the Haskell if/when names
* Make -fscc-profiling a dynamic flagIan Lynagh2012-07-241-2/+1
| | | | All the flags that 'ways' imply are now dynamic
* Make -fPIC a dynamic flagIan Lynagh2012-07-161-1/+1
| | | | | | 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).
* Make a picPOpts functionIan Lynagh2012-07-161-2/+2
| | | | | We now handle the preprocessor options the same way as the gcc options (picCCOpts).
* Omit -osuf/-odir -hisuf/-hidir and -stubdir from the flag checkerSimon Marlow2012-03-011-6/+32
| | | | | | | The reasoning is that GHC will only skip recompilation if it has found a valid up-to-date object file and .hi file, so there is no need to also check that these flags have not changed, and indeed there are valid reasons to want to change them.
* oops, a Bool is a little *too* lax (#5878)Simon Marlow2012-02-161-1/+2
|
* Be less conservative about recompiling after changes to -main-is (#5878)Simon Marlow2012-02-161-3/+4
|
* Don't record outputFile in the hashed flagsSimon Marlow2012-01-031-1/+3
| | | | | | | | | | | We don't want ghc --make M -o <file> to force recompilation of all modules when <file> changes. The -o value is already taken into account by the recompilation machinery when we check the modification time on the object file or the executable.
* Take into account -fprof-auto-*Simon Marlow2011-12-071-1/+5
|
* Keep the flag lists as IntSets rather than listsSimon Marlow2011-11-231-2/+2
| | | | This improves compile times slightly.
* Normalise FilePaths before hashing (fixes base01)Simon Marlow2011-11-111-3/+7
|
* Remove cruft code from FlagCheckerDavid Terei2011-11-101-103/+1
|
* Add more flags to the recompilation check (#437)Simon Marlow2011-11-101-19/+21
| | | | | | | Now included: - all language flags - all filename-related flags (-i, -osuf, -hidir etc.) - all CPP-related flags (-I, -D, -U)
* Fix #437: recompilation check includes flagsDavid Terei2011-11-091-0/+143