summaryrefslogtreecommitdiff
path: root/compiler/GHC/Driver/Flags.hs
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2021-10-23 17:24:24 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-10-24 01:26:11 -0400
commit8300ca2e3bcc3e74f7524116f85688da6167bb2f (patch)
tree73722e3f5621c1a08c34c67b68b461bc0aa35070 /compiler/GHC/Driver/Flags.hs
parentdd2dba808aaa957c3d036b0025b412c499aace3d (diff)
downloadhaskell-8300ca2e3bcc3e74f7524116f85688da6167bb2f.tar.gz
driver: Export wWarningFlagMap
A new feature requires Ghcide to be able to convert warnings to CLI flags (WarningFlag -> String). This is most easily implemented in terms of the internal function flagSpecOf, which uses an inefficient implementation based on linear search through a linked list. This PR derives Ord for WarningFlag, and replaces that list with a Map. Closes #19087.
Diffstat (limited to 'compiler/GHC/Driver/Flags.hs')
-rw-r--r--compiler/GHC/Driver/Flags.hs3
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/GHC/Driver/Flags.hs b/compiler/GHC/Driver/Flags.hs
index e0ddaff52b..05733c88e4 100644
--- a/compiler/GHC/Driver/Flags.hs
+++ b/compiler/GHC/Driver/Flags.hs
@@ -536,7 +536,7 @@ data WarningFlag =
| Opt_WarnMissingKindSignatures -- Since 9.2
| Opt_WarnMissingExportedPatternSynonymSignatures -- since 9.2
| Opt_WarnRedundantStrictnessFlags -- Since 9.4
- deriving (Eq, Show, Enum)
+ deriving (Eq, Ord, Show, Enum)
-- | Return the names of a WarningFlag
--
@@ -787,4 +787,3 @@ unusedBindsFlags = [ Opt_WarnUnusedTopBinds
, Opt_WarnUnusedLocalBinds
, Opt_WarnUnusedPatternBinds
]
-