X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FcodeGen%2FCgExtCode.hs;h=12efa03da0527fa478fe5d2c2e2c49ab4c424b42;hp=03ac75e0ba3fe63d505bf7329d1e2bafca05ce6b;hb=86add45dbfb6f962b65e371143dd467ae783f9e7;hpb=a02e7f40afc1aab7fe466f949f505c1d7250713d diff --git a/compiler/codeGen/CgExtCode.hs b/compiler/codeGen/CgExtCode.hs index 03ac75e..12efa03 100644 --- a/compiler/codeGen/CgExtCode.hs +++ b/compiler/codeGen/CgExtCode.hs @@ -21,7 +21,6 @@ module CgExtCode ( newLabel, newFunctionName, newImport, - lookupLabel, lookupName, @@ -40,9 +39,9 @@ where import CgMonad import CLabel -import Cmm +import OldCmm -import BasicTypes +-- import BasicTypes import BlockId import FastString import Module @@ -129,8 +128,8 @@ newLocal ty name = do newLabel :: FastString -> ExtFCode BlockId newLabel name = do u <- code newUnique - addLabel name (BlockId u) - return (BlockId u) + addLabel name (mkBlockId u) + return (mkBlockId u) -- | Add add a local function to the environment. @@ -146,14 +145,13 @@ newFunctionName name pkg -- | Add an imported foreign label to the list of local declarations. -- If this is done at the start of the module the declaration will scope -- over the whole module. --- CLabel's labelDynamic classifies these labels as dynamic, hence the --- code generator emits PIC code for them. -newImport :: (Maybe PackageId, FastString) -> ExtFCode () -newImport (Nothing, name) - = addVarDecl name (CmmLit (CmmLabel (mkForeignLabel name Nothing True IsFunction))) +newImport + :: (FastString, CLabel) + -> ExtFCode () + +newImport (name, cmmLabel) + = addVarDecl name (CmmLit (CmmLabel cmmLabel)) -newImport (Just pkg, name) - = addVarDecl name (CmmLit (CmmLabel (mkCmmCodeLabel pkg name))) -- | Lookup the BlockId bound to the label with this name. -- If one hasn't been bound yet, create a fresh one based on the @@ -164,7 +162,7 @@ lookupLabel name = do return $ case lookupUFM env name of Just (Label l) -> l - _other -> BlockId (newTagUnique (getUnique name) 'L') + _other -> mkBlockId (newTagUnique (getUnique name) 'L') -- | Lookup the location of a named variable.