summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/RegAlloc/Liveness.hs
diff options
context:
space:
mode:
authorMax Bolingbroke <batterseapower@hotmail.com>2011-07-06 16:18:09 +0100
committerMax Bolingbroke <batterseapower@hotmail.com>2011-07-06 16:41:20 +0100
commit41ca0b8dcb91cf02f389b3d099c33fbdf009312c (patch)
tree29b35ed3623b47ce36f25ede3abd79eedeb84e6d /compiler/nativeGen/RegAlloc/Liveness.hs
parent43293b8c3210003c9e5b5b4a662f0fdb874353b7 (diff)
downloadhaskell-41ca0b8dcb91cf02f389b3d099c33fbdf009312c.tar.gz
Refactoring: explicitly mark whether we have an info table in RawCmm
I introduced this to support explicitly recording the info table label in RawCmm for another patch I am working on, but it turned out to lead to significant simplification in those parts of the compiler that consume RawCmm. Now, instead of lots of tests for null [CmmStatic] we have a simple test of a Maybe, and have reduced the number of guys that need to know how to convert entry->info labels by a TON. There are only 3 callers of that function now!
Diffstat (limited to 'compiler/nativeGen/RegAlloc/Liveness.hs')
-rw-r--r--compiler/nativeGen/RegAlloc/Liveness.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/nativeGen/RegAlloc/Liveness.hs b/compiler/nativeGen/RegAlloc/Liveness.hs
index a6a3724bfa..0f9220de8f 100644
--- a/compiler/nativeGen/RegAlloc/Liveness.hs
+++ b/compiler/nativeGen/RegAlloc/Liveness.hs
@@ -158,7 +158,7 @@ data Liveness
-- | Stash regs live on entry to each basic block in the info part of the cmm code.
data LiveInfo
= LiveInfo
- [CmmStatic] -- cmm static stuff
+ (Maybe CmmStatics) -- cmm info table static stuff
(Maybe BlockId) -- id of the first block
(Maybe (BlockMap RegSet)) -- argument locals live on entry to this block
(Map BlockId (Set Int)) -- stack slots live on entry to this block
@@ -212,8 +212,8 @@ instance Outputable instr
| otherwise = name <> (hcat $ punctuate space $ map ppr $ uniqSetToList regs)
instance Outputable LiveInfo where
- ppr (LiveInfo static firstId liveVRegsOnEntry liveSlotsOnEntry)
- = (vcat $ map ppr static)
+ ppr (LiveInfo mb_static firstId liveVRegsOnEntry liveSlotsOnEntry)
+ = (maybe empty ppr mb_static)
$$ text "# firstId = " <> ppr firstId
$$ text "# liveVRegsOnEntry = " <> ppr liveVRegsOnEntry
$$ text "# liveSlotsOnEntry = " <> text (show liveSlotsOnEntry)