2 -- The above warning supression flag is a temporary kludge.
3 -- While working on this module you are encouraged to remove it and fix
4 -- any warnings in the module. See
5 -- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings
8 -----------------------------------------------------------------------------
10 -- Machine-specific parts of the register allocator
12 -- (c) The University of Glasgow 1996-2004
14 -----------------------------------------------------------------------------
44 #include "nativeGen/NCG.h"
45 #include "HsVersions.h"
53 import Constants ( rESERVED_C_STACK_BYTES )
59 #elif i386_TARGET_ARCH || x86_64_TARGET_ARCH
62 #elif powerpc_TARGET_ARCH
65 #elif sparc_TARGET_ARCH
71 -- Here because it knows about JumpDest
72 shortcutStatic :: (BlockId -> Maybe JumpDest) -> CmmStatic -> CmmStatic
73 shortcutStatic fn (CmmStaticLit (CmmLabel lab))
74 | Just uq <- maybeAsmTemp lab
75 = CmmStaticLit (CmmLabel (shortBlockId fn (BlockId uq)))
76 shortcutStatic fn (CmmStaticLit (CmmLabelDiffOff lbl1 lbl2 off))
77 | Just uq <- maybeAsmTemp lbl1
78 = CmmStaticLit (CmmLabelDiffOff (shortBlockId fn (BlockId uq)) lbl2 off)
79 -- slightly dodgy, we're ignoring the second label, but this
80 -- works with the way we use CmmLabelDiffOff for jump tables now.
81 shortcutStatic fn other_static
84 shortBlockId fn blockid@(BlockId uq) =
86 Nothing -> mkAsmTempLabel uq
87 Just (DestBlockId blockid') -> shortBlockId fn blockid'
88 Just (DestImm (ImmCLbl lbl)) -> lbl
89 _other -> panic "shortBlockId"