ghc-8.2.2: The GHC API

Safe Haskell | Safe
Language | Haskell2010

Platform

Description

A description of the platform we're compiling for.

Synopsis

- data Platform = Platform {
  - platformArch :: Arch
  - platformOS :: OS
  - platformWordSize :: !Int
  - platformUnregisterised :: Bool
  - platformHasGnuNonexecStack :: Bool
  - platformHasIdentDirective :: Bool
  - platformHasSubsectionsViaSymbols :: Bool
  - platformIsCrossCompiling :: Bool
  }
- data Arch
  - = ArchUnknown
  - | ArchX86
  - | ArchX86_64
  - | ArchPPC
  - | ArchPPC_64 {
    - ppc_64ABI :: PPC_64ABI
    }
  - | ArchSPARC
  - | ArchSPARC64
  - | ArchARM {
    - armISA :: ArmISA
    - armISAExt :: [ArmISAExt]
    - armABI :: ArmABI
    }
  - | ArchARM64
  - | ArchAlpha
  - | ArchMipseb
  - | ArchMipsel
  - | ArchJavaScript
- data OS
  - = OSUnknown
  - | OSLinux
  - | OSDarwin
  - | OSiOS
  - | OSSolaris2
  - | OSMinGW32
  - | OSFreeBSD
  - | OSDragonFly
  - | OSOpenBSD
  - | OSNetBSD
  - | OSKFreeBSD
  - | OSHaiku
  - | OSQNXNTO
  - | OSAndroid
  - | OSAIX
- data ArmISA
  - = ARMv5
  - | ARMv6
  - | ARMv7
- data ArmISAExt
  - = VFPv2
  - | VFPv3
  - | VFPv3D16
  - | NEON
  - | IWMMX2
- data ArmABI
  - = SOFT
  - | SOFTFP
  - | HARD
- data PPC_64ABI
  - = ELF_V1
  - | ELF_V2
- target32Bit :: Platform -> Bool
- isARM :: Arch -> Bool
- osElfTarget :: OS -> Bool
- osMachOTarget :: OS -> Bool
- osSubsectionsViaSymbols :: OS -> Bool
- platformUsesFrameworks :: Platform -> Bool
- platformBinariesAreStaticLibs :: Platform -> Bool

# Documentation

data Platform #

Contains enough information for the native code generator to emit code for this platform.

Constructors

Platform |

Fields

- platformArch :: Arch
- platformOS :: OS
- platformWordSize :: !Int
- platformUnregisterised :: Bool
- platformHasGnuNonexecStack :: Bool
- platformHasIdentDirective :: Bool
- platformHasSubsectionsViaSymbols :: Bool
- platformIsCrossCompiling :: Bool

Instances

Eq Platform # |
Methods (==) :: Platform -> Platform -> Bool # (/=) :: Platform -> Platform -> Bool #
Read Platform # |
Methods readsPrec :: Int -> ReadS Platform Source # readList :: ReadS [Platform] Source # readPrec :: ReadPrec Platform Source # readListPrec :: ReadPrec [Platform] Source #
Show Platform # |
Methods showsPrec :: Int -> Platform -> ShowS Source # show :: Platform -> String Source # showList :: [Platform] -> ShowS Source #

data Arch #

Architectures that the native code generator knows about. TODO: It might be nice to extend these constructors with information about what instruction set extensions an architecture might support.

Constructors

ArchUnknown |
ArchX86 |
ArchX86_64 |
ArchPPC |
ArchPPC_64 |

Fields

- ppc_64ABI :: PPC_64ABI

ArchSPARC |
ArchSPARC64 |
ArchARM |

Fields

- armISA :: ArmISA
- armISAExt :: [ArmISAExt]
- armABI :: ArmABI

ArchARM64 |
ArchAlpha |
ArchMipseb |
ArchMipsel |
ArchJavaScript |

Instances

Eq Arch # |
Methods (==) :: Arch -> Arch -> Bool # (/=) :: Arch -> Arch -> Bool #
Read Arch # |
Methods readsPrec :: Int -> ReadS Arch Source # readList :: ReadS [Arch] Source # readPrec :: ReadPrec Arch Source # readListPrec :: ReadPrec [Arch] Source #
Show Arch # |
Methods showsPrec :: Int -> Arch -> ShowS Source # show :: Arch -> String Source # showList :: [Arch] -> ShowS Source #

data OS #

Operating systems that the native code generator knows about. Having OSUnknown should produce a sensible default, but no promises.

