From b7b61f608b38752327aadfa9af8e9eb053a5942f Mon Sep 17 00:00:00 2001 From: sewardj Date: Mon, 17 Jan 2000 10:48:08 +0000 Subject: [PATCH] [project @ 2000-01-17 10:48:08 by sewardj] Print a couple of blank lines in final assembly output in between basic blocks, to make it easier to match up with the output of -ddump-stix. --- ghc/compiler/nativeGen/AsmCodeGen.lhs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ghc/compiler/nativeGen/AsmCodeGen.lhs b/ghc/compiler/nativeGen/AsmCodeGen.lhs index 4d1481c..73c2935 100644 --- a/ghc/compiler/nativeGen/AsmCodeGen.lhs +++ b/ghc/compiler/nativeGen/AsmCodeGen.lhs @@ -8,6 +8,7 @@ module AsmCodeGen ( nativeCodeGen ) where #include "HsVersions.h" import IO ( Handle ) +import List ( intersperse ) import MachMisc import MachRegs @@ -104,9 +105,10 @@ codeGen :: [[StixTree]] -> UniqSM SDoc codeGen stixFinal = mapUs genMachCode stixFinal `thenUs` \ dynamic_codes -> let - static_instrs = scheduleMachCode dynamic_codes + static_instrss = scheduleMachCode dynamic_codes + docs = map (vcat . map pprInstr) static_instrss in - returnUs (vcat (map pprInstr static_instrs)) + returnUs (vcat (intersperse (char ' ' $$ char ' ') docs)) \end{code} Top level code generator for a chunk of stix code: @@ -124,10 +126,10 @@ exposed via the OrdList, but more might occur, so further analysis might be needed. \begin{code} -scheduleMachCode :: [InstrList] -> [Instr] +scheduleMachCode :: [InstrList] -> [[Instr]] scheduleMachCode - = concat . map (runRegAllocate freeRegsState reservedRegs) + = map (runRegAllocate freeRegsState reservedRegs) where freeRegsState = mkMRegsState (extractMappedRegNos freeRegs) \end{code} -- 1.7.10.4