1. 16 Sep, 2015 1 commit
  2. 03 Sep, 2015 2 commits
  3. 02 Sep, 2015 2 commits
    • Simon Peyton Jones's avatar
      Improve the error messages for class instance errors · 28ac9d31
      Simon Peyton Jones authored
      Summary: See Note [Displaying potential instances].
      
      Reviewers: austin
      
      Subscribers: KaneTW, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1176
      28ac9d31
    • Michael Snoyman's avatar
      Use a response file for linker command line arguments #10777 · 296bc70b
      Michael Snoyman authored
      On Windows, we're constrained to 32k bytes total for command line
      arguments.  When building large projects, this limit can be exceeded.
      This patch changes GHC to always use response files for linker
      arguments, a feature first used by Microsoft compilers and added to GCC
      (over a decade ago).
      
      Alternatives here include:
      
      * Only use this method on Windows systems
      * Check the length of the command line arguments and use that to decide
        whether to use this method
      
      I did not pursue either of these, as I believe it would make the patch
      more likely to break in less tested situations.
      
      Test Plan:
      Confirm that linking still works in general. Ideally: compile a very
      large project on Windows with this patch. (I am attempting to do that
      myself now, but having trouble getting the Windows build tool chain up
      and running.)
      
      Reviewers: goldfire, hvr, rwbarton, austin, thomie, bgamari, Phyx
      
      Reviewed By: thomie, bgamari, Phyx
      
      Subscribers: erikd, awson, #ghc_windows_task_force, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1158
      
      GHC Trac Issues: #8596, #10777
      296bc70b
  4. 27 Aug, 2015 1 commit
  5. 26 Aug, 2015 2 commits
  6. 24 Aug, 2015 1 commit
  7. 21 Aug, 2015 5 commits
    • rpglover64's avatar
      Check options before warning about source imports. · a5061a96
      rpglover64 authored
      Summary: Fixes T10637
      
      Reviewers: austin, bgamari, thomie
      
      Subscribers: dfordivam, simonpj, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1157
      
      GHC Trac Issues: #10637
      a5061a96
    • thomie's avatar
      Refactor: delete most of the module FastTypes · 2f29ebbb
      thomie authored
      This reverses some of the work done in #1405, and goes back to the
      assumption that the bootstrap compiler understands GHC-haskell.
      
      In particular:
        * use MagicHash instead of _ILIT and _CLIT
        * pattern matching on I# if possible, instead of using iUnbox
          unnecessarily
        * use Int#/Char#/Addr# instead of the following type synonyms:
          - type FastInt   = Int#
          - type FastChar  = Char#
          - type FastPtr a = Addr#
        * inline the following functions:
          - iBox           = I#
          - cBox           = C#
          - fastChr        = chr#
          - fastOrd        = ord#
          - eqFastChar     = eqChar#
          - shiftLFastInt  = uncheckedIShiftL#
          - shiftR_FastInt = uncheckedIShiftRL#
          - shiftRLFastInt = uncheckedIShiftRL#
        * delete the following unused functions:
          - minFastInt
          - maxFastInt
          - uncheckedIShiftRA#
          - castFastPtr
          - panicDocFastInt and pprPanicFastInt
        * rename panicFastInt back to panic#
      
      These functions remain, since they actually do something:
        * iUnbox
        * bitAndFastInt
        * bitOrFastInt
      
      Test Plan: validate
      
      Reviewers: austin, bgamari
      
      Subscribers: rwbarton
      
      Differential Revision: https://phabricator.haskell.org/D1141
      
      GHC Trac Issues: #1405
      2f29ebbb
    • thomie's avatar
      Delete FastBool · 3452473b
      thomie authored
      This reverses some of the work done in Trac #1405, and assumes GHC is
      smart enough to do its own unboxing of booleans now.
      
      I would like to do some more performance measurements, but the code
      changes can be reviewed already.
      
      Test Plan:
      With a perf build:
      ./inplace/bin/ghc-stage2 nofib/spectral/simple/Main.hs -fforce-recomp
      +RTS -t --machine-readable
      
      before:
      ```
        [("bytes allocated", "1300744864")
        ,("num_GCs", "302")
        ,("average_bytes_used", "8811118")
        ,("max_bytes_used", "24477464")
        ,("num_byte_usage_samples", "9")
        ,("peak_megabytes_allocated", "64")
        ,("init_cpu_seconds", "0.001")
        ,("init_wall_seconds", "0.001")
        ,("mutator_cpu_seconds", "2.833")
        ,("mutator_wall_seconds", "4.283")
        ,("GC_cpu_seconds", "0.960")
        ,("GC_wall_seconds", "0.961")
        ]
      ```
      
      after:
      ```
        [("bytes allocated", "1301088064")
        ,("num_GCs", "310")
        ,("average_bytes_used", "8820253")
        ,("max_bytes_used", "24539904")
        ,("num_byte_usage_samples", "9")
        ,("peak_megabytes_allocated", "64")
        ,("init_cpu_seconds", "0.001")
        ,("init_wall_seconds", "0.001")
        ,("mutator_cpu_seconds", "2.876")
        ,("mutator_wall_seconds", "4.474")
        ,("GC_cpu_seconds", "0.965")
        ,("GC_wall_seconds", "0.979")
        ]
      ```
      
      CPU time seems to be up a bit, but I'm not sure. Unfortunately CPU time
      measurements are rather noisy.
      
      Reviewers: austin, bgamari, rwbarton
      
      Subscribers: nomeata
      
      Differential Revision: https://phabricator.haskell.org/D1143
      
      GHC Trac Issues: #1405
      3452473b
    • Ben Gamari's avatar
      Implement getSizeofMutableByteArrayOp primop · 9e8562ae
      Ben Gamari authored
      Now since ByteArrays are mutable we need to be more explicit about when
      the size is queried.
      
      Test Plan: Add testcase and validate
      
      Reviewers: goldfire, hvr, austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1139
      
      GHC Trac Issues: #9447
      9e8562ae
    • Ben Gamari's avatar
      GhcMake: Fix spelling in comment · a146b282
      Ben Gamari authored
      a146b282
  8. 18 Aug, 2015 2 commits
    • Tamar Christina's avatar
      Fix rdynamic flag and test on Windows · b17ec567
      Tamar Christina authored
      The rdynamic tests and feature are marked broken on windows.
      This is because the flag used doesn't exist and the symbol lookup
      in the test did not account for platform differences in name mangling.
      
      This commit fixes the flag and tests for rdynamic on windows.
      
      Test Plan:
      make TEST="rdynamic"
      
      on both x86 and x86_64
      
      Reviewers: austin, thomie, bgamari
      
      Reviewed By: thomie, bgamari
      
      Subscribers: #ghc_windows_task_force
      
      Differential Revision: https://phabricator.haskell.org/D1149
      
      GHC Trac Issues: #9381
      b17ec567
    • Michael Snoyman's avatar
      Dump files always use UTF8 encoding #10762 · ab9403d5
      Michael Snoyman authored
      When the Windows codepage or *nix LANG variable is something besides
      UTF-8, dumping to file can cause GHC to exit currently. This changes the
      output encoding for files to match the defined input encoding for
      Haskell source code (UTF-8), making it easier for users and build tools
      to capture this output.
      
      Test Plan:
      Create a Haskell source file with non-Latin characters for identifier
      names and
      compile with:
      
      LANG=C ghc -ddump-to-file -ddump-hi filename.hs -fforce-recomp
      
      Without this patch, it will fail. With this patch, it succeeds
      
      Reviewers: austin, rwbarton, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1151
      
      GHC Trac Issues: #10762
      ab9403d5
  9. 13 Aug, 2015 1 commit
  10. 12 Aug, 2015 2 commits
    • Ben Gamari's avatar
      SysTools: Fix whitespace in error message · 8c5b087b
      Ben Gamari authored
      8c5b087b
    • Tamar Christina's avatar
      Upgrade GCC to 5.2.0 for Windows x86 and x86_64 · 7b211b4e
      Tamar Christina authored
      This patch does a few things
      
      - Moved GHC x86 to MinGW-w64 (Using Awson's patch)
      - Moves Both GHCs to MSYS2 toolchains
      - Completely removes the dependencies on the git tarball repo
        - Downloads only the required tarball for the architecture for
          which we are building
        - Downloads the perl tarball is missing as well
        - Fixed a few bugs in the linker to fix tests on Windows
      
      The links currently point to repo.msys2.org and GitHub, it might be
      more desirable to mirror them on
      http://downloads.haskell.org/~ghc/mingw/ as with the previous patch
      attempt.
      
      For more details on what the MSYS2 packages I include see #10726
      (Awson's comment). but it should contain all we need
      and no python or fortran, which makes the uncompressed tar a 1-2
      hundreds mb smaller.
      
      The `GCC 5.2.0` in the package supports `libgcc` as a shared library,
      this is a problem since
      when compiling with -shared the produced dll now has a dependency on
      `libgcc_s_sjlj-1.dll`.
      To solve this the flag `-static-libgcc` is now being used for all GCC
      calls on windows.
      
      Test Plan:
      ./validate was ran both on x86 and x86_64 windows and compared against
      the baseline.
      
      A few test were failing due to Ld no longer being noisy. These were
      updated.
      
      The changes to the configure script *should* be validated by the build
      bots for the other platforms before landing
      
      Reviewers: simonmar, awson, bgamari, austin, thomie
      
      Reviewed By: thomie
      
      Subscribers: #ghc_windows_task_force, thomie, awson
      
      Differential Revision: https://phabricator.haskell.org/D1123
      
      GHC Trac Issues: #10726, #9014, #9218, #10435
      7b211b4e
  11. 06 Aug, 2015 1 commit
    • Ben Gamari's avatar
      Ensure DynFlags are consistent · eca9a1a1
      Ben Gamari authored
      While we have always had makeDynFlagsConsistent to enforce a variety of
      consistency invariants on DynFlags, it hasn't been widely used.
      GHC.Main, for instance, ignored it entirely. This leads to issues like
      Trac #10549, where an OPTIONS_GHC pragma introduced an inconsistency,
      leading to a perplexing crash later in compilation.
      
      Here I add consistency checks in GHC.Main.set{Session,Program}DynFlags,
      closing this hole.
      
      Fixes #10549.
      
      Test Plan: Validate with T10549
      
      Reviewers: austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1128
      
      GHC Trac Issues: #10549
      eca9a1a1
  12. 05 Aug, 2015 4 commits
    • Simon Peyton Jones's avatar
      Warn about missed specialisations for imports · a4261549
      Simon Peyton Jones authored
      This change was provoked by Trac #10720, where a missing
      INLINEABLE pragma gave very poor performance.
      
      The change is to warn when an imported function is not specialised
      in a situation where the user expects it to be.
      
      New flags
        -fwarn-missed-specialisations
        -fwarn-all-missed-specialisations
      
      Documented in user manual.
      See Note [Warning about missed specialisations]
      a4261549
    • Simon Peyton Jones's avatar
      Allow proper errors/warnings in core2core passes · e2b57381
      Simon Peyton Jones authored
      This patch makes it possible for core-to-core passes to emit
      proper error messages and warnings.
      
        * New function CoreMonad.warnMsg
      
        * CoreMonad.warnMsg and errorMsg now print a proper warning/error
          message heading.
      
        * CoreMonad carries a SrcSpan, which is used in warning/error
          messages.  It is initialised to be the source file name, but
          a core-to-core pass could set it more specifically if it had
          better location information.
      
      There was a bit of plumbing needed to get the filename to the
      right place.
      e2b57381
    • Christiaan Baaij's avatar
      Make -fcpr-off a dynamic flag · ecb1752f
      Christiaan Baaij authored
      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
      ecb1752f
    • Christiaan Baaij's avatar
      Add framework flags when linking a dynamic library · dd7e1880
      Christiaan Baaij authored
      This fixes the GHC side of trac #10568. So `cabal install
      --ghc-options="-framework GLUT" GLUT` creates a correctly linked
      GLUT.dylib. We still need to explictly pass `--ghc-options="-framework
      GLUT"` because the Cabal side #10568 is not fixed.
      
      Update: the Cabal side of #10568 is fixed by
      [Cabal#2747](https://github.com/haskell/cabal/pull/2747)
      
      Test Plan: validate
      
      Reviewers: austin, rwbarton, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1115
      
      GHC Trac Issues: #10568
      dd7e1880
  13. 03 Aug, 2015 1 commit
  14. 02 Aug, 2015 1 commit
    • Alan Zimmerman's avatar
      Replace (SourceText,FastString) with StringLiteral data type · 15dd7007
      Alan Zimmerman authored
      Summary:
      Phab:D907 introduced SourceText for a number of data types, by replacing
      FastString with (SourceText,FastString). Since this has an Outputable
      instance, no warnings are generated when ppr is called on it, but
      unexpected output is generated. See Phab:D1096 for an example of this.
      
      Replace the (SourceText,FastString) tuples with a new data type,
      ```lang=hs
      data StringLiteral = StringLiteral SourceText FastString
      ```
      
      Update haddock submodule accordingly
      
      Test Plan: ./validate
      
      Reviewers: hvr, austin, rwbarton, trofi, bgamari
      
      Reviewed By: trofi, bgamari
      
      Subscribers: thomie, trofi, rwbarton, mpickering
      
      Differential Revision: https://phabricator.haskell.org/D1101
      
      GHC Trac Issues: #10692
      15dd7007
  15. 27 Jul, 2015 1 commit
    • Adam Sandberg Eriksson's avatar
      Implementation of StrictData language extension · f842ad6c
      Adam Sandberg Eriksson authored
      This implements the `StrictData` language extension, which lets the
      programmer default to strict data fields in datatype declarations on a
      per-module basis.
      
      Specification and motivation can be found at
      https://ghc.haskell.org/trac/ghc/wiki/StrictPragma
      
      This includes a tricky parser change due to conflicts regarding `~` in
      the type level syntax: all ~'s are parsed as strictness annotations (see
      `strict_mark` in Parser.y) and then turned into equality constraints at
      the appropriate places using `RdrHsSyn.splitTilde`.
      
      Updates haddock submodule.
      
      Test Plan: Validate through Harbormaster.
      
      Reviewers: goldfire, austin, hvr, simonpj, tibbe, bgamari
      
      Reviewed By: simonpj, tibbe, bgamari
      
      Subscribers: lelf, simonpj, alanz, goldfire, thomie, bgamari, mpickering
      
      Differential Revision: https://phabricator.haskell.org/D1033
      
      GHC Trac Issues: #8347
      f842ad6c
  16. 23 Jul, 2015 4 commits
    • Edward Z. Yang's avatar
      Library names, with Cabal submodule update · f9687caf
      Edward Z. Yang authored
      A library name is a package name, package version, and hash of the
      version names of all textual dependencies (i.e. packages which were included.) A library
      name is a coarse approximation of installed package IDs, which are suitable for
      inclusion in package keys (you don't want to put an IPID in a package key, since
      it means the key will change any time the source changes.)
      
          - We define ShPackageKey, which is the semantic object which
            is hashed into a PackageKey.  You can use 'newPackageKey'
            to hash a ShPackageKey to a PackageKey
      
          - Given a PackageKey, we can lookup its ShPackageKey with
            'lookupPackageKey'.  The way we can do this is by consulting
            the 'pkgKeyCache', which records a reverse mapping from
            every hash to the ShPackageKey.  This means that if you
            load in PackageKeys from external sources (e.g. interface
            files), you also need to load in a mapping of PackageKeys
            to their ShPackageKeys so we can populate the cache.
      
          - We define a 'LibraryName' which encapsulates the full
            depenency resolution that Cabal may have selected; this
            is opaque to GHC but can be used to distinguish different
            versions of a package.
      
          - Definite packages don't have an interesting PackageKey,
            so we rely on Cabal to pass them to us.
      
          - We can pretty-print package keys while displaying the
            instantiation, but it's not wired up to anything (e.g.
            the Outputable instance of PackageKey).
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: austin, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1056
      
      GHC Trac Issues: #10566
      f9687caf
    • Ben Gamari's avatar
      5ff4dadd
    • thomie's avatar
      ghci: fixity declarations for infix data constructors (#10018) · e809ef57
      thomie authored
      Declaring a custom fixity for an infix data constructor should work:
      
          Prelude> data Infix a b = a :@: b; infixl 4 :@:
      
      This is a followup to #2947, which handled fixity declarations in ghci
      statements (e.g. let add = (+); infixl 6 `add`).
      
      Support for declarations (data, type, newtype, class, instance,
      deriving, and foreign) was added to GHCi in #4929.
      
      Reviewers: simonpj, austin, thomie
      
      Subscribers: thomie, bgamari
      
      Differential Revision: https://phabricator.haskell.org/D1028
      
      GHC Trac Issues: #10018
      e809ef57
    • spinda's avatar
      Generate .dyn_o files for .hsig files with -dynamic-too · d2b4df15
      spinda authored
      With -dynamic-too, .dyn_o files were not being generated for .hsig
      files.  Normally, this is handled in the pipeline; however, the branch
      for .hsig files called compileEmptyStub directly instead of going
      through runPipeline.  When compiling a Cabal package that included .hsig
      files, this triggered a linker error later on, as it expected a .dyn_o
      file to have been generated for each .hsig.
      
      The fix is to use runPipeline for .hsig files, just as with .hs files.
      Alternately, one could duplicate the logic for handling -dynamic-too in
      the .hsig branch, but simply calling runPipeline ends up being much
      cleaner.
      
      Test Plan: validate
      
      Reviewers: austin, ezyang, bgamari, thomie
      
      Reviewed By: ezyang, thomie
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1084
      
      GHC Trac Issues: #10660
      d2b4df15
  17. 22 Jul, 2015 1 commit
  18. 21 Jul, 2015 3 commits
  19. 17 Jul, 2015 1 commit
  20. 16 Jul, 2015 3 commits
  21. 10 Jul, 2015 1 commit