2 years agoExpand I/O CP in comments
Joachim Breitner [Tue, 27 Dec 2016 08:41:19 +0000 (09:41 +0100)] 
Expand I/O CP in comments

as suggested by @gracjan at

2 years agoCallArity: Use exprIsCheap to detect thunks
Joachim Breitner [Mon, 26 Dec 2016 09:16:55 +0000 (10:16 +0100)] 
CallArity: Use exprIsCheap to detect thunks

Originally, everything that is not in WHNF (`exprIsWHNF`) is considered
a thunk, not eta-expanded, to avoid losing any sharing. This is also how
the published papers on Call Arity describe it.

In practice, there are thunks that do a just little work, such as
pattern-matching on a variable, and the benefits of eta-expansion likely
oughtweigh the cost of doing that repeatedly. Therefore, this
implementation of Call Arity considers everything that is not cheap
(`exprIsCheap`) as a thunk.

Nofib reports -2.58% allocations for scs and -40.93% allocation for
wheel-sieve1; the latter has - 2.92% runtime.

2 years agoRemove redudant import from check-ppr
Matthew Pickering [Mon, 26 Dec 2016 16:26:49 +0000 (16:26 +0000)] 
Remove redudant import from check-ppr

2 years agocheck-ppr: Make --dump the default behavior
Ben Gamari [Mon, 26 Dec 2016 15:02:43 +0000 (10:02 -0500)] 
check-ppr: Make --dump the default behavior

2 years agorename: Add note describing #11216
Ben Gamari [Fri, 23 Dec 2016 23:09:40 +0000 (18:09 -0500)] 
rename: Add note describing #11216

2 years agoDefine MAP_ANONYMOUS on systems that only provide MAP_ANON
Gracjan Polak [Fri, 23 Dec 2016 19:37:08 +0000 (14:37 -0500)] 
Define MAP_ANONYMOUS on systems that only provide MAP_ANON

Reviewers: simonmar, erikd, austin, bgamari

Reviewed By: bgamari

Subscribers: gracjan, rwbarton, thomie

Differential Revision:

GHC Trac Issues: #13005

2 years agobase: Override Foldable.{toList,length} for NonEmpty
Artyom [Fri, 23 Dec 2016 19:36:55 +0000 (14:36 -0500)] 
base: Override Foldable.{toList,length} for NonEmpty

Previously the Foldable instance for NonEmpty used default
implementations for toList and length.

I assume that the existing implementations
(i.e. Data.List.NonEmpty.{toList,length}) are better than
the default ones, and frankly can't see a good reason why they
might be worse – but if they are, instead of this commit
we'd have to switch Data.List.NonEmpty.{toList,length}
to use Foldable.

Reviewers: austin, hvr, bgamari

Reviewed By: bgamari

Subscribers: int-index, thomie

Differential Revision:

2 years agoFix test for T12877
Sylvain Henry [Fri, 23 Dec 2016 19:36:10 +0000 (14:36 -0500)] 
Fix test for T12877

Summary: See

Reviewers: nomeata, austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision:

2 years agoUse python3 for linters
Matthew Pickering [Fri, 23 Dec 2016 19:35:55 +0000 (14:35 -0500)] 
Use python3 for linters

We now require python3 for the testsuite so rather than require two
versions of python it makes sense to use python3 for the linters as

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision:

2 years agoAdd caret diagnostics
Phil Ruffwind [Thu, 22 Dec 2016 22:06:51 +0000 (17:06 -0500)] 
Add caret diagnostics

This is controlled by -f[no-]diagnostics-show-caret.

Example of what it looks like:
 42 |     x = 1 + ()
    |         ^^^^^^
This is appended to each diagnostic message.

Test Plan:

Reviewers: simonpj, austin, bgamari

Reviewed By: simonpj, bgamari

Subscribers: joehillen, mpickering, Phyx, simonpj, alanz, thomie

Differential Revision:

GHC Trac Issues: #8809

2 years agorename: Don't require 'fail' in non-monadic contexts
Ben Gamari [Thu, 22 Dec 2016 18:55:30 +0000 (13:55 -0500)] 
rename: Don't require 'fail' in non-monadic contexts

Fixes #11216.

2 years agousers-guide: Kill extraneous link
Ben Gamari [Thu, 22 Dec 2016 18:07:23 +0000 (13:07 -0500)] 
users-guide: Kill extraneous link

2 years agotestsuite: Split out Windows allocations numbers for T12234
Ben Gamari [Wed, 21 Dec 2016 18:37:59 +0000 (13:37 -0500)] 
testsuite: Split out Windows allocations numbers for T12234

2 years agoPush coercions in exprIsConApp_maybe
Simon Peyton Jones [Fri, 23 Dec 2016 12:59:41 +0000 (12:59 +0000)] 
Push coercions in exprIsConApp_maybe

Trac #13025 showed up the fact that exprIsConApp_maybe isn't
clever enough: it didn't push coercions through applicatins, and that
meant we weren't getting as much superclass selection as we should.

It's easy to fix, happily.

See Note [Push coercions in exprIsConApp_maybe]

2 years agoRemoved dead code in DsCCall.mk_alt
Simon Peyton Jones [Fri, 23 Dec 2016 10:43:03 +0000 (10:43 +0000)] 
Removed dead code in DsCCall.mk_alt

Fixes Trac #13029 by deleting code and adding comments

2 years agoPropagate evaluated-ness a bit more faithfully
Simon Peyton Jones [Thu, 22 Dec 2016 12:22:47 +0000 (12:22 +0000)] 
Propagate evaluated-ness a bit more faithfully

This was provoked by Trac #13027.

The fix in Simplify actually cures the reported bug; see
Note [Case binder evaluated-ness] in Simplify.

The fix in CoreTidy looks like an omission that I fixed while I
was at it.

2 years agoTiny refactor in CoreTidy
Simon Peyton Jones [Thu, 22 Dec 2016 12:20:13 +0000 (12:20 +0000)] 
Tiny refactor in CoreTidy

2 years agoFloat unboxed expressions by boxing
Simon Peyton Jones [Fri, 9 Dec 2016 00:04:00 +0000 (00:04 +0000)] 
Float unboxed expressions by boxing

