diff options
author | Ian Lynagh <ian@well-typed.com> | 2012-12-14 00:42:54 +0000 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2012-12-14 00:42:54 +0000 |
commit | 7085b8419033f74a985b824b63d85aae65b55882 (patch) | |
tree | 85a8e86c95aa8bc9b1dc06404f7eed47948150dc /compiler/coreSyn | |
parent | c79f733460c17d66853c184ccd1782d0be21b4dc (diff) | |
download | haskell-7085b8419033f74a985b824b63d85aae65b55882.tar.gz |
Inline some FastBytes/ByteString wrappers
Working towards removing FastBytes
Diffstat (limited to 'compiler/coreSyn')
-rw-r--r-- | compiler/coreSyn/CoreUnfold.lhs | 3 | ||||
-rw-r--r-- | compiler/coreSyn/MkExternalCore.lhs | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/compiler/coreSyn/CoreUnfold.lhs b/compiler/coreSyn/CoreUnfold.lhs index 7ed5d2b475..70ddc9a989 100644 --- a/compiler/coreSyn/CoreUnfold.lhs +++ b/compiler/coreSyn/CoreUnfold.lhs @@ -68,6 +68,7 @@ import FastString import Outputable import ForeignCall +import qualified Data.ByteString as BS import Data.Maybe \end{code} @@ -535,7 +536,7 @@ sizeExpr dflags bOMB_OUT_SIZE top_args expr litSize :: Literal -> Int -- Used by CoreUnfold.sizeExpr litSize (LitInteger {}) = 100 -- Note [Size of literal integers] -litSize (MachStr str) = 10 + 10 * ((lengthFB str + 3) `div` 4) +litSize (MachStr str) = 10 + 10 * ((BS.length str + 3) `div` 4) -- If size could be 0 then @f "x"@ might be too small -- [Sept03: make literal strings a bit bigger to avoid fruitless -- duplication of little strings] diff --git a/compiler/coreSyn/MkExternalCore.lhs b/compiler/coreSyn/MkExternalCore.lhs index 4c1d435bc8..164146ad43 100644 --- a/compiler/coreSyn/MkExternalCore.lhs +++ b/compiler/coreSyn/MkExternalCore.lhs @@ -39,6 +39,7 @@ import FastString import Exception import Control.Monad +import qualified Data.ByteString as BS import Data.Char import System.IO @@ -221,7 +222,7 @@ make_lit dflags l = -- For a character bigger than 0xff, we represent it in ext-core -- as an int lit with a char type. MachChar i -> C.Lint (fromIntegral $ ord i) t - MachStr s -> C.Lstring (bytesFB s) t + MachStr s -> C.Lstring (BS.unpack s) t MachNullAddr -> C.Lint 0 t MachInt i -> C.Lint i t MachInt64 i -> C.Lint i t |