diff options
author | Ian Lynagh <igloo@earth.li> | 2011-01-05 18:30:11 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2011-01-05 18:30:11 +0000 |
commit | a056bcdea7901557f8c97f0da69ae194338e550d (patch) | |
tree | f057437e567433c68f58442fd7a54d942e9f335c | |
parent | d9e0cfba383d8bbff5f5b7428a683cfdfb7b95b9 (diff) | |
download | haskell-a056bcdea7901557f8c97f0da69ae194338e550d.tar.gz |
Replace a #if with a Haskell conditional
-rw-r--r-- | compiler/nativeGen/X86/Ppr.hs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/compiler/nativeGen/X86/Ppr.hs b/compiler/nativeGen/X86/Ppr.hs index 0ca230b0a3..f26e2e6c08 100644 --- a/compiler/nativeGen/X86/Ppr.hs +++ b/compiler/nativeGen/X86/Ppr.hs @@ -35,6 +35,7 @@ import PprBase import BlockId import Cmm import CLabel +import Config import Unique ( pprUnique ) import Pretty import FastString @@ -42,6 +43,7 @@ import qualified Outputable import Outputable (panic, Outputable) import Data.Word +import Distribution.System #if i386_TARGET_ARCH && darwin_TARGET_OS import Data.Bits @@ -161,15 +163,11 @@ instance Outputable Instr where ppr instr = Outputable.docToSDoc $ pprInstr instr -#if i386_TARGET_ARCH || x86_64_TARGET_ARCH pprUserReg :: Reg -> Doc -pprUserReg = pprReg IF_ARCH_i386(II32,) IF_ARCH_x86_64(II64,) - -#else -pprUserReg :: Reg -> Doc -pprUserReg = panic "X86.Ppr.pprUserReg: not defined" - -#endif +pprUserReg + | cTargetArch == I386 = pprReg II32 + | cTargetArch == X86_64 = pprReg II64 + | otherwise = panic "X86.Ppr.pprUserReg: not defined" pprReg :: Size -> Reg -> Doc |