X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FbasicTypes%2FUnique.lhs;h=396feeab11879a781e014e7712c45fff89253646;hp=6e0ee20ead805d7163cc3ed95f596603c7204d09;hb=34c8d0312071f7d0f4d221a997d3408c653ef9e5;hpb=4623207393db41c970e713c326e9b54aa017dc3a diff --git a/compiler/basicTypes/Unique.lhs b/compiler/basicTypes/Unique.lhs index 6e0ee20..396feea 100644 --- a/compiler/basicTypes/Unique.lhs +++ b/compiler/basicTypes/Unique.lhs @@ -16,6 +16,7 @@ Some of the other hair in this code is to be able to use a Haskell). \begin{code} +{-# LANGUAGE BangPatterns #-} module Unique ( -- * Main data types Unique, Uniquable(..), @@ -368,9 +369,14 @@ mkRegSubUnique = mkUnique 'S' mkRegPairUnique = mkUnique 'P' mkRegClassUnique = mkUnique 'L' -mkVarOccUnique, mkDataOccUnique, mkTvOccUnique, mkTcOccUnique :: FastString -> Unique +mkVarOccUnique :: FastString -> Int -> Unique +mkVarOccUnique fs depth = + if depth > 255 + then error "FIXME: no support for syntactic depth > 255" + else mkUnique 'i' ((iBox (uniqueOfFS fs)) * 8 + depth ) + +mkDataOccUnique, mkTvOccUnique, mkTcOccUnique :: FastString -> Unique -- See Note [The Unique of an OccName] in OccName -mkVarOccUnique fs = mkUnique 'i' (iBox (uniqueOfFS fs)) mkDataOccUnique fs = mkUnique 'd' (iBox (uniqueOfFS fs)) mkTvOccUnique fs = mkUnique 'v' (iBox (uniqueOfFS fs)) mkTcOccUnique fs = mkUnique 'c' (iBox (uniqueOfFS fs))