Skip to content
Snippets Groups Projects
  1. Dec 17, 2019
  2. Dec 11, 2019
    • Richard Eisenberg's avatar
      Warn on inferred polymorphic recursion · 2d1b9619
      Richard Eisenberg authored and Marge Bot's avatar Marge Bot committed
      Silly users sometimes try to use visible dependent quantification
      and polymorphic recursion without a CUSK or SAK. This causes
      unexpected errors. So we now adjust expectations with a bit
      of helpful messaging.
      
      Closes #17541 and closes #17131.
      
      test cases: dependent/should_fail/T{17541{,b},17131}
      2d1b9619
    • John Ericson's avatar
      Move Int64# and Word64# sections of primops.txt.pp · 7a823b0f
      John Ericson authored and Marge Bot's avatar Marge Bot committed
      This way it is next to the other fixed-sized ones.
      7a823b0f
    • John Ericson's avatar
      Move Int# section of primops.txt.pp · 8f1ceb67
      John Ericson authored and Marge Bot's avatar Marge Bot committed
      This matches the organization of the fixed-sized ones, and keeps each
      Int* next to its corresponding Word*.
      8f1ceb67
    • Ryan Scott's avatar
      Ignore unary constraint tuples during typechecking (#17511) · 921d3238
      Ryan Scott authored and Marge Bot's avatar Marge Bot committed
      We deliberately avoid defining a magical `Unit%` class, for reasons
      that I have expounded upon in the newly added
      `Note [Ignore unary constraint tuples]` in `TcHsType`. However, a
      sneaky user could try to insert `Unit%` into their program by way of
      Template Haskell, leading to the interface-file error observed
      in #17511. To avoid this, any time we encounter a unary constraint
      tuple during typechecking, we drop the surrounding constraint tuple
      application. This is safe to do since `Unit% a` and `a` would be
      semantically equivalent (unlike other forms of unary tuples).
      
      Fixes #17511.
      921d3238
  3. Dec 09, 2019
    • Gabor Greif's avatar
      Fix comment typos · d46a72e1
      Gabor Greif authored
      The below is only necessary to fix the CI perf fluke that
      happened in 9897e8c8:
      -------------------------
      Metric Decrease:
          T5837
          T6048
          T9020
          T12425
          T12234
          T13035
          T12150
          Naperian
      -------------------------
      d46a72e1
  4. Dec 07, 2019
    • Simon Peyton Jones's avatar
      Split up coercionKind · 0a4ca9eb
      Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
      This patch implements the idea in #17515, splitting `coercionKind` into:
      
       * `coercion{Left,Right}Kind`, which computes the left/right side of the
          pair
       * `coercionKind`, which computes the pair of coercible types
      
      This is reduces allocation since we frequently only need only one side
      of the pair. Specifically, we see the following improvements on x86-64
      Debian 9:
      
      | test     | new        | old           | relative chg. |
      | :------- | ---------: | ------------: | ------------: |
      | T5030	   | 695537752  | 747641152.0   | -6.97%        |
      | T5321Fun | 449315744  | 474009040.0   | -5.21%        |
      | T9872a   | 2611071400 | 2645040952.0  | -1.28%        |
      | T9872c   | 2957097904 | 2994260264.0  | -1.24%        |
      | T12227   | 773435072  | 812367768.0   | -4.79%        |
      | T12545   | 3142687224 | 3215714752.0  | -2.27%        |
      | T14683   | 9392407664 | 9824775000.0  | -4.40%        |
      
      Metric Decrease:
          T12545
          T9872a
          T14683
          T5030
          T12227
          T9872c
          T5321Fun
          T9872b
      0a4ca9eb
    • Simon Peyton Jones's avatar
      Work in progress on coercionLKind, coercionRKind · ee07421f
      Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
      This is a preliminary patch for #17515
      ee07421f
    • Gabor Greif's avatar
      Implement pointer tagging for big families (#14373) · 9897e8c8
      Gabor Greif authored and Marge Bot's avatar Marge Bot committed
      Formerly we punted on these and evaluated constructors always got a tag
      of 1.
      
      We now cascade switches because we have to check the tag first and when
      it is MAX_PTR_TAG then get the precise tag from the info table and
      switch on that. The only technically tricky part is that the default
      case needs (logical) duplication. To do this we emit an extra label for
      it and branch to that from the second switch. This avoids duplicated
      codegen.
      
      Here's a simple example of the new code gen:
      
          data D = D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8
      
      On a 64-bit system previously all constructors would be tagged 1. With
      the new code gen D7 and D8 are tagged 7:
      
          [Lib.D7_con_entry() {
               ...
               {offset
                 c1eu: // global
                     R1 = R1 + 7;
                     call (P64[Sp])(R1) args: 8, res: 0, upd: 8;
               }
           }]
      
          [Lib.D8_con_entry() {
               ...
               {offset
                 c1ez: // global
                     R1 = R1 + 7;
                     call (P64[Sp])(R1) args: 8, res: 0, upd: 8;
               }
           }]
      
      When switching we now look at the info table only when the tag is 7. For
      example, if we derive Enum for the type above, the Cmm looks like this:
      
          c2Le:
              _s2Js::P64 = R1;
              _c2Lq::P64 = _s2Js::P64 & 7;
              switch [1 .. 7] _c2Lq::P64 {
                  case 1 : goto c2Lk;
                  case 2 : goto c2Ll;
                  case 3 : goto c2Lm;
                  case 4 : goto c2Ln;
                  case 5 : goto c2Lo;
                  case 6 : goto c2Lp;
                  case 7 : goto c2Lj;
              }
      
          // Read info table for tag
          c2Lj:
              _c2Lv::I64 = %MO_UU_Conv_W32_W64(I32[I64[_s2Js::P64 & (-8)] - 4]);
              if (_c2Lv::I64 != 6) goto c2Lu; else goto c2Lt;
      
      Generated Cmm sizes do not change too much, but binaries are very
      slightly larger, due to the fact that the new instructions are longer in
      encoded form. E.g. previously entry code for D8 above would be
      
          00000000000001c0 <Lib_D8_con_info>:
           1c0:	48 ff c3             	inc    %rbx
           1c3:	ff 65 00             	jmpq   *0x0(%rbp)
      
      With this patch
      
          00000000000001d0 <Lib_D8_con_info>:
           1d0:	48 83 c3 07          	add    $0x7,%rbx
           1d4:	ff 65 00             	jmpq   *0x0(%rbp)
      
      This is one byte longer.
      
      Secondly, reading info table directly and then switching is shorter
      
          _c1co:
                  movq -1(%rbx),%rax
                  movl -4(%rax),%eax
                  // Switch on info table tag
                  jmp *_n1d5(,%rax,8)
      
      than doing the same switch, and then for the tag 7 doing another switch:
      
          // When tag is 7
          _c1ct:
                  andq $-8,%rbx
                  movq (%rbx),%rax
                  movl -4(%rax),%eax
                  // Switch on info table tag
                  ...
      
      Some changes of binary sizes in actual programs:
      
      - In NoFib the worst case is 0.1% increase in benchmark "parser" (see
        NoFib results below). All programs get slightly larger.
      
      - Stage 2 compiler size does not change.
      
      - In "containers" (the library) size of all object files increases
        0.0005%. Size of the test program "bitqueue-properties" increases
        0.03%.
      
      nofib benchmarks kindly provided by Ömer (@osa1):
      
      NoFib Results
      =============
      
      --------------------------------------------------------------------------------
              Program           Size    Allocs    Instrs     Reads    Writes
      --------------------------------------------------------------------------------
                   CS          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
                  CSD          +0.0%      0.0%      0.0%     +0.0%     +0.0%
                   FS          +0.0%      0.0%      0.0%     +0.0%      0.0%
                    S          +0.0%      0.0%     -0.0%      0.0%      0.0%
                   VS          +0.0%      0.0%     -0.0%     +0.0%     +0.0%
                  VSD          +0.0%      0.0%     -0.0%     +0.0%     -0.0%
                  VSM          +0.0%      0.0%      0.0%      0.0%      0.0%
                 anna          +0.0%      0.0%     +0.1%     -0.9%     -0.0%
                 ansi          +0.0%      0.0%     -0.0%     +0.0%     +0.0%
                 atom          +0.0%      0.0%      0.0%      0.0%      0.0%
               awards          +0.0%      0.0%     -0.0%     +0.0%      0.0%
               banner          +0.0%      0.0%     -0.0%     +0.0%      0.0%
           bernouilli          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
         binary-trees          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
                boyer          +0.0%      0.0%     +0.0%      0.0%     -0.0%
               boyer2          +0.0%      0.0%     +0.0%      0.0%     -0.0%
                 bspt          +0.0%      0.0%     +0.0%     +0.0%      0.0%
            cacheprof          +0.0%      0.0%     +0.1%     -0.8%      0.0%
             calendar          +0.0%      0.0%     -0.0%     +0.0%     -0.0%
             cichelli          +0.0%      0.0%     +0.0%      0.0%      0.0%
              circsim          +0.0%      0.0%     -0.0%     -0.1%     -0.0%
             clausify          +0.0%      0.0%     +0.0%     +0.0%      0.0%
        comp_lab_zift          +0.0%      0.0%     +0.0%      0.0%     -0.0%
             compress          +0.0%      0.0%     +0.0%     +0.0%      0.0%
            compress2          +0.0%      0.0%      0.0%      0.0%      0.0%
          constraints          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
         cryptarithm1          +0.0%      0.0%     +0.0%      0.0%      0.0%
         cryptarithm2          +0.0%      0.0%     +0.0%     -0.0%      0.0%
                  cse          +0.0%      0.0%     +0.0%     +0.0%      0.0%
         digits-of-e1          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
         digits-of-e2          +0.0%      0.0%     +0.0%     -0.0%     -0.0%
               dom-lt          +0.0%      0.0%     +0.0%     +0.0%      0.0%
                eliza          +0.0%      0.0%     -0.0%     +0.0%      0.0%
                event          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
          exact-reals          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
               exp3_8          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
               expert          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
       fannkuch-redux          +0.0%      0.0%     +0.0%      0.0%      0.0%
                fasta          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
                  fem          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
                  fft          +0.0%      0.0%     +0.0%     -0.0%     -0.0%
                 fft2          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
             fibheaps          +0.0%      0.0%     +0.0%     +0.0%      0.0%
                 fish          +0.0%      0.0%     +0.0%     +0.0%      0.0%
                fluid          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
               fulsom          +0.0%      0.0%     +0.0%     -0.0%     +0.0%
               gamteb          +0.0%      0.0%     +0.0%     -0.0%     -0.0%
                  gcd          +0.0%      0.0%     +0.0%     +0.0%      0.0%
          gen_regexps          +0.0%      0.0%     +0.0%     -0.0%     -0.0%
               genfft          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
                   gg          +0.0%      0.0%      0.0%     -0.0%      0.0%
                 grep          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
               hidden          +0.0%      0.0%     +0.0%     -0.0%     -0.0%
                  hpg          +0.0%      0.0%     +0.0%     -0.1%     -0.0%
                  ida          +0.0%      0.0%     +0.0%     -0.0%     -0.0%
                infer          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
              integer          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
            integrate          +0.0%      0.0%      0.0%     +0.0%      0.0%
         k-nucleotide          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
                kahan          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
              knights          +0.0%      0.0%     +0.0%     -0.0%     -0.0%
               lambda          +0.0%      0.0%     +1.2%     -6.1%     -0.0%
           last-piece          +0.0%      0.0%     +0.0%     -0.0%     -0.0%
                 lcss          +0.0%      0.0%     +0.0%     -0.0%     -0.0%
                 life          +0.0%      0.0%     +0.0%     -0.0%     -0.0%
                 lift          +0.0%      0.0%     +0.0%     +0.0%      0.0%
               linear          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
            listcompr          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
             listcopy          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
             maillist          +0.0%      0.0%     +0.0%     -0.0%     -0.0%
               mandel          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
              mandel2          +0.0%      0.0%     +0.0%     +0.0%     -0.0%
                 mate          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
              minimax          +0.0%      0.0%     -0.0%     +0.0%     -0.0%
              mkhprog          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
           multiplier          +0.0%      0.0%      0.0%     +0.0%     -0.0%
               n-body          +0.0%      0.0%     +0.0%     -0.0%     -0.0%
             nucleic2          +0.0%      0.0%     +0.0%     +0.0%     -0.0%
                 para          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
            paraffins          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
               parser          +0.1%      0.0%     +0.4%     -1.7%     -0.0%
              parstof          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
                  pic          +0.0%      0.0%     +0.0%      0.0%     -0.0%
             pidigits          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
                power          +0.0%      0.0%     +0.0%     -0.0%     -0.0%
               pretty          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
               primes          +0.0%      0.0%     +0.0%      0.0%      0.0%
            primetest          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
               prolog          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
               puzzle          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
               queens          +0.0%      0.0%      0.0%     +0.0%     +0.0%
              reptile          +0.0%      0.0%     +0.0%     +0.0%      0.0%
      reverse-complem          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
              rewrite          +0.0%      0.0%     +0.0%      0.0%     -0.0%
                 rfib          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
                  rsa          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
                  scc          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
                sched          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
                  scs          +0.0%      0.0%     +0.0%     +0.0%      0.0%
               simple          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
                solid          +0.0%      0.0%     +0.0%     +0.0%      0.0%
              sorting          +0.0%      0.0%     +0.0%     -0.0%      0.0%
        spectral-norm          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
               sphere          +0.0%      0.0%     +0.0%     -1.0%      0.0%
               symalg          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
                  tak          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
            transform          +0.0%      0.0%     +0.4%     -1.3%     +0.0%
             treejoin          +0.0%      0.0%     +0.0%     -0.0%      0.0%
            typecheck          +0.0%      0.0%     -0.0%     +0.0%      0.0%
              veritas          +0.0%      0.0%     +0.0%     -0.1%     +0.0%
                 wang          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
            wave4main          +0.0%      0.0%     +0.0%      0.0%     -0.0%
         wheel-sieve1          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
         wheel-sieve2          +0.0%      0.0%     +0.0%     +0.0%      0.0%
                 x2n1          +0.0%      0.0%     +0.0%     +0.0%      0.0%
      --------------------------------------------------------------------------------
                  Min          +0.0%      0.0%     -0.0%     -6.1%     -0.0%
                  Max          +0.1%      0.0%     +1.2%     +0.0%     +0.0%
       Geometric Mean          +0.0%     -0.0%     +0.0%     -0.1%     -0.0%
      
      NoFib GC Results
      ================
      
      --------------------------------------------------------------------------------
              Program           Size    Allocs    Instrs     Reads    Writes
      --------------------------------------------------------------------------------
              circsim          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
          constraints          +0.0%      0.0%     -0.0%      0.0%     -0.0%
             fibheaps          +0.0%      0.0%      0.0%     -0.0%     -0.0%
               fulsom          +0.0%      0.0%      0.0%     -0.6%     -0.0%
             gc_bench          +0.0%      0.0%      0.0%      0.0%     -0.0%
                 hash          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
                 lcss          +0.0%      0.0%      0.0%     -0.0%      0.0%
            mutstore1          +0.0%      0.0%      0.0%     -0.0%     -0.0%
            mutstore2          +0.0%      0.0%     +0.0%     -0.0%     -0.0%
                power          +0.0%      0.0%     -0.0%      0.0%     -0.0%
           spellcheck          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
      --------------------------------------------------------------------------------
                  Min          +0.0%      0.0%     -0.0%     -0.6%     -0.0%
                  Max          +0.0%      0.0%     +0.0%      0.0%      0.0%
       Geometric Mean          +0.0%     +0.0%     +0.0%     -0.1%     +0.0%
      
      Fixes #14373
      
      These performance regressions appear to be a fluke in CI. See the
      discussion in !1742 for details.
      
      Metric Increase:
          T6048
          T12234
          T12425
          Naperian
          T12150
          T5837
          T13035
      9897e8c8
  5. Dec 05, 2019
    • Vladislav Zavialov's avatar
      Pretty-printing of the * kind · 3354c68e
      Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
      Before this patch, GHC always printed the * kind unparenthesized.
      
      This led to two issues:
      
      1. Sometimes GHC printed invalid or incorrect code.
         For example, GHC would print:  type F @*   x = x
               when it meant to print:  type F @(*) x = x
         In the former case, instead of a kind application we were getting a
         type operator (@*).
      
      2. Sometimes GHC printed kinds that were correct but hard to read.
         Should  Either * Int  be read as  Either (*) Int
                                    or as  (*) Either Int  ?
         This depends on whether -XStarIsType is enabled, but it would be
         easier if we didn't have to check for the flag when reading the code.
      
      We can solve both problems by assigning (*) a different precedence. Note
      that Haskell98 kinds are not affected:
      
        ((* -> *) -> *) -> *  does NOT become  (((*) -> (*)) -> (*)) -> (*)
      
      The parentheses are added when (*) is used in a function argument
      position:
      
         F * * *   becomes  F (*) (*) (*)
         F A * B   becomes  F A (*) B
         Proxy *   becomes  Proxy (*)
         a * -> *  becomes  a (*) -> *
      3354c68e
    • Vladislav Zavialov's avatar
      Improve error messages for SCC pragmas · e49e5470
      Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
      e49e5470
    • Vladislav Zavialov's avatar
      Meaning-preserving SCC annotations (#15730) · 84585e5e
      Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
      This patch implements GHC Proposal #176:
        https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0176-scc-parsing.rst
      
      Before the change:
      
        1 /                    2 / 2 = 0.25
        1 / {-# SCC "name" #-} 2 / 2 = 1.0
      
      After the change:
      
        1 /                    2 / 2 = 0.25
        1 / {-# SCC "name" #-} 2 / 2 = parse error
      84585e5e
  6. Dec 04, 2019
    • Ben Gamari's avatar
      Elf: Fix link info note generation · f03a41d4
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Previously we would use the `.int` assembler directive to generate
      32-bit words in the note section. However, `.int` is note guaranteed to
      produce 4-bytes; in fact, on some platforms (e.g. AArch64) it produces
      8-bytes. Use the `.4bytes` directive to avoid this.
      
      Moreover, we used the `.align` directive, which is quite platform
      dependent. On AArch64 it appears to not even be idempotent (despite what
      the documentation claims). `.balign` is consequentially preferred as it
      offers consistent behavior across platforms.
      f03a41d4
    • Ben Gamari's avatar
      Simplify uniqAway · 78b67ad0
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      This does two things:
      
       * Eliminate all uses of Unique.deriveUnique, which was quite easy to
         mis-use and extremely subtle.
      
       * Rename the previous "derived unique" notion to "local unique". This
         is possible because the only places where `uniqAway` can be safely
         used are those where local uniqueness (with respect to some
         InScopeSet) is sufficient.
      
       * Rework the implementation of VarEnv.uniqAway, as discussed in #17462.
         This should make the operation significantly more efficient than its
         previous iterative implementation..
      
      Metric Decrease:
          T9872c
          T12227
          T9233
          T14683
          T5030
          T12545
          hie002
      
      Metric Increase:
          T9961
      78b67ad0
    • Ben Gamari's avatar
      Drop Uniquable constraint for AnnTarget · 25019d18
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      This relied on deriveUnique, which was far too subtle to be safely
      applied. Thankfully the instance doesn't appear to be used so let's just
      drop it.
      25019d18
  7. Dec 03, 2019
    • Sylvain Henry's avatar
      Add constant folding rule (#16402) · 7a51b587
      Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
          narrowN (x .&. m)
          m .&. (2^N-1) = 2^N-1
          ==> narrowN x
      
      e.g.  narrow16 (x .&. 0x12FFFF) ==> narrow16 x
      7a51b587
    • Ben Gamari's avatar
      Make BCO# lifted · 705a16df
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      In #17424 Simon PJ noted that there is a potentially unsafe occurrence
      of unsafeCoerce#, coercing from an unlifted to lifted type. However,
      nowhere in the compiler do we assume that a BCO# is not a thunk.
      Moreover, in the case of a CAF the result returned by `createBCO` *will*
      be a thunk (as noted in [Updatable CAF BCOs]).  Consequently it seems
      better to rather make BCO# a lifted type and rename it to BCO.
      705a16df
    • Sylvain Henry's avatar
      Add `timesInt2#` primop · 5f7cb423
      Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
      5f7cb423
  8. Dec 02, 2019
  9. Dec 01, 2019
  10. Nov 30, 2019
  11. Nov 29, 2019
    • Ömer Sinan Ağacan's avatar
      Pass ModDetails with (partial) ModIface in HscStatus · 7f695a20
      Ömer Sinan Ağacan authored and Marge Bot's avatar Marge Bot committed
      (Partial) ModIface and ModDetails are generated at the same time, but
      they're passed differently: ModIface is passed in HscStatus consturctors
      while ModDetails is returned in a tuple. This refactors ModDetails
      passing so that it's passed around with ModIface in HscStatus
      constructors. This makes the code more consistent and hopefully easier
      to understand: ModIface and ModDetails are really very closely related.
      It makes sense to treat them the same way.
      7f695a20
  12. Nov 28, 2019
    • Vladislav Zavialov's avatar
      Factor out HsSCC/HsCoreAnn/HsTickPragma into HsPragE · 6985e0fc
      Vladislav Zavialov authored
      This is a refactoring with no user-visible changes (except for GHC API
      users). Consider the HsExpr constructors that correspond to user-written
      pragmas:
      
        HsSCC         representing  {-# SCC ... #-}
        HsCoreAnn     representing  {-# CORE ... #-}
        HsTickPragma  representing  {-# GENERATED ... #-}
      
      We can factor them out into a separate datatype, HsPragE. It makes the
      code a bit tidier, especially in the parser.
      
      Before this patch:
      
        hpc_annot :: { Located ( (([AddAnn],SourceText),(StringLiteral,(Int,Int),(Int,Int))),
                                 ((SourceText,SourceText),(SourceText,SourceText))
                               ) }
      
      After this patch:
      
        prag_hpc :: { Located ([AddAnn], HsPragE GhcPs) }
      6985e0fc
    • Stefan Schulze Frielinghaus's avatar
      Fix endian handling of LLVM backend · 6c59cc71
      Stefan Schulze Frielinghaus authored and Marge Bot's avatar Marge Bot committed
      Get rid of CPP macro WORDS_BIGENDIAN which is not defined anymore, and
      replace it by DynFlag. This fixes partially #17337.
      6c59cc71
    • Brian Wignall's avatar
      Fix typos, using Wikipedia list of common typos · 3748ba3a
      Brian Wignall authored and Marge Bot's avatar Marge Bot committed
      3748ba3a
    • Philipp Krüger's avatar
      Reduce boolean blindness in OccInfo(OneOcc) #17482 · 5f84b52a
      Philipp Krüger authored and Marge Bot's avatar Marge Bot committed
      * Transformed the type aliases `InterestingCxt`, `InsideLam` and `OneBranch`
        into data types.
      * Added Semigroup and Monoid instances for use in orOccInfo in OccurAnal.hs
      * Simplified some usage sites by using pattern matching instead of boolean algebra.
      
      Metric Increase:
          T12150
      
      This increase was on a Mac-build of exactly 1%. This commit does *not* re-intruduce
      the asymptotic memory usage described in T12150.
      5f84b52a
  13. Nov 27, 2019
    • Vladislav Zavialov's avatar
      Whitespace-sensitive bang patterns (#1087, #17162) · 8168b42a
      Vladislav Zavialov authored
      This patch implements a part of GHC Proposal #229 that covers five
      operators:
      
      * the bang operator (!)
      * the tilde operator (~)
      * the at operator (@)
      * the dollar operator ($)
      * the double dollar operator ($$)
      
      Based on surrounding whitespace, these operators are disambiguated into
      bang patterns, lazy patterns, strictness annotations, type
      applications, splices, and typed splices.
      
      This patch doesn't cover the (-) operator or the -Woperator-whitespace
      warning, which are left as future work.
      8168b42a
    • Sebastian Graf's avatar
      Make warnings for TH splices opt-in · 5a08f7d4
      Sebastian Graf authored and Marge Bot's avatar Marge Bot committed
      In #17270 we have the pattern-match checker emit incorrect warnings. The
      reason for that behavior is ultimately an inconsistency in whether we
      treat TH splices as written by the user (`FromSource :: Origin`) or as
      generated code (`Generated`). This was first reported in #14838.
      
      The current solution is to TH splices as `Generated` by default and only
      treat them as `FromSource` when the user requests so
      (-fenable-th-splice-warnings). There are multiple reasons for opt-in
      rather than opt-out:
      
        * It's not clear that the user that compiles a splice is the author of the code
          that produces the warning. Think of the situation where she just splices in
          code from a third-party library that produces incomplete pattern matches.
          In this scenario, the user isn't even able to fix that warning.
        * Gathering information for producing the warnings (pattern-match check
          warnings in particular) is costly. There's no point in doing so if the user
          is not interested in those warnings.
      
      Fixes #17270, but not #14838, because the proper solution needs a GHC
      proposal extending the TH AST syntax.
      5a08f7d4
  14. Nov 25, 2019
  15. Nov 24, 2019
  16. Nov 23, 2019
Loading