X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fghci%2FByteCodeLink.lhs;h=fabd5d1785a89a6c88e9a9b5759e523da52a5b2b;hb=8ffd91b6102f4ad3111cabdf6bdb1998f257887f;hp=389c9e7e29f9f1caf06ed0b6dc2a4a611e747f4c;hpb=f4c9109d7f1deb6f79c2c141f69ec24b7022776b;p=ghc-hetmet.git diff --git a/compiler/ghci/ByteCodeLink.lhs b/compiler/ghci/ByteCodeLink.lhs index 389c9e7..fabd5d1 100644 --- a/compiler/ghci/ByteCodeLink.lhs +++ b/compiler/ghci/ByteCodeLink.lhs @@ -6,6 +6,13 @@ ByteCodeLink: Bytecode assembler and linker \begin{code} {-# OPTIONS -optc-DNON_POSIX_SOURCE #-} +{-# OPTIONS -w #-} +-- The above warning supression flag is a temporary kludge. +-- While working on this module you are encouraged to remove it and fix +-- any warnings in the module. See +-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings +-- for details + module ByteCodeLink ( HValue, ClosureEnv, emptyClosureEnv, extendClosureEnv, @@ -27,10 +34,7 @@ import Module import PackageConfig import FastString import Panic - -#ifdef DEBUG import Outputable -#endif -- Standard libraries import GHC.Word ( Word(..) ) @@ -38,7 +42,6 @@ import GHC.Word ( Word(..) ) import Data.Array.Base import GHC.Arr ( STArray(..) ) -import Control.Exception ( throwDyn ) import Control.Monad ( zipWithM ) import Control.Monad.ST ( stToIO ) @@ -241,7 +244,7 @@ lookupIE ie con_nm linkFail :: String -> String -> IO a linkFail who what - = throwDyn (ProgramError $ + = ghcError (ProgramError $ unlines [ "" , "During interactive linking, GHCi couldn't find the following symbol:" , ' ' : ' ' : what @@ -262,7 +265,7 @@ nameToCLabel n suffix else qual_name where pkgid = modulePackageId mod - mod = nameModule n + mod = ASSERT( isExternalName n ) nameModule n package_part = unpackFS (zEncodeFS (packageIdFS (modulePackageId mod))) module_part = unpackFS (zEncodeFS (moduleNameFS (moduleName mod))) occ_part = unpackFS (zEncodeFS (occNameFS (nameOccName n))) @@ -271,7 +274,7 @@ nameToCLabel n suffix primopToCLabel :: PrimOp -> String{-suffix-} -> String primopToCLabel primop suffix - = let str = "base_GHCziPrimopWrappers_" ++ unpackFS (zEncodeFS (occNameFS (primOpOcc primop))) ++ '_':suffix + = let str = "ghczmprim_GHCziPrimopWrappers_" ++ unpackFS (zEncodeFS (occNameFS (primOpOcc primop))) ++ '_':suffix in --trace ("primopToCLabel: " ++ str) str \end{code}