ghc.git
4 years agoCleverly use a *landmark* context when it might be empty
Richard Eisenberg [Wed, 5 Aug 2015 02:04:45 +0000 (22:04 -0400)] 
Cleverly use a *landmark* context when it might be empty

4 years agoImprove ddump-tc-trace in TcErrors
Richard Eisenberg [Wed, 5 Aug 2015 01:36:45 +0000 (21:36 -0400)] 
Improve ddump-tc-trace in TcErrors

4 years agoImprove error messages
Richard Eisenberg [Wed, 5 Aug 2015 01:34:41 +0000 (21:34 -0400)] 
Improve error messages

4 years agoPropagate CtOrigins for better errors
Richard Eisenberg [Tue, 4 Aug 2015 15:47:18 +0000 (11:47 -0400)] 
Propagate CtOrigins for better errors

4 years agoStart toward tracking origins better
Richard Eisenberg [Thu, 9 Jul 2015 19:52:26 +0000 (15:52 -0400)] 
Start toward tracking origins better

4 years agoUse a Flexi, not a ReturnTv, when checking seq.
Richard Eisenberg [Wed, 29 Jul 2015 21:16:38 +0000 (17:16 -0400)] 
Use a Flexi, not a ReturnTv, when checking seq.

4 years agoFix broken test code
Richard Eisenberg [Wed, 29 Jul 2015 21:03:18 +0000 (17:03 -0400)] 
Fix broken test code

4 years agoInstantiate scrutinees.
Richard Eisenberg [Wed, 29 Jul 2015 19:49:39 +0000 (15:49 -0400)] 
Instantiate scrutinees.

4 years agoAvoid unnecessary call to tcSubType
Richard Eisenberg [Wed, 29 Jul 2015 19:41:06 +0000 (15:41 -0400)] 
Avoid unnecessary call to tcSubType

The unnecessary call resulted in an unexpected ambiguity check.

4 years agoInstantiate when inferring types
Richard Eisenberg [Wed, 29 Jul 2015 19:19:38 +0000 (15:19 -0400)] 
Instantiate when inferring types

4 years agoNew test
Richard Eisenberg [Wed, 29 Jul 2015 19:19:23 +0000 (15:19 -0400)] 
New test

4 years agoFix bug in TcLambdaCase
Richard Eisenberg [Wed, 15 Jul 2015 17:23:56 +0000 (13:23 -0400)] 
Fix bug in TcLambdaCase

4 years agoAdd new test to all.T
Richard Eisenberg [Fri, 10 Jul 2015 17:03:14 +0000 (13:03 -0400)] 
Add new test to all.T

4 years agoAdd another test case
Richard Eisenberg [Fri, 10 Jul 2015 16:48:39 +0000 (12:48 -0400)] 
Add another test case

4 years agobug in test case
Richard Eisenberg [Fri, 10 Jul 2015 16:47:48 +0000 (12:47 -0400)] 
bug in test case

4 years agoPropagate polytypes into if and case.
Richard Eisenberg [Fri, 10 Jul 2015 14:15:15 +0000 (10:15 -0400)] 
Propagate polytypes into if and case.

4 years agoTypeApplications implies AllowAmbiguousTypes
Richard Eisenberg [Fri, 10 Jul 2015 03:05:54 +0000 (23:05 -0400)] 
TypeApplications implies AllowAmbiguousTypes

4 years agoSupport wildcards in type applications
Richard Eisenberg [Fri, 10 Jul 2015 01:46:54 +0000 (21:46 -0400)] 
Support wildcards in type applications

4 years agoSuggest TypeApplications when it's off
Richard Eisenberg [Fri, 10 Jul 2015 01:01:28 +0000 (21:01 -0400)] 
Suggest TypeApplications when it's off

4 years agoImported ids without signatures are still inferred.
Richard Eisenberg [Fri, 10 Jul 2015 00:08:47 +0000 (20:08 -0400)] 
Imported ids without signatures are still inferred.

4 years agoRemove SkolemiseMode -- always go deep.
Richard Eisenberg [Thu, 9 Jul 2015 18:39:16 +0000 (14:39 -0400)] 
Remove SkolemiseMode -- always go deep.

4 years agoBugfixing
Richard Eisenberg [Thu, 9 Jul 2015 18:35:15 +0000 (14:35 -0400)] 
Bugfixing

4 years agoVTA tests work
Richard Eisenberg [Thu, 9 Jul 2015 17:57:48 +0000 (13:57 -0400)] 
VTA tests work

4 years agoStage 2 succeeds
Richard Eisenberg [Thu, 9 Jul 2015 17:40:56 +0000 (13:40 -0400)] 
Stage 2 succeeds

4 years agoFix [OpenTypeKind accepts foralls]
Richard Eisenberg [Thu, 9 Jul 2015 17:20:43 +0000 (13:20 -0400)] 
Fix [OpenTypeKind accepts foralls]

4 years agoComments only
Richard Eisenberg [Thu, 9 Jul 2015 17:13:13 +0000 (13:13 -0400)] 
Comments only

4 years ago*** Use global url for .gitmodules
Richard Eisenberg [Thu, 9 Jul 2015 03:24:56 +0000 (23:24 -0400)] 
*** Use global url for .gitmodules

4 years ago`base` compiles
Richard Eisenberg [Thu, 9 Jul 2015 02:17:07 +0000 (22:17 -0400)] 
`base` compiles

4 years agoUndoing some changes
Richard Eisenberg [Wed, 8 Jul 2015 20:41:33 +0000 (16:41 -0400)] 
Undoing some changes

4 years agoCheckpoint in bugfixing
Richard Eisenberg [Wed, 8 Jul 2015 18:33:54 +0000 (14:33 -0400)] 
Checkpoint in bugfixing

4 years agoMassive simplification: always deeply skolemise
Richard Eisenberg [Wed, 8 Jul 2015 13:12:34 +0000 (09:12 -0400)] 
Massive simplification: always deeply skolemise

4 years agoYet another checkpoint
Richard Eisenberg [Wed, 8 Jul 2015 03:51:50 +0000 (23:51 -0400)] 
Yet another checkpoint

4 years agoCheckpoint in more undoing.
Richard Eisenberg [Wed, 8 Jul 2015 03:39:03 +0000 (23:39 -0400)] 
Checkpoint in more undoing.

4 years agoCheckpoint on undoing a lot of sigma-type stuff.
Richard Eisenberg [Wed, 8 Jul 2015 03:29:20 +0000 (23:29 -0400)] 
Checkpoint on undoing a lot of sigma-type stuff.

4 years agoSome bugfixing
Richard Eisenberg [Wed, 8 Jul 2015 02:05:59 +0000 (22:05 -0400)] 
Some bugfixing

4 years agoWorking on failing test
Richard Eisenberg [Thu, 2 Jul 2015 03:56:57 +0000 (23:56 -0400)] 
Working on failing test

4 years agoVta1 passes
Richard Eisenberg [Wed, 1 Jul 2015 21:29:18 +0000 (17:29 -0400)] 
Vta1 passes

4 years agoCheckpoint in bugfixing
Richard Eisenberg [Wed, 1 Jul 2015 21:14:37 +0000 (17:14 -0400)] 
Checkpoint in bugfixing

4 years agoSome bugfixing
Richard Eisenberg [Wed, 1 Jul 2015 16:09:16 +0000 (12:09 -0400)] 
Some bugfixing

4 years agoIn the process of eager skolemisation
Richard Eisenberg [Wed, 1 Jul 2015 12:29:32 +0000 (08:29 -0400)] 
In the process of eager skolemisation

4 years agoIt compiles.
Richard Eisenberg [Tue, 30 Jun 2015 21:25:02 +0000 (17:25 -0400)] 
It compiles.

4 years agoStarting to compile.
Richard Eisenberg [Tue, 30 Jun 2015 20:07:56 +0000 (16:07 -0400)] 
Starting to compile.

4 years agoMidway through redesign of the type inference alg.
Richard Eisenberg [Tue, 30 Jun 2015 03:28:47 +0000 (23:28 -0400)] 
Midway through redesign of the type inference alg.

4 years agoTestsuite stuff from previous commit
Richard Eisenberg [Sun, 28 Jun 2015 20:55:09 +0000 (16:55 -0400)] 
Testsuite stuff from previous commit

