Unnec. -Onot to eval

This commit is contained in:
Don Stewart 2005-04-25 03:49:11 +00:00
parent 94f3eff3b7
commit 1930e846e4

View File

@ -1,6 +1,6 @@
{-# OPTIONS -fglasgow-exts -fffi #-} {-# OPTIONS -fglasgow-exts -fffi #-}
-- --
-- Copyright (C) 2004 Don Stewart - http://www.cse.unsw.edu.au/~dons -- Copyright (C) 2004-5 Don Stewart - http://www.cse.unsw.edu.au/~dons
-- --
-- This library is free software; you can redistribute it and/or -- This library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public -- modify it under the terms of the GNU Lesser General Public
@ -117,14 +117,14 @@ unsafeEval :: String -> [Import] -> IO (Maybe a)
unsafeEval src mods = do unsafeEval src mods = do
pwd <- getCurrentDirectory pwd <- getCurrentDirectory
tmpf <- mkUniqueWith wrap src mods tmpf <- mkUniqueWith wrap src mods
status <- make tmpf ["-Onot"] status <- make tmpf []
m_rsrc <- case status of m_rsrc <- case status of
MakeSuccess _ obj -> do MakeSuccess _ obj -> do
m_v <- load obj [pwd] [] symbol m_v <- load obj [pwd] [] symbol
case m_v of LoadFailure _ -> return Nothing case m_v of LoadFailure _ -> return Nothing
LoadSuccess _ rsrc -> return $ Just rsrc LoadSuccess _ rsrc -> return $ Just rsrc
MakeFailure err -> mapM_ putStrLn err >> return Nothing MakeFailure err -> mapM_ putStrLn err >> return Nothing
-- makeCleaner tmpf makeCleaner tmpf
return m_rsrc return m_rsrc
-- --
@ -143,7 +143,7 @@ unsafeEval_ :: String -- ^ code to compile
unsafeEval_ src mods args ldflags incs = do unsafeEval_ src mods args ldflags incs = do
pwd <- getCurrentDirectory pwd <- getCurrentDirectory
tmpf <- mkUniqueWith wrap src mods tmpf <- mkUniqueWith wrap src mods
status <- make tmpf $ ["-Onot"] ++ args status <- make tmpf args
e_rsrc <- case status of e_rsrc <- case status of
MakeSuccess _ obj -> do MakeSuccess _ obj -> do
m_v <- load obj (pwd:incs) ldflags symbol m_v <- load obj (pwd:incs) ldflags symbol