This patch makes GHC's floating more robust, by allowing it
to float unboxed expressions of at least some common types.

See Note [Floating MFEs of unlifted type] in SetLevels.

This was all provoked by Trac #12603

In working this through I also made a number of other corner-case
changes in SetLevels:

* Previously we inconsistently use exprIsBottom (which checks for
  bottom) instead of exprBotStrictness_maybe (which checks for
  bottoming functions).  As well as being inconsistent it was
  simply less good.

  See Note [Bottoming floats]

* I fixed a case where were were unprofitably floating an
  expression because we thought it escaped a value lambda
  (see Note [Escaping a value lambda]).  The relevant code is
       float_me = (dest_lvl `ltMajLvl` (le_ctxt_lvl env)
                  && not float_is_lam)   -- NEW

* I made lvlFloatRhs work properly in the case where abs_vars
  is non-empty.  It wasn't wrong before, but it did some stupid
  extra floating.

2 years agoEnsure that even bottoming functions have an unfolding
Simon Peyton Jones [Fri, 23 Dec 2016 10:06:03 +0000 (10:06 +0000)] 
Ensure that even bottoming functions have an unfolding

The payload of this change is to ensure that a bottoming function
still has an unfolding, just one with an UnfoldingGuidance of

Previously it was getting an unfolding of NoUnfolding. I don't think
that was really /wrong/, but it was inconsistent with the general
principle of giving everthing an unfoding if we know it.  And it
seems tideier this way.

2 years agoComments only
Simon Peyton Jones [Fri, 23 Dec 2016 10:04:23 +0000 (10:04 +0000)] 
Comments only

2 years agoWhite space only
Simon Peyton Jones [Fri, 23 Dec 2016 10:04:02 +0000 (10:04 +0000)] 
White space only

2 years agoFix a bug in ABot handling in CoreArity
Simon Peyton Jones [Fri, 23 Dec 2016 09:33:07 +0000 (09:33 +0000)] 
Fix a bug in ABot handling in CoreArity

See Note [ABot branches: use max] in CoreArity.

I stumbled on this when investigating something else, and
opened Trac #13031 to track it.

It's very hard to tickle the bug, which is why it has lurked so long,
but the test
does so

Oddly, the testsuite framework doesn't actually run the test; I have
no idea why.

2 years agoAlpha-renaming and white space only
Simon Peyton Jones [Thu, 22 Dec 2016 13:49:35 +0000 (13:49 +0000)] 
Alpha-renaming and white space only

2 years agoAllow timeout to kill entire process tree.
Tamar Christina [Fri, 23 Dec 2016 00:56:34 +0000 (00:56 +0000)] 
Allow timeout to kill entire process tree.

we spawn the child processes with handle inheritance on. So they inherit the std handles.
The problem is that the job handle gets inherited too.
So the `JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE` doesn't get used since there are
open handles to the job in the children.

We then terminate the top level process which is `sh` but leaves the children around.

This explicitly disallows the inheritance of the job and events handle.

Test Plan: ./validate

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: thomie, #ghc_windows_task_force

Differential Revision:

GHC Trac Issues: #13004

2 years agoRevert "Suppress duplicate .T files"
Gabor Greif [Thu, 22 Dec 2016 13:57:27 +0000 (14:57 +0100)] 
Revert "Suppress duplicate .T files"

This reverts commit 9a29b65bda8aed4c5fdbff25866ddf2dd1583210.

It turns out that while not harmful, that commit is unnecessary,
and a `make clean` resolved it. See:

2 years agoFix another forward reference to a Note
Ryan Scott [Thu, 22 Dec 2016 01:35:33 +0000 (20:35 -0500)] 
Fix another forward reference to a Note

A continuation of ccc918cdc8b2d147c4dbc29bfc87c058862a97cd.

[ci skip]

2 years agoNotes on parsing lists in Parser.y
Edward Z. Yang [Wed, 21 Dec 2016 07:38:20 +0000 (23:38 -0800)] 
Notes on parsing lists in Parser.y

Maybe everyone knows this but I think it is worth mentioning

Signed-off-by: Edward Z. Yang <>
Test Plan: none

Reviewers: bgamari, austin

Subscribers: thomie, mpickering

Differential Revision:

2 years agoUpdate ghc-cabal command line usage text.
Edward Z. Yang [Wed, 21 Dec 2016 06:09:16 +0000 (22:09 -0800)] 
Update ghc-cabal command line usage text.

Old usage text was horribly out-of-date.  Now updated!

Signed-off-by: Edward Z. Yang <>
Test Plan: none

Reviewers: bgamari, austin

Subscribers: thomie

Differential Revision:

2 years agoSupport for abi-depends for computing shadowing.
Edward Z. Yang [Wed, 14 Dec 2016 09:28:43 +0000 (01:28 -0800)] 
Support for abi-depends for computing shadowing.

This is a complete fix based off of
ed7af26606b3a605a4511065ca1a43b1c0f3b51d for handling
shadowing and out-of-order -package-db flags simultaneously.

The general strategy is we first put all databases together,
overriding packages as necessary.  Once this is done, we successfully
prune out broken packages, including packages which depend on a package
whose ABI differs from the ABI we need.

Our check gracefully degrades in the absence of abi-depends, as
we only check deps which are recorded in abi-depends.

Contains time and Cabal submodule update.

Signed-off-by: Edward Z. Yang <>
Test Plan: validate

Reviewers: niteria, austin, bgamari

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #12485

2 years agoDisambiguate two Notes with identical names
Ryan Scott [Wed, 21 Dec 2016 16:44:04 +0000 (11:44 -0500)] 
Disambiguate two Notes with identical names

It turns out there were two Notes in the GHC codebase named
[Pattern synonym signatures]. To avoid confusion, I gave one Note a slightly
different name.

2 years agoFix a forward reference to a Note
Ryan Scott [Wed, 21 Dec 2016 16:40:06 +0000 (11:40 -0500)] 
Fix a forward reference to a Note

2 years agoImproved perf for T12227
Simon Peyton Jones [Wed, 21 Dec 2016 14:03:53 +0000 (14:03 +0000)] 
Improved perf for T12227

