Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glasgow Haskell Compiler
GHC
Commits
4ab7031d
Commit
4ab7031d
authored
8 months ago
by
Cheng Shao
Committed by
Torsten Schmits
7 months ago
Browse files
Options
Downloads
Patches
Plain Diff
compiler: implement --show-iface-abi-hash major mode
parent
969c9ace
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
compiler/GHC/Iface/Load.hs
+14
-1
14 additions, 1 deletion
compiler/GHC/Iface/Load.hs
docs/users_guide/expected-undocumented-flags.txt
+1
-0
1 addition, 0 deletions
docs/users_guide/expected-undocumented-flags.txt
ghc/Main.hs
+12
-0
12 additions, 0 deletions
ghc/Main.hs
with
27 additions
and
1 deletion
compiler/GHC/Iface/Load.hs
+
14
−
1
View file @
4ab7031d
...
...
@@ -33,7 +33,7 @@ module GHC.Iface.Load (
WhereFrom
(
..
),
pprModIfaceSimple
,
ifaceStats
,
pprModIface
,
showIface
,
ifaceStats
,
pprModIface
,
showIface
,
showIfaceAbiHash
,
module
Iface_Errors
-- avoids boot files in Ppr modules
)
where
...
...
@@ -1090,6 +1090,19 @@ showIface logger dflags unit_state name_cache filename = do
$
withPprStyle
(
mkDumpStyle
name_ppr_ctx
)
$
pprModIface
unit_state
iface
-- | Read binary interface, and print ABI hash. Unlike the
-- @--abi-hash@ major mode, the output is the ABI hash deserialized
-- from the interface directly.
showIfaceAbiHash
::
Logger
->
DynFlags
->
NameCache
->
FilePath
->
IO
()
showIfaceAbiHash
logger
dflags
name_cache
filename
=
do
let
profile
=
targetProfile
dflags
-- skip the hi way check and silence warnings
iface
<-
readBinIface
profile
name_cache
IgnoreHiWay
QuietBinIFace
filename
logMsg
logger
MCDump
noSrcSpan
$
ppr
$
mi_mod_hash
$
mi_final_exts
iface
-- | Show a ModIface but don't display details; suitable for ModIfaces stored in
-- the EPT.
pprModIfaceSimple
::
UnitState
->
ModIface
->
SDoc
...
...
This diff is collapsed.
Click to expand it.
docs/users_guide/expected-undocumented-flags.txt
+
1
−
0
View file @
4ab7031d
-#include
--abi-hash
--backpack
--show-iface-abi-hash
--show-packages
-Onot
-Walternative-layout-rule-transitional
...
...
This diff is collapsed.
Click to expand it.
ghc/Main.hs
+
12
−
0
View file @
4ab7031d
...
...
@@ -291,6 +291,10 @@ main' postLoadMode units dflags0 args flagWarnings = do
(
hsc_units
hsc_env
)
(
hsc_NC
hsc_env
)
f
ShowInterfaceAbiHash
f
->
liftIO
$
showIfaceAbiHash
logger
(
hsc_dflags
hsc_env
)
(
hsc_NC
hsc_env
)
f
DoMake
->
doMake
units
srcs
DoMkDependHS
->
doMkDependHS
(
map
fst
srcs
)
StopBefore
p
->
liftIO
(
oneShot
hsc_env
p
srcs
)
...
...
@@ -481,6 +485,8 @@ isShowGhciUsageMode _ = False
data
PostLoadMode
=
ShowInterface
FilePath
-- ghc --show-iface
|
ShowInterfaceAbiHash
FilePath
-- ghc --show-iface-abi-hash
|
DoMkDependHS
-- ghc -M
|
StopBefore
StopPhase
-- ghc -E | -C | -S
-- StopBefore StopLn is the default
...
...
@@ -505,6 +511,9 @@ showUnitsMode = mkPostLoadMode ShowPackages
showInterfaceMode
::
FilePath
->
Mode
showInterfaceMode
fp
=
mkPostLoadMode
(
ShowInterface
fp
)
showInterfaceAbiHashMode
::
FilePath
->
Mode
showInterfaceAbiHashMode
fp
=
mkPostLoadMode
(
ShowInterfaceAbiHash
fp
)
stopBeforeMode
::
StopPhase
->
Mode
stopBeforeMode
phase
=
mkPostLoadMode
(
StopBefore
phase
)
...
...
@@ -639,6 +648,9 @@ mode_flags =
[
defFlag
"-show-iface"
(
HasArg
(
\
f
->
setMode
(
showInterfaceMode
f
)
"--show-iface"
))
,
defFlag
"-show-iface-abi-hash"
(
HasArg
(
\
f
->
setMode
(
showInterfaceAbiHashMode
f
)
"--show-iface-abi-hash"
))
------- primary modes ------------------------------------------------
,
defFlag
"c"
(
PassFlag
(
\
f
->
do
setMode
(
stopBeforeMode
NoStop
)
f
addFlag
"-no-link"
f
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment