1. 07 Oct, 2015 1 commit
  2. 06 Oct, 2015 7 commits
  3. 05 Oct, 2015 1 commit
  4. 03 Oct, 2015 5 commits
    • Ryan Scott's avatar
      Fill in associated type defaults with DeriveAnyClass · 2f74be9c
      Ryan Scott authored
      Summary:
      Unlike `-XDefaultSignatures`, `-XDeriveAnyClass` would not fill in
      associated type family defaults when deriving a class which contained
      them.
      
      In order to fix this properly, `tcATDefault` needed to be used from
      `TcGenDeriv`. To avoid a module import cycle, `tcATDefault` was moved
      from `TcInstDcls` to `TcClsDcl`.
      
      Fixes #10361.
      
      Test Plan: ./validate
      
      Reviewers: kosmikus, dreixel, bgamari, austin, simonpj
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1283
      
      GHC Trac Issues: #10361
      2f74be9c
    • Herbert Valerio Riedel's avatar
      Enable `Enumeration is empty` warnings for `Integer` · 0eb8fcd9
      Herbert Valerio Riedel authored
      This warning was implemented via
      abb3a9fa for addressing #7881. The
      bounded H2010 integral types were handled, but the `Integer` type was
      missed for the enumeration warning.
      
      Fixes #10929
      
      Test Plan: reused T7881 testcase
      
      Reviewers: thomie, bgamari, austin
      
      Reviewed By: thomie, bgamari, austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1305
      
      GHC Trac Issues: #10929
      0eb8fcd9
    • Ryan Scott's avatar
      Make GHC generics capable of handling unboxed types · 6cde981a
      Ryan Scott authored
      This adds a data family (`URec`) and six data family instances (`UAddr`,
      `UChar`, `UDouble`, `UFloat`, `UInt`, and `UWord`) which a `deriving
      Generic(1)` clause will generate if it sees `Addr#`, `Char#`, `Double#`,
      `Float#`, `Int#`, or `Word#`, respectively. The programmer can then
      provide instances for these data family instances to provide custom
      implementations for unboxed types, similar to how derived `Eq`, `Ord`,
      and `Show` instances currently special-case unboxed types.
      
      Fixes #10868.
      
      Test Plan: ./validate
      
      Reviewers: goldfire, dreixel, bgamari, austin, hvr, kosmikus
      
      Reviewed By: dreixel, kosmikus
      
      Subscribers: simonpj, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1239
      
      GHC Trac Issues: #10868
      6cde981a
    • Tamar Christina's avatar
      Fix broken validation Build 6564 and accepting a few other test results · c4d7df04
      Tamar Christina authored
      Test Plan: ./validate
      
      Reviewers: thomie, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: #ghc_windows_task_force
      
      Differential Revision: https://phabricator.haskell.org/D1304
      c4d7df04
    • Tamar Christina's avatar
      Prevent GHC from silently dying when preprocessor is not found · b6f76b9a
      Tamar Christina authored
      The Windows preprocessor code calls `runInteractiveProcess` but does
      not check if an exception is thrown.
      `runInteractiveProcess` calls `CreateProcess` which when given a format
      the system loader does not know about
      will throw an exception. This is what makes #9399 fail.
      
      Ultimately we should not use any `CreateProcess` based calls but
      instead `ShellExecuteEx` as  this would allow
      us to run applications that the shell knows about instead of just the
      loader. More details on #365.
      
      This patch removes `PhaseFailed` and throws `ProgramError` instead.
      `PhaseFailed` was largely unneeded since it never gave
      very useful information aside from the `errorcode` which was almost
      always `1`. `IOErrors` have also been eliminated and `GhcExceptions`
      thrown in their place wherever possible.
      
      Updates haddock submodule.
      
      Test Plan:
      `./validate` to make sure anything didn't break and
      `make TESTS="T365"` to test that an error is now properly thrown
      
      Reviewers: austin, thomie, bgamari
      
      Reviewed By: thomie, bgamari
      
      Subscribers: #ghc_windows_task_force
      
      Differential Revision: https://phabricator.haskell.org/D1256
      
      GHC Trac Issues: #365
      b6f76b9a
  5. 02 Oct, 2015 6 commits
    • Edward Z. Yang's avatar
      Don't use old linkable for hs-boot files. · 9ed700bb
      Edward Z. Yang authored
      We should only use the old linkable when the really is nothing
      to be done.  In the case of hs-boot, there should just not be
      a linkable.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1301
      9ed700bb
    • Ben Gamari's avatar
      Move CallStack back to base · 74424346
      Ben Gamari authored
      CallStack requires tuples, instances of which are defined in GHC.Tuple.
      Unfortunately the change made in D757 to the `Typeable` deriving
      mechanism means that `GHC.Tuple` must import `GHC.Types` for types
      necessary to generate type representations.  This results in a cycle.
      
      Test Plan: Validate
      
      Reviewers: gridaphobe, austin, hvr
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1298
      74424346
    • Ben Gamari's avatar
      LLVM: Factor out accumulation of LLVM statements and variables · 95394085
      Ben Gamari authored
      The LLVM code generator currently has a rather large amount of
      boilerplate devoted to piping around and building up various AST
      elements. This is rather unfortunate for a language which prides itself
      on ease of abstraction and detracts from readability.
      
      Here I continue a refactoring that I originally suggested in D991, using
      `WriterT` to factor out this pattern. `WriterT` is in general a bit
      problematic from an evaluation perspective, but the expressions here are
      small enough that it should be a problem in practice.
      
      Test Plan: Validate
      
      Reviewers: austin
      
      Reviewed By: austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1286
      95394085
    • Ben Gamari's avatar
      LLVM: Implement atomic operations in terms of LLVM primitives · bd41eb2a
      Ben Gamari authored
      This fixes Trac #7883.
      
      This adds proper support for,
        * `MO_AtomicRMW`
        * `MO_AtomicWrite`
        * `MO_CmpXChg`
      
      Test Plan: Validate
      
      Reviewers: rrnewton, austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1282
      
      GHC Trac Issues: #7883
      bd41eb2a
    • Peter Trommler's avatar
      nativeGen PPC: fix > 16 bit offsets in stack handling · b29f20ed
      Peter Trommler authored
      Implement access to spill slots at offsets larger than 16 bits.
      Also allocation and deallocation of spill slots was restricted to
      16 bit offsets. Now 32 bit offsets are supported on all PowerPC
      platforms.
      
      The implementation of 32 bit offsets requires more than one instruction
      but the native code generator wants one instruction. So we implement
      pseudo-instructions that are pretty printed into multiple assembly
      instructions.
      
      With pseudo-instructions for spill slot allocation and deallocation
      we can also implement handling of the back chain pointer according
      to the ELF ABIs.
      
      Test Plan: validate (especially on powerpc (32 bit))
      
      Reviewers: bgamari, austin, erikd
      
      Reviewed By: erikd
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1296
      
      GHC Trac Issues: #7830
      b29f20ed
    • Ben Gamari's avatar
      Fix treatment of -0.0 · eb975d2e
      Ben Gamari authored
      Here we fix a few mis-optimizations that could occur in code with
      floating point comparisons with -0.0. These issues arose from our
      insistence on rewriting equalities into case analyses and the
      simplifier's ignorance of floating-point semantics.
      
      For instance, in Trac #10215 (and the similar issue Trac #9238) we
      turned `ds == 0.0` into a case analysis,
      
      ```
      case ds of
          __DEFAULT -> ...
          0.0 -> ...
      ```
      
      Where the second alternative matches where `ds` is +0.0 and *also* -0.0.
      However, the simplifier doesn't realize this and will introduce a local
      inlining of `ds = -- +0.0` as it believes this is the only
      value that matches this pattern.
      
      Instead of teaching the simplifier about floating-point semantics
      we simply prohibit case analysis on floating-point scrutinees and keep
      this logic in the comparison primops, where it belongs.
      
      We do several things here,
      
       - Add test cases from relevant tickets
       - Clean up a bit of documentation
       - Desugar literal matches against floats into applications of the
         appropriate equality primitive instead of case analysis
       - Add a CoreLint to ensure we don't pattern match on floats in Core
      
      Test Plan: validate with included testcases
      
      Reviewers: goldfire, simonpj, austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1061
      
      GHC Trac Issues: #10215, #9238
      eb975d2e
  6. 01 Oct, 2015 1 commit
  7. 30 Sep, 2015 1 commit
    • thomie's avatar
      Lexer: delete dead code for binary character literals · 2eddcd9b
      thomie authored
      The Haskell 2010 report chapter 2.6 (Characters and String Literals)
      says:
      
        "Numeric escapes such as \137 are used to designate the character with
        decimal representation 137; octal (e.g. \o137) and hexadecimal (e.g.
        \x37) representations are also allowed."
      
      Commit 1c0b5fdc added syntax for writing
      character literals using binary notation (e.g. '\b100100'). But this
      code can never be reached, because '\b' already represents "backspace".
      
      Turn on -fwarn-overlapping-patterns to catch such bugs in the future.
      
      Reviewed by: hvr
      
      Differential Revision: https://phabricator.haskell.org/D1291
      2eddcd9b
  8. 26 Sep, 2015 1 commit
    • Ömer Sinan Ağacan's avatar
      reify associated types when reifying typeclasses(#10891) · b4d43b4e
      Ömer Sinan Ağacan authored
      As reported in Trac #10891, Template Haskell's `reify` was not
      generating Decls for associated types. This patch fixes that.
      
      Note that even though `reifyTyCon` function used in this patch returns
      some type instances, I'm ignoring that.
      
      Here's an example of how associated types are encoded with this patch:
      
      (Simplified representation)
      
          class C a where
            type F a :: *
      
          -->
      
          OpenTypeFamilyD "F" ["a"]
      
      With default type instances:
      
          class C a where
            type F a :: *
            type F a = a
      
          -->
      
          OpenTypeFamilyD "F" ["a"]
          TySynInstD "F" (TySynEqn [VarT "a"] "a")
      
      Test Plan:
      This patch was already reviewed and even merged. The patch is later
      reverted because apparently it broke the build some time between the
      validation of this patch and merge. Creating this new ticket to fix the
      validation.
      
      Reviewers: goldfire, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1277
      
      GHC Trac Issues: #10891
      b4d43b4e
  9. 25 Sep, 2015 5 commits
  10. 24 Sep, 2015 1 commit
    • Ömer Sinan Ağacan's avatar
      Fix DeriveGeneric for types with same OccName (#10487) · b08a533d
      Ömer Sinan Ağacan authored
      Summary:
      DeriveGeneric generates some data types (for data type constructors and for
      selectors of those constructors) and instances for those types. This patch
      changes name generation for these new types to make it working with data types
      with same names imported from different modules and with data types with same
      names imported from same modules(using module imports).
      
      Bonus content:
      
      - Some refactoring in `TcGenGenerics.metaTyConsToDerivStuff` to remove some
        redundant partial function applications and to remove a duplicated function.
      - Remove some unused names from `OccName`. (those were used for an old
        implementation of `DeriveGeneric`)
      
      Reviewers: kosmikus, simonpj, dreixel, ezyang, bgamari, austin
      
      Reviewed By: bgamari, austin
      
      Subscribers: ezyang, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1081
      
      GHC Trac Issues: #10487
      b08a533d
  11. 23 Sep, 2015 6 commits
  12. 22 Sep, 2015 4 commits
  13. 21 Sep, 2015 1 commit