Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
ee7c4f43
Commit
ee7c4f43
authored
Jun 18, 2012
by
Ian Lynagh
Browse files
Make -ignore-dot-ghci a dynamic flag
parent
e6e3a960
Changes
4
Hide whitespace changes
Inline
Side-by-side
compiler/main/DynFlags.hs
View file @
ee7c4f43
...
...
@@ -303,6 +303,7 @@ data DynFlag
|
Opt_BuildingCabalPackage
|
Opt_SSE2
|
Opt_SSE4_2
|
Opt_IgnoreDotGhci
|
Opt_GhciSandbox
|
Opt_GhciHistory
|
Opt_HelpfulErrors
...
...
@@ -1798,6 +1799,8 @@ dynamic_flags = [
,
Flag
"fpackage-trust"
(
NoArg
setPackageTrust
)
,
Flag
"fno-safe-infer"
(
NoArg
(
setSafeHaskell
Sf_None
))
]
++
map
(
mkFlag
turnOn
""
setDynFlag
)
negatableFlags
++
map
(
mkFlag
turnOff
"no-"
unSetDynFlag
)
negatableFlags
++
map
(
mkFlag
turnOn
"d"
setDynFlag
)
dFlags
++
map
(
mkFlag
turnOff
"dno-"
unSetDynFlag
)
dFlags
++
map
(
mkFlag
turnOn
"f"
setDynFlag
)
fFlags
...
...
@@ -1920,6 +1923,11 @@ fWarningFlags = [
(
"warn-pointless-pragmas"
,
Opt_WarnPointlessPragmas
,
nop
),
(
"warn-unsupported-calling-conventions"
,
Opt_WarnUnsupportedCallingConventions
,
nop
)
]
-- | These @-\<blah\>@ flags can all be reversed with @-no-\<blah\>@
negatableFlags
::
[
FlagSpec
DynFlag
]
negatableFlags
=
[
(
"ignore-dot-ghci"
,
Opt_IgnoreDotGhci
,
nop
)
]
-- | These @-d\<blah\>@ flags can all be reversed with @-dno-\<blah\>@
dFlags
::
[
FlagSpec
DynFlag
]
dFlags
=
[
...
...
compiler/main/StaticFlags.hs
View file @
ee7c4f43
...
...
@@ -76,7 +76,6 @@ module StaticFlags (
opt_Static
,
-- misc opts
opt_IgnoreDotGhci
,
opt_ErrorSpans
,
opt_GranMacros
,
opt_HiVersion
,
...
...
@@ -195,9 +194,6 @@ unpacked_opts =
expandAts l = [l]
-}
opt_IgnoreDotGhci
::
Bool
opt_IgnoreDotGhci
=
lookUp
(
fsLit
"-ignore-dot-ghci"
)
-- debugging options
-- | Suppress all that is suppressable in core dumps.
-- Except for uniques, as some simplifier phases introduce new varibles that
...
...
docs/users_guide/flags.xml
View file @
ee7c4f43
...
...
@@ -489,7 +489,7 @@
<row>
<entry><option>
-ignore-dot-ghci
</option></entry>
<entry>
Disable reading of
<filename>
.ghci
</filename>
files
</entry>
<entry>
stat
ic
</entry>
<entry>
dynam
ic
</entry>
<entry>
-
</entry>
</row>
<row>
...
...
ghc/InteractiveUI.hs
View file @
ee7c4f43
...
...
@@ -49,7 +49,6 @@ import Linker
import
Maybes
(
orElse
,
expectJust
)
import
NameSet
import
Panic
hiding
(
showException
)
import
StaticFlags
import
Util
-- Haskell Libraries
...
...
@@ -389,8 +388,9 @@ withGhcAppData right left = do
runGHCi
::
[(
FilePath
,
Maybe
Phase
)]
->
Maybe
[
String
]
->
GHCi
()
runGHCi
paths
maybe_exprs
=
do
dflags
<-
getDynFlags
let
read_dot_files
=
not
o
pt_IgnoreDotGhci
read_dot_files
=
not
(
dopt
O
pt_IgnoreDotGhci
dflags
)
current_dir
=
return
(
Just
".ghci"
)
...
...
@@ -431,7 +431,6 @@ runGHCi paths maybe_exprs = do
setGHCContextFromGHCiState
dflags
<-
getDynFlags
when
(
read_dot_files
)
$
do
mcfgs0
<-
sequence
$
[
current_dir
,
app_user_dir
,
home_dir
]
++
map
(
return
.
Just
)
(
ghciScripts
dflags
)
mcfgs
<-
liftIO
$
mapM
canonicalizePath'
(
catMaybes
mcfgs0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment