-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Utility for managing GHC target toolchains
--   
--   Utility for managing GHC target toolchains
@package ghc-toolchain
@version 0.1.0.0


-- | A very simple Lens implementation
module GHC.Toolchain.Lens
data Lens a b
Lens :: (a -> b) -> (b -> a -> a) -> Lens a b
[view] :: Lens a b -> a -> b
[set] :: Lens a b -> b -> a -> a
(%) :: Lens a b -> Lens b c -> Lens a c
over :: Lens a b -> (b -> b) -> a -> a

-- | Append <tt>b</tt> to <tt>[b]</tt>
--   
--   Example usage: @<tt> cc &amp; _ccProgram % _prgFlags %++ "-U__i686"
--   </tt>@
(%++) :: Lens a [b] -> b -> a -> a
(&) :: a -> (a -> b) -> b

module GHC.Toolchain.Monad
data Env
Env :: Int -> Maybe String -> Bool -> Bool -> [String] -> Env
[verbosity] :: Env -> Int
[targetPrefix] :: Env -> Maybe String
[keepTemp] :: Env -> Bool
[canLocallyExecute] :: Env -> Bool
[logContexts] :: Env -> [String]
data M a
runM :: Env -> M a -> IO (Either [Error] a)
getEnv :: M Env
makeM :: IO (Either [Error] a) -> M a
throwE :: String -> M a

-- | Throw an error with multiple lines. This should be used rather than
--   `throwE . unlines` to preserve proper logging indentation.
throwEs :: [String] -> M a

-- | Branch on whether we can execute target code locally.
ifCrossCompiling :: M a -> M a -> M a
readFile :: FilePath -> M String
writeFile :: FilePath -> String -> M ()
appendFile :: FilePath -> String -> M ()

-- | Create an empty file.
createFile :: FilePath -> M ()
logInfo :: String -> M ()
logDebug :: String -> M ()
checking :: Show a => String -> M a -> M a
withLogContext :: String -> M a -> M a
instance GHC.Internal.Base.Alternative GHC.Toolchain.Monad.M
instance GHC.Internal.Base.Applicative GHC.Toolchain.Monad.M
instance GHC.Internal.Base.Functor GHC.Toolchain.Monad.M
instance GHC.Internal.Control.Monad.IO.Class.MonadIO GHC.Toolchain.Monad.M
instance GHC.Internal.Base.Monad GHC.Toolchain.Monad.M
instance GHC.Internal.Show.Show GHC.Toolchain.Monad.Error

module GHC.Toolchain.Prelude
($) :: (a -> b) -> a -> b
($!) :: (a -> b) -> a -> b
(++) :: [a] -> [a] -> [a]
(.) :: (b -> c) -> (a -> b) -> a -> c
(=<<) :: Monad m => (a -> m b) -> m a -> m b
asTypeOf :: a -> a -> a
const :: a -> b -> a
flip :: (a -> b -> c) -> b -> a -> c
id :: a -> a
map :: (a -> b) -> [a] -> [b]
otherwise :: Bool
until :: (a -> Bool) -> (a -> a) -> a -> a
(&&) :: Bool -> Bool -> Bool
not :: Bool -> Bool
(||) :: Bool -> Bool -> Bool
either :: (a -> c) -> (b -> c) -> Either a b -> c
all :: Foldable t => (a -> Bool) -> t a -> Bool
and :: Foldable t => t Bool -> Bool
any :: Foldable t => (a -> Bool) -> t a -> Bool
concat :: Foldable t => t [a] -> [a]
concatMap :: Foldable t => (a -> [b]) -> t a -> [b]
mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
notElem :: (Foldable t, Eq a) => a -> t a -> Bool
or :: Foldable t => t Bool -> Bool
sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
(<$>) :: Functor f => (a -> b) -> f a -> f b
maybe :: b -> (a -> b) -> Maybe a -> b
lines :: String -> [String]
unlines :: [String] -> String
unwords :: [String] -> String
words :: String -> [String]
curry :: ((a, b) -> c) -> a -> b -> c
fst :: (a, b) -> a
snd :: (a, b) -> b
uncurry :: (a -> b -> c) -> (a, b) -> c
error :: HasCallStack => [Char] -> a
errorWithoutStackTrace :: [Char] -> a
undefined :: HasCallStack => a
ioError :: HasCallStack => IOError -> IO a
userError :: String -> IOError
(!!) :: HasCallStack => [a] -> Int -> a
break :: (a -> Bool) -> [a] -> ([a], [a])
cycle :: HasCallStack => [a] -> [a]
drop :: Int -> [a] -> [a]
dropWhile :: (a -> Bool) -> [a] -> [a]
filter :: (a -> Bool) -> [a] -> [a]
head :: HasCallStack => [a] -> a
init :: HasCallStack => [a] -> [a]
iterate :: (a -> a) -> a -> [a]
last :: HasCallStack => [a] -> a
lookup :: Eq a => a -> [(a, b)] -> Maybe b
repeat :: a -> [a]
replicate :: Int -> a -> [a]
reverse :: [a] -> [a]
scanl :: (b -> a -> b) -> b -> [a] -> [b]
scanl1 :: (a -> a -> a) -> [a] -> [a]
scanr :: (a -> b -> b) -> b -> [a] -> [b]
scanr1 :: (a -> a -> a) -> [a] -> [a]
span :: (a -> Bool) -> [a] -> ([a], [a])
splitAt :: Int -> [a] -> ([a], [a])
tail :: HasCallStack => [a] -> [a]
take :: Int -> [a] -> [a]
takeWhile :: (a -> Bool) -> [a] -> [a]
unzip :: [(a, b)] -> ([a], [b])
unzip3 :: [(a, b, c)] -> ([a], [b], [c])
zip :: [a] -> [b] -> [(a, b)]
zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
subtract :: Num a => a -> a -> a
lex :: ReadS String
readParen :: Bool -> ReadS a -> ReadS a
(^) :: (Num a, Integral b) => a -> b -> a
(^^) :: (Fractional a, Integral b) => a -> b -> a
even :: Integral a => a -> Bool
fromIntegral :: (Integral a, Num b) => a -> b
gcd :: Integral a => a -> a -> a
lcm :: Integral a => a -> a -> a
odd :: Integral a => a -> Bool
realToFrac :: (Real a, Fractional b) => a -> b
showChar :: Char -> ShowS
showParen :: Bool -> ShowS -> ShowS
showString :: String -> ShowS
shows :: Show a => a -> ShowS
getChar :: IO Char
getContents :: IO String
getLine :: IO String
interact :: (String -> String) -> IO ()
print :: Show a => a -> IO ()
putChar :: Char -> IO ()
putStr :: String -> IO ()
putStrLn :: String -> IO ()
readIO :: Read a => String -> IO a
readLn :: Read a => IO a
read :: Read a => String -> a
reads :: Read a => ReadS a
seq :: a -> b -> b
class Functor f => Applicative (f :: Type -> Type)
pure :: Applicative f => a -> f a
(<*>) :: Applicative f => f (a -> b) -> f a -> f b
liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c
(*>) :: Applicative f => f a -> f b -> f b
(<*) :: Applicative f => f a -> f b -> f a
class Functor (f :: Type -> Type)
fmap :: Functor f => (a -> b) -> f a -> f b
(<$) :: Functor f => a -> f b -> f a
class Applicative m => Monad (m :: Type -> Type)
(>>=) :: Monad m => m a -> (a -> m b) -> m b
(>>) :: Monad m => m a -> m b -> m b
return :: Monad m => a -> m a
class Semigroup a => Monoid a
mempty :: Monoid a => a
mappend :: Monoid a => a -> a -> a
mconcat :: Monoid a => [a] -> a
class Semigroup a
(<>) :: Semigroup a => a -> a -> a
class Eq a
(==) :: Eq a => a -> a -> Bool
(/=) :: Eq a => a -> a -> Bool
class Eq a => Ord a
compare :: Ord a => a -> a -> Ordering
(<) :: Ord a => a -> a -> Bool
(<=) :: Ord a => a -> a -> Bool
(>) :: Ord a => a -> a -> Bool
(>=) :: Ord a => a -> a -> Bool
max :: Ord a => a -> a -> a
min :: Ord a => a -> a -> a
class Monad m => MonadFail (m :: Type -> Type)
fail :: (MonadFail m, HasCallStack) => String -> m a
data Either a b
Left :: a -> Either a b
Right :: b -> Either a b
class Foldable (t :: Type -> Type)
foldMap :: (Foldable t, Monoid m) => (a -> m) -> t a -> m
foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b
foldl :: Foldable t => (b -> a -> b) -> b -> t a -> b
foldl' :: Foldable t => (b -> a -> b) -> b -> t a -> b
foldr1 :: Foldable t => (a -> a -> a) -> t a -> a
foldl1 :: Foldable t => (a -> a -> a) -> t a -> a
null :: Foldable t => t a -> Bool
length :: Foldable t => t a -> Int
elem :: (Foldable t, Eq a) => a -> t a -> Bool
maximum :: (Foldable t, Ord a) => t a -> a
minimum :: (Foldable t, Ord a) => t a -> a
sum :: (Foldable t, Num a) => t a -> a
product :: (Foldable t, Num a) => t a -> a
class (Functor t, Foldable t) => Traversable (t :: Type -> Type)
traverse :: (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b)
sequenceA :: (Traversable t, Applicative f) => t (f a) -> f (t a)
mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)
sequence :: (Traversable t, Monad m) => t (m a) -> m (t a)
class Bounded a
minBound :: Bounded a => a
maxBound :: Bounded a => a
class Enum a
succ :: Enum a => a -> a
pred :: Enum a => a -> a
toEnum :: Enum a => Int -> a
fromEnum :: Enum a => a -> Int
enumFrom :: Enum a => a -> [a]
enumFromThen :: Enum a => a -> a -> [a]
enumFromTo :: Enum a => a -> a -> [a]
enumFromThenTo :: Enum a => a -> a -> a -> [a]
class Fractional a => Floating a
pi :: Floating a => a
exp :: Floating a => a -> a
log :: Floating a => a -> a
sqrt :: Floating a => a -> a
(**) :: Floating a => a -> a -> a
logBase :: Floating a => a -> a -> a
sin :: Floating a => a -> a
cos :: Floating a => a -> a
tan :: Floating a => a -> a
asin :: Floating a => a -> a
acos :: Floating a => a -> a
atan :: Floating a => a -> a
sinh :: Floating a => a -> a
cosh :: Floating a => a -> a
tanh :: Floating a => a -> a
asinh :: Floating a => a -> a
acosh :: Floating a => a -> a
atanh :: Floating a => a -> a
class (RealFrac a, Floating a) => RealFloat a
floatRadix :: RealFloat a => a -> Integer
floatDigits :: RealFloat a => a -> Int
floatRange :: RealFloat a => a -> (Int, Int)
decodeFloat :: RealFloat a => a -> (Integer, Int)
encodeFloat :: RealFloat a => Integer -> Int -> a
exponent :: RealFloat a => a -> Int
significand :: RealFloat a => a -> a
scaleFloat :: RealFloat a => Int -> a -> a
isNaN :: RealFloat a => a -> Bool
isInfinite :: RealFloat a => a -> Bool
isDenormalized :: RealFloat a => a -> Bool
isNegativeZero :: RealFloat a => a -> Bool
isIEEE :: RealFloat a => a -> Bool
atan2 :: RealFloat a => a -> a -> a
type FilePath = String
type IOError = IOException
class Num a
(+) :: Num a => a -> a -> a
(-) :: Num a => a -> a -> a
(*) :: Num a => a -> a -> a
negate :: Num a => a -> a
abs :: Num a => a -> a
signum :: Num a => a -> a
fromInteger :: Num a => Integer -> a
class Read a
readsPrec :: Read a => Int -> ReadS a
readList :: Read a => ReadS [a]
class Num a => Fractional a
(/) :: Fractional a => a -> a -> a
recip :: Fractional a => a -> a
fromRational :: Fractional a => Rational -> a
class (Real a, Enum a) => Integral a
quot :: Integral a => a -> a -> a
rem :: Integral a => a -> a -> a
div :: Integral a => a -> a -> a
mod :: Integral a => a -> a -> a
quotRem :: Integral a => a -> a -> (a, a)
divMod :: Integral a => a -> a -> (a, a)
toInteger :: Integral a => a -> Integer
type Rational = Ratio Integer
class (Num a, Ord a) => Real a
toRational :: Real a => a -> Rational
class (Real a, Fractional a) => RealFrac a
properFraction :: (RealFrac a, Integral b) => a -> (b, a)
truncate :: (RealFrac a, Integral b) => a -> b
round :: (RealFrac a, Integral b) => a -> b
ceiling :: (RealFrac a, Integral b) => a -> b
floor :: (RealFrac a, Integral b) => a -> b
class Show a
showsPrec :: Show a => Int -> a -> ShowS
show :: Show a => a -> String
showList :: Show a => [a] -> ShowS
type ShowS = String -> String
type ReadS a = String -> [(a, String)]
data IO a
data Ordering
LT :: Ordering
EQ :: Ordering
GT :: Ordering
type String = [Char]
data Integer
data Maybe a
Nothing :: Maybe a
Just :: a -> Maybe a
data Bool
False :: Bool
True :: Bool
data Char
data Double
data Float
data Int
data Word
class a ~# b => (a :: k) ~ (b :: k)
(<|>) :: Alternative f => f a -> f a -> f a

module GHC.Toolchain.Utils
expectJust :: String -> Maybe a -> M a
expectFileExists :: FilePath -> String -> M ()
withTempDir :: (FilePath -> M a) -> M a
oneOf :: String -> [M b] -> M b

-- | Like <a>oneOf</a> but takes a multi-line error message if none of the
--   checks succeed.
oneOf' :: [String] -> [M b] -> M b
isSuccess :: ExitCode -> Bool

module GHC.Toolchain.Program
data Program
Program :: FilePath -> [String] -> Program
[prgPath] :: Program -> FilePath
[prgFlags] :: Program -> [String]
shProgram :: Program
_prgPath :: Lens Program FilePath
_prgFlags :: Lens Program [String]

-- | Prepends a flag to a program's flags if the flag is not in the
--   existing flags.
addFlagIfNew :: String -> Program -> Program
runProgram :: Program -> [String] -> M ExitCode
callProgram :: Program -> [String] -> M ()

-- | Runs a program with a list of arguments and returns the exit code and
--   the stdout and stderr output
readProgram :: Program -> [String] -> M (ExitCode, String, String)

-- | Runs a program with a list of arguments and returns the stdout output,
--   ignoring the exit code.
readProgramStdout :: Program -> [String] -> M String

-- | Program specifier from the command-line.
data ProgOpt
ProgOpt :: Maybe String -> Maybe [String] -> ProgOpt

