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
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Yiming Yang
GHC
Commits
0f55a795
Commit
0f55a795
authored
27 years ago
by
sof
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1997-09-04 20:21:37 by sof]
ppr tidy up
parent
72592f20
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/compiler/coreSyn/CoreLint.lhs
+23
-14
23 additions, 14 deletions
ghc/compiler/coreSyn/CoreLint.lhs
with
23 additions
and
14 deletions
ghc/compiler/coreSyn/CoreLint.lhs
+
23
−
14
View file @
0f55a795
...
...
@@ -13,7 +13,7 @@ module CoreLint (
IMP_Ubiq()
import CmdLineOpts ( opt_
PprUserLength
)
import CmdLineOpts ( opt_
D_show_passes, opt_PprUserLength, opt_DoCoreLinting
)
import CoreSyn
import Bag
...
...
@@ -30,7 +30,8 @@ import Maybes ( catMaybes )
import Name ( isLocallyDefined, getSrcLoc, Name{-instance NamedThing-},
NamedThing(..) )
import PprCore
import Outputable ( PprStyle(..), Outputable(..) )
import Outputable ( PprStyle(..), Outputable(..), pprErrorsStyle, printErrs )
import ErrUtils ( doIfSet, ghcExit )
import PprType ( GenType, GenTyVar, TyCon )
import Pretty
import PrimOp ( primOpType, PrimOp(..) )
...
...
@@ -86,25 +87,33 @@ Outstanding issues:
--
\begin{code}
lintCoreBindings
:: PprStyle -> String -> Bool -> [CoreBinding] -> [CoreBinding]
lintCoreBindings :: String -> Bool -> [CoreBinding] -> IO ()
lintCoreBindings sty whoDunnit spec_done binds
lintCoreBindings whoDunnit spec_done binds
| not opt_DoCoreLinting
= return ()
lintCoreBindings whoDunnit spec_done binds
= case (initL (lint_binds binds) spec_done) of
Nothing -> binds
Just msg ->
pprPanic "" (vcat [
text ("*** Core Lint Errors: in " ++ whoDunnit ++ " ***"),
msg sty,
ptext SLIT("*** Offending Program ***"),
vcat (map (pprCoreBinding sty) binds),
ptext SLIT("*** End of Offense ***")
])
Nothing -> doIfSet opt_D_show_passes
(hPutStr stderr ("*** Core Linted result of " ++ whoDunnit ++ "\n"))
Just bad_news -> printErrs (display bad_news) >>
ghcExit 1
where
lint_binds [] = returnL ()
lint_binds (bind:binds)
= lintCoreBinding bind `thenL` \binders ->
addInScopeVars binders (lint_binds binds)
display bad_news
= vcat [
text ("*** Core Lint Errors: in result of " ++ whoDunnit ++ " ***"),
bad_news pprErrorsStyle,
ptext SLIT("*** Offending Program ***"),
pprCoreBindings pprErrorsStyle binds,
ptext SLIT("*** End of Offense ***")
]
\end{code}
%************************************************************************
...
...
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