1 {-# OPTIONS -fno-warn-missing-fields #-}
2 -----------------------------------------------------------------------------
6 -- Most flags are dynamic flags, which means they can change from
7 -- compilation to compilation using OPTIONS_GHC pragmas, and in a
8 -- multi-session GHC each session can be using different dynamic
9 -- flags. Dynamic flags can also be set at the prompt in GHCi.
11 -- (c) The University of Glasgow 2005
13 -----------------------------------------------------------------------------
20 GhcMode(..), isOneShot,
21 GhcLink(..), isNoLink,
25 -- Configuration of the core-to-core and stg-to-stg phases
29 SimplifierMode(..), FloatOutSwitches(..),
30 getCoreToDo, getStgToDo,
32 -- Manipulating DynFlags
33 defaultDynFlags, -- DynFlags
34 initDynFlags, -- DynFlags -> IO DynFlags
36 dopt, -- DynFlag -> DynFlags -> Bool
37 dopt_set, dopt_unset, -- DynFlags -> DynFlag -> DynFlags
38 getOpts, -- (DynFlags -> [a]) -> IO [a]
49 machdepCCOpts, picCCOpts
52 #include "HsVersions.h"
54 import Module ( Module, mkModuleName, mkModule )
56 import PrelNames ( mAIN )
57 #ifdef i386_TARGET_ARCH
58 import StaticFlags ( opt_Static )
60 import StaticFlags ( opt_PIC, WayName(..), v_Ways, v_Build_tag,
62 import {-# SOURCE #-} Packages (PackageState)
63 import DriverPhases ( Phase(..), phaseInputExt )
66 import Constants ( mAX_CONTEXT_REDUCTION_DEPTH )
67 import Panic ( panic, GhcException(..) )
68 import UniqFM ( UniqFM )
69 import Util ( notNull, splitLongestPrefix, normalisePath )
70 import Maybes ( fromJust, orElse )
71 import SrcLoc ( SrcSpan )
73 import {-# SOURCE #-} ErrUtils ( Severity(..), Message, mkLocMessage )
75 import Data.IORef ( readIORef )
76 import Control.Exception ( throwDyn )
77 import Control.Monad ( when )
78 #ifdef mingw32_TARGET_OS
79 import Data.List ( isPrefixOf )
84 import Data.Char ( isUpper )
85 import System.IO ( hPutStrLn, stderr )
88 import Breakpoints ( BkptHandler )
89 import Module ( ModuleName )
91 -- -----------------------------------------------------------------------------
104 | Opt_D_dump_inlinings
105 | Opt_D_dump_occur_anal
109 | Opt_D_dump_simpl_iterations
118 | Opt_D_dump_worker_wrapper
119 | Opt_D_dump_rn_trace
120 | Opt_D_dump_rn_stats
122 | Opt_D_dump_simpl_stats
123 | Opt_D_dump_tc_trace
124 | Opt_D_dump_if_trace
130 | Opt_D_verbose_core2core
131 | Opt_D_verbose_stg2stg
133 | Opt_D_dump_hi_diffs
134 | Opt_D_dump_minimal_imports
135 | Opt_D_faststring_stats
140 | Opt_WarnIsError -- -Werror; makes warnings fatal
141 | Opt_WarnDuplicateExports
143 | Opt_WarnIncompletePatterns
144 | Opt_WarnIncompletePatternsRecUpd
145 | Opt_WarnMissingFields
146 | Opt_WarnMissingMethods
147 | Opt_WarnMissingSigs
148 | Opt_WarnNameShadowing
149 | Opt_WarnOverlappingPatterns
150 | Opt_WarnSimplePatterns
151 | Opt_WarnTypeDefaults
152 | Opt_WarnUnusedBinds
153 | Opt_WarnUnusedImports
154 | Opt_WarnUnusedMatches
155 | Opt_WarnDeprecations
156 | Opt_WarnDodgyImports
160 | Opt_AllowOverlappingInstances
161 | Opt_AllowUndecidableInstances
162 | Opt_AllowIncoherentInstances
163 | Opt_MonomorphismRestriction
165 | Opt_ExtendedDefaultRules -- Use GHC's extended rules for defaulting
168 | Opt_PArr -- Syntactic support for parallel arrays
169 | Opt_Arrows -- Arrow-notation syntax
173 | Opt_ImplicitPrelude
174 | Opt_ScopedTypeVariables
182 | Opt_IgnoreInterfacePragmas
183 | Opt_OmitInterfacePragmas
184 | Opt_DoLambdaEtaExpansion
186 | Opt_IgnoreBreakpoints
189 | Opt_UnboxStrictFields
198 | Opt_ExcessPrecision
199 | Opt_ReadUserPackageConf
203 | Opt_HideAllPackages
204 #if defined(GHCI) && defined(DEBUGGER)
207 | Opt_PrintBindResult
220 data DynFlags = DynFlags {
223 coreToDo :: Maybe [CoreToDo], -- reserved for -Ofile
224 stgToDo :: Maybe [StgToDo], -- similarly
225 hscTarget :: HscTarget,
226 hscOutName :: String, -- name of the output file
227 extCoreName :: String, -- name of the .core output file
228 verbosity :: Int, -- verbosity level
229 optLevel :: Int, -- optimisation level
230 maxSimplIterations :: Int, -- max simplifier iterations
231 ruleCheck :: Maybe String,
232 libCaseThreshold :: Int, -- Threshold for liberate-case
234 stolen_x86_regs :: Int,
235 cmdlineHcIncludes :: [String], -- -#includes
236 importPaths :: [FilePath],
238 mainFunIs :: Maybe String,
239 ctxtStkDepth :: Int, -- Typechecker context stack depth
241 thisPackage :: PackageId,
244 wayNames :: [WayName], -- way flags from the cmd line
245 buildTag :: String, -- the global "way" (eg. "p" for prof)
246 rtsBuildTag :: String, -- the RTS "way"
249 objectDir :: Maybe String,
250 hiDir :: Maybe String,
251 stubDir :: Maybe String,
257 outputFile :: Maybe String,
258 outputHi :: Maybe String,
260 includePaths :: [String],
261 libraryPaths :: [String],
262 frameworkPaths :: [String], -- used on darwin only
263 cmdlineFrameworks :: [String], -- ditto
264 tmpDir :: String, -- no trailing '/'
266 ghcUsagePath :: FilePath, -- Filled in by SysTools
267 ghciUsagePath :: FilePath, -- ditto
269 hpcDir :: String, -- ^ path to store the .mix files
271 -- options for particular phases
282 -- commands for particular phases
284 pgm_P :: (String,[Option]),
286 pgm_c :: (String,[Option]),
287 pgm_m :: (String,[Option]),
288 pgm_s :: (String,[Option]),
289 pgm_a :: (String,[Option]),
290 pgm_l :: (String,[Option]),
291 pgm_dll :: (String,[Option]),
293 pgm_sysman :: String,
296 extraPkgConfs :: [FilePath],
297 topDir :: FilePath, -- filled in by SysTools
298 systemPackageConfig :: FilePath, -- ditto
299 -- The -package-conf flags given on the command line, in the order
302 packageFlags :: [PackageFlag],
303 -- The -package and -hide-package flags from the command-line
306 -- NB. do not modify this field, it is calculated by
307 -- Packages.initPackages and Packages.updatePackages.
308 pkgDatabase :: Maybe (UniqFM InstalledPackageInfo),
309 pkgState :: PackageState,
315 log_action :: Severity -> SrcSpan -> PprStyle -> Message -> IO ()
318 -- breakpoint handling
319 ,bkptHandler :: Maybe (BkptHandler Module)
332 = BatchCompile -- | @ghc --make Main@
333 | Interactive -- | @ghc --interactive@
334 | OneShot -- | @ghc -c Foo.hs@
335 | JustTypecheck -- | Development environemnts, refactorer, etc.
339 isOneShot :: GhcMode -> Bool
340 isOneShot OneShot = True
341 isOneShot _other = False
343 data GhcLink -- What to do in the link step, if there is one
344 = -- Only relevant for modes
345 -- DoMake and StopBefore StopLn
346 NoLink -- Don't link at all
347 | StaticLink -- Ordinary linker [the default]
348 | MkDLL -- Make a DLL
350 isNoLink :: GhcLink -> Bool
351 isNoLink NoLink = True
352 isNoLink other = False
355 = ExposePackage String
357 | IgnorePackage String
361 | cGhcWithNativeCodeGen == "YES" = HscAsm
364 initDynFlags dflags = do
365 -- someday these will be dynamic flags
366 ways <- readIORef v_Ways
367 build_tag <- readIORef v_Build_tag
368 rts_build_tag <- readIORef v_RTS_Build_tag
371 buildTag = build_tag,
372 rtsBuildTag = rts_build_tag
378 ghcLink = StaticLink,
381 hscTarget = defaultHscTarget,
386 maxSimplIterations = 4,
388 libCaseThreshold = 20,
390 cmdlineHcIncludes = [],
394 ctxtStkDepth = mAX_CONTEXT_REDUCTION_DEPTH,
396 thisPackage = mainPackageId,
402 objectSuf = phaseInputExt StopLn,
403 hcSuf = phaseInputExt HCc,
406 outputFile = Nothing,
411 cmdlineFrameworks = [],
412 tmpDir = cDEFAULT_TMPDIR,
428 pkgDatabase = Nothing,
429 pkgState = panic "no package state yet: call GHC.setSessionDynFlags",
431 bkptHandler = Nothing,
434 Opt_ReadUserPackageConf,
436 Opt_MonoPatBinds, -- Experimentally, I'm making this non-standard
437 -- behaviour the default, to see if anyone notices
441 Opt_MonomorphismRestriction,
443 -- strictness is on by default, but this only
445 Opt_CSE, -- similarly for CSE.
446 Opt_FullLaziness, -- ...and for full laziness
448 Opt_DoLambdaEtaExpansion,
449 -- This one is important for a tiresome reason:
450 -- we want to make sure that the bindings for data
451 -- constructors are eta-expanded. This is probably
452 -- a good thing anyway, but it seems fragile.
456 -- and the default no-optimisation options:
457 Opt_IgnoreInterfacePragmas,
458 Opt_OmitInterfacePragmas,
462 ] ++ standardWarnings,
464 log_action = \severity srcSpan style msg ->
466 SevInfo -> hPutStrLn stderr (show (msg style))
467 SevFatal -> hPutStrLn stderr (show (msg style))
468 _ -> hPutStrLn stderr ('\n':show ((mkLocMessage srcSpan msg) style))
474 0 | print errors & warnings only
475 1 | minimal verbosity: print "compiling M ... done." for each module.
476 2 | equivalent to -dshow-passes
477 3 | equivalent to existing "ghc -v"
478 4 | "ghc -v -ddump-most"
479 5 | "ghc -v -ddump-all"
482 dopt :: DynFlag -> DynFlags -> Bool
483 dopt f dflags = f `elem` (flags dflags)
485 dopt_set :: DynFlags -> DynFlag -> DynFlags
486 dopt_set dfs f = dfs{ flags = f : flags dfs }
488 dopt_unset :: DynFlags -> DynFlag -> DynFlags
489 dopt_unset dfs f = dfs{ flags = filter (/= f) (flags dfs) }
491 getOpts :: DynFlags -> (DynFlags -> [a]) -> [a]
492 getOpts dflags opts = reverse (opts dflags)
493 -- We add to the options from the front, so we need to reverse the list
495 getVerbFlag :: DynFlags -> String
497 | verbosity dflags >= 3 = "-v"
500 setObjectDir f d = d{ objectDir = f}
501 setHiDir f d = d{ hiDir = f}
502 setStubDir f d = d{ stubDir = f}
504 setObjectSuf f d = d{ objectSuf = f}
505 setHiSuf f d = d{ hiSuf = f}
506 setHcSuf f d = d{ hcSuf = f}
508 setOutputFile f d = d{ outputFile = f}
509 setOutputHi f d = d{ outputHi = f}
511 -- XXX HACK: Prelude> words "'does not' work" ===> ["'does","not'","work"]
512 -- Config.hs should really use Option.
513 setPgmP f d = let (pgm:args) = words f in d{ pgm_P = (pgm, map Option args)}
515 setPgmL f d = d{ pgm_L = f}
516 setPgmF f d = d{ pgm_F = f}
517 setPgmc f d = d{ pgm_c = (f,[])}
518 setPgmm f d = d{ pgm_m = (f,[])}
519 setPgms f d = d{ pgm_s = (f,[])}
520 setPgma f d = d{ pgm_a = (f,[])}
521 setPgml f d = d{ pgm_l = (f,[])}
522 setPgmdll f d = d{ pgm_dll = (f,[])}
524 addOptL f d = d{ opt_L = f : opt_L d}
525 addOptP f d = d{ opt_P = f : opt_P d}
526 addOptF f d = d{ opt_F = f : opt_F d}
527 addOptc f d = d{ opt_c = f : opt_c d}
528 addOptm f d = d{ opt_m = f : opt_m d}
529 addOpta f d = d{ opt_a = f : opt_a d}
530 addOptl f d = d{ opt_l = f : opt_l d}
531 addOptdll f d = d{ opt_dll = f : opt_dll d}
532 addOptdep f d = d{ opt_dep = f : opt_dep d}
534 addCmdlineFramework f d = d{ cmdlineFrameworks = f : cmdlineFrameworks d}
536 -- -----------------------------------------------------------------------------
537 -- Command-line options
539 -- When invoking external tools as part of the compilation pipeline, we
540 -- pass these a sequence of options on the command-line. Rather than
541 -- just using a list of Strings, we use a type that allows us to distinguish
542 -- between filepaths and 'other stuff'. [The reason being, of course, that
543 -- this type gives us a handle on transforming filenames, and filenames only,
544 -- to whatever format they're expected to be on a particular platform.]
547 = FileOption -- an entry that _contains_ filename(s) / filepaths.
548 String -- a non-filepath prefix that shouldn't be
549 -- transformed (e.g., "/out=")
550 String -- the filepath/filename portion
553 -----------------------------------------------------------------------------
554 -- Setting the optimisation level
556 updOptLevel :: Int -> DynFlags -> DynFlags
557 -- Set dynflags appropriate to the optimisation level
559 = dfs2{ optLevel = n }
561 dfs1 = foldr (flip dopt_unset) dfs remove_dopts
562 dfs2 = foldr (flip dopt_set) dfs1 extra_dopts
565 | n == 0 = opt_0_dopts
566 | otherwise = opt_1_dopts
569 | n == 0 = opt_1_dopts
570 | otherwise = opt_0_dopts
573 Opt_IgnoreInterfacePragmas,
574 Opt_OmitInterfacePragmas
583 -- -----------------------------------------------------------------------------
584 -- Standard sets of warning options
587 = [ Opt_WarnDeprecations,
588 Opt_WarnOverlappingPatterns,
589 Opt_WarnMissingFields,
590 Opt_WarnMissingMethods,
591 Opt_WarnDuplicateExports
595 = standardWarnings ++
596 [ Opt_WarnUnusedBinds,
597 Opt_WarnUnusedMatches,
598 Opt_WarnUnusedImports,
599 Opt_WarnIncompletePatterns,
605 [ Opt_WarnTypeDefaults,
606 Opt_WarnNameShadowing,
612 -- -----------------------------------------------------------------------------
613 -- CoreToDo: abstraction of core-to-core passes to run.
615 data CoreToDo -- These are diff core-to-core passes,
616 -- which may be invoked in any order,
617 -- as many times as you like.
619 = CoreDoSimplify -- The core-to-core simplifier.
622 -- Each run of the simplifier can take a different
623 -- set of simplifier-specific flags.
625 | CoreDoFloatOutwards FloatOutSwitches
630 | CoreDoWorkerWrapper
633 | CoreDoOldStrictness
636 | CoreDoRuleCheck Int{-CompilerPhase-} String -- Check for non-application of rules
637 -- matching this string
639 | CoreDoNothing -- useful when building up lists of these things
641 data SimplifierMode -- See comments in SimplMonad
645 data SimplifierSwitch
646 = MaxSimplifierIterations Int
649 data FloatOutSwitches
650 = FloatOutSw Bool -- True <=> float lambdas to top level
651 Bool -- True <=> float constants to top level,
652 -- even if they do not escape a lambda
655 -- The core-to-core pass ordering is derived from the DynFlags:
657 getCoreToDo :: DynFlags -> [CoreToDo]
659 | Just todo <- coreToDo dflags = todo -- set explicitly by user
660 | otherwise = core_todo
662 opt_level = optLevel dflags
663 max_iter = maxSimplIterations dflags
664 strictness = dopt Opt_Strictness dflags
665 full_laziness = dopt Opt_FullLaziness dflags
666 cse = dopt Opt_CSE dflags
667 rule_check = ruleCheck dflags
670 if opt_level == 0 then
672 CoreDoSimplify (SimplPhase 0) [
673 MaxSimplifierIterations max_iter
676 else {- opt_level >= 1 -} [
678 -- initial simplify: mk specialiser happy: minimum effort please
679 CoreDoSimplify SimplGently [
681 -- Don't inline anything till full laziness has bitten
682 -- In particular, inlining wrappers inhibits floating
683 -- e.g. ...(case f x of ...)...
684 -- ==> ...(case (case x of I# x# -> fw x#) of ...)...
685 -- ==> ...(case x of I# x# -> case fw x# of ...)...
686 -- and now the redex (f x) isn't floatable any more
687 -- Similarly, don't apply any rules until after full
688 -- laziness. Notably, list fusion can prevent floating.
690 NoCaseOfCase, -- Don't do case-of-case transformations.
691 -- This makes full laziness work better
692 MaxSimplifierIterations max_iter
695 -- Specialisation is best done before full laziness
696 -- so that overloaded functions have all their dictionary lambdas manifest
699 if full_laziness then CoreDoFloatOutwards (FloatOutSw False False)
704 CoreDoSimplify (SimplPhase 2) [
705 -- Want to run with inline phase 2 after the specialiser to give
706 -- maximum chance for fusion to work before we inline build/augment
707 -- in phase 1. This made a difference in 'ansi' where an
708 -- overloaded function wasn't inlined till too late.
709 MaxSimplifierIterations max_iter
711 case rule_check of { Just pat -> CoreDoRuleCheck 2 pat; Nothing -> CoreDoNothing },
713 CoreDoSimplify (SimplPhase 1) [
714 -- Need inline-phase2 here so that build/augment get
715 -- inlined. I found that spectral/hartel/genfft lost some useful
716 -- strictness in the function sumcode' if augment is not inlined
717 -- before strictness analysis runs
718 MaxSimplifierIterations max_iter
720 case rule_check of { Just pat -> CoreDoRuleCheck 1 pat; Nothing -> CoreDoNothing },
722 CoreDoSimplify (SimplPhase 0) [
723 -- Phase 0: allow all Ids to be inlined now
724 -- This gets foldr inlined before strictness analysis
726 MaxSimplifierIterations 3
727 -- At least 3 iterations because otherwise we land up with
728 -- huge dead expressions because of an infelicity in the
730 -- let k = BIG in foldr k z xs
731 -- ==> let k = BIG in letrec go = \xs -> ...(k x).... in go xs
732 -- ==> let k = BIG in letrec go = \xs -> ...(BIG x).... in go xs
736 case rule_check of { Just pat -> CoreDoRuleCheck 0 pat; Nothing -> CoreDoNothing },
738 #ifdef OLD_STRICTNESS
741 if strictness then CoreDoStrictness else CoreDoNothing,
745 CoreDoSimplify (SimplPhase 0) [
746 MaxSimplifierIterations max_iter
749 if full_laziness then
750 CoreDoFloatOutwards (FloatOutSw False -- Not lambdas
751 True) -- Float constants
753 -- nofib/spectral/hartel/wang doubles in speed if you
754 -- do full laziness late in the day. It only happens
755 -- after fusion and other stuff, so the early pass doesn't
756 -- catch it. For the record, the redex is
757 -- f_el22 (f_el21 r_midblock)
760 -- We want CSE to follow the final full-laziness pass, because it may
761 -- succeed in commoning up things floated out by full laziness.
762 -- CSE used to rely on the no-shadowing invariant, but it doesn't any more
764 if cse then CoreCSE else CoreDoNothing,
768 -- Case-liberation for -O2. This should be after
769 -- strictness analysis and the simplification which follows it.
771 case rule_check of { Just pat -> CoreDoRuleCheck 0 pat; Nothing -> CoreDoNothing }
776 (if opt_level >= 2 then
778 CoreDoSimplify (SimplPhase 0) [
779 MaxSimplifierIterations max_iter
780 ], -- Run the simplifier after LiberateCase to vastly
781 -- reduce the possiblility of shadowing
782 -- Reason: see Note [Shadowing] in SpecConstr.lhs
790 -- Final clean-up simplification:
791 [ CoreDoSimplify (SimplPhase 0) [
792 MaxSimplifierIterations max_iter
796 -- -----------------------------------------------------------------------------
797 -- StgToDo: abstraction of stg-to-stg passes to run.
800 = StgDoMassageForProfiling -- should be (next to) last
801 -- There's also setStgVarInfo, but its absolute "lastness"
802 -- is so critical that it is hardwired in (no flag).
805 getStgToDo :: DynFlags -> [StgToDo]
807 | Just todo <- stgToDo dflags = todo -- set explicitly by user
810 stg_stats = dopt Opt_StgStats dflags
812 todo1 = if stg_stats then [D_stg_stats] else []
814 todo2 | WayProf `elem` wayNames dflags
815 = StgDoMassageForProfiling : todo1
819 -- -----------------------------------------------------------------------------
823 allFlags = map ('-':) $
824 [ name | (name, optkind) <- dynamic_flags, ok optkind ] ++
825 map ("fno-"++) flags ++
827 where ok (PrefixPred _ _) = False
829 flags = map fst fFlags
831 dynamic_flags :: [(String, OptKind DynP)]
833 ( "n" , NoArg (setDynFlag Opt_DryRun) )
834 , ( "cpp" , NoArg (setDynFlag Opt_Cpp))
835 , ( "F" , NoArg (setDynFlag Opt_Pp))
836 , ( "#include" , HasArg (addCmdlineHCInclude) )
837 , ( "v" , OptIntSuffix setVerbosity )
839 ------- Specific phases --------------------------------------------
840 , ( "pgmL" , HasArg (upd . setPgmL) )
841 , ( "pgmP" , HasArg (upd . setPgmP) )
842 , ( "pgmF" , HasArg (upd . setPgmF) )
843 , ( "pgmc" , HasArg (upd . setPgmc) )
844 , ( "pgmm" , HasArg (upd . setPgmm) )
845 , ( "pgms" , HasArg (upd . setPgms) )
846 , ( "pgma" , HasArg (upd . setPgma) )
847 , ( "pgml" , HasArg (upd . setPgml) )
848 , ( "pgmdll" , HasArg (upd . setPgmdll) )
850 , ( "optL" , HasArg (upd . addOptL) )
851 , ( "optP" , HasArg (upd . addOptP) )
852 , ( "optF" , HasArg (upd . addOptF) )
853 , ( "optc" , HasArg (upd . addOptc) )
854 , ( "optm" , HasArg (upd . addOptm) )
855 , ( "opta" , HasArg (upd . addOpta) )
856 , ( "optl" , HasArg (upd . addOptl) )
857 , ( "optdll" , HasArg (upd . addOptdll) )
858 , ( "optdep" , HasArg (upd . addOptdep) )
860 , ( "split-objs" , NoArg (if can_split
861 then setDynFlag Opt_SplitObjs
864 -------- Linking ----------------------------------------------------
865 , ( "c" , NoArg (upd $ \d -> d{ ghcLink=NoLink } ))
866 , ( "no-link" , NoArg (upd $ \d -> d{ ghcLink=NoLink } )) -- Dep.
867 , ( "-mk-dll" , NoArg (upd $ \d -> d{ ghcLink=MkDLL } ))
869 ------- Libraries ---------------------------------------------------
870 , ( "L" , Prefix addLibraryPath )
871 , ( "l" , AnySuffix (\s -> do upd (addOptl s)
874 ------- Frameworks --------------------------------------------------
875 -- -framework-path should really be -F ...
876 , ( "framework-path" , HasArg addFrameworkPath )
877 , ( "framework" , HasArg (upd . addCmdlineFramework) )
879 ------- Output Redirection ------------------------------------------
880 , ( "odir" , HasArg (upd . setObjectDir . Just))
881 , ( "o" , SepArg (upd . setOutputFile . Just))
882 , ( "ohi" , HasArg (upd . setOutputHi . Just ))
883 , ( "osuf" , HasArg (upd . setObjectSuf))
884 , ( "hcsuf" , HasArg (upd . setHcSuf))
885 , ( "hisuf" , HasArg (upd . setHiSuf))
886 , ( "hidir" , HasArg (upd . setHiDir . Just))
887 , ( "tmpdir" , HasArg (upd . setTmpDir))
888 , ( "stubdir" , HasArg (upd . setStubDir . Just))
890 ------- Keeping temporary files -------------------------------------
891 , ( "keep-hc-file" , AnySuffix (\_ -> setDynFlag Opt_KeepHcFiles))
892 , ( "keep-s-file" , AnySuffix (\_ -> setDynFlag Opt_KeepSFiles))
893 , ( "keep-raw-s-file", AnySuffix (\_ -> setDynFlag Opt_KeepRawSFiles))
894 , ( "keep-tmp-files" , AnySuffix (\_ -> setDynFlag Opt_KeepTmpFiles))
896 ------- Miscellaneous ----------------------------------------------
897 , ( "no-hs-main" , NoArg (setDynFlag Opt_NoHsMain))
898 , ( "main-is" , SepArg setMainIs )
899 , ( "haddock" , NoArg (setDynFlag Opt_Haddock) )
900 , ( "hpcdir" , SepArg setOptHpcDir )
902 ------- recompilation checker (DEPRECATED, use -fforce-recomp) -----
903 , ( "recomp" , NoArg (unSetDynFlag Opt_ForceRecomp) )
904 , ( "no-recomp" , NoArg (setDynFlag Opt_ForceRecomp) )
906 ------- Packages ----------------------------------------------------
907 , ( "package-conf" , HasArg extraPkgConf_ )
908 , ( "no-user-package-conf", NoArg (unSetDynFlag Opt_ReadUserPackageConf) )
909 , ( "package-name" , HasArg (upd . setPackageName) )
910 , ( "package" , HasArg exposePackage )
911 , ( "hide-package" , HasArg hidePackage )
912 , ( "hide-all-packages", NoArg (setDynFlag Opt_HideAllPackages) )
913 , ( "ignore-package" , HasArg ignorePackage )
914 , ( "syslib" , HasArg exposePackage ) -- for compatibility
916 ------ HsCpp opts ---------------------------------------------------
917 , ( "D", AnySuffix (upd . addOptP) )
918 , ( "U", AnySuffix (upd . addOptP) )
920 ------- Include/Import Paths ----------------------------------------
921 , ( "I" , Prefix addIncludePath)
922 , ( "i" , OptPrefix addImportPath )
924 ------ Debugging ----------------------------------------------------
925 , ( "dstg-stats", NoArg (setDynFlag Opt_StgStats))
927 , ( "ddump-cmm", setDumpFlag Opt_D_dump_cmm)
928 , ( "ddump-asm", setDumpFlag Opt_D_dump_asm)
929 , ( "ddump-cpranal", setDumpFlag Opt_D_dump_cpranal)
930 , ( "ddump-deriv", setDumpFlag Opt_D_dump_deriv)
931 , ( "ddump-ds", setDumpFlag Opt_D_dump_ds)
932 , ( "ddump-flatC", setDumpFlag Opt_D_dump_flatC)
933 , ( "ddump-foreign", setDumpFlag Opt_D_dump_foreign)
934 , ( "ddump-inlinings", setDumpFlag Opt_D_dump_inlinings)
935 , ( "ddump-occur-anal", setDumpFlag Opt_D_dump_occur_anal)
936 , ( "ddump-parsed", setDumpFlag Opt_D_dump_parsed)
937 , ( "ddump-rn", setDumpFlag Opt_D_dump_rn)
938 , ( "ddump-simpl", setDumpFlag Opt_D_dump_simpl)
939 , ( "ddump-simpl-iterations", setDumpFlag Opt_D_dump_simpl_iterations)
940 , ( "ddump-spec", setDumpFlag Opt_D_dump_spec)
941 , ( "ddump-prep", setDumpFlag Opt_D_dump_prep)
942 , ( "ddump-stg", setDumpFlag Opt_D_dump_stg)
943 , ( "ddump-stranal", setDumpFlag Opt_D_dump_stranal)
944 , ( "ddump-tc", setDumpFlag Opt_D_dump_tc)
945 , ( "ddump-types", setDumpFlag Opt_D_dump_types)
946 , ( "ddump-rules", setDumpFlag Opt_D_dump_rules)
947 , ( "ddump-cse", setDumpFlag Opt_D_dump_cse)
948 , ( "ddump-worker-wrapper", setDumpFlag Opt_D_dump_worker_wrapper)
949 , ( "ddump-rn-trace", NoArg (setDynFlag Opt_D_dump_rn_trace))
950 , ( "ddump-if-trace", NoArg (setDynFlag Opt_D_dump_if_trace))
951 , ( "ddump-tc-trace", setDumpFlag Opt_D_dump_tc_trace)
952 , ( "ddump-splices", setDumpFlag Opt_D_dump_splices)
953 , ( "ddump-rn-stats", NoArg (setDynFlag Opt_D_dump_rn_stats))
954 , ( "ddump-opt-cmm", setDumpFlag Opt_D_dump_opt_cmm)
955 , ( "ddump-simpl-stats", setDumpFlag Opt_D_dump_simpl_stats)
956 , ( "ddump-bcos", setDumpFlag Opt_D_dump_BCOs)
957 , ( "dsource-stats", setDumpFlag Opt_D_source_stats)
958 , ( "dverbose-core2core", setDumpFlag Opt_D_verbose_core2core)
959 , ( "dverbose-stg2stg", setDumpFlag Opt_D_verbose_stg2stg)
960 , ( "ddump-hi-diffs", NoArg (setDynFlag Opt_D_dump_hi_diffs))
961 , ( "ddump-hi", setDumpFlag Opt_D_dump_hi)
962 , ( "ddump-minimal-imports", NoArg (setDynFlag Opt_D_dump_minimal_imports))
963 , ( "ddump-vect", setDumpFlag Opt_D_dump_vect)
964 , ( "ddump-hpc", setDumpFlag Opt_D_dump_hpc)
966 , ( "dcore-lint", NoArg (setDynFlag Opt_DoCoreLinting))
967 , ( "dstg-lint", NoArg (setDynFlag Opt_DoStgLinting))
968 , ( "dcmm-lint", NoArg (setDynFlag Opt_DoCmmLinting))
969 , ( "dshow-passes", NoArg (do setDynFlag Opt_ForceRecomp
970 setVerbosity (Just 2)) )
971 , ( "dfaststring-stats", NoArg (setDynFlag Opt_D_faststring_stats))
973 ------ Machine dependant (-m<blah>) stuff ---------------------------
975 , ( "monly-2-regs", NoArg (upd (\s -> s{stolen_x86_regs = 2}) ))
976 , ( "monly-3-regs", NoArg (upd (\s -> s{stolen_x86_regs = 3}) ))
977 , ( "monly-4-regs", NoArg (upd (\s -> s{stolen_x86_regs = 4}) ))
979 ------ Warning opts -------------------------------------------------
980 , ( "W" , NoArg (mapM_ setDynFlag minusWOpts) )
981 , ( "Werror" , NoArg (setDynFlag Opt_WarnIsError) )
982 , ( "Wall" , NoArg (mapM_ setDynFlag minusWallOpts) )
983 , ( "Wnot" , NoArg (mapM_ unSetDynFlag minusWallOpts) ) /* DEPREC */
984 , ( "w" , NoArg (mapM_ unSetDynFlag minusWallOpts) )
986 ------ Optimisation flags ------------------------------------------
987 , ( "O" , NoArg (upd (setOptLevel 1)))
988 , ( "Onot" , NoArg (upd (setOptLevel 0)))
989 , ( "O" , OptIntSuffix (\mb_n -> upd (setOptLevel (mb_n `orElse` 1))))
990 -- If the number is missing, use 1
992 , ( "fmax-simplifier-iterations", IntSuffix (\n ->
993 upd (\dfs -> dfs{ maxSimplIterations = n })) )
994 , ( "fliberate-case-threshold", IntSuffix (\n -> upd (\dfs -> dfs{ libCaseThreshold = n })))
995 , ( "frule-check", SepArg (\s -> upd (\dfs -> dfs{ ruleCheck = Just s })))
996 , ( "fcontext-stack" , IntSuffix $ \n -> upd $ \dfs -> dfs{ ctxtStkDepth = n })
998 ------ Compiler flags -----------------------------------------------
1000 , ( "fno-code", NoArg (setTarget HscNothing))
1001 , ( "fasm", AnySuffix (\_ -> setTarget HscAsm) )
1002 , ( "fvia-c", NoArg (setTarget HscC) )
1003 , ( "fvia-C", NoArg (setTarget HscC) )
1005 , ( "fglasgow-exts", NoArg (mapM_ setDynFlag glasgowExtsFlags) )
1006 , ( "fno-glasgow-exts", NoArg (mapM_ unSetDynFlag glasgowExtsFlags) )
1009 -- the rest of the -f* and -fno-* flags
1010 , ( "fno-", PrefixPred (\f -> isFFlag f) (\f -> unSetDynFlag (getFFlag f)) )
1011 , ( "f", PrefixPred (\f -> isFFlag f) (\f -> setDynFlag (getFFlag f)) )
1014 -- these -f<blah> flags can all be reversed with -fno-<blah>
1017 ( "warn-duplicate-exports", Opt_WarnDuplicateExports ),
1018 ( "warn-hi-shadowing", Opt_WarnHiShadows ),
1019 ( "warn-incomplete-patterns", Opt_WarnIncompletePatterns ),
1020 ( "warn-incomplete-record-updates", Opt_WarnIncompletePatternsRecUpd ),
1021 ( "warn-missing-fields", Opt_WarnMissingFields ),
1022 ( "warn-missing-methods", Opt_WarnMissingMethods ),
1023 ( "warn-missing-signatures", Opt_WarnMissingSigs ),
1024 ( "warn-name-shadowing", Opt_WarnNameShadowing ),
1025 ( "warn-overlapping-patterns", Opt_WarnOverlappingPatterns ),
1026 ( "warn-simple-patterns", Opt_WarnSimplePatterns ),
1027 ( "warn-type-defaults", Opt_WarnTypeDefaults ),
1028 ( "warn-unused-binds", Opt_WarnUnusedBinds ),
1029 ( "warn-unused-imports", Opt_WarnUnusedImports ),
1030 ( "warn-unused-matches", Opt_WarnUnusedMatches ),
1031 ( "warn-deprecations", Opt_WarnDeprecations ),
1032 ( "warn-orphans", Opt_WarnOrphans ),
1033 ( "fi", Opt_FFI ), -- support `-ffi'...
1034 ( "ffi", Opt_FFI ), -- ...and also `-fffi'
1035 ( "arrows", Opt_Arrows ), -- arrow syntax
1036 ( "parr", Opt_PArr ),
1038 ( "implicit-prelude", Opt_ImplicitPrelude ),
1039 ( "scoped-type-variables", Opt_ScopedTypeVariables ),
1040 ( "bang-patterns", Opt_BangPatterns ),
1041 ( "indexed-types", Opt_IndexedTypes ),
1042 ( "monomorphism-restriction", Opt_MonomorphismRestriction ),
1043 ( "mono-pat-binds", Opt_MonoPatBinds ),
1044 ( "extended-default-rules", Opt_ExtendedDefaultRules ),
1045 ( "implicit-params", Opt_ImplicitParams ),
1046 ( "allow-overlapping-instances", Opt_AllowOverlappingInstances ),
1047 ( "allow-undecidable-instances", Opt_AllowUndecidableInstances ),
1048 ( "allow-incoherent-instances", Opt_AllowIncoherentInstances ),
1049 ( "generics", Opt_Generics ),
1050 ( "strictness", Opt_Strictness ),
1051 ( "full-laziness", Opt_FullLaziness ),
1053 ( "ignore-interface-pragmas", Opt_IgnoreInterfacePragmas ),
1054 ( "omit-interface-pragmas", Opt_OmitInterfacePragmas ),
1055 ( "do-lambda-eta-expansion", Opt_DoLambdaEtaExpansion ),
1056 ( "ignore-asserts", Opt_IgnoreAsserts ),
1057 ( "ignore-breakpoints", Opt_IgnoreBreakpoints),
1058 ( "do-eta-reduction", Opt_DoEtaReduction ),
1059 ( "case-merge", Opt_CaseMerge ),
1060 ( "unbox-strict-fields", Opt_UnboxStrictFields ),
1061 ( "dicts-cheap", Opt_DictsCheap ),
1062 ( "excess-precision", Opt_ExcessPrecision ),
1063 ( "asm-mangling", Opt_DoAsmMangling ),
1064 ( "print-bind-result", Opt_PrintBindResult ),
1065 #if defined(GHCI) && defined(DEBUGGER)
1066 ( "debugging", Opt_Debugging),
1068 ( "force-recomp", Opt_ForceRecomp ),
1069 ( "hpc-no-auto", Opt_Hpc_No_Auto )
1073 glasgowExtsFlags = [
1077 Opt_ScopedTypeVariables,
1080 isFFlag f = f `elem` (map fst fFlags)
1081 getFFlag f = fromJust (lookup f fFlags)
1083 -- -----------------------------------------------------------------------------
1084 -- Parsing the dynamic flags.
1086 parseDynamicFlags :: DynFlags -> [String] -> IO (DynFlags,[String])
1087 parseDynamicFlags dflags args = do
1088 let ((leftover,errs),dflags')
1089 = runCmdLine (processArgs dynamic_flags args) dflags
1090 when (not (null errs)) $ do
1091 throwDyn (UsageError (unlines errs))
1092 return (dflags', leftover)
1095 type DynP = CmdLineP DynFlags
1097 upd :: (DynFlags -> DynFlags) -> DynP ()
1099 dfs <- getCmdLineState
1100 putCmdLineState $! (f dfs)
1102 setDynFlag, unSetDynFlag :: DynFlag -> DynP ()
1103 setDynFlag f = upd (\dfs -> dopt_set dfs f)
1104 unSetDynFlag f = upd (\dfs -> dopt_unset dfs f)
1106 setDumpFlag :: DynFlag -> OptKind DynP
1107 setDumpFlag dump_flag
1108 = NoArg (setDynFlag Opt_ForceRecomp >> setDynFlag dump_flag)
1109 -- Whenver we -ddump, switch off the recompilation checker,
1110 -- else you don't see the dump!
1112 setVerbosity :: Maybe Int -> DynP ()
1113 setVerbosity mb_n = upd (\dfs -> dfs{ verbosity = mb_n `orElse` 3 })
1115 addCmdlineHCInclude a = upd (\s -> s{cmdlineHcIncludes = a : cmdlineHcIncludes s})
1117 extraPkgConf_ p = upd (\s -> s{ extraPkgConfs = p : extraPkgConfs s })
1120 upd (\s -> s{ packageFlags = ExposePackage p : packageFlags s })
1122 upd (\s -> s{ packageFlags = HidePackage p : packageFlags s })
1124 upd (\s -> s{ packageFlags = IgnorePackage p : packageFlags s })
1127 | Nothing <- unpackPackageId pid
1128 = throwDyn (CmdLineError ("cannot parse \'" ++ p ++ "\' as a package identifier"))
1130 = \s -> s{ thisPackage = pid }
1132 pid = stringToPackageId p
1134 -- we can only switch between HscC, and HscAsmm with dynamic flags
1135 -- (-fvia-C, -fasm, -filx respectively).
1136 setTarget l = upd (\dfs -> case hscTarget dfs of
1137 HscC -> dfs{ hscTarget = l }
1138 HscAsm -> dfs{ hscTarget = l }
1141 setOptLevel :: Int -> DynFlags -> DynFlags
1142 setOptLevel n dflags
1143 | hscTarget dflags == HscInterpreted && n > 0
1145 -- not in IO any more, oh well:
1146 -- putStr "warning: -O conflicts with --interactive; -O ignored.\n"
1148 = updOptLevel n dflags
1151 setMainIs :: String -> DynP ()
1153 | not (null main_fn) -- The arg looked like "Foo.baz"
1154 = upd $ \d -> d{ mainFunIs = Just main_fn,
1155 mainModIs = mkModule mainPackageId (mkModuleName main_mod) }
1157 | isUpper (head main_mod) -- The arg looked like "Foo"
1158 = upd $ \d -> d{ mainModIs = mkModule mainPackageId (mkModuleName main_mod) }
1160 | otherwise -- The arg looked like "baz"
1161 = upd $ \d -> d{ mainFunIs = Just main_mod }
1163 (main_mod, main_fn) = splitLongestPrefix arg (== '.')
1165 -----------------------------------------------------------------------------
1166 -- Paths & Libraries
1168 -- -i on its own deletes the import paths
1169 addImportPath "" = upd (\s -> s{importPaths = []})
1170 addImportPath p = upd (\s -> s{importPaths = importPaths s ++ splitPathList p})
1174 upd (\s -> s{libraryPaths = libraryPaths s ++ splitPathList p})
1177 upd (\s -> s{includePaths = includePaths s ++ splitPathList p})
1179 addFrameworkPath p =
1180 upd (\s -> s{frameworkPaths = frameworkPaths s ++ splitPathList p})
1182 split_marker = ':' -- not configurable (ToDo)
1184 splitPathList :: String -> [String]
1185 splitPathList s = filter notNull (splitUp s)
1186 -- empty paths are ignored: there might be a trailing
1187 -- ':' in the initial list, for example. Empty paths can
1188 -- cause confusion when they are translated into -I options
1189 -- for passing to gcc.
1191 #ifndef mingw32_TARGET_OS
1192 splitUp xs = split split_marker xs
1194 -- Windows: 'hybrid' support for DOS-style paths in directory lists.
1196 -- That is, if "foo:bar:baz" is used, this interpreted as
1197 -- consisting of three entries, 'foo', 'bar', 'baz'.
1198 -- However, with "c:/foo:c:\\foo;x:/bar", this is interpreted
1199 -- as 3 elts, "c:/foo", "c:\\foo", "x:/bar"
1201 -- Notice that no attempt is made to fully replace the 'standard'
1202 -- split marker ':' with the Windows / DOS one, ';'. The reason being
1203 -- that this will cause too much breakage for users & ':' will
1204 -- work fine even with DOS paths, if you're not insisting on being silly.
1207 splitUp (x:':':div:xs) | div `elem` dir_markers
1208 = ((x:':':div:p): splitUp rs)
1210 (p,rs) = findNextPath xs
1211 -- we used to check for existence of the path here, but that
1212 -- required the IO monad to be threaded through the command-line
1213 -- parser which is quite inconvenient. The
1214 splitUp xs = cons p (splitUp rs)
1216 (p,rs) = findNextPath xs
1221 -- will be called either when we've consumed nought or the
1222 -- "<Drive>:/" part of a DOS path, so splitting is just a Q of
1223 -- finding the next split marker.
1225 case break (`elem` split_markers) xs of
1226 (p, d:ds) -> (p, ds)
1229 split_markers :: [Char]
1230 split_markers = [':', ';']
1232 dir_markers :: [Char]
1233 dir_markers = ['/', '\\']
1236 -- -----------------------------------------------------------------------------
1237 -- tmpDir, where we store temporary files.
1239 setTmpDir :: FilePath -> DynFlags -> DynFlags
1240 setTmpDir dir dflags = dflags{ tmpDir = canonicalise dir }
1242 #if !defined(mingw32_HOST_OS)
1243 canonicalise p = normalisePath p
1245 -- Canonicalisation of temp path under win32 is a bit more
1246 -- involved: (a) strip trailing slash,
1247 -- (b) normalise slashes
1248 -- (c) just in case, if there is a prefix /cygdrive/x/, change to x:
1250 canonicalise path = normalisePath (xltCygdrive (removeTrailingSlash path))
1252 -- if we're operating under cygwin, and TMP/TEMP is of
1253 -- the form "/cygdrive/drive/path", translate this to
1254 -- "drive:/path" (as GHC isn't a cygwin app and doesn't
1255 -- understand /cygdrive paths.)
1257 | "/cygdrive/" `isPrefixOf` path =
1258 case drop (length "/cygdrive/") path of
1259 drive:xs@('/':_) -> drive:':':xs
1263 -- strip the trailing backslash (awful, but we only do this once).
1264 removeTrailingSlash path =
1271 -----------------------------------------------------------------------------
1274 setOptHpcDir :: String -> DynP ()
1275 setOptHpcDir arg = upd $ \ d -> d{hpcDir = arg}
1277 -----------------------------------------------------------------------------
1278 -- Via-C compilation stuff
1280 machdepCCOpts :: DynFlags -> ([String], -- flags for all C compilations
1281 [String]) -- for registerised HC compilations
1282 machdepCCOpts dflags
1283 #if alpha_TARGET_ARCH
1285 #ifdef HAVE_THREADED_RTS_SUPPORT
1289 -- For now, to suppress the gcc warning "call-clobbered
1290 -- register used for global register variable", we simply
1291 -- disable all warnings altogether using the -w flag. Oh well.
1293 #elif hppa_TARGET_ARCH
1294 -- ___HPUX_SOURCE, not _HPUX_SOURCE, is #defined if -ansi!
1295 -- (very nice, but too bad the HP /usr/include files don't agree.)
1296 = ( ["-D_HPUX_SOURCE"], [] )
1298 #elif m68k_TARGET_ARCH
1299 -- -fno-defer-pop : for the .hc files, we want all the pushing/
1300 -- popping of args to routines to be explicit; if we let things
1301 -- be deferred 'til after an STGJUMP, imminent death is certain!
1303 -- -fomit-frame-pointer : *don't*
1304 -- It's better to have a6 completely tied up being a frame pointer
1305 -- rather than let GCC pick random things to do with it.
1306 -- (If we want to steal a6, then we would try to do things
1307 -- as on iX86, where we *do* steal the frame pointer [%ebp].)
1308 = ( [], ["-fno-defer-pop", "-fno-omit-frame-pointer"] )
1310 #elif i386_TARGET_ARCH
1311 -- -fno-defer-pop : basically the same game as for m68k
1313 -- -fomit-frame-pointer : *must* in .hc files; because we're stealing
1314 -- the fp (%ebp) for our register maps.
1315 = let n_regs = stolen_x86_regs dflags
1318 ( [ if sta then "-DDONT_WANT_WIN32_DLL_SUPPORT" else ""
1319 -- , if suffixMatch "mingw32" cTARGETPLATFORM then "-mno-cygwin" else ""
1322 #ifdef HAVE_GCC_MNO_OMIT_LFPTR
1323 -- Some gccs are configured with
1324 -- -momit-leaf-frame-pointer on by default, and it
1325 -- apparently takes precedence over
1326 -- -fomit-frame-pointer, so we disable it first here.
1327 "-mno-omit-leaf-frame-pointer",
1329 #ifdef HAVE_GCC_HAS_NO_UNIT_AT_A_TIME
1330 "-fno-unit-at-a-time",
1331 -- unit-at-a-time doesn't do us any good, and screws
1332 -- up -split-objs by moving the split markers around.
1333 -- It's only turned on with -O2, but put it here just
1334 -- in case someone uses -optc-O2.
1336 "-fomit-frame-pointer",
1337 -- we want -fno-builtin, because when gcc inlines
1338 -- built-in functions like memcpy() it tends to
1339 -- run out of registers, requiring -monly-n-regs
1341 "-DSTOLEN_X86_REGS="++show n_regs ]
1344 #elif ia64_TARGET_ARCH
1345 = ( [], ["-fomit-frame-pointer", "-G0"] )
1347 #elif x86_64_TARGET_ARCH
1348 = ( [], ["-fomit-frame-pointer",
1349 "-fno-asynchronous-unwind-tables",
1350 -- the unwind tables are unnecessary for HC code,
1351 -- and get in the way of -split-objs. Another option
1352 -- would be to throw them away in the mangler, but this
1354 #ifdef HAVE_GCC_HAS_NO_UNIT_AT_A_TIME
1355 "-fno-unit-at-a-time",
1356 -- unit-at-a-time doesn't do us any good, and screws
1357 -- up -split-objs by moving the split markers around.
1358 -- It's only turned on with -O2, but put it here just
1359 -- in case someone uses -optc-O2.
1362 -- calling builtins like strlen() using the FFI can
1363 -- cause gcc to run out of regs, so use the external
1367 #elif sparc_TARGET_ARCH
1369 -- For now, to suppress the gcc warning "call-clobbered
1370 -- register used for global register variable", we simply
1371 -- disable all warnings altogether using the -w flag. Oh well.
1373 #elif powerpc_apple_darwin_TARGET
1375 -- Disable Apple's precompiling preprocessor. It's a great thing
1376 -- for "normal" programs, but it doesn't support register variable
1378 = ( [], ["-no-cpp-precomp"] )
1383 picCCOpts :: DynFlags -> [String]
1385 #if darwin_TARGET_OS
1386 -- Apple prefers to do things the other way round.
1387 -- PIC is on by default.
1388 -- -mdynamic-no-pic:
1389 -- Turn off PIC code generation.
1391 -- Don't generate "common" symbols - these are unwanted
1392 -- in dynamic libraries.
1397 = ["-mdynamic-no-pic"]
1398 #elif mingw32_TARGET_OS
1399 -- no -fPIC for Windows
1408 -- -----------------------------------------------------------------------------
1413 #if defined(i386_TARGET_ARCH) \
1414 || defined(x86_64_TARGET_ARCH) \
1415 || defined(alpha_TARGET_ARCH) \
1416 || defined(hppa_TARGET_ARCH) \
1417 || defined(m68k_TARGET_ARCH) \
1418 || defined(mips_TARGET_ARCH) \
1419 || defined(powerpc_TARGET_ARCH) \
1420 || defined(rs6000_TARGET_ARCH) \
1421 || defined(sparc_TARGET_ARCH)