4 years agoRetain System naems until the end of typechecking
Richard Eisenberg [Sun, 28 Jun 2015 17:53:32 +0000 (13:53 -0400)] 
Retain System naems until the end of typechecking

4 years agoOnly thing left is the typechecker
Richard Eisenberg [Sat, 27 Jun 2015 16:50:20 +0000 (12:50 -0400)] 
Only thing left is the typechecker

4 years agoLexing/parsing complete.
Richard Eisenberg [Sat, 27 Jun 2015 16:01:50 +0000 (12:01 -0400)] 
Lexing/parsing complete.

4 years agoAdd VTA tests
Richard Eisenberg [Fri, 26 Jun 2015 21:12:57 +0000 (17:12 -0400)] 
Add VTA tests

4 years agoRemove vestigial prefixq{var,con}sym from parser.
Richard Eisenberg [Sat, 27 Jun 2015 16:55:36 +0000 (12:55 -0400)] 
Remove vestigial prefixq{var,con}sym from parser.

4 years agoTest Trac #10524
Simon Peyton Jones [Fri, 26 Jun 2015 15:00:45 +0000 (16:00 +0100)] 
Test Trac #10524

4 years agoImprove error message for Typeable k (T k)
Simon Peyton Jones [Fri, 26 Jun 2015 15:00:19 +0000 (16:00 +0100)] 
Improve error message for Typeable k (T k)

GHC can't yest build a TypeRep for a type involving kind variables.
(We await kinds = types for that.)  But the error message was terrible,
as fixing #10524 reminded me.

This improves it a lot.

4 years agoBetter tracing and tiny refactoring
Simon Peyton Jones [Fri, 26 Jun 2015 14:57:28 +0000 (15:57 +0100)] 
Better tracing and tiny refactoring

4 years agoMake fvType ignore kinds
Simon Peyton Jones [Fri, 26 Jun 2015 14:56:35 +0000 (15:56 +0100)] 
Make fvType ignore kinds

TcValidity.fvTypes works in partnership with sizeTypes, and
hence should ignore kinds in exactly the same way.  It wasn't
doing so, which meant that validDerivPred said "No" when it
should have said "Yes". That led to the bug reported in
Trac #10524 comment:7.

The error message is pretty terrible
  No instance for (Typeable T)
but I'll fix that next

4 years agoKill off sizePred
Simon Peyton Jones [Fri, 26 Jun 2015 13:34:42 +0000 (14:34 +0100)] 
Kill off sizePred

It really isn't needed, and life is simpler without

4 years agocloseOverKinds *before* oclose in coverage check
Simon Peyton Jones [Fri, 26 Jun 2015 13:28:45 +0000 (14:28 +0100)] 
closeOverKinds *before* oclose in coverage check

Combining functional dependencies with kind-polymorphism is
devilishly tricky!  It's all documented in
    Note [Closing over kinds in coverage]

Fixes Trac #10564

4 years agoImprove CPR behavior for strict constructors
Simon Peyton Jones [Fri, 26 Jun 2015 10:40:01 +0000 (11:40 +0100)] 
Improve CPR behavior for strict constructors

When working on Trac #10482 I noticed that we could give constructor
arguments the CPR property if they are use strictly.

This is documented carefully in
    Note [CPR in a product case alternative]
and also
    Note [Initial CPR for strict binders]

There are a bunch of intersting examples in
    Note [CPR examples]
which I have added to the test suite as T10482a.

I also added a test for #10482 itself.

4 years agoSmall doc fixes
Simon Peyton Jones [Fri, 26 Jun 2015 10:36:02 +0000 (11:36 +0100)] 
Small doc fixes

4 years agoComments only
Simon Peyton Jones [Fri, 26 Jun 2015 07:35:11 +0000 (08:35 +0100)] 
Comments only

4 years agoGHCi docs: layout rule is respected inside :{ :}
Thomas Miedema [Wed, 24 Jun 2015 10:52:16 +0000 (12:52 +0200)] 
GHCi docs: layout rule is respected inside :{ :}

Summary:
I don't know if or when this changed, but the documentation on :{ :}
(multiline input) seems out of date. Layout rule works fine. I added a
regression test.

Reviewers: austin

Subscribers: thomie, bgamari

Differential Revision: https://phabricator.haskell.org/D1013

