import DriverMkDepend
import DriverPhases
import DriverFlags
-import SysTools ( newTempName, addFilesToClean, getSysMan, unDosifyPath )
+import SysTools ( newTempName, addFilesToClean, getSysMan )
import qualified SysTools
import HscMain
import Finder
split <- readIORef v_Split_object_files
mangle <- readIORef v_Do_asm_mangling
keep_hc <- readIORef v_Keep_hc_files
+ keep_il <- readIORef v_Keep_il_files
keep_raw_s <- readIORef v_Keep_raw_s_files
keep_s <- readIORef v_Keep_s_files
osuf <- readIORef v_Object_suf
stop_phase = case todo of
StopBefore As | split -> SplitAs
+#ifdef ILX
+ | real_lang == HscILX -> Ilasm
+#endif
StopBefore phase -> phase
DoMkDependHS -> Ln
DoLink -> Ln
Mangle | keep_raw_s -> Persistent
As | keep_s -> Persistent
HCc | keep_hc -> Persistent
+#ifdef ILX
+ Ilasm | keep_il -> Persistent
+#endif
_other -> Temporary
-- add information about output files to the pipeline
run_phase Unlit _basename _suff input_fn output_fn
= do unlit_flags <- getOpts opt_L
- -- The -h option passes the file name for unlit to put in a #line directive;
- -- we undosify it so that it doesn't contain backslashes in Windows, which
- -- would disappear in error messages
+ -- The -h option passes the file name for unlit to put in a #line directive
SysTools.runUnlit (map SysTools.Option unlit_flags ++
[ SysTools.Option "-h"
, SysTools.Option input_fn
let dyn_flags' = dyn_flags { hscOutName = output_fn,
hscStubCOutName = basename ++ "_stub.c",
hscStubHOutName = basename ++ "_stub.h",
- extCoreName = basename ++ ".core" }
+ extCoreName = basename ++ ".hcr" }
-- run the compiler!
pcs <- initPersistentCompilerState
++ extra_ld_opts
++ if static && not no_hs_main then
[ "-u", prefixUnderscore "PrelMain_mainIO_closure",
- "-u", prefixUnderscore "__init_PrelMain"]
+ "-u", prefixUnderscore "__stginit_PrelMain"]
else []))
-- parallel only: move binary to another dir -- HWL
(basename, _) = splitFilename input_fn
keep_hc <- readIORef v_Keep_hc_files
+ keep_il <- readIORef v_Keep_il_files
keep_s <- readIORef v_Keep_s_files
output_fn <-
| otherwise -> newTempName (phaseInputExt HCc)
HscJava -> newTempName "java" -- ToDo
#ifdef ILX
- HscILX -> return (phaseInputExt Ilx2Il)
+ HscILX | keep_il -> return (basename ++ '.':phaseInputExt Ilasm)
+ | otherwise -> newTempName (phaseInputExt Ilx2Il)
#endif
HscInterpreted -> return (error "no output file")
HscNothing -> return (error "no output file")
let dyn_flags' = dyn_flags { hscOutName = output_fn,
hscStubCOutName = basename ++ "_stub.c",
hscStubHOutName = basename ++ "_stub.h",
- extCoreName = basename ++ ".core" }
+ extCoreName = basename ++ ".hcr" }
-- figure out which header files to #include in a generated .hc file
c_includes <- getPackageCIncludes