Fix bug with reporting deprecated use of flag (Trac #7349)
Do not treat a constructor in a *pattern* as a *use* of that constructor

Occurrences in terms are uses, in patterns they are not.
In this way we get unused-constructor warnings from modules like this

   module M( f, g, T ) where
     data T = T1 | T2 Bool

     f x = T2 x

     g T1 = True
     g (T2 x) = x

Here a T1 value cannot be constructed, so we can warn. The use
in a pattern doesn't count.  See Note [Patterns are not uses]
in RnPat.

Interestingly this change exposed three module in GHC itself
that had unused constructors, which I duly removed:
  * ghc/Main.hs
  * compiler/ghci/ByteCodeAsm
  * compiler/nativeGen/PPC/RegInfo
Their changes are in this patch.
INFO_TABLE_RET should generate a CmmRetInfoLabel, not a CmmInfoLabel

Fixes this, when building unregisterised:

rts/dist/build/AutoApply.hc:87:1:
     error: ‘stg_ap_v_entry’ undeclared (first use in this function)
Make DYNAMIC_BY_DEFAULT=NO when GhcUnregisterised
Cmm jumps always have live register information.

Jumps now always have live register information attached, so drop Maybes.
Attach proper jump liveness information to generated C-- code.
Save and restore registers across calls to unlockClosure.

We may not assume that registers are saved across calls to unlockClosure because
it could call a C function on some platforms.
Generalize register sets and liveness calculations.

We would like to calculate register liveness for global registers as well as
local registers, so this patch generalizes the existing infrastructure to set
the stage.
Properly mark C-- calls to _assertFail as "never returns".
Attach global register liveness info to Cmm procedures.

All Cmm procedures now include the set of global registers that are live on
procedure entry, i.e., the global registers used to pass arguments to the
procedure. Only global registers that are use to pass arguments are included in
this list.
Draw STG F and D registers from the same pool of available SSE registers on x86-64.

On x86-64 F and D registers are both drawn from SSE registers, so there is no
reason not to draw them from the same pool of available SSE registers. This
means that whereas previously a function could only receive two Double arguments
in registers even if it did not have any Float arguments, now it can receive up
to 6 arguments that are any mix of Float and Double in registers.

This patch breaks the LLVM back end. The next patch will fix this breakage.
Generate correct LLVM for the new register allocation scheme.

We now have accurate global register liveness information attached to all Cmm
procedures and jumps. With this patch, the LLVM back end uses this information
to pass only the live floating point (F and D) registers on tail calls. This
makes the LLVM back end compatible with the new register allocation strategy.

Ideally the GHC LLVM calling convention would put all registers that are always
live first in the parameter sequence. Unfortunately the specification is written
so that on x86-64 SpLim (always live) is passed after the R registers. Therefore
we must always pass *something* in the R registers, so we pass the LLVM value
undef.
Get ride of the -fregs-liveness flag.

With the new register allocation scheme, the LLVM back end must always use
liveness information.
Change how touchy sets the file time

Also added a large comment about why we need it
Improve touchy

It's now simpler, and it fails if something fails rather than just
printing an error message and continuing.
Merge branch 'master' of http://darcs.haskell.org/ghc
Clean some old files that we no longer generate

Avoids problems for people with old files in their tree
Comments only
Do not instantiate unification variables with polytypes

Without -XImpredicativeTypes, the typing rules say that a function
should be instantiated only at a *monotype*.  In implementation terms,
that means that a unification variable should not unify with a type
involving foralls.  But we were not enforcing that rule, and that
gave rise to some confusing error messages, such as
  Trac #7264, #6069

This patch adds the test for foralls.  There are consequences

 * I put the test in occurCheckExpand, since that is where we see if a
   type can unify with a given unification variable.  So
   occurCheckExpand has to get DynFlags, so it can test for
   -XImpredicativeTypes

 * We want this to work
      foo :: (forall a. a -> a) -> Int
      foo = error "foo"
   But that means instantiating error at a polytype!  But error is special
   already because you can instantiate it at an unboxed type like Int#.
   So I extended the specialness to allow type variables of openTypeKind
   to unify with polytypes, regardless of -XImpredicativeTypes.

   Conveniently, this works in TcUnify.matchExpectedFunTys, which generates
   unification variable for the function arguments, which can be polymorphic.

 * GHC has a special typing rule for ($) (see Note [Typing rule
   for ($)] in TcExpr).  It unifies the argument and result with a
   unification variable to exclude unboxed types -- but that means I
   now need a kind of unificatdion variable that *can* unify with a
   polytype.

   So for this sole case I added PolyTv to the data type TcType.MetaInfo.
   I suspect we'll find mor uses for this, and the changes are tiny,
   but it still feel a bit of a hack.  Well the special rule for ($)
   is a hack!

There were some consequential changes in error reporting (TcErrors).
Merge branch 'master' of http://darcs.haskell.org/ghc