X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FnativeGen%2FRegAllocLinear.hs;h=a9d8fc00cf2e38e98ed452ea427a52a412fae905;hb=8672676c20d5c9a268a8f07dc7aa706df4ca315f;hp=c3a731910256bcc5f6959bd3cb0660d00d8dcc1a;hpb=272f0ba89eca1d9fc700cf4c27b9f8c3e23d6fe8;p=ghc-hetmet.git diff --git a/compiler/nativeGen/RegAllocLinear.hs b/compiler/nativeGen/RegAllocLinear.hs index c3a7319..a9d8fc0 100644 --- a/compiler/nativeGen/RegAllocLinear.hs +++ b/compiler/nativeGen/RegAllocLinear.hs @@ -224,6 +224,7 @@ emptyStackMap = StackMap [0..maxSpillSlots] emptyUFM getStackSlotFor :: StackMap -> Unique -> (StackMap,Int) getStackSlotFor (StackMap [] _) _ = panic "RegAllocLinear.getStackSlotFor: out of stack slots" + getStackSlotFor fs@(StackMap (freeSlot:stack') reserved) reg = case lookupUFM reserved reg of Just slot -> (fs,slot) @@ -242,12 +243,12 @@ regAlloc (CmmData sec d) ( CmmData sec d , Nothing ) -regAlloc (CmmProc (LiveInfo info _ _) lbl params []) +regAlloc (CmmProc (LiveInfo info _ _) lbl params (ListGraph [])) = return - ( CmmProc info lbl params [] + ( CmmProc info lbl params (ListGraph []) , Nothing ) -regAlloc (CmmProc static lbl params comps) +regAlloc (CmmProc static lbl params (ListGraph comps)) | LiveInfo info (Just first_id) block_live <- static = do -- do register allocation on each component. @@ -263,7 +264,7 @@ regAlloc (CmmProc static lbl params comps) let ((first':_), rest') = partition ((== first_id) . blockId) final_blocks - return ( CmmProc info lbl params (first' : rest') + return ( CmmProc info lbl params (ListGraph (first' : rest')) , Just stats) -- bogus. to make non-exhaustive match warning go away. @@ -1111,7 +1112,7 @@ pprStats code statss #ifdef DEBUG my_fromJust s p Nothing = pprPanic ("fromJust: " ++ s) p -my_fromJust s p (Just x) = x +my_fromJust _ _ (Just x) = x #else my_fromJust _ _ = fromJust #endif