Make GHCi & TH work when the compiler is built with -prof
authorSimon Marlow <marlowsd@gmail.com>
Sat, 7 Nov 2015 09:39:05 +0000 (09:39 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Sat, 7 Nov 2015 09:39:05 +0000 (09:39 +0000)
commitce1f1607ed7f8fedd2f63c8610cafefd59baaf32
tree718641160c3d93a2ca974deec1e228cb09e1a97e
parenta58eeb7febd67c93dab82de7049ef1dcdecd34e9
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: #4837, #545
58 files changed:
compiler/cmm/CmmInfo.hs
compiler/codeGen/StgCmmProf.hs
compiler/ghci/ByteCodeItbls.hs
compiler/ghci/Linker.hs
compiler/ghci/RtClosureInspect.hs
compiler/main/DynFlags.hs
compiler/main/HscMain.hs
ghc/InteractiveUI.hs
includes/rts/prof/CCS.h
includes/rts/storage/InfoTables.h
rts/Interpreter.c
rts/Linker.c
rts/PrimOps.cmm
rts/ProfHeap.c
rts/Profiling.c
rts/Profiling.h
rts/RtsStartup.c
rts/RtsSymbols.c
testsuite/config/ghc
testsuite/mk/boilerplate.mk
testsuite/mk/ghc-config.hs
testsuite/tests/annotations/should_compile/all.T
testsuite/tests/annotations/should_compile/th/Makefile
testsuite/tests/annotations/should_compile/th/all.T
testsuite/tests/annotations/should_compile/th/annth.hs
testsuite/tests/annotations/should_run/all.T
testsuite/tests/cabal/cabal04/Makefile
testsuite/tests/cabal/cabal04/all.T
testsuite/tests/ghc-e/should_fail/all.T
testsuite/tests/ghc-e/should_run/all.T
testsuite/tests/ghci.debugger/scripts/all.T
testsuite/tests/ghci.debugger/scripts/break022/all.T
testsuite/tests/ghci.debugger/scripts/break023/all.T
testsuite/tests/ghci/scripts/all.T
testsuite/tests/ghci/should_fail/all.T
testsuite/tests/ghci/should_run/all.T
testsuite/tests/layout/all.T
testsuite/tests/overloadedrecflds/ghci/all.T
testsuite/tests/partial-sigs/should_compile/all.T
testsuite/tests/partial-sigs/should_fail/all.T
testsuite/tests/plugins/annotation-plugin/Makefile
testsuite/tests/plugins/rule-defining-plugin/Makefile
testsuite/tests/plugins/simple-plugin/Makefile
testsuite/tests/profiling/should_run/ioprof.prof.sample
testsuite/tests/profiling/should_run/ioprof.stderr
testsuite/tests/quasiquotation/qq007/Makefile
testsuite/tests/quasiquotation/qq007/test.T
testsuite/tests/quasiquotation/qq008/Makefile
testsuite/tests/quasiquotation/qq008/test.T
testsuite/tests/quasiquotation/qq009/Makefile
testsuite/tests/quasiquotation/qq009/test.T
testsuite/tests/runghc/all.T
testsuite/tests/th/Makefile
testsuite/tests/th/T2014/all.T
testsuite/tests/th/T4255.hs [deleted file]
testsuite/tests/th/T4255.stderr [deleted file]
testsuite/tests/th/TH_import_loop/TH_import_loop.T
testsuite/tests/th/all.T