-- debugging flags
= Opt_D_dump_cmm
+ | Opt_D_dump_cps_cmm
| Opt_D_dump_asm
| Opt_D_dump_cpranal
| Opt_D_dump_deriv
| 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
| Opt_Arrows -- Arrow-notation syntax
| Opt_TH
| Opt_Generics
| Opt_ImplicitPrelude
| Opt_ScopedTypeVariables
+ | Opt_UnboxedTuples
+ | Opt_ExpressionSignaturesUnboxedTuples
+ | Opt_TypeSynonymUnboxedTuples
| Opt_BangPatterns
| Opt_TypeFamilies
| Opt_OverloadedStrings
| Opt_DisambiguateRecordFields
- | Opt_RecordDotDot
+ | Opt_RecordWildCards
| Opt_RecordPuns
| Opt_GADTs
| Opt_RelaxedPolyRec -- -X=RelaxedPolyRec
+ | Opt_StandaloneDeriving
+ | Opt_DeriveDataTypeable
+ | Opt_TypeSynonymInstances
+ | Opt_FlexibleContexts
+ | Opt_FlexibleInstances
+ | Opt_ConstrainedClassMethods
+ | Opt_MultiParamTypeClasses
+ | Opt_FunctionalDependencies
+ | Opt_UnicodeSyntax
+ | Opt_PolymorphicComponents
+ | Opt_ExistentialQuantification
+ | Opt_MagicHash
+ | Opt_EmptyDataDecls
+ | Opt_KindSignatures
+ | Opt_PatternSignatures
+ | Opt_ParallelListComp
+ | Opt_GeneralizedNewtypeDeriving
+ | Opt_RecursiveDo
+ | Opt_PatternGuards
+ | Opt_PartiallyAppliedClosedTypeSynonyms
+ | Opt_Rank2Types
+ | Opt_RankNTypes
+ | Opt_TypeOperators
+
+ | Opt_PrintExplicitForalls
-- optimisation opts
| Opt_Strictness
| Opt_UnboxStrictFields
| Opt_DictsCheap
| Opt_RewriteRules
+ | Opt_Vectorise
-- misc opts
- | Opt_ShortGhciBanner
| Opt_Cpp
| Opt_Pp
| Opt_ForceRecomp
= NoLink -- Don't link at all
| LinkBinary -- Link object code into a binary
| LinkInMemory -- Use the in-memory dynamic linker
- | MkDLL -- Make a DLL
+ | LinkDynLib -- Link objects into a dynamic lib (DLL on Windows, DSO on ELF platforms)
deriving Eq
isNoLink :: GhcLink -> Bool
, ( "F" , NoArg (setDynFlag Opt_Pp))
, ( "#include" , HasArg (addCmdlineHCInclude) )
, ( "v" , OptIntSuffix setVerbosity )
- , ( "short-ghci-banner", NoArg (setDynFlag Opt_ShortGhciBanner) )
- , ( "long-ghci-banner" , NoArg (unSetDynFlag Opt_ShortGhciBanner) )
------- Specific phases --------------------------------------------
, ( "pgmL" , HasArg (upd . setPgmL) )
-------- Linking ----------------------------------------------------
, ( "c" , NoArg (upd $ \d -> d{ ghcLink=NoLink } ))
, ( "no-link" , NoArg (upd $ \d -> d{ ghcLink=NoLink } )) -- Dep.
- , ( "-mk-dll" , NoArg (upd $ \d -> d{ ghcLink=MkDLL } ))
+ , ( "shared" , NoArg (upd $ \d -> d{ ghcLink=LinkDynLib } ))
------- Libraries ---------------------------------------------------
, ( "L" , Prefix addLibraryPath )
, ( "stubdir" , HasArg (upd . setStubDir . Just))
------- Keeping temporary files -------------------------------------
- , ( "keep-hc-file" , AnySuffix (\_ -> setDynFlag Opt_KeepHcFiles))
- , ( "keep-s-file" , AnySuffix (\_ -> setDynFlag Opt_KeepSFiles))
- , ( "keep-raw-s-file", AnySuffix (\_ -> setDynFlag Opt_KeepRawSFiles))
- , ( "keep-tmp-files" , AnySuffix (\_ -> setDynFlag Opt_KeepTmpFiles))
+ -- These can be singular (think ghc -c) or plural (think ghc --make)
+ , ( "keep-hc-file" , NoArg (setDynFlag Opt_KeepHcFiles))
+ , ( "keep-hc-files" , NoArg (setDynFlag Opt_KeepHcFiles))
+ , ( "keep-s-file" , NoArg (setDynFlag Opt_KeepSFiles))
+ , ( "keep-s-files" , NoArg (setDynFlag Opt_KeepSFiles))
+ , ( "keep-raw-s-file" , NoArg (setDynFlag Opt_KeepRawSFiles))
+ , ( "keep-raw-s-files", NoArg (setDynFlag Opt_KeepRawSFiles))
+ -- This only makes sense as plural
+ , ( "keep-tmp-files" , NoArg (setDynFlag Opt_KeepTmpFiles))
------- Miscellaneous ----------------------------------------------
, ( "no-hs-main" , NoArg (setDynFlag Opt_NoHsMain))
, ( "dstg-stats", NoArg (setDynFlag Opt_StgStats))
, ( "ddump-cmm", setDumpFlag Opt_D_dump_cmm)
+ , ( "ddump-cps-cmm", setDumpFlag Opt_D_dump_cps_cmm)
, ( "ddump-asm", setDumpFlag Opt_D_dump_asm)
, ( "ddump-cpranal", setDumpFlag Opt_D_dump_cpranal)
, ( "ddump-deriv", setDumpFlag Opt_D_dump_deriv)
, ( "dsource-stats", setDumpFlag Opt_D_source_stats)
, ( "dverbose-core2core", setDumpFlag Opt_D_verbose_core2core)
, ( "dverbose-stg2stg", setDumpFlag Opt_D_verbose_stg2stg)
- , ( "ddump-hi-diffs", setDumpFlag Opt_D_dump_hi_diffs)
, ( "ddump-hi", setDumpFlag Opt_D_dump_hi)
, ( "ddump-minimal-imports", setDumpFlag Opt_D_dump_minimal_imports)
, ( "ddump-vect", setDumpFlag Opt_D_dump_vect)
, ( "ddump-hpc", setDumpFlag Opt_D_dump_hpc)
, ( "ddump-mod-cycles", setDumpFlag Opt_D_dump_mod_cycles)
+ , ( "ddump-hi-diffs", NoArg (setDynFlag Opt_D_dump_hi_diffs))
, ( "dcore-lint", NoArg (setDynFlag Opt_DoCoreLinting))
, ( "dstg-lint", NoArg (setDynFlag Opt_DoStgLinting))
, ( "dcmm-lint", NoArg (setDynFlag Opt_DoCmmLinting))
------ Compiler flags -----------------------------------------------
- , ( "fasm", AnySuffix (\_ -> setObjTarget HscAsm) )
+ , ( "fasm", NoArg (setObjTarget HscAsm) )
, ( "fvia-c", NoArg (setObjTarget HscC) )
, ( "fvia-C", NoArg (setObjTarget HscC) )
( "warn-deprecations", Opt_WarnDeprecations ),
( "warn-orphans", Opt_WarnOrphans ),
( "warn-tabs", Opt_WarnTabs ),
+ ( "print-explicit-foralls", Opt_PrintExplicitForalls ),
( "strictness", Opt_Strictness ),
( "full-laziness", Opt_FullLaziness ),
( "liberate-case", Opt_LiberateCase ),
( "force-recomp", Opt_ForceRecomp ),
( "hpc-no-auto", Opt_Hpc_No_Auto ),
( "rewrite-rules", Opt_RewriteRules ),
- ( "break-on-exception", Opt_BreakOnException )
+ ( "break-on-exception", Opt_BreakOnException ),
+ ( "vectorise", Opt_Vectorise )
]
-- These -X<blah> flags can all be reversed with -Xno-<blah>
xFlags :: [(String, DynFlag)]
xFlags = [
+ ( "CPP", Opt_Cpp ),
+ ( "PatternGuards", Opt_PatternGuards ),
+ ( "UnicodeSyntax", Opt_UnicodeSyntax ),
+ ( "MagicHash", Opt_MagicHash ),
+ ( "PolymorphicComponents", Opt_PolymorphicComponents ),
+ ( "ExistentialQuantification", Opt_ExistentialQuantification ),
+ ( "KindSignatures", Opt_KindSignatures ),
+ ( "PatternSignatures", Opt_PatternSignatures ),
+ ( "EmptyDataDecls", Opt_EmptyDataDecls ),
+ ( "ParallelListComp", Opt_ParallelListComp ),
( "FI", Opt_FFI ), -- support `-ffi'...
( "FFI", Opt_FFI ), -- ...and also `-fffi'
- ( "ForeignFunctionInterface", Opt_FFI ), -- ...and also `-fffi'
-
+ ( "ForeignFunctionInterface", Opt_FFI ),
+ ( "UnliftedFFITypes", Opt_UnliftedFFITypes ),
+
+ ( "PartiallyAppliedClosedTypeSynonyms", Opt_PartiallyAppliedClosedTypeSynonyms ),
+ ( "Rank2Types", Opt_Rank2Types ),
+ ( "RankNTypes", Opt_RankNTypes ),
+ ( "TypeOperators", Opt_TypeOperators ),
+ ( "RecursiveDo", Opt_RecursiveDo ),
( "Arrows", Opt_Arrows ), -- arrow syntax
( "Parr", Opt_PArr ),
- ( "TH", Opt_TH ),
+ ( "TH", Opt_TH ), -- support -fth
( "TemplateHaskelll", Opt_TH ),
( "Generics", Opt_Generics ),
( "ImplicitPrelude", Opt_ImplicitPrelude ), -- On by default
+ ( "RecordWildCards", Opt_RecordWildCards ),
+ ( "RecordPuns", Opt_RecordPuns ),
+ ( "DisambiguateRecordFields", Opt_DisambiguateRecordFields ),
+
( "OverloadedStrings", Opt_OverloadedStrings ),
( "GADTs", Opt_GADTs ),
( "TypeFamilies", Opt_TypeFamilies ),
( "ExtendedDefaultRules", Opt_ExtendedDefaultRules ),
( "ImplicitParams", Opt_ImplicitParams ),
( "ScopedTypeVariables", Opt_ScopedTypeVariables ),
+ ( "UnboxedTuples", Opt_UnboxedTuples ),
+ ( "ExpressionSignaturesUnboxedTuples", Opt_ExpressionSignaturesUnboxedTuples ),
+ ( "TypeSynonymUnboxedTuples", Opt_TypeSynonymUnboxedTuples ),
+ ( "StandaloneDeriving", Opt_StandaloneDeriving ),
+ ( "DeriveDataTypeable", Opt_DeriveDataTypeable ),
+ ( "TypeSynonymInstances", Opt_TypeSynonymInstances ),
+ ( "FlexibleContexts", Opt_FlexibleContexts ),
+ ( "FlexibleInstances", Opt_FlexibleInstances ),
+ ( "ConstrainedClassMethods", Opt_ConstrainedClassMethods ),
+ ( "MultiParamTypeClasses", Opt_MultiParamTypeClasses ),
+ ( "FunctionalDependencies", Opt_FunctionalDependencies ),
+ ( "GeneralizedNewtypeDeriving", Opt_GeneralizedNewtypeDeriving ),
( "AllowOverlappingInstances", Opt_AllowOverlappingInstances ),
( "AllowUndecidableInstances", Opt_AllowUndecidableInstances ),
( "AllowIncoherentInstances", Opt_AllowIncoherentInstances )
( Opt_GADTs, [Opt_RelaxedPolyRec] ) -- We want type-sig variables to be completely rigid for GADTs
]
-glasgowExtsFlags = [ Opt_GlasgowExts
+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
+ , Opt_FlexibleContexts
+ , Opt_FlexibleInstances
+ , Opt_ConstrainedClassMethods
+ , Opt_MultiParamTypeClasses
+ , Opt_FunctionalDependencies
+ , Opt_MagicHash
+ , Opt_PolymorphicComponents
+ , Opt_ExistentialQuantification
+ , Opt_UnicodeSyntax
+ , Opt_PatternGuards
+ , Opt_PartiallyAppliedClosedTypeSynonyms
+ , Opt_RankNTypes
+ , Opt_TypeOperators
+ , Opt_RecursiveDo
+ , Opt_ParallelListComp
+ , Opt_EmptyDataDecls
+ , Opt_KindSignatures
+ , Opt_PatternSignatures
+ , Opt_GeneralizedNewtypeDeriving
, Opt_TypeFamilies ]
------------------
sta = opt_Static
in
( [ if sta then "-DDONT_WANT_WIN32_DLL_SUPPORT" else ""
--- , if suffixMatch "mingw32" cTARGETPLATFORM then "-mno-cygwin" else ""
+-- , if "mingw32" `isSuffixOf` cTARGETPLATFORM then "-mno-cygwin" else ""
],
[ "-fno-defer-pop",
#ifdef HAVE_GCC_MNO_OMIT_LFPTR