Rename literal constructors
authorSylvain Henry <hsyl20@gmail.com>
Thu, 22 Nov 2018 16:31:16 +0000 (11:31 -0500)
committerBen Gamari <ben@smart-cactus.org>
Thu, 22 Nov 2018 17:11:15 +0000 (12:11 -0500)
commit13bb4bf44e6e690133be334bbf0c63fcae5db34a
treeee7a9a9f60ca936b16cc15a46c758d4dc51abfd7
parentf5fbecc85967218fd8ba6512f10eea2daf2812ac
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
40 files changed:
compiler/basicTypes/Literal.hs
compiler/cmm/CLabel.hs
compiler/cmm/CmmType.hs
compiler/codeGen/StgCmmCon.hs
compiler/codeGen/StgCmmUtils.hs
compiler/coreSyn/CoreOpt.hs
compiler/coreSyn/CorePrep.hs
compiler/coreSyn/CoreSyn.hs
compiler/coreSyn/CoreUnfold.hs
compiler/coreSyn/CoreUtils.hs
compiler/coreSyn/MkCore.hs
compiler/deSugar/DsCCall.hs
compiler/deSugar/DsForeign.hs
compiler/deSugar/DsMonad.hs
compiler/deSugar/DsUtils.hs
compiler/deSugar/Match.hs
compiler/deSugar/MatchLit.hs
compiler/ghci/ByteCodeAsm.hs
compiler/ghci/ByteCodeGen.hs
compiler/llvmGen/Llvm/Types.hs
compiler/main/Finder.hs
compiler/nativeGen/Dwarf/Constants.hs
compiler/nativeGen/Dwarf/Types.hs
compiler/nativeGen/PPC/Ppr.hs
compiler/nativeGen/SPARC/Ppr.hs
compiler/nativeGen/X86/Ppr.hs
compiler/prelude/PrelRules.hs
compiler/simplCore/SetLevels.hs
compiler/simplCore/Simplify.hs
compiler/simplStg/UnariseStg.hs
compiler/stgSyn/CoreToStg.hs
compiler/stranal/WwLib.hs
compiler/typecheck/TcEvTerm.hs
compiler/typecheck/TcSplice.hs
compiler/utils/BufWrite.hs
compiler/utils/FastString.hs
compiler/utils/Outputable.hs
compiler/utils/Pretty.hs
testsuite/tests/plugins/HomePackagePlugin.hs
testsuite/tests/plugins/simple-plugin/Simple/Plugin.hs