Make GHCi & TH work when the compiler is built with -prof

Authored by simonmar.

Description

Make GHCi & TH work when the compiler is built with -prof

Summary:
Amazingly, there were zero changes to the byte code generator and very
few changes to the interpreter - mainly because we've used good
abstractions that hide the differences between profiling and
non-profiling. So that bit was pleasantly straightforward, but there
were a pile of other wibbles to get the whole test suite through.

Note that a compiler built with -prof is now like one built with
-dynamic, in that to use TH you have to build the code the same way.
For dynamic, we automatically enable -dynamic-too when TH is required,
but we don't have anything equivalent for profiling, so you have to
explicitly use -prof when building code that uses TH with a profiled
compiler. For this reason Cabal won't work with TH. We don't expect
to ship a profiled compiler, so I think that's OK.

Test Plan: validate with GhcProfiled=YES in validate.mk

Reviewers: goldfire, bgamari, rwbarton, austin, hvr, erikd, ezyang

Reviewed By: ezyang

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1407

GHC Trac Issues: Trac #4837, Trac #545

Details

Auditors
hvr
bgamari
Group Auditors
Restricted Owners Package
Committed
simonmarNov 7 2015, 3:39 AM
Reviewer
ezyang
Differential Revision
D1407: Make GHCi & TH work when the compiler is built with -prof
Parents
rGHCa58eeb7febd6: Call Arity: In "e x", the result of "x" is not shared
Branches
Unknown
Tags
Unknown
Build Status
Buildable 6568
Build 7637: GHC Continuous Integration (amd64/Linux)
hvr raised a concern with this commit.Nov 23 2015, 11:42 AM
hvr added a subscriber: hvr.
hvr added inline comments.
/compiler/main/DynFlags.hs
3495–3496

is this comment still accurate?

bgamari added inline comments.
/compiler/main/DynFlags.hs
3495–3496

It would appear that it is not however the binding is still used for other purposes.

simonmar added inline comments.Nov 24 2015, 9:45 AM
/compiler/main/DynFlags.hs
3495–3496

This comment can be removed now.

bgamari accepted this commit.Nov 24 2015, 9:57 AM
bgamari added inline comments.
/compiler/main/DynFlags.hs
3495–3496

Done.

This is still flagged as a problem commit, does someone need to accept?

hvr resigned from this audit.Dec 7 2015, 10:00 AM

I need to get out the way it seems...

hvr accepted this commit.Dec 7 2015, 10:00 AM