[commit: ghc] ghc-7.2: Use sepArg instead of hasArg for -fplugin* to avoid ambiguity (7f8eb7b)
Ian Lynagh
igloo at earth.li
Tue Jul 5 17:27:23 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : ghc-7.2
http://hackage.haskell.org/trac/ghc/changeset/7f8eb7bf972d877881c237ed73707a4ce0397dec
>---------------------------------------------------------------
commit 7f8eb7bf972d877881c237ed73707a4ce0397dec
Author: Max Bolingbroke <batterseapower at hotmail.com>
Date: Wed Jun 29 19:13:35 2011 +0100
Use sepArg instead of hasArg for -fplugin* to avoid ambiguity
>---------------------------------------------------------------
compiler/main/DynFlags.hs | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 62d3c2a..afb1d87 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -1365,7 +1365,7 @@ dynamic_flags = [
------- Output Redirection ------------------------------------------
, flagA "odir" (hasArg setObjectDir)
- , flagA "o" (SepArg (upd . setOutputFile . Just))
+ , flagA "o" (sepArg (setOutputFile . Just))
, flagA "ohi" (hasArg (setOutputHi . Just ))
, flagA "osuf" (hasArg setObjectSuf)
, flagA "hcsuf" (hasArg setHcSuf)
@@ -1522,8 +1522,8 @@ dynamic_flags = [
, flagA "w" (NoArg (mapM_ unSetDynFlag minuswRemovesOpts))
------ Plugin flags ------------------------------------------------
- , flagA "fplugin" (hasArg addPluginModuleName)
- , flagA "fplugin-opt" (hasArg addPluginModuleNameOption)
+ , flagA "fplugin" (sepArg addPluginModuleName)
+ , flagA "fplugin-opt" (sepArg addPluginModuleNameOption)
------ Optimisation flags ------------------------------------------
, flagA "O" (noArgM (setOptLevel 1))
@@ -1541,7 +1541,7 @@ dynamic_flags = [
, flagA "fno-spec-constr-count" (noArg (\d -> d{ specConstrCount = Nothing }))
, flagA "fliberate-case-threshold" (intSuffix (\n d -> d{ liberateCaseThreshold = Just n }))
, flagA "fno-liberate-case-threshold" (noArg (\d -> d{ liberateCaseThreshold = Nothing }))
- , flagA "frule-check" (SepArg (\s -> upd (\d -> d{ ruleCheck = Just s })))
+ , flagA "frule-check" (sepArg (\s d -> d{ ruleCheck = Just s }))
, flagA "fcontext-stack" (intSuffix (\n d -> d{ ctxtStkDepth = n }))
, flagA "fstrictness-before" (intSuffix (\n d -> d{ strictnessBefore = n : strictnessBefore d }))
, flagA "ffloat-lam-args" (intSuffix (\n d -> d{ floatLamArgs = Just n }))
@@ -2137,6 +2137,9 @@ hasArgDF :: (String -> DynFlags -> DynFlags) -> String -> OptKind (CmdLineP DynF
hasArgDF fn deprec = HasArg (\s -> do { upd (fn s)
; deprecate deprec })
+sepArg :: (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
+sepArg fn = SepArg (upd . fn)
+
intSuffix :: (Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix fn = IntSuffix (\n -> upd (fn n))
More information about the Cvs-ghc
mailing list