X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FnativeGen%2FX86%2FPpr.hs;h=7944a38ff4f7c6eb430d66d3b285e73fac1bb36f;hb=9c5838466769fb9d5fd2cc4cc677852fd798af03;hp=0ca230b0a32de36b202ac6349eb81d43f814b542;hpb=d9e0cfba383d8bbff5f5b7428a683cfdfb7b95b9;p=ghc-hetmet.git diff --git a/compiler/nativeGen/X86/Ppr.hs b/compiler/nativeGen/X86/Ppr.hs index 0ca230b..7944a38 100644 --- a/compiler/nativeGen/X86/Ppr.hs +++ b/compiler/nativeGen/X86/Ppr.hs @@ -32,16 +32,17 @@ import Reg import PprBase -import BlockId -import Cmm +import OldCmm import CLabel -import Unique ( pprUnique ) +import Config +import Unique ( pprUnique, Uniquable(..) ) import Pretty import FastString import qualified Outputable import Outputable (panic, Outputable) import Data.Word +import Distribution.System #if i386_TARGET_ARCH && darwin_TARGET_OS import Data.Bits @@ -55,9 +56,9 @@ pprNatCmmTop (CmmData section dats) = pprSectionHeader section $$ vcat (map pprData dats) -- special case for split markers: -pprNatCmmTop (CmmProc [] lbl _ (ListGraph [])) = pprLabel lbl +pprNatCmmTop (CmmProc [] lbl (ListGraph [])) = pprLabel lbl -pprNatCmmTop (CmmProc info lbl _ (ListGraph blocks)) = +pprNatCmmTop (CmmProc info lbl (ListGraph blocks)) = pprSectionHeader Text $$ (if null info then -- blocks guaranteed not null, so label needed pprLabel lbl @@ -89,8 +90,8 @@ pprNatCmmTop (CmmProc info lbl _ (ListGraph blocks)) = pprBasicBlock :: NatBasicBlock Instr -> Doc -pprBasicBlock (BasicBlock (BlockId id) instrs) = - pprLabel (mkAsmTempLabel id) $$ +pprBasicBlock (BasicBlock blockid instrs) = + pprLabel (mkAsmTempLabel (getUnique blockid)) $$ vcat (map pprInstr instrs) @@ -161,15 +162,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 @@ -621,9 +618,9 @@ pprInstr (CLTD II64) = ptext (sLit "\tcqto") pprInstr (SETCC cond op) = pprCondInstr (sLit "set") cond (pprOperand II8 op) -pprInstr (JXX cond (BlockId id)) +pprInstr (JXX cond blockid) = pprCondInstr (sLit "j") cond (pprCLabel_asm lab) - where lab = mkAsmTempLabel id + where lab = mkAsmTempLabel (getUnique blockid) pprInstr (JXX_GBL cond imm) = pprCondInstr (sLit "j") cond (pprImm imm)