@@ -263,32 +263,37 @@ compile config@Config{mode,input,verbosity,backend,cfile} fp0 = do
263
263
let stM = passes config' l0
264
264
l4 <- evalStateT stM (CompileState {cnt= cnt0, result= initResult})
265
265
266
- if mode == Interp2
267
- then do
268
- error " TODO: Interp2"
269
- -- l4res <- execProg l4
270
- -- mapM_ (\(IntVal v) -> liftIO $ print v) l4res
271
- -- exitSuccess
272
- else do
273
- str <- case backend of
274
- C -> codegenProg config' l4
266
+ case mode of
267
+ Interp2 -> do
268
+ error " TODO: Interp2"
269
+ -- l4res <- execProg l4
270
+ -- mapM_ (\(IntVal v) -> liftIO $ print v) l4res
271
+ -- exitSuccess
272
+
273
+ ToSML -> return ()
274
+ ToMPLExe -> return ()
275
+ RunMPL -> return ()
275
276
277
+ _ -> do
278
+ str <- case backend of
279
+ C -> codegenProg config' l4
276
280
277
281
278
- LLVM -> error $ " Cannot execute through the LLVM backend. To build Gibbon with LLVM: "
279
- ++ " stack build --flag gibbon:llvm_enabled"
280
282
281
- -- The C code is long, so put this at a higher verbosity level.
282
- dbgPrint passChatterLvl $ " [compiler] Final C codegen: " ++ show (length str) ++ " characters."
283
- dbgPrintLn 4 $ sepline ++ " \n " ++ str
283
+ LLVM -> error $ " Cannot execute through the LLVM backend. To build Gibbon with LLVM: "
284
+ ++ " stack build --flag gibbon:llvm_enabled"
284
285
285
- clearFile outfile
286
- writeFile outfile str
286
+ -- The C code is long, so put this at a higher verbosity level.
287
+ dbgPrint passChatterLvl $ " [compiler] Final C codegen: " ++ show (length str) ++ " characters."
288
+ dbgPrintLn 4 $ sepline ++ " \n " ++ str
287
289
288
- -- (Stage 3) Code written, now compile if warranted.
289
- when (mode == ToExe || mode == RunExe || isBench mode ) $ do
290
- compileAndRunExe config fp >>= putStr
291
- return ()
290
+ clearFile outfile
291
+ writeFile outfile str
292
+
293
+ -- (Stage 3) Code written, now compile if warranted.
294
+ when (mode == ToExe || mode == RunExe || isBench mode ) $ do
295
+ compileAndRunExe config fp >>= putStr
296
+ return ()
292
297
293
298
runL0 :: L0. Prog0 -> IO ()
294
299
runL0 l0 = do
0 commit comments