Link with hpc even if GhcWithInterpreter is not set
[ghc-hetmet.git] / compiler / main / DynFlags.hs
index 951b50e..cbed799 100644 (file)
@@ -166,7 +166,6 @@ data DynFlag
    | Opt_MonomorphismRestriction
    | Opt_MonoPatBinds
    | Opt_ExtendedDefaultRules          -- Use GHC's extended rules for defaulting
-   | Opt_GlasgowExts
    | Opt_FFI
    | Opt_UnliftedFFITypes
    | Opt_PArr                          -- Syntactic support for parallel arrays
@@ -177,8 +176,6 @@ data DynFlag
    | Opt_ImplicitPrelude 
    | Opt_ScopedTypeVariables
    | Opt_UnboxedTuples
-   | Opt_ExpressionSignaturesUnboxedTuples
-   | Opt_TypeSynonymUnboxedTuples
    | Opt_BangPatterns
    | Opt_TypeFamilies
    | Opt_OverloadedStrings
@@ -653,6 +650,16 @@ minusWallOpts
        Opt_WarnOrphans
       ]
 
+-- minuswRemovesOpts should be every warning option
+minuswRemovesOpts
+    = minusWallOpts ++
+      [Opt_WarnImplicitPrelude,
+       Opt_WarnIncompletePatternsRecUpd,
+       Opt_WarnSimplePatterns,
+       Opt_WarnMonomorphism,
+       Opt_WarnTabs
+      ]
+
 -- -----------------------------------------------------------------------------
 -- CoreToDo:  abstraction of core-to-core passes to run.
 
@@ -679,6 +686,7 @@ data CoreToDo               -- These are diff core-to-core passes,
   | CoreCSE
   | CoreDoRuleCheck Int{-CompilerPhase-} String        -- Check for non-application of rules 
                                                -- matching this string
+  | CoreDoVectorisation
   | CoreDoNothing               -- Useful when building up 
   | CoreDoPasses [CoreToDo]     -- lists of these things
 
@@ -714,6 +722,7 @@ getCoreToDo dflags
     spec_constr   = dopt Opt_SpecConstr dflags
     liberate_case = dopt Opt_LiberateCase dflags
     rule_check    = ruleCheck dflags
+    vectorisation = dopt Opt_Vectorise dflags
 
     core_todo = 
      if opt_level == 0 then
@@ -741,6 +750,15 @@ getCoreToDo dflags
            MaxSimplifierIterations max_iter
        ],
 
+
+        -- We run vectorisation here for now, but we might also try to run
+        -- it later
+        runWhen vectorisation (CoreDoPasses [
+                  CoreDoVectorisation,
+                  CoreDoSimplify SimplGently
+                                  [NoCaseOfCase,
+                                   MaxSimplifierIterations max_iter]]),
+
        -- Specialisation is best done before full laziness
        -- so that overloaded functions have all their dictionary lambdas manifest
        CoreDoSpecialising,
@@ -1027,7 +1045,7 @@ dynamic_flags = [
   ,  ( "Werror"                , NoArg (setDynFlag         Opt_WarnIsError) )
   ,  ( "Wall"          , NoArg (mapM_ setDynFlag   minusWallOpts) )
   ,  ( "Wnot"          , NoArg (mapM_ unSetDynFlag minusWallOpts) ) /* DEPREC */
-  ,  ( "w"             , NoArg (mapM_ unSetDynFlag minusWallOpts) )
+  ,  ( "w"             , NoArg (mapM_ unSetDynFlag minuswRemovesOpts) )
 
        ------ Optimisation flags ------------------------------------------
   ,  ( "O"     , NoArg (upd (setOptLevel 1)))
@@ -1074,6 +1092,7 @@ dynamic_flags = [
 -- these -f<blah> flags can all be reversed with -fno-<blah>
 
 fFlags = [
+  ( "warn-dodgy-imports",              Opt_WarnDodgyImports ),
   ( "warn-duplicate-exports",          Opt_WarnDuplicateExports ),
   ( "warn-hi-shadowing",               Opt_WarnHiShadows ),
   ( "warn-implicit-prelude",            Opt_WarnImplicitPrelude ),
@@ -1167,8 +1186,6 @@ xFlags = [
   ( "ImplicitParams",                  Opt_ImplicitParams ),
   ( "ScopedTypeVariables",             Opt_ScopedTypeVariables ),
   ( "UnboxedTuples",                Opt_UnboxedTuples ),
-  ( "ExpressionSignaturesUnboxedTuples", Opt_ExpressionSignaturesUnboxedTuples ),
-  ( "TypeSynonymUnboxedTuples",     Opt_TypeSynonymUnboxedTuples ),
   ( "StandaloneDeriving",           Opt_StandaloneDeriving ),
   ( "DeriveDataTypeable",           Opt_DeriveDataTypeable ),
   ( "TypeSynonymInstances",         Opt_TypeSynonymInstances ),
@@ -1188,16 +1205,14 @@ impliedFlags = [
   ( Opt_GADTs, [Opt_RelaxedPolyRec] )  -- We want type-sig variables to be completely rigid for GADTs
   ]
 
-glasgowExtsFlags = [ Opt_GlasgowExts 
-           , Opt_PrintExplicitForalls
+glasgowExtsFlags = [
+             Opt_PrintExplicitForalls
                   , Opt_FFI 
            , Opt_UnliftedFFITypes
                   , Opt_GADTs
                   , Opt_ImplicitParams 
                   , Opt_ScopedTypeVariables
            , Opt_UnboxedTuples
-           , Opt_ExpressionSignaturesUnboxedTuples
-           , Opt_TypeSynonymUnboxedTuples
            , Opt_TypeSynonymInstances
            , Opt_StandaloneDeriving
            , Opt_DeriveDataTypeable