From a056bcdea7901557f8c97f0da69ae194338e550d Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Wed, 5 Jan 2011 18:30:11 +0000 Subject: [PATCH] Replace a #if with a Haskell conditional --- compiler/nativeGen/X86/Ppr.hs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) 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 -- 1.7.10.4