Constructors

OSUnknown |
OSLinux |
OSDarwin |
OSiOS |
OSSolaris2 |
OSMinGW32 |
OSFreeBSD |
OSDragonFly |
OSOpenBSD |
OSNetBSD |
OSKFreeBSD |
OSHaiku |
OSQNXNTO |
OSAndroid |
OSAIX |

Instances

Eq OS # |
Methods (==) :: OS -> OS -> Bool # (/=) :: OS -> OS -> Bool #
Read OS # |
Methods readsPrec :: Int -> ReadS OS Source # readList :: ReadS [OS] Source # readPrec :: ReadPrec OS Source # readListPrec :: ReadPrec [OS] Source #
Show OS # |
Methods showsPrec :: Int -> OS -> ShowS Source # show :: OS -> String Source # showList :: [OS] -> ShowS Source #

data ArmISA #

ARM Instruction Set Architecture, Extensions and ABI

Constructors

ARMv5 |
ARMv6 |
ARMv7 |

Instances

Eq ArmISA # |
Methods (==) :: ArmISA -> ArmISA -> Bool # (/=) :: ArmISA -> ArmISA -> Bool #
Read ArmISA # |
Methods readsPrec :: Int -> ReadS ArmISA Source # readList :: ReadS [ArmISA] Source # readPrec :: ReadPrec ArmISA Source # readListPrec :: ReadPrec [ArmISA] Source #
Show ArmISA # |
Methods showsPrec :: Int -> ArmISA -> ShowS Source # show :: ArmISA -> String Source # showList :: [ArmISA] -> ShowS Source #

data ArmISAExt #

Constructors

VFPv2 |
VFPv3 |
VFPv3D16 |
NEON |
IWMMX2 |

Instances

Eq ArmISAExt # |
Methods (==) :: ArmISAExt -> ArmISAExt -> Bool # (/=) :: ArmISAExt -> ArmISAExt -> Bool #
Read ArmISAExt # |
Methods readsPrec :: Int -> ReadS ArmISAExt Source # readList :: ReadS [ArmISAExt] Source # readPrec :: ReadPrec ArmISAExt Source # readListPrec :: ReadPrec [ArmISAExt] Source #
Show ArmISAExt # |
Methods showsPrec :: Int -> ArmISAExt -> ShowS Source # show :: ArmISAExt -> String Source # showList :: [ArmISAExt] -> ShowS Source #

data ArmABI #

Constructors

SOFT |
SOFTFP |
HARD |

Instances

Eq ArmABI # |
Methods (==) :: ArmABI -> ArmABI -> Bool # (/=) :: ArmABI -> ArmABI -> Bool #
Read ArmABI # |
Methods readsPrec :: Int -> ReadS ArmABI Source # readList :: ReadS [ArmABI] Source # readPrec :: ReadPrec ArmABI Source # readListPrec :: ReadPrec [ArmABI] Source #
Show ArmABI # |
Methods showsPrec :: Int -> ArmABI -> ShowS Source # show :: ArmABI -> String Source # showList :: [ArmABI] -> ShowS Source #

data PPC_64ABI #

PowerPC 64-bit ABI

Constructors

ELF_V1 |
ELF_V2 |

Instances

Eq PPC_64ABI # |
Methods (==) :: PPC_64ABI -> PPC_64ABI -> Bool # (/=) :: PPC_64ABI -> PPC_64ABI -> Bool #
Read PPC_64ABI # |
Methods readsPrec :: Int -> ReadS PPC_64ABI Source # readList :: ReadS [PPC_64ABI] Source # readPrec :: ReadPrec PPC_64ABI Source # readListPrec :: ReadPrec [PPC_64ABI] Source #
Show PPC_64ABI # |
Methods showsPrec :: Int -> PPC_64ABI -> ShowS Source # show :: PPC_64ABI -> String Source # showList :: [PPC_64ABI] -> ShowS Source #

target32Bit :: Platform -> Bool #

This predicate tells us whether the platform is 32-bit.

isARM :: Arch -> Bool #

osElfTarget :: OS -> Bool #

This predicate tells us whether the OS supports ELF-like shared libraries.

osMachOTarget :: OS -> Bool #

This predicate tells us whether the OS support Mach-O shared libraries.

osSubsectionsViaSymbols :: OS -> Bool #

platformUsesFrameworks :: Platform -> Bool #

platformBinariesAreStaticLibs :: Platform -> Bool #