Platform

ghc-7.0.4: The GHC API

Platform

Description

A description of the platform we're compiling for. Used by the native code generator. In the future, this module should be the only one that references the evil #defines for each TARGET_ARCH and TARGET_OS

Synopsis

- data Platform = Platform {
  - platformArch :: Arch
  - platformOS :: OS
  }
- data Arch
  - = ArchAlpha
  - | ArchX86
  - | ArchX86_64
  - | ArchPPC
  - | ArchPPC_64
  - | ArchSPARC
- data OS
  - = OSUnknown
  - | OSLinux
  - | OSDarwin
  - | OSSolaris2
  - | OSMinGW32
  - | OSFreeBSD
  - | OSOpenBSD
- defaultTargetPlatform :: Platform
- 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

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

ArchAlpha |
ArchX86 |
ArchX86_64 |
ArchPPC |
ArchPPC_64 |
ArchSPARC |

Instances

Eq 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 |

Instances

Eq OS |
Show OS |

defaultTargetPlatform :: Platform

This is the target platform as far as the #ifdefs are concerned. These are set in includes/ghcplatform.h by the autoconf scripts

osElfTarget :: OS -> Bool

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