cpp: Use #pragma once instead of #ifndef guards
[ghc.git] / includes / stg / RtsMachRegs.h
1 /* -----------------------------------------------------------------------------
2 *
3 * (c) The GHC Team, 1998-2011
4 *
5 * Registers used in STG code. Might or might not correspond to
6 * actual machine registers.
7 *
8 * Do not #include this file directly: #include "Rts.h" instead.
9 *
10 * To understand the structure of the RTS headers, see the wiki:
11 * http://ghc.haskell.org/trac/ghc/wiki/Commentary/SourceTree/Includes
12 *
13 * ---------------------------------------------------------------------------*/
14
15 #pragma once
16
17 #ifdef UnregisterisedCompiler
18 #ifndef NO_REGS
19 #define NO_REGS
20 #endif
21 #endif
22
23 /*
24 * Defining NO_REGS causes no global registers to be used. NO_REGS is
25 * typically defined by GHC, via a command-line option passed to gcc,
26 * when the -funregisterised flag is given.
27 *
28 * NB. When NO_REGS is on, calling & return conventions may be
29 * different. For example, all function arguments will be passed on
30 * the stack, and components of an unboxed tuple will be returned on
31 * the stack rather than in registers.
32 */
33 #ifdef NO_REGS
34
35 #define MACHREGS_NO_REGS 1
36
37 #else
38
39 #define MACHREGS_NO_REGS 0
40
41 #define MACHREGS_i386 i386_HOST_ARCH
42 #define MACHREGS_x86_64 x86_64_HOST_ARCH
43 #define MACHREGS_powerpc (powerpc_HOST_ARCH || powerpc64_HOST_ARCH \
44 || powerpc64le_HOST_ARCH || rs6000_HOST_ARCH)
45 #define MACHREGS_sparc sparc_HOST_ARCH
46 #define MACHREGS_arm arm_HOST_ARCH
47 #define MACHREGS_aarch64 aarch64_HOST_ARCH
48 #define MACHREGS_darwin darwin_HOST_OS
49
50 #endif
51
52 #include "MachRegs.h"