summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimonmar <unknown>2001-05-09 09:38:18 +0000
committersimonmar <unknown>2001-05-09 09:38:18 +0000
commit02edb7607692a5168b6636a100a27d2e4063b915 (patch)
tree57d05c80f5f499e7640c1ff8847e3d81efd26ef5
parent3738f22746c5619e00b4a26b38d6d2a98009b188 (diff)
downloadhaskell-02edb7607692a5168b6636a100a27d2e4063b915.tar.gz
[project @ 2001-05-09 09:38:18 by simonmar]
Add a new option: -hcsuf <suffix> which renames the .hc suffix to <suffix> for this compilation, in the same way as -osuf and -hisuf. To even things up, remove partial support for '-ohi -', which allegedly dumped the .hi file to stdout but in reality never worked. It's a strange thing to want to do anyway, but in any case you could always say '-ohi /dev/stdout', or even 'ghc Foo.hs && cat Foo.hi'.
-rw-r--r--ghc/compiler/main/DriverFlags.hs7
-rw-r--r--ghc/compiler/main/DriverPipeline.hs11
-rw-r--r--ghc/compiler/main/DriverState.hs13
3 files changed, 14 insertions, 17 deletions
diff --git a/ghc/compiler/main/DriverFlags.hs b/ghc/compiler/main/DriverFlags.hs
index ce024883e6..a22668ec87 100644
--- a/ghc/compiler/main/DriverFlags.hs
+++ b/ghc/compiler/main/DriverFlags.hs
@@ -1,7 +1,7 @@
{-# OPTIONS -#include "hschooks.h" #-}
-----------------------------------------------------------------------------
--- $Id: DriverFlags.hs,v 1.52 2001/03/29 18:40:09 rrt Exp $
+-- $Id: DriverFlags.hs,v 1.53 2001/05/09 09:38:18 simonmar Exp $
--
-- Driver flags
--
@@ -206,11 +206,10 @@ static_flags =
, ( "odir" , HasArg (writeIORef v_Output_dir . Just) )
, ( "o" , SepArg (writeIORef v_Output_file . Just) )
, ( "osuf" , HasArg (writeIORef v_Object_suf . Just) )
+ , ( "hcsuf" , HasArg (writeIORef v_HC_suf . Just) )
, ( "hisuf" , HasArg (writeIORef v_Hi_suf) )
, ( "tmpdir" , HasArg (writeIORef v_TmpDir . (++ "/")) )
- , ( "ohi" , HasArg (\s -> case s of
- "-" -> writeIORef v_Hi_on_stdout True
- _ -> writeIORef v_Output_hi (Just s)) )
+ , ( "ohi" , HasArg (writeIORef v_Output_hi . Just) )
-- -odump?
, ( "keep-hc-file" , AnySuffix (\_ -> writeIORef v_Keep_hc_files True) )
diff --git a/ghc/compiler/main/DriverPipeline.hs b/ghc/compiler/main/DriverPipeline.hs
index 2668c64edf..6e32929665 100644
--- a/ghc/compiler/main/DriverPipeline.hs
+++ b/ghc/compiler/main/DriverPipeline.hs
@@ -1,5 +1,5 @@
-----------------------------------------------------------------------------
--- $Id: DriverPipeline.hs,v 1.67 2001/05/08 11:07:30 simonmar Exp $
+-- $Id: DriverPipeline.hs,v 1.68 2001/05/09 09:38:18 simonmar Exp $
--
-- GHC Driver
--
@@ -152,6 +152,7 @@ genPipeline todo stop_flag persistent_output lang filename
writeIORef v_Object_suf (Just "ilx")
#endif
osuf <- readIORef v_Object_suf
+ hcsuf <- readIORef v_HC_suf
let
----------- ----- ---- --- -- -- - - -
@@ -209,10 +210,10 @@ genPipeline todo stop_flag persistent_output lang filename
else do
let
- ----------- ----- ---- --- -- -- - - -
- myPhaseInputExt Ln = case osuf of Nothing -> phaseInputExt Ln
- Just s -> s
- myPhaseInputExt other = phaseInputExt other
+ -- .o and .hc suffixes can be overriden by command-line options:
+ myPhaseInputExt Ln | Just s <- osuf = s
+ myPhaseInputExt HCc | Just s <- hcsuf = s
+ myPhaseInputExt other = phaseInputExt other
annotatePipeline
:: [Phase] -- raw pipeline
diff --git a/ghc/compiler/main/DriverState.hs b/ghc/compiler/main/DriverState.hs
index 522330e04f..8591f8a699 100644
--- a/ghc/compiler/main/DriverState.hs
+++ b/ghc/compiler/main/DriverState.hs
@@ -1,5 +1,5 @@
-----------------------------------------------------------------------------
--- $Id: DriverState.hs,v 1.37 2001/03/28 11:01:19 simonmar Exp $
+-- $Id: DriverState.hs,v 1.38 2001/05/09 09:38:18 simonmar Exp $
--
-- Settings for the driver
--
@@ -92,10 +92,13 @@ defaultHscLang
| otherwise = HscC
GLOBAL_VAR(v_Output_dir, Nothing, Maybe String)
-GLOBAL_VAR(v_Object_suf, Nothing, Maybe String)
GLOBAL_VAR(v_Output_file, Nothing, Maybe String)
GLOBAL_VAR(v_Output_hi, Nothing, Maybe String)
+GLOBAL_VAR(v_Object_suf, Nothing, Maybe String)
+GLOBAL_VAR(v_HC_suf, Nothing, Maybe String)
+GLOBAL_VAR(v_Hi_suf, "hi", String)
+
GLOBAL_VAR(v_Ld_inputs, [], [String])
odir_ify :: String -> IO String
@@ -113,12 +116,6 @@ osuf_ify f = do
Just s -> return (newsuf s f)
-----------------------------------------------------------------------------
--- Hi Files
-
-GLOBAL_VAR(v_Hi_on_stdout, False, Bool)
-GLOBAL_VAR(v_Hi_suf, "hi", String)
-
------------------------------------------------------------------------------
-- Compiler optimisation options
GLOBAL_VAR(v_OptLevel, 0, Int)