diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2019-01-17 13:34:32 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2019-01-31 12:46:51 -0500 |
commit | 4fa32293c9d2658ce504b8fe6d909db2acf59983 (patch) | |
tree | 6c7519fd6a320cbaf2264c2cbfdfe1eef0d70acc /compiler/llvmGen | |
parent | deab6d64eac085b2e0ec68bfb3eeeda608dfb85a (diff) | |
download | haskell-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.hs | 4 |
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) |