summaryrefslogtreecommitdiff
path: root/compiler/cmm
diff options
context:
space:
mode:
authorSylvain Henry <hsyl20@gmail.com>2018-11-22 11:31:16 -0500
committerBen Gamari <ben@smart-cactus.org>2018-11-22 12:11:15 -0500
commit13bb4bf44e6e690133be334bbf0c63fcae5db34a (patch)
treeee7a9a9f60ca936b16cc15a46c758d4dc51abfd7 /compiler/cmm
parentf5fbecc85967218fd8ba6512f10eea2daf2812ac (diff)
downloadhaskell-13bb4bf44e6e690133be334bbf0c63fcae5db34a.tar.gz
Rename literal constructors
In a previous patch we replaced some built-in literal constructors (MachInt, MachWord, etc.) with a single LitNumber constructor. In this patch we replace the `Mach` prefix of the remaining constructors with `Lit` for consistency (e.g., LitChar, LitLabel, etc.). Sadly the name `LitString` was already taken for a kind of FastString and it would become misleading to have both `LitStr` (literal constructor renamed after `MachStr`) and `LitString` (FastString variant). Hence this patch renames the FastString variant `PtrString` (which is more accurate) and the literal string constructor now uses the least surprising `LitString` name. Both `Literal` and `LitString/PtrString` have recently seen breaking changes so doing this kind of renaming now shouldn't harm much. Reviewers: hvr, goldfire, bgamari, simonmar, jrtc27, tdammers Subscribers: tdammers, rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4881
Diffstat (limited to 'compiler/cmm')
-rw-r--r--compiler/cmm/CLabel.hs4
-rw-r--r--compiler/cmm/CmmType.hs2
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs
index 3f7c97fbf6..40b4e70aa0 100644
--- a/compiler/cmm/CLabel.hs
+++ b/compiler/cmm/CLabel.hs
@@ -419,7 +419,7 @@ data RtsLabelInfo
| RtsSlowFastTickyCtr String
deriving (Eq, Ord)
- -- NOTE: Eq on LitString compares the pointer only, so this isn't
+ -- NOTE: Eq on PtrString compares the pointer only, so this isn't
-- a real equality.
@@ -1368,7 +1368,7 @@ tempLabelPrefixOrUnderscore = sdocWithPlatform $ \platform ->
underscorePrefix :: Bool -- leading underscore on assembler labels?
underscorePrefix = (cLeadingUnderscore == "YES")
-asmTempLabelPrefix :: Platform -> LitString -- for formatting labels
+asmTempLabelPrefix :: Platform -> PtrString -- for formatting labels
asmTempLabelPrefix platform = case platformOS platform of
OSDarwin -> sLit "L"
OSAIX -> sLit "__L" -- follow IBM XL C's convention
diff --git a/compiler/cmm/CmmType.hs b/compiler/cmm/CmmType.hs
index 97b181a243..77d894b1c7 100644
--- a/compiler/cmm/CmmType.hs
+++ b/compiler/cmm/CmmType.hs
@@ -173,7 +173,7 @@ data Width = W8 | W16 | W32 | W64
instance Outputable Width where
ppr rep = ptext (mrStr rep)
-mrStr :: Width -> LitString
+mrStr :: Width -> PtrString
mrStr W8 = sLit("W8")
mrStr W16 = sLit("W16")
mrStr W32 = sLit("W32")