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
Model registry
Operate
Terraform modules
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
Gesh
GHC
Commits
1fb5dd7a
Commit
1fb5dd7a
authored
27 years ago
by
sof
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1997-09-04 20:12:21 by sof]
error msg tidy up
parent
e43e83f4
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/compiler/rename/Rename.lhs
+44
-18
44 additions, 18 deletions
ghc/compiler/rename/Rename.lhs
with
44 additions
and
18 deletions
ghc/compiler/rename/Rename.lhs
+
44
−
18
View file @
1fb5dd7a
...
...
@@ -45,10 +45,15 @@ import TysWiredIn ( unitTyCon, intTyCon, doubleTyCon )
import PrelInfo ( ioTyCon_NAME, primIoTyCon_NAME )
import TyCon ( TyCon )
import PrelMods ( mAIN, gHC_MAIN )
import ErrUtils ( SYN_IE(Error), SYN_IE(Warning) )
import ErrUtils ( SYN_IE(Error), SYN_IE(Warning), pprBagOfErrors,
doIfSet, dumpIfSet, ghcExit
)
import FiniteMap ( emptyFM, eltsFM, fmToList, addToFM, FiniteMap )
import Pretty
import Outputable ( Outputable(..), PprStyle(..) )
import Outputable ( Outputable(..), PprStyle(..),
pprErrorsStyle, pprDumpStyle, printErrs
)
import Bag ( isEmptyBag )
import Util ( cmpPString, equivClasses, panic, assertPanic, pprTrace )
#if __GLASGOW_HASKELL__ >= 202
import UniqSupply
...
...
@@ -60,24 +65,46 @@ import UniqSupply
\begin{code}
renameModule :: UniqSupply
-> RdrNameHsModule
-> IO (Maybe -- Nothing <=> everything up to date;
-- no ned to recompile any further
(RenamedHsModule, -- Output, after renaming
-> IO (Maybe (RenamedHsModule, -- Output, after renaming
InterfaceDetails, -- Interface; for interface file generatino
RnNameSupply, -- Final env; for renaming derivings
[Module]), -- Imported modules; for profiling
Bag Error,
Bag Warning
)
\end{code}
[Module])) -- Imported modules; for profiling
\begin{code}
renameModule us this_mod@(HsModule mod_name vers exports imports fixities local_decls loc)
= -- INITIALISE THE RENAMER MONAD
initRn mod_name us (mkSearchPath opt_HiMap) loc $
= -- Initialise the renamer monad
initRn mod_name us (mkSearchPath opt_HiMap) loc
(rename this_mod) >>=
\ (maybe_rn_stuff, rn_errs_bag, rn_warns_bag) ->
-- Check for warnings
doIfSet (not (isEmptyBag rn_warns_bag))
(print_errs rn_warns_bag) >>
-- Check for errors; exit if so
doIfSet (not (isEmptyBag rn_errs_bag))
(print_errs rn_errs_bag >>
ghcExit 1
) >>
-- Dump output, if any
(case maybe_rn_stuff of
Nothing -> return ()
Just results@(rn_mod, _, _, _)
-> dumpIfSet opt_D_dump_rn "Renamer:"
(ppr pprDumpStyle rn_mod)
) >>
-- Return results
return maybe_rn_stuff
print_errs errs = printErrs (pprBagOfErrors pprErrorsStyle errs)
\end{code}
-- FIND THE GLOBAL NAME ENVIRONMENT
\begin{code}
rename this_mod@(HsModule mod_name vers exports imports fixities local_decls loc)
= -- FIND THE GLOBAL NAME ENVIRONMENT
getGlobalNames this_mod `thenRn` \ global_name_info ->
case global_name_info of {
...
...
@@ -278,9 +305,8 @@ rnStats all_decls
| opt_D_show_rn_trace ||
opt_D_show_rn_stats ||
opt_D_dump_rn
= getRnStats all_decls `thenRn` \ msg ->
ioToRnMG (hPutStr stderr (show msg) >>
hPutStr stderr "\n") `thenRn_`
= getRnStats all_decls `thenRn` \ msg ->
ioToRnMG (printErrs msg) `thenRn_`
returnRn ()
| otherwise = returnRn ()
...
...
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