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
e49dae36
Commit
e49dae36
authored
Jun 30, 2011
by
batterseapower
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore home-package-plugin functionality
parent
fe7eac51
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
21 deletions
+49
-21
compiler/main/DriverPipeline.hs
compiler/main/DriverPipeline.hs
+2
-2
compiler/main/DynFlags.hs
compiler/main/DynFlags.hs
+5
-1
compiler/main/GHC.hs
compiler/main/GHC.hs
+1
-1
compiler/main/GhcMake.hs
compiler/main/GhcMake.hs
+3
-3
compiler/main/HscTypes.lhs
compiler/main/HscTypes.lhs
+29
-13
compiler/typecheck/TcRnDriver.lhs
compiler/typecheck/TcRnDriver.lhs
+9
-1
No files found.
compiler/main/DriverPipeline.hs
View file @
e49dae36
...
...
@@ -934,8 +934,8 @@ runPhase (Hsc src_flavour) input_fn dflags0
ms_location
=
location4
,
ms_hs_date
=
src_timestamp
,
ms_obj_date
=
Nothing
,
ms_
imps
=
imps
,
ms_srcimps
=
src_imps
}
ms_
textual_imps
=
imps
,
ms_srcimps
=
src_imps
}
-- run the compiler!
result
<-
io
$
hscCompileOneShot
hsc_env'
...
...
compiler/main/DynFlags.hs
View file @
e49dae36
...
...
@@ -30,7 +30,7 @@ module DynFlags (
DynLibLoader
(
..
),
fFlags
,
fLangFlags
,
xFlags
,
DPHBackend
(
..
),
dphPackageMaybe
,
wayNames
,
wayNames
,
dynFlagDependencies
,
-- ** Safe Haskell
SafeHaskellMode
(
..
),
...
...
@@ -980,6 +980,10 @@ setLanguage l = upd f
extensionFlags
=
flattenExtensionFlags
mLang
oneoffs
}
-- | Some modules have dependencies on others through the DynFlags rather than textual imports
dynFlagDependencies
::
DynFlags
->
[
ModuleName
]
dynFlagDependencies
=
pluginModNames
-- | Is the Safe Haskell safe language in use
safeLanguageOn
::
DynFlags
->
Bool
safeLanguageOn
dflags
=
s
==
Sf_SafeLanguage
...
...
compiler/main/GHC.hs
View file @
e49dae36
...
...
@@ -816,7 +816,7 @@ compileCoreToObj simplify cm@(CoreModule{ cm_module = mName }) = do
ms_obj_date
=
Nothing
,
-- Only handling the single-module case for now, so no imports.
ms_srcimps
=
[]
,
ms_imps
=
[]
,
ms_
textual_
imps
=
[]
,
-- No source file
ms_hspp_file
=
""
,
ms_hspp_opts
=
dflags
,
...
...
compiler/main/GhcMake.hs
View file @
e49dae36
...
...
@@ -1254,7 +1254,7 @@ summariseFile hsc_env old_summaries file mb_phase obj_allowed maybe_buf
ms_hspp_file
=
hspp_fn
,
ms_hspp_opts
=
dflags'
,
ms_hspp_buf
=
Just
buf
,
ms_srcimps
=
srcimps
,
ms_imps
=
the_imps
,
ms_srcimps
=
srcimps
,
ms_
textual_
imps
=
the_imps
,
ms_hs_date
=
src_timestamp
,
ms_obj_date
=
obj_timestamp
})
...
...
@@ -1379,8 +1379,8 @@ summariseModule hsc_env old_summary_map is_boot (L loc wanted_mod)
ms_hspp_file
=
hspp_fn
,
ms_hspp_opts
=
dflags'
,
ms_hspp_buf
=
Just
buf
,
ms_srcimps
=
srcimps
,
ms_
imps
=
the_imps
,
ms_srcimps
=
srcimps
,
ms_
textual_imps
=
the_imps
,
ms_hs_date
=
src_timestamp
,
ms_obj_date
=
obj_timestamp
}))
...
...
compiler/main/HscTypes.lhs
View file @
e49dae36
...
...
@@ -17,7 +17,7 @@ module HscTypes (
ModGuts(..), CgGuts(..), ForeignStubs(..), appendStubC,
ImportedMods, ImportedModsVal,
ModSummary(..), ms_mod_name, showModMsg, isBootSummary,
ModSummary(..), ms_
imps, ms_
mod_name, showModMsg, isBootSummary,
msHsFilePath, msHiFilePath, msObjFilePath,
-- * Information about the module being compiled
...
...
@@ -131,7 +131,7 @@ import DataCon ( DataCon, dataConImplicitIds, dataConWrapId )
import PrelNames ( gHC_PRIM )
import Packages hiding ( Version(..) )
import DynFlags ( DynFlags(..), isOneShot, HscTarget (..), dopt,
DynFlag(..), SafeHaskellMode(..) )
DynFlag(..), SafeHaskellMode(..)
, dynFlagDependencies
)
import DriverPhases ( HscSource(..), isHsBoot, hscSourceString, Phase )
import BasicTypes ( IPName, defaultFixity, WarningTxt(..) )
import OptimizationFuel ( OptFuelState )
...
...
@@ -1656,22 +1656,38 @@ emptyMG = []
-- * An external-core source module
data ModSummary
= ModSummary {
ms_mod
:: Module,
-- ^ Identity of the module
ms_hsc_src :: HscSource, -- ^ The module source either plain Haskell, hs-boot or external core
ms_location :: ModLocation, -- ^ Location of the various files belonging to the module
ms_hs_date :: ClockTime, -- ^ Timestamp of source file
ms_obj_date :: Maybe ClockTime, -- ^ Timestamp of object, if we have one
ms_srcimps :: [Located (ImportDecl RdrName)], -- ^ Source imports of the module
ms_
imps :: [Located (ImportDecl RdrName)], -- ^ Non-source imports of the module
ms_hspp_file :: FilePath, -- ^ Filename of preprocessed source file
ms_hspp_opts
:: DynFlags,
-- ^ Cached flags from @OPTIONS@, @INCLUDE@
ms_mod
:: Module,
-- ^ Identity of the module
ms_hsc_src
:: HscSource, -- ^ The module source either plain Haskell, hs-boot or external core
ms_location
:: ModLocation, -- ^ Location of the various files belonging to the module
ms_hs_date
:: ClockTime, -- ^ Timestamp of source file
ms_obj_date
:: Maybe ClockTime, -- ^ Timestamp of object, if we have one
ms_srcimps
:: [Located (ImportDecl RdrName)], -- ^ Source imports of the module
ms_
textual_imps :: [Located (ImportDecl RdrName)], -- ^ Non-source imports of the module from the module *text*
ms_hspp_file
:: FilePath, -- ^ Filename of preprocessed source file
ms_hspp_opts
:: DynFlags,
-- ^ Cached flags from @OPTIONS@, @INCLUDE@
-- and @LANGUAGE@ pragmas in the modules source code
ms_hspp_buf
:: Maybe StringBuffer
-- ^ The actual preprocessed source, if we have it
ms_hspp_buf
:: Maybe StringBuffer
-- ^ The actual preprocessed source, if we have it
}
ms_mod_name :: ModSummary -> ModuleName
ms_mod_name = moduleName . ms_mod
ms_imps :: ModSummary -> [Located (ImportDecl RdrName)]
ms_imps ms = ms_textual_imps ms ++ map mk_additional_import (dynFlagDependencies (ms_hspp_opts ms))
where
-- This is a not-entirely-satisfactory means of creating an import that corresponds to an
-- import that did not occur in the program text, such as those induced by the use of
-- plugins (the -plgFoo flag)
mk_additional_import mod_nm = noLoc $ ImportDecl {
ideclName = noLoc mod_nm,
ideclPkgQual = Nothing,
ideclSource = False,
ideclQualified = False,
ideclAs = Nothing,
ideclHiding = Nothing,
ideclSafe = False
}
-- The ModLocation contains both the original source filename and the
-- filename of the cleaned-up source file after all preprocessing has been
-- done. The point is that the summariser will have to cpp/unlit/whatever
...
...
@@ -1697,7 +1713,7 @@ instance Outputable ModSummary where
nest 3 (sep [text "ms_hs_date = " <> text (show (ms_hs_date ms)),
text "ms_mod =" <+> ppr (ms_mod ms)
<> text (hscSourceString (ms_hsc_src ms)) <> comma,
text "ms_
imps =" <+> ppr (ms
_imps ms),
text "ms_
textual_imps =" <+> ppr (ms_textual
_imps ms),
text "ms_srcimps =" <+> ppr (ms_srcimps ms)]),
char '}'
]
...
...
compiler/typecheck/TcRnDriver.lhs
View file @
e49dae36
...
...
@@ -204,7 +204,15 @@ tcRnImports hsc_env this_mod import_decls
= do { (rn_imports, rdr_env, imports,hpc_info) <- rnImports import_decls ;
; let { dep_mods :: ModuleNameEnv (ModuleName, IsBootInterface)
; dep_mods = imp_dep_mods imports
-- Make sure we record the dependencies from the DynFlags in the EPS or we
-- end up hitting the sanity check in LoadIface.loadInterface that
-- checks for unknown home-package modules being loaded. We put
-- these dependencies on the left so their (non-source) imports
-- take precedence over the (possibly-source) imports on the right.
-- We don't add them to any other field (e.g. the imp_dep_mods of
-- imports) because we don't want to load their instances etc.
; dep_mods = listToUFM [(mod_nm, (mod_nm, False)) | mod_nm <- dynFlagDependencies (hsc_dflags hsc_env)]
`plusUFM` imp_dep_mods imports
-- We want instance declarations from all home-package
-- modules below this one, including boot modules, except
...
...
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