summaryrefslogtreecommitdiff
path: root/compiler/GHC/Driver
diff options
context:
space:
mode:
authorCarrieMY <carrie.xmy@gmail.com>2021-10-04 21:03:38 +0800
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-10-08 18:11:08 -0400
commit816d256114858d01c99503c10e3be86ecdb15173 (patch)
tree44ded885646734cbd185304eaaa0f855aa6df6e7 /compiler/GHC/Driver
parent1f160cd9c82c8cd21fbc733dc18c86a2abe3459f (diff)
downloadhaskell-816d256114858d01c99503c10e3be86ecdb15173.tar.gz
Fix -E -fno-code undesirable interactions #20439
Diffstat (limited to 'compiler/GHC/Driver')
-rw-r--r--compiler/GHC/Driver/Pipeline.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/GHC/Driver/Pipeline.hs b/compiler/GHC/Driver/Pipeline.hs
index 8362af9423..202043665c 100644
--- a/compiler/GHC/Driver/Pipeline.hs
+++ b/compiler/GHC/Driver/Pipeline.hs
@@ -530,11 +530,13 @@ compileFile hsc_env stop_phase (src, _mb_phase) = do
dflags = hsc_dflags hsc_env
mb_o_file = outputFile dflags
ghc_link = ghcLink dflags -- Set by -c or -no-link
-
+ notStopPreprocess | StopPreprocess <- stop_phase = False
+ | _ <- stop_phase = True
-- When linking, the -o argument refers to the linker's output.
-- otherwise, we use it as the name for the pipeline's output.
output
- | NoBackend <- backend dflags = NoOutputFile
+ | NoBackend <- backend dflags, notStopPreprocess = NoOutputFile
+ -- avoid -E -fno-code undesirable interactions. see #20439
| NoStop <- stop_phase, not (isNoLink ghc_link) = Persistent
-- -o foo applies to linker
| isJust mb_o_file = SpecificFile