X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=compiler%2FnativeGen%2FRegAlloc%2FLinear%2FBase.hs;h=a986c0ff32ec047102265c1305cbd36a0e193653;hb=a842f3d5e7c9026a642589948ef67dbaf6272396;hp=95c99653a88f5d4afb40f0965d0422d83511b484;hpb=cbc96da034482b769889c109f6cc822f42b12027;p=ghc-hetmet.git diff --git a/compiler/nativeGen/RegAlloc/Linear/Base.hs b/compiler/nativeGen/RegAlloc/Linear/Base.hs index 95c9965..a986c0f 100644 --- a/compiler/nativeGen/RegAlloc/Linear/Base.hs +++ b/compiler/nativeGen/RegAlloc/Linear/Base.hs @@ -3,7 +3,9 @@ module RegAlloc.Linear.Base ( BlockAssignment, + Loc(..), + regsOfLoc, -- for stats SpillReason(..), @@ -65,6 +67,13 @@ instance Outputable Loc where ppr l = text (show l) +-- | Get the reg numbers stored in this Loc. +regsOfLoc :: Loc -> [RegNo] +regsOfLoc (InReg r) = [r] +regsOfLoc (InBoth r _) = [r] +regsOfLoc (InMem _) = [] + + -- | Reasons why instructions might be inserted by the spiller. -- Used when generating stats for -ddrop-asm-stats. --