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/simplCore/Simplify.hs | |
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/simplCore/Simplify.hs')
-rw-r--r-- | compiler/simplCore/Simplify.hs | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/compiler/simplCore/Simplify.hs b/compiler/simplCore/Simplify.hs index b123055387..53e3a210de 100644 --- a/compiler/simplCore/Simplify.hs +++ b/compiler/simplCore/Simplify.hs @@ -440,13 +440,7 @@ prepareRhs mode top_lvl occ _ rhs0 -- we can obtain non-counting ticks. | (not (tickishCounts t) || tickishCanSplit t) = do { (is_exp, floats, rhs') <- go n_val_args rhs - ; let tickIt (id, expr) - -- we have to take care not to tick top-level literal - -- strings. See Note [CoreSyn top-level string literals]. - | isTopLevel top_lvl && exprIsLiteralString expr - = (id, expr) - | otherwise - = (id, mkTick (mkNoCount t) expr) + ; let tickIt (id, expr) = (id, mkTick (mkNoCount t) expr) floats' = mapLetFloats floats tickIt ; return (is_exp, floats', Tick t rhs') } |