projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Refactor gcc.c, pulling out the reusable code
[ghc-hetmet.git]
/
utils
/
genprimopcode
/
Main.hs
diff --git
a/utils/genprimopcode/Main.hs
b/utils/genprimopcode/Main.hs
index
9a80a50
..
2f7a287
100644
(file)
--- a/
utils/genprimopcode/Main.hs
+++ b/
utils/genprimopcode/Main.hs
@@
-8,7
+8,6
@@
module Main where
import Parser
import Syntax
import Parser
import Syntax
-import Monad
import Char
import List
import System ( getArgs )
import Char
import List
import System ( getArgs )
@@
-125,6
+124,8
@@
gen_hs_source (Info defaults entries) =
++ "-- Portability : non-portable (GHC extensions)\n"
++ "--\n"
++ "-- GHC\'s primitive types and operations.\n"
++ "-- Portability : non-portable (GHC extensions)\n"
++ "--\n"
++ "-- GHC\'s primitive types and operations.\n"
+ ++ "-- Use GHC.Exts from the base package instead of importing this\n"
+ ++ "-- module directly.\n"
++ "--\n"
++ "-----------------------------------------------------------------------------\n"
++ "module GHC.Prim (\n"
++ "--\n"
++ "-----------------------------------------------------------------------------\n"
++ "module GHC.Prim (\n"
@@
-661,8
+662,7
@@
ppType (TyApp "MVar#" [x,y]) = "mkMVarPrimTy " ++ ppType x
++ " " ++ ppType y
ppType (TyApp "TVar#" [x,y]) = "mkTVarPrimTy " ++ ppType x
++ " " ++ ppType y
++ " " ++ ppType y
ppType (TyApp "TVar#" [x,y]) = "mkTVarPrimTy " ++ ppType x
++ " " ++ ppType y
-ppType (TyUTup ts) = "(mkTupleTy Unboxed " ++ show (length ts)
- ++ " "
+ppType (TyUTup ts) = "(mkTupleTy Unboxed "
++ listify (map ppType ts) ++ ")"
ppType (TyF s d) = "(mkFunTy (" ++ ppType s ++ ") (" ++ ppType d ++ "))"
++ listify (map ppType ts) ++ ")"
ppType (TyF s d) = "(mkFunTy (" ++ ppType s ++ ") (" ++ ppType d ++ "))"