Improved compiler allocations by abut 5%.  It comes from one of

1a4c04b1 Fix 'SPECIALISE instance'
c48595ee Never apply worker/wrapper to DFuns
05d233e8 Move InId/OutId to CoreSyn
e07ad4db Don't eta-expand in stable unfoldings
d250d493 Add INLINE pragamas on Traversable default methods
c66dd05c Move typeSize/coercionSize into TyCoRep

I think d250d493.

But it's good anyway.

2 years agoTest Trac #12950
Simon Peyton Jones [Wed, 21 Dec 2016 12:26:12 +0000 (12:26 +0000)] 
Test Trac #12950

2 years agoFix 'SPECIALISE instance'
Simon Peyton Jones [Wed, 21 Dec 2016 12:24:41 +0000 (12:24 +0000)] 
Fix 'SPECIALISE instance'

Trac #12944 showed that the DsBinds code that implemented a
SPECIALISE pragma was inadequate if the constraints solving
added let-bindings for dictionaries.  The result was that
we ended up with an unbound dictionary in a DFunUnfolding -- and
Lint didn't even check for that!

Fixing this was not entirely straightforward

* In DsBinds.dsSpec we use a new function
  to pick off the lambda binders from the HsWapper

* dsWrapper now returns a (CoreExpr -> CoreExpr) function

* CoreUnfold.specUnfolding now takes a (CoreExpr -> CoreExpr)
  function it can use to specialise the unfolding.

On the whole the code is simpler than before.

2 years agoNever apply worker/wrapper to DFuns
Simon Peyton Jones [Wed, 21 Dec 2016 12:22:00 +0000 (12:22 +0000)] 
Never apply worker/wrapper to DFuns

While fixing Trac #12444 I found an occasion on which we applied
worker/wrapper to a DFunId.  This is bad: it destroys the magic

This patch is a minor refactoring that stops this corner case
happening, and tidies up the code a bit too.

2 years agoMove InId/OutId to CoreSyn
Simon Peyton Jones [Wed, 21 Dec 2016 12:13:11 +0000 (12:13 +0000)] 
Move InId/OutId to CoreSyn

It turned out that many different modules defined the same type
synonyms (InId, OutId, InType, OutType, etc) for the same purpose.

This patch is refactoring only: it moves all those definitions to

2 years agoLint DFunUnfoldings
Simon Peyton Jones [Mon, 19 Dec 2016 15:04:51 +0000 (15:04 +0000)] 
Lint DFunUnfoldings

Previously we simply failed to Lint these DFunUnfoldings, which led
to a very delayed error message for Trac #12944

2 years agoDon't eta-expand in stable unfoldings
Simon Peyton Jones [Wed, 21 Dec 2016 12:01:32 +0000 (12:01 +0000)] 
Don't eta-expand in stable unfoldings

See SimplUtils Note [No eta expansion in stable unfoldings],
and Trac #9509 for an excellend diagnosis by Nick Frisby

2 years agoAdd INLINE pragamas on Traversable default methods
Simon Peyton Jones [Wed, 21 Dec 2016 11:38:50 +0000 (11:38 +0000)] 
Add INLINE pragamas on Traversable default methods

I discovered, when debugging a performance regression in
the compiler, that the list instance of mapM was not being
inlined at call sites, with terrible runtime costs.

It turned out that this was a serious (but not entirely obvious)
omission of an INLINE pragmas in the class declaration for
Traversable.  This patch fixes it.  I reproduce below the
Note [Inline default methods], which I wrote at some length.

We may well want to apply the same fix in other class declarations
whose default methods are often used.

