module GHC.Driver.LlvmConfigCache
( LlvmConfigCache
, initLlvmConfigCache
, readLlvmConfigCache
)
where
import GHC.Prelude
import GHC.CmmToLlvm.Config
import System.IO.Unsafe
data LlvmConfigCache = LlvmConfigCache LlvmConfig
initLlvmConfigCache :: FilePath -> IO LlvmConfigCache
initLlvmConfigCache :: FilePath -> IO LlvmConfigCache
initLlvmConfigCache FilePath
top_dir = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ LlvmConfig -> LlvmConfigCache
LlvmConfigCache (forall a. IO a -> a
unsafePerformIO forall a b. (a -> b) -> a -> b
$ FilePath -> IO LlvmConfig
initLlvmConfig FilePath
top_dir)
readLlvmConfigCache :: LlvmConfigCache -> IO LlvmConfig
readLlvmConfigCache :: LlvmConfigCache -> IO LlvmConfig
readLlvmConfigCache (LlvmConfigCache !LlvmConfig
config) = forall (f :: * -> *) a. Applicative f => a -> f a
pure LlvmConfig
config