Skip to content

Make -fbyte-code prevent unboxed tuples/sums from implying object code (#16876)

Ryan Scott requested to merge RyanGlScott/ghc:wip/T16876 into master

This resolves #16876 (closed) by making the explicit use of -fbyte-code prevent code that enables UnboxedTuples or UnboxedSums from automatically compiling to object code. This allows for a nice middle ground where most code that enables UnboxedTuples/-Sums will still benefit from automatically enabling -fobject-code, but allows power users who wish to avoid this behavior in certain corner cases (such as lens, whose use case is documented in #16876 (closed)) to do so.

Along the way, I did a little cleanup of the relevant code and documentation:

  • enableCodeGenForUnboxedTuples was only checking for the presence of UnboxedTuples, but UnboxedSums has the same complications. I fixed this and renamed the function to enableCodeGenForUnboxedTuplesOrSums.
  • I amended the users' guide with a discussion of these issues.

Merge request reports