1. 19 May, 2015 7 commits
    • Austin Seipp's avatar
      Revert "In ghci linker, link against all previous temp sos (#10322)" · 470a9494
      Austin Seipp authored
      This reverts commit b0b11ad9.
      
      It apparently made Harbormaster sad.
      470a9494
    • Austin Seipp's avatar
      compiler: make sure we reject -O + HscInterpreted · b199536b
      Austin Seipp authored
      When using GHCi, we explicitly reject optimization, because the
      compilers optimization passes can introduce unboxed tuples, which the
      interpreter is not able to handle. But this goes the other way too: using
      GHCi on optimized code may cause the optimizer to float out breakpoints
      that the interpreter introduces. This manifests itself in weird ways,
      particularly if you as an API client use custom DynFlags to introduce
      optimization in combination with HscInterpreted.
      
      It turns out we weren't checking for consistent DynFlag settings when
      doing `setSessionDynFlags`, as #10052 showed. While the main driver
      handled it in `DynFlags` via `parseDynamicFlags`, we didn't check this
      elsewhere.
      
      This does a little refactoring to split out some of the common code, and
      immunizes the various `DynFlags` utilities in the `GHC` module from this
      particular bug. We should probably be checking other general invariants
      too.
      
      This fixes #10052, and adds some notes about the behavior in `GHC` and
      `FloatOut`
      
      As a bonus, expose `warningMsg` from `ErrUtils` as a helper since it
      didn't exist (somehow).
      Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
      
      Reviewed By: edsko
      
      Differential Revision: https://phabricator.haskell.org/D727
      
      GHC Trac Issues: #10052
      b199536b
    • rwbarton's avatar
      In ghci linker, link against all previous temp sos (#10322) · b0b11ad9
      rwbarton authored
      The OS X dlopen() appears to only resolve undefined symbols in
      the direct dependencies of the shared library it is loading.
      
      Reviewed By: trommler, austin
      
      Differential Revision: https://phabricator.haskell.org/D852
      
      GHC Trac Issues: #10322
      b0b11ad9
    • Ben Gamari's avatar
      ghci: Allow :back and :forward to take counts · b03f074f
      Ben Gamari authored
      These behave like the count arguments of the gdb `up` and `down`
      commands, allowing the user to quickly jump around in history.
      
      Reviewed By: austin
      
      Differential Revision: https://phabricator.haskell.org/D853
      b03f074f
    • Michal Terepeta's avatar
      Remove unneeded compatibility with LLVM < 3.6 · 578d2bad
      Michal Terepeta authored
      Since GHC requires at least LLVM 3.6, some of the special cases (for,
      e.g., LLVM 2.8 or 2.9) in the LLVM CodeGen can be simply removed.
      
      Reviewed By: rwbarton, austin
      
      Differential Revision: https://phabricator.haskell.org/D884
      
      GHC Trac Issues: #10074
      578d2bad
    • AlexET's avatar
      user guide: correct documentation for -Wall (fixes #10386) · 5cbac886
      AlexET authored
      This fixes the documentation for -Wall.
      As was done previously it leaves out deprecated flags and also
      fwarn-safe and fwarn-unsafe. I don't know
      if that was intended or not. -fwarn-safe and fwarn-unsafe are
      not mentioned on the warnings page at all instead they are
      mentioned in the safe haskell section.
      
      Reviewed By: austin
      
      Differential Revision: https://phabricator.haskell.org/D889
      
      GHC Trac Issues: #10386
      5cbac886
    • Peter Trommler's avatar
      Add regression test for #10110. · 85bf9e49
      Peter Trommler authored
      Module C imports a from Module A and b from module B. B does not
      import anything from A. So if ld is configured to drop DT_NEEDED
      tags for libraries it does not depend on no DT_NEEDED tag for the
      temporary shared object containing module A is recorded in the temp
      SO containing module B. This leads to an undefined symbol when
      linking the temp SO for module C.
      
      Fixes #10110.
      
      Reviewed By: austin
      
      Differential Revision: https://phabricator.haskell.org/D895
      
      GHC Trac Issues: #10110
      85bf9e49
  2. 18 May, 2015 8 commits
    • Sergei Trofimovich's avatar
      includes/stg/SMP.h: implement simple load_/store_load_barrier on armv6 and older · eaaa38ba
      Sergei Trofimovich authored
      Assuming there is no real SMP systems on these CPUs
      I've added only compiler barrier (otherwise write_barrier
      and friends need to be fixed as well).
      
      Patch also fixes build breakage reported in #10244.
      Signed-off-by: default avatarSergei Trofimovich <siarheit@google.com>
      
      Reviewers: rwbarton, nomeata, austin
      
      Reviewed By: nomeata, austin
      
      Subscribers: bgamari, thomie
      
      Differential Revision: https://phabricator.haskell.org/D894
      
      GHC Trac Issues: #10244
      eaaa38ba
    • Simon Peyton Jones's avatar
      Make the "matchable-given" check happen first · 228ddb95
      Simon Peyton Jones authored
      This change makes the matchable-given check apply uniformly to
           - constraint tuples
           - natural numbers
           - Typeable
      as well as to vanilla class constraints.
      
      See Note [Instance and Given overlap] in TcInteract
      228ddb95
    • Simon Peyton Jones's avatar
      Refactor tuple constraints · ffc21506
      Simon Peyton Jones authored
      Make tuple constraints be handled by a perfectly ordinary
      type class, with the component constraints being the
      superclasses:
          class (c1, c2) => (c2, c2)
      
      This change was provoked by
      
        #10359  inability to re-use a given tuple
                constraint as a whole
      
        #9858   confusion between term tuples
                and constraint tuples
      
      but it's generally a very nice simplification. We get rid of
       -  In Type, the TuplePred constructor of PredTree,
          and all the code that dealt with TuplePreds
       -  In TcEvidence, the constructors EvTupleMk, EvTupleSel
      
      See Note [How tuples work] in TysWiredIn.
      
      Of course, nothing is ever entirely simple. This one
      proved quite fiddly.
      
      - I did quite a bit of renaming, which makes this patch
        touch a lot of modules. In partiuclar tupleCon -> tupleDataCon.
      
      - I made constraint tuples known-key rather than wired-in.
        This is different to boxed/unboxed tuples, but it proved
        awkward to have all the superclass selectors wired-in.
        Easier just to use the standard mechanims.
      
      - While I was fiddling with known-key names, I split the TH Name
        definitions out of DsMeta into a new module THNames.  That meant
        that the known-key names can all be gathered in PrelInfo, without
        causing module loops.
      
      - I found that the parser was parsing an import item like
            T( .. )
        as a *data constructor* T, and then using setRdrNameSpace to
        fix it.  Stupid!  So I changed the parser to parse a *type
        constructor* T, which means less use of setRdrNameSpace.
      
        I also improved setRdrNameSpace to behave better on Exact Names.
        Largely on priciple; I don't think it matters a lot.
      
      - When compiling a data type declaration for a wired-in thing like
        tuples (,), or lists, we don't really need to look at the
        declaration.  We have the wired-in thing!  And not doing so avoids
        having to line up the uniques for data constructor workers etc.
        See Note [Declarations for wired-in things]
      
      - I found that FunDeps.oclose wasn't taking superclasses into
        account; easily fixed.
      
      - Some error message refactoring for invalid constraints in TcValidity
      
      - Haddock needs to absorb the change too; so there is a submodule update
      ffc21506
    • Simon Peyton Jones's avatar
      Delete commented-out line · 76024fdb
      Simon Peyton Jones authored
      76024fdb
    • Simon Peyton Jones's avatar
      Test Trac #10248 · fa0bdd3d
      Simon Peyton Jones authored
      fa0bdd3d
    • Simon Peyton Jones's avatar
      Test Trac #10403 · f1f265df
      Simon Peyton Jones authored
      f1f265df
    • Simon Peyton Jones's avatar
      Test Trac #10359 · 3f42de51
      Simon Peyton Jones authored
      3f42de51
    • Joachim Breitner's avatar
      CmmCommonBlockElim: Improve hash function · 73f836f5
      Joachim Breitner authored
      Previously, the hash function used to cut down the number of block
      comparisons did not take local registers into account, causing far too
      many similar, but different bocks to be considered candidates for the
      (expensive!) comparision.
      
      Adding register to the hash takes CmmCommonBlockElim's share of the
      runtime of the example in #10397 from 17% to 2.5%, and eliminates all
      unwanted hash collisions.
      
      This patch also replaces the fancy trie by a plain Data.Map. It turned
      out to be not performance critical, so this simplifies the code.
      
      Differential Revision: https://phabricator.haskell.org/D896
      73f836f5
  3. 16 May, 2015 2 commits
  4. 15 May, 2015 1 commit
  5. 14 May, 2015 3 commits
  6. 13 May, 2015 13 commits
    • Simon Peyton Jones's avatar
      Test Trac #10359 · 04a484ea
      Simon Peyton Jones authored
      04a484ea
    • Simon Peyton Jones's avatar
      Test Trac #10403 · a9ccd37a
      Simon Peyton Jones authored
      a9ccd37a
    • Simon Peyton Jones's avatar
      Test Trac #10248 · c0aae6f6
      Simon Peyton Jones authored
      c0aae6f6
    • Simon Peyton Jones's avatar
      Make the "matchable-given" check happen first · eb6ca851
      Simon Peyton Jones authored
      This change makes the matchable-given check apply uniformly to
           - constraint tuples
           - natural numbers
           - Typeable
      as well as to vanilla class constraints.
      
      See Note [Instance and Given overlap] in TcInteract
      eb6ca851
    • Simon Peyton Jones's avatar
      Add a case to checkValidTyCon · ca173aa3
      Simon Peyton Jones authored
      Apparently when Haddock'ing, we check GHC.Prim.
      So checkValidTyCon must not crash when dealing with
      PrimTyCons; and it was doing so in dataConStupidTheta.
      
      The fix is easy, but I'm puzzled about why Haddock needs to
      typecheck GHC.Prim.
      ca173aa3
    • Simon Peyton Jones's avatar
      Update haddock submodule · 51cbad15
      Simon Peyton Jones authored
      The location of setRdrNameSpace has changed in GHC.
      
      (Sadly, the build still fails with a tyConStupidTheta failure in
      a haddock invocation; I have no idea why.  But at least Haddock
      itself builds.)
      51cbad15
    • Simon Peyton Jones's avatar
      Separate transCloVarSet from fixVarSet · 6e1174da
      Simon Peyton Jones authored
      I wasn't clear about the distinction before, and that led to a bug
      when I refactored FunDeps.oclose to use transCloVarSet; it should
      use fixVarSet.
      6e1174da
    • Simon Peyton Jones's avatar
      Fix imports in HscMain (stage2) · a8493e03
      Simon Peyton Jones authored
      a8493e03
    • Simon Peyton Jones's avatar
      Two wibbles to fix the build · a154944b
      Simon Peyton Jones authored
      ...following the constraint-tuple patch.
      
      * There was interaction with the recent Safe Haskell change
      * Haddock comoplained about constraint tuples defined but not used
      a154944b
    • Simon Peyton Jones's avatar
      Change in capitalisation of error msg · 5910a1bc
      Simon Peyton Jones authored
        -outofmem.exe: Out of memory
        +outofmem.exe: out of memory
      5910a1bc
    • Simon Peyton Jones's avatar
      Refactor tuple constraints · 130e93aa
      Simon Peyton Jones authored
      Make tuple constraints be handled by a perfectly ordinary
      type class, with the component constraints being the
      superclasses:
          class (c1, c2) => (c2, c2)
      
      This change was provoked by
      
        #10359  inability to re-use a given tuple
                constraint as a whole
      
        #9858   confusion between term tuples
                and constraint tuples
      
      but it's generally a very nice simplification. We get rid of
       -  In Type, the TuplePred constructor of PredTree,
          and all the code that dealt with TuplePreds
       -  In TcEvidence, the constructors EvTupleMk, EvTupleSel
      
      See Note [How tuples work] in TysWiredIn.
      
      Of course, nothing is ever entirely simple. This one
      proved quite fiddly.
      
      - I did quite a bit of renaming, which makes this patch
        touch a lot of modules. In partiuclar tupleCon -> tupleDataCon.
      
      - I made constraint tuples known-key rather than wired-in.
        This is different to boxed/unboxed tuples, but it proved
        awkward to have all the superclass selectors wired-in.
        Easier just to use the standard mechanims.
      
      - While I was fiddling with known-key names, I split the TH Name
        definitions out of DsMeta into a new module THNames.  That meant
        that the known-key names can all be gathered in PrelInfo, without
        causing module loops.
      
      - I found that the parser was parsing an import item like
            T( .. )
        as a *data constructor* T, and then using setRdrNameSpace to
        fix it.  Stupid!  So I changed the parser to parse a *type
        constructor* T, which means less use of setRdrNameSpace.
      
        I also improved setRdrNameSpace to behave better on Exact Names.
        Largely on priciple; I don't think it matters a lot.
      
      - When compiling a data type declaration for a wired-in thing like
        tuples (,), or lists, we don't really need to look at the
        declaration.  We have the wired-in thing!  And not doing so avoids
        having to line up the uniques for data constructor workers etc.
        See Note [Declarations for wired-in things]
      
      - I found that FunDeps.oclose wasn't taking superclasses into
        account; easily fixed.
      
      - Some error message refactoring for invalid constraints in TcValidity
      130e93aa
    • Simon Peyton Jones's avatar
      Delete commented-out line · 8da785d5
      Simon Peyton Jones authored
      8da785d5
    • Austin Seipp's avatar
      Revert D727 · 8764a7e8
      Austin Seipp authored
      This caused print007 to fail, so I guess I botched this more than I
      thought. This is a combination of reverting:
      
        "Fix build breakage from 9736c042", commit f35d621d.
        "compiler: make sure we reject -O + HscInterpreted", commit 9736c042.
      8764a7e8
  7. 12 May, 2015 6 commits