diff options
author | Bartosz Nitka <niteria@gmail.com> | 2018-03-02 05:33:07 -0800 |
---|---|---|
committer | Bartosz Nitka <niteria@gmail.com> | 2018-03-06 05:56:48 -0800 |
commit | 5bc195a2caddc5c29cf24e9c731dd8d5050f2c66 (patch) | |
tree | 3d0e58f6d1e37052c50938cd2ea9c1888183e7d2 /compiler/ghci | |
parent | ee597e9ec78ceb1a9a208c16dbdeb0b67b4ba5ec (diff) | |
download | haskell-5bc195a2caddc5c29cf24e9c731dd8d5050f2c66.tar.gz |
Allow top level ticked string literals
This reverts f5b275a239d2554c4da0b7621211642bf3b10650
and changes the places that looked for `Lit (MachStr _))`
to use `exprIsMbTickedLitString_maybe` to unwrap ticks as
necessary.
Also updated relevant comments.
Test Plan:
I added 3 new tests that previously reproduced.
GHC HEAD now builds with -g
Reviewers: simonpj, simonmar, bgamari, hvr, goldfire
Subscribers: rwbarton, thomie, carter
GHC Trac Issues: #14779
Differential Revision: https://phabricator.haskell.org/D4470
Diffstat (limited to 'compiler/ghci')
-rw-r--r-- | compiler/ghci/ByteCodeGen.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/ghci/ByteCodeGen.hs b/compiler/ghci/ByteCodeGen.hs index d5370805ea..13cb83df14 100644 --- a/compiler/ghci/ByteCodeGen.hs +++ b/compiler/ghci/ByteCodeGen.hs @@ -93,8 +93,8 @@ byteCodeGen hsc_env this_mod binds tycs mb_modBreaks -- See Note [generating code for top-level string literal bindings]. let (strings, flatBinds) = splitEithers $ do (bndr, rhs) <- flattenBinds binds - return $ case rhs of - Lit (MachStr str) -> Left (bndr, str) + return $ case exprIsTickedString_maybe rhs of + Just str -> Left (bndr, str) _ -> Right (bndr, simpleFreeVars rhs) stringPtrs <- allocateTopStrings hsc_env strings |