Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4,323
Issues
4,323
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
377
Merge Requests
377
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
4274688a
Commit
4274688a
authored
May 20, 2020
by
Sylvain Henry
Committed by
Marge Bot
Jun 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move distrustAll into mkUnitState
parent
fca2d25f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
13 deletions
+12
-13
compiler/GHC/Unit/State.hs
compiler/GHC/Unit/State.hs
+12
-13
No files found.
compiler/GHC/Unit/State.hs
View file @
4274688a
...
...
@@ -570,7 +570,7 @@ initUnits :: DynFlags -> IO (DynFlags, [UnitId])
initUnits
dflags
=
do
let
forceUnitInfoMap
(
state
,
_
)
=
unitInfoMap
state
`
seq
`
()
(
state
,
raw_
dbs
)
<-
withTiming
dflags
(
state
,
dbs
)
<-
withTiming
dflags
(
text
"initializing package database"
)
forceUnitInfoMap
$
do
...
...
@@ -581,22 +581,14 @@ initUnits dflags = do
let
printer
=
debugTraceMsg
dflags
-- read the databases if they have not been already read
raw_
dbs
<-
case
unitDatabases
dflags
of
dbs
<-
case
unitDatabases
dflags
of
Nothing
->
readUnitDatabases
printer
cfg
Just
dbs
->
return
dbs
-- distrust all units if the flag is set
let
distrust_all
db
=
db
{
unitDatabaseUnits
=
distrustAllUnits
(
unitDatabaseUnits
db
)
}
dbs
|
unitConfigDistrustAll
cfg
=
map
distrust_all
raw_dbs
|
otherwise
=
raw_dbs
-- create the UnitState
state
<-
mkUnitState
ctx
(
printer
2
)
cfg
dbs
return
(
state
,
raw_
dbs
)
return
(
state
,
dbs
)
dumpIfSet_dyn
(
dflags
{
pprCols
=
200
})
Opt_D_dump_mod_map
"Mod Map"
FormatText
...
...
@@ -608,7 +600,7 @@ initUnits dflags = do
unwiredInsts
=
homeUnitInstantiations
dflags
wiredInsts
=
map
(
fmap
(
upd_wired_in_mod
wiringMap
))
unwiredInsts
return
(
dflags
{
unitDatabases
=
Just
raw_
dbs
,
return
(
dflags
{
unitDatabases
=
Just
dbs
,
unitState
=
state
,
homeUnitInstantiations
=
wiredInsts
},
(
preloadUnits
state
))
...
...
@@ -1443,7 +1435,7 @@ mkUnitState
-- the command line (later databases shadow earlier ones)
->
[
UnitDatabase
UnitId
]
->
IO
UnitState
mkUnitState
ctx
printer
cfg
dbs
=
do
mkUnitState
ctx
printer
cfg
raw_
dbs
=
do
{-
Plan.
...
...
@@ -1497,6 +1489,13 @@ mkUnitState ctx printer cfg dbs = do
we build a mapping saying what every in scope module name points to.
-}
-- distrust all units if the flag is set
let
distrust_all
db
=
db
{
unitDatabaseUnits
=
distrustAllUnits
(
unitDatabaseUnits
db
)
}
dbs
|
unitConfigDistrustAll
cfg
=
map
distrust_all
raw_dbs
|
otherwise
=
raw_dbs
-- This, and the other reverse's that you will see, are due to the fact that
-- packageFlags, pluginPackageFlags, etc. are all specified in *reverse* order
-- than they are on the command line.
...
...
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