{- Note [Inline default methods]

   class ... => Traversable t where
       mapM :: Monad m => (a -> m b) -> t a -> m (t b)
       mapM = traverse   -- Default method

   instance Traversable [] where
       {-# INLINE traverse #-}
       traverse = ...code for traverse on lists ...

This gives rise to a list-instance of mapM looking like this

  $fTraversable[]_$ctaverse = ...code for traverse on lists...
       {-# INLINE $fTraversable[]_$ctaverse #-}
  $fTraversable[]_$cmapM    = $fTraversable[]_$ctraverse

Now the $ctraverse obediently inlines into the RHS of $cmapM, /but/
that's all!  We get

  $fTraversable[]_$cmapM = ...code for traverse on lists...

with NO INLINE pragma!  This happens even though 'traverse' had an
INLINE pragma becuase the author knew it should be inlined pretty

Indeed, it turned out that the rhs of $cmapM was just too big to
inline, so all uses of mapM on lists used a terribly inefficient
dictionary-passing style, because of its 'Monad m =>' type.  Disaster!

Solution: add an INLINE pragma on the default method:

   class ... => Traversable t where
       mapM :: Monad m => (a -> m b) -> t a -> m (t b)
       {-# INLINE mapM #-}     -- VERY IMPORTANT!
       mapM = traverse

2 years agoMove typeSize/coercionSize into TyCoRep
Simon Peyton Jones [Wed, 21 Dec 2016 11:24:25 +0000 (11:24 +0000)] 
Move typeSize/coercionSize into TyCoRep

While investigating something else I found that 'typeSize' was
allocating like crazy.  Stupid becuase it should allocate precisely

Turned out that it was because typeSize and coercionSize were mutually
recursive across module boundaries, and so could not benefit from the
CPR property.  To fix this I moved them both into TyCoRep.

It's not critical (because typeSize is really only used in
debug mode, but I tripped over and example (T5642) in which
typeSize was one of the biggest single allocators in all of GHC.
And it's easy to fix, so I did.

2 years agoAdd note for rebindable syntax of [a..b]
Simon Peyton Jones [Mon, 19 Dec 2016 15:06:34 +0000 (15:06 +0000)] 
Add note for rebindable syntax of [a..b]

See Trac #12969

2 years agoTest Trac #12968, plus some comments
Simon Peyton Jones [Mon, 19 Dec 2016 15:05:57 +0000 (15:05 +0000)] 
Test Trac #12968, plus some comments

2 years agoFix typos (not test relevant)
Gabor Greif [Wed, 21 Dec 2016 10:28:07 +0000 (11:28 +0100)] 
Fix typos (not test relevant)

2 years agoSuppress duplicate .T files
Gabor Greif [Wed, 21 Dec 2016 10:17:48 +0000 (11:17 +0100)] 
Suppress duplicate .T files

As per
use the set() function to zap duplicates from the obtained list of .T files.

I am using
$ python3 --version
Python 3.5.1

and strangely findTFiles() returns some .T files twice:

Found 376 .T files...

====> Scanning ../../libraries/array/tests/all.T
====> Scanning ../../libraries/array/tests/all.T
*** framework failure for T2120(duplicate) There are multiple tests with this name
*** framework failure for largeArray(duplicate) There are multiple tests with this name
*** framework failure for array001(duplicate) There are multiple tests with this name
*** framework failure for T9220(duplicate) There are multiple tests with this name
*** framework failure for T229(duplicate) There are multiple tests with this name

Found 365 .T files...
====> Scanning ../../libraries/array/tests/all.T

Even more strangely 'find' begs to differ:
$ find libraries testsuite/tests -name "*.T" | sort | uniq | wc -l

2 years agoRewrite Note [Api annotations] for clarity.
Edward Z. Yang [Tue, 20 Dec 2016 19:13:23 +0000 (11:13 -0800)] 
Rewrite Note [Api annotations] for clarity.

Based off my understanding of how the moving parts work.

Signed-off-by: Edward Z. Yang <>
Test Plan: comments only

Reviewers: alanz, mpickering, austin, bgamari

Subscribers: thomie

Differential Revision:

2 years agoMake CompactionFailed a newtype
Ryan Scott [Tue, 20 Dec 2016 21:32:30 +0000 (16:32 -0500)] 
Make CompactionFailed a newtype

2 years agoTest Trac #12996
Simon Peyton Jones [Tue, 20 Dec 2016 00:08:42 +0000 (00:08 +0000)] 
Test Trac #12996

2 years agoAllow use of the external interpreter in stage1.
Shea Levy [Tue, 20 Dec 2016 01:19:18 +0000 (01:19 +0000)] 
Allow use of the external interpreter in stage1.

Now that we have -fexternal-interpreter, we can lose most of the GHCI ifdefs.

This was originally added in
but that led to a compatibility issue with ghc 7.10.x on Windows.
That's fixed here and the revert reverted.

Reviewers: goldfire, hvr, austin, bgamari, Phyx

Reviewed By: Phyx

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #13008

2 years agoMark T8089 as unbroken since #7325 is now resolved
Ben Gamari [Mon, 19 Dec 2016 23:45:08 +0000 (18:45 -0500)] 
Mark T8089 as unbroken since #7325 is now resolved

2 years agoFix timeout's timeout on Windows
Tamar Christina [Mon, 19 Dec 2016 00:18:57 +0000 (00:18 +0000)] 
Fix timeout's timeout on Windows

Timeout has been broken by my previous patch.
The timeout event was not being processed correctly,
as such hanging processes would not be killed as they should
have been.

This corrects it.

Test Plan:

~/ghc/testsuite/timeout/install-inplace/bin/timeout.exe 10 "sleep 10000s"

Reviewers: austin, RyanGlScott, bgamari

Reviewed By: bgamari

Subscribers: thomie, #ghc_windows_task_force

Differential Revision:

GHC Trac Issues: #13004

2 years agoRevert "Allow use of the external interpreter in stage1."
Tamar Christina [Mon, 19 Dec 2016 19:09:18 +0000 (19:09 +0000)] 
Revert "Allow use of the external interpreter in stage1."

This reverts commit 52ba9470a7e85d025dc84a6789aa809cdd68b566.

2 years agoT8242: disable on NOSMP targets
Sergei Trofimovich [Sun, 18 Dec 2016 17:30:10 +0000 (17:30 +0000)] 
T8242: disable on NOSMP targets

Test calls setNumCapabilities, requires SMP support.

Signed-off-by: Sergei Trofimovich <>
2 years agoregalloc_unit_tests: disable on UNREG targets
Sergei Trofimovich [Sun, 18 Dec 2016 17:24:13 +0000 (17:24 +0000)] 
regalloc_unit_tests: disable on UNREG targets

Test requires register allocator to be present
(native code generator).

Signed-off-by: Sergei Trofimovich <>
2 years agoT10296a: disable on NOSMP targets
Sergei Trofimovich [Sun, 18 Dec 2016 17:15:37 +0000 (17:15 +0000)] 
T10296a: disable on NOSMP targets

Test uses +RTS -N2, requires SMP support.

Signed-off-by: Sergei Trofimovich <>
2 years agoT8209: disable on NOSMP targets
Sergei Trofimovich [Sun, 18 Dec 2016 17:11:56 +0000 (17:11 +0000)] 
T8209: disable on NOSMP targets

Test calls setNumCapabilities, requires SMP support.

Signed-off-by: Sergei Trofimovich <>
2 years agoT12035j: disable on NOSMP targets
Sergei Trofimovich [Sun, 18 Dec 2016 17:01:11 +0000 (17:01 +0000)] 
T12035j: disable on NOSMP targets

Test calls setNumCapabilities, requires SMP support.

Signed-off-by: Sergei Trofimovich <>
2 years agoFix #12998 by removing CTimer
Ryan Scott [Sun, 18 Dec 2016 15:41:48 +0000 (10:41 -0500)] 
Fix #12998 by removing CTimer

CTimer is a wrapper around `timer_t`, which is a typedef for `void*`
on most platforms. The issue is that GHC's `FPTOOLS_CHECK_HTYPE` is not robust
enough to discern pointer types from non-pointer types, so it mistakenly labels
`timer_t` as a `Double` or `Int32` (depending on how many bits a pointer takes
up on your platform). This wreaks havoc when trying to give it certain type
class instances, as noted in

For now, the simplest thing to do would be removing `CTimer`, since:

1. The original author (@DanielG) didn't have a particular use in mind for
   `timer_t` when he fixed #12795.
2. `CTimer` hasn't appeared in a release of `base` yet.

Fixes #12998.

Reviewers: austin, hvr, bgamari, DanielG, trofi

Reviewed By: bgamari, trofi

Subscribers: thomie, DanielG, erikd

Differential Revision:

GHC Trac Issues: #12795, #12998

2 years agoIntroduce unboxedSum{Data,Type}Name to template-haskell
Ryan Scott [Sun, 18 Dec 2016 15:41:33 +0000 (10:41 -0500)] 
Introduce unboxedSum{Data,Type}Name to template-haskell

In D2448 (which introduced Template Haskell support for unboxed
sums), I neglected to add `unboxedSumDataName` and `unboxedSumTypeName`
functions, since there wasn't any way you could write unboxed sum data or type
constructors in prefix form to begin with (see #12514). But even if you can't
write these `Name`s directly in source code, it would still be nice to be able
to use these `Name`s in Template Haskell (for instance, to be able to treat
unboxed sum type constructors like any other type constructors).

Along the way, this uncovered a minor bug in `isBuiltInOcc_maybe` in
`TysWiredIn`, which was calculating the arity of unboxed sum data constructors

Test Plan: make test TEST=T12478_5

Reviewers: osa1, goldfire, austin, bgamari

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #12478, #12514

2 years agoFix Haddock comment typo.
Edward Z. Yang [Sun, 18 Dec 2016 10:55:04 +0000 (02:55 -0800)] 
Fix Haddock comment typo.

Signed-off-by: Edward Z. Yang <>
2 years agoCheck family instance consistency of hs-boot families later, fixes #11062.
Edward Z. Yang [Fri, 16 Dec 2016 02:05:33 +0000 (18:05 -0800)] 
Check family instance consistency of hs-boot families later, fixes #11062.

With hs-boot files, some type families may be defined in the
module we are typechecking.  In this case, we are not allowed
to poke these families until after we typecheck our local
declarations.  So we first check everything involving non-recursive
families, and then check the recursive families as we finish
kind-checking them.

Signed-off-by: Edward Z. Yang <>
Test Plan: validate

Reviewers: goldfire, austin, simonpj, bgamari

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #11062

2 years agoAllow use of the external interpreter in stage1.
Shea Levy [Sun, 18 Dec 2016 01:08:58 +0000 (20:08 -0500)] 
Allow use of the external interpreter in stage1.

Now that we have -fexternal-interpreter, we can lose most of the GHCI ifdefs.

Reviewers: simonmar, goldfire, austin, hvr, bgamari

Reviewed By: simonmar

Subscribers: RyanGlScott, mpickering, angerman, thomie

Differential Revision:

2 years agoDocs: Delete duplicate paragraph in user guide
Siddhanathan Shanmugam [Sat, 17 Dec 2016 23:09:13 +0000 (18:09 -0500)] 
Docs: Delete duplicate paragraph in user guide

Removes duplicate paragraph in user guide. The same paragraph is
repeated below this one.

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision:

2 years agoImprove StringBuffer and FastString docs
Phil Ruffwind [Sat, 17 Dec 2016 23:09:06 +0000 (18:09 -0500)] 
Improve StringBuffer and FastString docs

This area of code contains a lot of unsafe functionality, so it might be
worth documenting to reduce the risk of misuse.

Test Plan: inspection

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision:

2 years agoRun some tests with -fexternal-interpreter -prof
Simon Marlow [Sat, 17 Dec 2016 23:08:59 +0000 (18:08 -0500)] 
Run some tests with -fexternal-interpreter -prof

We don't have any other tests for this, except one Template Haskell
test.  This would have caught the bug I just fixed in D2868, at least
when validating with profiling on.

Test Plan: Ran tests

Reviewers: niteria, austin, erikd, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #5654

2 years agoFix bug in previous fix for #5654
Simon Marlow [Sat, 17 Dec 2016 23:08:48 +0000 (18:08 -0500)] 
Fix bug in previous fix for #5654

I forgot to account for BCOs, which have a different layout from
functions.  This caused crashes when using profiling with GHCi (via
-fexternal-interpreter -prof), which unfortunately is not tested at all
by validate, even when profiling is enabled.  I'm going to add some
testing that would have caught this in a separate patch.

Test Plan:
cd nofib/spectral/puzzle && make NoFibWithGHCi=YES
EXTRA_RUNTEST_OPTS='-fexternal-interpreter -prof'
New testsuite tests coming in a separate diff.

Reviewers: niteria, austin, erikd, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #5654

2 years agoReexport Language.Haskell.TH.Lib from Language.Haskell.TH
Ryan Scott [Sat, 17 Dec 2016 23:08:36 +0000 (18:08 -0500)] 
Reexport Language.Haskell.TH.Lib from Language.Haskell.TH

Reexporting `Language.Haskell.TH.Lib` from `Language.Haskell.TH` ensures
that `Language.Haskell.TH` will continue to expose all of the functions
that `Language.Haskell.TH.Lib` does in the future.

Fixes #12992.

Test Plan: ./validate

Reviewers: austin, bgamari, goldfire

Reviewed By: bgamari, goldfire

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #12992

2 years agorts/win32/IOManager: Fix integer types
Ben Gamari [Sat, 17 Dec 2016 23:08:00 +0000 (18:08 -0500)] 
rts/win32/IOManager: Fix integer types

This code has been broken on 64-bit systems for some time: the length
and timeout arguments of `addIORequest` and `addDelayRequest`,
respectively, were declared as `int`. However, they were passed Haskell
integers from their respective primops. Integer overflow and madness
ensued. This resulted in #7325 and who knows what else.

Also, there were a few left-over `BOOL`s in here which were not passed
to Windows system calls; these were changed to C99 `bool`s.

However, there is still a bit of signedness inconsistency within the
`delay#` call-chain,

 * `GHC.Conc.IO.threadDelay` and the `delay#` primop accept `Int`

 * The `delay#` implementation in `PrimOps.cmm` expects the timeout as
   a `W_`

 * `AsyncIO.c:addDelayRequest` expects an `HsInt` (was `int` prior to
   this patch)

 * `IOManager.c:AddDelayRequest` expects an `HsInt`` (was `int`)

 * The Windows `Sleep` function expects a `DWORD` (which is unsigned)

Test Plan: Validate on Windows

Reviewers: erikd, austin, simonmar, Phyx

Reviewed By: Phyx

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #7325

2 years agoWindows: Improve terminal detection mechanism
Phil Ruffwind [Sat, 17 Dec 2016 23:07:49 +0000 (18:07 -0500)] 
Windows: Improve terminal detection mechanism

The previous detection mechanism allowed environment variables (ANSICON,
ConEmuANSI, TERM) to supersede the fact that the stderr is not a
terminal, which is probably what led to color codes appearing in the
stderr of the tests (see: 847d229346431483b99adcff12e46c7bf6af15da).

This commit changes the detection mechanism to detect Cygwin/MSYS2
terminals in a more reliable manner, avoiding the use of environment
variables entirely.

Test Plan: validate

Reviewers: Phyx, austin, erikd, bgamari

Reviewed By: Phyx, bgamari

Subscribers: RyanGlScott, thomie

Differential Revision:

2 years agoReshuffle levity polymorphism checks.
Richard Eisenberg [Sat, 17 Dec 2016 23:06:34 +0000 (18:06 -0500)] 
Reshuffle levity polymorphism checks.

Previously, GHC checked for bad levity polymorphism to the left of all
arrows in data constructors. This was wrong, as reported in #12911
(where an example is also shown). The solution is to check each
individual argument for bad levity polymorphism.  Thus the check has
been moved from TcValidity to TcTyClsDecls.

A similar situation exists with pattern synonyms, also fixed here.

This patch also nabs #12819 while I was in town.

Test cases: typecheck/should_compile/T12911, patsyn/should_fail/T12819

Test Plan: ./validate

Reviewers: simonpj, austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #12819, #12911

2 years agoutils/genargs: delete unused tool
Sergei Trofimovich [Sat, 17 Dec 2016 22:19:29 +0000 (22:19 +0000)] 
utils/genargs: delete unused tool

The tool was added in 2003 but never used at least in ghc tree.

Signed-off-by: Sergei Trofimovich <>
2 years agofix OpenBSD linkage (wxneeded)
Sergei Trofimovich [Sat, 17 Dec 2016 20:25:19 +0000 (20:25 +0000)] 
fix OpenBSD linkage (wxneeded)

There is two types of options passed directly to 'ld'
(and not to 'gcc' driver):

This changedoes two things:

- split 'EXTRA_LD_OPTS' into two variables:
    - EXTRA_LD_OPTS (accepts 'gcc' wrapper options)
    - EXTRA_LD_LINKER_OPTS (accepts raw 'ld' options)

- wraps all LD_LINKER options as '-Wl,' when passed
  to 'gcc' driver.


Signed-off-by: Sergei Trofimovich <>
2 years agoRevert "Do not init record accessors as exported"
Ben Gamari [Sat, 17 Dec 2016 16:53:59 +0000 (11:53 -0500)] 
Revert "Do not init record accessors as exported"

This reverts commit 3a00ff92a3ee66c096b85b180d247d1a471a6b6e due
to #12993

2 years agoFix Pretty printer tests on Windows
Tamar Christina [Sat, 17 Dec 2016 16:40:11 +0000 (16:40 +0000)] 
Fix Pretty printer tests on Windows

D2752 added some tests which escapes string literals. This means newlines are converted
before they get normalized by the IO functions. So on Windows \r\n would be in the output
while \n was expected.

Test Plan: make test -C testsuite/tests/printer

Reviewers: austin, bgamari, alanz

Reviewed By: alanz

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #3384

2 years agorts/Compact.cmm: fix UNREG build failure
Sergei Trofimovich [Sat, 17 Dec 2016 13:39:18 +0000 (13:39 +0000)] 
rts/Compact.cmm: fix UNREG build failure

The change does the following:
- Add explicit declaration of exception closures
  from base. C backend needs those symbols to be
- Reorder cmm functions in use order. Again C
  backend needs symbol declaration/definition
  before use. even for module-local cmm functions.

Fixes the following build failure:

  rts_dist_HC rts/dist/build/Compact.o
    In file included from /tmp/ghc3348_0/ghc_4.hc:3:0: error:
    /tmp/ghc3348_0/ghc_4.hc: In function 'stg_compactAddWithSharingzh':

    /tmp/ghc3348_0/ghc_4.hc:27:11: error:
     error: 'stg_compactAddWorkerzh' undeclared (first use in this function)
    /tmp/ghc3348_0/ghc_4.hc:230:13: error:
     error: 'base_GHCziIOziException_cannotCompactMutable_closure'
     undeclared (first use in this function)
     R1.w = (W_)&base_GHCziIOziException_cannotCompactMutable_closure;

Signed-off-by: Sergei Trofimovich <>
2 years agorevert '-Wl' prefixing to *_LD_OPTS
Sergei Trofimovich [Sat, 17 Dec 2016 13:30:41 +0000 (13:30 +0000)] 
revert '-Wl' prefixing to *_LD_OPTS

This reverts f48f5a9ebf384e1e157b7b413e1d779f4289ddd2

The prefixing does not work as comma
is stripped by $(addprefix) macro:

The following call
    $$(addprefix -optl-Wl, $$($1_$2_$3_ALL_LD_OPTS))

prefixes options with "-optl-Wl" not with "-optl-Wl,"

The simplest breakage can be seen by adding
    SRC_LD_OPTS += -O1
to mk/

  <no location info>: error:
    Warning: Couldn't figure out linker information!
             Make sure you're using GNU ld, GNU gold
             or the built in OS X linker, etc.
  gcc: error: unrecognized command line option '-Wl-O1'

Another problem with original change is loss of ability
to pass options to gcc as a linker driver, for example:
    SRC_LD_OPTS += -flto

Signed-off-by: Sergei Trofimovich <>
2 years agoUNREG: include CCS_OVERHEAD to STG
Sergei Trofimovich [Sat, 17 Dec 2016 13:25:43 +0000 (13:25 +0000)] 

Commit 394231b301efb6b56654b0a480ab794fe3b7e4db aded
CCS_OVERHEAD annotation to 'rts/Apply.cmm'.

Before the change CCS_OVERHEAD was used only in C code.

The change exports CCS_OVERHEAD to STG.

Fixes UNREG build failure:
  rts_dist_HC rts/dist/build/Apply.p_o
    /tmp/ghc29563_0/ghc_4.hc: In function 'cm_entry':

    /tmp/ghc29563_0/ghc_4.hc:73:13: error:
     error: 'CCS_OVERHEAD' undeclared (first use in this function)
     *((P_)((W_)&CCS_OVERHEAD+72)) = ...

Signed-off-by: Sergei Trofimovich <>
2 years agotestsuite: Add test for #12993
Ben Gamari [Fri, 16 Dec 2016 21:47:45 +0000 (16:47 -0500)] 
testsuite: Add test for #12993

2 years agoEnable split sections by default where possible
Simon Brenner [Fri, 16 Dec 2016 17:16:05 +0000 (12:16 -0500)] 
Enable split sections by default where possible

On non-windows platforms with GNU ld, enable SplitSections in the GHC
build by default.

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: DemiMarie, thomie

Differential Revision:

GHC Trac Issues: #11445

2 years agoFix string merging with -split-sections
Simon Brenner [Fri, 16 Dec 2016 17:14:36 +0000 (12:14 -0500)] 
Fix string merging with -split-sections

The added flags for string literal merging ended up printed in the
middle of the section name when -split-sections was enabled. Break it up
to put the flags after the name.

Test Plan: validate with SplitSections=YES

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #9577

2 years agoMake up a module name for c-- files
Ben Gamari [Fri, 16 Dec 2016 17:00:27 +0000 (12:00 -0500)] 
Make up a module name for c-- files

We used to pass a bottoming Module to the NCG, which resulted in panics
when `-v` was used due to debug output (see #11784). Instead we make up
a module name. This is a bit scary since `PIC.howToAccessLabel` might
actually use the Module, but if it wasn't crashing before I suppose it's

Test Plan: `touch hi.cmm; ghc -v2 -c -dcmm-lint hi.cmm`

Reviewers: austin, simonmar

Reviewed By: simonmar

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #11784

2 years agoCLabel: Kill redundant UnitId argument from labelDynamic
Ben Gamari [Fri, 16 Dec 2016 16:59:49 +0000 (11:59 -0500)] 
CLabel: Kill redundant UnitId argument from labelDynamic

It already has access to the current package's UnitId via the Module.
Edward Yang pointed out that there is one wrinkle, however: the
following invariant isn't true at all stages of compilation,

    if I am compiling the module (this_mod :: Module), then
    thisPackage dflags == moduleUnitId this_mod.

Specifically, this is only true after desugaring; it may be broken when
typechecking an indefinite signature.

However, it's safe to assume this in the native codegen. I've updated
Note to state this invariant more directly.

Test Plan: Validate

Reviewers: austin, ezyang, simonmar

Reviewed By: ezyang, simonmar

Subscribers: thomie

Differential Revision:

2 years agoPackages: Kill unused UnitId argument to isDllName
Ben Gamari [Fri, 16 Dec 2016 16:59:26 +0000 (11:59 -0500)] 
Packages: Kill unused UnitId argument to isDllName

Test Plan: Validate

Reviewers: austin, simonmar

Subscribers: thomie, ezyang

Differential Revision:

2 years agoDynFlags: Rip out remnants of WarnContextQuantification
Ben Gamari [Fri, 16 Dec 2016 16:58:55 +0000 (11:58 -0500)] 
DynFlags: Rip out remnants of WarnContextQuantification

Test Plan: Validate

Reviewers: austin

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #11221

2 years agoTypos in comments
Gabor Greif [Fri, 16 Dec 2016 13:00:15 +0000 (14:00 +0100)] 
Typos in comments

2 years agoVerify that known-key uniques fit in interface file
Ben Gamari [Fri, 16 Dec 2016 00:00:00 +0000 (19:00 -0500)] 
Verify that known-key uniques fit in interface file

Here we introduce a debug check asserting that all uniques in
knownKeyNames will fit in the space allowed in the interface file's
symbol encoding.

Test Plan: Validate

Reviewers: austin

Subscribers: thomie

Differential Revision:

2 years agobase: Add more POSIX types (fixes #12795)
Daniel Gröber [Thu, 15 Dec 2016 23:58:59 +0000 (18:58 -0500)] 
base: Add more POSIX types (fixes #12795)

Test Plan: validate

Reviewers: hvr, austin, RyanGlScott, bgamari

Reviewed By: RyanGlScott, bgamari

Subscribers: RyanGlScott, thomie, erikd

Differential Revision:

GHC Trac Issues: #12795

2 years agoUniqSupply: Use full range of machine word
Ben Gamari [Thu, 15 Dec 2016 23:57:26 +0000 (18:57 -0500)] 
UniqSupply: Use full range of machine word

Currently uniques are 32-bits wide. 8 of these bits are for the unique
class, leaving only 24 for the unique number itself. This seems
dangerously small for a large project. Let's use the full range of the
native machine word.

We also add (now largely unnecessary) overflow check to ensure that the
unique number doesn't overflow.

Test Plan: Validate

Reviewers: simonmar, austin, niteria

Reviewed By: niteria

Subscribers: mpickering, thomie

Differential Revision:

GHC Trac Issues: #12944

2 years agoarray: Check for integer overflow during allocation
Ben Gamari [Thu, 15 Dec 2016 22:47:08 +0000 (17:47 -0500)] 
array: Check for integer overflow during allocation

This fixes #229, where creating a new array can cause array to allocate
a smaller array than it thinks it allocates due to integer overflow,
resulting in memory unsafety.

This breaks the rts/overflow1 test, which relied on this unchecked
overflow. I fix it by reimplementing the test in terms of newByteArray#

Updates the array submodule.

2 years agotestsuite: Add test for #12966
Ben Gamari [Thu, 15 Dec 2016 20:27:01 +0000 (15:27 -0500)] 
testsuite: Add test for #12966

This isn't exactly a typechecker test, but it was the most appropriate
directory I could think of. The issue being tested is fixed.

Test Plan: Validate

Reviewers: austin

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #12966

2 years agotestsuite: Mark T10294 as fixed
Ben Gamari [Thu, 15 Dec 2016 20:26:39 +0000 (15:26 -0500)] 
testsuite: Mark T10294 as fixed

It seems that c3c702441137dc8f7ee0dd5ac313be96d625459a resolved #10301.
It took a while to notice this since it only broke when tested against a
statically linked GHC, a configuration which Harbormaster doesn't test.

Test Plan: Validate

Reviewers: angerman, austin

Subscribers: thomie, nomeata

Differential Revision:

GHC Trac Issues: #10294, #10301

2 years agotestsuite: Add test for #12971
Ben Gamari [Thu, 15 Dec 2016 20:26:11 +0000 (15:26 -0500)] 
testsuite: Add test for #12971

Test Plan: Validate

Reviewers: austin

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #12971

2 years agobase: Bump version to
Ben Gamari [Tue, 15 Nov 2016 15:26:14 +0000 (10:26 -0500)] 
base: Bump version to

Updates a number of submodules.

2 years agotestsuite: Separate out Windows results for T5205
Ben Gamari [Thu, 15 Dec 2016 16:18:05 +0000 (11:18 -0500)] 
testsuite: Separate out Windows results for T5205

This test seems to have much different allocation behavior on Windows
and Linux.  Previously we had widened the acceptance window to 7% to
accomodate this, but even this isn't enough any more. Instead of further
widening the window let's just give an expected number for each
platform. Really, this is precisely the issue with our performance
testing model which I've been complaining about in #12758.

Fixes test for #5205 on 64-bit Windows.

Test Plan: Validate on Windows

Reviewers: austin

Subscribers: thomie, Phyx

Differential Revision:

GHC Trac Issues: #5205

2 years agoWarn about missing instance methods that start with an underscore
Ryan Scott [Thu, 15 Dec 2016 16:17:49 +0000 (11:17 -0500)] 
Warn about missing instance methods that start with an underscore

Previously, GHC would not warn whenever there was a class instance that
didn't implement a class method whose name begins with an underscore.

Fixes #12959.

Test Plan: make test TEST=WarnMinimal

Reviewers: austin, bgamari, simonpj

Reviewed By: bgamari, simonpj

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #12959

2 years agoFix pretty printing of MINIMAL signatures
Matthew Pickering [Thu, 15 Dec 2016 16:17:34 +0000 (11:17 -0500)] 
Fix pretty printing of MINIMAL signatures

Reviewers: austin, alanz, bgamari

Reviewed By: alanz, bgamari

Subscribers: thomie

Differential Revision:

2 years agoFix cost-centre-stacks bug (#5654)
Simon Marlow [Thu, 15 Dec 2016 16:17:19 +0000 (11:17 -0500)] 
Fix cost-centre-stacks bug (#5654)

This fixes some cases of wrong stacks being generated by the profiler.
For background and details on the fix see
`Note [Evaluating functions with profiling]` in `rts/Apply.cmm`.

This does have an impact on allocations for some programs when
profiling.  nofib results:

   k-nucleotide          +0.0%     +8.8%    +11.0%    +11.0%      0.0%
         puzzle          +0.0%    +12.5%     0.244     0.246      0.0%
      typecheck           0.0%     +8.7%    +16.1%    +16.2%      0.0%
            Min          -0.0%     -0.0%    -34.4%    -35.5%    -25.0%
            Max          +0.0%    +12.5%    +48.9%    +49.4%    +10.6%
 Geometric Mean          +0.0%     +0.6%     +2.0%     +1.8%     -0.3%


But runtimes don't seem to be affected much, and the examples I looked
at were completely legitimate.  For example, in puzzle we have this:

position :: ItemType -> StateType ->  BankType
position Bono = bonoPos
position Edge = edgePos
position Larry = larryPos
position Adam = adamPos

where the identifiers on the rhs are all record selectors.  Previously
the profiler gave a stack that looked like


i.e. `bonoPos` was at the same level of the call stack as `position`,
but now it looks like


I used the normaliser from the testsuite to diff the profiling output
from other nofib programs and they all looked better.

Test Plan:
* the broken test passes
* validate
* compiled and ran all of nofib, measured perf, diff'd several .prof

Reviewers: niteria, erikd, austin, scpmw, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #5654, #10007

2 years agocheck-ppr: Add a --dump flag to aid in debugging
Ben Gamari [Wed, 14 Dec 2016 22:09:02 +0000 (17:09 -0500)] 
check-ppr: Add a --dump flag to aid in debugging

Currently tracking down where two ASTs disagree is quite difficult. Add a --dump
flag to check-ppr which dumps the respective ASTs to files, which can then be
easily compared with diff, etc.

2 years agotestsuite: Specify expected allocations of T12877 for Windows
Ben Gamari [Wed, 14 Dec 2016 21:51:54 +0000 (16:51 -0500)] 
testsuite: Specify expected allocations of T12877 for Windows

This deviated by 12% from the expected allocations on Windows.
Yet another case of #12758.

2 years agoMake unboxedTuple{Type,Data}Name support 0- and 1-tuples
Ryan Scott [Wed, 14 Dec 2016 21:47:53 +0000 (16:47 -0500)] 
Make unboxedTuple{Type,Data}Name support 0- and 1-tuples

Previously, these functions were hardcoded so as to always `error`
whenever given an argument of 0 or 1. This restriction can be lifted
pretty easily, however.

This requires a slight tweak to `isBuiltInOcc_maybe` in `TysWiredIn` to
allow it to recognize `Unit#` (which is the hard-wired `OccName` for
unboxed 1-tuples).

Fixes #12977.

Test Plan: make test TEST=12977

Reviewers: austin, goldfire, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #12977

2 years agoAdd entry to .gitignore to for __.SYMDEF_SORTED
John Leo [Wed, 14 Dec 2016 21:47:18 +0000 (16:47 -0500)] 
Add entry to .gitignore to for __.SYMDEF_SORTED

libraries/integer-gmp/gmp/objs/__.SYMDEF SORTED is created by Mac OS

Test Plan: validate

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: