Commit 9e8fea3e authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

Update 'getHaskellObjects' to take 'ComponentLocalBuildInfo'

Eliminating the use of deprecated 'getComponentLocalBuildInfo'
parent 99e83f87
......@@ -675,16 +675,16 @@ buildOrReplLib forRepl verbosity numJobs pkg_descr lbi lib clbi = do
| ghcVersion < mkVersion [7,2] -- ghc-7.2+ does not make _stub.o files
, x <- allLibModules lib clbi ]
hObjs <- Internal.getHaskellObjects implInfo lib lbi
hObjs <- Internal.getHaskellObjects implInfo lib lbi clbi
libTargetDir objExtension True
hProfObjs <-
if withProfLib lbi
then Internal.getHaskellObjects implInfo lib lbi
then Internal.getHaskellObjects implInfo lib lbi clbi
libTargetDir ("p_" ++ objExtension) True
else return []
hSharedObjs <-
if withSharedLib lbi
then Internal.getHaskellObjects implInfo lib lbi
then Internal.getHaskellObjects implInfo lib lbi clbi
libTargetDir ("dyn_" ++ objExtension) False
else return []
......
......@@ -356,8 +356,9 @@ ghcLookupProperty prop comp =
-- when using -split-objs, we need to search for object files in the
-- Module_split directory for each module.
getHaskellObjects :: GhcImplInfo -> Library -> LocalBuildInfo
-> ComponentLocalBuildInfo
-> FilePath -> String -> Bool -> NoCallStackIO [FilePath]
getHaskellObjects _implInfo lib lbi pref wanted_obj_ext allow_split_objs
getHaskellObjects _implInfo lib lbi clbi pref wanted_obj_ext allow_split_objs
| splitObjs lbi && allow_split_objs = do
let splitSuffix = "_" ++ wanted_obj_ext ++ "_split"
dirs = [ pref </> (ModuleName.toFilePath x ++ splitSuffix)
......@@ -371,8 +372,6 @@ getHaskellObjects _implInfo lib lbi pref wanted_obj_ext allow_split_objs
| otherwise =
return [ pref </> ModuleName.toFilePath x <.> wanted_obj_ext
| x <- allLibModules lib clbi ]
where
clbi = getComponentLocalBuildInfo lbi CLibName
mkGhcOptPackages :: ComponentLocalBuildInfo
-> [(UnitId, ModuleRenaming)]
......
......@@ -430,16 +430,16 @@ buildOrReplLib forRepl verbosity numJobs pkg_descr lbi lib clbi = do
sharedLibFilePath = libTargetDir </> mkSharedLibName compiler_id uid
ghciLibFilePath = libTargetDir </> Internal.mkGHCiLibName uid
hObjs <- Internal.getHaskellObjects implInfo lib lbi
hObjs <- Internal.getHaskellObjects implInfo lib lbi clbi
libTargetDir objExtension True
hProfObjs <-
if (withProfLib lbi)
then Internal.getHaskellObjects implInfo lib lbi
then Internal.getHaskellObjects implInfo lib lbi clbi
libTargetDir ("p_" ++ objExtension) True
else return []
hSharedObjs <-
if (withSharedLib lbi)
then Internal.getHaskellObjects implInfo lib lbi
then Internal.getHaskellObjects implInfo lib lbi clbi
libTargetDir ("dyn_" ++ objExtension) False
else return []
......
......@@ -364,16 +364,16 @@ buildLib verbosity pkg_descr lbi lib clbi = do
(ModuleName.toFilePath x ++"_stub")
| x <- allLibModules lib clbi ]
hObjs <- getHaskellObjects lib lbi
hObjs <- getHaskellObjects lib lbi clbi
pref objExtension True
hProfObjs <-
if (withProfLib lbi)
then getHaskellObjects lib lbi
then getHaskellObjects lib lbi clbi
pref ("p_" ++ objExtension) True
else return []
hSharedObjs <-
if (withSharedLib lbi)
then getHaskellObjects lib lbi
then getHaskellObjects lib lbi clbi
pref ("dyn_" ++ objExtension) False
else return []
......@@ -535,9 +535,9 @@ hackThreadedFlag verbosity comp prof bi
-- when using -split-objs, we need to search for object files in the
-- Module_split directory for each module.
getHaskellObjects :: Library -> LocalBuildInfo
getHaskellObjects :: Library -> LocalBuildInfo -> ComponentLocalBuildInfo
-> FilePath -> String -> Bool -> NoCallStackIO [FilePath]
getHaskellObjects lib lbi pref wanted_obj_ext allow_split_objs
getHaskellObjects lib lbi clbi pref wanted_obj_ext allow_split_objs
| splitObjs lbi && allow_split_objs = do
let dirs = [ pref </> (ModuleName.toFilePath x ++ "_split")
| x <- allLibModules lib clbi ]
......@@ -550,8 +550,6 @@ getHaskellObjects lib lbi pref wanted_obj_ext allow_split_objs
| otherwise =
return [ pref </> ModuleName.toFilePath x <.> wanted_obj_ext
| x <- allLibModules lib clbi ]
where
clbi = getComponentLocalBuildInfo lbi CLibName
constructGHCCmdLine
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment