X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FbasicTypes%2FLiteral.lhs;h=e83ea9db74e006ea9b6e9305f8678d7c648074e9;hb=9d7da331989abcd1844e9d03b8d1e4163796fa85;hp=5a3608bb3ed9713eda501967022d0a2d822dba81;hpb=23f40f0e9be6d4aa5cf9ea31d73f4013f8e7b4bd;p=ghc-hetmet.git diff --git a/ghc/compiler/basicTypes/Literal.lhs b/ghc/compiler/basicTypes/Literal.lhs index 5a3608b..e83ea9d 100644 --- a/ghc/compiler/basicTypes/Literal.lhs +++ b/ghc/compiler/basicTypes/Literal.lhs @@ -7,14 +7,14 @@ module Literal ( Literal(..) -- Exported to ParseIface , mkMachInt, mkMachWord - , mkMachInt64, mkMachWord64, mkStringLit, + , mkMachInt64, mkMachWord64, mkStringLit , litSize , litIsDupable, litIsTrivial - , literalType, + , literalType , hashLiteral , inIntRange, inWordRange, tARGET_MAX_INT, inCharRange - , isZeroLit, + , isZeroLit , word2IntLit, int2WordLit , narrow8IntLit, narrow16IntLit, narrow32IntLit @@ -35,7 +35,6 @@ import FastTypes import FastString import Binary -import UnicodeUtil ( stringToUtf8 ) import Ratio ( numerator ) import FastString ( uniqueOfFS, lengthFS ) import DATA_INT ( Int8, Int16, Int32 ) @@ -95,7 +94,11 @@ data Literal = ------------------ -- First the primitive guys MachChar Char -- Char# At least 31 bits - | MachStr FastString + + | MachStr FastString -- A string-literal: stored and emitted + -- UTF-8 encoded, we'll arrange to decode it + -- at runtime. Also emitted with a '\0' + -- terminator. | MachNullAddr -- the NULL pointer, the only pointer value -- that can be represented as a Literal. @@ -206,7 +209,7 @@ mkMachInt64 x = MachInt64 x mkMachWord64 x = MachWord64 x mkStringLit :: String -> Literal -mkStringLit s = MachStr (mkFastString (stringToUtf8 s)) +mkStringLit s = MachStr (mkFastString s) -- stored UTF-8 encoded inIntRange, inWordRange :: Integer -> Bool inIntRange x = x >= tARGET_MIN_INT && x <= tARGET_MAX_INT