Commit d361262b authored by Ian Lynagh's avatar Ian Lynagh

Make -firrefutable-tuples a dynamic flag

parent ee7c4f43
......@@ -38,7 +38,6 @@ import DynFlags
import UniqFM
import UniqSupply
import CostCentre
import StaticFlags
import Panic
import Binary
import SrcLoc
......
......@@ -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 ),
......
......@@ -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")
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment