projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
NCG: Split out joinToTargets from linear alloctor into its own module.
[ghc-hetmet.git]
/
compiler
/
nativeGen
/
RegAlloc
/
Linear
/
Base.hs
diff --git
a/compiler/nativeGen/RegAlloc/Linear/Base.hs
b/compiler/nativeGen/RegAlloc/Linear/Base.hs
index
95c9965
..
a986c0f
100644
(file)
--- a/
compiler/nativeGen/RegAlloc/Linear/Base.hs
+++ b/
compiler/nativeGen/RegAlloc/Linear/Base.hs
@@
-3,7
+3,9
@@
module RegAlloc.Linear.Base (
BlockAssignment,
module RegAlloc.Linear.Base (
BlockAssignment,
+
Loc(..),
Loc(..),
+ regsOfLoc,
-- for stats
SpillReason(..),
-- for stats
SpillReason(..),
@@
-65,6
+67,13
@@
instance Outputable Loc where
ppr l = text (show l)
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.
--
-- | Reasons why instructions might be inserted by the spiller.
-- Used when generating stats for -ddrop-asm-stats.
--