1. 11 Jan, 2013 1 commit
  2. 29 Nov, 2012 1 commit
  3. 29 Oct, 2012 1 commit
    • Simon Peyton Jones's avatar
      Do not treat a constructor in a *pattern* as a *use* of that constructor · 910a6422
      Simon Peyton Jones authored
      Occurrences in terms are uses, in patterns they are not.
      In this way we get unused-constructor warnings from modules like this
      
         module M( f, g, T ) where
           data T = T1 | T2 Bool
      
           f x = T2 x
      
           g T1 = True
           g (T2 x) = x
      
      Here a T1 value cannot be constructed, so we can warn. The use
      in a pattern doesn't count.  See Note [Patterns are not uses]
      in RnPat.
      
      Interestingly this change exposed three module in GHC itself
      that had unused constructors, which I duly removed:
        * ghc/Main.hs
        * compiler/ghci/ByteCodeAsm
        * compiler/nativeGen/PPC/RegInfo
      Their changes are in this patch.
      910a6422
  4. 25 Oct, 2012 1 commit
  5. 16 Oct, 2012 1 commit
    • ian@well-typed.com's avatar
      Some alpha renaming · cd33eefd
      ian@well-typed.com authored
      Mostly d -> g (matching DynFlag -> GeneralFlag).
      Also renamed if* to when*, matching the Haskell if/when names
      cd33eefd
  6. 03 Sep, 2012 2 commits
  7. 13 Aug, 2012 1 commit
  8. 07 Aug, 2012 1 commit
  9. 14 Jul, 2012 1 commit
    • Ian Lynagh's avatar
      Add a separate FastZString type · 509d2ad2
      Ian Lynagh authored
      FastStrings are now always UTF8-encoded.
      
      There's no StringTable for FastZString, but I don't think one is needed.
      We only ever make a FastZString by running zEncodeFS on a FastString,
      and the FastStrings are shared via the FastString StringTable, so we get
      the same FastZString from the IORef.
      509d2ad2
  10. 10 Jul, 2012 1 commit
  11. 19 Jun, 2012 1 commit
  12. 18 Jun, 2012 1 commit
  13. 12 Jun, 2012 1 commit
  14. 11 Jun, 2012 3 commits
    • Ian Lynagh's avatar
      Pass DynFlags to the LogAction · 5716a2f8
      Ian Lynagh authored
      A side-effect is that we can no longer use the LogAction in
      defaultErrorHandler, as we don't have DynFlags at that point.
      But all that defaultErrorHandler did is to print Strings as
      SevFatal, so now it takes a 'FatalMessager' instead.
      5716a2f8
    • Ian Lynagh's avatar
      Pass DynFlags to prettyPrintGhcErrors · 65152943
      Ian Lynagh authored
      We don't use it yet
      65152943
    • Ian Lynagh's avatar
      Change how pprPanic works · fa362ab5
      Ian Lynagh authored
      We now include the String and the SDoc in the exception, and don't
      flatten them into a String until near the top-level
      fa362ab5
  15. 13 Mar, 2012 1 commit
  16. 01 Mar, 2012 1 commit
    • Simon Marlow's avatar
      GHCi: add :seti, for options that apply only at the prompt (#3217) · 2e55760b
      Simon Marlow authored
      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.
      2e55760b
  17. 24 Feb, 2012 1 commit
  18. 07 Feb, 2012 1 commit
  19. 20 Dec, 2011 1 commit
  20. 04 Nov, 2011 1 commit
  21. 17 Oct, 2011 2 commits
  22. 06 Aug, 2011 1 commit
  23. 20 Jul, 2011 1 commit
  24. 03 Jul, 2011 1 commit
    • Ian Lynagh's avatar
      defaultErrorHandler now only takes LogAction · e01fffc6
      Ian Lynagh authored
      It used to take a whole DynFlags, but that meant we had to
      create a DynFlags with (panic "No settings") for settings, as
      we didn't have any real settings.
      
      Now we just pass the LogAction, which is all that it actually needed.
      The default is exported from DynFlags as defaultLogAction.
      e01fffc6
  25. 18 Jun, 2011 1 commit
    • dterei's avatar
      SafeHaskell: Disable certain ghc extensions in Safe. · 45c64c1d
      dterei authored
      This patch disables the use of some GHC extensions in
      Safe mode and also the use of certain flags. Some
      are disabled completely while others are only allowed
      on the command line and not in source PRAGMAS.
      
      We also check that Safe imports are indeed importing
      a Safe or Trustworthy module.
      45c64c1d
  26. 21 Apr, 2011 2 commits
  27. 04 Apr, 2011 1 commit
  28. 23 Nov, 2010 1 commit
  29. 27 Oct, 2010 1 commit
    • Simon Marlow's avatar
      Refactoring and tidyup of HscMain and related things (also fix #1666) · 94bf0d36
      Simon Marlow authored
      While trying to fix #1666 (-Werror aborts too early) I decided to some
      tidyup in GHC/DriverPipeline/HscMain.
      
       - The GhcMonad overloading is gone from DriverPipeline and HscMain
         now.  GhcMonad is now defined in a module of its own, and only
         used in the top-level GHC layer.  DriverPipeline and HscMain
         use the plain IO monad and take HscEnv as an argument.
      
       - WarnLogMonad is gone.  printExceptionAndWarnings is now called
         printException (the old name is deprecated).  Session no longer
         contains warnings.
      
       - HscMain has its own little monad that collects warnings, and also
         plumbs HscEnv around.  The idea here is that warnings are collected
         while we're in HscMain, but on exit from HscMain (any function) we
         check for warnings and either print them (via log_action, so IDEs
         can still override the printing), or turn them into an error if
         -Werror is on.
      
       - GhcApiCallbacks is gone, along with GHC.loadWithLogger.  Thomas
         Schilling told me he wasn't using these, and I don't see a good
         reason to have them.
      
       - there's a new pure API to the parser (suggestion from Neil Mitchell):
            parser :: String
                   -> DynFlags
                   -> FilePath
                   -> Either ErrorMessages (WarningMessages, 
                                            Located (HsModule RdrName))
      94bf0d36
  30. 16 Aug, 2010 1 commit
    • simonpj@microsoft.com's avatar
      Refactor the command-line argument parsing (again) · 0cb74388
      simonpj@microsoft.com authored
      This change allows the client of CmdLineParser a bit more flexibility,
      by giving him an arbitrary computation (not just a deprecation
      message) for each flag.  
      
      There are several clients, so there are lots of boilerplate changes.
      
      Immediate motivation: if RTS is not profiled, we want to make 
      Template Haskell illegal.  That wasn't with the old setup.
      0cb74388
  31. 24 Jul, 2010 3 commits
  32. 27 Apr, 2010 1 commit
    • Simon Marlow's avatar
      --make is now the default (#3515), and -fno-code works with --make (#3783) · 7828bf3e
      Simon Marlow authored
      If the command line contains any Haskell source files, then we behave
      as if --make had been given.
      
      The meaning of the -c flag has changed (back): -c now selects one-shot
      compilation, but stops before linking.  However, to retain backwards
      compatibility, -c is still allowed with --make, and means the same as
      --make -no-link.  The -no-link flag has been un-deprecated.
      
      -fno-code is now allowed with --make (#3783); the fact that it was
      disabled before was largely accidental, it seems.  We also had some
      regressions in this area: it seems that -fno-code was causing a .hc
      file to be emitted in certain cases.  I've tidied up the code, there
      was no need for -fno-code to be a "mode" flag, as far as I can tell.
      
      -fno-code does not emit interface files, nor does it do recompilation
      checking, as suggested in #3783.  This would make Haddock emit
      interface files, for example, and I'm fairly sure we don't want to do
      that.  Compiling with -fno-code is pretty quick anyway, perhaps we can
      get away without recompilation checking.
      7828bf3e
  33. 12 Oct, 2009 1 commit