From: sewardj Date: Mon, 10 Jan 2000 17:06:42 +0000 (+0000) Subject: [project @ 2000-01-10 17:06:41 by sewardj] X-Git-Tag: Approximately_9120_patches~5323 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=810bbf81f6446cf6770a1de6a8b2e970fb69fec8;p=ghc-hetmet.git [project @ 2000-01-10 17:06:41 by sewardj] This is the missing log message for the commit by sewardj at 2000/01/10 08:23:33 PST for these files: Some names in the standalone Prelude are referred to during desugaring in Hugs. These functions therefore need to be supplied from the GHC world in combined mode. Rename the relevant functions from primXYZ to hugsprimXYZ to distinguish them, in preparation for create of ghc/lib/std/PrelHugs.lhs. --------------------------------------------------------------------- --- diff --git a/ghc/interpreter/lib/Prelude.hs b/ghc/interpreter/lib/Prelude.hs index ce05049..df4613c 100644 --- a/ghc/interpreter/lib/Prelude.hs +++ b/ghc/interpreter/lib/Prelude.hs @@ -1545,6 +1545,9 @@ readFloat r = [(fromRational ((n%1)*10^^(k-d)),t) | (n,d,s) <- readFix r, -- Hooks for primitives: ----------------------------------------------------- -- Do not mess with these! +-- Anything named hugsprim needs to also be available in combined mode, +-- so any such function is also present in ghc/lib/std/PrelHugs.lhs. + primCompAux :: Ord a => a -> a -> Ordering -> Ordering primCompAux x y o = case compare x y of EQ -> o; LT -> LT; GT -> GT @@ -1557,21 +1560,6 @@ hugsprimPmInteger n x = fromInteger n == x primPmDouble :: Fractional a => Double -> a -> Bool primPmDouble n x = fromDouble n == x --- ToDo: make the message more informative. -primPmFail :: a -primPmFail = error "Pattern Match Failure" - --- used in desugaring Foreign functions -hugsprimMkIO :: (RealWorld -> (a,RealWorld)) -> IO a -hugsprimMkIO = ST - -hugsprimCreateAdjThunk :: (a -> b) -> String -> Char -> IO Addr -hugsprimCreateAdjThunk fun typestr callconv - = do sp <- makeStablePtr fun - p <- copy_String_to_cstring typestr -- is never freed - a <- primCreateAdjThunkARCH sp p callconv - return a - -- The following primitives are only needed if (n+k) patterns are enabled: hugsprimPmSub :: Integral a => Int -> a -> a hugsprimPmSub n x = x - fromInt n @@ -1585,6 +1573,21 @@ hugsprimPmSubtract x y = x - y hugsprimPmLe :: Integral a => a -> a -> Bool hugsprimPmLe x y = x <= y +-- ToDo: make the message more informative. +primPmFail :: a +primPmFail = error "Pattern Match Failure" + +-- used in desugaring Foreign functions +primMkIO :: (RealWorld -> (a,RealWorld)) -> IO a +primMkIO = ST + +primCreateAdjThunk :: (a -> b) -> String -> Char -> IO Addr +primCreateAdjThunk fun typestr callconv + = do sp <- makeStablePtr fun + p <- copy_String_to_cstring typestr -- is never freed + a <- primCreateAdjThunkARCH sp p callconv + return a + -- Unpack strings generated by the Hugs code generator. -- Strings can contain \0 provided they're coded right. -- diff --git a/ghc/interpreter/link.c b/ghc/interpreter/link.c index 7b83a99..456adf2 100644 --- a/ghc/interpreter/link.c +++ b/ghc/interpreter/link.c @@ -9,8 +9,8 @@ * included in the distribution. * * $RCSfile: link.c,v $ - * $Revision: 1.29 $ - * $Date: 2000/01/10 16:27:04 $ + * $Revision: 1.30 $ + * $Date: 2000/01/10 17:06:41 $ * ------------------------------------------------------------------------*/ #include "prelude.h" @@ -439,7 +439,7 @@ Void linkPreludeNames(void) { /* Hook to names defined in Prelude */ setCurrModule(modulePrelude); /* primops */ - nameMkIO = linkName("hugsprimMkIO"); + nameMkIO = linkName("primMkIO"); for (i=0; asmPrimOps[i].name; ++i) { Text t = findText(asmPrimOps[i].name); Name n = findName(t); @@ -470,7 +470,7 @@ Void linkPreludeNames(void) { /* Hook to names defined in Prelude */ # endif /* translator */ nameEqChar = linkName("primEqChar"); - nameCreateAdjThunk = linkName("hugsprimCreateAdjThunk"); + nameCreateAdjThunk = linkName("primCreateAdjThunk"); namePmInt = linkName("hugsprimPmInt"); namePmInteger = linkName("hugsprimPmInteger"); namePmDouble = linkName("primPmDouble"); diff --git a/ghc/interpreter/storage.c b/ghc/interpreter/storage.c index a302cb7..2bc407b 100644 --- a/ghc/interpreter/storage.c +++ b/ghc/interpreter/storage.c @@ -9,8 +9,8 @@ * included in the distribution. * * $RCSfile: storage.c,v $ - * $Revision: 1.34 $ - * $Date: 2000/01/10 16:23:33 $ + * $Revision: 1.35 $ + * $Date: 2000/01/10 17:06:41 $ * ------------------------------------------------------------------------*/ #include "prelude.h" diff --git a/ghc/lib/hugs/Prelude.hs b/ghc/lib/hugs/Prelude.hs index ce05049..df4613c 100644 --- a/ghc/lib/hugs/Prelude.hs +++ b/ghc/lib/hugs/Prelude.hs @@ -1545,6 +1545,9 @@ readFloat r = [(fromRational ((n%1)*10^^(k-d)),t) | (n,d,s) <- readFix r, -- Hooks for primitives: ----------------------------------------------------- -- Do not mess with these! +-- Anything named hugsprim needs to also be available in combined mode, +-- so any such function is also present in ghc/lib/std/PrelHugs.lhs. + primCompAux :: Ord a => a -> a -> Ordering -> Ordering primCompAux x y o = case compare x y of EQ -> o; LT -> LT; GT -> GT @@ -1557,21 +1560,6 @@ hugsprimPmInteger n x = fromInteger n == x primPmDouble :: Fractional a => Double -> a -> Bool primPmDouble n x = fromDouble n == x --- ToDo: make the message more informative. -primPmFail :: a -primPmFail = error "Pattern Match Failure" - --- used in desugaring Foreign functions -hugsprimMkIO :: (RealWorld -> (a,RealWorld)) -> IO a -hugsprimMkIO = ST - -hugsprimCreateAdjThunk :: (a -> b) -> String -> Char -> IO Addr -hugsprimCreateAdjThunk fun typestr callconv - = do sp <- makeStablePtr fun - p <- copy_String_to_cstring typestr -- is never freed - a <- primCreateAdjThunkARCH sp p callconv - return a - -- The following primitives are only needed if (n+k) patterns are enabled: hugsprimPmSub :: Integral a => Int -> a -> a hugsprimPmSub n x = x - fromInt n @@ -1585,6 +1573,21 @@ hugsprimPmSubtract x y = x - y hugsprimPmLe :: Integral a => a -> a -> Bool hugsprimPmLe x y = x <= y +-- ToDo: make the message more informative. +primPmFail :: a +primPmFail = error "Pattern Match Failure" + +-- used in desugaring Foreign functions +primMkIO :: (RealWorld -> (a,RealWorld)) -> IO a +primMkIO = ST + +primCreateAdjThunk :: (a -> b) -> String -> Char -> IO Addr +primCreateAdjThunk fun typestr callconv + = do sp <- makeStablePtr fun + p <- copy_String_to_cstring typestr -- is never freed + a <- primCreateAdjThunkARCH sp p callconv + return a + -- Unpack strings generated by the Hugs code generator. -- Strings can contain \0 provided they're coded right. --