summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2015-08-13 20:17:06 +0200
committerBen Gamari <ben@smart-cactus.org>2015-08-13 21:03:05 +0200
commitd2dd5af433be80464883735f133f3e4dea9c8bd4 (patch)
tree9d41192244875e69ec6ef6d6c3c8bfc5bac8fd20
parent8c5b087b85624092a76465b844dd74d220fcc417 (diff)
downloadhaskell-d2dd5af433be80464883735f133f3e4dea9c8bd4.tar.gz
DynFlags: Prohibit hpc and byte-code interpreter
The user's guide says hpc is incompatible with GHCi and #9903 would agree. Fixes #9903.
-rw-r--r--compiler/main/DynFlags.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 4f0bfc559b..5fa62b4541 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -4179,6 +4179,10 @@ makeDynFlagsConsistent dflags
else let dflags' = dflags { hscTarget = HscLlvm }
warn = "Compiler not unregisterised, so using LLVM rather than compiling via C"
in loop dflags' warn
+ | gopt Opt_Hpc dflags && hscTarget dflags == HscInterpreted
+ = let dflags' = gopt_unset dflags Opt_Hpc
+ warn = "Hpc can't be used with byte-code interpreter. Ignoring -fhpc."
+ in loop dflags' warn
| hscTarget dflags == HscAsm &&
platformUnregisterised (targetPlatform dflags)
= loop (dflags { hscTarget = HscC })