blob: 03a4a65d6efbed1999849906a9f018520b51ebe4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -Wall #-}
module Main where
import System.Environment
import GHC
main :: IO ()
main = do
flags <- getArgs
runGhc' flags $ do
setTargets [Target (TargetFile "T10052-input.hs" Nothing) True Nothing]
_success <- load LoadAllTargets
return ()
runGhc' :: [String] -> Ghc a -> IO a
runGhc' args act = do
let libdir = head args
flags = map noLoc (tail args)
runGhc (Just libdir) $ do
dflags0 <- getSessionDynFlags
(dflags1, _leftover, _warns) <- parseDynamicFlags dflags0 flags
let dflags2 = dflags1 {
backend = Interpreter
, ghcLink = LinkInMemory
, verbosity = 1
}
_newPkgs <- setSessionDynFlags dflags2
act
|