summaryrefslogtreecommitdiff
path: root/compiler/main/HscMain.hs
Commit message (Collapse)AuthorAgeFilesLines
...
* Split the Hsc phase into two subphasesIan Lynagh2013-03-091-8/+2
| | | | | The goal is that the second subphase will be run twice when using -dynamic-too
* A couple more small refactoringsIan Lynagh2013-03-091-11/+14
|
* Refactor the pipeline/hsc interactionIan Lynagh2013-03-071-316/+191
| | | | | It would probably still benefit from some tidying up, but it's now much more opaque, with the control flow easier to understand.
* Make codeOutput and friends return the filename that they have createdIan Lynagh2013-03-021-13/+15
|
* When printing types in the interactive UI, take account of free variablesSimon Peyton Jones2013-01-221-0/+2
| | | | | | | Often the types we print are full-generalised, but in fact *kinds* are not, so we need to use tidyOpenType. Fixes Trac #7587
* Handle -boot files properly when doing -dynamic-tooIan Lynagh2013-01-101-1/+2
|
* Rename all of the 'cmmz' flags and make them more consistent.Austin Seipp2012-12-191-4/+4
| | | | | | | | | | | | | | | | There's only a single compiler backend now, so the 'z' suffix means nothing. Also, the flags were confusingly named ('cmm-foo' vs 'foo-cmm',) and counter-intuitively, '-ddump-cmm' did not do at all what you expected since the new backend went live. Basically, all of the -ddump-cmmz-* flags are now -ddump-cmm-*. Some were renamed to be more consistent. This doesn't update the manual; it already mentions '-ddump-cmm' and that flag implies all the others anyway, which is probably what you want. Signed-off-by: Austin Seipp <mad.one@gmail.com>
* Implement the -dynamic-too optimised path for the NCGIan Lynagh2012-12-111-1/+8
| | | | | | | | We don't yet have the slow path, for when we have to fall back to separate compilation. We also only currently handle the case qhere we're compiling Haskell code with the NCG.
* Remove OldCmm, convert backends to consume new CmmSimon Marlow2012-11-121-9/+7
| | | | | | | | | | | | | | | | | | This removes the OldCmm data type and the CmmCvt pass that converts new Cmm to OldCmm. The backends (NCGs, LLVM and C) have all been converted to consume new Cmm. The main difference between the two data types is that conditional branches in new Cmm have both true/false successors, whereas in OldCmm the false case was a fallthrough. To generate slightly better code we occasionally need to invert a conditional to ensure that the branch-not-taken becomes a fallthrough; this was previously done in CmmCvt, and it is now done in CmmContFlowOpt. We could go further and use the Hoopl Block representation for native code, which would mean that we could use Hoopl's postorderDfs and analyses for native code, but for now I've left it as is, using the old ListGraph representation for native code.
* Refactor the way dump flags are handledIan Lynagh2012-10-181-2/+2
| | | | | | | | | | | | | We were being inconsistent about how we tested whether dump flags were enabled; in particular, sometimes we also checked the verbosity, and sometimes we didn't. This lead to oddities such as "ghc -v4" printing an "Asm code" section which didn't contain any code, and "-v4" enabled some parts of "-ddump-deriv" but not others. Now all the tests use dopt, which also takes the verbosity into account as appropriate.
* Some alpha renamingIan Lynagh2012-10-161-4/+4
| | | | | Mostly d -> g (matching DynFlag -> GeneralFlag). Also renamed if* to when*, matching the Haskell if/when names
* Produce new-style Cmm from the Cmm parserSimon Marlow2012-10-081-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main change here is that the Cmm parser now allows high-level cmm code with argument-passing and function calls. For example: foo ( gcptr a, bits32 b ) { if (b > 0) { // we can make tail calls passing arguments: jump stg_ap_0_fast(a); } return (x,y); } More details on the new cmm syntax are in Note [Syntax of .cmm files] in CmmParse.y. The old syntax is still more-or-less supported for those occasional code fragments that really need to explicitly manipulate the stack. However there are a couple of differences: it is now obligatory to give a list of live GlobalRegs on every jump, e.g. jump %ENTRY_CODE(Sp(0)) [R1]; Again, more details in Note [Syntax of .cmm files]. I have rewritten most of the .cmm files in the RTS into the new syntax, except for AutoApply.cmm which is generated by the genapply program: this file could be generated in the new syntax instead and would probably be better off for it, but I ran out of enthusiasm. Some other changes in this batch: - The PrimOp calling convention is gone, primops now use the ordinary NativeNodeCall convention. This means that primops and "foreign import prim" code must be written in high-level cmm, but they can now take more than 10 arguments. - CmmSink now does constant-folding (should fix #7219) - .cmm files now go through the cmmPipeline, and as a result we generate better code in many cases. All the object files generated for the RTS .cmm files are now smaller. Performance should be better too, but I haven't measured it yet. - RET_DYN frames are removed from the RTS, lots of code goes away - we now have some more canned GC points to cover unboxed-tuples with 2-4 pointers, which will reduce code size a little.
* This big patch re-factors the way in which arrow-syntax is handledSimon Peyton Jones2012-10-031-3/+3
| | | | | | | | | | | | | | | | | | | | | | All the work was done by Dan Winograd-Cort. The main thing is that arrow comamnds now have their own data type HsCmd (defined in HsExpr). Previously it was punned with the HsExpr type, which was jolly confusing, and made it hard to do anything arrow-specific. To make this work, we now parameterise * MatchGroup * Match * GRHSs, GRHS * StmtLR and friends over the "body", that is the kind of thing they enclose. This "body" parameter can be instantiated to either LHsExpr or LHsCmd respectively. Everything else is really a knock-on effect; there should be no change (yet!) in behaviour. But it should be a sounder basis for fixing bugs.
* fix stage2 compilationSimon Marlow2012-09-261-0/+1
|
* Remove some old-codegen cruftSimon Marlow2012-09-251-11/+3
|
* When -split-objs is on, make one SRT per split, not one per moduleSimon Marlow2012-09-251-12/+27
| | | | | This is a hopefully temporary measure until the new SRT design is implemeented.
* Fix -split-objs with the new code generatorSimon Marlow2012-09-041-1/+3
| | | | | | We need to make the SRT label external and unique when splitting, because it is shared amongst all the functions in the module. Also some SRT-related cleanup.
* Fix :issafe command (#7172).David Terei2012-08-231-4/+18
|
* Improve Safe Haskell warn/error output.David Terei2012-08-231-7/+9
|
* Remove an unsafe use of head (#7118)Paolo Capriotti2012-08-051-1/+1
|
* Make -fscc-profiling a dynamic flagIan Lynagh2012-07-241-3/+2
| | | | All the flags that 'ways' imply are now dynamic
* Allow 'default' declarations in GHCiPatrick Palka2012-07-111-1/+4
|
* Remove "fuel", adapt to Hoopl changes, fix warningsSimon Marlow2012-07-051-3/+0
|
* Fix merge-related problemsSimon Marlow2012-07-041-2/+0
|
* Merge remote-tracking branch 'origin/master' into newcgSimon Marlow2012-07-041-140/+185
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/master: (756 commits) don't crash if argv[0] == NULL (#7037) -package P was loading all versions of P in GHCi (#7030) Add a Note, copying text from #2437 improve the --help docs a bit (#7008) Copy Data.HashTable's hashString into our Util module Build fix Build fixes Parse error: suggest brackets and indentation. Don't build the ghc DLL on Windows; works around trac #5987 On Windows, detect if DLLs have too many symbols; trac #5987 Add some more Integer rules; fixes #6111 Fix PA dfun construction with silent superclass args Add silent superclass parameters to the vectoriser Add silent superclass parameters (again) Mention Generic1 in the user's guide Make the GHC API a little more powerful. tweak llvm version warning message New version of the patch for #5461. Fix Word64ToInteger conversion rule. Implemented feature request on reconfigurable pretty-printing in GHCi (#5461) ... Conflicts: compiler/basicTypes/UniqSupply.lhs compiler/cmm/CmmBuildInfoTables.hs compiler/cmm/CmmLint.hs compiler/cmm/CmmOpt.hs compiler/cmm/CmmPipeline.hs compiler/cmm/CmmStackLayout.hs compiler/cmm/MkGraph.hs compiler/cmm/OldPprCmm.hs compiler/codeGen/CodeGen.lhs compiler/codeGen/StgCmm.hs compiler/codeGen/StgCmmBind.hs compiler/codeGen/StgCmmLayout.hs compiler/codeGen/StgCmmUtils.hs compiler/main/CodeOutput.lhs compiler/main/HscMain.hs compiler/nativeGen/AsmCodeGen.lhs compiler/simplStg/SimplStg.lhs
| * small tidyupSimon Marlow2012-06-151-2/+1
| |
| * Remove more redundant Platform argumentsIan Lynagh2012-06-131-2/+1
| |
| * Remove some more Platform argumentsIan Lynagh2012-06-131-1/+1
| |
| * Merge branch 'master' of darcs.haskell.org:/srv/darcs//ghcIan Lynagh2012-06-131-8/+8
| |\ | | | | | | | | | | | | Fix conflicts in: compiler/main/DynFlags.hs
| | * fix spelling: "infered" -> "inferred"Simon Marlow2012-06-111-8/+8
| | |
| * | Remove PlatformOutputableIan Lynagh2012-06-131-2/+2
| | | | | | | | | | | | | | | We can now get the Platform from the DynFlags inside an SDoc, so we no longer need to pass the Platform in.
| * | Pass DynFlags down to showSDocIan Lynagh2012-06-121-2/+3
| | |
| * | Pass DynFlags down to mk_err_msgIan Lynagh2012-06-121-16/+16
| |/
| * Put the Integer type, rather than the mkIntegerId, inside LitIntegerIan Lynagh2012-06-061-4/+5
| | | | | | | | | | This will make it possible to write PrelRules that produce an Integer result without having Integer arguments.
| * Change how macros like ASSERT are definedIan Lynagh2012-06-051-0/+1
| | | | | | | | | | By using Haskell's debugIsOn rather than CPP's "#ifdef DEBUG", we don't need to kludge things to keep the warning checker happy etc.
| * Replace printDump with a new SeverityIan Lynagh2012-05-291-1/+1
| | | | | | | | | | | | We now use log_action with severity SevDump, rather than calling printDump. This means that what happens to dumped info is now under the control of the GHC API user, rather than always going to stdout.
| * Add a fixity environment to InteractiveContext (#2947)Paolo Capriotti2012-05-151-4/+4
| |
| * Tidy up a remaining glitch in unificationSimon Peyton Jones2012-05-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was one place, in type checking parallel list comprehensions where we were unifying types, but had no convenient way to use the resulting coercion; instead we just checked that it was Refl. This was Wrong Wrong; it might fail unpredicably in a GADT-like situation, and it led to extra error-generation code used only in this one place. This patch tidies it all up, by moving the 'return' method from the *comprehension* to the ParStmtBlock. The latter is a new data type, now used for each sub-chunk of a parallel list comprehension. Because of the data type change, quite a few modules are touched, but only in a fairly trivial way. The real changes are in TcMatches (and corresponding desugaring); plus deleting code from TcUnify. This patch also fixes the pretty-printing bug in Trac #6060
| * Add experimental GHCi monad.David Terei2012-04-241-0/+6
| | | | | | | | | | | | | | | | Modification of previous commit: e0e99f9948c1eac82cf69dd3cc30cb068e42d45e Allows setting which monad GHCi runs statements in. Unsupported at this stage.
| * Revert "Added ':runmonad' command to GHCi"Simon Peyton Jones2012-04-131-6/+0
| | | | | | | | | | | | | | | | | | | | Two problems, for now at any rate a) Breaks the build with lots of errors like No instance for (Show (IO ())) arising from a use of `print' b) Discussion of the approache hasn't converged yet (Simon M had a number of suggestions) This reverts commit eecd7c98c1f079c14d99ed831dff33a48ee45e67.
| * Added ':runmonad' command to GHCiDavid Terei2012-04-121-0/+6
| | | | | | | | | | | | | | | | | | This command allows you to lift user stmts in GHCi into an IO monad that implements the GHC.GHCi.GHCiSandboxIO type class. This allows for easy sandboxing of GHCi using :runmonad and Safe Haskell. Longer term it would be nice to allow a more general model for the Monad than GHCiSandboxIO but delaying this for the moment.
| * Fix GHC API with respect to safe haskell. (#5989)David Terei2012-04-041-49/+61
| | | | | | | | | | This fixes haddock so it correctly reports the safe haskell mode of a module.
| * Update safe haskell error/warn formattingDavid Terei2012-04-041-15/+11
| |
| * Fix tracking of reason safe inference failed. (#5988)David Terei2012-04-041-13/+26
| |
| * In --make, give an indication of why a module is being recompiledSimon Marlow2012-03-011-17/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | e.g. [3 of 5] Compiling C (C.hs, C.o) [4 of 5] Compiling D (D.hs, D.o) [C changed] [5 of 5] Compiling E (E.hs, E.o) [D changed] The main motivation for this is so that we can give the user a clue when something is being recompiled because the flags changed: [1 of 1] Compiling Test2 ( Test2.hs, Test2.o ) [flags changed]
| * GHCi: add :seti, for options that apply only at the prompt (#3217)Simon Marlow2012-03-011-17/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GHCi now maintains two DynFlags: one that applies to whole modules loaded with :load, and one that applies to things typed at the prompt (expressions, statements, declarations, commands). The :set command modifies both DynFlags. This is for backwards compatibility: users won't notice any difference. The :seti command applies only to the interactive DynFlags. Additionally, I made a few changes to ":set" (with no arguments): * Now it only prints out options that differ from the defaults, rather than the whole list. * There is a new variant, ":set -a" to print out all options (the old behaviour). * It also prints out language options. e.g. Prelude> :set options currently set: none. base language is: Haskell2010 with the following modifiers: -XNoDatatypeContexts -XNondecreasingIndentation GHCi-specific dynamic flag settings: other dynamic, non-language, flag settings: -fimplicit-import-qualified warning settings: ":seti" (with no arguments) does the same as ":set", but for the interactive options. It also has the "-a" option. The interactive DynFlags are kept in the InteractiveContext, and copied into the HscEnv at the appropriate points (all in HscMain). There are some new GHC API operations: -- | Set the 'DynFlags' used to evaluate interactive expressions. setInteractiveDynFlags :: GhcMonad m => DynFlags -> m () -- | Get the 'DynFlags' used to evaluate interactive expressions. getInteractiveDynFlags :: GhcMonad m => m DynFlags -- | Sets the program 'DynFlags'. setProgramDynFlags :: GhcMonad m => DynFlags -> m [PackageId] -- | Returns the program 'DynFlags'. getProgramDynFlags :: GhcMonad m => m DynFlags Note I have not completed the whole of the plan outlined in #3217 yet: when in the context of a loaded module we don't take the interactive DynFlags from that module. That needs some more refactoring and thinking about, because we'll need to save and restore the original interactive DynFlags. This solves the immediate problem that people are having with the new flag checking in 7.4.1, because now it is possible to set language options in ~/.ghci that do not affect loaded modules and thereby cause recompilation.
* | Merge remote-tracking branch 'origin/master' into newcgSimon Marlow2012-02-131-130/+145
|\ \ | |/ | | | | | | | | | | | | Conflicts: compiler/cmm/CmmLint.hs compiler/cmm/OldCmm.hs compiler/codeGen/CgMonad.lhs compiler/main/CodeOutput.lhs
| * Put only local instances in the interactive context (fixes Trac #5820)Simon Peyton Jones2012-02-101-2/+2
| | | | | | | | | | | | | | | | In HscMain.hscDeclsWithLocaion, we were grabbing class instances from the tcg_inst_env field of the TcGblEnv. But that's wrong: that field contains all the *home-package* instances. Instead we need the tct_insts field, which has just the instances from the module being compiled.
| * Fix validation error, import only in GHCiDavid Terei2012-01-261-1/+2
| |
| * Fix missing import in HscMain.David Terei2012-01-261-0/+1
| |