Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
8245241e
Commit
8245241e
authored
Jun 14, 2001
by
simonmar
Browse files
[project @ 2001-06-14 11:46:55 by simonmar]
just move some code around.
parent
a30fbb32
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/compiler/main/DriverPipeline.hs
View file @
8245241e
-----------------------------------------------------------------------------
-- $Id: DriverPipeline.hs,v 1.7
6
2001/06/
08 20:09:43 sof
Exp $
-- $Id: DriverPipeline.hs,v 1.7
7
2001/06/
14 11:46:55 simonmar
Exp $
--
-- GHC Driver
--
...
...
@@ -194,8 +194,13 @@ genPipeline todo stop_flag persistent_output lang filename
|
otherwise
=
[ ]
-- just pass this file through to the linker
-- ToDo: this is somewhat cryptic
not_valid
=
throwDyn
(
UsageError
(
"invalid option combination"
))
stop_phase
=
case
todo
of
StopBefore
As
|
split
->
SplitAs
StopBefore
phase
->
phase
DoMkDependHS
->
Ln
DoLink
->
Ln
----------- ----- ---- --- -- -- - - -
-- this shouldn't happen.
...
...
@@ -204,6 +209,17 @@ genPipeline todo stop_flag persistent_output lang filename
++
filename
))
else
do
-- if we can't find the phase we're supposed to stop before,
-- something has gone wrong. This test carefully avoids the
-- case where we aren't supposed to do any compilation, because the file
-- is already in linkable form (for example).
if
start_phase
`
elem
`
pipeline
&&
(
stop_phase
/=
Ln
&&
stop_phase
`
notElem
`
pipeline
)
then
throwDyn
(
UsageError
(
"flag "
++
stop_flag
++
" is incompatible with source file `"
++
filename
++
"'"
))
else
do
let
-- .o and .hc suffixes can be overriden by command-line options:
myPhaseInputExt
Ln
|
Just
s
<-
osuf
=
s
...
...
@@ -235,28 +251,12 @@ genPipeline todo stop_flag persistent_output lang filename
-- the suffix on an output file is determined by the next phase
-- in the pipeline, so we add linking to the end of the pipeline
-- to force the output from the final phase to be a .o file.
stop_phase
=
case
todo
of
StopBefore
As
|
split
->
SplitAs
StopBefore
phase
->
phase
DoMkDependHS
->
Ln
DoLink
->
Ln
annotated_pipeline
=
annotatePipeline
(
pipeline
++
[
Ln
])
stop_phase
phase_ne
p
(
p1
,
_
,
_
)
=
(
p1
/=
p
)
----------- ----- ---- --- -- -- - - -
-- if we can't find the phase we're supposed to stop before,
-- something has gone wrong. This test carefully avoids the
-- case where we aren't supposed to do any compilation, because the file
-- is already in linkable form (for example).
if
start_phase
`
elem
`
pipeline
&&
(
stop_phase
/=
Ln
&&
stop_phase
`
notElem
`
pipeline
)
then
throwDyn
(
UsageError
(
"flag "
++
stop_flag
++
" is incompatible with source file `"
++
filename
++
"'"
))
else
do
return
(
takeWhile
(
phase_ne
stop_phase
)
$
dropWhile
(
phase_ne
start_phase
)
$
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment