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
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
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
Alex D
GHC
Commits
62070c7f
Commit
62070c7f
authored
May 28, 2009
by
simonpj@microsoft.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move getMainFun to TcRnDriver, trim DynFlags imports
parent
fce8977b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
12 deletions
+7
-12
compiler/main/DynFlags.hs
compiler/main/DynFlags.hs
+1
-11
compiler/typecheck/TcRnDriver.lhs
compiler/typecheck/TcRnDriver.lhs
+6
-1
No files found.
compiler/main/DynFlags.hs
View file @
62070c7f
...
...
@@ -31,7 +31,6 @@ module DynFlags (
dopt_set
,
dopt_unset
,
-- DynFlags -> DynFlag -> DynFlags
getOpts
,
-- DynFlags -> (DynFlags -> [a]) -> [a]
getVerbFlag
,
getMainFun
,
updOptLevel
,
setTmpDir
,
setPackageName
,
...
...
@@ -69,9 +68,7 @@ import Platform
#
endif
import
Module
import
PackageConfig
import
PrelNames
(
mAIN
,
main_RDR_Unqual
)
import
RdrName
(
RdrName
,
mkRdrUnqual
)
import
OccName
(
mkVarOccFS
)
import
PrelNames
(
mAIN
)
#
if
defined
(
i386_TARGET_ARCH
)
||
(
!
defined
(
mingw32_TARGET_OS
)
&&
!
defined
(
darwin_TARGET_OS
))
import
StaticFlags
(
opt_Static
)
#
endif
...
...
@@ -2104,13 +2101,6 @@ setMainIs arg
where
(
main_mod
,
main_fn
)
=
splitLongestPrefix
arg
(
==
'.'
)
-- | Get the unqualified name of the function to use as the \"main\" for the main module.
-- Either returns the default name or the one configured on the command line with -main-is
getMainFun
::
DynFlags
->
RdrName
getMainFun
dflags
=
case
(
mainFunIs
dflags
)
of
Just
fn
->
mkRdrUnqual
(
mkVarOccFS
(
mkFastString
fn
))
Nothing
->
main_RDR_Unqual
-----------------------------------------------------------------------------
-- Paths & Libraries
...
...
compiler/typecheck/TcRnDriver.lhs
View file @
62070c7f
...
...
@@ -34,7 +34,6 @@ import DynFlags
import StaticFlags
import HsSyn
import RdrHsSyn
import PrelNames
import RdrName
import TcHsSyn
...
...
@@ -944,6 +943,12 @@ check_main dflags tcg_env
pp_main_fn | main_fn == main_RDR_Unqual = ptext (sLit "function") <+> quotes (ppr main_fn)
| otherwise = ptext (sLit "main function") <+> quotes (ppr main_fn)
-- | Get the unqualified name of the function to use as the \"main\" for the main module.
-- Either returns the default name or the one configured on the command line with -main-is
getMainFun :: DynFlags -> RdrName
getMainFun dflags = case (mainFunIs dflags) of
Just fn -> mkRdrUnqual (mkVarOccFS (mkFastString fn))
Nothing -> main_RDR_Unqual
\end{code}
Note [Root-main Id]
...
...
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