Skip to content
Snippets Groups Projects
Commit cee3adbc authored by Austin Seipp's avatar Austin Seipp
Browse files

Make SpecConstr also check for GHC.Types.SPEC


SpecConstr has for a while now looked for types with the built
in ForceSpecConstr annotation, in order to know where to be particularly
aggressive.

Unfortunately using an annotation has a number of downsides, the most
prominent two being:

  A) ForceSpecConstr is vital for efficiency (even if it's
     a hack), but it means users of it must have GHCI - even though
     stage2 features are not required for anything but the annotation.

  B) Any user who might need it (read: vector) has to duplicate the same
     piece of code. In general there are few people actually doing this,
     but it's unclear why they should have to.

This patch makes SpecConstr look for functions applied to the new
GHC.Types.SPEC type - a copy of the already-extant 'SPEC' type - as well
as look for annotations, in the stage2 compiler.

In particular, this means `vector` can now be built with a stage1
compiler, since it no longer depends on stage2 for anything else. This
is particularly important for e.g. iOS cross-compilers.

This also means we should be able to build `vector` earlier in the build
process too, but this patch doesn't address that.

This requires an accompanying bump in ghc-prim.

Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
parent 2fc1ac24
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment