X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FnativeGen%2FAsmCodeGen.lhs;h=116c159ff2f86358c84f994355f13750940d7594;hb=119e76b23158f2fa37a65d018cadb7af0cbf2f9b;hp=3bc927799f899d0f1027e42883212f85bb654238;hpb=c4597dfe0b0de808b6e024b7d7e898e5ae14de19;p=ghc-hetmet.git diff --git a/compiler/nativeGen/AsmCodeGen.lhs b/compiler/nativeGen/AsmCodeGen.lhs index 3bc9277..116c159 100644 --- a/compiler/nativeGen/AsmCodeGen.lhs +++ b/compiler/nativeGen/AsmCodeGen.lhs @@ -39,6 +39,7 @@ import CLabel ( pprCLabel ) import ErrUtils ( dumpIfSet_dyn ) import DynFlags ( DynFlags, DynFlag(..), dopt ) import StaticFlags ( opt_Static, opt_PIC ) +import Config ( cProjectVersion ) import Digraph import qualified Pretty @@ -140,6 +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 ) } @@ -302,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