1. 15 May, 2015 1 commit
  2. 13 May, 2015 1 commit
    • 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
  3. 11 May, 2015 1 commit
    • Austin Seipp's avatar
      compiler: make sure we reject -O + HscInterpreted · 9736c042
      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
      9736c042
  4. 07 Apr, 2015 1 commit
    • Edward Z. Yang's avatar
      Support for multiple signature files in scope. · a7524eae
      Edward Z. Yang authored
      Summary:
      A common pattern when programming with signatures is to combine multiple
      signatures together (signature linking).  We achieve this by making it
      not-an-error to have multiple, distinct interface files for the same module
      name, as long as they have the same backing implementation.  When a user
      imports a module name, they get ALL matching signatures dumped into their
      scope.
      
      On the way, I refactored the module finder code, which now distinguishes
      between exact finds (when you had a 'Module') and regular finds (when
      you had a 'ModuleName').  I also refactored the package finder code to
      use a Monoid instance on LookupResult to collect together various results.
      
      ToDo: At the moment, if a signature is declared in the local package,
      it completely overrides any remote signatures.  Eventually, we'll want
      to also pull in the remote signatures (or even override the local signature,
      if the full implementation is available.)  There are bunch of ToDos in the
      code for what to do once this is done.
      
      ToDo: At the moment, whenever a module name lookup occurs in GHCi and we
      would have seen a signature, we instead continue and return the Module
      for the backing implementation.  This is correct for most cases, but there
      might be some situations where we want something a little more fine-grained
      (e.g. :browse should only list identifiers which are available through
      the in-scope signatures, and not ALL of them.)
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: simonpj, hvr, austin
      
      Subscribers: carter, thomie
      
      Differential Revision: https://phabricator.haskell.org/D790
      
      GHC Trac Issues: #9252
      a7524eae
  5. 19 Mar, 2015 1 commit
  6. 23 Feb, 2015 2 commits
  7. 06 Feb, 2015 1 commit
  8. 03 Jan, 2015 1 commit
    • Edward Z. Yang's avatar
      Fix #9243 so recompilation avoidance works with -fno-code · 2223e196
      Edward Z. Yang authored
      Summary:
      Where we track timestamps of object files, also track timestamps
      for interface files.  When -fno-code -fwrite-interface is enabled, use
      the interface file timestamp as an extra check to see if the files are
      up-to-date.  We had to apply this logic to one-shot and make modes.
      
      This fix would be good to merge into 7.10; it makes using -fno-code
      -fwrite-interface for flywheel type checking usable.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate and new test cases
      
      Reviewers: austin
      
      Subscribers: carter, thomie
      
      Differential Revision: https://phabricator.haskell.org/D596
      
      GHC Trac Issues: #9243
      2223e196
  9. 27 Nov, 2014 1 commit
  10. 19 Nov, 2014 1 commit
    • Herbert Valerio Riedel's avatar
      Restore exact old semantics of `decodeFloat` · e2af452c
      Herbert Valerio Riedel authored
      `integer-gmp2` uses the new 64bit-based IEEE deconstructing primop
      introduced in b62bd5ec.
      
      However, the returned values differ for exceptional IEEE values:
      
      Previous (expected) semantics:
      
        > decodeFloat (-1/0)
        (-4503599627370496,972)
      
        > decodeFloat (1/0)
        (4503599627370496,972)
      
        > decodeFloat (0/0)
        (-6755399441055744,972)
      
      Currently (broken) semantics:
      
        > decodeFloat (-1/0 :: Double)
        (-9223372036854775808,-53)
      
        > decodeFloat (1/0 :: Double)
        (-9223372036854775808,-53)
      
        > decodeFloat (0/0 :: Double)
        (-9223372036854775808,-53)
      
      This patch reverts to the old expected semantics.
      
      I plan to revisit the implementation during GHC 7.11 development.
      
      This should address #9810
      
      Reviewed By: austin, ekmett, luite
      
      Differential Revision: https://phabricator.haskell.org/D486
      e2af452c
  11. 13 Nov, 2014 1 commit
  12. 08 Nov, 2014 1 commit
    • cactus's avatar
      In pattern synonym matchers, support unboxed continuation results (fixes #9783). · 474e535b
      cactus authored
      This requires ensuring the continuations have arguments by adding a dummy
      Void# argument when needed. This is so that matching on a pattern synonym
      is lazy even when the result is unboxed, e.g.
      
          pattern P = ()
          f P = 0#
      
      In this case, without dummy arguments, the generated matcher's type would be
      
         $mP :: forall (r :: ?). () -> r -> r -> r
      
      which is called in `f` at type `() -> Int# -> Int# -> Int#`,
      so it would be strict, in particular, in the failure continuation
      of `patError`.
      
      We work around this by making sure both continuations have arguments:
      
        $mP :: forall (r :: ?). () -> (Void# -> r) -> (Void# -> r) -> r
      
      Of course, if `P` (and thus, the success continuation) has any arguments,
      we are only adding the extra dummy argument to the failure continuation.
      474e535b
  13. 02 Nov, 2014 1 commit
  14. 30 Oct, 2014 1 commit
  15. 24 Oct, 2014 1 commit
    • Edward Z. Yang's avatar
      Implementation of hsig (module signatures), per #9252 · aa479953
      Edward Z. Yang authored
      Summary:
      Module signatures, like hs-boot files, are Haskell modules which omit
      value definitions and contain only signatures.  This patchset implements
      one particular aspect of module signature, namely compiling them against
      a concrete implementation.  It works like this: when we compile an hsig
      file, we must be told (via the -sig-of flag) what module this signature
      is implementing.  The signature is compiled into an interface file which
      reexports precisely the entities mentioned in the signature file.  We also
      verify that the interface is compatible with the implementation.
      
      This feature is useful in a few situations:
      
          1. Like explicit import lists, signatures can be used to reduce
          sensitivity to upstream changes.  However, a signature can be defined
          once and then reused by many modules.
      
          2. Signatures can be used to quickly check if a new upstream version
          is compatible, by typechecking just the signatures and not the actual
          modules.
      
          3. A signature can be used to mediate separate modular development,
          where the signature is used as a placeholder for functionality which
          is loaded in later.  (This is only half useful at the moment, since
          typechecking against signatures without implementations is not implemented
          in this patchset.)
      
      Unlike hs-boot files, hsig files impose no performance overhead.
      
      This patchset punts on the type class instances (and type families) problem:
      instances simply leak from the implementation to the signature.  You can
      explicitly specify what instances you expect to have, and those will be checked,
      but you may get more instances than you asked for.  Our eventual plan is
      to allow hiding instances, but to consider all transitively reachable instances
      when considering overlap and soundness.
      
      ToDo: signature merging: when a module is provided by multiple signatures
      for the same base implementation, we should not consider this ambiguous.
      
      ToDo: at the moment, signatures do not constitute use-sites, so if you
      write a signature for a deprecated function, you won't get a warning
      when you compile the signature.
      
      Future work: The ability to feed in shaping information so that we can take
      advantage of more type equalities than might be immediately evident.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate and new tests
      
      Reviewers: simonpj, simonmar, hvr, austin
      
      Subscribers: simonmar, relrod, ezyang, carter, goldfire
      
      Differential Revision: https://phabricator.haskell.org/D130
      
      GHC Trac Issues: #9252
      aa479953
  16. 21 Oct, 2014 1 commit
  17. 15 Sep, 2014 1 commit
  18. 01 Sep, 2014 1 commit
    • thomie's avatar
      StringBuffer should not contain initial byte-order mark (BOM) · 9e939403
      thomie authored
      Summary:
      Just skipping over a BOM, but leaving it in the Stringbuffer, is not
      sufficient. The Lexer calls prevChar when a regular expression starts
      with '^' (which is a shorthand for '\n^'). It would never match on the
      first line, since instead of '\n', prevChar would still return '\xfeff'.
      
      Test Plan: validate
      
      Reviewers: austin, ezyang
      
      Reviewed By: austin, ezyang
      
      Subscribers: simonmar, ezyang, carter
      
      Differential Revision: https://phabricator.haskell.org/D176
      
      GHC Trac Issues: #6016
      9e939403
  19. 22 Aug, 2014 1 commit
  20. 14 Aug, 2014 1 commit
    • Herbert Valerio Riedel's avatar
      Implement new CLZ and CTZ primops (re #9340) · e0c1767d
      Herbert Valerio Riedel authored
      This implements the new primops
      
        clz#, clz32#, clz64#,
        ctz#, ctz32#, ctz64#
      
      which provide efficient implementations of the popular
      count-leading-zero and count-trailing-zero respectively
      (see testcase for a pure Haskell reference implementation).
      
      On x86, NCG as well as LLVM generates code based on the BSF/BSR
      instructions (which need extra logic to make the 0-case well-defined).
      
      Test Plan: validate and succesful tests on i686 and amd64
      
      Reviewers: rwbarton, simonmar, ezyang, austin
      
      Subscribers: simonmar, relrod, ezyang, carter
      
      Differential Revision: https://phabricator.haskell.org/D144
      
      GHC Trac Issues: #9340
      e0c1767d
  21. 11 Aug, 2014 1 commit
  22. 09 Aug, 2014 2 commits
  23. 05 Aug, 2014 1 commit
    • Edward Z. Yang's avatar
      Package keys (for linking/type equality) separated from package IDs. · 66218d15
      Edward Z. Yang authored
      This patch set makes us no longer assume that a package key is a human
      readable string, leaving Cabal free to "do whatever it wants" to allocate
      keys; we'll look up the PackageId in the database to display to the user.
      This also means we have a new level of qualifier decisions to make at the
      package level, and rewriting some Safe Haskell error reporting code to DTRT.
      
      Additionally, we adjust the build system to use a new ghc-cabal output
      Make variable PACKAGE_KEY to determine library names and other things,
      rather than concatenating PACKAGE/VERSION as before.
      
      Adds a new `-this-package-key` flag to subsume the old, erroneously named
      `-package-name` flag, and `-package-key` to select packages by package key.
      
      RFC: The md5 hashes are pretty tough on the eye, as far as the file
      system is concerned :(
      
      ToDo: safePkg01 test had its output updated, but the fix is not really right:
      the rest of the dependencies are truncated due to the fact the we're only
      grepping a single line, but ghc-pkg is wrapping its output.
      
      ToDo: In a later commit, update all submodules to stop using -package-name
      and use -this-package-key.  For now, we don't do it to avoid submodule
      explosion.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: simonpj, simonmar, hvr, austin
      
      Subscribers: simonmar, relrod, carter
      
      Differential Revision: https://phabricator.haskell.org/D80
      66218d15
  24. 01 Aug, 2014 1 commit
  25. 31 Jul, 2014 1 commit
  26. 29 Jul, 2014 1 commit
  27. 28 Jul, 2014 1 commit
    • Jost Berthold's avatar
      use GHC-7.8.3's values for thread block reason (fixes #9333) · 4ee8c273
      Jost Berthold authored
      Summary:
      For now, BlockedOnMVar and BlockedOnMVarRead are not distinguished.
      Making the distinction would mean to change an exported datatype
      (API change). Code for this change is included but commented out.
      
      The patch adds a test for the threadstatus, which retrieves status
      BlockedOnMVar for two threads blocked on writing and reading an MVar.
      
      Test Plan: ran validate, including the new test
      
      Reviewers: simonmar, austin, ezyang
      
      Reviewed By: austin, ezyang
      
      Subscribers: phaskell, simonmar, relrod, carter
      
      Differential Revision: https://phabricator.haskell.org/D83
      4ee8c273
  28. 26 Jul, 2014 1 commit
    • Edward Z. Yang's avatar
      Module reexports, fixing #8407. · 7f5c1086
      Edward Z. Yang authored
      The general approach is to add a new field to the package database,
      reexported-modules, which considered by the module finder as possible
      module declarations.  Unlike declaring stub module files, multiple
      reexports of the same physical package at the same name do not
      result in an ambiguous import.
      
      Has submodule updates for Cabal and haddock.
      
      NB: When a reexport renames a module, that renaming is *not* accessible
      from inside the package.  This is not so much a deliberate design choice
      as for implementation expediency (reexport resolution happens only when
      a package is in the package database.)
      
      TODO: Error handling when there are duplicate reexports/etc is not very
      well tested.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Conflicts:
      	compiler/main/HscTypes.lhs
      	testsuite/.gitignore
      	utils/haddock
      7f5c1086
  29. 21 Jul, 2014 1 commit
    • Edward Z. Yang's avatar
      [ghc-pkg] Fix #5442 by using the flag db stack to modify packages. · d7c807f7
      Edward Z. Yang authored
      Summary:
      Previously, the full database stack was used for ghc-pkg to
      modify packages, which meant that commands like
      'ghc-pkg unregister --user' worked the same as 'ghc-pkg unregister'.
      Since package modification is a "read and write" operation, we
      should use the flag db stack (which is currently used for reads)
      to determine which database to update.
      
      There is also a new flag --user-package-db, which lets you explicitly
      set the user database (as seen by --user).  This was mostly added
      to aid in testing, but could be useful for end users as well.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: simonmar, hvr, austin
      
      Subscribers: simonmar, relrod, carter
      
      Differential Revision: https://phabricator.haskell.org/D84
      d7c807f7
  30. 07 Jul, 2014 1 commit
  31. 01 Jul, 2014 1 commit
  32. 28 Jun, 2014 1 commit
    • Herbert Valerio Riedel's avatar
      Simplify .gitignore files · 767b9ddf
      Herbert Valerio Riedel authored
      It's a bit confusing to have .gitignore files spread all over the
      filesystem. This commit tries to consolidate those into one .gitignore
      file per component. Moreover, we try to describe files to be ignored which
      happen to have a common identifying pattern by glob patterns.
      Signed-off-by: Herbert Valerio Riedel's avatarHerbert Valerio Riedel <hvr@gnu.org>
      767b9ddf
  33. 27 Jun, 2014 1 commit
    • Herbert Valerio Riedel's avatar
      Add -XBinaryLiterals language extension (re #9224) · 1c0b5fdc
      Herbert Valerio Riedel authored
      Haskell2010 supports
      
      - base-10 (prefix-less),
      - base-8 (via `0[oO]`-prefix), and
      - base-16 (via `0[xX]`-prefix) integer literals.
      
      This commit adds syntax support for base-2 integer literals via the new `0[bB]`
      prefix. The use of a `0b` prefix for indicating binary literals is known
      from popular programming languages such as C++14, Perl, Python, Ruby, and Java.
      
      This syntax extension is disabled by default and can be enabled via the
      new `{-# LANGUAGE BinaryLiterals #-}` pragma and/or the new `-XBinaryLiterals`
      
      This new extensions requires to upgrade the `ExtsBitmap` type from
      `Word` to `Word64` as this adds a 33th flag which is not guaranteed to
      fit into a `Word`.
      Signed-off-by: Herbert Valerio Riedel's avatarHerbert Valerio Riedel <hvr@gnu.org>
      
      Differential Revision: https://phabricator.haskell.org/D22
      1c0b5fdc
  34. 26 Mar, 2014 1 commit
    • tibbe's avatar
      Add flags to control memcpy and memset inlining · 11b31c3c
      tibbe authored
      This adds -fmax-inline-memcpy-insns and -fmax-inline-memset-insns.
      These flags control when we inline calls to memcpy/memset with
      statically known arguments. The flag naming style is taken from GCC
      and the same limit is used by both GCC and LLVM.
      11b31c3c
  35. 14 Jan, 2014 1 commit
  36. 13 Jan, 2014 1 commit
  37. 12 Jan, 2014 2 commits