X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FnativeGen%2FAsmCodeGen.lhs;h=0e05fb8f51dd6635992150e64fb0b729ee5c962a;hp=fa0ff890a85f313a1270a59cb0964030f5aa2c64;hb=9da4639011348fb6c318e3cba4b08622f811d9c4;hpb=ea0253067c7043854beee3f19dcfe8b4ecf2a0b3 diff --git a/compiler/nativeGen/AsmCodeGen.lhs b/compiler/nativeGen/AsmCodeGen.lhs index fa0ff89..0e05fb8 100644 --- a/compiler/nativeGen/AsmCodeGen.lhs +++ b/compiler/nativeGen/AsmCodeGen.lhs @@ -10,7 +10,7 @@ module AsmCodeGen ( nativeCodeGen ) where #include "HsVersions.h" -#include "NCG.h" +#include "nativeGen/NCG.h" import MachInstrs import MachRegs @@ -141,12 +141,14 @@ nativeCodeGen dflags cmms us -- stack so add the note in: Pretty.$$ Pretty.text ".section .note.GNU-stack,\"\",@progbits" #endif +#if !defined(darwin_TARGET_OS) -- And just because every other compiler does, lets stick in -- an identifier directive: .ident "GHC x.y.z" Pretty.$$ let compilerIdent = Pretty.text "GHC" Pretty.<+> Pretty.text cProjectVersion in Pretty.text ".ident" Pretty.<+> Pretty.doubleQuotes compilerIdent +#endif ) } @@ -309,17 +311,17 @@ reorder id accum (b@(block,id',out) : rest) genMachCode :: CmmTop -> UniqSM ([NatCmmTop], [CLabel]) -genMachCode cmm_top initial_us - = let initial_st = mkNatM_State initial_us 0 - (new_tops, final_st) = initNat initial_st (cmmTopCodeGen cmm_top) - final_us = natm_us final_st - final_delta = natm_delta final_st - final_imports = natm_imports final_st - in - if final_delta == 0 - then ((new_tops, final_imports), final_us) - else pprPanic "genMachCode: nonzero final delta" - (int final_delta) +genMachCode cmm_top + = do { initial_us <- getUs + ; let initial_st = mkNatM_State initial_us 0 + (new_tops, final_st) = initNat initial_st (cmmTopCodeGen cmm_top) + final_us = natm_us final_st + final_delta = natm_delta final_st + final_imports = natm_imports final_st + ; if final_delta == 0 + then return (new_tops, final_imports) + else pprPanic "genMachCode: nonzero final delta" (int final_delta) + } -- ----------------------------------------------------------------------------- -- Fixup assignments to global registers so that they assign to