ghc-7.4.2: The GHC API

Safe Haskell | Safe-Infered

Platform

Description

A description of the platform we're compiling for.

Synopsis

- data Platform = Platform {
  - platformArch :: Arch
  - platformOS :: OS
  - platformWordSize :: !Int
  - platformHasGnuNonexecStack :: Bool
  - platformHasSubsectionsViaSymbols :: Bool
  }
- data Arch
  - = ArchUnknown
  - | ArchX86
  - | ArchX86_64
  - | ArchPPC
  - | ArchPPC_64
  - | ArchSPARC
  - | ArchARM {
    - armISA :: ArmISA
    - armISAExt :: [ArmISAExt]
    }
- data OS
  - = OSUnknown
  - | OSLinux
  - | OSDarwin
  - | OSSolaris2
  - | OSMinGW32
  - | OSFreeBSD
  - | OSOpenBSD
  - | OSNetBSD
  - | OSKFreeBSD
  - | OSHaiku
- data ArmISA
  - = ARMv5
  - | ARMv6
  - | ARMv7
- data ArmISAExt
  - = VFPv2
  - | VFPv3
  - | VFPv3D16
  - | NEON
  - | IWMMX2
- target32Bit :: Platform -> Bool
- osElfTarget :: OS -> 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
platformHasGnuNonexecStack :: Bool
platformHasSubsectionsViaSymbols :: Bool

Instances

Eq Platform |
Read Platform |
Show Platform |

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 |
ArchSPARC |
ArchARM |

Fields

armISA :: ArmISA
armISAExt :: [ArmISAExt]

Instances

Eq Arch |
Read Arch |
Show Arch |

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 |
OSSolaris2 |
OSMinGW32 |
OSFreeBSD |
OSOpenBSD |
OSNetBSD |
OSKFreeBSD |
OSHaiku |

Instances

Eq OS |
Read OS |
Show OS |

data ArmISA

ARM Instruction Set Architecture and Extensions

Constructors

ARMv5 |
ARMv6 |
ARMv7 |

Instances

Eq ArmISA |
Read ArmISA |
Show ArmISA |

data ArmISAExt

Constructors

VFPv2 |
VFPv3 |
VFPv3D16 |
NEON |
IWMMX2 |

Instances

Eq ArmISAExt |
Read ArmISAExt |
Show ArmISAExt |

target32Bit :: Platform -> Bool

osElfTarget :: OS -> Bool

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