diff options
Diffstat (limited to 'compiler/cmm')
-rw-r--r-- | compiler/cmm/CLabel.hs | 42 | ||||
-rw-r--r-- | compiler/cmm/CmmParse.y | 7 |
2 files changed, 24 insertions, 25 deletions
diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs index 5c8328116a..aacac3e0dd 100644 --- a/compiler/cmm/CLabel.hs +++ b/compiler/cmm/CLabel.hs @@ -103,11 +103,11 @@ module CLabel ( #include "HsVersions.h" -import Packages ( HomeModules ) import StaticFlags ( opt_Static, opt_DoTickyProfiling ) -import Packages ( isHomeModule, isDllName ) +import Packages ( isDllName ) import DataCon ( ConTag ) -import Module ( Module ) +import PackageConfig ( PackageId ) +import Module ( Module, modulePackageId ) import Name ( Name, isExternalName ) import Unique ( pprUnique, Unique ) import PrimOp ( PrimOp ) @@ -293,20 +293,20 @@ mkLocalInfoTableLabel name = IdLabel name InfoTable mkLocalEntryLabel name = IdLabel name Entry mkLocalClosureTableLabel name = IdLabel name ClosureTable -mkClosureLabel hmods name - | isDllName hmods name = DynIdLabel name Closure +mkClosureLabel this_pkg name + | isDllName this_pkg name = DynIdLabel name Closure | otherwise = IdLabel name Closure -mkInfoTableLabel hmods name - | isDllName hmods name = DynIdLabel name InfoTable +mkInfoTableLabel this_pkg name + | isDllName this_pkg name = DynIdLabel name InfoTable | otherwise = IdLabel name InfoTable -mkEntryLabel hmods name - | isDllName hmods name = DynIdLabel name Entry +mkEntryLabel this_pkg name + | isDllName this_pkg name = DynIdLabel name Entry | otherwise = IdLabel name Entry -mkClosureTableLabel hmods name - | isDllName hmods name = DynIdLabel name ClosureTable +mkClosureTableLabel this_pkg name + | isDllName this_pkg name = DynIdLabel name ClosureTable | otherwise = IdLabel name ClosureTable mkLocalConInfoTableLabel con = IdLabel con ConInfoTable @@ -320,12 +320,12 @@ mkConInfoTableLabel name True = DynIdLabel name ConInfoTable mkStaticInfoTableLabel name False = IdLabel name StaticInfoTable mkStaticInfoTableLabel name True = DynIdLabel name StaticInfoTable -mkConEntryLabel hmods name - | isDllName hmods name = DynIdLabel name ConEntry +mkConEntryLabel this_pkg name + | isDllName this_pkg name = DynIdLabel name ConEntry | otherwise = IdLabel name ConEntry -mkStaticConEntryLabel hmods name - | isDllName hmods name = DynIdLabel name StaticConEntry +mkStaticConEntryLabel this_pkg name + | isDllName this_pkg name = DynIdLabel name StaticConEntry | otherwise = IdLabel name StaticConEntry @@ -337,13 +337,13 @@ mkDefaultLabel uniq = CaseLabel uniq CaseDefault mkStringLitLabel = StringLitLabel mkAsmTempLabel = AsmTempLabel -mkModuleInitLabel :: HomeModules -> Module -> String -> CLabel -mkModuleInitLabel hmods mod way - = ModuleInitLabel mod way $! (not (isHomeModule hmods mod)) +mkModuleInitLabel :: PackageId -> Module -> String -> CLabel +mkModuleInitLabel this_pkg mod way + = ModuleInitLabel mod way $! modulePackageId mod /= this_pkg -mkPlainModuleInitLabel :: HomeModules -> Module -> CLabel -mkPlainModuleInitLabel hmods mod - = PlainModuleInitLabel mod $! (not (isHomeModule hmods mod)) +mkPlainModuleInitLabel :: PackageId -> Module -> CLabel +mkPlainModuleInitLabel this_pkg mod + = PlainModuleInitLabel mod $! modulePackageId mod /= this_pkg -- Some fixed runtime system labels diff --git a/compiler/cmm/CmmParse.y b/compiler/cmm/CmmParse.y index 5908314c87..a1cbbf51ed 100644 --- a/compiler/cmm/CmmParse.y +++ b/compiler/cmm/CmmParse.y @@ -38,7 +38,6 @@ import Unique import UniqFM import SrcLoc import DynFlags ( DynFlags, DynFlag(..) ) -import Packages ( HomeModules ) import StaticFlags ( opt_SccProfilingOn ) import ErrUtils ( printError, dumpIfSet_dyn, showPass ) import StringBuffer ( hGetStringBuffer ) @@ -907,8 +906,8 @@ initEnv = listToUFM [ Var (CmmLit (CmmInt (fromIntegral stdInfoTableSizeB) wordRep) )) ] -parseCmmFile :: DynFlags -> HomeModules -> FilePath -> IO (Maybe Cmm) -parseCmmFile dflags hmods filename = do +parseCmmFile :: DynFlags -> FilePath -> IO (Maybe Cmm) +parseCmmFile dflags filename = do showPass dflags "ParseCmm" buf <- hGetStringBuffer filename let @@ -919,7 +918,7 @@ parseCmmFile dflags hmods filename = do case unP cmmParse init_state of PFailed span err -> do printError span err; return Nothing POk _ code -> do - cmm <- initC dflags hmods no_module (getCmm (unEC code initEnv [] >> return ())) + cmm <- initC dflags no_module (getCmm (unEC code initEnv [] >> return ())) dumpIfSet_dyn dflags Opt_D_dump_cmm "Cmm" (pprCmms [cmm]) return (Just cmm) where |