Remove outdated comment (#8434)

Authored-by: Gergely Risko <gergely@risko.hu>
Signed-off-by: Austin Seipp <austin@well-typed.com>
Add machinery to reify annotations (#8397)

Authored-by: Gergely Risko <gergely@risko.hu>
Signed-off-by: Austin Seipp <austin@well-typed.com>
Fix mkdirhier.sh on OS X 10.9 (#8139)

Mac OS X 10.9 mkdir is apparently stricter than the Mac OS X 10.8
mkdir about which paths are considered valid arguments. For example,
in a typical build on Mac OS X 10.9, the first of the following
invocations of mkdirhier.sh will succeed but the second will fail:

"inplace/bin/mkdirhier"   utils/ghc-cabal/dist/build/tmp//.  # WORKS
"inplace/bin/mkdirhier"   bootstrapping/.                    # FAILS

Simply prefixing the path arguments with "./" causes both to succeed:

"inplace/bin/mkdirhier" ./utils/ghc-cabal/dist/build/tmp//.  # WORKS
"inplace/bin/mkdirhier" ./bootstrapping/.                    # WORKS

Testing indicates failure on paths satisfying all of these criteria:

- path is suffixed with "/."
- path is only 1 level deep (e.g., "foo/."; _not_ "foo/bar/.")
- path is _not_ prefixed with "./"

This workaround prefixes "./" to the path argument passed to mkdir.

Signed-off-by: Austin Seipp <austin@well-typed.com>
Fix building RtsProbes.d on Mac OS X 10.9 (#8139)

Signed-off-by: Austin Seipp <austin@well-typed.com>
Add rts_isDynamic to the linker symbol list

Spotted by Bertram Felgenhauer.

Signed-off-by: Austin Seipp <austin@well-typed.com>
Typos
Reject negative type-level integers created via TH (#8412)

This commit moves the check from parser to renamer.
Update `haskeline` library to latest HEAD

This is actually a no-op wrt the source-code and is only performed to show
that upstream is identical to our lagged repository.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Add rEP_Capability_no.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Add cmmNotWord.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Add BLOCK constants to DeriveConstants.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Teach code generator about Nursery register.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Teach code generator about CurrentAlloc register.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Place static closures in their own section.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
BC-breaking changes to C-- CLOSURE syntax.

Previously, there were two variants of CLOSURE in C--:

    - Top-level CLOSURE(foo_closure, foo, lits...), which defines a new
      static closure and gives it a name, and

    - Array CLOSURE(foo, lits...), which was used for the static char
      and integer arrays.

They used the same name, were confusing, and didn't even generate
the correct internal label representation!  So now, we have two
new forms:

    - Top-level CLOSURE(foo, lits...) which automatically generates
      foo_closure (along with foo_info, which we were doing already)

    - Array ANONYMOUS_CLOSURE(foo, lits...) which doesn't generate
      a foo_closure identifier.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Properly generate info tables for static closures in C--.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Rename _closure to _static_closure, apply naming consistently.

In preparation for indirecting all references to closures,
we rename _closure to _static_closure to ensure any old code
will get an undefined symbol error.  In order to reference
a closure foobar_closure (which is now undefined), you should instead
use STATIC_CLOSURE(foobar).  For convenience, a number of these
old identifiers are macro'd.

Across C-- and C (Windows and otherwise), there were differing
conventions on whether or not foobar_closure or &foobar_closure
was the address of the closure.  Now, all foobar_closure references
are addresses, and no & is necessary.

CHARLIKE/INTLIKE were not changed, simply alpha-renamed.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Implement closure indirections.

Closure indirections live in the staticclosureinds section
and initially point to their corresponding closure in
the staticclosures.  The intent is that all code goes through
a closure indirection, and at runtime the indirections can
change.

These pieces of code have to go through closure indirections:

    - Code references to a static closure
    - SRTs
    - Heap check (but we want to fix this)
    - References to closures in RTS (see STATIC_CLOSURE) macro
    - Runtime symbol lookup (e.g. GHCi, dynwrapper)
    - The main closure passed to hs_main

Closure indirections should simplify these components (but that
is not implemented yet):

    - Windows DLL handling (which already needed an indirection)

In order to keep the code running, the fields of static closures
are not indirected (although they should be); this will be switched
over in a later commit.

Important invariant: an indirection may only be dereferenced
after the runtime is setup.  In particular, references to
closures in __attribute__(constructor) need to be kept indirections;
this is what the stable pointer deferral is for.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Implement runtime setup code for static closures.

Fields of static closures are now indirected, and we have a simple
runtime initialization code initStaticClosures() which merely rewrites
all of the indirections into untagged pointers and untangles references
between the static closures.  This also copies static closures into
blocks, although this data is unused.

The runtime system finds out about indirections by way of
__attribute__(constructor) methods; thus C-- compilation may now
generate foreign stubs (if it defines closures).

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Indirect SRTs and heap checks.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>