From: Ian Lynagh Date: Wed, 5 Jan 2011 18:30:11 +0000 (+0000) Subject: Replace a #if with a Haskell conditional X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=a056bcdea7901557f8c97f0da69ae194338e550d;p=ghc-hetmet.git Replace a #if with a Haskell conditional --- diff --git a/compiler/nativeGen/X86/Ppr.hs b/compiler/nativeGen/X86/Ppr.hs index 0ca230b..f26e2e6 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