projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update submodule pointer
[ghc-hetmet.git]
/
compiler
/
basicTypes
/
Name.lhs
diff --git
a/compiler/basicTypes/Name.lhs
b/compiler/basicTypes/Name.lhs
index
1a8b8b3
..
aac7670
100644
(file)
--- a/
compiler/basicTypes/Name.lhs
+++ b/
compiler/basicTypes/Name.lhs
@@
-64,6
+64,7
@@
module Name (
getSrcLoc, getSrcSpan, getOccString,
pprInfixName, pprPrefixName, pprModulePrefix,
getSrcLoc, getSrcSpan, getOccString,
pprInfixName, pprPrefixName, pprModulePrefix,
+ getNameDepth, setNameDepth,
-- Re-export the OccName stuff
module OccName
-- Re-export the OccName stuff
module OccName
@@
-106,11
+107,18
@@
data Name = Name {
--(note later when changing Int# -> FastInt: is that still true about UNPACK?)
n_loc :: !SrcSpan -- Definition site
}
--(note later when changing Int# -> FastInt: is that still true about UNPACK?)
n_loc :: !SrcSpan -- Definition site
}
+ deriving Typeable
-- NOTE: we make the n_loc field strict to eliminate some potential
-- (and real!) space leaks, due to the fact that we don't look at
-- the SrcLoc in a Name all that often.
-- NOTE: we make the n_loc field strict to eliminate some potential
-- (and real!) space leaks, due to the fact that we don't look at
-- the SrcLoc in a Name all that often.
+setNameDepth :: Int -> Name -> Name
+setNameDepth depth name = name { n_occ = setOccNameDepth depth (n_occ name) }
+
+getNameDepth :: Name -> Int
+getNameDepth name = getOccNameDepth $ n_occ name
+
data NameSort
= External Module
data NameSort
= External Module
@@
-280,7
+288,7
@@
mkSystemVarName :: Unique -> FastString -> Name
mkSystemVarName uniq fs = mkSystemName uniq (mkVarOccFS fs)
mkSysTvName :: Unique -> FastString -> Name
mkSystemVarName uniq fs = mkSystemName uniq (mkVarOccFS fs)
mkSysTvName :: Unique -> FastString -> Name
-mkSysTvName uniq fs = mkSystemName uniq (mkOccNameFS tvName fs)
+mkSysTvName uniq fs = mkSystemName uniq (mkOccNameFS tvName fs)
-- | Make a name for a foreign call
mkFCallName :: Unique -> String -> Name
-- | Make a name for a foreign call
mkFCallName :: Unique -> String -> Name
@@
-363,8
+371,6
@@
instance Uniquable Name where
instance NamedThing Name where
getName n = n
instance NamedThing Name where
getName n = n
-INSTANCE_TYPEABLE0(Name,nameTc,"Name")
-
instance Data Name where
-- don't traverse?
toConstr _ = abstractConstr "Name"
instance Data Name where
-- don't traverse?
toConstr _ = abstractConstr "Name"