-- | Refers to the path to an executable, or simply the executable name.
[poPath] :: ProgOpt -> Maybe String
[poFlags] :: ProgOpt -> Maybe [String]
emptyProgOpt :: ProgOpt

-- | Make a <tt><a>Program</a></tt> from user specified program options
--   (<tt><a>ProgOpt</a></tt>), defaulting to the given path and flags if
--   unspecified in the <tt><a>ProgOpt</a></tt>.
programFromOpt :: ProgOpt -> FilePath -> [String] -> Program
_poPath :: Lens ProgOpt (Maybe FilePath)
_poFlags :: Lens ProgOpt (Maybe [String])

-- | Tries to find the user specified program by path or tries to look for
--   one in the given list of candidates.
--   
--   If the <a>ProgOpt</a> program flags are unspecified the program will
--   have an empty list of flags.
findProgram :: String -> ProgOpt -> [FilePath] -> M Program

-- | Compile a program with a given compiler.
--   
--   The compiler must * Take the program path as a positional argument *
--   Accept <tt>-o</tt> to specify output path
compile :: FilePath -> [String] -> Lens compiler Program -> compiler -> FilePath -> String -> M ()

-- | Does compiler program support the <tt>--target=<a>triple</a></tt>
--   option? If so, we should pass it whenever possible to avoid ambiguity
--   and potential compile-time errors (e.g. see #20162).
supportsTarget :: ArchOS -> Lens compiler Program -> (compiler -> M ()) -> String -> compiler -> M compiler
instance GHC.Internal.Classes.Eq GHC.Toolchain.Program.Program
instance GHC.Internal.Classes.Ord GHC.Toolchain.Program.Program
instance GHC.Internal.Read.Read GHC.Toolchain.Program.Program
instance GHC.Internal.Show.Show GHC.Toolchain.Program.Program

module GHC.Toolchain.Tools.Readelf
newtype Readelf
Readelf :: Program -> Readelf
[readelfProgram] :: Readelf -> Program

-- | Readelf is only needed by <a>checkBfdCopyBug</a>.
findReadelf :: ProgOpt -> M Readelf
instance GHC.Internal.Read.Read GHC.Toolchain.Tools.Readelf.Readelf
instance GHC.Internal.Show.Show GHC.Toolchain.Tools.Readelf.Readelf

module GHC.Toolchain.Tools.Ranlib
newtype Ranlib
Ranlib :: Program -> Ranlib
[ranlibProgram] :: Ranlib -> Program
findRanlib :: ProgOpt -> M Ranlib
instance GHC.Internal.Classes.Eq GHC.Toolchain.Tools.Ranlib.Ranlib
instance GHC.Internal.Classes.Ord GHC.Toolchain.Tools.Ranlib.Ranlib
instance GHC.Internal.Read.Read GHC.Toolchain.Tools.Ranlib.Ranlib
instance GHC.Internal.Show.Show GHC.Toolchain.Tools.Ranlib.Ranlib

module GHC.Toolchain.Tools.Nm
newtype Nm
Nm :: Program -> Nm
[nmProgram] :: Nm -> Program
findNm :: ProgOpt -> M Nm
instance GHC.Internal.Classes.Eq GHC.Toolchain.Tools.Nm.Nm
instance GHC.Internal.Classes.Ord GHC.Toolchain.Tools.Nm.Nm
instance GHC.Internal.Read.Read GHC.Toolchain.Tools.Nm.Nm
instance GHC.Internal.Show.Show GHC.Toolchain.Tools.Nm.Nm

module GHC.Toolchain.Tools.Cxx
newtype Cxx
Cxx :: Program -> Cxx
[cxxProgram] :: Cxx -> Program
findCxx :: ArchOS -> String -> ProgOpt -> M Cxx
compileCxx :: Cxx -> FilePath -> String -> M ()
instance GHC.Internal.Classes.Eq GHC.Toolchain.Tools.Cxx.Cxx
instance GHC.Internal.Classes.Ord GHC.Toolchain.Tools.Cxx.Cxx
instance GHC.Internal.Read.Read GHC.Toolchain.Tools.Cxx.Cxx
instance GHC.Internal.Show.Show GHC.Toolchain.Tools.Cxx.Cxx

module GHC.Toolchain.Tools.Cc
newtype Cc
Cc :: Program -> Cc
[ccProgram] :: Cc -> Program
_ccProgram :: Lens Cc Program
findBasicCc :: ProgOpt -> M Cc
findCc :: ArchOS -> String -> ProgOpt -> M Cc

-- | Preprocess the given program.
preprocess :: Cc -> String -> M String

-- | Compile a C source file to object code.
compileC :: Cc -> FilePath -> String -> M ()

-- | Compile an assembler source file to object code.
compileAsm :: Cc -> FilePath -> String -> M ()

-- | Add various platform-dependent compiler flags needed by GHC. We can't
--   do this in <a>findCc</a> since we need a <tt>Cc</tt> to determine the
--   <a>ArchOS</a>.
addPlatformDepCcFlags :: ArchOS -> Cc -> M Cc
checkC99Support :: Cc -> M Cc
instance GHC.Internal.Classes.Eq GHC.Toolchain.Tools.Cc.Cc
instance GHC.Internal.Classes.Ord GHC.Toolchain.Tools.Cc.Cc
instance GHC.Internal.Read.Read GHC.Toolchain.Tools.Cc.Cc
instance GHC.Internal.Show.Show GHC.Toolchain.Tools.Cc.Cc

module GHC.Toolchain.Tools.Link

-- | Configuration on how the C compiler can be used to link
data CcLink
CcLink :: Program -> Bool -> Bool -> Bool -> Bool -> Bool -> CcLink
[ccLinkProgram] :: CcLink -> Program
[ccLinkSupportsNoPie] :: CcLink -> Bool
[ccLinkSupportsCompactUnwind] :: CcLink -> Bool
[ccLinkSupportsFilelist] :: CcLink -> Bool
[ccLinkSupportsSingleModule] :: CcLink -> Bool
[ccLinkIsGnu] :: CcLink -> Bool
findCcLink :: String -> ProgOpt -> ProgOpt -> Bool -> ArchOS -> Cc -> Maybe Readelf -> M CcLink
instance GHC.Internal.Classes.Eq GHC.Toolchain.Tools.Link.CcLink
instance GHC.Internal.Classes.Ord GHC.Toolchain.Tools.Link.CcLink
instance GHC.Internal.Read.Read GHC.Toolchain.Tools.Link.CcLink
instance GHC.Internal.Show.Show GHC.Toolchain.Tools.Link.CcLink

module GHC.Toolchain.Tools.MergeObjs

-- | Configuration on how the C compiler can be used to link
data MergeObjs
MergeObjs :: Program -> Bool -> MergeObjs
[mergeObjsProgram] :: MergeObjs -> Program
[mergeObjsSupportsResponseFiles] :: MergeObjs -> Bool
findMergeObjs :: ProgOpt -> Cc -> CcLink -> Nm -> M MergeObjs
instance GHC.Internal.Classes.Eq GHC.Toolchain.Tools.MergeObjs.MergeObjs
instance GHC.Internal.Classes.Ord GHC.Toolchain.Tools.MergeObjs.MergeObjs
instance GHC.Internal.Read.Read GHC.Toolchain.Tools.MergeObjs.MergeObjs
instance GHC.Internal.Show.Show GHC.Toolchain.Tools.MergeObjs.MergeObjs

module GHC.Toolchain.Tools.Cpp
newtype HsCpp
HsCpp :: Program -> HsCpp
[hsCppProgram] :: HsCpp -> Program
findHsCpp :: ProgOpt -> Cc -> M HsCpp
newtype Cpp
Cpp :: Program -> Cpp
[cppProgram] :: Cpp -> Program
findCpp :: ProgOpt -> Cc -> M Cpp
newtype JsCpp
JsCpp :: Program -> JsCpp
[jsCppProgram] :: JsCpp -> Program
findJsCpp :: ProgOpt -> Cc -> M JsCpp
data CmmCpp
CmmCpp :: Program -> Bool -> CmmCpp
[cmmCppProgram] :: CmmCpp -> Program

-- | Whether the C-- preprocessor supports -g0. Extracted out as -g0 needs
--   to be appended to the complete invocation, rather than prefix flags,
--   in order to override other flags.
[cmmCppSupportsG0] :: CmmCpp -> Bool
findCmmCpp :: ProgOpt -> Cc -> M CmmCpp
instance GHC.Internal.Classes.Eq GHC.Toolchain.Tools.Cpp.CmmCpp
instance GHC.Internal.Classes.Eq GHC.Toolchain.Tools.Cpp.Cpp
instance GHC.Internal.Classes.Eq GHC.Toolchain.Tools.Cpp.HsCpp
instance GHC.Internal.Classes.Eq GHC.Toolchain.Tools.Cpp.JsCpp
instance GHC.Internal.Classes.Ord GHC.Toolchain.Tools.Cpp.CmmCpp
instance GHC.Internal.Classes.Ord GHC.Toolchain.Tools.Cpp.Cpp
instance GHC.Internal.Classes.Ord GHC.Toolchain.Tools.Cpp.HsCpp
instance GHC.Internal.Classes.Ord GHC.Toolchain.Tools.Cpp.JsCpp
instance GHC.Internal.Read.Read GHC.Toolchain.Tools.Cpp.CmmCpp
instance GHC.Internal.Read.Read GHC.Toolchain.Tools.Cpp.Cpp
instance GHC.Internal.Read.Read GHC.Toolchain.Tools.Cpp.HsCpp
instance GHC.Internal.Read.Read GHC.Toolchain.Tools.Cpp.JsCpp
instance GHC.Internal.Show.Show GHC.Toolchain.Tools.Cpp.CmmCpp
instance GHC.Internal.Show.Show GHC.Toolchain.Tools.Cpp.Cpp
instance GHC.Internal.Show.Show GHC.Toolchain.Tools.Cpp.HsCpp
instance GHC.Internal.Show.Show GHC.Toolchain.Tools.Cpp.JsCpp

module GHC.Toolchain.CheckArm

-- | Awkwardly, ARM triples sometimes contain insufficient information
--   about the platform. Consequently we instead extract this information
--   from the toolchain.
findArmIsa :: Cc -> M Arch

module GHC.Toolchain.ParseTriple

-- | Parse a triple `arch-vendor-os` into an <a>ArchOS</a> and a vendor
--   name <a>String</a>
--   
--   If the user specified a duple (`arch-os`) instead, the vendor name is
--   <a>Nothing</a>
parseTriple :: Cc -> String -> M (ArchOS, Maybe String)

module GHC.Toolchain.Tools.Ar
data Ar
Ar :: Program -> Bool -> Bool -> Bool -> Bool -> Ar
[arMkArchive] :: Ar -> Program
[arIsGnu] :: Ar -> Bool
[arSupportsAtFile] :: Ar -> Bool
[arSupportsDashL] :: Ar -> Bool
[arNeedsRanlib] :: Ar -> Bool
findAr :: Maybe String -> ProgOpt -> M Ar
instance GHC.Internal.Classes.Eq GHC.Toolchain.Tools.Ar.Ar
instance GHC.Internal.Classes.Ord GHC.Toolchain.Tools.Ar.Ar
instance GHC.Internal.Read.Read GHC.Toolchain.Tools.Ar.Ar
instance GHC.Internal.Show.Show GHC.Toolchain.Tools.Ar.Ar

module GHC.Toolchain.Target
data WordSize
WS4 :: WordSize
WS8 :: WordSize
data Endianness
LittleEndian :: Endianness
BigEndian :: Endianness

-- | A <a>Target</a> consists of:
--   
--   <ul>
--   <li>a target architecture and operating system</li>
--   <li>various bits of information about the platform</li>
--   <li>various toolchain components targetting that platform</li>
--   </ul>
data Target
Target :: ArchOS -> Maybe String -> Bool -> Bool -> Bool -> Bool -> WordSize -> Endianness -> Bool -> String -> Bool -> Bool -> Bool -> Cc -> Cxx -> Cpp -> HsCpp -> Maybe JsCpp -> CmmCpp -> CcLink -> Ar -> Maybe Ranlib -> Nm -> Maybe MergeObjs -> Maybe Program -> Maybe Program -> Maybe Program -> Maybe Program -> Maybe Program -> Maybe Program -> Target
[tgtArchOs] :: Target -> ArchOS

-- | This is the vendor component of the triple, the other two components
--   are found in <tt><a>tgtArchOs</a></tt>
[tgtVendor] :: Target -> Maybe String
[tgtLocallyExecutable] :: Target -> Bool
[tgtSupportsGnuNonexecStack] :: Target -> Bool
[tgtSupportsSubsectionsViaSymbols] :: Target -> Bool
[tgtSupportsIdentDirective] :: Target -> Bool
[tgtWordSize] :: Target -> WordSize
[tgtEndianness] :: Target -> Endianness
[tgtSymbolsHaveLeadingUnderscore] :: Target -> Bool
[tgtLlvmTarget] :: Target -> String
[tgtUnregisterised] :: Target -> Bool
[tgtTablesNextToCode] :: Target -> Bool

-- | We need to know whether or not to include libffi headers, and generate
--   additional code for it
[tgtUseLibffiForAdjustors] :: Target -> Bool
[tgtCCompiler] :: Target -> Cc
[tgtCxxCompiler] :: Target -> Cxx
[tgtCPreprocessor] :: Target -> Cpp
[tgtHsCPreprocessor] :: Target -> HsCpp
[tgtJsCPreprocessor] :: Target -> Maybe JsCpp

-- | We set it only in javascript target
[tgtCmmCPreprocessor] :: Target -> CmmCpp
[tgtCCompilerLink] :: Target -> CcLink
[tgtAr] :: Target -> Ar

-- | N.B. Most <tt>ar</tt> implementations will add an index by default
--   without <tt>ranlib</tt> so this is often optional
[tgtRanlib] :: Target -> Maybe Ranlib
[tgtNm] :: Target -> Nm

-- | We don't need a merge objects tool if we <tt>Ar</tt> supports
--   <tt>-L</tt>
[tgtMergeObjs] :: Target -> Maybe MergeObjs
[tgtLlc] :: Target -> Maybe Program
[tgtOpt] :: Target -> Maybe Program

-- | assembler used to assemble LLVM backend output; typically
--   <tt>clang</tt>
[tgtLlvmAs] :: Target -> Maybe Program
[tgtWindres] :: Target -> Maybe Program
[tgtOtool] :: Target -> Maybe Program
[tgtInstallNameTool] :: Target -> Maybe Program

-- | The word size as an integer representing the number of bytes
wordSize2Bytes :: WordSize -> Int

-- | Reconstruct the platform triple from a toolchain target (specifically
--   from tgtArchOs and tgtVendor)
targetPlatformTriple :: Target -> String
instance GHC.Internal.Classes.Eq GHC.Toolchain.Target.Endianness
instance GHC.Internal.Classes.Eq GHC.Toolchain.Target.Target
instance GHC.Internal.Classes.Eq GHC.Toolchain.Target.WordSize
instance GHC.Internal.Classes.Ord GHC.Toolchain.Target.Endianness
instance GHC.Internal.Classes.Ord GHC.Toolchain.Target.Target
instance GHC.Internal.Classes.Ord GHC.Toolchain.Target.WordSize
instance GHC.Internal.Read.Read GHC.Toolchain.Target.Endianness
instance GHC.Internal.Read.Read GHC.Toolchain.Target.Target
instance GHC.Internal.Read.Read GHC.Toolchain.Target.WordSize
instance GHC.Internal.Show.Show GHC.Toolchain.Target.Endianness
instance GHC.Internal.Show.Show GHC.Toolchain.Target.Target
instance GHC.Internal.Show.Show GHC.Toolchain.Target.WordSize

module GHC.Toolchain

module GHC.Toolchain.NormaliseTriple

-- | Normalise the triple by calling `config.sub` on the given triple.
normaliseTriple :: String -> M String

module GHC.Toolchain.PlatformDetails
checkWordSize :: Cc -> M WordSize
checkEndianness :: Cc -> M Endianness
checkLeadingUnderscore :: Cc -> Nm -> M Bool
checkSubsectionsViaSymbols :: ArchOS -> Cc -> M Bool
checkIdentDirective :: Cc -> M Bool
checkGnuNonexecStack :: ArchOS -> Cc -> M Bool
