summaryrefslogtreecommitdiff
path: root/compiler/llvmGen
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2019-01-17 13:34:32 +0100
committerBen Gamari <ben@smart-cactus.org>2019-01-31 12:46:51 -0500
commit4fa32293c9d2658ce504b8fe6d909db2acf59983 (patch)
tree6c7519fd6a320cbaf2264c2cbfdfe1eef0d70acc /compiler/llvmGen
parentdeab6d64eac085b2e0ec68bfb3eeeda608dfb85a (diff)
downloadhaskell-4fa32293c9d2658ce504b8fe6d909db2acf59983.tar.gz
Use ByteString to represent Cmm string literals (#16198)
Also used ByteString in some other relevant places
Diffstat (limited to 'compiler/llvmGen')
-rw-r--r--compiler/llvmGen/LlvmCodeGen/Data.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/llvmGen/LlvmCodeGen/Data.hs b/compiler/llvmGen/LlvmCodeGen/Data.hs
index 36d51e9e18..cabfe76762 100644
--- a/compiler/llvmGen/LlvmCodeGen/Data.hs
+++ b/compiler/llvmGen/LlvmCodeGen/Data.hs
@@ -22,6 +22,7 @@ import Platform
import FastString
import Outputable
+import qualified Data.ByteString as BS
-- ----------------------------------------------------------------------------
-- * Constants
@@ -102,7 +103,8 @@ llvmSection (Section t suffix) = do
genData :: CmmStatic -> LlvmM LlvmStatic
genData (CmmString str) = do
- let v = map (\x -> LMStaticLit $ LMIntLit (fromIntegral x) i8) str
+ let v = map (\x -> LMStaticLit $ LMIntLit (fromIntegral x) i8)
+ (BS.unpack str)
ve = v ++ [LMStaticLit $ LMIntLit 0 i8]
return $ LMStaticArray ve (LMArray (length ve) i8)