diff options
author | Ian Lynagh <igloo@earth.li> | 2012-06-18 21:57:35 +0100 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2012-06-18 21:58:57 +0100 |
commit | d361262b601c90512176e3dbc4a65c02d73a234d (patch) | |
tree | 72a51c085e9e6d5a6fb17d5135c920df8ffd1948 /compiler | |
parent | ee7c4f434d377396dc9054fb5c1d9c899cc3b287 (diff) | |
download | haskell-d361262b601c90512176e3dbc4a65c02d73a234d.tar.gz |
Make -firrefutable-tuples a dynamic flag
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/iface/BinIface.hs | 1 | ||||
-rw-r--r-- | compiler/main/DynFlags.hs | 2 | ||||
-rw-r--r-- | compiler/main/StaticFlags.hs | 4 | ||||
-rw-r--r-- | compiler/typecheck/TcPat.lhs | 4 |
4 files changed, 5 insertions, 6 deletions
diff --git a/compiler/iface/BinIface.hs b/compiler/iface/BinIface.hs index f03808fbd2..799438086a 100644 --- a/compiler/iface/BinIface.hs +++ b/compiler/iface/BinIface.hs @@ -38,7 +38,6 @@ import DynFlags import UniqFM import UniqSupply import CostCentre -import StaticFlags import Panic import Binary import SrcLoc diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 5d8d379482..7192ff8972 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -269,6 +269,7 @@ data DynFlag | Opt_PedanticBottoms -- Be picky about how we treat bottom | Opt_LlvmTBAA -- Use LLVM TBAA infastructure for improving AA (hidden flag) | Opt_RegLiveness -- Use the STG Reg liveness information (hidden flag) + | Opt_IrrefutableTuples -- Interface files | Opt_IgnoreInterfacePragmas @@ -1975,6 +1976,7 @@ fFlags = [ ( "regs-iterative", Opt_RegsIterative, nop ), ( "llvm-tbaa", Opt_LlvmTBAA, nop), -- hidden flag ( "regs-liveness", Opt_RegLiveness, nop), -- hidden flag + ( "irrefutable-tuples", Opt_IrrefutableTuples, nop ), ( "gen-manifest", Opt_GenManifest, nop ), ( "embed-manifest", Opt_EmbedManifest, nop ), ( "ext-core", Opt_EmitExternalCore, nop ), diff --git a/compiler/main/StaticFlags.hs b/compiler/main/StaticFlags.hs index 563ecf1766..966c2fab09 100644 --- a/compiler/main/StaticFlags.hs +++ b/compiler/main/StaticFlags.hs @@ -48,7 +48,6 @@ module StaticFlags ( -- language opts opt_DictsStrict, - opt_IrrefutableTuples, opt_Parallel, -- optimisation opts @@ -266,9 +265,6 @@ opt_Hpc = lookUp (fsLit "-fhpc") opt_DictsStrict :: Bool opt_DictsStrict = lookUp (fsLit "-fdicts-strict") -opt_IrrefutableTuples :: Bool -opt_IrrefutableTuples = lookUp (fsLit "-firrefutable-tuples") - opt_Parallel :: Bool opt_Parallel = lookUp (fsLit "-fparallel") diff --git a/compiler/typecheck/TcPat.lhs b/compiler/typecheck/TcPat.lhs index 8f5287b9f6..a4f2c379a2 100644 --- a/compiler/typecheck/TcPat.lhs +++ b/compiler/typecheck/TcPat.lhs @@ -469,6 +469,8 @@ tc_pat penv (TuplePat pats boxity _) pat_ty thing_inside ; (coi, arg_tys) <- matchExpectedPatTy (matchExpectedTyConApp tc) pat_ty ; (pats', res) <- tc_lpats penv pats arg_tys thing_inside + ; dflags <- getDynFlags + -- Under flag control turn a pattern (x,y,z) into ~(x,y,z) -- so that we can experiment with lazy tuple-matching. -- This is a pretty odd place to make the switch, but @@ -477,7 +479,7 @@ tc_pat penv (TuplePat pats boxity _) pat_ty thing_inside -- pat_ty /= pat_ty iff coi /= IdCo unmangled_result = TuplePat pats' boxity pat_ty' possibly_mangled_result - | opt_IrrefutableTuples && + | dopt Opt_IrrefutableTuples dflags && isBoxed boxity = LazyPat (noLoc unmangled_result) | otherwise = unmangled_result |