4 years agoFix deadlock (#10545)
Simon Marlow [Fri, 19 Jun 2015 14:12:24 +0000 (15:12 +0100)] 
Fix deadlock (#10545)

yieldCapability() was not prepared to be called by a Task that is not
either a worker or a bound Task.  This could happen if we ended up in
yieldCapability via this call stack:

performGC()
scheduleDoGC()
requestSync()
yieldCapability()

and there were a few other ways this could happen via requestSync.
The fix is to handle this case in yieldCapability(): when the Task is
not a worker or a bound Task, we put it on the returning_workers
queue, where it will be woken up again.

Summary of changes:

* `yieldCapability`: factored out subroutine waitForWorkerCapability`
* `waitForReturnCapability` renamed to `waitForCapability`, and
  factored out subroutine `waitForReturnCapability`
* `releaseCapabilityAndQueue` worker renamed to `enqueueWorker`, does
  not take a lock and no longer tests if `!isBoundTask()`
* `yieldCapability` adjusted for refactorings, only change in behavior
  is when it is not a worker or bound task.

Test Plan:
* new test concurrent/should_run/performGC
* validate

Reviewers: niteria, austin, ezyang, bgamari

Subscribers: thomie, bgamari

Differential Revision: https://phabricator.haskell.org/D997

GHC Trac Issues: #10545

4 years agoFix for crash in setnumcapabilities001
Simon Marlow [Fri, 19 Jun 2015 13:41:32 +0000 (14:41 +0100)] 
Fix for crash in setnumcapabilities001

getNewNursery() was unconditionally incrementing next_nursery, which
is normally fine but it broke an assumption in
storageAddCapabilities().  This manifested as an occasional crash in
the setnumcapabilities001 test.

4 years agoTiny refactor plus comments
Simon Peyton Jones [Fri, 26 Jun 2015 07:31:37 +0000 (08:31 +0100)] 
Tiny refactor plus comments

4 years agoError message wibbles from out-of-scope changes
Simon Peyton Jones [Thu, 25 Jun 2015 08:25:39 +0000 (09:25 +0100)] 
Error message wibbles from out-of-scope changes

The patch "Treat out-of-scope variables as holes" makes
lots of error messages change a bit. This patch has all
the change.

4 years agoTreat out-of-scope variables as holes
Simon Peyton Jones [Wed, 24 Jun 2015 22:27:59 +0000 (23:27 +0100)] 
Treat out-of-scope variables as holes

This patch implements the idea in Trac #10569.

* An out-of-scope variable is treated as a typed expression
  hole.

* That is, we don't report it in the type checker, not the
  renamer, and we when we do report it, we give its type.

* Moreover, we can defer the error to runtime with
  -fdefer-typed-holes

In implementation terms:

* The renamer turns an unbound variable into a HsUnboundVar

* The type checker emits a Hole constraint for a
  HsUnboundVar, and turns it back into a HsVar

It was a bit painful to implement because a whole raft of
error messages change slightly.  But there was absolutely
nothing hard in principle.

Holes are reported with a bunch of possibly-useful context,
notably the "relevant bindings".  I found that this was
distracting clutter in the very common case of a mis-typed
variable that is only accidentally not in scope, so I've
arranged to print the context information only for true holes,
that is ones starting with an underscore.

Unbound data constructors use in patterns, like
  f (D x) = x
are still reportd by the renamer, and abort compilation
before type checking.

4 years agoGet rid of irrelevant impredicative polymoprhism
Simon Peyton Jones [Thu, 25 Jun 2015 08:21:13 +0000 (09:21 +0100)] 
Get rid of irrelevant impredicative polymoprhism

These tests aren't about impredicativity

4 years agoGet rid of irrlevant result type signature
Simon Peyton Jones [Thu, 25 Jun 2015 08:17:27 +0000 (09:17 +0100)] 
Get rid of irrlevant result type signature

Result type-sigs are now illegal, but that's not what this test
is about

4 years agoAdd module header to test
Simon Peyton Jones [Thu, 25 Jun 2015 08:14:21 +0000 (09:14 +0100)] 
Add module header to test

..to avoid irrelevant 'main is not defined' error message

4 years agoDon't float out alpha[sig] ~ Int
Simon Peyton Jones [Thu, 25 Jun 2015 08:13:30 +0000 (09:13 +0100)] 
Don't float out alpha[sig] ~ Int

This is just a small twiddle to TcSimplify.usefulToFloat
See Note [Which equalities to float].

4 years agoFix addDataConStrictness
Simon Peyton Jones [Wed, 24 Jun 2015 22:43:41 +0000 (23:43 +0100)] 
Fix addDataConStrictness

See Note [Add demands for strict constructors].

The new bit is the test for isAbsDmd in addDataConStrictness.
There was a cryptic note that said that this function
should add a seqDmd even for Absent arguments, but that
is definitely a bad thing (as the Note now says), causing
unused arguments to be passed to the worker.

Easy fix!

4 years agoMinor fix to free-vars in RnTypes
Simon Peyton Jones [Wed, 24 Jun 2015 22:29:11 +0000 (23:29 +0100)] 
Minor fix to free-vars in RnTypes

A type wild-card should't appear in the "uses"
free-variable set.

4 years agoAllow recursive unwrapping of data families
Simon Peyton Jones [Wed, 24 Jun 2015 21:54:27 +0000 (22:54 +0100)] 
Allow recursive unwrapping of data families

When doing strictness analysis, we need to look inside products.
To avoid unpacking infinitely, we must be careful about
infinite types.  That in turn is controlled by TyCon.checkRecTc.

For data families like
   data instance T (a,b) = MkT a (T b)
we want to unpack the thing recursively for types like
  T (Int, (Int, (Int, Int)))

This patch elaborates the checkRecTc mechanism in TyCon, to
maintain a *count* of how many times a TyCon has shown up,
rather than just a boolean.

A simple change, and a useful one.  Fixes Trac #10482.

4 years agoUse a Representaional coercion for data families
Simon Peyton Jones [Wed, 24 Jun 2015 21:35:32 +0000 (22:35 +0100)] 
Use a Representaional coercion for data families

When we have
  data instance T (a,b) = MkT a b
we make a represntation type
  data TPair a b = MkT a b
plus an axiom to connect the two
  ax a b :: T (a,b)  ~R  TPair a b

Previously this was a Nominal equality, and that worked ok
but seems illogical since Nominal equalities are between
types that the programmer thinks of as being equal.  But
TPair is not visible to the programmer; indeed we call it
the "representation TyCon".  So a Representational equality
seems more suitable here.

4 years agoImprove pretty-printing for CoPat
Simon Peyton Jones [Wed, 24 Jun 2015 21:19:33 +0000 (22:19 +0100)] 
Improve pretty-printing for CoPat

4 years agoWhite space only
Simon Peyton Jones [Wed, 24 Jun 2015 21:14:44 +0000 (22:14 +0100)] 
White space only

4 years agoComments only
Reid Barton [Thu, 25 Jun 2015 18:26:40 +0000 (14:26 -0400)] 
Comments only

4 years agoBe aware of overlapping global STG registers in CmmSink (#10521)
Reid Barton [Thu, 25 Jun 2015 17:53:57 +0000 (13:53 -0400)] 
Be aware of overlapping global STG registers in CmmSink (#10521)

Summary:
On x86_64, commit e2f6bbd3a27685bc667655fdb093734cb565b4cf assigned
the STG registers F1 and D1 the same hardware register (xmm1), and
the same for the registers F2 and D2, etc. When mixing calls to
functions involving Float#s and Double#s, this can cause wrong Cmm
optimizations that assume the F1 and D1 registers are independent.

Reviewers: simonpj, austin

Reviewed By: austin

Subscribers: simonpj, thomie, bgamari

Differential Revision: https://phabricator.haskell.org/D993

GHC Trac Issues: #10521

4 years agoTest Trac #10562
Simon Peyton Jones [Thu, 25 Jun 2015 14:49:09 +0000 (15:49 +0100)] 
Test Trac #10562

4 years agoImprove kind-checking for 'deriving' clauses
Simon Peyton Jones [Thu, 25 Jun 2015 14:48:37 +0000 (15:48 +0100)] 
Improve kind-checking for 'deriving' clauses

The main payload is in 'mk_functor_like_constraints' in
TcDeriv.inferConstraints.

This is moving towards a fix for Trac #10561

4 years agodriver: pass '-fPIC' option to all CC invocations
Sergei Trofimovich [Wed, 24 Jun 2015 21:10:47 +0000 (22:10 +0100)] 
driver: pass '-fPIC' option to all CC invocations

Reported by mitchty:

  When porting ghc to alpine linux (rumors say they build
  all binaries as Position Independent Executables
  to leverage global ASLR) linker issued obscure errors:

Tiny example:
    $ echo 'main = print "hello"' > a.hs
    $ ghc -fforce-recomp a.hs -fPIC -dynamic -optl-pie -o a
        ld: /tmp/ghc2142_0/ghc2142_5.o: relocation R_X86_64_32 against `ZCMain_main_closure'
            can not be used when making a shared object; recompile with -fPIC
        /tmp/ghc2142_0/ghc2142_5.o: error adding symbols: Bad value
        collect2: error: ld returned 1 exit status

There is two entry points in CC driver:
    'runPhase' (CC) and 'mkExtraObj'

'mkExtraObj' does not handle most of 'runPhase's complexity.
Ideally it should.

This patch only adds -fPIC propagation to 'mkExtraObj'.

Please merge to stable branch.

Signed-off-by: Sergei Trofimovich <siarheit@google.com>
4 years agoClean outdated ext-core references in comments.
Sergei Trofimovich [Sun, 21 Jun 2015 20:11:22 +0000 (21:11 +0100)] 
Clean outdated ext-core references in comments.

Signed-off-by: Sergei Trofimovich <siarheit@google.com>
4 years agoDrop prefix from package keys.
Edward Z. Yang [Tue, 23 Jun 2015 17:41:45 +0000 (10:41 -0700)] 
Drop prefix from package keys.

Summary:
Contains Cabal submodule update, as Cabal is responsible
generating package keys.  We also have to update some output.

Also comes with a documentation update for ghc-pkg in the
user manual for --package-key.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate

Reviewers: simonpj, austin

Subscribers: thomie, bgamari

Differential Revision: https://phabricator.haskell.org/D1011

GHC Trac Issues: #10550

4 years agoBuild system: delete unused variables in config.mk.in
Thomas Miedema [Tue, 23 Jun 2015 15:08:48 +0000 (17:08 +0200)] 
Build system: delete unused variables in config.mk.in

GhcStage1DefaultNewCodegen, GhcStage2DefaultNewCodegen,
GhcStage3DefaultNewCodegen and GhcCompilerWays are not used anywhere.

4 years agoMake $1 in $1_$2_$3_FOO actually be directory.
Edward Z. Yang [Sat, 20 Jun 2015 23:32:56 +0000 (16:32 -0700)] 
Make $1 in $1_$2_$3_FOO actually be directory.

Summary:
Previously, we used $1_$2_PACKAGE_KEY to parametrize $1.  But the
documentation says that $1 should be the directory...  and we're now
putting the libraries in $1_$2_LIB_NAME.  So use /that/.  This is just
alpha-renaming, so as long as we're consistent, there's no material
difference.)

I also fixed a bug of a package ID calculation which I missed first
time around, which was tickled by this change.

BTW, this means DEP_KEYS and TRANSITIVE_DEP_KEYS are unused, so
remove them from ghc-cabal.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate

Reviewers: austin

Subscribers: thomie, bgamari

Differential Revision: https://phabricator.haskell.org/D1010

4 years agopowerpc: add basic support for PLT relocations (#10402)
Sergei Trofimovich [Tue, 23 Jun 2015 12:39:34 +0000 (07:39 -0500)] 
powerpc: add basic support for PLT relocations (#10402)

Commit a93ab43ab5f40cadbedea2f6342b93c245e91434
enabled support for proper PIC relocations from
assembler.

Commit adds support for relocations of type:
    R_PPC_REL16_HI
    R_PPC_REL16_HA
    R_PPC_REL16_LO
    R_PPC_PLTREL24

They are used only when GHC is built in
    DYNAMIC_GHC_PROGRAMS = NO
mode.

Verified by running the following test:

    // cat a.c
    #include <stdio.h>

    void ffi_a_hello (int i) {
        fprintf (stderr, "WEEEEEEEE: i=%d\n", i);
    }

    -- cat A.hs
    {-# LANGUAGE ForeignFunctionInterface #-}
    module A where

    import Foreign.C

    foreign import ccall "ffi_a_hello" a :: CInt -> IO ()

    # ghc -fPIC -c a.c -fforce-recomp
    # ghc -fPIC -c A.hs -fforce-recomp
    # ghc --interactive ./a.o A
    ...
    *A> a 42
    WEEEEEEEE: i=42
See gory details in Trac #10402.

Signed-off-by: Colin Watson <cjwatson@debian.org>
Signed-off-by: Sergei Trofimovich <siarheit@google.com>
Reviewed By: bgamari, austin

Differential Revision: https://phabricator.haskell.org/D996

GHC Trac Issues: #10402

4 years agoFurther elaborate Trac #10403 test
Simon Peyton Jones [Tue, 23 Jun 2015 12:14:26 +0000 (13:14 +0100)] 
Further elaborate Trac #10403 test

Adding app1, app2, as requested in the ticket

4 years agoRename $1_$2_$3_LIB_NAME to LIB_FILE.
Edward Z. Yang [Sat, 20 Jun 2015 23:23:58 +0000 (16:23 -0700)] 
Rename $1_$2_$3_LIB_NAME to LIB_FILE.

Summary:
When we introduced user-friendly library names
(e.g. unix-2.7.1.0-G4Yo1pNtYrk8nCq1cx8P9d instead of
unix_G4Yo1pNtYrk8nCq1cx8P9d) we added a new variable to
be written out by ghc-cabal, $1_$2_LIB_NAME.

What I didn't realize at the time was that this conflicts
with an existing variable in the build system, $1_$2_$3_LIB_NAME,
which (confusingly) refers to something like
'libHSunix-2.7.1.0-G4Yo1pNtYrk8nCq1cx8P9d.so'.  This is pretty
confusing (despite never conflicting), so I renamed this variable
to LIB_FILE for enhanced greppability.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate

Reviewers: austin

Subscribers: thomie, bgamari

Differential Revision: https://phabricator.haskell.org/D1002

4 years agoFix #10551 by using LIB_NAMES.
Edward Z. Yang [Sat, 20 Jun 2015 23:15:41 +0000 (16:15 -0700)] 
Fix #10551 by using LIB_NAMES.

Summary:
(NB: this code is dead at the moment since Windows is not built
dynamically.)

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: none

Reviewers: austin

Subscribers: thomie, bgamari

Differential Revision: https://phabricator.haskell.org/D1001

GHC Trac Issues: #10551

4 years agoUse -package-id to specify libraries on command line.
Edward Z. Yang [Sat, 20 Jun 2015 22:35:28 +0000 (15:35 -0700)] 
Use -package-id to specify libraries on command line.

Summary:
There's not really any good reason to use -package-key over
-package-id, so use the latter as standard practice.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate

Reviewers: austin

Subscribers: thomie, bgamari

Differential Revision: https://phabricator.haskell.org/D1000

4 years agoCheck KnownSymbol => Typeable deduction
Gabor Greif [Mon, 22 Jun 2015 13:40:01 +0000 (15:40 +0200)] 
Check KnownSymbol => Typeable deduction

verifying fix for #10348

4 years agoDocumentation: add section on .haskeline file (#2531)
Thomas Miedema [Sun, 21 Jun 2015 18:56:56 +0000 (20:56 +0200)] 
Documentation: add section on .haskeline file (#2531)

4 years agoAdd parsePattern parser entry point
Alan Zimmerman [Sun, 21 Jun 2015 19:52:58 +0000 (21:52 +0200)] 
Add parsePattern parser entry point

Reviewers: austin, thomie, alanz

Reviewed By: thomie, alanz

Subscribers: thomie, bgamari

Differential Revision: https://phabricator.haskell.org/D1005

GHC Trac Issues: #10556

4 years agoChange `Typeable` instance for type-lis to use the Known* classes.
Iavor S. Diatchki [Sun, 21 Jun 2015 19:24:42 +0000 (12:24 -0700)] 
Change `Typeable` instance for type-lis to use the Known* classes.

This should fix T10348

4 years agoBuild system: unset HADDOCK when haddock is not found
Thomas Miedema [Thu, 18 Jun 2015 17:40:40 +0000 (19:40 +0200)] 
Build system: unset HADDOCK when haddock is not found

This prevents the following test errors on Windows:

   perf/haddock haddock.Cabal [[Errno 2] No such file or directory: ...
   perf/haddock haddock.base [[Errno 2] No such file or directory: ...
   perf/haddock haddock.compiler [[Errno 2] No such file or directory: ...

The tests will now be reported as having missing libraries.

4 years agoRemove duplicate test.
Edward Z. Yang [Sat, 20 Jun 2015 23:12:20 +0000 (16:12 -0700)] 
Remove duplicate test.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
4 years agoFix all.T for T8131/T8131b.
Edward Z. Yang [Sat, 20 Jun 2015 22:58:46 +0000 (15:58 -0700)] 
Fix all.T for T8131/T8131b.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
4 years agoFilter orphan rules based on imports, fixes #10294 and #10420.
Edward Z. Yang [Wed, 3 Jun 2015 21:33:05 +0000 (14:33 -0700)] 
Filter orphan rules based on imports, fixes #10294 and #10420.

Summary:
If we have an orphan rule in our database, don't apply it
unless the defining module is transitively imported by the
module we are processing.  We do this by defining a new RuleEnv
data type which includes both the RuleBase as well as the set
of visible orphan modules, and threading this through the
relevant environments (CoreReader, RuleCheckEnv and ScEnv).

This is analogous to the instances fix we applied in #2182
4c834fdddf4d44d12039da4d6a2c63a660975b95, but done for RULES.
An important knock-on effect is that we can remove some buggy
code in LoadInterface which tried to avoid loading interfaces
that were loaded by plugins (which sometimes caused instances
and rules to NEVER become visible).

One note about tests: I renamed the old plugins07 test to T10420
and replaced plugins07 with a test to ensure that a plugin
import did not cause new rules to be loaded in.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate

Reviewers: simonpj, austin, goldfire

Subscribers: bgamari, thomie

Differential Revision: https://phabricator.haskell.org/D950

GHC Trac Issues: #10420

4 years agoMake GHC install libraries to e.g. xhtml-3000.2.1-0ACfOp3hebWD9jGWE4v4Gh.
Edward Z. Yang [Fri, 29 May 2015 00:11:12 +0000 (17:11 -0700)] 
Make GHC install libraries to e.g. xhtml-3000.2.1-0ACfOp3hebWD9jGWE4v4Gh.

Summary:
Previously, we'd install them to something like
xhtml_0ACfOp3hebWD9jGWE4v4G which was fairly ugly; this
commit changes the default install path to contain the full
package name and version, as well as the package key.

Needs a Cabal submodule update for the commit for install paths support
"Add libname install-dirs variable, use it by default. Fixes #2437".
It also contains some miscellaneous fixes for Cabal HEAD.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate

Reviewers: austin

Subscribers: bgamari, thomie

Trac Issues: #10479

Differential Revision: https://phabricator.haskell.org/D922

4 years agoUpdated output for test ghci024
Sergei Trofimovich [Sat, 20 Jun 2015 11:47:50 +0000 (12:47 +0100)] 
Updated output for test ghci024

Signed-off-by: Sergei Trofimovich <siarheit@google.com>
4 years agoRecognise 'hardhloat' as a valid vendor in a host tuple
Sergei Trofimovich [Sat, 20 Jun 2015 11:23:00 +0000 (12:23 +0100)] 
Recognise 'hardhloat' as a valid vendor in a host tuple

Observed on a tuple armv7a-hardfloat-linux-gnueabi:
> Unknown vendor hardfloat

Reported-by: Sergey Alirzaev
Signed-off-by: Sergei Trofimovich <siarheit@google.com>
4 years agoFix a couple of tests for GHCi/-O* (Trac #10052)
Sergei Trofimovich [Sat, 20 Jun 2015 09:24:40 +0000 (10:24 +0100)] 
Fix a couple of tests for GHCi/-O* (Trac #10052)

Tests use unboxed types (or optimizer gets to them),
those can't be handled by ghci. Fixed by using -fobject-code.

Signed-off-by: Sergei Trofimovich <siarheit@google.com>