summaryrefslogtreecommitdiff
path: root/compiler/main/DynFlags.hs
Commit message (Collapse)AuthorAgeFilesLines
...
| * Add '-freg-liveness' flag to control if STG liveness informationDavid Terei2012-01-121-0/+3
| | | | | | | | is used for optimisation. (enabled by default)
| * Add '-fllvm-tbaa' flag for controlling LLVM TBAA opt.David Terei2012-01-121-0/+3
| |
| * Implememt -fdefer-type-errors (Trac #5624)Simon Peyton Jones2012-01-121-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements the idea of deferring (most) type errors to runtime, instead emitting only a warning at compile time. The basic idea is very simple: * The on-the-fly unifier in TcUnify never fails; instead if it gets stuck it emits a constraint. * The constraint solver tries to solve the constraints (and is entirely unchanged, hooray). * The remaining, unsolved constraints (if any) are passed to TcErrors.reportUnsolved. With -fdefer-type-errors, instead of emitting an error message, TcErrors emits a warning, AND emits a binding for the constraint witness, binding it to (error "the error message"), via the new form of evidence TcEvidence.EvDelayedError. So, when the program is run, when (and only when) that witness is needed, the program will crash with the exact same error message that would have been given at compile time. Simple really. But, needless to say, the exercise forced me into some major refactoring. * TcErrors is almost entirely rewritten * EvVarX and WantedEvVar have gone away entirely * ErrUtils is changed a bit: * New Severity field in ErrMsg * Renamed the type Message to MsgDoc (this change touches a lot of files trivially) * One minor change is that in the constraint solver we try NOT to combine insoluble constraints, like Int~Bool, else all such type errors get combined together and result in only one error message! * I moved some definitions from TcSMonad to TcRnTypes, where they seem to belong more
| * Ignore -fpackage-trust if no other Safe Haskell flagsDavid Terei2011-12-191-9/+26
| |
| * Add a class HasDynFlags(getDynFlags)Ian Lynagh2011-12-191-0/+4
| | | | | | | | | | | | | | | | We no longer have many separate, clashing getDynFlags functions I've given each GhcMonad its own HasDynFlags instance, rather than using UndecidableInstances to make a GhcMonad m => HasDynFlags m instance.
* | SnapshotSimon Marlow2012-01-171-2/+2
|/
* Allow type signatures in instance decls (Trac #5676)Simon Peyton Jones2011-12-121-1/+3
| | | | | | | | | | | This new feature-ette, enable with -XInstanceSigs, lets you give a type signature in an instance declaration: instance Eq Int where (==) :: Int -> Int -> Bool (==) = ...blah... Scoped type variables work too.
* Take into account -fprof-auto-*Simon Marlow2011-12-071-0/+1
|
* More changes aimed at improving call stacks.Simon Marlow2011-12-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | - Attach a SrcSpan to every CostCentre. This had the side effect that CostCentres that used to be merged because they had the same name are now considered distinct; so I had to add a Unique to CostCentre to give them distinct object-code symbols. - New flag: -fprof-auto-calls. This flag adds an automatic SCC to every call site (application, to be precise). This is typically more useful for call stacks than annotating whole functions. Various tidy-ups at the same time: removed unused NoCostCentre constructor, and refactored a bit in Coverage.lhs. The call stack we get from traceStack now looks like this: Stack trace: Main.CAF (<entire-module>) Main.main.xs (callstack002.hs:18:12-24) Main.map (callstack002.hs:13:12-16) Main.map.go (callstack002.hs:15:21-34) Main.map.go (callstack002.hs:15:21-23) Main.f (callstack002.hs:10:7-43)
* Implement a capi calling convention; fixes #2979Ian Lynagh2011-11-281-0/+2
| | | | | | | | | In GHC, this provides an easy way to call a C function via a C wrapper. This is important when the function is really defined by CPP. Requires the new CApiFFI extension. Not documented yet, as it's still an experimental feature at this stage.
* Keep the flag lists as IntSets rather than listsSimon Marlow2011-11-231-21/+23
| | | | This improves compile times slightly.
* Add '-dno-llvm-mangler' flag for debugging purposesDavid Terei2011-11-221-0/+2
|
* Formatting fix.David Terei2011-11-221-1/+1
|
* Turn on LLVM backend if 'keep-llvm-files' flag specified.David Terei2011-11-211-2/+4
|
* Fix #5636: Use clang as assembler on OSX when LLVM >= 3.0David Terei2011-11-211-2/+1
| | | | | | LLVM doesn't support the OS X system assembler anymore so we must use their assembler through clang. Also improved error messages when various LLVM tools can't be run.
* Add -dumpdir flag; fixes trac #5198Ian Lynagh2011-11-181-2/+7
| | | | | | -ddump-* files are put in the given directory. -outputdir also sets the dumpdir.
* Tabs -> Spaces + formatting fixesDavid Terei2011-11-161-3/+3
|
* Add Safe Haskell '-fwarn-safe', '-fwarn-unsafe', '-fno-safe-infer' flagsDavid Terei2011-11-161-6/+25
|
* Add -fpedantic-bottoms, and document itSimon Peyton Jones2011-11-161-0/+2
| | | | | | I did a bit of refactoring (of course) at the same time. See the discussion in Trac #5587. Most of the real change is in CoreArity.
* New kind-polymorphic coreJose Pedro Magalhaes2011-11-111-3/+7
| | | | | | | | | This big patch implements a kind-polymorphic core for GHC. The current implementation focuses on making sure that all kind-monomorphic programs still work in the new core; it is not yet guaranteed that kind-polymorphic programs (using the new -XPolyKinds flag) will work. For more information, see http://haskell.org/haskellwiki/GHC/Kinds
* Add more flags to the recompilation check (#437)Simon Marlow2011-11-101-1/+2
| | | | | | | Now included: - all language flags - all filename-related flags (-i, -osuf, -hidir etc.) - all CPP-related flags (-I, -D, -U)
* Remove the -fdph-* flagsManuel M T Chakravarty2011-11-101-35/+0
|
* Include package_flags in allFlags list.David Terei2011-11-081-1/+1
| | | | | This means ghci now correctly picks up the package flags for tab completion.
* Fix handling of safe imports in inference modeDavid Terei2011-11-081-2/+2
|
* Overhaul of infrastructure for profiling, coverage (HPC) and breakpointsSimon Marlow2011-11-021-19/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | User visible changes ==================== Profilng -------- Flags renamed (the old ones are still accepted for now): OLD NEW --------- ------------ -auto-all -fprof-auto -auto -fprof-exported -caf-all -fprof-cafs New flags: -fprof-auto Annotates all bindings (not just top-level ones) with SCCs -fprof-top Annotates just top-level bindings with SCCs -fprof-exported Annotates just exported bindings with SCCs -fprof-no-count-entries Do not maintain entry counts when profiling (can make profiled code go faster; useful with heap profiling where entry counts are not used) Cost-centre stacks have a new semantics, which should in most cases result in more useful and intuitive profiles. If you find this not to be the case, please let me know. This is the area where I have been experimenting most, and the current solution is probably not the final version, however it does address all the outstanding bugs and seems to be better than GHC 7.2. Stack traces ------------ +RTS -xc now gives more information. If the exception originates from a CAF (as is common, because GHC tends to lift exceptions out to the top-level), then the RTS walks up the stack and reports the stack in the enclosing update frame(s). Result: +RTS -xc is much more useful now - but you still have to compile for profiling to get it. I've played around a little with adding 'head []' to GHC itself, and +RTS -xc does pinpoint the problem quite accurately. I plan to add more facilities for stack tracing (e.g. in GHCi) in the future. Coverage (HPC) -------------- * derived instances are now coloured yellow if they weren't used * likewise record field names * entry counts are more accurate (hpc --fun-entry-count) * tab width is now correct (markup was previously off in source with tabs) Internal changes ================ In Core, the Note constructor has been replaced by Tick (Tickish b) (Expr b) which is used to represent all the kinds of source annotation we support: profiling SCCs, HPC ticks, and GHCi breakpoints. Depending on the properties of the Tickish, different transformations apply to Tick. See CoreUtils.mkTick for details. Tickets ======= This commit closes the following tickets, test cases to follow: - Close #2552: not a bug, but the behaviour is now more intuitive (test is T2552) - Close #680 (test is T680) - Close #1531 (test is result001) - Close #949 (test is T949) - Close #2466: test case has bitrotted (doesn't compile against current version of vector-space package)
* Tweak to doc for DynFlagsDavid Terei2011-11-011-7/+9
|
* safe haskell wipDavid Terei2011-11-011-6/+0
|
* More updates to Safe Haskell to implement new design (done!).David Terei2011-11-011-32/+50
| | | | | | | Conflicts: compiler/main/DynFlags.hs compiler/main/HscMain.lhs
* Fix some validation errorsDavid Terei2011-11-011-0/+4
| | | | | | | Conflicts: compiler/main/DynFlags.hs compiler/main/HscMain.lhs
* Revert "More updates to Safe Haskell to implement new design (done!)."Ian Lynagh2011-10-261-54/+32
| | | | This reverts commit bb0eb57e329bcdd781e24b0d86993a0df25beed8.
* Revert "Fix some validation errors"Ian Lynagh2011-10-261-0/+6
| | | | This reverts commit 4e2121f4fa33743d0acb42506b4d34952a7e4c80.
* Fix some validation errorsDavid Terei2011-10-251-6/+0
|
* More updates to Safe Haskell to implement new design (done!).David Terei2011-10-251-32/+54
|
* Setup new Safe Haskell interfaceDavid Terei2011-10-251-16/+16
|
* Follow change in FFI import declsIan Lynagh2011-10-211-1/+1
| | | | Now need to import constructors for Foreign.C.Types types
* Put the target platform in the settings fileIan Lynagh2011-10-191-2/+5
|
* Add -fpackage-trust flag to Safe Haskell.David Terei2011-10-171-0/+11
|
* Fix safe haskell warnings to include src locationsDavid Terei2011-10-171-9/+22
|
* Formatting wibbles.David Terei2011-10-171-21/+21
|
* Remove cruft code from old Safe Haskell implementation methodDavid Terei2011-10-171-483/+473
|
* Remove some CPPIan Lynagh2011-10-141-26/+19
|
* Define a TraditionalRecordSyntax extension; fixes #3356Ian Lynagh2011-09-271-0/+4
| | | | | | This allows the extension (which is on by default) to be turned off, which gets us a small step closer to replacing Haskell98 records with something better.
* Add a transformation limit to the simplifier (Trac #5448)Simon Peyton Jones2011-09-231-0/+3
| | | | | | | | | | | | | | | | | | | This addresses the rare cases where the simplifier diverges (see the above ticket). We were already counting how many simplifier steps were taking place, but with no limit. This patch adds a limit; at which point we halt compilation, and print out useful stats. The stats show what is begin inlined, and how often, which points you directly to the problem. The limit is set based on the size of the program. Instead of halting compilation, we could instead just inhibit inlining, which would let compilation of the module complete. This is a bit harder to implement, and it's likely to mean that you unrolled the function 1143 times and then ran out of ticks; you probably don't want to complete parsing on this highly-unrolled program. Flags: -dsimpl-tick-factor=N. Default is 100 (percent). A bigger number increases the allowed maximum tick count.
* ConstraintKind -> ConstraintKindsSimon Peyton Jones2011-09-071-2/+2
|
* Implement -XConstraintKindMax Bolingbroke2011-09-061-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Basically as documented in http://hackage.haskell.org/trac/ghc/wiki/KindFact, this patch adds a new kind Constraint such that: Show :: * -> Constraint (?x::Int) :: Constraint (Int ~ a) :: Constraint And you can write *any* type with kind Constraint to the left of (=>): even if that type is a type synonym, type variable, indexed type or so on. The following (somewhat related) changes are also made: 1. We now box equality evidence. This is required because we want to give (Int ~ a) the *lifted* kind Constraint 2. For similar reasons, implicit parameters can now only be of a lifted kind. (?x::Int#) => ty is now ruled out 3. Implicit parameter constraints are now allowed in superclasses and instance contexts (this just falls out as OK with the new constraint solver) Internally the following major changes were made: 1. There is now no PredTy in the Type data type. Instead GHC checks the kind of a type to figure out if it is a predicate 2. There is now no AClass TyThing: we represent classes as TyThings just as a ATyCon (classes had TyCons anyway) 3. What used to be (~) is now pretty-printed as (~#). The box constructor EqBox :: (a ~# b) -> (a ~ b) 4. The type LCoercion is used internally in the constraint solver and type checker to represent coercions with free variables of type (a ~ b) rather than (a ~# b)
* Add a flag -fno-ghci-historyIan Lynagh2011-09-011-0/+3
| | | | | Allows you to turn off loading/storing the GHCi command history from/to the ~/.ghc/ghci_history file.
* Snapshot of codegen refactoring to share with simonpjSimon Marlow2011-08-251-2/+0
|
* Add popCnt# primopJohan Tibell2011-08-161-0/+2
|
* Major improvement to pattern bindingsSimon Peyton Jones2011-08-161-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes a number of related improvements a) Implements the Haskell Prime semantics for pattern bindings (Trac #2357). That is, a pattern binding p = e is typed just as if it had been written t = e f = case t of p -> f g = case t of p -> g ... etc ... where f,g are the variables bound by p. In paricular it's ok to say (f,g) = (\x -> x, \y -> True) and f and g will get propertly inferred types f :: a -> a g :: a -> Int b) Eliminates the MonoPatBinds flag altogether. (For the moment it is deprecated and has no effect.) Pattern bindings are now generalised as per (a). Fixes Trac #2187 and #4940, in the way the users wanted! c) Improves the OutsideIn algorithm generalisation decision. Given a definition without a type signature (implying "infer the type"), the published algorithm rule is this: - generalise *top-level* functions, and - do not generalise *nested* functions The new rule is - generalise a binding whose free variables have Guaranteed Closed Types - do not generalise other bindings Generally, a top-level let-bound function has a Guaranteed Closed Type, and so does a nested function whose free vaiables are top-level functions, and so on. (However a top-level function that is bitten by the Monomorphism Restriction does not have a GCT.) Example: f x = let { foo y = y } in ... Here 'foo' has no free variables, so it is generalised despite being nested. d) When inferring a type f :: ty for a definition f = e, check that the compiler would accept f :: ty as a type signature for that same definition. The type is rejected precisely when the type is ambiguous. Example: class Wob a b where to :: a -> b from :: b -> a foo x = [x, to (from x)] GHC 7.0 would infer the ambiguous type foo :: forall a b. Wob a b => b -> [b] but that type would give an error whenever it is called; and GHC 7.0 would reject that signature if given by the programmer. The new type checker rejects it up front. Similarly, with the advent of type families, ambiguous types are easy to write by mistake. See Trac #1897 and linked tickets for many examples. Eg type family F a :: * f ::: F a -> Int f x = 3 This is rejected because (F a ~ F b) does not imply a~b. Previously GHC would *infer* the above type for f, but was unable to check it. Now even the inferred type is rejected -- correctly. The main implemenation mechanism is to generalise the abe_wrap field of ABExport (in HsBinds), from [TyVar] to HsWrapper. This beautiful generalisation turned out to make everything work nicely with minimal programming effort. All the work was fiddling around the edges; the core change was easy!
* Separate the warning flags into their own datatypeIan Lynagh2011-07-141-67/+85
| | | | | | | The -w flag wasn't turning off a few warnings (Opt_WarnMissingImportList, Opt_WarnMissingLocalSigs, Opt_WarnIdentities). Rather than just adding them, I've separated the Opt_Warn* contructors off into their own type, so -w now just sets the list of warning flags to [].